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 @@
@@ -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">
+