|
@ -12,7 +12,6 @@ |
|
|
class="div_form" |
|
|
class="div_form" |
|
|
> |
|
|
> |
|
|
<!-- 需求类别 --> |
|
|
<!-- 需求类别 --> |
|
|
|
|
|
|
|
|
<el-form-item label="需求类型" prop="categoryCode" label-width="150px"> |
|
|
<el-form-item label="需求类型" prop="categoryCode" label-width="150px"> |
|
|
<el-cascader |
|
|
<el-cascader |
|
|
v-model="formData.categoryCode" |
|
|
v-model="formData.categoryCode" |
|
@ -20,7 +19,7 @@ |
|
|
:props="{label: 'categoryName',value: 'categoryCode',children: 'childCateList'}" |
|
|
:props="{label: 'categoryName',value: 'categoryCode',children: 'childCateList'}" |
|
|
clearable |
|
|
clearable |
|
|
size="small" |
|
|
size="small" |
|
|
ref="categoryCode" |
|
|
ref="myCategoryCode" |
|
|
class="u-item-width-normal" |
|
|
class="u-item-width-normal" |
|
|
@change="handelChangeCategoryCode" |
|
|
@change="handelChangeCategoryCode" |
|
|
></el-cascader> |
|
|
></el-cascader> |
|
@ -364,6 +363,15 @@ export default { |
|
|
policyList: [], |
|
|
policyList: [], |
|
|
|
|
|
|
|
|
showLabelForm: false, |
|
|
showLabelForm: false, |
|
|
|
|
|
codeFilters: { |
|
|
|
|
|
'1038': ['party_unit', 'community_org'], |
|
|
|
|
|
'1039': ['party_unit', 'community_org'], |
|
|
|
|
|
'1040': ['party_unit', 'community_org'], |
|
|
|
|
|
'1041': ['party_unit', 'community_org', 'publicWelfare'], |
|
|
|
|
|
'1042': ['party_unit', 'community_org', 'publicWelfare'], |
|
|
|
|
|
'1043': ['party_unit', 'community_org', 'publicWelfare'], |
|
|
|
|
|
'1044': ['party_unit', 'community_org'], |
|
|
|
|
|
}, |
|
|
}; |
|
|
}; |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
@ -386,7 +394,6 @@ export default { |
|
|
created() {}, |
|
|
created() {}, |
|
|
async mounted() { |
|
|
async mounted() { |
|
|
this.startLoading(); |
|
|
this.startLoading(); |
|
|
// this.getCategrayList(); |
|
|
|
|
|
await this.getPolicyList(); |
|
|
await this.getPolicyList(); |
|
|
await this.loadScopeTree(); |
|
|
await this.loadScopeTree(); |
|
|
await this.getDictOptions(); |
|
|
await this.getDictOptions(); |
|
@ -396,17 +403,17 @@ export default { |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
methods: { |
|
|
methods: { |
|
|
async initForm(type, row) { |
|
|
initForm(type, row) { |
|
|
this.formType = type; |
|
|
this.formType = type; |
|
|
this.scopeId = row.id; |
|
|
this.scopeId = row.id; |
|
|
await this.getDetail(row.id); |
|
|
this.$nextTick(()=>{ |
|
|
|
|
|
this.getDetail(row.id); |
|
|
|
|
|
}) |
|
|
}, |
|
|
}, |
|
|
async getDetail(id) { |
|
|
async getDetail(id) { |
|
|
const url = `/governance/commonDemand/detail/${id}`; |
|
|
const url = `/governance/commonDemand/detail/${id}`; |
|
|
const { data, code, msg } = await requestGet(url); |
|
|
const { data, code, msg } = await requestGet(url); |
|
|
|
|
|
|
|
|
if (code === 0) { |
|
|
if (code === 0) { |
|
|
this.formData.serviceTypeLevel1Id = data.servicePid; |
|
|
|
|
|
this.formData.commonServiceTypeId = data.commonServiceTypeId; |
|
|
this.formData.commonServiceTypeId = data.commonServiceTypeId; |
|
|
this.formData.title = data.title; |
|
|
this.formData.title = data.title; |
|
|
this.formData.content = data.content; |
|
|
this.formData.content = data.content; |
|
@ -417,6 +424,7 @@ export default { |
|
|
} else { |
|
|
} else { |
|
|
this.formData.categoryCode = [data.parentCategoryCode]; |
|
|
this.formData.categoryCode = [data.parentCategoryCode]; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (data.assignInfo) { |
|
|
if (data.assignInfo) { |
|
|
this.newFormData.serviceTimeStart = data.assignInfo.serviceTimeStart; |
|
|
this.newFormData.serviceTimeStart = data.assignInfo.serviceTimeStart; |
|
|
this.newFormData.serviceTimeEnd = data.assignInfo.serviceTimeEnd; |
|
|
this.newFormData.serviceTimeEnd = data.assignInfo.serviceTimeEnd; |
|
@ -487,19 +495,14 @@ export default { |
|
|
}, |
|
|
}, |
|
|
handelChangeCategoryCode() { |
|
|
handelChangeCategoryCode() { |
|
|
this.serviceOptions = [...this.originalServiceOptions]; |
|
|
this.serviceOptions = [...this.originalServiceOptions]; |
|
|
const parentMappings = { |
|
|
const codeFilters = this.codeFilters; |
|
|
'公益事业类': ['party_unit', 'community_org'], |
|
|
console.log(this.serviceOptions); |
|
|
'技能培训类': ['party_unit', 'publicWelfare', 'community_org'], |
|
|
const checkedCode = this.$refs['myCategoryCode'].getCheckedNodes()[0].parent.value; |
|
|
'教育讲座类': ['party_unit', 'community_org'], |
|
|
console.log(checkedCode); |
|
|
'社会治理类': ['party_unit', 'community_org'], |
|
|
if (codeFilters[checkedCode] && Array.isArray(codeFilters[checkedCode])) { |
|
|
'公共服务类': ['party_unit', 'community_org', 'publicWelfare'], |
|
|
this.serviceOptions = this.serviceOptions.filter(item => codeFilters[checkedCode].includes(item.value)); |
|
|
'岗位提供类': ['party_unit', 'community_org'], |
|
|
|
|
|
}; |
|
|
|
|
|
const checkedParent = this.$refs['categoryCode'].getCheckedNodes()[0].parent.label; |
|
|
|
|
|
if (parentMappings[checkedParent] && Array.isArray(parentMappings[checkedParent])) { |
|
|
|
|
|
this.serviceOptions = this.serviceOptions.filter(item => parentMappings[checkedParent].includes(item.value)); |
|
|
|
|
|
} else { |
|
|
} else { |
|
|
this.serviceOptions = this.originalServiceOptions |
|
|
this.serviceOptions = this.originalServiceOptions; |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
async iniDefaultData() { |
|
|
async iniDefaultData() { |
|
@ -542,9 +545,24 @@ export default { |
|
|
.then(({ data: res }) => { |
|
|
.then(({ data: res }) => { |
|
|
if (res.code !== 0) { |
|
|
if (res.code !== 0) { |
|
|
return this.$message.error(res.msg); |
|
|
return this.$message.error(res.msg); |
|
|
|
|
|
} else { |
|
|
|
|
|
this.originalServiceOptions = [...res.data]; |
|
|
|
|
|
console.log(this.originalServiceOptions); |
|
|
|
|
|
if (this.formType == 'edit') { |
|
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
|
const code = this.$refs['myCategoryCode'].checkedValue[0]; |
|
|
|
|
|
const filterOptions = (filterCodes) => { |
|
|
|
|
|
this.serviceOptions = res.data.filter(item => filterCodes.includes(item.value)); |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
if (code && this.codeFilters[code]) { |
|
|
|
|
|
filterOptions(this.codeFilters[code]); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
}else{ |
|
|
}else{ |
|
|
this.serviceOptions = res.data; |
|
|
this.serviceOptions = res.data; |
|
|
this.originalServiceOptions = [...this.serviceOptions]; |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
.catch(() => { |
|
|
.catch(() => { |
|
@ -810,6 +828,7 @@ export default { |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
|
|
|
computed:{} |
|
|
}; |
|
|
}; |
|
|
</script> |
|
|
</script> |
|
|
|
|
|
|
|
|