From c78e4ef0b98443e3568024b26b23c2a298f7970d Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期五, 19 七月 2024 15:48:27 +0800
Subject: [PATCH] 工单审核页面优化

---
 src/views/system/work-order/index.vue |  428 ++++++++++++++++++++++++++---------------------------
 1 files changed, 208 insertions(+), 220 deletions(-)

diff --git a/src/views/system/work-order/index.vue b/src/views/system/work-order/index.vue
index 77c4441..7e250c5 100644
--- a/src/views/system/work-order/index.vue
+++ b/src/views/system/work-order/index.vue
@@ -1,6 +1,6 @@
 <template>
   <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
+    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
       <el-form-item label="宸ュ崟鍙�" prop="workOrderNo">
         <el-input
           v-model="queryParams.workOrderNo"
@@ -9,6 +9,19 @@
           @clear="handleQuery"
           @keyup.enter.native="handleQuery"
         />
+      </el-form-item>
+      <el-form-item label="鏁呴殰绫诲瀷" prop="workOrderNo">
+        <el-select v-model="queryParams.errorType" placeholder="鏁呴殰绫诲瀷" clearable @clear="handleQuery">
+          <el-option v-for="(item, index) in errorTypeOptions" :label="item.dictLabel" :value="item.dictValue" :key="index"></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item label="宸ュ崟鐘舵��" prop="status">
+        <el-select v-model="queryParams.status" placeholder="宸ュ崟鐘舵��" @change="handleQuery">
+          <el-option label="寰呭鐞�" value="DISTRIBUTED"></el-option>
+          <el-option label="寰呭鏍�" value="YW_HANDLE"></el-option>
+          <el-option label="瀹℃牳閫氳繃" value="AUDITING_SUCCESS"></el-option>
+          <el-option label="瀹℃牳涓嶉�氳繃" value="AUDITING_FAIL"></el-option>
+        </el-select>
       </el-form-item>
       <el-form-item label="杩愮淮澶勭悊鏃堕棿">
         <el-date-picker
@@ -29,21 +42,36 @@
       </el-form-item>
     </el-form>
 
-    <el-row>
-      <el-col :span="8" v-for="item in workOrderList" :key="item" style="width: 390px;margin-left: 40px;margin-top:20px;">
-        <el-card :body-style="{ padding: '0px' }">
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          size="mini"
+          @click="batchAuditingVisible = true; batchAuditingWorkOrder = {}"
+          v-hasPermi="['work:order:audit']"
+        >鎵归噺瀹℃牳</el-button>
+      </el-col>
+    </el-row>
+
+    <el-row :gutter="20">
+      <el-col :xl="6" :lg="8" :md="12" :sm="24"  v-for="item in workOrderList" :key="item.id" style="margin-bottom: 20px;">
+        <el-card :body-style="{ padding: '0px',display: 'flex' }">
           <el-image :preview-src-list="['https://img2.baidu.com/it/u=68398439,1553004927&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=357']" fit="cover" src="https://img2.baidu.com/it/u=68398439,1553004927&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=357" class="image"/>
-          <div style="padding-right: 10px;padding-top: 10px;float: right;">
+          <div style="padding-right: 10px;padding-top: 10px;">
             <el-row>
+              <el-col :span="24" class="time">鏁呴殰绫诲瀷锛�<el-tag size="small" type="danger">{{ item.errorType }}</el-tag></el-col>
+            </el-row>
+            <el-row class="work-order-item">
               <el-col class="time" :span="24">杩愮淮浜哄憳锛歿{ item.ywPeopleName }}</el-col>
             </el-row>
-            <el-row style="margin-top: 5px">
+            <el-row class="work-order-item">
               <el-col class="time" :span="24">杩愮淮鍗曚綅锛歿{ item.unitName }}</el-col>
             </el-row>
-            <el-row style="margin-top: 5px">
+            <el-row class="work-order-item">
               <el-col :span="24" class="time">宸ュ崟缂栧彿锛歿{ item.workOrderNo }}</el-col>
             </el-row>
-            <el-row style="margin-top: 5px">
+            <el-row>
               <el-col :span="24" class="time">澶勭悊鏃堕棿锛歿{ item.ywHandleTime }}</el-col>
             </el-row>
             <el-row>
@@ -51,24 +79,12 @@
                 size="mini"
                 type="text"
                 @click="handleAuditing(item)"
