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

---
 src/api/platform/calculate-report.js       |    4 +-
 src/api/platform/work-order.js             |   13 +++++-
 src/views/system/contract/report/index.vue |   19 +++++----
 src/views/system/work-order/index.vue      |   54 ++++++++++++++++++++------
 4 files changed, 64 insertions(+), 26 deletions(-)

diff --git a/src/api/platform/calculate-report.js b/src/api/platform/calculate-report.js
index ad1650f..b3363ea 100644
--- a/src/api/platform/calculate-report.js
+++ b/src/api/platform/calculate-report.js
@@ -18,9 +18,9 @@
 }
 
 // 閫氳繃id鑾峰彇鏍哥畻鎶ュ憡
-export const getCalculateReportById = (contractId,whichYear) => {
+export const getCalculateReportById = (contractId,whichYear,whichMoth) => {
     return axios({
-        url: "/calculate-report/" + contractId+"/"+whichYear,
+        url: "/calculate-report/" + contractId+"/"+whichYear+"/"+whichMoth,
         method: "GET"
     })
 }
diff --git a/src/api/platform/work-order.js b/src/api/platform/work-order.js
index b857855..37f5e9a 100644
--- a/src/api/platform/work-order.js
+++ b/src/api/platform/work-order.js
@@ -97,6 +97,17 @@
   })
 }
 
+export function ywConditionList(data){
+  return request({
+    url: '/work-order/yw-condition-list',
+    method: 'put',
+    data: data
+  })
+}
+
+
+
+
 // 鑾峰彇宸ュ崟杩愮淮鎯呭喌
 export function getYwCondition(data) {
   return request({
@@ -163,6 +174,4 @@
     method: 'get',
   })
 }
-
-
 
diff --git a/src/views/system/contract/report/index.vue b/src/views/system/contract/report/index.vue
index 3f081b4..eea5e8e 100644
--- a/src/views/system/contract/report/index.vue
+++ b/src/views/system/contract/report/index.vue
@@ -25,17 +25,17 @@
       >
       <el-card class="box-card" >
         <div slot="header" class="clearfix">
-          <span>{{ item.unitName +item.whichYear+"骞存牳绠楁姤鍛�" }}</span>
+          <span>{{ item.unitName +item.whichYear+"骞�"+item.whichMonth+"鏈堟牳绠楁姤鍛�" }}</span>
           <el-button style="float: right; padding: 3px 0" type="text" @click="handleDetail(item)">鏍哥畻</el-button>
         </div>
         <div class="text item">鍚堝悓<span class="time">{{ item.contractName }}</span></div>
         <div class="text item">鏈�杩戞墸鍑忛噾棰�<span class="time">{{ item.latestDeductMoney ?  item.latestDeductMoney:0 }}</span></div>
         <div class="text item">绱鎵e噺閲戦<span class="time">{{ item.deductMoney ? item.deductMoney:0}}</span></div>
         <div class="text item">鏈�杩戞牳绠楁湀浠�
-          <span v-if="item.latestMonth" class="time">{{ item.whichYear }}骞磠{ item.latestMonth }}鏈�</span>
+          <span v-if="item.latestMonth" class="time">{{ item.whichYear }}骞磠{ item.latestMonth }}鏈坽{item.latestDay}}鏃�</span>
           <span v-else class="time">鏆傛棤</span>
         </div>
-        <el-button size="small" type="primary" round style="float: right;margin-left: 18px;" @click="handleExport(item.whichYear,null,item.contractId,item.contractName)" v-hasPermi="['system:calculate:report:export']">瀵煎嚭</el-button>
+        <el-button size="small" type="primary" round style="float: right;margin-left: 18px;" @click="handleExport(item.whichYear,item.whichMonth,null,item.contractId,item.contractName)" v-hasPermi="['system:calculate:report:export']">瀵煎嚭</el-button>
         <el-button size="small" round style="float: right;margin-bottom: 18px;" @click="handlePublish(item)"  v-hasPermi="['system:calculate:report:status']">纭鍙戝竷</el-button>
       </el-card>
       </el-col>
@@ -89,7 +89,7 @@
             label="鏍哥畻鏈堜唤"
             width="180">
           <template slot-scope="scope">
-            <span> {{ scope.row.whichYear +'骞�'+ scope.row.whichMonth+ '鏈�'}}</span>
+            <span> {{ scope.row.whichYear +'骞�'+ scope.row.whichMonth+ '鏈�' + scope.row.whichDay+ '鏃�'}}</span>
           </template>
           </el-table-column>
           <el-table-column
