Browse Source

1、分享报价增加佣金点数,税金,额外点数,额外费用,币种
2、修复床垫报价包装方式切换带出的默认物料不正确问题
3、床垫清单配置录入类型自动匹配配置表选配项
4、床网报价,圆网类型四周口袋无法编辑问题

MY 20 hours ago
parent
commit
e8d4b2a290

+ 4 - 0
JLHHJSvr/Com/Model/u_mattress_mx_mtrl.cs

@@ -76,6 +76,10 @@ namespace JLHHJSvr.Com.Model
         /// 床网弹叉数量
         /// </summary>
         public decimal? bednet_fork_qty { get; set; }
+        /// <summary>
+        /// 默认物料
+        /// </summary>
+        public int? default_mtrlid { get; set; }
         #endregion
     }
 }

+ 7 - 13
JLHHJSvr/Excutor/GetMattressPackagMxExcutor.cs

@@ -37,23 +37,17 @@ namespace JLHHJSvr.Excutor
             {
                 con.Open();
 
-                using (cmd.Transaction = con.BeginTransaction())
-                {
+                var helper = HelperBase.GetHelper<MattressHelper>(cmd, new HelperBase.Context() { tokendata = tokendata });
+                var dw_2 = new List<u_mattress_mx_mtrl>();
 
-                    var helper = HelperBase.GetHelper<MattressHelper>(cmd, new HelperBase.Context() { tokendata = tokendata });
+                //   导入 2-按包装方式  的公式
+                helper.wf_import_bz(request.packtype, ref dw_2);
 
-                    var dw_2 = new List<u_mattress_mx_mtrl>();
+                helper.wf_sort_mx(ref dw_2);
+                helper.wf_default_mtrlid(request.pricelistid, ref dw_2);
 
-                    //   导入 2-按包装方式  的公式
-                    helper.wf_import_bz(request.packtype, ref dw_2);
+                rslt.mattressMx = dw_2;
 
-                    helper.wf_sort_mx(ref dw_2);
-
-                    helper.wf_default_mtrlid(request.pricelistid, ref dw_2);
-
-                    rslt.mattressMx = dw_2;
-
-                }
             }
         }
     }

+ 2 - 1
JLHHJSvr/Helper/InterfaceHelper.cs

@@ -1960,7 +1960,8 @@ namespace JLHHJSvr.Helper
                             interfaceList[i].erp_pzname = result.name;
                         }
 
-                        if (interfaceList[i].bj_inputtype != 2) interfaceList[i].bj_inputtype = result.inputtype;
+                        //if (interfaceList[i].bj_inputtype != 2) 
+                        interfaceList[i].bj_inputtype = result.inputtype;
                     }
                 }
 

+ 38 - 25
JLHHJSvr/Helper/MattressHelper.cs

@@ -2126,6 +2126,12 @@ namespace JLHHJSvr.Helper
                 mattress_copy.js1_auditingdate = null;
 
                 mattress_copy.xd_flag = 0;
+                mattress_copy.commission = mattress.commission;
+                mattress_copy.taxes = mattress.taxes;
+                mattress_copy.other_rate = mattress.other_rate;
+                mattress_copy.extras_cost = mattress.extras_cost;
+                mattress_copy.moneyrate = mattress.moneyrate;
+                mattress_copy.discount = mattress.discount;
 
                 var mattressMxMtrlList = GetMattressMxMtrl(mattress.mattressid);
 
@@ -3400,6 +3406,7 @@ namespace JLHHJSvr.Helper
                 newDw2.formula = mx.formula;
                 newDw2.useformula = mx.useformula;
                 newDw2.gydscrp = mx.gydscrp;
+                newDw2.default_mtrlid = mx.default_mtrlid;
 
                 dw_2.Add(newDw2);
             }
