浏览代码

1、修复后台WHERE条件没有空格问题
2、更新软床报价代码
3、修复床垫报价复制副规格无法保存问题

MY 1 月之前
父节点
当前提交
7fa6486e00
共有 28 个文件被更改,包括 1185 次插入205 次删除
  1. 1 1
      JLHHJSvr/Com/GetErpMtrlPriceList.cs
  2. 4 0
      JLHHJSvr/Com/Model/CalCulationFormula.cs
  3. 6 3
      JLHHJSvr/Com/Model/L1Mtrldef.cs
  4. 4 0
      JLHHJSvr/Com/Model/u_softbed.cs
  5. 1 1
      JLHHJSvr/DBA/DAL_SQLite/Utils/SqlStrHelper.cs
  6. 14 0
      JLHHJSvr/DataStore/_Mapper_softbed_formulaid.xml
  7. 26 36
      JLHHJSvr/Excutor/GetErpMtrlPriceListExcutor.cs
  8. 1 1
      JLHHJSvr/Excutor/SaveErpMtrlPriceListExcutor.cs
  9. 1 0
      JLHHJSvr/GlobalVar/GlobalVar.cs
  10. 75 1
      JLHHJSvr/Helper/BasicInfoHelper.cs
  11. 98 47
      JLHHJSvr/Helper/SoftBedHelper.cs
  12. 23 6
      JLHHJSvr/Tools/CalculateFormula.cs
  13. 3 0
      JLHWEB/src/api/interface/index.ts
  14. 6 1
      JLHWEB/src/api/modules/basicinfo.ts
  15. 8 0
      JLHWEB/src/api/modules/common.ts
  16. 1 1
      JLHWEB/src/components/LjVxeTable/index.vue
  17. 2 1
      JLHWEB/src/languages/modules/zh-cn/menu.json
  18. 0 0
      JLHWEB/src/views/baseinfo/erpmtrlprice/components/ImportPrice.vue
  19. 2 3
      JLHWEB/src/views/baseinfo/erpmtrldef/detail.vue
  20. 11 41
      JLHWEB/src/views/baseinfo/erpmtrldef/hooks/index.tsx
  21. 13 25
      JLHWEB/src/views/baseinfo/erpmtrldef/index.vue
  22. 2 0
      JLHWEB/src/views/quote/mattressQuote/detail.vue
  23. 8 1
      JLHWEB/src/views/quote/softbedQuote/detail.vue
  24. 93 36
      JLHWEB/src/views/quote/softbedQuote/hooks/index.tsx
  25. 185 0
      JLHWEB/src/views/system/selector/erpMtrlPrice/hooks/index.ts
  26. 305 0
      JLHWEB/src/views/system/selector/erpMtrlPrice/index.vue
  27. 116 0
      JLHWEB/src/views/system/selector/erpMtrlPrice/input.vue
  28. 176 0
      JLHWEB/src/views/system/selector/erpMtrlPrice/select.vue

+ 1 - 1
JLHHJSvr/Com/GetErpMtrlPriceList.cs

@@ -26,7 +26,7 @@ namespace JLHHJSvr.Com
         public string usermtrlmode { get; set; }
         public string plancode { get; set; }
         public string mtrlengname { get; set; }
-
+        public List<int> mtrltypeids { get; set; }
         public int pageindex { get; set; }
         public int pagesize { get; set; }
         public override string GetApiName()

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

@@ -28,6 +28,10 @@ namespace JLHHJSvr.Com.Model
         /// 计算后值
         /// </summary>
         public object value { get; set; }
+        /// <summary>
+        /// 拓扑
+        /// </summary>
+        public List<string> graph { get; set; }
 
         public override bool Equals(object o)
         {

+ 6 - 3
JLHHJSvr/Com/Model/L1Mtrldef.cs

@@ -105,9 +105,6 @@ namespace JLHHJSvr.Com.Model
         public string woodcode_configName { get; set; }
         public string status_configName { get; set; }
         public decimal? quoteqty { get; set; }
-        #region mtrlware
-        public decimal? noallocqty { get; set; }
-        #endregion
         /// <summary>
         /// 主图MD5
         /// </summary>
@@ -158,6 +155,12 @@ namespace JLHHJSvr.Com.Model
         public int? mtrlprp { get; set; }
         public string plancode { get; set; }
 
+        #region u_erpmtrl_price
+        public DateTime? create_date { get; set; }
+        public string create_emp { get; set; }
+        public DateTime? update_date { get; set; }
+        public string update_emp { get; set; }
+        #endregion
     }
 
 }

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

@@ -47,6 +47,10 @@ namespace JLHHJSvr.Com.Model
         public string update_emp { get; set; }
 
         public List<u_softbed_mx> mxList { get; set; }
+        /// <summary>
+        /// 生成标准配置值
+        /// </summary>
+        public List<u_configure_codemx> codeMxList { get; set; }
     }
 
 }

+ 1 - 1
JLHHJSvr/DBA/DAL_SQLite/Utils/SqlStrHelper.cs

@@ -311,7 +311,7 @@ DROP TABLE #tmp_sorttable";
                 }
                 whereStr += orgWhereStr;
             }
-            outCmdStr += whereStr;
+            outCmdStr += " " + whereStr;
             outCmdStr += " " + sqlInfo.groupStr;
             outCmdStr += " " + sqlInfo.orderStr;
             if (!string.IsNullOrEmpty(preOrderStr))

+ 14 - 0
JLHHJSvr/DataStore/_Mapper_softbed_formulaid.xml

@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<select>
+  <selectstr>
+SELECT u_softbed_formula.formulaid
+	,u_softbed_formula.formulaname
+	,u_softbed_formula.use_formula
+	,u_softbed_formula.price_formula
+FROM u_softbed_formula
+  </selectstr>
+  <where>
+  </where>
+  <displayfields>
+  </displayfields>
+</select>

+ 26 - 36
JLHHJSvr/Excutor/GetErpMtrlPriceListExcutor.cs

@@ -31,70 +31,60 @@ namespace JLHHJSvr.Excutor
             using (var cmd = con.CreateCommand())
             {
                 con.Open();
+                var baseHelper = HelperBase.GetHelper<BasicInfoHelper>(cmd);
 
-                var erpHelper = HelperBase.GetHelper<ERPHelper>(null);
+                var whereList = new List<string>();
+                var param = new Dictionary<string, object>();
 
-                var mtrldef = new L1Mtrldef()
+                //
+                whereList.Add("u_mtrldef.flag = 2");
+                //
+                if(request.mtrltypeids != null && request.mtrltypeids.Count > 0)
                 {
-                    flag = 2,
-                };
-
+                    whereList.Add($"u_mtrldef.mtrltypeid IN {ListEx.getString(request.mtrltypeids)}");
+                }
                 if (!string.IsNullOrEmpty(request.mtrlcode))
                 {
-                    mtrldef.mtrlcode = request.mtrlcode;
+                    whereList.Add("u_mtrldef.mtrlcode LIKE @mtrlcode");
+                    param.Add("@mtrlcode", $"%{request.mtrlcode}%");
                 }
-
                 if (!string.IsNullOrEmpty(request.mtrlname))
                 {
-                    mtrldef.mtrlname = request.mtrlname;
+                    whereList.Add("u_mtrldef.mtrlname LIKE @mtrlname");
+                    param.Add("@mtrlname", $"%{request.mtrlname}%");
                 }
-
                 if (!string.IsNullOrEmpty(request.mtrlmode))
                 {
-                    mtrldef.mtrlmode = request.mtrlmode;
+                    whereList.Add("u_mtrldef.mtrlmode LIKE @mtrlmode");
+                    param.Add("@mtrlmode", $"%{request.mtrlmode}%");
                 }
-
                 if (!string.IsNullOrEmpty(request.mtrlsectype))
                 {
-                    mtrldef.mtrlsectype = request.mtrlsectype;
+                    whereList.Add("u_mtrldef.mtrlsectype LIKE @mtrlsectype");
+                    param.Add("@mtrlsectype", $"%{request.mtrlsectype}%");
                 }
-
                 if (!string.IsNullOrEmpty(request.zxmtrlmode))
                 {
-                    mtrldef.zxmtrlmode = request.zxmtrlmode;
+                    whereList.Add("u_mtrldef.zxmtrlmode LIKE @zxmtrlmode");
+                    param.Add("@zxmtrlmode", $"%{request.zxmtrlmode}%");
                 }
-
                 if (!string.IsNullOrEmpty(request.usermtrlmode))
                 {
-                    mtrldef.usermtrlmode = request.usermtrlmode;
+                    whereList.Add("u_mtrldef.usermtrlmode LIKE @usermtrlmode");
+                    param.Add("@usermtrlmode", $"%{request.usermtrlmode}%");
                 }
-
                 if (!string.IsNullOrEmpty(request.plancode))
                 {
-                    mtrldef.plancode = request.plancode;
+                    whereList.Add("u_mtrldef.plancode LIKE @plancode");
+                    param.Add("@plancode", $"%{request.plancode}%");
                 }
                 if (!string.IsNullOrEmpty(request.mtrlengname))
                 {
-                    mtrldef.mtrlengname = request.mtrlengname;
+                    whereList.Add("u_mtrldef.mtrlengname LIKE @mtrlengname");
+                    param.Add("@mtrlengname", $"%{request.mtrlengname}%");
                 }
 
