Commit 67a4f76d authored by 鲁鑫's avatar 鲁鑫

ECN变更单优化

parent be8d87ab
......@@ -5,13 +5,29 @@ $(document).ready(function () {
loadGrid();
loadStockGrid();
bindEvent();
//$("#reasonForChangeMATERIAL CHANGE").remove();
});
function initialize(){
UICtrl.layout("#layout", {leftWidth: 3});
$('#changeList').fileList({
bizId : $("#id").val()
});
$("#deptNameAndPersonName").val($("#deptName").val()+"-"+$("#personMemberName").val())
$(".hg-form-list option[value='MATERIAL CHANGE']").remove();
// var reasonForChange = $("#reasonForChangeMATERIAL CHANGE").checked;
// if (reasonForChange){
// //涉及成品编码+旧原材料库存+涉及原材料成品库存 true
// materialChangeOtherRequire();
// //成品变更:产品代号+产品名称+制程工艺+原材料+其他 false
// noMaterialChangeNoRequire();
//
// }else {
// //成品变更:产品代号+产品名称+制程工艺+原材料+其他 true
// noMaterialChangeRequire();
// //涉及成品编码+旧原材料库存+涉及原材料成品库存 false
// materialChangeOtherNoRequire();
// }
//$("#deptNameAndPersonName").val($("#deptName").val()+"-"+$("#personMemberName").val())
}
function bindEvent(){
......@@ -46,46 +62,99 @@ function bindEvent(){
onChange: function (value, data) {
$('#pd').val(value.value);
$('#changedPd').val(value.value);
$('#productName').val(value.text);
$('#changedProductName').val(value.text);
//$('#productName').val(value.text);
//$('#changedProductName').val(value.text);
}
});
$('#process').searchbox({
type: "system", name: "queryProductAndBom",
// checkbox:true,
// checkboxIndex:"process",
// textIndex:"material,",
// valueIndex:"process",
// idIndex:"productionSolutionId",
getParam: function (item) {
return {
filterValue:$('#pd').val()
}
// $('#process').searchbox({
// type: "system", name: "queryProductAndBom",
// // checkbox:true,
// // checkboxIndex:"process",
// // textIndex:"material,",
// // valueIndex:"process",
// // idIndex:"productionSolutionId",
// getParam: function (item) {
// return {
// filterValue:$('#pd').val()
// }
// },
// onChange: function (value, data) {
// $('#process').val(data.process);
// $('#material').val(data.material);
// $('#productionSolutionId').val(data.productionSolutionId);
// }
// });
// $('input[name="reasonForChange"]').change(function () {
// //变更后的制程工艺和原材料可以不必填,原材料变更不需要
// if ($(this).is(':checked')) {
// if ($(this).val() == "MATERIAL CHANGE"){
// //涉及成品编码+旧原材料库存+涉及原材料成品库存 true
// materialChangeOtherRequire();
// //成品变更:产品代号+产品名称+制程工艺+原材料+其他 false
// noMaterialChangeNoRequire();
//
// }else {
// //成品变更:产品代号+产品名称+制程工艺+原材料+其他 true
// noMaterialChangeRequire();
// //涉及成品编码+旧原材料库存+涉及原材料成品库存 false
// materialChangeOtherNoRequire();
// }
// } else {
// if ($(this).val() == "MATERIAL CHANGE"){
// //成品变更:产品代号+产品名称+制程工艺+原材料+其他 true
// noMaterialChangeRequire();
// //涉及成品编码+旧原材料库存+涉及原材料成品库存 false
// materialChangeOtherNoRequire();
//
// }
// }
// })
$("#changePerson").orgTree({
filter: "psm", excludePos: 0, param: {orgKindId: "ogn,dpt,pos,psm"},
back: {
text: "#changePerson",
value : '#changePersonId'
},
onChange: function (value, data) {
$('#process').val(data.process);
$('#material').val(data.material);
$('#productionSolutionId').val(data.productionSolutionId);
//manageType: 'taskQuery',
onChange:function(value,data){
$('#changePerson').val(data.deptName+"-"+data.name);
}
});
}
$('input[name="reasonForChange"]').change(function () {
//变更后的制程工艺和原材料可以不必填,原材料变更不需要
if ($(this).is(':checked')) {
if ($(this).val() == "MATERIAL CHANGE"){
UICtrl.setElRequiredFlag("#changedProcess",false);
UICtrl.setElRequiredFlag("#changedMaterial",false);
}
}else {
if ($(this).val() == "MATERIAL CHANGE"){
UICtrl.setElRequiredFlag("#changedProcess",true);
UICtrl.setElRequiredFlag("#changedMaterial",true);
}
}
})
function materialChangeOtherRequire(){
//原材料变更:产品代号+产品名称+涉及成品编码+旧原材料库存+涉及原材料成品库存。 true
UICtrl.setElRequiredFlag("#otherProcess",true);
UICtrl.setElRequiredFlag("#oldMaterial",true);
UICtrl.setElRequiredFlag("#othersMaterialStore",true);
}
function materialChangeOtherNoRequire(){
//涉及成品编码+旧原材料库存+涉及原材料成品库存 false
UICtrl.setElRequiredFlag("#otherProcess",false);
UICtrl.setElRequiredFlag("#oldMaterial",false);
UICtrl.setElRequiredFlag("#othersMaterialStore",false);
}
function noMaterialChangeRequire(){
//成品变更:产品代号+产品名称+制程工艺+原材料+其他 true
UICtrl.setElRequiredFlag("#changedProcess",true);
UICtrl.setElRequiredFlag("#changedMaterial",true);
UICtrl.setElRequiredFlag("#process",true);
UICtrl.setElRequiredFlag("#material",true);
}
function noMaterialChangeNoRequire(){
//成品变更:产品代号+产品名称+制程工艺+原材料+其他 false
UICtrl.setElRequiredFlag("#changedProcess",false);
UICtrl.setElRequiredFlag("#changedMaterial",false);
UICtrl.setElRequiredFlag("#process",false);
UICtrl.setElRequiredFlag("#material",false);
}
function loadGrid() {
......@@ -110,20 +179,20 @@ function loadGrid() {
columns: [
{
display: "部门", name: "deptName", width: 200, minWidth: 60, type: "string", align: "left",
editor: {
type: 'tree',
required: true,
data: {
name: 'org',
filter: 'dpt',
minWidth: 250,
param: {
orgRoot: "14636F3F48934EE7811768692A0AC5E1"
}
},
textField: 'deptName',
valueField: 'deptId'
}
// editor: {
// type: 'tree',
// required: true,
// data: {
// name: 'org',
// filter: 'dpt',
// minWidth: 250,
// param: {
// orgRoot: "14636F3F48934EE7811768692A0AC5E1"
// }
// },
// textField: 'deptName',
// valueField: 'deptId'
// }
},
{
display: "执行人", name: "executor", width: 200, minWidth: 60, type: "string", align: "left",
......@@ -139,8 +208,14 @@ function loadGrid() {
orgRoot: "14636F3F48934EE7811768692A0AC5E1"
}
},
textField: 'executor',
valueField: 'executorId'
back: {
deptName:'deptName',
deptId:'deptId',
name: 'executor',
id: 'executorId'
},
// textField: 'executor',
// valueField: 'executorId',
}
},
{
......@@ -201,25 +276,49 @@ function loadStockGrid() {
columns: [
{
display: "仓库", name: "deptName", width: 200, minWidth: 60, type: "string", align: "left",
// editor: {
// type: 'tree',
// required: true,
// data: {
// name: 'org',
// filter: 'dpt',
// minWidth: 250,
// param: {
// orgRoot: "14636F3F48934EE7811768692A0AC5E1"
// }
// },
// textField: 'deptName',
// valueField: 'deptId'
// }
},
{
display: "专属原材料/半成品/在制品/成品数量(张)", name: "description", width: 300, minWidth: 60, type: "string", align: "left",
editor: {
type: "text"
}
},
{
display: "执行人", name: "executor", width: 200, minWidth: 60, type: "string", align: "left",
editor: {
type: 'tree',
required: true,
checkbox: true,
data: {
name: 'org',
filter: 'dpt',
filter: 'psm',
minWidth: 250,
param: {
orgRoot: "14636F3F48934EE7811768692A0AC5E1"
}
},
textField: 'deptName',
valueField: 'deptId'
}
},
{
display: "专属原材料/半成品/在制品/成品数量(张)", name: "description", width: 300, minWidth: 60, type: "string", align: "left",
editor: {
type: "text"
back: {
// deptName:'deptName',
// deptId:'deptId',
name: 'executor',
id: 'executorId'
},
// textField: 'executor',
// valueField: 'executorId',
}
},
{
......
......@@ -25,15 +25,19 @@
<x:hidden name="statusId"/>
<div class="hg-form-cols">
<div class="hg-form-row">
<x:inputC name="fillinDate" required="false" readonly="true" label="日期" labelCol="2" maxLength="64" fieldCol="2" wrapper="dateTime"/>
<x:inputC name="changeNo" required="true" label="变更序号" labelCol="2" maxLength="64" fieldCol="2" />
<x:inputC name="brandName" required="false" label="品牌名称" labelCol="2" fieldCol="2" wrapper="select"/>
<x:hidden name="brandCode"/>
<x:inputC name="deptNameAndPersonName" required="false" readonly="true" label="变更申请部门/姓名" labelCol="2" fieldCol="2"/>
<x:hidden name="changePersonId"/>
<x:inputC name="changePerson" required="false" label="变更申请部门/姓名" labelCol="2" fieldCol="2" wrapper="select"/>
</div>
<div class="hg-form-row">
<x:checkboxListC name="reasonForChange" dictionary="reasonForChange" required="true" label="变更原因" labelCol="2" fieldCol="6"/>
<x:checkboxListC name="reasonForChange" list="reasonForChangeList" required="true" label="变更原因" labelCol="2" fieldCol="6"/>
<x:inputC name="otherReasonDesc" required="false" label="其他原因描述" labelCol="2" fieldCol="2"/>
</div>
<div class="hg-form-row">
<x:textareaC name="changeMatter" required="false" label="变更事项" rows="3" labelCol="2" fieldCol="10"/>
</div>
<div class="hg-form-row">
<x:textareaC name="reasonDesc" required="false" label="原因描述" rows="3" labelCol="2" fieldCol="10"/>
</div>
......@@ -45,27 +49,28 @@
<x:inputC name="pd" required="true" label="产品代号" labelCol="2" maxLength="64" fieldCol="10" wrapper="select"/>
</div>
<div class="hg-form-row">
<x:inputC name="productName" required="true" label="产品名称" labelCol="2" fieldCol="10" readonly="true"/>
<x:inputC name="productName" required="true" label="产品名称" labelCol="2" fieldCol="10" />
</div>
<div class="hg-form-row">
<x:inputC name="process" required="true" label="制程工艺" labelCol="2" fieldCol="10" wrapper="select"/>
<x:inputC name="process" required="true" label="制程工艺" labelCol="2" fieldCol="10" />
<x:hidden name="productionSolutionId"/>
</div>
<div class="hg-form-row">
<x:inputC name="otherProcess" required="true" label="涉及成品编码" labelCol="2" fieldCol="10"/>
</div>
<div class="hg-form-row">
<x:textareaC name="material" required="true" label="原材料" labelCol="2" fieldCol="10" rows="3" readonly="true"/>
</div>
<div class="hg-form-row">
<x:textareaC name="oldMaterial" required="true" label="旧原材料库存" labelCol="2" fieldCol="10" rows="3"/>
<x:textareaC name="material" required="true" label="原材料" labelCol="2" fieldCol="10" rows="3" />
</div>
<%-- <div class="hg-form-row">--%>
<%-- <x:inputC name="otherProcess" required="false" label="涉及成品编码" labelCol="2" fieldCol="10"/>--%>
<%-- </div>--%>
<%-- <div class="hg-form-row">--%>
<%-- <x:textareaC name="oldMaterial" required="false" label="旧原材料库存" labelCol="2" fieldCol="10" rows="3"/>--%>
<%-- </div>--%>
<%-- <div class="hg-form-row">--%>
<%-- <x:inputC name="othersMaterialStore" required="false" label="涉及原材料成品库存" labelCol="2" fieldCol="10"/>--%>
<%-- </div>--%>
<div class="hg-form-row">
<x:inputC name="others" required="true" label="其他" labelCol="2" fieldCol="10"/>
</div>
<div class="hg-form-row">
<x:inputC name="othersMaterialStore" required="true" label="涉及原材料成品库存" labelCol="2" fieldCol="10"/>
</div>
<x:title title="REVISED SPEC 变更后产品信息" name="group"/>
<div class="hg-form-row">
<x:inputC name="changedPd" required="true" label="产品代号" labelCol="2" maxLength="64" fieldCol="10"/>
......
......@@ -10,7 +10,12 @@ function initUI() {
function loadGrid() {
var toolbarOptions = UICtrl.getDefaultToolbarOptions({
addHandler: addHandler,
productAddHandler: {id:'productAddHandler',img:'fa-cog',text:'成品变更',click:function(){
productAddHandler();
}},
materialAddHandler: {id:'materialAddHandler',img:'fa-cog',text:'原材料变更',click:function(){
materialAddHandler();
}},
exportExcelHandler: function () {
UICtrl.gridExport(gridManager);
},
......@@ -22,10 +27,13 @@ function loadGrid() {
});
gridManager = UICtrl.grid("#maingrid", {
columns: [
{display: "序号", name: "changeNo", width: 150, minWidth: 60, type: "string", align: "left"},
{display: "单据编号", name: "billCode", width: 150, minWidth: 60, type: "string", align: "left"},
{display: "变更原因", name: "reasonForChangeTextView", width: 150, minWidth: 60, type: "string", align: "left"},
{display: "变更事项", name: "changeMatter", width: 200, minWidth: 60, type: "string", align: "left"},
{display: "产品代号", name: "pd", width: 200, minWidth: 60, type: "string", align: "left"},
{display: "产品名称", name: "productName", width: 200, minWidth: 60, type: "string", align: "left"},
{display: "变更原因", name: "reasonForChangeTextView", width: 150, minWidth: 60, type: "string", align: "left"},
{display: "变更原因", name: "reasonDesc", width: 150, minWidth: 60, type: "string", align: "left"},
{display: "审批状态", name: "statusTextView", width: 100, minWidth: 60, type: "string", align: "left"},
{display: "创建日期", name: "fillinDate", width: 120, minWidth: 60, type: "date", align: "left"},
{display: "申请人", name: "personMemberName", width: 120, minWidth: 60, type: "string", align: "left"},
......@@ -65,11 +73,19 @@ function resetForm(obj) {
$(obj).formClean();
}
function addHandler() {
function productAddHandler() {
UICtrl.addTabItem({
tabid: 'epProductChangeForm',
text: "新增成品变更申请/通知单",
url: web_app.name + '/epChangeForm/forwardEpChangeFormDetail.job?type=product'
});
}
function materialAddHandler() {
UICtrl.addTabItem({
tabid: 'epChangeForm',
text: "新增变更申请/通知单",
url: web_app.name + '/epChangeForm/forwardEpChangeFormDetail.job'
tabid: 'epMaterialChangeForm',
text: "新增原材料变更申请/通知单",
url: web_app.name + '/epChangeForm/forwardEpChangeFormDetail.job?type=material'
});
}
......
var gridManager = null,stockGridManager = null,orgRoot = null;
$(document).ready(function () {
initialize();
loadGrid();
loadStockGrid();
bindEvent();
});
function initialize(){
UICtrl.layout("#layout", {leftWidth: 3});
$('#changeList').fileList({
bizId : $("#id").val()
});
}
function bindEvent(){
$('#pd').searchbox({
type: "system", name: "queryPd",
checkbox:true,
checkboxIndex:"productCode",
textIndex:"productName",
valueIndex:"productCode",
getParam: function (item) {
return {
filterValue:$("#brandCode").val()
}
},
onChange: function (value, data) {
$('#pd').val(value.value);
$('#changedPd').val(value.value);
//$('#productName').val(value.text);
//$('#changedProductName').val(value.text);
}
});
$("#changePerson").orgTree({
filter: "psm", excludePos: 0, param: {orgKindId: "ogn,dpt,pos,psm"},
back: {
text: "#changePerson",
value : '#changePersonId'
},
//manageType: 'taskQuery',
onChange:function(value,data){
$('#changePerson').val(data.deptName+"-"+data.name);
}
});
}
function loadGrid() {
var toolbarOptions = UICtrl.getDefaultToolbarOptions({
addHandler: function () {
UICtrl.addGridRow(gridManager);
},
deleteHandler: function () {
var _grid = UICtrl.getGridManager('#maingrid');
DataUtil.delSelectedRows({
action: 'epChangeForm/deleteEpChangeFormImplItem.ajax',
param: {},
gridManager: _grid,
idFieldName: 'id',
onSuccess: function () {
reloadGrid();
}
});
}
});
gridManager = UICtrl.grid("#maingrid", {
columns: [
{
display: "部门", name: "deptName", width: 200, minWidth: 60, type: "string", align: "left",
// editor: {
// type: 'tree',
// required: true,
// data: {
// name: 'org',
// filter: 'dpt',
// minWidth: 250,
// param: {
// orgRoot: "14636F3F48934EE7811768692A0AC5E1"
// }
// },
// textField: 'deptName',
// valueField: 'deptId'
// }
},
{
display: "执行人", name: "executor", width: 200, minWidth: 60, type: "string", align: "left",
editor: {
type: 'tree',
required: true,
checkbox: true,
data: {
name: 'org',
filter: 'psm',
minWidth: 250,
param: {
orgRoot: "14636F3F48934EE7811768692A0AC5E1"
}
},
back: {
deptName:'deptName',
deptId:'deptId',
name: 'executor',
id: 'executorId'
},
// textField: 'executor',
// valueField: 'executorId',
}
},
{
display: "签名确认", name: "confirmTextView", width: 140, minWidth: 60, type: "string", align: "left",
editor: {
type: 'dictionary',
data: {name: 'confirm'},
textField: 'confirmTextView',
valueField: 'confirm',
required: false,
render: function (item) {
return item.confirmTextView;
}
},
},
{
display: "日期", name: "date", width: 200, minWidth: 60, type: "date", align: "left",
editor: {
type: "text"
}
}
],
dataAction: "server",
url: web_app.name + '/epChangeForm/slicedEpChangeFormImplItems.ajax',
pageSize: 10,
usePager: true,
parms:{epChangeFormId:getId()},
toolbar: toolbarOptions,
enabledEdit: true,
width: "100%",
height: "200px",
heightDiff: -8,
checkbox: true,
fixedCellHeight: true,
selectRowButtonOnly: true,
});
UICtrl.setSearchAreaToggle(gridManager);
}
function loadStockGrid() {
var toolbarOptions = UICtrl.getDefaultToolbarOptions({
addHandler: function () {
UICtrl.addGridRow(stockGridManager);
},
deleteHandler: function () {
var _grid = UICtrl.getGridManager('#stockMainGrid');
DataUtil.delSelectedRows({
action: 'epChangeForm/deleteEpChangeFormStockItem.ajax',
param: {},
gridManager: _grid,
idFieldName: 'id',
onSuccess: function () {
reloadGrid();
}
});
}
});
stockGridManager = UICtrl.grid("#stockMainGrid", {
columns: [
{
display: "仓库", name: "deptName", width: 200, minWidth: 60, type: "string", align: "left",
// editor: {
// type: 'tree',
// required: true,
// data: {
// name: 'org',
// filter: 'dpt',
// minWidth: 250,
// param: {
// orgRoot: "14636F3F48934EE7811768692A0AC5E1"
// }
// },
// textField: 'deptName',
// valueField: 'deptId'
// }
},
{
display: "专属原材料/半成品/在制品/成品数量(张)", name: "description", width: 300, minWidth: 60, type: "string", align: "left",
editor: {
type: "text"
}
},
{
display: "执行人", name: "executor", width: 200, minWidth: 60, type: "string", align: "left",
editor: {
type: 'tree',
required: true,
checkbox: true,
data: {
name: 'org',
filter: 'psm',
minWidth: 250,
param: {
orgRoot: "14636F3F48934EE7811768692A0AC5E1"
}
},
back: {
// deptName:'deptName',
// deptId:'deptId',
name: 'executor',
id: 'executorId'
},
// textField: 'executor',
// valueField: 'executorId',
}
},
{
display: "签名确认", name: "confirmTextView", width: 140, minWidth: 60, type: "string", align: "left",
editor: {
type: 'dictionary',
data: {name: 'confirm'},
textField: 'confirmTextView',
valueField: 'confirm',
// checkbox:true,
required: false,
render: function (item) {
return item.confirmTextView;
}
},
},
{
display: "日期", name: "date", width: 200, minWidth: 60, type: "dateTime", align: "left",
editor: {
type: "dateTime"
}
}
],
dataAction: "server",
url: web_app.name + '/epChangeForm/slicedEpChangeFormStockItems.ajax',
pageSize: 10,
usePager: true,
parms:{epChangeFormId:getId()},
toolbar: toolbarOptions,
enabledEdit: true,
width: "100%",
height: "200px",
heightDiff: -8,
checkbox: true,
fixedCellHeight: true,
selectRowButtonOnly: true,
});
UICtrl.setSearchAreaToggle(stockGridManager);
}
/**
* 流程引擎回调设置打样的id
* @param value
*/
function setId(id) {
$("#id").val(id);
$('#changeList').fileList({
bizId : id
});
var _grid=UICtrl.getGridManager('#maingrid');
_grid.options.parms.epChangeFormId = id;
var _stockGrid=UICtrl.getGridManager('#stockMainGrid');
_stockGrid.options.parms.epChangeFormId = id;
}
/**
* 流程引擎获取打样申请id的回掉方法。
* @return
*/
function getId() {
return $("#id").val() || "";
}
function reloadGrid() {
gridManager.loadData();
stockGridManager.loadData();
}
function getExtendedData(processAction) {
//回退、打回、转交时,不需要验证必填项是否已经填写;
if (processAction == ProcessAction.BACK
|| processAction == ProcessAction.REPLENISH
|| processAction == ProcessAction.TRANSMIT) {
//不验证
$('#submitForm').attr('check', false);
}
var extendedData = {};
var _grid = UICtrl.getGridManager('#maingrid');
if (_grid) {
var datas = DataUtil.getGridData({
gridManager: _grid,
isAllData: true
});
if (!datas) {
return false;
}
extendedData.EpChangeFormImplItem = Public.encodeJSONURI(datas);
}
var _stockGrid = UICtrl.getGridManager('#stockMainGrid');
if (_stockGrid) {
var datas = DataUtil.getGridData({
gridManager: _stockGrid,
isAllData: true
});
if (!datas) {
return false;
}
extendedData.epChangeFormStockItem = Public.encodeJSONURI(datas);
}
return extendedData;
}
function print(){
if ($("#statusId").val() != 3){
Public.tip("请审批完成再打印!");
return;
}
var url='/epChangeForm/print.load';
Public.openPostWindow(web_app.name+url,{id :$("#id").val()});
}
<%@ page language="java" contentType="text/html; charset=utf-8" %>
<%@taglib uri="/WEB-INF/taglib.tld" prefix="x" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
<x:base include="layout,dialog,grid,tree,dateTime,combox,attachment,commonTree,comboDialog"/>
<x:script src='/biz/topsun/ep/change/epMaterialChangeFormDetail.js'/>
</head>
<body>
<div class="container-fluid">
<x:billTitle title="宝绅内部原材料变更申请/通知单" needStatus="false" needPerson="true"/>
<form class="hg-form" method="post" action="" id="submitForm">
<x:hidden name="id"/>
<x:hidden name="billCode"/>
<x:hidden name="fillinDate" type="datetime"/>
<x:hidden name="fullId"/>
<x:hidden name="organId"/>
<x:hidden name="organName"/>
<x:hidden name="deptId"/>
<x:hidden name="deptName"/>
<x:hidden name="positionId"/>
<x:hidden name="positionName"/>
<x:hidden name="personMemberId"/>
<x:hidden name="personMemberName"/>
<x:hidden name="statusId"/>
<div class="hg-form-cols">
<div class="hg-form-row">
<x:inputC name="changeNo" required="true" label="变更序号" labelCol="2" maxLength="64" fieldCol="2" />
<x:hidden name="changePersonId"/>
<x:inputC name="changePerson" required="false" label="变更申请部门/姓名" labelCol="2" fieldCol="2" wrapper="select"/>
</div>
<div class="hg-form-row">
<x:checkboxListC name="reasonForChange" list="reasonForChangeList" required="true" label="变更原因" labelCol="2" fieldCol="6"/>
<x:inputC name="otherReasonDesc" required="false" label="其他原因描述" labelCol="2" fieldCol="2"/>
</div>
<div class="hg-form-row">
<x:textareaC name="changeMatter" required="false" label="变更事项" rows="3" labelCol="2" fieldCol="10"/>
</div>
<div class="hg-form-row">
<x:textareaC name="reasonDesc" required="false" label="原因描述" rows="3" labelCol="2" fieldCol="10"/>
</div>
<div class="hg-form-row">
<x:checkboxListC name="changeEffective" dictionary="changeEffective" required="true" label="生效日期" labelCol="2" fieldCol="10"/>
</div>
<x:title title="CURRENT SPEC 目前产品信息" name="group"/>
<div class="hg-form-row">
<x:inputC name="pd" required="true" label="产品代号" labelCol="2" maxLength="64" fieldCol="10" wrapper="select"/>
</div>
<div class="hg-form-row">
<x:inputC name="productName" required="true" label="产品名称" labelCol="2" fieldCol="10" />
</div>
<div class="hg-form-row">
<x:inputC name="otherProcess" required="false" label="涉及成品编码" labelCol="2" fieldCol="10"/>
</div>
<div class="hg-form-row">
<x:textareaC name="oldMaterial" required="false" label="旧原材料库存" labelCol="2" fieldCol="10" rows="3"/>
</div>
<div class="hg-form-row">
<x:inputC name="othersMaterialStore" required="false" label="涉及原材料成品库存" labelCol="2" fieldCol="10"/>
</div>
<x:title title="REVISED SPEC 变更后产品信息" name="group"/>
<div class="hg-form-row">
<x:inputC name="changedPd" required="true" label="产品代号" labelCol="2" maxLength="64" fieldCol="10"/>
</div>
<div class="hg-form-row">
<x:inputC name="changedProductName" required="true" label="产品名称" labelCol="2" fieldCol="10"/>
</div>
</div>
<div style="padding-top: 15px;">
<x:fileList bizCode="change" bizId="id" id="changeList" title="附件" />
</div>
<div class="blank_div clearfix"></div>
<x:title title="Implementation 执行人(版具/模具等)" name="group"/>
<div id="maingrid" style="margin: 2px;"></div>
<div class="blank_div clearfix"></div>
<x:title title="Stock / Inventory 库存" name="group"/>
<div id="stockMainGrid" style="margin: 2px;"></div>
</form>
</div>
</body>
</html>
......@@ -26,6 +26,8 @@ function loadGrid() {
{display: "状态码", name: "code", width: 100, minWidth: 60, type: "string", align: "left"},
{display: "消息", name: "msg", width: 200, minWidth: 60, type: "string", align: "left"},
],
_tableKey: 'epSaleOrderCancel',
_local: true,
dataAction: "server",
url: web_app.name + '/epSaleOrderCancel/slicedEpSaleOrderCancelList.ajax',
pageSize: 20,
......
......@@ -8,23 +8,27 @@ function initUI() {
UICtrl.initDefaultLayout();
}
var defaultcols = [
{display: "单据编号", name: "billCode", width: 150, minWidth: 60, type: "string", align: "left"},
{display: "创建日期", name: "fillinDate", width: 120, minWidth: 60, type: "string", align: "left"},
{display: "申请人", name: "personMemberName", width: 120, minWidth: 60, type: "string", align: "left"},
{display: "申请部门", name: "deptName", width: 120, minWidth: 60, type: "string", align: "left"},
{display: "联系电话长号", name: "telPhoneLong", width: 200, minWidth: 60, type: "string", align: "left"},
{display: "联系电话短号", name: "telPhoneShort", width: 200, minWidth: 60, type: "string", align: "left"},
{display: "售达方", name: "kunnr", width: 200, minWidth: 60, type: "string", align: "left"},
{display: "审批状态", name: "statusTextView", width: 100, minWidth: 60, type: "string", align: "left"},
{display: "状态码", name: "code", width: 100, minWidth: 60, type: "string", align: "left"},
{display: "消息", name: "msg", width: 200, minWidth: 60, type: "string", align: "left"},
]
function loadGrid() {
var toolbarOptions = UICtrl.getDefaultToolbarOptions({
//addHandler: addHandler,
});
gridManager = UICtrl.grid("#maingrid", {
columns: [
{display: "单据编号", name: "billCode", width: 150, minWidth: 60, type: "string", align: "left"},
{display: "创建日期", name: "fillinDate", width: 120, minWidth: 60, type: "string", align: "left"},
{display: "申请人", name: "personMemberName", width: 120, minWidth: 60, type: "string", align: "left"},
{display: "申请部门", name: "deptName", width: 120, minWidth: 60, type: "string", align: "left"},
{display: "联系电话长号", name: "telPhoneLong", width: 200, minWidth: 60, type: "string", align: "left"},
{display: "联系电话短号", name: "telPhoneShort", width: 200, minWidth: 60, type: "string", align: "left"},
{display: "售达方", name: "kunnr", width: 200, minWidth: 60, type: "string", align: "left"},
{display: "审批状态", name: "statusTextView", width: 100, minWidth: 60, type: "string", align: "left"},
{display: "状态码", name: "code", width: 100, minWidth: 60, type: "string", align: "left"},
{display: "消息", name: "msg", width: 200, minWidth: 60, type: "string", align: "left"},
],
columns: defaultcols,
_tableKey: 'epSaleOrder',
_local: true,
dataAction: "server",
url: web_app.name + '/epSaleOrder/slicedEpSaleOrderList.ajax',
pageSize: 20,
......@@ -43,6 +47,7 @@ function loadGrid() {
UICtrl.setSearchAreaToggle(gridManager);
}
function query(obj) {
var param = $(obj).formToJSON();
UICtrl.gridSearch(gridManager, param);
......
......@@ -14,8 +14,8 @@
<body>
<div class="billTitle">
<span style="position: absolute">
<img src="${bsnPng}"></img>
<span style="position: absolute;margin-left: 50px">
<img src='data:image/jpg;base64,${bsnPng}' width="100px"/>
</span>
宝绅内部变更申请/通知单</div>
<div class="billTitle">Specification Change Form</div>
......@@ -59,28 +59,26 @@
<col width='100%' />
</colgroup>
<tr>
<td class="left">${reasonForChange?default("")?html}
<span style="text-decoration: underline">${otherReasonDesc?default("")?html}</span>
</td>
<td class="left">${reasonForChange?default("")?html}</td>
<td class="left">${otherReasonDesc?default("")?html}</td>
</tr>
</table>
<table cellspacing="0px" cellpadding="0px" class="tableBorder">
<colgroup>
<col width='17%' />
<col width='83%' />
<col width='100%' />
</colgroup>
<tr>
<td class="center">CHANGE EFFECTIVE 生效日期:</td>
<td class="left">${changeEffective?default("")?html}</td>
<td class="left">CHANGE EFFECTIVE 生效日期:
<span style="text-decoration: underline">${changeEffective?default("")?html}</span>
</td>
</tr>
</table>
<div class="title" style="background: #CC8F81;text-align: center">Change Details 变更内容</div>
<div class="title" style="background: yellow;text-align: left">CURRENT SPEC 目前产品信息</div>
<table cellspacing="0px" cellpadding="0px" class="tableBorder">
<colgroup>
<col width='17%' />
<col width='83%' />
<col width='22%' />
<col width='78%' />
</colgroup>
<tr>
<td class="left">
......@@ -112,8 +110,8 @@
<div class="title" style="background: yellow;text-align: left">REVISED SPEC 变更后产品信息</div>
<table cellspacing="0px" cellpadding="0px" class="tableBorder">
<colgroup>
<col width='17%' />
<col width='83%' />
<col width='22%' />
<col width='78%' />
</colgroup>
<tr>
<td class="left">
......
......@@ -123,4 +123,15 @@ public class Function extends AbstractDaoFunction {
}
return orgUnits;
}
/**
* 根据业务主表id查询审批人
* @param bizId
* @return
*/
public List<OrgUnit> fundApproval(String bizId){
Assert.hasText(bizId, "参数id不能为空。");
String sql = this.getSqlByname("fundApproval");
return this.sqlExecutorDao.queryToList(sql, OrgUnit.class,bizId);
}
}
package com.huigou.topsun.ep.change.controller;
import com.huigou.cache.DictUtil;
import com.huigou.cache.SystemCache;
import com.huigou.context.Operator;
import com.huigou.context.OrgUnit;
......@@ -9,19 +10,27 @@ import com.huigou.topsun.ep.change.application.EpChangeFormImplItemApplication;
import com.huigou.topsun.ep.change.application.EpChangeFormStockItemApplication;
import com.huigou.topsun.ep.change.domain.EpChangeForm;
import com.huigou.topsun.ep.change.domain.query.EpChangeFormQueryRequest;
import com.huigou.topsun.ep.order.controller.EpSaleOrderCancelController;
import com.huigou.uasp.annotation.ControllerMapping;
import com.huigou.uasp.bmp.common.BizBillStatus;
import com.huigou.uasp.bpm.engine.application.ActApplication;
import com.huigou.uasp.client.CommonController;
import com.huigou.util.SDO;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import sun.misc.BASE64Encoder;
import javax.annotation.Resource;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -33,6 +42,7 @@ import java.util.Map;
@Controller
@ControllerMapping("/epChangeForm")
public class EpChangeFormController extends CommonController {
private final static Logger LOG = LoggerFactory.getLogger(EpChangeFormController.class);
@Override
protected String getPagePath() {
return "/biz/topsun/ep/change/";
......@@ -69,13 +79,33 @@ public class EpChangeFormController extends CommonController {
*/
Operator operator = getOperator();
epChangeForm.setDefaultValues(new OrgUnit(operator.getFullId(), operator.getFullName()));
return forward("epChangeFormDetail",epChangeForm);
Map<String, String> reasonForChange = new HashMap<>();
String type = this.getSDO().getString("type");
if ("product".equals(type)){
reasonForChange = DictUtil.getDictionary("reasonForChange");
reasonForChange.remove("MATERIAL CHANGE");
this.putAttribute("reasonForChangeList",reasonForChange);
return forward("epChangeFormDetail",epChangeForm);
}else {
reasonForChange.put("MATERIAL CHANGE","原材料变更");
this.putAttribute("reasonForChangeList",reasonForChange);
return forward("epMaterialChangeFormDetail",epChangeForm);
}
}
public String showEpChangeFormDetail(){
SDO sdo = this.getSDO();
String id = sdo.getBizId();
EpChangeForm epChangeForm = epChangeFormApplication.findEpChangeFormById(id);
Map<String, String> reasonForChange = new HashMap<>();
if ("MATERIAL CHANGE".equals(epChangeForm.getReasonForChange())){
reasonForChange.put("MATERIAL CHANGE","原材料变更");
this.putAttribute("reasonForChangeList",reasonForChange);
return forward("epMaterialChangeFormDetail",epChangeForm);
}
reasonForChange = DictUtil.getDictionary("reasonForChange");
reasonForChange.remove("MATERIAL CHANGE");
this.putAttribute("reasonForChangeList",reasonForChange);
return forward("epChangeFormDetail",epChangeForm);
}
......@@ -140,8 +170,18 @@ public class EpChangeFormController extends CommonController {
effective.append(" √ ").append(s).append(" ").append(stringListTextView.get(i));
}
map.put("changeEffective",effective.toString());
File file = new File("bsn.png");
map.put("bsnPng",file);
File file = new File(SystemCache.getRealPath() +"/images/bsnLogo.png");
try {
FileInputStream inputFile = new FileInputStream(file);
byte[] buffer = new byte[inputFile.available()];
inputFile.read(buffer);
inputFile.close();
BASE64Encoder base64Encoder = new BASE64Encoder();
String encode = base64Encoder.encode(buffer);
map.put("bsnPng",encode);
}catch (Exception e) {
LOG.error("异常信息:" + e.getMessage());
}
// 获取Grid数据
QueryPageRequest pageModel = queryRequest.getPageModel();
pageModel.setPageSize(20);
......@@ -149,7 +189,6 @@ public class EpChangeFormController extends CommonController {
queryRequest.setEpChangeFormId(id);
Map<String, Object> implItemMap = changeFormImplItemApplication.findByEpChangeFormId(queryRequest);
Map<String, Object> stockItemMap = changeFormStockItemApplication.findByEpChangeFormId(queryRequest);
Map<String, Object> queriedApprovalHistory = actApplication.queryApprovalHistoryByBizId(id);
List<Map<String, Object>> mapList = this.epChangeFormApplication.queryApprovalPersons(id);
List<Map<String, Object>> implItemMaps = (List<Map<String, Object>>) implItemMap.get("Rows");
List<Map<String, Object>> stockItemMaps = (List<Map<String, Object>>) stockItemMap.get("Rows");
......
......@@ -150,6 +150,29 @@ public class EpChangeForm extends FlowBillAbstractEntity {
@Column(name = "msg")
private String msg;
/**
* 变更人员id
*/
@Column(name = "change_person_id")
private String changePersonId;
/**
* 变更人员
*/
@Column(name = "change_person")
private String changePerson;
/**
* 变更单排序
*/
@Column(name = "change_no")
private String changeNo;
/**
* 变更事项
*/
@Column(name = "change_matter")
private String changeMatter;
@Override
protected String getCodeRuleId() {
return "epChangeForm";
......
......@@ -37,6 +37,18 @@ public class EpChangeFormStockItem extends AbstractEntity {
@Column(name = "description")
private String description;
/**
* 执行人
*/
@Column(name = "executor")
private String executor;
/**
* 执行人
*/
@Column(name = "executor_id")
private String executorId;
/**
* 确认人
*/
......
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