| | |
| | | <u-form labelPosition="left" :model="info" :rules="rules" ref="form" labelWidth="100" |
| | | :labelStyle="{fontSize:'28rpx'}"> |
| | | <view class="content"> |
| | | |
| | | <u-form-item label="对象电话" prop="transactionObjectTel" borderBottom required> |
| | | <u-input v-model="info.transactionObjectTel" border="none" placeholder="请输入" placeholderClass="f-28 c-99" |
| | | inputAlign="right"></u-input> |
| | | <u-form-item label="对象电话" prop="transactionObjectTel" borderBottom required> |
| | | <u-input v-model="info.transactionObjectTel" border="none" placeholder="请输入" |
| | | placeholderClass="f-28 c-99" inputAlign="right"></u-input> |
| | | </u-form-item> |
| | | <u-form-item label="交易金额" prop="transactionMoney" borderBottom required> |
| | | <u-input v-model="info.transactionMoney" disabled disabledColor="#fff" border="none" placeholder="请输入" placeholderClass="f-28 c-99" |
| | | inputAlign="right"></u-input> |
| | | <u-form-item label="交易金额" prop="transactionMoney" borderBottom required> |
| | | <u-input v-model="info.transactionMoney" border="none" placeholder="请输入" |
| | | placeholderClass="f-28 c-99" inputAlign="right"></u-input> |
| | | </u-form-item> |
| | | <u-form-item label="物品数量" prop="goodsNums" borderBottom required> |
| | | <u-input v-model="info.goodsNums" type="number" border="none" placeholder="请输入" placeholderClass="f-28 c-99" |
| | | inputAlign="right"></u-input> |
| | | <u-form-item label="物品数量" prop="goodsNums" borderBottom required> |
| | | <u-input v-model="info.goodsNums" type="number" border="none" placeholder="请输入" |
| | | placeholderClass="f-28 c-99" inputAlign="right"></u-input> |
| | | </u-form-item> |
| | | |
| | | <u-form-item label="交易位置" prop="location" borderBottom ref="location" required> |
| | | <u-input v-model="info.location" border="none" placeholder="请输入" placeholderClass="f-28 c-99" |
| | | <u-input v-model="info.location" border="none" placeholder="请输入" placeholderClass="f-28 c-99" |
| | | inputAlign="right"></u-input> |
| | | </u-form-item> |
| | | <u-form-item label="交易过程" prop="transactionProcess" borderBottom> |
| | | <u-input v-model="info.transactionProcess" border="none" placeholder="请输入" placeholderClass="f-28 c-99" |
| | | inputAlign="right"></u-input> |
| | | <u-input v-model="info.transactionProcess" border="none" placeholder="请输入" |
| | | placeholderClass="f-28 c-99" inputAlign="right"></u-input> |
| | | </u-form-item> |
| | | </view> |
| | | |
| | |
| | | <view class="mt-20"> |
| | | <u-upload :fileList="imageUrls" :previewFullImage="uploadConfig.previewFullImage" |
| | | :accept="uploadConfig.acceptImg" :multiple="uploadConfig.multiple" |
| | | :maxCount="uploadConfig.maxCount" :capture="uploadConfig.capture" @afterRead="afterReadImgs($event,'imageUrls')" |
| | | @delete="deletePic"> |
| | | :maxCount="uploadConfig.maxCount" :capture="uploadConfig.capture" |
| | | @afterRead="afterReadImgs($event,'imageUrls')" @delete="deletePic"> |
| | | <view class="upload-item upload-icon flex_base"> |
| | | <u-icon name="/static/icon/upload.png" width="60rpx" height="60rpx"></u-icon> |
| | | </view> |
| | |
| | | <view class="mt-20"> |
| | | <u-upload :fileList="goodsImageUrls" :previewFullImage="uploadConfig.previewFullImage" |
| | | :accept="uploadConfig.acceptImg" :multiple="uploadConfig.multiple" |
| | | :maxCount="uploadConfig.maxCount" :capture="uploadConfig.capture" @afterRead="afterReadImgs($event,'goodsImageUrls')" |
| | | @delete="deletePic"> |
| | | :maxCount="uploadConfig.maxCount" :capture="uploadConfig.capture" |
| | | @afterRead="afterReadImgs($event,'goodsImageUrls')" @delete="deletePic"> |
| | | <view class="upload-item upload-icon flex_base"> |
| | | <u-icon name="/static/icon/upload.png" width="60rpx" height="60rpx"></u-icon> |
| | | </view> |
| | |
| | | </u-form> |
| | | |
| | | <button class="submit-btn" @click="sumitInfo">提交</button> |
| | | <!-- <button class="list-btn" @click="navigatorPage">我上报的事件</button> --> |
| | | <button class="list-btn" @click="navigatorPage">我上报的事件</button> |
| | | </view> |
| | | </template> |
| | | |
| | |
| | | } from "@/api/reporting/reporting"; |
| | | export default { |
| | | mixins: [uploadMixin], |
| | | data(){ |
| | | return{ |
| | | data() { |
| | | return { |
| | | info: { |
| | | transactionObjectTel:"", |
| | | transactionMoney:"", |
| | | goodsNums:"", |
| | | location:"", |
| | | transactionProcess:"", |
| | | districtId:"", |
| | | districtName:"", |
| | | userId:"" |
| | | transactionObjectTel: "", |
| | | transactionMoney: "", |
| | | goodsNums: "", |
| | | location: "", |
| | | transactionProcess: "", |
| | | houseCode: "", |
| | | districtName: "", |
| | | userId: "" |
| | | }, |
| | | rules: { |
| | | 'transactionObjectTel': { |
| | |
| | | message: '请输入对象电话', |
| | | trigger: ['blur', 'change'] |
| | | }, |
| | | |
| | | |
| | | 'transactionMoney': { |
| | | type: 'string', |
| | | required: true, |
| | | message: '请输入交易金额', |
| | | trigger: ['blur', 'change'] |
| | | }, |
| | | 'location':{ |
| | | 'location': { |
| | | type: 'string', |
| | | required: true, |
| | | message: '请输入交易位置', |
| | | trigger: ['blur', 'change'] |
| | | }, |
| | | 'transactionProcess':{ |
| | | 'transactionProcess': { |
| | | type: 'string', |
| | | required: false, |
| | | message: '请输入交易过程', |
| | | trigger: ['blur', 'change'] |
| | | } |
| | | }, |
| | | imageUrls:[], |
| | | goodsImageUrls:[] |
| | | imageUrls: [], |
| | | goodsImageUrls: [], |
| | | eventType:1 |
| | | } |
| | | }, |
| | | onLoad(option) { |
| | | if(option.type != 1){ |
| | | uni.setNavigationBarTitle({title:this.setTitle(option.type)}) |
| | | if (option.type != 1) { |
| | | this.eventType = option.type; |
| | | uni.setNavigationBarTitle({ |
| | | title: this.setTitle(option.type) |
| | | }) |
| | | } |
| | | this.$set(this.info,"eventType",option.type); |
| | | this.$set(this.info, "eventType", option.type); |
| | | let siteInfo = uni.getStorageSync("siteInfo"); |
| | | let userInfo = uni.getStorageSync("userInfo"); |
| | | this.$set(this.info, "houseCode", siteInfo.id); |
| | | this.$set(this.info, "districtName", siteInfo.name); |
| | | this.$set(this.info, "userId", userInfo.user_id); |
| | | }, |
| | | methods:{ |
| | | setTitle(type){ |
| | | if(type == 2){ |
| | | methods: { |
| | | setTitle(type) { |
| | | if (type == 2) { |
| | | return "二手车交易" |
| | | }else if (type == 3){ |
| | | } else if (type == 3) { |
| | | return "二手手机维修" |
| | | } |
| | | }, |
| | | |
| | | |
| | | |
| | | |
| | | confirmDate(e) { |
| | | console.log(e); |
| | | this.showSelectDate = false; |
| | | this.info.checkTime = uni.$u.timeFormat(e.value, 'yyyy-mm-dd hh:MM') |
| | | }, |
| | | |
| | | |
| | | async afterReadImgs(event, key) { |
| | | this.showLoading() |
| | | let lists = [].concat(event.file) |
| | |
| | | } |
| | | this.loadingClose() |
| | | }, |
| | | |
| | | |
| | | checkImages() { |
| | | if (this.imageUrls.length) { |
| | | this.$set(this.info,"imageUrls",this.setImages(this.imageUrls)) |
| | | this.$set(this.info, "imageUrls", this.setImages(this.imageUrls)) |
| | | } |
| | | if (this.goodsImageUrls.length) { |
| | | this.$set(this.info,"goodsImageUrls",this.setImages(this.goodsImageUrls)) |
| | | this.$set(this.info, "goodsImageUrls", this.setImages(this.goodsImageUrls)) |
| | | } |
| | | |
| | | |
| | | }, |
| | | |
| | | setImages(key){ |
| | | |
| | | setImages(key) { |
| | | let urls = []; |
| | | for(let i of key){ |
| | | for (let i of key) { |
| | | urls.push(i.url); |
| | | } |
| | | return urls.join(",") |
| | | return urls.join(",") |
| | | }, |
| | | |
| | | |
| | | sumitInfo() { |
| | | this.$refs.info.validate().then(valid => { |
| | | this.$refs.form.validate().then(valid => { |
| | | this.checkImages() |
| | | saveLabelReporting(this.info).then(res => { |
| | | uni.showToast({ |
| | |
| | | title: '提交成功', |
| | | success() { |
| | | setTimeout(() => { |
| | | that.$u.func.globalNavigator("", "navBack") |
| | | uni.navigateBack() |
| | | // this.$u.func.globalNavigator("", "navBack") |
| | | }, 1000) |
| | | } |
| | | }) |
| | | }) |
| | | }) |
| | | }, |
| | | // navigatorPage() { |
| | | // let url = "/subPackage/bs/views/repairList" + "?title=" + this.title + "&type=" + this.info.type |
| | | // this.$u.func.globalNavigator(url, "navTo") |
| | | // } |
| | | navigatorPage() { |
| | | this.$u.func.globalNavigator(`formList?type=${this.eventType}`, "navTo") |
| | | } |
| | | } |
| | | } |
| | | </script> |