-                int total = 0;
-                var resultList = erpHelper.GetERPMtrldef(cmd, ref total, request.keyword, mtrldef, request.pagesize, request.pageindex);
-
-
-                var mtrlids = resultList.Where(t => t.mtrlid > 0).Select(t => t.mtrlid).ToList();
-
-                if (mtrlids.Count > 0)
-                {
-                    var priceList = new List<u_erpmtrl_price>();
-
-                    DbSqlHelper.SelectJoin(cmd, $@"SELECT * FROM u_erpmtrl_price FROM mtrlid IN {ListEx.getString(mtrlids)}", null, null, "mtrlid", "mtrlid,price", 0,
-                       0, priceList);
-
-                }
-
-
-                rslt.mtrldefList = resultList;
+                rslt.mtrldefList = baseHelper.GetErpMtrlPriceList(whereList, param, request.pageindex, request.pagesize, out int total);
                 rslt.totalcnt = total;
                 rslt.pageindex = request.pageindex;
                 rslt.pagesize = request.pagesize;

+ 1 - 1
JLHHJSvr/Excutor/SaveErpMtrlPriceListExcutor.cs

@@ -54,7 +54,7 @@ namespace JLHHJSvr.Excutor
                 }
 
 
-                var baseHelper = HelperBase.GetHelper<BasicInfoHelper>(cmd);
+                var baseHelper = HelperBase.GetHelper<BasicInfoHelper>(cmd,new HelperBase.Context() { tokendata = tokendata});
                 using (cmd.Transaction = con.BeginTransaction())
                 {
                     try

+ 1 - 0
JLHHJSvr/GlobalVar/GlobalVar.cs

@@ -262,6 +262,7 @@ namespace JLHHJSvr
                 excutorManager.AddMap("GetSoftBedConfigureList", typeof(GetSoftBedConfigureListRequest), new GetSoftBedConfigureListExcutor()); // 获取软床报价部件选配
                 excutorManager.AddMap("SaveSoftBedFormula", typeof(SaveSoftBedFormulaRequest), new SaveSoftBedFormulaExcutor()); // 保存软床公式定义
                 excutorManager.AddMap("SaveErpMtrlPriceList", typeof(SaveErpMtrlPriceListRequest), new SaveErpMtrlPriceListExcutor()); // 保存物料价格
+                excutorManager.AddMap("GetErpMtrlPriceList", typeof(GetErpMtrlPriceListRequest), new GetErpMtrlPriceListExcutor()); // 获取ERP物料资料定义
 
             }
             catch (Exception ex)

+ 75 - 1
JLHHJSvr/Helper/BasicInfoHelper.cs

@@ -1,4 +1,5 @@
-using JLHHJSvr.BLL;
+using DirectService.Tools;
+using JLHHJSvr.BLL;
 using JLHHJSvr.Com.Model;
 using JLHHJSvr.LJException;
 using LJLib.DAL.SQL;
@@ -9,6 +10,7 @@ using System.Collections.Generic;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
+using System.Web.UI.WebControls.WebParts;
 
 namespace JLHHJSvr.Helper
 {
@@ -38,6 +40,37 @@ namespace JLHHJSvr.Helper
             }
         }
         /// <summary>
+        /// 核价选配项值-保存
+        /// </summary>
+        /// <param name="configure"></param>
+        public void SaveConfigureCodeMx(u_configure_codemx codeMx)
+        {
+            if (codeMx.printid <= 0)
+            {
+                int _printid = 0;
+                cmd.CommandText = @"SELECT ISNULL(MAX(printid),0) AS printid FROM u_configure_codemx WHERE pzid = @pzid";
+                cmd.Parameters.Clear();
+                cmd.Parameters.AddWithValue("@pzid", codeMx.pzid);
+                using (var reader = cmd.ExecuteReader())
+                {
+                    if (reader.Read())
+                    {
+                        _printid = Convert.ToInt32(reader["printid"]);
+                    }
+                }
+                codeMx.printid = _printid + 1;
+
+                var fields = @"pzid,printid,pzcodemx,namemx,gradestr,mtrlcode,price,ifdft,MCostRate,ProfitRate,dscrp,ifuse,ifnoch,pricerate,packqty,packvol,price_pz,grade";
+                DbSqlHelper.Insert(cmd, "u_configure_codemx", null, codeMx, fields);
+            }
+            else
+            {
+                //修改
+                var fields = @"pzcodemx,namemx,gradestr,mtrlcode,price,ifdft,MCostRate,ProfitRate,dscrp,ifuse,ifnoch,pricerate,packqty,packvol,price_pz,grade";
+                DbSqlHelper.Update(cmd, "u_configure_codemx", null, codeMx, "pzid,printid", fields);
+            }
+        }
+        /// <summary>
         /// 核价软床公式定义-保存
         /// </summary>
         /// <param name="formula"></param>
@@ -75,6 +108,11 @@ namespace JLHHJSvr.Helper
                 DbSqlHelper.Update(cmd, "u_softbed_formula", null, formula, "formulaid", fields);
             }
         }
+        /// <summary>
+        /// 保存ERP物料资料定义
+        /// </summary>
+        /// <param name="mtrl"></param>
+        /// <exception cref="LJCommonException"></exception>
         public void SaveErpMtrlPrice(u_erpmtrl_price mtrl)
         {
             var fields = "";
@@ -94,5 +132,41 @@ namespace JLHHJSvr.Helper
                 DbSqlHelper.Insert(cmd, "u_erpmtrl_price", null, mtrl, "mtrlid,price,create_date,create_emp");
             }
         }
+        /// <summary>
+        /// 获取ERP物料资料定义
+        /// </summary>
+        /// <param name="whereList"></param>
+        /// <param name="param"></param>
+        /// <param name="pageindex"></param>
+        /// <param name="pagesize"></param>
+        /// <param name="totalcnt"></param>
+        /// <returns></returns>
+        public List<L1Mtrldef> GetErpMtrlPriceList(List<string> whereList, Dictionary<string, object> param,int pageindex,int pagesize,out int totalcnt)
+        {
+            var mtrldefList = new List<L1Mtrldef>();
+
+            var selectFields = @"row_number() over (order by u_mtrldef.mtrlcode) as rowNum,u_mtrldef.scid,u_mtrldef.mtrlid,u_mtrldef.mtrlcode,u_mtrldef.mtrlname,u_mtrldef.mtrlorigin,u_mtrldef.mtrltype,u_mtrldef.mtrlengname,
+                                u_mtrldef.unit,u_mtrldef.mtrlmode,u_mtrldef.mtrlsectype,u_mtrldef.zxmtrlmode,u_mtrldef.status_config,u_mtrldef.woodcode_config,
+                                u_mtrldef.pcode_config,u_mtrldef.statustype,u_mtrldef.woodcodetype,u_mtrldef.pcodetype,ISNULL(u_erpmtrl_price.price,0) AS price,
+                                u_erpmtrl_price.create_date,u_erpmtrl_price.create_emp,u_erpmtrl_price.update_date,u_erpmtrl_price.update_emp";
+            var outputFileds = @"rowNum,scid,mtrlid,mtrlcode,mtrlname,mtrlorigin,mtrltype,mtrlengname,unit,mtrlmode,mtrlsectype,zxmtrlmode,status_config,woodcode_config,
+                                pcode_config,statustype,woodcodetype,pcodetype,price,create_date,create_emp,update_date,update_emp";
+            var selectStr = $@"SELECT {selectFields}
+                            FROM u_mtrldef
+                            LEFT JOIN u_erpmtrl_price ON u_mtrldef.mtrlid = u_erpmtrl_price.mtrlid";
+
+            var whereStr = string.Empty;
+            if (whereList != null && whereList.Count > 0)
+            {
+                whereStr = ListEx.GetWhereStr(whereList);
+            }
+
+            var orderStr = "mtrlcode";
+            totalcnt = 0;
+            DbSqlHelper.SelectJoin(cmd, selectStr, whereStr, param, orderStr, outputFileds, pageindex,
+               pagesize, mtrldefList, ref totalcnt);
+
+            return mtrldefList;
+        }
     }
 }

+ 98 - 47
JLHHJSvr/Helper/SoftBedHelper.cs

@@ -1,6 +1,7 @@
 using DirectService.Tools;
 using JLHHJSvr.BLL;
 using JLHHJSvr.Com.Model;
+using JLHHJSvr.Excutor;
 using JLHHJSvr.LJException;
 using JLHHJSvr.Tools;
 using LJLib.DAL.SQL;
