From dd1bb5e756d7dbebf0140deb8e2510c1cbbd81db Mon Sep 17 00:00:00 2001
From: fuliqi <fuliqi@qq.com>
Date: 星期三, 17 七月 2024 11:20:49 +0800
Subject: [PATCH] 工单阈值字段定义,菜单样式回滚

---
 src/views/system/work-order/index.vue |  121 ++++++++++++++++++++++++++++++----------
 1 files changed, 90 insertions(+), 31 deletions(-)

diff --git a/src/views/system/work-order/index.vue b/src/views/system/work-order/index.vue
index de65e22..acce881 100644
--- a/src/views/system/work-order/index.vue
+++ b/src/views/system/work-order/index.vue
@@ -12,12 +12,11 @@
       </el-form-item>
       <el-form-item label="鏁呴殰绫诲瀷" prop="workOrderNo">
         <el-select v-model="queryParams.errorType" placeholder="鏁呴殰绫诲瀷" clearable @clear="handleQuery">
-          <el-option label="甯傛斂鏂藉伐" value="甯傛斂鏂藉伐"></el-option>
-          <el-option label="璁惧閬楀け" value="璁惧閬楀け"></el-option>
+          <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="瀹℃牳鐘舵��" clearable @clear="handleQuery">
+        <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>
@@ -43,13 +42,25 @@
       </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">甯傛斂鏂藉伐</el-tag></el-col>
+              <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>
@@ -84,6 +95,7 @@
                 size="mini"
                 type="text"
                 @click="handleReport(item)"
+                v-hasPermi="['system:report:add']"
               >浜嬪悗鎶ュ</el-button>
             </el-row>
           </div>
@@ -102,8 +114,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 />
@@ -139,12 +151,14 @@
         <el-form-item label="杩愮淮浜哄憳" prop="ywPeopleName">
           <el-input v-model="auditingForm.ywPeopleName" disabled />
         </el-form-item>
-        <el-form-item label="鐜板満鎯呭喌" v-if="auditingForm.condition">
-          <el-input type="textarea" v-html="auditingForm.condition" disabled />
-        </el-form-item>
-        <el-form-item label="浣愯瘉鏉愭枡" v-if="auditingForm.proofMaterials">
-          <el-link v-for="item in auditingForm.proofMaterials != null ? auditingForm.proofMaterials.split(',') : auditingForm.proofMaterials" :underline="false" :key="item" @click="handleDownload(item)">{{ item.substring(item.lastIndexOf("/") + 1) }}</el-link>
-        </el-form-item>
+        <div v-for="obj, index in ywConditions" :key="index">
+          <el-form-item :label="'鐜板満鎯呭喌' + (index + 1)" v-if="obj.ywCondition">
+            <span v-html="obj.ywCondition"></span>
+          </el-form-item>
+          <el-form-item label="浣愯瘉鏉愭枡" v-if="obj.ywProofMaterials">
+            <el-link v-for="item in obj.ywProofMaterials != null ? obj.ywProofMaterials.split(',') : obj.ywProofMaterials" :underline="false" :key="item.id" @click="handleDownload(item)">{{ item.substring(item.lastIndexOf("/") + 1) }}</el-link>
+          </el-form-item>
+        </div>
         <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>
@@ -183,9 +197,26 @@
       </div>
     </el-dialog>
 
+    <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.errorType" 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="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="batchAuditing('AUDITING_SUCCESS')">瀹� 鏍�</el-button>
+        <el-button type="danger" @click="batchAuditing('AUDITING_FAIL')">椹� 鍥�</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="ywAuditingList.length != 0 ? 3 : ywHandleList.length != 0 ? 2 : 1" :space="500">
           <el-step title="浜х敓宸ュ崟">
@@ -211,13 +242,14 @@
           </el-step>
           <el-step title="杩愮淮澶勭悊">
             <template slot="description">
-              <div class="y-item" v-for="(item, index) in ywHandleList">
+              <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">
-                      <el-tag size="small" class="line-limit-length">{{ item.ywCondition }}</el-tag>
-                    </el-tooltip>
+                    <div v-html="item.ywCondition"></div>
+<!--                    <el-tooltip class="item" effect="dark" :content="item.ywCondition" placement="top">-->
+<!--                      <el-tag size="small" class="line-limit-length">{{ item.ywCondition }}</el-tag>-->
+<!--                    </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>
@@ -236,7 +268,7 @@
           </el-step>
           <el-step title="缁撴灉瀹℃牳">
             <template slot="description">
-              <div class="y-item" v-for="(item, index) in ywAuditingList">
+              <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>
@@ -282,14 +314,19 @@
 }
 </style>
 <script>
-import { listWorkOrder, getWorkOrder, delWorkOrder, addWorkOrder, updateWorkOrder,auditing, ywCondition, getYwCondition, getYwConditionList, getYwAuditingList } 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: {},
       ywHandleList: [],
       ywAuditingList: [],
       reportFormRules: {
@@ -387,12 +424,32 @@
           { required: true, message: "杩愮淮妫�娴嬬粨鏋滀笉鑳戒负绌�", trigger: "blur" }
         ],
       },
+      // 鎵归噺瀹℃牳鏍¢獙
+      batchAuditingRules: {
+        errorType: [
+          { required: true, message: "璇烽�夋嫨鏁呴殰绫诲瀷", trigger: "blur" }
+        ],
+      }
     };
   },
   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);
@@ -403,7 +460,7 @@
         if (valid) {
           addReport(this.reportForm).then(response => {
             this.$modal.msgSuccess("鎴愬姛鎻愪氦鎶ュ");
-            this.open = false;
+            this.reportOpen = false;
             this.getList();
           });
         }
@@ -411,17 +468,15 @@
     },
     // 浜嬪悗鎶ュ鎸夐挳
     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;
       getYwCondition(row.id).then(response => {
-        if (response.data) {
-          this.auditingForm.condition = response.data.ywCondition;
-          this.auditingForm.proofMaterials = response.data.ywProofMaterials;
-        }
+        this.ywConditions = response.data;
         this.auditingOpen = true;
       });
     },
@@ -536,14 +591,18 @@
     getList() {
       this.loading = true;
       this.queryParams.params = {};
-      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;
+      });
     },
     // 鍙栨秷鎸夐挳
     cancel() {

--
Gitblit v1.8.0