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/outbound/allocateoutboundOrder.vue | 156 ++++++++++++++++++++++++---------------------------
1 files changed, 73 insertions(+), 83 deletions(-)
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/outbound/allocateoutboundOrder.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/outbound/allocateoutboundOrder.vue"
index 46ae5a5..e9f64db 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/outbound/allocateoutboundOrder.vue"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/outbound/allocateoutboundOrder.vue"
@@ -1,55 +1,31 @@
<template>
- <view-grid
- ref="grid"
- @openOutboundDialog="handleOpenOutboundDialog"
- :columns="columns"
- :detail="detail"
- :editFormFields="editFormFields"
- :editFormOptions="editFormOptions"
- :searchFormFields="searchFormFields"
- :searchFormOptions="searchFormOptions"
- :table="table"
- :extend="extend"
- >
+ <view-grid ref="grid" @openOutboundDialog="handleOpenOutboundDialog" :columns="columns" :detail="detail"
+ :editFormFields="editFormFields" :editFormOptions="editFormOptions" :searchFormFields="searchFormFields"
+ :searchFormOptions="searchFormOptions" :table="table" :extend="extend">
</view-grid>
- <!-- 鍑哄簱鎿嶄綔寮圭獥 -->
- <OutboundDialog
- v-model:visible="outboundVisible"
- :selected-document="selectedOutboundDocument"
- @outbound-success="handleOutboundSuccess"
- ></OutboundDialog>
</template>
- <script>
+<script>
import extend from "@/extension/outbound/allocateoutboundOrder.js";
-import ViewGrid from '@/components/basic/ViewGrid/ViewGrid.vue';
import { ref, defineComponent } from "vue";
-import { ElMessage } from "element-plus";
-import OutboundDialog from "@/extension/outbound/extend/OutBound.vue"; // 寮曞叆鍑哄簱寮圭獥缁勪欢
-
export default defineComponent({
- components: {
- // 鍏抽敭淇2锛氱粍浠舵敞鍐屽悕涓庢ā鏉挎爣绛惧悕閫傞厤锛坘ebab-case瀵瑰簲view-grid锛�
- viewGrid: ViewGrid, // 娉ㄥ唽涓簁ebab-case锛屾ā鏉跨敤<view-grid>
- OutboundDialog // 娉ㄥ唽鍑哄簱寮圭獥缁勪欢
- },
setup() {
const table = ref({
key: "id",
footer: "Foots",
- cnName: "璋冩嫧鍗�(澶栭儴浠撳簱璋冩櫤浠�)",
+ cnName: "璋冩嫧鍗�(鏅轰粨璋冨嚭澶栭儴浠�)",
name: "outboundOrder",
- url: "/OutboundOrder/",
+ url: "/AllocateOrder/",
sortName: "id",
});
const editFormFields = ref({
orderType: "",
- orderNo:"",
+ orderNo: "",
upperOrderNo: "",
orderStatus: "",
remark: "",
- warehouseId:""
+ warehouseId: ""
});
const editFormOptions = ref([
[
@@ -62,11 +38,11 @@
data: [],
},
{
- field: "orderNo",
- title: "鍗曟嵁缂栧彿",
- type: "string",
- readonly:true
- },
+ field: "orderNo",
+ title: "鍗曟嵁缂栧彿",
+ type: "string",
+ readonly: true
+ },
{
title: "涓婃父鍗曟嵁缂栧彿",
field: "upperOrderNo",
@@ -107,7 +83,6 @@
const searchFormOptions = ref([
[
{ title: "鍗曟嵁缂栧彿", field: "orderNo", type: "like" },
- { title: "涓婃父鍗曟嵁缂栧彿", field: "upperOrderNo", type: "like" },
{
title: "鍗曟嵁绫诲瀷",
field: "orderType",
@@ -176,6 +151,7 @@
width: 150,
align: "left",
bind: { key: "businessType", data: [] },
+ hidden: true,
},
{
field: "orderStatus",
@@ -194,6 +170,20 @@
bind: { key: "createType", data: [] },
},
{
+ field: "fromWarehouse",
+ title: "璋冨嚭浠撳簱",
+ type: "string",
+ width: 120,
+ align: "left",
+ },
+ {
+ field: "toWarehouse",
+ title: "璋冨叆浠撳簱",
+ type: "string",
+ width: 120,
+ align: "left",
+ },
+ {
field: "factoryArea",
title: "鍘傚尯",
type: "string",
@@ -201,19 +191,18 @@
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: "閮ㄥ垎鍥炰紶澶辫触" },{ key: 5, value: "鏃犻渶鍥炰紶" }] },
+ },
+ {
field: "departmentCode",
title: "淇敼鏃堕棿",
type: "string",
width: 120,
align: "left",
- hidden:true
- },
- {
- field: "departmentName",
- title: "閮ㄩ棬鍚嶇О",
- type: "string",
- width: 160,
- align: "left",
+ hidden: true
},
{
field: "creater",
@@ -249,6 +238,7 @@
type: "string",
width: 100,
align: "left",
+ hidden: true,
},
]);
const detail = ref({
@@ -387,41 +377,41 @@
sortName: "id",
key: "id",
});
- // 璋冩嫧寮圭獥鐩稿叧
- const outboundVisible = ref(false);
- const selectedOutboundDocument = ref({}); // 瀛樺偍閫変腑鐨勮皟鎷ㄥ崟鏁版嵁
+ // 璋冩嫧寮圭獥鐩稿叧
+ // const outboundVisible = ref(false);
+ // const selectedOutboundDocument = ref({}); // 瀛樺偍閫変腑鐨勮皟鎷ㄥ崟鏁版嵁
- // 鎵撳紑璋冩嫧寮圭獥锛堜粠鎵╁睍閰嶇疆鐨勬寜閽簨浠惰Е鍙戯級
- const handleOpenOutboundDialog = (docData) => {
- selectedOutboundDocument.value = docData; // 淇濆瓨閫変腑鐨勫崟鎹暟鎹�
- outboundVisible.value = true; // 鏄剧ず寮圭獥
- };
+ // // 鎵撳紑璋冩嫧寮圭獥锛堜粠鎵╁睍閰嶇疆鐨勬寜閽簨浠惰Е鍙戯級
+ // const handleOpenOutboundDialog = (docData) => {
+ // selectedOutboundDocument.value = docData; // 淇濆瓨閫変腑鐨勫崟鎹暟鎹�
+ // outboundVisible.value = true; // 鏄剧ず寮圭獥
+ // };
- // 璋冩嫧鎴愬姛鍚庣殑鍥炶皟
- const handleOutboundSuccess = (docNo) => {
- ElMessage.success(`鍗曟嵁 ${docNo} 璋冩嫧鎴愬姛`);
- gridRef.value?.refresh(); // 鍒锋柊琛ㄦ牸鏁版嵁
- };
+ // // 璋冩嫧鎴愬姛鍚庣殑鍥炶皟
+ // const handleOutboundSuccess = (docNo) => {
+ // ElMessage.success(`鍗曟嵁 ${docNo} 璋冩嫧鎴愬姛`);
+ // gridRef.value?.refresh(); // 鍒锋柊琛ㄦ牸鏁版嵁
+ // };
- // 鍒濆鍖栨墿灞曢厤缃細涓鸿皟鎷ㄦ寜閽坊鍔犱簨浠惰Е鍙戦�昏緫
- const initExtension = () => {
- // 鎵惧埌"璋冩嫧"鎸夐挳骞剁粦瀹氭墦寮�寮圭獥鐨勯�昏緫
- const outboundBtn = extend.buttons.view.find(btn => btn.name === '鍑哄簱');
- if (outboundBtn) {
- const originalOnClick = outboundBtn.onClick;
- outboundBtn.onClick = function() {
- // 鍏堟墽琛屽師鏈夋牎楠岄�昏緫
- const selectedRows = this.$refs.table.getSelected();
- if (selectedRows.length === 1) {
- // 鏍¢獙閫氳繃鍚庯紝瑙﹀彂涓荤粍浠剁殑鍑哄簱寮圭獥浜嬩欢
- this.$emit('openOutboundDialog', selectedRows[0]);
- } else {
- // 鍘熸湁閫昏緫宸插鐞嗘彁绀猴紝鏃犻渶閲嶅
- originalOnClick.call(this);
- }
- };
- }
- };
+ // // 鍒濆鍖栨墿灞曢厤缃細涓鸿皟鎷ㄦ寜閽坊鍔犱簨浠惰Е鍙戦�昏緫
+ // const initExtension = () => {
+ // // 鎵惧埌"璋冩嫧"鎸夐挳骞剁粦瀹氭墦寮�寮圭獥鐨勯�昏緫
+ // const outboundBtn = extend.buttons.view.find(btn => btn.name === '鍑哄簱');
+ // if (outboundBtn) {
+ // const originalOnClick = outboundBtn.onClick;
+ // outboundBtn.onClick = function () {
+ // // 鍏堟墽琛屽師鏈夋牎楠岄�昏緫
+ // const selectedRows = this.$refs.table.getSelected();
+ // if (selectedRows.length === 1) {
+ // // 鏍¢獙閫氳繃鍚庯紝瑙﹀彂涓荤粍浠剁殑鍑哄簱寮圭獥浜嬩欢
+ // this.$emit('openOutboundDialog', selectedRows[0]);
+ // } else {
+ // // 鍘熸湁閫昏緫宸插鐞嗘彁绀猴紝鏃犻渶閲嶅
+ // originalOnClick.call(this);
+ // }
+ // };
+ // }
+ // };
return {
table,
extend,
@@ -431,11 +421,11 @@
searchFormOptions,
columns,
detail,
- // 鍑哄簱鐩稿叧
- outboundVisible,
- selectedOutboundDocument,
- handleOpenOutboundDialog,
- handleOutboundSuccess
+ // 鍑哄簱鐩稿叧
+ // outboundVisible,
+ // selectedOutboundDocument,
+ // handleOpenOutboundDialog,
+ // handleOutboundSuccess
};
},
});
--
Gitblit v1.9.3