Kaynağa Gözat

Merge branch 'dev' of git.sagacloud.cn:yunxing/wanda-bm-guide-h5 into dev

zhangyu 4 yıl önce
ebeveyn
işleme
c147352628

+ 24 - 0
src/api/overview.js

@@ -11,3 +11,27 @@ export function queryRecordCount({ getParams }) {
 export function queryEventypes({ data, postParams }) {
     return httputils.fetchJson(`/data/base/queryOptions`, data, postParams)
 }
+// 说明书变更记录
+export function getChangeList({ getParams }) {
+    return httputils.getJson(`/data/rpt_change_record/query`, getParams)
+}
+/**
+ * 变更记录详情接口
+ *
+ */
+// 1. 维保
+export function getUpdateDetail1({ getParams }) {
+    return httputils.getJson(`/data/sms_wbsms/query`, getParams)
+}
+// 2.维修
+export function getUpdateDetail4({ getParams }) {
+    return httputils.getJson(`/data/sms_wx/query`, getParams)
+}
+// 其他事项
+export function getUpdateDetail5({ getParams }) {
+    return httputils.getJson(`/data/sms_qtsx/query`, getParams)
+}
+// 综合事项
+export function getUpdateDetail3({ getParams }) {
+    return httputils.getJson(`/data/sms_zhsxjl/query`, getParams)
+}

+ 8 - 0
src/store/index.ts

@@ -16,6 +16,13 @@ export default new Vuex.Store({
         isMessage: true, //是否有发布的图
         bunkObj: {}, // 铺位名称
         floorsArr: [], //楼层数组
+        // 事件类型字典
+        objtypeDict: {
+            1: '重要维保',
+            3: '综合事项',
+            4: '重要维修',
+            5: '其他事项',
+        },
     },
     getters: {
         ssoToken: (state) => state.ssoToken,
@@ -25,6 +32,7 @@ export default new Vuex.Store({
         haveFengMap: (state) => state.haveFengMap,
         isMessage: (state) => state.isMessage,
         bunkObj: (state) => state.bunkObj,
+        objtypeDict: (state) => state.objtypeDict,
     },
     mutations: {
         SETSSOTOKEN(state, data) {

+ 214 - 99
src/views/overview/UpdateRecord.vue

@@ -2,30 +2,31 @@
     <div class='update-record'>
         <van-nav-bar title='说明书更新记录' left-arrow @click-left='backPage' />
         <van-dropdown-menu active-color='#1989fa'>
-            <van-dropdown-item v-model='objType' :options='option' />
+            <van-dropdown-item v-model='objtype' :options='option' @change='handleObjTypeChange' />
         </van-dropdown-menu>
         <div class='record'>
             <!-- 引入list,触底更新 -->
-            <van-list class='record-list' v-model='loading' :finished='finished' finished-text='没有更多了' @load='onLoad'>
-                <div class='info' v-for='i in list' :key='i'>
+            <van-list class='record-list' v-model='loading' :finished='finished' finished-text='没有更多了' :immediate-check='false' @load='onLoad'>
+                <div class='info' v-for='(item,index) in list' :key='index'>
                     <div class='left'>
                         <div class='dot'></div>
                         <div class='line'></div>
                     </div>
                     <div class='right'>
                         <div class='title'>
-                            <span class='date'>2020.08.19 {{i}}</span>
+                            <span class='date'>{{item[0].date}}</span>
                         </div>
-                        <div class='content' @click='goToDetailInfo'>
-                            <p class='type'>重要维保</p>
-                            <p>电梯系统-货梯-3-报停后的维保管理建筑-3#直梯光幕更换</p>
+                        <div class='content' v-for='(detail,dIndex) in item' :key='dIndex' @click='goToDetailInfo(detail)'>
+                            <p class='type'>{{objtypeDict[detail.objtype]}}</p>
+                            <p>{{detail.content}}</p>
                         </div>
-                        <div class='content' v-if='i===1'>
+                        <!-- <div class='content'>
                             <p class='type'>重要维修</p>
                             <p>电梯系统-货梯-3-报停后的维保管理建筑-3#直梯光幕更换</p>
-                        </div>
+                        </div>-->
                     </div>
                 </div>
+                <!-- <div class='m-load-more' v-show='!finished && list.length && list.length<=5 && page === 1' @click='onLoad'>加载更多</div> -->
             </van-list>
         </div>
     </div>
@@ -40,54 +41,45 @@ Vue.use(NavBar)
 Vue.use(DropdownMenu).use(DropdownItem)
 Vue.use(List)
 import { mapGetters } from 'vuex'
-// import { getChangeList } from '@/api/homePage'
-import { queryEventypes } from '@/api/overview'
+import { queryEventypes, getChangeList } from '@/api/overview'
 import { querySelect } from '@/api/public'
-
+import moment from 'moment'
+import { flattenDeep } from 'lodash'
 export default {
     name: 'UpdateRecord',
     props: {},
     components: {},
     data() {
         return {
-            objType: 0,
+            objtype: 0,
             option: [
-                { text: '全部', value: 0 },
-                { text: '重要维保', value: 1 },
-                { text: '重要维修', value: 4 },
-                { text: '其他事项', value: 5 },
-                { text: '综合事项', value: 3 },
+                // { text: '全部', value: 0 },
+                // { text: '重要维保', value: 1 },
+                // { text: '重要维修', value: 4 },
+                // { text: '其他事项', value: 5 },
+                // { text: '综合事项', value: 3 },
             ],
-            // 1: '重要维保',
-            // 3: '综合事项',
-            // 4: '重要维修',
-            // 5: '其他事项',
             list: [],
             loading: false,
             finished: false,
+            page: 1,
+            count: 0,
         }
     },
     computed: {
-        ...mapGetters(['plazaId']),
+        ...mapGetters(['plazaId', 'objtypeDict']),
     },
     created() {
-        let params = {
-            getParams: {
-                plazaId: this.plazaId,
-                page: 1,
-                size: 100,
-            },
-        }
-        getChangeList(params).then((res) => {
-            console.log(res)
-        })
+        // 查询更新记录列表
+        this.getList()
+        // 查询下拉菜单
         this.querySelect()
     },
     beforeMount() {},
     mounted() {},
     methods: {
         /**
-         *
+         * 查询事件类型 下拉菜单
          */
         async querySelect() {
             let data = {
@@ -102,32 +94,143 @@ export default {
                     },
                 ]
             let resData = await queryEventypes({ data, postParams })
+            let objtype = resData?.data?.data?.rpt_change_record?.objtype
             console.log('%c======', 'color:blue')
-            console.log(resData)
+            console.log(objtype)
+            objtype.map((item) => (item.text = this.objtypeDict[item.value]))
+            let option = [{ text: '全部', value: 0 }, ...objtype]
+            // 下拉菜单按照  重要维保、重要维修、其他事项、综合事项 排序
+            let orderDict = {
+                0: 0,
+                1: 1,
+                4: 2,
+                5: 3,
+                3: 4,
+            }
+            this.option = option.sort((a, b) => orderDict[a.value] - orderDict[b.value])
+        },
+        /**
+         * 查询列表
+         */
+        async getList() {
+            let getParams = {
+                plazaId: this.plazaId,
+                page: this.page,
+                size: 5,
+                // TODO: 一年 改一个月
+                changeDateStartDate: moment().subtract(1, 'years').format('YYYYMMDD000000'), //变更记录开始时间 格式yyyyMMddHHmiss 必填
+                changeDateEndDate: moment().format('YYYYMMDD000000'), //变更记录结束时间 格式yyyyMMddHHmiss 必填
+            }
+            if (this.objtype !== 0) {
+                getParams.objtype = this.objtype
+            }
+            let res = await getChangeList({ getParams })
+            if (!res) {
+                this.list = this.list.concat([])
+                return false
+            }
+            this.count = res.count
+            let listArr = res?.data || []
+            // 处理时间
+            listArr.map((item) => {
+                item.date = moment(item.create_date_time).format('YYYY.MM.DD')
+            })
+            /**
+             * 按照时间,构造二维数据
+             */
+            let list = [],
+                __index = 0
+            list[0] = [listArr[0]]
+            listArr.map((item, index) => {
+                if (index >= 1) {
+                    if (item.date === list[__index][0].date) {
+                        list[__index].push(item)
+                    } else {
+                        __index++
+                        list[__index] = [item]
+                    }
+                }
+            })
+            // console.log(JSON.stringify(list, null, 2))
+            // 第一页,直接设置list
+            // debugger
+            if (this.page === 1) {
+                this.list = list
+            } else {
+                // 第二页之后
+                // 将第一页,与第二页合并,并处理两页中时间一直的数据
+                const { length } = this.list
+                if (this.list[length - 1][0].date === list[0][0].date) {
+                    this.list = [...this.list.slice(0, length - 1), flattenDeep([this.list.slice(-1).concat(list.slice(0, 1))]), ...list.slice(1)]
+                } else {
+                    this.list = this.list.concat(list)
+                }
+            }
+            console.log(this.list)
+        },
+        handleObjTypeChange(data) {
+            console.log(data)
+            this.initData()
+            this.getList()
+        },
+        /**
+         * 更改下拉菜单,初始化数据
+         */
+        initData() {
+            this.page = 1
+            this.finished = false
+            this.loading = false
+            this.count = 0
+            this.list = []
         },
         // 返回上一个页面(项目概况)
         backPage() {
             this.$router.go(-1)
         },
-        goToDetailInfo() {
-            this.$router.push({ name: 'UpdateRecordDetail', params: { a: 1 } })
+        /**
+         * @param { Object } info 某一天更新记录的参数
+         *  changedate: 1599646777000
+            content: "消防系统-商业楼/3F/室内步行街/店铺/1-消防电系统/厨房自动灭火设备-1号-动火离人设施的增设或拆除-设备拆除"
+            create_date_time: 1599688281000
+            date: "2020.09.10"
+            diff: "out"
+            gname: "f3"
+            id: 3357
+            objid: "4932999"
+            objtype: 4
+            seq: "2"
+            siteid: "1000423"
+            smsxt: "1003"
+         */
+        goToDetailInfo(info) {
+            console.log(info)
+            this.$router.push({ name: 'UpdateRecordDetail', params: { info } })
         },
-        onLoad() {
+        /**
+         * 同步延迟器
+         * @param { Number } timeout 延迟时间,ms
+         */
+        async sleep(timeout) {
+            await new Promise((resolve) => {
+                setTimeout(() => {
+                    resolve()
+                }, timeout)
+            })
+        },
+        async onLoad() {
+            await this.sleep(1000)
+            this.page++
             // 异步更新数据
-            // setTimeout 仅做示例,真实场景中一般为 ajax 请求
-            setTimeout(() => {
-                for (let i = 0; i < 5; i++) {
-                    this.list.push(this.list.length + 1)
-                }
-
-                // 加载状态结束
-                this.loading = false
-
-                // 数据全部加载完成
-                if (this.list.length >= 40) {
-                    this.finished = true
-                }
-            }, 1000)
+            await this.getList()
+            // 加载状态结束
+            this.loading = false
+            // 获取平铺后list的总条数
+            const { length } = flattenDeep(this.list)
+            // 查询完成
+            if (length >= this.count) {
+                this.finished = true
+            }
+            console.log(this.loading, this.finished)
         },
     },
 }
@@ -152,62 +255,74 @@ export default {
         .record-list {
             width: 100%;
             height: 100%;
-        }
-        .info {
-            width: 100%;
-            height: auto;
-            display: flex;
-            .left {
-                width: 8px;
-                height: auto;
+            .info {
+                width: 100%;
+                // TODO:
+                // min-height: 103%;
+                // min-height: 100px;
+                // background-color: chartreuse;
                 display: flex;
-                flex-direction: column;
-                .dot {
-                    margin-top: 6px;
+                .left {
                     width: 8px;
-                    height: 8px;
-                    background-color: #025baa;
-                    border-radius: 50%;
+                    height: auto;
+                    display: flex;
+                    flex-direction: column;
+                    .dot {
+                        margin-top: 6px;
+                        width: 8px;
+                        height: 8px;
+                        background-color: #025baa;
+                        border-radius: 50%;
+                    }
+                    .line {
+                        margin: 0 auto;
+                        width: 2px;
+                        flex: 1;
+                        margin-top: 6px;
+                        background: #dcdcdc;
+                        // background-color: red;
+                    }
                 }
-                .line {
-                    margin: 0 auto;
-                    width: 2px;
+                .right {
                     flex: 1;
-                    margin-top: 6px;
-                    background: #dcdcdc;
-                    // background-color: red;
-                }
-            }
-            .right {
-                flex: 1;
-                padding-left: 10px;
-                padding-bottom: 30px;
-                .title {
-                    width: 100%;
-                    height: 20px;
-                    font-size: 14px;
-                    font-weight: 400;
-                    color: #666666;
-                    .type {
-                        margin-left: 15px;
+                    padding-left: 10px;
+                    padding-bottom: 30px;
+                    .title {
+                        width: 100%;
+                        height: 20px;
+                        font-size: 14px;
+                        font-weight: 400;
+                        color: #666666;
+                        .type {
+                            margin-left: 15px;
+                        }
                     }
-                }
-                .content {
-                    width: 100%;
-                    height: 95px;
-                    margin-top: 8px;
-                    font-size: 14px;
-                    font-weight: 400;
-                    color: #333333;
-                    line-height: 25px;
-                    background-color: #fff;
-                    padding: 12px 10px;
-                    .type {
-                        font-weight: 500;
+                    .content {
+                        width: 100%;
+                        height: auto;
+                        margin-top: 8px;
+                        font-size: 14px;
+                        font-weight: 400;
                         color: #333333;
+                        line-height: 25px;
+                        background-color: #fff;
+                        padding: 12px 10px;
+                        .type {
+                            font-weight: 500;
+                            color: #333333;
+                        }
                     }
                 }
             }
+            // 加载更多
+            .m-load-more {
+                width: 100%;
+                height: 20px;
+                line-height: 20px;
+                margin-top: 20px;
+                font-size: 14px;
+                text-align: center;
+            }
         }
     }
 }

+ 193 - 47
src/views/overview/UpdateRecordDetail.vue

@@ -4,79 +4,113 @@
     <div class='update-record-detail'>
         <van-nav-bar :title='title' left-arrow @click-left='backPage' />
         <div class='info'>
-            <i class='iconfont wanda-nuantong2'></i>
-            <!-- 维保/维修 -->
-            <div v-if='type === 1' class='container-1'>
+            <!-- <i class='iconfont wanda-nuantong2'></i> -->
+            <!-- 维保 -->
+            <div v-if='type === 1 ' class='container-1'>
                 <div class='date'>
                     <div class='report-date'>
                         <span>填报时间</span>
-                        <span>2020-08-25</span>
+                        <span>{{data.tbDate || '--'}}</span>
                     </div>
                     <div class='acceptance-date'>
                         <span>验收日期</span>
-                        <span>2020-08-29</span>
+                        <span>{{data.ysDate || '--'}}</span>
                     </div>
                 </div>
-                <div class='detail'>此处显示事项描述的具体内容,内容过多时自动折行,直到全部显示完成,卡片无固定高度,根据事项描述内容进行自适应高度</div>
+                <div class='detail'>{{data.matters || '--'}}</div>
                 <ul class='card'>
-                    <li class='title'>更换配件</li>
-                    <li class='name-model'>配件名称型号:VX00223-123</li>
-                    <li class='cost'>费用出处:重点设备维修保养资金</li>
+                    <!-- <li class='title'>更换配件</li> -->
+                    <li class='title'>{{data.description || '--'}}</li>
+                    <li class='name-model'>配件名称型号:{{data.model||'--'}}</li>
+                    <!-- <li class='cost'>费用出处:重点设备维修保养资金</li> -->
+                    <li class='cost'>费用出处:{{data.source ||'--'}}</li>
                     <li class='num-amount'>
-                        <span>数量: 2个</span>
-                        <span>金额: 1.5万元</span>
+                        <span>数量: {{data.sl || '--'}}个</span>
+                        <span>金额: {{data.cost ||'--'}}万元</span>
                     </li>
                 </ul>
                 <div class='bottom'>
-                    <div class='photo' @click='showPhoto'>现场照片: 3张</div>
-                    <div class='task-No' @click='showTaskInfo'>任务编号: 230238</div>
+                    <div class='photo' @click='showPhoto'>现场照片: {{imgList.length || '--'}}张</div>
+                    <div class='task-No' @click='showTaskInfo'>任务编号: {{data.wb_gzglid || '--'}}</div>
+                </div>
+            </div>
+            <!-- 维修 -->
+            <div v-else-if='type===4' class='container-1'>
+                <div class='date'>
+                    <div class='report-date'>
+                        <span>填报时间</span>
+                        <span>{{data.tbDate || '--'}}</span>
+                    </div>
+                    <div class='acceptance-date'>
+                        <span>验收日期</span>
+                        <span>{{data.ysDate || '--'}}</span>
+                    </div>
+                </div>
+                <div class='detail'>{{data.matters || '--'}}</div>
+                <ul class='card'>
+                    <!-- <li class='title'>更换配件</li> -->
+                    <li class='title'>{{data.description || '--'}}</li>
+                    <li class='name-model'>配件名称型号:{{data.model || '--'}}</li>
+                    <!-- <li class='cost'>费用出处:重点设备维修保养资金</li> -->
+                    <li class='cost'>费用出处:{{data.source || '--'}}</li>
+                    <li class='num-amount'>
+                        <span>数量: {{data.sl || '--'}}个</span>
+                        <span>金额: {{data.cost || '--'}}万元</span>
+                    </li>
+                </ul>
+                <div class='bottom'>
+                    <div class='photo' @click='showPhoto'>现场照片: {{imgList.length || '--'}}张</div>
+                    <div class='task-No' @click='showTaskInfo'>工单编号: {{data.wonum || '--'}}</div>
                 </div>
             </div>
             <!--  其他事项-->
-            <div v-else-if='type === 3' class='container-3'>
+            <div v-else-if='type === 5' class='container-3'>
                 <div class='deal-date'>
                     <div class='name'>处理时间:</div>
-                    <div>2020-08-25</div>
+                    <div>{{data.handleDate || '--'}}</div>
                 </div>
                 <div class='record'>
                     <div class='name'>记录事项:</div>
-                    <div>三明万达广场顶层4座空调冷却塔噪声超标 排放(已整改),三明万达广场顶层4座空调冷 却塔噪声超标排放(已整改),三明万达广场 顶层4座空调冷却塔噪声超标排放(已整改)</div>
+                    <div>{{data.jlsx || '--'}}</div>
                 </div>
                 <div class='detail-location'>
                     <div class='name'>详细位置:</div>
-                    <div>吴忠万达广场(WZ)/商业楼/1楼/娱乐楼/电 梯间/娱乐楼货梯间</div>
+                    <div>{{data.description || '--'}}</div>
                 </div>
                 <div class='deatil-info'>
                     <div class='name'>具体内容:</div>
-                    <div>三明万达广场顶层4座空调冷却塔噪声超标 排放(已整改),三明万达广场顶层4座空调冷 却塔噪声超标排放(已整改),三明万达广场 顶层4座空调冷却塔噪声超标排放(已整改)</div>
+                    <div>{{data.content || '--'}}</div>
                 </div>
             </div>
             <!-- 综合事项 -->
-            <div v-else class='container-4'>
+            <div v-else-if='type === 3' class='container-4'>
                 <div class='date'>
                     <div class='name'>日期:</div>
-                    <div>2020-08-25</div>
+                    <div>{{data.createDate || '--'}}</div>
                 </div>
                 <div class='record'>
                     <div class='name'>记录事项:</div>
-                    <div>三明万达广场顶层4座空调冷却塔噪声超标 排放(已整改),三明万达广场顶层4座空调冷 却塔噪声超标排放(已整改),三明万达广场 顶层4座空调冷却塔噪声超标排放(已整改)</div>
+                    <div>{{data.recordsx || '--'}}</div>
                 </div>
                 <div class='work'>
                     <div class='name'>工作要求:</div>
-                    <div>这里是工作要求具体内容</div>
+                    <div>{{data.workyq || '--'}}</div>
                 </div>
                 <div class='rectification-matters'>
+                    <!-- TODO: 整改事项 -->
                     <div class='name'>整改事项:</div>
-                    <div>三明万达广场顶层4座空调冷却塔噪声超标 排放(已整改),三明万达广场顶层4座空调冷 却塔噪声超标排放(已整改),三明万达广场 顶层4座空调冷却塔噪声超标排放(已整改)</div>
+                    <div>{{data.zgyq || '--'}}</div>
                 </div>
             </div>
+            <!-- TODO:  -->
+            <!-- <div>暂无数据</div> -->
         </div>
-        <!-- 现场找平预览 -->
+        <!-- 现场照片预览 -->
         <ImagePreview class='update-img-preview' :visible.sync='showImgPreview' :imgList='imgList' />
 
         <!-- 任务信息 -->
         <div class='task-info-container' v-show='showTask'>
-            <van-nav-bar title='任务信息' left-arrow @click-left='showTask = false' />
+            <van-nav-bar :title='taskTitle' left-arrow @click-left='showTask = false' />
             <ul class='task-info'>
                 <li>
                     <span class='name'>工单编号:</span>
@@ -117,46 +151,158 @@
 import Vue from 'vue'
 import { NavBar } from 'vant'
 Vue.use(NavBar)
-import ImagePreview from '../../components/ImagePreview'
+import ImagePreview from '@/components/ImagePreview'
+import { mapGetters } from 'vuex'
+import { getUpdateDetail1, getUpdateDetail4, getUpdateDetail5, getUpdateDetail3 } from '@/api/overview'
+import moment from 'moment'
 export default {
     name: 'UpdateRecordDetail',
     props: {},
     components: { ImagePreview },
     data() {
         return {
-            type: 1,
-            title: '重要维保',
-            showTask: false,
-            showImgPreview: false,
-            imgList: [],
+            type: 1, //  1,4,5,3  维保, 维保, 其他事项, 综合事项
+            title: '', //页面title
+            showTask: false, //是否展示工单/任务信息 页面
+            showImgPreview: false, //是否展示图片预览
+            imgList: [], //图片数组
+            data: {}, //页面显示数据
+            taskTitle: '', //    工单,任务信息 页面title
         }
     },
+    computed: {
+        ...mapGetters(['plazaId', 'objtypeDict']),
+    },
+    created() {
+        this.getData()
+    },
     beforeMount() {},
     mounted() {
-        console.log(this.$route.params)
+        // console.log(this.$route.params)
     },
     methods: {
+        /**
+         * 查询页面需要的详情信息
+         */
+        getData() {
+            const { info } = this.$route.params
+            console.log(JSON.stringify(info, null, 2))
+            this.type = info.objtype
+            this.title = this.objtypeDict[info.objtype]
+            switch (info.objtype) {
+                case 1:
+                    // 维保
+                    this.getUpdateDetail1Func(info)
+                    break
+                case 4:
+                    // 维保
+                    this.getUpdateDetail4Func(info)
+                    break
+                case 5:
+                    // 其他事项
+                    this.getUpdateDetail5Func(info)
+                    break
+                case 3:
+                    // 综合事项
+                    this.getUpdateDetail3Func(info)
+                    break
+                default:
+                    break
+            }
+        },
+        /**
+         * 维保
+         */
+        async getUpdateDetail1Func(info) {
+            let getParams = {
+                id: info.objid,
+                plazaId: this.plazaId,
+                onlyMainAsset: false,
+            }
+            let res = await getUpdateDetail1({ getParams })
+            console.log(res)
+            let data = res?.data[0] || {}
+            data.reportdate && (data.tbDate = moment(data.reportdate).format('YYYY-MM-DD'))
+            data.sjjssj && (data.ysDate = moment(data.sjjssj).format('YYYY-MM-DD'))
+            this.data = data
+            // 图片处理
+            this.imgList = []
+            if (data?.glsmsImage?.length) {
+                data.glsmsImage.map((item) => {
+                    this.imgList.push(item.url)
+                })
+            }
+        },
+        /**
+         * 维修
+         */
+        async getUpdateDetail4Func(info) {
+            let getParams = {
+                wonum: info.objid,
+                plazaId: this.plazaId,
+            }
+            let res = await getUpdateDetail4({ getParams })
+            console.log(res)
+            let data = res?.data[0] || {}
+            data.reportdate && (data.tbDate = moment(data.reportdate).format('YYYY-MM-DD'))
+            data.sjjssj && (data.ysDate = moment(data.sjjssj).format('YYYY-MM-DD'))
+            this.data = data
+            // 图片处理
+            this.imgList = []
+            if (data?.glsmsImage?.length) {
+                data.glsmsImage.map((item) => {
+                    this.imgList.push(item.url)
+                })
+            }
+        },
+        /**
+         * 其他事项
+         */
+        async getUpdateDetail5Func(info) {
+            let getParams = {
+                id: info.objid,
+                plazaId: this.plazaId,
+            }
+            let res = await getUpdateDetail5({ getParams })
+            let data = res?.data[0] || {}
+            data.handledate && (data.handleDate = moment(data.handledate).format('YYYY-MM-DD'))
+            this.data = data
+        },
+        /**
+         * 综合事项
+         */
+        async getUpdateDetail3Func(info) {
+            let getParams = {
+                id: info.objid,
+                plazaId: this.plazaId,
+            }
+            let res = await getUpdateDetail3({ getParams })
+            console.log(res)
+            let data = res?.data[0] || {}
+            data.createdate && (data.createDate = moment(data.createdate).format('YYYY-MM-DD'))
+            this.data = data
+        },
         // 返回上一个页面(项目概况)
         backPage() {
             this.$router.go(-1)
         },
         // 点击任务编号,显示任务信息
-        showTaskInfo(data) {
-            this.showTask = true
+        showTaskInfo() {
+            // 维保有任务编号,或者维修有工单编号,显示
+            if (this.type === 1) {
+                this.taskTitle = '任务信息'
+            } else if (this.type === 4) {
+                this.taskTitle = '工单信息'
+            }
+            if (this.data.wb_gzglid || this.data.wonum) {
+                this.showTask = true
+            }
         },
         // 显示图片预览弹窗
         showPhoto() {
-            this.imgList = [
-                'https://img.yzcdn.cn/vant/apple-1.jpg',
-                'https://img.yzcdn.cn/vant/apple-2.jpg',
-                'https://img.yzcdn.cn/vant/apple-1.jpg',
-                'https://img.yzcdn.cn/vant/apple-2.jpg',
-                'https://img.yzcdn.cn/vant/apple-1.jpg',
-                'https://img.yzcdn.cn/vant/apple-2.jpg',
-                'https://img.yzcdn.cn/vant/apple-1.jpg',
-                'https://img.yzcdn.cn/vant/apple-2.jpg',
-            ].slice(0, parseInt(Math.random() * 8 + 1))
-            this.showImgPreview = true
+            if (this.imgList?.length) {
+                this.showImgPreview = true
+            }
         },
     },
 }
@@ -201,8 +347,8 @@ export default {
                 width: 100%;
                 height: auto;
                 margin: 10px 0;
-                font-size: 14px;
-                font-weight: 400;
+                font-size: 16px;
+                font-weight: 600;
                 color: #333333;
                 line-height: 20px;
             }

+ 2 - 2
src/views/overview/index.vue

@@ -4,7 +4,7 @@
         <!-- <ImagePreview1 class='overview-img-preview' :visible.sync='showImgPreview' :imgList='imgList' /> -->
         <!-- 轮播 -->
         <div class='my-swipe'>
-            <van-swipe :autoplay='0' indicator-color='white'>
+            <van-swipe :autoplay='0' indicator-color='white' v-show='imgList.length'>
                 <van-swipe-item v-for='(image, index) in imgList' :key='index'>
                     <span class='type-name' v-show='image.typename'>{{ image.typename }}</span>
                     <van-image fit='contain' :src='image.url' />
@@ -196,7 +196,7 @@ export default {
     data() {
         return {
             showImgPreview: true,
-            imgList: ['https://img.yzcdn.cn/vant/apple-1.jpg', 'https://img.yzcdn.cn/vant/apple-2.jpg'],
+            imgList: [],
             active: 0, //  激活的tab页 0:建筑综合信息 1:施工单位信息
             plazaName: '', //广场名称
             build: [], //建筑综合信息