|
@@ -7,14 +7,13 @@
|
|
|
|
|
|
<cl-row>
|
|
|
<el-checkbox v-model="showSummary" label="统计数据" size="small" />
|
|
|
- <el-tag v-if="showSummary" class="ml-2" effect="light">代付成功金额: {{ summary.num1 }}</el-tag>
|
|
|
- <el-tag v-if="showSummary" class="ml-2" effect="light">成功订单数: {{ summary.num2 }}</el-tag>
|
|
|
- <el-tag v-if="showSummary && checkPerm(service.dj.withdraw.permission.update)" class="ml-2"
|
|
|
- effect="light">通道手续费: {{ summary.num5.toFixed(2) }}</el-tag>
|
|
|
- <el-tag v-if="showSummary" class="ml-2" effect="light">成功手续费: {{ summary.num3 }}</el-tag>
|
|
|
+ <el-tag v-if="showSummary" class="ml-2" effect="light">成功金额: {{ summary.num1 }}</el-tag>
|
|
|
+ <el-tag v-if="showSummary" class="ml-2" effect="light">成功手续费: {{ summary.num2 }}</el-tag>
|
|
|
+ <el-tag v-if="showSummary" class="ml-2" effect="light">成功订单数: {{ summary.num3 }}</el-tag>
|
|
|
+ <el-tag v-if="showSummary && checkPerm(service.dj.withdraw.permission.mch)" class="ml-2"
|
|
|
+ effect="light">通道手续费: {{ summary.num4.toFixed(2) }}</el-tag>
|
|
|
</cl-row>
|
|
|
|
|
|
-
|
|
|
<cl-row>
|
|
|
<!-- 数据表格 -->
|
|
|
<cl-table ref="Table" :contextMenu="[]">
|
|
@@ -24,7 +23,7 @@
|
|
|
<el-descriptions-item :span="2" label="收款账号">
|
|
|
{{ scope.row.accountNo }}
|
|
|
</el-descriptions-item>
|
|
|
- <el-descriptions-item :span="2" label="收款人姓名">
|
|
|
+ <el-descriptions-item :span="2" label="持卡人姓名">
|
|
|
{{ scope.row.accountName }}
|
|
|
</el-descriptions-item>
|
|
|
<el-descriptions-item :span="2" label="银行名称">
|
|
@@ -67,6 +66,7 @@ import { checkPerm } from "/$/base";
|
|
|
|
|
|
const { service } = useCool();
|
|
|
const showSummary = ref(false);
|
|
|
+
|
|
|
const filterParam = ref({
|
|
|
createTime: [
|
|
|
dayjs().format("YYYY-MM-DD ") + "00:00:00",
|
|
@@ -108,14 +108,16 @@ const items = ref<ClForm.Item[]>([
|
|
|
prop: "mchId",
|
|
|
component: {
|
|
|
name: "el-input"
|
|
|
- }
|
|
|
+ },
|
|
|
+ hidden: !checkPerm(service.dj.withdraw.permission.mch)
|
|
|
},
|
|
|
{
|
|
|
label: "通道编码",
|
|
|
prop: "code",
|
|
|
component: {
|
|
|
name: "el-input"
|
|
|
- }
|
|
|
+ },
|
|
|
+ hidden: !checkPerm(service.dj.withdraw.permission.code)
|
|
|
},
|
|
|
{
|
|
|
label: "状态",
|
|
@@ -193,113 +195,228 @@ const items = ref<ClForm.Item[]>([
|
|
|
}
|
|
|
]);
|
|
|
|
|
|
+function onStatusChange(status: any) {
|
|
|
+ if (+status === 1 || +status === 3) {
|
|
|
+ Upsert.value?.hideItem('traceNo');
|
|
|
+ Upsert.value?.hideItem('code')
|
|
|
+ } else if (status === 2) {
|
|
|
+ Upsert.value?.hideItem('traceNo');
|
|
|
+ Upsert.value?.showItem('code')
|
|
|
+ } else {
|
|
|
+ Upsert.value?.showItem('traceNo')
|
|
|
+ Upsert.value?.showItem('code')
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+let currentStatus = 1;
|
|
|
+
|
|
|
// cl-upsert
|
|
|
const Upsert = useUpsert({
|
|
|
items: [
|
|
|
{
|
|
|
- prop: "mchId",
|
|
|
- label: "商户号",
|
|
|
- required: true,
|
|
|
+ prop: "base",
|
|
|
+ props: {
|
|
|
+ labelWidth: "0px",
|
|
|
+ },
|
|
|
component: {
|
|
|
- name: "el-input",
|
|
|
+ name: "cl-form-card", // 自定义组件包装组件
|
|
|
props: {
|
|
|
- disabled: true
|
|
|
- }
|
|
|
+ label: "基础信息", // 标签名
|
|
|
+ expand: true, // 默认展开
|
|
|
+ isExpand: true, // 是否可以展开、收起
|
|
|
+ },
|
|
|
},
|
|
|
-
|
|
|
+ children: [
|
|
|
+ {
|
|
|
+ prop: "mchId",
|
|
|
+ label: "商户号",
|
|
|
+ required: true,
|
|
|
+ component: {
|
|
|
+ name: "el-input",
|
|
|
+ props: {
|
|
|
+ readonly: true
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "订单号",
|
|
|
+ prop: "orderNo",
|
|
|
+ required: true,
|
|
|
+ component: {
|
|
|
+ name: "el-input",
|
|
|
+ props: {
|
|
|
+ readonly: true
|
|
|
+ }
|
|
|
+ },
|
|
|
+ span: 12
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "商户订单号",
|
|
|
+ prop: "outOrderNo",
|
|
|
+ required: true,
|
|
|
+ component: {
|
|
|
+ name: "el-input",
|
|
|
+ props: {
|
|
|
+ readonly: true
|
|
|
+ }
|
|
|
+ },
|
|
|
+ span: 12
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: "amount",
|
|
|
+ label: "金额",
|
|
|
+ component: {
|
|
|
+ name: "el-input",
|
|
|
+ props: {
|
|
|
+ readonly: true
|
|
|
+ }
|
|
|
+ },
|
|
|
+ required: true,
|
|
|
+ span: 12
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: "currency",
|
|
|
+ label: "货币",
|
|
|
+ component: {
|
|
|
+ name: "el-input",
|
|
|
+ props: {
|
|
|
+ readonly: true
|
|
|
+ }
|
|
|
+ },
|
|
|
+ required: true,
|
|
|
+ span: 12
|
|
|
+ },
|
|
|
+ ]
|
|
|
},
|
|
|
{
|
|
|
- label: "订单号",
|
|
|
- prop: "orderNo",
|
|
|
- required: true,
|
|
|
+ prop: "account",
|
|
|
+ props: {
|
|
|
+ labelWidth: "0px",
|
|
|
+ },
|
|
|
component: {
|
|
|
- name: "el-input",
|
|
|
+ name: "cl-form-card", // 自定义组件包装组件
|
|
|
props: {
|
|
|
- disabled: true
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- prop: "traceNo",
|
|
|
- label: "交易号",
|
|
|
- component: { name: "el-input" },
|
|
|
- required: true
|
|
|
- },
|
|
|
- {
|
|
|
- prop: "code",
|
|
|
- label: "通道码",
|
|
|
- component: { name: "el-input" },
|
|
|
- required: true
|
|
|
- },
|
|
|
- {
|
|
|
- prop: "amount",
|
|
|
- label: "金额",
|
|
|
- hook: { bind: ["number"] },
|
|
|
- component: { name: "el-input-number", props: { min: 0 } },
|
|
|
- required: true
|
|
|
- },
|
|
|
- {
|
|
|
- prop: "accountNo",
|
|
|
- label: "账户",
|
|
|
- required: true,
|
|
|
- component: { name: "el-input" }
|
|
|
- },
|
|
|
- {
|
|
|
- prop: "bankCode",
|
|
|
- label: "银行编码",
|
|
|
- component: { name: "el-input" },
|
|
|
- required: true
|
|
|
- },
|
|
|
- {
|
|
|
- prop: "bankName",
|
|
|
- label: "银行名称",
|
|
|
- required: true,
|
|
|
- component: { name: "el-input" }
|
|
|
- },
|
|
|
- {
|
|
|
- prop: "accountName",
|
|
|
- label: "账户名",
|
|
|
- required: true,
|
|
|
- component: { name: "el-input" }
|
|
|
+ label: "收款信息", // 标签名
|
|
|
+ expand: false, // 默认展开
|
|
|
+ isExpand: true, // 是否可以展开、收起
|
|
|
+ },
|
|
|
+ },
|
|
|
+ children: [
|
|
|
+ {
|
|
|
+ prop: "accountNo",
|
|
|
+ label: "收款账号",
|
|
|
+ required: true,
|
|
|
+ component: { name: "el-input", props: {} },
|
|
|
+ span: 12
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: "accountName",
|
|
|
+ label: "持卡人姓名",
|
|
|
+ required: true,
|
|
|
+ component: { name: "el-input", props: {} },
|
|
|
+ span: 12
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: "bankCode",
|
|
|
+ label: "银行编码",
|
|
|
+ component: { name: "el-input", props: {} },
|
|
|
+ span: 12
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: "bankName",
|
|
|
+ label: "银行名称",
|
|
|
+ component: { name: "el-input", props: {} },
|
|
|
+ span: 12
|
|
|
+ },
|
|
|
+ ]
|
|
|
},
|
|
|
{
|
|
|
- prop: "status",
|
|
|
- label: "订单状态",
|
|
|
+ prop: "states",
|
|
|
+ props: {
|
|
|
+ labelWidth: "0px",
|
|
|
+ },
|
|
|
component: {
|
|
|
- name: "el-select",
|
|
|
+ name: "cl-form-card", // 自定义组件包装组件
|
|
|
props: {
|
|
|
- disabled: true
|
|
|
+ label: "状态流转", // 标签名
|
|
|
+ expand: true, // 默认展开
|
|
|
+ isExpand: false, // 是否可以展开、收起
|
|
|
},
|
|
|
- options: [
|
|
|
- {
|
|
|
- label: "已受理",
|
|
|
- value: 1
|
|
|
- },
|
|
|
- {
|
|
|
- label: "银行处理中",
|
|
|
- value: 2
|
|
|
- },
|
|
|
- {
|
|
|
- label: "代付失败",
|
|
|
- value: 3
|
|
|
+ },
|
|
|
+ children: [
|
|
|
+ {
|
|
|
+ prop: "status",
|
|
|
+ label: "订单状态",
|
|
|
+ component: {
|
|
|
+ name: "el-radio-group",
|
|
|
+ props: {
|
|
|
+ onChange(data) {
|
|
|
+ onStatusChange(data);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ options: [
|
|
|
+ {
|
|
|
+ label: "已受理",
|
|
|
+ value: 1
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "银行处理中",
|
|
|
+ value: 2
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "代付失败",
|
|
|
+ value: 3
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "代付成功",
|
|
|
+ value: 8
|
|
|
+ },
|
|
|
+ ]
|
|
|
},
|
|
|
- {
|
|
|
- label: "代付成功",
|
|
|
- value: 8
|
|
|
+ required: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: "traceNo",
|
|
|
+ label: "交易号",
|
|
|
+ component: { name: "el-input" },
|
|
|
+ required: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: "code",
|
|
|
+ label: "通道码",
|
|
|
+ component: {
|
|
|
+ name: "el-select",
|
|
|
+ options: [],
|
|
|
},
|
|
|
- ]
|
|
|
- },
|
|
|
- required: true
|
|
|
- },
|
|
|
- {
|
|
|
- prop: "remark",
|
|
|
- label: "备注",
|
|
|
- component: {
|
|
|
- name: "el-input",
|
|
|
- props: { type: "textarea", rows: 4 }
|
|
|
- }
|
|
|
+ required: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: "remark",
|
|
|
+ label: "备注",
|
|
|
+ component: {
|
|
|
+ name: "el-input",
|
|
|
+ props: { type: "textarea", rows: 4 }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
}
|
|
|
- ]
|
|
|
+ ],
|
|
|
+ async onOpen() {
|
|
|
+ const withdrawChannels = await service.dj.comm.getWithdrawChannels();
|
|
|
+ Upsert.value?.setOptions(
|
|
|
+ 'code',
|
|
|
+ withdrawChannels.map((item: any) => {
|
|
|
+ return {
|
|
|
+ label: item.code + ' ( ' + item.currency + ' ) ',
|
|
|
+ value: item.code
|
|
|
+ }
|
|
|
+ })
|
|
|
+ );
|
|
|
+ },
|
|
|
+ onOpened(data: any) {
|
|
|
+ Upsert.value?.setForm('status', currentStatus)
|
|
|
+ onStatusChange(currentStatus)
|
|
|
+ }
|
|
|
});
|
|
|
|
|
|
// cl-table
|
|
@@ -313,17 +430,18 @@ const Table = useTable({
|
|
|
prop: "detail"
|
|
|
};
|
|
|
},
|
|
|
- { prop: "orderNo", label: "订单号", showOverflowTooltip: true },
|
|
|
- { prop: "outOrderNo", label: "商户订单号", showOverflowTooltip: true },
|
|
|
- { prop: "traceNo", label: "交易号", showOverflowTooltip: true },
|
|
|
- { prop: "mchId", label: "商户号" },
|
|
|
- { prop: "code", label: "通道码" },
|
|
|
+ { prop: "orderNo", label: "订单号", showOverflowTooltip: true, width: 120 },
|
|
|
+ { prop: "outOrderNo", label: "商户订单号", showOverflowTooltip: true, width: 120 },
|
|
|
+ { prop: "traceNo", label: "交易号", showOverflowTooltip: true, width: 120 },
|
|
|
+ {
|
|
|
+ prop: "mchId", label: "商户号", hidden: !checkPerm(service.dj.withdraw.permission.mch), width: 90
|
|
|
+ },
|
|
|
{
|
|
|
prop: "amount",
|
|
|
label: "金额",
|
|
|
width: 90,
|
|
|
formatter(row) {
|
|
|
- return (+row.amount).toFixed(2) + ' ' + row.currency;
|
|
|
+ return (+row.amount).toFixed(2)
|
|
|
}
|
|
|
},
|
|
|
{
|
|
@@ -331,12 +449,17 @@ const Table = useTable({
|
|
|
label: "手续费",
|
|
|
width: 90,
|
|
|
formatter(row) {
|
|
|
- return (+row.amount).toFixed(2) + ' ' + row.currency;
|
|
|
+ return (+row.charge).toFixed(2)
|
|
|
}
|
|
|
},
|
|
|
+ {
|
|
|
+ prop: "currency",
|
|
|
+ label: "货币"
|
|
|
+ },
|
|
|
{
|
|
|
prop: "status",
|
|
|
label: "状态",
|
|
|
+ width: 110,
|
|
|
dict: [
|
|
|
{ label: "已受理", value: 1, color: "#909399" },
|
|
|
{ label: "银行处理中", value: 2, color: "#909399" },
|
|
@@ -344,25 +467,76 @@ const Table = useTable({
|
|
|
{ label: "代付成功", value: 8, color: "#67C23A" },
|
|
|
]
|
|
|
},
|
|
|
+ {
|
|
|
+ prop: "code", label: "通道编码", hidden: !checkPerm(service.dj.withdraw.permission.code), width: 120
|
|
|
+ },
|
|
|
{ prop: "createTime", label: "创建时间", sortable: "desc", width: 160 },
|
|
|
{
|
|
|
type: "op",
|
|
|
buttons({ scope }) {
|
|
|
const btns = [];
|
|
|
- if (+scope.row.status === 0) {
|
|
|
+ if (checkPerm(service.dj.withdraw.permission.update)) {
|
|
|
+ btns.push({
|
|
|
+ label: "编辑",
|
|
|
+ type: "primary",
|
|
|
+ async onClick({ scope }: any) {
|
|
|
+ currentStatus = scope.row.status;
|
|
|
+ Upsert.value?.edit(scope.row);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ if (+scope.row.status === 1 && checkPerm(service.dj.withdraw.permission.update)) {
|
|
|
+ btns.push({
|
|
|
+ label: "分配通道",
|
|
|
+ type: "warning",
|
|
|
+ async onClick({ scope }: any) {
|
|
|
+ currentStatus = 2;
|
|
|
+ Upsert.value?.edit(scope.row);
|
|
|
+ Upsert.value?.setProps('accountNo', {
|
|
|
+ readonly: true
|
|
|
+ })
|
|
|
+ Upsert.value?.setProps('bankName', {
|
|
|
+ readonly: true
|
|
|
+ })
|
|
|
+ Upsert.value?.setProps('bankCode', {
|
|
|
+ readonly: true
|
|
|
+ })
|
|
|
+ Upsert.value?.setProps('accountName', {
|
|
|
+ readonly: true
|
|
|
+ })
|
|
|
+ Upsert.value?.setProps('status', {
|
|
|
+ disabled: true
|
|
|
+ })
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else if (+scope.row.status === 2 && checkPerm(service.dj.withdraw.permission.query)) {
|
|
|
btns.push({
|
|
|
label: "API查单",
|
|
|
type: "primary",
|
|
|
async onClick({ scope }: any) {
|
|
|
const data = await service.dj.withdraw.query({ id: scope.row.id });
|
|
|
- if (+data.status === 0) {
|
|
|
- ElMessage.info("代付结果未知,接口返回: " + data.message);
|
|
|
- } else if (+data.status === 2) {
|
|
|
+ if (+data.status === 3) {
|
|
|
ElMessage.error("代付失败,失败原因: " + data.message);
|
|
|
Crud.value?.refresh();
|
|
|
- } else {
|
|
|
+ } else if (+data.status === 8) {
|
|
|
ElMessage.success("订单代付成功,已刷新状态!");
|
|
|
Crud.value?.refresh();
|
|
|
+ } else {
|
|
|
+ ElMessage.info("代付结果未知,接口返回: " + data.message);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else if ((+scope.row.status === 8 || +scope.row.status === 3) && checkPerm(service.dj.withdraw.permission.notify)) {
|
|
|
+ btns.push({
|
|
|
+ label: "补发通知",
|
|
|
+ type: "success",
|
|
|
+ async onClick({ scope }: any) {
|
|
|
+ const { status, msg = "" } = await service.dj.withdraw.notify({ id: scope.row.id });
|
|
|
+ if (+status === 1) {
|
|
|
+ ElMessage.success("补发通知成功!");
|
|
|
+ Crud.value?.refresh();
|
|
|
+ } else {
|
|
|
+ ElMessage.error("通知失败,失败原因:" + JSON.stringify(msg));
|
|
|
}
|
|
|
}
|
|
|
});
|
|
@@ -370,16 +544,33 @@ const Table = useTable({
|
|
|
return btns;
|
|
|
}
|
|
|
}
|
|
|
- ]
|
|
|
+ ],
|
|
|
});
|
|
|
|
|
|
// cl-crud
|
|
|
const Crud = useCrud(
|
|
|
{
|
|
|
- service: service.dj.withdraw
|
|
|
+ service: service.dj.withdraw,
|
|
|
+ async onRefresh(params, { next, render }) {
|
|
|
+ const { list, pagination } = await next({
|
|
|
+ order: "createTime",
|
|
|
+ sort: "desc",
|
|
|
+ ...params
|
|
|
+ });
|
|
|
+ if (showSummary.value) {
|
|
|
+ const { num1, num2, num3, num4, num5 } = (
|
|
|
+ await service.dj.withdraw.summary(params)
|
|
|
+ )[0];
|
|
|
+ summary.value.num1 = +num1;
|
|
|
+ summary.value.num2 = +num2;
|
|
|
+ summary.value.num3 = +num3;
|
|
|
+ summary.value.num4 = +num4;
|
|
|
+ }
|
|
|
+ render(list, pagination);
|
|
|
+ }
|
|
|
},
|
|
|
(app) => {
|
|
|
- app.refresh();
|
|
|
+ app.refresh(filterParam.value);
|
|
|
}
|
|
|
);
|
|
|
</script>
|