Explorar o código

JLHWEB:1、修复床垫报价,部分物料无法选择

JohnnyChan hai 2 días
pai
achega
589d99ae1e

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

@@ -2920,7 +2920,6 @@ const tableEvents = {
 };
 
 const handleCellDblClick_bednet = ({ row, rowIndex, $rowIndex, column, columnIndex, $columnIndex, $event }: any) => {
-  console.log("handleCellDblClick_bednet row :>> ", row);
   if (!orderStatus.value && row.mtrlid > 0) {
     drawerTitle.value = "床网报价详情";
     // bednetDrawerProps.deptid = LjDetailRef.value._mainData.deptid;

+ 52 - 37
JLHWEB/src/views/quote/mattressQuote/hooks/index.tsx

@@ -563,7 +563,7 @@ export const useHooks = (t?: any) => {
     {
       label: "防火线",
       formulakinds: [30],
-      value: -1
+      value: 32
     },
     {
       label: "木托",
@@ -733,7 +733,7 @@ export const useHooks = (t?: any) => {
     {
       label: "无拉手脚轮",
       formulakinds: [27],
-      value: -1
+      value: 19
     },
     {
       label: "拉钮",
@@ -753,7 +753,12 @@ export const useHooks = (t?: any) => {
     {
       label: "木托",
       formulakinds: [31],
-      value: -1
+      value: 28
+    },
+    {
+      label: "无纺布护角",
+      formulakinds: [201],
+      value: 27
     },
     {
       label: "床网",
@@ -985,7 +990,7 @@ export const useHooks = (t?: any) => {
     {
       label: "边带",
       formulakinds: [203],
-      value: -9
+      value: 9
     }
   ];
 
@@ -1295,7 +1300,7 @@ export const useHooks = (t?: any) => {
    * @param status 当前订单状态
    * @returns Promise
    */
-  const fModelChoseMtrl = (data: any, params: any, cb: any, label?: string, $table?: any, qty = 1) => {
+  const fModelChoseMtrl = (data: any, params: any, cb: any, label?: string, $table?: any) => {
     return new Promise((resolve, reject) => {
       // if (!ALLOW_EDIT_STATE.includes(status)) return;
 
@@ -1309,7 +1314,7 @@ export const useHooks = (t?: any) => {
           // submit
           console.log("openCustDialog res", res);
           nextTick(() => {
-            cb(data, res.value[0], $table, qty);
+            cb(data, res.value[0], $table);
             resolve(1);
           });
         },
@@ -1327,7 +1332,7 @@ export const useHooks = (t?: any) => {
    * @param data 当前数据
    * @param item 当前选择的数据
    */
-  const rModelSetMtrl = (data: any, item: any, $table?: any, qty = 1) => {
+  const rModelSetMtrl = (data: any, item: any, $table?: any) => {
     console.log("rModelSetMtrl data :>> ", data);
     console.log("rModelSetMtrl item :>> ", item);
     if (item) {
@@ -1344,7 +1349,18 @@ export const useHooks = (t?: any) => {
       data.shrinkage = item.price; // 收缩率
       data.thickness = Number(item.thickness);
       data.price_formula = item.price_formula;
-      data.qty = qty;
+
+      let _qty = 1;
+      if (data.formulakind == 5) {
+        //默认4个拉手
+        _qty = 4;
+      } else if ([7, 8, 9, 202].includes(data.formulakind)) {
+        // 拉手刺绣及其他工艺,大侧压压布、拉链等自动带出数量=周长
+        let mattress_width = state.LjDetailRef._mainData.mattress_width ?? 0;
+        let mattress_length = state.LjDetailRef._mainData.mattress_length ?? 0;
+        _qty = (mattress_width / 100 + mattress_length / 100) * 2;
+      }
+      data.qty = _qty;
 
       // cb && cb();
       if ($table) {
@@ -1400,15 +1416,18 @@ export const useHooks = (t?: any) => {
       data.shrinkage = item.price; // 收缩率
       Number(item?.thickness) > 0 && (data.thickness = item.thickness);
       item?.price_formula != "" && (data.price_formula = item.price_formula);
-      data.qty = 1;
 
-      if (Number(data.formulakind) == 5) {
-        data.qty = 4;
-      } else if ([7, 8, 9, 10, 202, 203].includes(Number(data.formulakind))) {
-        if (state.LjDetailRef._mainData) {
-          data.qty = (state.LjDetailRef._mainData.mattress_width * state.LjDetailRef._mainData.mattress_length * 2) / 100;
-        }
+      let _qty = 1;
+      if (data.formulakind == 5) {
+        //默认4个拉手
+        _qty = 4;
+      } else if ([7, 8, 9, 202, 203].includes(data.formulakind)) {
+        // 拉手刺绣及其他工艺,大侧压压布、拉链等自动带出数量=周长
+        let mattress_width = state.LjDetailRef._mainData.mattress_width ?? 0;
+        let mattress_length = state.LjDetailRef._mainData.mattress_length ?? 0;
+        _qty = (mattress_width / 100 + mattress_length / 100) * 2;
       }
+      data.qty = _qty;
 
       if ($table) {
         $table.clearEdit();
@@ -3568,13 +3587,6 @@ export const useHooks = (t?: any) => {
           pricelistid: _pricelistid
         };
 
-        // 拉手刺绣及其他工艺,大侧压压布、拉链等自动带出数量=周长
-        let ifCircum = [7, 8, 9, 202].includes(row.formulakind);
-
-        let mattress_width = state.LjDetailRef._mainData.mattress_width ?? 0;
-        let mattress_length = state.LjDetailRef._mainData.mattress_length ?? 0;
-        let _qty = ifCircum ? (mattress_width / 100 + mattress_length / 100) * 2 : 1;
-
         return (
           <>
             <MtrldefSelect
@@ -3582,8 +3594,8 @@ export const useHooks = (t?: any) => {
               {...params}
               clearable
               placeholder={_label}
-              onOpenModal={() => fModelChoseMtrl(row, params, rModelSetMtrl, _mtrltypeItem.label, $table, _qty)}
-              onSelect={val => rModelSetMtrl(row, val, $table, _qty)}
+              onOpenModal={() => fModelChoseMtrl(row, params, rModelSetMtrl, _mtrltypeItem.label, $table)}
+              onSelect={val => rModelSetMtrl(row, val, $table)}
               onClear={() => rModelClearMtrl(row, $table)}
             >
               {{
@@ -4454,19 +4466,22 @@ export const useHooks = (t?: any) => {
         };
 
         return (
-          <MtrldefSelect
-            value={row.mtrlid}
-            {...params}
-            clearable
-            placeholder={_label}
-            onOpenModal={() => fModelChoseMtrl(row, params, rModelSetMtrl, _mtrltypeItem.label, $table)}
-            onSelect={(val: any) => rModelSetMtrl(row, val, $table)}
-            onClear={() => rModelClearMtrl(row, $table)}
-          >
-            {{
-              label: () => row.mtrlname
-            }}
-          </MtrldefSelect>
+          <>
+            {row.formulakind}
+            <MtrldefSelect
+              value={row.mtrlid}
+              {...params}
+              clearable
+              placeholder={_label}
+              onOpenModal={() => fModelChoseMtrl(row, params, rModelSetMtrl, _mtrltypeItem.label, $table)}
+              onSelect={(val: any) => rModelSetMtrl(row, val, $table)}
+              onClear={() => rModelClearMtrl(row, $table)}
+            >
+              {{
+                label: () => row.mtrlname
+              }}
+            </MtrldefSelect>
+          </>
         );
       }
     },

+ 3 - 0
JLHWEB/src/views/system/selector/mtrldef/index.vue

@@ -278,6 +278,9 @@ const getTypename = (ins_type: number) => {
     case 1201:
       ls_typename = "顶布裥棉";
       break;
+    case 201:
+      ls_typename = "无纺布护角";
+      break;
     default:
       ls_typename = "类型未定义";
       break;