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

master
dshclm 10 months ago
parent 61d62ad5b6
commit 8877d5f969

@ -6,19 +6,29 @@
<th:block th:include="include :: datetimepicker-css" /> <th:block th:include="include :: datetimepicker-css" />
</head> </head>
<body class="white-bg"> <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}"> <form class="form-horizontal m" id="form-train-edit" th:object="${tdTrain}">
<input name="ID" th:field="*{ID}" type="hidden"> <input name="ID" th:field="*{ID}" type="hidden">
<div class="form-group"> <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"> <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> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">所属区县:</label> <label class="col-sm-3 control-label">所属区县:</label>
<div class="col-sm-8"> <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> </div>
<div class="form-group"> <div class="form-group">
@ -110,6 +120,49 @@
$("input[name='trainState']").val(item.dictLabel); $("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({ $("input[name='trainDate']").datetimepicker({
format: "yyyy-mm-dd", format: "yyyy-mm-dd",
minView: "month", minView: "month",

@ -6,19 +6,29 @@
<th:block th:include="include :: datetimepicker-css" /> <th:block th:include="include :: datetimepicker-css" />
</head> </head>
<body class="white-bg"> <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}"> <form class="form-horizontal m" id="form-train-examine" th:object="${tdTrain}">
<input name="ID" th:field="*{ID}" type="hidden"> <input name="ID" th:field="*{ID}" type="hidden">
<div class="form-group"> <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"> <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> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">所属区县:</label> <label class="col-sm-3 control-label">所属区县:</label>
<div class="col-sm-8"> <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> </div>
<div class="form-group"> <div class="form-group">
@ -105,6 +115,48 @@
$("input[name='trainState']").val(item.dictLabel); $("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"; var prefix = ctx + "system/train";
$("#form-train-examine").validate({ $("#form-train-examine").validate({
focusCleanup: true focusCleanup: true

@ -4,7 +4,7 @@
<th:block th:include="include :: header('涉密人员培训列表')" /> <th:block th:include="include :: header('涉密人员培训列表')" />
</head> </head>
<body class="gray-bg"> <body class="gray-bg">
<div class="container-div"> <div class="container-div" id="app">
<div class="row"> <div class="row">
<div class="col-sm-12 search-collapse"> <div class="col-sm-12 search-collapse">
<form id="formId"> <form id="formId">
@ -15,8 +15,13 @@
<input type="text" name="trainName"/> <input type="text" name="trainName"/>
</li> </li>
<li> <li>
<label>所属地市:</label> <label>所属地区:</label>
<input type="text" name="AREAID"/> <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>
<li> <li>
<label>培训日期:</label> <label>培训日期:</label>
@ -202,6 +207,32 @@
var url = prefix + '/examine/' + id; var url = prefix + '/examine/' + id;
$.modal.open("涉密人员培训审核", url); $.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> </script>
</body> </body>
</html> </html>

Loading…
Cancel
Save