|
|
@ -444,6 +444,7 @@ export default { |
|
|
|
this.formData.content = data.content; |
|
|
|
this.formData.assignFlag = data.assignFlag |
|
|
|
this.formData.resiSearchTagId = data.resiSearchTagId; |
|
|
|
if( data.assignInfo){ |
|
|
|
this.newFormData.serviceTimeStart = data.assignInfo.serviceTimeStart; |
|
|
|
this.newFormData.serviceTimeEnd = data.assignInfo.serviceTimeEnd; |
|
|
|
this.newFormData.serverOrgType = data.assignInfo.serverOrgType; |
|
|
@ -455,8 +456,9 @@ export default { |
|
|
|
data.assignInfo.serviceScopeList[i].objectId |
|
|
|
); |
|
|
|
} |
|
|
|
await this.handleChangeServiceTypeLevel1(); |
|
|
|
await this.getServiceuserList(data.assignInfo.serverOrgType); |
|
|
|
} |
|
|
|
await this.handleChangeServiceTypeLevel1(); |
|
|
|
await // this.formData = { ...data }; |
|
|
|
|
|
|
|
await this.getTagName(); |
|
|
@ -696,33 +698,47 @@ export default { |
|
|
|
objectName: this.newArr[i].objectName, |
|
|
|
}); |
|
|
|
} |
|
|
|
this.newArr = [] |
|
|
|
// 如果是编辑的话回填的数据会有数组字符串需要将不是对象属性的过滤掉 |
|
|
|
let arr = []; |
|
|
|
let isOk = false; |
|
|
|
this.newFormData.serviceScopeList.forEach((item) => { |
|
|
|
if (typeof item != "string") { |
|
|
|
arr.push(item); |
|
|
|
} |
|
|
|
}); |
|
|
|
// 选中的数据中有不是网格或者社区或者楼栋的就停止它 |
|
|
|
let isOk = false; |
|
|
|
arr.findIndex((item) => { |
|
|
|
if ( |
|
|
|
item.objectType == "neighborhood" || |
|
|
|
item.objectType == "agency" || |
|
|
|
item.objectType == "grid" |
|
|
|
) { |
|
|
|
// 选中的数据中有不是网格或者小区或者楼栋的就停止它 |
|
|
|
|
|
|
|
// arr.forEach((item) => { |
|
|
|
// if ( |
|
|
|
// item.objectType == "neighborhood" || |
|
|
|
// item.objectType == "agency" || |
|
|
|
// item.objectType == "grid" |
|
|
|
// ) { |
|
|
|
// isOk = true; |
|
|
|
// } else { |
|
|
|
// isOk = false |
|
|
|
// this.newArr = []; |
|
|
|
// this.newFormData.serviceScopeList = [] |
|
|
|
// arr = [] |
|
|
|
// this.$message.error("请选择正确的网格,社区,楼栋!"); |
|
|
|
// } |
|
|
|
// }); |
|
|
|
for(let i in arr){ |
|
|
|
if(arr[i].objectType == "neighborhood" || |
|
|
|
arr[i].objectType == "agency" || |
|
|
|
arr[i].objectType == "grid"){ |
|
|
|
isOk = true; |
|
|
|
} else { |
|
|
|
return (isOk = false); |
|
|
|
} |
|
|
|
}); |
|
|
|
console.log(isOk); |
|
|
|
if (!isOk) { |
|
|
|
this.newArr = []; |
|
|
|
}else{ |
|
|
|
isOk = false; |
|
|
|
console.log( this.newArr,'没有清空?'); |
|
|
|
this.$message.error("请选择正确的网格,社区,楼栋!"); |
|
|
|
return; |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
console.log( this.newArr); |
|
|
|
this.newFormData.serviceScopeList = arr; |
|
|
|
if (!isOk && this.formData.assignFlag) return |
|
|
|
var url = ""; |
|
|
|
var params = {}; |
|
|
|
if (this.formType == "edit") { |
|
|
@ -749,15 +765,15 @@ export default { |
|
|
|
} |
|
|
|
// const url = 'http://yapi.elinkservice.cn/mock/245/governance/icServiceProject/service/initiate' |
|
|
|
console.log(params); |
|
|
|
// const { data, code, msg } = await requestPost(url, params); |
|
|
|
|
|
|
|
// if (code === 0) { |
|
|
|
// this.$message.success("添加成功"); |
|
|
|
// this.resetData(); |
|
|
|
// this.$emit("handleComfirm"); |
|
|
|
// } else if(code>=8000){ |
|
|
|
// this.$message.error(msg); |
|
|
|
// } |
|
|
|
const { data, code, msg } = await requestPost(url, params); |
|
|
|
|
|
|
|
if (code === 0) { |
|
|
|
this.$message.success("添加成功"); |
|
|
|
this.resetData(); |
|
|
|
this.$emit("handleComfirm"); |
|
|
|
} else if(code>=8000){ |
|
|
|
this.$message.error(msg); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
handleCancle() { |
|
|
|