فهرست منبع

1、新增覆盖配置到副规格产品和副规格获取主规格配置
2、修复拼侧不能选择图案问题

MY 2 روز پیش
والد
کامیت
b0ddf9edb9

+ 1 - 0
JLHHJSvr/GlobalVar/GlobalVar.cs

@@ -208,6 +208,7 @@ namespace JLHHJSvr
                 excutorManager.AddMap("ReCalculateNoAudit", typeof(ReCalculateNoAuditRequest), new ReCalculateNoAuditExcutor());// 重算床垫报价
                 excutorManager.AddMap("ReCalculateBedNetNoAudit", typeof(ReCalculateBedNetNoAuditRequest), new ReCalculateBedNetNoAuditExcutor());// 重算床网报价
                 excutorManager.AddMap("ReCalculateERPCost", typeof(ReCalculateERPCostRequest), new ReCalculateERPCostExcutor());// 重算床网报价
+                excutorManager.AddMap("CoverMattressInterface", typeof(CoverMattressInterfaceRequest), new CoverMattressInterfaceExcutor());// 覆盖配置到副规格产品
 
                 excutorManager.AddMap("MattressYWAudit", typeof(MattressYWAuditRequest), new MattressYWAuditExcutor());// 床垫接口业务审核撤审
                 excutorManager.AddMap("MattressJSAudit", typeof(MattressJSAuditRequest), new MattressJSAuditExcutor());// 床垫接口产品补充审核撤审

+ 17 - 15
JLHHJSvr/Helper/InterfaceHelper.cs

@@ -325,11 +325,13 @@ namespace JLHHJSvr.Helper
         public void MattressInterfaceFindERPPz(int mattressid, List<u_mattress_interface> interfaceList, int? configcodetype = 0)
         {
             var mattress = new u_mattress() { mattressid = mattressid };
-            DbSqlHelper.SelectOne(cmd, mattress, "erp_configcodetype");
 
             if (configcodetype != 0)
             {
                 mattress.erp_configcodetype = configcodetype;
+            } else
+            {
+                DbSqlHelper.SelectOne(cmd, mattress, "erp_configcodetype");
             }
 
             MattressInterfaceFindERPPz(mattress, interfaceList);
@@ -390,23 +392,23 @@ namespace JLHHJSvr.Helper
             }
 
 
+            var resultDict = resultList.ToDictionary(r => r.name, r => r);
+
             for (var i = 0; i < interfaceList.Count; i++)
             {
-                interfaceList[i].printid = i + 1;
+                var current = interfaceList[i];
+                current.printid = i + 1;
 
-                foreach (var result in resultList) 
+                if (resultDict.TryGetValue(current.bj_pzname, out var result))
                 {
-                    if (interfaceList[i].bj_pzname == result.name)
+                    if (result.pzid > 0)
                     {
-                        if (result.pzid > 0)
-                        {
-                            interfaceList[i].erp_pzid = result.pzid;
-                            interfaceList[i].erp_pzcode = result.pzcode;
-                            interfaceList[i].erp_pzname = result.name;
-                        }
-
-                        if (interfaceList[i].bj_inputtype != 2) interfaceList[i].bj_inputtype = result.inputtype;
+                        current.erp_pzid = result.pzid;
+                        current.erp_pzcode = result.pzcode;
+                        current.erp_pzname = result.name;
                     }
+
+                    if (current.bj_inputtype != 2) current.bj_inputtype = result.inputtype;
                 }
             }
         }
@@ -478,9 +480,9 @@ namespace JLHHJSvr.Helper
                 {"顶布裥棉3",new string[] { "顶布裥棉", "", "顶布裥棉3图案", "顶布裥棉3说明" } },
                 {"顶布裥棉4",new string[] { "顶布裥棉","", "顶布裥棉4图案", "顶布裥棉4说明" } },
                 {"普通大侧",new string[] { "大侧", "大侧裥棉", "大侧裥棉图案" } },
-                {"上下拼侧1",new string[] {"大侧", "大侧-上下拼侧1", "大侧-上下拼侧1", "大侧-上下拼侧1高度"} },
-                {"上下拼侧2",new string[] { "大侧", "大侧-上下拼侧2", "大侧-上下拼侧2", "大侧-上下拼侧2高度" } },
-                {"上下拼侧3",new string[] { "大侧", "大侧-上下拼侧3", "大侧-上下拼侧3", "大侧-上下拼侧3高度" } },
+                {"上下拼侧1",new string[] {"大侧", "大侧-上下拼侧1", "大侧-上下拼侧1裥棉图案", "大侧-上下拼侧1高度"} },
+                {"上下拼侧2",new string[] { "大侧", "大侧-上下拼侧2", "大侧-上下拼侧2裥棉图案", "大侧-上下拼侧2高度" } },
+                {"上下拼侧3",new string[] { "大侧", "大侧-上下拼侧3", "大侧-上下拼侧3裥棉图案", "大侧-上下拼侧3高度" } },
                 {"左右拼侧1",new string[] { "大侧", "大侧-左右拼侧1", "大侧-左右拼侧1裥棉图案", "大侧-左右拼侧1长度" } },
                 {"左右拼侧2",new string[] { "大侧", "大侧-左右拼侧2", "大侧-左右拼侧2裥棉图案", "大侧-左右拼侧2长度" } },
                 {"左右拼侧3",new string[] { "大侧", "大侧-左右拼侧3", "大侧-左右拼侧3裥棉图案", "大侧-左右拼侧3长度", "大侧说明" } },

+ 2 - 0
JLHHJSvr/JLHHJSvr.csproj

