From 039aa6bf6fb6c43209f4a452a62b17833d36f27e Mon Sep 17 00:00:00 2001
From: linwenling <3256558519@qq.com>
Date: 星期二, 26 九月 2023 17:22:32 +0800
Subject: [PATCH] 修改保洁收纳

---
 ruoyi-ui/src/views/travel/index.vue |  157 +++++++++++++++++++++++++++++++++++-----------------
 1 files changed, 106 insertions(+), 51 deletions(-)

diff --git a/ruoyi-ui/src/views/travel/index.vue b/ruoyi-ui/src/views/travel/index.vue
index 75d4464..c0e5aad 100644
--- a/ruoyi-ui/src/views/travel/index.vue
+++ b/ruoyi-ui/src/views/travel/index.vue
@@ -5,7 +5,10 @@
       <el-form-item label="鏃堕棿" prop="startTime" >
         <el-date-picker
           v-model="dateRange"
-          style="width: 240px;"
+          style="width: 200px;
+                   height: 35px;
+                   border-radius: 16px 16px 16px 16px;
+                   opacity: 0.5;"
           value-format="yyyy-MM-dd HH-MM"
           type="daterange"
           range-separator="-"
@@ -16,9 +19,12 @@
       <el-form-item label="鎬诲ぉ鏁�" prop="usePeople" >
         <el-input
           v-model="queryParams.usePeople"
-          placeholder="璇疯緭鍏ヤ娇鐢ㄤ汉"
+          placeholder="璇疯緭鍏ユ�诲ぉ鏁�"
           clearable
-          style="width: 240px"
+          style="width: 200px;
+                   height: 35px;
+                   border-radius: 16px 16px 16px 16px;
+                   opacity: 0.5;"
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
@@ -48,7 +54,7 @@
           icon="el-icon-delete"
           size="mini"
           :disabled="multiple"
-          @click="handleDelete"
+          @click="handleDelete1"
           v-hasPermi="['system:role:remove']"
         >鍒犻櫎</el-button>
       </el-col>
@@ -112,14 +118,14 @@
                     size="mini"
                     type="text"
                     icon="el-icon-edit"
-                    @click="handleUpdate1(scope.row)"
+                    @click="handleUpdate(scope.row)"
                     v-hasPermi="['familymodel:economy:info']"
                   >淇敼</el-button>
                   <el-button
                     size="mini"
                     type="text"
                     icon="el-icon-delete"
-                    @click="handleDelete(scope.row)"
+                    @click="handleDelete1(scope.row)"
                     v-hasPermi="['system:role:remove']"
                   >鍒犻櫎</el-button>
                   <el-button size="mini" type="text" icon="el-icon-d-arrow-right"  @click="handleCheck1(scope.row)">鏌ョ湅璇︽儏</el-button>
@@ -154,7 +160,7 @@
       <el-table-column label="璐墿" prop="shopping" sortable width="70px" />
 
 
-      <el-table-column fixed label="鎿嶄綔" align="center" sortable width="180" >
+      <el-table-column  label="鎿嶄綔" align="center" sortable width="180" >
         <template slot-scope="scope" v-if="scope.row.roleId !== 1">
           <el-button
             size="mini"
@@ -242,8 +248,8 @@
       style="background: #FEF7FC;"
     />
 
-    <!-- 娣诲姞鎴栦慨鏀硅祫浜т俊鎭厤缃璇濇 -->
 
+<!--     鏂板鏃呮父缁忓巻-->
     <el-dialog :title="title" :visible.sync="dialog1Visible" width="800px" append-to-body>
       <el-form ref="elForm2" :model="formDat4" :rules="rules2" size="medium" label-width="100px">
 
@@ -289,7 +295,7 @@
         <el-button @click="cancelData">鍙� 娑�</el-button>
       </div>
     </el-dialog>
-
+<!--  鏂板姣忔棩琛岀▼鍐呭-->
     <el-dialog title="娣诲姞姣忔棩琛岀▼鍐呭" :visible.sync="centerDialogVisible" width="60%" center append-to-body>
       <el-form ref="elForm" :model="formDat" :rules="rules" size="medium" label-width="100px">
         <h4 class="form-header">琛岀▼鍐呭 </h4>
@@ -443,7 +449,18 @@
 
 
 //鍦╯ystem/note/index.js涓鍏ユ帴鍙e嚱鏁�  --鎺ュソ浜�
-import {listTravelPrice,enload,listTravelBase,delTravelPrice, addTravelPrice, uploadPic,updateTravelPrice,addTravelBase} from "@/api/travel/index";
+import {
+  listTravelPrice,
+  listTravelBase,
+  delTravelBase,
+  delTravelPrice,
+  addTravelPrice,
+  uploadPic,
+  updateTravelPrice,
+  addTravelBase,
+  getTravelBaseInfo, getTravelPriceInfo,
+} from "@/api/travel/index";
+import {getSelfEconomyInfo} from "@/api/selfeconomy";
 
 export default {
   name: "Role",
@@ -466,6 +483,7 @@
       total: 0,
       //
       travelpriceList: [],
+      target:[],
       travelBase:[],
       baseData:[],
       detailList:[],
@@ -515,6 +533,10 @@
         content: undefined,
       },
       formDat2: {
+        id: undefined,
+        detailList: undefined,
+      },
+      formDat7: {
         id: undefined,
         detailList: undefined,
       },
@@ -739,13 +761,7 @@
           //  alert(123)
           //   console.log(response.data)
           this.travelpriceList = response.data.data;
