diff --git a/src/main/java/com/JN/demo/jnzmquatation/controller/JNController.java b/src/main/java/com/JN/demo/jnzmquatation/controller/JNController.java index 7b02560..b8bf88d 100644 --- a/src/main/java/com/JN/demo/jnzmquatation/controller/JNController.java +++ b/src/main/java/com/JN/demo/jnzmquatation/controller/JNController.java @@ -1,12 +1,8 @@ package com.JN.demo.jnzmquatation.controller; import com.JN.common.R; -import com.JN.demo.jnzmquatation.dto.JnInventoryDto; import com.JN.demo.jnzmquatation.dto.JnMaterialDto; -import com.JN.demo.jnzmquatation.dto.JnRegionDto; -import com.JN.demo.jnzmquatation.service.JnInventoryService; import com.JN.demo.jnzmquatation.service.JnMaterialService; -import com.JN.demo.jnzmquatation.service.JnRegionService; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; @@ -27,32 +23,12 @@ import java.util.List; @Slf4j @RequestMapping("/jnquotation") public class JNController { - @Autowired - JnRegionService regionService; @Autowired JnMaterialService materialService; - @Autowired - JnInventoryService inventoryService; - /** - * @title queryRegionList - * @description 查询地区列表信息 - * @author JIAL - * @param: regionName - * @updateTime 2024/2/20 16:54 - * @return: com.JN.common.R> - */ - @PostMapping("/regionList") - public R queryRegionList(@RequestParam("regionName") String regionName){ - List regionList = regionService.queryRegionListByName(regionName); - - log.info("查询到的地区列表结果是:{}", regionList); - - return R.success(regionList); - } /** * @title queryMaterialList @@ -77,19 +53,4 @@ public class JNController { return R.success(materialList); } - /** - * @title queryInventoryList - * @description 获取盘具列表 - * @author JIAL - * @updateTime 2024/2/22 10:09 - * @return: com.JN.common.R> - */ - @PostMapping("/inventoryList") - public R queryInventoryList() { - List inventoryList = inventoryService.queryInventoryList(); - - return R.success(inventoryList); - } - - } diff --git a/src/main/java/com/JN/demo/jnzmquatation/dto/JnInventoryDto.java b/src/main/java/com/JN/demo/jnzmquatation/dto/JnInventoryDto.java deleted file mode 100644 index 2a3b16c..0000000 --- a/src/main/java/com/JN/demo/jnzmquatation/dto/JnInventoryDto.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.JN.demo.jnzmquatation.dto; - -import lombok.Data; - -import java.io.Serializable; - -/** - * @ClassName InventoryDto - * @Description TODO - * @Author JIAL - * @Date 2024/2/22 9:48 - * @Version 1.0 - */ -@Data -public class JnInventoryDto implements Serializable { - private static final long serialVersionUID = 1L; - - private String inventory; //盘具名称 - - private String invDesc; //盘具描述 - - private String weighInv; //盘重 -} diff --git a/src/main/java/com/JN/demo/jnzmquatation/dto/JnMaterialDto.java b/src/main/java/com/JN/demo/jnzmquatation/dto/JnMaterialDto.java index af10c68..27bc04b 100644 --- a/src/main/java/com/JN/demo/jnzmquatation/dto/JnMaterialDto.java +++ b/src/main/java/com/JN/demo/jnzmquatation/dto/JnMaterialDto.java @@ -15,37 +15,27 @@ import java.io.Serializable; public class JnMaterialDto implements Serializable { private static final long serialVersionUID = 1L; - private String materialName; //物料名称 + private String uid; //物料uid + + private String prodCategory; //产品大类 + + private String prodWorkshop; //生产车间 private String model; //型号 private String specification; //规格 - private String voltage; //电压 + private String voltLevel; //电压等级 - private String standard; //标准 + private String measureUnit; //单位 - private String costPrice; //成本价 + private String matCostPrice; //材料成本价格 - private String factoryPrice; //厂价 + private String redBookPrice; //红本价格 - private String netVolume; //净种量(物料重量) + private String redBookCost; //红本成本 - private String inventory; //盘具 + private String rbFacPrice; //红本厂价 - private String weighInv; //盘重 - - private String matPrice; //材料价格(去掉铜铝后的价格) - - private String totalCopperConsume; //铜导体总消耗 - - private String totalAluminumConsume; //铝导体总消耗 - - private String totalLHCost; //人工水电费合计 - - private String steamFee; //蒸汽费 - - private int quantity = 1; //数量默认为1 - - private int invItemCount = 1; //盘具数量默认1 + private Integer number = 1; //数量默认1 } diff --git a/src/main/java/com/JN/demo/jnzmquatation/dto/JnRegionDto.java b/src/main/java/com/JN/demo/jnzmquatation/dto/JnRegionDto.java deleted file mode 100644 index 9f390e1..0000000 --- a/src/main/java/com/JN/demo/jnzmquatation/dto/JnRegionDto.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.JN.demo.jnzmquatation.dto; - -import lombok.Data; - -import java.io.Serializable; -import java.math.BigDecimal; - -/** - * @ClassName RegionDto - * @Description TODO - * @Author JIAL - * @Date 2024/2/19 10:40 - * @Version 1.0 - */ -@Data -public class JnRegionDto implements Serializable { - private static final long serialVersionUID = 1L; - - private String province; - - private String city; - - private String district; - - private Integer kilometers; - - private BigDecimal price01; - - private BigDecimal price02; - - private BigDecimal price03; - - private BigDecimal price04; - - private BigDecimal price05; -} diff --git a/src/main/java/com/JN/demo/jnzmquatation/entity/MaterialEneity.java b/src/main/java/com/JN/demo/jnzmquatation/entity/MaterialEneity.java new file mode 100644 index 0000000..6b9898a --- /dev/null +++ b/src/main/java/com/JN/demo/jnzmquatation/entity/MaterialEneity.java @@ -0,0 +1,24 @@ +package com.JN.demo.jnzmquatation.entity; + +import lombok.Data; + +/** + * @ClassName MaterialEneity + * @Description TODO + * @Author JIAL + * @Date 2024/2/27 13:57 + * @Version 1.0 + */ +@Data +public class MaterialEneity { + + private String uid_0; + private String desp_0; + private String desp_1; + private String desp_2; + private String model_0; + private String model_1; + private String spec_0; + + +} diff --git a/src/main/java/com/JN/demo/jnzmquatation/mapper/JnInventoryMapper.java b/src/main/java/com/JN/demo/jnzmquatation/mapper/JnInventoryMapper.java deleted file mode 100644 index eec98c7..0000000 --- a/src/main/java/com/JN/demo/jnzmquatation/mapper/JnInventoryMapper.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.JN.demo.jnzmquatation.mapper; - -import com.JN.demo.jnzmquatation.dto.JnInventoryDto; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Select; - -import java.util.List; - -/** - * @ClassName InventoryMapper - * @Description TODO - * @Author JIAL - * @Date 2024/2/22 9:56 - * @Version 1.0 - */ -@Mapper -public interface JnInventoryMapper { - - @Select("SELECT [cbpj_mc] as inventory,\n" + - " [cbpj_pzjd1] as inv_desc,\n" + - " [cbpj_zl] as weigh_inv\n" + - "FROM [zm_erp2].[dbo].[cb_cbpj]") - List queryInventoryList(); -} diff --git a/src/main/java/com/JN/demo/jnzmquatation/mapper/JnMaterialMapper.java b/src/main/java/com/JN/demo/jnzmquatation/mapper/JnMaterialMapper.java index 671e386..787330b 100644 --- a/src/main/java/com/JN/demo/jnzmquatation/mapper/JnMaterialMapper.java +++ b/src/main/java/com/JN/demo/jnzmquatation/mapper/JnMaterialMapper.java @@ -15,24 +15,18 @@ import java.util.List; */ @Mapper public interface JnMaterialMapper { - @Select(" SELECT [cb_name] as material_name\n" + - " ,[cb_cj] as factory_price\n" + - " ,[cb_cbj] as cost_price\n" + - " ,[cb_zl] as net_volume\n" + - " ,[cb_gspj] as inventory\n" + - " ,[cbpj_zl] as weigh_inv\n" + - " ,[CB_bz] as standard\n" + - " ,[cb_xx] as model\n" + - " ,[cb_gg] as specification\n" + - " ,[cb_dy] as voltage\n" + - " ,[cb_cljg] as mat_price\n" + - " ,[tdtjg] as total_copper_consume\n" + - " ,[ldtjg] as total_aluminum_consume\n" + - " ,[rgsdf] as total_l_h_cost\n" + - " ,[cb_zqf]as steam_fee\n" + - " ,ROW_NUMBER() OVER(Order by [cb_name]) AS RowId\n" + - " FROM [zm_erp2].[dbo].[view_cb_material]\n" + - " WHERE [cb_name] like '${precMaterialName}%' and [cb_name] like '%${vagueMaterialName}%' and [cb_gg] like '%${vagueModel}%'") + @Select("SELECT [uid_0] AS uid \n" + + " ,[desp_0] AS prodCategory\n" + + " ,[model_0] AS model\n" + + " ,[spec_0] AS specification\n" + + " ,[voltage_0] AS voltLevel\n" + + " ,[unit_0] AS measureUnit\n" + + " ,[redBookPrice] \n" + + " ,[rbFacPrice]\n" + + " ,[matCostPrice]\n" + + " ,[redBookCost]\n" + + " FROM [jn_quot].[dbo].[c_material_detail]" + + " WHERE [model_0] like '${precMaterialName}%' and [model_0] like '%${vagueMaterialName}%' and [spec_0] like '%${vagueModel}%'") List queryMaterialListByParam(String precMaterialName, String vagueMaterialName, String vagueModel); diff --git a/src/main/java/com/JN/demo/jnzmquatation/mapper/JnRegionMapper.java b/src/main/java/com/JN/demo/jnzmquatation/mapper/JnRegionMapper.java deleted file mode 100644 index 83c5344..0000000 --- a/src/main/java/com/JN/demo/jnzmquatation/mapper/JnRegionMapper.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.JN.demo.jnzmquatation.mapper; - -import com.JN.demo.jnzmquatation.dto.JnRegionDto; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Select; - -import java.util.List; - -/** - * @ClassName RegionMapper - * @Description TODO - * @Author JIAL - * @Date 2024/2/19 10:47 - * @Version 1.0 - */ -@Mapper -public interface JnRegionMapper { - @Select("select * from c_place a where 1=1 and a.province like '%${regionName}%' or a.city like '%${regionName}%' or a.district like '%${regionName}%' ") - List queryRegionListByName(String regionName); -} diff --git a/src/main/java/com/JN/demo/jnzmquatation/service/JnInventoryService.java b/src/main/java/com/JN/demo/jnzmquatation/service/JnInventoryService.java deleted file mode 100644 index c9e0bbb..0000000 --- a/src/main/java/com/JN/demo/jnzmquatation/service/JnInventoryService.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.JN.demo.jnzmquatation.service; - -import com.JN.demo.jnzmquatation.dto.JnInventoryDto; - -import java.util.List; - -/** - * @ClassName InventoryService - * @Description TODO - * @Author JIAL - * @Date 2024/2/22 9:55 - * @Version 1.0 - */ -public interface JnInventoryService { - List queryInventoryList(); -} diff --git a/src/main/java/com/JN/demo/jnzmquatation/service/JnRegionService.java b/src/main/java/com/JN/demo/jnzmquatation/service/JnRegionService.java deleted file mode 100644 index bfa2ee7..0000000 --- a/src/main/java/com/JN/demo/jnzmquatation/service/JnRegionService.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.JN.demo.jnzmquatation.service; - -import com.JN.demo.jnzmquatation.dto.JnRegionDto; - -import java.util.List; - -/** - * @ClassName RegionService - * @Description TODO - * @Author JIAL - * @Date 2024/2/19 10:46 - * @Version 1.0 - */ -public interface JnRegionService { - - List queryRegionListByName(String regionName); -} diff --git a/src/main/java/com/JN/demo/jnzmquatation/service/impl/JnInventoryServiceImpl.java b/src/main/java/com/JN/demo/jnzmquatation/service/impl/JnInventoryServiceImpl.java deleted file mode 100644 index 3ae326b..0000000 --- a/src/main/java/com/JN/demo/jnzmquatation/service/impl/JnInventoryServiceImpl.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.JN.demo.jnzmquatation.service.impl; - -import com.JN.demo.jnzmquatation.dto.JnInventoryDto; -import com.JN.demo.jnzmquatation.mapper.JnInventoryMapper; -import com.JN.demo.jnzmquatation.service.JnInventoryService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.List; - -/** - * @ClassName InventoryServiceImpl - * @Description TODO - * @Author JIAL - * @Date 2024/2/22 9:55 - * @Version 1.0 - */ -@Service -public class JnInventoryServiceImpl implements JnInventoryService { - - @Autowired - JnInventoryMapper inventoryMapper; - - /** - * @title queryInventoryList - * @description 获取盘具列表 - * @author JIAL - * @updateTime 2024/2/22 10:06 - * @return: java.util.List - */ - @Override - public List queryInventoryList() { - return inventoryMapper.queryInventoryList(); - } -} diff --git a/src/main/java/com/JN/demo/jnzmquatation/service/impl/JnRegionServiceImpl.java b/src/main/java/com/JN/demo/jnzmquatation/service/impl/JnRegionServiceImpl.java deleted file mode 100644 index dc316b6..0000000 --- a/src/main/java/com/JN/demo/jnzmquatation/service/impl/JnRegionServiceImpl.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.JN.demo.jnzmquatation.service.impl; - -import com.JN.demo.jnzmquatation.dto.JnRegionDto; -import com.JN.demo.jnzmquatation.mapper.JnRegionMapper; -import com.JN.demo.jnzmquatation.service.JnRegionService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.List; - -/** - * @ClassName RegionServiceImpl - * @Description TODO - * @Author JIAL - * @Date 2024/2/19 10:46 - * @Version 1.0 - */ -@Service -public class JnRegionServiceImpl implements JnRegionService { - - @Autowired - JnRegionMapper regionMapper; - - /** - * @title queryRegionListByName - * @description 根据输入的地区名称查询地区列表 - * @author JIAL - * @param: regionName - * @updateTime 2024/2/19 10:59 - * @return: java.util.List - */ - @Override - public List queryRegionListByName(String regionName){ - return regionMapper.queryRegionListByName(regionName); - } -} diff --git a/src/main/resources/application-JN.yml b/src/main/resources/application-JN.yml index 14b6c9a..d9da96b 100644 --- a/src/main/resources/application-JN.yml +++ b/src/main/resources/application-JN.yml @@ -41,7 +41,7 @@ logging: mybatis-plus: configuration: #在映射实体或者属性时,将数据库中表名和字段名中的下划线去掉,按照驼峰命名法映射 - map-underscore-to-camel-case: true + map-underscore-to-camel-case: false log-impl: org.apache.ibatis.logging.stdout.StdOutImpl global-config: db-config: diff --git a/src/main/resources/static/jnquotation/css/index.css b/src/main/resources/static/jnquotation/css/index.css index 161c8f1..1a3ac16 100644 --- a/src/main/resources/static/jnquotation/css/index.css +++ b/src/main/resources/static/jnquotation/css/index.css @@ -47,7 +47,7 @@ font-size: 12px; } -.el-input-group{ +.form-box .el-input-group{ margin-top: 6px; } @@ -117,7 +117,7 @@ margin: 10px 80px 10px 0px; } -.form-box { +.collapse-box { background-color: #f0f0f0; /* 浅灰色背景 */ border-radius: 10px; /* 可以根据需要调整边框圆角 */ backdrop-filter: blur(10px); /* 调整模糊度 */ diff --git a/src/main/resources/static/jnquotation/js/index.js b/src/main/resources/static/jnquotation/js/index.js index 958ffd0..f2c231e 100644 --- a/src/main/resources/static/jnquotation/js/index.js +++ b/src/main/resources/static/jnquotation/js/index.js @@ -8,7 +8,7 @@ const queryRegionListByName = (params) => { const queryMaterialListByParam = (params) => { return $axios({ - url: '/zmquotation/materialList', + url: '/jnquotation/materialList', method: 'post', params }) diff --git a/src/main/resources/templates/jnquotation/index.html b/src/main/resources/templates/jnquotation/index.html index 1783496..6f0fa2d 100644 --- a/src/main/resources/templates/jnquotation/index.html +++ b/src/main/resources/templates/jnquotation/index.html @@ -15,145 +15,256 @@
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+
- 选择地区 添加物料 - 刷新界面 - + 计算数据
- - - + prop="prodCategory" + label="产品大类"> - - + prop="model" + label="型号"> + prop="specification" + label="规格"> + prop="voltLevel" + label="电压等级"> - - - + prop="measureUnit" + label="单位"> + prop="matCostPrice" + label="材料成本价格"> + + + + + + + + + width="180" + prop="varRatio" + label="差异比率"> + prop="wdFSurcharge" + label="盘具运费上浮金额"> + + + + + + + - -
- -
- - - - - 查询地区 - - -
-
- - - - - - - - - - - - - - - -
-
- -
-
- +
@@ -338,7 +405,7 @@
-
+
+ width="120" + prop="prodCategory" + label="产品大类"> + prop="measureUnit" + label="单位">
@@ -399,7 +466,7 @@ :key="index" class="selected-item" > - {{ selectedItem.materialName }} - {{ selectedItem.voltage }} + {{ selectedItem.model }} , {{ selectedItem.specification }} , {{ selectedItem.voltLevel }}
@@ -412,52 +479,6 @@
- -
- - - - - - - - - - - - - -
-
- -
-
@@ -474,39 +495,41 @@ el: '#index-app', data() { return { + activeNames: ['2'], formLabelAlign: { - processingFee: '0.60', /*蒸汽费/钢丝铠装材料及加工费*/ - prodFinancialCost: '0.40', /*生产财务成本*/ - accountPeriod: '1.20', /*账期*/ - acceptance: '0.90', /*承兑*/ - companyMgmtCost: '1.50', /*公司管理成本*/ - bidServiceFee: '0.44', /*中标服务费*/ - netProfit: '3.00', /*公司净利润*/ - businessFee: '2.00', /*业务费*/ - province: '', /*省*/ - city: '', /*市*/ - district: '', /*区*/ - freight: '', /*运费*/ - canFloat: '', /*可下浮点数*/ - kilometers: '', /*公里数*/ - netWeightTotal: '', /*净重合计*/ - weightTotal: '', /*重量合计*/ - totalFactoryAmount: '', /*厂价金额合计*/ - totalActualAmount: '', /*实际金额合计*/ + officeExpense: 0.022, + travelExpense: 0.011, + salaryInsur: 0.394, + otherMgmtExpense: 0.373, + carExpense: 0.010, + mgmtBizEntFee:0.156, //管理-业务招待费 + mgmtDeprecExpense: 0.016, //管理-折旧费 + consultAuditFee: 0.026, //咨询审计费 + tenderCost: 0.023, //标书费用 + rentExpense: 0.052, //房租费 + salary: 0.239, //工资 + inspectFee: 0.016, //检验检测费 + transTravelExpense: 0.020, //交通与差旅费 + otherSalesExpense: 0.073, //其他销售费 + biddingCost: 0.134, //投标费用 + bizFee: 1.183, //销售-业务费 + salesBizEntFee: 0.098, //销售-业务招待费 + transpHandlingFee: 0.621, //运输装卸费 + manufDeprecExpense: 0.217, //制造-折旧费 + interestExpense: 0.436, //利息支出 + handlingFee: 0.108, //手续费 + discInterest: 0.363, //贴现利息 + otherFinExpenses: 0.197, //财务-其他费用 + invOpCost: 0.031, //存货机会成本 + tax: 1.5, //税金 + totalFinExpenses : 0, + totalFactoryAmount: 0, + totalActualAmount: 0, }, + materialData: [ ], - regionTableData: [], - price_0t_5t: '', - price_5t_10t: '', - price_10t_25t: '', - price_25t_100t: '', - price_100t: '', - dialogRegionVisible: false, - regionName: '', - regionCurrentPage: 1, - inventoryCurrentPage : 1, materialCurrentPage: 1, pageSize: 10, dialogMaterialVisible: false, @@ -516,35 +539,25 @@ precMaterialName: '', vagueMaterialName: '', vagueModel: '', - dialogInventoryVisible: false, - inventoryTableData: [], - clickedRowIndex: null, // 用于记录点击的行的索引 + validationErrors: [], // 用于存储验证错误信息的数组 } }, computed: { - getCurrentRegionData() { - const start = (this.regionCurrentPage - 1) * this.pageSize; - const end = start + this.pageSize; - return this.regionTableData.slice(start, end); - }, getCurrentMaterialData() { const start = (this.materialCurrentPage - 1) * this.pageSize; const end = start + this.pageSize; return this.materialTableData.slice(start, end); }, - getCurrentInventoryData() { - const start = (this.inventoryCurrentPage - 1) * this.pageSize; - const end = start + this.pageSize; - return this.inventoryTableData.slice(start, end); - }, }, created() { - this.getInventoryData(); + this.calculateTotal(); }, + mounted() { }, methods: { + async init () { }, @@ -559,67 +572,55 @@ } }, + calculateTotal() { + this.formLabelAlign.totalFinExpenses =parseFloat( + ( + parseFloat(this.formLabelAlign.officeExpense) + + parseFloat(this.formLabelAlign.travelExpense) + + parseFloat(this.formLabelAlign.salaryInsur) + + parseFloat(this.formLabelAlign.otherMgmtExpense) + + parseFloat(this.formLabelAlign.carExpense) + + parseFloat(this.formLabelAlign.mgmtBizEntFee) + + parseFloat(this.formLabelAlign.mgmtDeprecExpense) + + parseFloat(this.formLabelAlign.consultAuditFee) + + parseFloat(this.formLabelAlign.tenderCost) + + parseFloat(this.formLabelAlign.rentExpense) + + parseFloat(this.formLabelAlign.salary) + + parseFloat(this.formLabelAlign.inspectFee) + + parseFloat(this.formLabelAlign.transTravelExpense) + + parseFloat(this.formLabelAlign.otherSalesExpense) + + parseFloat(this.formLabelAlign.biddingCost) + + parseFloat(this.formLabelAlign.bizFee) + + parseFloat(this.formLabelAlign.salesBizEntFee) + + parseFloat(this.formLabelAlign.transpHandlingFee) + + parseFloat(this.formLabelAlign.manufDeprecExpense) + + parseFloat(this.formLabelAlign.interestExpense) + + parseFloat(this.formLabelAlign.handlingFee) + + parseFloat(this.formLabelAlign.discInterest) + + parseFloat(this.formLabelAlign.otherFinExpenses) + + parseFloat(this.formLabelAlign.invOpCost) + + parseFloat(this.formLabelAlign.tax) + ).toFixed(2)) + }, + handleDeleteClick(index){ this.materialData.splice(index, 1) }, - selectedRegion(){ - this.dialogRegionVisible = true; - }, - chooseRegion(row) { - this.dialogRegionVisible = false; - this.formLabelAlign.province = row.province - this.formLabelAlign.city = row.city - this.formLabelAlign.district = row.district - this.formLabelAlign.kilometers = row.kilometers - this.price_0t_5t = row.price01 - this.price_5t_10t = row.price02 - this.price_10t_25t = row.price03 - this.price_25t_100t = row.price04 - this.price_100t = row.price05 - }, - searchRegion(){ - if(this.regionName === ''){ - this.$message({ - message: '请输入你要查询的地区名称', - type: 'warning' - }); - }else{ - const params = { - regionName : this.regionName - } - console.log(params) - queryRegionListByName(params).then(res => { - console.log('queryRegionListByName') - this.regionTableData = res.data || [] - this.regionCurrentPage = 1; - }).catch(err => { - this.$message.error('请求出错了:' + err) - }) - } - }, - - handleRegionCurrentChange(val) { - this.currentPage = val; - }, handleMaterialCurrentChange(val) { this.currentPage = val; }, - handleInventoryCurrentChange(val) { - this.currentPage = val; - }, - addMaterial(){ this.dialogMaterialVisible = true; }, handleSelectionChange(selection) { selection.forEach(item => { // 判断是否已经存在于已选列表中,避免重复添加 - if (!this.selectedMaterialItems.some(selectedItem => selectedItem.materialName === item.materialName)) { + if (!this.selectedMaterialItems.some(selectedItem => selectedItem.uid === item.uid)) { this.selectedMaterialItems.push(item); } }); @@ -630,7 +631,7 @@ const isSelected = this.$refs.materialTable.selection.includes(selectedItem); // 从已选列表中移除该项 - const index = this.selectedMaterialItems.findIndex(item => item.materialName === selectedItem.materialName); + const index = this.selectedMaterialItems.findIndex(item => item.uid === selectedItem.uid); if (index !== -1) { this.selectedMaterialItems.splice(index, 1); } @@ -667,12 +668,11 @@ const params = { precMaterialName : this.precMaterialName, vagueMaterialName : this.vagueMaterialName, - vagueModel : this.vagueModel + vagueModel : this.vagueModel, } queryMaterialListByParam(params).then(res => { - this.materialTableData = res.data || [] - this.materialCurrentPage = 1; + this.materialTableData = res.data || []; }).catch(err => { this.$message.error('请求出错了:' + err) }) @@ -680,35 +680,90 @@ } }, - handleInventoryClick(row, index) { - this.clickedRowIndex = index; // 记录点击的行的索引 - this.dialogInventoryVisible = true; // 打开选择盘具的 dialog - }, - - getInventoryData() { - queryInventoryList().then(res => { - this.inventoryTableData = res.data || [] - }).catch(err => { - this.$message.error('请求出错了:' + err) - }) - }, - - chooseInventory(row) { - // 在选择盘具的逻辑中,将选择的盘具信息赋值给之前点击的行的数据 - if (this.clickedRowIndex !== null) { - // 假设选择盘具后的数据存储在 this.selectedInventory 中 - const updatedRow = { - inventory: row.inventory, // 盘具名称 - weighInv: row.weighInv, // 盘重信息 - }; - this.$set(this.materialData, this.clickedRowIndex, updatedRow); - } - this.dialogInventoryVisible = false; // 打开选择盘具的 dialog - // 其他逻辑 - }, - calculatedData() { + /**-------------计算财务总成本---------------**/ + this.calculateTotal(); + /**----------------------进行盘具、数量、人工、水电三个数值的验证---------------**/ + this.validationErrors = []; // 清空之前的错误信息 + this.materialData.forEach((row, index) => { + const wdFSurcharge = parseFloat(row.wdFSurcharge) || 0; // 如果为空,默认为0 + const laborCostFloat = parseFloat(row.laborCostFloat) || 0; // 如果为空,默认为0 + const hydroCostFloat = parseFloat(row.hydroCostFloat) || 0; // 如果为空,默认为0 + const quantity = parseFloat(row.number) || 0; // 如果为空,默认为0 + // 进行数量验证 + if (isNaN(quantity) || quantity < 0) { + this.validationErrors.push(`第 ${index + 1} 行数量不符合要求\n`); + } + // 进行盘具运费的验证 + if (isNaN(wdFSurcharge) || wdFSurcharge < 0) { + this.validationErrors.push(`第 ${index + 1} 行盘具运费上浮金额不符合要求`); + } + // 进行点数的验证 + if (isNaN(laborCostFloat) || laborCostFloat < 0 || laborCostFloat > 100) { + this.validationErrors.push(`第 ${index + 1} 行人工成本上浮点数不符合要求(应在 0 到 100 之间)`); + } + if (isNaN(hydroCostFloat) || hydroCostFloat < 0 || hydroCostFloat > 100) { + this.validationErrors.push(`第 ${index + 1} 行水电成本上浮点数不符合要求(应在 0 到 100 之间)`); + } + }); + /**-----------------------验证完成进行运算,验证结果通过才进行计算--------------------------**/ + if (this.validationErrors.length === 0) { + // 遍历表格数据进行计算 + this.materialData.forEach((row, index) => { + this.validationErrors = []; // 清空之前的错误信息 + + const redBookFacPrice = parseFloat(row.rbFacPrice); + const materialCost = parseFloat(row.matCostPrice); + const wdFSurcharge = parseFloat(row.wdFSurcharge) || 0; // 如果为空,默认为0 + const laborCostFloat = parseFloat(row.laborCostFloat) || 0; // 如果为空,默认为0 + const hydroCostFloat = parseFloat(row.hydroCostFloat) || 0; // 如果为空,默认为0 + const quantity = parseFloat(row.number) || 0; // 如果为空,默认为0 + + // 进行其他计算 + this.$set(this.materialData, index, { + ...row, + varRatio: ((redBookFacPrice - materialCost) / redBookFacPrice * 100).toFixed(2), + totalFacPrice: (quantity * redBookFacPrice).toFixed(2), + totalCost: ( + (materialCost + wdFSurcharge + + materialCost * (laborCostFloat / 100) + materialCost * (hydroCostFloat / 100)) * + quantity + ).toFixed(2), + }); + }); + } else { + this.$message({ + type: 'error', + dangerouslyUseHTMLString: true, + message: this.validationErrors.join('
') + }); + } + + + // 计算厂价金额合计 + const totalFactoryAmount = this.materialData.reduce((sum, row) => sum + parseFloat(row.totalFacPrice), 0); + this.formLabelAlign.totalFactoryAmount = totalFactoryAmount.toFixed(2); + + // 计算实际金额合计 + const totalCost = this.materialData.reduce((sum, row) => sum + parseFloat(row.totalCost), 0); + this.formLabelAlign.totalActualAmount = (totalCost + totalCost * (parseFloat(this.formLabelAlign.totalFinExpenses) / 100)).toFixed(2); + }, + + /**----------------表头表单验证-----------------**/ + validateInputRange(value) { + const number = parseFloat(value); + return isNaN(number) || (number >= 0 && number <= 100); + }, + validateAndSetDefault(model, field) { + if (!this.validateInputRange(model[field])) { + // 如果验证不通过,设置错误提示 + this.$message({ + type: 'error', + message: '填写错误,范围为0~100' + }); + this.$set(model, field, 0); + } }, }, diff --git a/src/main/resources/templates/zmquotation/index.html b/src/main/resources/templates/zmquotation/index.html index 57cddee..f14ece4 100644 --- a/src/main/resources/templates/zmquotation/index.html +++ b/src/main/resources/templates/zmquotation/index.html @@ -519,7 +519,6 @@ dialogInventoryVisible: false, inventoryTableData: [], clickedRowIndex: null, // 用于记录点击的行的索引 - materialTotalRows: 0, } }, computed: { diff --git a/target/JNDemo-1.0-SNAPSHOT.jar b/target/JNDemo-1.0-SNAPSHOT.jar index 30282fb..a82d093 100644 Binary files a/target/JNDemo-1.0-SNAPSHOT.jar and b/target/JNDemo-1.0-SNAPSHOT.jar differ diff --git a/target/JNDemo-1.0-SNAPSHOT.jar.original b/target/JNDemo-1.0-SNAPSHOT.jar.original index 15cd25e..e23eecd 100644 Binary files a/target/JNDemo-1.0-SNAPSHOT.jar.original and b/target/JNDemo-1.0-SNAPSHOT.jar.original differ diff --git a/target/classes/application-JN.yml b/target/classes/application-JN.yml index 14b6c9a..d9da96b 100644 --- a/target/classes/application-JN.yml +++ b/target/classes/application-JN.yml @@ -41,7 +41,7 @@ logging: mybatis-plus: configuration: #在映射实体或者属性时,将数据库中表名和字段名中的下划线去掉,按照驼峰命名法映射 - map-underscore-to-camel-case: true + map-underscore-to-camel-case: false log-impl: org.apache.ibatis.logging.stdout.StdOutImpl global-config: db-config: diff --git a/target/classes/com/JN/demo/jnzmquatation/controller/JNController.class b/target/classes/com/JN/demo/jnzmquatation/controller/JNController.class index 9174e6b..bf2091c 100644 Binary files a/target/classes/com/JN/demo/jnzmquatation/controller/JNController.class and b/target/classes/com/JN/demo/jnzmquatation/controller/JNController.class differ diff --git a/target/classes/com/JN/demo/jnzmquatation/dto/JnInventoryDto.class b/target/classes/com/JN/demo/jnzmquatation/dto/JnInventoryDto.class deleted file mode 100644 index e09c215..0000000 Binary files a/target/classes/com/JN/demo/jnzmquatation/dto/JnInventoryDto.class and /dev/null differ diff --git a/target/classes/com/JN/demo/jnzmquatation/dto/JnMaterialDto.class b/target/classes/com/JN/demo/jnzmquatation/dto/JnMaterialDto.class index 45867fb..ab6a085 100644 Binary files a/target/classes/com/JN/demo/jnzmquatation/dto/JnMaterialDto.class and b/target/classes/com/JN/demo/jnzmquatation/dto/JnMaterialDto.class differ diff --git a/target/classes/com/JN/demo/jnzmquatation/dto/JnRegionDto.class b/target/classes/com/JN/demo/jnzmquatation/dto/JnRegionDto.class deleted file mode 100644 index 003edf0..0000000 Binary files a/target/classes/com/JN/demo/jnzmquatation/dto/JnRegionDto.class and /dev/null differ diff --git a/target/classes/com/JN/demo/jnzmquatation/entity/MaterialEneity.class b/target/classes/com/JN/demo/jnzmquatation/entity/MaterialEneity.class new file mode 100644 index 0000000..8689475 Binary files /dev/null and b/target/classes/com/JN/demo/jnzmquatation/entity/MaterialEneity.class differ diff --git a/target/classes/com/JN/demo/jnzmquatation/mapper/JnInventoryMapper.class b/target/classes/com/JN/demo/jnzmquatation/mapper/JnInventoryMapper.class deleted file mode 100644 index 5bb34a3..0000000 Binary files a/target/classes/com/JN/demo/jnzmquatation/mapper/JnInventoryMapper.class and /dev/null differ diff --git a/target/classes/com/JN/demo/jnzmquatation/mapper/JnMaterialMapper.class b/target/classes/com/JN/demo/jnzmquatation/mapper/JnMaterialMapper.class index 7b1562c..c1056d3 100644 Binary files a/target/classes/com/JN/demo/jnzmquatation/mapper/JnMaterialMapper.class and b/target/classes/com/JN/demo/jnzmquatation/mapper/JnMaterialMapper.class differ diff --git a/target/classes/com/JN/demo/jnzmquatation/mapper/JnRegionMapper.class b/target/classes/com/JN/demo/jnzmquatation/mapper/JnRegionMapper.class deleted file mode 100644 index 0449dac..0000000 Binary files a/target/classes/com/JN/demo/jnzmquatation/mapper/JnRegionMapper.class and /dev/null differ diff --git a/target/classes/com/JN/demo/jnzmquatation/service/JnInventoryService.class b/target/classes/com/JN/demo/jnzmquatation/service/JnInventoryService.class deleted file mode 100644 index 57523f1..0000000 Binary files a/target/classes/com/JN/demo/jnzmquatation/service/JnInventoryService.class and /dev/null differ diff --git a/target/classes/com/JN/demo/jnzmquatation/service/JnRegionService.class b/target/classes/com/JN/demo/jnzmquatation/service/JnRegionService.class deleted file mode 100644 index 33198d1..0000000 Binary files a/target/classes/com/JN/demo/jnzmquatation/service/JnRegionService.class and /dev/null differ diff --git a/target/classes/com/JN/demo/jnzmquatation/service/impl/JnInventoryServiceImpl.class b/target/classes/com/JN/demo/jnzmquatation/service/impl/JnInventoryServiceImpl.class deleted file mode 100644 index 132ca29..0000000 Binary files a/target/classes/com/JN/demo/jnzmquatation/service/impl/JnInventoryServiceImpl.class and /dev/null differ diff --git a/target/classes/com/JN/demo/jnzmquatation/service/impl/JnRegionServiceImpl.class b/target/classes/com/JN/demo/jnzmquatation/service/impl/JnRegionServiceImpl.class deleted file mode 100644 index ed148af..0000000 Binary files a/target/classes/com/JN/demo/jnzmquatation/service/impl/JnRegionServiceImpl.class and /dev/null differ diff --git a/target/classes/static/jnquotation/css/index.css b/target/classes/static/jnquotation/css/index.css index 161c8f1..1a3ac16 100644 --- a/target/classes/static/jnquotation/css/index.css +++ b/target/classes/static/jnquotation/css/index.css @@ -47,7 +47,7 @@ font-size: 12px; } -.el-input-group{ +.form-box .el-input-group{ margin-top: 6px; } @@ -117,7 +117,7 @@ margin: 10px 80px 10px 0px; } -.form-box { +.collapse-box { background-color: #f0f0f0; /* 浅灰色背景 */ border-radius: 10px; /* 可以根据需要调整边框圆角 */ backdrop-filter: blur(10px); /* 调整模糊度 */ diff --git a/target/classes/static/jnquotation/js/index.js b/target/classes/static/jnquotation/js/index.js index 958ffd0..f2c231e 100644 --- a/target/classes/static/jnquotation/js/index.js +++ b/target/classes/static/jnquotation/js/index.js @@ -8,7 +8,7 @@ const queryRegionListByName = (params) => { const queryMaterialListByParam = (params) => { return $axios({ - url: '/zmquotation/materialList', + url: '/jnquotation/materialList', method: 'post', params }) diff --git a/target/classes/templates/jnquotation/index.html b/target/classes/templates/jnquotation/index.html index 1783496..6f0fa2d 100644 --- a/target/classes/templates/jnquotation/index.html +++ b/target/classes/templates/jnquotation/index.html @@ -15,145 +15,256 @@
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+
- 选择地区 添加物料 - 刷新界面 - + 计算数据
- - - + prop="prodCategory" + label="产品大类"> - - + prop="model" + label="型号"> + prop="specification" + label="规格"> + prop="voltLevel" + label="电压等级"> - - - + prop="measureUnit" + label="单位"> + prop="matCostPrice" + label="材料成本价格"> + + + + + + + + + width="180" + prop="varRatio" + label="差异比率"> + prop="wdFSurcharge" + label="盘具运费上浮金额"> + + + + + + + - -
- -
- - - - - 查询地区 - - -
-
- - - - - - - - - - - - - - - -
-
- -
-
- +
@@ -338,7 +405,7 @@
-
+
+ width="120" + prop="prodCategory" + label="产品大类"> + prop="measureUnit" + label="单位">
@@ -399,7 +466,7 @@ :key="index" class="selected-item" > - {{ selectedItem.materialName }} - {{ selectedItem.voltage }} + {{ selectedItem.model }} , {{ selectedItem.specification }} , {{ selectedItem.voltLevel }}
@@ -412,52 +479,6 @@
- -
- - - - - - - - - - - - - -
-
- -
-
@@ -474,39 +495,41 @@ el: '#index-app', data() { return { + activeNames: ['2'], formLabelAlign: { - processingFee: '0.60', /*蒸汽费/钢丝铠装材料及加工费*/ - prodFinancialCost: '0.40', /*生产财务成本*/ - accountPeriod: '1.20', /*账期*/ - acceptance: '0.90', /*承兑*/ - companyMgmtCost: '1.50', /*公司管理成本*/ - bidServiceFee: '0.44', /*中标服务费*/ - netProfit: '3.00', /*公司净利润*/ - businessFee: '2.00', /*业务费*/ - province: '', /*省*/ - city: '', /*市*/ - district: '', /*区*/ - freight: '', /*运费*/ - canFloat: '', /*可下浮点数*/ - kilometers: '', /*公里数*/ - netWeightTotal: '', /*净重合计*/ - weightTotal: '', /*重量合计*/ - totalFactoryAmount: '', /*厂价金额合计*/ - totalActualAmount: '', /*实际金额合计*/ + officeExpense: 0.022, + travelExpense: 0.011, + salaryInsur: 0.394, + otherMgmtExpense: 0.373, + carExpense: 0.010, + mgmtBizEntFee:0.156, //管理-业务招待费 + mgmtDeprecExpense: 0.016, //管理-折旧费 + consultAuditFee: 0.026, //咨询审计费 + tenderCost: 0.023, //标书费用 + rentExpense: 0.052, //房租费 + salary: 0.239, //工资 + inspectFee: 0.016, //检验检测费 + transTravelExpense: 0.020, //交通与差旅费 + otherSalesExpense: 0.073, //其他销售费 + biddingCost: 0.134, //投标费用 + bizFee: 1.183, //销售-业务费 + salesBizEntFee: 0.098, //销售-业务招待费 + transpHandlingFee: 0.621, //运输装卸费 + manufDeprecExpense: 0.217, //制造-折旧费 + interestExpense: 0.436, //利息支出 + handlingFee: 0.108, //手续费 + discInterest: 0.363, //贴现利息 + otherFinExpenses: 0.197, //财务-其他费用 + invOpCost: 0.031, //存货机会成本 + tax: 1.5, //税金 + totalFinExpenses : 0, + totalFactoryAmount: 0, + totalActualAmount: 0, }, + materialData: [ ], - regionTableData: [], - price_0t_5t: '', - price_5t_10t: '', - price_10t_25t: '', - price_25t_100t: '', - price_100t: '', - dialogRegionVisible: false, - regionName: '', - regionCurrentPage: 1, - inventoryCurrentPage : 1, materialCurrentPage: 1, pageSize: 10, dialogMaterialVisible: false, @@ -516,35 +539,25 @@ precMaterialName: '', vagueMaterialName: '', vagueModel: '', - dialogInventoryVisible: false, - inventoryTableData: [], - clickedRowIndex: null, // 用于记录点击的行的索引 + validationErrors: [], // 用于存储验证错误信息的数组 } }, computed: { - getCurrentRegionData() { - const start = (this.regionCurrentPage - 1) * this.pageSize; - const end = start + this.pageSize; - return this.regionTableData.slice(start, end); - }, getCurrentMaterialData() { const start = (this.materialCurrentPage - 1) * this.pageSize; const end = start + this.pageSize; return this.materialTableData.slice(start, end); }, - getCurrentInventoryData() { - const start = (this.inventoryCurrentPage - 1) * this.pageSize; - const end = start + this.pageSize; - return this.inventoryTableData.slice(start, end); - }, }, created() { - this.getInventoryData(); + this.calculateTotal(); }, + mounted() { }, methods: { + async init () { }, @@ -559,67 +572,55 @@ } }, + calculateTotal() { + this.formLabelAlign.totalFinExpenses =parseFloat( + ( + parseFloat(this.formLabelAlign.officeExpense) + + parseFloat(this.formLabelAlign.travelExpense) + + parseFloat(this.formLabelAlign.salaryInsur) + + parseFloat(this.formLabelAlign.otherMgmtExpense) + + parseFloat(this.formLabelAlign.carExpense) + + parseFloat(this.formLabelAlign.mgmtBizEntFee) + + parseFloat(this.formLabelAlign.mgmtDeprecExpense) + + parseFloat(this.formLabelAlign.consultAuditFee) + + parseFloat(this.formLabelAlign.tenderCost) + + parseFloat(this.formLabelAlign.rentExpense) + + parseFloat(this.formLabelAlign.salary) + + parseFloat(this.formLabelAlign.inspectFee) + + parseFloat(this.formLabelAlign.transTravelExpense) + + parseFloat(this.formLabelAlign.otherSalesExpense) + + parseFloat(this.formLabelAlign.biddingCost) + + parseFloat(this.formLabelAlign.bizFee) + + parseFloat(this.formLabelAlign.salesBizEntFee) + + parseFloat(this.formLabelAlign.transpHandlingFee) + + parseFloat(this.formLabelAlign.manufDeprecExpense) + + parseFloat(this.formLabelAlign.interestExpense) + + parseFloat(this.formLabelAlign.handlingFee) + + parseFloat(this.formLabelAlign.discInterest) + + parseFloat(this.formLabelAlign.otherFinExpenses) + + parseFloat(this.formLabelAlign.invOpCost) + + parseFloat(this.formLabelAlign.tax) + ).toFixed(2)) + }, + handleDeleteClick(index){ this.materialData.splice(index, 1) }, - selectedRegion(){ - this.dialogRegionVisible = true; - }, - chooseRegion(row) { - this.dialogRegionVisible = false; - this.formLabelAlign.province = row.province - this.formLabelAlign.city = row.city - this.formLabelAlign.district = row.district - this.formLabelAlign.kilometers = row.kilometers - this.price_0t_5t = row.price01 - this.price_5t_10t = row.price02 - this.price_10t_25t = row.price03 - this.price_25t_100t = row.price04 - this.price_100t = row.price05 - }, - searchRegion(){ - if(this.regionName === ''){ - this.$message({ - message: '请输入你要查询的地区名称', - type: 'warning' - }); - }else{ - const params = { - regionName : this.regionName - } - console.log(params) - queryRegionListByName(params).then(res => { - console.log('queryRegionListByName') - this.regionTableData = res.data || [] - this.regionCurrentPage = 1; - }).catch(err => { - this.$message.error('请求出错了:' + err) - }) - } - }, - - handleRegionCurrentChange(val) { - this.currentPage = val; - }, handleMaterialCurrentChange(val) { this.currentPage = val; }, - handleInventoryCurrentChange(val) { - this.currentPage = val; - }, - addMaterial(){ this.dialogMaterialVisible = true; }, handleSelectionChange(selection) { selection.forEach(item => { // 判断是否已经存在于已选列表中,避免重复添加 - if (!this.selectedMaterialItems.some(selectedItem => selectedItem.materialName === item.materialName)) { + if (!this.selectedMaterialItems.some(selectedItem => selectedItem.uid === item.uid)) { this.selectedMaterialItems.push(item); } }); @@ -630,7 +631,7 @@ const isSelected = this.$refs.materialTable.selection.includes(selectedItem); // 从已选列表中移除该项 - const index = this.selectedMaterialItems.findIndex(item => item.materialName === selectedItem.materialName); + const index = this.selectedMaterialItems.findIndex(item => item.uid === selectedItem.uid); if (index !== -1) { this.selectedMaterialItems.splice(index, 1); } @@ -667,12 +668,11 @@ const params = { precMaterialName : this.precMaterialName, vagueMaterialName : this.vagueMaterialName, - vagueModel : this.vagueModel + vagueModel : this.vagueModel, } queryMaterialListByParam(params).then(res => { - this.materialTableData = res.data || [] - this.materialCurrentPage = 1; + this.materialTableData = res.data || []; }).catch(err => { this.$message.error('请求出错了:' + err) }) @@ -680,35 +680,90 @@ } }, - handleInventoryClick(row, index) { - this.clickedRowIndex = index; // 记录点击的行的索引 - this.dialogInventoryVisible = true; // 打开选择盘具的 dialog - }, - - getInventoryData() { - queryInventoryList().then(res => { - this.inventoryTableData = res.data || [] - }).catch(err => { - this.$message.error('请求出错了:' + err) - }) - }, - - chooseInventory(row) { - // 在选择盘具的逻辑中,将选择的盘具信息赋值给之前点击的行的数据 - if (this.clickedRowIndex !== null) { - // 假设选择盘具后的数据存储在 this.selectedInventory 中 - const updatedRow = { - inventory: row.inventory, // 盘具名称 - weighInv: row.weighInv, // 盘重信息 - }; - this.$set(this.materialData, this.clickedRowIndex, updatedRow); - } - this.dialogInventoryVisible = false; // 打开选择盘具的 dialog - // 其他逻辑 - }, - calculatedData() { + /**-------------计算财务总成本---------------**/ + this.calculateTotal(); + /**----------------------进行盘具、数量、人工、水电三个数值的验证---------------**/ + this.validationErrors = []; // 清空之前的错误信息 + this.materialData.forEach((row, index) => { + const wdFSurcharge = parseFloat(row.wdFSurcharge) || 0; // 如果为空,默认为0 + const laborCostFloat = parseFloat(row.laborCostFloat) || 0; // 如果为空,默认为0 + const hydroCostFloat = parseFloat(row.hydroCostFloat) || 0; // 如果为空,默认为0 + const quantity = parseFloat(row.number) || 0; // 如果为空,默认为0 + // 进行数量验证 + if (isNaN(quantity) || quantity < 0) { + this.validationErrors.push(`第 ${index + 1} 行数量不符合要求\n`); + } + // 进行盘具运费的验证 + if (isNaN(wdFSurcharge) || wdFSurcharge < 0) { + this.validationErrors.push(`第 ${index + 1} 行盘具运费上浮金额不符合要求`); + } + // 进行点数的验证 + if (isNaN(laborCostFloat) || laborCostFloat < 0 || laborCostFloat > 100) { + this.validationErrors.push(`第 ${index + 1} 行人工成本上浮点数不符合要求(应在 0 到 100 之间)`); + } + if (isNaN(hydroCostFloat) || hydroCostFloat < 0 || hydroCostFloat > 100) { + this.validationErrors.push(`第 ${index + 1} 行水电成本上浮点数不符合要求(应在 0 到 100 之间)`); + } + }); + /**-----------------------验证完成进行运算,验证结果通过才进行计算--------------------------**/ + if (this.validationErrors.length === 0) { + // 遍历表格数据进行计算 + this.materialData.forEach((row, index) => { + this.validationErrors = []; // 清空之前的错误信息 + + const redBookFacPrice = parseFloat(row.rbFacPrice); + const materialCost = parseFloat(row.matCostPrice); + const wdFSurcharge = parseFloat(row.wdFSurcharge) || 0; // 如果为空,默认为0 + const laborCostFloat = parseFloat(row.laborCostFloat) || 0; // 如果为空,默认为0 + const hydroCostFloat = parseFloat(row.hydroCostFloat) || 0; // 如果为空,默认为0 + const quantity = parseFloat(row.number) || 0; // 如果为空,默认为0 + + // 进行其他计算 + this.$set(this.materialData, index, { + ...row, + varRatio: ((redBookFacPrice - materialCost) / redBookFacPrice * 100).toFixed(2), + totalFacPrice: (quantity * redBookFacPrice).toFixed(2), + totalCost: ( + (materialCost + wdFSurcharge + + materialCost * (laborCostFloat / 100) + materialCost * (hydroCostFloat / 100)) * + quantity + ).toFixed(2), + }); + }); + } else { + this.$message({ + type: 'error', + dangerouslyUseHTMLString: true, + message: this.validationErrors.join('
') + }); + } + + + // 计算厂价金额合计 + const totalFactoryAmount = this.materialData.reduce((sum, row) => sum + parseFloat(row.totalFacPrice), 0); + this.formLabelAlign.totalFactoryAmount = totalFactoryAmount.toFixed(2); + + // 计算实际金额合计 + const totalCost = this.materialData.reduce((sum, row) => sum + parseFloat(row.totalCost), 0); + this.formLabelAlign.totalActualAmount = (totalCost + totalCost * (parseFloat(this.formLabelAlign.totalFinExpenses) / 100)).toFixed(2); + }, + + /**----------------表头表单验证-----------------**/ + validateInputRange(value) { + const number = parseFloat(value); + return isNaN(number) || (number >= 0 && number <= 100); + }, + validateAndSetDefault(model, field) { + if (!this.validateInputRange(model[field])) { + // 如果验证不通过,设置错误提示 + this.$message({ + type: 'error', + message: '填写错误,范围为0~100' + }); + this.$set(model, field, 0); + } }, }, diff --git a/target/classes/templates/zmquotation/index.html b/target/classes/templates/zmquotation/index.html index 57cddee..f14ece4 100644 --- a/target/classes/templates/zmquotation/index.html +++ b/target/classes/templates/zmquotation/index.html @@ -519,7 +519,6 @@ dialogInventoryVisible: false, inventoryTableData: [], clickedRowIndex: null, // 用于记录点击的行的索引 - materialTotalRows: 0, } }, computed: { diff --git a/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst index 9e26764..d11a9a8 100644 --- a/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst +++ b/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -1,56 +1,56 @@ -E:\myproject\JNDemo\src\main\java\com\JN\demo\jnzmquatation\service\impl\JnMaterialServiceImpl.java -E:\myproject\JNDemo\src\main\java\com\JN\demo\jnzmquatation\service\JnMaterialService.java -E:\myproject\JNDemo\src\main\java\com\JN\demo\jnzmquatation\dto\JnInventoryDto.java -E:\myproject\JNDemo\src\main\java\com\JN\demo\bizquery\controller\BizQccController.java -E:\myproject\JNDemo\src\main\java\com\JN\demo\bizquery\service\BizService.java -E:\myproject\JNDemo\src\main\java\com\JN\demo\zmquotation\mapper\RegionMapper.java -E:\myproject\JNDemo\src\main\java\com\JN\mapper\EmployeeMapper.java -E:\myproject\JNDemo\src\main\java\com\JN\demo\jnzmquatation\dto\JnRegionDto.java -E:\myproject\JNDemo\src\main\java\com\JN\filter\LoginCheckFilter.java -E:\myproject\JNDemo\src\main\java\com\JN\config\MybatisPlusConfig.java -E:\myproject\JNDemo\src\main\java\com\JN\demo\jnzmquatation\mapper\JnInventoryMapper.java -E:\myproject\JNDemo\src\main\java\com\JN\utils\JSONHelper.java -E:\myproject\JNDemo\src\main\java\com\JN\controller\PageRedirectController.java -E:\myproject\JNDemo\src\main\java\com\JN\demo\zmquotation\dto\InventoryDto.java -E:\myproject\JNDemo\src\main\java\com\JN\demo\jnzmquatation\service\JnRegionService.java -E:\myproject\JNDemo\src\main\java\com\JN\demo\zmquotation\service\InventoryService.java -E:\myproject\JNDemo\src\main\java\com\JN\demo\zmquotation\dto\RegionDto.java -E:\myproject\JNDemo\src\main\java\com\JN\demo\bizquery\mapper\BizMapper.java -E:\myproject\JNDemo\src\main\java\com\JN\demo\zmquotation\service\MaterialService.java -E:\myproject\JNDemo\src\main\java\com\JN\API\qichacha\QccApiUntils.java -E:\myproject\JNDemo\src\main\java\com\JN\demo\zmquotation\service\impl\MaterialServiceImpl.java -E:\myproject\JNDemo\src\main\java\com\JN\demo\bizquery\service\QccInfoService.java -E:\myproject\JNDemo\src\main\java\com\JN\demo\bizquery\mapper\QccInfoMapper.java -E:\myproject\JNDemo\src\main\java\com\JN\demo\jnzmquatation\controller\JNController.java -E:\myproject\JNDemo\src\main\java\com\JN\JNApplication.java -E:\myproject\JNDemo\src\main\java\com\JN\demo\zmquotation\mapper\InventoryMapper.java -E:\myproject\JNDemo\src\main\java\com\JN\demo\zmquotation\service\RegionService.java -E:\myproject\JNDemo\src\main\java\com\JN\demo\bizquery\dto\BizDto.java -E:\myproject\JNDemo\src\main\java\com\JN\demo\jnzmquatation\mapper\JnRegionMapper.java -E:\myproject\JNDemo\src\main\java\com\JN\config\WebMvcConfig.java -E:\myproject\JNDemo\src\main\java\com\JN\demo\bizquery\controller\BizController.java -E:\myproject\JNDemo\src\main\java\com\JN\demo\bizquery\service\impl\BizServiceImpl.java -E:\myproject\JNDemo\src\main\java\com\JN\demo\bizquery\entity\QccInfo.java -E:\myproject\JNDemo\src\main\java\com\JN\demo\jnzmquatation\service\impl\JnRegionServiceImpl.java -E:\myproject\JNDemo\src\main\java\com\JN\common\CustomException.java -E:\myproject\JNDemo\src\main\java\com\JN\common\JacksonObjectMapper.java -E:\myproject\JNDemo\src\main\java\com\JN\demo\jnzmquatation\dto\JnMaterialDto.java -E:\myproject\JNDemo\src\main\java\com\JN\utils\HttpHelper.java -E:\myproject\JNDemo\src\main\java\com\JN\utils\StringUtils.java -E:\myproject\JNDemo\src\main\java\com\JN\utils\SMSUtils.java -E:\myproject\JNDemo\src\main\java\com\JN\demo\jnzmquatation\service\impl\JnInventoryServiceImpl.java -E:\myproject\JNDemo\src\main\java\com\JN\demo\bizquery\service\impl\QccInfoServiceImpl.java -E:\myproject\JNDemo\src\main\java\com\JN\demo\jnzmquatation\service\JnInventoryService.java -E:\myproject\JNDemo\src\main\java\com\JN\service\EmployeeService.java -E:\myproject\JNDemo\src\main\java\com\JN\demo\zmquotation\service\impl\InventoryServiceImpl.java -E:\myproject\JNDemo\src\main\java\com\JN\common\GlobalExceptionHandler.java -E:\myproject\JNDemo\src\main\java\com\JN\demo\zmquotation\controller\ZMController.java -E:\myproject\JNDemo\src\main\java\com\JN\service\impl\EmployeeServiceImpl.java -E:\myproject\JNDemo\src\main\java\com\JN\common\BaseContext.java -E:\myproject\JNDemo\src\main\java\com\JN\common\R.java -E:\myproject\JNDemo\src\main\java\com\JN\demo\jnzmquatation\mapper\JnMaterialMapper.java -E:\myproject\JNDemo\src\main\java\com\JN\demo\zmquotation\mapper\MaterialMapper.java -E:\myproject\JNDemo\src\main\java\com\JN\demo\zmquotation\service\impl\RegionServiceImpl.java -E:\myproject\JNDemo\src\main\java\com\JN\demo\zmquotation\dto\MaterialDto.java -E:\myproject\JNDemo\src\main\java\com\JN\utils\ValidateCodeUtils.java -E:\myproject\JNDemo\src\main\java\com\JN\common\MyMetaObjecthandler.java +D:\JavaProject\JNDemo\src\main\java\com\JN\demo\jnzmquatation\dto\JnInventoryDto.java +D:\JavaProject\JNDemo\src\main\java\com\JN\demo\zmquotation\service\impl\MaterialServiceImpl.java +D:\JavaProject\JNDemo\src\main\java\com\JN\demo\bizquery\dto\BizDto.java +D:\JavaProject\JNDemo\src\main\java\com\JN\utils\SMSUtils.java +D:\JavaProject\JNDemo\src\main\java\com\JN\demo\zmquotation\controller\ZMController.java +D:\JavaProject\JNDemo\src\main\java\com\JN\API\qichacha\QccApiUntils.java +D:\JavaProject\JNDemo\src\main\java\com\JN\utils\JSONHelper.java +D:\JavaProject\JNDemo\src\main\java\com\JN\config\WebMvcConfig.java +D:\JavaProject\JNDemo\src\main\java\com\JN\common\JacksonObjectMapper.java +D:\JavaProject\JNDemo\src\main\java\com\JN\demo\jnzmquatation\service\JnMaterialService.java +D:\JavaProject\JNDemo\src\main\java\com\JN\common\CustomException.java +D:\JavaProject\JNDemo\src\main\java\com\JN\demo\zmquotation\service\RegionService.java +D:\JavaProject\JNDemo\src\main\java\com\JN\demo\zmquotation\dto\MaterialDto.java +D:\JavaProject\JNDemo\src\main\java\com\JN\demo\zmquotation\mapper\InventoryMapper.java +D:\JavaProject\JNDemo\src\main\java\com\JN\utils\StringUtils.java +D:\JavaProject\JNDemo\src\main\java\com\JN\demo\jnzmquatation\service\impl\JnMaterialServiceImpl.java +D:\JavaProject\JNDemo\src\main\java\com\JN\common\R.java +D:\JavaProject\JNDemo\src\main\java\com\JN\demo\bizquery\entity\QccInfo.java +D:\JavaProject\JNDemo\src\main\java\com\JN\demo\zmquotation\mapper\MaterialMapper.java +D:\JavaProject\JNDemo\src\main\java\com\JN\config\MybatisPlusConfig.java +D:\JavaProject\JNDemo\src\main\java\com\JN\common\BaseContext.java +D:\JavaProject\JNDemo\src\main\java\com\JN\demo\jnzmquatation\mapper\JnInventoryMapper.java +D:\JavaProject\JNDemo\src\main\java\com\JN\demo\jnzmquatation\dto\JnMaterialDto.java +D:\JavaProject\JNDemo\src\main\java\com\JN\controller\PageRedirectController.java +D:\JavaProject\JNDemo\src\main\java\com\JN\demo\zmquotation\service\impl\RegionServiceImpl.java +D:\JavaProject\JNDemo\src\main\java\com\JN\demo\bizquery\controller\BizQccController.java +D:\JavaProject\JNDemo\src\main\java\com\JN\utils\HttpHelper.java +D:\JavaProject\JNDemo\src\main\java\com\JN\demo\jnzmquatation\service\JnInventoryService.java +D:\JavaProject\JNDemo\src\main\java\com\JN\service\EmployeeService.java +D:\JavaProject\JNDemo\src\main\java\com\JN\JNApplication.java +D:\JavaProject\JNDemo\src\main\java\com\JN\demo\jnzmquatation\service\JnRegionService.java +D:\JavaProject\JNDemo\src\main\java\com\JN\demo\zmquotation\dto\InventoryDto.java +D:\JavaProject\JNDemo\src\main\java\com\JN\common\MyMetaObjecthandler.java +D:\JavaProject\JNDemo\src\main\java\com\JN\filter\LoginCheckFilter.java +D:\JavaProject\JNDemo\src\main\java\com\JN\demo\jnzmquatation\mapper\JnMaterialMapper.java +D:\JavaProject\JNDemo\src\main\java\com\JN\demo\bizquery\service\QccInfoService.java +D:\JavaProject\JNDemo\src\main\java\com\JN\demo\bizquery\service\impl\BizServiceImpl.java +D:\JavaProject\JNDemo\src\main\java\com\JN\demo\jnzmquatation\service\impl\JnInventoryServiceImpl.java +D:\JavaProject\JNDemo\src\main\java\com\JN\demo\bizquery\mapper\QccInfoMapper.java +D:\JavaProject\JNDemo\src\main\java\com\JN\mapper\EmployeeMapper.java +D:\JavaProject\JNDemo\src\main\java\com\JN\demo\jnzmquatation\controller\JNController.java +D:\JavaProject\JNDemo\src\main\java\com\JN\demo\zmquotation\dto\RegionDto.java +D:\JavaProject\JNDemo\src\main\java\com\JN\service\impl\EmployeeServiceImpl.java +D:\JavaProject\JNDemo\src\main\java\com\JN\demo\bizquery\service\impl\QccInfoServiceImpl.java +D:\JavaProject\JNDemo\src\main\java\com\JN\demo\zmquotation\service\impl\InventoryServiceImpl.java +D:\JavaProject\JNDemo\src\main\java\com\JN\utils\ValidateCodeUtils.java +D:\JavaProject\JNDemo\src\main\java\com\JN\demo\jnzmquatation\dto\JnRegionDto.java +D:\JavaProject\JNDemo\src\main\java\com\JN\demo\jnzmquatation\mapper\JnRegionMapper.java +D:\JavaProject\JNDemo\src\main\java\com\JN\demo\bizquery\controller\BizController.java +D:\JavaProject\JNDemo\src\main\java\com\JN\demo\bizquery\service\BizService.java +D:\JavaProject\JNDemo\src\main\java\com\JN\demo\bizquery\mapper\BizMapper.java +D:\JavaProject\JNDemo\src\main\java\com\JN\common\GlobalExceptionHandler.java +D:\JavaProject\JNDemo\src\main\java\com\JN\demo\jnzmquatation\service\impl\JnRegionServiceImpl.java +D:\JavaProject\JNDemo\src\main\java\com\JN\demo\zmquotation\service\InventoryService.java +D:\JavaProject\JNDemo\src\main\java\com\JN\demo\zmquotation\service\MaterialService.java +D:\JavaProject\JNDemo\src\main\java\com\JN\demo\zmquotation\mapper\RegionMapper.java diff --git a/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst b/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst new file mode 100644 index 0000000..e69de29 diff --git a/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst b/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst new file mode 100644 index 0000000..e69de29