From 1eb7c5cb1774ceeba4eed66132444ac6b3c181f9 Mon Sep 17 00:00:00 2001
From: zq <136432190602163.com>
Date: Tue, 1 Jul 2025 17:20:06 +0800
Subject: [PATCH 1/3] =?UTF-8?q?=E8=A1=A8=E6=A0=BC=E5=8B=BE=E9=80=89?=
=?UTF-8?q?=E6=93=8D=E4=BD=9C?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/agent/siteServiceList.vue | 75 ++++++++++++++++++++++++++++++-------
1 file changed, 62 insertions(+), 13 deletions(-)
diff --git a/src/views/agent/siteServiceList.vue b/src/views/agent/siteServiceList.vue
index 487972b..5dc3baf 100644
--- a/src/views/agent/siteServiceList.vue
+++ b/src/views/agent/siteServiceList.vue
@@ -10,9 +10,10 @@
-
@@ -535,7 +535,6 @@
-
跳过
完成
@@ -543,7 +542,6 @@
\ No newline at end of file
diff --git a/src/views/agent/siteServiceList.vue b/src/views/agent/siteServiceList.vue
index 5dc3baf..fa774f3 100644
--- a/src/views/agent/siteServiceList.vue
+++ b/src/views/agent/siteServiceList.vue
@@ -13,12 +13,12 @@
全选
共{{ serviceList.length }}条,已选{{ selectedCount }}条
- 批量删除
+ 批量删除
@@ -27,10 +27,10 @@
-
-
-
-
+
+
+
+
@@ -126,16 +126,19 @@
-
-
+
+
确定要移除服务吗?
+
+ 确定要移除选中的服务吗?
+
@@ -165,9 +168,6 @@ export default {
},
data() {
return {
- selectedRows:[],//表格选中项
- selectAll: false,//是否全选
- isIndeterminate: false,//全选/半选状态
// AUTH
token: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE3NTAwNTM3MjQsIm5iZiI6MTc1MDA1MzcyNCwiZXhwIjoxNzUyNjQ1NzI0LCJ1c2VyIjoic3VidXNlciIsImxvZ2luX3R5cGUiOjAsImFpZCI6IjEifQ.xyIqBLelB-k6jCifgRevBJTyg_Qrm6m1e4OcHhOpepU',
//删除按钮样式
@@ -193,17 +193,23 @@ export default {
serviceList: [],
//支付方式
payList: [],
+
+ selectedRows:[],//表格选中项
+ selectAll: false,//是否全选
+ isIndeterminate: false,//全选/半选状态
+
//编辑图片展示
popoverFlag:false,
//弹框
dialogVisible: false, //是否展示弹框
dialogTitle: "", //弹框标题
- showCancelButton: true, // 控制是否显示取消按钮
- showCloseButton: true, // 控制是否显示关闭按钮
+ editRow:{},
- //二次确认
+ //删除二次确认
dialogDelConfim: false,
delRow:{},
+ dialogBatchDelConfim: false,
+ delRows:[],
// 服务列表url
serviceAddUrl: '/agent/siteServiceAdd',
@@ -225,12 +231,12 @@ export default {
},
computed: {
selectedCount() {
- return this.selectedRows.length;
- },
+ return this.selectedRows.length;
+ },
},
methods: {
- jumpAdd(type){
- this.$router.push(this.serviceAddUrl + '?type=' + type + '&uid=' + this.uid)
+ jumpAdd(prodid){
+ this.$router.push(this.serviceAddUrl + '?uid=' + this.uid + '&prodid=' + prodid)
},
toggleAllSelection() {
this.$refs.multipleTable.$refs.guiptable.toggleAllSelection();
@@ -256,23 +262,9 @@ export default {
console.error(error, 'error')
})
},
- // 批量删除
- bantchDelete(){
- console.log(this.selectedRows,'全部的选中项');
- },
- onSwitchChange(row){
- row.is_display = row.is_display == 1 ? 0 : 1
-
- let obj = {}
- obj.uid = this.uid
- obj.type = row.type
- obj.is_display = row.is_display
- this.saveRequest('/agentnew/ajax_set_service_display_index', obj, row)
- },
handleSelect(selection, row) {
console.log('操作的行:', row);
console.log('当前所有选中行:', selection);
-
},
// 处理选择变化
handleSelectionChange(rows) {
@@ -284,6 +276,74 @@ export default {
this.selectAll = allSelected;
this.isIndeterminate = !noneSelected && !allSelected;
},
+ // 批量删除
+ handleBatchDelClick() {
+ this.dialogBatchDelConfim = true
+ },
+ handleBatchDelCancel(){
+ this.dialogBatchDelConfim = false
+ },
+ handleBatchDelConfirm(){
+ let delTypes = [];
+ this.selectedRows.forEach((row) => {
+ delTypes.push(row.type)
+ });
+
+ const that = this
+ this.dialogBatchDelConfim = false
+ this.$http('POST', '/agentnew/ajax_del_services', {
+ uid: that.uid,
+ types: JSON.stringify(delTypes)
+ },{
+ headers:{
+ 'Auth': this.token
+ }
+ }).then(response => {
+ if(response.status){
+ that.$message.success('删除成功');
+ that.selectedRows = [];
+ that.$nextTick(() => {
+ this.serviceList = this.serviceList.filter(row => !delTypes.includes(row.type));
+ })
+ return true;
+ }
+ that.$message.success(response.info);
+ }).catch(error => {
+ console.error(error, 'error')
+ })
+ },
+ //删除
+ handleDelClick(row, index) {
+ this.dialogDelConfim = true
+ this.delRow.index = index
+ this.delRow.type = row.type
+ },
+ handleDelCancel(){
+ this.dialogDelConfim = false
+ },
+ handleDelConfirm(){
+ const that = this
+ this.dialogDelConfim = false
+ this.$http('POST', '/agentnew/ajax_del_service', {
+ uid: that.uid,
+ type: that.delRow.type
+ },{
+ headers:{
+ 'Auth': this.token
+ }
+ }).then(response => {
+ if(response.status){
+ that.$message.success('删除成功');
+ this.$nextTick(() => {
+ that.serviceList.splice(that.delRow.index, 1);
+ })
+ return true;
+ }
+ that.$message.success(response.info);
+ }).catch(error => {
+ console.error(error, 'error')
+ })
+ },
// 点击价格单元格时触发
handleEditClick(row, index, type) {
// 关闭其他行的弹框
@@ -350,6 +410,15 @@ export default {
obj.sort_num = row.sort_id
this.saveRequest('/agentnew/ajax_set_service_sort', obj, row)
},
+ onSwitchChange(row){
+ row.is_display = row.is_display == "1" ? "0" : "1"
+
+ let obj = {}
+ obj.uid = this.uid
+ obj.type = row.type
+ obj.is_display = row.is_display
+ this.saveRequest('/agentnew/ajax_set_service_display_index', obj, row)
+ },
saveRequest(url, obj, row){
const that = this
this.$http('POST', url, obj,{
@@ -372,6 +441,7 @@ export default {
popPayMentModal(row){
this.dialogVisible = true;
this.dialogTitle = row.type_desc + '-收款方式'
+ this.editRow = row
this.getPayList(row.type)
},
// 获取支付列表
@@ -393,61 +463,52 @@ export default {
console.error(error, 'error')
})
},
+ confirmPayment(payList){
+ this.payList = payList
+ },
// 确认按钮事件
handleConfirm() {
- this.$message.success('点击了确认按钮');
this.dialogVisible = false;
+
+ let obj = {}
+ obj.uid = this.uid
+ obj.type = this.editRow.type
+ obj.info = ""
+
+ let hasClose = false
+ this.payList.forEach((row) => {
+ if(row.status == 1) {
+ let value = row.pay_type
+ if(row.id) value += ',' + row.id
+
+ obj.info = obj.info + ';' + value;
+ }else{
+ hasClose = true
+ }
+ });
+ obj.info = obj.info.substr(1, obj.info.length-1);
+
+ if(hasClose) this.editRow.payment_method_desc = '自定义支付';
+
+ this.saveRequest('/agentnew/ajax_payment_switch', obj, this.editRow)
},
// 取消按钮事件
handleCancel() {
- this.$message.warning('点击了取消按钮');
this.dialogVisible = false;
},
- // 关闭弹框事件
- handleClose() {
- this.$message.info('弹框已关闭');
- this.dialogVisible = false;
- },
- dialogVisibleChange(data) {
- console.log(data, 'data098908090');
- },
-
- //删除
- handleDelClick(row, index) {
- this.dialogDelConfim = true
- this.delRow.index = index
- this.delRow.type = row.type
- },
- handleDelConfirm(){
- const that = this
- that.dialogDelConfim = false
- this.$http('POST', '/agentnew/ajax_del_service', {
- uid: that.uid,
- type: that.delRow.type
- },{
- headers:{
- 'Auth': this.token
- }
- }).then(response => {
- if(response.status){
- that.$message.success('删除成功');
- this.$nextTick(() => {
- that.serviceList.splice(that.delRow.index, 1);
- })
- return true;
- }
- that.$message.success(response.info);
- }).catch(error => {
- console.error(error, 'error')
- })
- },
- handleDelCancel(){
- this.dialogDelConfim = false
- },
},
}