-                v-hasPermi="['work:order:audit']"
               >瀹℃牳</el-button>
               <el-button
                 size="mini"
                 type="text"
                 @click="handleYwCondition(item)"
               >杩愮淮鎯呭喌</el-button>
-              <!--          <el-button-->
-              <!--            size="mini"-->
-              <!--            type="text"-->
-              <!--            @click="handleYwResult(scope.row)"-->
-              <!--          >杩愮淮缁撴灉</el-button>-->
-              <el-button
-                size="mini"
-                type="text"
-                @click="handleCheckResult(item)"
-                v-hasPermi="['work:order:result']"
-              >妫�娴嬬粨鏋�</el-button>
               <el-button
                 size="mini"
                 type="text"
@@ -78,6 +94,7 @@
                 size="mini"
                 type="text"
                 @click="handleReport(item)"
+                v-hasPermi="['system:report:add']"
               >浜嬪悗鎶ュ</el-button>
             </el-row>
           </div>
@@ -96,8 +113,8 @@
     <!-- 浜嬪悗鎶ュ -->
     <el-dialog title="浜嬪悗鎶ュ" :visible.sync="reportOpen" width="600px" append-to-body>
       <el-form ref="reportForm" :model="reportForm" :rules="reportFormRules" label-width="80px">
-        <el-form-item label="鐐逛綅" prop="pointId">
-          <el-input v-model="reportForm.pointId" disabled />
+        <el-form-item label="鐐逛綅" prop="source">
+          <el-input v-model="reportForm.source" disabled />
         </el-form-item>
         <el-form-item label="鎶ュ绫诲瀷">
           <el-input v-model="reportForm.reportType" disabled />
@@ -122,25 +139,37 @@
       </div>
     </el-dialog>
 
-    <el-dialog title="宸ュ崟瀹℃牳" :visible.sync="auditingOpen" width="500px" append-to-body>
-      <el-form ref="auditingForm" :model="auditingForm" :rules="auditingRules" label-width="80px">
-        <el-form-item label="宸ュ崟鍙�" prop="workOrderNo">
-          <el-input v-model="auditingForm.workOrderNo" disabled  />
-        </el-form-item>
-        <el-form-item label="杩愮淮鍗曚綅" prop="unitName">
-          <el-input v-model="auditingForm.unitName" disabled  />
-        </el-form-item>
-        <el-form-item label="杩愮淮浜哄憳" prop="ywPeopleName">
-          <el-input v-model="auditingForm.ywPeopleName" disabled />
-        </el-form-item>
-        <el-form-item label="瀹℃牳缁撴灉" prop="auditingResult">
-          <el-radio v-model="auditingForm.auditingResult" label="pass">閫氳繃</el-radio>
-          <el-radio v-model="auditingForm.auditingResult" label="return">椹冲洖</el-radio>
-        </el-form-item>
-        <el-form-item label="瀹℃牳澶囨敞" prop="auditingRemark">
-          <el-input v-model="auditingForm.auditingRemark" type="textarea" maxlength="30" show-word-limit/>
-        </el-form-item>
-      </el-form>
+    <el-dialog title="宸ュ崟瀹℃牳" :visible.sync="auditingOpen" width="1000px" append-to-body>
+      <el-row :gutter="20">
+        <el-col :span="10">
+          <el-form ref="auditingForm" :model="auditingForm" :rules="auditingRules" label-width="80px">
+            <el-form-item label="宸ュ崟鍙�" prop="workOrderNo">
+              <el-input v-model="auditingForm.workOrderNo" disabled  />
+            </el-form-item>
+            <el-form-item label="杩愮淮鍗曚綅" prop="unitName">
+              <el-input v-model="auditingForm.unitName" disabled  />
+            </el-form-item>
+            <el-form-item label="瀹℃牳缁撴灉" prop="auditingResult">
+              <el-radio v-model="auditingForm.auditingResult" label="AUDITING_SUCCESS">閫氳繃</el-radio>
+              <el-radio v-model="auditingForm.auditingResult" label="AUDITING_FAIL">椹冲洖</el-radio>
+            </el-form-item>
+            <el-form-item label="瀹℃牳澶囨敞" prop="auditingRemark">
+              <el-input v-model="auditingForm.auditingRemark" type="textarea" maxlength="30" show-word-limit/>
+            </el-form-item>
+          </el-form>
+        </el-col>
+        <el-col :span="14" style="max-height: 500px; overflow-y: scroll">
+          <el-timeline>
+            <el-timeline-item v-for="(condition, index) in ywConditions" :key="index" :timestamp="condition.commitUserName + '___' + condition.createTime" placement="top">
+              <el-card>
+                <div v-html="condition.ywCondition"></div>
+                <el-link type="primary" v-for="item in condition.ywProofMaterials != null ? condition.ywProofMaterials.split(',') : condition.ywProofMaterials" :underline="false" :key="item.id" @click="handleDownload(item)">{{ item.substring(item.lastIndexOf("/") + 1) }}</el-link>
+              </el-card>
+            </el-timeline-item>
+          </el-timeline>
+        </el-col>
+      </el-row>
+
       <div slot="footer" class="dialog-footer">
         <el-button type="primary" @click="submitAuditing">纭� 瀹�</el-button>
         <el-button @click="cancelAuditing">鍙� 娑�</el-button>
