From 266e4bf654c55ce2f7e9271048e4625f1b8b49f6 Mon Sep 17 00:00:00 2001
From: heshaofeng <heshaofeng@hnkhzn.com>
Date: 星期一, 29 十二月 2025 14:36:08 +0800
Subject: [PATCH] Merge branch 'htq20251215' of http://115.159.85.185:8098/r/ZhongRui/ALDbanyunxiangmu into htq20251215
---
项目代码/WIDESEA_WMSClient/src/extension/outbound/outboundOrder.js | 220 ++++++++++++++++++++++++++++++++++++++++++++++++------
1 files changed, 195 insertions(+), 25 deletions(-)
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 bbd9987..6fa1f60 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"
@@ -3,7 +3,6 @@
import http from '@/api/http.js'
import { h, createVNode, render, reactive, ref } from 'vue';
import { ElDialog, ElForm, ElFormItem, ElInput, ElButton, ElMessage, ElSelect, ElOption } from 'element-plus';
-
import gridBody from './extend/outOrderDetail.vue'
import gridHeader from './extend/NoStockOut.vue'
import gridFooter from './extend/EmptyTrayOutbound.vue'
@@ -325,8 +324,6 @@
table.clearSelection();
table.toggleRowSelection(row, true);
}
- const rowId = row.id;
- console.log(rowId);
this.$refs.gridBody.open(row);
}
});
@@ -340,15 +337,18 @@
if (!selectedRows || selectedRows.length === 0) {
return _this.$Message.warning('璇峰厛閫夋嫨闇�瑕佸鐞嗙殑鍗曟嵁');
}
- const requestParams = {
- orderNos: selectedRows.map(row => row.orderNo),
- inout: 2
- };
+ if (selectedRows.length > 1) {
+ return _this.$Message.warning('璇烽�夋嫨涓�鏉℃暟鎹�');
+ }
+ // const requestParams = {
+ // orderNos: selectedRows.map(row => row.orderNo),
+ // inout: 2
+ // };
_this.http
- .post("api/InboundOrder/BatchOrderFeedbackToMes", requestParams, "鏁版嵁澶勭悊涓�...")
+ .post(`api/MesFeedback/OutboundFeedback?orderNo=${selectedRows[0].orderNo}`, {}, "鏁版嵁澶勭悊涓�...")
.then((x) => {
if (x.status) {
- _this.$Message.success('鍒嗘壒鍑哄簱鍥炶皟瀹屾垚');
+ _this.$Message.success(x.message);
_this.refresh();
} else {
return _this.$Message.error(x.message);
@@ -356,7 +356,7 @@
})
.catch((error) => {
// 澧炲姞寮傚父鎹曡幏锛屽鐞嗙綉缁滈敊璇瓑鎯呭喌
- _this.$Message.error('璇锋眰澶辫触锛�' + (error.message || '鏈煡閿欒'));
+ //_this.$Message.error('璇锋眰澶辫触锛�' + (error.message || '鏈煡閿欒'));
});
};
}
@@ -367,12 +367,188 @@
}
}
+
+
var EmptyTrayOutboundBtn = this.buttons.find(x => x.value == "EmptyTrayOutbound");
- if (EmptyTrayOutboundBtn != null) {
- EmptyTrayOutboundBtn.onClick = () => {
- this.$refs.gridFooter.open();
- }
+ if (EmptyTrayOutboundBtn != null) {
+ EmptyTrayOutboundBtn.onClick = () => {
+ this.$refs.gridFooter.open();
}
+ }
+
+ let OrderOutBtn = this.buttons.find(x => x.value == 'OrderOut');
+if (OrderOutBtn) {
+ // 1. 鏀逛负绠ご鍑芥暟锛岀‘淇漷his鎸囧悜Vue缁勪欢瀹炰緥锛堝師鏅�氬嚱鏁皌his鎸囧悜鎸夐挳鏈韩锛�
+ OrderOutBtn.onClick = async () => {
+ // 鐜板湪this鏄疺ue缁勪欢瀹炰緥锛岃兘姝g‘鑾峰彇$refs
+ let rows = this.$refs.table.getSelected();
+ if (rows.length == 0) return this.$error("璇烽�夋嫨鏁版嵁!");
+ if (rows.length > 1) return this.$error("璇烽�夋嫨涓�鏉℃暟鎹�!");
+
+
+ // 纭繚閫変腑琛屾湁id锛堟牴鎹疄闄呰〃鏍兼暟鎹瓧娈佃皟鏁达紝姣斿rows[0].detailId绛夛級
+ const selectedId = rows[0].id || rows[0].detailId;
+ if (!selectedId) return this.$error("閫変腑鏁版嵁缂哄皯蹇呰ID瀛楁!");
+
+ if(rows[0].orderStatus!=0&&rows[0].orderStatus!=1)return this.$error("璇ュ崟鎹凡缁忓畬鎴�");
+
+ const platformOptions = [
+ { label: "绔欏彴2", value: "2-1" },
+ { label: "绔欏彴3", value: "3-1" },
+ ];
+ const mountNode = document.createElement("div");
+ document.body.appendChild(mountNode);
+
+ const formData = reactive({
+ selectedPlatform: platformOptions[0].value,
+ });
+
+ 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: {
+ selectedPlatform: [
+ { required: true, message: "璇烽�夋嫨鍑哄簱绔欏彴", trigger: "change" },
+ ],
+ },
+ ref: "outboundForm", // 琛ㄥ崟ref
+ 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("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 () => {
+ // 2. 纭繚琛ㄥ崟ref宸叉寕杞斤紙鐢╪extTick閬垮厤鑾峰彇涓嶅埌锛�
+ await this.$nextTick();
+ const formRef = vnode.component.refs.outboundForm;
+
+ if (!formRef) {
+ ElMessage.error("琛ㄥ崟鍒濆鍖栧け璐ワ紝璇烽噸璇�");
+ return;
+ }
+
+ try {
+ await formRef.validate();
+ } catch (err) {
+ return;
+ }
+ var param = rows[0].orderNo;
+ const requestParams = {
+ detailIds: [],
+ outboundTargetLocation: formData.selectedPlatform,
+ outboundQuantity: 1,
+ operator: this.currentOperator || "admin",
+ orderNo: param,
+ };
+
+ try {
+
+ const x = await this.http.post(
+ "api/Outbound/ProcessPickingOutbound",
+ requestParams,
+ "鏁版嵁澶勭悊涓�"
+ );
+
+ if (!x.status) {
+ ElMessage.error(x.message || "鎿嶄綔澶辫触");
+ return;
+ }
+
+ ElMessage.success("鎿嶄綔鎴愬姛");
+ this.showDetialBox = false;
+ this.$emit("parentCall", ($vue) => {
+ $vue.getData();
+ });
+ } catch (error) {
+ // 5. 鎵撳紑閿欒鎹曡幏锛屾柟渚胯皟璇�
+ console.error("鍑哄簱鎺ュ彛璇锋眰澶辫触锛�", error);
+ ElMessage.error("璇锋眰澶辫触锛岃绋嶅悗閲嶈瘯");
+ } finally {
+ // 鏃犺鎴愬姛澶辫触锛岄兘鍏抽棴寮圭獥
+ render(null, mountNode);
+ document.body.removeChild(mountNode);
+ }
+ },
+ style: {
+ borderRadius: "4px",
+ padding: "8px 20px",
+ },
+ }, "纭畾鍑哄簱"),
+ ]),
+ ]),
+ }
+ );
+
+ vnode.appContext = this.$.appContext;
+ render(vnode, mountNode);
+ };
+}
},
onInited() {
@@ -381,19 +557,9 @@
//this.detailOptions.columns.forEach(column=>{ });
},
searchBefore(param) {
+
//鐣岄潰鏌ヨ鍓�,鍙互缁檖aram.wheres娣诲姞鏌ヨ鍙傛暟
//杩斿洖false锛屽垯涓嶄細鎵ц鏌ヨ
-
- let wheres = [{
- 'name': 'orderType',
- 'value': '0',
- 'displayType': 'text'
- }];
-
-
- param.wheres.push(...wheres);
- return true;
-
return true;
},
searchAfter(result) {
@@ -413,6 +579,10 @@
this.$refs.table.$refs.table.toggleRowSelection(row); //鍗曞嚮琛屾椂閫変腑褰撳墠琛�;
},
modelOpenAfter(row) {
+ if (this.currentAction === 'Add') { // 鍒ゆ柇褰撳墠鏄柊寤烘搷浣�
+ const currentUser = this.$store.state.userInfo?.userTrueName || 'system';
+ this.editFormFields.operator = currentUser;
+ }
//鐐瑰嚮缂栬緫銆佹柊寤烘寜閽脊鍑烘鍚庯紝鍙互鍦ㄦ澶勫啓閫昏緫锛屽锛屼粠鍚庡彴鑾峰彇鏁版嵁
//(1)鍒ゆ柇鏄紪杈戣繕鏄柊寤烘搷浣滐細 this.currentAction=='Add';
//(2)缁欏脊鍑烘璁剧疆榛樿鍊�
--
Gitblit v1.9.3