From 3c6bdb6f439ff7af04765259fd6a91b6d201d095 Mon Sep 17 00:00:00 2001
From: zxl <763096477@qq.com>
Date: 星期四, 19 六月 2025 17:12:25 +0800
Subject: [PATCH] 工单,数据中心用户查看数据的权限,合同考核每日,以及导出每日和按月

---
 src/views/system/work-order/index.vue |  353 +++++++++++++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 294 insertions(+), 59 deletions(-)

diff --git a/src/views/system/work-order/index.vue b/src/views/system/work-order/index.vue
index 5e3453e..5c3514e 100644
--- a/src/views/system/work-order/index.vue
+++ b/src/views/system/work-order/index.vue
@@ -1,7 +1,20 @@
 <template>
-  <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
-      <el-form-item label="鍏抽敭璇�" prop="keyword">
+  <div style=" padding: 0 20px;">
+    <el-row type="flex" justify="left" v-if="this.$store.state.user.roles.some(role => ['admin', 'zg_city', 'city_leader'].includes(role))">
+      <el-col :span="24" style="position: relative">
+        <el-menu :default-active="activeIndex" class="el-menu" mode="horizontal">
+          <el-menu-item index="0" @click="changeUnit(null, '鍏ㄩ儴')">
+            鍏ㄩ儴鍗曚綅锛坽{ totalWorkOrders }}锛�
+          </el-menu-item>
+          <el-menu-item :index="index + 1 +''" v-for="(item, index) in unitList" :key="index" @click="changeUnit(item.id, item.value)">
+            {{ item.unitName }}锛坽{ item.workOrderCount }}锛�
+          </el-menu-item>
+        </el-menu>
+      </el-col>
+    </el-row>
+
+    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" style="margin-top: 10px;">
+      <el-form-item label="鍏抽敭瀛�" prop="keyword">
         <el-input
           v-model="queryParams.keyword"
           placeholder="宸ュ崟鍙�/鐐逛綅鍚嶇О鎼滅储"
@@ -10,13 +23,22 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="鏁呴殰绫诲瀷" prop="errorTypeList">
-        <el-select v-model="queryParams.errorTypeList" multiple @change="handleQuery" placeholder="鏁呴殰绫诲瀷" clearable @clear="handleQuery">
-          <el-option v-for="dict in dict.type.error_type" :value="dict.value" :key="dict.value" :label="dict.label" />
-        </el-select>
+      <el-form-item label="鏁呴殰绫诲瀷" prop="errorType">
+<!--        <el-select v-model="queryParams.errorTypeList" multiple @change="handleQuery" placeholder="鏁呴殰绫诲瀷" clearable>-->
+<!--          <el-option v-for="dict in dict.type.error_type" :value="dict.value" :key="dict.value" :label="dict.label" />-->
+<!--        </el-select>-->
+          <el-cascader
+            v-model="queryParams.errorType"
+            :options="errorTypeList"
+            :props="{ expandTrigger: 'hover',emitPath: false }"
+            :show-all-levels="false"
+            @change="handleQuery"
+            placeholder="鏁呴殰绫诲瀷"
+            clearable
+          ></el-cascader>
       </el-form-item>
       <el-form-item label="宸ュ崟鐘舵��" prop="status">
-        <el-select v-model="queryParams.status" placeholder="宸ュ崟鐘舵��" @change="handleQuery">
+        <el-select v-model="queryParams.status" placeholder="宸ュ崟鐘舵��" @change="handleQuery" clearable>
           <el-option label="鍏ㄩ儴" value=""></el-option>
           <el-option label="寰呭鐞�" value="DISTRIBUTED"></el-option>
           <el-option label="寰呭鏍�" value="YW_HANDLE"></el-option>
@@ -24,14 +46,17 @@
           <el-option label="瀹℃牳鏈�氳繃" value="AUDITING_FAIL"></el-option>
         </el-select>
       </el-form-item>
-      <el-form-item label="鏃堕棿鑼冨洿" prop="timeRange">
+      <el-form-item label="鏃堕棿鑼冨洿" prop="timeRange" >
         <el-date-picker
-          v-model="queryParams.timeRange"
+          v-model="timeRange"
           type="daterange"
           range-separator="鑷�"
           value-format="yyyy-MM-dd"
           start-placeholder="寮�濮嬫棩鏈�"
-          end-placeholder="缁撴潫鏃ユ湡">
+          end-placeholder="缁撴潫鏃ユ湡"
+          @change="handleQuery"
+          clearable
+         >
         </el-date-picker>
       </el-form-item>
       <el-form-item>
@@ -39,9 +64,25 @@
         <el-button icon="el-icon-refresh" size="small" @click="resetQuery">閲嶇疆</el-button>
       </el-form-item>
     </el-form>
-
     <el-row :gutter="10" class="mb8">
       <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          size="mini"
