修改使用单位填写方式为选择框

kingbase
dshclm 9 months ago
parent 67900670d9
commit f1c92fed2c

@ -32,7 +32,10 @@
<div class="form-group">
<label class="col-sm-3 control-label is-required">使用单位:</label>
<div class="col-sm-8">
<input name="netDepart" required class="form-control" type="text">
<div class="input-group">
<input name="netDepart" required onclick="selectDeptTree()" id="treeName" type="text" placeholder="请选择使用单位" class="form-control">
<span class="input-group-addon"><i class="fa fa-search"></i></span>
</div>
</div>
</div>
<!--<div class="form-group">
@ -128,6 +131,25 @@
}
}
})
/* 选择部门树 */
function selectDeptTree() {
var treeId = $("#treeId").val();
var deptId = $.common.isEmpty(treeId) ? "100" : $("#treeId").val();
var url = ctx + "system/user/selectDeptTree/" + deptId;
var options = {
title: '选择部门',
width: "380",
url: url,
callBack: doSubmit
};
$.modal.openOptions(options);
}
function doSubmit(index, layero){
var body = $.modal.getChildFrame(index);
$("#treeId").val(body.find('#treeId').val());
$("#treeName").val(body.find('#treeName').val());
$.modal.close(index);
}
$("input[name='netDate']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",

@ -33,7 +33,10 @@
<div class="form-group">
<label class="col-sm-3 control-label is-required">使用单位:</label>
<div class="col-sm-8">
<input name="netDepart" required th:field="*{netDepart}" class="form-control" type="text">
<div class="input-group">
<input class="form-control" required type="text" name="netDepart" onclick="selectDeptTree()" id="treeName" th:field="*{netDepart}">
<span class="input-group-addon"><i class="fa fa-search"></i></span>
</div>
</div>
</div>
<!--<div class="form-group">
@ -129,7 +132,25 @@
$.operate.save(prefix + "/edit", $('#form-network-edit').serialize());
}
}
/* 选择部门树 */
function selectDeptTree() {
var deptId = $.common.isEmpty($("#treeId").val()) ? "100" : $("#treeId").val();
var url = ctx + "system/user/selectDeptTree/" + deptId;
var options = {
title: '选择部门',
width: "380",
url: url,
callBack: doSubmit
};
$.modal.openOptions(options);
}
function doSubmit(index, layero){
var body = $.modal.getChildFrame(index);
$("#treeId").val(body.find('#treeId').val());
$("#treeName").val(body.find('#treeName').val());
$.modal.close(index);
}
$("input[name='netDate']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",

@ -114,10 +114,10 @@
field: 'netDepart',
title: '使用单位'
},
{
field: 'part',
title: '使用部门'
},
// {
// field: 'part',
// title: '使用部门'
// },
{
field: 'netUser',
title: '登记人员'

@ -36,9 +36,12 @@
</div>
</div>-->
<div class="form-group">
<label class="col-sm-3 control-label is-required">使用部门</label>
<label class="col-sm-3 control-label is-required">使用单位</label>
<div class="col-sm-8">
<input name="useDepart" required class="form-control" type="text">
<div class="input-group">
<input name="useDepart" required onclick="selectDeptTree()" id="treeName" type="text" placeholder="请选择使用单位" class="form-control">
<span class="input-group-addon"><i class="fa fa-search"></i></span>
</div>
</div>
</div>
<div class="form-group">
@ -139,7 +142,25 @@
$.operate.save(prefix + "/add", $('#form-property-add').serialize());
}
}
/* 选择部门树 */
function selectDeptTree() {
var treeId = $("#treeId").val();
var deptId = $.common.isEmpty(treeId) ? "100" : $("#treeId").val();
var url = ctx + "system/user/selectDeptTree/" + deptId;
var options = {
title: '选择部门',
width: "380",
url: url,
callBack: doSubmit
};
$.modal.openOptions(options);
}
function doSubmit(index, layero){
var body = $.modal.getChildFrame(index);
$("#treeId").val(body.find('#treeId').val());
$("#treeName").val(body.find('#treeName').val());
$.modal.close(index);
}
$("input[name='useDate']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",

@ -39,7 +39,10 @@
<div class="form-group">
<label class="col-sm-3 control-label is-required">使用部门:</label>
<div class="col-sm-8">
<input name="useDepart" required th:field="*{useDepart}" class="form-control" type="text">
<div class="input-group">
<input class="form-control" required type="text" name="useDepart" onclick="selectDeptTree()" id="treeName" th:field="*{useDepart}">
<span class="input-group-addon"><i class="fa fa-search"></i></span>
</div>
</div>
</div>
<div class="form-group">
@ -147,7 +150,25 @@
$.operate.save(prefix + "/edit", $('#form-property-edit').serialize());
}
}
/* 选择部门树 */
function selectDeptTree() {
var treeId = $("#treeId").val();
var deptId = $.common.isEmpty(treeId) ? "100" : $("#treeId").val();
var url = ctx + "system/user/selectDeptTree/" + deptId;
var options = {
title: '选择部门',
width: "380",
url: url,
callBack: doSubmit
};
$.modal.openOptions(options);
}
function doSubmit(index, layero){
var body = $.modal.getChildFrame(index);
$("#treeId").val(body.find('#treeId').val());
$("#treeName").val(body.find('#treeName').val());
$.modal.close(index);
}
$("input[name='useDate']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",

Loading…
Cancel
Save