@@ -148,7 +177,7 @@
     </el-dialog>
 
     <el-dialog title="杩愮淮鎯呭喌璁板綍" :visible.sync="ywConditionOpen" width="500px" append-to-body>
-      <el-form ref="ywConditionForm" :model="ywConditionForm" :rules="ywConditionRules" label-width="80px">
+      <el-form ref="form" :model="form" :rules="ywConditionRules" label-width="80px">
         <el-form-item label="宸ュ崟鍙�" prop="workOrderNo">
           <el-input v-model="ywConditionForm.workOrderNo" disabled  />
         </el-form-item>
@@ -158,36 +187,11 @@
         <el-form-item label="杩愮淮浜哄憳" prop="ywPeopleName">
           <el-input v-model="ywConditionForm.ywPeopleName" disabled />
         </el-form-item>
-        <el-form-item label="鐜板満鍥剧墖" prop="picture">
-          <el-upload
-            class="avatar-uploader"
-            action="/dev-api/common/upload"
-            name="file"
-            :headers="{'Authorization': 'Bearer ' + getToken()}"
-            :on-success="pictureUploadSuccess"
-            :on-remove="pictureRemove"
-            :file-list="pictureList"
-            list-type="picture">
-            <el-button size="small" type="primary">鐐瑰嚮涓婁紶</el-button>
-            <div slot="tip" class="el-upload__tip">鍙兘涓婁紶jpg/png鏂囦欢锛屼笖涓嶈秴杩�500kb</div>
-          </el-upload>
+        <el-form-item label="鐜板満鎯呭喌" prop="ywCondition">
+          <editor v-model="form.ywCondition" :min-height="192"/>
         </el-form-item>
-        <el-form-item label="浣愯瘉鏉愭枡" prop="certificates">
-          <el-upload
-            class="avatar-uploader"
-            action="/dev-api/common/upload"
-            name="file"
-            :headers="{'Authorization': 'Bearer ' + getToken()}"
-            :on-success="certificateUploadSuccess"
-            :on-remove="certificateRemove"
-            :file-list="certificateList"
-            list-type="picture">
-            <el-button size="small" type="primary">鐐瑰嚮涓婁紶</el-button>
-            <div slot="tip" class="el-upload__tip">鍙兘涓婁紶jpg/png鏂囦欢锛屼笖涓嶈秴杩�500kb</div>
-          </el-upload>
-        </el-form-item>
-        <el-form-item label="杩愮淮鎯呭喌" prop="ywCondition">
-          <el-input v-model="ywConditionForm.ywCondition" type="textarea" maxlength="150" show-word-limit/>
+        <el-form-item label="浣愯瘉鏉愭枡" prop="ywProofMaterials">
+          <file-upload v-model="form.ywProofMaterials"/>
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
@@ -196,81 +200,28 @@
       </div>
     </el-dialog>
 
-
-    <el-dialog title="杩愮淮缁撴灉璁板綍" :visible.sync="ywResultOpen" width="500px" append-to-body>
-      <el-form ref="ywResultForm" :model="ywResultForm" :rules="ywResultRules" label-width="80px">
-        <el-form-item label="宸ュ崟鍙�" prop="workOrderNo">
-          <el-input v-model="ywResultForm.workOrderNo" disabled  />
+    <el-dialog title="杩愮淮鎵归噺瀹℃牳" :visible.sync="batchAuditingVisible" width="500px" append-to-body>
+      <el-form ref="batchAuditingWorkOrder" :model="batchAuditingWorkOrder" label-width="80px" :rules="batchAuditingRules">
+        <el-form-item label="鏁呴殰绫诲瀷" prop="errorType">
+          <el-select v-model="batchAuditingWorkOrder.errorTypes" multiple placeholder="鏁呴殰绫诲瀷">
+            <el-option v-for="(item, index) in errorTypeOptions" :label="item.dictLabel" :value="item.dictValue" :key="index"></el-option>
+          </el-select>
         </el-form-item>
