From ec15cf34499727cbd0e75be96c9793dd824a06c0 Mon Sep 17 00:00:00 2001
From: pan <antony1029@163.com>
Date: 星期三, 12 十一月 2025 10:09:23 +0800
Subject: [PATCH] 提交
---
项目代码/WIDESEA_WMSClient/src/extension/inbound/inboundOrder.js | 147 +++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 142 insertions(+), 5 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 edf53dd..13b07b2 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,8 +1,8 @@
//姝s鏂囦欢鏄敤鏉ヨ嚜瀹氫箟鎵╁睍涓氬姟浠g爜锛屽彲浠ユ墿灞曚竴浜涜嚜瀹氫箟椤甸潰鎴栬�呴噸鏂伴厤缃敓鎴愮殑浠g爜
import http from '@/api/http.js'
-import { defineAsyncComponent } from "vue";
-import { ElMessage } from 'element-plus'; // 寮曞叆ElMessage锛岃В鍐虫彁绀烘棤鍙嶅簲
+import { h,createVNode, render,reactive } from 'vue';
+import { ElDialog , ElForm, ElFormItem, ElInput, ElButton, ElMessage } from 'element-plus'; // 寮曞叆ElMessage锛岃В鍐虫彁绀烘棤鍙嶅簲
let extension = {
components: {
@@ -40,12 +40,149 @@
const targetRow = selectedRows[0];
-
-
-
this.$emit('openPalletDialog', targetRow.inboundOrderNo);
}
},
+ {
+ name: '鍒嗘壒鍏ュ簱',
+ type: 'primary',
+ value: '鍒嗘壒鍏ュ簱',
+ onClick: async function () {
+ console.log('鍒嗘壒鍏ュ簱鎸夐挳琚偣鍑伙紝寮�濮嬫牎楠�');
+ const selectedRows = this.$refs.table.getSelected();
+
+ // 鏍¢獙1锛氭槸鍚﹂�変腑琛岋紙鑷冲皯閫夋嫨涓�鏉★級
+ if (selectedRows.length === 0) {
+ console.log('鏍¢獙涓嶉�氳繃锛氭湭閫変腑浠讳綍鍗曟嵁');
+ ElMessage.warning('璇烽�夋嫨鑷冲皯涓�鏉″崟鎹�');
+ return;
+ }
+
+ // 鏀堕泦鎵�鏈夐�変腑鍗曟嵁鐨勭紪鍙凤紙杩囨护鏃犲崟鎹彿鐨勫紓甯歌锛�
+ const inboundOrderNos = selectedRows
+ .filter(row => row.inboundOrderNo)
+ .map(row => row.inboundOrderNo);
+
+ // 鏍¢獙2锛氭槸鍚︽湁鏈夋晥鍗曟嵁鍙�
+ if (inboundOrderNos.length === 0) {
+ console.log('鏍¢獙涓嶉�氳繃锛氶�変腑鍗曟嵁鏃犳湁鏁堢紪鍙�');
+ ElMessage.warning('閫変腑鐨勫崟鎹腑鏃犳湁鏁堢紪鍙凤紝璇烽噸鏂伴�夋嫨');
+ return;
+ }
+
+ try {
+ console.log('鍙戣捣鍒嗘壒鍏ュ簱璇锋眰锛屽弬鏁帮細', { inboundOrderNos});
+ const response = await http.post('/api/InboundOrder/BatchOrderFeedbackToMes', {
+ orderNos: inboundOrderNos,
+ inout:1
+ });
+
+ const { status, message, data } = response;
+ if (status) {
+ console.log('鍒嗘壒鍏ュ簱鎴愬姛锛屽悗绔繑鍥烇細', data);
+ ElMessage.success(`鍒嗘壒鍏ュ簱鎴愬姛锛佸叡澶勭悊${inboundOrderNos.length}鏉″崟鎹甡);
+ this.refresh(); // 鍏ュ簱鎴愬姛鍚庡埛鏂板垪琛紙澶嶇敤鍘熸湁閫昏緫锛�
+ } else {
+ console.log('鍒嗘壒鍏ュ簱澶辫触锛屽悗绔彁绀猴細', message);
+ ElMessage.error(message || data?.message || '鍒嗘壒鍏ュ簱澶辫触');
+ }
+ } catch (error) {
+ console.error('鍒嗘壒鍏ュ簱璇锋眰寮傚父锛�', error);
+ ElMessage.error('缃戠粶寮傚父鎴栨帴鍙i敊璇紝璇风◢鍚庨噸璇�');
+ }
+ }
+},
+ {
+ name: '绌烘墭鐩樺叆搴�',
+ type: 'primary',
+ value: '绌烘墭鐩樺叆搴�',
+ onClick: function () {
+ const mountNode = document.createElement('div');
+ document.body.appendChild(mountNode);
+
+ // 鍝嶅簲寮忚〃鍗曟暟鎹細鏂欑鐮佹敼涓哄彲閫夊~锛堝垵濮嬬┖瀛楃涓诧級
+ const formData = reactive({
+ boxCode: '' // 鏂欑鐮侊紙string绫诲瀷锛屽彲绌猴級
+ });
+
+ const vnode = createVNode(ElDialog, {
+ title: '绌烘墭鐩樺叆搴�',
+ width: '400px',
+ modelValue: true,
+ appendToBody: true,
+ 'onUpdate:modelValue': (isVisible) => {
+ if (!isVisible) {
+ render(null, mountNode);
+ document.body.removeChild(mountNode);
+ }
+ }
+ }, {
+ default: () => h(ElForm, {
+ model: formData,
+ rules: {
+ // 鏂欑鐮佹牎楠岋細浠呬繚鐣欏瓧绗︿覆绫诲瀷锛岀Щ闄ゅ繀濉姹傦紙绌哄�煎彲閫氳繃锛�
+ boxCode: [
+ { required: true, message: '璇疯緭鍏ユ枡绠辩爜', trigger: 'blur' },
+ { type: 'string', message: '鏂欑鐮佸繀椤讳负瀛楃涓�', trigger: 'blur' }
+ ]
+ },
+ ref: 'batchInForm'
+ }, [
+ // 鏂欑鐮佽緭鍏ラ」锛堝彲閫夊~锛�
+ h(ElFormItem, { label: '鏂欑鐮�', prop: 'boxCode',required:true }, [
+ h(ElInput, {
+ type: 'text',
+ modelValue: formData.boxCode,
+ 'onUpdate:modelValue': (val) => {
+ formData.boxCode = val;
+ }
+ })
+ ]),
+ // 搴曢儴鎸夐挳鍖猴紙淇濇寔涓嶅彉锛�
+ 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: async () => {
+ const formRef = vnode.component.refs.batchInForm;
+ try {
+ await formRef.validate(); // 绌哄�煎彲閫氳繃鏍¢獙
+ } catch (err) {
+ return;
+ }
+
+ // 鍏ュ簱鎺ュ彛鎻愪氦锛氭枡绠辩爜涓虹┖鏃朵紶閫掔┖瀛楃涓诧紝鍚庣闇�鏀寔璇ュ瓧娈靛彲閫�
+ http.post('/api/InboundOrder/EmptyMaterielGroup', {
+ palletCode: formData.boxCode // 鍙┖锛氱敤鎴疯緭鍏ユ垨绌哄瓧绗︿覆
+ }).then(({ data, status, message }) => {
+ if (status) {
+ ElMessage.success(`鍏ュ簱鎴愬姛${formData.boxCode ? '锛屾枡绠辩爜锛�' + formData.boxCode : ''}`);
+ this.refresh();
+ render(null, mountNode);
+ document.body.removeChild(mountNode);
+ } else {
+ ElMessage.error(message || data?.message || '鍏ュ簱澶辫触');
+ }
+ }).catch(() => {
+ ElMessage.error('璇锋眰澶辫触锛岃绋嶅悗閲嶈瘯');
+ });
+ }
+ }, '纭畾')
+ ])
+ ])
+ });
+
+ vnode.appContext = this.$.appContext;
+ render(vnode, mountNode);
+ }
+}
], box: [], detail: [] }, //鎵╁睍鐨勬寜閽�
methods: {
//涓嬮潰杩欎簺鏂规硶鍙互淇濈暀涔熷彲浠ュ垹闄�
--
Gitblit v1.9.3