From 6a232ec3d1d75af66b5afb475895d585a494cbaf Mon Sep 17 00:00:00 2001 From: yangan <yangan0921@163.com> Date: 星期六, 29 六月 2024 16:24:35 +0800 Subject: [PATCH] feat:小程序修改问题若干 --- pages/driver-page/driver-index/bill-of-lading-details/originInfo/originInfo.vue | 130 ++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 120 insertions(+), 10 deletions(-) diff --git a/pages/driver-page/driver-index/bill-of-lading-details/originInfo/originInfo.vue b/pages/driver-page/driver-index/bill-of-lading-details/originInfo/originInfo.vue index 07111fb..bce5c84 100644 --- a/pages/driver-page/driver-index/bill-of-lading-details/originInfo/originInfo.vue +++ b/pages/driver-page/driver-index/bill-of-lading-details/originInfo/originInfo.vue @@ -10,6 +10,8 @@ label-width="160" :label-style="{'marginLeft':'9px'}" ref="originInfoRef"> + <!-- 澶栬喘---isweight === 1 绉伴噸 鐨瘺鍑� --> + <view v-if="isWeight"> <u-form-item prop="coalContactSkin"> <view class="second-line"> <view class="label-text" @@ -56,7 +58,47 @@ <view class="unit">鍚�</view> </view> </u-form-item> - <u-form-item prop='contactPicture'> + + </view> + <view v-else class="table-div"> + <uni-table + border + id="table-box" + emptyText="鏆傛棤鏇村鏁版嵁"> + <uni-tr> + <uni-th align="center" >浜у搧</uni-th> + <!-- <uni-th align="center">鐨噸</uni-th> + <uni-th align="center">姣涢噸</uni-th> + <uni-th align="center">鍑�閲�</uni-th> --> + <uni-th align="center">鏁伴噺</uni-th> + </uni-tr> + <uni-tr v-for="(subItem, index) in coalData.tmTaskCoalList" :key="index"> + <uni-td align="center"> + <view class="name">{{ subItem.productName }}</view></uni-td> + <!-- <uni-td align='right'> + <view v-if="subItem.skin">{{ Number( subItem.skin).toFixed(2) || ''}}</view> + </uni-td> + <uni-td align='right'> + <view class="name" v-if="subItem.hair">{{ Number(subItem.hair) .toFixed(2) || '' }}</view> + </uni-td> + <uni-td align='right'> + <view class="name" v-if="subItem.clean">{{ Number( subItem.clean).toFixed(2) || '' }}</view> + </uni-td> --> + + 聽 <uni-td align="right"> + <view> + <u--input + placeholder="璇疯緭鍏ヤ骇鍝佹暟閲�" + type='number' + v-model="subItem.productQuantity" + ></u--input> + </view></uni-td> + + </uni-tr> + </uni-table> + </view> + + <u-form-item prop='contactPicture'> <view class="label-text"> <text style="color: #f56c6c;">*</text>鍘熷彂纾呭崟 </view> @@ -70,6 +112,7 @@ height="150" :previewFullImage="true"></u-upload> </u-form-item> + </u-form> <view class="submit-button"> <view class=""> @@ -82,7 +125,8 @@ <u-button text="鎻愪氦淇℃伅" type="primary" @click.stop="submitOriginInfo" - :loading="submitOriginInfoLoading"></u-button> + :loading="submitOriginInfoLoading" + :disabled="!coalContactClean"></u-button> </view> </view> </view> @@ -104,6 +148,7 @@ orderPlanId: "", // 鑱氱劍鏃舵敼鍙樻牱寮� isfocus1: false, + tmTaskCoalList:[], isfocus2: false, // 杈撳叆鐨勫師鍙戜俊鎭� originInfoForm: { @@ -119,14 +164,31 @@ sendDate: '', deptId: '', filedId: '', - isSpecial: null + isSpecial: null, + isWeight:null, } }, computed: { coalContactClean() { - let xx = BigNumber(this.originInfoForm.coalContactHair ? this.originInfoForm.coalContactHair : 0) - let yy = BigNumber(this.originInfoForm.coalContactSkin ? this.originInfoForm.coalContactSkin : 0) - return xx.minus(yy).toNumber() > 0 ? xx.minus(yy).toNumber().toFixed(2) : 0 + if(this.isWeight){ + let xx = BigNumber(this.originInfoForm.coalContactHair ? this.originInfoForm.coalContactHair : 0) + let yy = BigNumber(this.originInfoForm.coalContactSkin ? this.originInfoForm.coalContactSkin : 0) + return xx.minus(yy).toNumber() > 0 ? xx.minus(yy).toNumber().toFixed(2) : 0 + }else{ + //鏁伴噺 + if(!this.coalData.tmTaskCoalList.length){ + return false + }else{ + const reslut = this.coalData.tmTaskCoalList.find(item=>!item.productQuantity); + console.log(reslut); + if(reslut){ + return false + }else{ + return true + } + } + } + }, }, onLoad(params) { @@ -134,8 +196,9 @@ this.sendDate = params.sendDate || '' this.deptId = params.deptId || '' this.filedId = params.filedId || '' - this.isSpecial = Number(params.isSpecial) - console.log(params.isSpecial, typeof params.isSpecial); + this.isSpecial = Number(params.isSpecial); + this.isWeight = Number(params.isWeight) + console.log(params.isSpecial, typeof params.isSpecial,params,'paramssssss'); this.getTakeCoal() }, methods: { @@ -235,7 +298,9 @@ taskCoalCode: this.coalData.code, carNo: this.coalData.carNo, } - if (this.originInfoForm.coalContactSkin && this.originInfoForm.coalContactHair && this + //绉伴噸 + if(this.isWeight){ + if (this.originInfoForm.coalContactSkin && this.originInfoForm.coalContactHair && this .originInfoForm .contactPicture) { this.submitOriginInfoLoading = true @@ -256,6 +321,43 @@ } else { uni.$u.toast('璇峰~鍐欏畬鏁村師鍙戜俊鎭�') } + }else{ + //鏁伴噺 + form.numDtoList = this.coalData.tmTaskCoalList.map(item=>{ + let obj = { + tmId:item.id, + num:Number(item.productQuantity) + } + return obj; + }); + //鍒犻櫎鐨瘺鍑� + delete form.clean; + delete form.hair; + delete form.skin; + if (this.coalContactClean && this + .originInfoForm + .contactPicture) { + this.submitOriginInfoLoading = true; + console.log(form,'form') + this.$reqPost('appSaveContact', form, 'json').then(res => { + if (res.code === 0) { + this.$u.toast('鎻愪氦鎴愬姛') + this.submitOriginInfoLoading = false + setTimeout(() => { + uni.navigateTo({ + url: `/pages/driver-page/appointment/appointment?takeCoalId=${this.orderPlanId}&filedId=${this.filedId}&deptId=${this.deptId}&sendDate=${this.sendDate}` + }); + }, 1500) + } else { + this.submitOriginInfoLoading = false + this.$u.toast(res.msg ? res.msg : '鎻愪氦澶辫触') + } + }) + } else { + uni.$u.toast('璇峰~鍐欏畬鏁村師鍙戜俊鎭�') + } + } + } } } @@ -263,6 +365,14 @@ <style lang="scss" scoped> + .table-div{ + /deep/ .uni-table{ + width: 95%; + min-width: 0!important; + margin-left: 20rpx; + } + + } /deep/.u-button { font-size: 28rpx; font-weight: 300; @@ -303,7 +413,7 @@ .origin-info_content { width: 100%; height: 100%; - overflow-y: scroll; + // overflow-y: scroll; .first-line, .second-line { -- Gitblit v1.9.1