-        <el-form-item label="杩愮淮鍗曚綅" prop="unitName">
-          <el-input v-model="ywResultForm.unitName" disabled  />
-        </el-form-item>
-        <el-form-item label="杩愮淮浜哄憳" prop="ywPeopleName">
-          <el-input v-model="ywResultForm.ywPeopleName" disabled />
-        </el-form-item>
-        <el-form-item label="杩愮淮缁撴灉" prop="ywResult">
-          <el-input v-model="ywResultForm.ywResult" type="textarea" maxlength="150" show-word-limit/>
+        <el-form-item label="瀹℃牳璇存槑" prop="auditingRemark">
+          <el-input v-model="batchAuditingWorkOrder.auditingRemark" type="textarea" maxlength="30" show-word-limit />
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
-        <el-button type="primary" @click="submitYwResult">纭� 瀹�</el-button>
-        <el-button @click="cancelYwResult">鍙� 娑�</el-button>
-      </div>
-    </el-dialog>
-
-    <el-dialog title="杩愮淮妫�娴嬬粨鏋�" :visible.sync="checkResultOpen" width="550px" append-to-body>
-      <el-form ref="ywResultForm" :model="checkResultForm" :rules="checkResultRules" label-width="120px">
-        <el-form-item label="宸ュ崟鍙�" prop="workOrderNo">
-          <el-input v-model="checkResultForm.workOrderNo" disabled  />
-        </el-form-item>
-        <el-form-item label="杩愮淮鍗曚綅" prop="unitName">
-          <el-input v-model="checkResultForm.unitName" disabled  />
-        </el-form-item>
-        <el-form-item label="杩愮淮浜哄憳" prop="ywPeopleName">
-          <el-input v-model="checkResultForm.ywPeopleName" disabled />
-        </el-form-item>
-        <el-form-item label="杩愮淮妫�娴嬬粨鏋�" prop="ywCheckResult">
-          <file-upload v-model="checkResultForm.ywCheckResult"/>
-        </el-form-item>
-      </el-form>
-      <div slot="footer" class="dialog-footer">
-        <el-button type="primary" @click="submitYwResult">纭� 瀹�</el-button>
-        <el-button @click="cancelCheckResult">鍙� 娑�</el-button>
-      </div>
-    </el-dialog>
-
-    <!-- 娣诲姞鎴栦慨鏀硅繍缁村伐鍗曞璇濇 -->
-    <el-dialog :title="title" :visible.sync="open" width="550px" append-to-body>
-      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
-        <el-form-item label="宸ュ崟鍙�" prop="workOrderNo">
-          <el-input v-model="form.workOrderNo" placeholder="璇疯緭鍏ュ伐鍗曞彿" />
-        </el-form-item>
-        <el-form-item label="杩愮淮澶勭悊鏃堕棿" prop="ywHandleTime">
-          <el-date-picker clearable
-            v-model="form.ywHandleTime"
-            type="date"
-            value-format="yyyy-MM-dd"
-            placeholder="璇烽�夋嫨杩愮淮澶勭悊鏃堕棿">
-          </el-date-picker>
-        </el-form-item>
-        <el-form-item label="杩愮淮鎯呭喌" prop="ywCondition">
-          <el-input v-model="form.ywCondition" type="textarea" placeholder="璇疯緭鍏ュ唴瀹�" />
-        </el-form-item>
-        <el-form-item label="杩愮淮妫�娴嬬粨鏋�" prop="ywCheckResult">
-          <el-input v-model="form.ywCheckResult" type="textarea" placeholder="璇疯緭鍏ュ唴瀹�" />
-        </el-form-item>
-      </el-form>
-      <div slot="footer" class="dialog-footer">
-        <el-button type="primary" @click="submitForm">纭� 瀹�</el-button>
-        <el-button @click="cancel">鍙� 娑�</el-button>
+        <el-button type="primary" @click="batchAuditing('AUDITING_SUCCESS')" size="small">閫� 杩�</el-button>
+        <el-button type="danger" @click="batchAuditing('AUDITING_FAIL')" size="small">椹� 鍥�</el-button>
       </div>
     </el-dialog>
 
 
     <!-- 杩囩▼鍥� -->
