Browse Source

JLHWEB: 1、新增覆盖半成品归属

JohnnyChan 1 week ago
parent
commit
bd938e7318

+ 43 - 16
JLHWEB/src/views/erpapi/mattressInterface/detail.vue

@@ -123,7 +123,7 @@ import { useRoute, useRouter } from "vue-router";
 import { useHooks } from "./hooks/index";
 import { useAuthButtons } from "@/hooks/useAuthButtons";
 import { CommonDynamicSelect, GetERPWrkGrpList, GetERPWrkGrpList2 } from "@/api/modules/common";
-import { SaveMattressInterface } from "@/api/modules/quote";
+import { SaveMattressInterface, GetResetWiptype } from "@/api/modules/quote";
 import { ElMessage, ElMessageBox, ElNotification } from "element-plus";
 import mittBus from "@/utils/mittBus";
 import { MittEnum } from "@/enums/mittEnum";
@@ -562,21 +562,6 @@ const orderDefaultAction = [
       clickFunc: item => {
         RefreshMattressInterfaceList(LjDetailRef.value?._mainData.mattressid, 0, LjDetailRef.value?._mainData.erp_configcodetype);
       }
-    }),
-    buttonDefault({
-      label: "覆盖配置到副规格产品",
-      limited: () => {
-        return !orderStatus.value || editType.value != 1;
-      },
-      disabledTextCallBack: (data: any) => {
-        if (data.child_count == 0) {
-          return "没有副规格产品,无法操作";
-        }
-        return "";
-      },
-      clickFunc: item => {
-        alert("功能维护中!");
-      }
     })
   ],
   [
@@ -656,6 +641,48 @@ const orderDefaultAction = [
       clickFunc: () => funcCmpCC()
     })
   ],
+  buttonDefault({
+    label: "覆盖配置到副规格产品",
+    limited: () => {
+      return !orderStatus.value || LjDetailRef.value?._mainData.child_count == 0;
+    },
+    disabledTextCallBack: (data: any) => {
+      if (data.child_count == 0) {
+        return "没有副规格产品,无法操作";
+      }
+      return "";
+    },
+    clickFunc: item => {
+      alert("功能维护中!");
+    }
+  }),
+  buttonDefault({
+    label: "重置半成品归属列数据",
+    limited: () => {
+      return !orderStatus.value;
+    },
+    clickFunc: async () => {
+      const $table = QdTableRef.value.element;
+      if ($table) {
+        const { visibleData } = $table.getTableData();
+
+        let res = await GetResetWiptype({ qdList: visibleData });
+
+        let arr = visibleData.map(o => {
+          let _itm = res.qdList.find(itm => itm.printid == o.printid);
+
+          if (_itm) {
+            o.wip_type = _itm.wip_type;
+          }
+          return o;
+        });
+        console.log("arr :>> ", arr);
+
+        $table.reloadData(arr);
+        resetMergeCellsQd();
+      }
+    }
+  }),
   [
     buttonDefault({
       label: "业务补充",

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

@@ -1009,10 +1009,6 @@ export const useHooks = (t?: any) => {
   });
 
   const wipTypeEnum = [
-    {
-      label: "",
-      value: ""
-    },
     {
       label: "面裥绵",
       value: "面裥绵"
@@ -1095,7 +1091,7 @@ export const useHooks = (t?: any) => {
       editColRender: (scope: any) => {
         // console.log("formulakind editColRender scope :>> ", scope);
         return (
-          <el-select v-model={scope.row.wip_type} filterable>
+          <el-select v-model={scope.row.wip_type} filterable clearable>
             {{
               default: () => {
                 let rs = [];