Commit 7570616f authored by 李苏's avatar 李苏 💬

根节点新增

parent f33e9c07
...@@ -39,6 +39,9 @@ ...@@ -39,6 +39,9 @@
<script> <script>
$(function () { $(function () {
/*js初始化*/ /*js初始化*/
var opentype="add";
var $add=$(".toolbar-add")
var $edit=$(".toolbar-edit")
var $div=$('#bomBom'); var $div=$('#bomBom');
var $datagrid=$div.find(".toolbar-table"); var $datagrid=$div.find(".toolbar-table");
var $edtBomid=$div.find('input[name="bomid"]'); var $edtBomid=$div.find('input[name="bomid"]');
...@@ -182,14 +185,14 @@ $(function () { ...@@ -182,14 +185,14 @@ $(function () {
}) })
} }
}, },
messager:function () { messager:function (e) {
var selectedRow=$datagrid.treegrid("getSelected"); var selectedRow=$datagrid.treegrid("getSelected");
if(!selectedRow){ if(!selectedRow){
gas.showWarning("请选择一条数据!"); gas.showWarning("请选择一条数据!");
return true return true
} }
console.log(selectedRow) console.log(selectedRow)
if(selectedRow.bomid=="root"){ if(selectedRow.bomid=="root"&&opentype=="edit"){
gas.showWarning("无法操作根节点!"); gas.showWarning("无法操作根节点!");
return true return true
}else{ }else{
...@@ -205,6 +208,12 @@ $(function () { ...@@ -205,6 +208,12 @@ $(function () {
} }
} }
}; };
$edit.click(function(){
opentype="edit"
})
$add.click(function(){
opentype="add"
})
$div.Holder(options); $div.Holder(options);
Auxiliary.box($edtBomid,{code:'WLID',callback:function (res) { Auxiliary.box($edtBomid,{code:'WLID',callback:function (res) {
$edtBomid.textbox("setValue",res.id); $edtBomid.textbox("setValue",res.id);
......
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