-    <el-dialog title="杩囩▼鍥�" :visible.sync="flowOpen" width="1200px" :close-on-click-modal="false" append-to-body>
+    <el-dialog title="杩囩▼鍥�" :visible.sync="flowOpen" width="1200px" append-to-body>
       <div>
-        <el-steps :active="2" :space="500">
+        <el-steps :active="ywAuditingList.length != 0 ? 3 : ywHandleList.length != 0 ? 2 : 1" :space="500">
           <el-step title="浜х敓宸ュ崟">
             <template slot="description">
               <div>
@@ -286,88 +237,58 @@
                 <div class="flow-item-x">
                   鍒涘缓鏃堕棿锛歿{flowForm.createTime}}
                 </div>
-                <div class="flow-item-x">
-                  澶勭悊鏈熼檺锛�<el-tag type="danger" size="small">12灏忔椂</el-tag>
+                <div class="flow-item-x" v-if="flowForm.processingPeriod">
+                  澶勭悊鏈熼檺锛�<el-tag type="danger" size="small">{{ flowForm.processingPeriod }}</el-tag>
                 </div>
               </div>
             </template>
           </el-step>
           <el-step title="杩愮淮澶勭悊">
             <template slot="description">
-              <div class="y-item">
-                <div class="y-item-1">
-                  <div class="flow-item-x">
-                    杩愮淮鐘舵�侊細<el-tag type="danger" size="small">缁撴灉涓婃姤</el-tag>
+              <div style="max-height: 450px;overflow-y: scroll">
+                <div class="y-item" v-for="(item, index) in ywHandleList" :key="index">
+                  <div class="y-item-1">
+                    <div class="flow-item-x">
+                      鐜板満鎯呭喌锛�
+                      <!-- <el-tooltip class="item" effect="dark" :content="item.ywCondition" placement="top"> -->
+                      <span v-html="item.ywCondition"></span>
+                      <!-- </el-tooltip> -->
+                    </div>
+                    <!-- <div class="flow-item-x">
+                      <el-tag size="small" v-for="file in item.ywProofMaterials != null ? item.ywProofMaterials.split(',') : item.ywProofMaterials" :key="file" @click="handleDownload(file)">{{ file.substring(file.lastIndexOf("/") + 1) }}</el-tag>
+                    </div> -->
                   </div>
-                  <div class="flow-item-x">
-                    杩愮淮浜哄憳锛�<el-tag type="danger" size="small">{{flowForm.ywPeopleName}}</el-tag>
-                  </div>
-                </div>
-                <div class="y-item-2">
-                  <div >
-                    {{flowForm.ywHandleTime}}
-                  </div>
-                  <div >
-                    绗嚑娆★細1
+                  <div class="y-item-2">
+                    <div >
+                      {{ parseTime(item.createTime) }}
+                    </div>
+                    <div >
+                      绗瑊{ index + 1 }}娆�
+                    </div>
                   </div>
                 </div>
               </div>
-              <div class="y-item">
-                <div class="y-item-1">
-                  <div class="flow-item-x">
-                    杩愮淮鐘舵�侊細<el-tag type="danger" size="small">缁撴灉涓婃姤</el-tag>
-                  </div>
-                  <div class="flow-item-x">
-                    杩愮淮浜哄憳锛�<el-tag type="danger" size="small">{{flowForm.ywPeopleName}}</el-tag>
-                  </div>
-                </div>
-                <div class="y-item-2">
-                  <div >
-                    {{flowForm.ywHandleTime}}
-                  </div>
-                  <div >
-                    绗嚑娆★細2
-                  </div>
-                </div>
-              </div>
-
             </template>
           </el-step>
-          <el-step title="缁撴灉瀹℃牳">
+          <el-step title="瀹℃牳缁撴灉">
             <template slot="description">
