From 70fa49493702238af286ff99ec28fe32e9767f2e Mon Sep 17 00:00:00 2001
From: fuliqi <fuliqi@qq.com>
Date: 星期三, 13 三月 2024 13:37:46 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 src/views/system/point/index.vue |  142 ++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 115 insertions(+), 27 deletions(-)

diff --git a/src/views/system/point/index.vue b/src/views/system/point/index.vue
index 4d9e163..ad4b242 100644
--- a/src/views/system/point/index.vue
+++ b/src/views/system/point/index.vue
@@ -65,11 +65,19 @@
         <el-button
           type="warning"
           plain
-          icon="el-icon-download"
+          icon="el-icon-top"
           size="mini"
-          @click="handleExport"
-          v-hasPermi="['x:point:export']"
-        >瀵煎嚭</el-button>
+          @click="handleImportPoint"
+        >瀵煎叆鐐逛綅</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          plain
+          icon="el-icon-receiving"
+          size="mini"
+          @click="handleEditBatch"
+        >鎵归噺淇敼</el-button>
       </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
@@ -125,13 +133,30 @@
     />
 
     <!-- 娣诲姞杩愮淮鐐逛綅瀵硅瘽妗� -->
-    <el-dialog :title="title" :visible.sync="open" width="900px" append-to-body>
+    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
       <el-form ref="form" :model="form" :rules="rules" label-width="120px">
         <el-form-item label="鐐逛綅鍚嶇О" prop="pointName">
           <el-input v-model="form.pointName" placeholder="璇疯緭鍏ョ偣浣嶅悕绉�" />
         </el-form-item>
+        <el-form-item label="鐐逛綅鎵�鍦ㄥ湴" prop="region">
+          <el-cascader v-model="form.region" :options="regionList" placeholder="鐐逛綅鎵�鍦ㄥ湴" :props="props" collapse-tags></el-cascader>
+        </el-form-item>
+        <el-form-item label="璁惧绫诲瀷" prop="category">
+          <el-select v-model="form.category"  placeholder="璁惧绫诲瀷">
+            <el-option label="浜鸿劯璇嗗埆" value="2"/>
+            <el-option label="瑙嗛鐩戞帶" value="1"/>
+            <el-option label="杞﹁締鐩戞帶" value="3"/>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="鐩戠閮ㄩ棬" prop="category">
+          <el-select v-model="form.deptName"  placeholder="鐩戠閮ㄩ棬">
+            <el-option label="鐪佸巺" value="鐪佸巺"/>
+            <el-option label="鑷础鑽e幙鍏畨灞�" value="鑷础鑽e幙鍏畨灞�"/>
+            <el-option label="鑷础瀵岄『鍏畨灞�" value="鑷础瀵岄『鍏畨灞�"/>
+          </el-select>
+        </el-form-item>
         <el-form-item label="杩愮淮鍗曚綅" prop="unitId">
-          <el-select :disabled="title === '淇敼杩愮淮鐐逛綅'" v-model="form.unitId"  placeholder="杩愮淮鍗曚綅">
+          <el-select v-model="form.unitId"  placeholder="杩愮淮鍗曚綅">
             <el-option
               v-for="item in unitList"
               :key="item.id"
@@ -142,7 +167,6 @@
         </el-form-item>
         <el-form-item label="鐐逛綅鏃跺尯" prop="timezone">
           <el-date-picker
-            :disabled="title === '淇敼杩愮淮鐐逛綅'"
             @change="dateChange"
             v-model="form.timezone"
             type="daterange"
@@ -154,21 +178,6 @@
           >
           </el-date-picker>
         </el-form-item>
-        <el-form-item>
-          <div style="display: flex;flex-direction: row-reverse">
-            <el-button @click="nextAdd" type="primary" plain>娣诲姞鐐逛綅</el-button>
-          </div>
-        </el-form-item>
-        <el-row style="min-height: 200px;max-height: 400px; overflow-y: auto">
-          <el-col class="col-item" v-for="(point) in tempFormList" :span="8">
-            <div style="margin-right: 5px">
-              <el-cascader v-model="point.region" :options="regionList" placeholder="璇烽�夋嫨鍖哄煙" :show-all-levels="false"></el-cascader>
-            </div>
-            <div v-if="title === '淇敼杩愮淮鐐逛綅'">
-              <el-button @click="removeRegion(point)" type="danger" icon="el-icon-delete" circle></el-button>
-            </div>
-          </el-col>
-        </el-row>
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button type="primary" @click="submitForm">纭� 瀹�</el-button>
@@ -176,11 +185,47 @@
       </div>
     </el-dialog>
 
