涉密人员培训修改地区选择方式

master
dshclm 10 months ago
parent 61d62ad5b6
commit 8877d5f969

@ -94,7 +94,7 @@ var table = {
pagination: options.pagination, // 是否显示分页(*
paginationLoop: options.paginationLoop, // 是否启用分页条无限循环的功能
pageNumber: 1, // 初始化加载第一页,默认第一页
pageSize: options.pageSize, // 每页的记录行数(*
pageSize: options.pageSize, // 每页的记录行数(*
pageList: options.pageList, // 可供选择的每页的行数(*
firstLoad: options.firstLoad, // 是否首次请求加载数据对于数据较大可以配置false
escape: options.escape, // 转义HTML字符串
@ -155,7 +155,7 @@ var table = {
// 获取实例ID如存在多个返回#id1,#id2 delimeter分隔符
getOptionsIds: function(separator) {
var _separator = $.common.isEmpty(separator) ? "," : separator;
var optionsIds = "";
var optionsIds = "";
$.each(table.config, function(key, value){
optionsIds += "#" + key + _separator;
});
@ -173,7 +173,7 @@ var table = {
isAsc: params.order
};
var currentId = $.common.isEmpty(table.options.formId) ? $('form').attr('id') : table.options.formId;
return $.extend(curParams, $.common.formToJSON(currentId));
return $.extend(curParams, $.common.formToJSON(currentId));
},
// 请求获取数据后处理回调函数
responseHandler: function(res) {
@ -884,9 +884,9 @@ var table = {
},
// 弹出层指定参数选项
openOptions: function (options) {
var _url = $.common.isEmpty(options.url) ? "/404.html" : options.url;
var _title = $.common.isEmpty(options.title) ? "系统窗口" : options.title;
var _width = $.common.isEmpty(options.width) ? "800" : options.width;
var _url = $.common.isEmpty(options.url) ? "/404.html" : options.url;
var _title = $.common.isEmpty(options.title) ? "系统窗口" : options.title;
var _width = $.common.isEmpty(options.width) ? "800" : options.width;
var _height = $.common.isEmpty(options.height) ? ($(window).height() - 50) : options.height;
var _btn = ['<i class="fa fa-check"></i> 确认', '<i class="fa fa-close"></i> 关闭'];
// 如果是移动端,就使用自适应大小弹窗
@ -1055,7 +1055,7 @@ var table = {
width: width,
height: height,
url: _url,
skin: 'layui-layer-gray',
skin: 'layui-layer-gray',
btn: ['关闭'],
yes: function (index, layero) {
$.modal.close(index);
@ -1778,4 +1778,4 @@ modal_status = {
SUCCESS: "success",
FAIL: "error",
WARNING: "warning"
};
};

@ -6,19 +6,29 @@
<th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<div class="wrapper wrapper-content animated fadeInRight ibox-content" id="app">
<form class="form-horizontal m" id="form-train-edit" th:object="${tdTrain}">
<input name="ID" th:field="*{ID}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label is-required">所属地市:</label>
<div class="col-sm-8">
<input name="AREAID" disabled th:field="*{AREAID}" class="form-control" type="text" required>
<select id="City" name="AREAID" disabled required @change="getAreaList()" v-model="City" class="form-control m-b">
<option value="">请选择</option>
<option v-for="option in CityList" :value="option.id" :key="option.id">
{{ option.name }}
</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">所属区县:</label>
<div class="col-sm-8">
<input name="FRAMEWORK" disabled th:field="*{FRAMEWORK}" class="form-control" type="text">
<select id="Area" name="FRAMEWORK" disabled v-model="Area" class="form-control m-b">
<option value="">请选择</option>
<option v-for="option in AreaList" :value="option.id" :key="option.id">
{{ option.name }}
</option>
</select>
</div>
</div>
<div class="form-group">
@ -110,6 +120,49 @@
$("input[name='trainState']").val(item.dictLabel);
}
})
var app = new Vue({
el: '#app',
data: {
CityList: [],
AreaList:[],
City:[[${tdTrain.AREAID}]],
Area:[[${tdTrain.FRAMEWORK}]],
params:{
parentId:'',
}
},
mounted(){
// 初始化地市列表
this.getCityList();
if (this.City){
this.getAreaList()
}
},
methods:{
getCityList(){
$.ajax({
url: ctx + "system/area/getSysAreaList",
type: 'GET',
data:this.params ,
success:((res)=>{
this.CityList = res.data
}) ,
});
},
getAreaList(){
this.params.parentId = this.City
$.ajax({
url: ctx + "system/area/getSysAreaList",
type: 'GET',
data:this.params,
success:((res)=>{
this.AreaList = res.data
}) ,
});
}
}
})
$("input[name='trainDate']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
@ -135,4 +188,4 @@
});
</script>
</body>
</html>
</html>

@ -6,19 +6,29 @@
<th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<div class="wrapper wrapper-content animated fadeInRight ibox-content" id="app">
<form class="form-horizontal m" id="form-train-examine" th:object="${tdTrain}">
<input name="ID" th:field="*{ID}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label is-required">所属地市:</label>
<div class="col-sm-8">
<input name="AREAID" disabled th:field="*{AREAID}" class="form-control" type="text" required>
<select id="City" name="AREAID" required disabled @change="getAreaList()" v-model="City" class="form-control m-b">
<option value="">请选择</option>
<option v-for="option in CityList" :value="option.id" :key="option.id">
{{ option.name }}
</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">所属区县:</label>
<div class="col-sm-8">
<input name="FRAMEWORK" disabled th:field="*{FRAMEWORK}" class="form-control" type="text">
<select id="Area" name="FRAMEWORK" disabled v-model="Area" class="form-control m-b">
<option value="">请选择</option>
<option v-for="option in AreaList" :value="option.id" :key="option.id">
{{ option.name }}
</option>
</select>
</div>
</div>
<div class="form-group">
@ -105,6 +115,48 @@
$("input[name='trainState']").val(item.dictLabel);
}
})
var app = new Vue({
el: '#app',
data: {
CityList: [],
AreaList:[],
City:[[${tdTrain.AREAID}]],
Area:[[${tdTrain.FRAMEWORK}]],
params:{
parentId:'',
}
},
mounted(){
// 初始化地市列表
this.getCityList();
if (this.City){
this.getAreaList()
}
},
methods:{
getCityList(){
$.ajax({
url: ctx + "system/area/getSysAreaList",
type: 'GET',
data:this.params ,
success:((res)=>{
this.CityList = res.data
}) ,
});
},
getAreaList(){
this.params.parentId = this.City
$.ajax({
url: ctx + "system/area/getSysAreaList",
type: 'GET',
data:this.params,
success:((res)=>{
this.AreaList = res.data
}) ,
});
}
}
})
var prefix = ctx + "system/train";
$("#form-train-examine").validate({
focusCleanup: true

@ -4,7 +4,7 @@
<th:block th:include="include :: header('涉密人员培训列表')" />
</head>
<body class="gray-bg">
<div class="container-div">
<div class="container-div" id="app">
<div class="row">
<div class="col-sm-12 search-collapse">
<form id="formId">
@ -15,8 +15,13 @@
<input type="text" name="trainName"/>
</li>
<li>
<label>所属地市:</label>
<input type="text" name="AREAID"/>
<label>所属地区:</label>
<select id="City" name="AREAID" @change="getAreaList()" v-model="City">
<option value="">请选择</option>
<option v-for="option in CityList" :value="option.id" :key="option.id">
{{ option.name }}
</option>
</select>
</li>
<li>
<label>培训日期:</label>
@ -202,6 +207,32 @@
var url = prefix + '/examine/' + id;
$.modal.open("涉密人员培训审核", url);
}
var app = new Vue({
el: '#app',
data: {
CityList: [],
City:'',
params:{
parentId:'',
}
},
mounted(){
// 初始化地市列表
this.getCityList();
},
methods:{
getCityList(){
$.ajax({
url: ctx + "system/area/getSysAreaList",
type: 'GET',
data:this.params ,
success:((res)=>{
this.CityList = res.data
}) ,
});
},
}
})
</script>
</body>
</html>

Loading…
Cancel
Save