feat():增加支付管理的模块

master
zhang chengzhi 2024-08-09 10:54:31 +08:00
parent d7f249e311
commit 2b1203b2b1
5 changed files with 435 additions and 40 deletions

View File

@ -0,0 +1,71 @@
import request from '@/utils/request'
//查看客户列表
export function selectList(data){
return request({
url:"/pay/customer/list",
method:"post",
data:data
})
}
//未接入的nacos接口
export function customerAll(){
return request({
url: '/pay/customer/all',
method: 'GET'
})
}
//新增客户接口
export function save(data){
return request({
url: '/pay/customer',
method: 'POST',
data:data
})
}
//修改客户接口
export function update(data){
return request({
url: `/pay/customer/${data.id}`,
method: 'PUT',
data:data
})
}
//根据ID获取客户接口信息
export function get(orderCustomerId){
return request({
url:'/pay/customer/'+orderCustomerId,
method: 'GET'
})
}
//根据ID删除客户接口信息
export function delite(orderCustomerId){
return request({
url:`/pay/customer/${orderCustomerId}`,
method: 'DELETE'
})
}
//通过ID禁用客户
export function disable(orderCustomerId){
return request({
url:`/pay/customer/disable/${orderCustomerId}`,
method:'GET'
})
}
//通过ID启用客户
export function enable(orderCustomerId){
return request({
url:`/pay/customer/enable/${orderCustomerId}`,
method:'GET'
})
}

View File

