From 32b10def2b0944c4afbe4d89e55261c39a690f1d Mon Sep 17 00:00:00 2001 From: zjj <3272660260@qq.com> Date: 星期四, 17 七月 2025 13:40:09 +0800 Subject: [PATCH] # --- pages/rece/other.vue | 49 ++++++++++++++++++++++++++++--------------------- 1 files changed, 28 insertions(+), 21 deletions(-) diff --git a/pages/rece/other.vue b/pages/rece/other.vue index adcded2..0d7bdd3 100644 --- a/pages/rece/other.vue +++ b/pages/rece/other.vue @@ -3,7 +3,7 @@ <form> <view class="cu-form-group margin-top" v-show="!isconfirm"> <view class="title">ASN鍗曞彿</view> - <input placeholder="璇锋壂鎻廇SN鍗曞彿" v-model="asncode" @input="search" focus></input> + <input placeholder="璇锋壂鎻廇SN鍗曞彿" v-model="asncode" focus></input> <text class='cuIcon-close text-gray margin-right-xs' v-show="asncode!==''" @click="clearCode"></text> <!-- <text class='cuIcon-search text-blue' @click="search"></text> --> </view> @@ -81,9 +81,9 @@ <view class="content"> <text class="text-black">閲囪喘鍗曚綅:<text class="text-grey ">{{item.purUnit}}</text></text> </view> - <view class="content"> + <!-- <view class="content"> <text class="text-black">搴撳瓨鍗曚綅: <text class="text-grey ">{{item.stockUnit}}</text></text> - </view> + </view> --> </view> <view class="cu-item"> <view class="content"> @@ -108,8 +108,8 @@ </view> </view> <view class="cu-item"> - - <view class="content" > + + <view class="content"> <text class="text-black">鎵规:<text class="text-grey ">{{item.splrBatch}}</text></text> </view> </view> @@ -130,18 +130,18 @@ <text class="text-black">鐢熶骇鏃ユ湡:<text class="text-grey ">{{item.prodTime}}</text></text> </view> </view> - <view class="cu-item grid col-1" v-if="!isconfirm"> + <!-- <view class="cu-item grid col-1" v-if="!isconfirm"> <view v-for="el in dynamicFields" :key="el.id"> <view class="cu-form-group padding-lr-0"> <view class="title text-blue">{{el.fieldsAlise}}:</view> <input :placeholder='`璇疯緭鍏�${el.fieldsAlise}`' v-model="item[el.fields]"></input> </view> </view> - </view> - <view class="cu-item grid col-2" v-if="isconfirm"> + </view> --> + <view class="cu-item grid col-2" v-if="item.extendFields"> <view class="item" v-for="el in dynamicFields" :key="el.id"> <text class="text-black">{{el.fieldsAlise}}: - <text class="text-grey ">{{item[el.fields]}}</text></text> + <text class="text-grey ">{{item.extendFields[el.fields]}}</text></text> </view> </view> </view> @@ -155,8 +155,8 @@ <view class="cu-form-group margin-bottom"> <view class="title">鏀惰揣鍖�</view> <view style="width: 80%;"> - <uni-data-select style="min-width: 90%; max-width: 90%;" v-model="whAreaId" :localdata="range" placement="top" - @change="selChange"></uni-data-select> + <uni-data-select style="min-width: 90%; max-width: 90%;" v-model="whAreaId" :localdata="range" + placement="top" @change="selChange"></uni-data-select> </view> </view> @@ -197,16 +197,17 @@ } }, computed: { - ...mapState('user', ['dynamicFields']), - + ...mapState('user', ['dynamicFields']), + ...mapState('user', { + dynFields: state => state.dynamicFields + }), allCount() { return this.list.reduce((acc, row) => +row.receiptQty + acc, 0) } }, mounted() { - this.getRece() - console.log(dynamicFields) + this.getRece() this.whAreaId = uni.getStorageSync('whAreaId') }, methods: { @@ -220,7 +221,7 @@ matnrCode: this.barcode }) if (code === 200) { - this.list = [...data] + this.list = data } else { uni.showToast({ title: msg, @@ -250,6 +251,9 @@ clear() { this.list = [] this.barcode = '' + this.asncode = '' + this.whAreaId = '' + this.range = [] }, next() { if (this.list.length) { @@ -265,8 +269,6 @@ this.isconfirm = false }, selChange(val) { - console.log('-------->') - console.log(val) uni.setStorageSync('whAreaId', val) }, async complete(id) { @@ -296,13 +298,18 @@ title: '璇烽�夋嫨鏀惰揣鍖�' }) } else { + console.log(this.dynFields) const newArr = this.list.map(item => { return { ...item, - receiptQty: item.receiptQty === null ? 0 : +item.receiptQty + receiptQty: item.receiptQty === null ? 0 : +item.receiptQty, + // extendFields: this.dynFields.filter(el => el.unique == 1).map(exf => { + // return { + // [`${exf.fields}`]: item[exf.fields] + // } + // }).filter(field => Object.values(field)[0] != undefined) }; }).filter(el => el.receiptQty !== 0); - const { code, @@ -329,7 +336,7 @@ } } }, - async getRece() { + async getRece() { const { code, data, -- Gitblit v1.9.1