Commit 04759ff6 authored by 李苏's avatar 李苏 💬

联动

parent 671ee3de
......@@ -153,7 +153,11 @@
var $edtJghs = $div.find('input[name="jghs"]');
var $edtZyhs = $div.find('input[name="zyhs"]');
var $bInit = true;
var apigzzxid=""
var $dialog=$('#gyglGylxEdit');
var params=$dialog.closest(".panel-body").iDialog("options").queryParams.pid;//取参
var apigzzxid=params.gzzxid
var apigxlx=""
function pageInit(ops){
//$cbxGcid.iCombobox({valueField:'id', textField:'name', onSelect: doSelectGcid});
......@@ -176,13 +180,6 @@
}
}, ops);
gas.post('gygl/bzgx/queryNotTybzBzgx', {}, function(res){
if (res.success && res.data.records){
$cbxBzgxid.iCombobox('loadData', res.data.records);
}
}, ops);
gas.post('gygl/gylx/init/gxlx', {}, function(res){
if (res.success && res.data.records){
$cbxGxlx.iCombobox('loadData', res.data.records);
......@@ -194,6 +191,23 @@
$cbxGxbz.iCombobox('loadData', res.data.records);
}
}, ops);
setTimeout(function(){
gas.post('gygl/bzgx/queryNotTybzBzgx', {gxlx:apigxlx,gzzxid:apigzzxid}, function(res){
if (res.success && res.data.records){
// let value=""
// res.data.records.forEach(function(e){
// if(e.name==params.bzgxName){
// value=e.code
// }
// })
console.log( params.bzgxName)
$cbxBzgxid.iCombobox('loadData', res.data.records);
$cbxBzgxid.iCombobox('setValue', params.bzgxName);
$edtName.val(params.bzgxNam)
}
}, ops);
},200)
}
function run(ops){
......@@ -215,10 +229,12 @@
function doSelectGzzxid(a){
apigzzxid=a.id
if( $div.closest("form").attr("tag")!="add" && $bInit) return false;
gas.post('gygl/bzgx/queryNotTybzBzgx', {gzzxid: a.id}, function(res){
gas.post('gygl/bzgx/queryNotTybzBzgx', {gxlx:apigxlx,gzzxid:apigzzxid}, function(res){
if (res.success && res.data.records){
$cbxBzgxid.iCombobox('setValue', '');
$cbxBzgxid.iCombobox('loadData', res.data.records);
$cbxBzgxid.iCombobox('setValue', params.bzgxName);
$edtName.val(params.bzgxNam)
}
});
}
......@@ -239,10 +255,13 @@
});
}
function doldbzgx(e){
gas.post('gygl/bzgx/queryNotTybzBzgx', {gxlx:e.id,gzzxid:apigzzxid}, function(res){
apigxlx=e.id
gas.post('gygl/bzgx/queryNotTybzBzgx', {gxlx:apigxlx,gzzxid:apigzzxid}, function(res){
if (res.success && res.data.records){
$cbxBzgxid.iCombobox('setValue', '');
$cbxBzgxid.iCombobox('loadData', res.data.records);
$cbxBzgxid.iCombobox('setValue', params.bzgxName);
$edtName.val(params.bzgxNam)
}
});
}
......
......@@ -66,7 +66,6 @@ $(function () {
var $cbxGzzxid = $div.find('input[name="gzzxid"]');
var $gxlxArray = [];
var $gxbzArray = [];
function paramInit(ops){
gas.post('gygl/gylx/init/gxlx', {}, function(res){
$gxlxArray = res.data.records;
......@@ -109,7 +108,13 @@ $(function () {
]],
dialog: {
footerIn: true,
href: 'gygl/gylx/edit'
href: 'gygl/gylx/edit',
onBeforeLoad:function () {//传参
let pid=$("#gyglGylxTable").datagrid('getSelected')
$(this).dialog("options").queryParams={
pid:pid
}
}
}
};
$div.Holder(options);
......
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