提交 3d408dfc 编写于 作者: doc_wei's avatar doc_wei

加工单验收逻辑修改

上级 3b58c2ef
......@@ -12,22 +12,28 @@ layui.config({
var id = GetUrlParam("id");
var machinMation;
AjaxPostUtil.request({url: sysMainMation.erpBasePath + "queryMachinById", params: {id: id}, type: 'json', method: 'GET', callback: function (json) {
machinMation = json.bean;
$.each(json.bean.machinChildList, function(i, item) {
item.unitPrice = parseFloat(item.unitPrice).toFixed(2);
item.quantityNum = item.acceptNum - item.belowNum;
item.stateName = skyeyeClassEnumUtil.getEnumDataNameByCodeAndKey("machinChildStateEnum", 'id', item.state, 'name');
if (item.state == 'waitForCheckig') {
if (i == (json.bean.machinChildList.length - 1)) {
item.operator = '<button type="button" class="layui-btn layui-btn-xs layui-btn-normal acceptance" rowId="' + item.id + '" subType="2">工序验收</button>';
} else {
item.operator = '<button type="button" class="layui-btn layui-btn-xs layui-btn-normal acceptance" rowId="' + item.id + '" subType="1">工序验收</button>';
loadData();
function loadData() {
var loadAcceptanceBtn = false;
AjaxPostUtil.request({url: sysMainMation.erpBasePath + "queryMachinById", params: {id: id}, type: 'json', method: 'GET', callback: function (json) {
machinMation = json.bean;
$.each(json.bean.machinChildList, function(i, item) {
item.unitPrice = parseFloat(item.unitPrice).toFixed(2);
item.quantityNum = item.acceptNum - item.belowNum;
item.stateName = skyeyeClassEnumUtil.getEnumDataNameByCodeAndKey("machinChildStateEnum", 'id', item.state, 'name');
if (item.state == 'waitForCheckig' && !loadAcceptanceBtn) {
loadAcceptanceBtn = true;
if (i == (json.bean.machinChildList.length - 1)) {
item.operator = '<button type="button" class="layui-btn layui-btn-xs layui-btn-normal acceptance" rowId="' + item.id + '" subType="2">工序验收</button>';
} else {
item.operator = '<button type="button" class="layui-btn layui-btn-xs layui-btn-normal acceptance" rowId="' + item.id + '" subType="1">工序验收</button>';
}
}
}
});
$("#showForm").html(getDataUseHandlebars($("#useTemplate").html(), json));
}});
});
$("#showForm").html(getDataUseHandlebars($("#useTemplate").html(), json));
}});
}
// 工序验收
$("body").on("click", ".acceptance", function() {
......@@ -40,6 +46,7 @@ layui.config({
area: ['90vw', '90vh'],
callBack: function (refreshCode) {
winui.window.msg(systemLanguage["com.skyeye.successfulOperation"][languageType], {icon: 1, time: 2000});
loadData();
}});
});
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册