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 | 107 ++++++++++++++++++++++++++++++++--------------------- 1 files changed, 64 insertions(+), 43 deletions(-) diff --git a/pages/rece/other.vue b/pages/rece/other.vue index 3de4a88..0d7bdd3 100644 --- a/pages/rece/other.vue +++ b/pages/rece/other.vue @@ -3,14 +3,15 @@ <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> <view class="cu-form-group" v-show="!isconfirm"> - <view class="title">鐗╂枡鏍囩</view> - <input placeholder="璇锋壂鎻忕墿鏂欐爣绛�" v-model="barcode"></input> - <text class='cuIcon-search text-blue' @click="scrollTo"></text> + <view class="title">鐗╂枡缂栫爜</view> + <input placeholder="璇锋壂鎻忕墿鏂欑紪鐮�" v-model="barcode"></input> + <text class='cuIcon-close text-gray margin-right-xs' v-show="barcode!==''" @click="clearBarcode"></text> + <text class='cuIcon-search text-blue' @click="search"></text> </view> </form> @@ -26,7 +27,8 @@ {{index+1}} </view> <view class="text-blue"> - {{`${item.maktx}`}} + 缂栫爜: + {{`${item.matnr}`}} </view> </view> <view class="action" v-if="!isconfirm"> @@ -37,9 +39,16 @@ <view class="cu-item"> <view class="content"> <text class="text-black">ASN:</text> + <text class="text-grey ">{{item.asnCode}}</text> </view> <view class="action"> - <text class="text-grey ">{{item.asnCode}}</text> + + </view> + </view> + <view class="cu-item"> + <view class="content"> + <text class="text-black">鐗╂枡鍚嶇О:</text> + <text class="text-grey ">{{item.maktx}}</text> </view> </view> @@ -52,17 +61,17 @@ </view> </view> --> - <view class="cu-item"> + <!-- <view class="cu-item"> <view class="content"> <text class="text-black">鏈�澶у簱瀛�: <text class="text-grey ">{{item.maxQty}}</text></text> </view> <view class="content"> <text class="text-black">瀹炴椂搴撳瓨: <text class="text-grey ">{{item.stockQty}}</text></text> </view> - </view> + </view> --> <view class="cu-item"> <view class="content"> - <text class="text-black">骞冲彴琛屽彿: <text class="text-grey ">{{item.platformId}}</text></text> + <text class="text-black">琛屽彿: <text class="text-grey ">{{item.platItemId}}</text></text> </view> <view class="content"> <text class="text-black">璐ㄦ缁撴灉: <text class="text-grey ">{{item.inspect}}</text></text> @@ -72,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"> @@ -90,7 +99,7 @@ <view class="cu-form-group padding-lr-0"> <view class="title text-blue"><text class="text-red text-xl vertical-middle">*</text>鏀惰揣鏁伴噺:</view> - <uni-number-box style="width: 70%;" v-model="item.receiptQty" + <uni-number-box style="width: 70%;" :max="max" v-model="item.receiptQty" :step='1'></uni-number-box> </view> </view> @@ -99,14 +108,9 @@ </view> </view> <view class="cu-item"> - <view class="content" v-if="!isconfirm"> - <view class="cu-form-group padding-lr-0"> - <view class="title text-blue">渚涘簲鍟嗘壒娆�:</view> - <input placeholder="璇疯緭鍏ヤ緵搴斿晢鎵规" v-model="item.splrBatch"></input> - </view> - </view> - <view class="content" v-else> - <text class="text-black">渚涘簲鍟嗘壒娆�:<text class="text-grey ">{{item.splrBatch}}</text></text> + + <view class="content"> + <text class="text-black">鎵规:<text class="text-grey ">{{item.splrBatch}}</text></text> </view> </view> @@ -126,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> @@ -150,8 +154,10 @@ <view class="cu-form-group margin-bottom"> <view class="title">鏀惰揣鍖�</view> - <uni-data-select v-model="whAreaId" :localdata="range" placement="top" - @change="selChange"></uni-data-select> + <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> + </view> </view> <view class="cu-bar btn-group foot" v-show="!isconfirm"> @@ -186,11 +192,15 @@ list: [], range: [], repeatClick: false, - isconfirm: false + isconfirm: false, + max: 99999999, } }, computed: { ...mapState('user', ['dynamicFields']), + ...mapState('user', { + dynFields: state => state.dynamicFields + }), allCount() { return this.list.reduce((acc, row) => +row.receiptQty + acc, 0) } @@ -207,10 +217,11 @@ data, msg } = await request('/orders/other', { - asnCode: this.asncode + asnCode: this.asncode, + matnrCode: this.barcode }) if (code === 200) { - this.list = [...data] + this.list = data } else { uni.showToast({ title: msg, @@ -223,12 +234,16 @@ clearCode() { this.asncode = '' }, + clearBarcode() { + this.barcode = '' + }, scrollTo() { - const ref = this.$refs[`${this.barcode}ref`][0]; - uni.pageScrollTo({ - scrollTop: ref.$el.offsetTop, - duration: 300 - }) + + // const ref = this.$refs[`${this.barcode}ref`][0]; + // uni.pageScrollTo({ + // scrollTop: ref.$el.offsetTop, + // duration: 300 + // }) }, remove(index) { this.list.splice(index, 1); @@ -236,8 +251,11 @@ clear() { this.list = [] this.barcode = '' + this.asncode = '' + this.whAreaId = '' + this.range = [] }, - next(event) { + next() { if (this.list.length) { this.isconfirm = true } else { @@ -251,11 +269,10 @@ this.isconfirm = false }, selChange(val) { - console.log('-------->') - console.log(val) uni.setStorageSync('whAreaId', val) }, async complete(id) { + this.repeatClick = true const { code, data, @@ -272,6 +289,7 @@ icon: "none", }) } + this.repeatClick = false }, async confirm(isCom) { if (this.whAreaId === '') { @@ -280,14 +298,19 @@ 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); - this.repeatClick = true const { code, data, @@ -303,19 +326,17 @@ }) this.list = [] this.barcode = '' - this.isconfirm = false - this.repeatClick = false + this.isconfirm = false isCom && this.complete(data.id) } else { uni.showToast({ title: msg, icon: "none", }) - this.repeatClick = false } } }, - async getRece() { + async getRece() { const { code, data, -- Gitblit v1.9.1