|
|
@ -108,7 +108,12 @@ |
|
|
|
</el-button> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="指派服务" label-width="150px"> |
|
|
|
<el-switch v-model="formData.assignFlag"> </el-switch> |
|
|
|
<el-switch |
|
|
|
v-model="formData.assignFlag" |
|
|
|
:active-value="1" |
|
|
|
:inactive-value="0" |
|
|
|
> |
|
|
|
</el-switch> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<el-form :model="newFormData" :rules="newDataRule" ref="ref_gxxq_form1"> |
|
|
@ -334,7 +339,7 @@ export default { |
|
|
|
formData: { |
|
|
|
serviceTypeLevel1Id: "", // 公共服务(政策级别)一级分类id |
|
|
|
commonServiceTypeId: "", // 公共服务(政策级别)二级分类id |
|
|
|
assignFlag: false, |
|
|
|
assignFlag: 0, |
|
|
|
resiSearchTagId: "", //查找享受服务人员 |
|
|
|
resiSearchTagName: "", //享受服务人员名称 |
|
|
|
title: "", //服务名称 |
|
|
@ -362,7 +367,7 @@ export default { |
|
|
|
], |
|
|
|
content: [ |
|
|
|
{ required: true, message: "详细说明不能为空", trigger: "bulr" }, |
|
|
|
{ max: 1000, message: "不能超出1000个字符" , trigger: 'blur'}, |
|
|
|
{ max: 1000, message: "不能超出1000个字符", trigger: "blur" }, |
|
|
|
], |
|
|
|
}, |
|
|
|
newDataRule: { |
|
|
@ -437,17 +442,14 @@ export default { |
|
|
|
this.formData.commonServiceTypeId = data.commonServiceTypeId; |
|
|
|
this.formData.title = data.title; |
|
|
|
this.formData.content = data.content; |
|
|
|
this.formData.assignFlag = data.assignFlag |
|
|
|
this.formData.resiSearchTagId = data.resiSearchTagId; |
|
|
|
this.newFormData.serviceTimeStart = data.assignInfo.serviceTimeStart; |
|
|
|
this.newFormData.serviceTimeEnd = data.assignInfo.serviceTimeEnd; |
|
|
|
this.newFormData.serverOrgType = data.assignInfo.serverOrgType; |
|
|
|
this.newFormData.serverOrgId = data.assignInfo.serverOrgId; |
|
|
|
this.newFormData.noticeApproches = data.assignInfo.noticeApproches; |
|
|
|
if (data.assignFlag == 1) { |
|
|
|
this.formData.assignFlag = true; |
|
|
|
} else { |
|
|
|
this.formData.assignFlag = false; |
|
|
|
} |
|
|
|
|
|
|
|
for (let i in data.assignInfo.serviceScopeList) { |
|
|
|
this.newFormData.serviceScopeList.push( |
|
|
|
data.assignInfo.serviceScopeList[i].objectId |
|
|
@ -628,7 +630,6 @@ export default { |
|
|
|
// console.log(item[key]); |
|
|
|
for (let i of vals) { |
|
|
|
if (item[key] === i) { |
|
|
|
console.log(item[key]); |
|
|
|
this.sarr.push(item); |
|
|
|
} else if (item["objectType"] == "district") { |
|
|
|
this.getLastItem(item.children, vals, key); |
|
|
@ -673,12 +674,6 @@ export default { |
|
|
|
}, |
|
|
|
|
|
|
|
async addFuwu() { |
|
|
|
// 指派服务绑定0或1 |
|
|
|
if (this.formData.assignFlag) { |
|
|
|
this.formData.assignFlag = 1; |
|
|
|
} else { |
|
|
|
this.formData.assignFlag = 0; |
|
|
|
} |
|
|
|
// 通知服务方方式,如果都没有选中传数组字符串'0' |
|
|
|
if (this.newFormData.noticeApproches.length == 0) { |
|
|
|
this.newFormData.noticeApproches.push(0); |
|
|
@ -706,9 +701,27 @@ export default { |
|
|
|
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" |
|
|
|
) { |
|
|
|
isOk = true; |
|
|
|
} else { |
|
|
|
return (isOk = false); |
|
|
|
} |
|
|
|
}); |
|
|
|
//只有网格社区楼栋才可以,其他不行 |
|
|
|
console.log(isOk); |
|
|
|
if (!isOk) { |
|
|
|
this.newArr = []; |
|
|
|
this.$message.error("请选择正确的网格,社区,楼栋!"); |
|
|
|
return; |
|
|
|
} |
|
|
|
this.newFormData.serviceScopeList = arr; |
|
|
|
var url = ""; |
|
|
|
var params = {}; |
|
|
@ -736,15 +749,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() { |
|
|
@ -756,7 +769,7 @@ export default { |
|
|
|
this.formData = { |
|
|
|
serviceTypeLevel1Id: "", // 公共服务(政策级别)一级分类id |
|
|
|
commonServiceTypeId: "", // 公共服务(政策级别)二级分类id |
|
|
|
assignFlag: false, |
|
|
|
assignFlag: 0, |
|
|
|
resiSearchTagId: "", //查找享受服务人员 |
|
|
|
resiSearchTagName: "", //享受服务人员名称 |
|
|
|
title: "", //服务名称 |
|
|
@ -770,7 +783,7 @@ export default { |
|
|
|
serviceTimeEnd: "", //服务截止时间yyyy-MM-dd |
|
|
|
serverOrgType: "", //服务组织类型 社区自组织:community_org, 志愿者:ic_user_volunteer, 联建单位:party_unit |
|
|
|
serverOrgId: "", //服务组织Id |
|
|
|
} |
|
|
|
}; |
|
|
|
}, |
|
|
|
// 开启加载动画 |
|
|
|
startLoading() { |
|
|
|