@@ -42,36 +43,38 @@ namespace JLHHJSvr.Helper
 		/// <param name="mxlist"></param>
         public List<u_softbed_mx> GetSoftBedMxList(int billid,string fields = null)
         {
-            fields = fields ?? @"softbed_id,printid,pzid,mtrlid,mtrlname,mtrlcode,mtrlmode,unit,has_type,allow_edit,cutting_length,cutting_width,cutting_qty,
+            fields = fields ?? @"softbed_id,printid,formulaid,pzid,mtrlid,mtrlname,mtrlcode,mtrlmode,unit,has_type,allow_edit,cutting_length,cutting_width,cutting_qty,
                                 useqty,use_formula,use_formula_str,actual_useqty,loss_rate,price,price_formula,price_formula_str,cost_price,cost_amt,pzname,pzmxname";
             var mxlist = new List<u_softbed_mx>();
 
             var selectStr = @"SELECT u_softbed_mx.softbed_id
-								,u_softbed_mx.printid
-								,u_softbed_mx.pzid
-								,u_softbed_mx.mtrlid
-								,u_softbed_mx.mtrlname
-								,u_softbed_mx.mtrlcode
-								,u_softbed_mx.mtrlmode
-								,u_softbed_mx.unit
-								,u_softbed_mx.has_type
-								,u_softbed_mx.allow_edit
-								,u_softbed_mx.cutting_length
-								,u_softbed_mx.cutting_width
-								,u_softbed_mx.cutting_qty
-								,u_softbed_mx.useqty
-								,u_softbed_mx.use_formula
-								,u_softbed_mx.use_formula_str
-								,u_softbed_mx.actual_useqty
-								,u_softbed_mx.loss_rate
-								,u_softbed_mx.price
-								,u_softbed_mx.price_formula
-								,u_softbed_mx.price_formula_str
-								,u_softbed_mx.cost_price
-								,u_softbed_mx.cost_amt
-								,u_configure_code.name AS pzname
-								,u_configure_codemx.namemx AS pzmxname
-							FROM u_softbed_mx";
+									,u_softbed_mx.printid
+									,u_softbed_mx.formulaid
+									,u_softbed_mx.pzid
+									,u_softbed_mx.mtrlid
+									,u_softbed_mx.mtrlname
+									,u_softbed_mx.mtrlcode
+									,u_softbed_mx.mtrlmode
+									,u_softbed_mx.unit
+									,u_softbed_mx.has_type
+									,u_softbed_mx.allow_edit
+									,u_softbed_mx.cutting_length
+									,u_softbed_mx.cutting_width
+									,u_softbed_mx.cutting_qty
+									,u_softbed_mx.useqty
+									,u_softbed_mx.use_formula
+									,u_softbed_mx.use_formula_str
+									,u_softbed_mx.actual_useqty
+									,u_softbed_mx.loss_rate
+									,u_softbed_mx.price
+									,u_softbed_mx.price_formula
+									,u_softbed_mx.price_formula_str
+									,u_softbed_mx.cost_price
+									,u_softbed_mx.cost_amt
+									,u_configure_code.name AS pzname
+								FROM u_softbed_mx
+								LEFT JOIN u_configure_code ON u_softbed_mx.pzid = u_configure_code.pzid
+								";
 
             DbSqlHelper.SelectJoin(cmd, selectStr, "softbed_id = @billid", new Dictionary<string, object>() { { "@billid", billid } }, "printid", fields, 0, 0, mxlist);
 
@@ -305,6 +308,29 @@ namespace JLHHJSvr.Helper
 
 				if (cnt > 0) continue;
                 baseInfoHelper.SaveConfigureType(configure);
+            }
+
+			// 生成标准选配项值ifdft
+			if(softbed.codeMxList != null && softbed.codeMxList.Count > 0)
+			{
+				foreach (var codeMx in softbed.codeMxList)
+                {
+					if (codeMx.pzid == 0) continue;
+                    // 判断是否有标准
+                    cmd.CommandText = @"SELECT COUNT(*) FROM u_configure_codemx WHERE pzid = @pzid AND ifdft = 1";
+                    cmd.Parameters.Clear();
+                    cmd.Parameters.AddWithValue("@pzid", codeMx.pzid);
+					if(Convert.ToInt32(cmd.ExecuteScalar()) > 0)
+					{
+						cmd.CommandText = @"UPDATE u_configure_codemx SET ifdft = 0 WHERE pzid = @pzid AND ifdft = 1";
+                        cmd.Parameters.Clear();
+                        cmd.Parameters.AddWithValue("@pzid", codeMx.pzid);
+						cmd.ExecuteNonQuery();
+                    }
+
+                    codeMx.ifdft = 1;
+                    DbSqlHelper.Update(cmd, "u_configure_codemx", null, codeMx, "pzid,printid", "ifdft");
+                }
             }
         }
 		public List<u_configure_type> GetSoftBedConfigureList(u_softbed softbed)
@@ -537,31 +563,56 @@ namespace JLHHJSvr.Helper
 
 		private void InitReplaceMents(u_softbed softbed)
 		{
-            //AddKeyValue("不含税出厂价", "【车间成本】*(【工厂利润率】+【外销加点】)",0);
-            //AddKeyValue("部门不含税价", "【不含税出厂价】/【部门利润率】/( 1 - (【佣金点数】- 1))*【额外点数】", 0);
-            //AddKeyValue("税金", "【部门不含税价】* (【税率】-1)", 0);
-            //AddKeyValue("部门含税价", "【部门不含税价】*【税率】", 0);
-            //AddKeyValue("外币价", "【部门含税价】/【汇率】", 0);
-
-            //// 初始变量
-            //AddKeyValue("部门利润率", string.Empty,softbed.dept_profitrate);
-            //AddKeyValue("佣金点数", string.Empty, softbed.commission);
-            //AddKeyValue("额外点数", string.Empty, softbed.other_rate);
-            //AddKeyValue("额外费用", string.Empty, softbed.extras_cost);
-            ////AddKeyValue("FOB", softbed.fob);
-            //AddKeyValue("汇率", string.Empty, softbed.moneyrate);
-            //AddKeyValue("税率", string.Empty, softbed.taxrate);
+			// 公式变量
+			formula.AddFormulaItem("不含税出厂价", "【车间成本】*(【工厂利润率】+【外销加点】)");
+			formula.AddFormulaItem("部门不含税价", "【不含税出厂价】/【部门利润率】/( 1 - (【佣金点数】- 1))*【额外点数】+【FOB】");
+			formula.AddFormulaItem("部门含税价", "【部门不含税价】*【税率】");
+			formula.AddFormulaItem("税金", "【部门不含税价】* (【税率】-1)");
+			formula.AddFormulaItem("外币价", "【部门含税价】/【汇率】");
+
+			// 常量变量
+			formula.AddFormulaItem("部门利润率", softbed.dept_profitrate);
+			formula.AddFormulaItem("佣金点数", softbed.commission);
+			formula.AddFormulaItem("额外点数", softbed.other_rate);
+			formula.AddFormulaItem("额外费用", softbed.extras_cost);
+			formula.AddFormulaItem("FOB", 0);
+			formula.AddFormulaItem("汇率", softbed.moneyrate);
+			formula.AddFormulaItem("税率", softbed.taxrate);
         }
 
         private void InitMxReplaceMents(u_softbed softbed,u_softbed_mx mx)
         {
-            //AddKeyValue("下料长", string.Empty,mx.cutting_length);
-            //AddKeyValue("下料宽", string.Empty, mx.cutting_width);
-            //AddKeyValue("下料数量", string.Empty, mx.cutting_qty);
-            //AddKeyValue("用料量", string.Empty, mx.useqty);
-            //AddKeyValue("损耗率", string.Empty, mx.loss_rate);
-            //AddKeyValue("材料单价", string.Empty, mx.price);
-            //AddKeyValue("成本单价", string.Empty, mx.cost_price);
+            // 默认公式变量
+            formula.AddFormulaItem("实际用量", "【用料量】*【1 + 损耗率】");
+            formula.AddFormulaItem("成本金额", "【实际用量】 * 【成本单价】");
+
+            // 常量变量
+            formula.AddFormulaItem("下料长", mx.cutting_length);
+            formula.AddFormulaItem("下料宽", mx.cutting_width);
+            formula.AddFormulaItem("下料数量", mx.cutting_qty);
+            formula.AddFormulaItem("用料量", mx.useqty);
+            formula.AddFormulaItem("损耗率", mx.loss_rate);
+            formula.AddFormulaItem("材料单价", mx.price);
+
+			if(mx.formulaid > 0)
+			{
+				cmd.CommandText = @"SELECT u_softbed_formula.formulaid
+										,u_softbed_formula.formulaname
+										,u_softbed_formula.use_formula
+										,u_softbed_formula.price_formula
+									FROM u_softbed_formula
+									WHERE formulaid = @formulaid";
+				cmd.Parameters.Clear();
+				cmd.Parameters.AddWithValue("@formulaid", mx.formulaid);
+				using(var reader = cmd.ExecuteReader())
+				{
+					if(reader.Read())
+					{
+                        formula.AddFormulaItem("实际用量", Convert.ToString(reader["use_formula"]));
+                        formula.AddFormulaItem("成本单价", Convert.ToString(reader["price_formula"]));
+                    }
+				}
+			}
         }
 
         #region 通用公式

+ 23 - 6
JLHHJSvr/Tools/CalculateFormula.cs

@@ -1,13 +1,10 @@
-using CSUST.Data.Expr;
-using JLHHJSvr.Com.Model;
+using JLHHJSvr.Com.Model;
 using JLHHJSvr.LJException;
 using JLHHJSvr.LJFramework.Tools;
-using NPOI.SS.Formula.Functions;
 using System;
 using System.Collections.Generic;
 using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
