Commit f096def7 authored by 李苏's avatar 李苏 💬

联动选择框

parent f8799290
This diff is collapsed.
<div id="gyglGylx" class="gui-div">
<table class="toolbar-table" data-options="id: 'gyglGylxTable',herf:'kzzx/gridset/query'"></table>
<!-- 表格工具栏开始 -->
<div id="gyglGylxTable-toolbar" class="gui-toolbar" data-options="grid:{type:'datagrid',id:'gyglGylxTable'}">
<div class="navbar-toolbar">
<a class="toolbar-print toolbar" href="javascript:void(0)"></a>
<a class="toolbar-export toolbar" href="javascript:void(0)"></a>
<a class="toolbar-review toolbar" href="javascript:void(0)"></a>
<a class="toolbar-add toolbar" href="javascript:void(0)"></a>
<a class="toolbar-copy toolbar" href="javascript:void(0)"></a>
<a class="toolbar-edit toolbar" href="javascript:void(0)"></a>
<a class="toolbar-delete toolbar" href="javascript:void(0)"></a>
<a class="toolbar-attachment toolbar" href="javascript:void(0)"></a>
<a class="toolbar-run toolbar" href="javascript:void(0)"></a>
</div>
<div class="form-sub">
<form class="query-criteria">
<ul>
<li class="gui-form-row" >
<!--<div class="gui-col-sm3">
<label class="gui-form-label">工厂:</label>
<div class="gui-input-block">
<input type="text" name="gcid" class="gui-textbox">
</div>
</div>-->
<div class="gui-col-sm3">
<label class="gui-form-label">工作中心:</label>
<div class="gui-input-block">
<input type="text" name="gzzxid" class="gui-textbox">
</div>
</div>
<div class="gui-col-sm3">
<label class="gui-form-label">工序类型:</label>
<div class="gui-input-block">
<input type="text" name="gxlx" class="gui-textbox" style="width: 100%">
</div>
</div>
<div class="gui-col-sm3">
<label class="gui-form-label">标准工序:</label>
<div class="gui-input-block">
<input type="text" name="bzgxid" class="gui-textbox">
</div>
</div>
<div class="gui-col-sm3">
<label class="gui-form-label">工艺号:</label>
<div class="gui-input-block">
<input type="text" name="code" class="gui-textbox">
</div>
</div>
</li>
</ul>
<span class="toolbar-search-span"><a class="toolbar-search" href="javascript:void(0)"></a></span>
</form>
</div>
</div>
</div>
<!-- 表格工具栏结束 -->
<script>
$(function () {
/*js初始化*/
var $div=$('#gyglGylx');
var $datagrid=$div.find(".toolbar-table");
var $cbxGcid = $div.find('input[name="gcid"]');
var $cbxBzgxid = $div.find('input[name="bzgxid"]');
var $cbxGxlx = $div.find('input[name="gxlx"]');
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;
}, ops);
gas.post('gygl/gylx/init/gxbz', {}, function(res){
$gxbzArray = res.data.records;
}, ops);
}
function pageInit() {
var options = {
url: 'gygl/gylx',
noRequest: true,
columns: [[
{title: "序号1", field: "xh", fieldType: "int",align:"center",width: 60},
{title: "工艺路线号", field: "gylxcode", fieldType: "ftString",width:140},
{title: "工序名称", field: "name", fieldType: "ftString",width:140},
{title: "工作中心", field: "gzzxName", fieldType: "ftString",width:140},
{title: "标准工序", field: "bzgxName", fieldType: "ftString",width:140},
{title: "物料名称", field: "wlxxName", fieldType: "ftString",width:140},
/* {title: "规格", field: "wlxxGg", fieldType: "ftString",width:140},*/
{title: "工序类型", field: "gxlx", fieldType: "combobox",width:80, props: {data: $gxlxArray}},
{title: "工序标志", field: "gxbz", fieldType: "combobox",width:80, props: {data: $gxbzArray}},
{title: "设备数量", field: "sbsl", fieldType: "float"},
{title: "作业人数", field: "zyrsl", fieldType: "float"},
{title: "排队耗时", field: "pdhs", fieldType: "float"},
{title: "准备耗时", field: "zbhs", fieldType: "float"},
{title: "加工耗时", field: "jghs", fieldType: "float"},
{title: "转移耗时", field: "zyhs", fieldType: "float"},
{title: "关键工序", field: "gjgx", fieldType: "checkbox",width:80},
{title: "单位时间产量", field: "dwsjcl", fieldType: "float"},
{title: "排产倍数", field: "pcbs", fieldType: "float"},
{title: "状态", field: "tybz", fieldType: "tybz", width:80},
{title: "停用日期", field: "tyrq", fieldType: "ftDateTime"},
{title: "备注", field: "bz", fieldType: "ftString",width:200},
{title: "维护人", field: "whr", fieldType: "ftString"},
{title: "维护时间", field: "whsj", fieldType: "ftDateTime"},
{title: "附件数", field: "attachcount", fieldType:"int"}
]],
dialog: {
footerIn: true,
href: 'gygl/gylx/edit'
}
};
$div.Holder(options);
//$cbxGcid.iCombobox({valueField:'id', textField:'name', onSelect: doSelectGcid});
$cbxGzzxid.iCombobox({valueField:'id', textField:'name', allowNull:true,onSelect: doSelectBzgxid});
$cbxBzgxid.iCombobox({valueField:'id', textField:'name', allowNull:true});
$cbxGxlx.iCombobox({valueField:'id', textField:'name', allowNull:true});
}
/*数据初始化*/
function dataInit(ops){
gas.post('jcsj/common/gc/query', {}, function(res){
if (res.success && res.data.records){
$cbxGcid.iCombobox('loadData', res.data.records);
}
}, ops);
gas.post('gygl/gzzx/query', {}, function(res){
if (res.success && res.data.records){
$cbxGzzxid.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);
}
}, ops);
gas.post('gygl/bzgx/queryNotTybzBzgx', {}, function(res){
if (res.success && res.data.records){
$cbxBzgxid.iCombobox('loadData', res.data.records);
}
}, ops);
}
/*用户操作*/
function run(ops){
$datagrid.datagrid("options").url="gygl/gylx/query";
$datagrid.datagrid("load",DataBind.collectData($div))
}
gas.load(paramInit,pageInit,dataInit,run);
function doSelectGcid(res){
gas.post('gygl/gzzx/query', {gcid: res.id}, function(res){
if (res.success && res.data.records){
$cbxGzzxid.iCombobox('setValue', '');
$cbxGzzxid.iCombobox('loadData', res.data.records);
}
});
}
function doSelectBzgxid(res){
gas.post('gygl/bzgx/queryNotTybzBzgx', {gzzxid: res.id}, function(res){
if (res.success && res.data.records){
$cbxBzgxid.iCombobox('setValue', '');
$cbxBzgxid.iCombobox('loadData', res.data.records);
}
});
}
})
</script>
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