| | |
| | | <template> |
| | | <view class=""> |
| | | |
| | | |
| | | <view class="top item flex j-c-s-b a-i-c bgc-ff" @click="onScan()" v-if="roleName =='mj'"> |
| | | <view class="flex a-i-c"> |
| | | <u-icon name="/static/icon/nav-05.png" width="90rpx" height="90rpx"></u-icon> |
| | | <text class="f-28 ml-10">扫码获取信息</text> |
| | | </view> |
| | | <u-icon name="arrow-right" size="20"></u-icon> |
| | | </view> |
| | | |
| | | <view class="content bgc-ff"> |
| | | <u-form labelPosition="left" :model="info" :rules="rules" ref="form" labelWidth="90" |
| | | :labelStyle="{fontSize:'28rpx'}"> |
| | | <u-form-item label="家长姓名" prop="name" borderBottom ref="name"> |
| | | |
| | | <u-form-item label="角色类型" prop="type" borderBottom ref="phone" @click="showPicker = true" |
| | | v-if="roleName !='mj'"> |
| | | <u-input v-model="clockInRoleTypeValue" border="none" placeholder="请输入" placeholderClass="f-28 c-99" |
| | | inputAlign="right" disabled disabledColor="#ffffff"></u-input> |
| | | <u-icon slot="right" name="arrow-right"></u-icon> |
| | | </u-form-item> |
| | | |
| | | <u-form-item label="家长姓名" prop="name" borderBottom ref="name" v-if="info.type == 2"> |
| | | <u-input v-model="info.name" border="none" placeholder="请输入" placeholderClass="f-28 c-99" |
| | | inputAlign="right"></u-input> |
| | | </u-form-item> |
| | | |
| | | <u-form-item label="家长手机号" prop="phone" borderBottom ref="phone"> |
| | | <u-form-item label="家长手机号" prop="phone" borderBottom ref="phone" v-if="info.type == 2"> |
| | | <u-input v-model="info.phone" border="none" placeholder="请输入" placeholderClass="f-28 c-99" |
| | | inputAlign="right"></u-input> |
| | | </u-form-item> |
| | | <u-form-item label="学生姓名" prop="realName" borderBottom ref="realName"> |
| | | <u-form-item label="学生姓名" prop="realName" borderBottom ref="realName" v-if="info.type != 2"> |
| | | <u-input v-model="info.realName" border="none" placeholder="请输入" placeholderClass="f-28 c-99" |
| | | inputAlign="right"></u-input> |
| | | </u-form-item> |
| | | <u-form-item label="学生班级" prop="gradeAndClass" borderBottom ref="gradeAndClass"> |
| | | <u-form-item label="学生班级" prop="gradeAndClass" borderBottom ref="gradeAndClass" v-if="info.type != 2"> |
| | | <u-input v-model="info.gradeAndClass" border="none" placeholder="请输入" placeholderClass="f-28 c-99" |
| | | inputAlign="right"></u-input> |
| | | </u-form-item> |
| | |
| | | </view> |
| | | |
| | | |
| | | <button class="submit-btn" @click="sumitInfo">提交</button> |
| | | <!-- <button class="submit-btn" @click="sumitInfo">提交</button> --> |
| | | <!-- <button class="list-btn" @click="navigatorPage">我上报的事件</button> --> |
| | | |
| | | <footer-btn @click="sumitInfo"></footer-btn> |
| | | |
| | | |
| | | <u-picker :defaultIndex="clockInRoleTypeIndex" :closeOnClickOverlay="true" :show="showPicker" |
| | | :columns="[statusList]" @close="showPicker = false" @cancel="showPicker = false" keyName="name" |
| | | @confirm="confirmPicker"></u-picker> |
| | | |
| | | |
| | | |
| | | |
| | | </view> |
| | | </template> |
| | |
| | | import { |
| | | addClockIn |
| | | } from "@/api/school/school.js"; |
| | | |
| | | |
| | | import { |
| | | getQrCodeDetail |
| | | } from "@/api/system/index" |
| | | export default { |
| | | mixins: [uploadMixin], |
| | | data() { |
| | | return { |
| | | info: { |
| | | type: "", |
| | | name: "", |
| | | phone: "", |
| | | location: "", |
| | | gradeAndClass: "", |
| | | lat: "", |
| | | lng: "" |
| | | lng: "", |
| | | houseCode: "" |
| | | }, |
| | | rules: { |
| | | 'name': { |
| | |
| | | }, |
| | | desc: "", |
| | | title: "", |
| | | curSelectSite: {} |
| | | curSelectSite: {}, |
| | | statusList: [{ |
| | | name: "家长", |
| | | id: 2 |
| | | }, |
| | | { |
| | | name: "老师", |
| | | id: 3 |
| | | }, |
| | | |
| | | { |
| | | name: "志愿者", |
| | | id: 4 |
| | | } |
| | | ], |
| | | clockInRoleTypeList: [], |
| | | clockInRoleTypeIndex: [0], |
| | | clockInRoleTypeValue: "", |
| | | showPicker: false, |
| | | roleName: "" |
| | | } |
| | | }, |
| | | onLoad(option) { |
| | | if (option.type) { |
| | | this.info.type = option.type |
| | | } |
| | | |
| | | let { |
| | | roleAlias |
| | | } = uni.getStorageSync("activeRole"); |
| | | this.roleName = roleAlias |
| | | if (roleAlias == "mj") { |
| | | this.info.type = 1; |
| | | } else { |
| | | this.info.houseCode = uni.getStorageSync("siteInfo").houseCode; |
| | | } |
| | | |
| | | }, |
| | | // onShow() { |
| | |
| | | // this.info.addressCode = this.curSelectSite.houseCode |
| | | // }, |
| | | methods: { |
| | | |
| | | |
| | | getLocation() { |
| | | uni.chooseLocation({ |
| | |
| | | |
| | | |
| | | sumitInfo() { |
| | | |
| | | this.$refs.form.validate().then(valid => { |
| | | if (this.form.images.length > 0) { |
| | | let urls = [] |
| | |
| | | }) |
| | | this.info.images = urls.join(",") |
| | | } |
| | | |
| | | addClockIn(this.info).then(res => { |
| | | this.$showTips("提交成功", "success") |
| | | setTimeout(() => { |
| | |
| | | }) |
| | | }) |
| | | }, |
| | | |
| | | //选择隐患类型 |
| | | confirmPicker(e) { |
| | | this.clockInRoleTypeIndex = e.indexs; |
| | | this.clockInRoleTypeValue = e.value[0].name; |
| | | this.info.type = e.value[0].value; |
| | | this.showPicker = false; |
| | | }, |
| | | |
| | | |
| | | navigatorPage() { |
| | | let url = "/subPackage/bs/views/repairList" + "?title=" + this.title + "&type=" + this.info.type |
| | | this.$u.func.globalNavigator(url, "navTo") |
| | | } |
| | | }, |
| | | |
| | | |
| | | onScan() { |
| | | uni.scanCode({ |
| | | success: (res) => { |
| | | let obj = this.getUrlParams(res.result); |
| | | this.getHouseType(obj.stdId); |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | getUrlParams(url) { |
| | | let urlStr = url.split('?')[1] |
| | | let obj = {}; |
| | | let paramsArr = urlStr.split('&') |
| | | for (let i = 0, len = paramsArr.length; i < len; i++) { |
| | | let arr = paramsArr[i].split('=') |
| | | obj[arr[0]] = arr[1]; |
| | | } |
| | | return obj |
| | | }, |
| | | |
| | | getHouseType(code) { |
| | | getQrCodeDetail({ |
| | | roleName: uni.getStorageSync("activeRole").roleName, |
| | | addressCode: code |
| | | }).then(res => { |
| | | let { |
| | | isJur, |
| | | doorplateType, |
| | | addressLevel |
| | | } = res.data; |
| | | if (isJur == 1) { |
| | | if (doorplateType == "中门牌" || doorplateType == "小门牌") { |
| | | this.info.houseCode = code; |
| | | } |
| | | } else { |
| | | uni.showModal({ |
| | | title: "提示!", |
| | | content: "该区域不是您管辖范围", |
| | | showCancel: false |
| | | }) |
| | | } |
| | | |
| | | }) |
| | | }, |
| | | |
| | | |
| | | |
| | | } |
| | | } |
| | | </script> |
| | |
| | | background-color: #F5F5F5; |
| | | } |
| | | |
| | | .top { |
| | | padding: 20rpx; |
| | | margin: 20rpx 30rpx 0; |
| | | } |
| | | |
| | | .content { |
| | | margin: 20rpx 30rpx; |
| | | padding: 0 30rpx; |