From 5cffc3529840f9c2dac003cb93fe8b63dc3a6d4c Mon Sep 17 00:00:00 2001 From: dai <851733175@qq.com> Date: Wed, 18 May 2022 17:34:58 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=91=E5=8F=91=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../scss/modules/shequzhili/project-info.scss | 30 ++ .../shequzhili/xiangmu/cpts/event-info.vue | 6 +- .../xiangmu/cpts/project-evaluation.vue | 6 +- .../shequzhili/xiangmu/cpts/project-info.vue | 504 +++++++++++++++++- .../modules/shequzhili/xiangmu/index.vue | 16 +- 5 files changed, 526 insertions(+), 36 deletions(-) diff --git a/src/assets/scss/modules/shequzhili/project-info.scss b/src/assets/scss/modules/shequzhili/project-info.scss index 3fdfdd13..ac28f8c7 100644 --- a/src/assets/scss/modules/shequzhili/project-info.scss +++ b/src/assets/scss/modules/shequzhili/project-info.scss @@ -20,6 +20,36 @@ } .m-fm { + .avatar-uploader { + margin: 0 0 0 20px; + + ::v-deep .el-upload { + cursor: pointer; + position: relative; + overflow: hidden; + } + img { + object-fit: cover; + } + .el-upload:hover { + border-color: #409eff; + } + .avatar { + width: 36px; + height: 36px; + display: block; + } + .avatar-uploader-icon { + border: 1px dashed #d9d9d9; + border-radius: 6px; + font-size: 28px; + color: #8c939d; + width: 36px; + height: 36px; + line-height: 36px; + text-align: center; + } + } } .m-btns { diff --git a/src/views/modules/shequzhili/xiangmu/cpts/event-info.vue b/src/views/modules/shequzhili/xiangmu/cpts/event-info.vue index 72c04623..f91347a2 100644 --- a/src/views/modules/shequzhili/xiangmu/cpts/event-info.vue +++ b/src/views/modules/shequzhili/xiangmu/cpts/event-info.vue @@ -3,8 +3,6 @@
-

事件详情

-
事件内容
@@ -60,7 +58,7 @@ function iniData() { return { pageType: "info", - eventInfo: { + info: { eventTime: "", eventContent: "", eventAddress: "", @@ -126,7 +124,7 @@ export default { const url = "/gov/project/resievent/eventdetail-icdata"; const { data, code, msg } = await requestPost(url, { - resiEventId: this.projectInfo.originId, + resiEventId: this.eventId, }); if (code === 0) { diff --git a/src/views/modules/shequzhili/xiangmu/cpts/project-evaluation.vue b/src/views/modules/shequzhili/xiangmu/cpts/project-evaluation.vue index a4cf9f03..d3f8f87f 100644 --- a/src/views/modules/shequzhili/xiangmu/cpts/project-evaluation.vue +++ b/src/views/modules/shequzhili/xiangmu/cpts/project-evaluation.vue @@ -123,9 +123,9 @@ export default { }, async getTableData() { - // const url = "/gov/project/project/satisfaction-evaluation-list"; - const url = - "http://yapi.elinkservice.cn/mock/245/gov/project/project/satisfaction-evaluation-list"; + const url = "/gov/project/project/satisfaction-evaluation-list"; + // const url = + // "http://yapi.elinkservice.cn/mock/245/gov/project/project/satisfaction-evaluation-list"; const { pageSize, pageNo, fmData } = this; const { data, code, msg } = await requestPost(url, { pageSize, diff --git a/src/views/modules/shequzhili/xiangmu/cpts/project-info.vue b/src/views/modules/shequzhili/xiangmu/cpts/project-info.vue index 012013d9..ea9ea60e 100644 --- a/src/views/modules/shequzhili/xiangmu/cpts/project-info.vue +++ b/src/views/modules/shequzhili/xiangmu/cpts/project-info.vue @@ -22,6 +22,7 @@ 内部备注: {{ projectInfo.internalRemark || "--" }}
+
当前处理部门: {{ projectInfo.departmentNameList.join("、") }}
-
+ +
项目来源: 查看项目来源
+
项目评价: - 查看项目评价
+
分类: @@ -59,28 +69,168 @@
-
+
关闭
- +

处理

- + - 处理/响应 - 结案 - 转其他机关/科室 - 退回 + 处理/响应 + 结案 + 转其他机关/科室 + 退回 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
@@ -196,15 +346,46 @@ import dateFormat from "dai-js/tools/dateFormat"; function iniData() { return { pageType: "info", + uploadUlr: window.SITE_CONFIG["apiURL"] + "/oss/file/uploadqrcodeV2", showedEvaluation: false, projectIdCopy: this.projectId, + customerId: localStorage.getItem("customerId"), + fmData: { operateType: "", + + assistanceUnitIndex: "", + assistanceUnitId: "", + assistanceUnitType: "", + + internalRemark: "", + publicReply: "", + internalFile: [], + departmentName: "", + projectStaffId: "", + + projectProcessId: "", + + closedStatus: "", }, + myDepartmentList: [], + assistanceUnitList: [], + returnableList: [], + resolveTypeList: [ + { + name: "已解决", + value: "resolved", + }, + { + name: "无需解决", + value: "unresolved", + }, + ], + projectProcess: [], projectInfo: { @@ -223,7 +404,7 @@ function iniData() { platformIds: [], processable: false, projectId: "", - projectStatus: "pending", + projectStatus: "", projectTitle: "", publicReply: "", returnable: false, @@ -276,7 +457,7 @@ export default { props: { projectId: { type: String, - default: "64502a8f1048a7240295527a9b32e513", + default: "", }, type: { type: String, @@ -295,11 +476,42 @@ export default { computed: { dataRule() { - return { - operateType: [ - { required: true, message: "处理方式不能为空", trigger: "blur" }, - ], - }; + const { + fmData: { operateType }, + } = this; + let obj = (() => { + return { + operateType: [ + { required: true, message: "处理方式不能为空", trigger: "blur" }, + ], + projectStaffId: [ + { required: true, message: "请选择处理部门", trigger: "blur" }, + ], + }; + })(); + if (operateType != "") { + if (operateType == "close") { + obj.publicReply = [ + { required: true, message: "请填写结案说明", trigger: "blur" }, + ]; + obj.closedStatus = [ + { required: true, message: "请选择结案状态", trigger: "blur" }, + ]; + } else { + obj.internalRemark = [ + { required: true, message: "请填写内部备注", trigger: "blur" }, + ]; + } + } + + console.log(obj); + if (this.$refs && this.$refs.fm) { + this.$nextTick(() => { + this.$refs["fm"].clearValidate(); + }); + } + + return obj; }, }, @@ -311,9 +523,26 @@ export default { }); this.getApiData(); }, - // projectIdCopy () { - - // }, + "fmData.assistanceUnitIndex": function (val) { + if (val === "") { + this.fmData.assistanceUnitId = ""; + this.fmData.assistanceUnitType = ""; + } else { + this.fmData.assistanceUnitId = + this.assistanceUnitList[val].assistanceUnitId; + this.fmData.assistanceUnitType = + this.assistanceUnitList[val].assistanceUnitType; + } + }, + "fmData.projectStaffId": function (val) { + if (val === "") { + this.fmData.departmentName = ""; + } else { + this.fmData.departmentName = this.myDepartmentList.find( + (item) => item.projectStaffId == val + )["departmentName"]; + } + }, }, mounted() { @@ -322,6 +551,40 @@ export default { }, methods: { + beforeImgUpload(file) { + const isLt1M = file.size / 1024 / 1024 < 10; + + if (!isLt1M) { + this.$message.error("上传文件大小不能超过 10MB!"); + } + return isLt1M; + }, + + handleImgSuccess(res, file, fileList) { + console.log("res.data.url", file); + if (res.code === 0 && res.msg === "success") { + console.log("res.data.url", res.data.url); + this.fmData.internalFile.push({ + format: file.name.split(".").pop(), + name: file.name, + size: file.size, + type: file.raw.type, + url: res.data.url, + }); + console.log(this.fmData.internalFile); + } else { + this.$message.error(res.msg); + } + }, + + handleImgRemove(file) { + let index = this.fmData.internalFile.findIndex( + (item) => item.url == file.response.data.url + ); + this.fmData.internalFile.splice(index, 1); + console.log(this.fmData.internalFile); + }, + watchImg(src) { window.open(src); }, @@ -331,7 +594,29 @@ export default { }, handleSubmit() { - this.$emit("afterEdit"); + this.$refs["fm"].validate((valid, messageObj) => { + if (valid) { + this.beforeSubmit(); + } else { + } + }); + }, + + beforeSubmit() { + const { + fmData: { operateType }, + } = this; + if (operateType == "dispose") { + this.submitDispose(); + } else if (operateType == "close") { + this.submitClose(); + } else if (operateType == "trun") { + this.submitTurn(); + } else if (operateType == "back") { + this.submitBack(); + } else { + return this.$message.error("请先选择处理方式"); + } }, handleWatchOrigin() { @@ -341,6 +626,131 @@ export default { this.pageType = "info"; }, + //加载组织数据 + async submitBack() { + const url = "/gov/project/trace/return-v2"; + const { fmData } = this; + + const loading = this.$loading({ + lock: true, + text: "Loading", + spinner: "el-icon-loading", + background: "rgba(0, 0, 0, 0.5)", + }); + + const { data, code, msg } = await requestPost(url, { + projectId: this.projectIdCopy, + projectProcessId: fmData.projectProcessId, + departmentName: fmData.departmentName, + internalRemark: fmData.internalRemark, + projectStaffId: fmData.projectStaffId, + publicReply: fmData.publicReply, + internalFile: fmData.internalFile, + }); + + loading.close(); + + if (code === 0) { + this.$emit("afterEdit"); + } else { + this.$message.error(msg); + } + }, + + //加载组织数据 + async submitClose() { + const url = "/gov/project/trace/closeproject-v2"; + const { fmData } = this; + + const loading = this.$loading({ + lock: true, + text: "Loading", + spinner: "el-icon-loading", + background: "rgba(0, 0, 0, 0.5)", + }); + + const { data, code, msg } = await requestPost(url, { + projectId: this.projectIdCopy, + closedStatus: fmData.closedStatus, + departmentName: fmData.departmentName, + internalRemark: fmData.internalRemark, + projectStaffId: fmData.projectStaffId, + publicReply: fmData.publicReply, + internalFile: fmData.internalFile, + }); + + loading.close(); + + if (code === 0) { + this.$emit("afterEdit"); + } else { + this.$message.error(msg); + } + }, + + //加载组织数据 + async submitTurn() { + const url = "/gov/project/trace/return-v2"; + const { fmData } = this; + + const loading = this.$loading({ + lock: true, + text: "Loading", + spinner: "el-icon-loading", + background: "rgba(0, 0, 0, 0.5)", + }); + + const { data, code, msg } = await requestPost(url, { + projectId: this.projectIdCopy, + projectProcessId: fmData.projectProcessId, + departmentName: fmData.departmentName, + internalRemark: fmData.internalRemark, + projectStaffId: fmData.projectStaffId, + publicReply: fmData.publicReply, + internalFile: fmData.internalFile, + }); + + loading.close(); + + if (code === 0) { + this.$emit("afterEdit"); + } else { + this.$message.error(msg); + } + }, + + //加载组织数据 + async submitDispose() { + const url = "/gov/project/trace/response-v2"; + const { fmData } = this; + + const loading = this.$loading({ + lock: true, + text: "Loading", + spinner: "el-icon-loading", + background: "rgba(0, 0, 0, 0.5)", + }); + + const { data, code, msg } = await requestPost(url, { + projectId: this.projectIdCopy, + departmentName: fmData.departmentName, + internalRemark: fmData.internalRemark, + projectStaffId: fmData.projectStaffId, + publicReply: fmData.publicReply, + internalFile: fmData.internalFile, + assistanceUnitId: fmData.assistanceUnitId, + assistanceUnitType: fmData.assistanceUnitType, + }); + + loading.close(); + + if (code === 0) { + this.$emit("afterEdit"); + } else { + this.$message.error(msg); + } + }, + async getApiData() { await this.getProjectInfo(); this.getProjectCate(); @@ -357,6 +767,58 @@ export default { if (code === 0) { this.projectInfo = data; + if (data.projectStatus == "pending") { + this.getMyDepartmentList(); + this.getAssistanceUnitList(); + if (data.returnable) { + this.getReturnableList(); + } + } + } else { + this.$message.error(msg); + } + }, + + //加载组织数据 + async getReturnableList() { + const url = "/gov/project/trace/returnablelist"; + + const { data, code, msg } = await requestPost(url, { + projectId: this.projectIdCopy, + }); + + if (code === 0) { + this.returnableList = data; + } else { + this.$message.error(msg); + } + }, + + //加载组织数据 + async getMyDepartmentList() { + const url = "/gov/project/trace/mydepartmentlist"; + + const { data, code, msg } = await requestPost(url, { + projectId: this.projectIdCopy, + }); + + if (code === 0) { + this.myDepartmentList = data; + } else { + this.$message.error(msg); + } + }, + + //加载组织数据 + async getAssistanceUnitList() { + const url = "/heart/icpartyunit/assistanceUnitList"; + + const { data, code, msg } = await requestPost(url, { + // projectId: this.projectIdCopy, + }); + + if (code === 0) { + this.assistanceUnitList = data; } else { this.$message.error(msg); } diff --git a/src/views/modules/shequzhili/xiangmu/index.vue b/src/views/modules/shequzhili/xiangmu/index.vue index cda90bd3..a4c94800 100644 --- a/src/views/modules/shequzhili/xiangmu/index.vue +++ b/src/views/modules/shequzhili/xiangmu/index.vue @@ -277,11 +277,11 @@ export default { optionsStatus: [ { - value: "1", + value: "pending", label: "未结案", }, { - value: "0", + value: "closed", label: "已结案", }, ], @@ -315,11 +315,11 @@ export default { watch: { "fmData.date": function (val) { if (Array.isArray(val) && val.length == 2) { - this.fmData.birthdayStart = val[0]; - this.fmData.birthdayEnd = val[1]; + this.fmData.startDate = val[0]; + this.fmData.endDate = val[1]; } else { - this.fmData.birthdayStart = ""; - this.fmData.birthdayEnd = ""; + this.fmData.startDate = ""; + this.fmData.endDate = ""; } }, }, @@ -552,8 +552,8 @@ export default { }, async getTableData() { - const url = "http://yapi.elinkservice.cn/mock/245/gov/project/project/project-list"; - // const url = "/gov/project/project/project-list"; + // const url = "http://yapi.elinkservice.cn/mock/245/gov/project/project/project-list"; + const url = "/gov/project/project/project-list"; const { pageSize, pageNo, fmData } = this; const { data, code, msg } = await requestPost(url, { pageSize,