@@ -102,6 +102,7 @@
     <Compile Include="Com\CommonDynamicSelect.cs" />
     <Compile Include="Com\CopyMattressAudited.cs" />
     <Compile Include="Com\CopyMtrlDef.cs" />
+    <Compile Include="Com\CoverMattressInterface.cs" />
     <Compile Include="Com\CreatPrdPf.cs" />
     <Compile Include="Com\DeleteMattressExtraType.cs" />
     <Compile Include="Com\DeleteMattressExtra.cs" />
@@ -307,6 +308,7 @@
     <Compile Include="Excutor\CommonDynamicSelectExcutor.cs" />
     <Compile Include="Excutor\CopyMattressAuditedExcutor.cs" />
     <Compile Include="Excutor\CopyMtrlDefExcutor.cs" />
+    <Compile Include="Excutor\CoverMattressInterfaceExcutor.cs" />
     <Compile Include="Excutor\CreatPrdPfExcutor.cs" />
     <Compile Include="Excutor\DeleteMattressExtraTypeExcutor.cs" />
     <Compile Include="Excutor\DeleteMattressExtraExcutor.cs" />

+ 22 - 2
JLHWEB/src/views/erpapi/mattressInterface/detail.vue

@@ -159,6 +159,7 @@ const {
   RetriveMattressInterface,
   RefreshMattressInterfaceList,
   RefreshMattressInterfaceQdList,
+  CoverMattressInterfaceList,
   fModelChoseMattress,
   toExcel,
   toCreateMtrl,
@@ -1070,11 +1071,30 @@ const orderDefaultAction = [
       return "";
     },
     clickFunc: item => {
-      fModelChoseMattress("副规格", { arg_parentid: LjDetailRef.value?._mainData.mattressid }, 0).then((res: any) => {
-        // RefreshMattressInterfaceList(res.mattressid, 1);
+      fModelChoseMattress("副规格", { arg_parentid: LjDetailRef.value?._mainData.mattressid }, 2).then((res: any) => {
+        CoverMattressInterfaceList(
+          res.map(t => {
+            return { mattressid: t.mattressid };
+          })
+        );
       });
     }
   }),
+  buttonDefault({
+    label: "获取主规格配置",
+    limited: () => {
+      return !orderStatus.value || +LjDetailRef.value?._mainData.parentid === 0;
+    },
+    disabledTextCallBack: (data: any) => {
+      if (data.parentid == 0) {
+        return "主规格产品,无法操作";
+      }
+      return "";
+    },
+    clickFunc: item => {
+      RefreshMattressInterfaceList(LjDetailRef.value?._mainData.parentid, 0, LjDetailRef.value?._mainData.erp_configcodetype);
+    }
+  }),
   buttonDefault({
     label: "生成/更新物料",
     power: 88,

+ 29 - 3
JLHWEB/src/views/erpapi/mattressInterface/hooks/index.tsx

@@ -2,7 +2,12 @@ import { ref, reactive, computed, toRefs, nextTick, inject } from "vue";
 import { Table } from "@/hooks/interface";
 import { ColumnProps } from "@/components/LjVxeTable/interface";
 import { ALLOW_EDIT_STATE } from "@/config/index";
-import { GetMattressInterfaceList, RefreshMattressInterface, RefreshMattressInterfaceQd } from "@/api/modules/quote";
+import {
+  GetMattressInterfaceList,
+  RefreshMattressInterface,
+  RefreshMattressInterfaceQd,
+  CoverMattressInterface
+} from "@/api/modules/quote";
 import { getConfigureTypeList, getConfigureCodeList, getConfigureCodeMxList } from "@/api/modules/basicinfo";
 import { ElMessage, ElMessageBox, ElNotification } from "element-plus";
 import {
@@ -1911,7 +1916,7 @@ export const useHooks = (t?: any) => {
 
       state.mattressYWList = visibleData.map(mx => {
         const key = `${mx.erp_pzid}`;
-        if (copyMap.has(key) && (mx.bj_inputtype === 1 || mx.bj_inputtype === 0)) {
+        if (copyMap.has(key) && (mx.bj_inputtype === 1 || mx.bj_inputtype === 0 || mx.bj_name.includes("床网"))) {
           matchQty++;
           NEED_PROPS.forEach(prop => {
             mx[prop] = copyMap.get(key)[prop];
@@ -2068,6 +2073,22 @@ export const useHooks = (t?: any) => {
       });
     }
   };
+  /**
+   * 覆盖配置到副规格产品
+   * @param mattressid 床垫ID
+   * @param isPz 类型 0 - 刷新 1 - 复制 2 - 重新生成
+   */
+  const CoverMattressInterfaceList = async (list: any) => {
+    let res = await CoverMattressInterface({ list });
+
+    if (res) {
+      ElNotification({
+        title: "覆盖成功",
+        message: `成功覆盖${list.length}条副规格数据`,
+        type: "success"
+      });
+    }
+  };
 
   /**
    * @description 弹窗模块:床垫选择
@@ -2087,7 +2108,11 @@ export const useHooks = (t?: any) => {
           // submit
           console.log("openCustDialog res", res);
           nextTick(() => {
-            resolve(res.value[0]);
+            if (multipleLimit > 1) {
+              resolve(res.value);
+            } else {
+              resolve(res.value[0]);
+            }
           });
         },
         onCancel: (error: any) => {
@@ -2512,6 +2537,7 @@ export const useHooks = (t?: any) => {
     RetriveMattressInterface,
     RefreshMattressInterfaceList,
     RefreshMattressInterfaceQdList,
+    CoverMattressInterfaceList,
     fModelChoseMattress,
     toExcel,
     toCreateMtrl,