From d7e829cea04f498cb14d30b9913a696158d7b734 Mon Sep 17 00:00:00 2001
From: xiebin <123456>
Date: Mon, 10 Oct 2022 08:55:53 +0800
Subject: [PATCH] 代码优化

---
 src/views/eventgm/eventgmDetail.vue |  115 +++++++++++++++++++++------------------------------------
 1 files changed, 42 insertions(+), 73 deletions(-)

diff --git a/src/views/eventgm/eventgmDetail.vue b/src/views/eventgm/eventgmDetail.vue
index 5a6e814..3e12ca4 100644
--- a/src/views/eventgm/eventgmDetail.vue
+++ b/src/views/eventgm/eventgmDetail.vue
@@ -1,12 +1,11 @@
 <template>
   <div>
-    <el-button class="backBtn" size="small" type="success" icon="el-icon-back" @click="handleBack">返 回
-    </el-button>
+    <el-button class="backBtn" size="small" type="success" icon="el-icon-back" @click="handleBack">返 回</el-button>
     <el-row>
       <el-col :span="12">
         <div>
           <el-card class="trackClass" style="overflow-y: auto">
-            <!--事件详情信息-->
+            <!--事件详情信息开始-->
             <div
               style=""
               role="tab"
@@ -21,7 +20,7 @@
               >
                 <div class="avue-group__header avue-group">
                   <i class="el-icon-info avue-group__icon"></i>
-                  <h1 class="avue-group__title">事件详情信息</h1>
+                  <h1 class="avue-group__title">详情信息</h1>
                 </div>
               </div>
             </div>
@@ -46,7 +45,6 @@
                       <el-input disabled="true" v-model="form.address" autocomplete="off"></el-input>
                     </el-form-item>
                   </el-col>
-
                 </el-row>
                 <el-row>
                   <el-col span="24">
@@ -55,19 +53,6 @@
                     </el-form-item>
                   </el-col>
                 </el-row>
-<!--                <el-row>-->
-<!--                  <el-col span="12">-->
-<!--                    <el-form-item label="经度">-->
-<!--                      <el-input disabled="true" v-model="form.longitude" autocomplete="off"></el-input>-->
-<!--                    </el-form-item>-->
-<!--                  </el-col>-->
-<!--                  <el-col span="12">-->
-<!--                    <el-form-item label="纬度">-->
-<!--                      <el-input disabled="true" v-model="form.latitude" autocomplete="off"></el-input>-->
-<!--                    </el-form-item>-->
-<!--                  </el-col>-->
-<!--                </el-row>-->
-
                 <el-row>
                   <el-col span="12">
                     <el-form-item label="事件状态">
@@ -87,9 +72,21 @@
                       <el-input disabled="true" v-model="form.remark" autocomplete="off"></el-input>
                     </el-form-item>
                   </el-col>
+                  <el-col span="12" v-if="form.no">
+                    <el-form-item label="工单编号">
+                      <el-input disabled="true" v-model="form.no" autocomplete="off"></el-input>
+                    </el-form-item>
+                  </el-col>
+                  <el-col span="12" v-if="form.no">
+                    <el-form-item label="工单状态">
+                      <el-input disabled="true" v-if="repairsDetail.toUserId > 0" value="已派单" autocomplete="off"></el-input>
+                      <el-input disabled="true" v-else value="未派单" autocomplete="off"></el-input>
+                    </el-form-item>
+                  </el-col>
                 </el-row>
               </el-form>
             </el-card>
+            <!--事件详情信息结束-->
 
             <!--事件图片或视频-->
             <div
@@ -106,7 +103,7 @@
                 >
                   <div class="avue-group__header avue-group">
                     <i class="el-icon-s-order avue-group__icon"></i>
-                    <h1 class="avue-group__title">事件图片和视频</h1>
+                    <h1 class="avue-group__title">图片和视频</h1>
                   </div>
                 </div>
               </div>
@@ -128,35 +125,9 @@
 
               <span v-show="picUrls.length == 0&&videoUrls.length ==0">暂无数据</span>
             </el-card>
