Commit a666c2d2 by liuyang

2024-05-08 优化工序单价导入提示显示

parent c73ae9be
...@@ -83,7 +83,7 @@ public enum DdynamicEnum { ...@@ -83,7 +83,7 @@ public enum DdynamicEnum {
* 用途:工序编码下拉框 * 用途:工序编码下拉框
* 编写:ly * 编写:ly
*/ */
PROCESS_CODE_BLOCK_ID("processCode_block_id","processCode","processName","HGSJ001.queryProcessCode") PROCESS_CODE_BLOCK_ID("processCode_block_id","processCode","processName","factoryCode","factoryName","HGSJ001.queryProcessCode")
; ;
......
...@@ -33,12 +33,13 @@ public class ServiceHGSJ002A extends ServiceEPBase { ...@@ -33,12 +33,13 @@ public class ServiceHGSJ002A extends ServiceEPBase {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSJ002A.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0); inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSJ002A.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
//inInfo.setCell(EiConstant.queryBlock,ACConstants.ROW_CODE_0,HGPZ002A.FIELD_PARENT_ID,inInfo.get("inqu_status-0-parendId")); //inInfo.setCell(EiConstant.queryBlock,ACConstants.ROW_CODE_0,HGPZ002A.FIELD_PARENT_ID,inInfo.get("inqu_status-0-parendId"));
//inInfo.setCell(EiConstant.queryBlock,ACConstants.ROW_CODE_0,HGPZ002A.FIELD_FLOW_CODE,inInfo.get("inqu_status-0-flowCode")); //inInfo.setCell(EiConstant.queryBlock,ACConstants.ROW_CODE_0,HGPZ002A.FIELD_FLOW_CODE,inInfo.get("inqu_status-0-flowCode"));
//inInfo.setCell(EiConstant.queryBlock,ACConstants.ROW_CODE_0,HGPZ002A.FIELD_FLOW_NAME,inInfo.get("inqu_status-0-flowName")); String factoryCode = inInfo.getCell(EiConstant.queryBlock,ACConstants.ROW_CODE_0,HGSJ002A.FIELD_FACTORY_CODE).toString();
inInfo = super.query(inInfo, HGSJ002A.QUERY, new HGSJ002A()); inInfo = super.query(inInfo, HGSJ002A.QUERY, new HGSJ002A());
CommonMethod.initBlock(inInfo, CommonMethod.initBlock(inInfo,
Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID,DdynamicEnum.PROCESS_CODE_BLOCK_ID), Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID,DdynamicEnum.PROCESS_CODE_BLOCK_ID),
new HashMap<String,Object>(){{ new HashMap<String,Object>(){{
put("orgType", OrgTypeEnum.COMPANY.getCode()); put("orgType", OrgTypeEnum.COMPANY.getCode());
put(HGSJ002A.FIELD_FACTORY_CODE,factoryCode);
put(HGSJ002A.FIELD_DELETE_FLAG,CommonConstant.YesNo.NO_0);}} put(HGSJ002A.FIELD_DELETE_FLAG,CommonConstant.YesNo.NO_0);}}
); );
return inInfo; return inInfo;
......
...@@ -158,9 +158,11 @@ public class ServiceHGSJ003 extends ServiceEPBase { ...@@ -158,9 +158,11 @@ public class ServiceHGSJ003 extends ServiceEPBase {
// 重复校验 // 重复校验
String msg; String msg;
Map queryParam = new HashMap(); Map queryParam = new HashMap();
queryParam.put(HGSJ003.FIELD_ACCOUNT_CODE,hgsj003.getAccountCode()); //queryParam.put(HGSJ003.FIELD_ACCOUNT_CODE,hgsj003.getAccountCode());
queryParam.put(HGSJ003.FIELD_FACTORY_CODE,hgsj003.getFactoryCode());
queryParam.put(HGSJ003.FIELD_PROCESS_CODE, hgsj003.getProcessCode()); queryParam.put(HGSJ003.FIELD_PROCESS_CODE, hgsj003.getProcessCode());
queryParam.put(HGSJ003.FIELD_PROCESS_CLASS,hgsj003.getProcessClass()); queryParam.put(HGSJ003.FIELD_PROCESS_CLASS,hgsj003.getProcessClass());
queryParam.put(HGSJ003.FIELD_DELETE_FLAG,CommonConstant.YesNo.NO_0);
if (StringUtils.isBlank(hgsj003.getSpec())) { if (StringUtils.isBlank(hgsj003.getSpec())) {
queryParam.put("notSpec", CommonConstant.YesNo.YES); queryParam.put("notSpec", CommonConstant.YesNo.YES);
msg = String.format("工序编码[%s]已存在无规格,请勿重复添加!", hgsj003.getProcessCode()); msg = String.format("工序编码[%s]已存在无规格,请勿重复添加!", hgsj003.getProcessCode());
......
...@@ -281,10 +281,12 @@ ...@@ -281,10 +281,12 @@
<select id="queryProcessCode" parameterClass="java.util.HashMap" resultClass="java.util.HashMap"> <select id="queryProcessCode" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
SELECT SELECT
PROCESS_CODE as "processCode", <!-- 工序编码 --> PROCESS_CODE as "processCode", <!-- 工序编码 -->
PROCESS_NAME as "processName" <!-- 工序名称 --> CONCAT('[',FACTORY_NAME,']',PROCESS_NAME) as "processName", <!-- 工序名称 -->
FACTORY_CODE as "factoryCode", <!-- 厂区编码 -->
FACTORY_NAME as "factoryName" <!-- 厂区名称 -->
FROM ${hggpSchema}.HGGY001 WHERE 1=1 FROM ${hggpSchema}.HGGY001 WHERE 1=1
<include refid="condition" /> <include refid="condition" />
group by PROCESS_CODE,PROCESS_NAME group by PROCESS_CODE,PROCESS_NAME,FACTORY_CODE,FACTORY_NAME
</select> </select>
......
...@@ -499,7 +499,7 @@ public class ExcelUtils { ...@@ -499,7 +499,7 @@ public class ExcelUtils {
msg = String.format("工序编码[%s]已存在无规格,请勿重复添加!", hgsj003.getProcessCode()); msg = String.format("工序编码[%s]已存在无规格,请勿重复添加!", hgsj003.getProcessCode());
} else { } else {
queryParam.put("spec", hgsj003.getSpec()); queryParam.put("spec", hgsj003.getSpec());
msg = String.format("工厂[%s]工序编码[%s]已存在规格[%s],请勿重复添加!", hgsj003.getFactoryCode(), hgsj003.getProcessCode(), hgsj003.getSpec()); msg = String.format("公司[%s]工序名称[%s]已存在规格[%s],请勿重复添加!", hgsj003.getFactoryName(), hgsj003.getProcessName(), hgsj003.getSpec());
} }
List<HGSJ003> hgsj003List = dao.query(HGSJ003.QUERY, queryParam); List<HGSJ003> hgsj003List = dao.query(HGSJ003.QUERY, queryParam);
AssertUtils.isNotEmpty(hgsj003List, msg); AssertUtils.isNotEmpty(hgsj003List, msg);
......
...@@ -51,6 +51,18 @@ $(function (){ ...@@ -51,6 +51,18 @@ $(function (){
}, },
}, { }, {
field: "processCode", field: "processCode",
filter: function (options) {
var factoryCode = options.model['factoryCode'];
if(factoryCode) {
// 返回我们过滤后的数据集
/*return options.values[0][province];*/
return _.filter(processCodes, function (item) {
return item["param1Field"]==factoryCode;
})
} else {
return processCodes;
}
},
template: function (dataItem) { template: function (dataItem) {
for (let i = 0; i < processCodes.length; i++) { for (let i = 0; i < processCodes.length; i++) {
if (processCodes[i]['valueField'] === dataItem['processCode']) { if (processCodes[i]['valueField'] === dataItem['processCode']) {
...@@ -88,8 +100,28 @@ $(function (){ ...@@ -88,8 +100,28 @@ $(function (){
} }
], ],
loadComplete: function(grid) { loadComplete: function(grid) {
// 此 grid 对象
// 处理父子级联动,通过监听 change 事件,判断父级节点是否发生变化
grid.dataSource.bind("change", function(e) {
// 判断父级节点是否发生变化
if (e.field == "factoryCode") {
loadChange(grid,e,"processCode");
}else if (e.field == "processCode") {
if (e.items[0].factoryCode.length===0){
loadChange(grid,e,"factoryCode");
}
}
});
}, },
afterEdit:function (e) { afterEdit:function (e) {
if (e.field === "processCode" && e.model["factoryCode"].length === 0){
for (let i = 0; i < processCodes.length; i++) {
if (e.model[e.field] === processCodes[i]["valueField"]){
e.model["factoryCode"] = processCodes[i]["param1Field"]
break;
}
}
}
}, },
onSave: function (e) { onSave: function (e) {
// 阻止默认请求,使用自定义保存 // 阻止默认请求,使用自定义保存
...@@ -166,6 +198,7 @@ $(function (){ ...@@ -166,6 +198,7 @@ $(function (){
{msg: ei.msg, detailMsg: ei.detailMsg}, "error"); {msg: ei.msg, detailMsg: ei.detailMsg}, "error");
} else { } else {
NotificationUtil(ei.msg); NotificationUtil(ei.msg);
query();
} }
}, },
onFail(ei) { onFail(ei) {
...@@ -183,6 +216,26 @@ $(function (){ ...@@ -183,6 +216,26 @@ $(function (){
} }
} }
//工厂类型下拉联动
$('input[name="inqu_status-0-factoryCode"]').change(function () {
let dataEdition= processCodes;
var factoryCode=$("#inqu_status-0-factoryCode").val();
if (factoryCode){
dataEdition = _.filter(processCodes, function (item) {
return item["param1Field"]==factoryCode;
})
}
var input=$("#inqu_status-0-processCode");
input.kendoDropDownList({
valuePrimitive: true,
dataTextField: "textField",
dataValueField: "valueField",
optionLabel:"请选择",
dataSource: dataEdition,
template: "#=textField#"
});
});
//grush.downloadFile(`${ctx}\\DC\\BB\\template\\DCAMIN02_附加费用管理.xls`); //grush.downloadFile(`${ctx}\\DC\\BB\\template\\DCAMIN02_附加费用管理.xls`);
}) })
...@@ -217,11 +270,9 @@ let save = function (btnNode) { ...@@ -217,11 +270,9 @@ let save = function (btnNode) {
if(flag) { if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", { JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () { ok: function () {
JSUtils.submitGridsData("result", "HGSJ003", "save", true, JSUtils.submitGridsData("result", "HGSJ003", "save", true);
function (e) {
query();
});
btnNode.attr("disabled", false); btnNode.attr("disabled", false);
} }
}); });
} }
...@@ -244,3 +295,25 @@ function updateStatus(id,status) { ...@@ -244,3 +295,25 @@ function updateStatus(id,status) {
} }
); );
} }
function loadChange(grid,e,field) {
var cell_label = field,that = grid;
// locked 表示是否为固定列
var locked = that.isCellLocked(cell_label);
// tr 表示 locked 和非 locked 的行,index 表示此行的第几列
var tr,index;
// 获取此 model 元素信息
var item = e.items[0];
var _uid = item.uid;
if (locked) {
tr = $(".k-grid-content-locked tr[data-uid="+ _uid +"]");
index = $("th[data-field='"+cell_label+"']").data("index");
} else {
tr = $(".k-grid-content tr[data-uid="+ _uid +"]");
index = parseInt($("th[data-field='"+cell_label+"']").data("index")) - that.lockedHeader.find("th").length;
}
// 获取子 cell(td)
var td = tr.children("td:eq("+index+")");
// 触发 td.click 事件,
td.trigger("click");
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment