Commit fec40c4d authored by 周毅's avatar 周毅

bom页面移到标准

parent 1277a000
<div id="bomBomEdit" class="e-dialog-container" data-options="width:720,height:320">
<div class="e-single-dialog">
<input type="hidden" name="flag">
<input type="hidden" name="id" >
<input type="hidden" name="xh" >
<input type="hidden" name="bomid" >
<!-- <div class="gui-row" style="display: none">
<div class="gui-col-sm12">
<label class="gui-form-label">产品结构:</label>
<div class="gui-input-block">
<input type="text" name="bomid" data-toggle="gui-textbox" data-options="required:true" disabled >
</div>
</div>
</div>-->
<div class="gui-row">
<div class="gui-col-sm6" >
<label class="gui-form-label">物料:</label>
<div class="gui-input-block">
<input type="text" name="wlid" data-toggle="gui-textbox" data-title="wlxxName" data-options="required:true" >
</div>
</div>
<div class="gui-col-sm6">
<label class="gui-form-label">单位用量:</label>
<div class="gui-input-block">
<input type="text" name="dwyl" data-toggle="gui-textbox" data-options="required:true" >
</div>
</div>
</div>
<div class="gui-row" >
<!-- <div class="gui-col-sm4">
<label class="gui-form-label">工厂:</label>
<div class="gui-input-block">
<input type="text" name="gcid" data-toggle="gui-textbox" >
</div>
</div>-->
<!-- <div class="gui-col-sm4">
<label class="gui-form-label">序号:</label>
<div class="gui-input-block">
<input type="text" name="xh" data-toggle="gui-textbox" data-options="" >
</div>
</div>-->
</div>
<div class="gui-row" >
<div class="gui-col-sm6">
<label class="gui-form-label">损耗率:</label>
<div class="gui-input-block">
<input type="text" name="shl" data-toggle="gui-textbox" data-options="" >
</div>
</div>
<div class="gui-col-sm6">
<label class="gui-form-label">损耗值:</label>
<div class="gui-input-block">
<input type="text" name="shz" data-toggle="gui-textbox" data-options="" >
</div>
</div>
</div>
<div class="gui-row">
<div class="gui-col-sm6">
<label class="gui-form-label">发放原则:</label>
<div class="gui-input-block">
<input type="text" name="ffyz" data-toggle="gui-textbox" data-options="required:true" >
</div>
</div>
<div class="gui-col-sm6">
<label class="gui-form-label">发放工序:</label>
<div class="gui-input-block">
<input type="text" name="ffgx" data-toggle="gui-textbox" data-title="gylxName" data-options="" >
<input type="hidden" name="gylxName">
</div>
</div>
</div>
<div class="gui-row" >
<div class="gui-col-sm12">
<label class="gui-form-label">备注:</label>
<div class="gui-input-block">
<input type="text" name="bz" data-toggle="gui-textbox" data-options="" >
</div>
</div>
</div>
</div>
<div class="e-dialog-footer">
<a href="javascript:void(0);" class="e-dialog-ok"></a>
<a href="javascript:void(0);" class="e-dialog-cancel"></a>
</div>
</div>
<script>
$(function () {
var $dialog=$('#bomBomEdit');
var $edtbomid=$dialog.find("input[name='bomid']");
var $edtWlid=$dialog.find("input[name='wlid']");
var $edtFfgx=$dialog.find("input[name='ffgx']");
var $edtFfyz=$dialog.find("input[name='ffyz']");
var $inputXh=$dialog.find("input[name='xh']");
var parmas=$dialog.parent().dialog("options").params;
var xh=parmas.xh;
var tag=$dialog.closest("form").attr("tag");
function paramsInit(){
}
function pageInit(){
$edtFfyz.iCombobox({valueField:'id', textField:'name',allowNull:false, allowEdit:false});
if(tag=="add"){
$edtbomid.val(parmas.bomid);
}
Auxiliary.box($edtWlid,{code:'WLID'});
Auxiliary.box($edtFfgx,{code:'FFGX',onBeforeLoad:function(){
return {wlid:$edtbomid.val()};
}});
}
function dataInit(ops) {
gas.postHTTP("bom/bom/init/ffyz",{},function (res) {
if(res.success){
$edtFfyz.combobox("loadData",res.data.records||[])
}
}, ops);
$inputXh.val(xh);
}
function run(){
}
gas.load(paramsInit,pageInit,dataInit,run);
$dialog.find(".e-dialog-ok").iMenubutton({
text:"确定",
iconCls:"fa fa-save",
btnCls:"gui-btn-save",
onClick:function (){
var data=DataBind.collectData($dialog);
var queryUrl="bom/bom/add";
if(tag=='add'){
HTTP.post(queryUrl,{master:data},function (res) {
if(res.success){
$dialog.closest(".panel-body").iDialog("setStatus",{"state":"ok",data:{
data:$.extend({},data,{
id:res.data.id,
bomid:data.bomid,
wlid:data.wlid
}),
type:tag
}});
gas.showTips("操作成功")
}else{
gas.showWarning(res,"操作失败")
}
})
}else if(tag=="edit"){
queryUrl="bom/bom/update";
HTTP.post(queryUrl,{master:data},function (res) {
if(res.success){
$dialog.closest(".panel-body").iDialog("setStatus",{"state":"ok",data:{
data:data,
type:tag
}});
gas.showTips("操作成功");
}else{
gas.showWarning(res,"操作失败")
}
})
}
}
});
})
</script>
\ No newline at end of file
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