From e4413364d240066c3baf6b0f7ac98df55924b052 Mon Sep 17 00:00:00 2001
From: linwenling <3256558519@qq.com>
Date: 星期二, 12 九月 2023 21:25:47 +0800
Subject: [PATCH] 修改旅游——可删除附带当日费用删除
---
ruoyi-ui/src/views/travel/index.vue | 127 ++++++++++++++++++++++++++++--------------
1 files changed, 84 insertions(+), 43 deletions(-)
diff --git a/ruoyi-ui/src/views/travel/index.vue b/ruoyi-ui/src/views/travel/index.vue
index 75d4464..4b51021 100644
--- a/ruoyi-ui/src/views/travel/index.vue
+++ b/ruoyi-ui/src/views/travel/index.vue
@@ -48,7 +48,7 @@
icon="el-icon-delete"
size="mini"
:disabled="multiple"
- @click="handleDelete"
+ @click="handleDelete1"
v-hasPermi="['system:role:remove']"
>鍒犻櫎</el-button>
</el-col>
@@ -112,14 +112,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 +154,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 +242,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 +289,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 +443,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 +477,7 @@
total: 0,
//
travelpriceList: [],
+ target:[],
travelBase:[],
baseData:[],
detailList:[],
@@ -515,6 +527,10 @@
content: undefined,
},
formDat2: {
+ id: undefined,
+ detailList: undefined,
+ },
+ formDat7: {
id: undefined,
detailList: undefined,
},
@@ -739,13 +755,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 +782,7 @@
// 鎵惧埌浜嗙鍚堟潯浠剁殑鏁版嵁
const baseItem = baseData[key];
delete item1.id;
+ delete item1.address;
const mergedItem = { ...baseItem, ...item1 };
this.$set(baseData, key, mergedItem);
@@ -884,33 +895,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);
@@ -966,7 +950,11 @@
this.centerDialogVisible = false;
this.getList();
});
-
+ Object.keys(this.formDat).forEach(key => {
+ this.formDat[key] = '';
+ });
+ this.handleRemove(this.fileList[0]);
+ this.handleRemoveFile(this.fileListOther[0]);
}
});
this.$refs["elForm1"].validate(valid => {
@@ -977,7 +965,11 @@
// 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 +1078,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