-              <div class="y-item">
-                <div class="y-item-1">
-                  <div class="flow-item-x">
-                    瀹℃牳缁撴灉锛�<el-tag type="danger" size="small">椹冲洖</el-tag>
+              <div style="max-height: 450px;overflow-y: scroll">
+                <div class="y-item" v-for="(item, index) in ywAuditingList" :key="index">
+                  <div class="y-item-1">
+                    <div class="flow-item-x">
+                      瀹℃牳缁撴灉锛�<el-tag :type="item.result == '瀹℃牳閫氳繃' ? 'success' : 'danger'" size="small">{{ item.result }}</el-tag>
+                    </div>
+                    <div class="flow-item-x">
+                      瀹℃牳璇存槑锛�<span v-html="item.remark"></span>
+                    </div>
                   </div>
-                  <div class="flow-item-x">
-                    瀹℃牳璇存槑锛�<el-tag type="danger" size="small">鏈垚鍔熷鐞�</el-tag>
-                  </div>
-                </div>
-                <div class="y-item-2">
-                  <div >
-                    {{flowForm.ywHandleTime}}
-                  </div>
-                  <div >
-                    绗嚑娆★細1
-                  </div>
-                </div>
-              </div>
-              <div class="y-item">
-                <div class="y-item-1">
-                  <div class="flow-item-x">
-                    瀹℃牳鐘舵�侊細<el-tag type="info" size="small">瀹℃牳涓�</el-tag>
-                  </div>
-                  <div class="flow-item-x">
-                    瀹℃牳璇存槑锛�
-                  </div>
-                </div>
-                <div class="y-item-2">
-                  <div >
-                    {{flowForm.ywHandleTime}}
-                  </div>
-                  <div >
-                    绗嚑娆★細2
+                  <div class="y-item-2">
+                    <div >
+                      {{ parseTime(item.createTime) }}
+                    </div>
+                    <div >
+                      绗瑊{ index + 1 }}娆�
+                    </div>
                   </div>
                 </div>
               </div>
@@ -399,13 +320,25 @@
 }
 </style>
 <script>
