Prechádzať zdrojové kódy

JLHWEB: 1、,修改床垫高时,会赋值修改副规格高;

JohnnyChan 4 dní pred
rodič
commit
287397871a

+ 8 - 6
JLHWEB/src/views/quote/bednetQuote/detail.vue

@@ -785,18 +785,20 @@ const funcAfterMound = async (data: any) => {
 
         if (props.mattressLength || props.mattressWidth) {
           let msgArr = [];
-          if (props.mattressWidth) {
+          if (Number(props.mattressWidth) != Number(data.mattress_width)) {
             data.mattress_width = props.mattressWidth;
             msgArr.push("床垫宽");
           }
-          if (props.mattressLength) {
+          if (Number(props.mattressLength) != Number(data.mattress_length)) {
             data.mattress_length = props.mattressLength;
             msgArr.push("床垫长");
           }
-          setTimeout(() => {
-            setMxSpringQtyWidthAndLength(bednetMxData.value[0]);
-            ElMessage.success("已读取规格:" + msgArr.join("、") + "参数,弹簧排列数已刷新");
-          }, 200);
+          if (msgArr.length) {
+            setTimeout(() => {
+              setMxSpringQtyWidthAndLength(bednetMxData.value[0]);
+              ElMessage.success("已读取规格:" + msgArr.join("、") + "参数,弹簧排列数已刷新");
+            }, 200);
+          }
         }
       }
     });

+ 5 - 0
JLHWEB/src/views/quote/mattressQuote/detail.vue

@@ -1781,6 +1781,11 @@ const save = async () => {
             }
           });
         }
+        subspecs = subspecs.map(itm => {
+          itm.mattress_width = Number(itm.mattress_width ?? 0);
+          itm.mattress_length = Number(itm.mattress_length ?? 0);
+          itm.mattress_height = Number(mattress.mattress_height ?? 0);
+        });
       } catch (error) {
         ElMessage.error(error.message);
         return false;

+ 14 - 3
JLHWEB/src/views/quote/mattressQuote/hooks/index.tsx

@@ -2548,7 +2548,7 @@ export const useHooks = (t?: any) => {
             state.initParams.arg_deptid = val;
           }
         },
-        order: 1
+        order: 2
       },
       basicinfo: {
         // el: "select",
@@ -2603,7 +2603,7 @@ export const useHooks = (t?: any) => {
         props: {
           placeholder: "唯一码/编码/名称"
         },
-        order: 0
+        order: 1
       },
       basicinfo: {
         el: "input",
@@ -2645,7 +2645,7 @@ export const useHooks = (t?: any) => {
             state.vxeTableRef.refresh();
           }
         },
-        order: 2,
+        order: 3,
         render: scope => {
           // let _keys = Object.keys(scope);
           // let _data = _keys.includes("row") ? scope.row : _keys.includes("searchParam") ? scope.searchParam : scope;
@@ -2799,6 +2799,17 @@ export const useHooks = (t?: any) => {
       title: "床垫高/CM",
       basicinfo: {
         el: "input-number",
+        props: {
+          onChange: (val: any) => {
+            const $table = state.subSpecsRef?.element;
+            if ($table) {
+              const { visibleData } = $table.getTableData();
+              visibleData.forEach((o: any) => {
+                o.mattress_height = val;
+              });
+            }
+          }
+        },
         editable: ALLOW_EDIT_STATE
       }
     },

+ 3 - 5
JLHWEB/src/views/quote/mattressQuote/index.vue

@@ -339,12 +339,10 @@ const action: detailAction[] = [
             throw new Error("只能删除自己创建的报价单");
           }
           if (item.xd_flag == 1) {
-            ElMessage.warning("已业务下单,不能删除");
-            return;
+            throw new Error("已业务下单,不能删除");
           }
           if (item.flag == 1) {
-            ElMessage.warning("单据已财核,不能删除");
-            return;
+            throw new Error("单据已财核,不能删除");
           }
         });
       } catch (error) {
@@ -405,7 +403,7 @@ const action: detailAction[] = [
     label: t("common.businessOrderCancel"),
     power: 95,
     clickFunc: item => {
-      toAuditing({ xd_flag: 0 }, t("common.businessOrder"));
+      toAuditing({ xd_flag: 0 }, t("common.businessOrderCancel"));
     }
   }),
   // ],