Commit 7a61f633 authored by 刘学辉's avatar 刘学辉

非产品物料维护申请后台调整和专项任务跳转页面

parent c4b201a1
let gridManager = null;
//页面控制标识
let control = {
isInitiator: false,//是否为审核人
isDistribute: false,//是否已分发
}
$(document).ready(function () {
initializate()
loadGrid();
// initAssistantGrid();
loadRejectReasonBox();
})
function initializate() {
//页面控制
debugger
switch ($("#active").val()) {
case '0'://已分发未完成
if ($("#deptCode").val() === "system") {
$("#auditForm").show();
} else {
$("#buttonBox").show();
$("#showChart").remove();
}
break;
case '1'://完成/审核
// $("#auditForm").show();
break;
case '2'://保存未分发
$("#buttonBox").show();
break;
case '3'://被驳回
showRejectCauseBox();
$("#buttonBox").show();
$("#showChart").remove();
break;
default://其他/详情
$("#buttonBox").show();
break;
}
// let isInitiator = ($("#isInitiator").val() === "true");
// if (isInitiator) {
// //创建或审核人
// $("#buttonBox").remove();
// }else{
// //审核人
// $("#auditForm").remove();
// }
// $('input[name="maintenanceType"]').change(function () {
// if ($(this).is(':checked')) {
// console.log($(this).val()); // 输出选中的值
// switch ($(this).val()) {
// case 'new':
// if ($("#mtart").val() == "ZMPN") {
// UICtrl.enable($("#matnr"));
// } else {
// UICtrl.disable($("#matnr"));
// }
// UICtrl.disable($("#lvorm"));
// UICtrl.enable($("#mtart"));
// UICtrl.enable($("#matkl"));
// UICtrl.enable($("#spart"));
// break;
// case 'modify':
// UICtrl.enable($("#lvorm"))
// UICtrl.disable($("#mtart"));
// UICtrl.disable($("#matkl"));
// UICtrl.disable($("#spart"));
// break;
// case 'extend':
// UICtrl.enable($("#lvorm"))
// UICtrl.disable($("#mtart"));
// UICtrl.disable($("#matkl"));
// UICtrl.disable($("#spart"));
// break;
// }
// }
// });
//
// $('input[name="businessUsage"]').change(function () {
// if ($(this).is(":checked")) {
// console.log($(this).val()); // 输出选中的值
// }
// });
}
/**
* 初始化对应的分发部门
*/
function loadGrid() {
// alert($("#businessCode").val());
// if ($("#businessCode").val()!=''){
$("#genericName").attr("disabled",true);
$("#applicableStandard").attr("disabled",true);
$("#baseUnit").attr("disabled",true);
$("#size").attr("disabled",true);
$("#material").attr("disabled",true);
$("#design").attr("disabled",true);
$("#brand").attr("disabled",true);
$("#specifications").attr("disabled",true);
$("#materialUsage").attr("disabled",true);
// }
let coRowNum = $("#businessUsage").val().replace(/,/g, '') + 1;
// let length = dept.length;
// let dept=$("#businessUsage").val().split(",");
// let a=(dept.length+1)*37.5;
gridManager = UICtrl.grid("#businessPersonnelListGrid", {
columns: [
{display: "部门", name: "deptName", width: 200, minWidth: 60, type: "string", align: "left"},
{ display: "部门人员", name: "userName", width: 200, minWidth: 60, type: "string", align: "left",
editor: {
type: 'tree',
required: true,
data: {
name: 'org',
filter: 'psm',
minWidth: 250
},
textField: 'userName',
valueField: 'userCode'
}
// editor: {
// required: true, type: "select",
// data: {
// type: 'system',
// name: "testUser",
// back: {
// id: "userName",
// userCode: "userCode"
// },
// getParam: function (data) {
// return {deptCode: data.deptCode}
// },
// },
// }
},
{ display: "人员Id", name: "userCode", width: 260, minWidth: 60, type: "string", align: "left",
editor: {
type: 'text',
required: true
}
},
],
dataAction: "server",
url: web_app.name + '/sapNonProdApplyNext/slicedDeptList.ajax',
parms: {dept: $("#businessUsage").val(), id: $("#applyDeptId").val(),businessCode:$("#businessCode").val()},
pageSize: 20,
usePager: false,
enabledEdit: true,
width: "100%",
height: coRowNum * 37.5,
heightDiff: -8,
fixedCellHeight: true,
selectRowButtonOnly: true,
});
UICtrl.setSearchAreaToggle(gridManager);
}
/**
* 表单提交
* @returns {boolean}
*/
function saveForm() {
alert($("#businessCode").val());
let extendedData = getExtendedData();
if (!extendedData) return false;
var _self = this;
$('#submitForm').ajaxSubmit({
url: web_app.name + '/sapNonProdApplyNext/saveSapNonProdApplyDept.ajax',
param: extendedData,
success: function (data) {
$("#applyDeptId").val(data.applyDeptId);
Public.successTip("保存成功!");
_self.close();
}
});
}
/**
* 分发表单到各个部门
*/
function distributeForm() {
if (control.isDistribute) {
Public.successTip("已分发");
return false;
}
let extendedData = getExtendedData();
if (!extendedData) return false;
$('#submitForm').ajaxSubmit({
url: web_app.name + '/sapNonProdApplyNext/distributeSapNonProdApplyDept.ajax',
param: extendedData,
success: function (data) {
Public.successTip("分发成功!");
control.isDistribute = true;
_self.close();
}
});
}
function getExtendedData() {
debugger
let msg = "[";
let isUndefined = false
let deptStaffResult = DataUtil.getGridData({
gridManager: gridManager,
isAllData: true,
onCheck: function (data) {
if (typeof data.userCode === 'undefined') {
msg += `${data.deptName}、`;
isUndefined = true;
}
return true;
}
});
if (isUndefined) {
Public.tip(`${msg.slice(0, -1)}]未选择对应分发人员`);
return false
}
let extendedData = {};
extendedData.deptStaff = Public.encodeJSONURI(deptStaffResult);
return extendedData;
}
function rejectForm() {
debugger
$('#auditForm').ajaxSubmit({
url: web_app.name + '/sapNonProdApplyNext/rejectNonProdApplyDept.ajax',
param: {meId:getMeId()},
success: function (data) {
Public.successTip("已驳回!");
_self.close();
}
});
}
function checkThrough(){
$('#exPass').ajaxSubmit({
url: web_app.name + '/sapNonProdApplyNext/rejectNonProdApplyDept.ajax',
param: {meId:getMeId()},
success: function (data) {
Public.successTip("检查通过!");
_self.close();
}
});
}
/**
* 根据选择的驳回的部门生成输入框
*/
function loadRejectReasonBox() {
$('input[name="auditDept"]').change(function () {
let val = $(this).val()
let textData = $(this).parent().text().trim()
if (this.checked) {
if ($(`#id_${val}`).length) {
// 元素存在
$(`#id_${val}`).show();
} else {
// 元素不存在
let box = `<div id="id_${val}">
<div class="col-xs-4 col-sm-2" style="height:60px;">
<label class="hg-form-label" name="${val}" title="[${textData}]驳回原因">[${textData}]驳回原因&nbsp;:</label>
</div>
<div class="col-xs-8 col-sm-10 col-warp col-white-bg" style="height:60px;">
<textarea name="${val}" label="[${textData}]驳回原因" id="text_${val}"></textarea>
</div>
</div>`;
$("#rejectReasonBox").append(box)
}
$(window).scrollTop($(document).height());
} else {
$(`#id_${val}`).hide();
}
}
);
}
/**
*根据驳回信息生成驳回信息展示栏
*/
function showRejectCauseBox() {
Public.ajax(web_app.name + '/sapNonProdApplyNext/slicedRejectCauseList.ajax', {meId: getMeId()}, function (data) {
const generateCauseHTML = (item, newCause) => {
const { rectifyDate, rejectMsg, bsnExecuteId, rejectDate } = item;
return `
<div class="hg-form-row">
<div class="col-xs-4 col-sm-1" style="height:56px;">
<label class="hg-form-label" title="驳回原因">驳回原因${newCause}&nbsp;:</label>
</div>
<div class="col-xs-8 col-sm-11 col-warp col-gray-bg" style="height:56px;">
<textarea rows="2" label="驳回原因" readonly="readonly">${rejectMsg}</textarea>
</div>
</div>
<div class="hg-form-row">
<div class="col-xs-4 col-sm-1">
<label class="hg-form-label" title="驳回人">驳回人&nbsp;:</label>
</div>
<div class="col-xs-8 col-sm-3 col-warp col-gray-bg">
<input type="text" value="${bsnExecuteId}" readonly="readonly" label="驳回人">
</div>
<div class="col-xs-4 col-sm-1">
<label class="hg-form-label" title="驳回时间">驳回时间&nbsp;:</label>
</div>
<div class="col-xs-8 col-sm-3 col-warp col-gray-bg">
<input type="text" value="${rejectDate}" readonly="readonly" label="驳回时间">
</div>
<div class="col-xs-4 col-sm-1">
<label class="hg-form-label" title="处理时间">处理时间&nbsp;:</label>
</div>
<div class="col-xs-8 col-sm-3 col-warp col-gray-bg">
<input type="text" value="${rectifyDate}" readonly="readonly" label="处理时间">
</div>
</div>
`;
};
let newCause = `<span style="color:red;">new</span>`;
const ahtml = data
.map((item) => {
const cause = item.rectifyDate === '' ? `[${newCause}]` : '';
return generateCauseHTML(item, cause);
})
.join('');
$("#cause-details-box").html(ahtml);
$("#causeBox").show();
})
}
function getMeId() {
return $("#meId").val() || '';
}
\ No newline at end of file
<%@ 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,combox,commonTree,date"/>
<x:script src='/biz/topsun/sap/nonProdApply/nonProdApplyClass.js'/>
</head>
<body>
<x:hidden name="isDetailPage" value="false"/> <!--是否是详情页-->
<x:hidden name="deptCode" value="false"/> <!--是否是详情页-->
<x:hidden name="active" value=""/> <!--状态-->
<x:hidden name="meId" value=""/> <!--状态-->
<div class="container-fluid" style="padding: 10px;">
<x:billTitle title="非产品/非本成品类物料分类信息维护" needStatus="false" needPerson="true"/>
<form class="hg-form" method="post" action="" id="submitForm">
<div style="float: right; margin-right: 10px;display: none;" class="btn-group" id="buttonBox">
<button id="save" title="" type="button" onclick="saveForm()" class="btn btn-gray"><i
class="fa fa-save"></i>保存
</button>
<button id="back" title="" type="button" class="btn btn-gray"><i
class="fa fa-reply"></i>撤销
</button>
<button id="showChart" title="" type="button" onclick="distributeForm()" class="btn btn-gray"><i
class="fa fa-sitemap"></i>分发
</button>
</div>
<br/>
<div class=" border-left-top" style="margin-top: 20px;display: none;" id="causeBox">
<div class=" gray-bg">
<div class="col-xs-2 " style="text-align: center;margin-top: 30px">
<h4>驳回历史</h4>
</div>
<div class="hg-form-cols" id="cause-details-box"></div>
</div>
</div>
<x:hidden name="applyDeptId"/>
<x:hidden name="id"/>
<x:hidden name="businessCode"/>
<x:title title="基本信息" name="group"/>
<div class="hg-form-cols">
<div class="hg-form-row">
<x:inputC name="billCode" label="申请单编号" labelCol="1" readonly="true" fieldCol="2"/>
<x:selectC name="statusId" label="批准状态" dictionary="bizBillStatus" disabled="true" labelCol="1"
fieldCol="2"/>
<x:inputC name="personMemberName" label="填写人" readonly="true" labelCol="1" fieldCol="2"/>
<x:inputC name="fillinDate" label="填写日期" readonly="true" wrapper="date" labelCol="1" fieldCol="2"/>
</div>
<div class="hg-form-row">
<x:radioC name="maintenanceType" label="维护类型" labelCol="1" fieldCol="11" dictionary="maintainType"/>
</div>
</div>
<x:title title="物品总体内容" name="group"/>
<div class="hg-form-cols">
<div class="hg-form-row">
<x:inputC name="genericName" label="通用品名" labelCol="1" fieldCol="2"/>
<x:inputC name="applicableStandard" label="适用标准" labelCol="1" fieldCol="2"/>
<x:selectC name="baseUnit" label="基本计量单位" labelCol="1" fieldCol="2" dictionary="measuringUnit"/>
<x:inputC name="specifications" label="规格" labelCol="1" fieldCol="2"/>
<x:inputC name="material" label="材质" labelCol="1" fieldCol="2"/>
<x:inputC name="design" label="版式" labelCol="1" fieldCol="2"/>
<x:inputC name="size" label="尺码" labelCol="1" fieldCol="2"/>
<x:inputC name="brand" label="品牌" labelCol="1" fieldCol="2"/>
<x:selectC name="itemAttributes" label="物品属性" labelCol="1" fieldCol="2" dictionary="suppliesType"/>
<x:inputC name="materialUsage" label="用途" labelCol="1" fieldCol="8"/>
</div>
</div>
<x:title title="维护分类信息" name="group"/>
<div class="hg-form-cols">
<div class="hg-form-row">
<x:inputC name="klart" label="类类型" labelCol="1" fieldCol="5"/>
<x:inputC name="classify" label="分类" labelCol="1" fieldCol="5" />
</div>
</div>
<div class="hg-form-cols">
<div class="hg-form-row">
<x:hidden name="businessUsage"/>
<x:checkboxListC name="businessUsage" label="业务用途" dictionary="serviceusage" labelCol="1"
fieldCol="11"/>
</div>
<div class="hg-form-row">
<x:title title="业务人员" name="group"/>
<div id="businessPersonnelListGrid" style="margin: 2px;"></div>
</div>
</div>
<div class="hg-form-cols">
<div class="hg-form-row">
<x:textareaC rows="3" name="textDescription" label="文本说明" labelCol="1" fieldCol="11"/>
</div>
</div>
<%-- <x:title title="分类" name="group"/>--%>
<%-- <div class="hg-form-cols">--%>
<%-- <div class="hg-form-row">--%>
<%-- <x:inputC name="klart" label="类型" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="classify" label="分类" labelCol="1" fieldCol="2"/>--%>
<%-- </div>--%>
<%-- </div>--%>
<%-- <x:title title="销售" name="group"/>--%>
<%-- <div class="hg-form-cols">--%>
<%-- <div class="hg-form-row">--%>
<%-- <x:inputC name="vkorg" label="销售组织" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="vtweg" label="分销渠道" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="vrkme" label="销售计量单位" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="umren" label="转换分母" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="umrez" label="转换分子" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="dwerk" label="交货工厂" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="aland" label="税收发运国" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="taxkm" label="税分类" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="versg" label="统计组" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="kondm" label="物料定价组" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="ktgrm" label="会计科目组" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="prodh" label="产品层级" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="mvgr1" label="版式" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="mvgr2" label="品牌" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="mvgr3" label="用途" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="mvgr4" label="备用" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="mvgr5" label="备用" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="mtpos" label="销售项次组" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="tragr" label="运输组" labelCol="1" fieldCol="2"/>--%>
<%-- </div>--%>
<%-- </div>--%>
<%-- <x:title title="采购" name="group"/>--%>
<%-- <div class="hg-form-cols">--%>
<%-- <div class="hg-form-row">--%>
<%-- <x:inputC name="bstme" label="采购计量单位" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="umrenPurch" label="转换分母" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="umrezPurch" label="转换分子" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="ekgrp" label="默认采购组" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="mprof" label="MPN参数" labelCol="1" fieldCol="2"/>--%>
<%-- </div>--%>
<%-- </div>--%>
<%-- <x:title title="MRP" name="group"/>--%>
<%-- <div class="hg-form-cols">--%>
<%-- <div class="hg-form-row">--%>
<%-- <x:inputC name="lgort" label="库存地点" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="disgr" label="MRP组" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="dismm" label="MRP类型" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="minbe" label="重订货点" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="dispo" label="MRP控制者" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="disls" label="批量规模" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="bstfe" label="固定批量" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="bstma" label="最大批量" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="bstmi" label="最小批量" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="mabst" label="最大存货水平" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="bstrf" label="设入值" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="beskz" label="获取类型" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="sobsl" label="特殊获取方式" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="lgpro" label="默认生产库存地" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="rgekz" label="倒冲标志" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="lgfsb" label="默认采购收货库存地" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="webaz" label="收货处理天数" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="dzeit" label="自制时间" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="plifz" label="外部采购交货时间" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="fhori" label="排程边际码" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="eisbe" label="安全库存" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="eislo" label="最小安全库存" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="strgr" label="策略组" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="mtvfp" label="可用性检查组" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="wzeit" label="补货提前天数" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="altsl" label="BOM选择方法" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="sbdkz" label="独立/集中" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="diskz" label="库存地MRP标识" labelCol="1" fieldCol="2"/>--%>
<%-- </div>--%>
<%-- </div>--%>
<%-- <x:title title="生产" name="group"/>--%>
<%-- <div class="hg-form-cols">--%>
<%-- <div class="hg-form-row">--%>
<%-- <x:inputC name="ausme" label="投料计量单位" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="umrenProd" label="转换分母(生产)" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="umrezProd" label="转换分子(生产)" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="sfcpf" label="生产计划参数文件" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="insmk" label="过账到质检" labelCol="1" fieldCol="2"/>--%>
<%-- </div>--%>
<%-- </div>--%>
<%-- <x:title title="存储管理" name="group"/>--%>
<%-- <div class="hg-form-cols">--%>
<%-- <div class="hg-form-row">--%>
<%-- <x:inputC name="lgortQm" label="库存地点" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="sernp" label="序列号参数" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="serlv" label="序列号水平" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="prctr" label="利润中心" labelCol="1" fieldCol="2"/>--%>
<%-- </div>--%>
<%-- </div>--%>
<%-- <x:title title="仓库管理" name="group"/>--%>
<%-- <div class="hg-form-cols">--%>
<%-- <div class="hg-form-row">--%>
<%-- <x:inputC name="lgortProfit" label="库存地点" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="lgnum" label="仓库号" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="lgtyp" label="存储类型" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="ltkza" label="存货下架存储类型" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="ltkze" label="存货上架存储类型" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="lgbkz" label="存储分区标识" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="lhmg1" label="仓库设施1存储数量" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="lhme1" label="仓库设施1存储单位" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="lety1" label="仓库设施1类型" labelCol="1" fieldCol="2"/>--%>
<%-- </div>--%>
<%-- </div>--%>
<%-- <x:title title="质量管理" name="group"/>--%>
<%-- <div class="hg-form-cols">--%>
<%-- <div class="hg-form-row">--%>
<%-- <x:inputC name="kzdkz" label="文档要求" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="art" label="检验类型" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="aktiv" label="激活标识" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="insmkQm" label="过账到质检(质检)" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="aktiv" label="激活标识" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="ppl" label="带任务清单检验" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="app" label="自动分配" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="mer" label="检查特性" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="dyn" label="允许略过" labelCol="1" fieldCol="2"/>--%>
<%-- </div>--%>
<%-- </div>--%>
<%-- <x:title title="财务核算" name="group"/>--%>
<%-- <div class="hg-form-cols">--%>
<%-- <div class="hg-form-row">--%>
<%-- <x:inputC name="bklas" label="评估分类" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="mlast" label="价格确定" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="vprsv" label="价格控制" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="peinh" label="定价基数" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="verpr" label="移动平均价" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="stprs" label="标准价" labelCol="1" fieldCol="2"/>--%>
<%-- </div>--%>
<%-- </div>--%>
<%-- <x:title title="成本核算" name="group"/>--%>
<%-- <div class="hg-form-cols">--%>
<%-- <div class="hg-form-row">--%>
<%-- <x:inputC name="ekalr" label="数量结构" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="ncost" label="不参与成本核算" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="hkmat" label="物料来源" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="awsls" label="差异码" labelCol="1" fieldCol="2"/>--%>
<%-- </div>--%>
<%-- </div>--%>
</form>
<form class="hg-form" method="post" action="" style="display: none;" id="auditForm">
<div class=" border-left-top" style="margin-top: 10px;">
<div class=" gray-bg">
<div class="col-xs-2 " style="text-align: center;margin-top: 30px">
<span>部门数据审核</span>
</div>
<div class="hg-form-cols">
<div class="hg-form-row">
<x:checkboxListC name="auditDept" label="驳回部门" list="auditDeptMap" labelCol="2"
fieldCol="10"/>
</div>
<div id="rejectReasonBox"></div>
<div style="text-align: center">
<div class="btn-group" style="margin: 15px 0px 15px 0px;">
<button id="reject" title="" type="button" onclick="rejectForm()" class="btn btn-gray"><i
class="fa fa-reply"></i>驳回
</button>
<button id="exPass" title="" type="button" class="btn btn-gray"><i
class="fa fa-mail-forward"></i>检查通过
</button>
<button id="send" title="" type="button" onclick="distributeForm()"
class="btn btn-gray"><i
class="fa fa-send-o"></i>传输
</button>
</div>
</div>
</div>
</div>
</div>
</form>
<div class="blank_div clearfix" ></div>
</div>
</body>
</html>
......@@ -40,7 +40,7 @@ function initializate() {
$("#buttonBox").show();
break;
}
businessPersonnelListGrid
// let isInitiator = ($("#isInitiator").val() === "true");
// if (isInitiator) {
// //创建或审核人
......@@ -95,6 +95,18 @@ function initializate() {
* 初始化对应的分发部门
*/
function loadGrid() {
//alert($("#businessCode").val());
// if ($("#businessCode").val()!=''){
$("#genericName").attr("disabled",true);
$("#applicableStandard").attr("disabled",true);
$("#baseUnit").attr("disabled",true);
$("#size").attr("disabled",true);
$("#material").attr("disabled",true);
$("#design").attr("disabled",true);
$("#brand").attr("disabled",true);
$("#specifications").attr("disabled",true);
$("#materialUsage").attr("disabled",true);
//}
let coRowNum = $("#businessUsage").val().replace(/,/g, '') + 1;
// let length = dept.length;
// let dept=$("#businessUsage").val().split(",");
......@@ -138,7 +150,7 @@ function loadGrid() {
],
dataAction: "server",
url: web_app.name + '/sapNonProdApplyNext/slicedDeptList.ajax',
parms: {dept: $("#businessUsage").val(), id: $("#applyDeptId").val()},
parms: {dept: $("#businessUsage").val(),id: $("#applyDeptId").val(),businessCode:$("#businessCode").val()},
pageSize: 20,
usePager: false,
enabledEdit: true,
......@@ -157,6 +169,7 @@ function loadGrid() {
* @returns {boolean}
*/
function saveForm() {
// alert($("#businessCode").val());
let extendedData = getExtendedData();
if (!extendedData) return false;
var _self = this;
......
......@@ -13,7 +13,7 @@
<x:hidden name="active" value=""/> <!--状态-->
<x:hidden name="meId" value=""/> <!--状态-->
<div class="container-fluid" style="padding: 10px;">
<x:billTitle title="非产品/非本成品类物料主数据维护申请表" needStatus="false" needPerson="true"/>
<x:billTitle title="非产品/非本成品类物料基本信息维护" needStatus="false" needPerson="true"/>
<form class="hg-form" method="post" action="" id="submitForm">
......@@ -41,6 +41,7 @@
<x:hidden name="applyDeptId"/>
<x:hidden name="id"/>
<x:hidden name="businessCode"/>
<x:title title="基本信息" name="group"/>
<div class="hg-form-cols">
<div class="hg-form-row">
......@@ -54,10 +55,26 @@
<x:radioC name="maintenanceType" label="维护类型" labelCol="1" fieldCol="11" dictionary="maintainType"/>
</div>
</div>
<x:title title="物品总体内容" name="group"/>
<div class="hg-form-cols">
<div class="hg-form-row">
<x:inputC name="genericName" label="通用品名" labelCol="1" fieldCol="2"/>
<x:inputC name="applicableStandard" label="适用标准" labelCol="1" fieldCol="2"/>
<x:selectC name="baseUnit" label="基本计量单位" labelCol="1" fieldCol="2" dictionary="measuringUnit"/>
<x:inputC name="specifications" label="规格" labelCol="1" fieldCol="2"/>
<x:inputC name="material" label="材质" labelCol="1" fieldCol="2"/>
<x:inputC name="design" label="版式" labelCol="1" fieldCol="2"/>
<x:inputC name="size" label="尺码" labelCol="1" fieldCol="2"/>
<x:inputC name="brand" label="品牌" labelCol="1" fieldCol="2"/>
<x:selectC name="itemAttributes" label="物品属性" labelCol="1" fieldCol="2" dictionary="suppliesType"/>
<x:inputC name="materialUsage" label="用途" labelCol="1" fieldCol="8"/>
</div>
</div>
<x:title title="维护基本信息" name="group"/>
<div class="hg-form-cols">
<div class="hg-form-row">
<x:inputC name="matnr" label="物品编码" labelCol="1" fieldCol="5"/>
<x:inputC name="matnr" label="物品编码" labelCol="1" fieldCol="2"/>
<x:selectC name="mtart" label="物品类型" labelCol="1" fieldCol="2" dictionary="suppliesType"/>
<x:inputC name="matkl" label="物料组" labelCol="1" fieldCol="2"/>
<x:inputC name="lvorm" label="集团级删除" labelCol="1" fieldCol="2"/>
......@@ -66,7 +83,7 @@
<x:inputC name="maktx" label="汉语品名" labelCol="1" fieldCol="2"/>
<x:inputC name="xchpf" label="批次管理" labelCol="1" fieldCol="2"/>
<x:inputC name="magrv" label="包装物料组" labelCol="1" fieldCol="2"/>
<x:inputC name="applicableStandard" label="适用标准" labelCol="1" fieldCol="5"/>
<x:inputC name="maktxEn" label="英语品名" labelCol="1" fieldCol="2"/>
<x:selectC name="meins" label="基本计量单位" labelCol="1" fieldCol="2" dictionary="measuringUnit"/>
<x:inputC name="raube" label="存储条件" labelCol="1" fieldCol="2"/>
......@@ -77,18 +94,18 @@
<x:inputC name="iprkz" label="有效时间标识" labelCol="1" fieldCol="2"/>
<x:inputC name="mhdhb" label="总有效期" labelCol="1" fieldCol="2"/>
<x:inputC name="" label="旧料号" labelCol="1" fieldCol="2"/>
<x:inputC name="design" label="版式" labelCol="1" fieldCol="2"/>
<x:inputC name="size" label="尺码" labelCol="1" fieldCol="2"/>
<x:inputC name="brand" label="品牌" labelCol="1" fieldCol="2"/>
<x:inputC name="materialUsage" label="用途" labelCol="1" fieldCol="2"/>
<x:inputC name="mhdrz" label="最小货架寿命" labelCol="1" fieldCol="2"/>
<x:inputC name="werks" label="工厂" labelCol="1" fieldCol="2"/>
<x:inputC name="lgort" label="库存地点" labelCol="1" fieldCol="2"/>
<x:inputC name="vkorg" label="销售组织" labelCol="1" fieldCol="2"/>
<x:inputC name="vtweg" label="分销渠道" labelCol="1" fieldCol="2"/>
<x:inputC name="lgnum" label="仓库号" labelCol="1" fieldCol="2"/>
<x:inputC name="lgtyp" label="存储类型" labelCol="1" fieldCol="2"/>
<x:inputC name="" label="文本说明" labelCol="1" fieldCol="2"/>
<x:inputC name="normt" label="适用标准" labelCol="1" fieldCol="11"/>
<div class="hg-form-row">
<x:inputC name="werks" label="工厂" labelCol="1" fieldCol="1"/>
<x:inputC name="lgort" label="库存地点" labelCol="1" fieldCol="1"/>
<x:inputC name="vkorg" label="销售组织" labelCol="1" fieldCol="1"/>
<x:inputC name="vtweg" label="分销渠道" labelCol="1" fieldCol="1"/>
<x:inputC name="lgnum" label="仓库号" labelCol="1" fieldCol="1"/>
<x:inputC name="lgtyp" label="存储类型" labelCol="1" fieldCol="1"/>
</div>
</div>
</div>
......
let gridManager = null;
//页面控制标识
let control = {
isInitiator: false,//是否为审核人
isDistribute: false,//是否已分发
}
$(document).ready(function () {
initializate()
loadGrid();
// initAssistantGrid();
loadRejectReasonBox();
})
function initializate() {
//页面控制
debugger
switch ($("#active").val()) {
case '0'://已分发未完成
if ($("#deptCode").val() === "system") {
$("#auditForm").show();
} else {
$("#buttonBox").show();
$("#showChart").remove();
}
break;
case '1'://完成/审核
// $("#auditForm").show();
break;
case '2'://保存未分发
$("#buttonBox").show();
break;
case '3'://被驳回
showRejectCauseBox();
$("#buttonBox").show();
$("#showChart").remove();
break;
default://其他/详情
$("#buttonBox").show();
break;
}
// let isInitiator = ($("#isInitiator").val() === "true");
// if (isInitiator) {
// //创建或审核人
// $("#buttonBox").remove();
// }else{
// //审核人
// $("#auditForm").remove();
// }
// $('input[name="maintenanceType"]').change(function () {
// if ($(this).is(':checked')) {
// console.log($(this).val()); // 输出选中的值
// switch ($(this).val()) {
// case 'new':
// if ($("#mtart").val() == "ZMPN") {
// UICtrl.enable($("#matnr"));
// } else {
// UICtrl.disable($("#matnr"));
// }
// UICtrl.disable($("#lvorm"));
// UICtrl.enable($("#mtart"));
// UICtrl.enable($("#matkl"));
// UICtrl.enable($("#spart"));
// break;
// case 'modify':
// UICtrl.enable($("#lvorm"))
// UICtrl.disable($("#mtart"));
// UICtrl.disable($("#matkl"));
// UICtrl.disable($("#spart"));
// break;
// case 'extend':
// UICtrl.enable($("#lvorm"))
// UICtrl.disable($("#mtart"));
// UICtrl.disable($("#matkl"));
// UICtrl.disable($("#spart"));
// break;
// }
// }
// });
//
// $('input[name="businessUsage"]').change(function () {
// if ($(this).is(":checked")) {
// console.log($(this).val()); // 输出选中的值
// }
// });
}
/**
* 初始化对应的分发部门
*/
function loadGrid() {
// alert($("#businessCode").val());
$("#genericName").attr("disabled",true);
$("#applicableStandard").attr("disabled",true);
$("#baseUnit").attr("disabled",true);
$("#size").attr("disabled",true);
$("#material").attr("disabled",true);
$("#design").attr("disabled",true);
$("#brand").attr("disabled",true);
$("#specifications").attr("disabled",true);
$("#materialUsage").attr("disabled",true);
let coRowNum = $("#businessUsage").val().replace(/,/g, '') + 1;
// let length = dept.length;
// let dept=$("#businessUsage").val().split(",");
// let a=(dept.length+1)*37.5;
gridManager = UICtrl.grid("#businessPersonnelListGrid", {
columns: [
{display: "部门", name: "deptName", width: 200, minWidth: 60, type: "string", align: "left"},
{ display: "部门人员", name: "userName", width: 200, minWidth: 60, type: "string", align: "left",
editor: {
type: 'tree',
required: true,
data: {
name: 'org',
filter: 'psm',
minWidth: 250
},
textField: 'userName',
valueField: 'userCode'
}
// editor: {
// required: true, type: "select",
// data: {
// type: 'system',
// name: "testUser",
// back: {
// id: "userName",
// userCode: "userCode"
// },
// getParam: function (data) {
// return {deptCode: data.deptCode}
// },
// },
// }
},
{ display: "人员Id", name: "userCode", width: 260, minWidth: 60, type: "string", align: "left",
editor: {
type: 'text',
required: true
}
},
],
dataAction: "server",
url: web_app.name + '/sapNonProdApplyNext/slicedDeptList.ajax',
parms: {dept: $("#businessUsage").val(), id: $("#applyDeptId").val()},
pageSize: 20,
usePager: false,
enabledEdit: true,
width: "100%",
height: coRowNum * 37.5,
heightDiff: -8,
fixedCellHeight: true,
selectRowButtonOnly: true,
});
UICtrl.setSearchAreaToggle(gridManager);
}
/**
* 表单提交
* @returns {boolean}
*/
function saveForm() {
alert($("#businessCode").val());
let extendedData = getExtendedData();
if (!extendedData) return false;
var _self = this;
$('#submitForm').ajaxSubmit({
url: web_app.name + '/sapNonProdApplyNext/saveSapNonProdApplyDept.ajax',
param: extendedData,
success: function (data) {
$("#applyDeptId").val(data.applyDeptId);
Public.successTip("保存成功!");
_self.close();
}
});
}
/**
* 分发表单到各个部门
*/
function distributeForm() {
if (control.isDistribute) {
Public.successTip("已分发");
return false;
}
let extendedData = getExtendedData();
if (!extendedData) return false;
$('#submitForm').ajaxSubmit({
url: web_app.name + '/sapNonProdApplyNext/distributeSapNonProdApplyDept.ajax',
param: extendedData,
success: function (data) {
Public.successTip("分发成功!");
control.isDistribute = true;
_self.close();
}
});
}
function getExtendedData() {
debugger
let msg = "[";
let isUndefined = false
let deptStaffResult = DataUtil.getGridData({
gridManager: gridManager,
isAllData: true,
onCheck: function (data) {
if (typeof data.userCode === 'undefined') {
msg += `${data.deptName}、`;
isUndefined = true;
}
return true;
}
});
if (isUndefined) {
Public.tip(`${msg.slice(0, -1)}]未选择对应分发人员`);
return false
}
let extendedData = {};
extendedData.deptStaff = Public.encodeJSONURI(deptStaffResult);
return extendedData;
}
function rejectForm() {
debugger
$('#auditForm').ajaxSubmit({
url: web_app.name + '/sapNonProdApplyNext/rejectNonProdApplyDept.ajax',
param: {meId:getMeId()},
success: function (data) {
Public.successTip("已驳回!");
_self.close();
}
});
}
function checkThrough(){
$('#exPass').ajaxSubmit({
url: web_app.name + '/sapNonProdApplyNext/rejectNonProdApplyDept.ajax',
param: {meId:getMeId()},
success: function (data) {
Public.successTip("检查通过!");
_self.close();
}
});
}
/**
* 根据选择的驳回的部门生成输入框
*/
function loadRejectReasonBox() {
$('input[name="auditDept"]').change(function () {
let val = $(this).val()
let textData = $(this).parent().text().trim()
if (this.checked) {
if ($(`#id_${val}`).length) {
// 元素存在
$(`#id_${val}`).show();
} else {
// 元素不存在
let box = `<div id="id_${val}">
<div class="col-xs-4 col-sm-2" style="height:60px;">
<label class="hg-form-label" name="${val}" title="[${textData}]驳回原因">[${textData}]驳回原因&nbsp;:</label>
</div>
<div class="col-xs-8 col-sm-10 col-warp col-white-bg" style="height:60px;">
<textarea name="${val}" label="[${textData}]驳回原因" id="text_${val}"></textarea>
</div>
</div>`;
$("#rejectReasonBox").append(box)
}
$(window).scrollTop($(document).height());
} else {
$(`#id_${val}`).hide();
}
}
);
}
/**
*根据驳回信息生成驳回信息展示栏
*/
function showRejectCauseBox() {
Public.ajax(web_app.name + '/sapNonProdApplyNext/slicedRejectCauseList.ajax', {meId: getMeId()}, function (data) {
const generateCauseHTML = (item, newCause) => {
const { rectifyDate, rejectMsg, bsnExecuteId, rejectDate } = item;
return `
<div class="hg-form-row">
<div class="col-xs-4 col-sm-1" style="height:56px;">
<label class="hg-form-label" title="驳回原因">驳回原因${newCause}&nbsp;:</label>
</div>
<div class="col-xs-8 col-sm-11 col-warp col-gray-bg" style="height:56px;">
<textarea rows="2" label="驳回原因" readonly="readonly">${rejectMsg}</textarea>
</div>
</div>
<div class="hg-form-row">
<div class="col-xs-4 col-sm-1">
<label class="hg-form-label" title="驳回人">驳回人&nbsp;:</label>
</div>
<div class="col-xs-8 col-sm-3 col-warp col-gray-bg">
<input type="text" value="${bsnExecuteId}" readonly="readonly" label="驳回人">
</div>
<div class="col-xs-4 col-sm-1">
<label class="hg-form-label" title="驳回时间">驳回时间&nbsp;:</label>
</div>
<div class="col-xs-8 col-sm-3 col-warp col-gray-bg">
<input type="text" value="${rejectDate}" readonly="readonly" label="驳回时间">
</div>
<div class="col-xs-4 col-sm-1">
<label class="hg-form-label" title="处理时间">处理时间&nbsp;:</label>
</div>
<div class="col-xs-8 col-sm-3 col-warp col-gray-bg">
<input type="text" value="${rectifyDate}" readonly="readonly" label="处理时间">
</div>
</div>
`;
};
let newCause = `<span style="color:red;">new</span>`;
const ahtml = data
.map((item) => {
const cause = item.rectifyDate === '' ? `[${newCause}]` : '';
return generateCauseHTML(item, cause);
})
.join('');
$("#cause-details-box").html(ahtml);
$("#causeBox").show();
})
}
function getMeId() {
return $("#meId").val() || '';
}
\ No newline at end of file
<%@ 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,combox,commonTree,date"/>
<x:script src='/biz/topsun/sap/nonProdApply/nonProdApplyPurchase.js'/>
</head>
<body>
<x:hidden name="isDetailPage" value="false"/> <!--是否是详情页-->
<x:hidden name="deptCode" value="false"/> <!--是否是详情页-->
<x:hidden name="active" value=""/> <!--状态-->
<x:hidden name="meId" value=""/> <!--状态-->
<div class="container-fluid" style="padding: 10px;">
<x:billTitle title="非产品/非本成品类物料采购信息维护" needStatus="false" needPerson="true"/>
<form class="hg-form" method="post" action="" id="submitForm">
<div style="float: right; margin-right: 10px;display: none;" class="btn-group" id="buttonBox">
<button id="save" title="" type="button" onclick="saveForm()" class="btn btn-gray"><i
class="fa fa-save"></i>保存
</button>
<button id="back" title="" type="button" class="btn btn-gray"><i
class="fa fa-reply"></i>撤销
</button>
<button id="showChart" title="" type="button" onclick="distributeForm()" class="btn btn-gray"><i
class="fa fa-sitemap"></i>分发
</button>
</div>
<br/>
<div class=" border-left-top" style="margin-top: 20px;display: none;" id="causeBox">
<div class=" gray-bg">
<div class="col-xs-2 " style="text-align: center;margin-top: 30px">
<h4>驳回历史</h4>
</div>
<div class="hg-form-cols" id="cause-details-box"></div>
</div>
</div>
<x:hidden name="applyDeptId"/>
<x:hidden name="id"/>
<x:hidden name="businessCode"/>
<x:title title="基本信息" name="group"/>
<div class="hg-form-cols">
<div class="hg-form-row">
<x:inputC name="billCode" label="申请单编号" labelCol="1" readonly="true" fieldCol="2"/>
<x:selectC name="statusId" label="批准状态" dictionary="bizBillStatus" disabled="true" labelCol="1"
fieldCol="2"/>
<x:inputC name="personMemberName" label="填写人" readonly="true" labelCol="1" fieldCol="2"/>
<x:inputC name="fillinDate" label="填写日期" readonly="true" wrapper="date" labelCol="1" fieldCol="2"/>
</div>
<div class="hg-form-row">
<x:radioC name="maintenanceType" label="维护类型" labelCol="1" fieldCol="11" dictionary="maintainType"/>
</div>
</div>
<x:title title="物品总体内容" name="group"/>
<div class="hg-form-cols">
<div class="hg-form-row">
<x:inputC name="genericName" label="通用品名" labelCol="1" fieldCol="2"/>
<x:inputC name="applicableStandard" label="适用标准" labelCol="1" fieldCol="2"/>
<x:selectC name="baseUnit" label="基本计量单位" labelCol="1" fieldCol="2" dictionary="measuringUnit"/>
<x:inputC name="specifications" label="规格" labelCol="1" fieldCol="2"/>
<x:inputC name="material" label="材质" labelCol="1" fieldCol="2"/>
<x:inputC name="design" label="版式" labelCol="1" fieldCol="2"/>
<x:inputC name="size" label="尺码" labelCol="1" fieldCol="2"/>
<x:inputC name="brand" label="品牌" labelCol="1" fieldCol="2"/>
<x:selectC name="itemAttributes" label="物品属性" labelCol="1" fieldCol="2" dictionary="suppliesType"/>
<x:inputC name="materialUsage" label="用途" labelCol="1" fieldCol="8"/>
</div>
</div>
<x:title title="维护采购信息" name="group"/>
<div class="hg-form-cols">
<div class="hg-form-row">
<x:inputC name="matnr" label="物品编码" labelCol="1" fieldCol="5"/>
<x:selectC name="mtart" label="物品类型" labelCol="1" fieldCol="2" dictionary="suppliesType"/>
<x:inputC name="matkl" label="物料组" labelCol="1" fieldCol="2"/>
<x:inputC name="lvorm" label="集团级删除" labelCol="1" fieldCol="2"/>
<x:inputC name="spart" label="产品组" labelCol="1" fieldCol="2"/>
<x:inputC name="mtposMara" label="项目类别组" labelCol="1" fieldCol="2"/>
<x:inputC name="maktx" label="汉语品名" labelCol="1" fieldCol="2"/>
<x:inputC name="xchpf" label="批次管理" labelCol="1" fieldCol="2"/>
<x:inputC name="magrv" label="包装物料组" labelCol="1" fieldCol="2"/>
<x:inputC name="applicableStandard" label="适用标准" labelCol="1" fieldCol="5"/>
<x:inputC name="maktxEn" label="英语品名" labelCol="1" fieldCol="2"/>
<x:selectC name="meins" label="基本计量单位" labelCol="1" fieldCol="2" dictionary="measuringUnit"/>
<x:inputC name="raube" label="存储条件" labelCol="1" fieldCol="2"/>
<x:inputC name="brgew" label="毛重" labelCol="1" fieldCol="2"/>
<x:inputC name="gewei" label="重量单位" labelCol="1" fieldCol="2"/>
<x:inputC name="volum" label="体积" labelCol="1" fieldCol="2"/>
<x:inputC name="voleh" label="体积单位" labelCol="1" fieldCol="2"/>
<x:inputC name="iprkz" label="有效时间标识" labelCol="1" fieldCol="2"/>
<x:inputC name="mhdhb" label="总有效期" labelCol="1" fieldCol="2"/>
<x:inputC name="" label="旧料号" labelCol="1" fieldCol="2"/>
<x:inputC name="design" label="版式" labelCol="1" fieldCol="2"/>
<x:inputC name="size" label="尺码" labelCol="1" fieldCol="2"/>
<x:inputC name="brand" label="品牌" labelCol="1" fieldCol="2"/>
<x:inputC name="materialUsage" label="用途" labelCol="1" fieldCol="2"/>
<x:inputC name="mhdrz" label="最小货架寿命" labelCol="1" fieldCol="2"/>
<x:inputC name="werks" label="工厂" labelCol="1" fieldCol="2"/>
<x:inputC name="lgort" label="库存地点" labelCol="1" fieldCol="2"/>
<x:inputC name="vkorg" label="销售组织" labelCol="1" fieldCol="2"/>
<x:inputC name="vtweg" label="分销渠道" labelCol="1" fieldCol="2"/>
<x:inputC name="lgnum" label="仓库号" labelCol="1" fieldCol="2"/>
<x:inputC name="lgtyp" label="存储类型" labelCol="1" fieldCol="2"/>
<x:inputC name="" label="文本说明" labelCol="1" fieldCol="2"/>
</div>
</div>
<div class="hg-form-cols">
<div class="hg-form-row">
<x:hidden name="businessUsage"/>
<x:checkboxListC name="businessUsage" label="业务用途" dictionary="serviceusage" labelCol="1"
fieldCol="11"/>
</div>
<div class="hg-form-row">
<x:title title="业务人员" name="group"/>
<div id="businessPersonnelListGrid" style="margin: 2px;"></div>
</div>
</div>
<div class="hg-form-cols">
<div class="hg-form-row">
<x:textareaC rows="3" name="textDescription" label="文本说明" labelCol="1" fieldCol="11"/>
</div>
</div>
<%-- <x:title title="分类" name="group"/>--%>
<%-- <div class="hg-form-cols">--%>
<%-- <div class="hg-form-row">--%>
<%-- <x:inputC name="klart" label="类型" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="classify" label="分类" labelCol="1" fieldCol="2"/>--%>
<%-- </div>--%>
<%-- </div>--%>
<%-- <x:title title="销售" name="group"/>--%>
<%-- <div class="hg-form-cols">--%>
<%-- <div class="hg-form-row">--%>
<%-- <x:inputC name="vkorg" label="销售组织" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="vtweg" label="分销渠道" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="vrkme" label="销售计量单位" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="umren" label="转换分母" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="umrez" label="转换分子" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="dwerk" label="交货工厂" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="aland" label="税收发运国" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="taxkm" label="税分类" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="versg" label="统计组" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="kondm" label="物料定价组" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="ktgrm" label="会计科目组" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="prodh" label="产品层级" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="mvgr1" label="版式" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="mvgr2" label="品牌" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="mvgr3" label="用途" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="mvgr4" label="备用" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="mvgr5" label="备用" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="mtpos" label="销售项次组" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="tragr" label="运输组" labelCol="1" fieldCol="2"/>--%>
<%-- </div>--%>
<%-- </div>--%>
<%-- <x:title title="采购" name="group"/>--%>
<%-- <div class="hg-form-cols">--%>
<%-- <div class="hg-form-row">--%>
<%-- <x:inputC name="bstme" label="采购计量单位" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="umrenPurch" label="转换分母" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="umrezPurch" label="转换分子" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="ekgrp" label="默认采购组" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="mprof" label="MPN参数" labelCol="1" fieldCol="2"/>--%>
<%-- </div>--%>
<%-- </div>--%>
<%-- <x:title title="MRP" name="group"/>--%>
<%-- <div class="hg-form-cols">--%>
<%-- <div class="hg-form-row">--%>
<%-- <x:inputC name="lgort" label="库存地点" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="disgr" label="MRP组" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="dismm" label="MRP类型" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="minbe" label="重订货点" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="dispo" label="MRP控制者" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="disls" label="批量规模" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="bstfe" label="固定批量" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="bstma" label="最大批量" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="bstmi" label="最小批量" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="mabst" label="最大存货水平" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="bstrf" label="设入值" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="beskz" label="获取类型" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="sobsl" label="特殊获取方式" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="lgpro" label="默认生产库存地" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="rgekz" label="倒冲标志" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="lgfsb" label="默认采购收货库存地" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="webaz" label="收货处理天数" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="dzeit" label="自制时间" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="plifz" label="外部采购交货时间" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="fhori" label="排程边际码" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="eisbe" label="安全库存" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="eislo" label="最小安全库存" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="strgr" label="策略组" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="mtvfp" label="可用性检查组" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="wzeit" label="补货提前天数" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="altsl" label="BOM选择方法" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="sbdkz" label="独立/集中" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="diskz" label="库存地MRP标识" labelCol="1" fieldCol="2"/>--%>
<%-- </div>--%>
<%-- </div>--%>
<%-- <x:title title="生产" name="group"/>--%>
<%-- <div class="hg-form-cols">--%>
<%-- <div class="hg-form-row">--%>
<%-- <x:inputC name="ausme" label="投料计量单位" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="umrenProd" label="转换分母(生产)" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="umrezProd" label="转换分子(生产)" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="sfcpf" label="生产计划参数文件" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="insmk" label="过账到质检" labelCol="1" fieldCol="2"/>--%>
<%-- </div>--%>
<%-- </div>--%>
<%-- <x:title title="存储管理" name="group"/>--%>
<%-- <div class="hg-form-cols">--%>
<%-- <div class="hg-form-row">--%>
<%-- <x:inputC name="lgortQm" label="库存地点" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="sernp" label="序列号参数" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="serlv" label="序列号水平" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="prctr" label="利润中心" labelCol="1" fieldCol="2"/>--%>
<%-- </div>--%>
<%-- </div>--%>
<%-- <x:title title="仓库管理" name="group"/>--%>
<%-- <div class="hg-form-cols">--%>
<%-- <div class="hg-form-row">--%>
<%-- <x:inputC name="lgortProfit" label="库存地点" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="lgnum" label="仓库号" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="lgtyp" label="存储类型" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="ltkza" label="存货下架存储类型" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="ltkze" label="存货上架存储类型" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="lgbkz" label="存储分区标识" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="lhmg1" label="仓库设施1存储数量" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="lhme1" label="仓库设施1存储单位" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="lety1" label="仓库设施1类型" labelCol="1" fieldCol="2"/>--%>
<%-- </div>--%>
<%-- </div>--%>
<%-- <x:title title="质量管理" name="group"/>--%>
<%-- <div class="hg-form-cols">--%>
<%-- <div class="hg-form-row">--%>
<%-- <x:inputC name="kzdkz" label="文档要求" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="art" label="检验类型" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="aktiv" label="激活标识" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="insmkQm" label="过账到质检(质检)" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="aktiv" label="激活标识" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="ppl" label="带任务清单检验" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="app" label="自动分配" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="mer" label="检查特性" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="dyn" label="允许略过" labelCol="1" fieldCol="2"/>--%>
<%-- </div>--%>
<%-- </div>--%>
<%-- <x:title title="财务核算" name="group"/>--%>
<%-- <div class="hg-form-cols">--%>
<%-- <div class="hg-form-row">--%>
<%-- <x:inputC name="bklas" label="评估分类" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="mlast" label="价格确定" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="vprsv" label="价格控制" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="peinh" label="定价基数" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="verpr" label="移动平均价" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="stprs" label="标准价" labelCol="1" fieldCol="2"/>--%>
<%-- </div>--%>
<%-- </div>--%>
<%-- <x:title title="成本核算" name="group"/>--%>
<%-- <div class="hg-form-cols">--%>
<%-- <div class="hg-form-row">--%>
<%-- <x:inputC name="ekalr" label="数量结构" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="ncost" label="不参与成本核算" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="hkmat" label="物料来源" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="awsls" label="差异码" labelCol="1" fieldCol="2"/>--%>
<%-- </div>--%>
<%-- </div>--%>
</form>
<form class="hg-form" method="post" action="" style="display: none;" id="auditForm">
<div class=" border-left-top" style="margin-top: 10px;">
<div class=" gray-bg">
<div class="col-xs-2 " style="text-align: center;margin-top: 30px">
<span>部门数据审核</span>
</div>
<div class="hg-form-cols">
<div class="hg-form-row">
<x:checkboxListC name="auditDept" label="驳回部门" list="auditDeptMap" labelCol="2"
fieldCol="10"/>
</div>
<div id="rejectReasonBox"></div>
<div style="text-align: center">
<div class="btn-group" style="margin: 15px 0px 15px 0px;">
<button id="reject" title="" type="button" onclick="rejectForm()" class="btn btn-gray"><i
class="fa fa-reply"></i>驳回
</button>
<button id="exPass" title="" type="button" class="btn btn-gray"><i
class="fa fa-mail-forward"></i>检查通过
</button>
<button id="send" title="" type="button" onclick="distributeForm()"
class="btn btn-gray"><i
class="fa fa-send-o"></i>传输
</button>
</div>
</div>
</div>
</div>
</div>
</form>
<div class="blank_div clearfix" ></div>
</div>
</body>
</html>
let gridManager = null;
//页面控制标识
let control = {
isInitiator: false,//是否为审核人
isDistribute: false,//是否已分发
}
$(document).ready(function () {
initializate()
loadGrid();
// initAssistantGrid();
loadRejectReasonBox();
})
function initializate() {
//页面控制
debugger
switch ($("#active").val()) {
case '0'://已分发未完成
if ($("#deptCode").val() === "system") {
$("#auditForm").show();
} else {
$("#buttonBox").show();
$("#showChart").remove();
}
break;
case '1'://完成/审核
// $("#auditForm").show();
break;
case '2'://保存未分发
$("#buttonBox").show();
break;
case '3'://被驳回
showRejectCauseBox();
$("#buttonBox").show();
$("#showChart").remove();
break;
default://其他/详情
$("#buttonBox").show();
break;
}
// let isInitiator = ($("#isInitiator").val() === "true");
// if (isInitiator) {
// //创建或审核人
// $("#buttonBox").remove();
// }else{
// //审核人
// $("#auditForm").remove();
// }
// $('input[name="maintenanceType"]').change(function () {
// if ($(this).is(':checked')) {
// console.log($(this).val()); // 输出选中的值
// switch ($(this).val()) {
// case 'new':
// if ($("#mtart").val() == "ZMPN") {
// UICtrl.enable($("#matnr"));
// } else {
// UICtrl.disable($("#matnr"));
// }
// UICtrl.disable($("#lvorm"));
// UICtrl.enable($("#mtart"));
// UICtrl.enable($("#matkl"));
// UICtrl.enable($("#spart"));
// break;
// case 'modify':
// UICtrl.enable($("#lvorm"))
// UICtrl.disable($("#mtart"));
// UICtrl.disable($("#matkl"));
// UICtrl.disable($("#spart"));
// break;
// case 'extend':
// UICtrl.enable($("#lvorm"))
// UICtrl.disable($("#mtart"));
// UICtrl.disable($("#matkl"));
// UICtrl.disable($("#spart"));
// break;
// }
// }
// });
//
// $('input[name="businessUsage"]').change(function () {
// if ($(this).is(":checked")) {
// console.log($(this).val()); // 输出选中的值
// }
// });
}
/**
* 初始化对应的分发部门
*/
function loadGrid() {
// alert($("#businessCode").val());
$("#genericName").attr("disabled",true);
$("#applicableStandard").attr("disabled",true);
$("#baseUnit").attr("disabled",true);
$("#size").attr("disabled",true);
$("#material").attr("disabled",true);
$("#design").attr("disabled",true);
$("#brand").attr("disabled",true);
$("#specifications").attr("disabled",true);
$("#materialUsage").attr("disabled",true);
let coRowNum = $("#businessUsage").val().replace(/,/g, '') + 1;
// let length = dept.length;
// let dept=$("#businessUsage").val().split(",");
// let a=(dept.length+1)*37.5;
gridManager = UICtrl.grid("#businessPersonnelListGrid", {
columns: [
{display: "部门", name: "deptName", width: 200, minWidth: 60, type: "string", align: "left"},
{ display: "部门人员", name: "userName", width: 200, minWidth: 60, type: "string", align: "left",
editor: {
type: 'tree',
required: true,
data: {
name: 'org',
filter: 'psm',
minWidth: 250
},
textField: 'userName',
valueField: 'userCode'
}
// editor: {
// required: true, type: "select",
// data: {
// type: 'system',
// name: "testUser",
// back: {
// id: "userName",
// userCode: "userCode"
// },
// getParam: function (data) {
// return {deptCode: data.deptCode}
// },
// },
// }
},
{ display: "人员Id", name: "userCode", width: 260, minWidth: 60, type: "string", align: "left",
editor: {
type: 'text',
required: true
}
},
],
dataAction: "server",
url: web_app.name + '/sapNonProdApplyNext/slicedDeptList.ajax',
parms: {dept: $("#businessUsage").val(), id: $("#applyDeptId").val()},
pageSize: 20,
usePager: false,
enabledEdit: true,
width: "100%",
height: coRowNum * 37.5,
heightDiff: -8,
fixedCellHeight: true,
selectRowButtonOnly: true,
});
UICtrl.setSearchAreaToggle(gridManager);
}
/**
* 表单提交
* @returns {boolean}
*/
function saveForm() {
alert($("#businessCode").val());
let extendedData = getExtendedData();
if (!extendedData) return false;
var _self = this;
$('#submitForm').ajaxSubmit({
url: web_app.name + '/sapNonProdApplyNext/saveSapNonProdApplyDept.ajax',
param: extendedData,
success: function (data) {
$("#applyDeptId").val(data.applyDeptId);
Public.successTip("保存成功!");
_self.close();
}
});
}
/**
* 分发表单到各个部门
*/
function distributeForm() {
if (control.isDistribute) {
Public.successTip("已分发");
return false;
}
let extendedData = getExtendedData();
if (!extendedData) return false;
$('#submitForm').ajaxSubmit({
url: web_app.name + '/sapNonProdApplyNext/distributeSapNonProdApplyDept.ajax',
param: extendedData,
success: function (data) {
Public.successTip("分发成功!");
control.isDistribute = true;
_self.close();
}
});
}
function getExtendedData() {
debugger
let msg = "[";
let isUndefined = false
let deptStaffResult = DataUtil.getGridData({
gridManager: gridManager,
isAllData: true,
onCheck: function (data) {
if (typeof data.userCode === 'undefined') {
msg += `${data.deptName}、`;
isUndefined = true;
}
return true;
}
});
if (isUndefined) {
Public.tip(`${msg.slice(0, -1)}]未选择对应分发人员`);
return false
}
let extendedData = {};
extendedData.deptStaff = Public.encodeJSONURI(deptStaffResult);
return extendedData;
}
function rejectForm() {
debugger
$('#auditForm').ajaxSubmit({
url: web_app.name + '/sapNonProdApplyNext/rejectNonProdApplyDept.ajax',
param: {meId:getMeId()},
success: function (data) {
Public.successTip("已驳回!");
_self.close();
}
});
}
function checkThrough(){
$('#exPass').ajaxSubmit({
url: web_app.name + '/sapNonProdApplyNext/rejectNonProdApplyDept.ajax',
param: {meId:getMeId()},
success: function (data) {
Public.successTip("检查通过!");
_self.close();
}
});
}
/**
* 根据选择的驳回的部门生成输入框
*/
function loadRejectReasonBox() {
$('input[name="auditDept"]').change(function () {
let val = $(this).val()
let textData = $(this).parent().text().trim()
if (this.checked) {
if ($(`#id_${val}`).length) {
// 元素存在
$(`#id_${val}`).show();
} else {
// 元素不存在
let box = `<div id="id_${val}">
<div class="col-xs-4 col-sm-2" style="height:60px;">
<label class="hg-form-label" name="${val}" title="[${textData}]驳回原因">[${textData}]驳回原因&nbsp;:</label>
</div>
<div class="col-xs-8 col-sm-10 col-warp col-white-bg" style="height:60px;">
<textarea name="${val}" label="[${textData}]驳回原因" id="text_${val}"></textarea>
</div>
</div>`;
$("#rejectReasonBox").append(box)
}
$(window).scrollTop($(document).height());
} else {
$(`#id_${val}`).hide();
}
}
);
}
/**
*根据驳回信息生成驳回信息展示栏
*/
function showRejectCauseBox() {
Public.ajax(web_app.name + '/sapNonProdApplyNext/slicedRejectCauseList.ajax', {meId: getMeId()}, function (data) {
const generateCauseHTML = (item, newCause) => {
const { rectifyDate, rejectMsg, bsnExecuteId, rejectDate } = item;
return `
<div class="hg-form-row">
<div class="col-xs-4 col-sm-1" style="height:56px;">
<label class="hg-form-label" title="驳回原因">驳回原因${newCause}&nbsp;:</label>
</div>
<div class="col-xs-8 col-sm-11 col-warp col-gray-bg" style="height:56px;">
<textarea rows="2" label="驳回原因" readonly="readonly">${rejectMsg}</textarea>
</div>
</div>
<div class="hg-form-row">
<div class="col-xs-4 col-sm-1">
<label class="hg-form-label" title="驳回人">驳回人&nbsp;:</label>
</div>
<div class="col-xs-8 col-sm-3 col-warp col-gray-bg">
<input type="text" value="${bsnExecuteId}" readonly="readonly" label="驳回人">
</div>
<div class="col-xs-4 col-sm-1">
<label class="hg-form-label" title="驳回时间">驳回时间&nbsp;:</label>
</div>
<div class="col-xs-8 col-sm-3 col-warp col-gray-bg">
<input type="text" value="${rejectDate}" readonly="readonly" label="驳回时间">
</div>
<div class="col-xs-4 col-sm-1">
<label class="hg-form-label" title="处理时间">处理时间&nbsp;:</label>
</div>
<div class="col-xs-8 col-sm-3 col-warp col-gray-bg">
<input type="text" value="${rectifyDate}" readonly="readonly" label="处理时间">
</div>
</div>
`;
};
let newCause = `<span style="color:red;">new</span>`;
const ahtml = data
.map((item) => {
const cause = item.rectifyDate === '' ? `[${newCause}]` : '';
return generateCauseHTML(item, cause);
})
.join('');
$("#cause-details-box").html(ahtml);
$("#causeBox").show();
})
}
function getMeId() {
return $("#meId").val() || '';
}
\ No newline at end of file
<%@ 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,combox,commonTree,date"/>
<x:script src='/biz/topsun/sap/nonProdApply/nonProdApplySale.js'/>
</head>
<body>
<x:hidden name="isDetailPage" value="false"/> <!--是否是详情页-->
<x:hidden name="deptCode" value="false"/> <!--是否是详情页-->
<x:hidden name="active" value=""/> <!--状态-->
<x:hidden name="meId" value=""/> <!--状态-->
<div class="container-fluid" style="padding: 10px;">
<x:billTitle title="非产品/非本成品类物料销售信息维护" needStatus="false" needPerson="true"/>
<form class="hg-form" method="post" action="" id="submitForm">
<div style="float: right; margin-right: 10px;display: none;" class="btn-group" id="buttonBox">
<button id="save" title="" type="button" onclick="saveForm()" class="btn btn-gray"><i
class="fa fa-save"></i>保存
</button>
<button id="back" title="" type="button" class="btn btn-gray"><i
class="fa fa-reply"></i>撤销
</button>
<button id="showChart" title="" type="button" onclick="distributeForm()" class="btn btn-gray"><i
class="fa fa-sitemap"></i>分发
</button>
</div>
<br/>
<div class=" border-left-top" style="margin-top: 20px;display: none;" id="causeBox">
<div class=" gray-bg">
<div class="col-xs-2 " style="text-align: center;margin-top: 30px">
<h4>驳回历史</h4>
</div>
<div class="hg-form-cols" id="cause-details-box"></div>
</div>
</div>
<x:hidden name="applyDeptId"/>
<x:hidden name="id"/>
<x:hidden name="businessCode"/>
<x:title title="基本信息" name="group"/>
<div class="hg-form-cols">
<div class="hg-form-row">
<x:inputC name="billCode" label="申请单编号" labelCol="1" readonly="true" fieldCol="2"/>
<x:selectC name="statusId" label="批准状态" dictionary="bizBillStatus" disabled="true" labelCol="1"
fieldCol="2"/>
<x:inputC name="personMemberName" label="填写人" readonly="true" labelCol="1" fieldCol="2"/>
<x:inputC name="fillinDate" label="填写日期" readonly="true" wrapper="date" labelCol="1" fieldCol="2"/>
</div>
<div class="hg-form-row">
<x:radioC name="maintenanceType" label="维护类型" labelCol="1" fieldCol="11" dictionary="maintainType"/>
</div>
</div>
<x:title title="物品总体内容" name="group"/>
<div class="hg-form-cols">
<div class="hg-form-row">
<x:inputC name="genericName" label="通用品名" labelCol="1" fieldCol="2"/>
<x:inputC name="applicableStandard" label="适用标准" labelCol="1" fieldCol="2"/>
<x:selectC name="baseUnit" label="基本计量单位" labelCol="1" fieldCol="2" dictionary="measuringUnit"/>
<x:inputC name="specifications" label="规格" labelCol="1" fieldCol="2"/>
<x:inputC name="material" label="材质" labelCol="1" fieldCol="2"/>
<x:inputC name="design" label="版式" labelCol="1" fieldCol="2"/>
<x:inputC name="size" label="尺码" labelCol="1" fieldCol="2"/>
<x:inputC name="brand" label="品牌" labelCol="1" fieldCol="2"/>
<x:selectC name="itemAttributes" label="物品属性" labelCol="1" fieldCol="2" dictionary="suppliesType"/>
<x:inputC name="materialUsage" label="用途" labelCol="1" fieldCol="8"/>
</div>
</div>
<x:title title="维护销售信息" name="group"/>
<div class="hg-form-cols">
<div class="hg-form-row">
<x:inputC name="matnr" label="物品编码" labelCol="1" fieldCol="5"/>
<x:selectC name="mtart" label="物品类型" labelCol="1" fieldCol="2" dictionary="suppliesType"/>
<x:inputC name="matkl" label="物料组" labelCol="1" fieldCol="2"/>
<x:inputC name="lvorm" label="集团级删除" labelCol="1" fieldCol="2"/>
<x:inputC name="spart" label="产品组" labelCol="1" fieldCol="2"/>
<x:inputC name="mtposMara" label="项目类别组" labelCol="1" fieldCol="2"/>
<x:inputC name="maktx" label="汉语品名" labelCol="1" fieldCol="2"/>
<x:inputC name="xchpf" label="批次管理" labelCol="1" fieldCol="2"/>
<x:inputC name="magrv" label="包装物料组" labelCol="1" fieldCol="2"/>
<x:inputC name="applicableStandard" label="适用标准" labelCol="1" fieldCol="5"/>
<x:inputC name="maktxEn" label="英语品名" labelCol="1" fieldCol="2"/>
<x:selectC name="meins" label="基本计量单位" labelCol="1" fieldCol="2" dictionary="measuringUnit"/>
<x:inputC name="raube" label="存储条件" labelCol="1" fieldCol="2"/>
<x:inputC name="brgew" label="毛重" labelCol="1" fieldCol="2"/>
<x:inputC name="gewei" label="重量单位" labelCol="1" fieldCol="2"/>
<x:inputC name="volum" label="体积" labelCol="1" fieldCol="2"/>
<x:inputC name="voleh" label="体积单位" labelCol="1" fieldCol="2"/>
<x:inputC name="iprkz" label="有效时间标识" labelCol="1" fieldCol="2"/>
<x:inputC name="mhdhb" label="总有效期" labelCol="1" fieldCol="2"/>
<x:inputC name="" label="旧料号" labelCol="1" fieldCol="2"/>
<x:inputC name="design" label="版式" labelCol="1" fieldCol="2"/>
<x:inputC name="size" label="尺码" labelCol="1" fieldCol="2"/>
<x:inputC name="brand" label="品牌" labelCol="1" fieldCol="2"/>
<x:inputC name="materialUsage" label="用途" labelCol="1" fieldCol="2"/>
<x:inputC name="mhdrz" label="最小货架寿命" labelCol="1" fieldCol="2"/>
<x:inputC name="werks" label="工厂" labelCol="1" fieldCol="2"/>
<x:inputC name="lgort" label="库存地点" labelCol="1" fieldCol="2"/>
<x:inputC name="vkorg" label="销售组织" labelCol="1" fieldCol="2"/>
<x:inputC name="vtweg" label="分销渠道" labelCol="1" fieldCol="2"/>
<x:inputC name="lgnum" label="仓库号" labelCol="1" fieldCol="2"/>
<x:inputC name="lgtyp" label="存储类型" labelCol="1" fieldCol="2"/>
<x:inputC name="" label="文本说明" labelCol="1" fieldCol="2"/>
</div>
</div>
<div class="hg-form-cols">
<div class="hg-form-row">
<x:hidden name="businessUsage"/>
<x:checkboxListC name="businessUsage" label="业务用途" dictionary="serviceusage" labelCol="1"
fieldCol="11"/>
</div>
<div class="hg-form-row">
<x:title title="业务人员" name="group"/>
<div id="businessPersonnelListGrid" style="margin: 2px;"></div>
</div>
</div>
<div class="hg-form-cols">
<div class="hg-form-row">
<x:textareaC rows="3" name="textDescription" label="文本说明" labelCol="1" fieldCol="11"/>
</div>
</div>
<%-- <x:title title="分类" name="group"/>--%>
<%-- <div class="hg-form-cols">--%>
<%-- <div class="hg-form-row">--%>
<%-- <x:inputC name="klart" label="类型" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="classify" label="分类" labelCol="1" fieldCol="2"/>--%>
<%-- </div>--%>
<%-- </div>--%>
<%-- <x:title title="销售" name="group"/>--%>
<%-- <div class="hg-form-cols">--%>
<%-- <div class="hg-form-row">--%>
<%-- <x:inputC name="vkorg" label="销售组织" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="vtweg" label="分销渠道" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="vrkme" label="销售计量单位" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="umren" label="转换分母" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="umrez" label="转换分子" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="dwerk" label="交货工厂" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="aland" label="税收发运国" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="taxkm" label="税分类" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="versg" label="统计组" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="kondm" label="物料定价组" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="ktgrm" label="会计科目组" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="prodh" label="产品层级" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="mvgr1" label="版式" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="mvgr2" label="品牌" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="mvgr3" label="用途" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="mvgr4" label="备用" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="mvgr5" label="备用" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="mtpos" label="销售项次组" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="tragr" label="运输组" labelCol="1" fieldCol="2"/>--%>
<%-- </div>--%>
<%-- </div>--%>
<%-- <x:title title="采购" name="group"/>--%>
<%-- <div class="hg-form-cols">--%>
<%-- <div class="hg-form-row">--%>
<%-- <x:inputC name="bstme" label="采购计量单位" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="umrenPurch" label="转换分母" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="umrezPurch" label="转换分子" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="ekgrp" label="默认采购组" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="mprof" label="MPN参数" labelCol="1" fieldCol="2"/>--%>
<%-- </div>--%>
<%-- </div>--%>
<%-- <x:title title="MRP" name="group"/>--%>
<%-- <div class="hg-form-cols">--%>
<%-- <div class="hg-form-row">--%>
<%-- <x:inputC name="lgort" label="库存地点" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="disgr" label="MRP组" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="dismm" label="MRP类型" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="minbe" label="重订货点" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="dispo" label="MRP控制者" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="disls" label="批量规模" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="bstfe" label="固定批量" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="bstma" label="最大批量" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="bstmi" label="最小批量" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="mabst" label="最大存货水平" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="bstrf" label="设入值" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="beskz" label="获取类型" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="sobsl" label="特殊获取方式" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="lgpro" label="默认生产库存地" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="rgekz" label="倒冲标志" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="lgfsb" label="默认采购收货库存地" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="webaz" label="收货处理天数" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="dzeit" label="自制时间" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="plifz" label="外部采购交货时间" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="fhori" label="排程边际码" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="eisbe" label="安全库存" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="eislo" label="最小安全库存" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="strgr" label="策略组" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="mtvfp" label="可用性检查组" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="wzeit" label="补货提前天数" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="altsl" label="BOM选择方法" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="sbdkz" label="独立/集中" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="diskz" label="库存地MRP标识" labelCol="1" fieldCol="2"/>--%>
<%-- </div>--%>
<%-- </div>--%>
<%-- <x:title title="生产" name="group"/>--%>
<%-- <div class="hg-form-cols">--%>
<%-- <div class="hg-form-row">--%>
<%-- <x:inputC name="ausme" label="投料计量单位" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="umrenProd" label="转换分母(生产)" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="umrezProd" label="转换分子(生产)" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="sfcpf" label="生产计划参数文件" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="insmk" label="过账到质检" labelCol="1" fieldCol="2"/>--%>
<%-- </div>--%>
<%-- </div>--%>
<%-- <x:title title="存储管理" name="group"/>--%>
<%-- <div class="hg-form-cols">--%>
<%-- <div class="hg-form-row">--%>
<%-- <x:inputC name="lgortQm" label="库存地点" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="sernp" label="序列号参数" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="serlv" label="序列号水平" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="prctr" label="利润中心" labelCol="1" fieldCol="2"/>--%>
<%-- </div>--%>
<%-- </div>--%>
<%-- <x:title title="仓库管理" name="group"/>--%>
<%-- <div class="hg-form-cols">--%>
<%-- <div class="hg-form-row">--%>
<%-- <x:inputC name="lgortProfit" label="库存地点" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="lgnum" label="仓库号" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="lgtyp" label="存储类型" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="ltkza" label="存货下架存储类型" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="ltkze" label="存货上架存储类型" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="lgbkz" label="存储分区标识" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="lhmg1" label="仓库设施1存储数量" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="lhme1" label="仓库设施1存储单位" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="lety1" label="仓库设施1类型" labelCol="1" fieldCol="2"/>--%>
<%-- </div>--%>
<%-- </div>--%>
<%-- <x:title title="质量管理" name="group"/>--%>
<%-- <div class="hg-form-cols">--%>
<%-- <div class="hg-form-row">--%>
<%-- <x:inputC name="kzdkz" label="文档要求" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="art" label="检验类型" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="aktiv" label="激活标识" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="insmkQm" label="过账到质检(质检)" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="aktiv" label="激活标识" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="ppl" label="带任务清单检验" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="app" label="自动分配" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="mer" label="检查特性" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="dyn" label="允许略过" labelCol="1" fieldCol="2"/>--%>
<%-- </div>--%>
<%-- </div>--%>
<%-- <x:title title="财务核算" name="group"/>--%>
<%-- <div class="hg-form-cols">--%>
<%-- <div class="hg-form-row">--%>
<%-- <x:inputC name="bklas" label="评估分类" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="mlast" label="价格确定" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="vprsv" label="价格控制" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="peinh" label="定价基数" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="verpr" label="移动平均价" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="stprs" label="标准价" labelCol="1" fieldCol="2"/>--%>
<%-- </div>--%>
<%-- </div>--%>
<%-- <x:title title="成本核算" name="group"/>--%>
<%-- <div class="hg-form-cols">--%>
<%-- <div class="hg-form-row">--%>
<%-- <x:inputC name="ekalr" label="数量结构" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="ncost" label="不参与成本核算" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="hkmat" label="物料来源" labelCol="1" fieldCol="2"/>--%>
<%-- <x:inputC name="awsls" label="差异码" labelCol="1" fieldCol="2"/>--%>
<%-- </div>--%>
<%-- </div>--%>
</form>
<form class="hg-form" method="post" action="" style="display: none;" id="auditForm">
<div class=" border-left-top" style="margin-top: 10px;">
<div class=" gray-bg">
<div class="col-xs-2 " style="text-align: center;margin-top: 30px">
<span>部门数据审核</span>
</div>
<div class="hg-form-cols">
<div class="hg-form-row">
<x:checkboxListC name="auditDept" label="驳回部门" list="auditDeptMap" labelCol="2"
fieldCol="10"/>
</div>
<div id="rejectReasonBox"></div>
<div style="text-align: center">
<div class="btn-group" style="margin: 15px 0px 15px 0px;">
<button id="reject" title="" type="button" onclick="rejectForm()" class="btn btn-gray"><i
class="fa fa-reply"></i>驳回
</button>
<button id="exPass" title="" type="button" class="btn btn-gray"><i
class="fa fa-mail-forward"></i>检查通过
</button>
<button id="send" title="" type="button" onclick="distributeForm()"
class="btn btn-gray"><i
class="fa fa-send-o"></i>传输
</button>
</div>
</div>
</div>
</div>
</div>
</form>
<div class="blank_div clearfix" ></div>
</div>
</body>
</html>
......@@ -9,9 +9,11 @@ import com.huigou.topsun.base.bsnMessage.domain.*;
import com.huigou.topsun.sap.nonProdApply.application.NonProdApplyDeptApplication;
import com.huigou.topsun.sap.nonProdApply.domain.SapNonProdApplyDept;
import com.huigou.topsun.sap.nonProdApply.domain.vo.*;
import com.huigou.topsun.sap.nonProdApply.repository.NonProdApplyDeptRepository;
import com.huigou.uasp.bmp.common.application.BaseApplication;
import com.huigou.util.ClassHelper;
import com.huigou.util.SDO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -29,10 +31,65 @@ public class NonProdApplyDeptApplicationImpl extends BaseApplication implements
@Override
public Map<String,Object> saveSapNonProdApplyDept(SDO sdo){
Map<String,Object> map = new HashMap<>();
SapNonProdApplyDept nonProdApplyDept = sdo.toObject(SapNonProdApplyDept.class);
nonProdApplyDept.setBaseInfoId(sdo.getId());
String businessCode=sdo.getString("businessCode");
NonProdApplyDeptVo deptVo=null;
switch (businessCode) {
case "K":
deptVo = sdo.toObject(NonProdApplyBasicVo.class);
break;
case "C":
deptVo = sdo.toObject(NonProdApplyClassVo.class);
break;
case "V":
deptVo = sdo.toObject(NonProdApplySaleVo.class);
break;
case "E":
deptVo = sdo.toObject(NonProdApplyPurchaseVo.class);
break;
case "D":
deptVo = sdo.toObject(NonProdApplyMRPVo.class);
break;
case "A":
deptVo = sdo.toObject(NonProdApplyProduceVo.class);
break;
case "L":
deptVo = sdo.toObject(NonProdApplyStoreVo.class);
break;
case "S":
deptVo = sdo.toObject(NonProdApplyWarehouseVo.class);
break;
case "Q":
deptVo = sdo.toObject(NonProdApplyMassVo.class);
break;
case "B":
deptVo = sdo.toObject(NonProdApplyFinancialVo.class);
break;
case "G":
deptVo = sdo.toObject(NonProdApplyCostVo.class);
break;
}
// SapNonProdApplyDept nonProdApplyDeptObj = sdo.toObject(SapNonProdApplyDept.class);
//nonProdApplyDeptObj.setBaseInfoId(sdo.getId());
deptVo.setBaseInfoId(sdo.getId());
SapNonProdApplyDept nonProdApplyDept=nonProdApplyDeptRepository.findByBaseInfoId(sdo.getId());
ClassHelper.copyProperties(deptVo,nonProdApplyDept);
nonProdApplyDept = nonProdApplyDeptRepository.save(nonProdApplyDept);
map.put("applyDeptId",nonProdApplyDept.getApplyDeptId());
return map;
}
/**
* 发布任务
* @param sdo
*/
@Override
public void distributeSapNonProdApplyDept(SDO sdo) {
//将状态为保存未分发的全部修改为分发未完成
Map<String, Object> map = this.saveSapNonProdApplyDept(sdo);
//获取分发的部门与人员信息
ObjectMapper objectMapper = new ObjectMapper();
String deptStaffJSON = sdo.getString("deptStaff");
......@@ -49,7 +106,7 @@ public class NonProdApplyDeptApplicationImpl extends BaseApplication implements
bsnMessageSponsor.setTaskSponsor(this.getOperator().getUserId());
bsnMessageSponsor.setTitle("非产品/非本成品类物料");
bsnMessageSponsor.setExecutorUrl("sapNonProdApplyNext/fillInNonProdApplyDept.do");
bsnMessageSponsor.setBusinessId(nonProdApplyDept.getApplyDeptId());
bsnMessageSponsor.setBusinessId(map.get("applyDeptId").toString());
bsnMessageSponsor.setCreateDate(new Date());
bsnMessageSponsor.setStatus(0);
......@@ -68,18 +125,7 @@ public class NonProdApplyDeptApplicationImpl extends BaseApplication implements
}
//保存任务
bsnMessageApplication.keepTasks(bsnMessageSponsor);
map.put("applyDeptId",nonProdApplyDept.getApplyDeptId());
return map;
}
/**
* 发布任务
* @param sdo
*/
@Override
public void distributeSapNonProdApplyDept(SDO sdo) {
//将状态为保存未分发的全部修改为分发未完成
Map<String, Object> map = this.saveSapNonProdApplyDept(sdo);
//发布任务
bsnMessageApplication.publishTasks((String) map.get("applyDeptId"));
}
......
......@@ -18,9 +18,11 @@ import com.huigou.uasp.bmp.opm.application.OrgApplication;
import com.huigou.uasp.bmp.opm.domain.model.org.Org;
import com.huigou.uasp.client.CommonController;
import com.huigou.util.SDO;
import com.huigou.util.StringUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import javax.persistence.Transient;
import java.util.*;
import java.util.stream.Collectors;
......@@ -50,8 +52,10 @@ public class NonProdApplyNextController extends CommonController {
String id = sdo.getBizId();
// this.putAttribute("active", ActiveStatus.UNFINISHED.getValue() );//定义流程环节的id
NonProdApplyBaseInfo nonProdApplyBaseInfo = nonProdApplyApplication.loadNonProdApplyBaseInfoById(id);
SapNonProdApplyDept nonProdApplyDept = nonProdApplyDeptApplication.getNonProdApplyDeptByBaseInfoId(id);
getBaseInfoAttrs(nonProdApplyBaseInfo,nonProdApplyDept);
return forward("nonProdApplyNext", nonProdApplyBaseInfo);
return forward("nonProdApplyNext", nonProdApplyDept);
}
//部门相关
......@@ -65,7 +69,7 @@ public class NonProdApplyNextController extends CommonController {
String deptId=sdo.getString("id");
BsnMessageSponsor sponsor = bsnMessageSponsorRepository.findByBusinessId(deptId);
List<BsnMessageExecute> executeLists=bsnMessageExecuteRepository.findAllByMessageSponsorId(sponsor.getId());
String businessCode=sdo.getString("businessCode");
// 用于存储结果的字典
Map<String, List<HashMap<String, String>>> map = new HashMap<>(); // 用于存储结果的字典
List<HashMap<String, String>> list = new ArrayList<>();
......@@ -119,8 +123,40 @@ public class NonProdApplyNextController extends CommonController {
Map<String, Object> circulate = bsnMessageApplication.circulate(meId);
this.putAttribute(circulate);
SapNonProdApplyDept nonProdApplyDept = nonProdApplyDeptApplication.getNonProdApplyDeptById(bizId);
if (nonProdApplyDept == null) {
throw new RuntimeException("不存在该业务!");
}
NonProdApplyBaseInfo baseInfo = nonProdApplyApplication.loadNonProdApplyBaseInfoById(nonProdApplyDept.getBaseInfoId());
nonProdApplyDept.setBusinessCode(circulate.get("deptCode").toString());
getBaseInfoAttrs(baseInfo,nonProdApplyDept);
String businessCode=circulate.get("deptCode").toString();
switch (businessCode) {
case "K":
return forward("nonProdApplyNext", nonProdApplyDept);
case "C":
return forward("nonProdApplyClass", nonProdApplyDept);
case "V":
return forward("nonProdApplySale", nonProdApplyDept);
case "E":
return forward("nonProdApplyPurchase", nonProdApplyDept);
case "D":
return forward("nonProdApplyNext", nonProdApplyDept);
case "A":
return forward("nonProdApplyNext", nonProdApplyDept);
case "L":
return forward("nonProdApplyNext", nonProdApplyDept);
case "S":
return forward("nonProdApplyNext", nonProdApplyDept);
case "Q":
return forward("nonProdApplyNext", nonProdApplyDept);
case "B":
return forward("nonProdApplyNext", nonProdApplyDept);
case "G":
return forward("nonProdApplyNext", nonProdApplyDept);
}
return null;
}
public String slicedRejectCauseList(){
SDO sdo = this.getSDO();
......@@ -129,7 +165,28 @@ public class NonProdApplyNextController extends CommonController {
return toResult(rejectAll);
}
public void getBaseInfoAttrs(NonProdApplyBaseInfo baseInfo,SapNonProdApplyDept nonProdApplyDept){
nonProdApplyDept.setBillCode(baseInfo.getBillCode());
nonProdApplyDept.setStatusId(baseInfo.getStatusId());
nonProdApplyDept.setPersonMemberName(baseInfo.getPersonMemberName());
nonProdApplyDept.setFillinDate(baseInfo.getFillinDate());
nonProdApplyDept.setMaintenanceType(baseInfo.getMaintenanceType());
nonProdApplyDept.setBusinessUsage(baseInfo.getBusinessUsage());
nonProdApplyDept.setId(nonProdApplyDept.getBaseInfoId());
//物品总属性
nonProdApplyDept.setGenericName(baseInfo.getGenericName());
nonProdApplyDept.setApplicableStandard(baseInfo.getApplicableStandard());
nonProdApplyDept.setBaseUnit(baseInfo.getBaseUnit());
nonProdApplyDept.setSpecifications(baseInfo.getSpecifications());
nonProdApplyDept.setMaterial(baseInfo.getMaterial());
nonProdApplyDept.setDesign(baseInfo.getDesign());
nonProdApplyDept.setSize(baseInfo.getSize());
nonProdApplyDept.setBrand(baseInfo.getBrand());
nonProdApplyDept.setMaterialUsage(baseInfo.getMaterialUsage());
nonProdApplyDept.setItemAttributes(baseInfo.getItemAttributes());
}
// @EasySearch(queryName = "userNameSelect")
// public Map<String, Object> queryResourceNameGroup(SDO sdo){
......
......@@ -6,6 +6,7 @@ import org.hibernate.annotations.GenericGenerator;
import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
/**
*
......@@ -756,5 +757,44 @@ public class SapNonProdApplyDept implements Serializable {
@Column(name = "AWSLS")
private String awsls;
@Transient
private String billCode;
@Transient
private Integer statusId;
@Transient
private String personMemberName;
@Transient
private Date fillinDate;
@Transient
private String maintenanceType;
@Transient
private String businessUsage;
@Transient
private String businessCode;
@Transient
private String id; //baseInfoId
//物品总属性
@Transient
private String genericName;
@Transient
private String applicableStandard;
@Transient
private String baseUnit;
@Transient
private String specifications;
@Transient
private String material;
@Transient
private String design;
@Transient
private String size;
@Transient
private String brand;
@Transient
private String materialUsage;
@Transient
private String itemAttributes;
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
package com.huigou.topsun.sap.nonProdApply.domain.vo;
import lombok.Data;
import javax.persistence.Column;
@Data
public class NonProdApplyBasicVo extends NonProdApplyDeptVo {
/**
* 物料编码
*/
private String matnr;
/**
* 物料类型
*/
private String mtart;
/**
* 物料组
*/
private String matkl;
/**
* 集团删除
*/
private String lvorm;
/**
* 产品组
*/
private String spart;
/**
* 一般销售项次组
*/
private String mtposMara;
/**
* 汉语品名
*/
private String maktx;
/**
* 汉语语言
*/
private String spars;
/**
* 英语品名
*/
private String maktxEn;
/**
* 英语语言码
*/
private String sparsEn;
/**
* 适用标准
*/
private String normt;
/**
* 批次管理
*/
private String xchpf;
/**
* 包装物料组
*/
private String magrv;
/**
* 基本计量单位
*/
private String meins;
/**
* 毛重
*/
private String brgew;
/**
* 净重
*/
private String ntgew;
/**
* 重量单位
*/
private String gewei;
/**
* 体积
*/
private String volum;
/**
* 体积单位
*/
private String voleh;
/**
* 存储条件
*/
private String raube;
/**
* 有效期标识
*/
private String iprkz;
/**
* 最小货架寿命
*/
private String mhdrz;
/**
* 总有效期
*/
private String mhdhb;
private String werks; //工厂
private String lgort; //库存地点
private String vkorg; //销售组织
private String vtweg; //分销渠道
private String lgnum; //仓库号
private String lgtyp; //存储类型
}
package com.huigou.topsun.sap.nonProdApply.domain.vo;
import lombok.Data;
import javax.persistence.Column;
@Data
public class NonProdApplyClassVo extends NonProdApplyDeptVo {
/**
* 类型
*/
private String klart;
/**
* 分类
*/
private String classify;
}
package com.huigou.topsun.sap.nonProdApply.domain.vo;
import lombok.Data;
@Data
public class NonProdApplyCostVo extends NonProdApplyDeptVo {
}
package com.huigou.topsun.sap.nonProdApply.domain.vo;
import lombok.Data;
@Data
public class NonProdApplyDeptVo {
private String id;
private String baseInfoId;
}
package com.huigou.topsun.sap.nonProdApply.domain.vo;
import lombok.Data;
@Data
public class NonProdApplyFinancialVo extends NonProdApplyDeptVo {
}
package com.huigou.topsun.sap.nonProdApply.domain.vo;
import lombok.Data;
@Data
public class NonProdApplyMRPVo extends NonProdApplyDeptVo {
}
package com.huigou.topsun.sap.nonProdApply.domain.vo;
import lombok.Data;
@Data
public class NonProdApplyMassVo extends NonProdApplyDeptVo {
}
package com.huigou.topsun.sap.nonProdApply.domain.vo;
import lombok.Data;
@Data
public class NonProdApplyProduceVo extends NonProdApplyDeptVo {
}
package com.huigou.topsun.sap.nonProdApply.domain.vo;
import lombok.Data;
import javax.persistence.Column;
@Data
public class NonProdApplyPurchaseVo extends NonProdApplyDeptVo {
/**
* 采购计量单位
*/
private String bstme;
/**
* 转换分母(采购)
*/
private String umrenPurch;
/**
* 转换分子(采购)
*/
private String umrezPurch;
/**
* 默认采购组
*/
private String ekgrp;
/**
* MPN参数
*/
private String mprof;
}
package com.huigou.topsun.sap.nonProdApply.domain.vo;
import lombok.Data;
import javax.persistence.Column;
@Data
public class NonProdApplySaleVo extends NonProdApplyDeptVo {
/**
* 销售组织
*/
private String vkorg;
/**
* 分销渠道
*/
private String vtweg;
/**
* 销售计量单位
*/
private String vrkme;
/**
* 转换分母
*/
private String umren;
/**
* 转换分子
*/
private String umrez;
/**
* 交货工厂
*/
private String dwerk;
/**
* 税收发运国
*/
private String aland;
/**
* 税分类
*/
private String taxkm;
/**
* 统计组
*/
private String versg;
/**
* 物料定价组
*/
private String kondm;
/**
* 会计科目组
*/
private String ktgrm;
/**
* 产品层级
*/
private String prodh;
/**
* 版式
*/
private String mvgr1;
/**
* 品牌
*/
private String mvgr2;
/**
* 用途
*/
private String mvgr3;
/**
* 备用
*/
private String mvgr4;
/**
* 备用
*/
private String mvgr5;
/**
* 销售项次组
*/
private String mtpos;
/**
* 运输组
*/
private String tragr;
/**
* 装载组
*/
private String ladgr;
}
package com.huigou.topsun.sap.nonProdApply.domain.vo;
import lombok.Data;
@Data
public class NonProdApplyStoreVo extends NonProdApplyDeptVo {
}
package com.huigou.topsun.sap.nonProdApply.domain.vo;
import lombok.Data;
@Data
public class NonProdApplyWarehouseVo extends NonProdApplyDeptVo {
}
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