diff --git a/src/utils/cascader.js b/src/utils/cascader.js index 3ab33ae..8d7adbd 100644 --- a/src/utils/cascader.js +++ b/src/utils/cascader.js @@ -1,36 +1,41 @@ -export function getItemByIdInCascader(arr, vals, idName, childName) { - let item = arr.find((v) => v[idName] == vals[0]); - if (vals.length > 1) { - return [ - item, - ...getItemByIdInCascader( - item[childName], - vals.slice(1), - idName, - childName - ), - ]; - } else { - return [item]; - } +export function getItemByIdInCascader(arr, ids, idName, childName) { + let item = arr.find((v) => v[idName] == ids[0]); + if (ids.length > 1) { + return [ + item, + ...getItemByIdInCascader( + item[childName], + ids.slice(1), + idName, + childName + ), + ]; + } else { + return [item]; + } } export function collapse(arr, childName) { - if (arr.length > 0) { - let ret = [...arr]; - arr.forEach((element) => { - let childs = element[childName]; - if (childs && Array.isArray(childs)) { - ret.push(...collapse(childs, childName)); - } - }); - return ret; - } else { - return []; - } + if (arr.length > 0) { + let ret = [...arr]; + arr.forEach((element) => { + let childs = element[childName]; + if (childs && Array.isArray(childs)) { + ret.push(...collapse(childs, childName)); + } + }); + return ret; + } else { + return []; + } +} + +export function getItemBySingleIdInCascader(arr, id, idName, childName) { + let collapseArr = collapse(arr); + return getItemByIdInCascader(collapseArr, [id], idName, childName); } export default { - getItemByIdInCascader, - collapse, + getItemByIdInCascader, + collapse, }; diff --git a/src/views/modules/lingshan/bmfw/bsdt/index.vue b/src/views/modules/lingshan/bmfw/bsdt/index.vue new file mode 100644 index 0000000..f8704f5 --- /dev/null +++ b/src/views/modules/lingshan/bmfw/bsdt/index.vue @@ -0,0 +1,391 @@ + + + + + diff --git a/src/views/modules/lingshan/bmfw/zdbf/cpts/edit.vue b/src/views/modules/lingshan/bmfw/zdbf/cpts/edit.vue index 4dbd73d..655c22a 100644 --- a/src/views/modules/lingshan/bmfw/zdbf/cpts/edit.vue +++ b/src/views/modules/lingshan/bmfw/zdbf/cpts/edit.vue @@ -388,12 +388,12 @@ @@ -465,13 +465,13 @@ @@ -493,12 +493,12 @@ @@ -561,6 +561,994 @@ + +
+

空巢老人

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+

留守儿童

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+

低保人员

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+

特困人员

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
@@ -840,6 +1828,81 @@ export default { }, ], }, + + kongchao: { + "helpCrowdDetails.kongchao.jhrxm": [ + { + required: true, + message: "空巢老人-监护人姓名不能为空", + trigger: "blur", + }, + ], + "helpCrowdDetails.kongchao.jhrdh": [ + { + required: true, + message: "空巢老人-监护人电话不能为空", + trigger: "blur", + }, + ], + }, + + liushou: { + "helpCrowdDetails.liushou.jhrxm": [ + { + required: true, + message: "留守儿童-监护人姓名不能为空", + trigger: "blur", + }, + ], + "helpCrowdDetails.liushou.jhrdh": [ + { + required: true, + message: "留守儿童-监护人电话不能为空", + trigger: "blur", + }, + ], + "helpCrowdDetails.liushou.yjhrgx": [ + { + required: true, + message: "留守儿童-与监护人关系不能为空", + trigger: "blur", + }, + ], + "helpCrowdDetails.liushou.szxxjbj": [ + { + required: true, + message: "留守儿童-所在学校及班级不能为空", + trigger: "blur", + }, + ], + }, + + dibao: { + "helpCrowdDetails.dibao.dblx": [ + { + required: true, + message: "低保人员-低保类型名不能为空", + trigger: "blur", + }, + ], + "helpCrowdDetails.dibao.dbzh": [ + { + required: true, + message: "低保人员-低保(特困)证号不能为空", + trigger: "blur", + }, + ], + }, + + tekun: { + "helpCrowdDetails.tekun.dbzh": [ + { + required: true, + message: "低保人员-低保(特困)证号不能为空", + trigger: "blur", + }, + ], + }, }; helpType.forEach((ki) => { @@ -903,7 +1966,7 @@ export default { }, async getInfo() { - const url = `/epmetuser/lingShan/crowdCrowd/getPersonSpecialTypeDetail`; + const url = `/epmetuser/lingShan/helpCrowd/getPersonHelpTypeDetail`; const { resiId } = this; const params = { resiId, @@ -973,7 +2036,7 @@ export default { }, async submit() { - let url = "/epmetuser/lingShan/crowdCrowd/save"; + let url = "/epmetuser/lingShan/helpCrowd/save"; const { resiId, fmData: { diff --git a/src/views/modules/lingshan/bmfw/zdbf/cpts/pop-import.vue b/src/views/modules/lingshan/bmfw/zdbf/cpts/pop-import.vue index a3adc27..0eb333f 100644 --- a/src/views/modules/lingshan/bmfw/zdbf/cpts/pop-import.vue +++ b/src/views/modules/lingshan/bmfw/zdbf/cpts/pop-import.vue @@ -173,7 +173,7 @@ export default { failItemsQty: 1, //失败条数 }, - crowdTypeOptions: dict.crowdType, + crowdTypeOptions: dict.typeList, fmData: { crowdType: "", file: null, @@ -191,10 +191,10 @@ export default { if (!crowdType) { return this.$message.error("请先选择导入人员类型"); } - let url = "/epmetuser/helpCrowd/import"; + let url = "/epmetuser/lingShan/helpCrowd/downloadTemplate"; let params = { - crowdType, + helpType: crowdType, }; await this.$http({ method: "GET", @@ -288,7 +288,7 @@ export default { await this.$http .post( - `/epmetuser/helpCrowd/import?crowdType=${crowdType}`, + `/epmetuser/lingShan/helpCrowd/import?crowdType=${crowdType}`, fmData ) .then((res) => {