@@ -3513,35 +3520,41 @@ namespace JLHHJSvr.Helper
         {
             //   导入 2-按包装方式  的公式
             var mtrlPriceList = new List<u_mtrl_price>();
-            wf_mtrl_fine(new List<int> { 46804, 46809, 46811, 46817, 46872 }, pricelistid, ref mtrlPriceList);
+            var mtrlids = new List<int>();
+            List<int> uniqueMtrlIds = new HashSet<int>(dw_2.Select(obj => obj.default_mtrlid.Value)).ToList();
+
+            wf_mtrl_fine(uniqueMtrlIds, pricelistid, ref mtrlPriceList);
 
             foreach (var mx in dw_2)
             {
-                var _mtrlid = 0;
-                if (mx.formulakind == 16)
-                {
-                    //默认 pe    kind = 16  默认  10C PE袋  mtrlid  46804
-                    _mtrlid = 46804;
-                }
-                else if (mx.formulakind == 17)
-                {
-                    //默认 外层pe    kind = 17  默认  20C  mtrlid  46809
-                    _mtrlid = 46809;
-                }
-                else if (mx.formulakind == 18)
+                var _mtrlid = mx.default_mtrlid;
+                if(_mtrlid == null || _mtrlid == 0)
                 {
-                    //默认 pvc    kind = 18  默认  15C   mtrlid  46811
-                    _mtrlid = 46811;
-                }
-                else if (mx.formulakind == 19)
-                {
-                    //默认 卷包外包装    kind = 19  默认  彩箱   32*32   46817
-                    _mtrlid = 46817;
-                }
-                else if (mx.formulakind == 27)
-                {
-                    //默认 拉手脚轮    kind = 27  默认     46872
-                    _mtrlid = 46872;
+                    if (mx.formulakind == 16)
+                    {
+                        //默认 pe    kind = 16  默认  10C PE袋  mtrlid  46804
+                        _mtrlid = 46804;
+                    }
+                    else if (mx.formulakind == 17)
+                    {
+                        //默认 外层pe    kind = 17  默认  20C  mtrlid  46809
+                        _mtrlid = 46809;
+                    }
+                    else if (mx.formulakind == 18)
+                    {
+                        //默认 pvc    kind = 18  默认  15C   mtrlid  46811
+                        _mtrlid = 46811;
+                    }
+                    else if (mx.formulakind == 19)
+                    {
+                        //默认 卷包外包装    kind = 19  默认  彩箱   32*32   46817
+                        _mtrlid = 46817;
+                    }
+                    else if (mx.formulakind == 27)
+                    {
+                        //默认 拉手脚轮    kind = 27  默认     46872
+                        _mtrlid = 46872;
+                    }
                 }
 
                 var mtrlItm = mtrlPriceList.Where((itm) => itm.mtrlid == _mtrlid).ToList();

+ 60 - 0
JLHWEB/src/views/quote/bednetQuote/hooks/index.tsx

@@ -362,11 +362,23 @@ export const useHooks = (t?: any, props?: any) => {
     }
   };
 
+  const rModelSetPocketAroundSpring = (data: any, item: any) => {
+    if (item) {
+      data.pocket_around_springid = item.springid;
+      data.pocket_around_springname = item.springname;
+    }
+  };
+
   const rModelClearHardAroundSpring = (data: any) => {
     data.hard_around_springid = 0;
     data.hard_around_springname = "";
   };
 
+  const rModelClearPocketAroundSpring = (data: any) => {
+    data.pocket_around_springid = 0;
+    data.pocket_around_springname = "";
+  };
+
   const getPriceid = () => {
     let _deptid = state.LjDetailRef?._mainData?.deptid ?? 0;
 
@@ -2182,6 +2194,54 @@ export const useHooks = (t?: any, props?: any) => {
           </>
         );
       }
+    },
+    {
+      field: "if_pocket_around",
+      editRender: {},
+      editColRender: (scope: any) => {
+        const { column, row, status } = scope;
+
+        return (
+          <>
+            <el-checkbox v-model={row.if_pocket_around} class="vxe-edit-col-middle"></el-checkbox>
+          </>
+        );
+      }
+    },
+    {
+      field: "pocket_around_row",
+      editRender: {},
+      editColRender: (scope: any) => {
+        const { column, row, status } = scope;
+        return (
+          <>
+            <el-input v-model={row.pocket_around_row} disabled={Number(row.if_pocket_around) == 0} />
+          </>
+        );
+      }
+    },
+    {
+      field: "pocket_around_springname",
+      editRender: {},
+      editColRender: (scope: any) => {
+        console.log("hard_around_springname editColRender scope :>> ", scope);
+        const { column, row, status } = scope;
+        let _label = column.title;
+
+        return (
+          <>
+            <SpringSelect
+              value={row.pocket_around_springid}
+              disabled={Number(row.if_pocket_around) == 0}
+              clearable
+              placeholder={_label}
+              onOpenModal={() => fModelChoseSpring(row, {}, rModelSetPocketAroundSpring)}
+              onSelect={(val: any) => rModelSetPocketAroundSpring(row, val)}
+              onClear={() => rModelClearPocketAroundSpring(row)}
+            />
+          </>
+        );
+      }
     }
   ]);
   const columnsMx = ref<ColumnProps<any>[]>();

+ 72 - 6
JLHWEB/src/views/quote/mattressQuote/index.vue

@@ -24,7 +24,7 @@
   <el-dialog v-model="dialogFormVisible" title="部门选择" width="500" draggable append-to-body>
     <el-form :model="formParam" label-width="80px">
       <el-form-item label="部门">
-        <el-select v-model="formParam.deptid" placeholder="请选择部门" filterable>
+        <el-select v-model="formParam.deptid" placeholder="请选择部门" filterable @change="wf_get_moneyrate_discount">
           <el-option v-for="(col, index) in deptEnum" :key="index" :label="col.label" :value="col.value"></el-option>
         </el-select>
       </el-form-item>