+          @click="handleExport"
+          v-hasPermi="['work:order:export']"
+        >瀵煎嚭
+        </el-button>
+        <el-button
+          :type="isSelectAll ? 'danger' : 'primary'"
+          plain
+          size="mini"
+          @click="toggleSelectAll"
+          v-hasPermi="['work:order:audit']"
+        >
+          {{ isSelectAll ? '鍙栨秷鍏ㄩ��' : '鍏ㄩ��' }}
+        </el-button>
         <el-button
           type="primary"
           plain
@@ -51,13 +92,14 @@
         >鎵归噺瀹℃牳
         </el-button>
         <el-button
-          type="primary"
+          type="danger"
           plain
           size="mini"
-          @click="handleExport"
-          v-hasPermi="['work:order:export']"
-        >瀵煎嚭
+          @click="batchDelete"
+          v-hasPermi="['work:order:delete']"
+        >鍒犻櫎
         </el-button>
+        <el-button size="mini" plain type="info" @click="selectedDistribute" class="op">鎵归噺涓婃姤</el-button>
       </el-col>
     </el-row>
 
@@ -69,16 +111,30 @@
 <!--              <el-tag style="margin-right: 5px;height:24px;overflow:auto" effect="dark" v-for="(error, index) in item.errorTypeList" :key="index" size="small" type="warning">{{ error }}</el-tag>-->
 <!--            </el-row>-->
             <div>
+              <el-row style="display: flex;">
+              <el-checkbox  v-if="$store.state.user.roles.includes('admin')"
+                            v-model="isItemSelected[item.workOrderNo]"
+                            @change="toggleSelection(item)"
+                            style="margin-right: 10px; "></el-checkbox>
                <el-tooltip
                 effect="dark"
                 :content="allErrorTypesMessage(item.errorTypeList)"
                 placement="top"
                >
               <el-row>
-                <el-tag style="margin-right: 5px;height:24px;overflow:auto" effect="dark" v-for="(error, errorIndex) in displayedErrors(item.errorTypeList)" :key="errorIndex" size="small" type="warning">
+                <el-tag
+                  style="margin-right: 5px;height:24px;overflow:auto" effect="dark"
+                  v-for="(error, errorIndex) in displayedErrors(item.errorTypeList)" :key="errorIndex" size="small"
+                  :type="error === '鍥惧儚寮傚父'
+                     || error ===  '鐐逛綅淇℃伅閿欒'
+                     || error ===  '鏃堕挓鍋忓樊'
+                     || error ===  'OSD寮傚父'
+                     ? 'danger' : 'warning'">
                   {{ error }}
                 </el-tag>
