Jelajahi Sumber

JLHWEB: 1、修改床垫报价业务补充的跳转地址

JohnnyChan 3 minggu lalu
induk
melakukan
c6864048f1

+ 5 - 4
JLHWEB/src/views/erpapi/mattressInterface/hooks/index.tsx

@@ -154,10 +154,11 @@ export const useHooks = (t?: any) => {
       .then(() => {
         CreatMtrlPf({ list }).then(res => {
           console.log("toCreateMtrl, res :>> ", res);
-
-          state.LjDetailRef._mainData.erp_mtrlid = res.mattress.erp_mtrlid;
-          state.LjDetailRef._mainData.creatmtrl_flag = res.mattress.creatmtrl_flag;
-          state.LjDetailRef._mainData.erp_mtrlcode = res.mattress.erp_mtrlcode;
+          if (state.LjDetailRef) {
+            state.LjDetailRef._mainData.erp_mtrlid = res.mattress.erp_mtrlid;
+            state.LjDetailRef._mainData.creatmtrl_flag = res.mattress.creatmtrl_flag;
+            state.LjDetailRef._mainData.erp_mtrlcode = res.mattress.erp_mtrlcode;
+          }
           ElNotification({
             title: "物料",
             message: "生成/更新成功!",

+ 12 - 1
JLHWEB/src/views/quote/mattressQuote/detail.vue

@@ -931,7 +931,8 @@ const {
   resetMergeCellsInner,
   resetMergeCellsTopCotton,
   wf_rtr_cwdc,
-  resetSpecialProcesses
+  resetSpecialProcesses,
+  gotoErpapi
 } = useHooks(t);
 const { toExcelQuote } = useHooksCpQuote();
 const { CheckPower, CheckOption, buttonNew, buttonDefault } = useAuthButtons(t);
@@ -2110,6 +2111,16 @@ const orderDefaultAction = [
       loadingStatus.download = false;
     }
   }),
+  buttonDefault({
+    label: t("common.businessSupplement"),
+    power: 72,
+    clickFunc: item => {
+      let _cur = LjDetailRef.value._mainData;
+      let type = 1;
+
+      gotoErpapi(_cur, type);
+    }
+  }),
   // buttonDefault({
   //   label: t("common.dataTransmission"),
   //   power: 72,

+ 31 - 1
JLHWEB/src/views/quote/mattressQuote/hooks/index.tsx

@@ -5533,6 +5533,35 @@ export const useHooks = (t?: any) => {
     }
   };
 
+  const gotoErpapi = (_cur, type) => {
+    try {
+      if (type === 1) {
+        if (_cur.yw_flag == 1) {
+          throw new Error(_cur.mattresscode + ":已业务补充审核,无法修改");
+        }
+      } else if (type === 2) {
+        if (_cur.js1_flag == 1) {
+          throw new Error(_cur.mattresscode + ":已产品补充审核,无法修改");
+        }
+      } else if (type === 3) {
+        if (_cur.js2_flag == 1) {
+          throw new Error(_cur.mattresscode + ":已清单补充审核,无法修改");
+        }
+      }
+    } catch (error) {
+      ElMessage.error(error.message);
+      return false;
+    }
+
+    router.push({
+      path: `/erpapi/mattressInterface/edit/${_cur.mattressid}`,
+      query: {
+        code: _cur.mattresscode,
+        type: type
+      }
+    });
+  };
+
   return {
     ...toRefs(state),
     columns,
@@ -5569,6 +5598,7 @@ export const useHooks = (t?: any) => {
     resetMergeCellsInner,
     resetSpecialProcesses,
     resetMergeCellsTopCotton,
-    wf_rtr_cwdc
+    wf_rtr_cwdc,
+    gotoErpapi
   };
 };

+ 4 - 2
JLHWEB/src/views/quote/mattressQuote/index.vue

@@ -80,7 +80,7 @@ import { saveAs } from "file-saver";
 const { t } = useI18n();
 const router = useRouter();
 const globalStore = useGlobalStore();
-const { vxeTableRef, columns, initParams, dataCallback } = useHooks();
+const { vxeTableRef, columns, initParams, dataCallback, gotoErpapi } = useHooks();
 const { toExcelQuote } = useHooksCpQuote();
 const { CheckPower, CheckOption, buttonNew, buttonDefault } = useAuthButtons(t);
 
@@ -459,7 +459,9 @@ const action: detailAction[] = [
       }
       let _cur = $table.getCurrentRecord() ?? curRecords[curRecords.length - 1];
       let type = 1;
-      router.push(`/erpapi/mattressInterface/${type}/edit?id=${_cur.mattressid}&code=${_cur.mattresscode}&type=${type}`);
+      // router.push(`/erpapi/mattressInterface/${type}/edit?id=${_cur.mattressid}&code=${_cur.mattresscode}&type=${type}`);
+
+      gotoErpapi(_cur, type);
     }
   }),
   buttonDefault({