From 7f356bf22e4fe731e2b79ca3877e7c702eaf0704 Mon Sep 17 00:00:00 2001
From: fuliqi <fuliqi@qq.com>
Date: 星期三, 03 四月 2024 14:25:17 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 src/views/system/work-order/index.vue |  454 ++++++++++++++++++++++++++++++++++++++++++++------------
 1 files changed, 355 insertions(+), 99 deletions(-)

diff --git a/src/views/system/work-order/index.vue b/src/views/system/work-order/index.vue
index 993fa72..ad79c56 100644
--- a/src/views/system/work-order/index.vue
+++ b/src/views/system/work-order/index.vue
@@ -10,6 +10,12 @@
           @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 label="甯傛斂鏂藉伐" value="甯傛斂鏂藉伐"></el-option>
+          <el-option label="璁惧閬楀け" value="璁惧閬楀け"></el-option>
+        </el-select>
+      </el-form-item>
       <el-form-item label="杩愮淮澶勭悊鏃堕棿">
         <el-date-picker
           clearable
@@ -29,101 +35,64 @@
       </el-form-item>
     </el-form>
 
-    <el-row :gutter="10" class="mb8">
-<!--      <el-col :span="1.5">-->
-<!--        <el-button-->
-<!--          type="primary"-->
-<!--          plain-->
-<!--          icon="el-icon-plus"-->
-<!--          size="mini"-->
-<!--          @click="handleAdd"-->
-<!--          v-hasPermi="['x:work-order:add']"-->
-<!--        >鏂板</el-button>-->
-<!--      </el-col>-->
-<!--      <el-col :span="1.5">-->
-<!--        <el-button-->
-<!--          type="success"-->
-<!--          plain-->
-<!--          icon="el-icon-edit"-->
-<!--          size="mini"-->
-<!--          :disabled="single"-->
-<!--          @click="handleUpdate"-->
-<!--          v-hasPermi="['x:work-order:edit']"-->
-<!--        >淇敼</el-button>-->
-<!--      </el-col>-->
-      <el-col :span="1.5">
-        <el-button
-          type="danger"
-          plain
-          icon="el-icon-delete"
-          size="mini"
-          :disabled="multiple"
-          @click="handleDelete"
-          v-hasPermi="['x:work-order:remove']"
-        >鍒犻櫎</el-button>
+    <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-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;">
+            <el-row>
+              <el-col :span="24" class="time">鏁呴殰绫诲瀷锛�<el-tag size="small" type="danger">甯傛斂鏂藉伐</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 class="work-order-item">
+              <el-col class="time" :span="24">杩愮淮鍗曚綅锛歿{ item.unitName }}</el-col>
+            </el-row>
+            <el-row class="work-order-item">
+              <el-col :span="24" class="time">宸ュ崟缂栧彿锛歿{ item.workOrderNo }}</el-col>
+            </el-row>
+            <el-row>
+              <el-col :span="24" class="time">澶勭悊鏃堕棿锛歿{ item.ywHandleTime }}</el-col>
+            </el-row>
+            <el-row>
+              <el-button
+                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"
+                @click="handleFlow(item)"
+              >杩囩▼鍥�</el-button>
+              <el-button
+                size="mini"
+                type="text"
+                @click="handleReport(item)"
+              >浜嬪悗鎶ュ</el-button>
+            </el-row>
+          </div>
+        </el-card>
       </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="warning"
-          plain
-          icon="el-icon-download"
-          size="mini"
-          @click="handleExport"
-          v-hasPermi="['x:work-order:export']"
-        >瀵煎嚭</el-button>
-      </el-col>
-      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
-
-    <el-table v-loading="loading" :data="workOrderList" @selection-change="handleSelectionChange">
-      <el-table-column type="selection" width="55" align="center" />
-      <el-table-column label="宸ュ崟鍙�" align="center" prop="workOrderNo" width="170"/>
-      <el-table-column label="宸ュ崟鏉ユ簮" align="center" prop="source" width="170"/>
-      <el-table-column label="鏁呴殰绫诲瀷" align="center" prop="errorType" width="170"/>
-      <el-table-column label="杩愮淮鍗曚綅" align="center" prop="unitName" width="150"/>
-      <el-table-column label="杩愮淮浜哄憳" align="center" prop="ywPeopleName" />
-      <el-table-column label="杩愮淮澶勭悊鏃堕棿" align="center" prop="ywHandleTime" width="180"/>
-      <el-table-column label="杩愮淮缁撴灉" align="center" prop="ywResult" />
-      <el-table-column label="杩愮淮鎯呭喌" align="center" prop="ywCondition" width="150"/>
-      <el-table-column label="杩愮淮妫�娴嬬粨鏋�" align="center" prop="ywCheckResult" width="230"/>
-      <el-table-column label="鍒涘缓鏃堕棿" align="center" prop="createTime" width="180"/>
-
-      <el-table-column label="鎿嶄綔" fixed="right" width="150"  align="center" class-name="small-padding fixed-width">
-        <template slot-scope="scope">
-<!--          <el-button-->
-<!--            size="mini"-->
-<!--            type="text"-->
-<!--            icon="el-icon-edit"-->
-<!--            @click="handleUpdate(scope.row)"-->
-<!--            v-hasPermi="['x:work-order:edit']"-->
-<!--          >淇敼</el-button>-->
-          <el-button
-            size="mini"
-            type="text"
-            @click="handleAuditing(scope.row)"
-            v-hasPermi="['x:work-order:remove']"
-          >瀹℃牳</el-button>
-          <el-button
-            size="mini"
-            type="text"
-            @click="handleYwCondition(scope.row)"
-            v-hasPermi="['x:work-order:remove']"
-          >杩愮淮鎯呭喌</el-button>
-          <el-button
-            size="mini"
-            type="text"
-            @click="handleYwResult(scope.row)"
-            v-hasPermi="['x:work-order:remove']"
-          >杩愮淮缁撴灉</el-button>
-          <el-button
-            size="mini"
-            type="text"
-            @click="handleCheckResult(scope.row)"
-            v-hasPermi="['x:work-order:remove']"
-          >妫�娴嬬粨鏋�</el-button>
-        </template>
-      </el-table-column>
-    </el-table>
 
     <pagination
       v-show="total>0"
