|
|
@ -18,7 +18,7 @@ |
|
|
|
> |
|
|
|
<el-select |
|
|
|
class="cell-width-1" |
|
|
|
v-model.trim="formData.policyTypeLevel1Id" |
|
|
|
v-model.trim="formData.policyCategoryL1" |
|
|
|
placeholder="请选择" |
|
|
|
clearable |
|
|
|
> |
|
|
@ -31,7 +31,7 @@ |
|
|
|
> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
|
|
|
|
- |
|
|
|
<el-select |
|
|
|
class="cell-width-1" |
|
|
|
v-model.trim="formData.policyCategoryL2" |
|
|
@ -215,7 +215,11 @@ |
|
|
|
style="display: block" |
|
|
|
> |
|
|
|
<template v-if="formData.resiSearchTagName"> |
|
|
|
<el-tag @close="handleCloseTag" closable style="margin-right: 10px"> |
|
|
|
<el-tag |
|
|
|
@close="handleCloseTag" |
|
|
|
:closable="formType != 'detail'" |
|
|
|
style="margin-right: 10px" |
|
|
|
> |
|
|
|
{{ formData.resiSearchTagName }} |
|
|
|
</el-tag> |
|
|
|
</template> |
|
|
@ -233,7 +237,12 @@ |
|
|
|
</el-switch> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<el-form :model="newFormData" :rules="newDataRule" ref="ref_policy_form1"> |
|
|
|
<el-form |
|
|
|
:model="newFormData" |
|
|
|
:disabled="formType === 'detail'" |
|
|
|
:rules="newDataRule" |
|
|
|
ref="ref_policy_form1" |
|
|
|
> |
|
|
|
<el-form-item |
|
|
|
v-if="formData.assignFlag" |
|
|
|
label="服务方" |
|
|
@ -373,7 +382,7 @@ |
|
|
|
<script> |
|
|
|
import { mapGetters } from "vuex"; |
|
|
|
import { Loading } from "element-ui"; // 引入Loading服务 |
|
|
|
import { requestPost } from "@/js/dai/request"; |
|
|
|
import { requestPost, requestGet } from "@/js/dai/request"; |
|
|
|
import rule from "./rule"; |
|
|
|
import labelForm from "../labelConfig/addForm.vue"; |
|
|
|
|
|
|
@ -430,8 +439,8 @@ export default { |
|
|
|
}, |
|
|
|
|
|
|
|
formData: { |
|
|
|
policyTypeLevel1Id: "", // 公共服务(政策级别)一级分类id |
|
|
|
policyCategoryL2:"", |
|
|
|
policyCategoryL1: "", // 公共服务(政策级别)一级分类id |
|
|
|
policyCategoryL2: "", |
|
|
|
policyLevel: "", //政府级别 |
|
|
|
startDate: "", //起始时间yyyy-MM-dd |
|
|
|
endDate: "", //截止时间yyyy-MM-dd |
|
|
@ -499,16 +508,18 @@ export default { |
|
|
|
}, |
|
|
|
components: { rule, labelForm }, |
|
|
|
async mounted() { |
|
|
|
this.startLoading(); |
|
|
|
this.getServiceTypeDictOptions(); |
|
|
|
this.getDictOptions(); |
|
|
|
this.loadScopeTree(); |
|
|
|
await this.startLoading(); |
|
|
|
await this.getServiceTypeDictOptions(); |
|
|
|
await this.getDictOptions(); |
|
|
|
await this.loadScopeTree(); |
|
|
|
await this.loadDemandoption(); |
|
|
|
|
|
|
|
if (this.formType === "add") { |
|
|
|
this.$refs.ref_form.resetFields(); |
|
|
|
} else { |
|
|
|
this.loadFormInfo(); |
|
|
|
await this.loadFormInfo(); |
|
|
|
await this.handleChangeServiceTypeLevel1(); |
|
|
|
await this.handleServiceChange(); |
|
|
|
} |
|
|
|
|
|
|
|
this.endLoading(); |
|
|
@ -545,22 +556,29 @@ export default { |
|
|
|
}, |
|
|
|
|
|
|
|
async loadFormInfo() { |
|
|
|
const url = "/heart/policy/detail/" + this.policyId; |
|
|
|
const url = "/governance/policy/policyDetail/" + this.policyId; |
|
|
|
|
|
|
|
let params = {}; |
|
|
|
|
|
|
|
const { data, code, msg } = await requestPost(url, params); |
|
|
|
const { data, code, msg } = await requestGet(url, params); |
|
|
|
|
|
|
|
if (code === 0) { |
|
|
|
this.demandIdArray = []; |
|
|
|
data.categoryList.forEach((element) => { |
|
|
|
let arr = element.codePath.split(","); |
|
|
|
this.demandIdArray.push(arr); |
|
|
|
}); |
|
|
|
// data.categoryList.forEach((element) => { |
|
|
|
// let arr = element.codePath.split(","); |
|
|
|
// this.demandIdArray.push(arr); |
|
|
|
// }); |
|
|
|
// this.formData.ruleList = data.ruleList |
|
|
|
|
|
|
|
data.policyLevel = "" + data.policyLevel; |
|
|
|
this.formData = data; |
|
|
|
|
|
|
|
this.newFormData = data.assignInfo; |
|
|
|
if (data.assignInfo) { |
|
|
|
for (let i in data.assignInfo.serviceScopeList) { |
|
|
|
this.newFormData.serviceScopeList.push( |
|
|
|
data.assignInfo.serviceScopeList[i].objectId |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
if (data.attachmentList) { |
|
|
|
this.fileList = data.attachmentList; |
|
|
|
} |
|
|
@ -614,13 +632,11 @@ export default { |
|
|
|
this.$message.error(msg); |
|
|
|
} |
|
|
|
}, |
|
|
|
async handleServiceChange(type, val) { |
|
|
|
console.log(val); |
|
|
|
await this.getServiceuserList(val); |
|
|
|
async handleServiceChange() { |
|
|
|
await this.getServiceuserList(); |
|
|
|
}, |
|
|
|
|
|
|
|
async getServiceuserList(serverOrgType) { |
|
|
|
if (!serverOrgType) return false; |
|
|
|
async getServiceuserList() { |
|
|
|
if (!this.formData.assignInfo) return; |
|
|
|
if (this.formData.commonServiceTypeId == "") { |
|
|
|
this.$message.error("请先选择需求类别!"); |
|
|
|
return; |
|
|
@ -628,9 +644,10 @@ export default { |
|
|
|
const url = "/actual/base/serviceitem/listServerOrg"; |
|
|
|
let params = { |
|
|
|
serviceTypeId: this.formData.policyCategoryL2, |
|
|
|
serverOrgType: serverOrgType, |
|
|
|
serverOrgType: this.formData.assignInfo.serverOrgType, |
|
|
|
businessType: "common_service", |
|
|
|
}; |
|
|
|
console.log(this.formData); |
|
|
|
let { data, code, msg } = await requestPost(url, params); |
|
|
|
if (code == 0) { |
|
|
|
this.serviceOptiondList = data; |
|
|
@ -654,7 +671,7 @@ export default { |
|
|
|
console.log("组织类型获取失败!"); |
|
|
|
}); |
|
|
|
}, |
|
|
|
async getDictOptions() { |
|
|
|
getDictOptions() { |
|
|
|
// 政策级别下拉 |
|
|
|
this.$http |
|
|
|
.post("/sys/dict/data/dictlist", { |
|
|
@ -746,8 +763,7 @@ export default { |
|
|
|
// this.addFuwu(); |
|
|
|
// } |
|
|
|
// }); |
|
|
|
this.addFuwu(); |
|
|
|
|
|
|
|
this.addFuwu(); |
|
|
|
}, |
|
|
|
getLastItem(list, vals, key) { |
|
|
|
let LIST = list || []; |
|
|
@ -766,8 +782,9 @@ export default { |
|
|
|
} |
|
|
|
}, |
|
|
|
async operationOption() { |
|
|
|
this.sarr = [] |
|
|
|
this.sarr = []; |
|
|
|
// 使用递归找出符合条件的数据需要 |
|
|
|
if (!this.newFormData) return; |
|
|
|
await this.getLastItem( |
|
|
|
this.casOptions, |
|
|
|
this.newFormData.serviceScopeList, |
|
|
@ -798,42 +815,53 @@ export default { |
|
|
|
// 处理服务范围数据 |
|
|
|
await this.operationOption(); |
|
|
|
// this.formData.attachmentList = [...this.fileList]; |
|
|
|
this.fileList.forEach(item=>{ |
|
|
|
this.formData.attachmentList.push({ |
|
|
|
name:item.attachmentName, |
|
|
|
type:item.attachmentType, |
|
|
|
url:item.attachmentUrl, |
|
|
|
format:item.attachmentFormat, |
|
|
|
duration:0, |
|
|
|
}) |
|
|
|
}) |
|
|
|
// this.fileList.forEach(item=>{ |
|
|
|
// this.formData.attachmentList.push({ |
|
|
|
// name:item.attachmentName, |
|
|
|
// type:item.attachmentType, |
|
|
|
// url:item.attachmentUrl, |
|
|
|
// format:item.attachmentFormat, |
|
|
|
// duration:0, |
|
|
|
// }) |
|
|
|
// }) |
|
|
|
this.formData.assignInfo = this.newFormData; |
|
|
|
let url = "/governance/policy/addPolicy"; |
|
|
|
let url = ""; |
|
|
|
|
|
|
|
if (this.formType === "add" || this.formType === "copy") { |
|
|
|
url = "/governance/policy/addPolicy"; |
|
|
|
// this.formData.policyId = ""; |
|
|
|
} else { |
|
|
|
url = "/heart/policy/update"; |
|
|
|
// this.formData.policyId = this.policyId; |
|
|
|
url = "/governance/policy/updatePolicy"; |
|
|
|
this.formData.policyId = this.policyId; |
|
|
|
} |
|
|
|
//为什么不能传null还要返回null呢? |
|
|
|
if (this.formType == "copy"&& this.formData.assignFlag == 0) { |
|
|
|
this.formData.assignInfo = { |
|
|
|
noticeApproches: [], |
|
|
|
serverOrgId: "", |
|
|
|
serverOrgType: "", |
|
|
|
serviceScopeList: [], |
|
|
|
serviceTimeEnd: "", |
|
|
|
serviceTimeStart: "", |
|
|
|
}; |
|
|
|
this.formData.attachmentList = [] |
|
|
|
} |
|
|
|
|
|
|
|
// const url = 'http://yapi.elinkservice.cn/mock/245/heart/icServiceProject/service/initiate' |
|
|
|
let params = { |
|
|
|
...this.formData, |
|
|
|
}; |
|
|
|
delete params.policyTypeLevel1Id |
|
|
|
delete params.resiSearchTagName |
|
|
|
delete params.policyCategoryL1; |
|
|
|
delete params.resiSearchTagName; |
|
|
|
console.log(params); |
|
|
|
const { data, code, msg } = await requestPost(url, params) |
|
|
|
const { data, code, msg } = await requestPost(url, params); |
|
|
|
|
|
|
|
if (code === 0) { |
|
|
|
this.$message.success('操作成功') |
|
|
|
this.resetData() |
|
|
|
this.$emit('handleOk') |
|
|
|
this.$message.success("操作成功"); |
|
|
|
this.resetData(); |
|
|
|
this.$emit("handleOk"); |
|
|
|
} else { |
|
|
|
this.btnDisable = false |
|
|
|
this.$message.error(msg) |
|
|
|
this.btnDisable = false; |
|
|
|
this.$message.error(msg); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
@ -984,11 +1012,11 @@ export default { |
|
|
|
|
|
|
|
// 服务类型下拉框选中事件 |
|
|
|
handleChangeServiceTypeLevel1() { |
|
|
|
this.formData.policyCategoryL2 = ""; |
|
|
|
// this.formData.policyCategoryL2 = ""; |
|
|
|
this.$http |
|
|
|
.get( |
|
|
|
"/governance/commonServiceType/selectList/" + |
|
|
|
this.formData.policyTypeLevel1Id |
|
|
|
this.formData.policyCategoryL1 |
|
|
|
) |
|
|
|
.then(({ data: res }) => { |
|
|
|
if (res.code !== 0) { |
|
|
|