|
|
|
|
@ -15,7 +15,7 @@
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template> -->
|
|
|
|
|
<template v-slot:date v-if="type=='editor'">
|
|
|
|
|
<template v-slot:date>
|
|
|
|
|
<div class="xy-table-item">
|
|
|
|
|
<div class="xy-table-item-label" style="font-weight: bold;">
|
|
|
|
|
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>发现时间:
|
|
|
|
|
@ -41,7 +41,7 @@
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</template> -->
|
|
|
|
|
<template v-slot:siteName v-if="type=='editor'">
|
|
|
|
|
<template v-slot:siteName>
|
|
|
|
|
<div class="xy-table-item">
|
|
|
|
|
<div class="xy-table-item-label" style="font-weight: bold;">
|
|
|
|
|
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>检查地点:
|
|
|
|
|
@ -69,43 +69,7 @@
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-slot:patrol_list v-if="type=='add'">
|
|
|
|
|
<div class="xy-table-item">
|
|
|
|
|
<div class="xy-table-item-label" style="font-weight: bold;min-width:0">
|
|
|
|
|
<!-- <span style="color: red;font-weight: 600;padding-right: 4px;">*</span>问题详情 -->
|
|
|
|
|
</div>
|
|
|
|
|
<div class="xy-table-item-content" style="display: flex;flex-wrap: wrap;margin-left: 10px; width: 90%;">
|
|
|
|
|
<div style="margin-bottom:10px">
|
|
|
|
|
<el-button type="primary" @click="addPatrolList">新增</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
<div style="width:100%">
|
|
|
|
|
<xy-table
|
|
|
|
|
:list="patrol_list"
|
|
|
|
|
stripe
|
|
|
|
|
:isPage="false"
|
|
|
|
|
:table-item="patrol_table">
|
|
|
|
|
<template v-slot:btns>
|
|
|
|
|
<el-table-column align='center' fixed="right" label="操作" width="80" header-align="center">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<div>
|
|
|
|
|
<Button type="primary" style='margin-right:5px;margin-bottom:5px;' @click="copyAsk(scope.$index)" size='small' ghost>复制</Button>
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
<Poptip transfer confirm title="确认要删除吗?" @on-ok="delPatrolList(scope.$index)">
|
|
|
|
|
<Button type="primary" style='margin-right:5px;margin-bottom:5px;' size='small' ghost>删除</Button>
|
|
|
|
|
</Poptip>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
</xy-table>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-slot:ask_id v-if="type=='editor'">
|
|
|
|
|
<template v-slot:ask_id>
|
|
|
|
|
<div class="xy-table-item">
|
|
|
|
|
<div class="xy-table-item-label" style="font-weight: bold;">
|
|
|
|
|
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>问题类型:
|
|
|
|
|
@ -119,7 +83,7 @@
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<template v-slot:ask_department v-if="type=='editor'">
|
|
|
|
|
<template v-slot:ask_department>
|
|
|
|
|
<div class="xy-table-item">
|
|
|
|
|
<div class="xy-table-item-label">
|
|
|
|
|
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>建议整改科室:
|
|
|
|
|
@ -137,7 +101,7 @@
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<template v-slot:showgroups v-if="showgroups"></template>
|
|
|
|
|
<template v-slot:ask_introduce v-if="type=='editor'">
|
|
|
|
|
<template v-slot:ask_introduce>
|
|
|
|
|
<div class="xy-table-item">
|
|
|
|
|
<div class="xy-table-item-label" style="font-weight: bold;">
|
|
|
|
|
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>问题描述:
|
|
|
|
|
@ -148,7 +112,7 @@
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-slot:tips v-if="type=='editor'">
|
|
|
|
|
<template v-slot:tips>
|
|
|
|
|
<div class="xy-table-item">
|
|
|
|
|
<div class="xy-table-item-label">
|
|
|
|
|
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>整改建议:
|
|
|
|
|
@ -160,7 +124,7 @@
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<template v-slot:file_ids v-if="type=='editor'">
|
|
|
|
|
<template v-slot:file_ids>
|
|
|
|
|
<div class="xy-table-item">
|
|
|
|
|
<div class="xy-table-item-label">
|
|
|
|
|
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>问题图片:
|
|
|
|
|
@ -244,154 +208,8 @@
|
|
|
|
|
},
|
|
|
|
|
userdata:[],
|
|
|
|
|
mapform: [],
|
|
|
|
|
patrol_table:[
|
|
|
|
|
{
|
|
|
|
|
label:'*发现时间',
|
|
|
|
|
prop:'date',
|
|
|
|
|
width:180,
|
|
|
|
|
customFn:(row,scope)=>{
|
|
|
|
|
return( <el-date-picker style="width: 90%" v-model={this.patrol_list[scope.$index].date} format="yyyy-MM-dd"
|
|
|
|
|
value-format="yyyy-MM-dd" type="date" placeholder="选择发现时间">
|
|
|
|
|
</el-date-picker>)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label:'*问题描述',
|
|
|
|
|
prop:'ask_introduce',
|
|
|
|
|
width:180,
|
|
|
|
|
customFn:(row,scope)=>{
|
|
|
|
|
return(<el-input v-model={this.patrol_list[scope.$index].ask_introduce} type='textarea'
|
|
|
|
|
placeholder="请输入问题描述" clearable>
|
|
|
|
|
</el-input>)
|
|
|
|
|
}
|
|
|
|
|
},{
|
|
|
|
|
label:'*问题类型',
|
|
|
|
|
prop:'ask_id',
|
|
|
|
|
width:180,
|
|
|
|
|
customFn:(row,scope)=>{
|
|
|
|
|
return(<el-select v-model={this.patrol_list[scope.$index].ask_id} filterable clearable placeholder="请选择问题类型">
|
|
|
|
|
{
|
|
|
|
|
this.askList.map(item=>{
|
|
|
|
|
return(
|
|
|
|
|
<el-option key={item.id} label={item.value} value={item.id}>
|
|
|
|
|
</el-option>
|
|
|
|
|
)
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
</el-select>)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
label:'整改建议',
|
|
|
|
|
prop:'tips',
|
|
|
|
|
width:180,
|
|
|
|
|
customFn:(row,scope)=>{
|
|
|
|
|
return(<el-input v-model={this.patrol_list[scope.$index].tips} type='textarea'
|
|
|
|
|
placeholder="请输入整改建议" clearable>
|
|
|
|
|
</el-input>)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
label:'*检查地点',
|
|
|
|
|
prop:'siteName',
|
|
|
|
|
width:240,
|
|
|
|
|
customFn:(row,scope)=>{
|
|
|
|
|
return(<div style="display:flex"><div>
|
|
|
|
|
{
|
|
|
|
|
this.patrol_list[scope.$index].showCasc? <el-cascader filterable ref="cascader1"
|
|
|
|
|
show-all-levels={false} v-model={this.patrol_list[scope.$index].siteName}
|
|
|
|
|
clearable options={this.siteList} props={{
|
|
|
|
|
'props':{'label':'name','value':'id'}
|
|
|
|
|
}}
|
|
|
|
|
placeholder="请选择检查地点" style="width: 120px;margin-right: 10px;"
|
|
|
|
|
on={{
|
|
|
|
|
["change"]: (e) => (this.changeSite(e,'add',scope.$index)),
|
|
|
|
|
}}></el-cascader> : <el-input v-model={this.patrol_list[scope.$index].siteName}
|
|
|
|
|
type='text' placeholder="请选择地图" clearable
|
|
|
|
|
style="width: 120px;margin-right: 10px;"
|
|
|
|
|
on={{
|
|
|
|
|
["focus"]: (e) => (this.$refs.maps.box = true),
|
|
|
|
|
}}></el-input>
|
|
|
|
|
}
|
|
|
|
|
</div><div>
|
|
|
|
|
{
|
|
|
|
|
this.patrol_list[scope.$index].showCasc? <el-button type="primary"
|
|
|
|
|
on={{
|
|
|
|
|
["click"]: (e) => (this.$refs.maps.box = true,this.mapClickIndex = scope.$index,this.patrol_list[scope.$index].showCasc=false,this.patrol_list[scope.$index].siteName=''),
|
|
|
|
|
}}>选择地图</el-button>
|
|
|
|
|
:<el-button type="primary"
|
|
|
|
|
on={{
|
|
|
|
|
["click"]: (e) => (this.patrol_list[scope.$index].showCasc=true,this.patrol_list[scope.$index].siteName=''),
|
|
|
|
|
}}>选择站点</el-button>
|
|
|
|
|
}
|
|
|
|
|
</div>
|
|
|
|
|
</div>)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label:'问题图片',
|
|
|
|
|
prop:'files',
|
|
|
|
|
minWidth:220,
|
|
|
|
|
customFn:(row,scope)=>{
|
|
|
|
|
let _this = this
|
|
|
|
|
return(<el-upload action={this.action} style={{'overflow-x':'scroll','overflow-y':'hidden'}} class='upload-demo' list-type="picture-card"
|
|
|
|
|
file-list={this.patrol_list[scope.$index].pictureList}
|
|
|
|
|
ref="pictureUpload" auto-upload={true} data={this.uploadOther}
|
|
|
|
|
props={
|
|
|
|
|
{
|
|
|
|
|
"on-success": (response, file, fileList) => this.handlesuccess(response, file, fileList,scope.$index),
|
|
|
|
|
["on-preview"]: (file) => this.handlePictureCardPreview(file),
|
|
|
|
|
["on-remove"]: (file, fileList) => this.handleRemove(file, fileList,scope.$index),
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}>
|
|
|
|
|
<i class="el-icon-plus"></i>
|
|
|
|
|
</el-upload>)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label:'建议整改科室',
|
|
|
|
|
prop:'ask_department',
|
|
|
|
|
width:180,
|
|
|
|
|
customFn:(row,scope)=>{
|
|
|
|
|
return(<el-select
|
|
|
|
|
on={{
|
|
|
|
|
["change"]: (e) => (this.changeDepartment(e,scope.$index)),
|
|
|
|
|
}}
|
|
|
|
|
v-model={this.patrol_list[scope.$index].ask_department} filterable allow-create clearable placeholder="请选择或输入建议整改科室">
|
|
|
|
|
{
|
|
|
|
|
this.depList.map(item=>{
|
|
|
|
|
return(
|
|
|
|
|
<el-option key={item.id} label={item.name} value={item.name}>
|
|
|
|
|
</el-option>
|
|
|
|
|
)
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
</el-select>)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
],
|
|
|
|
|
sitePlaceholder:'请选择站点',
|
|
|
|
|
mapClickIndex:0,
|
|
|
|
|
patrol_list:[{
|
|
|
|
|
showCasc:true,
|
|
|
|
|
date:'',
|
|
|
|
|
ask_id:'',
|
|
|
|
|
site_id: '',
|
|
|
|
|
siteName: '',
|
|
|
|
|
address: '',
|
|
|
|
|
lat: '',
|
|
|
|
|
lon: '',
|
|
|
|
|
ask_department:'',
|
|
|
|
|
ask_introduce:'',
|
|
|
|
|
tips:'',
|
|
|
|
|
pictureList:[]
|
|
|
|
|
}],
|
|
|
|
|
form: {
|
|
|
|
|
|
|
|
|
|
date: '',
|
|
|
|
|
@ -399,7 +217,6 @@
|
|
|
|
|
siteName: '',
|
|
|
|
|
groups:'',
|
|
|
|
|
showgroups:"",
|
|
|
|
|
patrol_list:[],
|
|
|
|
|
ask_introduce: '',
|
|
|
|
|
ask_id: '',
|
|
|
|
|
site_id: '',
|
|
|
|
|
@ -413,7 +230,7 @@
|
|
|
|
|
|
|
|
|
|
tips: '',
|
|
|
|
|
file_ids: [],
|
|
|
|
|
mission_id: '',
|
|
|
|
|
mission_id: '',
|
|
|
|
|
up_admin_id:"",
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
@ -531,16 +348,6 @@
|
|
|
|
|
changeSite(e,type,index) {
|
|
|
|
|
if(e){
|
|
|
|
|
console.log("e",e)
|
|
|
|
|
if(type=='add'){
|
|
|
|
|
this.siteListArr.map(item => {
|
|
|
|
|
if (item.id == e[1]) {
|
|
|
|
|
this.patrol_list[index].site_id = item.id
|
|
|
|
|
this.patrol_list[index].address = item.address
|
|
|
|
|
this.patrol_list[index].lat = item.lat
|
|
|
|
|
this.patrol_list[index].lon = item.lon
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}else{
|
|
|
|
|
this.siteListArr.map(item => {
|
|
|
|
|
if (item.id == e[1]) {
|
|
|
|
|
this.form.site_id = item.id
|
|
|
|
|
@ -550,7 +357,7 @@
|
|
|
|
|
// this.form.siteName = item.name
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -565,11 +372,9 @@
|
|
|
|
|
arr.push(item.id)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
if(this.type==='add'){
|
|
|
|
|
this.patrol_list[index].accept_department_ids = arr
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
|
|
this.form.accept_department_ids = arr
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
@ -609,40 +414,15 @@
|
|
|
|
|
const res = await getparameteritem('askList')
|
|
|
|
|
this.askList = res.detail
|
|
|
|
|
},
|
|
|
|
|
addPatrolList(){
|
|
|
|
|
this.patrol_list.push({
|
|
|
|
|
showCasc:true,
|
|
|
|
|
date:'',
|
|
|
|
|
ask_id:'',
|
|
|
|
|
site_id: '',
|
|
|
|
|
siteName: '',
|
|
|
|
|
address: '',
|
|
|
|
|
lat: '',
|
|
|
|
|
lon: '',
|
|
|
|
|
ask_department:'',
|
|
|
|
|
ask_introduce:'',
|
|
|
|
|
tips:'',
|
|
|
|
|
pictureList:[]
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
delPatrolList(index){
|
|
|
|
|
this.patrol_list.splice(index,1)
|
|
|
|
|
},
|
|
|
|
|
handleRemove(file, fileList,index) {
|
|
|
|
|
if(this.type=='add'){
|
|
|
|
|
this.patrol_list[index].pictureList = fileList
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
|
|
this.pictureList = fileList
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
handlesuccess(response, file, fileList,index) {
|
|
|
|
|
console.log(response, file, fileList,index)
|
|
|
|
|
if(this.type=='add'){
|
|
|
|
|
this.patrol_list[index].pictureList = fileList
|
|
|
|
|
console.log("this.patrol_list",this.patrol_list)
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
|
|
this.pictureList = fileList
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
handlePictureCardPreview(file) {
|
|
|
|
|
this.showPicUrl = file.url;
|
|
|
|
|
@ -670,43 +450,18 @@
|
|
|
|
|
lat: res?.lat,
|
|
|
|
|
lon: res?.lon,
|
|
|
|
|
ask_id: res?.ask_id,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ask_department: res?.ask_department,
|
|
|
|
|
ask_introduce: res?.ask_introduce,
|
|
|
|
|
tips: res?.tips,
|
|
|
|
|
accept_department_ids:res.accept_department_ids?res.accept_department_ids:[],
|
|
|
|
|
file_ids: res?.file_ids,
|
|
|
|
|
patrol_list:[],
|
|
|
|
|
mission_id: res?.mission_id,
|
|
|
|
|
up_admin_id:res?.up_admin_id,
|
|
|
|
|
}
|
|
|
|
|
res.mission_id?this.getGroups(res.mission_id):''
|
|
|
|
|
this.sitePlaceholder = res.site_id?res.site.name:res.address
|
|
|
|
|
// if(res.site_id){
|
|
|
|
|
// this.showCasc = false
|
|
|
|
|
// let pArr = this.findParentElement(this.siteList,res.site_id)
|
|
|
|
|
// if(pArr){
|
|
|
|
|
// this.form.siteName = []
|
|
|
|
|
// this.form.siteName.push(pArr.id)
|
|
|
|
|
// this.form.siteName.push()
|
|
|
|
|
// this.$forceUpdate()
|
|
|
|
|
// }else{
|
|
|
|
|
// this.form.siteName = [undefined,res.site_id]
|
|
|
|
|
// }
|
|
|
|
|
// console.log("this.form.siteName",this.form.siteName)
|
|
|
|
|
|
|
|
|
|
// }else{
|
|
|
|
|
// this.form.siteName = res.address
|
|
|
|
|
// }
|
|
|
|
|
this.showCasc = res.site_id?true:false
|
|
|
|
|
// this.$refs.cascader.placeholder = res.site.name
|
|
|
|
|
// this.$forceUpdate()
|
|
|
|
|
// if(this.showCasc){
|
|
|
|
|
// console.log("this.form.siteName",this.form.siteName)
|
|
|
|
|
// // this.$refs['cascader'].checkedValue = this.form.siteName
|
|
|
|
|
// }
|
|
|
|
|
this.mapform = [res.lon, res.lat, res.address]
|
|
|
|
|
this.mapform = res.site_id?[]:[res.lon, res.lat, res.address]
|
|
|
|
|
for (var f of res.files) {
|
|
|
|
|
this.pictureList.push({
|
|
|
|
|
id: f.id,
|
|
|
|
|
@ -714,133 +469,17 @@
|
|
|
|
|
name: f.original_name
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
console.log("address",this.form)
|
|
|
|
|
this.$refs.cascader1.computePresentText()
|
|
|
|
|
// res.guide_upload ? this.guidePictureList.push(res.guide_upload) : ''
|
|
|
|
|
},
|
|
|
|
|
deepCopy(data){
|
|
|
|
|
//string,number,bool,null,undefined,symbol
|
|
|
|
|
//object,array,date
|
|
|
|
|
if (data && typeof data === "object") {
|
|
|
|
|
//针对函数的拷贝
|
|
|
|
|
if (typeof data === "function") {
|
|
|
|
|
let tempFunc = data.bind(null);
|
|
|
|
|
tempFunc.prototype = this.deepCopy(data.prototype);
|
|
|
|
|
return tempFunc;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
switch (Object.prototype.toString.call(data)) {
|
|
|
|
|
case "[object String]":
|
|
|
|
|
return data.toString();
|
|
|
|
|
case "[object Number]":
|
|
|
|
|
return Number(data.toString());
|
|
|
|
|
case "[object Boolean]":
|
|
|
|
|
return new Boolean(data.toString());
|
|
|
|
|
case "[object Date]":
|
|
|
|
|
return new Date(data.getTime());
|
|
|
|
|
case "[object Array]":
|
|
|
|
|
let arr = [];
|
|
|
|
|
for (let i = 0; i < data.length; i++) {
|
|
|
|
|
arr[i] = this.deepCopy(data[i]);
|
|
|
|
|
}
|
|
|
|
|
return arr;
|
|
|
|
|
|
|
|
|
|
//js自带对象或用户自定义类实例
|
|
|
|
|
case "[object Object]":
|
|
|
|
|
let obj = {};
|
|
|
|
|
for (let key in data) {
|
|
|
|
|
//会遍历原型链上的属性方法,可以用hasOwnProperty来控制 (obj.hasOwnProperty(prop)
|
|
|
|
|
obj[key] = this.deepCopy(data[key]);
|
|
|
|
|
}
|
|
|
|
|
return obj;
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
//string,number,bool,null,undefined,symbol
|
|
|
|
|
return data;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
copyAsk(index){
|
|
|
|
|
console.log(index)
|
|
|
|
|
let obj = this.deepCopy(this.patrol_list[index])
|
|
|
|
|
obj.pictureList=[]
|
|
|
|
|
obj.file_ids=[]
|
|
|
|
|
this.patrol_list.push(obj)
|
|
|
|
|
},
|
|
|
|
|
submit() {
|
|
|
|
|
console.log("this.patrol_list",this.patrol_list)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (this.type === 'add') {
|
|
|
|
|
if(this.patrol_list.length<1){
|
|
|
|
|
Message({
|
|
|
|
|
type: 'warning',
|
|
|
|
|
message: '请填写问题'
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
let nullCount = 0
|
|
|
|
|
this.patrol_list.map(item=>{
|
|
|
|
|
if(!item.date){
|
|
|
|
|
nullCount++
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
if(!item.ask_introduce){
|
|
|
|
|
nullCount++
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
if(!item.ask_id){
|
|
|
|
|
nullCount++
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
if(!item.siteName){
|
|
|
|
|
nullCount++
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
if( nullCount>0){
|
|
|
|
|
Message({
|
|
|
|
|
type: 'warning',
|
|
|
|
|
message: '请填写完整信息'
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
if(this.type=='editor'){
|
|
|
|
|
this.form.id = this.id
|
|
|
|
|
}else{
|
|
|
|
|
this.form.id = ''
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.patrol_list.map(item=>{
|
|
|
|
|
let _files = []
|
|
|
|
|
item.pictureList.map(p=>{
|
|
|
|
|
if (p.response) {
|
|
|
|
|
_files.push(p.response.id)
|
|
|
|
|
} else {
|
|
|
|
|
_files.push(p.id)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
item.file_ids = _files
|
|
|
|
|
})
|
|
|
|
|
let baseForm = {
|
|
|
|
|
mission_id:this.form.mission_id,
|
|
|
|
|
// date:this.form.date,
|
|
|
|
|
up_admin_id:this.form.up_admin_id,
|
|
|
|
|
batch:this.patrol_list,
|
|
|
|
|
// site_id: this.form.site_id,
|
|
|
|
|
// address: this.form.address,
|
|
|
|
|
// lat: this.form.lat,
|
|
|
|
|
// lon: this.form.lon,
|
|
|
|
|
}
|
|
|
|
|
console.log("baseForm",baseForm)
|
|
|
|
|
// return
|
|
|
|
|
batchSave({
|
|
|
|
|
...baseForm
|
|
|
|
|
}).then(res => {
|
|
|
|
|
Message({
|
|
|
|
|
type: 'success',
|
|
|
|
|
message: '新增检查成功'
|
|
|
|
|
})
|
|
|
|
|
this.isShow = false
|
|
|
|
|
this.$emit('refresh')
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
if (this.type === 'editor') {
|
|
|
|
|
// return
|
|
|
|
|
let _files = []
|
|
|
|
|
if (this.pictureList.length > 0) {
|
|
|
|
|
for (var h of this.pictureList) {
|
|
|
|
|
@ -854,18 +493,24 @@
|
|
|
|
|
} else {
|
|
|
|
|
this.form.file_ids = []
|
|
|
|
|
}
|
|
|
|
|
// if(this.form.site_id){
|
|
|
|
|
// this.form.address = ''
|
|
|
|
|
// this.form.lat = ''
|
|
|
|
|
// this.form.lon = ''
|
|
|
|
|
// }
|
|
|
|
|
console.log("form",this.form)
|
|
|
|
|
// return
|
|
|
|
|
save({
|
|
|
|
|
id: this.id,
|
|
|
|
|
...this.form
|
|
|
|
|
}).then(res => {
|
|
|
|
|
Message({
|
|
|
|
|
type: 'success',
|
|
|
|
|
message: '编辑检查成功'
|
|
|
|
|
message: '更改成功'
|
|
|
|
|
})
|
|
|
|
|
this.isShow = false
|
|
|
|
|
this.$emit('refresh')
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
watch: {
|
|
|
|
|
@ -891,11 +536,10 @@
|
|
|
|
|
this.groupObj = {}
|
|
|
|
|
this.showgroups = false
|
|
|
|
|
this.pictureList = []
|
|
|
|
|
this.patrol_list = []
|
|
|
|
|
this.mission_id = ''
|
|
|
|
|
this.mapform = []
|
|
|
|
|
this.showCasc = true
|
|
|
|
|
this.mapClickIndex = 0
|
|
|
|
|
this.mapClickIndex = 0
|
|
|
|
|
this.hasMissionId = false
|
|
|
|
|
this.$refs['dialog'].reset()
|
|
|
|
|
}
|
|
|
|
|
@ -914,20 +558,14 @@
|
|
|
|
|
mapform(newVal, oldVal) {
|
|
|
|
|
|
|
|
|
|
console.log("点击地图了z",this.mapClickIndex)
|
|
|
|
|
if(this.showCasc && this.type==='add'){
|
|
|
|
|
console.log("点击地图了",this.mapClickIndex)
|
|
|
|
|
this.patrol_list[this.mapClickIndex].lon = newVal[0];
|
|
|
|
|
this.patrol_list[this.mapClickIndex].lat = newVal[1];
|
|
|
|
|
this.patrol_list[this.mapClickIndex].address = newVal[2];
|
|
|
|
|
this.patrol_list[this.mapClickIndex].siteName = newVal[2]
|
|
|
|
|
this.patrol_list[this.mapClickIndex].site_id = ''
|
|
|
|
|
return
|
|
|
|
|
if(!this.showCasc){
|
|
|
|
|
this.form.lon = newVal[0];
|
|
|
|
|
this.form.lat = newVal[1];
|
|
|
|
|
this.form.address = newVal[2];
|
|
|
|
|
this.form.siteName = newVal[2]
|
|
|
|
|
this.form.site_id = ''
|
|
|
|
|
}
|
|
|
|
|
this.form.lon = newVal[0];
|
|
|
|
|
this.form.lat = newVal[1];
|
|
|
|
|
this.form.address = newVal[2];
|
|
|
|
|
this.form.siteName = newVal[2]
|
|
|
|
|
this.form.site_id = ''
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|