From d16d10d94fddff86bdfd87113e7fd2cebe8b7cd7 Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Wed, 24 Jan 2024 18:15:06 +0800
Subject: [PATCH] 居民监管样式调整

---
 src/views/task/reportForRepairs.vue |  264 ++++++++++++++++++++++++++++++++--------------------
 1 files changed, 160 insertions(+), 104 deletions(-)

diff --git a/src/views/task/reportForRepairs.vue b/src/views/task/reportForRepairs.vue
index 5914901..de0c335 100644
--- a/src/views/task/reportForRepairs.vue
+++ b/src/views/task/reportForRepairs.vue
@@ -2,7 +2,7 @@
  * @Author: shuishen 1109946754@qq.com
  * @Date: 2023-12-14 17:10:00
  * @LastEditors: shuishen 1109946754@qq.com
- * @LastEditTime: 2024-01-02 10:14:01
+ * @LastEditTime: 2024-01-09 18:59:37
  * @FilePath: \jczz_web\src\views\task\reportForRepairs.vue
  * @Description:
  *
@@ -16,13 +16,13 @@
             :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">
+            <template slot="confirmFlag" slot-scope="{row, size}">
+                <el-tag :size="size" :type="showConfirmFlag(row.confirmFlag).type">
                     {{ showConfirmFlag(row.confirmFlag).text }}
                 </el-tag>
             </template>
 
-            <template slot="expand" slot-scope="{row}">
+            <template slot="expand" slot-scope="{row, size}">
                 <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">
@@ -67,26 +67,24 @@
                 </el-timeline>
             </template>
 
-            <template slot-scope="scope" slot="menu">
-                <el-button v-if="permission.report_for_repairs_details" size="small" type="text"
-                    icon="el-icon-document-remove" @click="rowExpansion(scope.row)">
+            <template slot-scope="{row, size, index}" slot="menu">
+                <el-button :size="size" v-if="permission.report_for_repairs_details" type="text"
+                    icon="el-icon-document-remove" @click="rowExpansion(row)">
                     详情
                 </el-button>
 
-                <el-button v-if="permission.report_for_repairs_reply" size="small" type="text"
-                    icon="el-icon-chat-dot-square" :disabled="scope.row.confirmFlag === 3"
-                    @click="replyBtnClick(scope.row)">
+                <el-button :size="size" v-if="permission.report_for_repairs_reply" type="text"
+                    icon="el-icon-chat-dot-square" :disabled="row.confirmFlag === 3" @click="replyBtnClick(row)">
                     回复
                 </el-button>
 
-                <el-button v-if="permission.report_for_repairs_turn_over" size="small" type="text"
-                    icon="el-icon-document-copy" :disabled="scope.row.confirmFlag === 3"
-                    @click="turnOverBtnClick(scope.row)">
+                <el-button :size="size" v-if="permission.report_for_repairs_turn_over" type="text"
+                    icon="el-icon-document-copy" :disabled="row.confirmFlag === 3" @click="turnOverBtnClick(row)">
                     移交
                 </el-button>
 
-                <el-button v-if="permission.report_for_repairs_del" size="small" type="text" icon="el-icon-delete"
-                    @click="rowDel(scope.row)">
+                <el-button :size="size" v-if="permission.report_for_repairs_del" type="text" icon="el-icon-delete"
+                    @click="rowDel(row)">
                     删除
                 </el-button>
             </template>