+using System.Text.RegularExpressions;
 
 namespace JLHHJSvr.Tools
 {
@@ -46,7 +43,27 @@ namespace JLHHJSvr.Tools
 
         public void AddFormulaItem(string name, string formula)
         {
-            AddFormulaItem(new FormulaItem() { formula_name = name, formula = formula });
+            var formulaItem = new FormulaItem() { formula_name = name, formula = formula }
+            AddFormulaItem(formulaItem);
+
+            BuildFormulaGraph(formulaItem);
+        }
+
+        // 构建拓扑图
+        private void BuildFormulaGraph(FormulaItem formula)
+        {
+            formula.graph = new List<string>();
+            // 定义正则表达式模式,匹配包含【】的内容
+            string pattern = @"【(.*?)】";
+            // 创建正则表达式对象
+            Regex regex = new Regex(pattern);
+            // 使用正则表达式匹配输入字符串
+            MatchCollection matches = regex.Matches(formula.formula);
+
+            foreach (Match match in matches)
+            {
+                formula.graph.Add(match.Value);
+            }
         }
 
         private string ConvertToEnglishSymbols(string input)

+ 3 - 0
JLHWEB/src/api/interface/index.ts

@@ -1227,6 +1227,9 @@ export namespace Basicinfo {
   export interface ReqSoftBedFormula {
     formula: any;
   }
+  export interface ReqSaveErpMtrlPrice {
+    mtrldefList: any[];
+  }
 }
 
 export namespace SalePrice {

+ 6 - 1
JLHWEB/src/api/modules/basicinfo.ts

@@ -585,10 +585,15 @@ export const getSoftBedFormulaList = (params: any) => {
 export const SaveSoftBedFormula = (params: Basicinfo.ReqSoftBedFormula) => {
   return http.post(PORT1 + `/SaveSoftBedFormula`, params);
 };
-
 /**
  * @name 删除 床垫公式定义
  */
 export const DeleteSoftBedFormula = (params: Basicinfo.ReqDeleteBasicinfo) => {
   return http.post<Basicinfo.ResDeleteBasicinfo>(PORT1 + `/DeleteMattressFormula`, params);
 };
+/**
+ * @name 保存 ERP物料价格
+ */
+export const SaveErpMtrlPriceList = (params: Basicinfo.ReqSaveErpMtrlPrice) => {
+  return http.post(PORT1 + `/SaveErpMtrlPriceList`, params);
+};

+ 8 - 0
JLHWEB/src/api/modules/common.ts

@@ -121,3 +121,11 @@ export const CreatPrdPf = (params?: Mattress.ReqMultiMattressBcp) => {
 export const DelMtrlPf = (params?: Mattress.ReqMultiMattressBcp) => {
   return http.post(PORT1 + `/DelMtrlPf`, params);
 };
+/**
+ * @description 获取ERP物料资料价格定义
+ * @param params
+ * @returns
+ */
+export const GetERPMtrlPriceList = (params?: GenericApi.ReqGetERPMtrldefList) => {
+  return http.post<GenericApi.ResGetERPMtrldefList>(PORT1 + `/GetErpMtrlPriceList`, params);
+};

+ 1 - 1
JLHWEB/src/components/LjVxeTable/index.vue

@@ -1404,7 +1404,7 @@ const setEnumMap = async (col: ColumnProps) => {
     }
     return enumMap.value.set(col.field!, _enum);
   }
-  const data = await col.enum();
+  const { data } = await col.enum();
   console.log("enumMap data col.field,:>> ", col.field, data);
   enumMap.value.set(col.field!, data);
 };

+ 2 - 1
JLHWEB/src/languages/modules/zh-cn/menu.json

@@ -176,5 +176,6 @@
   "softbedQuoteEdit": "修改软床报价",
   "softbedQuoteAdd": "新建软床报价",
   "softbedQuoteCopy": "复制软床报价",
-  "softbedformula": "软床公式定义"
+  "softbedformula": "软床公式定义",
+  "erpmtrlprice": "ERP物料价格定义"
 }

JLHWEB/src/views/baseinfo/erpmtrldef/components/ImportPrice.vue → JLHWEB/src/views/baseinfo/erpmtrlprice/components/ImportPrice.vue


+ 2 - 3
JLHWEB/src/views/baseinfo/erpmtrldef/detail.vue

@@ -1,6 +1,6 @@
 <template>
   <LjDetail
-    name="mtrldefListDetail"
+    name="erpmtrlPriceListDetail"
     ref="LjDetailRef"
     v-bind="detailProps"
     v-model:order-status="orderStatus"
@@ -16,10 +16,9 @@
   </LjDetail>
 </template>
 
-<script setup lang="tsx" name="mtrldefListDetail">
+<script setup lang="tsx" name="erpmtrlPriceListDetail">
 import { ref, watch, reactive, inject, onMounted } from "vue";
 import { DwnameEnum } from "@/enums/dwnameEnum";
-import { getMtrlPriceList, getMtrlPriceNewList } from "@/api/modules/basicinfo";
 import LjDetail from "@/components/LjDetail/index.vue";
 import { DetailProp } from "@/components/LjDetail/interface";
 import { useI18n } from "vue-i18n";

+ 11 - 41
JLHWEB/src/views/baseinfo/erpmtrldef/hooks/index.tsx

@@ -2,7 +2,7 @@ import { ref, reactive, computed, toRefs } from "vue";
 import { Table } from "@/hooks/interface";
 import { ColumnProps } from "@/components/LjVxeTable/interface";
 import { ALLOW_EDIT_STATE } from "@/config/index";
-import { SaveMtrlDef, DeleteMtrlDef, BanMtrlDef, getMtrlType } from "@/api/modules/basicinfo";
+import { SaveErpMtrlPriceList } from "@/api/modules/basicinfo";
 import { getPriceList } from "@/api/modules/saleprice";
 import { ElMessage, ElMessageBox } from "element-plus";
 import { transformTreeData } from "@/utils/index";
@@ -107,23 +107,23 @@ export const useHooks = (t?: any) => {
     },
     {
       title: "建立时间",
-      field: "opdate",
-      table: "u_mtrldef"
+      field: "create_date",
+      table: "u_erpmtrl_price"
     },
     {
       title: "建立人",
-      field: "opemp",
-      table: "u_mtrldef"
+      field: "create_emp",
+      table: "u_erpmtrl_price"
     },
     {
       title: "修改时间",
-      field: "moddate",
-      table: "u_mtrldef"
+      field: "update_date",
+      table: "u_erpmtrl_price"
     },
     {
       title: "修改人",
-      field: "modemp",
-      table: "u_mtrldef"
+      field: "update_emp",
+      table: "u_erpmtrl_price"
     },
     {
       title: "状态",
@@ -146,7 +146,7 @@ export const useHooks = (t?: any) => {
         type: "warning"
       })
         .then(() => {
-          SaveMtrlDef(param).then(() => {
+          SaveErpMtrlPriceList(param).then(() => {
             ElMessage.success("保存成功!");
             state.VxeTableRef?.refresh();
             resolve({});
@@ -161,39 +161,9 @@ export const useHooks = (t?: any) => {
     });
   };
 
-  // 删除
-  const fDelete = () => {
-    const checkDate = state.VxeTableRef?.element.getCheckboxRecords();
-    if (checkDate.length === 0) {
-      ElMessage.error("请选择要删除的数据!");
-      return;
-    }
-    const delArr = checkDate.map((item: any) => {
-      return { mtrlid: parseInt(item.mtrlid), name: item.name };
-    });
-    ElMessageBox.confirm("是否确定要删除吗?", "询问", {
-      confirmButtonText: "是",
-      cancelButtonText: "否",
-      type: "warning"
-    })
-      .then(() => {
-        DeleteMtrlDef({ list: delArr }).then(() => {
-          ElMessage.success("删除成功!");
-          state.VxeTableRef?.refresh();
-        });
-      })
-      .catch(() => {
-        ElMessage({
-          type: "info",
-          message: "操作取消"
-        });
-      });
-  };
-
   return {
     ...toRefs(state),
     columns,
-    fSave,
-    fDelete
+    fSave
   };
 };

+ 13 - 25
JLHWEB/src/views/baseinfo/erpmtrldef/index.vue

@@ -27,13 +27,6 @@
           :auto-load-layout="false"
           pagination
         >
-          <!-- 表格 header 按钮 -->
-          <template #tableHeader>
-            <el-button-group>
-              <el-button>{{ $t("common.add") }}</el-button>
-              <el-button @click="fDelete">{{ $t("common.delText") }}</el-button>
-            </el-button-group>
-          </template>
         </LjVxeTable>
       </div>
     </LjFoldLayout>
@@ -59,7 +52,7 @@
   </LjDialog>
 </template>
 
-<script setup lang="ts" name="baseinfo_mtrldeflist">
+<script setup lang="ts" name="baseinfo_erpmtrlprice_list">
 import { ref, onMounted, provide } from "vue";
 import Detail from "./detail.vue";
 import { useHooks } from "./hooks/index";
@@ -68,10 +61,10 @@ import LjHeaderMenu from "@/components/LjHeaderMenu/index.vue";
 import { useI18n } from "vue-i18n";
 import { useAuthButtons } from "@/hooks/useAuthButtons";
 import { cloneDeep } from "lodash-es";
-import { GetERPMtrldefList, GetERPMtrlTypeList } from "@/api/modules/common";
-import { transformTreeData } from "@/utils/index";
+import { GetERPMtrlPriceList, GetERPMtrlTypeList } from "@/api/modules/common";
+import { transformTreeData, traverseNode } from "@/utils/index";
 
-const dwname = "web_mtrldeflist";
+const dwname = "web_erpmtrlprice_list";
 const mainData = ref({});
 const tableProps = {
   height: "auto",
@@ -86,7 +79,7 @@ const layoutSetting = {
 };
 
 const { t } = useI18n();
-const { VxeTableRef, LjDetailRef, VxeTableMxRef, columns, fDelete, fSave, initParams } = useHooks(t);
+const { VxeTableRef, LjDetailRef, VxeTableMxRef, columns, fSave, initParams } = useHooks(t);
 const { CheckPower, CheckOption, buttonNew, buttonDefault } = useAuthButtons(t);
 
 const orderStatus = ref("");
@@ -102,10 +95,9 @@ const orderDefaultAction = [
     label: t("common.saveText"),
     icon: "iconsave-01",
     clickFunc: item => {
-      const save_data = orderStatus.value == "new" ? LjDetailRef.value?.infoParam : LjDetailRef.value?._mainData;
+      const save_data = LjDetailRef.value?._mainData;
 
-      save_data.mxlist = VxeTableMxRef.value?.tableData;
-      fSave({ mtrl: save_data }).then(() => {
+      fSave({ mtrldefList: [save_data] }).then(() => {
         LjDrawerRef.value.hide();
       });
     }
@@ -118,10 +110,7 @@ const orderEditAction = [
     clickFunc: item => {
       const save_data = LjDetailRef.value?._mainData;
 
-      if (orderStatus.value == "new" || orderStatus.value == "copy") save_data.mtrlid = 0;
-      let { fullData } = VxeTableMxRef.value?.element.getTableData();
-      save_data.mxlist = fullData;
-      fSave({ mtrl: save_data }).then(() => {
+      fSave({ mtrldefList: [save_data] }).then(() => {
         LjDrawerRef.value.hide();
       });
     }
@@ -130,7 +119,10 @@ const orderEditAction = [
 
 const changeTreeFilter = (val: any) => {
   console.log("val :>> ", val);
-  initParams.value.mtrltypeid = val.mtrltypeid;
+  // initParams.value.mtrltypeid = val.mtrltypeid;
+  let mtrltypeids = [] as Number[];
+  traverseNode(val, (node: any) => node?.mtrltypeid >= 0 && mtrltypeids.push(parseInt(node.mtrltypeid)));
+  initParams.value.mtrltypeids = mtrltypeids.length > 0 ? mtrltypeids : undefined;
 };
 
 /*
@@ -150,7 +142,7 @@ const getData = (params: any) => {
 
   delete params.pageNum;
   delete params.pageSize;
-  return GetERPMtrldefList(newParams);
+  return GetERPMtrlPriceList(newParams);
 };
 
 const dataCallback = (data: any) => {
@@ -192,8 +184,4 @@ const tableEvents = {
   "cell-dblclick": handleDBlClickTable
   // "cell-click": handleClickTable
 };
-
-const toGetPriceList = () => {
-  VxeTableRef.value.refresh();
-};
 </script>

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

@@ -1786,6 +1786,7 @@ const save = async () => {
 
     if (orderStatus.value == "copy") {
       mattress.copy_id = mattress.mattressid;
+      mattress.parentid = 0;
     }
 
     // 主副规格
@@ -2377,6 +2378,7 @@ const funcAfterMound = async (data: any) => {
   console.log("onMounted detail sale start!!!! :>> ", orderStatus.value, orderStatus.value != "new", data);
   if (route.fullPath.indexOf("/copy?") > -1) {
     LjDetailRef.value._mainData.mattresscode = "";
+    LjDetailRef.value._mainData.parentid = 0;
   }
 
   if (!orderStatus.value) {

+ 8 - 1
JLHWEB/src/views/quote/softbedQuote/detail.vue

@@ -89,6 +89,7 @@
     @submit="onConfirmConfigureDialog"
     @cancel="isModalVisible = false"
   />
+  <ErpMtrlPriceDialog ref="ErpMtrlPriceDialogRef" v-bind="ErpMtrlPriceDialogProps" />
 </template>
 
 <script setup lang="tsx" name="softBedQuoteDetail">
@@ -102,6 +103,7 @@ import { useAuthButtons } from "@/hooks/useAuthButtons";
 import { useHooks } from "./hooks/index";
 import { useUserStore } from "@/stores/modules/user";
 import BedConfigModal from "./components/BedConfigModal.vue";
+import ErpMtrlPriceDialog from "@/views/system/selector/erpMtrlPrice/index.vue";
 
 const { t } = useI18n();
 const route = useRoute();
@@ -126,6 +128,8 @@ const {
   nightstandConfigOptions,
   bedframeConfigOptions,
   configValueOptionsMap,
+  ErpMtrlPriceDialogProps,
+  ErpMtrlPriceDialogRef,
   partsConfig,
   detail_getData,
   toAddMx,
@@ -134,7 +138,8 @@ const {
   onAudit,
   onCAudit,
   onDelete,
-  onConfirmConfigureDialog
+  onConfirmConfigureDialog,
+  GetSoftBedFormulaMapper
 } = useHooks(t);
 const { CheckPower, CheckOption, buttonNew, buttonDefault } = useAuthButtons(t);
 
@@ -419,6 +424,8 @@ const funcAfterMound = async (data: any) => {
   }
 
   detail_getData(initParams.value);
+
+  GetSoftBedFormulaMapper();
 };
 </script>
 <style lang="scss">

+ 93 - 36
JLHWEB/src/views/quote/softbedQuote/hooks/index.tsx

@@ -9,7 +9,7 @@ import { CommonDynamicSelect } from "@/api/modules/common";
 import SoftBedSelect from "@/views/system/selector/softbedTemplate/select.vue";
 import { cloneDeep } from "lodash-es";
 import { getCurrentRecords } from "@/utils/index";
-import MtrldefErpSelect from "@/views/system/selector/mtrldefErp/select.vue";
+import ErpMtrlPriceSelect from "@/views/system/selector/erpMtrlPrice/select.vue";
 interface defaultState {
   /**
    * @description 单据当前状态
@@ -88,8 +88,9 @@ interface defaultState {
   nightstandConfigOptions: any[];
   bedframeConfigOptions: any[];
   configValueOptionsMap: any;
-  MtrldefDialogRef: any;
-  MtrldefDialogProps: any;
+  ErpMtrlPriceDialogRef: any;
+  ErpMtrlPriceDialogProps: any;
+  softBedFormulaEnum: any[];
 }
 
 /**
@@ -125,8 +126,9 @@ export const useHooks = (t?: any) => {
     nightstandConfigOptions: [],
     bedframeConfigOptions: [],
     configValueOptionsMap: {},
-    MtrldefDialogRef: null,
-    MtrldefDialogProps: {}
+    ErpMtrlPriceDialogRef: null,
+    ErpMtrlPriceDialogProps: {},
+    softBedFormulaEnum: []
   });
   // 表格配置项
   const columns: ColumnProps<any>[] = [
@@ -153,13 +155,12 @@ export const useHooks = (t?: any) => {
     {
       field: "deptid",
       title: "部门",
-      enum: () =>
-        getDeptList({}).then(res => {
-          return res.datatable.map(t => {
-            return { ...t, label: t.deptname, value: t.deptid };
-          });
-        }),
-      // fieldNames: { label: "deptname", value: "deptid" },
+      enum: async () => {
+        const data = (await getDeptList({})).datatable.map(t => {
+          return { ...t, label: t.deptname, value: t.deptid };
+        });
+        return { data };
+      },
       search: {
         el: "select",
         key: "arg_deptid",
@@ -498,10 +499,9 @@ export const useHooks = (t?: any) => {
     {
       field: "moneyrate",
       title: "币种",
-      enum: () => {
-        return GetMoneyRateMapper().then(res => {
-          return res.datatable;
-        });
+      enum: async () => {
+        const data = (await GetMoneyRateMapper()).datatable;
+        return { data };
       },
       render: (scope: any) => {
         return (
@@ -772,7 +772,7 @@ export const useHooks = (t?: any) => {
     {
       field: "allow_edit",
       title: "业务修改",
-      width: 80,
+      width: 88,
       align: "center",
       datatype: "checkbox",
       editRender: {},
@@ -792,11 +792,7 @@ export const useHooks = (t?: any) => {
     {
       field: "pzname",
       title: "部件选配项",
-      visible: false
-    },
-    {
-      field: "pznamemx",
-      title: "部件选配项值",
+      width: 160,
       editRender: {},
       editColRender: (scope: any) => {
         const { row } = scope;
@@ -819,6 +815,37 @@ export const useHooks = (t?: any) => {
         );
       }
     },
+    {
+      field: "formulaname",
+      title: "公式名",
+      width: 160,
+      enum: async () => {
+        const data = (await GetSoftBedFormulaMapper()).datatable;
+        state.softBedFormulaEnum = data;
+        return { data };
+      },
+      editRender: {},
+      editColRender: (scope: any) => {
+        const { row } = scope;
+        const { _mainData } = state.LjDetailRef;
+        const _disabled = !row.allow_edit && !_mainData.is_template;
+
+        const options =
+          state.softBedFormulaEnum?.map(item => <el-option key={item.formulaid} label={item.formulaname} value={item} />) || [];
+
+        return (
+          <el-select
+            v-model={row.formulaname}
+            disabled={_disabled}
+            valueKey={"formulaid"}
+            clearable={true}
+            onChange={val => fModelChoseFormula(row, val)}
+          >
+            {options}
+          </el-select>
+        );
+      }
+    },
     {
       field: "mtrlcode",
       title: "物料编码"
@@ -826,7 +853,7 @@ export const useHooks = (t?: any) => {
     {
       field: "mtrlname",
       title: "物料名称规格",
-      width: 400,
+      width: 300,
       editRender: {},
       editColRender: (scope: any) => {
         const { $table, column, row, status } = scope;
@@ -837,7 +864,7 @@ export const useHooks = (t?: any) => {
         };
 
         return (
-          <MtrldefErpSelect
+          <ErpMtrlPriceSelect
             value={row.mtrlid}
             {...params}
             clearable
@@ -849,7 +876,7 @@ export const useHooks = (t?: any) => {
             {{
               label: () => `${row.mtrlname} ${row.mtrlmode}`
             }}
-          </MtrldefErpSelect>
+          </ErpMtrlPriceSelect>
         );
       }
     },
@@ -937,7 +964,7 @@ export const useHooks = (t?: any) => {
         const { _mainData } = state.LjDetailRef;
 
         let _disabled = !Boolean(row.allow_edit) && !Boolean(_mainData.is_template);
-        return <el-input v-model={scope.row.loss_rate} type="number" disabled={_disabled}></el-input>;
+        return <el-input v-model={scope.row.price} type="number" disabled={_disabled}></el-input>;
       }
     },
     {
@@ -1044,12 +1071,18 @@ export const useHooks = (t?: any) => {
 
     const _softbed = cloneDeep(_mainData);
     const _mxList = [];
+    const _codeMxList = [];
     _softbed.mxList = _mxList;
+    _softbed.codeMxList = _codeMxList;
 
     if (headboard_table && headboard_table.length > 0) _mxList.push(headboard_table);
     if (nightstand_table && nightstand_table.length > 0) _mxList.push(nightstand_table);
     if (bedframe_table && bedframe_table.length > 0) _mxList.push(bedframe_table);
 
+    if (_softbed.has_headboard) _codeMxList.push(...state.partsConfig.headboard);
+    if (_softbed.has_nightstand) _codeMxList.push(...state.partsConfig.nightstand);
+    if (_softbed.has_bedframe) _codeMxList.push(...state.partsConfig.bedframe);
+
     transformData(_softbed);
 
     const params: any = {
@@ -1155,10 +1188,27 @@ export const useHooks = (t?: any) => {
    * 显示公式
    */
   const onShowFormula = () => {};
-
+  /**
+   * 获取币种
+   * @returns
+   */
   const GetMoneyRateMapper = async () => {
     return CommonDynamicSelect({ dsname: "_Mapper_if_moneyrate", queryparams: {} });
   };
+  /**
+   * 获取软床公式
+   * @returns
+   */
+  const GetSoftBedFormulaMapper = async () => {
+    return await CommonDynamicSelect({ dsname: "_Mapper_softbed_formulaid", queryparams: {} });
+    // if (result) {
+    //   state.softBedFormulaEnum.push(
+    //     result.datatable.map(t => {
+    //       return { label: t.formulaname, value: t.formulaid, ...t };
+    //     })
+    //   );
+    // }
+  };
   /**
    * @description 获取部门汇率 和  折扣率
    */
@@ -1181,11 +1231,9 @@ export const useHooks = (t?: any) => {
       }
     }
   };
-
   const funcTaxrateChange = async (val: any, data) => {
     data.taxrate = val;
   };
-
   /**
    * @description 弹窗模块:客户选择
    * @param data 当前数据
@@ -1253,7 +1301,6 @@ export const useHooks = (t?: any) => {
       };
       const { row } = await $table.insertAt(records, -1);
       await $table.setCurrentRow(row);
-      await $table.setEditRow(row);
     }
   };
 
@@ -1287,15 +1334,12 @@ export const useHooks = (t?: any) => {
    */
   const fModelChoseMtrlErp = (data: any, params: any) => {
     return new Promise((resolve, reject) => {
-      // if (!ALLOW_EDIT_STATE.includes(status)) return;
-
       let _params = {
         keyword: ""
       };
-      state.MtrldefDialogProps = {
+      state.ErpMtrlPriceDialogProps = {
         onSubmit: (res: any) => {
           // submit
-          console.log("openCustDialog res", res);
           nextTick(() => {
             rModelSetMtrlErp(data, res.value[0]);
             resolve(1);
@@ -1306,7 +1350,7 @@ export const useHooks = (t?: any) => {
           console.log("openCustDialog error", error);
         }
       };
-      state.MtrldefDialogRef.show(_params);
+      state.ErpMtrlPriceDialogRef.show(_params);
     });
   };
 
@@ -1321,6 +1365,7 @@ export const useHooks = (t?: any) => {
     data.mtrlcode = item.mtrlcode;
     data.mtrlmode = item.mtrlmode;
     data.unit = item.unit;
+    data.price = item.price;
   };
 
   const rModelClearMtrlErp = (data: any) => {
@@ -1329,6 +1374,17 @@ export const useHooks = (t?: any) => {
     data.mtrlcode = "";
     data.mtrlmode = "";
     data.unit = "";
+    data.price = 0;
+  };
+
+  /**
+   * @description 选择公式返回
+   */
+  const fModelChoseFormula = (data: any, val: any) => {
+    data.formulaid = val.formulaid;
+    data.formulaname = val.formulaname;
+    data.use_formula = val.use_formula;
+    data.price_formula = val.price_formula;
   };
 
   return {
@@ -1344,6 +1400,7 @@ export const useHooks = (t?: any) => {
     onDelete,
     onCopyQuote,
     onShowFormula,
-    onConfirmConfigureDialog
+    onConfirmConfigureDialog,
+    GetSoftBedFormulaMapper
   };
 };

+ 185 - 0
JLHWEB/src/views/system/selector/erpMtrlPrice/hooks/index.ts

@@ -0,0 +1,185 @@
+import { ref, reactive, computed, toRefs, nextTick, inject } from "vue";
+import { Table } from "@/hooks/interface";
+import { ColumnProps } from "@/components/LjVxeTable/interface";
+import { ALLOW_EDIT_STATE, sys_arry_formulatype } from "@/config/index";
+import { CommonDynamicSelect } from "@/api/modules/common";
+import { GetComputeMattress, GetMattressImportDW2, GetMattressPackagMx } from "@/api/modules/quote";
+import { useUserStore } from "@/stores/modules/user";
+import MtrldefSelect from "@/views/system/selector/mtrldef/select.vue";
+import BednetSelect from "@/views/system/selector/bednet/select.vue";
+import { handleRowAccordingToProp } from "@/utils";
+import { ElButton, ElMessage, ElPopconfirm, ElMessageBox, ElNotification, ElTag } from "element-plus";
+import { Minus, Plus, InfoFilled } from "@element-plus/icons-vue";
+import { DwnameEnum } from "@/enums/dwnameEnum";
+import { isArray } from "@/utils/is";
+import { calculateFormula, formulaPartsFormula, floatAdd, floatMul, formatFixedNumber } from "@/utils/index";
+import { cloneDeep, defaultsDeep } from "lodash-es";
+import { TYPE, useToast, POSITION } from "vue-toastification";
+import ToastFormula from "@/components/ToastWidget/Formula/index.vue";
+import ToastHistoryPrice from "@/components/ToastWidget/HistoryPrice/index.vue";
+import { useRouter } from "vue-router";
+import { useGlobalStore } from "@/stores/modules/global";
+
+interface defaultState {
+  vxeTableRef: any;
+}
+
+export const useHooks = () => {
+  const state = reactive<defaultState>({
+    vxeTableRef: null
+  });
+
+  const mtrloriginOptions = [
+    {
+      label: "全部来源",
+      value: -1
+    },
+    {
+      label: "自制",
+      value: 0
+    },
+    {
+      label: "客户来源",
+      value: 6
+    },
+    {
+      label: "采购",
+      value: 2
+    },
+    {
+      label: "外协",
+      value: 3
+    }
+  ];
+  const mtrlprpOptions = [
+    {
+      label: "全部",
+      value: -1
+    },
+    {
+      label: "成品",
+      value: 0
+    },
+    {
+      label: "半成品",
+      value: 1
+    },
+    {
+      label: "原料",
+      value: 2
+    },
+    {
+      label: "其他",
+      value: 8
+    }
+  ];
+  const mtrldefStatus = [
+    {
+      label: "待审核",
+      value: 0
+    },
+    {
+      label: "待终审",
+      value: 1
+    },
+    {
+      label: "已审核",
+      value: 2
+    }
+  ];
+  // 表格配置项
+  const columns: ColumnProps<any>[] = [
+    {
+      title: "序",
+      field: "rowNum",
+      width: 50
+    },
+    {
+      title: "物料编码",
+      field: "mtrlcode",
+      table: "u_mtrldef",
+      type: "html"
+      // search: {
+      //   el: "input"
+      // }
+    },
+    {
+      title: "物料名称",
+      field: "mtrlname",
+      table: "u_mtrldef",
+      type: "html"
+      // search: {
+      //   el: "input"
+      // }
+    },
+    {
+      title: "英文名称",
+      field: "mtrlengname",
+      table: "u_mtrldef"
+    },
+    {
+      title: "物料类别",
+      field: "mtrltype",
+      table: "u_mtrldef"
+    },
+    {
+      title: "自定义1",
+      field: "mtrlsectype",
+      table: "u_mtrldef"
+    },
+    {
+      title: "物料规格",
+      field: "mtrlmode",
+      table: "u_mtrldef"
+    },
+    {
+      title: "自定义2",
+      field: "zxmtrlmode",
+      table: "u_mtrldef"
+    },
+    {
+      title: "单位",
+      field: "unit",
+      table: "u_mtrldef"
+    },
+    {
+      title: "建立时间",
+      field: "opdate",
+      table: "u_mtrldef"
+    },
+    {
+      title: "建立人",
+      field: "opemp",
+      table: "u_mtrldef"
+    },
+    {
+      title: "修改时间",
+      field: "moddate",
+      table: "u_mtrldef"
+    },
+    {
+      title: "修改人",
+      field: "modemp",
+      table: "u_mtrldef"
+    },
+    {
+      title: "状态",
+      field: "isuse",
+      table: "u_mtrldef",
+      datatype: "checkbox",
+      width: 80
+    },
+    {
+      title: "自定义3",
+      field: "usermtrlmode",
+      table: "u_mtrldef"
+    }
+  ];
+
+  return {
+    ...toRefs(state),
+    columns,
+    mtrloriginOptions,
+    mtrlprpOptions
+  };
+};

+ 305 - 0
JLHWEB/src/views/system/selector/erpMtrlPrice/index.vue

@@ -0,0 +1,305 @@
+<template>
+  <LjSelector
+    ref="LjSelectorRef"
+    :title="`${t('business.selector.mtrlprice.title')}`"
+    v-model:value="selectList"
+    v-bind="$attrs"
+    :item-key="TABLE_KEY"
+  >
+    <template #aside>
+      <el-collapse-item name="mtrl">
+        <template #title>
+          {{ $t("common.table.searchBtn") }}
+          <el-icon class="ml-4"><Search /></el-icon>
+        </template>
+        <el-form v-model="initParams" class="pl-4">
+          <el-form-item :label="$t('business.selector.saletask.keyword')">
+            <template #label>
+              <div class="flx-center">
+                <span>
+                  {{ $t("business.selector.saletask.keyword") }}
+                </span>
+                <el-tooltip :content="$t('business.selector.saletask.keywordTips')">
+                  <el-icon><QuestionFilled /></el-icon>
+                </el-tooltip>
+              </div>
+            </template>
+            <el-input
+              v-model.trim="initParams.keyword"
+              :title="$t('business.selector.saletask.keyword')"
+              :placeholder="$t('business.selector.saletask.keywordTips')"
+              clearable
+              @input="disshow(initParams.keyword)"
+            ></el-input>
+          </el-form-item>
+          <el-form-item :label="$t('table.u_mtrldef.mtrlorigin')">
+            <el-select
+              v-model="initParams.mtrlorigin"
+              clearable
+              :placeholder="$t('common.all') + $t('table.u_mtrldef.mtrlorigin')"
+              :title="$t('table.u_mtrldef.mtrlorigin')"
+              @change="getData"
+            >
+              <el-option v-for="item in mtrloriginOptions" :key="item.value" :label="item.label" :value="item.value" />
+            </el-select>
+          </el-form-item>
+          <el-form-item :label="$t('table.u_mtrldef.mtrlprp')">
+            <el-select
+              v-model="initParams.mtrlprp"
+              clearable
+              :placeholder="$t('common.all') + $t('table.u_mtrldef.mtrlprp')"
+              :title="$t('table.u_mtrldef.mtrlprp')"
+              @change="getData"
+            >
+              <el-option v-for="item in mtrlprpOptions" :key="item.value" :label="item.label" :value="item.value" />
+            </el-select>
+          </el-form-item>
+          <el-form-item :label="$t('table.u_mtrldef.mtrltype')">
+            <CascaderFilter
+              v-model:value="initParams.mtrltypeid"
+              label="text"
+              :request-api="getMtrlType"
+              filterable
+              @change="changeTreeFilter"
+            />
+          </el-form-item>
+        </el-form>
+      </el-collapse-item>
+    </template>
+    <template #default>
+      <div class="main-box flx-col">
+        <LjVxeTable
+          ref="vxeTableRef"
+          table-cls=""
+          :columns="columns"
+          :request-api="getData"
+          :data-callback="dataCallback"
+          :init-param="initParams"
+          :dwname="dwname"
+          pagination
+          :table-events="tableEvents"
+          :table-props="tableProps"
+          :tool-button="[]"
+          :auto-load-layout="false"
+          collapse-buttons
+        >
+        </LjVxeTable>
+      </div>
+    </template>
+  </LjSelector>
+</template>
+
+<script setup lang="tsx" name="SelectorErpMtrlPrice">
+import { ref, reactive, inject, nextTick, watch } from "vue";
+import { useDesign } from "@/hooks/useDesign";
+import { GetERPMtrlPriceList, GetERPMtrlTypeList } from "@/api/modules/common";
+import LjVxeTable from "@/components/LjVxeTable/index.vue";
+import { Search, ColdDrink, QuestionFilled, SwitchButton, ArrowRight } from "@element-plus/icons-vue";
+import { ElMessage, ElButton } from "element-plus";
+import { useI18n } from "vue-i18n";
+import dayjs from "dayjs";
+import { useHooks } from "./hooks/index";
+import CascaderFilter from "@/components/TreeFilter/cascader.vue";
+import LjSelector from "@/components/LjSelector/index.vue";
+import { transformTreeData, traverseNode } from "@/utils/index";
+import { throttle } from "lodash-es";
+
+const { prefixCls } = useDesign("saletask-selector");
+const { t } = useI18n();
+const dwname = "web_erpmtrl_price_sel";
+const drawerVisible = ref(false);
+const selectList = ref([]);
+const TABLE_KEY = "mtrlid";
+
+/**
+ * @description 鼠标双击表格
+ */
+const handleDBlClickTable = async ({ row, column, rowIndex }: any) => {
+  const $table = vxeTableRef.value.element;
+  if ($table) {
+    await $table.clearCurrentRow();
+    selectList.value = [row];
+    $table.setRadioRow(row);
+
+    LjSelectorRef.value.funcSubmit();
+  }
+};
+/**
+ * @description 鼠标单击表格
+ */
+const handleClickTable = ({ row, column, rowIndex }: any) => {
+  nextTick(async () => {
+    const $table = vxeTableRef.value.element;
+    if ($table) {
+      await $table.clearCurrentRow();
+      selectList.value = [row];
+      $table.setRadioRow(row);
+    }
+  });
+};
+
+// 返回绑定的事件
+const tableEvents = {
+  "cell-dblclick": handleDBlClickTable,
+  "cell-click": handleClickTable
+};
+
+const dataCallback = (data: any) => {
+  console.log("data :>> ", data);
+  return {
+    list: data.mtrldefList,
+    // tableinfo: data.tableinfo,
+    total: data.totalcnt,
+    pageNum: data.pageindex,
+    pageSize: data.pagesize
+  };
+};
+
+const rowClsNameFunc = (data: any) => {
+  const { row, rowIndex, $rowIndex } = data;
+  return "";
+};
+/**
+ * @description vxetable props
+ */
+const tableProps = {
+  height: "auto",
+  columnConfig: { resizable: true, useKey: true },
+  checkboxConfig: {
+    checkField: "checked",
+    trigger: "row",
+    highlight: true,
+    range: true
+  },
+  rowClassName: rowClsNameFunc
+};
+
+// 全表搜索
+let tableData = ref<any[]>([]);
+const list = ref<any>([]);
+const filterName = ref("");
+const searchField = ref("");
+const searchEvent = () => {
+  const filterVal = String(searchField.value).trim().toLowerCase();
+  if (filterVal) {
+    const filterRE = new RegExp(filterVal, "gi");
+    const searchProps = ["mtrlcode", "mtrlname"];
+    const rest = tableData.value.filter(item => searchProps.some(key => String(item[key]).toLowerCase().indexOf(filterVal) > -1));
+    list.value = rest.map(row => {
+      const item = Object.assign({}, row);
+      searchProps.forEach(key => {
+        item[key] = String(item[key]).replace(filterRE, match => `<span class="keyword-lighten">${match}</span>`);
+      });
+      return item;
+    });
+  } else {
+    list.value = tableData.value;
+  }
+};
+// 节流
+const disshow = throttle((val: any) => {
+  initParams.value.keyword = val;
+}, 500);
+
+const getData = (params: any) => {
+  let newParams: any = params;
+  params.pageNum && (newParams.pageindex = params.pageNum);
+  params.pageSize && (newParams.pagesize = params.pageSize);
+
+  delete params.pageNum;
+  delete params.pageSize;
+  return GetERPMtrlPriceList(newParams);
+};
+
+const show = (params: any) => {
+  selectList.value = [];
+  for (const key in params) {
+    initParams.value[key] = params[key];
+  }
+
+  LjSelectorRef.value.show(initParams.value, "mtrl");
+};
+
+const LjSelectorRef = ref();
+const initParams = ref<any>({});
+
+const { vxeTableRef, columns, mtrloriginOptions, mtrlprpOptions } = useHooks();
+
+const getMtrlType = async () => {
+  const data = await GetERPMtrlTypeList();
+  let arr = data.reList;
+  arr.unshift({
+    value: -1,
+    text: "全部",
+    data: {
+      mtrltypeid: -1,
+      mtrltype: "全部",
+      inuse: 1,
+      parentid: 0
+    }
+  });
+  return transformTreeData(data.reList);
+};
+
+const changeTreeFilter = (val: any) => {
+  console.log("val :>> ", val);
+  // initParams.value.mtrltypeid = val.mtrltypeid;
+  let mtrltypeids = [] as Number[];
+  traverseNode(val, (node: any) => node?.mtrltypeid >= 0 && mtrltypeids.push(parseInt(node.mtrltypeid)));
+  initParams.value.mtrltypeids = mtrltypeids.length > 0 ? mtrltypeids : undefined;
+};
+
+// 确认按钮
+const emit = defineEmits(["confirm"]);
+const confirm = () => {
+  let selectRecords = [];
+  const $table = vxeTableRef.value?.element;
+  if ($table) {
+    selectRecords = $table.getCheckboxRecords();
+  }
+  if (!selectRecords.length) {
+    ElMessage.warning(t("business.error.saletaskmx.confirmTips"));
+    return;
+  }
+
+  emit("confirm", selectRecords);
+  drawerVisible.value = false;
+};
+
+defineExpose({
+  show
+});
+</script>
+
+<style lang="scss">
+$prefix-cls: "#{$namespace}-saletask-selector";
+
+.#{$prefix-cls} {
+  .el-dialog__body {
+    flex: 1;
+  }
+  .footer-tips {
+    .tips-item {
+      span {
+        margin-right: $space-a1;
+        display: inline-block;
+        width: $space-a2;
+        height: $space-a2;
+        border-radius: $br-xs;
+        border: 2px solid $color-gray-1;
+        box-shadow: $shadow-1-down;
+
+        &.purple {
+          background-color: var(--lj-color-golden-purple-6);
+        }
+        &.danger {
+          background-color: var(--lj-color-dust-red-2);
+        }
+      }
+      & + .tips-item {
+        margin-left: $space-b4;
+      }
+    }
+  }
+}
+</style>

+ 116 - 0
JLHWEB/src/views/system/selector/erpMtrlPrice/input.vue

@@ -0,0 +1,116 @@
+<template>
+  <el-input v-model="inputValue" @input="disshow" clearable @clear="handleClear" @keydown="handleKeydown">
+    <template #suffix>
+      <el-icon class="el-input__icon" v-if="loading">
+        <Loading />
+      </el-icon>
+      <el-icon v-else-if="successState && !successNoMatchState" class="vxecol-green"><CircleCheckFilled /></el-icon>
+      <el-icon v-else-if="successState && successNoMatchState" class="vxecol-gold"><WarningFilled /></el-icon>
+      <el-icon v-else-if="successState" class="vxecol-green"><CircleCheckFilled /></el-icon>
+      <el-icon v-else-if="errorState" class="vxecol-danger"><CircleCloseFilled /></el-icon>
+      <el-icon v-else class="vxecol-gray" @click="openModal"><Search /></el-icon>
+    </template>
+  </el-input>
+</template>
+
+<script lang="ts" setup name="SelectorMtrldefSelect">
+import { ref, computed, nextTick } from "vue";
+import { GetERPMtrlPriceList } from "@/api/modules/common";
+import { ElInput, ElIcon } from "element-plus";
+import { Search, Loading, CircleCheckFilled, CircleCloseFilled, WarningFilled } from "@element-plus/icons-vue";
+import { useUserStore } from "@/stores/modules/user";
+import { throttle } from "lodash-es";
+
+interface ProTableProps {
+  value?: any;
+  valueKey?: string;
+  searchKey?: any;
+  row?: any;
+  setMtrlerp?: any;
+}
+
+// 默认值
+const props = withDefaults(defineProps<ProTableProps>(), {
+  // valueKey: "mtrlid"
+});
+
+const inputValue = computed({
+  get: () => props.value,
+  set: val => emit("update:value", val)
+});
+
+const { userInfo } = useUserStore();
+const emit = defineEmits(["select", "update:value", "openModal", "clear"]);
+const loading = ref(false);
+const successState = ref(false);
+const errorState = ref(false);
+const successNoMatchState = ref(false);
+const mtrldefList = ref<any[]>([]);
+
+const disshow = throttle(async (queryString: any) => {
+  console.log("disshow props :>> ", props, queryString);
+  loading.value = true;
+  errorState.value = false;
+  successState.value = false;
+  successNoMatchState.value = false;
+
+  let newParams: any = {};
+  newParams.pageindex = 1;
+  newParams.pagesize = 5;
+  // newParams.mtrlid = props.mtrlid;
+  if (props.searchKey) {
+    newParams[props.searchKey] = queryString;
+  } else {
+    newParams.keyword = queryString;
+  }
+  console.log("newParams :>> ", newParams);
+  let result = await GetERPMtrlPriceList(newParams);
+
+  mtrldefList.value = result.mtrldefList;
+  console.log("result.datatable :>> ", result.mtrldefList);
+
+  loading.value = false;
+
+  if (result.mtrldefList.length > 1) {
+    let matchItem = result.mtrldefList.find(o => o[props.searchKey] == queryString.trim());
+    if (matchItem) {
+      props.setMtrlerp(props.row, matchItem, props.searchKey);
+    } else {
+      successNoMatchState.value = true;
+    }
+    successState.value = true;
+    setTimeout(() => {
+      successState.value = false;
+    }, 1200);
+  } else if (result.mtrldefList.length == 1) {
+    // emit("select", result.mtrldefList[0]);
+    props.setMtrlerp(props.row, result.mtrldefList[0], props.searchKey);
+    successState.value = true;
+    setTimeout(() => {
+      successState.value = false;
+    }, 1200);
+  } else {
+    props.setMtrlerp(props.row, {}, props.searchKey);
+    // emit("select", {});
+    errorState.value = true;
+    setTimeout(() => {
+      errorState.value = false;
+    }, 1200);
+  }
+}, 1000);
+
+const openModal = (e: any) => {
+  emit("openModal", e);
+};
+
+const handleClear = () => {
+  emit("clear");
+};
+const handleKeydown = e => {
+  console.log("handleKeydown e :>> ", e);
+  // emit("clear");
+  if (e.key == "Enter" && mtrldefList.value.length > 1) {
+    emit("openModal", e);
+  }
+};
+</script>

+ 176 - 0
JLHWEB/src/views/system/selector/erpMtrlPrice/select.vue

@@ -0,0 +1,176 @@
+<template>
+  <LjSelectorSelect
+    ref="selectStationRef"
+    v-model:value="props.value"
+    :value-key="valueKey"
+    :loading="loading"
+    v-bind="$attrs"
+    :remote-method="remoteMethod"
+    popper-class="lj-select-mtrldef__popper"
+    @select="handleSelect"
+    @open-modal="openModal"
+  >
+    <template #label v-if="$slots?.label">
+      <slot name="label"></slot>
+    </template>
+    <template #header>
+      <div class="table-header lj-select__table">
+        <div class="table-tr">
+          <div class="table-td pr-4" style="width: 120px; max-width: 120px; min-width: 120px">
+            {{ $t("table.u_mtrldef.mtrlcode") }}
+          </div>
+          <div class="table-td pr-4" style="width: 120px; max-width: 120px; min-width: 120px">
+            {{ $t("table.u_mtrldef.mtrlname") }}
+          </div>
+          <div class="table-td pr-4" style="width: 60px; max-width: 60px; min-width: 60px">
+            {{ $t("table.u_mtrldef.mtrltype") }}
+          </div>
+          <div class="table-td pr-4" style="width: 60px; max-width: 60px; min-width: 60px">
+            {{ $t("table.u_mtrldef.mtrlmode") }}
+          </div>
+          <div class="table-td pr-4" style="width: 120px; max-width: 120px; min-width: 120px">
+            {{ $t("table.u_mtrldef.mtrlsectype") }}
+          </div>
+          <div class="table-td pr-4" style="width: 120px; max-width: 120px; min-width: 120px">
+            {{ $t("table.u_mtrldef.zxmtrlmode") }}
+          </div>
+        </div>
+      </div>
+    </template>
+    <el-option
+      v-for="item in options"
+      :key="item.mtrlid"
+      :label="item.mtrlname"
+      :value="item"
+      class="lj-select__table pl-10 pr-10"
+      :class="{
+        'w-full': item.label
+      }"
+    >
+      <template v-if="item.label">
+        <div class="table-tr w-full text-center">{{ item.label }}</div>
+      </template>
+      <template v-else>
+        <div class="table-tr">
+          <div
+            style="width: 120px; max-width: 120px; min-width: 120px"
+            class="table-td pr-4 text-ellipsis-two break-word"
+            :title="item.mtrlcode"
+          >
+            {{ item.mtrlcode }}
+          </div>
+          <div
+            style="width: 120px; max-width: 120px; min-width: 120px"
+            class="table-td pr-4 text-ellipsis-two break-word"
+            :title="item.mtrlname"
+          >
+            {{ item.mtrlname }}
+          </div>
+          <div
+            style="width: 60px; max-width: 60px; min-width: 60px"
+            :title="item.mtrltype"
+            class="table-td pr-4 text-ellipsis-two break-word"
+          >
+            {{ item.mtrltype }}
+          </div>
+          <div
+            style="width: 60px; max-width: 60px; min-width: 60px"
+            :title="item.mtrlmode"
+            class="table-td pr-4 text-ellipsis-two break-word"
+          >
+            {{ item.mtrlmode }}
+          </div>
+          <div
+            style="width: 120px; max-width: 120px; min-width: 120px"
+            class="table-td pr-4 text-ellipsis-two break-word"
+            :title="item.mtrlsectype"
+          >
+            {{ item.mtrlsectype }}
+          </div>
+          <div
+            style="width: 120px; max-width: 120px; min-width: 120px"
+            class="table-td pr-4 text-ellipsis-two break-word"
+            :title="item.zxmtrlmode"
+          >
+            {{ item.zxmtrlmode }}
+          </div>
+        </div>
+      </template>
+    </el-option>
+  </LjSelectorSelect>
+</template>
+
+<script lang="ts" setup name="SelectorMtrldefSelect">
+import { ref, computed, nextTick } from "vue";
+import { GetERPMtrlPriceList } from "@/api/modules/common";
+import { DwnameEnum } from "@/enums/dwnameEnum";
+import LjSelectorSelect from "@/components/LjSelector/select.vue";
+import { useUserStore } from "@/stores/modules/user";
+import { isFilterPrice } from "@/utils/index";
+
+interface ProTableProps {
+  value: any;
+  valueKey?: string;
+  [key: string]: any;
+  searchKey?: any;
+}
+
+// 默认值
+const props = withDefaults(defineProps<ProTableProps>(), {
+  valueKey: "mtrlid"
+});
+const { userInfo } = useUserStore();
+const emit = defineEmits(["select", "update:value", "openModal", "update:pricelistid"]);
+const loading = ref(false);
+
+const options = ref<any[]>([]);
+// const isuse = ref("有效");
+const selectStationRef = ref();
+
+const remoteMethod = async (queryString: string) => {
+  console.log("remoteMethod props :>> ", props, queryString);
+  loading.value = true;
+
+  let newParams: any = {};
+  newParams.pageindex = 1;
+  newParams.pagesize = 5;
+  // newParams.mtrlid = props.mtrlid;
+  if (props.searchKey) {
+    newParams[props.searchKey] = queryString;
+  } else {
+    newParams.keyword = queryString;
+  }
+  console.log("newParams :>> ", newParams);
+  let result = await GetERPMtrlPriceList(newParams);
+
+  console.log("result.datatable :>> ", result.mtrldefList);
+  if (result.mtrldefList.length) {
+    options.value = result.mtrldefList;
+  } else {
+    options.value = [
+      {
+        label: "暂无数据",
+        disabled: true
+      }
+    ];
+  }
+
+  loading.value = false;
+};
+
+const handleSelect = (item: any) => {
+  console.log("handleSelect 手动选择 :>> ", item);
+  emit("select", item);
+};
+
+const openModal = (e: any) => {
+  emit("openModal", e);
+};
+</script>
+
+<style lang="scss">
+.lj-select-mtrldef__popper {
+  max-width: 600px !important;
+  min-width: 600px !important;
+}
+</style>