From ad973219e4c7d5d49df8b4b82c271aa24ec94236 Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期三, 07 八月 2024 17:00:59 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 src/views/system/point/index.vue |   37 +++++++++++++++++++++++++++++++------
 1 files changed, 31 insertions(+), 6 deletions(-)

diff --git a/src/views/system/point/index.vue b/src/views/system/point/index.vue
index 83c25d0..eb8e231 100644
--- a/src/views/system/point/index.vue
+++ b/src/views/system/point/index.vue
@@ -34,10 +34,17 @@
       </el-col>
       <el-col :span="1.5">
         <el-popover>
+          <p>瀵煎叆鐐逛綅鍙仛鏇存柊鎿嶄綔</p>
           <div class="bottom_">
-            <el-select v-model="importUnitId" size="small" placeholder="杩愮淮鍗曚綅">
+            <el-select @change="getUnitContractTime" v-model="importUnitId" size="small" placeholder="杩愮淮鍗曚綅">
               <el-option v-for="unit in unitList" :key="unit.id" :label="unit.value" :value="unit.id"></el-option>
             </el-select>
+          </div>
+          <div class="bottom_">
+            <el-select @change="showTimeRange" v-model="contractId" size="small" placeholder="杩愮淮鍚堝悓">
+              <el-option v-for="(time, index) in timeList" :key="index" :label="time.name" :value="time.id"></el-option>
+            </el-select>
+            <span style="margin-left: 10px;color: #8a8989" v-show="importUnitId">璇ュ崟浣嶆湁{{timeList.length}}涓悎鍚�</span>
           </div>
           <div class="bottom_">
             <el-date-picker
@@ -70,10 +77,10 @@
           <el-button type="primary" size="mini" plain icon="el-icon-top" slot="reference">瀵煎叆鐐逛綅</el-button>
         </el-popover>
       </el-col>
-      <el-col :span="1.5">
-        <el-button type="danger" plain icon="el-icon-receiving" size="mini" @click="handleEditBatch"
-          v-hasPermi="['point:edit']">鎵归噺淇敼</el-button>
-      </el-col>
+<!--      <el-col :span="1.5">-->
+<!--        <el-button type="danger" plain icon="el-icon-receiving" size="mini" @click="handleEditBatch"-->
+<!--          v-hasPermi="['point:edit']">鎵归噺淇敼</el-button>-->
+<!--      </el-col>-->
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
@@ -198,7 +205,7 @@
 </template>
 
 <script>
-import { listPoint, getPoint, delPoint, addPoint, batchEdit, updatePoint, exportData, importData } from "@/api/platform/point";
+import { listPoint, getPoint, delPoint, addPoint, batchEdit, updatePoint, exportData, importData, timeRange } from "@/api/platform/point";
 import { unitSelect } from "@/api/platform/unit";
 import { getCascader } from '@/api/platform/region'
 import { cascader } from '@/api/system/dept'
@@ -208,12 +215,14 @@
   dicts: ['point_tag'],
   data() {
     return {
+      timeList: [],
       timezone: [],
       ywTimes: [],
       fileList: [],
       importFile: null,
       importUrl: '',
       importUnitId: null,
+      contractId: null,
       download: false,
       upload: false,
       deptOptions: [],
@@ -287,6 +296,22 @@
     this.getDeptCascader();
   },
   methods: {
+    getUnitContractTime(unitId) {
+      this.ywTimes = []
+      this.contractId = null;
+      timeRange(unitId).then(res => {
+        this.timeList = res.data;
+      })
+    },
+    showTimeRange(contractId) {
+      let a = this.timeList.filter(item => item.id === contractId)
+      if (a.length < 1) {
+        this.ywTimes = []
+        return
+      }
+      let target = a[0]
+      this.ywTimes = [target.startTime, target.endTime]
+    },
     beforeUpload(file) {
       this.importFile = file
       this.fileList = [file]

--
Gitblit v1.8.0