-import { listWorkOrder, getWorkOrder, delWorkOrder, addWorkOrder, updateWorkOrder,auditing, ywCondition } from "@/api/platform/work-order";
+import { listWorkOrder, getWorkOrder, delWorkOrder, addWorkOrder, updateWorkOrder, auditing, batchAuditing, ywCondition, getYwCondition, getYwConditionList, getYwAuditingList } from "@/api/platform/work-order";
+import { addReport } from "@/api/platform/report";
+import { getDicts } from "@/api/system/dict/data";
 export default {
   name: "Work-order",
   components: {
   },
   data() {
     return {
+      errorTypeOptions: [],
+      ywConditions: [],
+      batchAuditingVisible: false,
+      batchAuditingWorkOrder: {
+        errorTypes: [],
+        auditingRemark: '',
+        auditingResult: ''
+      },
+      ywHandleList: [],
+      ywAuditingList: [],
       reportFormRules: {
         reportContent: [
           { required: true, message: "鎶ュ鍐呭涓嶈兘涓虹┖", trigger: "blur" }
@@ -417,7 +350,7 @@
       reportOpen: false,
       reportForm: {
         reportType: "浜嬪悗鎶ュ",
-        pointId: "鐞间簬闀�3琛�1鍙锋憚鍍忓ご",
+        pointId: "",
         errorType: "",
         reportContent: "",
         reportMaterials: ""
@@ -457,6 +390,7 @@
         ywHandleTime: null,
         ywResult: null,
         ywCondition: null,
+        status: ''
       },
       // 琛ㄥ崟鍙傛暟
       form: {},
@@ -500,19 +434,43 @@
           { required: true, message: "杩愮淮妫�娴嬬粨鏋滀笉鑳戒负绌�", trigger: "blur" }
         ],
       },
+      // 鎵归噺瀹℃牳鏍¢獙
+      batchAuditingRules: {
+        errorTypes: [
+          { required: true, message: "璇烽�夋嫨鏁呴殰绫诲瀷", trigger: "change" }
+        ],
+      }
     };
   },
   created() {
     this.getList();
   },
   methods: {
+    // 鎵归噺瀹℃牳
+    batchAuditing(result) {
+      this.batchAuditingWorkOrder.auditingResult = result;
+      this.$refs["batchAuditingWorkOrder"].validate(valid => {
+        if (valid) {
+          batchAuditing(this.batchAuditingWorkOrder).then(res => {
+            this.batchAuditingWorkOrder = {};
+            this.batchAuditingVisible = false;
+            this.$modal.msgSuccess("鎿嶄綔鎴愬姛");
+            this.getList();
+          })
+        }
+      })
+    },
+    /** 涓嬭浇鎸夐挳鎿嶄綔 */
+    handleDownload (data) {
+      this.$download.resource(data);
+    },
     // 鎶ュ
     submitReportForm() {
       this.$refs["reportForm"].validate(valid => {
         if (valid) {
-          addReport(this.form).then(response => {
+          addReport(this.reportForm).then(response => {
             this.$modal.msgSuccess("鎴愬姛鎻愪氦鎶ュ");
-            this.open = false;
+            this.reportOpen = false;
             this.getList();
           });
         }
@@ -520,18 +478,24 @@
     },
     // 浜嬪悗鎶ュ鎸夐挳
     handleReport(row) {
-      this.reportForm.pointId = row.source;
+      this.reportForm.pointId = row.pointId;
+      this.reportForm.source = row.source;
       this.reportOpen = true;
     },
     // 瀹℃牳鎸夐挳
     handleAuditing(row) {
       this.auditingForm = row;
-      this.auditingOpen = true;
+      getYwCondition(row.id).then(response => {
+        this.ywConditions = response.data;
+        this.auditingOpen = true;
+      });
     },
     // 杩愮淮鎯呭喌鎸夐挳
     handleYwCondition(row) {
+      this.form = {};
       this.ywConditionForm = row;
       this.ywConditionOpen = true;
+      this.form.id = row.id;
     },
     // 杩愮淮缁撴灉鎸夐挳
     handleYwResult(row) {
@@ -545,8 +509,18 @@
     },
     // 杩囩▼鍥炬煡鐪�
     handleFlow(row) {
-      this.flowOpen = true;
       this.flowForm = row;
+      getYwAuditingList(row.id).then(response => {
+        if (response.data) {
+          this.ywAuditingList = response.data;
+        }
+      });
+      getYwCondition(row.id).then(response => {
+        if (response.data) {
+          this.ywHandleList = response.data;
+        }
+        this.flowOpen = true;
+      });
     },
     // 鎻愪氦瀹℃牳
     submitAuditing() {
@@ -555,6 +529,7 @@
           auditing(this.auditingForm).then(res => {
             this.auditingOpen = false;
             this.$modal.msgSuccess("鎿嶄綔鎴愬姛");
+            this.getList();
           })
         }
       })
@@ -592,11 +567,12 @@
     },
     // 鎻愪氦杩愮淮鎯呭喌
     submitYwCondition() {
-      this.$refs["ywConditionForm"].validate(valid => {
+      this.$refs["form"].validate(valid => {
         if (valid) {
-          ywCondition(this.ywConditionForm).then(res => {
+          ywCondition(this.form).then(res => {
             this.ywConditionOpen = false;
             this.$modal.msgSuccess("鎿嶄綔鎴愬姛");
+            this.getList();
           })
         }
       })
@@ -625,14 +601,17 @@
     getList() {
       this.loading = true;
       this.queryParams.params = {};
-      if (null != this.daterangeYwHandleTime && '' != this.daterangeYwHandleTime) {
-        this.queryParams["start"] = this.daterangeYwHandleTime[0];
-        this.queryParams["end"] = this.daterangeYwHandleTime[1];
-      }
+      this.queryParams["start"] = this.daterangeYwHandleTime ? this.daterangeYwHandleTime[0] : null;
+      this.queryParams["end"] = this.daterangeYwHandleTime ? this.daterangeYwHandleTime[1] : null;
+      if (this.queryParams["status"] == "") { this.queryParams["status"] = "DISTRIBUTED"; }
       listWorkOrder(this.queryParams).then(response => {
         this.workOrderList = response.data;
         this.total = response.total;
         this.loading = false;
+      });
+      // 鑾峰彇鏁呴殰绫诲瀷
+      getDicts("error_type").then(response => {
+        this.errorTypeOptions = response.data;
       });
     },
     // 鍙栨秷鎸夐挳
@@ -745,15 +724,24 @@
 </script>
 
 <style scoped>
-
+.work-order-item {
+  margin-bottom: 5px;
+}
 .time {
   font-size: 13px;
   color: #999;
 }
 
 .image {
-  width: 125px;
-  height: 125px;
+  width: 165px;
+  height: 150px;
   padding: 10px;
 }
+
+.line-limit-length {
+  overflow: hidden;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+  width: 200px;
+}
 </style>

--
Gitblit v1.8.0