diff --git a/rainmaintain/rainmaintain/rainmaintain.vue b/rainmaintain/rainmaintain/rainmaintain.vue index 85ee41e..f828273 100644 --- a/rainmaintain/rainmaintain/rainmaintain.vue +++ b/rainmaintain/rainmaintain/rainmaintain.vue @@ -17,7 +17,7 @@ - + @@ -29,17 +29,17 @@ 重新获取 - - - - - - - - - - - + + + + + + + + + + + @@ -106,16 +106,16 @@ otherData: { token: "" }, - roadName: "", - aboutShow:false, + roadName: "", + aboutShow: false, typeShow: false, dateShow: false, formshow: true, lawshow: true, - showInfoId: false, - askName:"", - askShow:false, - numShow:false, + showInfoId: false, + askName: "", + askShow: false, + numShow: false, typeName: "雨水管道疏挖", dateparams: { year: true, @@ -125,8 +125,8 @@ minute: true, second: true, }, - rainArr: { - askContentList:[], + rainArr: { + askContentList: [], rainTypes: [{ id: 1, name: "雨水管道疏挖" @@ -183,10 +183,10 @@ files_list: [], files_deal_list: [], date: "", - address: "", - scope:"", - point_name:"", - title_id:"" + address: "", + scope: "", + point_name: "", + title_id: "" }, rules: { content: [{ @@ -202,7 +202,7 @@ "/api/mobile/rain-maintains/circulation-store", "/api/mobile/rain-maintains/circulation-store", "/api/mobile/rain-maintains/help-discharge-store", - "/api/mobile/rain-maintains/mire-store", + "/api/mobile/rain-maintains/mire-store", "/api/mobile/rain-maintains/out-water-store" ], save: [ @@ -210,7 +210,7 @@ "/api/mobile/rain-maintains/circulation-save", "/api/mobile/rain-maintains/circulation-save", "/api/mobile/rain-maintains/help-discharge-save", - "/api/mobile/rain-maintains/mire-save", + "/api/mobile/rain-maintains/mire-save", "/api/mobile/rain-maintains/out-water-save" ] } @@ -226,7 +226,7 @@ if (options.roadid) { this.form.road_id = options.roadid this.roadName = options.roadname - } + } that.loadAskContent(); @@ -278,15 +278,15 @@ that.typeName = val[0].label that.form.type = val[0].value that.formshow = true - that.lawshow = true - that.aboutShow = false + that.lawshow = true + that.aboutShow = false that.numShow = false - that.filesList = []; - that.askName = "" - that.form.title_id="" + that.filesList = []; + that.askName = "" + that.form.title_id = "" this.$refs.uUpload.clear(); - that.dealFilesList = []; - that.form.scope = "" + that.dealFilesList = []; + that.form.scope = "" that.form.point_name = "" if (that.form.is_solve == 1) { this.$refs.uUploaddeal.clear(); @@ -300,35 +300,36 @@ that.form.longitude = "" } if (val[0].value == 3 || val[0].value == 4) { - that.lawshow = false + that.lawshow = false + that.aboutShow = true + } + if (val[0].value == 5) { that.aboutShow = true - } - if (val[0].value == 5) { - that.aboutShow = true - that.numShow = true + that.numShow = true } + that.loadAskContent(); console.log("res", that.form) - }, - confirmAskType(e){ - console.log(e) - this.askName = e[0].label - this.form.title_id = e[0].value - }, - loadAskContent() { - var that = this; - that.util.request({ - api: '/api/admin/parameter/show', - method: "get", - data: { - number: "maintainContent" - }, - utilSuccess: function(result) { - that.rainArr.askContentList = result.detail - }, - utilFail: function(res) { - that.util.alert(res); - } - }); + }, + confirmAskType(e) { + console.log(e) + this.askName = e[0].label + this.form.title_id = e[0].value + }, + loadAskContent() { + var that = this; + that.util.request({ + api: '/api/admin/parameter/show', + method: "get", + data: { + number: "maintainContent" + "_" + that.form.type + }, + utilSuccess: function(result) { + that.rainArr.askContentList = result.detail + }, + utilFail: function(res) { + that.util.alert(res); + } + }); }, chooseLocation(e) { //打开地图选择位置 var that = this; @@ -409,9 +410,11 @@ that.form = result.circulation_info; that.form.circulation_id = result.circulation_id; - that.roadName = result.circulation_info.road?result.circulation_info.road.name:"" - that.askName = result.circulation_info.title_detail?result.circulation_info.title_detail.value:"" - + that.roadName = result.circulation_info.road ? result.circulation_info.road + .name : "" + that.askName = result.circulation_info.title_detail ? result.circulation_info + .title_detail.value : "" + let _files = []; for (var mod of result.circulation_info.circulation_files) { let m = Object.assign({}, mod); @@ -433,37 +436,39 @@ that.dealFilesList = _filesafter; that.form.type = result.type console.log(that.form) - break; - case 5: - that.typeName = "出水口排查" - that.numShow = true - that.aboutShow = true - that.form = result.out_water_info; - that.form.out_water_id = result.out_water_id - that.roadName = result.out_water_info.road?result.out_water_info.road.name:"" - that.askName = result.out_water_info.title_detail?result.out_water_info.title_detail.value:"" - let water_files = []; - for (var mod of result.out_water_info.out_water_files) { - let m = Object.assign({}, mod); - m.url = mod.files.url; - m.id = mod.files.id; - m.photoType = "before"; - water_files.push(m); - } - that.filesList = water_files; - - let water_filesafter = []; - for (var mod of result.out_water_info.out_water_deal_files) { - let m = Object.assign({}, mod); - m.url = mod.files.url; - m.id = mod.files.id; - m.photoType = "after"; - water_filesafter.push(m); - } - that.dealFilesList = water_filesafter; - that.form.type = result.type - console.log(that.form) - + break; + case 5: + that.typeName = "出水口排查" + that.numShow = true + that.aboutShow = true + that.form = result.out_water_info; + that.form.out_water_id = result.out_water_id + that.roadName = result.out_water_info.road ? result.out_water_info.road.name : + "" + that.askName = result.out_water_info.title_detail ? result.out_water_info + .title_detail.value : "" + let water_files = []; + for (var mod of result.out_water_info.out_water_files) { + let m = Object.assign({}, mod); + m.url = mod.files.url; + m.id = mod.files.id; + m.photoType = "before"; + water_files.push(m); + } + that.filesList = water_files; + + let water_filesafter = []; + for (var mod of result.out_water_info.out_water_deal_files) { + let m = Object.assign({}, mod); + m.url = mod.files.url; + m.id = mod.files.id; + m.photoType = "after"; + water_filesafter.push(m); + } + that.dealFilesList = water_filesafter; + that.form.type = result.type + console.log(that.form) + break case 3: that.typeName = "汛期助排" @@ -554,7 +559,7 @@ } this.$refs.uForm.validate(valid => { - console.log("form",that.form) + console.log("form", that.form) // return; if (valid) { console.log('验证通过'); diff --git a/rainmaintain/rainmaintaininfo/rainmaintainInfo.vue b/rainmaintain/rainmaintaininfo/rainmaintainInfo.vue index 6fc4233..e6ec1c6 100644 --- a/rainmaintain/rainmaintaininfo/rainmaintainInfo.vue +++ b/rainmaintain/rainmaintaininfo/rainmaintainInfo.vue @@ -2,9 +2,9 @@ - + - + @@ -24,38 +24,38 @@ {{form.typeName}} - - - - 养护内容: - - - {{titleName}} - - - - - 排水口编号: - - - {{form.number}} - - - - - 覆盖范围: - - - {{form.scope}}米 - - - - - 点位名称: - - - {{form.point_name}} - + + + + 养护内容: + + + {{titleName}} + + + + + 排水口编号: + + + {{form.number}} + + + + + 覆盖范围: + + + {{form.scope}}米 + + + + + 点位名称: + + + {{form.point_name}} + @@ -78,7 +78,8 @@ 现场图片: - + @@ -119,23 +120,24 @@ 处理后图片: - + - - - - + + + + - + - + - - + + @@ -145,164 +147,174 @@ export default { data() { return { - formshow:true, - lawshow:true, - titleName:"", - watershow:false, - lists:{}, - form:{}, - filesList:[], - dealFilesList:[], - + formshow: true, + lawshow: true, + titleName: "", + watershow: false, + lists: {}, + form: {}, + filesList: [], + dealFilesList: [], + } }, - - - + + + onLoad(options) { - if(options.id){ + if (options.id) { this.loadInfo(options.id) } }, - methods: { - imgListPreview(item){ - var urlList = [] - urlList.push(item) //push中的参数为 :src="item.img_url" 中的图片地址 - uni.previewImage({ - indicator:"number", - loop:true, - urls: urlList - }) - + methods: { + imgListPreview(item) { + var urlList = [] + urlList.push(item) //push中的参数为 :src="item.img_url" 中的图片地址 + uni.previewImage({ + indicator: "number", + loop: true, + urls: urlList + }) + }, loadInfo: function(id) { var that = this; this.util.request({ - method:"get", + method: "get", api: '/api/mobile/rain-maintains/show', customLoading: false, data: { - id:id + id: id }, - + utilSuccess: function(result) { that.lists = result - switch(result.type){ - case 1: - case 2: - - that.form = result.circulation_info; - let _files = []; - for (var mod of result.circulation_info.circulation_files) { - let m = Object.assign({}, mod); - m.url = mod.files.url; - m.id = mod.files.id; - m.photoType = "before"; - _files.push(m); - } - that.filesList = _files; - - let _filesafter = []; - for (var mod of result.circulation_info.circulation_deal_files) { - let m = Object.assign({}, mod); - m.url = mod.files.url; - m.id = mod.files.id; - m.photoType = "after"; - _filesafter.push(m); - } - that.dealFilesList = _filesafter; - that.form.type = result.type - result.circulation_info.is_solve==0 ? that.form.solveName="否":that.form.solveName="是" - result.circulation_info.is_law==0 ? that.form.lawName="否":that.form.lawName="是" - that.form.areaName = result.area_info?result.area_info.name:"" - that.form.created_at = result.created_at - that.titleName = result.circulation_info.title_detail?result.circulation_info.title_detail.value:'' - break; - case 3: - that.lawshow = false - that.form = result.help_discharge_info; - let discharge_files = []; - for (var mod of result.help_discharge_info.help_discharge_files) { - let m = Object.assign({}, mod); - m.url = mod.files.url; - m.id = mod.files.id; - m.photoType = "before"; - discharge_files.push(m); - } - that.filesList = discharge_files; - - let discharge_filesafter = []; - for (var mod of result.help_discharge_info.help_discharge_deal_files) { - let m = Object.assign({}, mod); - m.url = mod.files.url; - m.id = mod.files.id; - m.photoType = "after"; - discharge_filesafter.push(m); - } - that.dealFilesList = discharge_filesafter; - that.form.type = result.type - that.form.typeName = "汛期助排" - result.help_discharge_info.is_solve==0 ? that.form.solveName="否":that.form.solveName="是" - that.form.areaName = result.area_info?result.area_info.name:"" - that.form.created_at = result.created_at - break; - case 4: - that.formshow = false - that.form = result.mire_info; - let mire_files = []; - for (var mod of result.mire_info.mire_files) { - let m = Object.assign({}, mod); - m.url = mod.files.url; - m.id = mod.files.id; - m.photoType = "before"; - mire_files.push(m); - } - that.filesList =mire_files; - that.form.type = result.type - that.form.typeName = "污泥外运" - that.form.areaName = result.area_info?result.area_info.name:"" - that.form.created_at = result.created_at - break; - case 5: - that.watershow = true - that.form = result.out_water_info; - let water_files = []; - for (var mod of result.out_water_info.out_water_files) { - let m = Object.assign({}, mod); - m.url = mod.files.url; - m.id = mod.files.id; - m.photoType = "before"; - water_files.push(m); - } - that.filesList = water_files; - - let water_filesafter = []; - for (var mod of result.out_water_info.out_water_deal_files) { - let m = Object.assign({}, mod); - m.url = mod.files.url; - m.id = mod.files.id; - m.photoType = "after"; - water_filesafter.push(m); - } - that.dealFilesList = water_filesafter; - that.form.type = result.type - that.form.typeName = "出水口排查" - result.out_water_info.is_solve==0 ? that.form.solveName="否":that.form.solveName="是" - result.out_water_info.is_law==0 ? that.form.lawName="否":that.form.lawName="是" - that.form.areaName = result.area_info?result.area_info.name:"" - that.form.created_at = result.created_at - that.titleName = result.out_water_info.title_detail?result.out_water_info.title_detail.value:'' - break; + switch (result.type) { + case 1: + case 2: + + that.form = result.circulation_info; + let _files = []; + for (var mod of result.circulation_info.circulation_files) { + let m = Object.assign({}, mod); + m.url = mod.files.url; + m.id = mod.files.id; + m.photoType = "before"; + _files.push(m); + } + that.filesList = _files; + + let _filesafter = []; + for (var mod of result.circulation_info.circulation_deal_files) { + let m = Object.assign({}, mod); + m.url = mod.files.url; + m.id = mod.files.id; + m.photoType = "after"; + _filesafter.push(m); + } + that.dealFilesList = _filesafter; + that.form.type = result.type + that.form.typeName = result.type == 1 ? "雨水管道疏挖" : "雨水管道疏通" + result.circulation_info.is_solve == 0 ? that.form.solveName = "否" : that + .form.solveName = "是" + result.circulation_info.is_law == 0 ? that.form.lawName = "否" : that.form + .lawName = "是" + that.form.areaName = result.area_info ? result.area_info.name : "" + that.form.created_at = result.created_at + that.titleName = result.circulation_info.title_detail ? result + .circulation_info.title_detail.value : '' + break; + case 3: + that.lawshow = false + that.form = result.help_discharge_info; + let discharge_files = []; + for (var mod of result.help_discharge_info.help_discharge_files) { + let m = Object.assign({}, mod); + m.url = mod.files.url; + m.id = mod.files.id; + m.photoType = "before"; + discharge_files.push(m); + } + that.filesList = discharge_files; + + let discharge_filesafter = []; + for (var mod of result.help_discharge_info.help_discharge_deal_files) { + let m = Object.assign({}, mod); + m.url = mod.files.url; + m.id = mod.files.id; + m.photoType = "after"; + discharge_filesafter.push(m); + } + that.dealFilesList = discharge_filesafter; + that.form.type = result.type + that.form.typeName = "汛期助排" + result.help_discharge_info.is_solve == 0 ? that.form.solveName = "否" : that + .form.solveName = "是" + that.form.areaName = result.area_info ? result.area_info.name : "" + that.form.created_at = result.created_at + that.titleName = result.help_discharge_info.title_detail ? result + .help_discharge_info.title_detail.value : '' + break; + case 4: + that.formshow = false + that.form = result.mire_info; + let mire_files = []; + for (var mod of result.mire_info.mire_files) { + let m = Object.assign({}, mod); + m.url = mod.files.url; + m.id = mod.files.id; + m.photoType = "before"; + mire_files.push(m); + } + that.filesList = mire_files; + that.form.type = result.type + that.form.typeName = "污泥外运" + that.form.areaName = result.area_info ? result.area_info.name : "" + that.form.created_at = result.created_at + break; + case 5: + that.watershow = true + that.form = result.out_water_info; + let water_files = []; + for (var mod of result.out_water_info.out_water_files) { + let m = Object.assign({}, mod); + m.url = mod.files.url; + m.id = mod.files.id; + m.photoType = "before"; + water_files.push(m); + } + that.filesList = water_files; + + let water_filesafter = []; + for (var mod of result.out_water_info.out_water_deal_files) { + let m = Object.assign({}, mod); + m.url = mod.files.url; + m.id = mod.files.id; + m.photoType = "after"; + water_filesafter.push(m); + } + that.dealFilesList = water_filesafter; + that.form.type = result.type + that.form.typeName = "出水口排查" + result.out_water_info.is_solve == 0 ? that.form.solveName = "否" : that.form + .solveName = "是" + result.out_water_info.is_law == 0 ? that.form.lawName = "否" : that.form + .lawName = "是" + that.form.areaName = result.area_info ? result.area_info.name : "" + that.form.created_at = result.created_at + that.titleName = result.out_water_info.title_detail ? result.out_water_info + .title_detail.value : '' + break; } }, utilFail: function(res) { - + this.util.alert(res); } }); } - + } @@ -331,19 +343,22 @@ margin: 10rpx 0; font-size: 28rpx; } - .u-card{ + + .u-card { z-index: 1; } +