From a2078e7a8ee8ad92d517525406b86df34ed32578 Mon Sep 17 00:00:00 2001 From: lion <120344285@qq.com> Date: Wed, 31 Aug 2022 16:04:30 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=9A=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../raininspection/raininspection.vue | 86 +++++++++-- .../raininspectioninfo/raininspectionInfo.vue | 2 +- rainmaintain/rainmaintain/rainmaintain.vue | 146 ++++++++++++++---- .../rainmaintainlist/rainmaintainList.vue | 6 +- 4 files changed, 189 insertions(+), 51 deletions(-) diff --git a/raininspection/raininspection/raininspection.vue b/raininspection/raininspection/raininspection.vue index 6573819..42c8bb5 100644 --- a/raininspection/raininspection/raininspection.vue +++ b/raininspection/raininspection/raininspection.vue @@ -18,12 +18,19 @@ - - + + {{item.value}} + + + + :list="rainArr.askContentList" @confirm="confirmAskType"> --> + + {{item.value}} + @@ -95,7 +102,7 @@ 提交 - + @@ -124,7 +131,8 @@ hour: true, minute: true, second: true, - }, + }, + askArr:[], rainArr: { askContentList: [], rainTypes: [{ @@ -196,7 +204,8 @@ point_name: "", title_id: "", mobile_worksheet_id:"" - }, + }, + gettype:null, rules: { // scope: [{ // required: true, @@ -243,8 +252,14 @@ var that = this; if (options.id) { this.infoId = options.id; - this.showInfoId = true - this.showInfo(this.infoId); + this.showInfoId = true + this.gettype=options.type + setTimeout(function(){ + that.showInfo(that.infoId); + },1000) + that.loadAskContent(that.gettype); + }else{ + that.loadAskContent(1) } if (options.roadid) { this.form.road_id = options.roadid @@ -253,9 +268,8 @@ if(options.orderId){ this.form.mobile_worksheet_id = options.orderId } - that.loadAskContent(); - - + + that.rainArr.askContentList = that.rainArr.askContentList_1 this.action = this.util.HOST + "/api/mobile/upload-file"; this.otherData.token = uni.getStorageSync("userInfo_token").access_token; }, @@ -322,43 +336,57 @@ this.$refs.uUploaddeal.clear(); } that.form.is_law = 0 - that.form.is_solve = 0 + that.form.is_solve = 0 + that.askArr=[] if (val[0].value == 4) { that.formshow = false that.form.address = "" that.form.latitude = "" that.form.longitude = "" - that.form.title_id="" + that.askName="" } if (val[0].value == 3 || val[0].value == 4) { that.lawshow = false - that.aboutShow = true + that.aboutShow = true + that.form.title_id="" } if (val[0].value == 5) { that.aboutShow = true that.numShow = true + } + if(val[0].value !=4){ + that.loadAskContent(val[0].value); } - that.loadAskContent(); - console.log("res", that.form) }, confirmAskType(e) { console.log(e) this.askName = e[0].label this.form.title_id = e[0].value + }, + checkboxGroupChange(val){ + this.askArr = val + console.log(val) }, - loadAskContent() { - var that = this; + loadAskContent(type) { + var that = this; + type?type:that.form.type that.util.request({ api: '/api/admin/parameter/show', method: "get", data: { - number: "maintainContent" + "_" + that.form.type + number: "maintainContent" + "_" + type }, utilSuccess: function(result) { - that.rainArr.askContentList = result.detail - that.form.title_id = that.rainArr.askContentList[0].id+"" - that.askName = that.rainArr.askContentList[0].value + that.rainArr["askContentList_"+type] = result.detail + for(var m of that.rainArr["askContentList_"+type]){ + // m.checked = false + that.$set(m, 'checked', false) + } + console.log(that.gettype) + if(!that.gettype){ + that.rainArr.askContentList = that.rainArr["askContentList_"+type] + } }, utilFail: function(res) { that.util.alert(res); @@ -425,15 +453,17 @@ }, showInfo(id) { - var that = this; + var that = this; + // await that.loadAskContent(that.gettype) that.util.request({ api: '/api/mobile/rain-maintains/show', method: "get", data: { id: id }, - utilSuccess: function(result) { - + utilSuccess: function(result) { + + that.rainArr.askContentList = that.rainArr["askContentList_"+result.old_type] switch (result.old_type) { case 1: case 2: @@ -475,8 +505,20 @@ _filesafter.push(m); } that.dealFilesList = _filesafter; - that.form.type = result.type - console.log(that.form) + that.form.type = result.type + that.form.title_id=that.form.title_id+"" + if(that.form.title_id!=""){ + that.askArr = that.form.title_id.split(",") + for(var m of that.askArr){ + m = parseInt(m) + for(var k of that.rainArr.askContentList){ + if(m==k.id){ + console.log(m) + k.checked = true + } + } + } + } break; case 5: that.typeName = "出水口排查" @@ -507,8 +549,20 @@ water_filesafter.push(m); } that.dealFilesList = water_filesafter; - that.form.type = result.type - console.log(that.form) + that.form.type = result.type + that.form.title_id=that.form.title_id+"" + if(that.form.title_id!=""){ + that.askArr = that.form.title_id.split(",") + for(var m of that.askArr){ + m = parseInt(m) + for(var k of that.rainArr.askContentList){ + if(m==k.id){ + console.log(m) + k.checked = true + } + } + } + } break case 3: @@ -536,7 +590,20 @@ discharge_filesafter.push(m); } that.dealFilesList = discharge_filesafter; - that.form.type = result.type + that.form.type = result.type + that.form.title_id=that.form.title_id+"" + if(that.form.title_id!=""){ + that.askArr = that.form.title_id.split(",") + for(var m of that.askArr){ + m = parseInt(m) + for(var k of that.rainArr.askContentList){ + if(m==k.id){ + console.log(m) + k.checked = true + } + } + } + } break; case 4: that.typeName = "污泥外运" @@ -597,7 +664,26 @@ api = this.apis.save[this.form.type] } else { api = this.apis.store[this.form.type] - } + } + + if(that.form.type!=4){ + if(this.askArr.length==0){ + this.$refs.uToast.show({ + title: '请选择养护内容' + }) + return + }else{ + console.log(this.askArr) + let titleContent = "" + for(var m of this.askArr){ + titleContent+= m+"," + } + this.form.title_id = titleContent.substring(0,titleContent.length-1) + } + } + console.log("forms",this.form) + console.log("titles",this.form.title_id) + // return this.$refs.uForm.validate(valid => { console.log("form", that.form) diff --git a/rainmaintain/rainmaintainlist/rainmaintainList.vue b/rainmaintain/rainmaintainlist/rainmaintainList.vue index a5fd919..138c11b 100644 --- a/rainmaintain/rainmaintainlist/rainmaintainList.vue +++ b/rainmaintain/rainmaintainlist/rainmaintainList.vue @@ -63,7 +63,7 @@ - 编辑 @@ -220,9 +220,9 @@ this.options1[index].active = !this.options1[index].active; }, - toedit(id) { + toedit(item) { uni.navigateTo({ - url: "../rainmaintain/rainmaintain?id=" + id + url: "../rainmaintain/rainmaintain?id=" + item.id +"&type="+item.old_type }) }, todetail: function(id) {