diff --git a/src/views/modules/lingshan/shzl/wgy/cpts/edit.vue b/src/views/modules/lingshan/shzl/wgy/cpts/edit.vue index 2e6130b..a73c8f3 100644 --- a/src/views/modules/lingshan/shzl/wgy/cpts/edit.vue +++ b/src/views/modules/lingshan/shzl/wgy/cpts/edit.vue @@ -18,795 +18,96 @@ prop="name" label-width="120px" > - - - - - - - - - - - - - - - - - - - - - - - - {{ fmData.genderZh }} - - - {{ fmData.nation }} - - - {{ fmData.birthday }} - - - {{ fmData.domicilePlace }} - - - {{ fmData.mobile }} - - - {{ fmData.address }} - - - - -
-

安置帮教

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- -
-

戒毒人员

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- -
-

精障患者

-
- - - - - - - - - - - - - - - - - - - - - - - - + {{ fmData.name }} - - - - + {{ fmData.genderName }} - - - - + {{ fmData.gridName }} - - - - + {{ fmData.roleName }} - - - - + {{ fmData.idCard }} - - + {{ fmData.mobile }} - - + +
-
-

社区矫正

+
+

详细信息

- - - - - @@ -850,108 +131,18 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- -
-

信访人员

-
- - - - - - - - - - - @@ -1091,16 +194,13 @@ @@ -1113,61 +213,6 @@ - - - - - - - - - - - - - -
@@ -1193,88 +238,33 @@ import { Loading } from "element-ui"; // 引入Loading服务 import { requestPost, requestGet } from "@/js/dai/request"; import formVltHelper from "dai-js/tools/formVltHelper"; import nextTick from "dai-js/tools/nextTick"; -import dict from "@/views/modules/lingshan/shzl/tsrq/dict"; +import { workTypeOptions, roleOptions, genderOptions } from "../dict"; let loading; // 加载动画 function iniFmData() { return { - gender: "", - genderZh: "", - nation: null, - birthday: "", - domicilePlace: "", - mobile: "", - address: "", - name: "", - idCard: "", - specialType: [], - headPhoto: "", - specialCrowdDetails: { - anzhibangjiao: { - id: "", // 修改的时候用到,新增用不到 - originalCharge: "", // 原罪名 - releaseDate: "", // 释放日期 - originPrisonTerm: "", // 原判刑期 - recidivismFlag: "", // 是否累犯 - emplacementFlag: "", // 是否安置 - emplacementDate: "", // 安置日期 - emplacementInfo: "", //安置帮教情况 - canceledFlag: "", //是否注销 - canceledReason: "", //注销原因 - }, - jiedurenyuan: { - id: "", // 修改的时候用到,新增用不到 - criminalHistoryFlag: "", // 有无犯罪史 - drugRepetitionFlag: "", //有无复吸史 - firstDiscoveryDate: "", //初次发现日期 - controllerName: "", //管控人姓名 - controllerContact: "", //管控人联系方式 - helperName: "", //帮扶人姓名 - helperContact: "", //帮扶人联系方式 - detachedFlag: "", //是否脱管 - detachedReason: "", //脱管原因 - }, - jingzhanghuanzhe: { - id: "", // 修改的时候用到,新增用不到 - causeTroubleHistoryFlag: "", //有无肇事肇祸史 - causeTroubleTimes: "", //肇事肇祸次数 - currentDiagnosis: "", //目前诊断类型 - dangerousClass: "", //危险性评估等级 - canGoOutFlag: "", //是否具备外出能力 - violenceFlag: "", //是否有暴力倾向 - allowanceFlag: "", //是否落实监管补助 - subsistenceFlag: "", //是否纳入低保 - guardianName: "", //监护人姓名 - guardianContact: "", //监护人联系方式 - }, - shequjiaozheng: { - id: "", // 修改的时候用到,新增用不到 - rectificateType: "", //矫正类型 - rectificateStartDate: "", //矫正开始日期 - rectificateEndDate: "", //矫正结束日期 - originDetainAddress: "", //原羁押场所 - originalCharge: "", //原罪名 - receiveWay: "", //接受方式 - rectificateInfo: "", //矫正情况说明 - detachedFlag: "", //是否脱管 - detachedReason: "", //脱管原因 - canceledFlag: "", //是否注销 - canceledReason: "", //注销原因 - }, - xinfangrenyuan: { - id: "", // 修改的时候用到,新增用不到 - problem: "", //反映问题 - stableControlMeasurement: "", //稳控措施 - multipleFlag: "", //是否多次上访 - localFlag: "", //是否在当地 - branchLeader: "", //分管领导 - branchLeaderContact: "", //分管领导联系方式 - principal: "", //负责人 - principalContact: "", //负责人联系方式 - stableControlerList: "", //稳控人员名单 - }, - }, + id: "", + gridName: "", + staffId: "", //人员ID + name: "", //姓名 + mobile: "", //电话 + headPhoto: "", //头像 + activeFlag: "", + activeTime: null, + gender: 1, //性别 + enableFlag: "", + roles: [], //角色 + culture: "", //学历 + member: "", //是否两委委员 0 否 1 是 + mediator: "", //是否调解员 0 否 1 是 + idCard: "", //身份证号 + birthday: null, //生日 + customerId: null, + workType: "", // fulltime专职 parttime兼职 + address: "", //地址 + political: "", //政治面貌 + nation: "", //政治面貌 }; } @@ -1289,7 +279,13 @@ export default { btnDisable: false, - specialTypeOptions: dict.specialType, + workTypeOptions, + roleOptions, + genderOptions, + cultureOptions: [], + nationOptions: [], + politicalOptions: [], + yesOptions: [ { value: 0, @@ -1301,7 +297,7 @@ export default { }, ], - resiId: "", + staffId: "", fmData: iniFmData(), headPhotoList: [], @@ -1312,216 +308,22 @@ export default { computed: { dataRule() { let rules = { - name: [ - { - required: true, - message: "姓名不能为空", - trigger: "blur", - }, - ], - specialType: [ - { - required: true, - message: "分类名称不能为空", - trigger: "blur", - }, - ], - idCard: [ - { - required: true, - message: "身份证号不能为空", - trigger: "blur", - }, - ], - }; - - const { - fmData: { specialType }, - } = this; - const specialTypeRules = { - anzhibangjiao: { - "specialCrowdDetails.anzhibangjiao.originalCharge": [ - { - required: true, - message: "安置帮教-原罪名不能为空", - trigger: "blur", - }, - ], - "specialCrowdDetails.anzhibangjiao.releaseDate": [ - { - required: true, - message: "安置帮教-释放日期不能为空", - trigger: "blur", - }, - ], - }, - - jiedurenyuan: { - "specialCrowdDetails.jiedurenyuan.criminalHistoryFlag": [ - { - required: true, - message: "戒毒人员-有无犯罪史不能为空", - trigger: "blur", - }, - ], - "specialCrowdDetails.jiedurenyuan.drugRepetitionFlag": [ - { - required: true, - message: "戒毒人员-有无复吸史不能为空", - trigger: "blur", - }, - ], - "specialCrowdDetails.jiedurenyuan.firstDiscoveryDate": [ - { - required: true, - message: "戒毒人员-初次发现日期不能为空", - trigger: "blur", - }, - ], - }, - - jingzhanghuanzhe: { - "specialCrowdDetails.jingzhanghuanzhe.causeTroubleHistoryFlag": - [ - { - required: true, - message: "精障患者-有无肇事肇祸史不能为空", - trigger: "blur", - }, - ], - "specialCrowdDetails.jingzhanghuanzhe.causeTroubleTimes": [ - { - required: true, - message: "精障患者-肇事肇祸次数不能为空", - trigger: "blur", - }, - ], - "specialCrowdDetails.jingzhanghuanzhe.currentDiagnosis": [ - { - required: true, - message: "精障患者-目前诊断类型不能为空", - trigger: "blur", - }, - ], - "specialCrowdDetails.jingzhanghuanzhe.dangerousClass": [ - { - required: true, - message: "精障患者-危险性评估等级不能为空", - trigger: "blur", - }, - ], - "specialCrowdDetails.jingzhanghuanzhe.canGoOutFlag": [ - { - required: true, - message: "精障患者-是否具备外出能力不能为空", - trigger: "blur", - }, - ], - "specialCrowdDetails.jingzhanghuanzhe.violenceFlag": [ - { - required: true, - message: "精障患者-是否有暴力倾向不能为空", - trigger: "blur", - }, - ], - "specialCrowdDetails.jingzhanghuanzhe.allowanceFlag": [ - { - required: true, - message: "精障患者-是否落实监管补助不能为空", - trigger: "blur", - }, - ], - "specialCrowdDetails.jingzhanghuanzhe.subsistenceFlag": [ - { - required: true, - message: "精障患者-是否纳入低保不能为空", - trigger: "blur", - }, - ], - }, - - shequjiaozheng: { - "specialCrowdDetails.shequjiaozheng.rectificateType": [ - { - required: true, - message: "社区矫正-矫正类型不能为空", - trigger: "blur", - }, - ], - "specialCrowdDetails.shequjiaozheng.rectificateStartDate": [ - { - required: true, - message: "社区矫正-矫正开始日期不能为空", - trigger: "blur", - }, - ], - "specialCrowdDetails.shequjiaozheng.rectificateEndDate": [ - { - required: true, - message: "社区矫正-矫正结束日期不能为空", - trigger: "blur", - }, - ], - "specialCrowdDetails.shequjiaozheng.receiveWay": [ - { - required: true, - message: "社区矫正-接受方式不能为空", - trigger: "blur", - }, - ], - "specialCrowdDetails.shequjiaozheng.detachedFlag": [ - { - required: true, - message: "社区矫正-是否脱管不能为空", - trigger: "blur", - }, - ], - "specialCrowdDetails.shequjiaozheng.canceledFlag": [ - { - required: true, - message: "社区矫正-是否注销不能为空", - trigger: "blur", - }, - ], - }, - - xinfangrenyuan: { - "specialCrowdDetails.xinfangrenyuan.problem": [ - { - required: true, - message: "信访人员-反映问题不能为空", - trigger: "blur", - }, - ], - "specialCrowdDetails.xinfangrenyuan.stableControlMeasurement": - [ - { - required: true, - message: "信访人员-稳控措施不能为空", - trigger: "blur", - }, - ], - "specialCrowdDetails.xinfangrenyuan.multipleFlag": [ - { - required: true, - message: "信访人员-是否多次上访不能为空", - trigger: "blur", - }, - ], - "specialCrowdDetails.xinfangrenyuan.localFlag": [ - { - required: true, - message: "信访人员-是否在当地不能为空", - trigger: "blur", - }, - ], - }, + // name: [ + // { + // required: true, + // message: "姓名不能为空", + // trigger: "blur", + // }, + // ], + // idCard: [ + // { + // required: true, + // message: "身份证号不能为空", + // trigger: "blur", + // }, + // ], }; - specialType.forEach((ki) => { - rules = { ...rules, ...specialTypeRules[ki] }; - }); - return rules; }, }, @@ -1534,7 +336,9 @@ export default { }, async mounted() { - // this.getCategoryList(); + this.getCultureOptions(); + this.getNationOptions(); + this.getPoliticalOptions(); }, methods: { @@ -1553,27 +357,56 @@ export default { this.fmData.headPhoto = response.data.url; }, + getLabelByValue(value, options) { + let label = ""; + if (Array.isArray(options)) { + let selectedItem = options.find((item) => item.value == value); + if (selectedItem) { + label = selectedItem.label; + } + } + return label; + }, + async getInfo() { - const url = `/epmetuser/lingShan/specialCrowd/getPersonSpecialTypeDetail`; - const { resiId } = this; + const url = `/epmetuser/customerstaff/staffdetail`; + const { staffId } = this; const params = { - resiId, + staffId, }; - const { data, code, msg } = await requestGet(url, params); + const { data, code, msg } = await requestPost(url, params); if (code === 0) { let fmData = iniFmData(); - let specialType = Object.keys(data.specialCrowdDetails).filter( - (ki) => data.specialCrowdDetails[ki] - ); - let specialCrowdDetails = fmData.specialCrowdDetails; - specialType.forEach((ki) => { - specialCrowdDetails[ki] = data.specialCrowdDetails[ki]; - }); this.fmData = { ...fmData, ...data, - specialType, - specialCrowdDetails, + genderName: this.getLabelByValue( + data.gender, + this.genderOptions + ), + cultureName: this.getLabelByValue( + data.culture, + this.cultureOptions + ), + workTypeName: this.getLabelByValue( + data.workType, + this.workTypeOptions + ), + roleName: (data.roles || []) + .join(","), + politicalName: this.getLabelByValue( + data.political, + this.politicalOptions + ), + nationName: this.getLabelByValue( + data.nation, + this.nationOptions + ), + age: + typeof data.birthday == "string" + ? new Date().getFullYear() - + parseInt(data.birthday.substr(0, 4)) + : "--", }; if (this.fmData.headPhoto) { this.headPhotoList = [{ url: this.fmData.headPhoto }]; @@ -1583,15 +416,43 @@ export default { } }, - // 先弃用,本地写死字典 - async getCategoryList() { - const url = "/sys/dict/data/dictlist"; + // 文化程度 + async getCultureOptions() { + const url = "/sys/dict/data/education"; + let params = { + formCode: "resi_base_info", + }; + const { data, code, msg } = await requestPost(url, params); + if (code === 0) { + this.cultureOptions = data; + } else { + this.$message.error(msg); + } + }, + + // 民族 + async getNationOptions() { + const url = "/sys/dict/data/nation"; + const params = { + formCode: "resi_base_info", + }; + const { data, code, msg } = await requestPost(url, params); + if (code === 0) { + this.nationOptions = data; + } else { + this.$message.error(msg); + } + }, + + // 政治面貌 + async getPoliticalOptions() { + const url = "/sys/dict/data/dictOption/yt_politics_status"; const params = { - dictType: "self_org_category", + formCode: "resi_base_info", }; const { data, code, msg } = await requestPost(url, params); if (code === 0) { - this.specialTypeOptions = data; + this.politicalOptions = data; } else { this.$message.error(msg); } @@ -1603,7 +464,7 @@ export default { this.formType = type; if (row) { - this.resiId = row.resiId; + this.staffId = row.staffId; this.getInfo(); } }, @@ -1624,28 +485,27 @@ export default { }, async submit() { - let url = "/epmetuser/lingShan/specialCrowd/save"; - const { - resiId, - fmData: { - name, - idCard, - headPhoto, - specialCrowdDetails: allDetails, - specialType, - }, - } = this; - let specialCrowdDetails = {}; - specialType.forEach((ki) => { - specialCrowdDetails[ki] = allDetails[ki]; - }); + let url = "/epmetuser/customerstaff/update"; + const { staffId, fmData } = this; const { data, code, msg } = await requestPost(url, { - resiId, - name, - headPhoto, - idCard, - specialCrowdDetails, + staffId, + id: fmData.id, + userId: staffId, + realName: fmData.name, + mobile: fmData.mobile, + headPhoto: fmData.headPhoto, + activeFlag: fmData.activeFlag, + gender: fmData.gender, + culture: fmData.culture, + member: fmData.member, + mediator: fmData.mediator, + idCard: fmData.idCard, + birthday: fmData.birthday, + workType: fmData.workType, + address: fmData.address, + political: fmData.political, + nation: fmData.nation, }); if (code === 0) { @@ -1668,7 +528,7 @@ export default { }, resetData() { - this.resiId = ""; + this.staffId = ""; this.headPhotoList = []; this.fmData = iniFmData(); }, diff --git a/src/views/modules/lingshan/shzl/wgy/dict.js b/src/views/modules/lingshan/shzl/wgy/dict.js index bb5aad0..56be24d 100644 --- a/src/views/modules/lingshan/shzl/wgy/dict.js +++ b/src/views/modules/lingshan/shzl/wgy/dict.js @@ -1,12 +1,45 @@ +export const genderOptions = [ + { value: 1, label: "男" }, + { value: 2, label: "女" }, + { value: 0, label: "未知" }, +]; + +export const roleOptions = [ + { + value: "grid_member", + label: "网格员", + }, + { + value: "grid_manager", + label: "网格长", + }, +]; + +export const workTypeOptions = [ + { + value: "fulltime", + label: "专职", + }, + { + value: "parttime", + label: "兼职", + }, +]; + +export const memberOptions = [ + { value: 0, label: "否" }, + { value: 1, label: "是" }, +]; + +export const mediatorOptions = [ + { value: 0, label: "否" }, + { value: 1, label: "是" }, +]; + export default { - specialType: [ - { - value: "grid_member", - label: "网格员", - }, - { - value: "grid_manager", - label: "网格长", - }, - ], + roleOptions, + workTypeOptions, + genderOptions, + memberOptions, + mediatorOptions, }; diff --git a/src/views/modules/lingshan/shzl/wgy/index.vue b/src/views/modules/lingshan/shzl/wgy/index.vue index ae16c9c..161013e 100644 --- a/src/views/modules/lingshan/shzl/wgy/index.vue +++ b/src/views/modules/lingshan/shzl/wgy/index.vue @@ -7,7 +7,7 @@ :model="fmData" class="demo-form-inline" > - + - + - - + - + + + - + - + -
+
+ + 修改完善信息 item.value == value); + if (selectedItem) { + label = selectedItem.label; + } + } + return label; + }, + async getTableData() { - const url = "/epmetuser/lingShan/specialCrowd/listSpecialCrowd"; + const url = "/data/aggregator/epmetuser/listStaffByOrgAndRoles"; const { pageSize, pageNo, fmData } = this; - const { data, code, msg } = await requestGet(url, { + const { data, code, msg } = await requestPost(url, { pageSize, pageNo, ...fmData, + roleKeys: + fmData.roleKeys.length == 0 + ? ["grid_member", "grid_manager"] + : fmData.roleKeys, }); if (code === 0) { - console.log("列表请求成功!!!!!!!!!!!!!!"); this.total = data.total || 0; - this.tableData = data.list - ? data.list.map((item) => { - return item; - }) - : []; + this.tableData = (data.list || []).map((item) => { + return { + ...item, + genderName: this.getLabelByValue( + item.gender, + this.genderOptions + ), + cultureName: this.getLabelByValue( + item.culture, + this.cultureOptions + ), + workTypeName: this.getLabelByValue( + item.workType, + this.workTypeOptions + ), + roleName: this.getLabelByValue( + item.roleType, + this.roleOptions + ), + age: + typeof item.birthday == "string" + ? new Date().getFullYear() - + parseInt(item.birthday.substr(0, 4)) + : "--", + }; + }); } else { this.$message.error(msg); }