@@ -143,6 +141,17 @@
 
 export default {
     data () {
+        let validatorPhone = function (rule, value, callback) {
+            if (value) {
+                if (!/^1[3456789]\d{9}$/.test(value)) {
+                    callback(new Error('手机号格式有误!'))
+                } else {
+                    callback()
+                }
+            }
+            callback()
+        }
+
         return {
             colors: ['#99A9BF', '#F7BA2A', '#FF9900'],
             form: {},
@@ -156,6 +165,12 @@
             datetime: "",
             selectionList: [],
             option: {
+                labelWidth: 96,
+                searchLabelWidth: 96,
+                searchShow: true,
+                searchMenuSpan: 3,
+                menuWidth: 280,
+
                 viewBtn: false,
                 editBtn: false,
                 delBtn: false,
@@ -166,100 +181,107 @@
                 calcHeight: 54,
                 dialogWidth: 950,
                 tip: false,
-                searchShow: true,
-                searchMenuSpan: 3,
-                menuWidth: 272,
                 border: true,
                 //stripe: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",
+                column: [
+                    {
+                        width: 100,
+                        label: "类型",
+                        prop: "type",
+                        span: 12,
+                        searchLabelWidth: 66,
+                        searchSpan: 4,
+                        search: true,
+                        dataType: "number",
+                        type: "select",
+                        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",
+                    {
+                        width: 110,
+                        label: "姓名",
+                        prop: "realName",
+                        span: 12,
+                        searchSpan: 4,
+                        searchLabelWidth: 66,
+                        search: true,
                     },
-                    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,
-                }
+
+                    {
+                        width: 120,
+                        label: "手机号码",
+                        prop: "phone",
+                        search: true,
+                        searchSpan: 4,
+                        slot: true,
+                        rules: [{
+                            validator: validatorPhone,
+                            trigger: 'blur'
+                        }],
+                    },
+
+                    {
+                        width: 110,
+                        label: "图片",
+                        prop: "imageUrls",
+                        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,
+                    },
+                    {
+                        overHidden: true,
+                        label: "地点",
+                        prop: "addressName",
+                    },
+                    {
+                        width: 100,
+                        label: "状态",
+                        addDisplay: false,
+                        editDisplay: false,
+                        slot: true,
+                        prop: "confirmFlag",
+                        overHidden: true
+                    },
+                    {
+                        width: 144,
+                        label: "上报时间",
+                        prop: "createTime",
+                        addDisplay: false,
+                        editDisplay: false,
+                        type: "date",
+                        format: "yyyy-MM-dd HH:mm:ss",
+                        valueFormat: "yyyy-MM-dd HH:mm:ss",
+                    },
+                    {
+                        width: 144,
+                        label: "处理时间",
+                        prop: "confirmTime",
+                        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: [],
@@ -308,10 +330,10 @@
                 },
 
                 {
+                    width: 110,
                     fileType: 'img',
                     label: "图片",
                     prop: "imageList",
-                    width: 80,
                     type: "upload",
                     listType: "picture-card",
                     dataType: "string",
@@ -578,6 +600,26 @@
         },
 
         handleSubmit (form, done) {
+
+            if (form.imageList.length > 0) {
+                var urls = []
+                var split = form.imageList.split(",").filter(item => item != '')
+                split.forEach(url => {
+                    var names = url.split("jczz/")
+                    urls.push(names[1])
+                })
+                form.imageList = urls.join(",")
+            }
+            // if (form.imageList.length > 0) {
+            //   var urls = []
+            //   var split = form.imageList.split(",").filter(item => item != '')
+            //   split.forEach(url => {
+            //     var names = url.split("jczz/")
+            //     urls.push(names[1])
+            //   })
+            //   form.imageList = urls.join(",")
+            // }
+
             this.saveReply({
                 ...form,
                 videoList: this.fileList.map(item => item.response.data.link).join(','),
@@ -827,6 +869,20 @@
                             item.imageUrls = urls.join(",")
                         }
                     }
+                    if (item.taskRepairStepList.length > 0) {
+                        item.taskRepairStepList.forEach(ee => {
+                            if (ee.imageList) {
+                                if (ee.imageList.length > 0) {
+                                    var urls = []
+                                    var names = ee.imageList.split(",")
+                                    names.forEach(name => {
+                                        urls.push(website.minioUrl + name)
+                                    })
+                                    ee.imageList = urls.join(",")
+                                }
+                            }
+                        })
+                    }
                 })
                 this.loading = false
                 this.selectionClear()

--
Gitblit v1.9.3