@@ -141,7 +141,7 @@
               <el-button
                 size="small"
                 type="text"
-                @click="handleExport(scope.row.whichYear,scope.row.whichMonth,detail.contractId,detail.contractName)"
+                @click="handleExport(scope.row.whichYear,scope.row.whichMonth,scope.row.whichDay,detail.contractId,detail.contractName)"
               >
                 瀵煎嚭
               </el-button>
@@ -287,7 +287,7 @@
       // })
     },
     handleDetail(row) {
-      getCalculateReportById(row.contractId,row.whichYear).then(res => {
+      getCalculateReportById(row.contractId,row.whichYear,row.whichMonth).then(res => {
         this.detail = res.data
         this.detailTitle = row.unitName + '鑰冩牳缁撴灉'
         this.detailOpen = true
@@ -343,10 +343,11 @@
 
     },
     /** 瀵煎嚭鎸夐挳鎿嶄綔 */
-    handleExport(whichYear,whichMonth,contractId,contractName) {
-      const name = contractName+whichYear+'骞�'+(whichMonth==null? '': whichMonth+'鏈�')+'杩愮淮鏍哥畻.xlsx'
+    handleExport(whichYear,whichMonth,whichDay,contractId,contractName) {
+
+      const name = contractName+whichYear+'骞�'+(whichMonth==null? '': whichMonth+'鏈�')+(whichDay==null? '': whichDay+'鏃�')+'杩愮淮鏍哥畻.xlsx'
       this.download('calculate-report/export', {
-        ...{ 'whichYear': whichYear,'whichMonth': whichMonth, 'contractId': contractId},
+        ...{ 'whichYear': whichYear,'whichMonth': whichMonth,'whichDay':whichDay, 'contractId': contractId},
       }, `${name}`)
     },
     /** 鍚堣琛� */
diff --git a/src/views/system/work-order/index.vue b/src/views/system/work-order/index.vue
index c5be7b7..5c3514e 100644
--- a/src/views/system/work-order/index.vue
+++ b/src/views/system/work-order/index.vue
@@ -6,7 +6,7 @@
           <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)">
+          <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>
@@ -99,6 +99,7 @@
           v-hasPermi="['work:order:delete']"
         >鍒犻櫎
         </el-button>
+        <el-button size="mini" plain type="info" @click="selectedDistribute" class="op">鎵归噺涓婃姤</el-button>
       </el-col>
     </el-row>
 
@@ -113,7 +114,7 @@
               <el-row style="display: flex;">
               <el-checkbox  v-if="$store.state.user.roles.includes('admin')"
                             v-model="isItemSelected[item.workOrderNo]"
-                            @change="toggleSelection(item.workOrderNo)"
+                            @change="toggleSelection(item)"
                             style="margin-right: 10px; "></el-checkbox>
                <el-tooltip
                 effect="dark"
@@ -348,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">
@@ -561,6 +562,7 @@
 </style>
 <script>
 import {
+  ywConditionList,
   listWorkOrder,
   getWorkOrder,
   delWorkOrder,
@@ -585,6 +587,7 @@
   components: {WorkOrderAuditing},
   data() {
     return {
+      isConditionList:false,
       isSelectAll: false, // 鍏ㄩ�夋寜閽�
       activeIndex: '0',
       drawer: false,
@@ -721,7 +724,8 @@
       ywData: {
         content: '',
         fileList: 'process.env.VUE_APP_BASE_API'
-      }
+      },
+
     }
   },
   created() {
@@ -733,6 +737,17 @@
     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;
@@ -833,6 +848,7 @@
       this.form = {}
       this.ywConditionForm = row
       this.ywConditionOpen = true
+      this.isConditionList = false
       this.form.id = row.id
     },
     // 杩愮淮缁撴灉鎸夐挳
@@ -905,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() {
@@ -1027,12 +1053,14 @@
       this.multiple = !selection.length
     },
     // 澶氶�夋閫変腑鏁版嵁
-    toggleSelection(workOrderNo) {
-      const index = this.workOrderNumbers.indexOf(workOrderNo);
+    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(workOrderNo); // 娣诲姞閫変腑椤�
+        this.workOrderNumbers.push(item.workOrderNo); // 娣诲姞閫変腑椤�
       }
     },
     /** 鏂板鎸夐挳鎿嶄綔 */

--
Gitblit v1.8.0