@@ -42,6 +42,33 @@
           <el-option label="小柜" value="小柜" />
         </el-select>
       </el-form-item>
+      <el-form-item label="佣金点数">
+        <el-input-number v-model="formParam.commission" />
+      </el-form-item>
+      <el-form-item label="税金">
+        <el-select v-model="formParam.taxes" class="select-text-right">
+          <template #prefix>
+            <span>{{ formParam.taxes }}</span>
+          </template>
+          <el-option label="不含税" :value="1" />
+          <el-option label="含税" :value="1.07" />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="额外点数">
+        <el-input-number v-model="formParam.other_rate" />
+      </el-form-item>
+      <el-form-item label="额外费用">
+        <el-input-number v-model="formParam.extras_cost" />
+      </el-form-item>
+      <el-form-item label="币种">
+        <el-select v-model="formParam.moneytype" class="select-text-right" @change="wf_get_moneyrate_discount">
+          <template #prefix>
+            <span>{{ formParam.moneyrate }}</span>
+          </template>
+          <el-option label="人民币" :value="0" />
+          <el-option label="美元" :value="1" />
+        </el-select>
+      </el-form-item>
       <el-form-item label="压包数量" v-if="formParam.packtype == 0">
         <el-input-number v-model="formParam.packqty" :min="0" :max="1000" />
       </el-form-item>
@@ -146,7 +173,14 @@ const formParam = ref({
   cabinet_type: "维持原状",
   packtype: 0,
   packqty: 0,
-  createby: ""
+  createby: "",
+  commission: 0,
+  taxes: 1,
+  other_rate: 0,
+  extras_cost: 0,
+  moneytype: 0,
+  moneyrate: 1,
+  discount: 0
 });
 
 const getData = (params: any) => {
@@ -707,15 +741,18 @@ const openDeptChoosen = async curRecords => {
     let enumMap = vxeTableRef.value.enumMap;
     deptEnum.value = enumMap.get("deptid");
     console.log("openDeptChoosen deptEnum.value :>> ", deptEnum.value);
+    console.log("openDeptChoosen curRecords.value :>> ", curRecords);
 
     if (deptEnum.value.length > 0) {
       formParam.value.deptid = curRecords[0].deptid;
       formParam.value.packtype = curRecords[0].packtype;
       formParam.value.packqty = curRecords[0].packqty;
+      formParam.value.commission = curRecords[0].commission;
+      formParam.value.other_rate = curRecords[0].other_rate;
+      formParam.value.extras_cost = curRecords[0].extras_cost;
+      formParam.value.moneytype = curRecords[0].moneyrate > 1 ? 1 : 0;
 
       dialogFormVisible.value = true;
-
-      // loadingBtn.value = false;
     } else {
       console.error("获取部门列表为空");
     }
@@ -734,16 +771,24 @@ const BatchCopyMattressAudited = () => {
   }
 
   loadingBtn.value = true;
+
   let list = curRecords.map((item: any) => {
-    return {
+    const result = {
       mattressid: Number(item.mattressid),
       deptid: formParam.value.deptid,
       area: formParam.value.area,
       cabinet_type: formParam.value.cabinet_type,
       packtype: formParam.value.packtype,
       packqty: formParam.value.packqty,
-      createby: formParam.value.createby
+      createby: formParam.value.createby,
+      commission: formParam.value.commission,
+      taxes: formParam.value.taxes,
+      other_rate: formParam.value.other_rate,
+      extras_cost: formParam.value.extras_cost,
+      moneyrate: formParam.value.moneyrate,
+      discount: formParam.value.discount
     };
+    return result;
   });
   ElMessageBox.confirm(`是否确定要批复制${curRecords.length}张床垫报价单吗?`, "询问", {
     confirmButtonText: t("common.okText"),
@@ -781,4 +826,25 @@ const autoUpdateTableCheckbox = () => {
     $table.setAllTreeExpand(true);
   }
 };
+
+const wf_get_moneyrate_discount = val => {
+  let depItem = deptEnum.value.find((item: any) => item.value == formParam.value.deptid);
+  if (depItem) {
+    let _moneyrate = !depItem.moneyrate || Number(depItem.moneyrate) == 0 ? 1 : depItem.moneyrate;
+    if (formParam.value.moneytype == 0) {
+      formParam.value.moneyrate = 1;
+    } else {
+      formParam.value.moneyrate = _moneyrate;
+    }
+    formParam.value.discount = depItem.discount;
+  }
+};
 </script>
+
+<style lang="scss">
+.select-text-right {
+  .el-select__wrapper {
+    text-align: right;
+  }
+}
+</style>