-          // const targetId = row.id
-          //   const detailList = filteredData.detailList;
-          // console.log("detailList" );
-          // console.log(detailList);
-          // resolve(detailList);
-          // console.log(this.detailList)
-          // console.log(this.travelpriceList);
+
           this.total = response.data.total;
 
           for (let item of this.travelpriceList) {
@@ -772,6 +788,7 @@
                   // 鎵惧埌浜嗙鍚堟潯浠剁殑鏁版嵁
                   const baseItem = baseData[key];
                   delete item1.id;
+                  delete item1.address;
                   const mergedItem = { ...baseItem, ...item1 };
 
                   this.$set(baseData, key, mergedItem);
@@ -884,33 +901,6 @@
 
       this.formDat2.detailList = [];
       console.log("璋冭瘯");
-      // console.log(this.formDat2.detailList);
-      // await this.getList().then(detailList => {
-      // this.formDat2.detailList = detailList;
-      // console.log(this.formDat2.detailList);
-      // });
-
-      //   async function getData() {
-
-      //    listTravelPrice(this.queryParams).then(async response => {
-
-      //     this.travelpriceList = response.data.data;
-
-      //     const filteredData = this.travelpriceList.filter(item => item.id === id);
-      //     this.total = response.data.total;
-      //     console.log( filteredData[0].detailList);
-
-
-      //   //  this.formDat2.detailList =filteredData[0].detailList
-      //   this.formDat2.detailList = filteredData[0].detailList;
-      //   // console.log(this.formDat2.detailList );
-      //   //  console.log(this.formDat2.detailList);
-      //    return this.formDat2
-      //   }).catch(error => {
-      //     console.error("璇锋眰閿欒:", error);
-      //   });
-      // }
-
       async function getData() {
         try {
           const response = await listTravelPrice(this.queryParams);
@@ -925,6 +915,7 @@
           console.error("璇锋眰閿欒:", error);
         }
       }
+
       this.formDat2.detailList = await getData();  // 璋冪敤async鍑芥暟鏉ヨ幏鍙栨暟鎹苟璧嬪�肩粰detailList
 
       console.log(" this.formDat2.detailList");
@@ -956,8 +947,8 @@
       this.formDat.totalPrice=totalPrice;
 
       console.log(this.formDat2)
-      console.log(this.formDat);
-
+      console.log("?");
+      debugger
       this.$refs["elForm"].validate(valid => {
         if (valid) {
 
@@ -966,18 +957,33 @@
             this.centerDialogVisible = false;
             this.getList();
           });
-
+          updateTravelPrice(this.formDat2).then(response => {
+            this.$modal.msgSuccess("璐圭敤鏂板鎴愬姛");
+            this.centerDialogVisible = false;
+          });
+          Object.keys(this.formDat2).forEach(key => {
+            this.formDat2[key] = '';
+          });
+          Object.keys(this.formDat).forEach(key => {
+            this.formDat[key] = '';
+          });
+          this.handleRemove(this.fileList[0]);
+          this.handleRemoveFile(this.fileListOther[0]);
         }
       });
       this.$refs["elForm1"].validate(valid => {
+        console.log(valid)
+        debugger
         if (valid) {
-
-
           updateTravelPrice(this.formDat2).then(response => {
-            // this.$modal.msgSuccess("璐圭敤鏂板鎴愬姛");
+            this.$modal.msgSuccess("璐圭敤鏂板鎴愬姛");
             this.centerDialogVisible = false;
           });
-
+          Object.keys(this.formDat2).forEach(key => {
+            this.formDat2[key] = '';
+          });
+          this.handleRemove(this.fileList[0]);
+          this.handleRemoveFile(this.fileListOther[0]);
         }
       });
     },
@@ -1086,6 +1092,55 @@
         this.$modal.msgSuccess("鍒犻櫎鎴愬姛");
       }).catch(() => {});
     },
+    /** 鍒犻櫎鎸夐挳鎿嶄綔 */
+    async handleDelete1(row) {
+      const id = row.id || this.ids;
+      console.log(id)
+      const feeid = row.feeId;
+      console.log(feeid)
+      const targetDay = row.happenTime
+      console.log(targetDay)
+      this.formDat7.detailList=[];
+      async function getFilteredData() {
+        try {
+          const response = await listTravelPrice(this.queryParams);
+          this.travelpriceList = response.data.data;
+
+          const filteredData = this.travelpriceList.filter(item => item.id === feeid);
+          console.log(filteredData[0].detailList);
+          this.change = filteredData[0].detailList.filter(item => item.happenTime !== targetDay);
+          console.log(this.change)
+          this.total = response.data.total;
+
+          // return filteredData[0].detailList;
+          return this.change;
+        } catch (error) {
+          console.error("璇锋眰閿欒:", error);
+        }
+      }
+
+      try {
+        this.formDat7.detailList = await getFilteredData();
+        this.formDat7.id = feeid
+        console.log("鎵撳嵃formDat7")
+        console.log(this.formDat7)
+      } catch (error) {
+        console.error(error);
+      }
+      console.log(this.formDat7)
+
+      this.$modal.confirm('鏄惁纭鍒犻櫎鎵�閫夋暟鎹」锛�').then(function() {
+
+        return delTravelBase(id);
+      }).then(() => {
+        updateTravelPrice(this.formDat7).then(response => {
+          this.$modal.msgSuccess("璐圭敤鍒犻櫎鎴愬姛");
+
+        });
+        this.getList();
+        this.$modal.msgSuccess("鍒犻櫎鎴愬姛");
+      }).catch(() => {});
+    },
     /** 瀵煎嚭鎸夐挳鎿嶄綔 */
     handleExport() {
       const Ids = this.ids;

--
Gitblit v1.9.1