@ -8,7 +8,7 @@
<div class="right-menu">
<template v-if="device!=='mobile'">
<el-button @click="getNoticeList(),drawer = true,this.direction = 'rtl'" style="margin-left: 16px;"
<el-button @click="getNoticeList(),drawer = true,direction = 'rtl'" style="margin-left: 16px;"
icon="el-icon-chat-dot-round" class="right-menu-item">
</el-button>
<search id="header-search" class="right-menu-item"/>
@ -26,14 +26,14 @@
>
<div>
<el-radio-group v-model="notice.noticeType" @change="getNoticeList">
<el-radio-group v-model="noticeResp.noticeType" @change="getNoticeList">
<el-radio-button label="null">全部</el-radio-button>
<el-radio-button label="1">通知</el-radio-button>
<el-radio-button label="2">公告</el-radio-button>
</el-radio-group>
</div>
<div>
<el-radio-group v-model="notice.readStatus" @change="getNoticeList">
<el-radio-group v-model="noticeResp.readStatus" @change="getNoticeList">
<el-radio-button label="null">全部</el-radio-button>
<el-radio-button label="1">已读</el-radio-button>
<el-radio-button label="0">未读</el-radio-button>
@ -96,37 +96,6 @@
</el-descriptions>
</div>
<!-- &lt;!&ndash; 消息对话框 &ndash;&gt;-->
<!-- <el-dialog :title="title" :visible.sync="open" append-to-body width="780px">-->
<!-- <el-form ref="form" :model="form" : label-width="80px">-->
<!-- <el-row>-->
<!-- <el-col :span="12">-->
<!-- <el-form-item label="公告标题" prop="noticeTitle">-->
<!-- <el-input v-model="form.noticeTitle" placeholder="请输入公告标题"/>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- <el-col :span="12">-->
<!-- <el-form-item label="公告类型" prop="noticeType">-->
<!-- <el-form-item label="公告标题" prop="noticeTitle">-->
<!-- <el-input v-model="form.noticeType" placeholder="请输入公告标题"/>-->
<!-- </el-form-item>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- <el-col :span="12">-->
<!-- </el-col>-->
<!-- <el-col :span="24">-->
<!-- <el-form-item label="内容">-->
<!-- <editor v-model="form.noticeContent" :min-height="192"/>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- </el-row>-->
<!-- </el-form>-->
<!-- <div slot="footer" class="dialog-footer">-->
<!-- <el-button type="primary" @click="cancel"> </el-button>-->
<!-- <el-button @click="cancel"> </el-button>-->
<!-- </div>-->
<!-- </el-dialog>-->
</el-drawer>
@ -174,10 +143,12 @@ export default {
open: false,
noticeList: [],
notice: {
noticeResp: {
readStatus: null,
noticeType: null,
},
drawer: false,
direction: 'rtl',
@ -249,7 +220,7 @@ export default {
},
getNoticeList() {
listNoticeByNotice(this.notice).then(res => {
listNoticeByNotice(this.noticeResp).then(res => {
this.noticeList = res.data;
console.log(res);

View File

@ -0,0 +1,356 @@
<template>
<div class="app-container">
<el-form v-show="showSearch" ref="queryForm" :inline="true" :model="queryParams" label-width="68px" size="small">
<el-form-item label="客户名称">
<el-input
v-model="queryParams.appName"
clearable
placeholder="请输入客户名称"
style="width: 240px"
@keyup.enter.native="getList"
/>
</el-form-item>
<el-form-item label="客户编码">
<el-input
v-model="queryParams.appCode"
clearable
placeholder="请输入客户编码"
style="width: 240px"
@keyup.enter.native="getList"
/>
</el-form-item>
<el-form-item label="客户状态" prop="configType">
<el-select v-model="queryParams.status" clearable placeholder="客户状态">
<el-option
v-for="dict in dict.type.sys_yes_no"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button icon="el-icon-search" size="mini" type="primary" @click="getList"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
v-hasPermi="['system:config:add']"
icon="el-icon-plus"
plain
size="mini"
type="primary"
@click="handleAdd"
>新增
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
v-hasPermi="['system:config:export']"
icon="el-icon-download"
plain
size="mini"
type="warning"
@click="handleExport"
>导出
</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-row :gutter="10">
<el-empty description="暂无支付客户" v-if="customerList.length == 0"></el-empty>
<el-col :span="8" v-for="customer in customerList" v-if="customerList.length != 0">
<el-card class="box-card">
<div slot="header" class="clearfix">
<span style="font-size: 18px;font-weight: 900;">{{customer.appName}}</span>
<el-switch
style="float: right;padding: 5px; margin: 4px 5px 0;"
v-model="customer.status"
active-value="Y"
inactive-value="N"
active-color="#13ce66"
inactive-color="#ff4949"
@change="handleStatusChange(customer)"
>
</el-switch>
<!-- <el-popconfirm-->
<!-- confirm-button-text='好的'-->
<!-- cancel-button-text='不用了'-->
<!-- icon="el-icon-info"-->
<!-- icon-color="red"-->
<!-- title="这是一段内容确定删除吗?"-->
<!-- @confirm="handleDelete(customer.id)"-->
<!-- >-->
<!-- <el-button slot="reference">删除</el-button>-->
<!-- </el-popconfirm>-->
<el-button style="float: right;padding: 5px; margin: 0 5px" type="danger" icon="el-icon-delete" circle @click="handleDelete(customer.id)"></el-button>
<el-button style="float: right;padding: 5px; margin: 0 5px" type="primary" icon="el-icon-edit" circle @click="handleUpdate(customer.id)"></el-button>
</div>
<div >
<el-descriptions class="margin-top" :column="1" :size="size" border>
<el-descriptions-item>
<template slot="label">
<i class="el-icon-user"> </i>客户名称</template>
{{customer.appName}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
<i class="el-icon-user"> </i>客户编码</template>
{{customer.appCode}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
<i class="el-icon-user"> </i>创建人</template>
{{customer.createBy}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
<i class="el-icon-user"> </i>创建时间</template>
{{customer.createTime}}
</el-descriptions-item>
</el-descriptions>
<el-divider content-position="center">近五笔交易记录</el-divider>
<el-table
:data="customer.orderPaySimpleRespList"
style="width: 100%">
<el-table-column prop="cusOrderNumber" label="客户单号"/>
<el-table-column prop="price" label="支付金额"/>
<el-table-column prop="channelTypeName" label="渠道商"/>
</el-table>
</div>
</el-card>
</el-col>
</el-row>
<el-dialog
:title="title"
:visible.sync="open"
width="50%">
<el-form ref="form" :model="form" label-width="120px" :rules="rules">
<el-form-item label="客户编码" prop="appCode">
<span v-if="this.form.id !=null" style="font-size: 16px">{{form.appCode}}</span>
<el-select v-if="this.form.id == null" v-model="form.appCode" placeholder="选择未入住的客户" >
<el-option
v-for="item in appCodeList"
:key="item"
:label="item"
:value="item">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="客户名称" prop="appName">
<el-input v-model="form.appName"></el-input>
</el-form-item>
<el-form-item label="激活开通" prop="status">
<el-radio-group v-model="form.status">
<el-radio
v-for="dict in dict.type.sys_yes_no"
:key="dict.value"
:label="dict.value"
>{{ dict.label }}
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="客户备注">
<el-input v-model="form.remark" type="textarea" rows="6"></el-input>
</el-form-item>
<el-form-item label="详细描述">
<editor v-model="form.appDesc" :min-height="192"/>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="open = false"> </el-button>
<el-button type="primary" @click="submitForm()"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
//jsjsjson,
//import from ',
import {addConfig, listConfig, updateConfig} from "@/api/system/config";
import {customerAll, delite, disable, enable, get, save, selectList, update} from "@/api/pay/customer";
import {delUser} from "@/api/system/user";
export default {
name: "Customer",
dicts: ['sys_yes_no'],
data() {
//"
return {
//
size: '',
//
customerList:[],
//
title: "",
//
open: false,
switchValue: true,
//
showSearch: true,
//
queryParams: {
"appName": "",
"appCode": "",
"status": "Y"
},
form: {
"appName": "",
"appCode": "",
"appDesc": "",
"status": "Y",
"remark": ""
},
//
appCodeList: [],
//
rules: {
appCode: [
{required: true, message: "选择客户编码", trigger: "change"},
],
appName: [
{required: true, message: "客户名称不能为空", trigger: "blur"}
],
status: [
{required: true, message: "请选择客户是否开通", trigger: "blur"}
]
},
}
},
//",
methods: {
/**客户状态更改触发 */
handleStatusChange(row){
if (row.status == 'Y'){
enable(row.id).then(response=>{
this.$modal.msgSuccess("启用成功");
this.getList();
})
}else {
disable(row.id).then(response=>{
this.$modal.msgSuccess("禁用成功");
this.getList();
})
}
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加支付单客户信息";
},
/** 修改按钮操作 */
handleUpdate(orderCustomerId) {
this.reset();
//TODO
get(orderCustomerId).then(response=>{
this.form = response.data;
this.open = true;
this.title = "修改支付单客户信息";
})
},
//
reset() {
this.form = {
"appName": "",
"appCode": "",
"appDesc": "",
"status": "Y",
"remark": ""
};
this.resetForm("form");
// this.customerList = [];
customerAll().then(response =>{
this.appCodeList = response.data;
})
},
/** 提交按钮 */
submitForm: function () {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != undefined) {
update(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
save(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(id) {
this.$modal.confirm('是否确认删除用户编号为"' + id + '"的数据项?').then(function () {
return delite(id);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {
});
},
/** 导出按钮操作 */
handleExport() {
this.download('system/config/export', {
...this.queryParams
}, `config_${new Date().getTime()}.xlsx`)
},
/** 重置按钮操作 */
resetQuery() {
this.queryParams = {
"appName": "",
"appCode": "",
"status": "Y"
},
this.resetForm("queryForm");
this.getList();
},
/** 查询参数列表 */
getList() {
selectList(this.queryParams).then(response =>{
this.customerList = response.data;
})
},
},
// - 访this",
created() {
this.getList();
},
};
</script>
<style scoped>
.el-card{
margin: 10px 0;
}
</style>

View File

@ -197,9 +197,6 @@
<span>已读数量:{{form.readCount}}</span>
</div>
<el-col :span="12" v-show="empShow">
<el-input v-model="form.deptIds" />
<el-form-item label="归属部门" >

View File

@ -35,7 +35,7 @@ module.exports = {
proxy: {
// detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: {
target: `http://106.54.199.209`,
target: `http://106.54.199.209/prod-api`,
changeOrigin: true,
pathRewrite: {
['^' + process.env.VUE_APP_BASE_API]: ''