From 1378fc4cd7abc24ed3a982e09437c2c8a74e9f2f Mon Sep 17 00:00:00 2001
From: 647556386 <647556386@qq.com>
Date: 星期二, 27 一月 2026 19:06:32 +0800
Subject: [PATCH] 代码优化
---
项目代码/WIDESEA_WMSClient/src/views/inbound/Dt_AllocateOrder.vue | 192 +++++++++++++++++++++++++++++------------------
1 files changed, 118 insertions(+), 74 deletions(-)
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/inbound/Dt_AllocateOrder.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/inbound/Dt_AllocateOrder.vue"
index 9fddac1..d972c31 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/inbound/Dt_AllocateOrder.vue"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/inbound/Dt_AllocateOrder.vue"
@@ -1,6 +1,7 @@
<template>
<view-grid
- ref="gridRef"
+ ref="grid"
+ @openPalletDialog="handleOpenPalletDialog"
:columns="columns"
:detail="detail"
:editFormFields="editFormFields"
@@ -11,30 +12,36 @@
:extend="extend"
>
</view-grid>
+ <!-- 2. 缁勭洏寮圭獥锛氱‘淇漰rops鍜屼簨浠剁粦瀹氭纭� -->
+ <PalletDialog
+ v-model:visible="palletVisible"
+ :docNo="currentPalletDocNo"
+ @back-success="handlePalletBackSuccess"
+ ></PalletDialog>
+
</template>
-
-<script>
-import extend from "@/extension/inbound/Dt_AllocateOrder.js";
-import ViewGrid from '@/components/basic/ViewGrid/ViewGrid.vue';
+ <script>
+import extend from "@/extension/inbound/Dt_AllocateOrder.js";
+import ViewGrid from '@/components/basic/ViewGrid/ViewGrid.vue';
import { ref, defineComponent } from "vue";
-
+import PalletDialog from "@/extension/inbound/extend/AllocatedPallet.vue";
export default defineComponent({
- components: {
- viewGrid: ViewGrid,
- PalletDialog
+ components: {
+ // 鍏抽敭淇2锛氱粍浠舵敞鍐屽悕涓庢ā鏉挎爣绛惧悕閫傞厤锛坘ebab-case瀵瑰簲view-grid锛�
+ viewGrid: ViewGrid, // 娉ㄥ唽涓簁ebab-case锛屾ā鏉跨敤<view-grid>
+ PalletDialog // 娉ㄥ唽缁勭洏寮圭獥
+
},
setup() {
- // 琛ㄦ牸鍩虹閰嶇疆锛氬榻愯皟鎷ㄥ崟瀹炰綋
const table = ref({
key: "id",
footer: "Foots",
cnName: "璋冩嫧鍗�",
- name: "allocateOrder",
- url: "/allocateOrder/", // 鍚庣鎺ュ彛璺緞闇�涓庤皟鎷ㄥ崟鎺ュ彛鍖归厤
+ name: "AllocateOrder",
+ url: "/AllocateOrder/",
sortName: "id",
});
- // 缂栬緫琛ㄥ崟瀛楁锛氬搴擠t_AllocateOrder鍙紪杈戝睘鎬�
const editFormFields = ref({
orderNo: "",
upperOrderNo: "",
@@ -48,7 +55,6 @@
remark: "",
});
- // 缂栬緫琛ㄥ崟閰嶇疆锛氭寜瀹炰綋瀛楁绫诲瀷璁剧疆缁勪欢
const editFormOptions = ref([
[
{
@@ -72,7 +78,7 @@
title: "璁㈠崟绫诲瀷",
field: "orderType",
type: "select",
- dataKey: "allocateOrderType", // 璋冩嫧鍗曚笓灞炴灇涓緆ey
+ dataKey: "allocateOrderType",
data: [],
required: true,
},
@@ -88,7 +94,7 @@
title: "鏉ユ簮浠撳簱",
field: "fromWarehouse",
type: "select",
- dataKey: "warehouses", // 浠撳簱鏋氫妇key锛堝鐢ㄦ垨鍗曠嫭閰嶇疆锛�
+ dataKey: "warehouses",
data: [],
required: true,
},
@@ -121,65 +127,97 @@
],
]);
- // 鎼滅储琛ㄥ崟瀛楁锛氬搴擠t_AllocateOrder鏌ヨ灞炴��
+
+ // const searchFormFields = ref({
+ // orderNo: "",
+ // upperOrderNo: "",
+ // orderType: "117",
+ // orderStatus: "",
+ // createType: "",
+ // fromWarehouse: "",
+ // toWarehouse: "",
+ // factoryArea: "",
+ // creater: "",
+ // createDate: "",
+ // });
+
+
+ // const searchFormOptions = ref([
+ // [
+ // { title: "涓婄骇鍗曟嵁缂栧彿", field: "upperOrderNo", type: "like" },
+ // {
+ // title: "鍗曟嵁鐘舵��",
+ // field: "orderStatus",
+ // type: "select",
+ // dataKey: "allocateOrderStatus",
+ // data: [],
+ // },
+ // {
+ // title: "鍗曟嵁绫诲瀷",
+ // field: "orderType",
+ // type: "select",
+ // dataKey: "outOrderType",
+ // data: [],
+ // },
+ // ],
+ // [
+ // {
+ // title: "鍒涘缓绫诲瀷",
+ // field: "createType",
+ // type: "select",
+ // dataKey: "createType",
+ // data: [],
+ // },
+ // { title: "鏉ユ簮浠撳簱", field: "fromWarehouse", type: "like" },
+ // { title: "鐩爣浠撳簱", field: "toWarehouse", type: "like" },
+ // ],
+ // [
+ // { title: "鍘傚尯", field: "factoryArea", type: "like" },
+ // { title: "鍒涘缓鑰�", field: "creater", type: "like" },
+ // { title: "鍒涘缓鏃堕棿", field: "createDate", type: "datetime" },
+ // ],
+ // ]);
const searchFormFields = ref({
orderNo: "",
upperOrderNo: "",
- supplierId: "",
- orderType: "",
+ orderType: "117",
orderStatus: "",
createType: "",
- businessType: "",
- fromWarehouse: "",
- toWarehouse: "",
- factoryArea: "",
creater: "",
createDate: "",
});
-
- // 鎼滅储琛ㄥ崟閰嶇疆锛氭寜鏌ヨ闇�姹傝缃瓧娈电被鍨�
const searchFormOptions = ref([
[
{ title: "鍗曟嵁缂栧彿", field: "orderNo", type: "like" },
- { title: "涓婄骇鍗曟嵁缂栧彿", field: "upperOrderNo", type: "like" },
- { title: "渚涘簲鍟咺D", field: "supplierId", type: "like" },
{
- title: "璁㈠崟绫诲瀷",
+ title: "鍗曟嵁绫诲瀷",
field: "orderType",
type: "select",
- dataKey: "allocateOrderType",
+ dataKey: "outOrderType",
+ data: [],
+ },
+ {
+ title: "鍗曟嵁鐘舵��",
+ field: "orderStatus",
+ type: "select",
+ dataKey: "outboundStatusEnum",
data: [],
},
],
[
{
- title: "鍗曟嵁鐘舵��",
- field: "orderStatus",
- type: "select",
- dataKey: "allocateOrderStatus",
- data: [],
- },
- {
- title: "鍒涘缓绫诲瀷",
+ title: "鍒涘缓鏂瑰紡",
field: "createType",
type: "select",
dataKey: "createType",
data: [],
},
- { title: "涓氬姟绫诲瀷", field: "businessType", type: "like" },
- ],
- [
- { title: "鏉ユ簮浠撳簱", field: "fromWarehouse", type: "like" },
- { title: "鐩爣浠撳簱", field: "toWarehouse", type: "like" },
- { title: "鍘傚尯", field: "factoryArea", type: "like" },
- ],
- [
{ title: "鍒涘缓鑰�", field: "creater", type: "like" },
{ title: "鍒涘缓鏃堕棿", field: "createDate", type: "datetime" },
],
]);
- // 涓昏〃鏍煎垪閰嶇疆锛氬畬鍏ㄥ榻怐t_AllocateOrder瀛楁
+
const columns = ref([
{
field: "id",
@@ -196,7 +234,6 @@
type: "string",
width: 120,
align: "left",
- link: true,
},
{
field: "upperOrderNo",
@@ -206,19 +243,12 @@
align: "left",
},
{
- field: "supplierId",
- title: "渚涘簲鍟咺D",
- type: "string",
- width: 120,
- align: "left",
- },
- {
field: "orderType",
title: "璁㈠崟绫诲瀷",
type: "int",
width: 120,
align: "left",
- bind: { key: "allocateOrderType", data: [] },
+ bind: { key: "outOrderType", data: [] },
},
{
field: "orderStatus",
@@ -226,7 +256,7 @@
type: "int",
width: 120,
align: "left",
- bind: { key: "allocateOrderStatus", data: [] },
+ bind: { key: "inboundState", data: [] },
},
{
field: "createType",
@@ -236,20 +266,20 @@
align: "left",
bind: { key: "createType", data: [] },
},
- {
- field: "businessType",
- title: "涓氬姟绫诲瀷",
- type: "string",
- width: 120,
- align: "left",
- },
+ // {
+ // field: "businessType",
+ // title: "涓氬姟绫诲瀷",
+ // type: "string",
+ // width: 120,
+ // align: "left",
+ // bind: { key: "businessType", data: [] },
+ // },
{
field: "fromWarehouse",
title: "鏉ユ簮浠撳簱",
type: "string",
width: 120,
align: "left",
- bind: { key: "warehouses", data: [] },
},
{
field: "toWarehouse",
@@ -257,14 +287,12 @@
type: "string",
width: 120,
align: "left",
- bind: { key: "warehouses", data: [] },
},
{
- field: "isBatch",
- title: "鏄惁鎵规",
- type: "bool",
- width: 100,
- align: "left",
+ field: "returnToMESStatus",
+ title: "鍥炰紶MES鐘舵��",
+ width: 120,
+ bind: { key: "createType", data: [{ key: 0, value: "鏈洖浼�" }, { key: 1, value: "宸插洖浼犳垚鍔�" }, { key: 2, value: "鍥炰紶澶辫触" },{ key: 3, value: "閮ㄥ垎鍥炰紶鎴愬姛" },{ key: 4, value: "閮ㄥ垎鍥炰紶澶辫触" }] },
},
{
field: "factoryArea",
@@ -338,11 +366,11 @@
width: 150,
align: "left",
required: true,
- dataKey: "materielCodes", // 鐗╂枡缂栫爜鏋氫妇key
+ dataKey: "materielCodes",
data: [],
},
{
- field: "materielName", // 瀹炰綋涓棤璇ュ瓧娈碉紝闇�鍚庣鍏宠仈杩斿洖鎴栬皟鏁翠负bind鏄犲皠
+ field: "materielName",
title: "鐗╂枡鍚嶇О",
type: "string",
width: 100,
@@ -458,6 +486,21 @@
key: "id",
});
+ // 6. 缁勭洏寮圭獥鑱斿姩锛堟墍鏈夊彉閲忓繀椤昏繑鍥烇級
+ const palletVisible = ref(false);
+ const currentPalletDocNo = ref("");
+
+ const handleOpenPalletDialog = (docNo) => {
+ console.log('涓荤粍浠舵敹鍒扮粍鐩樹簨浠讹紝鍗曟嵁鍙凤細', docNo);
+ currentPalletDocNo.value = docNo;
+ palletVisible.value = true;
+ };
+
+ const handlePalletBackSuccess = () => {
+ console.log('缁勭洏鍥炰紶鎴愬姛锛屽埛鏂拌〃鏍�');
+ grid.value?.refresh(); // 姝ゆ椂gridRef宸叉寕杞斤紝鍙皟鐢ㄦ柟娉�
+ };
+
return {
table,
extend,
@@ -467,11 +510,12 @@
searchFormOptions,
columns,
detail,
+ // 缁勭洏寮圭獥鐩稿叧
+ PalletDialog, // 寮圭獥缁勪欢锛堟棤闇�杩斿洖锛屾敞鍐屽嵆鍙紝浣嗗彉閲忛渶杩斿洖锛�
palletVisible,
currentPalletDocNo,
handleOpenPalletDialog,
- handlePalletBackSuccess,
- gridRef
+ handlePalletBackSuccess
};
},
});
--
Gitblit v1.9.3