需求类别:
- {{ ServiceTypeName || "--" }}
+ {{ formData.allCategoryName || "--" }}
-
{
- if (res.code !== 0) {
- return this.$message.error(res.msg);
- } else {
- this.serviceTypesLevel2 = res.data;
- }
- })
- .catch(() => {
- return this.$message.error("网络错误");
- })
+ .post("/actual/base/serviceitem/listAllCategory")
+ .then(({ data: res }) => {
+ if (res.code !== 0) {
+ return this.$message.error(res.msg);
+ } else {
+ this.searchdemandOptions = this.getTreeData(res.data);
+ }
+ })
+ .catch(() => {
+ return this.$message.error("网络错误");
+ });
+ },
+ 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;
},
handleSearch (val) {
@@ -555,21 +525,11 @@ export default {
} else {
this.$message.error(msg)
}
-
- this.$http
- .get("/governance/commonServiceType/selectList/0")
- .then(({ data: res }) => {
- if (res.code !== 0) {
- return this.$message.error(res.msg);
- } else {
- this.serviceTypesLevel1 = res.data;
- }
- })
- .catch(() => {
- return this.$message.error("网络错误");
- });
},
-
+ handleCateCHange(val) {
+ this.formData.parentCategoryCode = val[0];
+ this.formData.categoryCode = val[1];
+ },
handleServiceChange (type, val) {
this.formData.serviceOrgId = ''
if (val === "social_org") {
@@ -799,8 +759,7 @@ export default {
resetSearch () {
this.formData = {
- serviceTypeLevel1Id:'',// 公共服务(政策级别)一级分类id
- serviceTypeLevel2Id:'',// 公共服务(政策级别)二级分类id
+ categoryCode:'',
serviceName: '',//项目名称
serviceOrgType: '',//服务组织类型
serviceOrgId: '',//服务组织Id
diff --git a/src/views/modules/communityService/measure/index.vue b/src/views/modules/communityService/measure/index.vue
index 142946e59..b2190c3e6 100644
--- a/src/views/modules/communityService/measure/index.vue
+++ b/src/views/modules/communityService/measure/index.vue
@@ -35,7 +35,7 @@
class="u-item-width-daterange2"
size="small"
:options="searchdemandOptions"
- :props="{ checkStrictly: true }"
+ :props="{ checkStrictly: true,label: 'categoryName',value: 'categoryCode',children: 'childCateList'}"
clearable
@change="handleCateCHange"
>
@@ -341,7 +341,7 @@
-
+
{
- if (item.value == val[0]) this.form.parentCode = item.pvalue;
- });
- this.form.categoryCode = val[0];
+ this.form.parentCode = val[0];
+ this.form.categoryCode = '';
} else {
this.form.parentCode = val[0];
this.form.categoryCode = val[1];
@@ -1197,16 +1196,8 @@ export default {
async editCate() {
const categoryCode = this.form.categoryCode;
if (Array.isArray(categoryCode)) {
- if (categoryCode.length === 1) {
- this.demandOptions.forEach((item) => {
- if (item.value == categoryCode[0])
- this.form.parentCode = item.pvalue;
- });
- this.form.categoryCode = categoryCode[0];
- } else {
this.form.parentCode = categoryCode[0];
- this.form.categoryCode = categoryCode[1];
- }
+ this.form.categoryCode = categoryCode[1]? categoryCode[1]:'';
}
const _form = {
@@ -1267,10 +1258,10 @@ export default {
if (!Array.isArray(data)) return [];
let arr = data.map((item) => {
let _item = {};
- if (item.children) {
- if (item.children.length === 0)
- _item = { ...item, children: undefined };
- else _item = { ...item, children: this.getTreeData(item.children) };
+ if (item.childCateList) {
+ if (item.childCateList.length === 0)
+ _item = { ...item, childCateList: undefined };
+ else _item = { ...item, childCateList: this.getTreeData(item.childCateList) };
} else {
_item = { ...item };
}
@@ -1282,8 +1273,8 @@ export default {
if (!Array.isArray(data)) return [];
let arr1 = data.filter((item) => item[flag]);
let arr2 = arr1.map((item) => {
- if (item.children)
- return { ...item, children: this.getFlagData(item.children, flag) };
+ if (item.childCateList)
+ return { ...item, childCateList: this.getFlagData(item.childCateList, flag) };
else return item;
});
// console.log('arrr-oppp', arr2)
@@ -1337,7 +1328,7 @@ export default {
async getDemandOptions() {
this.$http
- .post("/governance/icresidemanddict/demandoption")
+ .post("/actual/base/serviceitem/listAllCategory")
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg);
diff --git a/src/views/modules/communityService/policy/addPolicy.vue b/src/views/modules/communityService/policy/addPolicy.vue
index 0bd011feb..7a9dac658 100644
--- a/src/views/modules/communityService/policy/addPolicy.vue
+++ b/src/views/modules/communityService/policy/addPolicy.vue
@@ -10,45 +10,16 @@
class="div_form"
>
-
-
-
-
-
- -
-
+
-
-
-
-
-
+ size="small"
+ class="u-item-width-normal"
+ >
+
{
- if (res.code !== 0) {
- return this.$message.error(res.msg);
- } else {
- this.serviceTypesLevel1 = res.data;
- }
- })
- .catch(() => {
- return this.$message.error("网络错误");
- });
+
},
// 获取服务范围树
@@ -687,22 +639,6 @@ export default {
);
},
- // handleCateSlect(val) {
- // console.log("val", val);
- // let arr = [];
- // val.forEach((item) => {
- // let obj = {
- // codePath: item.join(","),
- // categoryCode: item[item.length - 1],
- // };
-
- // arr.push(obj);
- // });
-
- // console.log("arr", arr);
- // this.formData.categoryList = arr;
- // },
-
async handleAdd() {
// var oDate1 = new Date(this.formData.startDate);
// var oDate2 = new Date(this.formData.endDate);
@@ -814,7 +750,7 @@ export default {
url = "/governance/policy/updatePolicy";
this.formData.policyId = this.policyId;
}
- //为什么不能传null还要返回null呢?
+
if (this.formType == "copy" && this.formData.assignFlag == 0) {
this.formData.assignInfo = {
noticeApproches: [],
@@ -828,10 +764,19 @@ export default {
}
// const url = 'http://yapi.elinkservice.cn/mock/245/heart/icServiceProject/service/initiate'
let params = {
- ...this.formData,
+ categoryCode:this.formData.categoryCode[1]?this.formData.categoryCode[1]:'',
+ parentCategoryCode:this.formData.categoryCode[0],
+ policyLevel:this.formData.policyLevel,
+ startDate:this.formData.startDate,
+ endDate:this.formData.endDate,
+ title:this.formData.title,
+ content:this.formData.content,
+ attachmentList:this.formData.attachmentList,
+ assignFlag:this.formData.assignFlag,
+ assignInfo:this.formData.assignInfo,
+ resiSearchTagId:this.formData.resiSearchTagId,
+ policyId:this.formData.policyId
};
- delete params.policyCategoryL1;
- delete params.resiSearchTagName;
console.log(params);
const { data, code, msg } = await requestPost(url, params);
@@ -844,7 +789,35 @@ export default {
this.$message.error(msg);
}
},
-
+ 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.children)
+ return { ...item, children: this.getFlagData(item.children, flag) };
+ else return item;
+ });
+ // console.log('arrr-oppp', arr2)
+ return arr2;
+ },
+
getTreeData(data) {
if (!Array.isArray(data)) return [];
let arr = data.map((item) => {
@@ -964,14 +937,18 @@ export default {
resetData() {
this.formData = {
- serviceTypeLevel1Id: "",
- serviceTypeLevel2Id: "",
+ categoryCode: [],
+ parentCategoryCode: "",
policyLevel: "", //政府级别
startDate: "", //起始时间yyyy-MM-dd
endDate: "", //截止时间yyyy-MM-dd
title: "", //
content: "", //
attachmentList: [],
+ resiSearchTagName: "", //符合政策人员标签
+ assignFlag: 0, //是否指派服务
+ resiSearchTagId: "", //符合政策人员id
+ assignInfo: {},
};
},
// 开启加载动画
@@ -991,32 +968,12 @@ export default {
},
// 服务类型下拉框选中事件
- handleChangeServiceTypeLevel1() {
- this.formData.policyCategoryL2 = "";
- this.getCommonServiceTypeSelectList()
- },
- getCommonServiceTypeSelectList(){
- this.$http
- .get(
- "/governance/commonServiceType/selectList/" +
- this.formData.policyCategoryL1
- )
- .then(({ data: res }) => {
- if (res.code !== 0) {
- return this.$message.error(res.msg);
- } else {
- this.serviceTypesLevel2 = res.data;
- }
- })
- .catch(() => {
- return this.$message.error("网络错误");
- });
- },
+
},
computed: {
dataRule() {
return {
- policyCategoryL2: [
+ categoryCode: [
{ required: true, message: "政策类型不能为空", trigger: "blur" },
],
policyLevel: [
diff --git a/src/views/modules/communityService/wennuanzhaoren/addForm.vue b/src/views/modules/communityService/wennuanzhaoren/addForm.vue
index 9c90d611a..7df70934c 100644
--- a/src/views/modules/communityService/wennuanzhaoren/addForm.vue
+++ b/src/views/modules/communityService/wennuanzhaoren/addForm.vue
@@ -12,44 +12,16 @@
:rules="dataRule"
class="div_form"
>
-
-
- -
-
-
+ size="small"
+ class="u-item-width-normal"
+ >
+
+
@@ -249,7 +257,6 @@ export default {
gridList: [], //所属网格list--场所区域
placeTypeList: [], //场所类型
list: {},
- serviceList: [],
formData: {
organizationName: '',
categoryCode: '',
@@ -265,6 +272,7 @@ export default {
latitude: '',
organizationPersonnel: []
},
+ demandOptions:[],
dataRule: {
organizationName: [
{ required: true, message: '组织名称 不能为空', trigger: 'blur' },
@@ -302,7 +310,9 @@ export default {
this.startLoading();
this.getVolunteerList();
this.loadplaceType();
- this.loadserviceList();
+ this.getDemandOptions()
+
+ // this.loadserviceList();
// this.loadGrid();
// this.loadplaceType();
if (this.pageType != 'add') {
@@ -315,17 +325,60 @@ export default {
},
methods: {
- async loadserviceList() {
- const url = '/actual/base/serviceitem/dict-list';
- const params = {
- type: 'usable'
- };
- const { data, code, msg } = await requestPost(url, params);
- if (code === 0) {
- this.serviceList = data;
- } else {
- this.$message.error(msg);
- }
+ // async loadserviceList() {
+ // const url = '/actual/base/serviceitem/dict-list';
+ // const params = {
+ // type: 'usable'
+ // };
+ // const { data, code, msg } = await requestPost(url, params);
+ // if (code === 0) {
+ // this.serviceList = data;
+ // } else {
+ // this.$message.error(msg);
+ // }
+ // },
+ 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;
},
querySearchVolunteer(queryString, cb) {
const { volunteerList } = this;
diff --git a/src/views/modules/workSys/serviceMatters.vue b/src/views/modules/workSys/serviceMatters.vue
index 171c47d62..df9b3800b 100644
--- a/src/views/modules/workSys/serviceMatters.vue
+++ b/src/views/modules/workSys/serviceMatters.vue
@@ -2,41 +2,38 @@
-
新增
-
-
-
-
-
-
+ 新增
+
+
+
+ {{ scope.row.index }}
+
+
- 禁用
- 启用
+ {{ handleFilterSpan(scope.row, item) }}
-
+
禁用
启用
- 修改
- 删除
+
+ 修改
-
+
-
+
@@ -69,11 +66,37 @@ export default {
detailData: {},
multipleSelection: [],
rowObj: {},
- importLoading: false
+ importLoading: false,
+ tableHeader: [
+ {
+ label: '分类名称',
+ align: 'left',
+ columnName: 'categoryName'
+ }, {
+ label: '状态',
+ columnName: 'usableFlag',
+ align: 'center',
+ options: [{
+ value: true,
+ label: '启用'
+ }, {
+ value: false,
+ label: '禁用'
+ }]
+ }
+ ],
+
+ tableLoading: false,
};
},
components: { addForm },
- created() {},
+
+ created() {
+ this.user = this.$store.state.user;
+ this.agencyId = this.user.agencyId;
+ this.customerId = this.user.customerId;
+ this.getTableData();
+ },
computed: {
maxTableHeight() {
return this.$store.state.inIframe ? this.clientHeight - 410 + this.iframeHeigh : this.clientHeight - 410;
@@ -82,11 +105,7 @@ export default {
},
watch: {},
mounted() {
- this.user = this.$store.state.user;
- this.agencyId = this.user.agencyId;
- this.customerId = this.user.customerId;
- console.log('this.customerId ', this.customerId);
- this.getTableData();
+
},
methods: {
async handleDel(rowData) {
@@ -99,7 +118,7 @@ export default {
.then(() => {
this.del(rowData.categoryId);
})
- .catch(err => {});
+ .catch(err => { });
},
async del(id) {
const url = `/actual/base/serviceitem/delete/${id}`;
@@ -151,9 +170,20 @@ export default {
this.detailId = '';
this.getTableData();
},
+ handleFilterSpan(row, item) {
+ let _val = ''
+ if (item.options && item.options.length > 0) {
+ item.options.forEach((n) => {
+ if (n.value === row[item.columnName]) _val = n.label
+ })
+ }
+ return _val || row[item.columnName]
+ },
async getTableData() {
- const url = '/actual/base/serviceitem/list';
+ this.tableLoading = true
+
+ const url = '/actual/base/serviceitem/listAllCategory';
// const url = 'http://yapi.elinkservice.cn/mock/330/actual/base/enterprise/list';
const { pageSize, pageNo, customerId } = this;
const { data, code, msg } = await requestPost(url, {
@@ -163,14 +193,28 @@ export default {
});
if (code === 0) {
this.total = data.total || 0;
- this.tableData = data.list
- ? data.list.map(item => {
- return item;
- })
+ this.tableData = data
+ ? data.map((item, index) => {
+ return {
+ ...item,
+ index: index + 1,
+ hasBtn: true,
+ children: item.childCateList.map(n => {
+ return {
+ ...n,
+ hasBtn: true
+ }
+ })
+ }
+ })
: [];
+
+ console.log(this.tableData);
} else {
this.$message.error(msg);
}
+ this.tableLoading = false
+
},
handleSizeChange(val) {
this.pageSize = val;
@@ -194,6 +238,7 @@ export default {