@@ -132,6 +101,35 @@
       :limit.sync="queryParams.pageSize"
       @pagination="getList"
     />
+
+    <!-- 浜嬪悗鎶ュ -->
+    <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>
+        <el-form-item label="鎶ュ绫诲瀷">
+          <el-input v-model="reportForm.reportType" disabled />
+        </el-form-item>
+        <el-form-item label="鏁呴殰绫诲瀷" prop="errorType">
+          <el-select v-model="reportForm.errorType">
+            <el-option label="甯傛斂鏂藉伐" value="甯傛斂鏂藉伐"/>
+            <el-option label="璁惧鏁呴殰" value="璁惧鏁呴殰"/>
+            <el-option label="璁惧閬楀け" value="璁惧閬楀け"/>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="鎶ュ鍐呭" prop="reportContent">
+          <editor v-model="reportForm.reportContent" :min-height="192"/>
+        </el-form-item>
+        <el-form-item label="涓婃姤鏉愭枡" prop="reportMaterials">
+          <file-upload v-model="reportForm.reportMaterials"/>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitReportForm">鎻� 浜�</el-button>
+        <el-button @click="reportOpen = false">鍙� 娑�</el-button>
+      </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">
@@ -169,6 +167,34 @@
         <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>
+        <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>
@@ -201,7 +227,7 @@
       </div>
     </el-dialog>
 
-    <el-dialog title="杩愮淮妫�娴嬬粨鏋�" :visible.sync="checkResultOpen" width="500px" append-to-body>
+    <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  />
@@ -213,17 +239,17 @@
           <el-input v-model="checkResultForm.ywPeopleName" disabled />
         </el-form-item>
         <el-form-item label="杩愮淮妫�娴嬬粨鏋�" prop="ywCheckResult">
-          <el-input v-model="checkResultForm.ywCheckResult" type="textarea" maxlength="150" show-word-limit/>
+          <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="cancelYwResult">鍙� 娑�</el-button>
+        <el-button @click="cancelCheckResult">鍙� 娑�</el-button>
       </div>
     </el-dialog>
 
     <!-- 娣诲姞鎴栦慨鏀硅繍缁村伐鍗曞璇濇 -->
-    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
+    <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="璇疯緭鍏ュ伐鍗曞彿" />
@@ -248,16 +274,168 @@
         <el-button @click="cancel">鍙� 娑�</el-button>
       </div>
     </el-dialog>
+
+
+    <!-- 杩囩▼鍥� -->
+    <el-dialog title="杩囩▼鍥�" :visible.sync="flowOpen" width="1200px" :close-on-click-modal="false" append-to-body>
+      <div>
+        <el-steps :active="2" :space="500">
+          <el-step title="浜х敓宸ュ崟">
+            <template slot="description">
+              <div>
+                <div class="flow-item-x">
+                  宸ュ崟鏉ユ簮锛�<el-tag type="danger" size="small">{{flowForm.source}}</el-tag>
+                </div>
+                <div class="flow-item-x">
+                  鏁呴殰绫诲瀷锛歿{flowForm.errorType}}
+                </div>
+                <div class="flow-item-x">
+                  杩愮淮鍗曚綅锛歿{flowForm.unitName}}
+                </div>
+                <div class="flow-item-x">
+                  鍒涘缓鏃堕棿锛歿{flowForm.createTime}}
+                </div>
+                <div class="flow-item-x">
+                  澶勭悊鏈熼檺锛�<el-tag type="danger" size="small">12灏忔椂</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>
+                  <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>
+                </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="缁撴灉瀹℃牳">
+            <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>
+                  <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>
+                </div>
+              </div>
+            </template>
+          </el-step>
+        </el-steps>
+      </div>
+    </el-dialog>
+
   </div>
 </template>
