|
|
@@ -224,20 +224,33 @@ $(function () {
|
|
|
// }
|
|
|
// }
|
|
|
// });
|
|
|
- /* 获取省市区 */
|
|
|
$.ajax({
|
|
|
- type: "POST",
|
|
|
- url: baseURL + "/api/region/list",
|
|
|
+ type: "post",
|
|
|
+ url: baseURL + "api/region/provinceList",
|
|
|
contentType: "application/json",
|
|
|
- success: function(r){
|
|
|
- if(r.code == 0){
|
|
|
- vm.location.city = r.data;
|
|
|
- vm.location2.city = r.data;
|
|
|
- }else{
|
|
|
+ success: function (r) {
|
|
|
+ if (r.code == 0) {
|
|
|
+ vm.location2.province = r.data;
|
|
|
+ vm.location.province = r.data
|
|
|
+ } else {
|
|
|
layer.alert("读取省失败");
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
+ /* 获取省市区 */
|
|
|
+ // $.ajax({
|
|
|
+ // type: "POST",
|
|
|
+ // url: baseURL + "/api/region/list",
|
|
|
+ // contentType: "application/json",
|
|
|
+ // success: function(r){
|
|
|
+ // if(r.code == 0){
|
|
|
+ // vm.location.city = r.data;
|
|
|
+ // vm.location2.city = r.data;
|
|
|
+ // }else{
|
|
|
+ // layer.alert("读取省失败");
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // });
|
|
|
$.ajax({
|
|
|
type: "POST",
|
|
|
url: baseURL + "qmgj/wgclientinfo/selectCiList",
|
|
|
@@ -577,11 +590,11 @@ var vm = new Vue({
|
|
|
$('.selectpicker#client').selectpicker('val', '');
|
|
|
// console.log('工作新增')
|
|
|
// console.log(vm.location.city)
|
|
|
- for (let i=0; i<=vm.location.city.length; i++) {
|
|
|
- if(420100 == vm.location.city[i].id) {
|
|
|
- return vm.location.area = vm.location.city[i].childRegionList
|
|
|
- }
|
|
|
- }
|
|
|
+ // for (let i=0; i<=vm.location.city.length; i++) {
|
|
|
+ // if(420100 == vm.location.city[i].id) {
|
|
|
+ // return vm.location.area = vm.location.city[i].childRegionList
|
|
|
+ // }
|
|
|
+ // }
|
|
|
},
|
|
|
update: function (event) {
|
|
|
var id = getSelectedRow();
|
|
|
@@ -594,25 +607,25 @@ var vm = new Vue({
|
|
|
$('#client').selectpicker('refresh');
|
|
|
vm.getInfo(id)
|
|
|
/*区域选择*/
|
|
|
- $.ajax({
|
|
|
- type: "POST",
|
|
|
- url: baseURL + "/api/region/list",
|
|
|
- contentType: "application/json",
|
|
|
- success: function(r){
|
|
|
- if(r.code == 0){
|
|
|
+ // $.ajax({
|
|
|
+ // type: "POST",
|
|
|
+ // url: baseURL + "/api/region/list",
|
|
|
+ // contentType: "application/json",
|
|
|
+ // success: function(r){
|
|
|
+ // if(r.code == 0){
|
|
|
|
|
|
- vm.location.city = r.data;
|
|
|
- for (const elem of r.data) {
|
|
|
- if(vm.work.city == elem.id) {
|
|
|
- vm.location.area = elem.childRegionList
|
|
|
- }
|
|
|
- }
|
|
|
- console.log(vm.work.area)
|
|
|
- }else{
|
|
|
- layer.alert("读取省失败");
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
+ // vm.location.city = r.data;
|
|
|
+ // for (const elem of r.data) {
|
|
|
+ // if(vm.work.city == elem.id) {
|
|
|
+ // vm.location.area = elem.childRegionList
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // console.log(vm.work.area)
|
|
|
+ // }else{
|
|
|
+ // layer.alert("读取省失败");
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // });
|
|
|
// console.log('修改')
|
|
|
// console.log(vm.location.city)
|
|
|
},
|
|
|
@@ -659,25 +672,25 @@ var vm = new Vue({
|
|
|
vm.getInfo(id)
|
|
|
vm.work.readNum = 0
|
|
|
/*区域选择*/
|
|
|
- $.ajax({
|
|
|
- type: "POST",
|
|
|
- url: baseURL + "/api/region/list",
|
|
|
- contentType: "application/json",
|
|
|
- success: function(r){
|
|
|
- if(r.code == 0){
|
|
|
+ // $.ajax({
|
|
|
+ // type: "POST",
|
|
|
+ // url: baseURL + "/api/region/list",
|
|
|
+ // contentType: "application/json",
|
|
|
+ // success: function(r){
|
|
|
+ // if(r.code == 0){
|
|
|
|
|
|
- vm.location.city = r.data;
|
|
|
- for (const elem of r.data) {
|
|
|
- if(vm.work.city == elem.id) {
|
|
|
- vm.location.area = elem.childRegionList
|
|
|
- }
|
|
|
- }
|
|
|
- // console.log(vm.work.area)
|
|
|
- }else{
|
|
|
- layer.alert("读取省失败");
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
+ // vm.location.city = r.data;
|
|
|
+ // for (const elem of r.data) {
|
|
|
+ // if(vm.work.city == elem.id) {
|
|
|
+ // vm.location.area = elem.childRegionList
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // // console.log(vm.work.area)
|
|
|
+ // }else{
|
|
|
+ // layer.alert("读取省失败");
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // });
|
|
|
// console.log('修改')
|
|
|
// console.log(vm.location.city)
|
|
|
},
|
|
|
@@ -686,7 +699,13 @@ var vm = new Vue({
|
|
|
$.get(baseURL + "qmgj/work/info/"+id, function(r){
|
|
|
vm.work = r.work;
|
|
|
// console.log(vm.work.area)
|
|
|
- vm.work.province = ''
|
|
|
+ // vm.work.province = ''
|
|
|
+ if (vm.work.province) {
|
|
|
+ vm.province(2, true)
|
|
|
+ }
|
|
|
+ if (vm.work.city) {
|
|
|
+ vm.city(true)
|
|
|
+ }
|
|
|
if(r.work.isAppletsRelease == 1) {
|
|
|
r.work.appletsDetails = JSON.parse(r.work.appletsDetails)
|
|
|
vm.jieshao = r.work.appletsDetails[0]
|
|
|
@@ -724,34 +743,6 @@ var vm = new Vue({
|
|
|
$('#demo3').show();
|
|
|
$('#demo3').attr('src',vm.work.qrCodePicture);
|
|
|
}
|
|
|
- // vm.work.city = r.work.city
|
|
|
- // vm.location.city
|
|
|
- // $.ajax({
|
|
|
- // type: "POST",
|
|
|
- // url: baseURL + "qmgj/productinfo/selectTwo/"+vm.work.province,
|
|
|
- // contentType: "application/json",
|
|
|
- // async: false,
|
|
|
- // success: function(r){
|
|
|
- // if(r.code == 0){
|
|
|
- // vm.location.city = r.decList;
|
|
|
- // }else{
|
|
|
- // layer.alert("读取市失败");
|
|
|
- // }
|
|
|
- // }
|
|
|
- // });
|
|
|
- // $.ajax({
|
|
|
- // type: "POST",
|
|
|
- // url: baseURL + "qmgj/productinfo/selectThree/"+vm.work.city,
|
|
|
- // contentType: "application/json",
|
|
|
- // async: false,
|
|
|
- // success: function(r){
|
|
|
- // if(r.code == 0){
|
|
|
- // vm.location.area = r.decList;
|
|
|
- // }else{
|
|
|
- // layer.alert("读取区失败");
|
|
|
- // }
|
|
|
- // }
|
|
|
- // });
|
|
|
/*搜索下拉框*/
|
|
|
if (vm.work.clientId){
|
|
|
$('.selectpicker#client').selectpicker('val', vm.work.clientId);
|
|
|
@@ -777,21 +768,36 @@ var vm = new Vue({
|
|
|
postData:{'queryParam': JSON.stringify(vm.queryParam)},
|
|
|
page:page
|
|
|
}).trigger("reloadGrid");
|
|
|
- },
|
|
|
- province: function (event) {
|
|
|
- var d = event.target.value;
|
|
|
- vm.location.city = {};
|
|
|
- vm.work.city = '';
|
|
|
- vm.location.area = {};
|
|
|
- vm.work.area = '';
|
|
|
+ },
|
|
|
+ province: function (type, show = false) {
|
|
|
+ // var d = event.target.value;
|
|
|
+ // console.log(type, show);
|
|
|
+ let d = type == 1 ? vm.queryParam.select4 : vm.work.province;
|
|
|
+ // console.log(d)
|
|
|
+ if (!show) {
|
|
|
+ if (type == 1) {
|
|
|
+ vm.location2.city = [];
|
|
|
+ vm.queryParam.select5 = '';
|
|
|
+ } else {
|
|
|
+ vm.location.city = [];
|
|
|
+ vm.work.city = '';
|
|
|
+ vm.location.area = [];
|
|
|
+ vm.work.area = '';
|
|
|
+ }
|
|
|
+ }
|
|
|
$.ajax({
|
|
|
- type: "POST",
|
|
|
- url: baseURL + "qmgj/productinfo/selectTwo/"+d,
|
|
|
+ type: "post",
|
|
|
+ url: baseURL + "api/region/childList",
|
|
|
contentType: "application/json",
|
|
|
- success: function(r){
|
|
|
- if(r.code == 0){
|
|
|
- vm.location.city = r.decList;
|
|
|
- }else{
|
|
|
+ data: JSON.stringify({ id: d }),
|
|
|
+ success: function (r) {
|
|
|
+ if (r.code == 0) {
|
|
|
+ if (type == 1) {
|
|
|
+ vm.location2.city = r.data;
|
|
|
+ } else {
|
|
|
+ vm.location.city = r.data;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
layer.alert("读取市失败");
|
|
|
}
|
|
|
}
|
|
|
@@ -816,17 +822,27 @@ var vm = new Vue({
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- city: function (event) {
|
|
|
- var d = event.target.value;
|
|
|
- console.log(event)
|
|
|
- vm.location.area = {};
|
|
|
- vm.work.area = '';
|
|
|
- // vm.location.city
|
|
|
- for (let i=0; i<=vm.location.city.length; i++) {
|
|
|
- if(d == vm.location.city[i].id) {
|
|
|
- return vm.location.area = vm.location.city[i].childRegionList
|
|
|
- }
|
|
|
+ city: function (show) {
|
|
|
+ var d = vm.work.city;
|
|
|
+ // console.log(vm.location.city)
|
|
|
+ if (!show) {
|
|
|
+ vm.work.area = '';
|
|
|
}
|
|
|
+ vm.location.area = [];
|
|
|
+ // console.log(d)
|
|
|
+ $.ajax({
|
|
|
+ type: "post",
|
|
|
+ url: baseURL + "api/region/childList",
|
|
|
+ contentType: "application/json",
|
|
|
+ data: JSON.stringify({ id: d }),
|
|
|
+ success: function (r) {
|
|
|
+ if (r.code == 0) {
|
|
|
+ vm.location.area = r.data;
|
|
|
+ } else {
|
|
|
+ layer.alert("读取市失败");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
},
|
|
|
publish: function (event) {
|
|
|
var ids = getSelectedRows();
|