检查结果管理更改地区选择方式

master
dshclm 10 months ago
parent f6a4431557
commit 10458ef6da

@ -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">
@ -16,11 +16,21 @@
</li>
<li>
<label>所属市州:</label>
<input type="text" name="framework"/>
<select id="City" name="framework" @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>
<input type="text" name="area"/>
<select id="Area" name="area" v-model="Area">
<option value="">请选择</option>
<option v-for="option in AreaList" :value="option.id" :key="option.id">
{{ option.name }}
</option>
</select>
</li>
<li>
<label>检查状态:</label>
@ -66,7 +76,15 @@
var checkcontentryxmsjjtDatas = [[${@dict.getType('sys_check_state')}]];
var checkcontentryxmsjotherjtDatas = [[${@dict.getType('sys_check_state')}]];
var prefix = ctx + "system/checkresult";
let datas = []
$.ajax({
url: ctx + "system/area/getAllList",
type: 'GET',
data:{parentId:''} ,
success:((res)=>{
datas = res.data
}) ,
});
$(function() {
var options = {
url: prefix + "/list",
@ -82,12 +100,18 @@
visible: false
},
{
field: 'area',
title: '所属区县'
field: 'framework',
title: '所属市州',
formatter: function(value, row, index) {
return getCity(datas, value)
}
},
{
field: 'framework',
title: '所属市州'
field: 'area',
title: '所属区县',
formatter: function(value, row, index) {
return getCity(datas, value)
}
},
{
field: 'user',
@ -122,6 +146,48 @@
};
$.table.init(options);
});
var app = new Vue({
el: '#app',
data: {
CityList: [],
AreaList:[],
City:'',
Area:'',
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
}) ,
});
}
}
})
function resultCheck(id) {
var url ='/system/checkresult/checkresult/' + id;
$.modal.open("检查管理", url);

@ -1546,7 +1546,11 @@
var day = String(date.getDate()).padStart(2, '0'); // 日可能是个位数,需要补零
return year + '-' + month + '-' + day
}
if(document.querySelector('#entryDate').innerHTML){
document.querySelector('#entryDate').innerHTML ='检查日期:' + conversionDate(new Date(document.querySelector('#entryDate').innerHTML))
}else{
document.querySelector('#entryDate').innerHTML ='检查日期:'
}
</script>
</body>

@ -15,23 +15,33 @@
}
</style>
<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-check-edit" th:object="${tdCheck}">
<input name="checkId" th:field="*{checkId}" type="hidden">
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label class="col-xs-4 control-label">所属市</label>
<label class="col-xs-4 control-label is-required">所属市:</label>
<div class="col-xs-8">
<input name="framework" readonly th:field="*{framework}" class="form-control" type="text">
<select id="City" name="framework" 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 class="col-sm-6">
<div class="form-group">
<label class="col-xs-4 control-label">所属区县:</label>
<label class="col-xs-4 control-label is-required">所属区县:</label>
<div class="col-xs-8">
<input name="area" readonly th:field="*{area}" class="form-control" type="text">
<select id="Area" name="area" disabled required 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>
@ -287,7 +297,48 @@
$.operate.save(prefix + "/checkresult", $('#form-check-edit').serialize());
}
}
var app = new Vue({
el: '#app',
data: {
CityList: [],
AreaList:[],
City:[[${tdCheck.framework}]],
Area:[[${tdCheck.area}]],
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='checkStartTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",

Loading…
Cancel
Save