-              </el-row></el-tooltip>
+              </el-row>
+               </el-tooltip>
+              </el-row>
             </div>
           </div>
           <svg v-if="item.status === 'DISTRIBUTED'" t="1721617809410" class="icon work-order-status" width="72" height="72" viewBox="0 0 1669 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6020"><path d="M429.450929 719.145278L62.111562 621.044163c-18.20892-5.253429-31.164411-25.844201-25.888722-44.030861l20.613032-74.883628c-12.91097 2.626715-25.866461 2.626715-38.799691 2.626715l-15.582206 61.972658c-10.306516 38.755171 12.955491 77.532603 49.128468 87.816858l305.277668 82.763772c20.835635-2.604454 51.955525-7.857884 72.568557-18.164399zM525.281493 744.989479c-15.582206 5.253429-31.164411 10.306516-44.075381 7.679801-10.306516-2.626715-18.20892-12.91097-20.635293-25.844201l-25.866461-7.679801-23.262007 31.09763 367.56197 98.123375c12.91097-7.679801 28.493176-18.18666 44.075381-25.844201l-297.798209-77.532603zM62.111562 486.569729L175.928444 62.822778c5.253429-18.18666 25.866461-31.09763 44.075381-25.844201L1389.715478 349.691183c-7.679801-12.91097-7.679801-31.07537-7.679801-38.755171L274.16312 13.761091c7.702062 10.284256 18.20892 20.590772 28.515436 28.470916-20.613032-5.253429-57.008612-20.813375-80.248359-41.404147-36.195238-5.231169-72.390475 15.359603-80.270619 51.688402L28.342696 473.658759c10.306516 5.253429 20.813375 7.679801 33.768866 12.91097zM1467.1813 982.818457c-7.679801 5.253429-18.20892 7.679801-28.493175 5.253429l-444.983272-119.114832c-41.448667-7.679801-106.13708-15.559945-173.474468-10.306516l610.755678 162.722747c5.253429 2.626715 12.933231 2.626715 18.18666 2.626715 2.448632-10.284256 10.328776-23.217486 18.008577-41.181543zM1555.109461 706.234307s10.328776 7.657541 25.888721 15.537685l69.941843-266.07729c10.328776-38.777432-12.91097-77.532603-49.128468-87.816859l-209.647446-56.941831c23.262007 12.91097 69.964103 36.128457 121.719286 41.404146-12.933231 5.231169-36.195238 10.284256-57.008613 12.910971l134.630257 36.128456c18.20892 5.253429 31.142151 25.821941 25.888721 44.008601l-132.003541 493.622013c5.231169 20.590772 7.657541 46.434973 2.604454 69.852801 10.306516-10.306516 20.635292-23.217486 25.888722-38.777431l56.986352-211.962517c-18.364742-10.506859-15.738028-51.888745-15.738028-51.888745z" fill="#d81e06" p-id="6021"></path><path d="M359.08614 281.864068l9.505146-35.126743 80.671304 21.815088 11.931518-44.030861 39.623322 10.707201-11.931517 44.008601 85.101103 22.816801-9.505146 35.126743-85.101103-22.816801-11.130146 40.981201 102.708995 27.669545-9.505146 35.126743-241.991652-65.423003 9.10446-33.702085a328.628716 328.628716 0 0 1-41.248325 35.928115l-49.729496 184.537834-36.595923-9.705488 37.619897-139.104575c-15.18152 9.505145-30.140438 18.587345-45.099355 27.068517 0-4.229456-0.222603-11.130147-0.801371-20.590772-1.224316-10.707201-1.825344-18.787688-1.424659-24.041117 41.626749-22.193513 79.847674-51.265456 114.640513-86.815145l26.667832 29.294546-2.22603 2.604455 75.217533 20.190086 20.613032 27.869888 2.448632-21.592485 11.107887-40.981201-80.671305-21.815088z m-125.748399 17.964057a443.35827 443.35827 0 0 0-6.255142-40.95894 420.808592 420.808592 0 0 0 105.513792-70.47609l26.289407 30.674685c-41.626749 33.724345-83.476101 60.570259-125.548057 80.760345z m69.7415 125.570317l9.10446-33.702085 146.584034 39.556542 7.056514-26.445229 39.623322 10.684941-7.056513 26.46749 51.332238 13.734601-9.0822 33.702084-51.354498-13.71234-48.126755 20.590771 39.42298 11.308229-10.306516 38.354486c-7.479459 31.498316-28.493176 43.18497-62.863069 34.926401-17.585632-4.652401-35.59421-9.705488-54.181555-14.535971 0.601028-6.0548 1.402399-15.359603 2.626715-27.469203 0.400685-5.231169 0.400685-9.282542 0.200342-12.510285 13.356176 4.652401 28.493176 9.282542 45.077095 13.734601 19.010291 7.256856 29.917835 1.803084 32.744892-16.361316l15.782548-58.544572-146.584034-39.779145z m45.099355 95.296317a773.83459 773.83459 0 0 1-15.582205-29.272286 1399.393364 1399.393364 0 0 0-18.787688-34.926401l32.344207-14.936657c0.601028 1.202056 1.825344 3.0274 3.227742 5.654115 13.356176 20.390429 24.864748 39.779145 34.570236 57.943544l-35.772292 15.537685zM953.858928 718.343907c-54.982925-13.734601-96.609675-26.645572-124.924769-38.354486-47.102781-15.760288-81.87336-42.005174-104.534339-78.356234-17.585632 10.907544-49.929839 25.866461-97.03262 44.631889-1.825344-4.630141-4.452059-10.684941-7.679801-17.763714-3.851031-9.482885-6.455485-16.361316-8.503433-21.1918 37.820239-11.708914 70.164446-26.645572 97.054881-44.631889-2.448632-7.457198 30.31852-29.873314 28.493176-37.731197-1.402399-6.277403-37.397293 2.003426-38.198664-4.251717a277.229698 277.229698 0 0 1-1.825344-55.316829c-2.827057 2.426372-7.078773 6.455485-12.732888 12.309942-13.356176 14.335629-23.863035 24.441802-31.943522 30.696945a583.019352 583.019352 0 0 0-4.652401-46.835658c43.674696-41.604489 81.272332-93.270631 112.614826-155.065206l37.998321 16.561659c-3.628428 5.253429-8.280829 12.91097-14.157547 22.816801a1843.775607 1843.775607 0 0 1-17.785974 31.297973l93.804877 25.220912-9.505145 35.149004c-25.265433 62.373343-56.607927 108.808316-94.205563 139.483 16.583919 31.698658 45.099355 54.53772 85.323706 68.450404 41.626749 16.561659 86.325419 29.472629 134.029228 39.178117-6.878431 10.083913-14.157547 21.1918-21.637005 33.702084z m-142.911086-291.320463l-67.537731-18.1644a50.75347 50.75347 0 0 1-9.505145 11.508572c-5.053087 45.811684-3.0274 84.989801 5.876717 117.690173 27.892148-24.842488 51.55484-61.772315 71.166159-111.034345z m159.294662 143.534373c-5.053087-8.681515-12.933231-22.193513-23.440089-40.95894-10.729462-18.587345-19.010291-32.321946-25.087351-41.203804l-41.426407 153.640547-39.623323-10.684941 15.960631-58.767175 40.847639 5.854457-31.142151-42.606202 50.130181-185.539548 39.623323 10.707201-28.092491 103.955572 14.958918-8.458912a2097.89912 2097.89912 0 0 1 64.488071 92.669603l-37.174691 21.392142zM1135.814568 470.609099l9.905831-36.506882 114.41791 30.875027-9.883571 36.551403-38.220924-10.306516-23.239747 86.41446 36.595923 9.88357-9.505145 35.126744-36.595923-9.883571-24.041117 89.219257 40.424693 1.424659a534.024446 534.024446 0 0 0-8.904117 38.354486c-5.253429-0.400685-13.356176-1.001713-24.664406-2.003426-39.623323-4.452059-71.366502-7.279116-95.229536-8.503432l4.051373-38.154144 45.900726 4.452059 16.984604-62.774028 43.051408-13.957205-34.369893-18.364742-36.595923-9.88357 9.505145-35.126744 36.595923 9.883571 23.239747-86.41446-39.40072-10.284256z m70.787734 238.852951l8.681515-32.299686 87.92816 23.595911 9.905831-36.506882-83.476102-22.416115 49.106208-181.510435 203.792989 54.916144-43.051408 158.693634-26.890435 17.140426-62.885329-16.940083-9.905831 36.529142 87.92816 23.618171-8.681515 32.121604-87.92816-23.640432-10.907544 41.404147 101.061734 27.246599-8.280829 30.674685-244.818711-66.001771 8.28083-30.696945 106.938451 28.871601 11.130147-40.95894-87.928161-23.840775z m79.847674-132.226145l-11.530832 42.3836 46.902439 12.710627 11.508571-42.383599-46.880178-12.732888z m20.012004-74.705545l-11.931517 44.0086 46.902438 12.710628 11.931518-44.008601-46.902439-12.710627z m63.464097 97.099401l-11.508572 42.405859 46.902439 12.710628 11.508572-42.383599-46.902439-12.732888z m67.137046-61.972658l-46.902439-12.732888-11.931517 44.030861 46.902439 12.710628 11.931517-44.008601z" fill="#d81e06" p-id="6022"></path></svg>
