add:新增其他球磨参数维护、下发
This commit is contained in:
@@ -0,0 +1,89 @@
|
||||
package org.nl.pda.pdm;
|
||||
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class otherQmUtil {
|
||||
/**
|
||||
* 料浆卸料参数字段
|
||||
*/
|
||||
static List<String> rawPulpCodeList = Arrays.asList(
|
||||
"slurry_angle1", "slurry_angle2", "slurry_angle3", "slurry_angle4", "slurry_angle5", "slurry_angle6",
|
||||
"slurry_angle7", "slurry_angle8", "slurry_time1", "slurry_time2", "slurry_time3", "slurry_time4",
|
||||
"slurry_time5", "slurry_time6", "slurry_time7", "slurry_time8"
|
||||
);
|
||||
/**
|
||||
* 酒精卸料参数表
|
||||
*/
|
||||
static List<String> alcoholCodeList = Arrays.asList(
|
||||
"alc_qty1", "alc_qty2", "alc_qty3", "alc_qty4", "alc_qty5", "alc_qty6","alc_qty7","alc_qty8",
|
||||
"alc_alcangle1", "alc_alcangle2", "alc_alcangle3", "alc_alcangle4", "alc_alcangle5", "alc_alcangle6","alc_alcangle7","alc_alcangle8",
|
||||
"alc_angle1", "alc_angle2", "alc_angle3", "alc_angle4", "alc_angle5", "alc_angle6","alc_angle7","alc_angle8",
|
||||
"alc_flattime1", "alc_flattime2", "alc_flattime3", "alc_flattime4", "alc_flattime5", "alc_flattime6","alc_flattime7","alc_flattime8",
|
||||
"alc_time1", "alc_time2", "alc_time3", "alc_time4", "alc_time5", "alc_time6","alc_time7","alc_time8"
|
||||
);
|
||||
/**
|
||||
* 清洗参数表一
|
||||
*/
|
||||
static List<String> cleanseOneCodeList = Arrays.asList(
|
||||
"clean_waterqty1", "clean_waterqty2", "clean_waterqty3", "clean_waterqty4", "clean_waterqty5",
|
||||
"clean_waterangle1", "clean_waterangle2", "clean_waterangle3", "clean_waterangle4", "clean_waterangle5",
|
||||
"clean_angle1", "clean_angle2", "clean_angle3", "clean_angle4", "clean_angle5",
|
||||
"clean_flattime1", "clean_flattime2", "clean_flattime3", "clean_flattime4", "clean_flattime5",
|
||||
"clean_time1", "clean_time2", "clean_time3", "clean_time4", "clean_time5",
|
||||
"clean_resttime1", "clean_resttime2", "clean_resttime3", "clean_resttime4", "clean_resttime5"
|
||||
);
|
||||
/**
|
||||
* 清洗参数表二
|
||||
*/
|
||||
static List<String> cleanseTwoCodeList = Arrays.asList(
|
||||
"extra_qty", "extra_alcangle", "extra_angle", "extra_flattime", "extra_time"
|
||||
);
|
||||
|
||||
static Map<String, List<String>> TYPE_CODE_MAP = new HashMap<>();
|
||||
|
||||
static {
|
||||
// type -> List 映射表
|
||||
TYPE_CODE_MAP.put("A", rawPulpCodeList);
|
||||
TYPE_CODE_MAP.put("B", alcoholCodeList);
|
||||
TYPE_CODE_MAP.put("C", cleanseOneCodeList);
|
||||
TYPE_CODE_MAP.put("D", cleanseTwoCodeList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 组织下发acs数组
|
||||
* @param typeTable 集合类型 {
|
||||
* A:料浆卸料参数表
|
||||
* B:酒精卸料参数表
|
||||
* C:清洗参数表一
|
||||
* D:清洗参数表二
|
||||
* }
|
||||
* @param json 具体表数据
|
||||
* @param deviceCode 设备编码
|
||||
* @return result
|
||||
*/
|
||||
static public JSONArray otherQm(String typeTable, JSONObject json, String deviceCode) {
|
||||
JSONArray result = new JSONArray();
|
||||
// 根据type拿到对应数组,拿不到返回空
|
||||
List<String> codeList = TYPE_CODE_MAP.get(typeTable);
|
||||
if (codeList == null) {
|
||||
return result;
|
||||
}
|
||||
|
||||
for (String code : codeList) {
|
||||
JSONObject item = new JSONObject();
|
||||
item.put("code", code);
|
||||
item.put("device_code", deviceCode);
|
||||
item.put("value", ObjectUtil.isEmpty(json)
|
||||
? "0"
|
||||
: (ObjectUtil.isEmpty(NumberUtil.round(json.getString(code),1)) ? "0" : NumberUtil.round(json.getString(code),1))
|
||||
);
|
||||
result.add(item);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -14,6 +14,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.exception.BadRequestException;
|
||||
import org.nl.ext.acs.service.WmsToAcsService;
|
||||
import org.nl.pda.exception.PdaRequestException;
|
||||
import org.nl.pda.pdm.otherQmUtil;
|
||||
import org.nl.pda.pdm.service.PdmWorkTaskService;
|
||||
import org.nl.pda.st.vehicle.service.impl.EmptyVehicleServiceImpl;
|
||||
import org.nl.utils.SecurityUtils;
|
||||
@@ -975,6 +976,9 @@ public class PdmWorkTaskServiceImpl implements PdmWorkTaskService {
|
||||
array.add(data2);
|
||||
}
|
||||
|
||||
// 组织其他球磨参数
|
||||
JSONArray otherQMList = otherQM(material_id,device_jo.getString("device_code"));
|
||||
array.addAll(otherQMList);
|
||||
Map<String, Object> result = wmsToAcsService.action(array);
|
||||
String status = MapUtil.getStr(result, "status");
|
||||
if (!StrUtil.equals(status, "200")) {
|
||||
@@ -995,6 +999,42 @@ public class PdmWorkTaskServiceImpl implements PdmWorkTaskService {
|
||||
return returnjo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 其他球磨参数
|
||||
* @param materialId 物料标识
|
||||
* @param deviceCode 设备编码
|
||||
* @return JSONArray
|
||||
*/
|
||||
private JSONArray otherQM(String materialId, String deviceCode) {
|
||||
JSONArray result = new JSONArray();
|
||||
// 浆卸料参数表
|
||||
WQLObject rawPulpWo = WQLObject.getWQLObject("PDM_BI_RawPulpParam");
|
||||
// 酒精卸料参数表
|
||||
WQLObject alcoholWo = WQLObject.getWQLObject("PDM_BI_AlcoholParam");
|
||||
// 清洗参数表一
|
||||
WQLObject cleanseOneWo = WQLObject.getWQLObject("PDM_BI_CleanseParamOne");
|
||||
// 清洗参数表二
|
||||
WQLObject cleanseTwoWo = WQLObject.getWQLObject("PDM_BI_CleanseParamTwo");
|
||||
|
||||
// 查询浆卸料参数
|
||||
JSONObject rawPulpWoJson = rawPulpWo.query("material_id = '" + materialId + "'").uniqueResult(0);
|
||||
JSONArray rawPulpList = otherQmUtil.otherQm("A", rawPulpWoJson, deviceCode);
|
||||
result.addAll(rawPulpList);
|
||||
// 查询酒精卸料参数
|
||||
JSONObject alcoholWoJson = alcoholWo.query("material_id = '" + materialId + "'").uniqueResult(0);
|
||||
JSONArray alcoholList = otherQmUtil.otherQm("B", alcoholWoJson, deviceCode);
|
||||
result.addAll(alcoholList);
|
||||
// 查询清洗参数一
|
||||
JSONObject cleanseOneWoJson = cleanseOneWo.query("material_id = '" + materialId + "'").uniqueResult(0);
|
||||
JSONArray cleanseOneList = otherQmUtil.otherQm("C", cleanseOneWoJson, deviceCode);
|
||||
result.addAll(cleanseOneList);
|
||||
// 查询清洗参数二
|
||||
JSONObject cleanseTwoWoJson = cleanseTwoWo.query("material_id = '" + materialId + "'").uniqueResult(0);
|
||||
JSONArray cleanseTwoList = otherQmUtil.otherQm("D", cleanseTwoWoJson, deviceCode);
|
||||
result.addAll(cleanseTwoList);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> moveQMVehicle(Map jsonObject) {
|
||||
if (ObjectUtil.isEmpty(jsonObject)) {
|
||||
|
||||
@@ -74,4 +74,19 @@ public class ProductProcessParamController {
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/getBallMillParam")
|
||||
@Log("获取其他球磨参数")
|
||||
@ApiOperation("获取其他球磨参数")
|
||||
public ResponseEntity<Object> getBallMillParam(@RequestBody Map whereJson) {
|
||||
return new ResponseEntity<>(productProcessParamService.getBallMillParam(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/saveBallMillParam")
|
||||
@Log("保存其他球磨参数")
|
||||
@ApiOperation("保存其他球磨参数")
|
||||
public ResponseEntity<Object> saveBallMillParam(@RequestBody JSONObject whereJson) {
|
||||
productProcessParamService.saveBallMillParam(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -49,4 +49,30 @@ public interface ProductProcessParamService {
|
||||
* 删除参数
|
||||
*/
|
||||
void deleteAll(Map whereJson);
|
||||
|
||||
/**
|
||||
* 获取其他球磨参数
|
||||
* @param whereJson {
|
||||
* material_id: 物料标识
|
||||
* }
|
||||
* @return JSONObject {
|
||||
* slurryParams: {} --原浆卸料
|
||||
* alcoholParams: {} --酒精卸料
|
||||
* cleanParams: {} --清洗一
|
||||
* extraAlcoholParams: {} --清洗二
|
||||
* }
|
||||
*/
|
||||
JSONObject getBallMillParam(Map whereJson);
|
||||
|
||||
/**
|
||||
* 保存其他球磨参数
|
||||
* @param whereJson {
|
||||
* material_id : 物料标识
|
||||
* slurryParams: {} --原浆卸料
|
||||
* alcoholParams: {} --酒精卸料
|
||||
* cleanParams: {} --清洗
|
||||
* extraAlcoholParams: {} --清洗二
|
||||
* }
|
||||
*/
|
||||
void saveBallMillParam(JSONObject whereJson);
|
||||
}
|
||||
|
||||
@@ -5,10 +5,10 @@ import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.exception.BadRequestException;
|
||||
import org.nl.utils.SecurityUtils;
|
||||
import org.nl.wms.basedata.master.constant.MaterOptTypeEnum;
|
||||
@@ -44,8 +44,8 @@ public class ProductProcessParamServiceImpl implements ProductProcessParamServic
|
||||
public Map<String, Object> queryAll(Map whereJson, Pageable page) {
|
||||
String search = MapUtil.getStr(whereJson, "search");
|
||||
//只能查询PG粉
|
||||
String classIds=classstandardService.getAllChildIdStr(MaterOptTypeEnum.PGF.getClass_idStr());
|
||||
String where = "is_delete ='0' and material_type_id in "+ classIds;
|
||||
String classIds = classstandardService.getAllChildIdStr(MaterOptTypeEnum.PGF.getClass_idStr());
|
||||
String where = "is_delete ='0' and material_type_id in " + classIds;
|
||||
if (ObjectUtil.isNotEmpty(search)) {
|
||||
if (search.contains("\\")) search = search.replace("\\", "\\\\\\");
|
||||
where += " AND (material_code like '%" + search + "%' OR material_code like '%" + search + "%' ) ";
|
||||
@@ -223,7 +223,67 @@ public class ProductProcessParamServiceImpl implements ProductProcessParamServic
|
||||
String material_id = (String) whereJson.get("material_id");
|
||||
String workprocedure_code = (String) whereJson.get("workprocedure_code");
|
||||
WQLObject wo = WQLObject.getWQLObject("PDM_BI_WorkProcedureParaProduct");
|
||||
wo.delete("material_id = '" + material_id + "' and workprocedure_code='"+workprocedure_code+"'");
|
||||
wo.delete("material_id = '" + material_id + "' and workprocedure_code='" + workprocedure_code + "'");
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject getBallMillParam(Map whereJson) {
|
||||
// 浆卸料参数表
|
||||
WQLObject rawPulpWo = WQLObject.getWQLObject("PDM_BI_RawPulpParam");
|
||||
// 酒精卸料参数表
|
||||
WQLObject alcoholWo = WQLObject.getWQLObject("PDM_BI_AlcoholParam");
|
||||
// 清洗参数表一
|
||||
WQLObject cleanseOneWo = WQLObject.getWQLObject("PDM_BI_CleanseParamOne");
|
||||
// 清洗参数表二
|
||||
WQLObject cleanseOneTwo = WQLObject.getWQLObject("PDM_BI_CleanseParamTwo");
|
||||
String materialId = MapUtil.getStr(whereJson, "material_id");
|
||||
|
||||
JSONObject slurryParams = rawPulpWo.query("material_id = '" + materialId + "'").uniqueResult(0);
|
||||
JSONObject alcoholParams = alcoholWo.query("material_id = '" + materialId + "'").uniqueResult(0);
|
||||
JSONObject cleanParams = cleanseOneWo.query("material_id = '" + materialId + "'").uniqueResult(0);
|
||||
JSONObject extraAlcoholParams = cleanseOneTwo.query("material_id = '" + materialId + "'").uniqueResult(0);
|
||||
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("slurryParams", slurryParams);
|
||||
result.put("alcoholParams", alcoholParams);
|
||||
result.put("cleanParams", cleanParams);
|
||||
result.put("extraAlcoholParams", extraAlcoholParams);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void saveBallMillParam(JSONObject whereJson) {
|
||||
// 料浆卸料参数表
|
||||
WQLObject rawPulpWo = WQLObject.getWQLObject("PDM_BI_RawPulpParam");
|
||||
// 酒精卸料参数表
|
||||
WQLObject alcoholWo = WQLObject.getWQLObject("PDM_BI_AlcoholParam");
|
||||
// 清洗参数表一
|
||||
WQLObject cleanseOneWo = WQLObject.getWQLObject("PDM_BI_CleanseParamOne");
|
||||
// 清洗参数表二
|
||||
WQLObject cleanseOneTwo = WQLObject.getWQLObject("PDM_BI_CleanseParamTwo");
|
||||
String materialId = MapUtil.getStr(whereJson, "material_id");
|
||||
|
||||
// 先删除后新增
|
||||
rawPulpWo.delete("material_id = '" + materialId + "'");
|
||||
JSONObject slurryParams = whereJson.getJSONObject("slurryParams");
|
||||
slurryParams.put("material_id", materialId);
|
||||
rawPulpWo.insert(slurryParams);
|
||||
|
||||
alcoholWo.delete("material_id = '" + materialId + "'");
|
||||
JSONObject alcoholParams = whereJson.getJSONObject("alcoholParams");
|
||||
alcoholParams.put("material_id", materialId);
|
||||
alcoholWo.insert(alcoholParams);
|
||||
|
||||
cleanseOneWo.delete("material_id = '" + materialId + "'");
|
||||
JSONObject cleanParams = whereJson.getJSONObject("cleanParams");
|
||||
cleanParams.put("material_id", materialId);
|
||||
cleanseOneWo.insert(cleanParams);
|
||||
|
||||
cleanseOneTwo.delete("material_id = '" + materialId + "'");
|
||||
JSONObject extraAlcoholParams = whereJson.getJSONObject("extraAlcoholParams");
|
||||
extraAlcoholParams.put("material_id", materialId);
|
||||
cleanseOneTwo.insert(extraAlcoholParams);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Binary file not shown.
@@ -357,7 +357,7 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
||||
if (row.getString("bill_type").equals("000203")) {
|
||||
//通过入库单对象组织数据
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
map.put("flag", "2");
|
||||
map.put("flag", "222");
|
||||
map.put("iostorinv_id", row.getString("iostorinv_id"));
|
||||
JSONArray dtl_rows = WQL.getWO("QST_IVT_INANDOUTRETRUN").addParamMap(map).process().getResultJSONArray(0);
|
||||
// 根据物料批次获取到货通知单的采购订单采购组织
|
||||
@@ -2064,7 +2064,8 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
||||
throw new BadRequestException("物料【"+dtl.getString("material_id")+"】,批次【"+dtl.getString("pcsn")+"】的通知单对应的采购订单库位为空!");
|
||||
}
|
||||
} else {
|
||||
throw new BadRequestException("找不到物料为【"+dtl.getString("material_id")+"】,批次为【"+dtl.getString("pcsn")+"】的到货通知单对应的采购订单!");
|
||||
// 没有采购订单的设默认值:如软废型材入库:erp提供
|
||||
erp_storage_id = "1002A11000000055U84C";
|
||||
}
|
||||
|
||||
// 出库仓库
|
||||
|
||||
@@ -158,6 +158,48 @@
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "222"
|
||||
QUERY
|
||||
SELECT
|
||||
proc.PK_DEPT,
|
||||
proc.VEND_ID,
|
||||
proc.CEMPLOYEEID,
|
||||
proc.PK_DEPT_V,
|
||||
proc.VBILLCODE,
|
||||
dtl.pcsn,
|
||||
dtl.material_id,
|
||||
proc.PRICE,
|
||||
proc.PRICE_TAX,
|
||||
(case when mst.bill_type not in ('000601','000501','010701') then dtl.real_qty else concat('-',dtl.plan_qty) end) AS real_qty,
|
||||
proc.TAX,
|
||||
proc.PURCHASE_ID_B,
|
||||
proc.PURCHASE_ID,
|
||||
mb.ext_id AS ITEM_ID,
|
||||
proc.CROWNO,
|
||||
proc.QTY,
|
||||
mb.material_name,
|
||||
unit.ext_id AS F_UNIT_ID,
|
||||
unit.ext_id AS M_UNIT_ID,
|
||||
userper.ext_id AS make_ext_id,
|
||||
userper.extuser_id AS create_user_id,
|
||||
mb.measrate AS vchangerate,
|
||||
dict.label,
|
||||
mst.biz_date,
|
||||
mst.input_time
|
||||
FROM
|
||||
st_ivt_iostorinvdtl dtl
|
||||
LEFT JOIN st_ivt_iostorinv mst ON mst.iostorinv_id = dtl.iostorinv_id
|
||||
LEFT JOIN sys_dict_detail dict ON dict.`value` = mst.bill_type AND dict.name = 'IO_BUSS_TYPE'
|
||||
LEFT JOIN pcs_if_purchaseorderproc proc ON proc.id = dtl.base_billdtl_id
|
||||
LEFT JOIN sys_user userper ON userper.user_id = mst.input_optid
|
||||
LEFT JOIN md_me_materialbase mb ON mb.material_id = dtl.material_id
|
||||
LEFT JOIN md_pb_measureunit unit ON mb.base_unit_id = unit.measure_unit_id
|
||||
WHERE
|
||||
dtl.iostorinv_id = 输入.iostorinv_id
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "3"
|
||||
QUERY
|
||||
SELECT
|
||||
|
||||
@@ -31,4 +31,20 @@ export function del(data) {
|
||||
})
|
||||
}
|
||||
|
||||
export default { getTableTitle, getSetData, saveData, del }
|
||||
export function getBallMillParam(data) {
|
||||
return request({
|
||||
url: 'api/productProcessParam/getBallMillParam',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function saveBallMillParam(data) {
|
||||
return request({
|
||||
url: 'api/productProcessParam/saveBallMillParam',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { getTableTitle, getSetData, saveData, del, getBallMillParam, saveBallMillParam }
|
||||
|
||||
@@ -0,0 +1,341 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
title="其他球磨参数设置"
|
||||
append-to-body
|
||||
:visible.sync="dialogVisible"
|
||||
width="90%"
|
||||
destroy-on-close
|
||||
@close="close"
|
||||
>
|
||||
<!-- 原浆卸料参数表 -->
|
||||
<div class="table-section">
|
||||
<h3 class="table-title">原浆卸料参数表</h3>
|
||||
<el-table
|
||||
:data="[1,2,3,4]"
|
||||
stripe
|
||||
border
|
||||
size="mini"
|
||||
style="width: 100%"
|
||||
:header-cell-style="{ background: '#f5f7fa', textAlign: 'center' }"
|
||||
>
|
||||
<el-table-column label="参数" width="60" align="center">
|
||||
<template slot-scope="scope">{{ scope.row }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="卸料角度" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input-number v-model="slurryParams['slurry_angle'+scope.row]" :controls="false" :precision="1" size="small" style="width:100%" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="卸料时间 S" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input-number v-model="slurryParams['slurry_time'+scope.row]" :controls="false" :precision="1" size="small" style="width:100%" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="参数" width="60" align="center">
|
||||
<template slot-scope="scope">{{ scope.row + 4 }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="卸料角度" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input-number v-model="slurryParams['slurry_angle'+(scope.row+4)]" :controls="false" :precision="1" size="small" style="width:100%" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="卸料时间 S" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input-number v-model="slurryParams['slurry_time'+(scope.row+4)]" :controls="false" :precision="1" size="small" style="width:100%" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
|
||||
<el-divider />
|
||||
|
||||
<!-- 酒精卸料参数表 -->
|
||||
<div class="table-section">
|
||||
<h3 class="table-title">酒精卸料参数表</h3>
|
||||
<el-table
|
||||
:data="[1,2,3,4,5,6,7,8]"
|
||||
stripe
|
||||
border
|
||||
size="mini"
|
||||
style="width: 100%"
|
||||
:header-cell-style="{ background: '#f5f7fa', textAlign: 'center' }"
|
||||
>
|
||||
<el-table-column label="参数" width="60" align="center">
|
||||
<template slot-scope="scope">{{ scope.row }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="加酒精量 L" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input-number v-model="alcoholParams['alc_qty'+scope.row]" :controls="false" :precision="1" size="small" style="width:100%" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="加酒精角度" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input-number v-model="alcoholParams['alc_alcangle'+scope.row]" :controls="false" :precision="1" size="small" style="width:100%" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="卸料角度" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input-number v-model="alcoholParams['alc_angle'+scope.row]" :controls="false" :precision="1" size="small" style="width:100%" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="平磨时间 S" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input-number v-model="alcoholParams['alc_flattime'+scope.row]" :controls="false" :precision="1" size="small" style="width:100%" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="卸料时间 S" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input-number v-model="alcoholParams['alc_time'+scope.row]" :controls="false" :precision="1" size="small" style="width:100%" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
|
||||
<el-divider />
|
||||
|
||||
<!-- 清洗参数表 -->
|
||||
<div class="table-section">
|
||||
<h3 class="table-title">清洗参数表</h3>
|
||||
<el-table
|
||||
:data="[1,2,3,4,5]"
|
||||
stripe
|
||||
border
|
||||
size="mini"
|
||||
style="width: 100%"
|
||||
:header-cell-style="{ background: '#f5f7fa', textAlign: 'center' }"
|
||||
>
|
||||
<el-table-column label="参数" width="60" align="center">
|
||||
<template slot-scope="scope">{{ scope.row }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="加水量 L" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input-number v-model="cleanParams['clean_waterqty'+scope.row]" :controls="false" :precision="1" size="small" style="width:100%" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="加水角度" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input-number v-model="cleanParams['clean_waterangle'+scope.row]" :controls="false" :precision="1" size="small" style="width:100%" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="卸料角度" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input-number v-model="cleanParams['clean_angle'+scope.row]" :controls="false" :precision="1" size="small" style="width:100%" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="平磨时间 S" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input-number v-model="cleanParams['clean_flattime'+scope.row]" :controls="false" :precision="1" size="small" style="width:100%" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="卸料时间 S" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input-number v-model="cleanParams['clean_time'+scope.row]" :controls="false" :precision="1" size="small" style="width:100%" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="静止时间 S" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input-number v-model="cleanParams['clean_resttime'+scope.row]" :controls="false" :precision="1" size="small" style="width:100%" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
|
||||
<el-divider />
|
||||
|
||||
<!-- 酒精卸料参数表(单行) -->
|
||||
<div class="table-section">
|
||||
<el-table
|
||||
:data="[1]"
|
||||
stripe
|
||||
border
|
||||
size="mini"
|
||||
style="width: 100%"
|
||||
:header-cell-style="{ background: '#f5f7fa', textAlign: 'center' }"
|
||||
>
|
||||
<el-table-column label="参数" width="60" align="center">
|
||||
<template slot-scope="scope">{{ 6 }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="加酒精量 L" align="center">
|
||||
<template>
|
||||
<el-input-number v-model="extraAlcoholParams.extra_qty" :controls="false" :precision="1" size="small" style="width:100%" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="加酒精角度" align="center">
|
||||
<template>
|
||||
<el-input-number v-model="extraAlcoholParams.extra_alcangle" :controls="false" :precision="1" size="small" style="width:100%" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="卸料角度" align="center">
|
||||
<template>
|
||||
<el-input-number v-model="extraAlcoholParams.extra_angle" :controls="false" :precision="1" size="small" style="width:100%" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="平磨时间 S" align="center">
|
||||
<template>
|
||||
<el-input-number v-model="extraAlcoholParams.extra_flattime" :controls="false" :precision="1" size="small" style="width:100%" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="卸料时间 S" align="center">
|
||||
<template>
|
||||
<el-input-number v-model="extraAlcoholParams.extra_time" :controls="false" :precision="1" size="small" style="width:100%" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="close">取 消</el-button>
|
||||
<el-button type="primary" @click="onSubmit">保 存</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudProductProcessParam from '@/api/wms/basedata/pdm/productProcessParam'
|
||||
|
||||
// 原浆卸料默认数据
|
||||
const defaultSlurryParams = {
|
||||
slurry_angle1: 0, slurry_time1: 0, slurry_angle2: 0, slurry_time2: 0,
|
||||
slurry_angle3: 0, slurry_time3: 0, slurry_angle4: 0, slurry_time4: 0,
|
||||
slurry_angle5: 0, slurry_time5: 0, slurry_angle6: 0, slurry_time6: 0,
|
||||
slurry_angle7: 0, slurry_time7: 0, slurry_angle8: 0, slurry_time8: 0
|
||||
}
|
||||
|
||||
// 酒精卸料默认数据
|
||||
const defaultAlcoholParams = {
|
||||
alc_qty1: 0, alc_alcangle1: 0, alc_angle1: 0, alc_flattime1: 0, alc_time1: 0,
|
||||
alc_qty2: 0, alc_alcangle2: 0, alc_angle2: 0, alc_flattime2: 0, alc_time2: 0,
|
||||
alc_qty3: 0, alc_alcangle3: 0, alc_angle3: 0, alc_flattime3: 0, alc_time3: 0,
|
||||
alc_qty4: 0, alc_alcangle4: 0, alc_angle4: 0, alc_flattime4: 0, alc_time4: 0,
|
||||
alc_qty5: 0, alc_alcangle5: 0, alc_angle5: 0, alc_flattime5: 0, alc_time5: 0,
|
||||
alc_qty6: 0, alc_alcangle6: 0, alc_angle6: 0, alc_flattime6: 0, alc_time6: 0,
|
||||
alc_qty7: 0, alc_alcangle7: 0, alc_angle7: 0, alc_flattime7: 0, alc_time7: 0,
|
||||
alc_qty8: 0, alc_alcangle8: 0, alc_angle8: 0, alc_flattime8: 0, alc_time8: 0
|
||||
}
|
||||
|
||||
// 清洗默认数据
|
||||
const defaultCleanParams = {
|
||||
clean_waterqty1: 0, clean_waterangle1: 0, clean_angle1: 0, clean_flattime1: 0, clean_time1: 0, clean_resttime1: 0,
|
||||
clean_waterqty2: 0, clean_waterangle2: 0, clean_angle2: 0, clean_flattime2: 0, clean_time2: 0, clean_resttime2: 0,
|
||||
clean_waterqty3: 0, clean_waterangle3: 0, clean_angle3: 0, clean_flattime3: 0, clean_time3: 0, clean_resttime3: 0,
|
||||
clean_waterqty4: 0, clean_waterangle4: 0, clean_angle4: 0, clean_flattime4: 0, clean_time4: 0, clean_resttime4: 0,
|
||||
clean_waterqty5: 0, clean_waterangle5: 0, clean_angle5: 0, clean_flattime5: 0, clean_time5: 0, clean_resttime5: 0
|
||||
}
|
||||
const defaultExtraAlcoholParams = {
|
||||
extra_qty: 0, extra_alcangle: 0, extra_angle: 0, extra_flattime: 0, extra_time: 0
|
||||
}
|
||||
|
||||
function createEmptyParams(defaults) {
|
||||
const obj = {}
|
||||
Object.keys(defaults).forEach(k => { obj[k] = null })
|
||||
return obj
|
||||
}
|
||||
|
||||
export default {
|
||||
name: 'BallMillParamDialog',
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
openParam: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
slurryParams: createEmptyParams(defaultSlurryParams),
|
||||
alcoholParams: createEmptyParams(defaultAlcoholParams),
|
||||
cleanParams: createEmptyParams(defaultCleanParams),
|
||||
extraAlcoholParams: createEmptyParams(defaultExtraAlcoholParams)
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue) {
|
||||
this.dialogVisible = newValue
|
||||
if (newValue) {
|
||||
this.loadData()
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
loadData() {
|
||||
const param = {
|
||||
workprocedure_code: this.openParam.workprocedure_code,
|
||||
material_id: this.openParam.optRow
|
||||
}
|
||||
crudProductProcessParam.getBallMillParam(param).then(res => {
|
||||
// 过滤掉后端返回的 null 值,防止覆盖 default*Params 的默认值 0
|
||||
// 否则 WQL 框架 insert 时会跳过 null 字段,导致只插入 material_id 而丢失业务数据
|
||||
const filterNulls = (obj) => {
|
||||
if (!obj) return {}
|
||||
const filtered = {}
|
||||
Object.keys(obj).forEach(k => {
|
||||
if (obj[k] != null) filtered[k] = obj[k]
|
||||
})
|
||||
return filtered
|
||||
}
|
||||
this.slurryParams = { ...defaultSlurryParams, ...filterNulls(res.slurryParams) }
|
||||
this.alcoholParams = { ...defaultAlcoholParams, ...filterNulls(res.alcoholParams) }
|
||||
this.cleanParams = { ...defaultCleanParams, ...filterNulls(res.cleanParams) }
|
||||
this.extraAlcoholParams = { ...defaultExtraAlcoholParams, ...filterNulls(res.extraAlcoholParams) }
|
||||
}).catch(() => {
|
||||
this.slurryParams = { ...defaultSlurryParams }
|
||||
this.alcoholParams = { ...defaultAlcoholParams }
|
||||
this.cleanParams = { ...defaultCleanParams }
|
||||
this.extraAlcoholParams = { ...defaultExtraAlcoholParams }
|
||||
})
|
||||
},
|
||||
onSubmit() {
|
||||
const param = {
|
||||
workprocedure_code: this.openParam.workprocedure_code,
|
||||
material_id: this.openParam.optRow,
|
||||
slurryParams: this.slurryParams,
|
||||
alcoholParams: this.alcoholParams,
|
||||
cleanParams: this.cleanParams,
|
||||
extraAlcoholParams: this.extraAlcoholParams
|
||||
}
|
||||
crudProductProcessParam.saveBallMillParam(param).then(() => {
|
||||
this.$notify({
|
||||
title: '保存成功',
|
||||
type: 'success',
|
||||
duration: 2500
|
||||
})
|
||||
this.close()
|
||||
}).catch(() => {
|
||||
this.$notify({
|
||||
title: '保存失败,请联系管理员',
|
||||
type: 'error',
|
||||
duration: 2500
|
||||
})
|
||||
})
|
||||
},
|
||||
close() {
|
||||
this.slurryParams = createEmptyParams(defaultSlurryParams)
|
||||
this.alcoholParams = createEmptyParams(defaultAlcoholParams)
|
||||
this.cleanParams = createEmptyParams(defaultCleanParams)
|
||||
this.extraAlcoholParams = createEmptyParams(defaultExtraAlcoholParams)
|
||||
this.$emit('update:dialogShow', false)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.table-section {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.table-title {
|
||||
font-size: 15px;
|
||||
font-weight: bold;
|
||||
color: #303133;
|
||||
margin: 0 0 10px 0;
|
||||
padding-left: 8px;
|
||||
border-left: 4px solid #409EFF;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
@@ -13,7 +13,19 @@
|
||||
class="filter-item"
|
||||
/>
|
||||
<rrOperation />
|
||||
<crudOperation :permission="permission" />
|
||||
<crudOperation :permission="permission">
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="success"
|
||||
:disabled="openParamFlag"
|
||||
icon="el-icon-position"
|
||||
size="mini"
|
||||
@click="openParamView"
|
||||
>
|
||||
其他球磨参数设置
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<!--表单组件-->
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
@@ -23,7 +35,10 @@
|
||||
size="mini"
|
||||
style="width: 100%;"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
@select="handleSelectionChange"
|
||||
@select-all="onSelectAll"
|
||||
>
|
||||
<el-table-column type="selection" width="55" fixed />
|
||||
<el-table-column prop="material_code" label="物料编码" min-width="130" fixed />
|
||||
<el-table-column prop="material_name" label="物料名称" min-width="100" fixed />
|
||||
|
||||
@@ -50,6 +65,7 @@
|
||||
</div>
|
||||
|
||||
<SetDialog :dialog-show.sync="setShow" :open-param="openParam" />
|
||||
<BallMillParamDialog :dialog-show.sync="ballMillShow" :open-param="openParam" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -62,11 +78,11 @@ import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import SetDialog from '@/views/wms/basedata/pdm/productProcessParam/SetDialog'
|
||||
import crudBagrecord from '@/api/wms/basedata/master/bagrecord'
|
||||
import BallMillParamDialog from '@/views/wms/basedata/pdm/productProcessParam/BallMillParamDialog'
|
||||
|
||||
export default {
|
||||
name: 'ProductProcessParam',
|
||||
components: { pagination, crudOperation, rrOperation, udOperation, SetDialog },
|
||||
components: { pagination, crudOperation, rrOperation, udOperation, SetDialog, BallMillParamDialog },
|
||||
mixins: [presenter(), header(), form(), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
@@ -87,8 +103,11 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
permission: {},
|
||||
currentRow: {},
|
||||
workprocedure_code: null,
|
||||
setShow: false,
|
||||
ballMillShow: false,
|
||||
openParamFlag: true,
|
||||
openParam: {},
|
||||
// 行转列:https://www.jb51.net/article/196058.htm
|
||||
cols: [],
|
||||
@@ -161,6 +180,32 @@ export default {
|
||||
this.crud.notify('删除成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
})
|
||||
})
|
||||
},
|
||||
handleSelectionChange(val, row) {
|
||||
if (val.length > 1) {
|
||||
this.$refs.table.clearSelection()
|
||||
this.$refs.table.toggleRowSelection(val.pop())
|
||||
this.currentRow = row
|
||||
this.openParamFlag = false
|
||||
} else if (val.length === 1) {
|
||||
this.currentRow = row
|
||||
this.openParamFlag = false
|
||||
} else {
|
||||
this.openParamFlag = true
|
||||
this.currentRow = {}
|
||||
}
|
||||
},
|
||||
onSelectAll() {
|
||||
this.$refs.table.clearSelection()
|
||||
this.openParamFlag = true
|
||||
this.currentRow = {}
|
||||
},
|
||||
openParamView() {
|
||||
this.openParam = {
|
||||
optRow: this.currentRow.material_id,
|
||||
workprocedure_code: this.workprocedure_code
|
||||
}
|
||||
this.ballMillShow = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -313,8 +313,8 @@ export default {
|
||||
crudSectattr.getSect({ 'is_materialstore': '1', 'sect_type_attr': '00' }).then(res => {
|
||||
this.sects = res.content
|
||||
})
|
||||
let area_type = ''
|
||||
if (this.billType === '000101' || this.billType === '000102' || this.billType === '000201' || this.billType === '000202' || this.billType === '000305') {
|
||||
let area_type = '\'21\''
|
||||
if (this.billType === '000101' || this.billType === '000102' || this.billType === '000201' || this.billType === '000202' || this.billType === '000203' || this.billType === '000305' || this.billType === '000103') {
|
||||
area_type = '\'21\''
|
||||
}
|
||||
if (this.billType === '000301' || this.billType === '000303' || this.billType === '000304') {
|
||||
|
||||
Reference in New Issue
Block a user