Commit abb87f95 authored by 刘学辉's avatar 刘学辉

物料主数据的页面调整必输逻辑

parent 9bde5ca1
......@@ -76,16 +76,15 @@ function initializate() {
UICtrl.setDisable("#distributeDiv");
viewOnly();
break;
case '3'://已办结
// case '3'://已办结
// showRejectCauseBox();
$("#buttonBox").remove();
break;
// $("#buttonBox").remove();
// break;
default://其他/详情
$("#buttonBox").show();
break;
}
if (isAll=="1"){
$('input[name="isAll"]').attr("checked",true);
}
......@@ -94,34 +93,15 @@ function initializate() {
// debugger
if ($(this).is(':checked')) {
$("#busiLens").val(dictUsage.length);
showAllBusiness();
coRowNum=dictUsage.length;
for (var x=0;x<$("input[name='businessUsage']").length;x++) {
for (var x=0;x<$("input[name='businessUsage']").length;x++) {
$("input[name='businessUsage']")[x].checked = true;
// let datas = gridManager.getData();
/* var name = "", deptCode = "";
for (var u = 0; u < dictUsage.length; u++) {
name = dictUsage[u].split(",")[1];
deptCode = dictUsage[u].split(",")[0];
let isExist = 0
for (var i = 0; i < datas.length; i++) {
if (datas[i].deptCode == deptCode) {
isExist = 1;
break;
}
}
// if (isExist == 0) {
// gridManager.addRow({deptName: name, deptCode: deptCode, userName: ""});
// }
} */
}
showAllBusiness();
} else {
$("input[name='businessUsage']").each(function(){
$(this).attr("checked",false);
hideAllBusiness();
// for (var u=0;u<dictUsage.length;u++){
// gridManager.deleteRow(u);
// }
})
}
});
......@@ -131,47 +111,17 @@ function initializate() {
//alert($(this).is(':checked'));
if ($(this).is(':checked')) {
//let datas=gridManager.getData();
var name="",deptCode="";
/* for (var u=0;u<dictUsage.length;u++){
if ($(this).val()==dictUsage[u].split(",")[0]){
name=dictUsage[u].split(",")[1];
deptCode=dictUsage[u].split(",")[0];
break;
}
} */
/* let isExist=0;
for (var i=0;i<datas.length;i++) {
if (datas[i].deptCode==deptCode){
isExist=1;
break;
}
} */
// var name="",deptCode="";
coRowNum=MathUtil.add(coRowNum,1);
// alert(name+deptCode+coRowNum);
showBusiness($(this).val());
/* if (isExist==0) {
gridManager.addRow({deptName: name, deptCode: deptCode, userName: ""});
}
datas = gridManager.getData(); */
// debugger
// alert(datas.length);alert(dictUsage.length)
if (coRowNum==dictUsage.length){
$('input[name="isAll"]')[0].checked = true;
}
} else {
// let datas=gridManager.getData();
// var selval=$(this).val();
hideBusiness($(this).val());
coRowNum=MathUtil.sub(coRowNum,1);
/* for (var i=0;i<datas.length;i++) {
if (datas[i].deptCode==selval){
gridManager.deleteRow(i);
}
} */
// datas = gridManager.getData();
// if (coRowNum==0){
$('input[name="isAll"]').attr("checked",false);
// }
$('input[name="isAll"]').attr("checked",false);
}
});
}
......@@ -196,6 +146,8 @@ function showBusiness(busiCode) {
}
});
UICtrl.setElRequiredFlag("#dismm",true);
UICtrl.setElRequiredFlag("#werksName",true);
UICtrl.setElRequiredFlag("#mtvfp",true);
}
if (busiCode=="A") { //生产
......@@ -263,6 +215,9 @@ function showAllBusiness() {
storeMustInput(true);
warehouseMustInput(true);
financialMustInput(true);
werksMustInput();
lgortMustInput();
mtvfpMustInput();
}
function hideAllBusiness() {
......@@ -273,6 +228,9 @@ function hideAllBusiness() {
$("#storeDiv").hide();
$("#warehouseDiv").hide();
$("#financialDiv").hide();
werksMustInput();
lgortMustInput();
mtvfpMustInput();
}
function showBusinessReadOnly(busiCode) {
......@@ -333,10 +291,73 @@ function saleMustInput(flag) { //销售必输项
UICtrl.setElRequiredFlag("#aland",flag);
UICtrl.setElRequiredFlag("#taxkm",flag);
UICtrl.setElRequiredFlag("#ktgrm",flag);
UICtrl.setElRequiredFlag("#vkorgName",flag);
UICtrl.setElRequiredFlag("#vtwegName",flag);
mtvfpMustInput();
}
function purchaseMustInput(flag) { //采购必输项
UICtrl.setElRequiredFlag("#ekgrpName",flag);
UICtrl.setElRequiredFlag("#ekgrp",flag);
werksMustInput();
}
function werksMustInput(){ //工厂必输
var isMustInput="0";
for (var x=0;x<$("input[name='businessUsage']").length;x++) {
// alert($("input[name='businessUsage']")[x].value);
if ($("input[name='businessUsage']")[x].checked) {
// E 采购 L 存储 D MRP A 生产
if ($("input[name='businessUsage']")[x].value == "L" || $("input[name='businessUsage']")[x].value == "D"
|| $("input[name='businessUsage']")[x].value=="A"|| $("input[name='businessUsage']")[x].value=="E"){
isMustInput="1";
break;
}
}
}
if (isMustInput=="1"){
UICtrl.setElRequiredFlag("#werksName",true);
} else {
UICtrl.setElRequiredFlag("#werksName",false);
}
}
function lgortMustInput(){ //库存地点必输
var isMustInput="0";
for (var x=0;x<$("input[name='businessUsage']").length;x++) {
// alert($("input[name='businessUsage']")[x].value);
if ($("input[name='businessUsage']")[x].checked) {
// L 存储 S 仓库
if ($("input[name='businessUsage']")[x].value == "L" || $("input[name='businessUsage']")[x].value == "S"
){
isMustInput="1";
break;
}
}
}
if (isMustInput=="1"){
UICtrl.setElRequiredFlag("#lgortName",true);
} else {
UICtrl.setElRequiredFlag("#lgortName",false);
}
}
function mtvfpMustInput(){ //可用性检查必输
var isMustInput="0";
for (var x=0;x<$("input[name='businessUsage']").length;x++) {
// alert($("input[name='businessUsage']")[x].value);
if ($("input[name='businessUsage']")[x].checked) {
// V 销售 D MRP
if ($("input[name='businessUsage']")[x].value == "V" || $("input[name='businessUsage']")[x].value == "D"
){
isMustInput="1";
break;
}
}
}
if (isMustInput=="1"){
UICtrl.setElRequiredFlag("#mtvfp",true);
} else {
UICtrl.setElRequiredFlag("#mtvfp",false);
}
}
function mrpMustInput(flag) { //MRP必输项
......@@ -352,16 +373,19 @@ function mrpMustInput(flag) { //MRP必输项
UICtrl.setElRequiredFlag("#vrmod",flag);
UICtrl.setElRequiredFlag("#vint1",flag);
UICtrl.setElRequiredFlag("#vint2",flag);
werksMustInput();
mtvfpMustInput();
}
function produceMustInput(flag){
UICtrl.setElRequiredFlag("#sfcpf",flag);
UICtrl.setElRequiredFlag("#fevor",flag);
werksMustInput();
}
function storeMustInput(flag) {
UICtrl.setElRequiredFlag("#prctr",flag);
storeDisplaySer($('#mtart').val());
werksMustInput();
lgortMustInput();
}
function storeDisplaySer(mtart){
if (mtart=='ZGMB'){
......@@ -400,7 +424,9 @@ function warehouseMustInput(flag) {
UICtrl.setElRequiredFlag("#lgortProfitName",flag);
UICtrl.setElRequiredFlag("#lhmg1",flag);
UICtrl.setElRequiredFlag("#lhme1Name",flag);
UICtrl.setElRequiredFlag("#lgnumName",flag);
UICtrl.setElRequiredFlag("#lgortName",flag);
lgortMustInput();
}
function financialMustInput(flag) {
UICtrl.setElRequiredFlag("#bklas",flag);
......@@ -629,7 +655,7 @@ function clearForm_financial(){
}
/**
*领导确认
*领导确认/回退
*/
function confirmForm(val){
$("#status").val(val);
......@@ -645,10 +671,13 @@ function confirmForm(val){
success: function (data) {
// alert(data.result);
if (data.result=='') {
Public.successTip("操作成功!");
Public.successTip("操作成功!");
} else {
Public.errorTip(data.result);
}
//parent.reloadSpecialTaskGrid();
// parent.homepage.trackTaskContent
UICtrl.reloadTabById('homepage');
$("#buttonBox").remove();
control.isConfirm = true;
// _self.close();
......@@ -659,7 +688,7 @@ function confirmForm(val){
/**
* 分发表单到各个部门
*/
function distributeForm() {
/*function distributeForm() {
$("#status").val(2);
if (control.isDistribute) {
Public.successTip("已分发");
......@@ -754,7 +783,7 @@ function distributeForm() {
_self.close();
}
});
}
} */
function bindEvent() {
//物料组
......@@ -1190,7 +1219,7 @@ function loadRejectReasonBox() {
/**
*根据驳回信息生成驳回信息展示栏
*/
function showRejectCauseBox() {
/*function showRejectCauseBox() {
Public.ajax(web_app.name + '/sapNonProdApplyNext/slicedRejectCauseList.ajax', {meId: getMeId()}, function (data) {
const generateCauseHTML = (item, newCause) => {
const { rectifyDate, rejectMsg, bsnExecuteId, rejectDate } = item;
......@@ -1237,7 +1266,7 @@ function showRejectCauseBox() {
$("#causeBox").show();
})
}
} */
function getMeId() {
return $("#meId").val() || '';
......
......@@ -142,24 +142,7 @@
<x:inputC name="classify" label="分类" labelCol="1" fieldCol="2" readonly="true"/>
</div>
</div>
<div class="hg-form-cols" id="distributeDiv">
<div class="hg-form-row">
<x:inputC name="werksName" label="工厂" required="true" labelCol="1" fieldCol="2" wrapper="select"/>
<x:hidden name="werks"/>
<x:inputC name="lgortName" label="库存地点" required="true" labelCol="1" fieldCol="2" wrapper="select"/>
<x:hidden name="lgort"/>
<x:inputC name="vkorgName" label="销售组织" required="true" labelCol="1" wrapper="select" fieldCol="2"/>
<x:hidden name="vkorg"/>
<x:inputC name="vtwegName" label="分销渠道" required="true" labelCol="1" wrapper="select" fieldCol="2"/>
<x:hidden name="vtweg"/>
<x:inputC name="lgnumName" label="仓库号" required="true" labelCol="1" fieldCol="2" wrapper="select"/>
<x:hidden name="lgnum"/>
<x:inputC name="lgtypName" label="存储类型" labelCol="1" fieldCol="2" wrapper="select"/>
<x:hidden name="lgtyp"/>
</div>
</div>
<div class="hg-form-cols">
<div class="hg-form-cols">
<div class="hg-form-row">
<x:textareaC rows="3" name="maktxRemZh" label="中文文本说明" labelCol="1" fieldCol="11"/>
<x:textareaC rows="3" name="maktxRemEn" label="英文文本说明" labelCol="1" fieldCol="11"/>
......@@ -186,11 +169,26 @@
</c:if>
</div>
<div class="hg-form-cols">
</div>
<div class="hg-form-cols" id="distributeDiv">
<div class="hg-form-row">
<x:inputC name="werksName" label="工厂" required="false" labelCol="1" fieldCol="2" wrapper="select"/>
<x:hidden name="werks"/>
<x:inputC name="lgortName" label="库存地点" required="false" labelCol="1" fieldCol="2" wrapper="select"/>
<x:hidden name="lgort"/>
<x:inputC name="lgtypName" label="存储类型" labelCol="1" fieldCol="2" wrapper="select"/>
<x:hidden name="lgtyp"/>
<x:selectC name="mtvfp" label="可用性检查组" labelCol="1" fieldCol="2" required="false" dictionary="mtvfp"/>
</div>
</div>
<div id="businessUsageDiv">
<div class="hg-form-cols" id="saleDiv">
<x:title title="销售" name="group"/>
<div class="hg-form-row">
<x:inputC name="vkorgName" label="销售组织" required="true" labelCol="1" wrapper="select" fieldCol="2"/>
<x:hidden name="vkorg"/>
<x:inputC name="vtwegName" label="分销渠道" required="true" labelCol="1" wrapper="select" fieldCol="2"/>
<x:hidden name="vtweg"/>
<x:inputC name="vrkmeName" label="销售计量单位" labelCol="1" fieldCol="2" wrapper="select"/>
<x:hidden name="vrkme"/>
<x:inputC name="umrenSale" label="转换分母" labelCol="1" fieldCol="2"/>
......@@ -268,7 +266,7 @@
<x:inputC name="eisbe" label="安全库存" labelCol="1" fieldCol="1" required="false"/>
<x:inputC name="eislo" label="最小安全库存" labelCol="1" fieldCol="1"/>
<x:selectC name="mtvfp" label="可用性检查组" labelCol="1" fieldCol="2" required="false" dictionary="mtvfp"/>
<x:selectC name="strgr" label="策略组" labelCol="1" fieldCol="2" dictionary="strgr"/>
......@@ -321,6 +319,8 @@
<div class="hg-form-cols" id="warehouseDiv">
<x:title title="仓库管理" name="group"/>
<div class="hg-form-row">
<x:inputC name="lgnumName" label="仓库号" required="false" labelCol="1" fieldCol="2" wrapper="select"/>
<x:hidden name="lgnum"/>
<x:inputC name="lgortProfitName" label="库存地点" labelCol="1" fieldCol="2" wrapper="select"/>
<x:hidden name="lgortProfit"/>
<!--x:selectC name="lgnum" label="仓库号" labelCol="1" fieldCol="2" dictionary="lgnum"/-->
......
......@@ -589,8 +589,10 @@ public class NonProdApplyDeptApplicationImpl extends BaseApplication implements
} else if ("D".equals(backMap.get("TYPE").toString())) { // 推送待分发的待办信息
if (genericName.equals(title)){
title="";
} else {
title="("+title+")";
}
messageExecute.setTaskDescribe(genericName +sign+ "待确认(" + title+ ")");
messageExecute.setTaskDescribe(genericName +sign+ "待确认" + title);
}
bsnMessageApplication.saveBsnMessageSponsor(bsnMessageSponsor);
messageExecute.setMessageSponsorId(bsnMessageSponsor.getId());
......
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