diff --git a/src/views/modules/shequzhili/event/cpts/event-info.vue b/src/views/modules/shequzhili/event/cpts/event-info.vue index 2fa926ec4..441073510 100644 --- a/src/views/modules/shequzhili/event/cpts/event-info.vue +++ b/src/views/modules/shequzhili/event/cpts/event-info.vue @@ -99,6 +99,31 @@
办结时限:
{{ formTimeLimit(item.timeLimit) }}
+ @@ -259,6 +311,9 @@ export default { changeGridId(val) { this.gridId = val; }, + watchImg(src) { + window.open(src); + }, //加载组织数据 async getProjectProcess() { @@ -305,6 +360,7 @@ export default { }, async handelAdd() { + debugger this.$refs.ref_add.getEventInfo(); if (this.$refs.ref_add.okflag) { this.eventInfoData = this.$refs.ref_add.formData; @@ -318,6 +374,7 @@ export default { this.project = {}; this.demand = {}; this.replayInfo = this.$refs.ref_processinfo_add.replayInfo; + console.log(this.replayInfo); //回复属性赋值 this.eventInfoData.content = this.replayInfo.content; this.eventInfoData.status = this.replayInfo.status; @@ -330,6 +387,7 @@ export default { this.demand = {}; console.log(this.$refs.ref_process_form_designate.replayInfo); this.replayInfo = this.$refs.ref_process_form_designate.replayInfo; + console.log(this.replayInfo); //回复属性赋值 this.eventInfoData.content = this.replayInfo.content; this.eventInfoData.status = this.replayInfo.status; diff --git a/src/views/modules/shequzhili/event/cpts/process-form-designate.vue b/src/views/modules/shequzhili/event/cpts/process-form-designate.vue index 0c3af3a14..81ff219b3 100644 --- a/src/views/modules/shequzhili/event/cpts/process-form-designate.vue +++ b/src/views/modules/shequzhili/event/cpts/process-form-designate.vue @@ -28,6 +28,15 @@ placeholder="请输入转办意见,不超过500字" v-model="formData.content"> + + + 点击上传 +
支持图片、word、pdf
+
+
@@ -55,7 +64,8 @@ export default { categoryId: "",//事件分类 deptId: "", //指派部门 deptName: "", - categoryList: [] + categoryList: [], + files: [] //附件 }, orgOptions: [], orgOptionProps: { @@ -71,6 +81,8 @@ export default { eventDetailCopy: {}, selCategoryArray: [], casOptions: [], + fileList: [], + uploadUlr: window.SITE_CONFIG["apiURL"] + "/oss/file/uploadvariedfile", iscascaderShow: 0, optionProps: { multiple: false, @@ -92,8 +104,8 @@ export default { { required: true, message: "办结时限不能为空", trigger: "blur" }, ] }, - selCateObj:{ - id:"" + selCateObj: { + id: "" }, }; }, @@ -126,7 +138,6 @@ export default { this.getCategoryList(); if (this.eventId) { this.eventDetailCopy = JSON.parse(JSON.stringify(this.eventDetailData)); - console.log(this.eventDetailCopy); // 这一步接收到eventDetailCopy在这里回填 if (this.eventDetailCopy.parentCategoryId && this.eventDetailCopy.categoryId) { this.selCateObj.id = this.eventDetailCopy.categoryId @@ -181,7 +192,7 @@ export default { if (this.selCateObj = this.$refs["myCascader"].getCheckedNodes()[0]) { this.selCateObj = this.$refs["myCascader"].getCheckedNodes()[0].data this.formData.categoryId = this.selCateObj.id - console.log(this.formData.categoryId,'this.formData.categoryId'); + console.log(this.formData.categoryId, 'this.formData.categoryId'); } else { this.selCateObj = {} } @@ -206,11 +217,13 @@ export default { if (!valid) { app.util.validateRule(messageObj); } else { - console.log(this.selCateObj); if (!this.selCateObj || !this.selCateObj.id) { this.$message.error("请选择事件分类"); return false; } + if(this.fileList){ + this.formData.files = this.fileList + } this.formData.status = "processing"; this.formData.categoryId = this.selCateObj.id; this.formData.categoryList = []; @@ -222,6 +235,74 @@ export default { resetData() { this.agencyIdArray = [] }, + beforeUpload(file) { + const array = file.name.split("."); + const extension = array[array.length - 1]; + const formatarray = [ + "jpg", + "png", + "jpeg", + "bmp", + "mp4", + "wma", + "m4a", + "mp3", + "doc", + "docx", + "xls", + "xlsx", + "pdf", + ]; + if (formatarray.indexOf(extension) === -1) { + this.$message.error("只支持图片、word、pdf"); + return false; + } + }, + handleFileRemove(file) { + if (file && file.status === "success") { + this.fileList.splice( + this.fileList.findIndex((item) => item.uid === file.uid), + 1 + ); + } + }, + handleFileSuccess(res, file) { + if (res.code === 0 && res.msg === "success") { + const array = file.name.split("."); + const fileType = array[array.length - 1]; + const picArray = ["jpg", "png", "jpeg", "bmp"]; + const videoarray = ["mp4", "wma", "m4a"]; + const docArray = ["doc", "docx", "xls", "xlsx", "pdf"]; + const mp3Array = ["mp3"]; + + if (picArray.indexOf(fileType) > -1) { + file.attachmentFormat = "image"; + } else if (videoarray.indexOf(fileType) > -1) { + file.attachmentFormat = "video"; + } else if (docArray.indexOf(fileType) > -1) { + file.attachmentFormat = "doc"; + } else if (mp3Array.indexOf(fileType) > -1) { + file.attachmentFormat = "voice"; + } + + file.url = res.data.url; + file.type = fileType; + + file.attachmentName = file.name; + file.attachmentType = file.type; + file.attachmentUrl = file.url; + + this.fileList.push(file); + } else this.$message.error(res.msg); + }, + //下载 + handleFileDownload(file) { + var a = document.createElement("a"); + var event = new MouseEvent("click"); + a.download = file.name; + a.href = file.url; + a.dispatchEvent(event); + }, // 开启加载动画 startLoading() { loading = Loading.service({ diff --git a/src/views/modules/shequzhili/event/cpts/process-form-replay-end.vue b/src/views/modules/shequzhili/event/cpts/process-form-replay-end.vue index 62f536191..2a001ba74 100644 --- a/src/views/modules/shequzhili/event/cpts/process-form-replay-end.vue +++ b/src/views/modules/shequzhili/event/cpts/process-form-replay-end.vue @@ -25,6 +25,15 @@ placeholder="请输入回复内容,不超过500字" v-model="formData.content">
+ + + 点击上传 +
支持图片、word、pdf
+
+
@@ -43,12 +52,15 @@ export default { content: '', status: 'closed_case', categoryList: [], + files: [] }, status: false, okflag: false, eventDetailCopy: {}, selCategoryArray: [], casOptions: [], + fileList: [], + uploadUlr: window.SITE_CONFIG["apiURL"] + "/oss/file/uploadvariedfile", iscascaderShow: 0, optionProps: { multiple: false, @@ -87,7 +99,7 @@ export default { }, watch: {}, - created() {}, + created() { }, async mounted() { this.getCategoryList(); @@ -152,6 +164,9 @@ export default { if (!this.formData.categoryId) { this.formData.categoryId = this.selCateObj.id; } + if(this.fileList){ + this.formData.files = this.fileList + } this.formData.categoryList = []; this.formData.categoryList.push(this.selCateObj); this.okflag = true; @@ -159,6 +174,74 @@ export default { }); }, resetData() { }, + beforeUpload(file) { + const array = file.name.split("."); + const extension = array[array.length - 1]; + const formatarray = [ + "jpg", + "png", + "jpeg", + "bmp", + "mp4", + "wma", + "m4a", + "mp3", + "doc", + "docx", + "xls", + "xlsx", + "pdf", + ]; + if (formatarray.indexOf(extension) === -1) { + this.$message.error("只支持图片、word、pdf"); + return false; + } + }, + handleFileRemove(file) { + if (file && file.status === "success") { + this.fileList.splice( + this.fileList.findIndex((item) => item.uid === file.uid), + 1 + ); + } + }, + handleFileSuccess(res, file) { + if (res.code === 0 && res.msg === "success") { + const array = file.name.split("."); + const fileType = array[array.length - 1]; + const picArray = ["jpg", "png", "jpeg", "bmp"]; + const videoarray = ["mp4", "wma", "m4a"]; + const docArray = ["doc", "docx", "xls", "xlsx", "pdf"]; + const mp3Array = ["mp3"]; + + if (picArray.indexOf(fileType) > -1) { + file.attachmentFormat = "image"; + } else if (videoarray.indexOf(fileType) > -1) { + file.attachmentFormat = "video"; + } else if (docArray.indexOf(fileType) > -1) { + file.attachmentFormat = "doc"; + } else if (mp3Array.indexOf(fileType) > -1) { + file.attachmentFormat = "voice"; + } + + file.url = res.data.url; + file.type = fileType; + + file.attachmentName = file.name; + file.attachmentType = file.type; + file.attachmentUrl = file.url; + + this.fileList.push(file); + } else this.$message.error(res.msg); + }, + //下载 + handleFileDownload(file) { + var a = document.createElement("a"); + var event = new MouseEvent("click"); + a.download = file.name; + a.href = file.url; + a.dispatchEvent(event); + }, // 开启加载动画 startLoading() { loading = Loading.service({