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

物料主数据调分发页面业务用途的全选

parent 442d4cce
......@@ -91,22 +91,27 @@
<x:selectC name="beskz" label="获取类型" labelCol="1" fieldCol="2" dictionary="beskz" required="true"/>
<x:selectC name="sobsl" label="特殊获取方式" labelCol="1" fieldCol="2" dictionary="sobsl" required="false"/>
<x:inputC name="lgproName" label="默认生产库存地" labelCol="1" fieldCol="2" wrapper="select"/>
<x:inputC name="lgproName" label="默认生产库存地" labelCol="2" fieldCol="2" wrapper="select"/>
<x:hidden name="lgpro"/>
<x:selectC name="rgekz" label="倒冲标志" labelCol="1" fieldCol="2" dictionary="rgekz"/>
<x:inputC name="lgfsbName" label="默认采购收货库存地" labelCol="1" fieldCol="2" wrapper="select"/>
<x:inputC name="lgfsbName" label="默认采购收货库存地" labelCol="2" fieldCol="3" wrapper="select"/>
<x:hidden name="lgfsb"/>
<x:selectC name="rgekz" label="倒冲标志" labelCol="1" fieldCol="2" dictionary="rgekz"/>
<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" required="false"/>
<x:inputC name="eisbe" label="安全库存" labelCol="1" fieldCol="2" required="false"/>
<x:inputC name="plifz" label="外部采购交货时间" labelCol="2" fieldCol="2"/>
<x:inputC name="eisbe" label="安全库存" labelCol="1" fieldCol="1" required="false"/>
<x:inputC name="eislo" label="最小安全库存" labelCol="1" fieldCol="2"/>
<x:selectC name="strgr" label="策略组" labelCol="1" fieldCol="2" dictionary="strgr"/>
<x:selectC name="mtvfp" label="可用性检查组" labelCol="1" fieldCol="2" required="true" dictionary="mtvfp"/>
<x:inputC name="wzeit" label="补货提前天数" labelCol="1" fieldCol="2"/>
<x:selectC name="strgr" label="策略组" labelCol="1" fieldCol="1" dictionary="strgr"/>
<x:inputC name="wzeit" label="补货提前天数" labelCol="1" fieldCol="1"/>
<x:selectC name="sbdkz" label="独立/集中" labelCol="1" fieldCol="2" dictionary="sbdkz"/>
<x:selectC name="diskz" label="库存地MRP标识" labelCol="1" fieldCol="2" dictionary="diskz"/>
<x:selectC name="diskz" label="库存地MRP标识" labelCol="2" fieldCol="2" dictionary="diskz"/>
</div>
</div>
......
......@@ -61,27 +61,49 @@ function initializate() {
}
if (isAll=="1"){
$('input[name="isAll"]').attr("checked",true);
}
/* $('input[name="isAll"]').change(function () {
$('input[name="isAll"]').change(function () {
//alert($(this).is(':checked'));
if ($(this).is(':checked')) { alert(1);
$("input[name='businessUsage']").each(function(){
$(this).attr("checked",true);
})
debugger
if ($(this).is(':checked')) { //alert("全选");
$("#busiLens").val(dictUsage.length);
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: ""});
}
}
}
} else {
alert(2);
$("input[name='businessUsage']").each(function(){
$(this).attr("checked",false);
for (var u=0;u<dictUsage.length;u++){
gridManager.deleteRow(u);
}
})
}
});*/
});
var dictUsage=dictUsages.split(";");
$('input[name="businessUsage"]').change(function () {
//alert($(this).is(':checked'));
if ($(this).is(':checked')) {
// console.log($(this).val()); // 输出选中的值
// debugger
let datas=gridManager.getData();
var name="",deptCode="";
for (var u=0;u<dictUsage.length;u++){
if ($(this).val()==dictUsage[u].split(",")[0]){
......@@ -90,7 +112,23 @@ function initializate() {
break;
}
}
gridManager.addRow({ deptName: name, deptCode: deptCode,userName: "" });
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: ""});
}
datas = gridManager.getData();
// debugger
// alert(datas.length);alert(dictUsage.length)
if (datas.length==dictUsage.length){
// $('input[name="isAll"]').attr("checked",true);
$('input[name="isAll"]')[0].checked = true;
}
// coRowNum+=1;
//gridManager.loadData();
} else {
......@@ -101,7 +139,10 @@ function initializate() {
gridManager.deleteRow(i);
}
}
datas = gridManager.getData();
if (datas.length==0){
$('input[name="isAll"]').attr("checked",false);
}
}
});
}
......
......@@ -6,6 +6,7 @@
<head>
<script>
var dictUsages ="${dictUsages}";
var isAll ="${isAll}";
</script>
<x:base include="layout,dialog,grid,tree,combox,commonTree,date"/>
<x:script src='/biz/topsun/sap/nonProdApply/nonProdApplyNext.js'/>
......@@ -155,8 +156,9 @@
fieldCol="5"/-->
<c:if test="${applyType==2}">
<div class="hg-form-row">
<x:checkbox name="isAll" label="全选" />
<x:checkboxListC name="businessUsage" label="业务用途" dictionary="serviceusage" labelCol="1"
fieldCol="11"/>
fieldCol="8"/>
</div>
</c:if>
<c:if test="${applyType==1}">
......@@ -167,7 +169,7 @@
</c:if>
<c:if test="${applyType==0}">
<div class="hg-form-row">
<!--x:checkbox name="isAll" label="是否全选" /-->
<x:checkbox name="isAll" label="全选" />
<x:checkboxListC name="businessUsage" label="业务用途" dictionary="serviceusage" labelCol="1"
fieldCol="8"/>
</div>
......
......@@ -66,7 +66,12 @@ public class NonProdApplyNextController extends CommonController {
// String key = entry.getKey().toUpperCase();
dictMapUsages+=entry.getKey().toUpperCase()+","+entry.getValue()+";";
}
dictMapUsages=dictMapUsages.substring(0,dictMapUsages.length()-1);
this.putAttribute("dictUsages",dictMapUsages);
this.putAttribute("isAll","0");
if (nonProdApplyBaseInfo.getBusinessUsage().split(",").length==dictMapUsages.split(";").length){
this.putAttribute("isAll","1");
}
if (nonProdApplyBaseInfo.getMaintenanceType().equals("modify")){
nonProdApplyBaseInfo.setApplyType("1");
this.putAttribute("applyType", "1");
......@@ -259,6 +264,7 @@ public class NonProdApplyNextController extends CommonController {
// String key = entry.getKey().toUpperCase();
dictMapUsages+=entry.getKey().toUpperCase()+","+entry.getValue()+";";
}
dictMapUsages=dictMapUsages.substring(0,dictMapUsages.length()-1);
this.putAttribute("dictUsages",dictMapUsages);
Map <String, String>unMapTmp=new HashMap();
for (Map.Entry<String, String> entry : dictMapUsage.entrySet()) {
......
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