优化
This commit is contained in:
@@ -44,6 +44,14 @@ public class PerformancemstController {
|
|||||||
return new ResponseEntity<>(performancemstService.queryAll(whereJson,page),HttpStatus.OK);
|
return new ResponseEntity<>(performancemstService.queryAll(whereJson,page),HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/query2")
|
||||||
|
@Log("查询工作量汇报")
|
||||||
|
@ApiOperation("查询工作量汇报")
|
||||||
|
//@PreAuthorize("@el.check('performancemst:list')")
|
||||||
|
public ResponseEntity<Object> query2(@RequestParam Map whereJson, Pageable page){
|
||||||
|
return new ResponseEntity<>(performancemstService.queryAll2(whereJson,page),HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
@GetMapping("/workloadstat")
|
@GetMapping("/workloadstat")
|
||||||
@Log("工作量统计数据")
|
@Log("工作量统计数据")
|
||||||
@ApiOperation("工作量统计数据")
|
@ApiOperation("工作量统计数据")
|
||||||
|
|||||||
@@ -24,6 +24,13 @@ public interface PerformancemstService {
|
|||||||
* @return Map<String,Object>
|
* @return Map<String,Object>
|
||||||
*/
|
*/
|
||||||
Map<String,Object> queryAll(Map whereJson, Pageable page);
|
Map<String,Object> queryAll(Map whereJson, Pageable page);
|
||||||
|
/**
|
||||||
|
* 查询数据分页
|
||||||
|
* @param whereJson 条件
|
||||||
|
* @param page 分页参数
|
||||||
|
* @return Map<String,Object>
|
||||||
|
*/
|
||||||
|
Map<String,Object> queryAll2(Map whereJson, Pageable page);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询所有数据不分页
|
* 查询所有数据不分页
|
||||||
|
|||||||
@@ -61,6 +61,20 @@ public class PerformancemstServiceImpl implements PerformancemstService {
|
|||||||
return json;
|
return json;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> queryAll2(Map whereJson, Pageable page) {
|
||||||
|
String assessor_id = (String) whereJson.get("assessor_id");
|
||||||
|
String assessor_date = (String) whereJson.get("assessor_date");
|
||||||
|
HashMap<String, String> map = new HashMap<>();
|
||||||
|
map.put("flag", "1");
|
||||||
|
if (ObjectUtil.isNotEmpty(assessor_id)) {
|
||||||
|
map.put("assessor_id", "%" + assessor_id + "%");
|
||||||
|
}
|
||||||
|
map.put("assessor_date", assessor_date);
|
||||||
|
JSONObject json = WQL.getWO("QL_TEST_PERFORMANCEMST01").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "mst.update_time desc");
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<PerformancemstDto> queryAll(Map whereJson) {
|
public List<PerformancemstDto> queryAll(Map whereJson) {
|
||||||
WQLObject wo = WQLObject.getWQLObject("ql_test_performancemst");
|
WQLObject wo = WQLObject.getWQLObject("ql_test_performancemst");
|
||||||
@@ -126,6 +140,7 @@ public class PerformancemstServiceImpl implements PerformancemstService {
|
|||||||
jsonDtl.put("item_name", json.getString("item_name"));
|
jsonDtl.put("item_name", json.getString("item_name"));
|
||||||
if (ObjectUtil.isEmpty(json.getString("workload"))) throw new BadRequestException("工作量不能为空!");
|
if (ObjectUtil.isEmpty(json.getString("workload"))) throw new BadRequestException("工作量不能为空!");
|
||||||
jsonDtl.put("workload", json.getString("workload"));
|
jsonDtl.put("workload", json.getString("workload"));
|
||||||
|
jsonDtl.put("workload_audit", json.getString("workload_audit"));
|
||||||
//算出每行的分数
|
//算出每行的分数
|
||||||
BigDecimal num = NumberUtil.mul(json.getString("single_score"), json.getString("workload"));
|
BigDecimal num = NumberUtil.mul(json.getString("single_score"), json.getString("workload"));
|
||||||
jsonDtl.put("score", NumberUtil.round(num, 2));
|
jsonDtl.put("score", NumberUtil.round(num, 2));
|
||||||
@@ -171,6 +186,7 @@ public class PerformancemstServiceImpl implements PerformancemstService {
|
|||||||
jsonDtl.put("item_name", json.getString("item_name"));
|
jsonDtl.put("item_name", json.getString("item_name"));
|
||||||
if (ObjectUtil.isEmpty(json.getString("workload"))) throw new BadRequestException("工作量不能为空!");
|
if (ObjectUtil.isEmpty(json.getString("workload"))) throw new BadRequestException("工作量不能为空!");
|
||||||
jsonDtl.put("workload", json.getString("workload"));
|
jsonDtl.put("workload", json.getString("workload"));
|
||||||
|
jsonDtl.put("workload_audit", json.getString("workload_audit"));
|
||||||
//算出每行的分数
|
//算出每行的分数
|
||||||
BigDecimal num = NumberUtil.mul(json.getString("single_score"), json.getString("workload"));
|
BigDecimal num = NumberUtil.mul(json.getString("single_score"), json.getString("workload"));
|
||||||
jsonDtl.put("score", NumberUtil.round(num, 2));
|
jsonDtl.put("score", NumberUtil.round(num, 2));
|
||||||
@@ -186,6 +202,7 @@ public class PerformancemstServiceImpl implements PerformancemstService {
|
|||||||
String now = DateUtil.now();
|
String now = DateUtil.now();
|
||||||
|
|
||||||
WQLObject wo = WQLObject.getWQLObject("ql_test_performancemst");
|
WQLObject wo = WQLObject.getWQLObject("ql_test_performancemst");
|
||||||
|
WQLObject ql_test_performancedtl = WQLObject.getWQLObject("ql_test_performancedtl");
|
||||||
for (Long performance_id : ids) {
|
for (Long performance_id : ids) {
|
||||||
JSONObject param = new JSONObject();
|
JSONObject param = new JSONObject();
|
||||||
param.put("performance_id", String.valueOf(performance_id));
|
param.put("performance_id", String.valueOf(performance_id));
|
||||||
@@ -194,6 +211,7 @@ public class PerformancemstServiceImpl implements PerformancemstService {
|
|||||||
param.put("update_optname", nickName);
|
param.put("update_optname", nickName);
|
||||||
param.put("update_time", now);
|
param.put("update_time", now);
|
||||||
wo.update(param);
|
wo.update(param);
|
||||||
|
ql_test_performancedtl.delete("performance_id='"+String.valueOf(performance_id)+"'");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -219,7 +219,7 @@
|
|||||||
IF 输入.flag = "9"
|
IF 输入.flag = "9"
|
||||||
QUERY
|
QUERY
|
||||||
SELECT
|
SELECT
|
||||||
sum (IFNULL(dtl.workload,0)) AS num,
|
sum (IFNULL(dtl.workload_audit,0)) AS num,
|
||||||
mst.assessor_id
|
mst.assessor_id
|
||||||
FROM
|
FROM
|
||||||
QL_TEST_PerformanceMst mst
|
QL_TEST_PerformanceMst mst
|
||||||
|
|||||||
Binary file not shown.
@@ -493,6 +493,28 @@ public class ReceivemstServiceImpl implements ReceivemstService {
|
|||||||
}
|
}
|
||||||
JSONObject jsonFactMst = factMstTab.query("material_id = '" + material_id + "' and pcsn = '" + pcsn + "' and is_delete = '0'").uniqueResult(0);
|
JSONObject jsonFactMst = factMstTab.query("material_id = '" + material_id + "' and pcsn = '" + pcsn + "' and is_delete = '0'").uniqueResult(0);
|
||||||
|
|
||||||
|
if (ObjectUtil.isEmpty(jsonMst)) {
|
||||||
|
//插入质检单
|
||||||
|
HashMap<Object, Object> param = new HashMap<>();
|
||||||
|
param.put("material_id", String.valueOf(material_id));
|
||||||
|
boolean is_YL = materialBaseService.isAlongMaterType(MaterOptTypeEnum.YL.getCode(), material_id, null);
|
||||||
|
boolean is_FL = materialBaseService.isAlongMaterType(MaterOptTypeEnum.FL.getCode(), material_id, null);
|
||||||
|
boolean is_BCP = materialBaseService.isAlongMaterType(MaterOptTypeEnum.BCP.getCode(), material_id, null);
|
||||||
|
if (is_YL) param.put("inspection_type", "10");
|
||||||
|
if (is_FL) param.put("inspection_type", "20");
|
||||||
|
if (is_BCP) param.put("inspection_type", "30");
|
||||||
|
param.put("pcsn", MapUtil.getStr(whereJson, "pcsn"));
|
||||||
|
param.put("source_bill_id", MapUtil.getStr(whereJson, "receivedtl_id"));
|
||||||
|
param.put("source_bill_code", MapUtil.getStr(whereJson, "receive_code"));
|
||||||
|
param.put("source_bill_type", MapUtil.getStr(whereJson, "receive_type"));
|
||||||
|
param.put("source_bill_table", "PCS_RC_ReceiveDtl");
|
||||||
|
param.put("source_bill_table_pk", "");
|
||||||
|
param.put("base_bill_id", jsonReMst.get("source_id"));
|
||||||
|
param.put("base_bill_type", jsonReMst.get("source_type"));
|
||||||
|
inspectionsheetmstService.create(param);
|
||||||
|
}else{
|
||||||
|
throw new BadRequestException("质检单已存在,不允许重复插入!");
|
||||||
|
}
|
||||||
if (ObjectUtil.isEmpty(jsonFactMst)) {
|
if (ObjectUtil.isEmpty(jsonFactMst)) {
|
||||||
JSONObject jsonMater = WQLObject.getWQLObject("md_me_materialbase").query("material_id = '" + material_id + "'").uniqueResult(0);
|
JSONObject jsonMater = WQLObject.getWQLObject("md_me_materialbase").query("material_id = '" + material_id + "'").uniqueResult(0);
|
||||||
JSONObject jsonUnit = WQLObject.getWQLObject("md_pb_measureunit").query("measure_unit_id = '" + jsonMater.getString("base_unit_id") + "'").uniqueResult(0);
|
JSONObject jsonUnit = WQLObject.getWQLObject("md_pb_measureunit").query("measure_unit_id = '" + jsonMater.getString("base_unit_id") + "'").uniqueResult(0);
|
||||||
@@ -527,29 +549,6 @@ public class ReceivemstServiceImpl implements ReceivemstService {
|
|||||||
}else{
|
}else{
|
||||||
throw new BadRequestException("厂家质保书已存在,不允许重复插入!");
|
throw new BadRequestException("厂家质保书已存在,不允许重复插入!");
|
||||||
}
|
}
|
||||||
if (ObjectUtil.isEmpty(jsonMst)) {
|
|
||||||
//插入质检单
|
|
||||||
HashMap<Object, Object> param = new HashMap<>();
|
|
||||||
param.put("material_id", String.valueOf(material_id));
|
|
||||||
boolean is_YL = materialBaseService.isAlongMaterType(MaterOptTypeEnum.YL.getCode(), material_id, null);
|
|
||||||
boolean is_FL = materialBaseService.isAlongMaterType(MaterOptTypeEnum.FL.getCode(), material_id, null);
|
|
||||||
boolean is_BCP = materialBaseService.isAlongMaterType(MaterOptTypeEnum.BCP.getCode(), material_id, null);
|
|
||||||
if (is_YL) param.put("inspection_type", "10");
|
|
||||||
if (is_FL) param.put("inspection_type", "20");
|
|
||||||
if (is_BCP) param.put("inspection_type", "30");
|
|
||||||
param.put("pcsn", MapUtil.getStr(whereJson, "pcsn"));
|
|
||||||
param.put("source_bill_id", MapUtil.getStr(whereJson, "receivedtl_id"));
|
|
||||||
param.put("source_bill_code", MapUtil.getStr(whereJson, "receive_code"));
|
|
||||||
param.put("source_bill_type", MapUtil.getStr(whereJson, "receive_type"));
|
|
||||||
param.put("source_bill_table", "PCS_RC_ReceiveDtl");
|
|
||||||
param.put("source_bill_table_pk", "");
|
|
||||||
param.put("base_bill_id", jsonReMst.get("source_id"));
|
|
||||||
param.put("base_bill_type", jsonReMst.get("source_type"));
|
|
||||||
inspectionsheetmstService.create(param);
|
|
||||||
}else{
|
|
||||||
throw new BadRequestException("质检单已存在,不允许重复插入!");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -103,3 +103,19 @@
|
|||||||
ENDSELECT
|
ENDSELECT
|
||||||
ENDQUERY
|
ENDQUERY
|
||||||
ENDIF
|
ENDIF
|
||||||
|
|
||||||
|
IF 输入.flag = "4"
|
||||||
|
QUERY
|
||||||
|
SELECT
|
||||||
|
sum(QTY_ZT) AS notqty
|
||||||
|
FROM
|
||||||
|
PURCHASE_CONTRACT_VIEW
|
||||||
|
where
|
||||||
|
STATUSFLAG = '3'
|
||||||
|
AND DEL_FLAG = '0'
|
||||||
|
OPTION 输入.ext_id <> ""
|
||||||
|
ITEM_ID = 输入.ext_id
|
||||||
|
ENDOPTION
|
||||||
|
ENDSELECT
|
||||||
|
ENDQUERY
|
||||||
|
ENDIF
|
||||||
|
|||||||
@@ -92,6 +92,7 @@ public class StatisticalReportServiceImpl implements StatisticalReportService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> materPlanQuery(Map whereJson) {
|
public Map<String, Object> materPlanQuery(Map whereJson) {
|
||||||
|
WQLObject materTab = WQLObject.getWQLObject("md_me_materialbase"); // 物料信息表
|
||||||
String begin_time = MapUtil.getStr(whereJson, "begin_time");
|
String begin_time = MapUtil.getStr(whereJson, "begin_time");
|
||||||
String end_time = MapUtil.getStr(whereJson, "end_time");
|
String end_time = MapUtil.getStr(whereJson, "end_time");
|
||||||
String org_id = MapUtil.getStr(whereJson, "org_id");
|
String org_id = MapUtil.getStr(whereJson, "org_id");
|
||||||
@@ -150,44 +151,55 @@ public class StatisticalReportServiceImpl implements StatisticalReportService {
|
|||||||
need_qty = dtlJa_map.get(material_id);
|
need_qty = dtlJa_map.get(material_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
jo1.put(material_id, String.format("%.3f", now_ivt));
|
jo1.put(material_id, String.format("%.2f", now_ivt));
|
||||||
|
|
||||||
double canuse_num = now_ivt;
|
double canuse_num = now_ivt;
|
||||||
//已开单重量
|
//已开单重量
|
||||||
jo22.put(material_id, String.format("%.3f", need_qty));
|
jo22.put(material_id, String.format("%.2f", need_qty));
|
||||||
//2、排产需求量(未开工的工令重量+排产未生成工令日计划重量)根据bom计算需要多少原料库存重量:
|
//2、排产需求量(未开工的工令重量+排产未生成工令日计划重量)根据bom计算需要多少原料库存重量:
|
||||||
JSONObject nedd_mater = WQL.getWO("statistical_report_query_01").addParam("flag", "6").addParam("material_id", material_id).addParam("begin_time", begin_time).addParam("end_time", end_time).addParam("org_id", org_id).process().uniqueResult(0);
|
JSONObject nedd_mater = WQL.getWO("statistical_report_query_01").addParam("flag", "6").addParam("material_id", material_id).addParam("begin_time", begin_time).addParam("end_time", end_time).addParam("org_id", org_id).process().uniqueResult(0);
|
||||||
double bom_qty = 0;
|
double bom_qty = 0;
|
||||||
if (ObjectUtil.isNotEmpty(nedd_mater)) {
|
if (ObjectUtil.isNotEmpty(nedd_mater)) {
|
||||||
bom_qty = nedd_mater.getDoubleValue("qty");
|
bom_qty = nedd_mater.getDoubleValue("qty");
|
||||||
}
|
}
|
||||||
jo2.put(material_id, String.format("%.3f", bom_qty));
|
jo2.put(material_id, String.format("%.2f", bom_qty));
|
||||||
|
|
||||||
//3、待检入库量:sum(此物料未确认的到货单的单据数-入库数)
|
|
||||||
JSONObject num_jo = WQL.getWO("statistical_report_query_01").addParam("flag", "7").addParam("material_id", material_id).process().uniqueResult(0);
|
|
||||||
|
|
||||||
//3、待检入库量:sum(此物料未确认的到货单的单据数-入库数)
|
//3、待检入库量:sum(此物料未确认的到货单的单据数-入库数)
|
||||||
JSONObject noin_jo = WQL.getWO("statistical_report_query_01").addParam("flag", "77").addParam("material_id", material_id).process().uniqueResult(0);
|
JSONObject noin_jo = WQL.getWO("statistical_report_query_01").addParam("flag", "77").addParam("material_id", material_id).process().uniqueResult(0);
|
||||||
//合同在途
|
|
||||||
double notqty = 0;
|
|
||||||
//待检+未入库数量
|
//待检+未入库数量
|
||||||
double noin_qty = 0;
|
double noin_qty = 0;
|
||||||
|
if (ObjectUtil.isNotEmpty(noin_jo)) {
|
||||||
|
noin_qty = noin_jo.getDoubleValue("noin_qty");
|
||||||
|
}
|
||||||
|
jo4.put(material_id, String.format("%.2f", noin_qty));
|
||||||
|
|
||||||
|
|
||||||
|
// 合同在途1.将wms物料id转换成本erp物料id
|
||||||
|
JSONObject jsonMater = materTab.query("material_id = '" + material_id + "' and is_delete = '0' and is_used = '1'").uniqueResult(0);
|
||||||
|
if (ObjectUtil.isEmpty(jsonMater)) {
|
||||||
|
throw new BadRequestException("此物料" + material_id + "在mes系统不存在");
|
||||||
|
}
|
||||||
|
if (StrUtil.isEmpty(jsonMater.getString("ext_id"))) {
|
||||||
|
throw new BadRequestException("此物料" + material_id + "在mes系统不存在erp物料外键");
|
||||||
|
}
|
||||||
|
// 2.根据物料、批次查询erp系统中是否存在此批次的理化报告
|
||||||
|
JSONObject map = new JSONObject();
|
||||||
|
map.put("flag", "4");
|
||||||
|
map.put("ext_id", jsonMater.getString("ext_id"));
|
||||||
|
JSONObject num_jo = WQL.getWO("QL_ERP").addParamMap(map).setDbname("dataSource1").process().uniqueResult(0);
|
||||||
|
|
||||||
|
//合同在途
|
||||||
|
double notqty = 0;
|
||||||
if (ObjectUtil.isNotEmpty(num_jo)) {
|
if (ObjectUtil.isNotEmpty(num_jo)) {
|
||||||
notqty = num_jo.getDoubleValue("notqty");
|
notqty = num_jo.getDoubleValue("notqty");
|
||||||
if (notqty < 0) {
|
if (notqty < 0) {
|
||||||
notqty = 0;
|
notqty = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (ObjectUtil.isNotEmpty(noin_jo)) {
|
jo6.put(material_id, String.format("%.2f", notqty));
|
||||||
noin_qty = noin_jo.getDoubleValue("noin_qty");
|
|
||||||
}
|
|
||||||
jo4.put(material_id, String.format("%.3f", noin_qty));
|
|
||||||
|
|
||||||
//4、合同在途:订单量-到货量
|
|
||||||
jo6.put(material_id, String.format("%.3f", notqty));
|
|
||||||
|
|
||||||
//5、库/需差额量 :库存现存量-排产需求量
|
//5、库/需差额量 :库存现存量-排产需求量
|
||||||
jo3.put(material_id, String.format("%.3f", (canuse_num - bom_qty)));
|
jo3.put(material_id, String.format("%.2f", (canuse_num - bom_qty)));
|
||||||
|
|
||||||
//7、最低储备定额:物料的安全库存量下限
|
//7、最低储备定额:物料的安全库存量下限
|
||||||
JSONObject safe_jo = WQLObject.getWQLObject("ST_IVT_MaterialSafeIvt").query("material_id = '" + material_id + "'").uniqueResult(0);
|
JSONObject safe_jo = WQLObject.getWQLObject("ST_IVT_MaterialSafeIvt").query("material_id = '" + material_id + "'").uniqueResult(0);
|
||||||
@@ -195,11 +207,11 @@ public class StatisticalReportServiceImpl implements StatisticalReportService {
|
|||||||
if (ObjectUtil.isNotEmpty(safe_jo)) {
|
if (ObjectUtil.isNotEmpty(safe_jo)) {
|
||||||
safe_qty = safe_jo.getDoubleValue("safe_ivt_down");
|
safe_qty = safe_jo.getDoubleValue("safe_ivt_down");
|
||||||
}
|
}
|
||||||
jo7.put(material_id, String.format("%.3f", safe_qty));
|
jo7.put(material_id, String.format("%.2f", safe_qty));
|
||||||
|
|
||||||
//8、采购缺口:库存+待检+在途+最低储备-排产量
|
//8、采购缺口:库存+待检+在途+最低储备-排产量
|
||||||
double buy_qty = (canuse_num + noin_qty + notqty) - (bom_qty + safe_qty);
|
double buy_qty = (canuse_num + noin_qty + notqty) - (bom_qty + safe_qty);
|
||||||
jo8.put(material_id, String.format("%.3f", buy_qty));
|
jo8.put(material_id, String.format("%.2f", buy_qty));
|
||||||
|
|
||||||
//6、覆盖日期:物料库存可坚持到哪一天:库存现存量减每天需求量,哪天<0,取前一天
|
//6、覆盖日期:物料库存可坚持到哪一天:库存现存量减每天需求量,哪天<0,取前一天
|
||||||
if (canuse_num<0){
|
if (canuse_num<0){
|
||||||
@@ -254,7 +266,7 @@ public class StatisticalReportServiceImpl implements StatisticalReportService {
|
|||||||
JSONObject dtl = bom_dtl.getJSONObject(j);
|
JSONObject dtl = bom_dtl.getJSONObject(j);
|
||||||
double standard_rate = dtl.getDoubleValue("standard_rate");
|
double standard_rate = dtl.getDoubleValue("standard_rate");
|
||||||
double qty = standard_rate * row.getDoubleValue("product_weight") * 0.01;
|
double qty = standard_rate * row.getDoubleValue("product_weight") * 0.01;
|
||||||
row.put(dtl.getString("material_id"), String.format("%.3f", qty));
|
row.put(dtl.getString("material_id"), String.format("%.2f", qty));
|
||||||
}
|
}
|
||||||
rows.add(row);
|
rows.add(row);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -98,6 +98,7 @@
|
|||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column prop="workload_audit" label="审核工作量" align="center" />
|
||||||
<el-table-column prop="time_quota" label="工时定额" align="center" />
|
<el-table-column prop="time_quota" label="工时定额" align="center" />
|
||||||
<el-table-column prop="describes" label="积分标准" align="center" />
|
<el-table-column prop="describes" label="积分标准" align="center" />
|
||||||
<el-table-column v-permission="['admin','productbom:edit','productbom:del']" label="操作" width="150px" align="center">
|
<el-table-column v-permission="['admin','productbom:edit','productbom:del']" label="操作" width="150px" align="center">
|
||||||
@@ -217,6 +218,7 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
if (same_mater) {
|
if (same_mater) {
|
||||||
|
item.workload_audit = 0
|
||||||
this.form.tableData.splice(-1, 0, item)
|
this.form.tableData.splice(-1, 0, item)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -224,7 +226,7 @@ export default {
|
|||||||
},
|
},
|
||||||
delOne(index, rows) {
|
delOne(index, rows) {
|
||||||
// 将总分值减去每行的总分
|
// 将总分值减去每行的总分
|
||||||
var num = parseFloat(this.form.total_score) - parseFloat(rows[index].single_score) * parseFloat(rows[index].workload)
|
var num = parseFloat(this.form.total_score) - parseFloat(rows[index].single_score) * parseFloat(rows[index].workload_audit)
|
||||||
this.form.total_score = num.toFixed(2)
|
this.form.total_score = num.toFixed(2)
|
||||||
rows.splice(index, 1)
|
rows.splice(index, 1)
|
||||||
this.form.num = this.form.tableData.length
|
this.form.num = this.form.tableData.length
|
||||||
@@ -232,8 +234,9 @@ export default {
|
|||||||
change(val, row, index) {
|
change(val, row, index) {
|
||||||
// 将每行的算出来的分值相加
|
// 将每行的算出来的分值相加
|
||||||
let all = 0
|
let all = 0
|
||||||
|
row.workload_audit = val
|
||||||
this.form.tableData.forEach((item) => {
|
this.form.tableData.forEach((item) => {
|
||||||
all = all + parseFloat(item.workload) * parseFloat(item.single_score)
|
all = all + parseFloat(item.workload_audit) * parseFloat(item.single_score)
|
||||||
})
|
})
|
||||||
this.form.total_score = all.toFixed(2)
|
this.form.total_score = all.toFixed(2)
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -83,9 +83,10 @@
|
|||||||
<el-table-column prop="unit_name" label="单位" align="center" />
|
<el-table-column prop="unit_name" label="单位" align="center" />
|
||||||
<el-table-column prop="item_type" label="项点分类" align="center" :formatter="formatItemTypeName" />
|
<el-table-column prop="item_type" label="项点分类" align="center" :formatter="formatItemTypeName" />
|
||||||
<el-table-column prop="single_score" label="单项分值" align="center" />
|
<el-table-column prop="single_score" label="单项分值" align="center" />
|
||||||
<el-table-column prop="workload" label="工作量" align="center">
|
<el-table-column prop="workload" label="工作量" align="center" />
|
||||||
|
<el-table-column prop="workload_audit" label="审核工作量" align="center">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-input v-model="form.tableData[scope.$index].workload" size="mini" class="edit-input" :disabled="crud.status.view > 0" @input="change($event,form.tableData[scope.$index],scope.$index)" />
|
<el-input v-model="form.tableData[scope.$index].workload_audit" size="mini" class="edit-input" :disabled="crud.status.view > 0" @input="change($event,form.tableData[scope.$index],scope.$index)" />
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="time_quota" label="工时定额" align="center" />
|
<el-table-column prop="time_quota" label="工时定额" align="center" />
|
||||||
@@ -214,7 +215,7 @@ export default {
|
|||||||
},
|
},
|
||||||
delOne(index, rows) {
|
delOne(index, rows) {
|
||||||
// 将总分值减去每行的总分
|
// 将总分值减去每行的总分
|
||||||
var num = parseFloat(this.form.total_score) - parseFloat(rows[index].single_score) * parseFloat(rows[index].workload)
|
var num = parseFloat(this.form.total_score) - parseFloat(rows[index].single_score) * parseFloat(rows[index].workload_audit)
|
||||||
this.form.total_score = num.toFixed(2)
|
this.form.total_score = num.toFixed(2)
|
||||||
rows.splice(index, 1)
|
rows.splice(index, 1)
|
||||||
this.form.num = this.form.tableData.length
|
this.form.num = this.form.tableData.length
|
||||||
@@ -225,17 +226,17 @@ export default {
|
|||||||
const numRe = new RegExp(numReg)
|
const numRe = new RegExp(numReg)
|
||||||
if (!numRe.test(val)) {
|
if (!numRe.test(val)) {
|
||||||
this.crud.notify('请输入不小于0的数字', CRUD.NOTIFICATION_TYPE.INFO)
|
this.crud.notify('请输入不小于0的数字', CRUD.NOTIFICATION_TYPE.INFO)
|
||||||
row.workload = 0
|
row.workload_audit = 0
|
||||||
} else {
|
} else {
|
||||||
if (row.workload === '') {
|
if (row.workload_audit === '') {
|
||||||
row.workload = 0
|
row.workload_audit = 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.form.tableData.splice(index, 1, row)
|
this.form.tableData.splice(index, 1, row)
|
||||||
// 将每行的算出来的分值相加
|
// 将每行的算出来的分值相加
|
||||||
let all = 0
|
let all = 0
|
||||||
this.form.tableData.forEach((item) => {
|
this.form.tableData.forEach((item) => {
|
||||||
all = all + parseFloat(item.workload) * parseFloat(item.single_score)
|
all = all + parseFloat(item.workload_audit) * parseFloat(item.single_score)
|
||||||
})
|
})
|
||||||
this.form.total_score = all.toFixed(2)
|
this.form.total_score = all.toFixed(2)
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ export default {
|
|||||||
cruds() {
|
cruds() {
|
||||||
return CRUD({
|
return CRUD({
|
||||||
title: '工作量汇报',
|
title: '工作量汇报',
|
||||||
url: 'api/performancemst',
|
url: 'api/performancemst/query2',
|
||||||
idField: 'performance_id',
|
idField: 'performance_id',
|
||||||
sort: 'performance_id,desc',
|
sort: 'performance_id,desc',
|
||||||
crudMethod: { ...crudPerformancemst },
|
crudMethod: { ...crudPerformancemst },
|
||||||
|
|||||||
@@ -129,9 +129,9 @@
|
|||||||
<el-table-column fixed="left" prop="maintenancecycle" label="维修周期" :formatter="formatMainName" min-width="75" />
|
<el-table-column fixed="left" prop="maintenancecycle" label="维修周期" :formatter="formatMainName" min-width="75" />
|
||||||
<el-table-column fixed="left" prop="repair_type" label="维修类型" :formatter="formatRepairpType" min-width="75" />
|
<el-table-column fixed="left" prop="repair_type" label="维修类型" :formatter="formatRepairpType" min-width="75" />
|
||||||
<el-table-column prop="plan_start_date" label="计划初始日期" min-width="100" />
|
<el-table-column prop="plan_start_date" label="计划初始日期" min-width="100" />
|
||||||
<el-table-column prop="real_start_date" label="最近保养开始日期" min-width="125" />
|
<el-table-column prop="real_start_date" label="最近维修开始日期" min-width="125" />
|
||||||
<el-table-column prop="real_end_date" label="最近保养结束日期" min-width="125" />
|
<el-table-column prop="real_end_date" label="最近维修结束日期" min-width="125" />
|
||||||
<el-table-column prop="next_end_date" label="下次保养日期" min-width="100" />
|
<el-table-column prop="next_end_date" label="下次维修日期" min-width="100" />
|
||||||
<el-table-column prop="create_name" label="创建人" min-width="90" />
|
<el-table-column prop="create_name" label="创建人" min-width="90" />
|
||||||
<el-table-column prop="create_time" label="创建时间" min-width="140" />
|
<el-table-column prop="create_time" label="创建时间" min-width="140" />
|
||||||
<el-table-column prop="confirm_optname" label="审核人" min-width="90" />
|
<el-table-column prop="confirm_optname" label="审核人" min-width="90" />
|
||||||
|
|||||||
Reference in New Issue
Block a user