检查报告管理更改地区选择方式

master
dshclm 10 months ago
parent 15e0f8803e
commit f6a4431557

@ -5,7 +5,7 @@
<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-check-add" th:object="${user}"> <form class="form-horizontal m" id="form-check-add" th:object="${user}">
<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>
@ -29,15 +29,25 @@
</div> </div>
</div> </div>
<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="framework" required class="form-control" type="text"> <select id="City" name="framework" 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 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="area" class="form-control" type="text" required> <select id="Area" name="area" 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> </div>
<div class="form-group"> <div class="form-group">
@ -85,7 +95,48 @@
$("#form-check-add").validate({ $("#form-check-add").validate({
focusCleanup: true focusCleanup: true
}); });
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 submitHandler() { function submitHandler() {
if ($.validate.form()) { if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-check-add').serialize()); $.operate.save(prefix + "/add", $('#form-check-add').serialize());

@ -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">
@ -16,11 +16,21 @@
</li> </li>
<li> <li>
<label>所属市州:</label> <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>
<li> <li>
<label>所属区县:</label> <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>
<li> <li>
<label>检查状态:</label> <label>检查状态:</label>
@ -72,7 +82,15 @@
var checkcontentryxmsjjtDatas = [[${@dict.getType('sys_check_state')}]]; var checkcontentryxmsjjtDatas = [[${@dict.getType('sys_check_state')}]];
var checkcontentryxmsjotherjtDatas = [[${@dict.getType('sys_check_state')}]]; var checkcontentryxmsjotherjtDatas = [[${@dict.getType('sys_check_state')}]];
var prefix = ctx + "system/check"; var prefix = ctx + "system/check";
let datas = []
$.ajax({
url: ctx + "system/area/getAllList",
type: 'GET',
data:{parentId:''} ,
success:((res)=>{
datas = res.data
}) ,
});
$(function() { $(function() {
var options = { var options = {
url: prefix + "/list", url: prefix + "/list",
@ -91,12 +109,18 @@
visible: false visible: false
}, },
{ {
field: 'area', field: 'framework',
title: '所属区县' title: '所属市州',
formatter: function(value, row, index) {
return getCity(datas, value)
}
}, },
{ {
field: 'framework', field: 'area',
title: '所属市州' title: '所属区县',
formatter: function(value, row, index) {
return getCity(datas, value)
}
}, },
{ {
field: 'user', field: 'user',
@ -132,6 +156,48 @@
}; };
$.table.init(options); $.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 selfcheck(id) { function selfcheck(id) {
var url ='/system/check/selfcheck/' + id; var url ='/system/check/selfcheck/' + id;
$.modal.open("检查管理", url); $.modal.open("检查管理", url);

@ -5,7 +5,7 @@
<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-check-edit" th:object="${tdCheck}"> <form class="form-horizontal m" id="form-check-edit" th:object="${tdCheck}">
<input name="checkId" th:field="*{checkId}" type="hidden"> <input name="checkId" th:field="*{checkId}" type="hidden">
<div class="form-group"> <div class="form-group">
@ -30,15 +30,25 @@
</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 is-required">所属市:</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="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>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">所属区县:</label> <label class="col-sm-3 control-label is-required">所属区县:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="area" disabled 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> </div>
<div class="form-group"> <div class="form-group">
@ -86,7 +96,48 @@
$("#form-check-edit").validate({ $("#form-check-edit").validate({
focusCleanup: true focusCleanup: true
}); });
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
}) ,
});
}
}
})
function submitHandler() { function submitHandler() {
if ($.validate.form()) { if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-check-edit').serialize()); $.operate.save(prefix + "/edit", $('#form-check-edit').serialize());

@ -5,7 +5,7 @@
<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-check-edit" th:object="${tdCheck}"> <form class="form-horizontal m" id="form-check-edit" th:object="${tdCheck}">
<input name="checkId" th:field="*{checkId}" type="hidden"> <input name="checkId" th:field="*{checkId}" type="hidden">
<div class="form-group"> <div class="form-group">
@ -30,15 +30,25 @@
</div> </div>
</div> </div>
<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="framework" required th:field="*{framework}" class="form-control" type="text"> <select id="City" name="framework" 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 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="area" required th:field="*{area}" class="form-control" type="text"> <select id="Area" name="area" 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> </div>
<div class="form-group"> <div class="form-group">
@ -86,7 +96,48 @@
$("#form-check-edit").validate({ $("#form-check-edit").validate({
focusCleanup: true focusCleanup: true
}); });
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
}) ,
});
}
}
})
function submitHandler() { function submitHandler() {
if ($.validate.form()) { if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-check-edit').serialize()); $.operate.save(prefix + "/edit", $('#form-check-edit').serialize());

Loading…
Cancel
Save