Explorar o código

JLHWEB: 1、床垫公式计算过程支持显示全部小数;2、拉链数量读取周长

JohnnyChan hai 1 mes
pai
achega
e0dff0372b

+ 8 - 2
JLHWEB/src/components/LjDetail/components/BaseForm.vue

@@ -551,7 +551,12 @@
                                 </span>
                               </template>
                               <template
-                                v-if="getIfCanEditable(item) || (item?.basicinfo && item.basicinfo?.render) || item?.render"
+                                v-if="
+                                  getIfCanEditable(item) ||
+                                  (item?.basicinfo && item.basicinfo?.render) ||
+                                  item?.render ||
+                                  item?.enum
+                                "
                               >
                                 <!-- v-if="getIfCanEditable(item) && ((item?.basicinfo && item.basicinfo?.render) || item?.render)" -->
                                 <BaseFormItem
@@ -2653,7 +2658,8 @@ defineExpose({
       text-align: justify;
       text-justify: distribute-all-lines;
     }
-    .el-input.is-disabled .el-input__inner {
+    .el-input.is-disabled .el-input__inner,
+    .el-select__wrapper.is-disabled .el-select__selected-item {
       color: $color-text-title;
       -webkit-text-fill-color: $color-text-title;
     }

+ 1 - 8
JLHWEB/src/components/LjDetail/components/ButtonGroup.vue

@@ -290,14 +290,7 @@ const bottonDropdownRender = (item: any, placement?: string) => {
    */
   let ifMenu = !_item.hasOwnProperty("clickFunc");
   let idx = ifMenu ? 1 : 0; // 若是菜单按钮,下拉菜单跳过第一个
-  let ifShowDot = false;
   let _buttonsRd = item.map((itm: any, index: number) => {
-    if (!ifShowDot && index > 0) {
-      let btnDisabledTxt = props.data && itm.hasOwnProperty("disabledTextCallBack") && itm.disabledTextCallBack(props.data);
-      if (!btnDisabledTxt) {
-        ifShowDot = true;
-      }
-    }
     return index >= idx && buttonsMenuRender(itm);
   });
   _buttonsRd = _buttonsRd.filter((itm: any) => itm);
@@ -347,7 +340,7 @@ const bottonDropdownRender = (item: any, placement?: string) => {
                   v-slots={iconRender}
                   style={{ cursor: ifMenu ? "default" : "pointer" }}
                 >
-                  <el-badge is-dot={!ifMenu && ifShowDot}>{buttonGroupInnderRender(_item, ifMenu, _placement)}</el-badge>
+                  {buttonGroupInnderRender(_item, ifMenu, _placement)}
                 </el-button>
               </el-tooltip>
             </span>

+ 6 - 3
JLHWEB/src/components/LjVxeTable/index.vue

@@ -739,7 +739,7 @@ const _defineProps = ref({
   },
   headerCellClassName: ({ column }: any) => {
     if (ALLOW_EDIT_STATE.includes(orderStatus.value) || props.editable) {
-      if (column?.editRender) {
+      if (column?.editRender && column.editRender.enabled !== false) {
         return "vxecol-edit";
       }
     }
@@ -747,7 +747,7 @@ const _defineProps = ref({
   },
   cellClassName: ({ column }: any) => {
     if (ALLOW_EDIT_STATE.includes(orderStatus.value) || props.editable) {
-      if (column?.editRender) {
+      if (column?.editRender && column.editRender.enabled !== false) {
         return "vxecol-edit";
       }
     }
@@ -836,7 +836,10 @@ const propsEvents = computed(() => {
     keydownStart: (data: any) => emit("keydownStart", data),
     keydown: (data: any) => emit("keydown", data),
     keydownEnd: (data: any) => emit("keydownEnd", data),
-    currentChange: (data: any) => emit("currentChange", data),
+    currentChange: (data: any) => {
+      console.log("currentChange !!!!!!!!!!!!:>> ", data);
+      emit("currentChange", data);
+    },
     radioChange: (data: any) => emit("radioChange", data),
     checkboxChange: (data: any) => emit("checkboxChange", data),
     checkboxAll: (data: any) => emit("checkboxAll", data),

+ 9 - 0
JLHWEB/src/styles/reset.scss

@@ -175,3 +175,12 @@
 .vxe-table--tooltip-wrapper {
   z-index: 3000 !important;
 }
+
+.vxe-table--body-wrapper.fixed-left--wrapper {
+  overflow-x: hidden !important;
+}
+
+.el-select__selected-item {
+  -webkit-user-select: auto !important;
+  user-select: auto !important;
+}

+ 1 - 1
JLHWEB/src/views/quote/bednetQuote/components/FormulaGroup.vue

@@ -30,7 +30,7 @@
       </div>
     </div>
     <div class="flx-1 overflow-auto">
-      <FormulaItem :data="item" :fields="fields" />
+      <FormulaItem :data="item" :fields="fields" :formula="data" />
     </div>
   </div>
 </template>

+ 7 - 3
JLHWEB/src/views/quote/bednetQuote/components/FormulaItem.vue

@@ -24,6 +24,7 @@ interface itemProps {
    */
   ifFold?: boolean;
   // dataValue: any;
+  formula?: any[];
 }
 
 const props = withDefaults(defineProps<itemProps>(), {
@@ -105,9 +106,12 @@ const RenderVariable = (data: any, rprops: any) => {
   let _value = "";
   if (sumVal) {
     // _value = isFilterPrice(sumVal.value);
-    _value = isFilterPrice(sumVal.value);
-    if (Number(_value) == 0) {
-      _value = sumVal.value;
+    // if (Number(_value) == 0) {
+    _value = sumVal.value;
+    // }
+    let isFormulaValue = props.formula.some(o => o.label.indexOf(fieldName) > -1);
+    if (isFormulaValue) {
+      _value = isFilterPrice(sumVal.value);
     }
     // } else {
     //   if (rprops.data?.children) {

+ 3 - 3
JLHWEB/src/views/quote/bednetQuote/detail.vue

@@ -129,7 +129,7 @@ interface DetailProps {
   /**
    * @description 床网大单类型
    */
-  dannumType?: number;
+  dannum_type?: number;
   /**
    * @description 是否只读
    */
@@ -644,7 +644,7 @@ onMounted(async () => {
       initParamsMx.value.arg_deptid = route.query?.deptid;
     }
   }
-  console.log('typeof props?.bednetid != "undefined" :>> ', typeof props?.bednetid != "undefined");
+  console.log('typeof props?.bednetid != "undefined" :>> ', typeof props?.bednetid != "undefined", props);
   if (typeof props?.bednetid != "undefined") {
     // 直接读取
     orderStatus.value = props.state;
@@ -652,7 +652,7 @@ onMounted(async () => {
     initParamsMx.value.arg_deptid = props?.deptid;
     initParamsMx.value.arg_bednetid = props.bednetid;
     defaultColumnsValue.value.deptid = props?.deptid;
-    dannum_type.value = props?.dannumType;
+    dannum_type.value = props?.dannum_type;
 
     defaultColumnsValue.value.mattress_width = props?.mattressWidth;
     defaultColumnsValue.value.mattress_length = props?.mattressLength;

+ 1 - 1
JLHWEB/src/views/quote/mattressQuote/components/FormulaGroup.vue

@@ -12,7 +12,7 @@
       </div>
     </div>
     <div class="flx-1 overflow-auto">
-      <FormulaItem :data="item" :fields="fields" :ifFold="item.ifFold" />
+      <FormulaItem :data="item" :fields="fields" :ifFold="item.ifFold" :formula="data" />
     </div>
   </div>
 </template>

+ 147 - 51
JLHWEB/src/views/quote/mattressQuote/hooks/index.tsx

@@ -241,7 +241,7 @@ export const useHooks = (t?: any) => {
         ref: "specialProcessesMxRef"
       },
       {
-        label: "其他额外费用",
+        label: "材料额外费用",
         name: "additionalCosts",
         ref: "additionalCostsMxRef"
       }
@@ -1295,7 +1295,7 @@ export const useHooks = (t?: any) => {
    * @param status 当前订单状态
    * @returns Promise
    */
-  const fModelChoseMtrl = (data: any, params: any, cb: any, label?: string, $table?: any) => {
+  const fModelChoseMtrl = (data: any, params: any, cb: any, label?: string, $table?: any, qty = 1) => {
     return new Promise((resolve, reject) => {
       // if (!ALLOW_EDIT_STATE.includes(status)) return;
 
@@ -1309,7 +1309,7 @@ export const useHooks = (t?: any) => {
           // submit
           console.log("openCustDialog res", res);
           nextTick(() => {
-            cb(data, res.value[0], $table);
+            cb(data, res.value[0], $table, qty);
             resolve(1);
           });
         },
@@ -1327,7 +1327,7 @@ export const useHooks = (t?: any) => {
    * @param data 当前数据
    * @param item 当前选择的数据
    */
-  const rModelSetMtrl = (data: any, item: any, $table?: any) => {
+  const rModelSetMtrl = (data: any, item: any, $table?: any, qty = 1) => {
     console.log("rModelSetMtrl data :>> ", data);
     console.log("rModelSetMtrl item :>> ", item);
     if (item) {
@@ -1344,7 +1344,7 @@ export const useHooks = (t?: any) => {
       data.shrinkage = item.price; // 收缩率
       data.thickness = Number(item.thickness);
       data.price_formula = item.price_formula;
-      data.qty = 1;
+      data.qty = qty;
 
       // cb && cb();
       if ($table) {
@@ -3020,6 +3020,7 @@ export const useHooks = (t?: any) => {
                 disabled={_disabled}
                 label="面拆"
                 class="mr-8"
+                onChange={val => autoLoadExtraData_chai(val, "if_m_chai")}
               />
               <el-checkbox
                 v-model={scope.searchParam.if_z_chai}
@@ -3028,6 +3029,7 @@ export const useHooks = (t?: any) => {
                 disabled={_disabled}
                 label="中拆"
                 class="mr-8"
+                onChange={val => autoLoadExtraData_chai(val, "if_z_chai")}
               />
               <el-checkbox
                 v-model={scope.searchParam.if_d_chai}
@@ -3035,6 +3037,7 @@ export const useHooks = (t?: any) => {
                 false-value={0}
                 disabled={_disabled}
                 label="底拆"
+                onChange={val => autoLoadExtraData_chai(val, "if_d_chai")}
               />
             </>
           );
@@ -3541,7 +3544,7 @@ export const useHooks = (t?: any) => {
           row.formulakind == 7
         );
 
-        return <el-input v-model={scope.row.thickness} type="number" disabled={_disabled}></el-input>;
+        return <el-input v-model={scope.row.thickness} disabled={_disabled}></el-input>;
       }
     },
     {
@@ -3549,8 +3552,6 @@ export const useHooks = (t?: any) => {
       field: "mtrlname",
       editRender: {},
       editColRender: (scope: any) => {
-        console.log("mtrlname hooks render scope :>> ", scope);
-        console.log("mtrlname hooks render LjDetailRef.value._mainData :>> ", state.LjDetailRef);
         const { $table, column, row, status } = scope;
         let field = column.field;
         let _label = column.title;
@@ -3558,9 +3559,6 @@ export const useHooks = (t?: any) => {
         //   _label = handleRowAccordingToProp(searchParam, field, column?.format);
         // }
         let _pricelistid = getPriceid();
-        console.log("_pricelistid :>> ", _pricelistid, row.formulakind);
-
-        console.log("state.mtrltypeTabList :>> ", mtrltypeTabList);
 
         let _mtrltypeItem: any = mtrltypeTabList.find(t => t.formulakinds.includes(Number(row.formulakind)));
         !_mtrltypeItem && (_mtrltypeItem = { value: -1 });
@@ -3570,6 +3568,13 @@ 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
@@ -3577,8 +3582,8 @@ export const useHooks = (t?: any) => {
               {...params}
               clearable
               placeholder={_label}
-              onOpenModal={() => fModelChoseMtrl(row, params, rModelSetMtrl, _mtrltypeItem.label, $table)}
-              onSelect={val => rModelSetMtrl(row, val, $table)}
+              onOpenModal={() => fModelChoseMtrl(row, params, rModelSetMtrl, _mtrltypeItem.label, $table, _qty)}
+              onSelect={val => rModelSetMtrl(row, val, $table, _qty)}
               onClear={() => rModelClearMtrl(row, $table)}
             >
               {{
@@ -3597,7 +3602,35 @@ export const useHooks = (t?: any) => {
       editColRender: (scope: any) => {
         const { $table, column, row, status } = scope;
 
-        return <el-input v-model={scope.row.qty} type="number" disabled={row.mtrlid == 0}></el-input>;
+        // 面料(面、底、侧)的数量/长度,不能输入
+        let arr = [
+          {
+            // label: "裥面",
+            type: [0, 80, 40, 50, 60, 70, 9000]
+          },
+          {
+            // label: "裥底",
+            type: [1, 81, 41, 51, 61, 71, 9001]
+          },
+          {
+            // label: "裥大恻",
+            type: [2, 82, 42, 52, 62, 72, 9002]
+          }
+          // {
+          //   // label: "裥小恻",
+          //   type: [3, 83, 43, 53, 63, 73, 9003]
+          //   // ref: "fabricMxTab11Ref"
+          // },
+          // {
+          //   // label: "裥V恻",
+          //   type: [4, 84, 44, 54, 64, 74, 9004]
+          //   // ref: "fabricMxTab12Ref"
+          // }
+        ];
+
+        let _disabled = arr.some(t => t.type.includes(row.formulakind));
+
+        return <el-input v-model={scope.row.qty} type="number" disabled={row.mtrlid == 0 || _disabled}></el-input>;
       }
     },
     {
@@ -4095,8 +4128,6 @@ export const useHooks = (t?: any) => {
       editRender: {},
       width: 250,
       editColRender: (scope: any) => {
-        console.log("mtrlname hooks render scope :>> ", scope);
-        console.log("mtrlname hooks render LjDetailRef.value._mainData :>> ", state.LjDetailRef);
         const { column, row, status, $table } = scope;
         let _label = column.title;
         let _deptid = state.LjDetailRef._mainData.deptid;
@@ -4270,15 +4301,11 @@ export const useHooks = (t?: any) => {
       field: "mtrlname",
       editRender: {},
       editColRender: (scope: any) => {
-        console.log("mtrlname hooks render scope :>> ", scope);
-        console.log("mtrlname hooks render LjDetailRef.value._mainData :>> ", state.LjDetailRef);
         const { column, row, status, $table } = scope;
         let _label = column.title;
         let _pricelistid = getPriceid();
-        console.log("_pricelistid :>> ", _pricelistid, row.formulakind);
 
         let _mtrltypeItem: any = mtrltypeTabList_cushions.find(t => t.formulakinds.includes(Number(row.formulakind)));
-        console.log("state.mtrltypeTabList :>> ", mtrltypeTabList_cushions, _mtrltypeItem);
         if (!_mtrltypeItem) {
           // ElMessage.error("不是垫层类型行,不能选物料");
           // return <></>;
@@ -4355,8 +4382,6 @@ export const useHooks = (t?: any) => {
       field: "mtrlname",
       editRender: {},
       editColRender: (scope: any) => {
-        console.log("mtrlname hooks render scope :>> ", scope);
-        console.log("mtrlname hooks render LjDetailRef.value._mainData :>> ", state.LjDetailRef);
         const { column, row, status, $table } = scope;
         let field = column.field;
         let _label = column.title;
@@ -4364,9 +4389,6 @@ export const useHooks = (t?: any) => {
         //   _label = handleRowAccordingToProp(searchParam, field, column?.format);
         // }
         let _pricelistid = getPriceid();
-        console.log("_pricelistid :>> ", _pricelistid, row.formulakind);
-
-        console.log("state.mtrltypeTabList :>> ", state.mtrltypeTabList);
 
         let _mtrltypeItem: any = mtrltypeTabList_accessories.find(t => t.formulakinds.includes(Number(row.formulakind)));
         if (!_mtrltypeItem) {
@@ -4415,8 +4437,6 @@ export const useHooks = (t?: any) => {
       field: "mtrlname",
       editRender: {},
       editColRender: (scope: any) => {
-        console.log("mtrlname hooks render scope :>> ", scope);
-        console.log("mtrlname hooks render LjDetailRef.value._mainData :>> ", state.LjDetailRef);
         const { column, row, status, $table } = scope;
         let field = column.field;
         let _label = column.title;
@@ -4424,9 +4444,6 @@ export const useHooks = (t?: any) => {
         //   _label = handleRowAccordingToProp(searchParam, field, column?.format);
         // }
         let _pricelistid = getPriceid();
-        console.log("_pricelistid :>> ", _pricelistid, row.formulakind);
-
-        console.log("state.mtrltypeTabList :>> ", state.mtrltypeTabList);
 
         let _mtrltypeItem: any = mtrltypeTabList_packag.find(t => t.formulakinds.includes(Number(row.formulakind)));
         !_mtrltypeItem && (_mtrltypeItem = { value: -1 });
@@ -4575,14 +4592,9 @@ export const useHooks = (t?: any) => {
       field: "mtrlname",
       editRender: {},
       editColRender: (scope: any) => {
-        console.log("mtrlname hooks render scope :>> ", scope);
-        console.log("mtrlname hooks render LjDetailRef.value._mainData :>> ", state.LjDetailRef);
         const { column, row, status, $table } = scope;
         let _label = column.title;
         let _pricelistid = getPriceid();
-        console.log("_pricelistid :>> ", _pricelistid, row.formulakind);
-
-        console.log("state.mtrltypeTabList :>> ", state.mtrltypeTabList);
 
         let _mtrltypeItem: any = mtrltypeTabList_inner.find(t => t.formulakinds.includes(Number(row.formulakind)));
         !_mtrltypeItem && (_mtrltypeItem = { value: -1 });
@@ -4647,8 +4659,24 @@ export const useHooks = (t?: any) => {
       field: "addmx",
       width: 80,
       render: (scope: any) => {
+        let oItem = state.specialProcessesMxData.find(o => o.extraid == scope.row.extraid);
+        if (!oItem) {
+          oItem = {
+            inputtype: 1
+          };
+        }
+
         if (state.orderStatus) {
-          return <ElButton type="primary" plain circle icon={Plus} onClick={() => funcAddMtrlMx(scope)}></ElButton>;
+          return (
+            <ElButton
+              type="primary"
+              plain
+              circle
+              icon={Plus}
+              disabled={oItem.inputtype == 2}
+              onClick={() => funcAddMtrlMx(scope)}
+            ></ElButton>
+          );
         } else {
           return <>+</>;
         }
@@ -4659,6 +4687,13 @@ export const useHooks = (t?: any) => {
       field: "delmx",
       width: 80,
       render: (scope: any) => {
+        let oItem = state.specialProcessesMxData.find(o => o.extraid == scope.row.extraid);
+        if (!oItem) {
+          oItem = {
+            inputtype: 1
+          };
+        }
+
         if (state.orderStatus) {
           return (
             <>
@@ -4672,7 +4707,7 @@ export const useHooks = (t?: any) => {
               >
                 {{
                   reference: () => {
-                    return <ElButton type="danger" plain circle icon={Minus} />;
+                    return <ElButton type="danger" plain circle disabled={oItem.inputtype == 2} icon={Minus} />;
                   }
                 }}
               </ElPopconfirm>
@@ -4960,7 +4995,7 @@ export const useHooks = (t?: any) => {
       editColRender: (scope: any) => {
         return (
           <>
-            <el-input v-model={scope.row.mattress_width} type="number" onChange={() => disshow_subspecs(scope.row)} />
+            <el-input v-model={scope.row.mattress_width} onChange={() => disshow_subspecs(scope.row)} />
           </>
         );
       }
@@ -4979,7 +5014,7 @@ export const useHooks = (t?: any) => {
       editColRender: (scope: any) => {
         return (
           <>
-            <el-input v-model={scope.row.mattress_length} type="number" onChange={() => disshow_subspecs(scope.row)} />
+            <el-input v-model={scope.row.mattress_length} onChange={() => disshow_subspecs(scope.row)} />
           </>
         );
       }
@@ -4998,7 +5033,7 @@ export const useHooks = (t?: any) => {
       editColRender: (scope: any) => {
         return (
           <>
-            <el-input v-model={scope.row.mattress_height} type="number" onChange={() => disshow_subspecs(scope.row)} />
+            <el-input v-model={scope.row.mattress_height} onChange={() => disshow_subspecs(scope.row)} />
           </>
         );
       }
@@ -5008,10 +5043,10 @@ export const useHooks = (t?: any) => {
       field: "spring_qty_width",
       datatype: "integer",
       editRender: {
-        name: "$input",
-        props: {
-          type: "number"
-        }
+        name: "$input"
+        // props: {
+        //   type: "number"
+        // }
       }
     },
     {
@@ -5019,10 +5054,10 @@ export const useHooks = (t?: any) => {
       field: "spring_qty_length",
       datatype: "integer",
       editRender: {
-        name: "$input",
-        props: {
-          type: "number"
-        }
+        name: "$input"
+        // props: {
+        //   type: "number"
+        // }
       }
     }
   ];
@@ -5261,7 +5296,6 @@ export const useHooks = (t?: any) => {
    */
   const getPriceid = () => {
     let _deptid = state.LjDetailRef?._mainData?.deptid ?? 0;
-    console.log("getPriceid state.LjDetailRef  _deptid :>> ", _deptid);
     if (!_deptid) {
       ElMessage.warning("请先选择部门");
       state.LjDetailRef?.baseformRef.element.validateField("deptid");
@@ -5270,10 +5304,8 @@ export const useHooks = (t?: any) => {
 
     let deptEnum = state.LjDetailRef.enumMap.get("deptid");
     let _pricelistid = 0;
-    console.log("deptEnum :>> ", deptEnum);
     if (deptEnum) {
       let depItem = deptEnum.find((item: any) => item.value == _deptid);
-      console.log("depItem :>> ", depItem);
       if (depItem) {
         _pricelistid = Number(depItem.pricelistid);
       }
@@ -5337,6 +5369,70 @@ export const useHooks = (t?: any) => {
     }
   };
 
+  /**
+   * @description 自动导入修改特殊工艺费用
+   */
+  const autoLoadExtraData_chai = (value?: any, fieldName?: any) => {
+    console.log("autoLoadExtraData_chai value :>> ", value);
+    let _type = "";
+    switch (fieldName) {
+      case "if_m_chai":
+        _type = "面拆";
+        break;
+      case "if_z_chai":
+        _type = "中拆";
+        break;
+      case "if_d_chai":
+        _type = "底拆";
+        break;
+    }
+
+    console.log("state. specialProcessesEnum:>> ", state.specialProcessesEnum, state.specialProcessesMxData);
+
+    let result = state.specialProcessesMxData.filter((item: any) => item.extramxname.indexOf(_type) > -1);
+    if (result.length) {
+      const $tableTarget = state.specialProcessesMxRef.element;
+      const { visibleData: tgVisibleData } = $tableTarget.getTableData();
+
+      if (tgVisibleData) {
+        let _remove = [];
+        tgVisibleData.map(t => {
+          let _itm = result.find(i => i.extraid === t.extraid);
+          if (_itm) {
+            _remove.push(t);
+          }
+        });
+        $tableTarget.remove(_remove);
+      }
+
+      if (value) {
+        // 新增
+        if (result.length) {
+          let _arr = [];
+          let _mattressId = state.LjDetailRef._mainData.mattressid;
+          result.map(o => {
+            let _itm = {
+              mattressid: _mattressId,
+              mattressmxid: 0,
+              extraid: o.extraid,
+              // extratypename: "",
+              extraname: o.extramxname,
+              price: o.price,
+              qty: o.qty,
+              dscrp: o.dscrp,
+              inputtype: o.inputtype,
+              typeid: o.typeid
+            };
+            _arr.push(_itm);
+          });
+          $tableTarget.insertAt(_arr, -1);
+        }
+      } else {
+        // 删除
+      }
+    }
+  };
+
   return {
     ...toRefs(state),
     columns,