-
+<style scoped>
+.flow-item-x {
+  margin: 5px 0;
+}
+.y-item {
+  margin-bottom: 8px;
+  padding: 0 3px;
+  background-color: #d9d9d9;
+  display: flex;
+  flex-direction: row;
+  align-items: center
+}
+.y-item-2 {
+  flex: 1;
+}
+.y-item-1 {
+  flex: 2;
+}
+</style>
 <script>
 import { listWorkOrder, getWorkOrder, delWorkOrder, addWorkOrder, updateWorkOrder,auditing, ywCondition } from "@/api/platform/work-order";
-
 export default {
   name: "Work-order",
+  components: {
+  },
   data() {
     return {
+      reportFormRules: {
+        reportContent: [
+          { required: true, message: "鎶ュ鍐呭涓嶈兘涓虹┖", trigger: "blur" }
+        ],
+        reportMaterials: [
+          { required: true, message: "涓婃姤鏉愭枡涓嶈兘涓虹┖", trigger: "blur" }
+        ],
+      },
+      reportOpen: false,
+      reportForm: {
+        reportType: "浜嬪悗鎶ュ",
+        pointId: "鐞间簬闀�3琛�1鍙锋憚鍍忓ご",
+        errorType: "",
+        reportContent: "",
+        reportMaterials: ""
+      },
+      // 杩囩▼鍥�
+      flowOpen: false,
+      flowForm: {},
+      certificateList:[],
+      pictureList: [],
       // 閬僵灞�
       loading: true,
       // 閫変腑鏁扮粍
@@ -337,6 +515,23 @@
     this.getList();
   },
   methods: {
+    // 鎶ュ
+    submitReportForm() {
+      this.$refs["reportForm"].validate(valid => {
+        if (valid) {
+          addReport(this.form).then(response => {
+            this.$modal.msgSuccess("鎴愬姛鎻愪氦鎶ュ");
+            this.open = false;
+            this.getList();
+          });
+        }
+      });
+    },
+    // 浜嬪悗鎶ュ鎸夐挳
+    handleReport(row) {
+      this.reportForm.pointId = row.source;
+      this.reportOpen = true;
+    },
     // 瀹℃牳鎸夐挳
     handleAuditing(row) {
       this.auditingForm = row;
@@ -357,6 +552,11 @@
       this.checkResultForm = row;
       this.checkResultOpen = true;
     },
+    // 杩囩▼鍥炬煡鐪�
+    handleFlow(row) {
+      this.flowOpen = true;
+      this.flowForm = row;
+    },
     // 鎻愪氦瀹℃牳
     submitAuditing() {
       this.$refs["auditingForm"].validate(valid => {
@@ -372,6 +572,32 @@
     cancelAuditing() {
       this.auditingForm = {};
       this.auditingOpen = false;
+    },
+    pictureRemove(file, fileList) {
+      this.form.picture = null,
+
+        this.pictureList = this.pictureList.filter(item => item.name !== file.name)
+    },
+    certificateRemove(file, fileList) {
+      this.form.certificate = null,
+
+        this.certificateList = this.certificateList.filter(item => item.name !== file.name)
+    },
+    pictureUploadSuccess(response, file, fileList) {
+      this.form.picture = response.fileName,
+        this.pictureList.push({
+          name: response.originalFilename,
+          url: response.url,
+          fileName: response.fileName
+        })
+    },
+    certificateUploadSuccess(response, file, fileList) {
+      this.form.certificate = response.fileName,
+        this.certificateList.push({
+          name: response.originalFilename,
+          url: response.url,
+          fileName: response.fileName
+        })
     },
     // 鎻愪氦杩愮淮鎯呭喌
     submitYwCondition() {
@@ -471,6 +697,20 @@
         this.form = response.data;
         this.open = true;
         this.title = "淇敼杩愮淮宸ュ崟";
+        this.pictureList = JSON.parse(response.data.picture).map(item => {
+          return {
+            name: item,
+            url: process.env.VUE_APP_FILE_API + '/' + item,
+            fileName: item
+          }
+        })
+        this.certificateList = JSON.parse(row.certificate).map(item => {
+          return {
+            name: item,
+            url: process.env.VUE_APP_FILE_API + '/' + item,
+            fileName: item
+          }
+        })
       });
     },
     /** 鎻愪氦鎸夐挳 */
@@ -512,3 +752,19 @@
   }
 };
 </script>
+
+<style scoped>
+.work-order-item {
+  margin-bottom: 5px;
+}
+.time {
+  font-size: 13px;
+  color: #999;
+}
+
+.image {
+  width: 165px;
+  height: 150px;
+  padding: 10px;
+}
+</style>

--
Gitblit v1.8.0