From 3989edc0d8a6b321120c62f6f9a2738f1aee4d41 Mon Sep 17 00:00:00 2001
From: linwei <872216696@qq.com>
Date: Fri, 29 Dec 2023 11:20:49 +0800
Subject: [PATCH] 报事优化
---
src/views/task/reportForRepairs.vue | 1514 +++++++++++++++++++++++++++++-----------------------------
1 files changed, 759 insertions(+), 755 deletions(-)
diff --git a/src/views/task/reportForRepairs.vue b/src/views/task/reportForRepairs.vue
index 9f2ec6e..826828e 100644
--- a/src/views/task/reportForRepairs.vue
+++ b/src/views/task/reportForRepairs.vue
@@ -4,815 +4,819 @@
* @LastEditors: shuishen 1109946754@qq.com
* @LastEditTime: 2023-12-29 10:36:08
* @FilePath: \jczz_web\src\views\task\reportForRepairs.vue
- * @Description:
- *
- * Copyright (c) 2023 by shuishen, All Rights Reserved.
+ * @Description:
+ *
+ * Copyright (c) 2023 by shuishen, All Rights Reserved.
-->
<!-- 走访日志 -->
<template>
- <basic-container>
- <avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" ref="crud" @row-del="rowDel"
- v-model="form" :permission="permissionList" @row-update="rowUpdate" @row-save="rowSave"
- :before-open="beforeOpen" @search-change="searchChange" @search-reset="searchReset"
- @selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange"
- @refresh-change="refreshChange" @on-load="onLoad">
- <template slot="confirmFlag" slot-scope="{row}">
- <el-tag size="small" :type="showConfirmFlag(row.confirmFlag).type">
- {{ showConfirmFlag(row.confirmFlag).text }}
- </el-tag>
- </template>
+ <basic-container>
+ <avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" ref="crud" @row-del="rowDel"
+ v-model="form" :permission="permissionList" @row-update="rowUpdate" @row-save="rowSave" :before-open="beforeOpen"
+ @search-change="searchChange" @search-reset="searchReset" @selection-change="selectionChange"
+ @current-change="currentChange" @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad">
+ <template slot="confirmFlag" slot-scope="{row}">
+ <el-tag size="small" :type="showConfirmFlag(row.confirmFlag).type">
+ {{ showConfirmFlag(row.confirmFlag).text }}
+ </el-tag>
+ </template>
- <template slot="expand" slot-scope="{row}">
- <el-timeline>
- <el-timeline-item v-for="(item, index) in timeLineData(row)" :key="index" :timestamp="item.createTime"
- :icon="item.icon" :color="item.color" :hide-timestamp="item.contentType == 3" placement="top">
- <el-card v-show="item.contentType == 1" :body-style="{ padding: '10px', background: '#f8f8f8' }">
- <div>
- 评价:{{ item.content }}
- </div>
- <el-rate v-model="item.point" disabled :colors="colors">
- </el-rate>
- </el-card>
+ <template slot="expand" slot-scope="{row}">
+ <el-timeline>
+ <el-timeline-item v-for="(item, index) in timeLineData(row)" :key="index" :timestamp="item.createTime"
+ :icon="item.icon" :color="item.color" :hide-timestamp="item.contentType == 3" placement="top">
+ <el-card v-show="item.contentType == 1" :body-style="{ padding: '10px', background: '#f8f8f8' }">
+ <div>
+ 评价:{{ item.content }}
+ </div>
+ <el-rate v-model="item.point" disabled :colors="colors">
+ </el-rate>
+ </el-card>
- <el-card v-show="item.peopleType != 1 && item.contentType == 0"
- :body-style="{ padding: '10px', background: '#f8f8f8' }">
- <div>
- {{ item.name }} {{ item.mobile }}
- </div>
- <div>
- {{ item.content }}
- </div>
- <div v-show="item.imageList != '' && item.imageList != null">
- <el-image style="width: 100px; height: 100px" :src="showCurImage(item.imageList)"
- :preview-src-list="showImageListData(item.imageList)">
- </el-image>
- </div>
- </el-card>
+ <el-card v-show="item.peopleType != 1 && item.contentType == 0"
+ :body-style="{ padding: '10px', background: '#f8f8f8' }">
+ <div>
+ {{ item.name }} {{ item.mobile }}
+ </div>
+ <div>
+ {{ item.content }}
+ </div>
+ <div v-show="item.imageList != '' && item.imageList != null">
+ <el-image style="width: 100px; height: 100px" :src="showCurImage(item.imageList)"
+ :preview-src-list="showImageListData(item.imageList)">
+ </el-image>
+ </div>
+ </el-card>
- <el-card v-show="item.peopleType == 1 && item.contentType == 0"
- :body-style="{ padding: '10px', background: '#f8f8f8' }">
- <span style="color: rgb(204, 204, 204);">系统:{{ item.content || '959999' }}</span>
- </el-card>
+ <el-card v-show="item.peopleType == 1 && item.contentType == 0"
+ :body-style="{ padding: '10px', background: '#f8f8f8' }">
+ <span style="color: rgb(204, 204, 204);">系统:{{ item.content || '959999' }}</span>
+ </el-card>
- <span v-show="item.contentType == 3">结束</span>
- </el-timeline-item>
+ <span v-show="item.contentType == 3">结束</span>
+ </el-timeline-item>
- <!-- <el-timeline-item timestamp="2018/4/12" placement="top">
+ <!-- <el-timeline-item timestamp="2018/4/12" placement="top">
<el-card>
<h4>更新 Github 模板</h4>
<p>王小虎 提交于 2018/4/12 20:46</p>
</el-card>
</el-timeline-item> -->
- </el-timeline>
- </template>
+ </el-timeline>
+ </template>
- <template slot-scope="scope" slot="menu">
- <el-button type="text" icon="el-icon-chat-dot-square" @click="replyBtnClick(scope.row)">
- 回复
- </el-button>
+ <template slot-scope="scope" slot="menu">
+ <el-button type="text" icon="el-icon-chat-dot-square" :disabled="scope.row.confirmFlag === 3"
+ @click="replyBtnClick(scope.row)">
+ 回复
+ </el-button>
- <el-button type="text" icon="el-icon-document-copy" @click="turnOverBtnClick(scope.row)">
- 移交
- </el-button>
- </template>
+ <el-button type="text" icon="el-icon-document-copy" :disabled="scope.row.confirmFlag === 3"
+ @click="turnOverBtnClick(scope.row)">
+ 移交
+ </el-button>
+ </template>
- <template slot="menuLeft">
- <el-button size="small" icon="el-icon-delete" plain v-if="permission.article_delete" @click="handleDelete">删
- 除
- </el-button>
- </template>
- </avue-crud>
+ <template slot="menuLeft">
+ <el-button size="small" icon="el-icon-delete" plain v-if="permission.article_delete" @click="handleDelete">删
+ 除
+ </el-button>
+ </template>
+ </avue-crud>
- <el-dialog title="回复" append-to-body :visible.sync="replyPopup" center @close="popupClose">
- <avue-form ref="replyForm" :option="replyOption" v-model="replyForm" @submit="handleSubmit"
- @reset-change="handleReset">
- <template slot-scope="{row}" slot="videoList">
- <el-upload class="video-uploader" action="/api/blade-resource/oss/endpoint/put-file"
- :file-list="fileList" :headers="updateHeader" :show-file-list="true" :limit="1" :on-change="getFile"
- :on-exceed="handleExceed" :on-success="uploadVideoProcess" :before-upload="beforeUploadVideo"
- :before-remove="beforeRemove">
- <el-button size="small" type="primary">点击上传</el-button>
- <div slot="tip" class="el-upload__tip">上传视频只能是 mp4 格式,且大小不能超过 50MB</div>
- </el-upload>
- </template>
- </avue-form>
- </el-dialog>
+ <el-dialog title="回复" append-to-body :visible.sync="replyPopup" center @close="popupClose">
+ <avue-form ref="replyForm" :option="replyOption" v-model="replyForm" @submit="handleSubmit"
+ @reset-change="handleReset">
+ <template slot-scope="{row}" slot="videoList">
+ <el-upload class="video-uploader" action="/api/blade-resource/oss/endpoint/put-file" :file-list="fileList"
+ :headers="updateHeader" :show-file-list="true" :limit="1" :on-change="getFile" :on-exceed="handleExceed"
+ :on-success="uploadVideoProcess" :before-upload="beforeUploadVideo" :before-remove="beforeRemove">
+ <el-button size="small" type="primary">点击上传</el-button>
+ <div slot="tip" class="el-upload__tip">上传视频只能是 mp4 格式,且大小不能超过 50MB</div>
+ </el-upload>
+ </template>
+ </avue-form>
+ </el-dialog>
- <el-dialog title="转交" append-to-body :visible.sync="turnOverPopup" center @close="popupClose">
- <avue-form ref="turnOverForm" :option="turnOverOption" v-model="turnOverForm" @submit="turnOverHandleSubmit"
- @reset-change="turnOverHandleReset"></avue-form>
- </el-dialog>
- </basic-container>
+ <el-dialog title="转交" append-to-body :visible.sync="turnOverPopup" center @close="popupClose">
+ <avue-form ref="turnOverForm" :option="turnOverOption" v-model="turnOverForm" @submit="turnOverHandleSubmit"
+ @reset-change="turnOverHandleReset"></avue-form>
+ </el-dialog>
+ </basic-container>
</template>
<script>
-import {
+ import {
getList,
remove,
update,
add,
getReportForRepairs,
saveReply
-} from "@/api/task/reportForRepairs"
-import { mapGetters } from "vuex"
-import website from '@/config/website'
-import { Base64 } from 'js-base64'
-import { getToken } from '@/util/auth'
+ } from "@/api/task/reportForRepairs"
+ import {
+ mapGetters
+ } from "vuex"
+ import website from '@/config/website'
+ import {
+ Base64
+ } from 'js-base64'
+ import {
+ getToken
+ } from '@/util/auth'
-export default {
- data () {
- return {
- colors: ['#99A9BF', '#F7BA2A', '#FF9900'],
- form: {},
- query: {},
- loading: true,
- page: {
- pageSize: 10,
- currentPage: 1,
- total: 0,
+ export default {
+ data() {
+ return {
+ colors: ['#99A9BF', '#F7BA2A', '#FF9900'],
+ form: {},
+ query: {},
+ loading: true,
+ page: {
+ pageSize: 10,
+ currentPage: 1,
+ total: 0,
+ },
+ datetime: "",
+ selectionList: [],
+ option: {
+ index: false,
+ selection: false,
+ expand: true,
+ height: "auto",
+ calcHeight: 54,
+ dialogWidth: 950,
+ tip: false,
+ searchShow: true,
+ searchMenuSpan: 3,
+ menuWidth: 350,
+ border: true,
+ //stripe:true,
+ viewBtn: true,
+ // excelBtn: true,
+ dialogClickModal: false,
+ column: [{
+ label: "类型",
+ prop: "type",
+ span: 12,
+ searchSpan: 4,
+ dataType: "number",
+ type: "select",
+ width: 100,
+ dicUrl: "/api/blade-system/dict-biz/dictionary?code=reportForRepairsType",
+ props: {
+ label: "dictValue",
+ value: "dictKey",
+ },
+ search: true,
},
- datetime: "",
- selectionList: [],
- option: {
- index: false,
- selection: false,
- expand: true,
- height: "auto",
- calcHeight: 54,
- dialogWidth: 950,
- tip: false,
- searchShow: true,
- searchMenuSpan: 3,
- menuWidth: 350,
- border: true,
- //stripe:true,
- viewBtn: true,
- // excelBtn: true,
- dialogClickModal: false,
- column: [
- {
- label: "类型",
- prop: "type",
- span: 12,
- searchSpan: 4,
- dataType: "number",
- type: "select",
- width: 100,
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=reportForRepairsType",
- props: {
- label: "dictValue",
- value: "dictKey",
- },
- search: true,
- },
- {
- label: "姓名",
- prop: "realName",
- span: 12,
- searchSpan: 4,
- width: 100,
- search: true,
- },
- {
- label: "手机号",
- prop: "phone",
- span: 12,
- width: 100,
- searchSpan: 4,
- search: true,
- },
- {
- label: "图片",
- prop: "imageUrls",
- width: 80,
- type: "upload",
- listType: "picture-card",
- dataType: "string",
- multiple: true,
- action: "/api/blade-resource/oss/endpoint/put-file",
- propsHttp: {
- res: "data",
- name: 'name',
- url: "link",
- },
- span: 24,
- },
- {
- label: "地点",
- prop: "addressName",
- overHidden: true
- },
- {
- addDisplay: false,
- editDisplay: false,
- slot: true,
- label: "状态",
- prop: "confirmFlag",
- overHidden: true
- },
- {
- label: "上报时间",
- prop: "createTime",
- width: 160,
- addDisplay: false,
- editDisplay: false,
- type: "date",
- format: "yyyy-MM-dd HH:mm:ss",
- valueFormat: "yyyy-MM-dd HH:mm:ss",
- },
- {
- label: "处理时间",
- prop: "confirmTime",
- width: 160,
- addDisplay: false,
- editDisplay: false,
- type: "date",
- format: "yyyy-MM-dd HH:mm:ss",
- valueFormat: "yyyy-MM-dd HH:mm:ss",
- },
- {
- label: "描述",
- prop: "remark",
- type: "textarea",
- hide: true,
- span: 24,
- }
- ],
+ {
+ label: "姓名",
+ prop: "realName",
+ span: 12,
+ searchSpan: 4,
+ width: 100,
+ search: true,
},
- data: [],
+ {
+ label: "手机号",
+ prop: "phone",
+ span: 12,
+ width: 100,
+ searchSpan: 4,
+ search: true,
+ },
+ {
+ label: "图片",
+ prop: "imageUrls",
+ width: 80,
+ type: "upload",
+ listType: "picture-card",
+ dataType: "string",
+ multiple: true,
+ action: "/api/blade-resource/oss/endpoint/put-file",
+ propsHttp: {
+ res: "data",
+ name: 'name',
+ url: "link",
+ },
+ span: 24,
+ },
+ {
+ label: "地点",
+ prop: "addressName",
+ overHidden: true
+ },
+ {
+ addDisplay: false,
+ editDisplay: false,
+ slot: true,
+ label: "状态",
+ prop: "confirmFlag",
+ overHidden: true
+ },
+ {
+ label: "上报时间",
+ prop: "createTime",
+ width: 160,
+ addDisplay: false,
+ editDisplay: false,
+ type: "date",
+ format: "yyyy-MM-dd HH:mm:ss",
+ valueFormat: "yyyy-MM-dd HH:mm:ss",
+ },
+ {
+ label: "处理时间",
+ prop: "confirmTime",
+ width: 160,
+ addDisplay: false,
+ editDisplay: false,
+ type: "date",
+ format: "yyyy-MM-dd HH:mm:ss",
+ valueFormat: "yyyy-MM-dd HH:mm:ss",
+ },
+ {
+ label: "描述",
+ prop: "remark",
+ type: "textarea",
+ hide: true,
+ span: 24,
+ }
+ ],
+ },
+ data: [],
- replyPopup: false,
- replyForm: {},
- replyOption: {
- submitBtn: true,
- submitText: '确定',
- emptyBtn: true,
- emptyText: '取消',
+ replyPopup: false,
+ replyForm: {},
+ replyOption: {
+ submitBtn: true,
+ submitText: '确定',
+ emptyBtn: true,
+ emptyText: '取消',
- column: [
- {
- span: 24,
- label: "说明",
- prop: "content",
- type: 'textarea',
- minRows: 3,
- maxRows: 5,
- rules: [{
- required: true,
- message: "请输入说明",
- trigger: "blur",
- }],
- },
-
- {
- label: '处理状态',
- prop: 'confirmFlag',
- type: 'select',
- dicData: [
- {
- label: '待处理',
- value: 1
- }, {
- label: '处理中',
- value: 2
- }, {
- label: '已处理',
- value: 3
- }
- ],
- rules: [{
- required: true,
- message: "请选择处理状态",
- trigger: "blur",
- }],
- },
-
- {
- fileType: 'img',
- label: "图片",
- prop: "imageList",
- width: 80,
- type: "upload",
- listType: "picture-card",
- dataType: "string",
- multiple: true,
- action: "/api/blade-resource/oss/endpoint/put-file",
- propsHttp: {
- res: "data",
- name: 'name',
- url: "link",
- },
- span: 24,
- },
-
- {
- slot: true,
- label: "视频",
- prop: "videoList",
- span: 24,
- }
- ]
+ column: [{
+ span: 24,
+ label: "说明",
+ prop: "content",
+ type: 'textarea',
+ minRows: 3,
+ maxRows: 5,
+ rules: [{
+ required: true,
+ message: "请输入说明",
+ trigger: "blur",
+ }],
},
- turnOverPopup: false,
- turnOverForm: {},
- turnOverOption: {
- submitBtn: true,
- submitText: '确定',
- emptyBtn: true,
- emptyText: '取消',
-
- column: [
- // {
- // hide: true,
- // span: 14,
- // label: "地址",
- // prop: "addressCode",
- // },
-
- {
- span: 14,
- label: "人员类型",
- prop: "peopleType",
- type: 'select',
- dicData: [
- {
- label: '网格员',
- value: 0
- }, {
- label: '物业公司人员',
- value: 2
- }
- ],
- cascader: ["transferUserld"],
- rules: [{
- required: true,
- message: "请选择人员类型",
- trigger: "blur",
- }],
- },
-
- {
- span: 14,
- label: "指定人员",
- prop: "transferUserld",
- type: 'select',
- dicUrl: `/api/blade-system/user/getUserInfoByCode?houseCode={{addressCode}}&type={{peopleType}}`,
- props: {
- label: "name",
- value: "id",
- },
- change: ({ value, column, item, dic }) => {
- this.curPeopleDetails = {}
-
- if (value) {
- this.curPeopleDetails = item
- }
- },
- rules: [{
- required: true,
- message: "请选择指定人员",
- trigger: "blur",
- }],
- },
- ]
+ {
+ label: '处理状态',
+ prop: 'confirmFlag',
+ type: 'select',
+ dicData: [{
+ label: '待处理',
+ value: 1
+ }, {
+ label: '处理中',
+ value: 2
+ }, {
+ label: '已处理',
+ value: 3
+ }],
+ rules: [{
+ required: true,
+ message: "请选择处理状态",
+ trigger: "blur",
+ }],
},
- curRow: {},
-
- fileList: [],
- updateHeader: {
- Authorization: `Basic ${Base64.encode(`${website.clientId}:${website.clientSecret}`)}`,
- 'Blade-Auth': getToken()
+ {
+ fileType: 'img',
+ label: "图片",
+ prop: "imageList",
+ width: 80,
+ type: "upload",
+ listType: "picture-card",
+ dataType: "string",
+ multiple: true,
+ action: "/api/blade-resource/oss/endpoint/put-file",
+ propsHttp: {
+ res: "data",
+ name: 'name',
+ url: "link",
+ },
+ span: 24,
},
- curPeopleDetails: {},
+ {
+ slot: true,
+ label: "视频",
+ prop: "videoList",
+ span: 24,
+ }
+ ]
+ },
- videoFlag: false,
- videoUploadPercent: ''
- }
+ turnOverPopup: false,
+ turnOverForm: {},
+ turnOverOption: {
+ submitBtn: true,
+ submitText: '确定',
+ emptyBtn: true,
+ emptyText: '取消',
+
+ column: [
+ // {
+ // hide: true,
+ // span: 14,
+ // label: "地址",
+ // prop: "addressCode",
+ // },
+
+ {
+ span: 14,
+ label: "人员类型",
+ prop: "peopleType",
+ type: 'select',
+ dicData: [{
+ label: '网格员',
+ value: 0
+ }, {
+ label: '物业公司人员',
+ value: 2
+ }],
+ cascader: ["transferUserId"],
+ rules: [{
+ required: true,
+ message: "请选择人员类型",
+ trigger: "blur",
+ }],
+ },
+
+ {
+ span: 14,
+ label: "指定人员",
+ prop: "transferUserId",
+ type: 'select',
+ dicUrl: `/api/blade-system/user/getUserInfoByCode?houseCode={{addressCode}}&type={{peopleType}}`,
+ props: {
+ label: "name",
+ value: "id",
+ },
+ change: ({
+ value,
+ column,
+ item,
+ dic
+ }) => {
+ this.curPeopleDetails = {}
+
+ if (value) {
+ this.curPeopleDetails = item
+ }
+ },
+ rules: [{
+ required: true,
+ message: "请选择指定人员",
+ trigger: "blur",
+ }],
+ },
+ ]
+ },
+
+ curRow: {},
+
+ fileList: [],
+ updateHeader: {
+ Authorization: `Basic ${Base64.encode(`${website.clientId}:${website.clientSecret}`)}`,
+ 'Blade-Auth': getToken()
+ },
+
+ curPeopleDetails: {},
+
+ videoFlag: false,
+ videoUploadPercent: ''
+ }
},
- watch: {
- },
+ watch: {},
computed: {
- ...mapGetters(["permission", "userInfo"]),
- permissionList () {
- return {
- addBtn: this.vaildData(this.permission.reportForRepairs_add, true),
- viewBtn: this.vaildData(this.permission.reportForRepairs_view, true),
- delBtn: this.vaildData(this.permission.reportForRepairs_delete, true),
- editBtn: this.vaildData(this.permission.reportForRepairs_edit, true),
- }
- },
-
- ids () {
- let ids = []
- this.selectionList.forEach((ele) => {
- ids.push(ele.id)
- })
- return ids.join(",")
- },
-
- timeLineData () {
- return (row) => {
- let imageList = row.imageUrls
-
- if (row.taskRepairAppraiseList.length) {
- return [
- {
- createTime: row.createTime,
- mobile: row.phone,
- name: row.realName,
- imageList,
- content: row.remark,
- color: '#1890ff',
- contentType: 0,
- },
- ...row.taskRepairStepList.map((item, index) => {
- if (index == 0) {
- return {
- ...item,
- contentType: 0,
- }
- }
- return {
- ...item,
- contentType: 0
- }
- }),
- ...row.taskRepairAppraiseList.map(item => {
- return {
- ...item,
- contentType: 1
- }
- }),
- {
- contentType: 3,
- createTime: '',
- icon: 'el-icon-check',
- color: '#0bbd87'
- }
- ]
- } else {
- return [
- {
- createTime: row.createTime,
- mobile: row.phone,
- name: row.realName,
- imageList,
- content: row.remark,
- color: '#1890ff',
- contentType: 0,
- },
- ...row.taskRepairStepList.map((item, index) => {
- if (index == 0) {
- return {
- ...item,
- contentType: 0,
- }
- }
- return {
- ...item,
- contentType: 0
- }
- })
- ]
- }
- }
- },
-
- showCurImage () {
- return (data) => {
- if (data != null && data.length > 0) {
- return data.split(',').filter(item => item != '')[0]
- }
- return ''
- }
- },
-
- showImageListData () {
- return (data) => {
- if (data != null && data.length > 0) {
- return data.split(',').filter(item => item != '')
- }
- return []
- }
- },
-
- showConfirmFlag () {
- return (data) => {
- let tags = {}
-
- if (data == 1) {
- tags = {
- type: 'warning',
- text: '待处理'
- }
- } else if (data == 2) {
- tags = {
- type: '',
- text: '处理中'
- }
- } else if (data == 3) {
- tags = {
- type: 'success',
- text: '已处理'
- }
- } else if (data == 4) {
- tags = {
- type: 'success',
- text: '已评价'
- }
- }
-
- return tags
- }
+ ...mapGetters(["permission", "userInfo"]),
+ permissionList() {
+ return {
+ addBtn: this.vaildData(this.permission.reportForRepairs_add, true),
+ viewBtn: this.vaildData(this.permission.reportForRepairs_view, true),
+ delBtn: this.vaildData(this.permission.reportForRepairs_delete, true),
+ editBtn: this.vaildData(this.permission.reportForRepairs_edit, true),
}
+ },
+
+ ids() {
+ let ids = []
+ this.selectionList.forEach((ele) => {
+ ids.push(ele.id)
+ })
+ return ids.join(",")
+ },
+
+ timeLineData() {
+ return (row) => {
+ let imageList = row.imageUrls
+
+ if (row.taskRepairAppraiseList.length) {
+ return [{
+ createTime: row.createTime,
+ mobile: row.phone,
+ name: row.realName,
+ imageList,
+ content: row.remark,
+ color: '#1890ff',
+ contentType: 0,
+ },
+ ...row.taskRepairStepList.map((item, index) => {
+ if (index == 0) {
+ return {
+ ...item,
+ contentType: 0,
+ }
+ }
+ return {
+ ...item,
+ contentType: 0
+ }
+ }),
+ ...row.taskRepairAppraiseList.map(item => {
+ return {
+ ...item,
+ contentType: 1
+ }
+ }),
+ {
+ contentType: 3,
+ createTime: '',
+ icon: 'el-icon-check',
+ color: '#0bbd87'
+ }
+ ]
+ } else {
+ return [{
+ createTime: row.createTime,
+ mobile: row.phone,
+ name: row.realName,
+ imageList,
+ content: row.remark,
+ color: '#1890ff',
+ contentType: 0,
+ },
+ ...row.taskRepairStepList.map((item, index) => {
+ if (index == 0) {
+ return {
+ ...item,
+ contentType: 0,
+ }
+ }
+ return {
+ ...item,
+ contentType: 0
+ }
+ })
+ ]
+ }
+ }
+ },
+
+ showCurImage() {
+ return (data) => {
+ if (data != null && data.length > 0) {
+ return data.split(',').filter(item => item != '')[0]
+ }
+ return ''
+ }
+ },
+
+ showImageListData() {
+ return (data) => {
+ if (data != null && data.length > 0) {
+ return data.split(',').filter(item => item != '')
+ }
+ return []
+ }
+ },
+
+ showConfirmFlag() {
+ return (data) => {
+ let tags = {}
+
+ if (data == 1) {
+ tags = {
+ type: 'warning',
+ text: '待处理'
+ }
+ } else if (data == 2) {
+ tags = {
+ type: '',
+ text: '处理中'
+ }
+ } else if (data == 3) {
+ tags = {
+ type: 'success',
+ text: '已处理'
+ }
+ } else if (data == 4) {
+ tags = {
+ type: 'success',
+ text: '已评价'
+ }
+ }
+
+ return tags
+ }
+ }
},
methods: {
- popupClose () {
- this.$refs.replyForm && this.$refs.replyForm.resetForm()
- this.$refs.turnOverForm && this.$refs.turnOverForm.resetForm()
- },
+ popupClose() {
+ this.$refs.replyForm && this.$refs.replyForm.resetForm()
+ this.$refs.turnOverForm && this.$refs.turnOverForm.resetForm()
+ },
- saveReply (data, done) {
- saveReply(data).then(
- () => {
- this.replyPopup = false
- this.turnOverPopup = false
- this.onLoad(this.page)
- this.$message({
- type: "success",
- message: "操作成功!",
- })
- done()
- },
- (error) => {
- window.console.log(error)
- }
- )
- },
-
- handleSubmit (form, done) {
- this.saveReply({
- ...form,
- videoList: this.fileList.map(item => item.response.data.link).join(','),
- repairId: this.curRow.id,
- peopleType: 0,
- mobile: this.userInfo.phone
- }, done)
- },
-
- handleReset () {
- this.fileList = []
+ saveReply(data, done) {
+ saveReply(data).then(
+ () => {
this.replyPopup = false
- },
-
- turnOverHandleSubmit (form, done) {
- let content = ''
-
- if (form.peopleType == 0) {
- content = `事件已移交至 网格员 李伟`
- } else if (form.peopleType == 2) {
- content = `事件已移交至 物业公司人员 ${this.curPeopleDetails.distictName || ''}${this.curPeopleDetails.name}`
- }
-
- this.saveReply({
- ...form,
- confirmFlag: 1,
- content,
- peopleType: 1,
- repairId: this.curRow.id,
- }, done)
- },
-
- turnOverHandleReset () {
this.turnOverPopup = false
- },
-
- //移除
- beforeRemove (file, fileList) {
- return this.$confirm(`确定移除 ${file.name}?`).then(() => {
- this.fileList = fileList
- })
- },
-
- //上传
- getFile (file, fileList) {
- this.fileList = fileList
- },
-
- beforeUploadVideo (file) {
- const isLt50M = file.size / 1024 / 1024 < 50
- if (['video/mp4'].indexOf(file.type) == -1) {
- this.$message.error('上传视频只能是 mp4 格式!')
- return false
- }
- if (!isLt50M) {
- this.$message.error('上传视频大小不能超过 50MB!')
- return false
- }
- return true
- },
-
- handleExceed (files, fileList) {
- this.$message.warning("目前只能上传一个视频文件")
- },
-
- uploadVideoProcess (event, file, fileList) {
- console.log(event, file, fileList, this.fileList)
- },
-
- replyBtnClick (row) {
- this.curRow = row
- this.replyForm = {}
- this.replyPopup = true
- },
-
- turnOverBtnClick (row) {
- this.curRow = row
- this.turnOverForm = {
- addressCode: row.addressCode
- }
- this.turnOverPopup = true
- },
-
- rowSave (row, done, loading) {
- if (row.imageUrls.length > 0) {
- var urls = []
- var split = row.imageUrls.split(",")
- split.forEach(url => {
- var names = url.split("jczz/")
- urls.push(names[1])
- })
- row.imageUrls = urls.join(",")
- }
- add(row).then(
- () => {
- this.onLoad(this.page)
- this.$message({
- type: "success",
- message: "操作成功!",
- })
- done()
- },
- (error) => {
- window.console.log(error)
- loading()
- }
- )
- },
- rowUpdate (row, index, done, loading) {
- if (row.imageUrls.length > 0) {
- var urls = []
- var split = row.imageUrls.split(",")
- split.forEach(url => {
- var names = url.split("jczz/")
- urls.push(names[1])
- })
- row.imageUrls = urls.join(",")
- }
- update(row).then(
- () => {
- this.onLoad(this.page)
- this.$message({
- type: "success",
- message: "操作成功!",
- })
- done()
- },
- (error) => {
- window.console.log(error)
- loading()
- }
- )
- },
- rowDel (row) {
- this.$confirm("确定将选择数据删除?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(() => {
- return remove(row.id)
- })
- .then(() => {
- this.onLoad(this.page)
- this.$message({
- type: "success",
- message: "操作成功!",
- })
- })
- },
- searchReset () {
- this.query = {}
this.onLoad(this.page)
- },
- searchChange (params, done) {
- this.query = params
- this.page.currentPage = 1
- this.onLoad(this.page, params)
- done()
- },
- selectionChange (list) {
- this.selectionList = list
- },
- selectionClear () {
- this.selectionList = []
- this.$refs.crud.toggleSelection()
- },
- handleDelete () {
- if (this.selectionList.length === 0) {
- this.$message.warning("请选择至少一条数据")
- return
- }
- this.$confirm("确定将选择数据删除?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
+ this.$message({
+ type: "success",
+ message: "操作成功!",
})
- .then(() => {
- return remove(this.ids)
- })
- .then(() => {
- this.onLoad(this.page)
- this.$message({
- type: "success",
- message: "操作成功!",
- })
- this.$refs.crud.toggleSelection()
- })
- },
- beforeOpen (done, type) {
- if (["edit", "view"].includes(type)) {
- getReportForRepairs(this.form.id).then((res) => {
- this.form = res.data.data
- if (this.form.imageUrls) {
- if (this.form.imageUrls.length > 0) {
- var urls = []
- var names = this.form.imageUrls.split(",")
- names.forEach(name => {
- urls.push(website.minioUrl + name)
- })
- this.form.imageUrls = urls.join(",")
- }
- }
- })
- }
+ done()
+ },
+ (error) => {
+ window.console.log(error)
+ }
+ )
+ },
- done()
- },
- currentChange (currentPage) {
- this.page.currentPage = currentPage
- },
- sizeChange (pageSize) {
- this.page.pageSize = pageSize
- },
- refreshChange () {
- this.onLoad(this.page, this.query)
- },
- onLoad (page, params = {}) {
- const { dateTime } = this.query
- let values = {
- ...params,
- }
- if (dateTime) {
- values = {
- ...params,
- startTime: dateTime[0],
- endTime: dateTime[1],
- ...this.query,
- }
- values.dateTime = null
- }
- this.loading = true
- getList(page.currentPage, page.pageSize, values).then((res) => {
- const data = res.data.data
- this.page.total = data.total
- this.data = data.records
- this.data.forEach(item => {
- if (item.imageUrls) {
- if (item.imageUrls.length > 0) {
- var urls = []
- var names = item.imageUrls.split(",")
- names.forEach(name => {
- urls.push(website.minioUrl + name)
- })
- item.imageUrls = urls.join(",")
- }
- }
- })
- this.loading = false
- this.selectionClear()
- })
+ handleSubmit(form, done) {
+ this.saveReply({
+ ...form,
+ videoList: this.fileList.map(item => item.response.data.link).join(','),
+ repairId: this.curRow.id,
+ peopleType: 0,
+ mobile: this.userInfo.phone
+ }, done)
+ },
+
+ handleReset() {
+ this.fileList = []
+ this.replyPopup = false
+ },
+
+ turnOverHandleSubmit(form, done) {
+ let content = ''
+
+ if (form.peopleType == 0) {
+ content = `事件已移交至 网格员 ${this.curPeopleDetails.name}`
+ } else if (form.peopleType == 2) {
+ content = `事件已移交至 物业公司人员 ${this.curPeopleDetails.distictName || ''}${this.curPeopleDetails.name}`
}
+
+ this.saveReply({
+ ...form,
+ confirmFlag: 1,
+ content,
+ peopleType: 1,
+ repairId: this.curRow.id,
+ }, done)
+ },
+
+ turnOverHandleReset() {
+ this.turnOverPopup = false
+ },
+
+ //移除
+ beforeRemove(file, fileList) {
+ return this.$confirm(`确定移除 ${file.name}?`).then(() => {
+ this.fileList = fileList
+ })
+ },
+
+ //上传
+ getFile(file, fileList) {
+ this.fileList = fileList
+ },
+
+ beforeUploadVideo(file) {
+ const isLt50M = file.size / 1024 / 1024 < 50
+ if (['video/mp4'].indexOf(file.type) == -1) {
+ this.$message.error('上传视频只能是 mp4 格式!')
+ return false
+ }
+ if (!isLt50M) {
+ this.$message.error('上传视频大小不能超过 50MB!')
+ return false
+ }
+ return true
+ },
+
+ handleExceed(files, fileList) {
+ this.$message.warning("目前只能上传一个视频文件")
+ },
+
+ uploadVideoProcess(event, file, fileList) {
+ console.log(event, file, fileList, this.fileList)
+ },
+
+ replyBtnClick(row) {
+ this.curRow = row
+ this.replyForm = {}
+ this.replyPopup = true
+ },
+
+ turnOverBtnClick(row) {
+ this.curRow = row
+ this.turnOverForm = {
+ addressCode: row.addressCode
+ }
+ this.turnOverPopup = true
+ },
+
+ rowSave(row, done, loading) {
+ if (row.imageUrls.length > 0) {
+ var urls = []
+ var split = row.imageUrls.split(",")
+ split.forEach(url => {
+ var names = url.split("jczz/")
+ urls.push(names[1])
+ })
+ row.imageUrls = urls.join(",")
+ }
+ add(row).then(
+ () => {
+ this.onLoad(this.page)
+ this.$message({
+ type: "success",
+ message: "操作成功!",
+ })
+ done()
+ },
+ (error) => {
+ window.console.log(error)
+ loading()
+ }
+ )
+ },
+ rowUpdate(row, index, done, loading) {
+ if (row.imageUrls.length > 0) {
+ var urls = []
+ var split = row.imageUrls.split(",")
+ split.forEach(url => {
+ var names = url.split("jczz/")
+ urls.push(names[1])
+ })
+ row.imageUrls = urls.join(",")
+ }
+ update(row).then(
+ () => {
+ this.onLoad(this.page)
+ this.$message({
+ type: "success",
+ message: "操作成功!",
+ })
+ done()
+ },
+ (error) => {
+ window.console.log(error)
+ loading()
+ }
+ )
+ },
+ rowDel(row) {
+ this.$confirm("确定将选择数据删除?", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning",
+ })
+ .then(() => {
+ return remove(row.id)
+ })
+ .then(() => {
+ this.onLoad(this.page)
+ this.$message({
+ type: "success",
+ message: "操作成功!",
+ })
+ })
+ },
+ searchReset() {
+ this.query = {}
+ this.onLoad(this.page)
+ },
+ searchChange(params, done) {
+ this.query = params
+ this.page.currentPage = 1
+ this.onLoad(this.page, params)
+ done()
+ },
+ selectionChange(list) {
+ this.selectionList = list
+ },
+ selectionClear() {
+ this.selectionList = []
+ this.$refs.crud.toggleSelection()
+ },
+ handleDelete() {
+ if (this.selectionList.length === 0) {
+ this.$message.warning("请选择至少一条数据")
+ return
+ }
+ this.$confirm("确定将选择数据删除?", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning",
+ })
+ .then(() => {
+ return remove(this.ids)
+ })
+ .then(() => {
+ this.onLoad(this.page)
+ this.$message({
+ type: "success",
+ message: "操作成功!",
+ })
+ this.$refs.crud.toggleSelection()
+ })
+ },
+ beforeOpen(done, type) {
+ if (["edit", "view"].includes(type)) {
+ getReportForRepairs(this.form.id).then((res) => {
+ this.form = res.data.data
+ if (this.form.imageUrls) {
+ if (this.form.imageUrls.length > 0) {
+ var urls = []
+ var names = this.form.imageUrls.split(",")
+ names.forEach(name => {
+ urls.push(website.minioUrl + name)
+ })
+ this.form.imageUrls = urls.join(",")
+ }
+ }
+ })
+ }
+
+ done()
+ },
+ currentChange(currentPage) {
+ this.page.currentPage = currentPage
+ },
+ sizeChange(pageSize) {
+ this.page.pageSize = pageSize
+ },
+ refreshChange() {
+ this.onLoad(this.page, this.query)
+ },
+ onLoad(page, params = {}) {
+ const {
+ dateTime
+ } = this.query
+ let values = {
+ ...params,
+ }
+ if (dateTime) {
+ values = {
+ ...params,
+ startTime: dateTime[0],
+ endTime: dateTime[1],
+ ...this.query,
+ }
+ values.dateTime = null
+ }
+ this.loading = true
+ getList(page.currentPage, page.pageSize, values).then((res) => {
+ const data = res.data.data
+ this.page.total = data.total
+ this.data = data.records
+ this.data.forEach(item => {
+ if (item.imageUrls) {
+ if (item.imageUrls.length > 0) {
+ var urls = []
+ var names = item.imageUrls.split(",")
+ names.forEach(name => {
+ urls.push(website.minioUrl + name)
+ })
+ item.imageUrls = urls.join(",")
+ }
+ }
+ })
+ this.loading = false
+ this.selectionClear()
+ })
+ }
},
-}
+ }
</script>
<style>
-.avue-upload__icon {
+ .avue-upload__icon {
line-height: 6;
-}
-</style>
+ }
+</style>
\ No newline at end of file
--
Gitblit v1.9.3