master
lion 4 years ago
parent ff23a68537
commit a2078e7a8e

@ -18,12 +18,19 @@
</u-form-item>
<block v-if='formshow'>
<u-form-item label="巡查内容" label-position="top" prop="type" required>
<u-input placeholder="请选择巡查内容" v-model="askName" type="select" :border="true"
<u-form-item label="巡查内容" label-position="top" prop="type" required>
<u-checkbox-group @change="checkboxGroupChange">
<u-checkbox
v-for="(item, index) in rainArr.askContentList" :key="index"
v-model="item.checked"
:name="item.id"
>{{item.value}}</u-checkbox>
</u-checkbox-group>
<!-- <u-button @click="checkedAll"></u-button> -->
<!-- <u-input placeholder="请选择巡查内容" v-model="askName" type="select" :border="true"
@click="askShow = true" />
<!-- <u-picker :show="typeShow" keyName="name" :columns="rainArr.rainTypes" @confirm="confirmType"></u-picker> -->
<u-select v-model="askShow" mode="single-column" value-name="id" label-name="value"
:list="rainArr.askContentList" @confirm="confirmAskType"></u-select>
:list="rainArr.askContentList" @confirm="confirmAskType"></u-select> -->
</u-form-item>
<!-- <u-form-item labelWidth="260" prop="scope" label="覆盖范围(米)" label-position="left" required>
<u-input type="number" v-model="form.scope" placeholder="请填写覆盖范围"/>
@ -264,7 +271,8 @@
]
},
filesList: [],
dealFilesList: [],
dealFilesList: [],
askArr:[],
form: {
road_id: '',
content: "",
@ -447,7 +455,12 @@
}
}
},
},
checkboxGroupChange(val){
this.askArr = val
console.log(val)
},
confirmAskType(val) {
console.log(val)
var that = this
@ -480,7 +493,8 @@
}
that.form.is_unusual = 0
that.form.is_scene = 0
that.form.is_law = 0
that.form.is_law = 0
if (val[0].value == 2) {
that.formshow = false
that.lawshow = false
@ -491,11 +505,13 @@
that.form.end_longitude = ""
that.form.end_latitude = ""
that.form.ask_content_id = ""
that.askName = ""
}
if (val[0].value == 1) {
that.loadAskContent()
that.askName = ""
that.form.ask_content_id = ""
that.askArr=[]
}
// if (val[0].value == 1) {
// that.loadAskContent()
// }
console.log("res", that.form)
},
chooseLocation(e) { //
@ -667,9 +683,14 @@
number: "equiementList"
},
utilSuccess: function(result) {
that.rainArr.askContentList = result.detail
that.form.ask_content_id = that.rainArr.askContentList[0].id + ""
that.askName = that.rainArr.askContentList[0].value
that.rainArr.askContentList = result.detail
for(var m of that.rainArr.askContentList){
// m.checked = false
that.$set(m, 'checked', false)
}
console.log("that.rainArr.askContentList",that.rainArr.askContentList)
// that.form.ask_content_id = that.rainArr.askContentList[0].id + ""
// that.askName = that.rainArr.askContentList[0].value
},
utilFail: function(res) {
that.util.alert(res);
@ -709,7 +730,7 @@
that.instype = 1
that.form = result.rain_equipment_info;
that.form.rain_equipment_id = result.rain_equipment_id;
that.askName = result.rain_equipment_info.ask_content_detail.value
that.askName = result.rain_equipment_info.ask_content_detail
that.unusualName = result.rain_equipment_info.unusual_type_detail ? result
.rain_equipment_info.unusual_type_detail.value : ""
that.roadName = result.rain_equipment_info.road ? result.rain_equipment_info
@ -732,7 +753,21 @@
m.photoType = "after";
_filesafter.push(m);
}
that.dealFilesList = _filesafter;
that.dealFilesList = _filesafter;
if(that.form.ask_content_id!=""){
that.askArr = that.form.ask_content_id.split(",")
console.log(that.askArr)
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
}
}
}
console.log(that.rainArr.askContentList)
}
console.log(that.form)
break;
case 2:
@ -813,7 +848,24 @@
}
that.form.files_list = list;
that.form.files_end_list = deallist;
if(that.instype==1){
if(this.askArr.length==0){
this.$refs.uToast.show({
title: '请选择巡查类型'
})
return
}else{
console.log(this.askArr)
let askContent = ""
for(var m of this.askArr){
askContent+= m+","
}
this.form.ask_content_id = askContent.substring(0,askContent.length-1)
}
}
if(that.instype==2){
console.log("form",this.form)
if(that.form.link_mobile!=""){
let res = /^1[3456789]\d{9}$/
if(!res.test(that.form.link_mobile)){
@ -832,7 +884,7 @@
}
}
console.log(that.form)
return
// return
let api = "";
if (this.infoId) {
api = this.apis.save[this.instype]

@ -292,7 +292,7 @@
that.scopeShow = true
that.form = result.rain_equipment_info;
that.form.rain_equipment_id = result.rain_equipment_id;
that.askName = result.rain_equipment_info.ask_content_detail.value
that.askName = result.rain_equipment_info.ask_content_detail
that.areaName = result.area_info?result.area_info.name:""
that.form.unsualName=result.rain_equipment_info.is_unusual==1?"是":"否"
that.form.sceneName = that.form.is_scene==0?"否":"是"

@ -19,10 +19,17 @@
<block v-if="formshow">
<u-form-item label="养护内容" label-position="top" prop="type" required>
<u-input placeholder="请选择养护内容" v-model="askName" type="select" :border="true"
<!-- <u-input placeholder="请选择养护内容" v-model="askName" type="select" :border="true"
@click="askShow = true" />
<u-select v-model="askShow" mode="single-column" value-name="id" label-name="value"
:list="rainArr.askContentList" @confirm="confirmAskType"></u-select>
:list="rainArr.askContentList" @confirm="confirmAskType"></u-select> -->
<u-checkbox-group @change="checkboxGroupChange">
<u-checkbox
v-for="(item, index) in rainArr.askContentList" :key="index"
v-model="item.checked"
:name="item.id"
>{{item.value}}</u-checkbox>
</u-checkbox-group>
</u-form-item>
<u-form-item label="位置" label-position="top" required>
<u-input v-model="form.address" disabled type='text' />
@ -95,7 +102,7 @@
</view>
</u-form>
<u-button type="primary" @click="submit"></u-button>
<u-toast ref="uToast" />
</view>
</template>
@ -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)

@ -63,7 +63,7 @@
</view>
<view class="footer" slot="foot">
<block v-if="item.status==0">
<u-button :custom-style="editStyle" type="primary" size="medium" @click="toedit(item.id)"
<u-button :custom-style="editStyle" type="primary" size="medium" @click="toedit(item)"
:ripple="true">编辑
</u-button>
</block>
@ -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) {

Loading…
Cancel
Save