From 18ca3750ce28d407afb518cadecdd29d79876c8b Mon Sep 17 00:00:00 2001
From: heshaofeng <heshaofeng@hnkhzn.com>
Date: 星期二, 09 十二月 2025 19:40:15 +0800
Subject: [PATCH] Merge branch 'master' of http://115.159.85.185:8098/r/ZhongRui/ALDbanyunxiangmu
---
项目代码/WIDESEA_WMSClient/src/extension/inbound/inboundOrder.js | 340 ++++++++++++++++++++++++++++----------------------------
1 files changed, 169 insertions(+), 171 deletions(-)
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/inboundOrder.js" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/inboundOrder.js"
index cf21535..3682205 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/inboundOrder.js"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/inboundOrder.js"
@@ -1,4 +1,3 @@
-
//姝s鏂囦欢鏄敤鏉ヨ嚜瀹氫箟鎵╁睍涓氬姟浠g爜锛屽彲浠ユ墿灞曚竴浜涜嚜瀹氫箟椤甸潰鎴栬�呴噸鏂伴厤缃敓鎴愮殑浠g爜
import http from '@/api/http.js'
import { h, createVNode, render, reactive, ref } from 'vue';
@@ -44,159 +43,159 @@
this.$emit('openPalletDialog', targetRow.inboundOrderNo);
}
},
- {
- name: '鎾ら攢缁勭洏',
- type: 'primary',
- value: '鎾ら攢缁勭洏',
- onClick: function () {
- console.log('鎾ら攢缁勭洏鎸夐挳琚偣鍑�');
- const mountNode = document.createElement('div');
- document.body.appendChild(mountNode);
+ {
+ name: '鎾ら攢缁勭洏',
+ type: 'primary',
+ value: '鎾ら攢缁勭洏',
+ onClick: function () {
+ console.log('鎾ら攢缁勭洏鎸夐挳琚偣鍑�');
+ const mountNode = document.createElement('div');
+ document.body.appendChild(mountNode);
- // 鍝嶅簲寮忚〃鍗曟暟鎹細鎵樼洏鍙凤紙蹇呭~锛�
- const formData = reactive({
- palletCode: '', // 鎵樼洏鍙疯緭鍏ユ
- barcode:''
- });
+ // 鍝嶅簲寮忚〃鍗曟暟鎹細鎵樼洏鍙凤紙蹇呭~锛�
+ const formData = reactive({
+ palletCode: '', // 鎵樼洏鍙疯緭鍏ユ
+ barcode: ''
+ });
- // 鎻愪氦琛ㄥ崟鐨勭粺涓�閫昏緫
- const submitForm = async () => {
- const formRef = vnode.component.refs.cancelPalletForm;
- try {
- // 鎵ц琛ㄥ崟鏍¢獙锛堟墭鐩樺彿蹇呭~锛�
- await formRef.validate();
- } catch (err) {
- ElMessage.warning('璇疯緭鍏ユ湁鏁堢殑鎵樼洏鍙�');
- return;
- }
+ // 鎻愪氦琛ㄥ崟鐨勭粺涓�閫昏緫
+ const submitForm = async () => {
+ const formRef = vnode.component.refs.cancelPalletForm;
+ try {
+ // 鎵ц琛ㄥ崟鏍¢獙锛堟墭鐩樺彿蹇呭~锛�
+ await formRef.validate();
+ } catch (err) {
+ ElMessage.warning('璇疯緭鍏ユ湁鏁堢殑鎵樼洏鍙�');
+ return;
+ }
- // 鍙戣捣鎾ら攢缁勭洏璇锋眰
- try {
- //console.log('鍙戣捣鎾ら攢缁勭洏璇锋眰锛屾墭鐩樺彿锛�', formData.palletCode.trim());
- const response = await http.post('/api/InboundOrder/UndoPalletGroup?palletCode='+formData.palletCode.trim()+'&barcode='+formData.barcode.trim());
-
+ // 鍙戣捣鎾ら攢缁勭洏璇锋眰
+ try {
+ //console.log('鍙戣捣鎾ら攢缁勭洏璇锋眰锛屾墭鐩樺彿锛�', formData.palletCode.trim());
+ const response = await http.post('/api/InboundOrder/UndoPalletGroup?palletCode=' + formData.palletCode.trim() + '&barcode=' + formData.barcode.trim());
- const { status, message, data } = response;
- if (status) {
- ElMessage.success(response.message);
- console.log(response.message)
- this.refresh(); // 鎴愬姛鍚庡埛鏂板垪琛�
- // 鍏抽棴瀵硅瘽妗�
- render(null, mountNode);
- document.body.removeChild(mountNode);
- } else {
- console.log('鎾ら攢缁勭洏澶辫触锛屽悗绔彁绀猴細', message);
- ElMessage.error(message || data?.message || '鎾ら攢缁勭洏澶辫触');
- selectPalletCodeInput(); // 閫変腑杈撳叆妗嗘柟渚块噸鏂拌緭鍏�
- }
- } catch (error) {
- console.error('鎾ら攢缁勭洏璇锋眰寮傚父锛�', error);
- ElMessage.error('缃戠粶寮傚父鎴栨帴鍙i敊璇紝璇风◢鍚庨噸璇�');
- selectPalletCodeInput();
- }
- };
- // 閫変腑杈撳叆妗嗘枃鏈紙鏂逛究閲嶆柊杈撳叆锛�
- const selectPalletCodeInput = () => {
- setTimeout(() => {
- const inputRef = vnode.component.refs.palletCodeInput;
- if (inputRef) {
- const targetInput = inputRef.$el?.querySelector('input') || inputRef;
- targetInput?.focus();
- targetInput?.select();
- }
- }, 100);
- };
+ const { status, message, data } = response;
+ if (status) {
+ ElMessage.success(response.message);
+ console.log(response.message)
+ this.refresh(); // 鎴愬姛鍚庡埛鏂板垪琛�
+ // 鍏抽棴瀵硅瘽妗�
+ render(null, mountNode);
+ document.body.removeChild(mountNode);
+ } else {
+ console.log('鎾ら攢缁勭洏澶辫触锛屽悗绔彁绀猴細', message);
+ ElMessage.error(message || data?.message || '鎾ら攢缁勭洏澶辫触');
+ selectPalletCodeInput(); // 閫変腑杈撳叆妗嗘柟渚块噸鏂拌緭鍏�
+ }
+ } catch (error) {
+ console.error('鎾ら攢缁勭洏璇锋眰寮傚父锛�', error);
+ ElMessage.error('缃戠粶寮傚父鎴栨帴鍙i敊璇紝璇风◢鍚庨噸璇�');
+ selectPalletCodeInput();
+ }
+ };
- // 鍒涘缓瀵硅瘽妗哣Node
- const vnode = createVNode(ElDialog, {
- title: '鎾ら攢缁勭洏',
- width: '400px',
- modelValue: true,
- appendToBody: true,
- onOpened: () => {
- // 瀵硅瘽妗嗘墦寮�鍚庤嚜鍔ㄨ仛鐒﹁緭鍏ユ
- setTimeout(() => {
- const inputRef = vnode.component.refs.palletCodeInput;
- inputRef?.focus();
- }, 100);
- },
- 'onUpdate:modelValue': (isVisible) => {
- if (!isVisible) {
- render(null, mountNode);
- document.body.removeChild(mountNode);
- }
- }
- }, {
- default: () => h(ElForm, {
- model: formData,
- rules: {
- palletCode: [
- { required: true, message: '璇疯緭鍏ユ墭鐩樺彿', trigger: ['blur', 'enter'] },
- { min: 1, max: 50, message: '鎵樼洏鍙烽暱搴︿笉鑳借秴杩�50涓瓧绗�', trigger: ['blur', 'input'] }
- ]
- },
- ref: 'cancelPalletForm'
- }, [
- // 鎵樼洏鍙疯緭鍏ラ」
- h(ElFormItem, { label: '鎵樼洏鍙�', prop: 'palletCode', required: true }, [
- h(ElInput, {
- type: 'text',
- modelValue: formData.palletCode,
- 'onUpdate:modelValue': (val) => {
- formData.palletCode = val;
- },
- ref: 'palletCodeInput',
- placeholder: '鎵爜杈撳叆鎴栨墜鍔ㄨ緭鍏ユ墭鐩樺彿',
- maxLength: 50,
- // 鐩戝惉鍥炶溅浜嬩欢锛堟壂鐮佹灙榛樿浼氬彂閫佸洖杞︼級
- onKeydown: (e) => {
- if (e.key === 'Enter') {
- e.preventDefault();
- submitForm();
- }
- }
- })
- ]),
- h(ElFormItem,{label: '鏉$爜', prop: 'barcode'},[
- h(ElInput, {
- type: 'text',
- modelValue: formData.barcode,
- 'onUpdate:modelValue': (val) => {
- formData.barcode = val;
- },
- placeholder: '鍙�夛紝鎵爜杈撳叆鎴栨墜鍔ㄨ緭鍏ユ潯鐮�',
- maxLength: 50,
- onKeydown: (e) => {
- if (e.key === 'Enter') {
- e.preventDefault();
- submitForm();
- }
- }
- })
- ]),
- // 搴曢儴鎸夐挳鍖�
- h('div', { style: { textAlign: 'right', marginTop: '16px' } }, [
- h(ElButton, {
- type: 'text',
- onClick: () => {
- render(null, mountNode);
- document.body.removeChild(mountNode);
- ElMessage.info('鍙栨秷鎾ら攢缁勭洏');
- }
- }, '鍙栨秷'),
- h(ElButton, {
- type: 'primary',
- onClick: submitForm.bind(this) // 缁戝畾this涓婁笅鏂�
- }, '纭鎾ら攢')
- ])
- ])
- });
+ // 閫変腑杈撳叆妗嗘枃鏈紙鏂逛究閲嶆柊杈撳叆锛�
+ const selectPalletCodeInput = () => {
+ setTimeout(() => {
+ const inputRef = vnode.component.refs.palletCodeInput;
+ if (inputRef) {
+ const targetInput = inputRef.$el?.querySelector('input') || inputRef;
+ targetInput?.focus();
+ targetInput?.select();
+ }
+ }, 100);
+ };
- vnode.appContext = this.$.appContext;
- render(vnode, mountNode);
- }
+ // 鍒涘缓瀵硅瘽妗哣Node
+ const vnode = createVNode(ElDialog, {
+ title: '鎾ら攢缁勭洏',
+ width: '400px',
+ modelValue: true,
+ appendToBody: true,
+ onOpened: () => {
+ // 瀵硅瘽妗嗘墦寮�鍚庤嚜鍔ㄨ仛鐒﹁緭鍏ユ
+ setTimeout(() => {
+ const inputRef = vnode.component.refs.palletCodeInput;
+ inputRef?.focus();
+ }, 100);
},
+ 'onUpdate:modelValue': (isVisible) => {
+ if (!isVisible) {
+ render(null, mountNode);
+ document.body.removeChild(mountNode);
+ }
+ }
+ }, {
+ default: () => h(ElForm, {
+ model: formData,
+ rules: {
+ palletCode: [
+ { required: true, message: '璇疯緭鍏ユ墭鐩樺彿', trigger: ['blur', 'enter'] },
+ { min: 1, max: 50, message: '鎵樼洏鍙烽暱搴︿笉鑳借秴杩�50涓瓧绗�', trigger: ['blur', 'input'] }
+ ]
+ },
+ ref: 'cancelPalletForm'
+ }, [
+ // 鎵樼洏鍙疯緭鍏ラ」
+ h(ElFormItem, { label: '鎵樼洏鍙�', prop: 'palletCode', required: true }, [
+ h(ElInput, {
+ type: 'text',
+ modelValue: formData.palletCode,
+ 'onUpdate:modelValue': (val) => {
+ formData.palletCode = val;
+ },
+ ref: 'palletCodeInput',
+ placeholder: '鎵爜杈撳叆鎴栨墜鍔ㄨ緭鍏ユ墭鐩樺彿',
+ maxLength: 50,
+ // 鐩戝惉鍥炶溅浜嬩欢锛堟壂鐮佹灙榛樿浼氬彂閫佸洖杞︼級
+ onKeydown: (e) => {
+ if (e.key === 'Enter') {
+ e.preventDefault();
+ submitForm();
+ }
+ }
+ })
+ ]),
+ h(ElFormItem, { label: '鏉$爜', prop: 'barcode' }, [
+ h(ElInput, {
+ type: 'text',
+ modelValue: formData.barcode,
+ 'onUpdate:modelValue': (val) => {
+ formData.barcode = val;
+ },
+ placeholder: '鍙�夛紝鎵爜杈撳叆鎴栨墜鍔ㄨ緭鍏ユ潯鐮�',
+ maxLength: 50,
+ onKeydown: (e) => {
+ if (e.key === 'Enter') {
+ e.preventDefault();
+ submitForm();
+ }
+ }
+ })
+ ]),
+ // 搴曢儴鎸夐挳鍖�
+ h('div', { style: { textAlign: 'right', marginTop: '16px' } }, [
+ h(ElButton, {
+ type: 'text',
+ onClick: () => {
+ render(null, mountNode);
+ document.body.removeChild(mountNode);
+ ElMessage.info('鍙栨秷鎾ら攢缁勭洏');
+ }
+ }, '鍙栨秷'),
+ h(ElButton, {
+ type: 'primary',
+ onClick: submitForm.bind(this) // 缁戝畾this涓婁笅鏂�
+ }, '纭鎾ら攢')
+ ])
+ ])
+ });
+
+ vnode.appContext = this.$.appContext;
+ render(vnode, mountNode);
+ }
+ },
{
name: '鍒嗘壒鍏ュ簱',
type: 'primary',
@@ -427,30 +426,30 @@
//涓嬮潰杩欎簺鏂规硶鍙互淇濈暀涔熷彲浠ュ垹闄�
onInit() {
this.columns.forEach(column => {
- if (column.field === 'orderStatistics') {
- column.formatter = (row) => {
- // 鏍¢獙details鏄惁瀛樺湪涓旀湁鏁版嵁
- if (row.details && row.details.length > 0) {
- //鎸塵aterielCode鍒嗙粍缁熻orderQuantity鎬诲拰
- const materielSumMap = row.details.reduce((acc, item) => {
- const materielCode = item.materielCode || '鏈煡鐗╂枡';
- const quantity = Number(item.orderQuantity) || 0;
- acc[materielCode] = (acc[materielCode] || 0) + quantity;
- return acc;
- }, {});
+ if (column.field === 'orderStatistics') {
+ column.formatter = (row) => {
+ // 鏍¢獙details鏄惁瀛樺湪涓旀湁鏁版嵁
+ if (row.details && row.details.length > 0) {
+ //鎸塵aterielCode鍒嗙粍缁熻orderQuantity鎬诲拰
+ const materielSumMap = row.details.reduce((acc, item) => {
+ const materielCode = item.materielCode || '鏈煡鐗╂枡';
+ const quantity = Number(item.orderQuantity) || 0;
+ acc[materielCode] = (acc[materielCode] || 0) + quantity;
+ return acc;
+ }, {});
- //姣忎釜鐗╂枡椤圭敓鎴愮嫭绔媎iv锛岃法琛屾樉绀�
- const displayItems = Object.entries(materielSumMap).map(([code, total]) => {
- return `<div style="line-height: 1.5; white-space: normal;">${code}锛�${total}涓�</div>`;
- });
- const displayContent = displayItems.join('');
- return `<div style="color: #F56C6C; white-space: normal; word-break: break-all;">${displayContent}</div>`;
- } else {
- return '<span style="color: #F56C6C">鏃犲叆搴撴槑缁�</span>';
- }
- };
- }
- });
+ //姣忎釜鐗╂枡椤圭敓鎴愮嫭绔媎iv锛岃法琛屾樉绀�
+ const displayItems = Object.entries(materielSumMap).map(([code, total]) => {
+ return `<div style="line-height: 1.5; white-space: normal;">${code}锛�${total}涓�</div>`;
+ });
+ const displayContent = displayItems.join('');
+ return `<div style="color: #F56C6C; white-space: normal; word-break: break-all;">${displayContent}</div>`;
+ } else {
+ return '<span style="color: #F56C6C">鏃犲叆搴撴槑缁�</span>';
+ }
+ };
+ }
+ });
},
onInited() {
@@ -473,7 +472,6 @@
return true;
},
searchAfter(result) {
- //鏌ヨ鍚庯紝result杩斿洖鐨勬煡璇㈡暟鎹�,鍙互鍦ㄦ樉绀哄埌琛ㄦ牸鍓嶅鐞嗚〃鏍肩殑鍊�
return true;
},
addBefore(formData) {
@@ -498,4 +496,4 @@
}
}
};
-export default extension;
+export default extension;
\ No newline at end of file
--
Gitblit v1.9.3