@@ -89,7 +145,7 @@
           <svg v-if="item.overtime === 2" t="1721640480312" class="icon work-order-overtime" width="36" height="36" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="13285"><path d="M896 0a128 128 0 0 1 128 128v768a128 128 0 0 1-128 128H128a128 128 0 0 1-128-128V128a128 128 0 0 1 128-128h768zM205.568 336.192h-40.768v57.792H99.84v37.632h64.96v57.344H95.808v38.528h79.296v135.744a175.168 175.168 0 0 1-31.36-40.768c2.688-21.056 4.032-43.008 4.928-66.304l-36.288-4.48a581.376 581.376 0 0 1-30.464 171.136l30.912 27.328c8.96-24.192 16.576-49.28 22.4-76.16 17.472 23.744 37.184 40.768 59.584 51.072 29.12 12.544 101.248 19.264 215.936 19.264H485.12l7.168-42.112a1437.44 1437.44 0 0 1-90.944 2.24c-94.976 0-155.456-4.48-181.44-13.44a21.824 21.824 0 0 0-4.928-1.792V620.224h54.208v-38.528h-54.208v-54.208h51.968V488.96h-61.376v-57.344h64.064v-37.632H205.568v-57.792z m685.44 4.032h-43.456v75.264h-149.184v40.768h149.184v232.96c0 11.648-5.376 17.472-16.128 17.472-23.744 0-48.384-0.896-74.368-2.24l9.408 41.216h79.296c30.016 0 45.248-15.232 45.248-45.696V456.256h50.176v-40.768h-50.176V340.224z m-210.112 27.328H544.256v346.304h41.664v-38.528h53.76v27.776h41.216V367.552zM469.888 540.032H293.376v144.256h176.512V540.032z m-38.528 37.184v70.336H331.456V577.216H431.36z m316.736-74.368l-35.392 21.952c25.984 41.216 47.04 78.848 62.72 112l35.392-24.64c-14.336-31.36-35.392-67.648-62.72-109.312z m-108.416 35.84v97.216h-53.76V538.688h53.76z m-163.072-183.68H281.728v39.424h57.344c-4.48 21.056-11.2 38.08-19.264 51.52-10.752 16.576-26.88 31.808-47.488 45.248l27.776 34.944c24.192-17.472 43.008-37.184 55.552-59.584 9.408-17.92 17.024-42.112 22.848-72.128h57.344c-0.448 40.768-2.24 65.856-4.928 75.264-2.688 9.856-8.96 15.232-19.712 15.68-9.408-0.896-21.056-1.792-35.392-3.136l10.304 37.184c13.44 1.344 24.64 2.24 34.048 2.24 20.608 0 34.944-8.064 43.456-23.744 8.064-15.68 12.544-63.168 12.992-142.912z m163.072 51.072v92.736h-53.76V406.08h53.76z" fill="#ED2525" fill-opacity="1" opacity="1" p-id="13286"></path></svg>
           <svg v-else-if="item.overtime === 1 "t="1721902978015" class="icon work-order-overtime" width="36" height="36" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5608"><path d="M512.2 141.8c-203.1 0-367.8 164.7-367.8 367.8s164.7 367.8 367.8 367.8c203.1 0 367.8-164.7 367.8-367.8S715.3 141.8 512.2 141.8z m162.4 494.3c-9.1 12.1-26.5 14.6-38.6 5.5l-143.9-108c-3.6-2.7-6.4-6.2-8.3-10.1-2.3-4-3.7-8.7-3.7-13.6V295.4c0-15.2 12.4-27.6 27.6-27.6 15.2 0 27.6 12.4 27.6 27.6V497L669 597.4c12.3 9.1 14.8 26.5 5.6 38.7zM122.5 277.1l-26.9-26.9c-3.9-3.9-3.9-10.3 0-14.1l129.7-129.7c3.9-3.9 10.3-3.9 14.1 0l26.9 26.9c3.9 3.9 3.9 10.3 0 14.1L136.7 277.1c-3.9 3.9-10.3 3.9-14.2 0zM901.9 277.1l26.9-26.9c3.9-3.9 3.9-10.3 0-14.1L799.1 106.3c-3.9-3.9-10.3-3.9-14.1 0l-27 27c-3.9 3.9-3.9 10.3 0 14.1l129.7 129.7c3.9 3.9 10.3 3.9 14.2 0z" fill="#d81e06" p-id="5609"></path><path d="M201.9 919.2L175 892.3c-3.9-3.9-3.9-10.3 0-14.1l129.7-129.7c3.9-3.9 10.3-3.9 14.1 0l26.9 26.9c3.9 3.9 3.9 10.3 0 14.1L216.1 919.2c-3.9 3.9-10.3 3.9-14.2 0zM821.5 919.2l26.9-26.9c3.9-3.9 3.9-10.3 0-14.1L718.7 748.5c-3.9-3.9-10.3-3.9-14.1 0l-26.9 26.9c-3.9 3.9-3.9 10.3 0 14.1l129.7 129.7c3.8 3.9 10.2 3.9 14.1 0z" fill="#d81e06" p-id="5610"></path></svg>
 
