From bb3b375a462dd37f74f39c4d6a4304ec25b4c5df Mon Sep 17 00:00:00 2001 From: mk <2403457699@qq.com> Date: Fri, 22 Sep 2023 19:55:07 +0800 Subject: [PATCH] =?UTF-8?q?#bug586=E5=B1=85=E6=B0=91=E5=88=86=E7=B1=BB?= =?UTF-8?q?=E7=BC=BA=E5=B0=91=E7=BB=84=E7=BB=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../subsistenceAllowance/addForm.vue | 113 ++++++++++++++---- .../subsistenceAllowance.vue | 9 +- .../unemployment/addForm.vue | 87 ++++++++++++++ .../unemployment/unemployment.vue | 9 +- .../residentManagement/veteran/addForm.vue | 86 +++++++++++++ .../residentManagement/veteran/veteran.vue | 10 +- .../residentManagement/volunteer/addForm.vue | 88 ++++++++++++++ .../volunteer/volunteer.vue | 9 +- 8 files changed, 387 insertions(+), 24 deletions(-) diff --git a/src/views/modules/base/residentManagement/subsistenceAllowance/addForm.vue b/src/views/modules/base/residentManagement/subsistenceAllowance/addForm.vue index 1cc1e6cd2..49333c546 100644 --- a/src/views/modules/base/residentManagement/subsistenceAllowance/addForm.vue +++ b/src/views/modules/base/residentManagement/subsistenceAllowance/addForm.vue @@ -12,24 +12,30 @@ class="div_form" > - -
- 所属组织: - {{ formData.agencyName || "--" }} -
- - - + +
+ 所属组织: + {{ formData.agencyName || "--" }} +
+ + + + {{ formData.agencyName || "--" }} + -
+
+
@@ -365,6 +371,10 @@ type: String, default: "manage", }, + formType:{ + type:Object, + default:"add" + } }, data() { @@ -378,6 +388,9 @@ return { formType:'', btnDisable: false, + selGridId: [], + optionsA: [], + formData: { name: "", idType: null, @@ -410,6 +423,8 @@ idType: [ { required: true, message: "证件类型不能为空", trigger: "bulr" }, ], + agencyId: [{ required: true, message: "所属组织不能为空", trigger: "bulr" }], + }, scopeId: "", @@ -426,9 +441,11 @@ watch: {}, components: {}, - created() { - this.getDicts(); - this.getOrgTreeList() + async created() { + await this.getDicts(); + // this.getOrgTreeList() + await this.getGridList() + }, async mounted() { this.startLoading(); @@ -535,6 +552,59 @@ return this.$message.error('网络错误') }) }, + handleChangeAngency (val) { + +let obj = this.$refs["ref_cascader_agency"].getCheckedNodes()[0].data; +console.log('改变组织', obj) +if (obj) { + if (obj.level !== 'community') { + this.$message.info('请选择社区') + this.formData.agencyId = '' + this.selGridId = [] + return false + } else { + this.formData.agencyId = val + } +} +}, +getGridList () { +const { user } = this.$store.state +this.dataListLoading = true +const params = { + agencyId: user.agencyId, + client: 'gov' +} +this.$http + // .post('/gov/org/userhouse/service/serviceScopeTree') + // .post('/data/aggregator/org/agencytree', params) + .post('/gov/org/customeragency/staffinagencylist') + .then(({ data: res }) => { + if (res.code !== 0) { + return this.$message.error(res.msg) + } else { + + let { agencyList, subAgencyList } = res.data + + const _arr = [{ ...agencyList, subAgencyList: [...subAgencyList] }] + this.optionsA = this.deepTree(_arr) + } + }) + .catch(() => { + this.dataListLoading = false + return this.$message.error('网络错误') + }) +this.dataListLoading = false +}, +deepTree (arr) { +if (Array.isArray(arr)) { + return arr.map(item => { + return { + ...item, + subAgencyList: item.subAgencyList.length > 0 && this.deepTree(item.subAgencyList) || null + } + }) +} +}, findPathInOptions(agencyId, options) { console.log(agencyId,options); for (let i = 0; i < options.length; i++) { @@ -611,6 +681,9 @@ padding-right: 10px; } } + .width-two { + width: 553px; +} diff --git a/src/views/modules/base/residentManagement/subsistenceAllowance/subsistenceAllowance.vue b/src/views/modules/base/residentManagement/subsistenceAllowance/subsistenceAllowance.vue index d08622c88..2a715c67f 100644 --- a/src/views/modules/base/residentManagement/subsistenceAllowance/subsistenceAllowance.vue +++ b/src/views/modules/base/residentManagement/subsistenceAllowance/subsistenceAllowance.vue @@ -215,7 +215,14 @@ :show-overflow-tooltip="true" > - + + + + +
+ 所属组织: + {{ formData.agencyName || "--" }} +
+ + + + {{ formData.agencyName || "--" }} + + +
+ +
@@ -515,6 +541,8 @@ export default { data() { return { btnDisable: false, + selGridId: [], + optionsA: [], genderList, binaryOptionList, @@ -545,6 +573,7 @@ export default { employmentWish: "", specialSkill: "", remark: "", + agencyId:"" }, dataRule: { @@ -554,6 +583,7 @@ export default { idType: [ { required: true, message: "证件类型不能为空", trigger: "bulr" }, ], + agencyId: [{ required: true, message: "所属组织不能为空", trigger: "bulr" }], }, scopeId: "", @@ -574,6 +604,7 @@ export default { components: {}, async created() { await this.getDicts(); + await this.getGridList() }, async mounted() { this.startLoading(); @@ -690,6 +721,59 @@ export default { loading.close(); } }, + handleChangeAngency (val) { + +let obj = this.$refs["ref_cascader_agency"].getCheckedNodes()[0].data; +console.log('改变组织', obj) +if (obj) { + if (obj.level !== 'community') { + this.$message.info('请选择社区') + this.formData.agencyId = '' + this.selGridId = [] + return false + } else { + this.formData.agencyId = val + } +} +}, +getGridList () { +const { user } = this.$store.state +this.dataListLoading = true +const params = { + agencyId: user.agencyId, + client: 'gov' +} +this.$http + // .post('/gov/org/userhouse/service/serviceScopeTree') + // .post('/data/aggregator/org/agencytree', params) + .post('/gov/org/customeragency/staffinagencylist') + .then(({ data: res }) => { + if (res.code !== 0) { + return this.$message.error(res.msg) + } else { + + let { agencyList, subAgencyList } = res.data + + const _arr = [{ ...agencyList, subAgencyList: [...subAgencyList] }] + this.optionsA = this.deepTree(_arr) + } + }) + .catch(() => { + this.dataListLoading = false + return this.$message.error('网络错误') + }) +this.dataListLoading = false +}, +deepTree (arr) { +if (Array.isArray(arr)) { + return arr.map(item => { + return { + ...item, + subAgencyList: item.subAgencyList.length > 0 && this.deepTree(item.subAgencyList) || null + } + }) +} +}, }, }; @@ -726,4 +810,7 @@ export default { padding-right: 10px; } } +.width-two { + width: 553px; +} \ No newline at end of file diff --git a/src/views/modules/base/residentManagement/unemployment/unemployment.vue b/src/views/modules/base/residentManagement/unemployment/unemployment.vue index ba6be6a4b..853a097f2 100644 --- a/src/views/modules/base/residentManagement/unemployment/unemployment.vue +++ b/src/views/modules/base/residentManagement/unemployment/unemployment.vue @@ -349,7 +349,14 @@ :show-overflow-tooltip="true" > - + + + + +
+ 所属组织: + {{ formData.agencyName || "--" }} +
+ + + + {{ formData.agencyName || "--" }} + + +
+ +
@@ -589,6 +615,8 @@ export default { }; return { btnDisable: false, + selGridId: [], + optionsA: [], formData: { name: "", @@ -616,6 +644,7 @@ export default { pubWelfareJobFlag: null, workUnit: "", remark: "", + agencyId:"" }, endPickerOptionsJoinWar: { disabledDate: (time) => endDisabledDate(time, "joinWarStartTime"), @@ -633,6 +662,7 @@ export default { idType: [ { required: true, message: "证件类型不能为空", trigger: "bulr" }, ], + agencyId: [{ required: true, message: "所属组织不能为空", trigger: "bulr" }], }, scopeId: "", @@ -650,6 +680,7 @@ export default { components: {}, async created() { await this.getDicts(); + await this.getGridList() }, async mounted() { this.startLoading(); @@ -757,7 +788,59 @@ export default { this.resetData(); this.$emit("handleClose"); }, + handleChangeAngency (val) { + let obj = this.$refs["ref_cascader_agency"].getCheckedNodes()[0].data; + console.log('改变组织', obj) + if (obj) { + if (obj.level !== 'community') { + this.$message.info('请选择社区') + this.formData.agencyId = '' + this.selGridId = [] + return false + } else { + this.formData.agencyId = val + } + } + }, + getGridList () { + const { user } = this.$store.state + this.dataListLoading = true + const params = { + agencyId: user.agencyId, + client: 'gov' + } + this.$http + // .post('/gov/org/userhouse/service/serviceScopeTree') + // .post('/data/aggregator/org/agencytree', params) + .post('/gov/org/customeragency/staffinagencylist') + .then(({ data: res }) => { + if (res.code !== 0) { + return this.$message.error(res.msg) + } else { + + let { agencyList, subAgencyList } = res.data + + const _arr = [{ ...agencyList, subAgencyList: [...subAgencyList] }] + this.optionsA = this.deepTree(_arr) + } + }) + .catch(() => { + this.dataListLoading = false + return this.$message.error('网络错误') + }) + this.dataListLoading = false + }, + deepTree (arr) { + if (Array.isArray(arr)) { + return arr.map(item => { + return { + ...item, + subAgencyList: item.subAgencyList.length > 0 && this.deepTree(item.subAgencyList) || null + } + }) + } + }, resetData() { this.formData = {}; }, @@ -811,6 +894,9 @@ export default { padding-right: 10px; } } +.width-two { + width: 553px; +} diff --git a/src/views/modules/base/residentManagement/veteran/veteran.vue b/src/views/modules/base/residentManagement/veteran/veteran.vue index 33108dc72..473f04591 100644 --- a/src/views/modules/base/residentManagement/veteran/veteran.vue +++ b/src/views/modules/base/residentManagement/veteran/veteran.vue @@ -377,7 +377,15 @@ :show-overflow-tooltip="true" > - + + + + + + +
+ 所属组织: + {{ formData.agencyName || "--" }} +
+ + + + {{ formData.agencyName || "--" }} + + +
+ +
@@ -373,6 +400,8 @@ export default { data() { return { btnDisable: false, + selGridId: [], + optionsA: [], formData: { name: "", @@ -390,6 +419,7 @@ export default { occupation: "", hobbyCodes: [], remark: "", + agencyId:"" }, genderList, binaryOptionList, @@ -400,6 +430,7 @@ export default { idType: [ { required: true, message: "证件类型不能为空", trigger: "bulr" }, ], + agencyId: [{ required: true, message: "所属组织不能为空", trigger: "bulr" }], }, scopeId: "", dicts: { @@ -417,6 +448,7 @@ export default { components: {}, async created() { await this.getDicts(); + await this.getGridList() }, async mounted() { this.startLoading(); @@ -523,6 +555,59 @@ export default { loading.close(); } }, + handleChangeAngency (val) { + +let obj = this.$refs["ref_cascader_agency"].getCheckedNodes()[0].data; +console.log('改变组织', obj) +if (obj) { + if (obj.level !== 'community') { + this.$message.info('请选择社区') + this.formData.agencyId = '' + this.selGridId = [] + return false + } else { + this.formData.agencyId = val + } +} +}, +getGridList () { +const { user } = this.$store.state +this.dataListLoading = true +const params = { + agencyId: user.agencyId, + client: 'gov' +} +this.$http + // .post('/gov/org/userhouse/service/serviceScopeTree') + // .post('/data/aggregator/org/agencytree', params) + .post('/gov/org/customeragency/staffinagencylist') + .then(({ data: res }) => { + if (res.code !== 0) { + return this.$message.error(res.msg) + } else { + + let { agencyList, subAgencyList } = res.data + + const _arr = [{ ...agencyList, subAgencyList: [...subAgencyList] }] + this.optionsA = this.deepTree(_arr) + } + }) + .catch(() => { + this.dataListLoading = false + return this.$message.error('网络错误') + }) +this.dataListLoading = false +}, +deepTree (arr) { +if (Array.isArray(arr)) { + return arr.map(item => { + return { + ...item, + subAgencyList: item.subAgencyList.length > 0 && this.deepTree(item.subAgencyList) || null + } + }) +} +}, }, }; @@ -559,6 +644,9 @@ export default { padding-right: 10px; } } +.width-two { + width: 553px; +} diff --git a/src/views/modules/base/residentManagement/volunteer/volunteer.vue b/src/views/modules/base/residentManagement/volunteer/volunteer.vue index c8d4834b1..1d52b01c6 100644 --- a/src/views/modules/base/residentManagement/volunteer/volunteer.vue +++ b/src/views/modules/base/residentManagement/volunteer/volunteer.vue @@ -288,7 +288,14 @@ :show-overflow-tooltip="true" > - + +