|
|
@ -24,32 +24,16 @@ |
|
|
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item label="服务事项" |
|
|
|
label-width="150px" |
|
|
|
prop="serviceMatterList"> |
|
|
|
|
|
|
|
<el-checkbox-group class="item_width_1" |
|
|
|
style="display:flex;flex-wrap:wrap" |
|
|
|
v-model="formData.serviceMatterList"> |
|
|
|
<el-checkbox v-for="item in serviceList" |
|
|
|
:key="item.value" |
|
|
|
:label="item.value">{{item.label}}</el-checkbox> |
|
|
|
|
|
|
|
</el-checkbox-group> |
|
|
|
|
|
|
|
<!-- <el-select class="item_width_1" |
|
|
|
v-model="formData.serviceMatter" |
|
|
|
placeholder="请选择" |
|
|
|
clearable> |
|
|
|
<el-option v-for="item in serviceList" |
|
|
|
:key="item.value" |
|
|
|
:label="item.label" |
|
|
|
:value="item.value"> |
|
|
|
</el-option> |
|
|
|
</el-select> --> |
|
|
|
|
|
|
|
<el-form-item label="服务事项" prop="serviceMatterList" label-width="150px"> |
|
|
|
<el-cascader |
|
|
|
v-model="formData.serviceMatterList" |
|
|
|
:options="demandOptions" |
|
|
|
:props="{label: 'categoryName',value: 'categoryCode',children: 'childCateList'}" |
|
|
|
clearable |
|
|
|
size="small" |
|
|
|
class="u-item-width-normal" |
|
|
|
></el-cascader> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item label="单位名称" |
|
|
|
prop="unitIdList" |
|
|
|
label-width="150px" |
|
|
@ -253,7 +237,9 @@ export default { |
|
|
|
formData: initFormData(), |
|
|
|
serviceList: [], |
|
|
|
// gridList: [], |
|
|
|
agencyId: '' |
|
|
|
agencyId: '', |
|
|
|
|
|
|
|
demandOptions:[] |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
@ -271,7 +257,7 @@ export default { |
|
|
|
|
|
|
|
|
|
|
|
//获取服务事项 |
|
|
|
await this.loadService() |
|
|
|
await this.getDemandOptions() |
|
|
|
|
|
|
|
let { latitude, longitude } = this.$store.state.user; |
|
|
|
|
|
|
@ -295,6 +281,50 @@ export default { |
|
|
|
this.endLoading() |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
async getDemandOptions() { |
|
|
|
this.$http |
|
|
|
.post("/actual/base/serviceitem/listAllCategory") |
|
|
|
.then(({ data: res }) => { |
|
|
|
if (res.code !== 0) { |
|
|
|
return this.$message.error(res.msg); |
|
|
|
} else { |
|
|
|
this.demandOptions = this.getFlagData( |
|
|
|
this.getTreeData(res.data), |
|
|
|
"usableFlag" |
|
|
|
); |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch(() => { |
|
|
|
return this.$message.error("网络错误"); |
|
|
|
}); |
|
|
|
}, |
|
|
|
getFlagData(data, flag) { |
|
|
|
if (!Array.isArray(data)) return []; |
|
|
|
let arr1 = data.filter((item) => item[flag]); |
|
|
|
let arr2 = arr1.map((item) => { |
|
|
|
if (item.childCateList) |
|
|
|
return { ...item, childCateList: this.getFlagData(item.childCateList, flag) }; |
|
|
|
else return item; |
|
|
|
}); |
|
|
|
// console.log('arrr-oppp', arr2) |
|
|
|
return arr2; |
|
|
|
}, |
|
|
|
getTreeData(data) { |
|
|
|
if (!Array.isArray(data)) return []; |
|
|
|
let arr = data.map((item) => { |
|
|
|
let _item = {}; |
|
|
|
if (item.childCateList) { |
|
|
|
if (item.childCateList.length === 0) |
|
|
|
_item = { ...item, childCateList: undefined }; |
|
|
|
else _item = { ...item, childCateList: this.getTreeData(item.childCateList) }; |
|
|
|
} else { |
|
|
|
_item = { ...item }; |
|
|
|
} |
|
|
|
return _item; |
|
|
|
}); |
|
|
|
return arr; |
|
|
|
}, |
|
|
|
async loadGrid () { |
|
|
|
const url = "/gov/org/customergrid/gridoption" |
|
|
|
|
|
|
@ -313,26 +343,7 @@ export default { |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
//获取服务事项下拉框 |
|
|
|
async loadService () { |
|
|
|
const url = "/actual/base/serviceitem/dict-list" |
|
|
|
|
|
|
|
let params = { |
|
|
|
type: 'usable' |
|
|
|
// parentCategoryCode: '1010' |
|
|
|
} |
|
|
|
|
|
|
|
const { data, code, msg } = await requestPost(url, params) |
|
|
|
|
|
|
|
if (code === 0) { |
|
|
|
this.serviceList = data |
|
|
|
|
|
|
|
} else { |
|
|
|
this.$message.error(msg) |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
//加载组织 |
|
|
|
async loadFormData () { |
|
|
|
const url = '/heart/icpartyactivity/detail' |
|
|
|