From 76ae45bef979f38d251837f6be274d602a5375b7 Mon Sep 17 00:00:00 2001
From: whycq <913841844@qq.com>
Date: 星期三, 13 十一月 2024 14:33:50 +0800
Subject: [PATCH] #
---
pages/phyz/stationManage/pickAgain.vue | 39 +++++++++++++++++++++++++++++----------
1 files changed, 29 insertions(+), 10 deletions(-)
diff --git a/pages/phyz/stationManage/pickAgain.vue b/pages/phyz/stationManage/pickAgain.vue
index 2ddb41e..73c71ca 100644
--- a/pages/phyz/stationManage/pickAgain.vue
+++ b/pages/phyz/stationManage/pickAgain.vue
@@ -36,7 +36,7 @@
</view>
<!-- 搴曢儴鎿嶄綔鎸夐挳 -->
<view class="buttom">
- <button size="mini" type="primary" @click="confirmPick('warn')">纭鎷f枡</button>
+ <button size="mini" type="primary" @click="confirmPick('warn')" :disabled="pickAgaDis">纭鎷f枡</button>
</view>
</view>
</template>
@@ -53,7 +53,8 @@
maxCount: 0,
wrkNo: '',
locNo: '',
- pickedAnfme: 0
+ pickedAnfme: 0,
+ pickAgaDis: false
}
},
onShow() {
@@ -64,7 +65,7 @@
const eventChannel = this.getOpenerEventChannel();
// 鐩戝惉acceptDataFromOpenerPage浜嬩欢锛岃幏鍙栦笂涓�椤甸潰閫氳繃eventChannel浼犻�佸埌褰撳墠椤甸潰鐨勬暟鎹�
eventChannel.on('item', function(data) {
- console.log(data);
+ // console.log(data);
_this.pickList = data.wrkDetls
_this.wrkNo = data.wrkDetls[0].wrkNo
_this.locNo = data.item.sourceLocNo
@@ -85,7 +86,7 @@
method: 'GET',
success(res) {
res = res.data
- console.log(res);
+ // console.log(res);
if (res.code === 200) {
_this.chosed(_this.pickList,res.data.records)
return
@@ -120,18 +121,21 @@
} else {
uni.showToast({ title: res.msg, icon: "error", position: 'top' })
}
- }
+ },
})
},
// 宸查�夋嫞鏂欏垪琛�
chosed(wrkDetls,locDetls) {
+ console.log(wrkDetls,locDetls);
let isfl = false, enbleList = []
for (let locDetl of locDetls) {
locDetl['color'] = 'order-sts-start'
locDetl['pickedAnfme'] = 0
locDetl['count'] = 0
for (let wrkDetl of wrkDetls) {
- if (wrkDetl.threeCode == locDetl.threeCode && wrkDetl.matnr == locDetl.matnr) {
+ console.log(wrkDetl);
+ if (wrkDetl.threeCode.replace(/\s/g, "") == locDetl.threeCode.replace(/\s/g, "") && wrkDetl.matnr == locDetl.matnr) {
+ console.log(wrkDetl);
locDetl['pickedAnfme'] = wrkDetl.anfme
if (locDetl.stock == -1) {
locDetl.stock = 0
@@ -155,12 +159,23 @@
// 鍒ゆ柇娣诲姞鐨勫晢鍝佹槸鍚﹀拰宸茬粡娣诲姞鐨勯噸澶�
let dataList = this.dataList
this.index = index
+ let orderCount = this.dataList[index].stock
+ let locCount = this.dataList[index].anfme
+ let pickedAnfme = this.dataList[index].pickedAnfme
+ // 棰勮鏈�澶ц鍑哄簱
+ let ftCount = pickedAnfme + orderCount
- if (this.dataList[index].stock > this.dataList[index].anfme) {
- this.maxCount = this.dataList[index].anfme - this.dataList[index].pickedAnfme
+ if (orderCount > locCount) {
+ this.maxCount = locCount - pickedAnfme
} else {
- this.maxCount = this.dataList[index].stock
+ if (ftCount > locCount) {
+ this.maxCount = locCount -pickedAnfme
+ } else {
+ this.maxCount = orderCount
+ }
+
}
+
this.$refs.addItem.open()
},
addClose() {
@@ -176,6 +191,7 @@
},
// 纭鍐嶆鎷f枡
confirmPick() {
+ this.pickAgaDis = true
let _this = this
uni.request({
url: `${_this.baseUrl}/agvMobile/pick/again/auth`,
@@ -187,8 +203,8 @@
}),
method: 'POST',
success(res) {
+ _this.pickAgaDis = false
res = res.data
- console.log(res);
if (res.code === 200) {
_this.getOpenerEventChannel().emit('acceptDataFromOpenedPage', {data: 1});
setTimeout(()=>{
@@ -202,6 +218,9 @@
}
}
})
+ },
+ fail(res) {
+ _this.pickAgaDis = false
}
}
}
--
Gitblit v1.9.1