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

加工单验收完成

上级 eb48085a
......@@ -60,6 +60,8 @@ layui.config({
var layEvent = obj.event;
if (layEvent === 'details') { // 详情
details(data);
} else if (layEvent === 'machinAccept') { //工序验收
machinAccept(data);
}
});
......@@ -74,6 +76,19 @@ layui.config({
}});
}
// 工序验收
function machinAccept(data) {
_openNewWindows({
url: "../../tpl/erpMachin/machinAccept.html?id=" + data.id,
title: '工序验收',
pageId: "machinAccept",
area: ['90vw', '90vh'],
callBack: function (refreshCode) {
winui.window.msg(systemLanguage["com.skyeye.successfulOperation"][languageType], {icon: 1, time: 2000});
loadTable();
}});
}
form.render();
$("body").on("click", "#reloadTable", function() {
loadTable();
......
......@@ -4,90 +4,89 @@ layui.config({
version: skyeyeVersion
}).extend({
window: 'js/winui.window'
}).define(['window', 'jquery', 'winui'], function (exports) {
}).define(['window', 'jquery', 'winui', 'form'], function (exports) {
winui.renderColor();
layui.use(['form'], function (form) {
var index = parent.layer.getFrameIndex(window.name);
var $ = layui.$,
form = layui.form;
var selOption = getFileContent('tpl/template/select-option.tpl');
// 提交类型,1.工序验收;2.生成验收单
var subType = 1;
subType = parent.subType;
if(subType == 1){
$("#depotIdBox").remove();
var index = parent.layer.getFrameIndex(window.name);
var $ = layui.$,
form = layui.form;
var selOption = getFileContent('tpl/template/select-option.tpl');
// 提交类型,1.工序验收;2.生成验收单
var subType = GetUrlParam("subType");
var id = GetUrlParam("id");
var needNum = parseInt(GetUrlParam("needNum"));
$("#acceptNum").val(needNum);
$("#quantityNum").val(needNum);
if(subType == 1){
$("#depotIdBox").remove();
} else {
erpOrderUtil.getDepotList(function (json){
// 加载仓库数据
$("#depotId").html(getDataUseHandlebars(selOption, json));
form.render('select');
});
}
$("body").on("input", "#acceptNum", function() {
calcNum(1);
});
$("body").on("change", "#acceptNum", function() {
calcNum(1);
});
$("body").on("input", "#belowNum", function() {
calcNum(2);
});
$("body").on("change", "#belowNum", function() {
calcNum(2);
});
function calcNum(type){
var changeNum = 0;
if(type == 1){
changeNum = parseInt(isNull($("#acceptNum").val()) ? "0" : $("#acceptNum").val());
$("#belowNum").val(needNum - changeNum);
} else {
erpOrderUtil.getDepotList(function (json){
// 加载仓库数据
$("#depotId").html(getDataUseHandlebars(selOption, json));
form.render('select');
});
changeNum = parseInt(isNull($("#belowNum").val()) ? "0" : $("#belowNum").val());
$("#acceptNum").val(needNum - changeNum);
}
var needNum = parent.needNum;
$("#needNum").val(needNum);
$("#acceptNum").val(needNum);
$("body").on("input", "#acceptNum", function() {
calcNum(1);
});
$("body").on("change", "#acceptNum", function() {
calcNum(1);
});
$("body").on("input", "#belowNum", function() {
calcNum(2);
});
$("body").on("change", "#belowNum", function() {
calcNum(2);
});
function calcNum(type){
var changeNum = 0;
if(type == 1){
changeNum = parseInt(isNull($("#acceptNum").val()) ? "0" : $("#acceptNum").val());
$("#belowNum").val(needNum - changeNum);
} else {
changeNum = parseInt(isNull($("#belowNum").val()) ? "0" : $("#belowNum").val());
$("#acceptNum").val(needNum - changeNum);
}
matchingLanguage();
form.render();
form.on('submit(formAddBean)', function (data) {
if (winui.verifyForm(data.elem)) {
if (parseInt(isNull($("#quantityNum").val()) ? "0" : $("#quantityNum").val()) < 0) {
winui.window.msg('合格数量不能小于0.', {icon: 2, time: 2000});
return false;
}
if (parseInt(isNull($("#belowNum").val()) ? "0" : $("#belowNum").val()) < 0) {
winui.window.msg('不合格数量不能小于0.', {icon: 2, time: 2000});
return false;
}
if (parseInt($("#belowNum").val()) + parseInt($("#quantityNum").val()) != needNum) {
winui.window.msg('合格数量以及不合格数量总和与总量不匹配.', {icon: 2, time: 2000});
return false;
}
var params = {
childId: id,
acceptNum: $("#acceptNum").val(),
belowNum: $("#belowNum").val(),
depotId: (subType == 1) ? "" : $("#depotId").val()
};
AjaxPostUtil.request({url: sysMainMation.erpBasePath + "erpmachin012", params: params, type: 'json', callback: function (json) {
parent.layer.close(index);
parent.refreshCode = '0';
}});
}
matchingLanguage();
form.render();
form.on('submit(formAddBean)', function (data) {
if (winui.verifyForm(data.elem)) {
if(parseInt(isNull($("#acceptNum").val()) ? "0" : $("#acceptNum").val()) < 0){
winui.window.msg('合格数量不能小于0.', {icon: 2, time: 2000});
return false;
}
if(parseInt(isNull($("#belowNum").val()) ? "0" : $("#belowNum").val()) < 0){
winui.window.msg('不合格数量不能小于0.', {icon: 2, time: 2000});
return false;
}
var params = {
childId: parent.childId,
acceptNum: $("#acceptNum").val(),
belowNum: $("#belowNum").val(),
depotId: (subType == 1) ? "" : $("#depotId").val()
};
AjaxPostUtil.request({url: flowableBasePath + "erpmachin012", params: params, type: 'json', callback: function (json) {
parent.layer.close(index);
parent.refreshCode = '0';
}});
}
return false;
});
// 取消
$("body").on("click", "#cancle", function() {
parent.layer.close(index);
});
return false;
});
// 取消
$("body").on("click", "#cancle", function() {
parent.layer.close(index);
});
});
\ No newline at end of file
......@@ -78,7 +78,7 @@ layui.config({
// 添加
$("body").on("click", "#addBean", function() {
_openNewWindows({
url: systemCommonUtil.getUrl('FP2023100300001', null),
url: systemCommonUtil.getUrl('FP2023100300001', null),
title: systemLanguage["com.skyeye.addPageTitle"][languageType],
pageId: "erpMachinAdd",
area: ['90vw', '90vh'],
......@@ -91,7 +91,7 @@ layui.config({
// 编辑
function edit(data) {
_openNewWindows({
url: systemCommonUtil.getUrl('FP2023100300002&id=' + data.id, null),
url: systemCommonUtil.getUrl('FP2023100300002&id=' + data.id, null),
title: systemLanguage["com.skyeye.editPageTitle"][languageType],
pageId: "erpMachinEdit",
area: ['90vw', '90vh'],
......@@ -104,7 +104,7 @@ layui.config({
// 详情
function details(data) {
_openNewWindows({
url: systemCommonUtil.getUrl('FP2023100300003&id=' + data.id, null),
url: systemCommonUtil.getUrl('FP2023100300003&id=' + data.id, null),
title: systemLanguage["com.skyeye.detailsPageTitle"][languageType],
pageId: "erpMachinDetails",
area: ['90vw', '90vh'],
......
layui.config({
base: basePath,
version: skyeyeVersion
}).extend({
window: 'js/winui.window'
}).define(['window', 'jquery', 'winui', 'form'], function (exports) {
winui.renderColor();
var index = parent.layer.getFrameIndex(window.name);
var $ = layui.$,
form = layui.form;
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>';
}
}
});
$("#showForm").html(getDataUseHandlebars($("#useTemplate").html(), json));
}});
// 工序验收
$("body").on("click", ".acceptance", function() {
var id = $(this).attr('rowId');
var subType = $(this).attr('subType');
_openNewWindows({
url: "../../tpl/erpMachin/erpMachinAcceptance.html?id=" + id + '&subType=' + subType + '&needNum=' + machinMation.needNum,
title: '工序验收',
pageId: "acceptance",
area: ['90vw', '90vh'],
callBack: function (refreshCode) {
winui.window.msg(systemLanguage["com.skyeye.successfulOperation"][languageType], {icon: 1, time: 2000});
}});
});
});
\ No newline at end of file
......@@ -18,6 +18,11 @@
<table id="messageTable" lay-filter="messageTable"></table>
<script type="text/html" id="tableBar">
{{# if(d.state == 'pass') { }}
{{# if(auth('1696385978429')) { }}
<a class="layui-btn layui-btn-xs layui-btn-normal" lay-event="machinAccept">工序验收</a>
{{# } }}
{{# } }}
</script>
</div>
<script src="../../assets/lib/layui/layui.js"></script>
......
......@@ -15,7 +15,7 @@
<div class="layui-form-item layui-col-xs12">
<label class="layui-form-label">待验收数量:</label>
<div class="layui-input-block">
<input type="text" id="needNum" name="needNum" placeholder="请输入待验收数量" class="layui-input" readonly="readonly"/>
<input type="text" id="acceptNum" name="acceptNum" placeholder="请输入待验收数量" class="layui-input" readonly="readonly"/>
</div>
</div>
<div class="layui-form-item layui-col-xs12" id="depotIdBox">
......@@ -29,7 +29,7 @@
<div class="layui-form-item layui-col-xs12">
<label class="layui-form-label">合格数量<i class="red">*</i></label>
<div class="layui-input-block">
<input type="text" id="acceptNum" name="acceptNum" placeholder="请输入合格数量" class="layui-input" value="0" win-verify="required|number"/>
<input type="text" id="quantityNum" name="quantityNum" placeholder="请输入合格数量" class="layui-input" value="0" win-verify="required|number"/>
</div>
</div>
<div class="layui-form-item layui-col-xs12">
......
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<link href="../../assets/lib/layui/css/layui.css" rel="stylesheet" />
<link href="../../assets/lib/winui/css/winui.css" rel="stylesheet" />
</head>
<body>
<div style="height: 100%">
<div class="layui-tab">
<ul class="layui-tab-title">
<li class="layui-this" id="orderMationLi">工序验收信息</li>
</ul>
<div class="layui-tab-content">
<div class="layui-tab-item layui-show">
<form class="layui-form" action="" id="showForm">
</form>
</div>
</div>
</div>
</div>
<!-- useTemplate -->
<script type="text/x-handlebars-template" id="useTemplate">
{{#bean}}
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">工序资料</label>
<div class="layui-input-block">
<table class="layui-table" style="table-layout: fixed">
<thead>
<tr>
<th style="width: 60px;">工序编号</th>
<th style="width: 80px;">工序名称</th>
<th style="width: 140px;">验收单号</th>
<th style="width: 60px;">加工单价</th>
<th style="width: 80px;">加工部门</th>
<th style="width: 60px;">验收数</th>
<th style="width: 60px;">合格数</th>
<th style="width: 60px;">不合格数</th>
<th style="width: 100px; text-align: center;">条形码</th>
<th style="width: 60px; text-align: center;">状态</th>
<th style="width: 80px; text-align: center;">操作</th>
</tr>
</thead>
<tbody id="procedureBody">
{{#each machinChildList}}
<tr>
<td>{{procedureMation.number}}</td>
<td>{{procedureMation.name}}</td>
<td>{{oddNumber}}</td>
<td>{{procedureMation.unitPrice}}</td>
<td>{{procedureMation.departmentMation.name}}</td>
<td>{{acceptNum}}</td>
<td>{{quantityNum}}</td>
<td>{{belowNum}}</td>
<td><img class="barCode" src="{{barCodeMation.imagePath}}" style="width: 150px;"/></td>
<td>{{{stateName}}}</td>
<td>{{{operator}}}</td>
</tr>
{{/each}}
</tbody>
</table>
</div>
</div>
{{/bean}}
</script>
<script src="../../assets/lib/layui/layui.js"></script>
<script src="../../assets/lib/layui/custom.js"></script>
<script type="text/javascript">
layui.config({base: '../../js/erpMachin/'}).use('machinAccept');
</script>
</body>
</html>
\ No newline at end of file
......@@ -44,6 +44,7 @@
"productionState": {"name": "生产计划单状态", "className": "skyeye-erp#com.skyeye.production.classenum.ProductionStateEnum"},
"machinStateEnum": {"name": "加工单状态", "className": "skyeye-erp#com.skyeye.machin.classenum.MachinStateEnum"},
"machinPickStateEnum": {"name": "加工单领料状态", "className": "skyeye-erp#com.skyeye.machin.classenum.MachinPickStateEnum"},
"machinChildStateEnum": {"name": "工序验收单状态", "className": "skyeye-erp#com.skyeye.machin.classenum.MachinChildStateEnum"},
"skyeyeView": {"name": "视图类型", "className": "skyeye-pro#com.skyeye.common.SkyeyeViewEnum"},
"widthScale": {"name": "宽度比例", "className": "skyeye-pro#com.skyeye.attr.classenum.WidthScale"},
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册