-          <el-carousel trigger="click" height="150px" :autoplay="false" indicator-position="none">
+          <el-carousel trigger="click" height="160px" :autoplay="false" indicator-position="none">
             <el-carousel-item>
               <div class="card">
                 <div class="card-left">
@@ -118,12 +174,15 @@
                     <el-col :span="24" class="time">鏁呴殰鏃堕棿锛歿{ item.createTime }}</el-col>
                   </el-row>
                   <el-row class="work-order-item">
-                    <el-col class="time" :span="24"><div>鍥芥爣鐮侊細{{ item.serialNumber }}</div>
+                    <el-col class="time" :span="24">
+                      <div>鍥芥爣鐮侊細{{ item.serialNumber }}</div>
                       <el-tooltip effect="dark" :content="item.source" placement="top-start">
                         <div>{{ item.source }}</div>
-                      </el-tooltip></el-col>
+                      </el-tooltip>
+                      <div>IP锛歿{ item.ip }}</div>
+                    </el-col>
                   </el-row>
-                  <el-row style="position: absolute;bottom: 10px">
+                  <el-row style="position: absolute">
                     <el-button
                       size="mini"
                       type="text"
@@ -163,8 +222,25 @@
                       size="mini"
                       type="text"
                       @click="handleDetail(item)"
-                      v-hasPermi="['system:workorder:detail']"
+                      v-hasPermi="['work:order:detail']"
                     >璇︽儏
+                    </el-button>
+                    <el-button
+                      class="my-button"
+                      size="mini"
+                      type="text"
+                      @click="handleCheck(item)"
+                      v-show="item.status === 'YW_HANDLE'"
+                      v-hasPermi="['system:workorder:getImage']"
+                    >妫�娴�
+                    </el-button>
+                    <el-button
+                      class="my-button"
+                      size="mini"
+                      type="text"
+                      @click="handleDelete(item)"
+                      v-hasPermi="['work:order:delete']"
+                    >鍒犻櫎
                     </el-button>
                   </el-row>
                 </div>
@@ -273,10 +349,10 @@
 
     <el-dialog title="杩愮淮鎯呭喌璁板綍" :visible.sync="ywConditionOpen" width="500px" append-to-body>
       <el-form ref="ywConditionForm" :model="form" :rules="ywConditionRules" label-width="80px">
-        <el-form-item label="宸ュ崟鍙�" prop="workOrderNo">
+        <el-form-item label="宸ュ崟鍙�" prop="workOrderNo" v-if="!isConditionList">
           <el-input v-model="ywConditionForm.workOrderNo" disabled/>
         </el-form-item>
