Commit f8296b1d by 江和松

物料清单增加批量提交功能

parent ac4c1c7c
...@@ -103,7 +103,7 @@ public class HGSC005A extends DaoEPBase { ...@@ -103,7 +103,7 @@ public class HGSC005A extends DaoEPBase {
public static final String INSERT = "HGSC005A.insert"; public static final String INSERT = "HGSC005A.insert";
public static final String UPDATE = "HGSC005A.update"; public static final String UPDATE = "HGSC005A.update";
public static final String DELETE = "HGSC005A.delete"; public static final String DELETE = "HGSC005A.delete";
public static final String BATCH_DELETE = "HGSC005.batch_delete"; public static final String BATCH_DELETE = "HGSC005A.batch_delete";
public static final String UPDATE_PLAN_DATE = "HGSC005A.update_plan_date"; public static final String UPDATE_PLAN_DATE = "HGSC005A.update_plan_date";
private Long id = new Long(0); private Long id = new Long(0);
......
...@@ -221,6 +221,9 @@ ...@@ -221,6 +221,9 @@
<isNotEmpty prepend=" AND " property="materialId"> <isNotEmpty prepend=" AND " property="materialId">
a.material_id = #materialId# a.material_id = #materialId#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="materialId">
a.material_id = #materialId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="id"> <isNotEmpty prepend=" AND " property="id">
a.id = #id# a.id = #id#
</isNotEmpty> </isNotEmpty>
...@@ -235,7 +238,7 @@ ...@@ -235,7 +238,7 @@
</select> </select>
<select id="queryTechFlowIdByProductId" parameterClass="java.util.HashMap" <select id="queryTechFlowIdByProductId" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.sc.domain.HGSC004A"> resultClass="Long">
SELECT SELECT
b.flow_id as "techFlowId" b.flow_id as "techFlowId"
FROM ${hggpSchema}.hgpz005 b FROM ${hggpSchema}.hgpz005 b
...@@ -243,6 +246,9 @@ ...@@ -243,6 +246,9 @@
<isNotEmpty prepend=" AND " property="productId"> <isNotEmpty prepend=" AND " property="productId">
b.id = #productId# b.id = #productId#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="productIds">
b.id IN <iterate close=")" open="(" conjunction="," property="productIds">#productIds[]#</iterate>
</isNotEmpty>
<dynamic prepend="ORDER BY"> <dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy"> <isNotEmpty property="orderBy">
$orderBy$ $orderBy$
......
...@@ -8,8 +8,11 @@ $(function () { ...@@ -8,8 +8,11 @@ $(function () {
$("#QUERY").on("click", function () { $("#QUERY").on("click", function () {
query(); query();
}); });
// 批量提交
$("#BATCH_SUBMIT").on("click", batchSubmit);
let inventNameGlobalData = []; let inventNameGlobalData = [];
let parentId = ''; let parentId = '';
var strs; var strs;
...@@ -30,6 +33,7 @@ $(function () { ...@@ -30,6 +33,7 @@ $(function () {
* @param options: 树的配置项 * @param options: 树的配置项
*/ */
query: function (postEiInfo, model) { query: function (postEiInfo, model) {
postEiInfo.set("companyCode",companyCode ? companyCode : null); postEiInfo.set("companyCode",companyCode ? companyCode : null);
postEiInfo.set("projCode",projCode ? projCode : null); postEiInfo.set("projCode",projCode ? projCode : null);
postEiInfo.set("materialId",$("#inqu_status-0-materialId").val()); postEiInfo.set("materialId",$("#inqu_status-0-materialId").val());
...@@ -111,6 +115,8 @@ $(function () { ...@@ -111,6 +115,8 @@ $(function () {
let status = item.productStatus; let status = item.productStatus;
let changeType = item.changeType; let changeType = item.changeType;
let template = ''; let template = '';
// template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
// + 'onclick="saveDetail()" >保存</a>';
if (item.id){ if (item.id){
if(changeType != 0){ if(changeType != 0){
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
...@@ -120,10 +126,12 @@ $(function () { ...@@ -120,10 +126,12 @@ $(function () {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="updateProductStatus(' + item.id + ',1)" >提交</a>'; + 'onclick="updateProductStatus(' + item.id + ',1)" >提交</a>';
} }
// else if (status == 1) { if(changeType != 3){
// template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' + template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
// 'onclick="updateProductStatus(' + item.id + ',0)" >取消提交</a>'; + 'onclick="deteleDetail(' + item.id + ')" >删除</a>';
// } }
} }
return template; return template;
} }
...@@ -257,13 +265,13 @@ $(function () { ...@@ -257,13 +265,13 @@ $(function () {
let totalWeight = item.quantity * item.singleWeight; let totalWeight = item.quantity * item.singleWeight;
resultGrid.setCellValue(item, 'totalWeight', totalWeight) resultGrid.setCellValue(item, 'totalWeight', totalWeight)
} }
loadChange(grid,e,"singleWeight");
} }
if (e.field == "singleWeight") { if (e.field == "singleWeight") {
if(item.quantity && item.singleWeight){ if(item.quantity && item.singleWeight){
let totalWeight = item.quantity * item.singleWeight; let totalWeight = item.quantity * item.singleWeight;
resultGrid.setCellValue(item, 'totalWeight', totalWeight) resultGrid.setCellValue(item, 'totalWeight', totalWeight)
} }
loadChange(grid,e,"totalWeight");
} }
}); });
}, },
...@@ -444,7 +452,7 @@ $(function () { ...@@ -444,7 +452,7 @@ $(function () {
}); });
}); });
$(window).load(function () { $(window).load(function () {
query(); // query();
}); });
/** /**
...@@ -636,23 +644,104 @@ function showDetail(id) { ...@@ -636,23 +644,104 @@ function showDetail(id) {
} }
function updateProductStatus(id,status) { function updateProductStatus(id,status) {
let inEiInfo = new EiInfo(); JSUtils.confirm("确定是否\"删除\"操作? ", {
inEiInfo.set("result-0-id", id); ok: function () {
inEiInfo.set("result-0-productStatus", status); let inEiInfo = new EiInfo();
inEiInfo.set("result-0-materialId", $("#inqu_status-0-materialId").val()); inEiInfo.set("result-0-id", id);
EiCommunicator.send('HGSC004A', 'updateProductStatus', inEiInfo, { inEiInfo.set("result-0-productStatus", status);
onSuccess(response) { inEiInfo.set("result-0-materialId", $("#inqu_status-0-materialId").val());
NotificationUtil(response.msg); EiCommunicator.send('HGSC004A', 'updateProductStatus', inEiInfo, {
query(); onSuccess(response) {
}, NotificationUtil(response.msg);
onFail(errorMessage, status, e) { query();
NotificationUtil("执行失败!", "error"); refreshTree();
} },
}, { onFail(errorMessage, status, e) {
async: false NotificationUtil("执行失败!", "error");
}
}, {
async: false
}
);
} }
); });
} }
function saveDetail() {
JSUtils.confirm("确定是否\"保存\"操作? ", {
ok: function () {
var inEiInfo = new EiInfo();
inEiInfo.setByNode("result");
EiCommunicator.send('HGSC004A', 'save', inEiInfo, {
onSuccess(response) {
NotificationUtil(response.msg);
query();
refreshTree();
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
}, {
async: false
}
);
}
});
}
function deteleDetail(id) {
JSUtils.confirm("确定是否\"删除\"操作? ", {
ok: function () {
let inEiInfo = new EiInfo();
inEiInfo.set("result-0-id", id);
inEiInfo.set("result-0-materialId", $("#inqu_status-0-materialId").val());
EiCommunicator.send('HGSC004A', 'delete', inEiInfo, {
onSuccess(response) {
NotificationUtil(response.msg);
query();
refreshTree();
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
}, {
async: false
}
);
}
});
}
/**
* 提交操作
*
* @param id
* @param checkNo
*/
let batchSubmit = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据")
return;
}
for (let i = 0; i < rows.length; i++) {
let singleWeight = rows[i]['singleWeight'];
let quantity = rows[i]['quantity'];
if (!isNumber(singleWeight) || !isNumber(quantity)) {
message("第" + (i + 1) + "行单重和数量必须是大于等于0的数字");
return;
}
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做提交操作吗? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGSC004A", "updateProductStatus", true);
}
});
}
function loadChange(grid,e,field) { function loadChange(grid,e,field) {
var cell_label = field,that = grid; var cell_label = field,that = grid;
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
<div id="right-pane" class="i-fit-height" style="width: 80%;float: right"> <div id="right-pane" class="i-fit-height" style="width: 80%;float: right">
<EF:EFRegion id="result" title="明细信息"> <EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="no" checkMode="single"> <EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" cname="主键" hidden="true"/> <EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="lv" cname="层级" hidden="true"/> <EF:EFColumn ename="lv" cname="层级" hidden="true"/>
<EF:EFColumn enable="false" ename="parentProdCode" hidden="true" cname="上级产品编号"/> <EF:EFColumn enable="false" ename="parentProdCode" hidden="true" cname="上级产品编号"/>
......
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