From 7ee2e961038a5e0dcf4e0e3a816b15373930f050 Mon Sep 17 00:00:00 2001 From: mk <2403457699@qq.com> Date: Thu, 3 Aug 2023 11:23:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=AE=8B=E7=96=BE=E4=BA=BA=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E8=81=94=E8=B0=83,=E8=BF=98=E5=B7=AE=E5=AF=BC=E5=85=A5?= =?UTF-8?q?=E3=80=81=E5=AF=BC=E5=87=BA,=E5=9C=B0=E5=9D=80=E6=9B=B4?= =?UTF-8?q?=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 2 +- .../resiDisability/addForm.vue | 122 ++++++++++++------ .../resiDisability/resiDisability.vue | 48 ++++--- 3 files changed, 113 insertions(+), 59 deletions(-) diff --git a/.env.development b/.env.development index f2669fe1c..65bdf2296 100644 --- a/.env.development +++ b/.env.development @@ -1,6 +1,6 @@ NODE_ENV=development -VUE_APP_API_SERVER = http://localhost:8080/api +VUE_APP_API_SERVER = http://192.168.1.144/api # VUE_APP_API_SERVER = http://118.190.150.119:41080/api # VUE_APP_API_SERVER = https://epmet-yantai.elinkservice.cn/api # VUE_APP_API_SERVER = https://epmet-test.elinkservice.cn/api diff --git a/src/views/modules/base/residentManagement/resiDisability/addForm.vue b/src/views/modules/base/residentManagement/resiDisability/addForm.vue index 85b3e3e00..ee6ff48bd 100644 --- a/src/views/modules/base/residentManagement/resiDisability/addForm.vue +++ b/src/views/modules/base/residentManagement/resiDisability/addForm.vue @@ -30,7 +30,7 @@ 联系电话: {{ formData.mobile || "--" }} - + 证件类型: {{ formData.idTypeName || "--" }} - + 证件号: {{ formData.idNum || "--" }} - +
性别: - {{ formData.gender?formData.gender=='1'?'男':formData.gender=='2'?'女':'--':'--' }} + {{ + formData.gender + ? formData.gender == "1" + ? "男" + : formData.gender == "2" + ? "女" + : "--" + : "--" + }}
-
本地户籍: - {{ formData.localResidenceFlag?formData.localResidenceFlag=='1'?'是':formData.localResidenceFlag=='0'?'否':'--':'--' }} + {{ + formData.localResidenceFlag != null + ? formData.localResidenceFlag === 1 + ? "是" + : formData.localResidenceFlag === 0 + ? "否" + : "--" + : "--" + }}
@@ -119,7 +142,12 @@ 户籍地址: {{ formData.placeOfDomicile || "--" }} - + 现居地址: {{ formData.currentResidence || "--" }} - +
低保: - {{ formData.subsistenceAllowanceFlag?formData.subsistenceAllowanceFlag=='1'?'是':formData.subsistenceAllowanceFlag=='0'?'否':'--':'--' }} + {{ + formData.subsistenceAllowanceFlag != null + ? formData.subsistenceAllowanceFlag == "1" + ? "是" + : formData.subsistenceAllowanceFlag == "0" + ? "否" + : "--" + : "--" + }}
@@ -227,6 +267,7 @@ v-model="formData.retirementAmount" placeholder="请输入" clearable + @blur="checkNumberInput" >
@@ -235,11 +276,12 @@ 月收入: {{ formData.monthIncome || "--" }} - + @@ -314,9 +356,9 @@ let loading; // 加载动画 export default { props: { - formType:{ - type:String, - default:'add' + formType: { + type: String, + default: "add", }, source: { //展示来源:manage 管理平台 visiual 可视化平台 @@ -384,46 +426,46 @@ export default { async initForm(type, row) { this.formType = type; this.scopeId = row.categorizedResiId; - await this.getDetail(); + await this.getDetail(row.categorizedResiId); }, async getDetail(categorizedResiId) { - const url = `/governance/commonDemand/detail/${categorizedResiId}`; + const url = `/actual/base/resiCategorized/disability/detail/${categorizedResiId}`; const { data, code, msg } = await requestGet(url); if (code === 0) { console.log(data); - // let obj = { - // name: "测试", - // mobile: "17555555555", - // idType: "1", - // idNum: "370254111111111111", - // gender: "1", - // localResidenceFlag: 1, - // placeOfDomicile: "青岛市市北区时代国际广场", - // currentResidence: "青岛市李沧区建安小区", - // disabilityCategoryCode: "tingli", - // disabilityLevel: "1", - // disabilityNum: "545461564512167", - // subsistenceAllowanceFlag: 1, - // retirementAmount: 1, - // monthIncome: 200.111, - // contactName: "刘备", - // contactMobile: "15655555454", - // remark: "备注", - // }; - this.formData = { ...obj }; + this.formData = { ...data }; } else { this.$message.error(msg); } }, + checkNumberInput() { + if (isNaN(this.formData.retirementAmount)) { + this.$message.error("请输入数字"); + this.formData.retirementAmount = ""; + } else { + this.formData.retirementAmount = parseFloat( + this.formData.retirementAmount + ); + } + }, + monthIncomeNumberInput() { + if (isNaN(this.formData.monthIncome)) { + this.$message.error("请输入数字"); + this.formData.monthIncome = ""; + } else { + this.formData.monthIncome = parseFloat(this.formData.monthIncome); + } + }, async handleComfirm() { this.$refs["ref_add_form"].validate(async (valid) => { if (!valid) { return false; } + console.log(this.formData); const url = this.formType === "edit" - ? "/governance/commonDemand/update" - : "/governance/commonDemand/save"; + ? "/actual/base/resiCategorized/disability/update" + : "/actual/base/resiCategorized/disability/create"; const { data, code, msg } = await requestPost(url, this.formData); if (code === 0) { diff --git a/src/views/modules/base/residentManagement/resiDisability/resiDisability.vue b/src/views/modules/base/residentManagement/resiDisability/resiDisability.vue index 12af64690..96db7efb3 100644 --- a/src/views/modules/base/residentManagement/resiDisability/resiDisability.vue +++ b/src/views/modules/base/residentManagement/resiDisability/resiDisability.vue @@ -310,14 +310,20 @@ label="性别" :show-overflow-tooltip="true" > + + + 查看 - + 编辑 @@ -441,7 +447,7 @@ @@ -556,6 +562,7 @@ export default { return this.$store.state.inIframe ? h : _h; }, ...mapGetters(["clientHeight", "iframeHeight"]), + }, watch: {}, async created() { @@ -589,7 +596,11 @@ export default { console.log("获取字典失败: ", error); } }, - + binaryText(value){ + let text = '' + text = this.binaryOptionList.filter(item=>item.value == value)[0].label + return text || "--" + }, // ------------------------------------事件------------------------------------------ // 搜索事件 handleSearch(val) { @@ -607,8 +618,7 @@ export default { // 查看详情触发事件 async handleDetail(row) { this.addDiaTitle = "详情"; - this.showDetail = true; - this.formType = "add"; + this.formType = "detail"; this.showAdd = true; this.$nextTick(() => { this.$refs.ref_add_form.initForm("detail", row); @@ -621,8 +631,11 @@ export default { }, // 编辑触发事件 async handleEdit(row) { + this.addDiaTitle = "编辑"; + this.formType = "edit"; + this.showAdd = true; this.$nextTick(() => { - this.$refs.ref_add_form.initForm(type, row); + this.$refs.ref_add_form.initForm("edit", row); }); }, // 新增弹出框组件取消事件 @@ -633,7 +646,7 @@ export default { this.showEdit = false; }, // 新增弹出框组件确定事件 - handleOk() { + handleComfirm() { this.handleClose(); this.pageNo = 1; this.getTableData(); @@ -646,7 +659,7 @@ export default { type: "warning", }) .then(() => { - this.cancelFuwu([row.id]); + this.cancelFuwu([row.categorizedResiId]); }) .catch((err) => { if (err == "cancel") { @@ -659,10 +672,10 @@ export default { }, // 删除处理 async cancelFuwu(id) { - const url = "/governance/icServiceRecordV2/delete"; + const url = "/actual/base/resiCategorized/disability/deleteBatch"; const { data, code, msg } = await requestPost(url, id); if (code === 0) { - this.$message.success("取消成功!"); + this.$message.success("删除成功!"); this.getTableData(); } else { this.$message.error("操作失败!"); @@ -671,8 +684,7 @@ export default { // 获取列表 async getTableData() { this.tableLoading = true; - const url = "/actual/base/resiDisability/page"; - + const url = "/actual/base/resiCategorized/disability/page"; const { pageSize, pageNo, formData } = this; const { data, code, msg } = await requestPost(url, { pageSize, @@ -799,7 +811,7 @@ export default { type: "warning", }) .then(() => { - this.cancelFuwu(this.multiSelection.map((e) => e.id)); + this.cancelFuwu(this.multiSelection.map((e) => e.categorizedResiId)); }) .catch((err) => { console.error(err);