-        <el-form-item label="杩愮淮鍗曚綅" prop="unitName">
+        <el-form-item label="杩愮淮鍗曚綅" prop="unitName"  v-if="!isConditionList">
           <el-input v-model="ywConditionForm.unitName" disabled/>
         </el-form-item>
         <el-form-item label="鐜板満鎯呭喌" prop="ywCondition">
@@ -296,11 +372,6 @@
       <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="dict in dict.type.error_type" :value="dict.value" :key="dict.value" :label="dict.label" />
-          </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>
@@ -427,6 +498,23 @@
       </div>
     </el-dialog>
 
+    <!-- 宸ュ崟妫�娴嬬粨鏋� -->
+    <el-dialog title="宸ュ崟妫�娴嬬粨鏋�" :visible.sync="checkImageOpen" width="1200px"  append-to-body>
+      <div  style="display: flex;justify-content: center;align-items: center; height: 600px" v-loading="imageLoading">
+        <el-image
+          v-if="imageUrl"
+          style="width: 100%; height: auto"
+          :src="imageUrl"
+          :preview-src-list="[imageUrl]"
+        >
+        </el-image>
+        <el-image style="display: flex;justify-content: center;align-items: center; height: 600px" v-else>
+          <div slot="error" class="image-slot">
+            <i class="el-icon-picture-outline" style="color: gray;font-size: 14px">鏈彇鍒板浘鐗�</i>
+          </div>
+        </el-image>
+      </div>
+    </el-dialog>
   </div>
 </template>
 <style scoped>
@@ -474,6 +562,7 @@
 </style>
 <script>
 import {
+  ywConditionList,
   listWorkOrder,
   getWorkOrder,
   delWorkOrder,
@@ -483,8 +572,12 @@
   batchAuditing,
   ywCondition,
   getYwCondition,
+  checkWorkOrder,
+  batchDelWorkOrder,
+  errorTypeAll,
   process
 } from '@/api/platform/work-order'
+import {workList} from "@/api/platform/unit";
 import { addReport } from '@/api/platform/report'
 import WorkOrderAuditing from "@/components/WorkOrder/WorkOrderAuditing";
 
