From 3de2db0492aa472cbb63c44c59b3ac13a47efe25 Mon Sep 17 00:00:00 2001 From: qingyiay <2386314947@qq.com> Date: 星期三, 28 六月 2023 11:11:40 +0800 Subject: [PATCH] 验质界面修改,确认验质修改 --- pages/driver-page/driver-index/bill-of-lading-details/weighDetail/weighDetail.vue | 109 ++++++++++++++++++++++++++++++++++++++---------------- 1 files changed, 76 insertions(+), 33 deletions(-) diff --git a/pages/driver-page/driver-index/bill-of-lading-details/weighDetail/weighDetail.vue b/pages/driver-page/driver-index/bill-of-lading-details/weighDetail/weighDetail.vue index 566490d..0f2d8e6 100644 --- a/pages/driver-page/driver-index/bill-of-lading-details/weighDetail/weighDetail.vue +++ b/pages/driver-page/driver-index/bill-of-lading-details/weighDetail/weighDetail.vue @@ -49,15 +49,9 @@ <u-tag :text="item.level||'璇烽�夋嫨'" plain @click="popoverShow(i)"></u-tag> - </view> - <view class="confirm-button" - v-if='roleType===1'> - <u-button type="primary" - shape="circle" - text="纭" - @click="confirmInput(item)" - :loading="loading" - loading-text="纭"></u-button> + <u-tag :text="item.productName||'璇烽�夋嫨'" + plain + @click="productNamePopoverShow(i)"></u-tag> </view> <view v-if='roleType===1'> <u-picker :show="show" @@ -65,6 +59,23 @@ @cancel='cancel' @confirm='confirm'></u-picker> </view> + <view class=""> + <u-action-sheet :actions="actionsList" + :show="actionShow" + cancelText='鍙栨秷' + :closeOnClickOverlay='true' + @close='productNameClose' + @select="selectClick"></u-action-sheet> + </view> + </view> + <view class="confirm-button" + v-if='roleType===1'> + <u-button type="primary" + shape="circle" + text="纭" + @click="confirmInput" + :loading="loading" + loading-text="纭"></u-button> </view> </view> </template> @@ -85,7 +96,11 @@ ['杞昏川', '涓川', '閲嶈川'] ], level: '璇烽�夋嫨', - selectIndex: null + selectIndex: null, + // 浜у搧鍒楄〃 + actionsList: [], + actionShow: false, + actionIndex: null }; }, computed: { @@ -99,6 +114,7 @@ }, onShow() { this.roleType === 1 ? this.GetOrderPlan() : this.getTakeCoal() + this.getJcProductList() }, methods: { getTakeCoal() { @@ -124,12 +140,6 @@ this.coalDetailsData = res.data; this.showWeigh = this.coalDetailsData[this.index].tmTaskCoalItems ? this.coalDetailsData[ this.index].tmTaskCoalItems : [], - // this.showWeigh = this.showWeigh.map(v => { - // return { - // ...v, - // loading: false - // } - // }) uni.hideLoading(); } else { this.$u.toast('鍔犺浇澶辫触') @@ -137,11 +147,22 @@ } }); }, + getJcProductList() { + this.$reqGet('getJcProductList').then(res => { + if (res.code === 0) { + this.actionsList = res.data.map(v => { + return { + ...v, + name: v.productName + } + }) + } + }) + }, // 杈撳叆鎶樻墸鐜囧悗鐐瑰嚮纭 - confirmInput(item) { + confirmInput() { this.loading = true - console.log(this.coalDetailsData); - this.$reqPost('updateTmTaskCoalItem', this.coalDetailsData[this.index].tmTaskCoalItems, 'json').then( + this.$reqPost('updateTmTaskCoalItem', this.showWeigh, 'json').then( res => { if (res.code == 0) { this.loading = false @@ -154,20 +175,36 @@ }, // 閫夋嫨璐ㄩ噺 popoverShow(i) { - this.show = true - this.selectIndex = i + if (this.roleType === 1) { + this.show = true + this.selectIndex = i + } + }, + // 閫夋嫨浜у搧 + productNamePopoverShow(i) { + if (this.roleType === 1) { + this.actionShow = true + this.actionIndex = i + } }, confirm(e) { this.show = false - this.coalDetailsData[this.index].tmTaskCoalItems[this.selectIndex].level = e.value[0] + this.showWeigh[this.selectIndex].level = e.value[0] }, cancel() { this.show = false }, + productNameClose() { + this.actionShow = false + }, + selectClick(val) { + console.log(this.showWeigh); + this.showWeigh[this.actionIndex].productName = val.productName + this.showWeigh[this.actionIndex].productId = val.id + }, // 鎶樻墸鐜囪緭鍏� discountInputHandle(value, index, clean) { - console.log(value, index); - this.coalDetailsData[this.index].tmTaskCoalItems[index].discountWeight = (Number(value) * clean) / 100 + this.showWeigh[index].discountWeight = (Number(value) * clean) / 100 } }, } @@ -250,7 +287,7 @@ .count-input { width: 70%; - // border-bottom: 1px solid rgb(218, 219, 222); + border-bottom: 1px solid rgb(218, 219, 222); } } @@ -263,19 +300,25 @@ } .level { - width: 120rpx; + width: 40%; margin-top: 30rpx; margin-left: 80rpx; + display: flex; + justify-content: space-between; } - .confirm-button { - position: absolute; - bottom: 10rpx; - right: 10rpx; + } - /deep/ .u-button { - width: 180rpx !important; - } + .confirm-button { + // position: relative; + // bottom: 10rpx; + // right: 10rpx; + width: 100%; + @include flex; + justify-content: center; + + /deep/ .u-button { + width: 180rpx !important; } } } -- Gitblit v1.9.1