| | |
| | | <template> |
| | | <view class=""> |
| | | |
| | | <u-form labelPosition="left" :model="info" :rules="rules" ref="form" labelWidth="100" |
| | | <u-form labelPosition="left" :model="info" :rules="rules" ref="form" labelWidth="120" |
| | | :labelStyle="{fontSize:'28rpx'}"> |
| | | <view class="flex j-c-s-b a-i-c bgc-ff" style="padding:24rpx; margin: 20rpx 30rpx;"> |
| | | <!-- <view class="box-title" style="width:50%;"> |
| | | <box-title title="房东信息"></box-title> |
| | | </view> --> |
| | | <!-- #ifdef MP-WEIXIN --> |
| | | <ocr-navigator @onSuccess="recognizeSuccess($event)" certificateType="idCard" :opposite="false"> |
| | | <view class="recognize-btn flex a-i-c"> |
| | | <u-icon name="scan" color="#fff" size="24"></u-icon> |
| | | <text class="f-26 c-ff" style="margin-left: 10rpx;">身份证信息识别</text> |
| | | </view> |
| | | </ocr-navigator> |
| | | <!-- #endif --> |
| | | </view> |
| | | |
| | | <view class="content"> |
| | | <u-form-item label="场所名称" prop="districtName" borderBottom required> |
| | | <u-input v-model="info.districtName" border="none" placeholder="请输入" placeholderClass="f-28 c-99" |
| | | inputAlign="right"></u-input> |
| | | </u-form-item> |
| | | <u-form-item label="对象电话" prop="transactionObjectTel" borderBottom required> |
| | | <u-input v-model="info.transactionObjectTel" type="number" border="none" placeholder="请输入" |
| | | <u-form-item label="物品名称" prop="transactionObject" borderBottom required> |
| | | <u-input v-model="info.transactionObject" border="none" placeholder="请输入" |
| | | placeholderClass="f-28 c-99" inputAlign="right"></u-input> |
| | | </u-form-item> |
| | | <u-form-item label="请输入交易人姓名" prop="owner" borderBottom required> |
| | | <u-input v-model="info.owner" border="none" placeholder="请输入" placeholderClass="f-28 c-99" |
| | | inputAlign="right"></u-input> |
| | | </u-form-item> |
| | | <u-form-item label="请输入交易人电话" prop="phoneNumber" borderBottom required> |
| | | <u-input v-model="info.phoneNumber" type="number" border="none" placeholder="请输入" |
| | | placeholderClass="f-28 c-99" inputAlign="right"></u-input> |
| | | </u-form-item> |
| | | <u-form-item label="身份证号" prop="idCard" borderBottom required> |
| | | <u-input v-model="info.idCard" type="idcard" border="none" placeholder="请输入" |
| | | placeholderClass="f-28 c-99" inputAlign="right"></u-input> |
| | | </u-form-item> |
| | | <u-form-item label="交易金额" prop="transactionMoney" borderBottom required> |
| | |
| | | getLabelReportingDetail, |
| | | setLabelReporting |
| | | } from "@/api/reporting/reporting"; |
| | | import { |
| | | getPlaceDetail |
| | | } from "@/api/place/place" |
| | | export default { |
| | | mixins: [uploadMixin], |
| | | data() { |
| | | return { |
| | | info: { |
| | | transactionObject: "", |
| | | owner: "", |
| | | phoneNumber: "", |
| | | idCard: "", |
| | | transactionObjectTel: "", |
| | | transactionMoney: "", |
| | | goodsNums: "", |
| | |
| | | reportType: "" |
| | | }, |
| | | rules: { |
| | | 'info.districtName': { |
| | | districtName: { |
| | | required: true, |
| | | message: '请输入场所名称', |
| | | trigger: ['blur', 'change'] |
| | | }, |
| | | 'info.transactionObjectTel': [{ |
| | | transactionObject: { |
| | | required: true, |
| | | message: '请输入物品名称', |
| | | trigger: ['blur', 'change'] |
| | | }, |
| | | owner: { |
| | | required: true, |
| | | message: '请输入交易人姓名', |
| | | trigger: ['blur', 'change'] |
| | | }, |
| | | goodsNums: [{ |
| | | type: 'number', |
| | | required: true, |
| | | message: '请输入物品数量', |
| | | trigger: ['blur', 'change'] |
| | | }], |
| | | phoneNumber: [{ |
| | | type: 'number', |
| | | required: true, |
| | | message: '请输入对象电话', |
| | | message: '请输入交易人手机号', |
| | | trigger: ['blur', 'change'] |
| | | }, |
| | | { |
| | |
| | | trigger: ['change', 'blur'] |
| | | } |
| | | ], |
| | | 'info.transactionMoney': { |
| | | idCard: [{ |
| | | // type: 'string', |
| | | required: false, |
| | | message: '请输入身份证号码', |
| | | trigger: ['change', 'blur'] |
| | | }, |
| | | { |
| | | validator: (rule, value, callback) => { |
| | | // const idCardRegex = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/ |
| | | return uni.$u.test.idCard(value) |
| | | // return idCardRegex.test(value) |
| | | }, |
| | | message: '身份证号码有误', |
| | | trigger: ['change', 'blur'] |
| | | } |
| | | ], |
| | | transactionMoney: { |
| | | required: true, |
| | | message: '请输入交易金额', |
| | | trigger: ['blur', 'change'] |
| | | }, |
| | | 'info.localtion': { |
| | | localtion: { |
| | | type: 'string', |
| | | required: true, |
| | | message: '请输入交易位置', |
| | | trigger: ['blur', 'change'] |
| | | }, |
| | | 'info.transactionProcess': { |
| | | transactionProcess: { |
| | | type: 'string', |
| | | required: false, |
| | | message: '请输入交易过程', |
| | |
| | | } |
| | | }, |
| | | onLoad(option) { |
| | | console.log(option); |
| | | console.log(option, 99999); |
| | | const { |
| | | houseCode |
| | | } = option; |
| | | if (option.id) { |
| | | this.isEdit = true; |
| | | this.id = option.id; |
| | |
| | | let siteInfo = uni.getStorageSync("siteInfo"); |
| | | let userInfo = uni.getStorageSync("userInfo"); |
| | | this.$set(this.info, "houseCode", siteInfo.houseCode); |
| | | // this.$set(this.info, "districtName", siteInfo.name); |
| | | this.$set(this.info, "districtName", siteInfo.name); |
| | | this.$set(this.info, "userId", userInfo.user_id); |
| | | } |
| | | |
| | | if (houseCode) { |
| | | // 获取地址 |
| | | this.getPlaceDetail(houseCode) |
| | | } |
| | | }, |
| | | onReady() { |
| | | //如果需要兼容微信小程序,并且校验规则中含有方法等,只能通过setRules方法设置规则。 |
| | | this.$refs.form.setRules(this.rules) |
| | | }, |
| | | methods: { |
| | | //识别成功 |
| | | recognizeSuccess(e, key) { |
| | | let { |
| | | detail: { |
| | | name, |
| | | id |
| | | } |
| | | } = e; |
| | | |
| | | this.info.owner = name.text; |
| | | this.info.idCard = id.text; |
| | | }, |
| | | |
| | | getPlaceDetail(houseCode) { |
| | | getPlaceDetail({ |
| | | houseCode: houseCode |
| | | }).then(res => { |
| | | if (res.code == 200) { |
| | | let data = res.data; |
| | | this.info.localtion = data.location; |
| | | } |
| | | }) |
| | | }, |
| | | getDetail(id) { |
| | | getLabelReportingDetail({ |
| | | taskId: id |
| | |
| | | background-color: #F5F5F5; |
| | | } |
| | | |
| | | .recognize-btn { |
| | | padding: 12rpx; |
| | | border-radius: 6rpx; |
| | | background-color: #3c9cff; |
| | | margin-left: 30rpx; |
| | | } |
| | | |
| | | .content { |
| | | margin: 20rpx 30rpx; |
| | | padding: 0 30rpx; |