@@ -494,13 +587,22 @@
   components: {WorkOrderAuditing},
   data() {
     return {
+      isConditionList:false,
+      isSelectAll: false, // 鍏ㄩ�夋寜閽�
+      activeIndex: '0',
       drawer: false,
       empty: false,
       openShowCurrent: null,
+      workOrderNumbers: [],  // 鐢ㄤ簬瀛樺偍閫変腑鐨勯」鐩甀D
+      errorTypeList: [],  // 鐢ㄤ簬瀛樺偍閫変腑鐨勯」鐩甀D
+      errorTypeLabelsMap: {}, // 鐢ㄤ簬瀛樺偍 value 鍒� label 鐨勬槧灏�
       ywConditions: [],
+      unitList: [],
+      imageUrl: null,
+      timeRange : null,
       batchAuditingVisible: false,
       batchAuditingWorkOrder: {
-        errorTypes: [],
+        workOrderNumbers: [],
         auditingRemark: '',
         auditingResult: ''
       },
@@ -535,11 +637,14 @@
       },
       // 杩囩▼鍥�
       flowOpen: false,
+      // 宸ュ崟妫�娴嬬粨鏋�
+      checkImageOpen: false,
       flowForm: {},
       certificateList: [],
       pictureList: [],
       // 閬僵灞�
       loading: true,
+      imageLoading: false,
       // 閫変腑鏁扮粍
       ids: [],
       // 闈炲崟涓鐢�
@@ -560,12 +665,16 @@
       daterangeYwHandleTime: [],
       // 鏌ヨ鍙傛暟
       queryParams: {
-        errorTypeList: [],
+        errorType: null,
         pageNum: 1,
         pageSize: 10,
         unitId: null,
         keyword: null,
         status: ''
+      },
+      imageQueryParams:{
+        workOrderNo: null,
+        serialNumber: null
       },
       // 琛ㄥ崟鍙傛暟
       form: {},
@@ -607,7 +716,7 @@
       },
       // 鎵归噺瀹℃牳鏍¢獙
       batchAuditingRules: {
-        errorTypes: [
+        workOrderNumbers: [
           { required: true, message: '璇烽�夋嫨鏁呴殰绫诲瀷', trigger: 'change' }
         ]
       },
@@ -615,13 +724,39 @@
       ywData: {
         content: '',
         fileList: 'process.env.VUE_APP_BASE_API'
-      }
+      },
+
     }
   },
   created() {
+    const today = new Date();
+    const start = today.toISOString().split('T')[0]; // 鑾峰彇鏃ユ湡閮ㄥ垎锛屾牸寮忎负 yyyy-MM-dd
+    const end = start; // 缁撴潫鏃ユ湡涔熸槸褰撳ぉ
+    this.timeRange = [start, end];
+    this.getErrorList()
     this.getList()
   },
   methods: {
+    selectedDistribute(){
+      this.form = {}
+      if (this.workOrderNumbers.length < 1) {
+        this.$message.warning("璇峰厛閫夋嫨瑕佷笅鍙戠殑宸ュ崟")
+        return
+      }
+      this.form.workOrderNumbers = this.workOrderNumbers;
+      this.ywConditionOpen = true
+      this.isConditionList = true
+    },
+
+    //鍏ㄩ�夋寜閽�
+    toggleSelectAll() {
+      this.isSelectAll = !this.isSelectAll;
+      if (this.isSelectAll) {
+        this.workOrderNumbers = this.workOrderList.map(order => order.workOrderNo);
+      } else {
+        this.workOrderNumbers = [];
+      }
+    },
     // 璁$畻姣忎釜鍗$墖搴旇鏄剧ず鐨勯敊璇被鍨嬪垪琛紙鏈�澶�3涓級
     displayedErrors(errorTypeList) {
       return errorTypeList.slice(0, 3);
@@ -649,9 +784,16 @@
       this.ywData.fileList = item.ywProofMaterials
       this.drawer = true
     },
+    changeUnit(unitId, unitName) {
+      this.unitId = unitId;
+      this.queryParams.unitId = unitId;
+      this.unitName = unitName;
+      this.getList()
+    },
     // 鎵归噺瀹℃牳
     batchAuditing(result) {
       this.batchAuditingWorkOrder.auditingResult = result
+      this.batchAuditingWorkOrder.workOrderNumbers = this.workOrderNumbers
       this.$refs['batchAuditingWorkOrder'].validate(valid => {
         if (valid) {
           batchAuditing(this.batchAuditingWorkOrder).then(res => {
@@ -706,6 +848,7 @@
       this.form = {}
       this.ywConditionForm = row
       this.ywConditionOpen = true
+      this.isConditionList = false
       this.form.id = row.id
     },
     // 杩愮淮缁撴灉鎸夐挳
@@ -778,17 +921,27 @@
     submitYwCondition() {
       this.$refs['ywConditionForm'].validate(valid => {
         if (valid) {
-          ywCondition(this.form).then(res => {
-            this.ywConditionOpen = false
-            this.$modal.msgSuccess('鎿嶄綔鎴愬姛')
-            this.getList()
-          })
+          if(this.isConditionList){
+            ywConditionList(this.form).then(res => {
+              this.ywConditionOpen = false
+              this.$modal.msgSuccess('鎿嶄綔鎴愬姛')
+              this.getList()
+            })
+          }else {
+            ywCondition(this.form).then(res => {
+              this.ywConditionOpen = false
+              this.$modal.msgSuccess('鎿嶄綔鎴愬姛')
+              this.getList()
+            })
+          }
+
         }
       })
     },
     cancelYwCondition() {
       this.ywConditionForm = {}
       this.ywConditionOpen = false
+      this.isConditionList = false
     },
     // 鎻愪氦杩愮淮缁撴灉
     submitYwResult() {
@@ -806,31 +959,59 @@
       this.checkResultForm = {}
       this.checkResultOpen = false
     },
+    getErrorList() {
+      errorTypeAll().then(errorRes => {
+        this.errorTypeList = errorRes.data;
+        // 鍦ㄧ粍浠跺垱寤烘椂鏋勫缓鏄犲皠
+        this.errorTypeList.forEach(item => {
+          item.children.forEach(child => {
+            this.errorTypeLabelsMap[child.value] = child.label;
+          })
+        });
+      })
+    },
     /** 鏌ヨ杩愮淮宸ュ崟鍒楄〃 */
     getList() {
       this.empty = false;
       this.loading = true
       this.queryParams.params = {}
-      if (this.queryParams.timeRange && this.queryParams.timeRange.length > 0) {
-        this.queryParams.start = this.queryParams.timeRange[0]
-        this.queryParams.end = this.queryParams.timeRange[1]
+      if (this.timeRange && this.timeRange.length > 0) {
+        this.queryParams.start = this.timeRange[0]
+        this.queryParams.end = this.timeRange[1]
+      }else {
+        this.queryParams.start = null
+        this.queryParams.end = null
       }
-
+      //鍚庣澶嶇敤涓�涓帴鍙�
+      this.queryParams.isNotDistribute = true;
+      if(this.queryParams.errorType){
+        this.queryParams.errorTypeLabel = this.errorTypeLabelsMap[this.queryParams.errorType];
+      }
+      //閲嶇疆鍏ㄩ��
+      this.workOrderNumbers = []
+      this.isSelectAll = false
       listWorkOrder(this.queryParams).then(response => {
-        response.data.forEach(item => {
-          if (item.imgList) {
-            item.imgList = item.imgList.map(img => {
-              return this.$img + img
-            })
+        workList(this.queryParams).then(res => {
+          this.unitList = res.data;
+          response.data.forEach(item => {
+            if (item.imgList) {
+              item.imgList = item.imgList.map(img => {
+                return this.$img + img
+              })
+            }
+          })
+          this.workOrderList = response.data
+          this.total = response.total
+          this.loading = false
+          if (this.total === 0) {
+            this.empty = true
           }
         })
-        this.workOrderList = response.data
-        this.total = response.total
-        this.loading = false
-        if (this.total === 0) {
-          this.empty = true
-        }
       })
+      //   .catch(error => {
+      //   //閬垮厤闃查噸鎻愬崱鍦ㄥ姞杞�
+      //   this.loading = false;
+      // });
     },
     // 鍙栨秷鎸夐挳
     cancel() {
@@ -870,6 +1051,17 @@
       this.ids = selection.map(item => item.id)
       this.single = selection.length !== 1
       this.multiple = !selection.length
+    },
+    // 澶氶�夋閫変腑鏁版嵁
+    toggleSelection(item) {
+      console.log(item.workOrderNo)
+      console.log(this.workOrderNumbers)
+      const index = this.workOrderNumbers.indexOf(item.workOrderNo);
+      if (index > -1) {
+        this.workOrderNumbers.splice(index, 1); // 绉婚櫎閫変腑椤�
+      } else {
+        this.workOrderNumbers.push(item.workOrderNo); // 娣诲姞閫変腑椤�
+      }
     },
     /** 鏂板鎸夐挳鎿嶄綔 */
     handleAdd() {
@@ -924,12 +1116,42 @@
     /** 鍒犻櫎鎸夐挳鎿嶄綔 */
     handleDelete(row) {
       const ids = row.id || this.ids
-      this.$modal.confirm('鏄惁纭鍒犻櫎杩愮淮宸ュ崟缂栧彿涓�"' + ids + '"鐨勬暟鎹」锛�').then(function() {
+      this.$modal.confirm('鏄惁纭鍒犻櫎杩愮淮宸ュ崟缂栧彿涓�"' + ids + '"鐨勫伐鍗曪紵').then(function() {
         return delWorkOrder(ids)
       }).then(() => {
         this.getList()
         this.$modal.msgSuccess('鍒犻櫎鎴愬姛')
       }).catch(() => {
+      })
+    },
+    batchDelete() {
+      this.$modal.confirm('鏄惁纭鍒犻櫎閫変腑鐨勫伐鍗曪紵')
+        .then(() => {
+          return batchDelWorkOrder(this.workOrderNumbers)
+        })
+        .then(() => {
+          this.getList()
+          this.workOrderNumbers = []
+          this.isSelectAll = false
+          this.$modal.msgSuccess('鍒犻櫎鎴愬姛')
+        })
+        .catch(() => {
+         })
+    },
+    /** 妫�娴嬫寜閽搷浣� */
+    handleCheck(row) {
+      this.imageUrl = null
+      this.imageLoading = true
+      this.checkImageOpen = true
+      this.imageQueryParams = {}
+      this.imageQueryParams.workOrderNo= row.workOrderNo
+      this.imageQueryParams.serialNumber= row.serialNumber
+      checkWorkOrder(this.imageQueryParams).then((res) => {
+        this.imageUrl = this.$img + res.data
+        console.log( "鍥剧墖鍦板潃"+this.imageUrl )
+        this.imageLoading = false
+      }).catch(() => {
+        this.imageLoading = false
       })
     },
     /** 瀵煎嚭鎸夐挳鎿嶄綔 */
@@ -938,7 +1160,20 @@
         ...this.queryParams
       }, `work-order_${new Date().getTime()}.xlsx`)
     }
-  }
+  },
+  computed: {
+    totalWorkOrders() {
+      return this.unitList.reduce((total, item) => total + item.workOrderCount, 0);
+    },
+    isItemSelected() {
+      // 鍒涘缓涓�涓璞★紝閿负workOrderNo锛屽�间负鏄惁閫変腑
+      const selected = {};
+      this.workOrderList.forEach(item => {
+        selected[item.workOrderNo] = this.workOrderNumbers.includes(item.workOrderNo);
+      });
+      return selected;
+    }
+  },
 }
 </script>
 
@@ -953,9 +1188,7 @@
   display: flex;
   flex-direction: row;
 }
-.card-left {
-  flex: 2;
-}
+
 .work-order {
   flex: 3;
   padding-right: 10px;
@@ -1001,6 +1234,7 @@
 .my-button {
   margin-left: 0px !important;
   margin-right: 15px;
+  margin-bottom: -10px;
 }
 .my-col {
   margin-bottom: 20px; box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px; position: relative;
@@ -1008,4 +1242,5 @@
 ::v-deep el-step__description.is-finish {
   color: gray;
 }
+
 </style>

--
Gitblit v1.8.0