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

update: 生产计划单微调

上级 d0b40f3f
layui.config({
base: basePath,
version: skyeyeVersion
}).extend({
window: 'js/winui.window'
}).define(['window', 'jquery', 'winui'], function (exports) {
winui.renderColor();
layui.use(['form'], function (form) {
var index = parent.layer.getFrameIndex(window.name);
var $ = layui.$;
AjaxPostUtil.request({url: flowableBasePath + "erpproduction006", params: {orderId: parent.rowId}, type: 'json', callback: function (json) {
$("#showForm").html(getDataUseHandlebars($("#beanTemplate").html(), json));
matchingLanguage();
form.render();
form.on('submit(formExamineBean)', function (data) {
if (winui.verifyForm(data.elem)) {
var msg = '确认提交吗?';
layer.confirm(msg, { icon: 3, title: '提交审批' }, function (i) {
layer.close(i);
var jStr = {
approvalContent: $("#opinion").val(),
state: $("input[name='flag']:checked").val(),
orderId: parent.rowId
};
AjaxPostUtil.request({url: flowableBasePath + "erpproduction008", params: jStr, type: 'json', callback: function (json) {
parent.layer.close(index);
parent.refreshCode = '0';
}});
});
}
return false;
});
}});
// 取消
$("body").on("click", "#cancle", function() {
parent.layer.close(index);
});
});
});
\ No newline at end of file
......@@ -7,9 +7,7 @@ layui.config({
}).extend({
window: 'js/winui.window'
}).define(['window', 'table', 'jquery', 'winui', 'form'], function (exports) {
winui.renderColor();
var $ = layui.$,
form = layui.form,
table = layui.table;
......@@ -20,7 +18,7 @@ layui.config({
id: 'messageTable',
elem: '#messageTable',
method: 'post',
url: flowableBasePath + 'erpproduction001',
url: sysMainMation.erpBasePath + 'erpproduction001',
where: getTableParams(),
even: true,
page: true,
......@@ -28,34 +26,33 @@ layui.config({
limit: getLimit(),
cols: [[
{ title: systemLanguage["com.skyeye.serialNumber"][languageType], type: 'numbers' },
{ field: 'defaultNumber', title: '生产单号', align: 'center', width: 200, templet: function (d) {
return '<a lay-event="details" class="notice-title-click">' + d.defaultNumber + '</a>';
}},
{ field: 'salesOrderNum', width: 200, title: '关联销售单', align: 'center'},
{ field: 'materialName', width: 150, title: '商品名称'},
{ field: 'materialModel', width: 150, title: '商品型号'},
{ field: 'number', width: 80, title: '计划数量'},
{ field: 'stateName', width: 80, align: 'center', title: '状态', templet: function (d) {
if(d.state == 1){
return "<span class='state-new'>" + d.stateName + "</span>";
} else if (d.state == 2){
return "<span>" + d.stateName + "</span>";
} else if (d.state == 3){
return "<span class='state-up'>" + d.stateName + "</span>";
} else if (d.state == 4){
return "<span class='state-down'>" + d.stateName + "</span>";
} else if (d.state == 5){
return "<span class='state-up'>" + d.stateName + "</span>";
} else {
return "参数错误";
}
{ field: 'oddNumber', title: '生产单号', align: 'center', width: 200, templet: function (d) {
return '<a lay-event="details" class="notice-title-click">' + d.oddNumber + '</a>';
}},
{ field: 'salesOrderNum', width: 200, title: '关联销售单', align: 'center' },
{ field: 'name', title: '产品名称', align: 'left',width: 150, templet: function (d) {return d.materialMation.name}},
{ field: 'model', title: '产品型号', align: 'left',width: 150, templet: function (d) {return d.materialMation.model}},
{ field: 'norms', title: '产品规格', align: 'left',width: 150, templet: function (d) {return d.normsMation.name}},
{ field: 'number', width: 100, title: '计划生产数量'},
{ field: 'processInstanceId', title: '流程ID', width: 100, templet: function (d) {
return '<a lay-event="processDetails" class="notice-title-click">' + d.processInstanceId + '</a>';
}},
{ field: 'state', title: '状态', width: 90, templet: function (d) {
return skyeyeClassEnumUtil.getEnumDataNameByCodeAndKey("productionState", 'id', d.state, 'name');
}},
{ field: 'planStartDate', width: 140, align: 'center', title: '计划开始时间'},
{ field: 'planComplateDate', width: 140, align: 'center', title: '计划结束时间'},
{ title: systemLanguage["com.skyeye.operation"][languageType], fixed: 'right', align: 'center', width: 240, toolbar: '#tableBar'}
{ field: 'createName', title: systemLanguage["com.skyeye.createName"][languageType], width: 120 },
{ field: 'createTime', title: systemLanguage["com.skyeye.createTime"][languageType], align: 'center', width: 150 },
{ field: 'lastUpdateName', title: systemLanguage["com.skyeye.lastUpdateName"][languageType], align: 'left', width: 120 },
{ field: 'lastUpdateTime', title: systemLanguage["com.skyeye.lastUpdateTime"][languageType], align: 'center', width: 150 },
{ title: systemLanguage["com.skyeye.operation"][languageType], fixed: 'right', align: 'center', width: 240, toolbar: '#tableBar'}
]],
done: function(json) {
matchingLanguage();
initTableSearchUtil.initAdvancedSearch(this, json.searchFilter, form, "请输入生产单号", function () {
table.reloadData("messageTable", {page: {curr: 1}, where: getTableParams()});
});
}
});
......@@ -70,35 +67,30 @@ layui.config({
details(data);
} else if (layEvent === 'subExamine') { //提交审核
subExamine(data);
} else if (layEvent === 'examine') { //审核
examine(data);
}
});
form.render();
form.on('submit(formSearch)', function (data) {
if (winui.verifyForm(data.elem)) {
refreshTable();
}
return false;
} else if (layEvent === 'processDetails') { // 工作流流程详情查看
activitiUtil.activitiDetails(data);
} else if (layEvent === 'revoke') { //撤销
revoke(data);
}
});
//删除
function del(data, obj) {
layer.confirm(systemLanguage["com.skyeye.deleteOperationMsg"][languageType], {icon: 3, title: systemLanguage["com.skyeye.deleteOperation"][languageType]}, function (index) {
layer.close(index);
AjaxPostUtil.request({url: flowableBasePath + "erpproduction005", params: {orderId: data.id}, type: 'json', callback: function (json) {
winui.window.msg(systemLanguage["com.skyeye.deleteOperationSuccessMsg"][languageType], {icon: 1, time: 2000});
// 新增
$("body").on("click", "#addBean", function() {
_openNewWindows({
url: systemCommonUtil.getUrl('FP2023092200001', null),
title: systemLanguage["com.skyeye.addPageTitle"][languageType],
pageId: "erpProductionAdd",
area: ['90vw', '90vh'],
callBack: function (refreshCode) {
winui.window.msg(systemLanguage["com.skyeye.successfulOperation"][languageType], {icon: 1, time: 2000});
loadTable();
}});
});
}
//编辑
}});
});
// 编辑
function edit(data) {
rowId = data.id;
_openNewWindows({
url: "../../tpl/erpProduction/erpProductionEdit.html",
url: systemCommonUtil.getUrl('FP2023092200002&id=' + data.id, null),
title: systemLanguage["com.skyeye.editPageTitle"][languageType],
pageId: "erpProductionEdit",
area: ['90vw', '90vh'],
......@@ -107,12 +99,11 @@ layui.config({
loadTable();
}});
}
//详情
// 详情
function details(data) {
rowId = data.id;
_openNewWindows({
url: "../../tpl/erpProduction/erpProductionDetail.html",
url: systemCommonUtil.getUrl('FP2023092200003&id=' + data.id, null),
title: systemLanguage["com.skyeye.detailsPageTitle"][languageType],
pageId: "erpProductionDetail",
area: ['90vw', '90vh'],
......@@ -120,66 +111,49 @@ layui.config({
}});
}
//提交审批
// 删除
function del(data, obj) {
layer.confirm(systemLanguage["com.skyeye.deleteOperationMsg"][languageType], {icon: 3, title: systemLanguage["com.skyeye.deleteOperation"][languageType]}, function (index) {
layer.close(index);
AjaxPostUtil.request({url: sysMainMation.erpBasePath + "deleteProductionById", params: {id: data.id}, type: 'json', method: 'DELETE', callback: function (json) {
winui.window.msg(systemLanguage["com.skyeye.deleteOperationSuccessMsg"][languageType], {icon: 1, time: 2000});
loadTable();
}});
});
}
// 提交审批
function subExamine(data) {
layer.confirm('确认要提交审核吗?', { icon: 3, title: '提交审核操作' }, function (index) {
AjaxPostUtil.request({url: flowableBasePath + "erpproduction007", params: {orderId: data.id}, type: 'json', callback: function (json) {
AjaxPostUtil.request({url: sysMainMation.erpBasePath + "erpproduction007", params: {id: data.id}, type: 'json', method: 'POST', callback: function (json) {
winui.window.msg("提交成功。", {icon: 1, time: 2000});
loadTable();
}});
});
}
//审核
function examine(data) {
rowId = data.id;
_openNewWindows({
url: "../../tpl/erpProduction/erpProductionExamine.html",
title: "审核",
pageId: "erpProductionExamine",
area: ['90vw', '90vh'],
callBack: function (refreshCode) {
winui.window.msg(systemLanguage["com.skyeye.successfulOperation"][languageType], {icon: 1, time: 2000});
loadTable();
}});
}
//刷新数据
$("body").on("click", "#reloadTable", function() {
loadTable();
});
//新增
$("body").on("click", "#addBean", function() {
_openNewWindows({
url: "../../tpl/erpProduction/erpProductionAdd.html",
title: systemLanguage["com.skyeye.addPageTitle"][languageType],
pageId: "erpProductionAdd",
area: ['90vw', '90vh'],
callBack: function (refreshCode) {
winui.window.msg(systemLanguage["com.skyeye.successfulOperation"][languageType], {icon: 1, time: 2000});
// 撤销
function revoke(data) {
layer.confirm('确认撤销该申请吗?', { icon: 3, title: '撤销操作' }, function (index) {
layer.close(index);
AjaxPostUtil.request({url: sysMainMation.erpBasePath + "revokeProduction", params: {processInstanceId: data.processInstanceId}, type: 'json', method: "PUT", callback: function (json) {
winui.window.msg("提交成功", {icon: 1, time: 2000});
loadTable();
}});
});
function loadTable() {
table.reloadData("messageTable", {where: getTableParams()});
}
//搜索
function refreshTable(){
table.reloadData("messageTable", {page: {curr: 1}, where: getTableParams()})
}
function getTableParams() {
return {
materialName: $("#materialName").val(),
materialModel: $("#materialModel").val(),
state: $("#state").val(),
defaultNumber: $("#defaultNumber").val(),
salesOrderNum: $("#salesOrderNum").val()
};
}
});
}
form.render();
$("body").on("click", "#reloadTable", function() {
loadTable();
});
function loadTable() {
table.reloadData("messageTable", {where: getTableParams()});
}
function getTableParams() {
return $.extend(true, {}, initTableSearchUtil.getSearchValue("messageTable"));
}
exports('erpProductionList', {});
});
<!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="padding:20px; margin:0 auto;">
<form class="layui-form" action="" id="showForm">
</form>
<script type="text/x-handlebars-template" id="beanTemplate">
{{#bean}}
<div class="layui-form-item layui-col-xs12">
<span class="hr-title">生产计划</span><hr>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">商品名称</label>
<div class="layui-input-block ver-center">
{{materialName}}
</div>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">销售单号</label>
<div class="layui-input-block ver-center">
{{defaultNumber}}
</div>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">商品型号</label>
<div class="layui-input-block ver-center">
{{materialModel}}
</div>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">计量单位</label>
<div class="layui-input-block ver-center">
{{unitName}}
</div>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">计划数量</label>
<div class="layui-input-block ver-center">
{{number}}
</div>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">计划开始时间</label>
<div class="layui-input-block ver-center">
{{planStartDate}}
</div>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">计划结束时间</label>
<div class="layui-input-block ver-center">
{{planComplateDate}}
</div>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">单据时间</label>
<div class="layui-input-block ver-center">
{{operTime}}
</div>
</div>
<div class="layui-form-item layui-col-xs12">
<label class="layui-form-label">备注说明</label>
<div class="layui-input-block ver-center">
{{remark}}
</div>
</div>
<div class="layui-form-item layui-col-xs12">
<span class="hr-title">生产工序</span><hr>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">工序资料</label>
<div class="layui-input-block">
{{#each procedureMationList}}
<span class="layui-badge layui-bg-blue" style="height: 25px !important; line-height: 25px !important; margin: 5px 0px;">{{procedureName}}
<span class="layui-badge layui-bg-gray">{{number}}</span>
</span>
<br>
{{/each}}
</div>
</div>
<div class="layui-form-item layui-col-xs12">
<span class="hr-title">生产建议</span><hr>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">生产方案</label>
<div class="layui-input-block ver-center">
{{title}}
</div>
</div>
<div class="layui-form-item layui-col-xs12">
<label class="layui-form-label">子件清单</label>
<div class="layui-input-block">
<div class="winui-tip alert-info" id="showInfo">
子件清单中如包含自产商品请单独下达生产计划单
</div>
<table class="layui-table">
<thead>
<tr>
<th>商品名称</th>
<th>型号</th>
<th>商品分类</th>
<th>商品来源</th>
<th>工序</th>
<th>单位所需数量</th>
<th>需求数量</th>
<th>待入库数量</th>
<th>建议采购/生产数量</th>
</tr>
</thead>
<tbody id="tBody">
{{#each childList}}
<tr rowid="{{productId}}">
<td id="name{{productId}}">{{productName}}</td>
<td id="model{{productId}}">{{productModel}}</td>
<td>{{categoryName}}</td>
<td>{{typeName}}</td>
<td>
{{#each procedureMationList}}
<span class="layui-badge layui-bg-gray">{{number}}</span>{{procedureName}}<br>
{{/each}}
</td>
<td style="text-align: center;">{{needNum}}{{unitName}}</td>
<td style="text-align: center;" id="needNum{{productId}}">{{needNum}}</td>
<td>{{beWarehousedNum}}</td>
<td>{{number}}</td>
</tr>
{{/each}}
</tbody>
</table>
</div>
</div>
<div class="layui-form-item layui-col-xs12">
<span class="hr-title">审批</span><hr>
</div>
<form class="layui-form" action="">
<div class="layui-form-item">
<label class="layui-form-label">审批结果<i class="red">*</i></label>
<div class="layui-input-block winui-radio">
<input type="radio" name="flag" value="3" title="同意" checked="checked"/>
<input type="radio" name="flag" value="4" title="拒绝" />
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">审批意见</label>
<div class="layui-input-block">
<textarea id="opinion" placeholder="请输入审批意见" maxlength="200" class="layui-textarea" style="height: 100px;"></textarea>
</div>
</div>
<div class="layui-input-block">
<button class="winui-btn" id="cancle"><language showName="com.skyeye.cancel"></language></button>
<button class="winui-btn" lay-submit lay-filter="formExamineBean">提交</button>
</div>
</form>
{{/bean}}
</script>
</div>
<script src="../../assets/lib/layui/layui.js"></script>
<script src="../../assets/lib/layui/custom.js"></script>
<script type="text/javascript">
layui.config({base: '../../js/erpProduction/'}).use('erpProductionExamine');
</script>
</body>
</html>
\ No newline at end of file
......@@ -7,65 +7,29 @@
<link href="../../assets/lib/winui/css/winui.css" rel="stylesheet" />
</head>
<body>
<div class="txtcenter" style="margin:0 auto;padding-top:10px;">
<form class="layui-form layui-form-pane" action="" autocomplete="off">
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">计划单号</label>
<div class="layui-input-inline">
<input id="defaultNumber" name="defaultNumber" class="layui-input" placeholder="请输入计划单号"/>
</div>
<label class="layui-form-label">销售单号</label>
<div class="layui-input-inline">
<input id="salesOrderNum" name="salesOrderNum" class="layui-input" placeholder="请输入销售单号"/>
</div>
<label class="layui-form-label">状态</label>
<div class="layui-input-inline">
<select lay-filter="state" lay-search="" id="state">
<option value="">全部</option>
<option value="1">新建</option>
<option value="2">审核中</option>
<option value="3">审核通过</option>
<option value="4">审核拒绝</option>
<option value="5">加工完成</option>
</select>
</div>
<label class="layui-form-label">商品名称</label>
<div class="layui-input-inline">
<input id="materialName" name="materialName" class="layui-input" placeholder="请输入商品名称"/>
</div>
<label class="layui-form-label">商品型号</label>
<div class="layui-input-inline">
<input id="materialModel" name="materialModel" class="layui-input" placeholder="请输入商品型号"/>
</div>
<button type="reset" class="layui-btn layui-btn-primary list-form-search"><language showName="com.skyeye.reset"></language></button>
<button class="layui-btn list-form-search" lay-submit lay-filter="formSearch"><language showName="com.skyeye.search2"></language></button>
</div>
</div>
</form>
</div>
<div class="winui-toolbar">
<div class="winui-tool">
<button id="reloadTable" class="winui-toolbtn"><i class="fa fa-refresh" aria-hidden="true"></i><language showName="com.skyeye.refreshDataBtn"></language></button>
<button id="addBean" class="winui-toolbtn" auth="1590913527206"><i class="fa fa-plus" aria-hidden="true"></i><language showName="com.skyeye.addBtn"></language></button>
<button id="reloadTable" class="winui-toolbtn search-table-btn-right"><i class="fa fa-refresh" aria-hidden="true"></i><language showName="com.skyeye.refreshDataBtn"></language></button>
<button id="addBean" class="winui-toolbtn search-table-btn-right" auth="1590913527206"><i class="fa fa-plus" aria-hidden="true"></i><language showName="com.skyeye.addBtn"></language></button>
</div>
</div>
<div style="margin:auto 10px;">
<table id="messageTable" lay-filter="messageTable"></table>
<script type="text/html" id="tableBar">
{{# if(d.state == 1 || d.state == 4){ }}
{{# if(auth('1590925927221')){ }}
<a class="layui-btn layui-btn-xs" lay-event="edit"><language showName="com.skyeye.editBtn"></language></a>
{{# if(d.editRow == 1) { }}
{{# if(auth('1591105857329')) { }}
<a class="layui-btn layui-btn-xs" lay-event="subApproval">提交审批</a>
{{# } }}
{{# if(auth('1590926876459')){ }}
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"><language showName="com.skyeye.deleteBtn"></language></a>
{{# if(auth('1590913527206')) { }}
<a class="layui-btn layui-btn-xs layui-btn-normal" lay-event="edit"><language showName="com.skyeye.editBtn"></language></a>
{{# } }}
{{# if(auth('1591105857329')){ }}
<a class="layui-btn layui-btn-xs" lay-event="subExamine">提交审核</a>
{{# if(auth('1590926876459')) { }}
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="delete"><language showName="com.skyeye.deleteBtn"></language></a>
{{# } }}
{{# } else if(d.state == 2) { }}
{{# if(auth('1591105866053')){ }}
<a class="layui-btn layui-btn-xs" lay-event="examine">审核</a>
{{# } }}
{{# if(d.editRow == 2) { }}
{{# if(auth('')) { }}
<a class="layui-btn layui-btn-xs layui-btn-danger" lay-event="revoke">撤销</a>
{{# } }}
{{# } }}
</script>
......
var rowId = "";
layui.config({
base: basePath,
version: skyeyeVersion
......@@ -97,7 +95,6 @@ layui.config({
// 编辑
function edit(data) {
rowId = data.id;
_openNewWindows({
url: systemCommonUtil.getUrl('FP2023042300002&id=' + data.id, null),
title: systemLanguage["com.skyeye.editPageTitle"][languageType],
......@@ -111,7 +108,6 @@ layui.config({
// 详情
function details(data) {
rowId = data.id;
_openNewWindows({
url: systemCommonUtil.getUrl('FP2023042300003&id=' + data.id, null),
title: systemLanguage["com.skyeye.detailsPageTitle"][languageType],
......
......@@ -16,19 +16,19 @@
<div style="margin:auto 10px;">
<table id="messageTable" lay-filter="messageTable"></table>
<script type="text/html" id="tableBar">
{{# if(d.editRow == 1){ }}
{{# if(auth('1591513626237')){ }}
{{# if(d.editRow == 1) { }}
{{# if(auth('1591513626237')) { }}
<a class="layui-btn layui-btn-xs" lay-event="subApproval">提交审批</a>
{{# } }}
{{# if(auth('1571813042536')){ }}
{{# if(auth('1571813042536')) { }}
<a class="layui-btn layui-btn-xs layui-btn-normal" lay-event="edit"><language showName="com.skyeye.editBtn"></language></a>
{{# } }}
{{# if(auth('1572484250823')){ }}
{{# if(auth('1572484250823')) { }}
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="delete"><language showName="com.skyeye.deleteBtn"></language></a>
{{# } }}
{{# } }}
{{# if(d.editRow == 2){ }}
{{# if(auth('1629466454798')){ }}
{{# if(d.editRow == 2) { }}
{{# if(auth('1629466454798')) { }}
<a class="layui-btn layui-btn-xs layui-btn-danger" lay-event="revoke">撤销</a>
{{# } }}
{{# } }}
......
......@@ -41,6 +41,7 @@
"erpOrderStateEnum": {"name": "ERP单据状态", "className": "skyeye-erp#com.skyeye.classenum.ErpOrderStateEnum"},
"supplierContractStateEnum": {"name": "供应商合同状态", "className": "skyeye-erp#com.skyeye.contract.classenum.SupplierContractStateEnum"},
"supplierContractAuthEnum": {"name": "供应商合同权限", "className": "skyeye-erp#com.skyeye.contract.classenum.SupplierContractAuthEnum", "pageUrl": "../../tpl/supplierContract/supplierContractList.html"},
"productionState": {"name": "生产计划单状态", "className": "skyeye-erp#com.skyeye.production.classenum.ProductionStateEnum"},
"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.
先完成此消息的编辑!
想要评论请 注册