+    <!-- 鎵归噺淇敼杩愮淮鍗曚綅 -->
+    <el-dialog title="鎵归噺淇敼杩愮淮鍗曚綅" :visible.sync="batchOpen" width="600px" append-to-body>
+      <el-form ref="form" :model="batchEditForm" :rules="batchRules" label-width="120px">
+        <el-form-item label="鐐逛綅閫夋嫨" prop="ids">
+          <el-cascader @change="cos" v-model="batchEditForm.ids" :options="regionList" placeholder="璇烽�夋嫨鍖哄煙" :props="props" collapse-tags></el-cascader>
+        </el-form-item>
+        <el-form-item label="杩愮淮鍗曚綅" prop="unitId">
+          <el-select v-model="batchEditForm.unitId"  placeholder="閫夋嫨杩愮淮鍗曚綅">
+            <el-option
+              v-for="item in unitList"
+              :key="item.id"
+              :label="item.value"
+              :value="item.id">
+            </el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="杩愮淮鏃堕棿娈�" prop="timezone">
+          <el-date-picker
+            @change="dateChange"
+            v-model="batchEditForm.timezone"
+            type="daterange"
+            align="right"
+            unlink-panels
+            range-separator="鑷�"
+            start-placeholder="寮�濮嬫棩鏈�"
+            end-placeholder="缁撴潫鏃ユ湡"
+          >
+          </el-date-picker>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitBatchEdit">纭� 瀹�</el-button>
+        <el-button @click="cancelBatchEdit">鍙� 娑�</el-button>
+      </div>
+    </el-dialog>
+
   </div>
 </template>
 
 <script>
-import { listPoint, getPoint, delPoint, addPoint, addPointBatch, updatePoint } from "@/api/platform/point";
+import { listPoint, getPoint, delPoint, addPoint, batchEdit, updatePoint } from "@/api/platform/point";
 import { unitSelect } from "@/api/platform/unit";
 import { getCascader } from '../../../api/platform/region'
 
@@ -188,6 +233,17 @@
   name: "Point",
   data() {
     return {
+      // 鎵归噺淇敼琛ㄥ崟
+      batchEditForm: {
+        ids: [],
+        unitId: null,
+        timezone: null,
+        startTime: null,
+        endTime: null
+      },
+      // 鎵归噺淇敼寮圭獥
+      batchOpen: false,
+      props: { multiple: true },
       regionList: [],
       // 姝e湪淇敼绗嚑涓�
       editingIndex: null,
@@ -238,12 +294,21 @@
         pointName: [
           { required: true, message: "鐐逛綅鍚嶇О涓嶈兘涓虹┖", trigger: "blur" }
         ],
-        timezone: [
-          { required: true, message: "鐐逛綅鏃跺尯涓嶈兘涓虹┖", trigger: "blur" }
+        region: [
+          { required: true, message: "鐐逛綅鎵�鍦ㄥ湴涓嶈兘涓虹┖", trigger: "change" }
         ],
-        unitId: [
-          { required: true, message: "杩愮淮鍗曚綅涓嶈兘涓虹┖", trigger: "change" }
+        deptName: [
+          { required: true, message: "鐩戠閮ㄩ棬涓嶈兘涓虹┖", trigger: "change" }
         ],
+        category: [
+          { required: true, message: "璁惧绫诲瀷", trigger: "change" }
+        ],
+      },
+      // 鎵归噺琛ㄥ崟鏍¢獙
+      batchRules: {
+        ids: [
+          { required: true, message: "璇烽�夋嫨鐐逛綅", trigger: "change" }
+        ]
       }
     };
   },
@@ -253,6 +318,29 @@
     this.getCascader();
   },
   methods: {
+    // 鐐逛綅瀵煎叆
+    handleImportPoint() {
+
+    },
+    cos(value) {
+      console.log(value)
+    },
+    // 鎻愪氦鎵归噺淇敼
+    submitBatchEdit() {
+      this.batchEditForm.ids = this.batchEditForm.ids.map(array => array[array.length - 1]);
+      if (this.batchEditForm.timezone) {
+        this.batchEditForm.startTime = this.batchEditForm.timezone[0];
+        this.batchEditForm.endTime = this.batchEditForm.timezone[1];
+      }
+    },
+    // 鍙栨秷鎵归噺淇敼
+    cancelBatchEdit() {
+      this.batchOpen = false;
+    },
+    // 鎵归噺淇敼
+    handleEditBatch() {
+      this.batchOpen = true;
+    },
     removeRegion(item) {
       this.tempFormList = this.tempFormList.filter(data => data !== item)
     },

--
Gitblit v1.8.0