From 796e7c646e4d40ab55e62f7454893dfd0dc28ffb Mon Sep 17 00:00:00 2001
From: pang.jiabao <pang_jiabao@163.com>
Date: 星期四, 07 五月 2026 19:33:38 +0800
Subject: [PATCH] 订单组托,领料出库功能完善
---
pages/order/orderSelect.vue | 154 +++++++++++++++++++++++++++++++++++---
pages/order/callReqOutbound.vue | 77 ++++++++++++------
2 files changed, 191 insertions(+), 40 deletions(-)
diff --git a/pages/order/callReqOutbound.vue b/pages/order/callReqOutbound.vue
index 3ccccd9..3135ffa 100644
--- a/pages/order/callReqOutbound.vue
+++ b/pages/order/callReqOutbound.vue
@@ -72,6 +72,12 @@
</view>
</view>
<view class="info-row">
+ <view class="info-label">宸ュ崟鍙凤細</view>
+ <view class="info-value">
+ <text class="tag tag-info">{{orderDetl.standby1 || '-'}}</text>
+ </view>
+ </view>
+ <view class="info-row">
<view class="info-label">鏂欏彿锛�</view>
<view class="info-value">
<text class="tag tag-primary">{{orderDetl.matnr || '-'}}</text>
@@ -195,12 +201,28 @@
methods: {
// 閲嶇疆閫変腑鐘舵��
reset() {
- for (let k of this.dataList) {
- this.$set(k, 'checked', false)
- }
+
this.orderNo = ''
- this.updateSelectAllTitle()
+
+ this.filterMatnr = ''
+
+ this.dataList = []
+
+ this.filteredList = []
+
+ this.idList = []
+
+ this.total = 0
+
+ this.seltitle = '鍏ㄩ��'
},
+ // reset() {
+ // for (let k of this.dataList) {
+ // this.$set(k, 'checked', false)
+ // }
+ // this.orderNo = ''
+ // this.updateSelectAllTitle()
+ // },
onFilterInput() {
this.applyFilter()
},
@@ -258,19 +280,14 @@
const missingStaNo = pickList.filter(item => {
return item.staNos && item.staNos.length > 0 && !item.selectedStaNo
})
-
if (missingStaNo.length > 0) {
- uni.showModal({
- title: '鎻愮ず',
- content: `鏈� ${missingStaNo.length} 涓墿鏂欐湭閫夋嫨鍑哄簱鍙o紝鏄惁缁х画锛焋,
- confirmText: '缁х画',
- cancelText: '鍙栨秷',
- success: (res) => {
- if (res.confirm) {
- this.submitPickList(pickList)
- }
- }
+
+ uni.showToast({
+ title: '瀛樺湪鏈�夋嫨鍑哄簱鍙g殑鐗╂枡',
+ icon: 'none',
+ position: 'center'
})
+
return
}
@@ -290,7 +307,9 @@
anfme: item.anfme, // 鍙敤鏁伴噺
orderNo: item.orderNo, // 璁㈠崟鍙�
staNo: item.selectedStaNo, // 閫変腑鐨勫嚭搴撳彛
+ standby1: item.standby1,
// 娣诲姞鍏朵粬闇�瑕佺殑瀛楁
+
}
})
@@ -299,7 +318,8 @@
},
// 鐩存帴璋冪敤鍑哄簱鎺ュ彛鐨勬柟娉�
outboundRequest(submitData) {
- console.info(submitData)
+ // console.info(submitData)
+ let that = this
uni.showLoading({ title: '鍑哄簱涓�...', mask: true })
uni.request({
@@ -322,18 +342,21 @@
}
if (result.code === 200) {
- uni.showToast({
- title: `鎴愬姛鍑哄簱 ${submitData.length} 涓墿鏂檂,
- icon: "success"
- })
+ uni.showToast({
+ title: `鎴愬姛鍑哄簱 ${submitData.length} 涓墿鏂檂,
+ icon: "success"
+ })
- // 鍑哄簱鎴愬姛鍚庯紝鍒锋柊鍒楄〃鎴栬繑鍥炰笂涓�椤�
- setTimeout(() => {
- // 鍒锋柊褰撳墠鍒楄〃
- this.getOrderDet()
- // 鎴栬�呰繑鍥炰笂涓�椤�
- // uni.navigateBack({})
- }, 1500)
+ // 娓呯┖鏃ф暟鎹�
+ that.dataList = []
+ that.filteredList = []
+
+ // 鍒锋柊鍒楄〃
+ setTimeout(() => {
+
+ that.getOrderDet()
+
+ }, 800)
} else if (result.code === 403) {
uni.showToast({ title: result.msg || '鐧诲綍宸茶繃鏈�', icon: "error" })
setTimeout(() => { uni.reLaunch({ url: '../login/login' }); }, 1500);
diff --git a/pages/order/orderSelect.vue b/pages/order/orderSelect.vue
index 1736861..9833578 100644
--- a/pages/order/orderSelect.vue
+++ b/pages/order/orderSelect.vue
@@ -13,7 +13,26 @@
<uni-combox :candidates="orderNoList" placeholder="璇烽�夋嫨璁㈠崟" v-model="orderNo" @input="getOrderDet"></uni-combox>
</view>
</view>
+ <!-- 鐗╂枡鐮佹壂鎻� -->
+ <view class="filter-item">
+ <view class="filter-label">
+ <uni-icons type="scan" size="18" color="#67C23A"></uni-icons>
+ <text>鐗╂枡鐮�</text>
+ </view>
+ <view class="filter-input">
+ <input
+ type="text"
+ v-model="scanCode"
+ placeholder="鎵弿鐗╂枡浜岀淮鐮�"
+ confirm-type="done"
+ class="filter-input-field"
+ placeholder-class="placeholder-style"
+ :focus="true"
+ @input="onScanInput"
+ />
+ </view>
+ </view>
<!-- 鐗╂枡缂栧彿杩囨护 -->
<view class="filter-item">
<view class="filter-label">
@@ -148,7 +167,8 @@
orderNo: '',
orderNoList: [],
seltitle: '鍏ㄩ��',
- filterMatnr: ''
+ filterMatnr: '',
+ scanCode: ''
}
},
onShow() {
@@ -170,17 +190,125 @@
this.getOrderNoList()
},
methods: {
- onFilterInput() {
- let that = this
- // 鏂规硶1锛氬垎鍓叉垚鏁扮粍
- let arr = that.filterMatnr.split('|')
- // 鏂规硶2锛氶亶鍘嗘瘡涓�娈�
- arr.forEach((item, index) => {
- switch(index){
- case 2: that.filterMatnr = item
- break;
- }
+ onScanInput(e) {
+
+ let value = e.detail.value
+
+ // 鏈変簺鎵爜鏋渶鍚庝細甯﹀洖杞�
+ value = value.replace(/\r|\n/g, '')
+
+ this.scanCode = value
+
+ // 鍒ゆ柇鎵爜鏍煎紡鏄惁瀹屾暣
+ // 渚嬪锛�
+ // 001|PPP6|YJ2026050514464499|205050506|fsd
+
+ let arr = value.split('|')
+
+ // 婊�5娈佃涓烘壂鐮佸畬鎴�
+ if (arr.length >= 5) {
+
+ // 寤惰繜涓�鐐癸紝閬垮厤杈撳叆鏈畬鎴�
+ setTimeout(() => {
+ this.handleScanCode()
+ }, 50)
+ }
+ },
+ handleScanCode() {
+
+ let code = this.scanCode
+
+ if (!code || code.trim() === '') {
+ return
+ }
+
+ code = code.trim()
+
+ // 鍒嗗壊浜岀淮鐮�
+ let arr = code.split('|')
+
+ if (arr.length < 5) {
+
+ uni.showToast({
+ title: '浜岀淮鐮佹牸寮忛敊璇�',
+ icon: 'none'
})
+
+ this.scanCode = ''
+ return
+ }
+
+ // 鎻愬彇瀛楁
+ let standby1 = (arr[1] || '').trim()
+ let matnr = (arr[2] || '').trim()
+ let batch = (arr[3] || '').trim()
+
+ console.log('宸ュ崟鍙�:', standby1)
+ console.log('鏂欏彿:', matnr)
+ console.log('鎵瑰彿:', batch)
+
+ // 鏌ユ壘鍖归厤
+ let target = this.dataList.find(item => {
+
+ let itemStandby1 = (item.standby1 || '').trim()
+ let itemMatnr = (item.matnr || '').trim()
+ let itemBatch = (item.batch || '').trim()
+
+ return itemStandby1 === standby1
+ && itemMatnr === matnr
+ && itemBatch === batch
+ })
+
+ // 鍖归厤鎴愬姛
+ if (target) {
+
+ // 宸叉壂鎻�
+ if (target.checked) {
+
+ uni.showToast({
+ title: '璇ョ墿鏂欏凡鎵弿',
+ icon: 'none'
+ })
+
+ } else {
+
+ this.$set(target, 'checked', true)
+
+ uni.showToast({
+ title: '鍖归厤鎴愬姛',
+ icon: 'success'
+ })
+ }
+
+ this.updateSelectAllTitle()
+
+ } else {
+
+ // 鏈尮閰嶆彁绀鸿缁嗗唴瀹�
+ uni.showModal({
+ title: '鏈尮閰嶅埌鐗╂枡',
+ content:
+ '宸ュ崟鍙凤細' + (standby1 || '绌�') +
+ '\n鏂欏彿锛�' + (matnr || '绌�') +
+ '\n鎵瑰彿锛�' + (batch || '绌�'),
+ showCancel: false
+ })
+ }
+
+ // 娓呯┖杈撳叆妗�
+ this.scanCode = ''
+ },
+ onFilterInput() {
+ // let that = this
+ // // 鏂规硶1锛氬垎鍓叉垚鏁扮粍
+ // let arr = that.filterMatnr.split('|')
+ // // 鏂规硶2锛氶亶鍘嗘瘡涓�娈�
+ // arr.forEach((item, index) => {
+ // switch(index){
+ // case 2: that.filterMatnr = item
+ // break;
+ // }
+ // })
this.applyFilter()
},
@@ -392,7 +520,7 @@
.filter-item {
display: flex;
align-items: center;
- padding: 24rpx 32rpx;
+ padding: 15rpx 15rpx;
border-bottom: 1px solid #f0f0f0;
}
@@ -401,7 +529,7 @@
}
.filter-label {
- width: 140rpx;
+ width: 160rpx;
display: flex;
align-items: center;
gap: 12rpx;
--
Gitblit v1.9.1