|
|
@ -10,24 +10,25 @@ |
|
|
|
<!-- page header --> |
|
|
|
<div class="pageheader"> |
|
|
|
<div class="pageheader-left"> |
|
|
|
<el-checkbox @change="toggleAllSelection">全选</el-checkbox> |
|
|
|
<span class="checked-text">共80条,已选0条</span> |
|
|
|
<GuipButton type="ignore" :btnstyle="btnInfostyleObj">批量删除</GuipButton> |
|
|
|
<el-checkbox @change="toggleAllSelection" :indeterminate="isIndeterminate" v-model="selectAll">全选</el-checkbox> |
|
|
|
<span class="checked-text">共{{ serviceList.length }}条,已选{{ selectedCount }}条</span> |
|
|
|
|
|
|
|
<GuipButton type="ignore" :btnstyle="btnInfostyleObj" @click="handleBatchDelClick">批量删除</GuipButton> |
|
|
|
</div> |
|
|
|
<div class="pageheader-right"> |
|
|
|
<GuipButton type="primary" :btnstyle="btnstyleObj" @click="jumpAdd(1)">添加查重服务</GuipButton> |
|
|
|
<GuipButton type="primary" :btnstyle="btnstyleObj" @click="jumpAdd(2)">添加写作辅助</GuipButton> |
|
|
|
<GuipButton type="primary" :btnstyle="btnstyleObj" @click="jumpAdd(3)">添加AIGC</GuipButton> |
|
|
|
<GuipButton type="primary" :btnstyle="btnstyleObj" @click="jumpAdd(3)">添加写作辅助</GuipButton> |
|
|
|
<GuipButton type="primary" :btnstyle="btnstyleObj" @click="jumpAdd(2)">添加AIGC</GuipButton> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<!-- page content --> |
|
|
|
<el-form> |
|
|
|
<GuipTable :tableData="serviceList" ref="multipleTable" autoColumn="true" :loading="tableLoading"> |
|
|
|
|
|
|
|
<el-table-column label="选择" width="70" header-align="center" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-checkbox @change="toggleSelection(scope.row)"></el-checkbox> |
|
|
|
<GuipTable :tableData="serviceList" ref="multipleTable" autoColumn="true" :loading="tableLoading" |
|
|
|
@selection-change="handleSelectionChange" @select="handleSelect"> |
|
|
|
<el-table-column type="selection" width="100"> |
|
|
|
<template slot="header"> |
|
|
|
<span class="selection-header-text">选择</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
|
|
|
@ -125,16 +126,19 @@ |
|
|
|
|
|
|
|
</GuipTable> |
|
|
|
|
|
|
|
<GuipDialog :dialogVisible="dialogVisible" :title="dialogTitle" :show-close-button="false" |
|
|
|
:show-cancel-button="showCancelButton" @confirm="handleConfirm" @cancel="handleCancel" @close="handleClose" |
|
|
|
@dialogVisibleChange="dialogVisibleChange"> |
|
|
|
<PaymentMethod :paymentList="payList" /> |
|
|
|
<GuipDialog :dialogVisible="dialogVisible" :title="dialogTitle" :show-close-button="false" @confirm="handleConfirm" |
|
|
|
@cancel="handleCancel"> |
|
|
|
<PaymentMethod :paymentList="payList" @confirm="confirmPayment"/> |
|
|
|
</GuipDialog> |
|
|
|
|
|
|
|
<GuipDialog :dialogVisible="dialogDelConfim" title="提示" :show-close-button="false" @confirm="handleDelConfirm" |
|
|
|
@cancel="handleDelCancel"> |
|
|
|
确定要移除服务吗? |
|
|
|
</GuipDialog> |
|
|
|
<GuipDialog :dialogVisible="dialogBatchDelConfim" title="提示" :show-close-button="false" @confirm="handleBatchDelConfirm" |
|
|
|
@cancel="handleBatchDelCancel"> |
|
|
|
确定要移除选中的服务吗? |
|
|
|
</GuipDialog> |
|
|
|
</el-form> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -189,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', |
|
|
@ -219,16 +229,18 @@ export default { |
|
|
|
mounted() { |
|
|
|
this.getSiteServiceList(); |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
selectedCount() { |
|
|
|
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(); |
|
|
|
}, |
|
|
|
toggleSelection(row){ |
|
|
|
console.log(row) |
|
|
|
}, |
|
|
|
// 获取服务列表 |
|
|
|
getSiteServiceList() { |
|
|
|
this.tableLoading = true |
|
|
@ -250,14 +262,87 @@ export default { |
|
|
|
console.error(error, 'error') |
|
|
|
}) |
|
|
|
}, |
|
|
|
onSwitchChange(row){ |
|
|
|
row.is_display = row.is_display == 1 ? 0 : 1 |
|
|
|
handleSelect(selection, row) { |
|
|
|
console.log('操作的行:', row); |
|
|
|
console.log('当前所有选中行:', selection); |
|
|
|
}, |
|
|
|
// 处理选择变化 |
|
|
|
handleSelectionChange(rows) { |
|
|
|
this.selectedRows = rows; |
|
|
|
// 更新全选按钮状态 |
|
|
|
const allSelected = rows.length === this.serviceList.length; |
|
|
|
const noneSelected = rows.length === 0; |
|
|
|
|
|
|
|
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) |
|
|
|
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) { |
|
|
@ -325,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,{ |
|
|
@ -347,6 +441,7 @@ export default { |
|
|
|
popPayMentModal(row){ |
|
|
|
this.dialogVisible = true; |
|
|
|
this.dialogTitle = row.type_desc + '-收款方式' |
|
|
|
this.editRow = row |
|
|
|
this.getPayList(row.type) |
|
|
|
}, |
|
|
|
// 获取支付列表 |
|
|
@ -368,61 +463,76 @@ 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 |
|
|
|
}, |
|
|
|
}, |
|
|
|
} |
|
|
|
</script> |
|
|
|
<style lang="scss" scoped> |
|
|
|
::v-deep .custom-popover { |
|
|
|
position: fixed !important; |
|
|
|
// max-height: 290px; |
|
|
|
// overflow-y: auto; |
|
|
|
margin-top: 0 !important; |
|
|
|
margin-left: 0 !important; |
|
|
|
transform: none !important; |
|
|
|
} |
|
|
|
|
|
|
|
::v-deep .el-table__header-wrapper .el-checkbox { |
|
|
|
display: none; |
|
|
|
} |
|
|
|
|
|
|
|
/* 隐藏表头的复选框 */ |
|
|
|
::v-deep .el-table__header-wrapper .el-checkbox { |
|
|
|
display: none !important; |
|
|
|
} |
|
|
|
|
|
|
|
/* 确保选择文字可见 */ |
|
|
|
::v-deep .selection-header-text { |
|
|
|
display: inline-block; |
|
|
|
margin-left: 8px; |
|
|
|
/* 调整位置 */ |
|
|
|
font-size: 14px; |
|
|
|
color: #606266; |
|
|
|
font-weight: bold; |
|
|
|
} |
|
|
|
|
|
|
|
/* 调整表头单元格的padding */ |
|
|
|
::v-deep .el-table .el-table__header th { |
|
|
|
padding: 8px 0; |
|
|
|
/* 根据需要调整 */ |
|
|
|
} |
|
|
|
.flex-service-title{ |
|
|
|
margin-bottom: 12px; |
|
|
|
} |
|
|
|