From 40bab448d8ba5a29a80bd12f342d47e42e73483f Mon Sep 17 00:00:00 2001
From: whycq <10027870+whycq@user.noreply.gitee.com>
Date: 星期四, 01 八月 2024 16:16:25 +0800
Subject: [PATCH] #
---
pages/phyz/stationManage/pickAgain.vue | 81 ++++++++++++++++++++++++++++++++++++----
1 files changed, 73 insertions(+), 8 deletions(-)
diff --git a/pages/phyz/stationManage/pickAgain.vue b/pages/phyz/stationManage/pickAgain.vue
index 0b0b72c..7d6f2f3 100644
--- a/pages/phyz/stationManage/pickAgain.vue
+++ b/pages/phyz/stationManage/pickAgain.vue
@@ -8,6 +8,7 @@
<view>鍚嶇О锛歿{orderDetl.maktx}}</view>
<view>搴撳瓨鏁伴噺锛歿{orderDetl.anfme}}</view>
<view>璁㈠崟鍙嚭鏁伴噺锛歿{orderDetl.stock}}</view>
+ <view>宸叉嫞鏁伴噺锛歿{orderDetl.pickedAnfme}}</view>
<view>鎷f枡鏁伴噺锛歿{orderDetl.count}}</view>
</view>
<view class="list-right" @click="addItem(index)">
@@ -35,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>
@@ -51,7 +52,9 @@
count: 0,
maxCount: 0,
wrkNo: '',
- locNo: ''
+ locNo: '',
+ pickedAnfme: 0,
+ pickAgaDis: false
}
},
onShow() {
@@ -71,6 +74,7 @@
},
methods: {
getLocDetl(locNo) {
+
let _this = this
uni.request({
url: `${_this.baseUrl}/agv/locDetl/list/auth/v2`,
@@ -85,10 +89,14 @@
res = res.data
console.log(res);
if (res.code === 200) {
- let enbleList = []
+ _this.chosed(_this.pickList,res.data.records)
+ return
+ let enbleList = [], isfl;
for (let k of res.data.records) {
+ isfl = false;
for (let j of _this.pickList) {
if (j.matnr == k.matnr && j.threeCode == k.threeCode) {
+ isfl = true;
break
} else {
if (k.stock == -1) {
@@ -99,8 +107,10 @@
}
k['count'] = 0
- enbleList.push(k)
}
+ }
+ if (!isfl) {
+ enbleList.push(k)
}
}
@@ -112,19 +122,58 @@
} else {
uni.showToast({ title: res.msg, icon: "error", position: 'top' })
}
- }
+ },
})
},
// 宸查�夋嫞鏂欏垪琛�
- orderCar() {
-
+ chosed(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) {
+ locDetl['pickedAnfme'] = wrkDetl.anfme
+ if (locDetl.stock == -1) {
+ locDetl.stock = 0
+ }
+ if (wrkDetl.anfme < locDetl.anfme) {
+ locDetl['color'] = 'order-sts-working'
+ locDetl['pickedAnfme'] = wrkDetl.anfme
+ locDetl['count'] = 0
+ } else {
+ locDetl['color'] = 'order-sts-end'
+ }
+ break
+ }
+ }
+
+ }
+ this.dataList = locDetls
},
// 娣诲姞鍏ュ簱鍟嗗搧鑷� 寰呯粍鎵樺垪琛�
addItem(index) {
// 鍒ゆ柇娣诲姞鐨勫晢鍝佹槸鍚﹀拰宸茬粡娣诲姞鐨勯噸澶�
let dataList = this.dataList
this.index = index
- this.maxCount = this.dataList[index].stock
+ let orderCount = this.dataList[index].stock
+ let locCount = this.dataList[index].anfme
+ let pickedAnfme = this.dataList[index].pickedAnfme
+ // 棰勮鏈�澶ц鍑哄簱
+ let ftCount = pickedAnfme + orderCount
+
+ if (orderCount > locCount) {
+ this.maxCount = locCount - pickedAnfme
+ } else {
+ if (ftCount > locCount) {
+ this.maxCount = locCount -pickedAnfme
+ } else {
+ this.maxCount = orderCount
+ }
+
+ }
+
this.$refs.addItem.open()
},
addClose() {
@@ -140,6 +189,7 @@
},
// 纭鍐嶆鎷f枡
confirmPick() {
+ this.pickAgaDis = true
let _this = this
uni.request({
url: `${_this.baseUrl}/agvMobile/pick/again/auth`,
@@ -151,10 +201,25 @@
}),
method: 'POST',
success(res) {
+ _this.pickAgaDis = false
res = res.data
console.log(res);
+ if (res.code === 200) {
+ _this.getOpenerEventChannel().emit('acceptDataFromOpenedPage', {data: 1});
+ setTimeout(()=>{
+ uni.navigateBack()
+ },700)
+ } else if (res.code == 403) {
+ uni.showToast({ title: res.msg, icon: "error", position: 'top' })
+ setTimeout(() => { uni.reLaunch({ url: '../../login/login' }); }, 1000);
+ } else {
+ uni.showToast({ title: res.msg, icon: "error", position: 'top' })
+ }
}
})
+ },
+ fail(res) {
+ _this.pickAgaDis = false
}
}
}
--
Gitblit v1.9.1