Преглед изворни кода

材料库清单功能提交

徐滕 пре 1 дан
родитељ
комит
f08bffd4b0

+ 99 - 15
src/main/java/com/jeeplus/modules/projectmaterialstorage/entity/ProjectMaterialStorage.java

@@ -23,7 +23,9 @@ public class ProjectMaterialStorage extends DataEntity<ProjectMaterialStorage> {
     private String brand; //品牌
     private String specifications; //规格型号
     private String unit; //单位
+    private Double projectPriceExcludingTax; //不含税工程价(元)
     private Double projectPriceIncludingTax; //含税工程价(元)
+    private Double marketPriceExcludingTax; //不含税市场价(元)
     private Double marketPriceIncludingTax; //含税市场价(元)
     private Double taxRate; //税率
     private String explain; //产品说明
@@ -47,8 +49,19 @@ public class ProjectMaterialStorage extends DataEntity<ProjectMaterialStorage> {
 
     private String distinctStr ; //用于去重用的临时参数
     private String errorMessage ; //错误原因
+    private String monomerProjectDescription ; //单体工程描述
+    private String priceSource ; //价格来源。 1:甲供、2:乙供、3:概算价
+    private Double count;   //数量
+
+    private Integer quotedPriceYear ; //报价时间-年份
+    private Integer quotedPriceMonth ; //报价时间-月份
 
 
+    private String beginProjectPriceExcludingTax; //开始工程价(元,不含税)
+    private String endProjectPriceExcludingTax; //结束工程价(元,不含税)
+    private String beginMarketPriceExcludingTax; //开始市场价(元,不含税)
+    private String endMarketPriceExcludingTax; //结束市场价(元,不含税)
+
     private String beginProjectPriceIncludingTax; //开始含税工程价(元)
     private String endProjectPriceIncludingTax; //结束含税工程价(元)
     private String beginMarketPriceIncludingTax; //开始含税市场价(元)
@@ -161,7 +174,7 @@ public class ProjectMaterialStorage extends DataEntity<ProjectMaterialStorage> {
         this.projectMaterialStorageList = projectMaterialStorageList;
     }
 
-    @ExcelField(title="品牌", align=2, sort=2)
+    @ExcelField(title="品牌", align=2, sort=10)
     public String getBrand() {
         return brand;
     }
@@ -170,7 +183,7 @@ public class ProjectMaterialStorage extends DataEntity<ProjectMaterialStorage> {
         this.brand = brand;
     }
 
-    @ExcelField(title="规格型号", align=2, sort=3)
+    @ExcelField(title="规格型号", align=2, sort=2)
     public String getSpecifications() {
         return specifications;
     }
@@ -179,7 +192,6 @@ public class ProjectMaterialStorage extends DataEntity<ProjectMaterialStorage> {
         this.specifications = specifications;
     }
 
-    @ExcelField(title="含税工程价(元)", align=2, sort=4)
     public Double getProjectPriceIncludingTax() {
         return projectPriceIncludingTax;
     }
@@ -188,7 +200,24 @@ public class ProjectMaterialStorage extends DataEntity<ProjectMaterialStorage> {
         this.projectPriceIncludingTax = projectPriceIncludingTax;
     }
 
-    @ExcelField(title="含税市场价(元)", align=2, sort=5)
+    @ExcelField(title="工程价(元,不含税)", align=2, sort=5)
+    public Double getProjectPriceExcludingTax() {
+        return projectPriceExcludingTax;
+    }
+
+    public void setProjectPriceExcludingTax(Double projectPriceExcludingTax) {
+        this.projectPriceExcludingTax = projectPriceExcludingTax;
+    }
+
+    @ExcelField(title="市场价(元,不含税)", align=2, sort=6)
+    public Double getMarketPriceExcludingTax() {
+        return marketPriceExcludingTax;
+    }
+
+    public void setMarketPriceExcludingTax(Double marketPriceExcludingTax) {
+        this.marketPriceExcludingTax = marketPriceExcludingTax;
+    }
+
     public Double getMarketPriceIncludingTax() {
         return marketPriceIncludingTax;
     }
@@ -197,7 +226,7 @@ public class ProjectMaterialStorage extends DataEntity<ProjectMaterialStorage> {
         this.marketPriceIncludingTax = marketPriceIncludingTax;
     }
 
-    @ExcelField(title="税率", align=2, sort=6)
+    @ExcelField(title="税率", align=2, sort=7)
     public Double getTaxRate() {
         return taxRate;
     }
@@ -206,7 +235,7 @@ public class ProjectMaterialStorage extends DataEntity<ProjectMaterialStorage> {
         this.taxRate = taxRate;
     }
 
-    @ExcelField(title="材料单位", align=2, sort=7)
+    @ExcelField(title="单位", align=2, sort=3)
     public String getUnit() {
         return unit;
     }
@@ -215,7 +244,7 @@ public class ProjectMaterialStorage extends DataEntity<ProjectMaterialStorage> {
         this.unit = unit;
     }
 
-    @ExcelField(title="产品说明", align=2, sort=8)
+    @ExcelField(title="产品说明", align=2, sort=11)
     public String getExplain() {
         return explain;
     }
@@ -224,7 +253,7 @@ public class ProjectMaterialStorage extends DataEntity<ProjectMaterialStorage> {
         this.explain = explain;
     }
 
-    @ExcelField(title="供应商", align=2, sort=9)
+    @ExcelField(title="供应商", align=2, sort=12)
     public String getSupplier() {
         return supplier;
     }
@@ -234,7 +263,7 @@ public class ProjectMaterialStorage extends DataEntity<ProjectMaterialStorage> {
     }
 
     @Override
-    @ExcelField(title="备注", align=2, sort=10)
+    @ExcelField(title="备注", align=2, sort=13)
     public String getRemarks() {
         return remarks;
     }
@@ -245,12 +274,10 @@ public class ProjectMaterialStorage extends DataEntity<ProjectMaterialStorage> {
     }
 
     @JsonFormat(pattern = "yyyy-MM-dd")
-    @ExcelField(title="报价时间", align=2, sort=11)
+    @ExcelField(title="报价时间", align=2, sort=14)
     public Date getQuotedPriceDate() {
         return quotedPriceDate;
     }
-    private String monomerProjectDescription ; //单体工程描述
-    private String priceSource ; //价格来源。 1:甲供、2:乙供、3:概算价
 
     public void setQuotedPriceDate(Date quotedPriceDate) {
         this.quotedPriceDate = quotedPriceDate;
@@ -336,7 +363,7 @@ public class ProjectMaterialStorage extends DataEntity<ProjectMaterialStorage> {
         this.distinctStr = distinctStr;
     }
 
-    @ExcelField(title="提醒", align=2, sort=14)
+    @ExcelField(title="提醒", align=2, sort=15, type = 1)
     public String getErrorMessage() {
         return errorMessage;
     }
@@ -345,7 +372,7 @@ public class ProjectMaterialStorage extends DataEntity<ProjectMaterialStorage> {
         this.errorMessage = errorMessage;
     }
 
-    @ExcelField(title="单体项目描述", align=2, sort=12)
+    @ExcelField(title="单体项目描述", align=2, sort=9)
     public String getMonomerProjectDescription() {
         return monomerProjectDescription;
     }
@@ -354,7 +381,7 @@ public class ProjectMaterialStorage extends DataEntity<ProjectMaterialStorage> {
         this.monomerProjectDescription = monomerProjectDescription;
     }
 
-    @ExcelField(title="价格来源", align=2, sort=13)
+    @ExcelField(title="价格来源", align=2, sort=8)
     public String getPriceSource() {
         return priceSource;
     }
@@ -362,4 +389,61 @@ public class ProjectMaterialStorage extends DataEntity<ProjectMaterialStorage> {
     public void setPriceSource(String priceSource) {
         this.priceSource = priceSource;
     }
+
+    @ExcelField(title="数量", align=2, sort=4, type = 2)
+    public Double getCount() {
+        return count;
+    }
+
+    public void setCount(Double count) {
+        this.count = count;
+    }
+
+    public Integer getQuotedPriceYear() {
+        return quotedPriceYear;
+    }
+
+    public void setQuotedPriceYear(Integer quotedPriceYear) {
+        this.quotedPriceYear = quotedPriceYear;
+    }
+
+    public Integer getQuotedPriceMonth() {
+        return quotedPriceMonth;
+    }
+
+    public void setQuotedPriceMonth(Integer quotedPriceMonth) {
+        this.quotedPriceMonth = quotedPriceMonth;
+    }
+
+    public String getBeginProjectPriceExcludingTax() {
+        return beginProjectPriceExcludingTax;
+    }
+
+    public void setBeginProjectPriceExcludingTax(String beginProjectPriceExcludingTax) {
+        this.beginProjectPriceExcludingTax = beginProjectPriceExcludingTax;
+    }
+
+    public String getEndProjectPriceExcludingTax() {
+        return endProjectPriceExcludingTax;
+    }
+
+    public void setEndProjectPriceExcludingTax(String endProjectPriceExcludingTax) {
+        this.endProjectPriceExcludingTax = endProjectPriceExcludingTax;
+    }
+
+    public String getBeginMarketPriceExcludingTax() {
+        return beginMarketPriceExcludingTax;
+    }
+
+    public void setBeginMarketPriceExcludingTax(String beginMarketPriceExcludingTax) {
+        this.beginMarketPriceExcludingTax = beginMarketPriceExcludingTax;
+    }
+
+    public String getEndMarketPriceExcludingTax() {
+        return endMarketPriceExcludingTax;
+    }
+
+    public void setEndMarketPriceExcludingTax(String endMarketPriceExcludingTax) {
+        this.endMarketPriceExcludingTax = endMarketPriceExcludingTax;
+    }
 }

+ 45 - 0
src/main/java/com/jeeplus/modules/projectmaterialstorage/entity/ProjectMaterialStorageImport.java

@@ -19,7 +19,9 @@ public class ProjectMaterialStorageImport extends DataEntity<ProjectMaterialStor
     private String brand; //品牌
     private String specifications; //规格型号
     private String unit; //单位
+    private Double projectPriceExcludingTax; //不含税工程价(元)
     private Double projectPriceIncludingTax; //含税工程价(元)
+    private Double marketPriceExcludingTax; //不含税市场价(元)
     private Double marketPriceIncludingTax; //含税市场价(元)
     private Double taxRate; //税率
     private String explain; //产品说明
@@ -33,8 +35,11 @@ public class ProjectMaterialStorageImport extends DataEntity<ProjectMaterialStor
 
     private String monomerProjectDescription ; //单体工程描述
     private String priceSource ; //价格来源。 1:甲供、2:乙供、3:概算价
+    private Double count;   //数量
     private String distinctStr ; //用于去重用的临时参数
     private String errorMessage ; //错误原因
+    private Integer quotedPriceYear ; //报价时间-年份
+    private Integer quotedPriceMonth ; //报价时间-月份
 
     public String getProjectNumber() {
         return projectNumber;
@@ -181,4 +186,44 @@ public class ProjectMaterialStorageImport extends DataEntity<ProjectMaterialStor
     public void setPriceSource(String priceSource) {
         this.priceSource = priceSource;
     }
+
+    public Double getCount() {
+        return count;
+    }
+
+    public void setCount(Double count) {
+        this.count = count;
+    }
+
+    public Integer getQuotedPriceYear() {
+        return quotedPriceYear;
+    }
+
+    public void setQuotedPriceYear(Integer quotedPriceYear) {
+        this.quotedPriceYear = quotedPriceYear;
+    }
+
+    public Integer getQuotedPriceMonth() {
+        return quotedPriceMonth;
+    }
+
+    public void setQuotedPriceMonth(Integer quotedPriceMonth) {
+        this.quotedPriceMonth = quotedPriceMonth;
+    }
+
+    public Double getProjectPriceExcludingTax() {
+        return projectPriceExcludingTax;
+    }
+
+    public void setProjectPriceExcludingTax(Double projectPriceExcludingTax) {
+        this.projectPriceExcludingTax = projectPriceExcludingTax;
+    }
+
+    public Double getMarketPriceExcludingTax() {
+        return marketPriceExcludingTax;
+    }
+
+    public void setMarketPriceExcludingTax(Double marketPriceExcludingTax) {
+        this.marketPriceExcludingTax = marketPriceExcludingTax;
+    }
 }

+ 8 - 5
src/main/java/com/jeeplus/modules/projectmaterialstorage/service/ProjectMaterialStorageService.java

@@ -37,7 +37,9 @@ public class ProjectMaterialStorageService extends CrudService<ProjectMaterialSt
     private RuralProjectRecordsDao ruralProjectRecordsDao;
 
     public ProjectMaterialStorage get(String id){
-        return super.get(id);
+        ProjectMaterialStorage projectMaterialStorage = super.get(id);
+        processHtmlEntities(projectMaterialStorage);
+        return projectMaterialStorage;
     }
 
 
@@ -155,8 +157,8 @@ public class ProjectMaterialStorageService extends CrudService<ProjectMaterialSt
             // 组合历史数据的distinctStr(材料名称+规格+含税价格)
             String name = (info.getMaterialName() != null) ? info.getMaterialName() : "";
             String spec = (info.getSpecifications() != null) ? info.getSpecifications() : "";
-            String priceStr = (info.getProjectPriceIncludingTax() != null)
-                    ? info.getProjectPriceIncludingTax().toString() : "";
+            String priceStr = (info.getProjectPriceExcludingTax() != null)
+                    ? info.getProjectPriceExcludingTax().toString() : "";
 
             info.setDistinctStr(name + "," + spec + "," + priceStr);
         }
@@ -277,7 +279,7 @@ public class ProjectMaterialStorageService extends CrudService<ProjectMaterialSt
         try{
             info.setId(IdGen.uuid());
             info.preInsert();
-            Integer i = projectMaterialStorageDao.saveUniqueInfo(info);
+            projectMaterialStorageDao.saveUniqueInfo(info);
             map.put("success",true);
             map.put("message","材料保存成功");
         }catch (Exception e){
@@ -327,6 +329,7 @@ public class ProjectMaterialStorageService extends CrudService<ProjectMaterialSt
         for (ProjectMaterialStorage projectMaterialStorage1:projectMaterialStorageList){
             User user=UserUtils.get(projectMaterialStorage1.getCreateBy().getId());
             projectMaterialStorage1.setCreateBy(user);
+            processHtmlEntities(projectMaterialStorage1);
         }
         page.setList(projectMaterialStorageList);
         return page;
@@ -491,7 +494,7 @@ public class ProjectMaterialStorageService extends CrudService<ProjectMaterialSt
     /**
      * 处理实体类中的HTML实体编码(如m&sup3; -> m³)
      */
-    private void processHtmlEntities(ProjectMaterialStorage material) {
+    public void processHtmlEntities(ProjectMaterialStorage material) {
         if (material == null) {
             return;
         }

+ 67 - 4
src/main/java/com/jeeplus/modules/projectmaterialstorage/web/ProjectMaterialStorageController.java

@@ -71,7 +71,19 @@ public class ProjectMaterialStorageController extends BaseController {
     @RequiresPermissions("project:projectMaterialStorage:list")
     @RequestMapping(value = {"list",""})
     public String list(ProjectMaterialStorage projectMaterialStorage, HttpServletRequest request, HttpServletResponse response, Model model){
-
+        //进行查询之后进行任何操作,返回还是查询之后的数据页面
+        if (StringUtils.isNotBlank(projectMaterialStorage.getToflag())){
+            if (projectMaterialStorage.getToflag().equals("1")){
+                request.getSession().removeAttribute("projectMaterialStorage");
+                ProjectMaterialStorage search=projectMaterialStorage;
+                request.getSession().setAttribute("projectMaterialStorage",search);
+            }
+        }else{
+            if (request.getSession().getAttribute("projectMaterialStorage")!=null){
+                projectMaterialStorage= (ProjectMaterialStorage) request.getSession().getAttribute("projectMaterialStorage");
+                model.addAttribute("projectMaterialStorage", projectMaterialStorage);
+            }
+        }
         Page<ProjectMaterialStorage> page =  projectMaterialStorageService.findPage(new Page<ProjectMaterialStorage>(request,response),projectMaterialStorage);
         model.addAttribute("page",page);
         model.addAttribute("projectMaterialStorage",projectMaterialStorage);
@@ -216,9 +228,9 @@ public class ProjectMaterialStorageController extends BaseController {
             // 处理可能的null值,转为空字符串
             String name = (info.getMaterialName() != null) ? info.getMaterialName() : "";
             String spec = (info.getSpecifications() != null) ? info.getSpecifications() : "";
-            String projectPriceIncludingTaxStr = (info.getProjectPriceIncludingTax() != null) ? info.getProjectPriceIncludingTax().toString() : "";
+            String projectPriceExcludingTaxStr = (info.getProjectPriceExcludingTax() != null) ? info.getProjectPriceExcludingTax().toString() : "";
             // 以逗号分隔组合
-            String resultStr = name + "," + spec + "," + projectPriceIncludingTaxStr;
+            String resultStr = name + "," + spec + "," + projectPriceExcludingTaxStr;
             info.setDistinctStr(resultStr);
         }
 
@@ -231,6 +243,41 @@ public class ProjectMaterialStorageController extends BaseController {
             info.setErrorMessage("重复数据");
         }
 
+        //对有效数据进行处理
+        for (ProjectMaterialStorageImport info : uniqueList) {
+            //如果税率不为空
+            if(null != info.getTaxRate()){
+                //计算含税市场价(元)
+                if(null != info.getMarketPriceExcludingTax()){
+                    double taxRate = info.getTaxRate();
+                    double priceExcludingTax = info.getMarketPriceExcludingTax();
+                    double tempPrice = priceExcludingTax * (1 + taxRate / 100.0);
+                    double roundedPrice = Math.round(tempPrice * 100) / 100.0; // 四舍五入保留两位
+                    info.setMarketPriceIncludingTax(roundedPrice);
+                }
+                //计算含税工程价(元)
+                if(null != info.getProjectPriceExcludingTax()){
+                    info.setProjectPriceIncludingTax(info.getProjectPriceExcludingTax() * (1 + info.getTaxRate() / 100.0));
+                    double taxRate = info.getTaxRate();
+                    double projectPriceExcludingTax = info.getProjectPriceExcludingTax();
+                    double tempPrice = projectPriceExcludingTax * (1 + taxRate / 100.0);
+                    double roundedPrice = Math.round(tempPrice * 100) / 100.0; // 四舍五入保留两位
+                    info.setProjectPriceExcludingTax(roundedPrice);
+                }
+            }
+            //给报价时间添加日期(当月第一天)
+            if(null != info.getQuotedPriceDate()){
+                Calendar calendar = Calendar.getInstance();
+                // 提取年(返回四位年份,如 2024)
+                int year = calendar.get (Calendar.YEAR);
+                // 提取月(返回 1-12,注意 Calendar.MONTH 默认 0-11,需 + 1)
+                int month = calendar.get (Calendar.MONTH) + 1;
+                info.setQuotedPriceYear(year);
+                info.setQuotedPriceMonth(month);
+            }
+
+        }
+
         Iterator<ProjectMaterialStorageImport> uniqueIterator = uniqueList.iterator();
         while (uniqueIterator.hasNext()){
             ProjectMaterialStorageImport info = uniqueIterator.next();
@@ -454,7 +501,6 @@ public class ProjectMaterialStorageController extends BaseController {
         try {
             ImportExcel ei = new ImportExcel(file, 1, 0);
             List<ProjectMaterialStorage> list = ei.getDataList(ProjectMaterialStorage.class);
-
             /*List<ProjectMaterialStorage> listAll = new ArrayList<>();
             //创建材料名称或单位为空的数据
             List<ProjectMaterialStorage> materialNameOrUnitIsNullList = new ArrayList<>();
@@ -507,6 +553,23 @@ public class ProjectMaterialStorageController extends BaseController {
         return "modules/projectMaterialStorage/projectMaterialStorageTwoForm";
     }
 
+    /**
+     * 查看,增加,编辑客户管理表单页面
+     */
+    @RequestMapping(value = "view")
+    public String view(ProjectMaterialStorage projectMaterialStorage, Model model,String isAdd) {
+        ProjectMaterialStorage projectMaterialStorage2 = new ProjectMaterialStorage();
+        if(StringUtils.isNotBlank(projectMaterialStorage.getId())){
+           projectMaterialStorage2  = projectMaterialStorageService.get(projectMaterialStorage.getId());
+        }
+        if(StringUtils.isNotBlank(projectMaterialStorage.getProjectNumber())){
+
+            model.addAttribute("projectMaterialStorage", projectMaterialStorage2);
+        }
+
+        return "modules/projectMaterialStorage/projectMaterialStorageView";
+    }
+
 
     /**
      * 选择材料关联项目

+ 95 - 25
src/main/resources/mappings/modules/projectMaterialStorage/ProjectMaterialStorageDao.xml

@@ -14,7 +14,9 @@
 		a.project_number as "projectNumber",
 		a.brand as "brand",
 		a.specifications as "specifications",
+		a.project_price_excluding_tax as "projectPriceExcludingTax",
 		a.project_price_including_tax as "projectPriceIncludingTax",
+		a.market_price_excluding_tax as "marketPriceExcludingTax",
 		a.market_price_including_tax as "marketPriceIncludingTax",
 		a.tax_rate as "taxRate",
 		a.unit as "unit",
@@ -23,6 +25,10 @@
 		a.remarks as "remarks",
 		a.quoted_price_date as "quotedPriceDate",
 		a.project_number AS "projectNumber",
+		a.price_source AS "priceSource",
+		a.monomer_project_description AS "monomerProjectDescription",
+		a.quoted_price_year AS "quotedPriceYear",
+		a.quoted_price_month AS "quotedPriceMonth",
 		r.project_name as "projectName"
 	</sql>
 
@@ -98,6 +104,12 @@
 			<if test="supplier != null and supplier != ''">
 				AND a.supplier like concat(concat('%',#{supplier}),'%')
 			</if>
+			<if test="monomerProjectDescription != null and monomerProjectDescription != ''">
+				AND a.monomer_project_description like concat(concat('%',#{monomerProjectDescription}),'%')
+			</if>
+			<if test="priceSource != null and priceSource != ''">
+				AND a.price_source = #{priceSource}
+			</if>
 
 			<if test="beginProjectPriceIncludingTax !=null and beginProjectPriceIncludingTax != ''">
 				AND a.project_price_including_tax >= #{beginProjectPriceIncludingTax}
@@ -113,6 +125,20 @@
 				AND a.market_price_including_tax &lt;= #{endMarketPriceIncludingTax}
 			</if>
 
+			<if test="beginProjectPriceExcludingTax !=null and beginProjectPriceExcludingTax != ''">
+				AND a.project_price_excluding_tax >= #{beginProjectPriceExcludingTax}
+			</if>
+			<if test="endProjectPriceExcludingTax !=null and endProjectPriceExcludingTax != ''">
+				AND a.project_price_excluding_tax &lt;= #{endProjectPriceExcludingTax}
+			</if>
+
+			<if test="beginMarketPriceExcludingTax !=null and beginMarketPriceExcludingTax != ''">
+				AND a.market_price_excluding_tax >= #{beginMarketPriceExcludingTax}
+			</if>
+			<if test="endMarketPriceExcludingTax !=null and endMarketPriceExcludingTax != ''">
+				AND a.market_price_excluding_tax &lt;= #{endMarketPriceExcludingTax}
+			</if>
+
 			<if test="beginTaxRate !=null and beginTaxRate != ''">
 				AND a.tax_rate >= #{beginTaxRate}
 			</if>
@@ -176,34 +202,46 @@
 			project_number,
 			brand,
 			specifications,
+			project_price_excluding_tax,
 			project_price_including_tax,
+			market_price_excluding_tax,
 			market_price_including_tax,
 			tax_rate,
 			unit,
 			`explain`,
 			supplier,
 			remarks,
-			quoted_price_date
+			quoted_price_date,
+			price_source,
+			monomer_project_description,
+			quoted_price_year,
+			quoted_price_month
 		) VALUES (
-			#{id},
-			#{createBy.id},
-			#{createDate},
-			#{updateBy.id},
-			#{updateDate},
-			#{delFlag},
-			#{materialName},
-			#{price},
-			#{projectNumber},
-			#{brand},
-			#{specifications},
-			#{projectPriceIncludingTax},
-			#{marketPriceIncludingTax},
-			#{taxRate},
-			#{unit},
-			#{explain},
-			#{supplier},
-			#{remarks},
-			#{quotedPriceDate}
+		 #{id},
+		 #{createBy.id},
+		 #{createDate},
+		 #{updateBy.id},
+		 #{updateDate},
+		 #{delFlag},
+		 #{materialName},
+		 #{price},
+		 #{projectNumber},
+		 #{brand},
+		 #{specifications},
+		 #{projectPriceExcludingTax},
+		 #{projectPriceIncludingTax},
+		 #{marketPriceExcludingTax},
+		 #{marketPriceIncludingTax},
+		 #{taxRate},
+		 #{unit},
+		 #{explain},
+		 #{supplier},
+		 #{remarks},
+		 #{quotedPriceDate},
+		 #{priceSource},
+		 #{monomerProjectDescription},
+		 #{quotedPriceYear},
+		 #{quotedPriceMonth}
 		)
 	</insert>
 
@@ -220,14 +258,20 @@
 			project_number,
 			brand,
 			specifications,
+			project_price_excluding_tax,
 			project_price_including_tax,
+			market_price_excluding_tax,
 			market_price_including_tax,
 			tax_rate,
 			unit,
 			`explain`,
 			supplier,
 			remarks,
-			quoted_price_date
+			quoted_price_date,
+			price_source,
+			monomer_project_description,
+			quoted_price_year,
+			quoted_price_month
 		) VALUES (
 			#{id},
 			#{createBy.id},
@@ -240,14 +284,20 @@
 			#{projectNumber},
 			#{brand},
 			#{specifications},
+			#{projectPriceExcludingTax},
 			#{projectPriceIncludingTax},
+			#{marketPriceExcludingTax},
 			#{marketPriceIncludingTax},
 			#{taxRate},
 			#{unit},
 			#{explain},
 			#{supplier},
 			#{remarks},
-			#{quotedPriceDate}
+			#{quotedPriceDate},
+			#{priceSource},
+			#{monomerProjectDescription},
+			#{quotedPriceYear},
+			#{quotedPriceMonth}
 		)
 	</insert>
 
@@ -261,14 +311,20 @@
 			del_flag = #{delFlag},
 			brand = #{brand},
 			specifications = #{specifications},
+			project_price_excluding_tax = #{projectPriceExcludingTax},
 			project_price_including_tax = #{projectPriceIncludingTax},
+			market_price_excluding_tax = #{marketPriceExcludingTax},
 			market_price_including_tax = #{marketPriceIncludingTax},
 			tax_rate = #{taxRate},
 			unit = #{unit},
 			`explain` = #{explain},
 			supplier = #{supplier},
 			remarks = #{remarks},
-			quoted_price_date = #{quotedPriceDate}
+			quoted_price_date = #{quotedPriceDate},
+			price_source = #{priceSource},
+			monomer_project_description = #{monomerProjectDescription},
+			quoted_price_year = #{quotedPriceYear},
+			quoted_price_month = #{quotedPriceMonth}
 		WHERE id = #{id}
 	</update>
 
@@ -347,14 +403,21 @@
 		project_number,
 		brand,
 		specifications,
+		project_price_excluding_tax,
 		project_price_including_tax,
+		market_price_excluding_tax,
 		market_price_including_tax,
 		tax_rate,
 		unit,
 		`explain`,
 		supplier,
 		remarks,
-		quoted_price_date)
+		quoted_price_date,
+		price_source,
+		monomer_project_description,
+		quoted_price_year,
+		quoted_price_month
+		)
 		values
 		<foreach collection="projectMaterialStorageImportList" item="data" separator=",">
 		(#{data.id},
@@ -368,14 +431,21 @@
 		#{data.projectNumber},
 		#{data.brand},
 		#{data.specifications},
+		#{data.projectPriceExcludingTax},
 		#{data.projectPriceIncludingTax},
+		#{data.marketPriceExcludingTax},
 		#{data.marketPriceIncludingTax},
 		#{data.taxRate},
 		#{data.unit},
 		#{data.explain},
 		#{data.supplier},
 		#{data.remarks},
-		#{data.quotedPriceDate})
+		#{data.quotedPriceDate},
+		#{data.priceSource},
+		#{data.monomerProjectDescription},
+		#{data.quotedPriceYear},
+		#{data.quotedPriceMonth}
+		)
 		</foreach>
 	</insert>
 

BIN
src/main/webapp/dot/材料库处理表模板.xlsx


+ 75 - 26
src/main/webapp/webpage/modules/projectMaterialStorage/projectMaterialStorageAddForm.jsp

@@ -114,27 +114,64 @@
 		}
 
 		function bornTemplete1(list, idx, tpl, row, idx1){
-			$(list).append(Mustache.render(tpl, {
-				idx: idx, delBtn: true, row: row,
-				order:idx1 + 1
-			}));
-			$(list+idx).find("select").each(function(){
-				$(this).val($(this).attr("data-value"));
+			// 渲染模板时确保row数据正确传递
+			var rendered = Mustache.render(tpl, {
+				idx: idx,
+				delBtn: true,
+				row: row || {},  // 确保row不为空
+				order: idx1 + 1
 			});
-			$(list+idx).find("input[type='checkbox'], input[type='radio']").each(function(){
-				var ss = $(this).attr("data-value").split(',');
-				for (var i=0; i<ss.length; i++){
-					if($(this).val() == ss[i]){
-						$(this).attr("checked","checked");
-					}
+			$(list).append(rendered);
+
+			// 获取当前行的选择器
+			var rowSelector = list + idx;
+			var $row = $(rowSelector);
+
+			// 修复下拉框选中逻辑:直接使用row中的数据
+			$row.find("select").each(function(){
+				var $select = $(this);
+				// 获取下拉框name属性(如"projectMaterialStorageList[0].priceSource")
+				var name = $select.attr("name");
+				// 提取字段名(如"priceSource")
+				var field = name.split('.')[1];
+
+				// 从row中获取对应字段的值并设置
+				if (row && row[field] !== undefined) {
+					$select.val(row[field]);
+				}
+
+				// 关键:如果使用Layui表单,需要重新渲染下拉框
+				if (window.layui && layui.form) {
+					layui.form.render('select', $select.closest('form')[0].id);
+				}
+			});
+
+			// 复选框/单选框处理(优化)
+			$row.find("input[type='checkbox'], input[type='radio']").each(function(){
+				var $input = $(this);
+				var name = $input.attr("name");
+				var field = name.split('.')[1];
+
+				if (row && row[field] !== undefined) {
+					var values = Array.isArray(row[field]) ? row[field] : [row[field].toString()];
+					values.forEach(function(val){
+						if ($input.val() == val) {
+							$input.prop("checked", true);  // 用prop替代attr更可靠
+						}
+					});
+				}
+
+				// 重新渲染Layui表单组件
+				if (window.layui && layui.form) {
+					layui.form.render('checkbox', $input.closest('form')[0].id);
+					layui.form.render('radio', $input.closest('form')[0].id);
 				}
 			});
 
+			// 日期选择器初始化
 			laydate.render({
-				elem : (list+idx+"_quotedPriceDate"),
-				event: 'focus',
-				type : 'date'
-				, trigger: 'click',
+				elem: rowSelector + "_quotedPriceDate",
+				type: 'date',
 				trigger: 'click'
 			});
 		}
@@ -232,7 +269,7 @@
 <body>
 <div class="single-form">
 	<div class="container">
-		<form:form id="inputForm" modelAttribute="projectMaterialStorage" action="${ctx}/project/projectMaterialStorage/storageSave" method="post" class="layui-form">
+		<form:form id="inputForm" modelAttribute="projectMaterialStorage" action="${ctx}/project/projectMaterialStorage/storageSave" method="post" class="form-horizontal">
 			<form:hidden path="id"/>
 			<form:hidden path="projectId"/>
 			<div class="form-group layui-row first">
@@ -274,12 +311,14 @@
 						<thead>
 						<tr>
 							<th width="200px"><font color="red">*</font>材料名称</th>
-							<th width="150px">品牌</th>
 							<th width="200px">规格型号</th>
-							<th width="100px">含税工程价(元)</th>
-							<th width="100px">含税市场价(元)</th>
-							<th width="100px">税率</th>
 							<th width="100px"><font color="red">*</font>单位</th>
+							<th width="160px">工程价(元,不含税)</th>
+							<th width="160px">市场价(元,不含税)</th>
+							<th width="100px">税率(%)</th>
+							<th width="100px">价格来源</th>
+							<th width="160px">单体项目描述</th>
+							<th width="150px">品牌</th>
 							<th width="200px">产品说明</th>
 							<th width="100px">供应商</th>
 							<th width="200px">备注</th>
@@ -301,22 +340,32 @@
 							<input id="projectMaterialStorageList{{idx}}_materialName" name = "projectMaterialStorageList[{{idx}}].materialName"  type="text" value="{{row.materialName}}"  class="form-control required"/>
                         </td>
                         <td>
-							<input id="projectMaterialStorageList{{idx}}_brand" name = "projectMaterialStorageList[{{idx}}].brand"  type="text" value="{{row.brand}}"  class="form-control"/>
+							<input id="projectMaterialStorageList{{idx}}_specifications" name = "projectMaterialStorageList[{{idx}}].specifications"  type="text" value="{{row.specifications}}"  class="form-control"/>
                         </td>
                         <td>
-							<input id="projectMaterialStorageList{{idx}}_specifications" name = "projectMaterialStorageList[{{idx}}].specifications"  type="text" value="{{row.specifications}}"  class="form-control"/>
+							<input id="projectMaterialStorageList{{idx}}_unit" name = "projectMaterialStorageList[{{idx}}].unit"  type="text" value="{{row.unit}}"  class="form-control required"/>
                         </td>
                         <td>
-							<input id="projectMaterialStorageList{{idx}}_projectPriceIncludingTax" name = "projectMaterialStorageList[{{idx}}].projectPriceIncludingTax"  type="text" value="{{row.projectPriceIncludingTax}}" onkeyup="num(this)"  class="form-control"/>
+							<input id="projectMaterialStorageList{{idx}}_projectPriceExcludingTax" name = "projectMaterialStorageList[{{idx}}].projectPriceExcludingTax"  type="text" value="{{row.projectPriceExcludingTax}}" onkeyup="num(this)"  class="form-control"/>
                         </td>
                         <td>
-							<input id="projectMaterialStorageList{{idx}}_marketPriceIncludingTax" name = "projectMaterialStorageList[{{idx}}].marketPriceIncludingTax"  type="text" value="{{row.marketPriceIncludingTax}}" onkeyup="num(this)"  class="form-control"/>
+							<input id="projectMaterialStorageList{{idx}}_marketPriceExcludingTax" name = "projectMaterialStorageList[{{idx}}].marketPriceExcludingTax"  type="text" value="{{row.marketPriceExcludingTax}}" onkeyup="num(this)"  class="form-control"/>
                         </td>
                         <td>
 							<input id="projectMaterialStorageList{{idx}}_taxRate" name = "projectMaterialStorageList[{{idx}}].taxRate"  type="text" value="{{row.taxRate}}" onkeyup="num(this)"  class="form-control"/>
                         </td>
                         <td>
-							<input id="projectMaterialStorageList{{idx}}_unit" name = "projectMaterialStorageList[{{idx}}].unit"  type="text" value="{{row.unit}}"  class="form-control required"/>
+							<select name="projectMaterialStorageList[{{idx}}].priceSource" id="projectMaterialStorageList{{idx}}_priceSource" class="form-control">
+								<c:forEach items="${fns:getMainDictList('priceSource')}" var="var">
+									<option value="${var.value}" <c:if test="${row.priceSource eq var.value}">selected</c:if>>${var.label}</option>
+								</c:forEach>
+							</select>
+                        </td>
+                        <td>
+							<input id="projectMaterialStorageList{{idx}}_monomerProjectDescription" name = "projectMaterialStorageList[{{idx}}].monomerProjectDescription"  type="text" value="{{row.monomerProjectDescription}}" class="form-control"/>
+                        </td>
+                        <td>
+							<input id="projectMaterialStorageList{{idx}}_brand" name = "projectMaterialStorageList[{{idx}}].brand"  type="text" value="{{row.brand}}"  class="form-control"/>
                         </td>
                         <td>
 							<input id="projectMaterialStorageList{{idx}}_explain" name = "projectMaterialStorageList[{{idx}}].explain"  type="text" value="{{row.explain}}"  class="form-control"/>

+ 54 - 14
src/main/webapp/webpage/modules/projectMaterialStorage/projectMaterialStorageForm.jsp

@@ -169,8 +169,36 @@
 	<form:form id="inputForm" modelAttribute="projectRecords" action="${ctx}/project/projectMaterialStorage/save?projectNumber=${projectRecords.id}&&pageId=1"  method="post" class="form-horizontal">
 <%--		<form:hidden path="id" name = "projectNumber"/>--%>
 		<input type="hidden" id="storageFlag" name="storageFlag" value="${projectRecords.storageFlag}">
+		<div class="form-group layui-row first">
+			<div class="form-group-label"><h2>项目信息</h2></div>
+			<div class="layui-item layui-col-sm6">
+				<label class="layui-form-label"><span class="require-item invoicetype">*</span>项目名称</label>
+				<div class="layui-input-block">
+					<sys:gridselectprojectmaterial disabled="true" url="${ctx}/project/projectMaterialStorage/selectproject" id="project" name="projectNumber"  value="${projectMaterialStorage.projectName}"  title="选择所属项目" labelName="projectName" cssStyle="background-color: #fff"
+												   labelValue="${projectMaterialStorage.projectName}" cssClass="form-control required layui-input" fieldLabels="项目名称" fieldKeys="projectName" searchLabel="项目名称" searchKey="projectName"  ></sys:gridselectprojectmaterial>
+				</div>
+			</div>
+			<div class="layui-item layui-col-sm6">
+				<label class="layui-form-label">报告号</label>
+				<div class="layui-input-block">
+					<input id="projectReportNumber" htmlEscape="false"  value=""  class="form-control layui-input" readonly="true"/>
+				</div>
+			</div>
+			<div class="layui-item layui-col-sm6">
+				<label class="layui-form-label">项目编号</label>
+				<div class="layui-input-block">
+					<input id="projectNoId" htmlEscape="false"  value=""  class="form-control layui-input" readonly="true"/>
+				</div>
+			</div>
+			<div class="layui-item layui-col-sm6">
+				<label class="layui-form-label">项目责任人</label>
+				<div class="layui-input-block">
+					<input id="leaderName" htmlEscape="false"  value=""  class="form-control layui-input" readonly="true"/>
+				</div>
+			</div>
+		</div>
 		<div class="form-group layui-row first lw14">
-			<div class="form-group-label"><h2>材料处理</h2></div>
+			<div class="form-group-label"><h2>材料详情</h2></div>
 			<div class="layui-item nav-btns">
 				<a class="nav-btn nav-btn-add" onclick="addRow1('#projectMaterialStorageList', projectMaterialStorageListRowIdx, projectMaterialStorageListTpl);projectMaterialStorageListRowIdx = projectMaterialStorageListRowIdx + 1;" title="新增"><i class="fa fa-plus"></i>&nbsp;新增</a>
 				<table:importExcelA url="${ctx}/project/projectMaterialStorage/import"></table:importExcelA><!-- 导入按钮 -->
@@ -180,16 +208,18 @@
 					<thead>
 					<tr>
 						<th width="200px"><font color="red">*</font>材料名称</th>
-						<th width="150px">品牌</th>
-						<th width="200px"><font color="red">*</font>规格型号</th>
-						<th width="100px">含税工程价(元)</th>
-						<th width="100px">含税市场价(元)</th>
-						<th width="100px">税率</th>
+						<th width="200px">规格型号</th>
 						<th width="100px"><font color="red">*</font>单位</th>
+						<th width="100px">工程价(元,不含税)</th>
+						<th width="100px">市场价(元,不含税)</th>
+						<th width="100px">税率(%)</th>
+						<th width="100px">价格来源</th>
+						<th width="100px">单体项目描述</th>
+						<th width="150px">品牌</th>
 						<th width="200px">产品说明</th>
 						<th width="100px">供应商</th>
 						<th width="200px">备注</th>
-<%--						<th width="200px">单位</th>--%>
+							<%--						<th width="200px">单位</th>--%>
 						<th width="100px">报价时间</th>
 						<th width="100px">操作</th>
 					</tr>
@@ -204,25 +234,35 @@
 							<input id="projectMaterialStorageList{{idx}}_delFlag" name="projectMaterialStorageList[{{idx}}].delFlag" type="hidden" value="0"/>
                         </td>
                         <td>
-							<input id="projectMaterialStorageList{{idx}}_materialName" name = "projectMaterialStorageList[{{idx}}].materialName"  type="text" value="{{row.materialName}}"  class="form-control"/>
+							<input id="projectMaterialStorageList{{idx}}_materialName" name = "projectMaterialStorageList[{{idx}}].materialName"  type="text" value="{{row.materialName}}"  class="form-control required"/>
                         </td>
                         <td>
-							<input id="projectMaterialStorageList{{idx}}_brand" name = "projectMaterialStorageList[{{idx}}].brand"  type="text" value="{{row.brand}}"  class="form-control"/>
+							<input id="projectMaterialStorageList{{idx}}_specifications" name = "projectMaterialStorageList[{{idx}}].specifications"  type="text" value="{{row.specifications}}"  class="form-control"/>
                         </td>
                         <td>
-							<input id="projectMaterialStorageList{{idx}}_specifications" name = "projectMaterialStorageList[{{idx}}].specifications"  type="text" value="{{row.specifications}}"  class="form-control"/>
+							<input id="projectMaterialStorageList{{idx}}_unit" name = "projectMaterialStorageList[{{idx}}].unit"  type="text" value="{{row.unit}}"  class="form-control required"/>
                         </td>
                         <td>
-							<input id="projectMaterialStorageList{{idx}}_projectPriceIncludingTax" name = "projectMaterialStorageList[{{idx}}].projectPriceIncludingTax"  type="text" value="{{row.projectPriceIncludingTax}}" onkeyup="num(this)"  class="form-control"/>
+							<input id="projectMaterialStorageList{{idx}}_projectPriceExcludingTax" name = "projectMaterialStorageList[{{idx}}].projectPriceExcludingTax"  type="text" value="{{row.projectPriceExcludingTax}}" onkeyup="num(this)"  class="form-control"/>
                         </td>
                         <td>
-							<input id="projectMaterialStorageList{{idx}}_marketPriceIncludingTax" name = "projectMaterialStorageList[{{idx}}].marketPriceIncludingTax"  type="text" value="{{row.marketPriceIncludingTax}}" onkeyup="num(this)"  class="form-control"/>
+							<input id="projectMaterialStorageList{{idx}}_marketPriceExcludingTax" name = "projectMaterialStorageList[{{idx}}].marketPriceExcludingTax"  type="text" value="{{row.marketPriceExcludingTax}}" onkeyup="num(this)"  class="form-control"/>
                         </td>
                         <td>
 							<input id="projectMaterialStorageList{{idx}}_taxRate" name = "projectMaterialStorageList[{{idx}}].taxRate"  type="text" value="{{row.taxRate}}" onkeyup="num(this)"  class="form-control"/>
                         </td>
                         <td>
-							<input id="projectMaterialStorageList{{idx}}_unit" name = "projectMaterialStorageList[{{idx}}].unit"  type="text" value="{{row.unit}}"  class="form-control"/>
+							<select name="projectMaterialStorageList[{{idx}}].priceSource" id="projectMaterialStorageList{{idx}}_priceSource" class="form-control" >
+								<option value=""></option>
+								<c:forEach items="${fns:getMainDictList('priceSource')}" var="var">
+									<option value="${var.value}">${var.label}</option>
+								</c:forEach>
+							</select>                        </td>
+                        <td>
+							<input id="projectMaterialStorageList{{idx}}_monomerProjectDescription" name = "projectMaterialStorageList[{{idx}}].monomerProjectDescription"  type="text" value="{{row.monomerProjectDescription}}" class="form-control"/>
+                        </td>
+                        <td>
+							<input id="projectMaterialStorageList{{idx}}_brand" name = "projectMaterialStorageList[{{idx}}].brand"  type="text" value="{{row.brand}}"  class="form-control"/>
                         </td>
                         <td>
 							<input id="projectMaterialStorageList{{idx}}_explain" name = "projectMaterialStorageList[{{idx}}].explain"  type="text" value="{{row.explain}}"  class="form-control"/>
@@ -247,7 +287,7 @@
                         workInvoiceProjectRelationListRowIdx = ${fn:length(workInvoice.workInvoiceProjectRelationList)};
 						}*/
 					$(document).ready(function() {
-						<%--var data = ${fns:toJson(projectMaterialStorage.projectMaterialStorageList)};--%>
+						var data = ${fns:toJson(projectMaterialStorage.projectMaterialStorageList)};
 						for (var i=0; i<data.length; i++){
 							addRow1('#projectMaterialStorageList', projectMaterialStorageListRowIdx, projectMaterialStorageListTpl, data[i])
 							projectMaterialStorageListRowIdx = projectMaterialStorageListRowIdx + 1;

+ 62 - 17
src/main/webapp/webpage/modules/projectMaterialStorage/projectMaterialStorageList.jsp

@@ -63,14 +63,12 @@
             });
             laydate.render({
                 elem: '#beginQuotedPriceDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
-                event: 'focus', //响应事件。如果没有传入event,则按照默认的click
-                type : 'date'
+                type : 'month'
 , trigger: 'click'
             });
             laydate.render({
                 elem: '#endQuotedPriceDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
-                event: 'focus', //响应事件。如果没有传入event,则按照默认的click
-                type : 'date'
+                type : 'month'
 , trigger: 'click'
             });
         });
@@ -346,6 +344,8 @@
 								var message = "保存成功!您总共上传了 " + metadataCount + " 条数据,保存成功 " + uniqueCount + " 条数据。";
 								//如果不存在错误数据、重复数据,则直接提示新增成功
 								parent.layer.msg(message, { icon: 0 });
+								top.layer.close(index);
+								sortOrRefresh();
 							}else{
 								var projectId = result.projectId
 								if(!projectId){
@@ -463,10 +463,10 @@
 											}
 											,
 											function(confirmIndex) {
-												top.layui.layer.close(confirmIndex);
 												setTimeout(() => {
 													top.layui.layer.close(index);
 												}, 100);
+												top.layer.close(index);
 												sortOrRefresh();
 											}
 									);
@@ -548,6 +548,24 @@
 						</div>
 
 						<div class="layui-item query athird" style="width: 25%">
+							<label class="layui-form-label double-line" style="line-height:100%">工程价(元,不含税):</label>
+							<div class="layui-input-block">
+								<input id="beginProjectPriceExcludingTax" value="${projectMaterialStorage.beginProjectPriceExcludingTax}" name="beginProjectPriceExcludingTax" placeholder="请输入工程价(元,不含税)" htmlEscape="false" maxlength="64"  class="query-group form-control  layui-input">
+								<span class="group-sep">-</span>
+								<input id="endProjectPriceExcludingTax" value="${projectMaterialStorage.endProjectPriceExcludingTax}" name="endProjectPriceExcludingTax" placeholder="请输入工程价(元,不含税)" htmlEscape="false" maxlength="64"  class="query-group form-control  layui-input">
+							</div>
+						</div>
+
+						<div class="layui-item query athird" style="width: 25%">
+							<label class="layui-form-label double-line" style="line-height:100%">市场价(元,不含税):</label>
+							<div class="layui-input-block">
+								<input id="beginMarketPriceExcludingTax" value="${projectMaterialStorage.beginMarketPriceExcludingTax}" name="beginMarketPriceExcludingTax" placeholder="请输入市场价(元,不含税)" htmlEscape="false" maxlength="64"  class="query-group form-control  layui-input">
+								<span class="group-sep">-</span>
+								<input id="endMarketPriceExcludingTax" value="${projectMaterialStorage.endMarketPriceExcludingTax}" name="endMarketPriceExcludingTax" placeholder="请输入市场价(元,不含税)" htmlEscape="false" maxlength="64"  class="query-group form-control  layui-input">
+							</div>
+						</div>
+
+						<div class="layui-item query athird" style="width: 25%">
 							<label class="layui-form-label double-line">含税工程价:</label>
 							<div class="layui-input-block">
 								<input id="beginProjectPriceIncludingTax" value="${projectMaterialStorage.beginProjectPriceIncludingTax}" name="beginProjectPriceIncludingTax" placeholder="请输入含税工程价(元)" htmlEscape="false" maxlength="64"  class="query-group form-control  layui-input">
@@ -575,6 +593,16 @@
 						</div>
 
 						<div class="layui-item query athird" style="width: 25%">
+							<label class="layui-form-label">价格来源:</label>
+							<div class="layui-input-block">
+								<form:select placeholder="请选择价格来源" path="priceSource" class="form-control simple-select">
+									<form:option value=""/>
+									<form:options items="${fns:getMainDictList('priceSource')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
+								</form:select>
+							</div>
+						</div>
+
+						<div class="layui-item query athird" style="width: 25%">
 							<label class="layui-form-label">单位:</label>
 							<div class="layui-input-block">
 								<form:input path="unit" htmlEscape="false" placeholder="请输入单位" maxlength="64"  class=" form-control  layui-input" />
@@ -595,15 +623,22 @@
 							</div>
 						</div>
 
+						<div class="layui-item query athird" style="width: 25%">
+							<label class="layui-form-label" style="line-height:100%">单体工程描述:</label>
+							<div class="layui-input-block">
+								<form:input path="monomerProjectDescription" htmlEscape="false" placeholder="请输入单体工程描述" maxlength="800"  class=" form-control  layui-input" />
+							</div>
+						</div>
+
 						<div class="layui-item query athird " style="width: 25%">
 							<label class="layui-form-label">报价时间:</label>
 							<div class="layui-input-block readOnlyFFF">
 								<input id="beginQuotedPriceDate" name="beginQuotedPriceDate" placeholder="报价开始时间" type="text" readonly="readonly" maxlength="20" class="laydate-icondate form-control layer-date layui-input laydate-icon query-group"
-									   value="<fmt:formatDate value="${projectMaterialStorage.beginQuotedPriceDate}" pattern="yyyy-MM-dd"/>"/>
+									   value="<fmt:formatDate value="${projectMaterialStorage.beginQuotedPriceDate}" pattern="yyyy-MM"/>"/>
 								</input>
 								<span class="group-sep">-</span>
 								<input id="endQuotedPriceDate" name="endQuotedPriceDate" placeholder="报价结束时间" type="text" readonly="readonly" maxlength="20" class="laydate-icondate form-control layer-date layui-input laydate-icon query-group"
-									   value="<fmt:formatDate value="${projectMaterialStorage.endQuotedPriceDate}" pattern="yyyy-MM-dd"/>"/>
+									   value="<fmt:formatDate value="${projectMaterialStorage.endQuotedPriceDate}" pattern="yyyy-MM"/>"/>
 								</input>
 							</div>
 						</div>
@@ -637,9 +672,9 @@
 						<%--</shiro:hasPermission>--%>
 						<button class="layui-btn layui-btn-sm" data-toggle="tooltip" data-placement="left" onclick="sortOrRefresh()" title="刷新"> 刷新</button>
 						</div>
-					<shiro:hasPermission name="project:projectMaterialStorage:list">
+					<%--<shiro:hasPermission name="project:projectMaterialStorage:list">
 						<table:exportExcel url="${ctx}/project/projectMaterialStorage/export"></table:exportExcel><!-- 导出按钮 -->
-					</shiro:hasPermission>
+					</shiro:hasPermission>--%>
 					<div style="clear: both;"></div>
 				</div>
 				<table class="oa-table layui-table" id="contentTable1"></table>
@@ -676,17 +711,23 @@
 						return xml;
 											}}
 				,{field:'projectId',align:'center', title: '报告号',  width:180}
-				,{field:'materialName',align:'center', title: '材料名称',  width:150}
-				,{field:'brand',align:'center', title: '品牌',  width:100}
+				,{field:'materialName',align:'center', title: '材料名称',  width:260,templet:function(d){
+						return "<a class=\"attention-info\" title=\"" + d.materialName + "\" href=\"javascript:void(0);\" onclick=\"openDialogView('查看详情', '${ctx}/project/projectMaterialStorage/view?id=" + d.id +"','95%', '95%')\">" + d.materialName + "</a>";
+					}}
 				,{field:'specifications',align:'center', title: '规格型号',  width:150}
+				,{field:'unit',align:'center', title: '单位',  width:80}
+				,{field:'projectPriceExcludingTax',align:'center', title: '工程价(元,不含税)',  width:150}
+				,{field:'marketPriceExcludingTax',align:'center', title: '市场价(元,不含税)',  width:150}
+				,{field:'taxRate',align:'center', title: '税率(%)',  width:100}
+				,{field:'priceSource',align:'center', title: '价格来源',  width:100}
+				,{field:'quotedPriceDate',align:'center', title: '报价时间',  width:100}
+				,{field:'monomerProjectDescription',align:'center', title: '单体项目描述',  width:140}
 				,{field:'projectPriceIncludingTax',align:'center', title: '含税工程价(元)',  width:130}
 				,{field:'marketPriceIncludingTax',align:'center', title: '含税市场价(元)',  width:130}
-				,{field:'taxRate',align:'center', title: '税率(%)',  width:100}
-				,{field:'unit',align:'center', title: '单位',  width:80}
-				,{field:'explain',align:'center', title: '产品说明',  width:150}
+				/*,{field:'brand',align:'center', title: '品牌',  width:100}
 				,{field:'supplier',align:'center', title: '供应商',  width:150}
-				,{field:'remarks',align:'center', title: '备注',  width:150}
-				,{field:'quotedPriceDate',align:'center', title: '报价时间',  width:100}
+				,{field:'explain',align:'center', title: '产品说明',  width:150}
+				,{field:'remarks',align:'center', title: '备注',  width:150}*/
 				,{field:'createBy',align:'center', title: '创建人',  width:80}
                 ,{field:'createDate',align:'center', title: '创建日期',  width:100}
                 ,{field:'op',align:'center',title:"操作",width:160,templet:function(d){
@@ -715,7 +756,7 @@
                     ,"projectName":"<c:out value="${projectMaterialStorage.projectName}" escapeXml="true"/>"
 					,"areaName":"${projectMaterialStorage.areaName}"
 					,"createDate":"<fmt:formatDate value="${projectMaterialStorage.createDate}" pattern="yyyy-MM-dd"/>"
-					,"quotedPriceDate":"<fmt:formatDate value="${projectMaterialStorage.quotedPriceDate}" pattern="yyyy-MM-dd"/>"
+					,"quotedPriceDate":"<fmt:formatDate value="${projectMaterialStorage.quotedPriceDate}" pattern="yyyy年MM月"/>"
 					,"brand":"${projectMaterialStorage.brand}"
 					,"specifications":"${projectMaterialStorage.specifications}"
 					,"projectPriceIncludingTax":"${projectMaterialStorage.projectPriceIncludingTax}"
@@ -725,6 +766,10 @@
 					,"explain":"${projectMaterialStorage.explain}"
 					,"supplier":"${projectMaterialStorage.supplier}"
 					,"remarks":"${projectMaterialStorage.remarks}"
+					,"priceSource":"${projectMaterialStorage.priceSource}"
+					,"monomerProjectDescription":"${projectMaterialStorage.monomerProjectDescription}"
+					,"projectPriceExcludingTax":"${projectMaterialStorage.projectPriceExcludingTax}"
+					,"marketPriceExcludingTax":"${projectMaterialStorage.marketPriceExcludingTax}"
 					,"createBy":"${projectMaterialStorage.createBy.name}"
 					,"flag":
 							<c:choose>

+ 80 - 18
src/main/webapp/webpage/modules/projectMaterialStorage/projectMaterialStorageTwoForm.jsp

@@ -67,8 +67,7 @@
 			});
 			laydate.render({
 				elem: '#quotedPriceDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
-				event: 'focus', //响应事件。如果没有传入event,则按照默认的click
-				type : 'date'
+				type : 'month'
 				, trigger: 'click'
 			});
         });
@@ -85,6 +84,41 @@
 			obj.value = obj.value.replace(/\.{2,}/g,"."); //只保留第一个, 清除多余的
 			obj.value = obj.value.replace(".","$#$").replace(/\./g,"").replace("$#$",".");
 			obj.value = obj.value.replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3'); //只能输入两个小数
+			var id = obj.id
+			var taxRate = $("#taxRate").val();
+			if(taxRate){
+				var projectPriceExcludingTax = parseFloat($("#projectPriceExcludingTax").val()) || 0;
+				if(projectPriceExcludingTax !== 0){
+					var rate = parseFloat(taxRate) / 100; // 将百分比税率转为小数
+					var projectPriceIncludingTax = projectPriceExcludingTax * (1 + rate);
+
+					// 四舍五入保留两位小数
+					projectPriceIncludingTax = Math.round(projectPriceIncludingTax * 100) / 100;
+
+					// 确保结果显示两位小数(如100 → 100.00)
+					$("#projectPriceIncludingTax").val(projectPriceIncludingTax.toFixed(2));
+				}else{
+					$("#projectPriceIncludingTax").val("");
+				}
+
+				var marketPriceExcludingTax = parseFloat($("#marketPriceExcludingTax").val()) || 0;
+				if(marketPriceExcludingTax !== 0){
+
+					var rate = parseFloat(taxRate) / 100; // 将百分比税率转为小数
+					var marketPriceIncludingTax = marketPriceExcludingTax * (1 + rate);
+
+					// 四舍五入保留两位小数
+					marketPriceIncludingTax = Math.round(marketPriceIncludingTax * 100) / 100;
+
+					// 确保结果显示两位小数(如100 → 100.00)
+					$("#marketPriceIncludingTax").val(marketPriceIncludingTax.toFixed(2));
+				}else{
+					$("#marketPriceIncludingTax").val("");
+				}
+			}else{
+				$("#projectPriceIncludingTax").val("");
+				$("#marketPriceIncludingTax").val("");
+			}
 		}
 	</script>
 </head>
@@ -106,68 +140,96 @@
 				<div class="layui-item layui-col-sm6">
 					<label class="layui-form-label"><span class="require-item invoicetype">*</span>材料名称</label>
 					<div class="layui-input-block">
-						<form:input id="materialName" path="materialName" htmlEscape="false"  placeholder="请输入材料名称"  class="form-control layui-input" required="true"/>
+						<form:input id="materialName" path="materialName" htmlEscape="false"  placeholder="请输入材料名称"  class="form-control layui-input" required="true" maxlength="240"/>
 					</div>
 				</div>
 				<div class="layui-item layui-col-sm6">
-					<label class="layui-form-label">品牌</label>
+					<label class="layui-form-label">规格型号</label>
 					<div class="layui-input-block">
-						<form:input id="brand" path="brand" htmlEscape="false"  placeholder="请输入品牌"  class="form-control layui-input"/>
+						<form:input id="specifications" path="specifications" htmlEscape="false"  placeholder="请输入规格型号"  class="form-control layui-input" maxlength="240"/>
 					</div>
 				</div>
 				<div class="layui-item layui-col-sm6">
-					<label class="layui-form-label">规格型号</label>
+					<label class="layui-form-label"><span class="require-item invoicetype" >*</span>单位</label>
+					<div class="layui-input-block">
+						<form:input id="unit" path="unit" htmlEscape="false"  placeholder="请输入单位"  class="form-control required layui-input" maxlength="30" />
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6">
+					<label class="layui-form-label double-line">工程价(元,不含税)</label>
 					<div class="layui-input-block">
-						<form:input id="specifications" path="specifications" htmlEscape="false"  placeholder="请输入规格型号"  class="form-control layui-input"/>
+						<form:input id="projectPriceExcludingTax" path="projectPriceExcludingTax" htmlEscape="false"  placeholder="请输入工程价(元,不含税)"  class="form-control layui-input" onkeyup="num(this)" maxlength="10"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6">
+					<label class="layui-form-label double-line">市场价(元,不含税)</label>
+					<div class="layui-input-block">
+						<form:input id="marketPriceExcludingTax" path="marketPriceExcludingTax" htmlEscape="false"  placeholder="请输入市场价(元,不含税)"  class="form-control layui-input" onkeyup="num(this)" maxlength="10"/>
 					</div>
 				</div>
 				<div class="layui-item layui-col-sm6">
 					<label class="layui-form-label double-line">含税工程价(元)</label>
 					<div class="layui-input-block">
-						<form:input id="projectPriceIncludingTax" path="projectPriceIncludingTax" htmlEscape="false"  placeholder="请输入含税工程价(元)"  class="form-control layui-input" onkeyup="num(this)"/>
+						<input class="form-control layui-input" readonly id="projectPriceIncludingTax" name="projectPriceIncludingTax" value="${projectMaterialStorage.projectPriceIncludingTax}">
 					</div>
 				</div>
 				<div class="layui-item layui-col-sm6">
 					<label class="layui-form-label double-line">含税市场价(元)</label>
 					<div class="layui-input-block">
-						<form:input id="marketPriceIncludingTax" path="marketPriceIncludingTax" htmlEscape="false"  placeholder="请输入含税市场价(元)"  class="form-control layui-input" onkeyup="num(this)"/>
+						<input class="form-control layui-input" readonly id="marketPriceIncludingTax" name="marketPriceIncludingTax" value="${projectMaterialStorage.marketPriceIncludingTax}">
 					</div>
 				</div>
 				<div class="layui-item layui-col-sm6">
 					<label class="layui-form-label">税率(%)</label>
 					<div class="layui-input-block">
-						<form:input id="taxRate" path="taxRate" htmlEscape="taxRate"  placeholder="请输入税率(%)"  class="form-control layui-input" onkeyup="num(this)"/>
+						<form:input id="taxRate" path="taxRate" htmlEscape="taxRate"  placeholder="请输入税率(%)"  class="form-control layui-input" onkeyup="num(this)"  maxlength="10"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6">
+					<label class="layui-form-label">价格来源</label>
+					<div class="layui-input-block readOnlyFFF">
+						<form:select path="priceSource" class="form-control simple-select">
+							<form:option value=" " label=""/>
+							<form:options items="${fns:getMainDictList('priceSource')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
+						</form:select>
 					</div>
 				</div>
 				<div class="layui-item layui-col-sm6">
-					<label class="layui-form-label"><span class="require-item invoicetype" >*</span>材料单位</label>
+					<label class="layui-form-label">品牌</label>
 					<div class="layui-input-block">
-						<form:input id="unit" path="unit" htmlEscape="false"  placeholder="请输入材料单位"  class="form-control required layui-input" />
+						<form:input id="brand" path="brand" htmlEscape="false"  placeholder="请输入品牌"  class="form-control layui-input" maxlength="240"/>
 					</div>
 				</div>
 				<div class="layui-item layui-col-sm6">
 					<label class="layui-form-label">产品说明</label>
 					<div class="layui-input-block">
-						<form:input id="explain" path="explain" htmlEscape="false"  placeholder="请输入产品说明"  class="form-control layui-input"/>
+						<form:input id="explain" path="explain" htmlEscape="false"  placeholder="请输入产品说明"  class="form-control layui-input" maxlength="800"/>
 					</div>
 				</div>
 				<div class="layui-item layui-col-sm6">
 					<label class="layui-form-label">供应商</label>
 					<div class="layui-input-block">
-						<form:input id="supplier" path="supplier" htmlEscape="false"  placeholder="请输入供应商"  class="form-control layui-input"/>
+						<form:input id="supplier" path="supplier" htmlEscape="false"  placeholder="请输入供应商"  class="form-control layui-input" maxlength="240" />
 					</div>
 				</div>
 				<div class="layui-item layui-col-sm6">
 					<label class="layui-form-label">报价时间</label>
 					<div class="layui-input-block">
-						<input class="form-control layui-input"  style="background-color: #FFFFFF" readonly id="quotedPriceDate" name="quotedPriceDate" value="<fmt:formatDate value="${projectMaterialStorage.quotedPriceDate}" pattern="yyyy-MM-dd"/>">
+						<input class="form-control layui-input"  style="background-color: #FFFFFF" readonly id="quotedPriceDate" name="quotedPriceDate" value="<fmt:formatDate value="${projectMaterialStorage.quotedPriceDate}" pattern="yyyy-MM"/>">
 					</div>
 				</div>
+				<div class="layui-item layui-col-sm12 with-textarea">
+					<label class="layui-form-label double-line">单体项目描述:</label>
+					<div class="layui-input-block">
+						<form:textarea path="monomerProjectDescription" htmlEscape="false" rows="4" placeholder="请输入单体项目描述"  class="form-control" maxlength="800"/>
 
-				<div class="layui-item layui-col-sm6">
-					<label class="layui-form-label">备注</label>
+					</div>
+				</div>
+
+				<div class="layui-item layui-col-sm12  with-textarea">
+					<label class="layui-form-label">备注:</label>
 					<div class="layui-input-block">
-						<form:input id="remarks" path="remarks" htmlEscape="false"  placeholder="请输入备注"  class="form-control layui-input"/>
+						<form:textarea id="remarks" path="remarks" htmlEscape="false" rows="4" placeholder="请输入备注"  class="form-control" maxlength="800"/>
 					</div>
 				</div>