From b01d33fb2262722cda8aa5b40d2fa9a5dee5b9be Mon Sep 17 00:00:00 2001
From: heshaofeng <heshaofeng@hnkhzn.com>
Date: 星期二, 04 十一月 2025 17:19:28 +0800
Subject: [PATCH] 提交
---
项目代码/WIDESEA_WMSClient/src/extension/inbound/extend/Pallet.vue | 6
项目代码/WIDESEA_WMSClient/src/extension/outbound/outboundOrder.js | 166 +++++++++++
项目代码/WIDESEA_WMSClient/src/router/viewGird.js | 9
项目代码/WIDESEA_WMSClient/src/views/inbound/Dt_MaterielToMes.vue | 194 +++++++++++++
项目代码/WIDESEA_WMSClient/src/extension/inbound/Dt_MaterielToMes.js | 328 +++++++++++++++++++++++
项目代码/WIDESEA_WMSClient/src/extension/inbound/inboundOrder.js | 95 ++++++
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Basic/MaterielToMesController.cs | 18 +
7 files changed, 807 insertions(+), 9 deletions(-)
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/Dt_MaterielToMes.js" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/Dt_MaterielToMes.js"
new file mode 100644
index 0000000..844b013
--- /dev/null
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/Dt_MaterielToMes.js"
@@ -0,0 +1,328 @@
+
+import QRCode from 'qrcode'; // 浜岀淮鐮佺敓鎴愬簱
+import { ElDialog, ElButton, ElMessage ,ElImage,ElMessageBox } from 'element-plus';// 寮曞叆ElMessage锛岃В鍐虫彁绀烘棤鍙嶅簲
+import { h,createVNode, render } from 'vue';
+//姝s鏂囦欢鏄敤鏉ヨ嚜瀹氫箟鎵╁睍涓氬姟浠g爜锛屽彲浠ユ墿灞曚竴浜涜嚜瀹氫箟椤甸潰鎴栬�呴噸鏂伴厤缃敓鎴愮殑浠g爜
+let extension = {
+ components: {
+ //鏌ヨ鐣岄潰鎵╁睍缁勪欢
+ gridHeader: '',
+ gridBody: '',
+ gridFooter: '',
+ //鏂板缓銆佺紪杈戝脊鍑烘鎵╁睍缁勪欢
+ modelHeader: '',
+ modelBody: '',
+ modelFooter: ''
+ },
+ tableAction: '', //鎸囧畾鏌愬紶琛ㄧ殑鏉冮檺(杩欓噷濉啓琛ㄥ悕,榛樿涓嶇敤濉啓)
+ buttons: { view: [{
+ name: '鐢熸垚浜岀淮鐮�',
+ type: 'success',
+ value: '鐢熸垚浜岀淮鐮�',
+ onClick: async function () {
+ // 1. 鏍¢獙閫変腑琛�
+ const selectedRows = this.$refs.table.getSelected();
+ if (selectedRows.length === 0) {
+ ElMessage.warning('璇峰厛閫夋嫨涓�琛屾暟鎹�');
+ return;
+ }
+ if (selectedRows.length > 1) {
+ ElMessage.warning('浠呮敮鎸侀�夋嫨涓�琛屾暟鎹敓鎴愪簩缁寸爜');
+ return;
+ }
+
+ // 2. 鑾峰彇鍗曟嵁缂栧彿
+ const newMaterialBarCode = selectedRows[0].newMaterialBarCode;
+ if (!newMaterialBarCode) {
+ ElMessage.error('閫変腑鐨勬暟鎹腑鏈壘鍒板崟鎹紪鍙�');
+ return;
+ }
+
+ // 3. 鑾峰彇鍗曟嵁鏄庣粏鏁版嵁锛堟柊澧烇細閫氳繃鍗曟嵁缂栧彿鑾峰彇QtyTrans銆丮aterialCode銆丮aterialName锛�
+ // let detailList = [];
+ // const loading = ElLoading.service({ text: '鑾峰彇鍗曟嵁鏄庣粏涓�...' });
+ // try {
+ // const res = await http.post('/api/DocumentDetail/details', { transNo: transNo });
+ // // 鏍¢獙杩斿洖鏍煎紡锛堝繀椤绘槸鏁扮粍涓旇嚦灏戞湁涓�鏉℃暟鎹級
+ // if (!res.status || !Array.isArray(res.data) || res.data.length === 0) {
+ // throw new Error('鏈煡璇㈠埌鍗曟嵁鏄庣粏鏁版嵁');
+ // }
+ // detailList = res.data;
+
+ // // 鏍¢獙姣忔潯鏄庣粏鐨勫繀濉瓧娈�
+ // detailList.forEach((item, index) => {
+ // if (!item.qtyTrans || !item.materialCode || !item.materialName) {
+ // throw new Error(`绗�${index + 1}鏉℃槑缁嗘暟鎹笉瀹屾暣`);
+ // }
+ // });
+ // } catch (err) {
+ // ElMessage.error(err.message || '鑾峰彇鍗曟嵁鏄庣粏澶辫触');
+ // loading.close();
+ // return;
+ // } finally {
+ // loading.close();
+ // }
+
+ // 4. 鐢熸垚浜岀淮鐮�
+ let qrCodeUrl = '';
+ try {
+ qrCodeUrl = await QRCode.toDataURL(newMaterialBarCode, {
+ width: 200, // 浜岀淮鐮佸ぇ灏忛�傞厤甯冨眬
+ margin: 1
+ });
+ } catch (err) {
+ ElMessage.error('浜岀淮鐮佺敓鎴愬け璐ワ紝璇烽噸璇�');
+ console.error('浜岀淮鐮佺敓鎴愰敊璇細', err);
+ return;
+ }
+
+ // 5. 鍒涘缓寮圭獥
+ const mountNode = document.createElement('div');
+ document.body.appendChild(mountNode);
+
+ // 娣诲姞鎵撳嵃涓撶敤鏍峰紡
+ const addPrintStyle = () => {
+ const style = document.createElement('style');
+ style.id = 'qr-print-style';
+ style.textContent = `
+ @media print {
+ body > *:not(.print-container) { display: none !important; }
+ .print-container {
+ position: fixed !important;
+ top: 50px !important;
+ left: 50px !important;
+ width: 90% !important;
+ height: auto !important;
+ }
+ /* 鎵撳嵃鍐呭甯冨眬 */
+ .print-content {
+ display: flex !important;
+ flex-direction: column !important;
+ gap: 20px !important;
+ }
+ .qr-wrapper {
+ align-self: flex-start !important; /* 浜岀淮鐮侀潬宸� */
+ }
+ .detail-fields {
+ display: flex !important;
+ justify-content: space-around !important; /* 瀛楁鍧囧寑鍒嗗竷 */
+ width: 100% !important;
+ margin-top: 20px !important;
+ font-size: 16px !important;
+ }
+ .field-item {
+ text-align: center !important;
+ padding: 10px !important;
+ border: 1px solid #eee !important;
+ border-radius: 4px !important;
+ width: 30% !important; /* 姣忎釜瀛楁鍗�1/3瀹藉害 */
+ }
+ .field-label {
+ font-weight: bold !important;
+ margin-bottom: 5px !important;
+ display: block !important;
+ }
+ }
+ `;
+ document.head.appendChild(style);
+ return style;
+ };
+
+ // 鎵撳嵃鍑芥暟
+ const printQrCode = () => {
+ // 鍒涘缓鎵撳嵃瀹瑰櫒
+ const printContainer = document.createElement('div');
+ printContainer.className = 'print-container';
+ printContainer.style = 'position:fixed; top:-9999px; left:-9999px;';
+ document.body.appendChild(printContainer);
+
+ // 濉厖鎵撳嵃鍐呭锛堝竷灞�锛氫簩缁寸爜宸︿笂瑙� + 涓変釜瀛楁鍧囧寑鍒嗗竷锛�
+ printContainer.innerHTML = `
+ <div class="print-content">
+ <!-- 浜岀淮鐮侊紙宸︿笂瑙掞級 -->
+ <div class="qr-wrapper">
+ <img src="${qrCodeUrl}" style="width: 200px; height: 200px;" />
+ <p style="margin-top: 10px; font-size: 16px;">鍗曟嵁缂栧彿锛�${newMaterialBarCode}</p>
+ </div>
+
+ <!-- 鏄庣粏瀛楁锛堝潎鍖�鍒嗗竷锛� -->
+ <div class="detail-fields">
+ <div class="field-item">
+ <span class="field-label">浜ゆ槗鏁伴噺</span>
+ <span>${detailList[0].qtyTrans}</span>
+ </div>
+ <div class="field-item">
+ <span class="field-label">鐗╂枡缂栫爜</span>
+ <span>${detailList[0].materialCode}</span>
+ </div>
+ <div class="field-item">
+ <span class="field-label">鐗╂枡鍚嶇О</span>
+ <span>${detailList[0].materialName}</span>
+ </div>
+ </div>
+ </div>
+ `;
+
+ // 娣诲姞鎵撳嵃鏍峰紡
+ const printStyle = addPrintStyle();
+
+ // 娓呯悊鍑芥暟锛堥槻姝㈤噸澶嶇Щ闄わ級
+ const cleanUp = () => {
+ if (printContainer.parentNode === document.body) {
+ document.body.removeChild(printContainer);
+ }
+ if (printStyle && printStyle.parentNode === document.head) {
+ document.head.removeChild(printStyle);
+ }
+ window.removeEventListener('afterprint', cleanUp);
+ };
+
+ // 鐩戝惉鎵撳嵃瀹屾垚
+ window.addEventListener('afterprint', cleanUp, { once: true });
+
+ // 瑙﹀彂鎵撳嵃
+ window.print();
+ };
+
+ // 寮圭獥缁勪欢锛堥瑙堝竷灞�锛�
+ const vnode = createVNode(ElDialog, {
+ title: '鍗曟嵁浜岀淮鐮佸強鏄庣粏',
+ width: '600px',
+ modelValue: true,
+ appendToBody: true,
+ 'onUpdate:modelValue': (isVisible) => {
+ if (!isVisible) {
+ const printStyle = document.getElementById('qr-print-style');
+ if (printStyle && printStyle.parentNode === document.head) {
+ document.head.removeChild(printStyle);
+ }
+ render(null, mountNode);
+ if (mountNode.parentNode === document.body) {
+ document.body.removeChild(mountNode);
+ }
+ }
+ }
+ }, {
+ default: () => [
+ // 棰勮鍖哄竷灞�锛堝拰鎵撳嵃甯冨眬涓�鑷达級
+ h('div', { style: { padding: '20px' } }, [
+ // 浜岀淮鐮侀瑙堬紙宸︿笂瑙掞級
+ h('div', { style: { marginBottom: '20px' } }, [
+ h(ElImage, {
+ src: qrCodeUrl,
+ alt: '鍗曟嵁浜岀淮鐮�',
+ style: { width: '200px', height: '200px' }
+ }),
+ h('p', { style: { marginTop: '10px', fontSize: '16px' } }, `鍗曟嵁缂栧彿锛�${newMaterialBarCode}`)
+ ]),
+ // 鏄庣粏瀛楁棰勮锛堝潎鍖�鍒嗗竷锛�
+ // h('div', { style: { display: 'flex', justifyContent: 'space-around', gap: '10px' } }, [
+ // h('div', { style: { textAlign: 'center', padding: '10px', border: '1px solid #eee', width: '30%' } }, [
+ // h('div', { style: { fontWeight: 'bold', marginBottom: '5px' } }, '浜ゆ槗鏁伴噺'),
+ // h('div', null, detailList[0].qtyTrans)
+ // ]),
+ // h('div', { style: { textAlign: 'center', padding: '10px', border: '1px solid #eee', width: '30%' } }, [
+ // h('div', { style: { fontWeight: 'bold', marginBottom: '5px' } }, '鐗╂枡缂栫爜'),
+ // h('div', null, detailList[0].materialCode)
+ // ]),
+ // h('div', { style: { textAlign: 'center', padding: '10px', border: '1px solid #eee', width: '30%' } }, [
+ // h('div', { style: { fontWeight: 'bold', marginBottom: '5px' } }, '鐗╂枡鍚嶇О'),
+ // h('div', null, detailList[0].materialName)
+ // ])
+ // ])
+ ])
+ ],
+ footer: () => h('div', null, [
+ h(ElButton, {
+ type: 'default',
+ onClick: () => {
+ const printStyle = document.getElementById('qr-print-style');
+ if (printStyle) document.head.removeChild(printStyle);
+ render(null, mountNode);
+ if (mountNode.parentNode === document.body) {
+ document.body.removeChild(mountNode);
+ }
+ }
+ }, '鍏抽棴'),
+ h(ElButton, {
+ type: 'primary',
+ onClick: () => {
+ ElMessageBox.confirm(
+ '鏄惁鎵撳嵃璇ュ唴瀹癸紵',
+ '鎵撳嵃纭',
+ {
+ confirmButtonText: '纭鎵撳嵃',
+ cancelButtonText: '鍙栨秷',
+ type: 'info'
+ }
+ ).then(async () => {
+ try {
+ // 鎵ц鎵撳嵃骞剁瓑寰呭畬鎴愶紝鎹曡幏鍙兘鐨勯敊璇�
+ await printQrCode();
+ setTimeout(() => {
+ render(null, mountNode);
+ if (mountNode.parentNode === document.body) {
+ document.body.removeChild(mountNode);
+ }
+ }, 500);
+ } catch (printErr) {
+ // 鏄剧ず鐪熷疄閿欒锛堣�岄潪鈥滃凡鍙栨秷鈥濓級
+ ElMessage.error(`鎵撳嵃澶辫触锛�${printErr.message || '鏈煡閿欒'}`);
+ console.error('鎵撳嵃閿欒锛�', printErr);
+ }
+ }).catch((err) => {
+ // 浠呯敤鎴蜂富鍔ㄥ彇娑堟椂鎵嶆樉绀衡�滃凡鍙栨秷鈥�
+ if (err === 'cancel' || err.name === 'CanceledError') {
+ ElMessage.info('宸插彇娑堟墦鍗�');
+ }
+ });
+ }
+ }, '鎵撳嵃')
+ ])
+ });
+
+ vnode.appContext = this.$.appContext;
+ render(vnode, mountNode);
+ }
+}], box: [], detail: [] }, //鎵╁睍鐨勬寜閽�
+ methods: {
+ //涓嬮潰杩欎簺鏂规硶鍙互淇濈暀涔熷彲浠ュ垹闄�
+ onInit() {
+ },
+ onInited() {
+ //妗嗘灦鍒濆鍖栭厤缃悗
+ //濡傛灉瑕侀厤缃槑缁嗚〃,鍦ㄦ鏂规硶鎿嶄綔
+ //this.detailOptions.columns.forEach(column=>{ });
+ },
+ searchBefore(param) {
+ //鐣岄潰鏌ヨ鍓�,鍙互缁檖aram.wheres娣诲姞鏌ヨ鍙傛暟
+ //杩斿洖false锛屽垯涓嶄細鎵ц鏌ヨ
+ return true;
+ },
+ searchAfter(result) {
+ //鏌ヨ鍚庯紝result杩斿洖鐨勬煡璇㈡暟鎹�,鍙互鍦ㄦ樉绀哄埌琛ㄦ牸鍓嶅鐞嗚〃鏍肩殑鍊�
+ return true;
+ },
+ addBefore(formData) {
+ //鏂板缓淇濆瓨鍓峟ormData涓哄璞★紝鍖呮嫭鏄庣粏琛紝鍙互缁欑粰琛ㄥ崟璁剧疆鍊硷紝鑷繁杈撳嚭鐪媐ormData鐨勫��
+ return true;
+ },
+ updateBefore(formData) {
+ //缂栬緫淇濆瓨鍓峟ormData涓哄璞★紝鍖呮嫭鏄庣粏琛ㄣ�佸垹闄よ鐨処d
+ return true;
+ },
+ rowClick({ row, column, event }) {
+ //鏌ヨ鐣岄潰鐐瑰嚮琛屼簨浠�
+ this.$refs.table.$refs.table.toggleRowSelection(row); //鍗曞嚮琛屾椂閫変腑褰撳墠琛�;
+ },
+ modelOpenAfter(row) {
+ //鐐瑰嚮缂栬緫銆佹柊寤烘寜閽脊鍑烘鍚庯紝鍙互鍦ㄦ澶勫啓閫昏緫锛屽锛屼粠鍚庡彴鑾峰彇鏁版嵁
+ //(1)鍒ゆ柇鏄紪杈戣繕鏄柊寤烘搷浣滐細 this.currentAction=='Add';
+ //(2)缁欏脊鍑烘璁剧疆榛樿鍊�
+ //(3)this.editFormFields.瀛楁='xxx';
+ //濡傛灉闇�瑕佺粰涓嬫媺妗嗚缃粯璁ゅ�硷紝璇烽亶鍘唗his.editFormOptions鎵惧埌瀛楁閰嶇疆瀵瑰簲data灞炴�х殑key鍊�
+ //鐪嬩笉鎳傚氨鎶婅緭鍑虹湅锛歝onsole.log(this.editFormOptions)
+ }
+ }
+};
+export default extension;
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/Pallet.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/Pallet.vue"
index 8a38acf..bad8e33 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/Pallet.vue"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/Pallet.vue"
@@ -37,11 +37,11 @@
<!-- 鎵樼洏鏉$爜杈撳叆 -->
<div class="input-wrapper custom-input-group">
- <div class="input-label">鎵樼洏鏉$爜</div>
+ <div class="input-label">鏂欑鐮�</div>
<el-input
ref="trayInput"
v-model="trayBarcode"
- placeholder="璇锋壂鎻忔垨杈撳叆鎵樼洏鏉$爜鍚庢寜鍥炶溅閿�"
+ placeholder="璇锋壂鎻忔垨杈撳叆鏂欑鐮佸悗鎸夊洖杞﹂敭"
clearable
@keyup.enter.native="handleTraySubmit"
@clear="handleTrayClear"
@@ -49,7 +49,7 @@
class="custom-input"
>
<template slot="prepend">
- <span>鎵樼洏鏉$爜</span>
+ <span>鏂欑銆傜爜</span>
</template>
<template slot="append">
<el-button
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..fb1ded8 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: {
@@ -46,6 +46,97 @@
this.$emit('openPalletDialog', targetRow.inboundOrderNo);
}
},
+ {
+ 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: [
+ { type: 'string', message: '鏂欑鐮佸繀椤讳负瀛楃涓�', trigger: 'blur' }
+ ]
+ },
+ ref: 'batchInForm'
+ }, [
+ // 鏂欑鐮佽緭鍏ラ」锛堝彲閫夊~锛�
+ h(ElFormItem, { label: '鏂欑鐮�', prop: 'boxCode' }, [
+ h(ElInput, {
+ type: 'text',
+ placeholder: '鍙�夎緭鍏ユ枡绠辩爜锛屼笉濉垯榛樿鍏ュ簱', // 鎻愮ず鍙┖瑙勫垯
+ 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/wmsTask/BatchInboundTask', {
+ boxCode: 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: {
//涓嬮潰杩欎簺鏂规硶鍙互淇濈暀涔熷彲浠ュ垹闄�
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/outbound/outboundOrder.js" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/outbound/outboundOrder.js"
index 52c18aa..664b84e 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/outbound/outboundOrder.js"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/outbound/outboundOrder.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 ,ElSelect, ElOption} from 'element-plus';
import gridBody from './extend/outOrderDetail.vue'
let extension = {
@@ -42,7 +42,169 @@
createDate: selectedRows[0].createDate || new Date().toLocaleDateString() // 鍑哄簱鏃ユ湡
});
}
+ },
+ {
+ name: '绌烘墭鐩樺嚭搴�',
+ type: 'primary',
+ value: '绌烘墭鐩樺嚭搴�',
+ onClick: function () {
+
+ // 2. 鐢熸垚3-12绔欏彴閫夐」锛堥粯璁ょ涓�涓负绔欏彴3锛�
+ const platformOptions = Array.from({ length: 10 }, (_, i) => {
+ const num = i + 3;
+ return { label: `绔欏彴${num}`, value: `PLATFORM${num.toString().padStart(3, '0')}` };
+ });
+
+ const mountNode = document.createElement('div');
+ document.body.appendChild(mountNode);
+
+ // 3. 琛ㄥ崟鏁版嵁锛堥粯璁ら�変腑绔欏彴3锛�
+ const formData = reactive({
+ palletCode: '',
+ selectedPlatform: platformOptions[0].value // 榛樿缁戝畾绔欏彴3鐨剉alue
+ });
+
+ const vnode = createVNode(ElDialog, {
+ title: '绌烘墭鐩樺嚭搴�',
+ width: '500px', // 寰皟瀹藉害鏇村崗璋�
+ modelValue: true,
+ appendToBody: true,
+ 'onUpdate:modelValue': (isVisible) => {
+ if (!isVisible) {
+ render(null, mountNode);
+ document.body.removeChild(mountNode);
+ }
+ },
+ style: {
+ padding: '20px 0', // 寮圭獥鍐呬笂涓嬬暀鐧斤紝閬垮厤鍐呭绱ц创杈规
+ borderRadius: '8px' // 杞诲井鍦嗚锛屾彁鍗囪川鎰�
}
+ }, {
+ default: () => h(ElForm, {
+ model: formData,
+ rules: {
+ palletCode: [
+ { type: 'string', message: '鏂欑鍙峰繀椤讳负瀛楃涓�', trigger: 'blur' }
+ ],
+ selectedPlatform: [
+ { required: true, message: '璇烽�夋嫨鍑哄簱绔欏彴', trigger: 'change' }
+ ]
+ },
+ ref: 'batchOutForm',
+ labelWidth: '100px', // 鍥哄畾鏍囩瀹藉害锛岀‘淇濆榻�
+ style: {
+ padding: '0 30px', // 琛ㄥ崟宸﹀彸鐣欑櫧锛屽鍔犲懠鍚告劅
+ }
+ }, [
+ // 鍑哄簱绔欏彴锛堜笂锛屼紭鍖栨牱寮忥級
+ h(ElFormItem, {
+ label: '鍑哄簱绔欏彴',
+ prop: 'selectedPlatform',
+ style: {
+ marginBottom: '24px' // 琛ㄥ崟椤归棿璺濅紭鍖�
+ }
+ }, [
+ h(ElSelect, {
+ placeholder: '璇烽�夋嫨鍑哄簱绔欏彴锛�3-12锛�',
+ modelValue: formData.selectedPlatform,
+ 'onUpdate:modelValue': (val) => {
+ formData.selectedPlatform = val;
+ },
+ style: {
+ width: '100%',
+ height: '40px', // 缁熶竴缁勪欢楂樺害
+ borderRadius: '4px',
+ borderColor: '#dcdfe6'
+ }
+ }, platformOptions.map(platform =>
+ h(ElOption, { label: platform.label, value: platform.value })
+ ))
+ ]),
+ // 鎵樼洏缂栧彿锛堜笅锛屼紭鍖栨牱寮忥級
+ h(ElFormItem, {
+ label: '鏂欑鍙�',
+ prop: 'palletCode',
+ style: {
+ marginBottom: '16px' // 涓庢寜閽尯鎷夊紑鍚堢悊闂磋窛
+ }
+ }, [
+ h(ElInput, {
+ type: 'text',
+ placeholder: '鍙�夎緭鍏ユ枡绠卞彿锛屼笉濉垯鑷姩鍒嗛厤绌烘枡绠�',
+ modelValue: formData.palletCode,
+ 'onUpdate:modelValue': (val) => {
+ formData.palletCode = val;
+ },
+ style: {
+ width: '100%',
+ height: '40px', // 涓庨�夋嫨鍣ㄩ珮搴︾粺涓�
+ borderRadius: '4px',
+ borderColor: '#dcdfe6'
+ },
+ attrs: {
+ placeholderStyle: 'color: #909399;' // 鍗犱綅鏂囧瓧棰滆壊浼樺寲锛屾洿鏌斿拰
+ }
+ })
+ ]),
+ // 搴曢儴鎸夐挳鍖猴紙鏍峰紡浼樺寲锛�
+ h('div', {
+ style: {
+ textAlign: 'right',
+ marginTop: '8px',
+ paddingRight: '4px' // 鎸夐挳涓庡彸渚у榻愬井璋�
+ }
+ }, [
+ h(ElButton, {
+ type: 'text',
+ onClick: () => {
+ render(null, mountNode);
+ document.body.removeChild(mountNode);
+ ElMessage.info('鍙栨秷鍑哄簱鎿嶄綔');
+ },
+ style: {
+ marginRight: '8px',
+ color: '#606266' // 鍙栨秷鎸夐挳棰滆壊浼樺寲
+ }
+ }, '鍙栨秷'),
+ h(ElButton, {
+ type: 'primary',
+ onClick: async () => {
+ const formRef = vnode.component.refs.batchOutForm;
+ try {
+ await formRef.validate();
+ } catch (err) {
+ return;
+ }
+
+ http.post('/api/wmsTask/BatchOutboundTask', {
+ palletCode: formData.palletCode,
+ platform: formData.selectedPlatform
+ }).then(({ data, status, message }) => {
+ if (status) {
+ ElMessage.success(`鍑哄簱鎴愬姛锛屽垎閰嶇殑鎵樼洏缂栧彿锛�${data.palletCode || formData.palletCode}`);
+ this.refresh();
+ render(null, mountNode);
+ document.body.removeChild(mountNode);
+ } else {
+ ElMessage.error(message || data?.message || '鍑哄簱澶辫触');
+ }
+ }).catch(() => {
+ ElMessage.error('璇锋眰澶辫触锛岃绋嶅悗閲嶈瘯');
+ });
+ },
+ style: {
+ borderRadius: '4px',
+ padding: '8px 20px' // 鎸夐挳鍐呰竟璺濅紭鍖栵紝鐐瑰嚮鍖哄煙鏇磋垝閫�
+ }
+ }, '纭畾')
+ ])
+ ])
+ });
+
+ vnode.appContext = this.$.appContext;
+ render(vnode, mountNode);
+ }
+}
], box: [], detail: [] }, //鎵╁睍鐨勬寜閽�
methods: {
//涓嬮潰杩欎簺鏂规硶鍙互淇濈暀涔熷彲浠ュ垹闄�
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/router/viewGird.js" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/router/viewGird.js"
index ccb09c9..11c8fe5 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/router/viewGird.js"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/router/viewGird.js"
@@ -99,7 +99,7 @@
name: 'stockQuantityChangeRecord',
component: () => import('@/views/record/stockQuantityChangeRecord.vue')
}, {
- path: '/locationStatusChangeRecord',
+ path: '/LocationStatusChangeRecord',
name: 'locationStatusChangeRecord',
component: () => import('@/views/record/locationStatusChangeRecord.vue')
}, {
@@ -181,6 +181,11 @@
name: 'mesOutboundOrder',
component: () => import('@/views/outbound/mesOutboundOrder.vue')
}
+ , {
+ path: '/materielToMes',
+ name: 'Dt_MaterielToMes',
+ component: () => import('@/views/inbound/Dt_MaterielToMes.vue')
+ }
]
-export default viewgird
+export default viewgird
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/inbound/Dt_MaterielToMes.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/inbound/Dt_MaterielToMes.vue"
new file mode 100644
index 0000000..cb9c659
--- /dev/null
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/inbound/Dt_MaterielToMes.vue"
@@ -0,0 +1,194 @@
+<template>
+ <view-grid
+ ref="grid"
+ :columns="columns"
+ :detail="detail"
+ :editFormFields="editFormFields"
+ :editFormOptions="editFormOptions"
+ :searchFormFields="searchFormFields"
+ :searchFormOptions="searchFormOptions"
+ :table="table"
+ :extend="extend"
+ >
+ </view-grid>
+</template>
+<script>
+import extend from "@/extension/inbound/Dt_MaterielToMes.js";
+import { ref, defineComponent } from "vue";
+export default defineComponent({
+ setup() {
+ const table = ref({
+ key: "id",
+ footer: "鐗╂枡鍙樻洿绠$悊",
+ cnName: "鐗╂枡鍙樻洿淇℃伅",
+ name: "Dt_MaterielToMes",
+ url: "/MaterielToMes/",
+ sortOrder: "desc",
+ autoIncrementKey: true
+ });
+
+ const editFormFields = ref({
+ OldMaterialBarCode: "",
+ NewMaterialBarCode: "",
+ Unit: "",
+ factoryArea: "",
+ Qty: 0,
+ supplyCode: "",
+ warehouseCode: "",
+ BatchNo: "",
+ MaterielCode: ""
+ });
+
+ const searchFormFields = ref({
+ OldMaterialBarCode: "",
+ NewMaterialBarCode: "",
+ BatchNo: "",
+ MaterielCode: "",
+ supplyCode: "",
+ factoryArea: ""
+ });
+
+ const searchFormOptions = ref([
+ [
+ { title: "鏃х墿鏂欑紪鍙�", field: "OldMaterialBarCode", type: "text", placeholder: "妯$硦鎼滅储鏃х墿鏂欑紪鍙�" },
+ { title: "鏂扮墿鏂欑紪鍙�", field: "NewMaterialBarCode", type: "text", placeholder: "妯$硦鎼滅储鏂扮墿鏂欑紪鍙�" }
+ ],
+ [
+ { title: "鎵规鍙�", field: "BatchNo", type: "text", placeholder: "妯$硦鎼滅储鎵规鍙�" },
+ { title: "鐗╂枡缂栧彿", field: "MaterielCode", type: "text", placeholder: "妯$硦鎼滅储鐗╂枡缂栧彿" }
+ ],
+ [
+ { title: "渚涘簲鍟咺D", field: "supplyCode", type: "text", placeholder: "鎼滅储渚涘簲鍟咺D" },
+ { title: "鍘傚尯", field: "factoryArea", type: "text", placeholder: "鎼滅储鍘傚尯" }
+ ]
+ ]);
+
+ const editFormOptions = ref([
+ [
+ { title: "鏃х墿鏂欑紪鍙�", field: "OldMaterialBarCode" },
+ { title: "鏂扮墿鏂欑紪鍙�", field: "NewMaterialBarCode" }
+ ],
+ [
+ { title: "鍗曚綅", field: "Unit" },
+ { title: "鍘傚尯", field: "factoryArea" },
+ ],
+ [
+ { title: "鏁伴噺", field: "Qty" },
+ { title: "渚涘簲鍟唅d", field: "supplyCode" }
+ ],
+ [
+ { title: "浠撳簱id", field: "warehouseCode" },
+ { title: "鎵规鍙�", field: "BatchNo" }
+ ],
+ [
+ { title: "鐗╂枡缂栧彿", field: "MaterielCode" }
+ ]
+ ]);
+
+ const columns = ref([
+ {
+ field: "Id",
+ title: "ID",
+ type: "int",
+ width: 80,
+ hidden: true,
+ readonly: true,
+ required: false,
+ edit: false, // 绂佹鍙備笌琛ㄥ崟
+ align: "left"
+ },
+ {
+ field: "oldMaterialBarCode",
+ title: "鏃х墿鏂欑紪鍙�",
+ type: "string",
+ width: 180,
+ align: "left",
+ sort: true
+ },
+ {
+ field: "newMaterialBarCode",
+ title: "鏂扮墿鏂欑紪鍙�",
+ type: "string",
+ width: 180,
+ align: "left",
+ sort: true
+ },
+ {
+ field: "unit",
+ title: "鍗曚綅",
+ type: "string",
+ width: 100,
+ align: "left",
+ sort: true
+ },
+ {
+ field: "factoryArea",
+ title: "鍘傚尯",
+ type: "string",
+ width: 120,
+ align: "left",
+ sort: true
+ },
+ {
+ field: "qty",
+ title: "鏁伴噺",
+ type: "decimal",
+ width: 100,
+ align: "right",
+ sort: true
+ },
+ {
+ field: "supplyCode",
+ title: "渚涘簲鍟咺D",
+ type: "string",
+ width: 150,
+ align: "left",
+ sort: true
+ },
+ {
+ field: "warehouseCode",
+ title: "浠撳簱ID",
+ type: "string",
+ width: 150,
+ align: "left",
+ sort: true
+ },
+ {
+ field: "BatchNo",
+ title: "鎵规鍙�",
+ type: "string",
+ width: 180,
+ align: "left",
+ sort: true
+ },
+ {
+ field: "MaterielCode",
+ title: "鐗╂枡缂栧彿",
+ type: "string",
+ width: 180,
+ align: "left",
+ sort: true
+ }
+ ]);
+
+ const detail = ref({
+ cnName: "鐗╂枡鍙樻洿璇︽儏",
+ table: "MaterielChangeDetail",
+ columns: [],
+ sortName: "",
+ key: ""
+ });
+
+ return {
+ table,
+ extend,
+ searchFormFields,
+ searchFormOptions,
+ columns,
+ detail,
+ editFormFields,
+ editFormOptions
+ };
+ }
+});
+</script>
\ No newline at end of file
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Basic/MaterielToMesController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Basic/MaterielToMesController.cs"
new file mode 100644
index 0000000..623ef98
--- /dev/null
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Basic/MaterielToMesController.cs"
@@ -0,0 +1,18 @@
+锘縰sing Microsoft.AspNetCore.Mvc;
+using WIDESEA_Core.BaseController;
+using WIDESEA_Core.BaseRepository;
+using WIDESEA_IBasicService;
+using WIDESEA_Model.Models.Basic;
+
+namespace WIDESEA_WMSServer.Controllers.Basic
+{
+
+ [Route("api/MaterielToMes")]
+ [ApiController]
+ public class MaterielToMesController : ApiBaseController<IMaterielToMesService, Dt_MaterielToMes>
+ {
+ public MaterielToMesController(IMaterielToMesService service) : base(service)
+ {
+ }
+ }
+}
--
Gitblit v1.9.3