test hace 8 meses
padre
commit
170713c61a

+ 256 - 0
build/cool/temp/eps.d.ts

@@ -351,6 +351,140 @@ declare namespace Eps {
 		[key: string]: any;
 	}
 
+	interface AgentEntity {
+		/**
+		 * ID
+		 */
+		id?: number;
+		/**
+		 * 系统用户Id
+		 */
+		userId?: string;
+		/**
+		 * 名称
+		 */
+		name?: string;
+		/**
+		 * 登录账号
+		 */
+		username?: string;
+		/**
+		 * 状态 0-禁用 1-启用
+		 */
+		status?: number;
+		/**
+		 * 备注
+		 */
+		remark?: string;
+		/**
+		 * 创建时间
+		 */
+		createTime?: Date;
+		/**
+		 * 更新时间
+		 */
+		updateTime?: Date;
+		/**
+		 * 任意键值
+		 */
+		[key: string]: any;
+	}
+
+	interface OrderEntity {
+		/**
+		 * ID
+		 */
+		id?: number;
+		/**
+		 * 订单号
+		 */
+		orderNo?: string;
+		/**
+		 * 商户订单号
+		 */
+		outOrderNo?: string;
+		/**
+		 * 交易号
+		 */
+		traceNo?: string;
+		/**
+		 * 支付方式
+		 */
+		payType?: string;
+		/**
+		 * 通道码
+		 */
+		code?: string;
+		/**
+		 * 商户号
+		 */
+		mchId?: string;
+		/**
+		 * 用户ID
+		 */
+		userId?: string;
+		/**
+		 * 用户IP
+		 */
+		userIp?: string;
+		/**
+		 * 金额
+		 */
+		amount?: number;
+		/**
+		 * 货币单位
+		 */
+		currency?: string;
+		/**
+		 * 通道手续费
+		 */
+		channelCharge?: number;
+		/**
+		 * 手续费
+		 */
+		charge?: number;
+		/**
+		 * 付款时间
+		 */
+		date?: Date;
+		/**
+		 * 同步返回地址
+		 */
+		returnUrl?: string;
+		/**
+		 * 通知地址
+		 */
+		notifyUrl?: string;
+		/**
+		 * 订单状态 0-待支付 1 已支付 2 支付失败
+		 */
+		status?: boolean;
+		/**
+		 * 订单状态 0-未通知 1 已通知 2 通知失败
+		 */
+		notifyStatus?: number;
+		/**
+		 * 备注
+		 */
+		remark?: string;
+		/**
+		 * 支付地址
+		 */
+		payUrl?: string;
+		/**
+		 * 创建时间
+		 */
+		createTime?: Date;
+		/**
+		 * 更新时间
+		 */
+		updateTime?: Date;
+		/**
+		 * 任意键值
+		 */
+		[key: string]: any;
+	}
+
 	interface BalanceEntity {
 		/**
 		 * ID
@@ -2224,6 +2358,126 @@ declare namespace Eps {
 		request: Service["request"];
 	}
 
+	interface DjAgent {
+		/**
+		 * 删除
+		 */
+		delete(data?: any): Promise<any>;
+		/**
+		 * 修改
+		 */
+		update(data?: any): Promise<any>;
+		/**
+		 * 单个信息
+		 */
+		info(data?: any): Promise<AgentEntity>;
+		/**
+		 * 分页查询
+		 */
+		page(data?: any): Promise<{
+			pagination: { size: number; page: number; total: number };
+			list: AgentEntity[];
+			[key: string]: any;
+		}>;
+		/**
+		 * 列表查询
+		 */
+		list(data?: any): Promise<AgentEntity[]>;
+		/**
+		 * 新增
+		 */
+		add(data?: any): Promise<any>;
+		/**
+		 * 权限标识
+		 */
+		permission: {
+			delete: string;
+			update: string;
+			info: string;
+			page: string;
+			list: string;
+			add: string;
+		};
+		/**
+		 * 权限状态
+		 */
+		_permission: {
+			delete: boolean;
+			update: boolean;
+			info: boolean;
+			page: boolean;
+			list: boolean;
+			add: boolean;
+		};
+		/**
+		 * 请求
+		 */
+		request: Service["request"];
+	}
+
+	interface DjAgentOrder {
+		/**
+		 * 统计
+		 */
+		summary(data?: any): Promise<any>;
+		/**
+		 * 分页查询
+		 */
+		page(data?: any): Promise<{
+			pagination: { size: number; page: number; total: number };
+			list: OrderEntity[];
+			[key: string]: any;
+		}>;
+		/**
+		 * list
+		 */
+		list(data?: any): Promise<OrderEntity[]>;
+		/**
+		 * info
+		 */
+		info(data?: any): Promise<OrderEntity>;
+		/**
+		 * update
+		 */
+		update(data?: any): Promise<any>;
+		/**
+		 * delete
+		 */
+		delete(data?: any): Promise<any>;
+		/**
+		 * add
+		 */
+		add(data?: any): Promise<any>;
+		/**
+		 * 权限标识
+		 */
+		permission: {
+			summary: string;
+			page: string;
+			list: string;
+			info: string;
+			update: string;
+			delete: string;
+			add: string;
+		};
+		/**
+		 * 权限状态
+		 */
+		_permission: {
+			summary: boolean;
+			page: boolean;
+			list: boolean;
+			info: boolean;
+			update: boolean;
+			delete: boolean;
+			add: boolean;
+		};
+		/**
+		 * 请求
+		 */
+		request: Service["request"];
+	}
+
 	interface DjBalance {
 		/**
 		 * 分页查询
@@ -3692,6 +3946,8 @@ declare namespace Eps {
 		};
 		dict: { info: DictInfo; type: DictType };
 		dj: {
+			agent: DjAgent;
+			agentOrder: DjAgentOrder;
 			balance: DjBalance;
 			bill: DjBill;
 			channel: DjChannel;

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
build/cool/temp/eps.json


+ 149 - 0
src/modules/dj/views/agent.vue

@@ -0,0 +1,149 @@
+<template>
+	<cl-crud ref="Crud">
+		<cl-row>
+			<!-- 刷新按钮 -->
+			<cl-refresh-btn />
+			<!-- 新增按钮 -->
+			<cl-add-btn />
+			<!-- 删除按钮 -->
+			<cl-multi-delete-btn />
+			<cl-flex1 />
+			<!-- 关键字搜索 -->
+			<cl-search-key />
+		</cl-row>
+
+		<cl-row>
+			<!-- 数据表格 -->
+			<cl-table ref="Table" :contextMenu="[]">
+			</cl-table>
+		</cl-row>
+
+		<cl-row>
+			<cl-flex1 />
+			<!-- 分页控件 -->
+			<cl-pagination />
+		</cl-row>
+
+		<!-- 新增、编辑 -->
+		<cl-upsert ref="Upsert"></cl-upsert>
+	</cl-crud>
+</template>
+
+<script lang="ts" name="dj-agent" setup>
+import { useCrud, useTable, useUpsert } from "@cool-vue/crud";
+import { useCool } from "/@/cool";
+
+const { service } = useCool();
+
+// cl-upsert
+const Upsert = useUpsert({
+	items: [
+		{
+			prop: "name",
+			label: "名称",
+			required: true,
+			component: { name: "el-input" },
+		},
+		() => {
+			return {
+				prop: "username",
+				label: "登录账号",
+				required: true,
+				component: { name: "el-input", props: { disabled: Upsert.value?.mode !== "add" } },
+			};
+		},
+		() => {
+			return {
+				prop: "password",
+				label: "登录密码",
+				span: 12,
+				required: Upsert.value?.mode == "add",
+				component: {
+					name: "el-input",
+					props: {
+						type: "password"
+					}
+				},
+				rules: [
+					{
+						min: 6,
+						max: 16,
+						message: "密码长度在 6 到 16 个字符"
+					}
+				]
+			};
+		},
+		{
+			prop: "mchIds",
+			label: "关联商户",
+			value: [],
+			component: {
+				name: "el-select",
+				options: [],
+				props: {
+					multiple: true,
+				}
+			}
+		},
+		{
+			prop: "status",
+			label: "状态",
+			value: 1,
+			component: {
+				name: "el-radio-group",
+				options: [
+					{
+						label: "开启",
+						value: 1
+					},
+					{
+						label: "关闭",
+						value: 0
+					}
+				]
+			},
+		},
+		{
+			prop: "remark",
+			label: "备注",
+			component: { name: "el-input", props: { type: "textarea", rows: 4 } }
+		}
+	],
+	async onOpen(data) {
+		const merchantList = await service.dj.comm.getMerchants();
+		Upsert.value?.setOptions(
+			'mchIds',
+			merchantList.map((item: any) => {
+				return {
+					label: item.name + '(' + item.mchId + ')',
+					value: item.mchId
+				}
+			})
+		);
+	},
+});
+
+// cl-table
+const Table = useTable({
+	columns: [
+		{ type: "selection" },
+		{ prop: "userId", label: "ID" },
+		{ prop: "name", label: "名称" },
+		{ prop: "username", label: "登录账号" },
+		{ prop: "status", label: "状态", component: { name: "cl-switch" } },
+		{ prop: "remark", label: "备注", showOverflowTooltip: true },
+		{ prop: "createTime", label: "创建时间", sortable: "desc", width: 160 },
+		{ type: "op", buttons: ["edit", "delete"] }
+	]
+});
+
+// cl-crud
+const Crud = useCrud(
+	{
+		service: service.dj.agent
+	},
+	(app) => {
+		app.refresh();
+	}
+);
+</script>

+ 242 - 0
src/modules/dj/views/agentOrder.vue

@@ -0,0 +1,242 @@
+<template>
+	<cl-crud ref="Crud" class="orderList">
+		<cl-row>
+			<cl-filter-group :items="items" :data="filterParam" :reset-btn="true" />
+			<cl-export-btn :columns="Table?.columns" />
+		</cl-row>
+
+		<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" class="ml-2" effect="light">成功订单数: {{ summary.num3 }}</el-tag>
+			<el-tag v-if="showSummary" class="ml-2" effect="light">成功率: {{ summary.num4.toFixed(2) }}%</el-tag>
+		</cl-row>
+
+		<cl-row>
+			<!-- 数据表格 -->
+			<cl-table ref="Table" :contextMenu="[]">
+			</cl-table>
+		</cl-row>
+
+		<cl-row>
+			<cl-flex1 />
+			<!-- 分页控件 -->
+			<cl-pagination />
+		</cl-row>
+	</cl-crud>
+</template>
+
+<script lang="ts" name="pay-order" setup>
+import { useCrud, useTable, useUpsert } from "@cool-vue/crud";
+import { ref } from "vue";
+import { useCool } from "/@/cool";
+import dayjs from "dayjs";
+
+const { service } = useCool();
+
+const showSummary = ref(false);
+
+const filterParam = ref({
+	createTime: [
+		dayjs().format("YYYY-MM-DD ") + "00:00:00",
+		dayjs().format("YYYY-MM-DD ") + "23:59:59"
+	]
+});
+
+const summary = ref({
+	num1: 0,
+	num2: 0,
+	num3: 0,
+	num4: 0
+});
+
+const items = ref<ClForm.Item[]>([
+	{
+		label: "订单号",
+		prop: "orderNo",
+		component: {
+			name: "el-input"
+		}
+	},
+	{
+		label: "商户订单号",
+		prop: "outOrderNo",
+		component: {
+			name: "el-input"
+		}
+	},
+	{
+		label: "商户号",
+		prop: "mchId",
+		component: {
+			name: "el-input"
+		},
+	},
+	{
+		label: "支付方式",
+		prop: "payType",
+		component: {
+			name: "el-input"
+		}
+	},
+	{
+		label: "支付状态",
+		prop: "status",
+		component: {
+			name: "el-select",
+			props: {
+				clearable: true
+			},
+			options: [
+				{
+					label: "待支付",
+					value: 0
+				},
+				{
+					label: "支付成功",
+					value: 1
+				},
+				{
+					label: "下单失败",
+					value: 2
+				}
+			]
+		}
+	},
+	{
+		label: "日期范围",
+		prop: "createTime",
+		component: {
+			name: "el-date-picker",
+			props: {
+				style: { width: "360px" },
+				type: "datetimerange",
+				unlinkPanels: true,
+				valueFormat: "YYYY-MM-DD HH:mm:ss",
+				shortcuts: [
+					{
+						text: '今天',
+						value: () => {
+							return [dayjs().startOf('day'), dayjs().endOf('day')]
+						}
+					},
+					{
+						text: '昨天',
+						value: () => {
+							return [dayjs().subtract(1, 'day').startOf('day'), dayjs().subtract(1, 'day').endOf('day')]
+						}
+					},
+					{
+						text: '近三天',
+						value: () => {
+							return [dayjs().subtract(2, 'day').startOf('day'), dayjs().endOf('day')]
+						}
+					},
+					{
+						text: '近七天',
+						value: () => {
+							return [dayjs().subtract(6, 'day').startOf('day'), dayjs().endOf('day')]
+						}
+					},
+					{
+						text: '近一个月',
+						value: () => {
+							return [dayjs().startOf('month'), dayjs().endOf('month')]
+						}
+					},
+				],
+				onChange() { }
+			}
+		}
+	}
+]);
+
+// cl-table
+const Table = useTable({
+	autoHeight: false,
+	columns: [
+		{ type: 'index', label: '#' },
+		{ prop: "orderNo", label: "订单号", showOverflowTooltip: true },
+		{ prop: "outOrderNo", label: "商户订单号", showOverflowTooltip: true },
+		{ prop: "mchId", label: "商户号" },
+		{
+			prop: "amount",
+			label: "金额",
+			formatter(row) {
+				return (+row.amount).toFixed(2);
+			}
+		},
+		{
+			prop: "charge",
+			label: "手续费",
+			formatter(row) {
+				return (+row.charge).toFixed(2);
+			}
+		},
+		{
+			prop: "currency",
+			label: "货币"
+		},
+		{
+			prop: "status",
+			label: "订单状态",
+			dict: [
+				{ label: "待支付", value: 0, color: "#909399" },
+				{ label: "支付成功", value: 1, color: "#67C23A" },
+				{ label: "下单失败", value: 2, color: "#F56C6C" }
+			],
+		},
+		{ prop: "payType", label: "支付方式", showOverflowTooltip: true },
+		{ prop: "createTime", label: "创建时间" },
+	]
+});
+
+// cl-crud
+const Crud = useCrud(
+	{
+		service: service.dj.agentOrder,
+		async onRefresh(params, { next, render }) {
+			const { list, pagination } = await next({
+				order: "createTime",
+				sort: "desc",
+				...params
+			});
+			if (showSummary.value) {
+				const { num1, num2, num3, num4 } = (
+					await service.dj.agentOrder.summary(params)
+				)[0];
+				summary.value.num1 = +num1;
+				summary.value.num2 = +num2;
+				summary.value.num3 = +num3;
+				summary.value.num4 = +num4 > 0 ? (+num3 / +num4) * 100 : 0;
+			}
+			render(list, pagination);
+		}
+	},
+	(app) => {
+		app.refresh(filterParam.value);
+	}
+);
+</script>
+
+<style lang="scss">
+.orderList {
+	.el-descriptions {
+		.el-descriptions__label {
+			width: 120px !important;
+		}
+	}
+}
+
+.desc .el-descriptions__label {
+	min-width: 115px;
+}
+
+.tooltip {
+	max-width: 100px !important;
+	overflow: hidden;
+	text-overflow: ellipsis;
+	white-space: nowrap;
+}
+</style>

Algunos archivos no se mostraron porque demasiados archivos cambiaron en este cambio