-              <!--视频-->
-<!--            <div-->
-<!--              style=""-->
-<!--              role="tab"-->
-<!--              aria-expanded="true"-->
-<!--              aria-controls="el-collapse-content-823"-->
-<!--              aria-describedby="el-collapse-content-823"-->
-<!--            >-->
-<!--              <div-->
-<!--                role="button"-->
-<!--                tabindex="0"-->
-<!--                class="el-collapse-item__header focusing is-active"-->
-<!--              >-->
-<!--                <div class="avue-group__header avue-group">-->
-<!--                  <i class="el-icon-s-order avue-group__icon"></i>-->
-<!--                  <h1 class="avue-group__title">事件视频</h1>-->
-<!--                </div>-->
-<!--              </div>-->
-<!--            </div>-->
-<!--            <el-card>-->
-<!--              <video-->
-<!--                :src="videoUrls"-->
-<!--                style="width: 200px; height: 200px; object-fit: fill"-->
-<!--                controls-->
-<!--                v-show="videoUrls != ''"-->
-<!--              ></video>-->
-<!--              <span v-show="videoUrls.length == 0">暂无视频</span>-->
-<!--            </el-card>-->
-            <!--事件流程信息-->
+            <!--事件图片或视频结束-->
+
+            <!--事件轨迹-->
             <div
               style=""
               role="tab"
@@ -171,7 +142,7 @@
               >
                 <div class="avue-group__header avue-group">
                   <i class="el-icon-s-order avue-group__icon"></i>
-                  <h1 class="avue-group__title">事件流程信息</h1>
+                  <h1 class="avue-group__title">事件轨迹</h1>
                 </div>
               </div>
             </div>
@@ -187,27 +158,22 @@
                 <el-table-column prop="remark" label="说明"  align="center"></el-table-column>
               </el-table>
             </el-card>
+            <!--事件轨迹结束-->
 
+            <!--是否显示维修信息-->
             <div v-if="this.form.no">
               <!--维修人员信息-->
-              <div v-if="repairsDetail.toUserId != -1">
-                <div
-                style="margin-top: -10px"
-                role="tab"
-                aria-expanded="true"
-                aria-controls="el-collapse-content-823"
-                aria-describedby="el-collapse-content-823"
-              >
-                <div
-                  role="button"
-                  tabindex="0"
-                  class="el-collapse-item__header focusing is-active"
-                >
-                  <div class="avue-group__header avue-group">
-                    <i class="el-icon-s-custom avue-group__icon"></i>
-                    <h1 class="avue-group__title">维修人员信息</h1>
+                <div style="margin-top: -10px" role="tab" aria-expanded="true" aria-controls="el-collapse-content-823"
+                aria-describedby="el-collapse-content-823" >
+                  <div role="button" tabindex="0"
+                    class="el-collapse-item__header focusing is-active" >
+                    <div class="avue-group__header avue-group">
+                      <i class="el-icon-s-custom avue-group__icon"></i>
+                      <h1 class="avue-group__title">
+                        维修人员信息 <span v-if="repairsDetail.toUserId < 0 || repairsDetail.toUserId == null">(未派单)</span>
+                      </h1>
+                    </div>
                   </div>
-                </div>
                 </div>
                 <el-card>
                 <el-table
@@ -222,8 +188,9 @@
                   <el-table-column prop="phone" label="联系电话"  align="center"></el-table-column>
                 </el-table>
               </el-card>
-              </div>
-              <!--维修流程信息-->
+              <!--维修人员信息结束-->
+
+              <!--维修轨迹开始-->
               <div
                 style="margin-top: 15px"
                 role="tab"
@@ -238,7 +205,7 @@
                 >
                   <div class="avue-group__header avue-group">
                     <i class="el-icon-s-order avue-group__icon"></i>
-                    <h1 class="avue-group__title">维修流程信息</h1>
+                    <h1 class="avue-group__title">维修轨迹</h1>
                   </div>
                 </div>
               </div>
@@ -254,7 +221,9 @@
                   <el-table-column prop="remark" label="说明"  align="center"></el-table-column>
                 </el-table>
               </el-card>
+              <!--维修轨迹结束-->
             </div>
+
           </el-card>
         </div>
       </el-col>
@@ -315,9 +284,7 @@
       var params = {eventId : this.form.id}
       getEventgmRecordList(1,100,params).then(res=>{
         if (res.data.code ==200){
-          res.data.data.records.forEach(e=>{
-            this.eventgmRecord.push(e)
-          })
+          this.eventgmRecord = res.data.data.records
         }
       })
     },
@@ -339,7 +306,9 @@
         getDetail({no:this.form.no}).then(res=>{
           if (res.data.code == 200){
            this.repairsDetail = res.data.data
-            this.getRepairPersonInfo();
+            if (this.repairsDetail.toUserId > 0) {
+              this.getRepairPersonInfo()
+            }
          }
         })
       }

--
Gitblit v1.9.3