@@ -55,7 +64,8 @@ export default {
categoryId: "",//事件分类
deptId: "", //指派部门
deptName: "",
- categoryList: []
+ categoryList: [],
+ files: [] //附件
},
orgOptions: [],
orgOptionProps: {
@@ -71,12 +81,15 @@ export default {
eventDetailCopy: {},
selCategoryArray: [],
casOptions: [],
+ fileList: [],
+ uploadUlr: window.SITE_CONFIG["apiURL"] + "/oss/file/uploadvariedfile",
iscascaderShow: 0,
optionProps: {
multiple: false,
value: "id",
- label: "name",
- children: "subCategory",
+ label: "categoryName",
+ children: "children",
+ checkStrictly: true
},
dataRule: {
content: [
@@ -90,10 +103,13 @@ export default {
],
timeLimit: [
{ required: true, message: "办结时限不能为空", trigger: "blur" },
+ ],
+ categoryList: [
+ { required: true, message: '事件分类不能为空', trigger: 'blur' },
]
},
- selCateObj:{
- id:""
+ selCateObj: {
+ id: ""
},
};
},
@@ -126,12 +142,11 @@ 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
- this.formData.categoryId = this.eventDetailCopy.categoryId
- this.selCategoryArray.push(this.eventDetailCopy.parentCategoryId, this.eventDetailCopy.categoryId)
+ this.selCategoryArray = this.eventDetailCopy.parentCategoryId.split(",");
+ this.selCategoryArray.push(this.eventDetailCopy.categoryId);
+ this.handleChangeCate(this.selCategoryArray)
}
}
},
@@ -152,18 +167,40 @@ export default {
}
},
async getCategoryList() {
- const url = "/governance/issueprojectcategorydict/list";
+ const url = '/governance/icEvent/getCategoryTree';
let params = {};
const { data, code, msg } = await requestPost(url, params);
if (code === 0) {
- let treeDataNew = this.filterTree(data);
- //组织级联数据
+ let treeDataNew = this.deepTree(data, "children");
++this.iscascaderShow;
this.casOptions = [];
this.casOptions = treeDataNew;
} else {
this.$message.error(msg);
}
+ if (this.eventDetailCopy.parentCategoryId) {
+ const pids = this.eventDetailCopy.parentCategoryId.split(',');
+ pids.push(this.eventDetailCopy.categoryId);
+ let nodes = this.casOptions;
+ for (let i = 0; i < pids.length; i++) {
+ nodes = this.buildNode(nodes, pids[i])
+ }
+ if (nodes) {
+ this.formData.categoryList.push(nodes)
+ this.selCateObj = nodes
+ }
+ }
+ },
+ buildNode(nodes, treeId) {
+ for (let i = 0; i < nodes.length; i++) {
+ if (nodes[i].id === treeId) {
+ if (nodes[i].children) {
+ return nodes[i].children
+ } else {
+ return nodes[i]
+ }
+ }
+ }
},
handleChangeAgency(val) {
let obj = this.$refs["agencyIdArray"].getCheckedNodes()[0].data
@@ -171,7 +208,6 @@ export default {
this.formData.orgType = obj.level === 'grid' ? 'grid' : 'agency'
this.formData.deptId = obj.agencyId
this.formData.deptName = obj.agencyName
-
} else {
this.form.orgType = ''
this.form.orgId = ''
@@ -180,25 +216,26 @@ export default {
handleChangeCate() {
if (this.selCateObj = this.$refs["myCascader"].getCheckedNodes()[0]) {
this.selCateObj = this.$refs["myCascader"].getCheckedNodes()[0].data
+ this.formData.categoryList = this.selCateObj
this.formData.categoryId = this.selCateObj.id
- console.log(this.formData.categoryId,'this.formData.categoryId');
} else {
this.selCateObj = {}
}
},
//重构树,去除网格
- filterTree(arr) {
- let childs = arr;
- for (let i = childs.length; i--; i > 0) {
- if (childs[i].subCategory) {
- if (childs[i].subCategory.length) {
- this.filterTree(childs[i].subCategory);
- } else {
- delete childs[i].subCategory;
- }
- }
+ deepTree(arr, children) {
+ if (Array.isArray(arr) && arr.length > 0) {
+ return arr.map((item) => {
+ return {
+ ...item,
+ [children]:
+ (item[children] &&
+ item[children].length > 0 &&
+ this.deepTree(item[children], children)) ||
+ null,
+ };
+ });
}
- return arr;
},
async getReplayInfo() {
this.okflag = false;
@@ -206,11 +243,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 +261,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/eventOld/cpts/process-form-replay-end.vue b/src/views/modules/shequzhili/eventOld/cpts/process-form-replay-end.vue
index 9cad30838..a7ad2654f 100644
--- a/src/views/modules/shequzhili/eventOld/cpts/process-form-replay-end.vue
+++ b/src/views/modules/shequzhili/eventOld/cpts/process-form-replay-end.vue
@@ -1,8 +1,8 @@
转服务
-
转议题
-
+
-
-
-
+
-
-
@@ -72,27 +86,26 @@ import processFormReplay from "./process-form-replay";
import processFormProject from "./process-form-project";
import processFormDemand from "./process-form-demand";
import processFormIssue from "./process-form-issue";
-
+import processFormReplayEnd from "./process-form-replay-end";
+import processFormDesignate from "./process-form-designate";
let loading; // 加载动画
export default {
- data () {
+ data() {
return {
-
casOptions: [],
iscascaderShow: 0,
selCategoryArray: [],
selCateObj: {},
optionProps: {
multiple: false,
- value: 'id',
- label: 'name',
- children: 'subCategory',
+ value: "id",
+ label: "name",
+ children: "subCategory",
},
- operationType: '',
-
+ operationType: "",
replayInfo: {},
demand: {},
@@ -101,30 +114,28 @@ export default {
okflag: false,
eventDetailCopy: {},
- transferObj:{
- latitude :"",
- longitude :""
- }
+ transferObj: {
+ latitude: "",
+ longitude: "",
+ },
};
},
components: {
processFormReplay,
processFormProject,
processFormDemand,
- processFormIssue
+ processFormIssue,
+ processFormReplayEnd,
+ processFormDesignate,
},
computed: {
- dataRule () {
+ dataRule() {
return {
-
operationType: [
{ required: true, message: "处理方式不能为空", trigger: "blur" },
],
-
};
},
-
-
},
props: {
demandUserId: {
@@ -149,107 +160,89 @@ export default {
},
eventDetailData: {
type: Object,
- default () {
- return {}
- }
+ default() {
+ return {};
+ },
},
- source: {//展示来源:manage 管理平台 visiual 可视化平台
+ source: {
+ //展示来源:manage 管理平台 visiual 可视化平台
type: String,
- default: 'manage'
- }
- },
-
- watch: {
-
+ default: "manage",
+ },
},
- created () {
-
- console.log(this.source)
+ watch: {},
+ created() {
+ console.log(this.source);
},
- async mounted () {
- const { user } = this.$store.state
- this.agencyId = user.agencyId
+ async mounted() {
+ const { user } = this.$store.state;
+ this.agencyId = user.agencyId;
if (this.eventId) {
this.eventDetailCopy = JSON.parse(JSON.stringify(this.eventDetailData));
-
}
- if(this.eventDetailData.operationType){
- this.operationType = this.eventDetailCopy.operationType
+ if (this.eventDetailData.operationType) {
+ this.operationType = this.eventDetailCopy.operationType;
// this.getProcessInfo()
}
- this.$EventBus.$on('map',(val)=>{
- this.transferObj.latitude = val.lat
- this.transferObj.longitude = val.lng
- })
+ this.$EventBus.$on("map", (val) => {
+ this.transferObj.latitude = val.lat;
+ this.transferObj.longitude = val.lng;
+ });
},
methods: {
- handleChangeOperationType (val) {
-
+ handleChangeOperationType(val) {
+ this.operationType = val;
},
- async getProcessInfo () {
- this.okflag = false
- if (this.operationType === '0') {
- this.$refs.ref_process_form_replay.getReplayInfo()
+ async getProcessInfo() {
+ this.okflag = false;
+ if (this.operationType === "0") {
+ this.$refs.ref_process_form_replay.getReplayInfo();
if (this.$refs.ref_process_form_replay.okflag) {
- this.replayInfo = this.$refs.ref_process_form_replay.formData
-
- this.okflag = true
-
- } else {
- return false
- }
-
- } else if (this.operationType === '1') {
- this.$refs.ref_process_form_project.getProjectInfo()
- if (this.$refs.ref_process_form_project.okflag) {
-
- this.project = this.$refs.ref_process_form_project.formData
-
- //赋值分类信息
- this.okflag = true
+ this.replayInfo = this.$refs.ref_process_form_replay.formData;
+ this.okflag = true;
} else {
- return false
+ return false;
}
- } else if (this.operationType === '2') {
- this.$refs.ref_process_form_demond.getDemandInfo()
+ } else if (this.operationType === "2") {
+ this.$refs.ref_process_form_demond.getDemandInfo();
if (this.$refs.ref_process_form_demond.okflag) {
- this.demand = this.$refs.ref_process_form_demond.formData
-
- this.okflag = true
+ this.demand = this.$refs.ref_process_form_demond.formData;
+ this.okflag = true;
} else {
- return false
+ return false;
}
- } else if (this.operationType === '3') {
- this.$refs.ref_process_form_issue.getIssueInfo()
- if (this.$refs.ref_process_form_issue.okflag) {
- this.issueInfo = this.$refs.ref_process_form_issue.formData
-
- this.okflag = true
-
- } else {
- return false
+ } else if (this.operationType === "5") {
+ this.$refs.ref_process_form_designate.getReplayInfo();
+ this.replayInfo = this.$refs.ref_process_form_designate.formData;
+ if (this.$refs.ref_process_form_designate.okflag) {
+ this.replayInfo = this.$refs.ref_process_form_designate.formData;
+ this.okflag = true;
}
+ } else if (this.operationType === "6") {
+ this.$refs.ref_process_form_replay_end.getReplayInfo();
+ this.replayInfo = this.$refs.ref_process_form_replay_end.formData;
+ if (this.$refs.ref_process_form_replay_end.okflag) {
+ this.replayInfo = this.$refs.ref_process_form_replay_end.formData;
+ this.okflag = true;
+ }
+ } else if (this.formData.operationType === "4") {
+ this.replayInfo = {};
}
-
},
-
- handleCancle () {
+ handleCancle() {
this.resetData();
-
- },
- resetData () {
-
},
+ resetData() {},
// 开启加载动画
- startLoading () {
+ startLoading() {
loading = Loading.service({
lock: true, // 是否锁定
text: "正在加载……", // 加载中需要显示的文字
@@ -257,7 +250,7 @@ export default {
});
},
// 结束加载动画
- endLoading () {
+ endLoading() {
// clearTimeout(timer);
if (loading) {
loading.close();
diff --git a/src/views/modules/shequzhili/eventOld/eventList.vue b/src/views/modules/shequzhili/eventOld/eventList.vue
index 2569d1a3c..078efbdcd 100644
--- a/src/views/modules/shequzhili/eventOld/eventList.vue
+++ b/src/views/modules/shequzhili/eventOld/eventList.vue
@@ -573,10 +573,10 @@ export default {
value: "2",
label: "社区电话",
},
- {
- value: "3",
- label: "12345",
- },
+ // {
+ // value: "3",
+ // label: "12345",
+ // },
{
value: "4",
label: "网络员手持终端",