Browse Source

JLHWEB:
1、新增床垫清单选择配置弹窗

MY 1 day ago
parent
commit
3d6f386050

+ 3 - 0
JLHWEB/src/languages/modules/zh-cn/business.json

@@ -289,6 +289,9 @@
     },
     "mattress": {
       "title": "床垫选择"
+    },
+    "codeMx": {
+      "title": "配置选择"
     }
   },
   "sptPriceChange": {

+ 5 - 1
JLHWEB/src/views/erpapi/mattressInterface/detail.vue

@@ -77,6 +77,7 @@
 
   <MattressDialog ref="MattressDialogRef" v-bind="MattressDialogProps" />
   <MtrldefErpDialog ref="MtrldefErpDialogRef" v-bind="MtrldefErpDialogProps" />
+  <CodeMxDialog ref="CodeMxDialogRef" v-bind="CodeMxDialogProps" />
   <!-- <SetSubspecsDialog ref=SetSubspecsDialogRef" /> -->
 </template>
 
@@ -96,6 +97,7 @@ import mittBus from "@/utils/mittBus";
 import { MittEnum } from "@/enums/mittEnum";
 import MattressDialog from "@/views/system/selector/mattress/index.vue";
 import MtrldefErpDialog from "@/views/system/selector/mtrldefErp/index.vue";
+import CodeMxDialog from "@/views/system/selector/codemx/index.vue";
 import { formatToDate } from "@/utils/dateUtil";
 import LjFoldLayout from "@/components/LjFoldLayout/index.vue";
 import { detailAction } from "@/components/LjDetail/interface";
@@ -168,7 +170,9 @@ const {
   resetMergeCells,
   funcAddRowQd,
   funcCmpCC,
-  dynamicRef
+  dynamicRef,
+  CodeMxDialogProps,
+  CodeMxDialogRef
 } = useHooks(t);
 const { CheckPower, CheckOption, buttonNew, buttonDefault } = useAuthButtons(t);
 

+ 38 - 1
JLHWEB/src/views/erpapi/mattressInterface/hooks/index.tsx

@@ -55,6 +55,8 @@ interface defaultState {
   VxeTableMxRef: any;
   YwTableRef: any;
   QdTableRef: any;
+  CodeMxDialogProps: any;
+  CodeMxDialogRef: any;
 }
 
 /**
@@ -80,7 +82,9 @@ export const useHooks = (t?: any) => {
     MtrldefErpDialogProps: {},
     workgrpEnum: [],
     workgrpEnum2: [],
-    configureTypeEnum: []
+    configureTypeEnum: [],
+    CodeMxDialogProps: null,
+    CodeMxDialogRef: null
   });
 
   const QdAddRowList = [
@@ -853,6 +857,7 @@ export const useHooks = (t?: any) => {
               {...params}
               clearable
               placeholder="请选择配置"
+              onOpenModal={() => fModelChoseCodeMx(row, params, rModelSetCodemx, scope.row.bj_namemx, $table)}
               onSelect={val => rModelSetCodemx(scope.row, val, $table)}
               onClear={() => rModelClearCodemx(scope.row, $table)}
             ></CodemxSelect>
@@ -2263,6 +2268,38 @@ export const useHooks = (t?: any) => {
       });
   };
 
+  /**
+   * @description 弹窗模块:物料选择
+   * @param data 当前数据
+   * @param status 当前订单状态
+   * @returns Promise
+   */
+  const fModelChoseCodeMx = (data: any, params: any, cb: any, label?: string, $table?: any) => {
+    return new Promise((resolve, reject) => {
+      // if (!ALLOW_EDIT_STATE.includes(status)) return;
+
+      let _params = {
+        keyword: "",
+        pzid: params.pzid
+      };
+      state.CodeMxDialogProps = {
+        onSubmit: (res: any) => {
+          // submit
+          console.log("openCustDialog res", res);
+          nextTick(() => {
+            cb(data, res.value[0], $table);
+            resolve(1);
+          });
+        },
+        onCancel: (error: any) => {
+          // cancel 回调
+          console.log("openCustDialog error", error);
+        }
+      };
+      state.CodeMxDialogRef.show(_params, label);
+    });
+  };
+
   const dynamicRef = name => {
     return state[name]; // 获取ref的值
   };