style(api): 统一代码风格并修复语法问题

- 统一import语句的空格格式
- 修复分号缺失问题
- 调整函数参数换行格式以符合规范
- 删除多余空行保持代码整洁
- 修复字符串拼接的换行格式问题
This commit is contained in:
2026-01-21 00:26:14 +08:00
parent 7a37f66081
commit 82ac209505
559 changed files with 40550 additions and 37977 deletions

View File

@@ -27,7 +27,7 @@
style="width: 200px"
:options="options"
@change="handleChange"
></a-select>
/>
</a-form-item>
<a-form-item label="班级" name="name">
<a-input
@@ -68,8 +68,8 @@
import { storeToRefs } from 'pinia';
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
import { FormInstance } from 'ant-design-vue/es/form';
import {BszxGrade} from "@/api/bszx/bszxGrade/model";
import {listBszxGrade} from "@/api/bszx/bszxGrade";
import { BszxGrade } from '@/api/bszx/bszxGrade/model';
import { listBszxGrade } from '@/api/bszx/bszxGrade';
// 是否是修改
const isUpdate = ref(false);
@@ -137,17 +137,17 @@
const handleBranch = () => {
getBszxGradeList();
}
};
const getBszxGradeList = () => {
listBszxGrade({branch: form.branch}).then((list) => {
options.value = list.map(d => {
listBszxGrade({ branch: form.branch }).then((list) => {
options.value = list.map((d) => {
d.value = d.name;
d.label = d.name;
return d;
});
})
}
});
};
const { resetFields } = useForm(form, rules);
/* 保存编辑 */
@@ -182,7 +182,7 @@
() => props.visible,
(visible) => {
if (visible) {
getBszxGradeList()
getBszxGradeList();
images.value = [];
if (props.data) {
assignObject(form, props.data);

View File

@@ -3,7 +3,7 @@
<a-space :size="10" style="flex-wrap: wrap">
<a-button type="primary" class="ele-btn-icon" @click="add">
<template #icon>
<PlusOutlined/>
<PlusOutlined />
</template>
<span>添加</span>
</a-button>
@@ -14,7 +14,7 @@
placeholder="选择年级"
:options="gradeList"
@change="onGrade"
></a-select>
/>
<a-input-search
allow-clear
placeholder="请输入关键词"
@@ -27,72 +27,70 @@
</template>
<script lang="ts" setup>
import {PlusOutlined} from '@ant-design/icons-vue';
import {watch,ref} from 'vue';
import useSearch from "@/utils/use-search";
import {BszxClassParam} from "@/api/bszx/bszxClass/model";
import {listBszxGrade} from "@/api/bszx/bszxGrade";
import { PlusOutlined } from '@ant-design/icons-vue';
import { watch, ref } from 'vue';
import useSearch from '@/utils/use-search';
import { BszxClassParam } from '@/api/bszx/bszxClass/model';
import { listBszxGrade } from '@/api/bszx/bszxGrade';
const props = withDefaults(
defineProps<{
// 选中的角色
selection?: [];
}>(),
{}
);
const props = withDefaults(
defineProps<{
// 选中的角色
selection?: [];
}>(),
{}
);
const gradeList = ref<BszxClassParam[]>([]);
const gradeList = ref<BszxClassParam[]>([]);
const emit = defineEmits<{
(e: 'search', where?: BszxClassParam): void;
(e: 'add'): void;
(e: 'remove'): void;
(e: 'batchMove'): void;
}>();
const emit = defineEmits<{
(e: 'search', where?: BszxClassParam): void;
(e: 'add'): void;
(e: 'remove'): void;
(e: 'batchMove'): void;
}>();
// 表单数据
const { where, resetFields } = useSearch<BszxClassParam>({
gradeId: undefined,
eraId: undefined,
branch: undefined,
keywords: ''
});
// 表单数据
const {where, resetFields} = useSearch<BszxClassParam>({
gradeId: undefined,
eraId: undefined,
branch: undefined,
keywords: ''
});
// 新增
const add = () => {
emit('add');
};
// 新增
const add = () => {
emit('add');
};
const handleSearch = () => {
emit('search', where);
};
const handleSearch = () => {
emit('search', where);
}
/* 重置 */
const reset = () => {
resetFields();
handleSearch();
};
/* 重置 */
const reset = () => {
resetFields();
handleSearch();
};
const onGrade = (gradeId: number) => {
where.gradeId = gradeId;
handleSearch();
};
const onGrade = (gradeId: number) => {
where.gradeId = gradeId;
handleSearch();
}
const reload = () => {
listBszxGrade({}).then(res => {
gradeList.value = res.map(d => {
d.value = Number(d.id);
d.label = d.name;
return d;
const reload = () => {
listBszxGrade({}).then((res) => {
gradeList.value = res.map((d) => {
d.value = Number(d.id);
d.label = d.name;
return d;
});
});
})
}
reload();
watch(
() => props.selection,
() => {
},
{ immediate: true }
);
};
reload();
watch(
() => props.selection,
() => {},
{ immediate: true }
);
</script>

View File

@@ -1,18 +1,8 @@
<template>
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
<template #extra>
<a-button
type="text"
@click="openUrl('/bsyx/grade')"
>年级设置
</a-button
>
<a-button
type="text"
@click="openUrl('/bsyx/class')"
>班级设置
</a-button
>
<a-button type="text" @click="openUrl('/bsyx/grade')">年级设置 </a-button>
<a-button type="text" @click="openUrl('/bsyx/class')">班级设置 </a-button>
</template>
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-pro-table
@@ -35,7 +25,7 @@
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'image'">
<a-image :src="record.image" :width="50"/>
<a-image :src="record.image" :width="50" />
</template>
<template v-if="column.key === 'era'">
<span>{{ record.era }}</span>
@@ -47,7 +37,7 @@
<template v-if="column.key === 'action'">
<a-space>
<a @click="openEdit(record)">修改</a>
<a-divider type="vertical"/>
<a-divider type="vertical" />
<a-popconfirm
title="确定要删除此记录吗?"
@confirm="remove(record)"
@@ -61,177 +51,181 @@
</a-card>
<!-- 编辑弹窗 -->
<BszxClassEdit v-model:visible="showEdit" :data="current" @done="reload"/>
<BszxClassEdit v-model:visible="showEdit" :data="current" @done="reload" />
</a-page-header>
</template>
<script lang="ts" setup>
import {createVNode, ref} from 'vue';
import {message, Modal} from 'ant-design-vue';
import {ExclamationCircleOutlined} from '@ant-design/icons-vue';
import type {EleProTable} from 'ele-admin-pro';
import type {
DatasourceFunction,
ColumnItem
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue';
import BszxClassEdit from './components/bszxClassEdit.vue';
import {pageBszxClass, removeBszxClass, removeBatchBszxClass} from '@/api/bszx/bszxClass';
import type {BszxClass, BszxClassParam} from '@/api/bszx/bszxClass/model';
import {getPageTitle, openUrl} from "@/utils/common";
import { createVNode, ref } from 'vue';
import { message, Modal } from 'ant-design-vue';
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
import type { EleProTable } from 'ele-admin-pro';
import type {
DatasourceFunction,
ColumnItem
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue';
import BszxClassEdit from './components/bszxClassEdit.vue';
import {
pageBszxClass,
removeBszxClass,
removeBatchBszxClass
} from '@/api/bszx/bszxClass';
import type { BszxClass, BszxClassParam } from '@/api/bszx/bszxClass/model';
import { getPageTitle, openUrl } from '@/utils/common';
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
// 表格选中数据
const selection = ref<BszxClass[]>([]);
// 当前编辑数据
const current = ref<BszxClass | null>(null);
// 是否显示编辑弹窗
const showEdit = ref(false);
// 是否显示批量移动弹窗
const showMove = ref(false);
// 加载状态
const loading = ref(true);
// 表格选中数据
const selection = ref<BszxClass[]>([]);
// 当前编辑数据
const current = ref<BszxClass | null>(null);
// 是否显示编辑弹窗
const showEdit = ref(false);
// 是否显示批量移动弹窗
const showMove = ref(false);
// 加载状态
const loading = ref(true);
// 表格数据源
const datasource: DatasourceFunction = ({
page,
limit,
where,
orders,
filters
}) => {
if (filters) {
where.status = filters.status;
}
return pageBszxClass({
...where,
...orders,
// 表格数据源
const datasource: DatasourceFunction = ({
page,
limit
});
};
// 表格列配置
const columns = ref<ColumnItem[]>([
// {
// title: 'ID',
// dataIndex: 'id',
// key: 'id',
// width: 120,
// },
{
title: '年级',
dataIndex: 'gradeName',
key: 'gradeName',
width: 120
},
// {
// title: '年级',
// dataIndex: 'gradeId',
// key: 'gradeId',
// width: 120
// },
{
title: '班级',
dataIndex: 'name',
key: 'name'
},
{
title: '操作',
key: 'action',
width: 180,
fixed: 'right',
align: 'center',
hideInSetting: true
}
]);
/* 搜索 */
const reload = (where?: BszxClassParam) => {
selection.value = [];
tableRef?.value?.reload({where: where});
};
/* 打开编辑弹窗 */
const openEdit = (row?: BszxClass) => {
current.value = row ?? null;
showEdit.value = true;
};
/* 打开批量移动弹窗 */
const openMove = () => {
showMove.value = true;
};
/* 删除单个 */
const remove = (row: BszxClass) => {
const hide = message.loading('请求中..', 0);
removeBszxClass(row.id)
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
limit,
where,
orders,
filters
}) => {
if (filters) {
where.status = filters.status;
}
return pageBszxClass({
...where,
...orders,
page,
limit
});
};
/* 批量删除 */
const removeBatch = () => {
if (!selection.value.length) {
message.error('请至少选择一条数据');
return;
}
Modal.confirm({
title: '提示',
content: '确定要删除选中的记录吗?',
icon: createVNode(ExclamationCircleOutlined),
maskClosable: true,
onOk: () => {
const hide = message.loading('请求中..', 0);
removeBatchBszxClass(selection.value.map((d) => d.id))
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
}
});
};
/* 查询 */
const query = () => {
loading.value = true;
};
/* 自定义行属性 */
const customRow = (record: BszxClass) => {
return {
// 行点击事件
onClick: () => {
// console.log(record);
},
// 行双击事件
onDblclick: () => {
openEdit(record);
}
};
};
query();
// 表格列配置
const columns = ref<ColumnItem[]>([
// {
// title: 'ID',
// dataIndex: 'id',
// key: 'id',
// width: 120,
// },
{
title: '年级',
dataIndex: 'gradeName',
key: 'gradeName',
width: 120
},
// {
// title: '年级',
// dataIndex: 'gradeId',
// key: 'gradeId',
// width: 120
// },
{
title: '班级',
dataIndex: 'name',
key: 'name'
},
{
title: '操作',
key: 'action',
width: 180,
fixed: 'right',
align: 'center',
hideInSetting: true
}
]);
/* 搜索 */
const reload = (where?: BszxClassParam) => {
selection.value = [];
tableRef?.value?.reload({ where: where });
};
/* 打开编辑弹窗 */
const openEdit = (row?: BszxClass) => {
current.value = row ?? null;
showEdit.value = true;
};
/* 打开批量移动弹窗 */
const openMove = () => {
showMove.value = true;
};
/* 删除单个 */
const remove = (row: BszxClass) => {
const hide = message.loading('请求中..', 0);
removeBszxClass(row.id)
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
};
/* 批量删除 */
const removeBatch = () => {
if (!selection.value.length) {
message.error('请至少选择一条数据');
return;
}
Modal.confirm({
title: '提示',
content: '确定要删除选中的记录吗?',
icon: createVNode(ExclamationCircleOutlined),
maskClosable: true,
onOk: () => {
const hide = message.loading('请求中..', 0);
removeBatchBszxClass(selection.value.map((d) => d.id))
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
}
});
};
/* 查询 */
const query = () => {
loading.value = true;
};
/* 自定义行属性 */
const customRow = (record: BszxClass) => {
return {
// 行点击事件
onClick: () => {
// console.log(record);
},
// 行双击事件
onDblclick: () => {
openEdit(record);
}
};
};
query();
</script>
<script lang="ts">
export default {
name: 'BszxClass'
};
export default {
name: 'BszxClass'
};
</script>
<style lang="less" scoped></style>

View File

@@ -12,9 +12,9 @@
<script lang="ts" setup>
import { PlusOutlined } from '@ant-design/icons-vue';
import useSearch from "@/utils/use-search";
import useSearch from '@/utils/use-search';
import { watch } from 'vue';
import {BszxGradeParam} from "@/api/bszx/bszxGrade/model";
import { BszxGradeParam } from '@/api/bszx/bszxGrade/model';
const props = withDefaults(
defineProps<{
@@ -32,7 +32,7 @@
}>();
// 表单数据
const {where} = useSearch<BszxGradeParam>({
const { where } = useSearch<BszxGradeParam>({
branch: undefined,
keywords: ''
});
@@ -44,7 +44,7 @@
const handleSearch = () => {
emit('search', where);
}
};
watch(
() => props.selection,
() => {}

View File

@@ -1,18 +1,8 @@
<template>
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
<template #extra>
<a-button
type="text"
@click="openUrl('/bsyx/grade')"
>年级设置
</a-button
>
<a-button
type="text"
@click="openUrl('/bsyx/class')"
>班级设置
</a-button
>
<a-button type="text" @click="openUrl('/bsyx/grade')">年级设置 </a-button>
<a-button type="text" @click="openUrl('/bsyx/class')">班级设置 </a-button>
</template>
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-pro-table
@@ -73,9 +63,13 @@
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue';
import BszxGradeEdit from './components/bszxGradeEdit.vue';
import { pageBszxGrade, removeBszxGrade, removeBatchBszxGrade } from '@/api/bszx/bszxGrade';
import {
pageBszxGrade,
removeBszxGrade,
removeBatchBszxGrade
} from '@/api/bszx/bszxGrade';
import type { BszxGrade, BszxGradeParam } from '@/api/bszx/bszxGrade/model';
import {getPageTitle, openUrl} from "@/utils/common";
import { getPageTitle, openUrl } from '@/utils/common';
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
@@ -129,7 +123,7 @@
dataIndex: 'sortNumber',
key: 'sortNumber',
align: 'center',
width: 120,
width: 120
},
{
title: '操作',

View File

@@ -28,7 +28,7 @@
:labelStyle="{ width: '90px', color: '#808080' }"
>
<a-space class="flex items-center">
<a-avatar :src="form.avatar" size="small"/>
<a-avatar :src="form.avatar" size="small" />
{{ form.realName }}
</a-space>
</a-descriptions-item>
@@ -49,7 +49,9 @@
<a-tag v-if="form.orderStatus === 4" color="red">退款申请中</a-tag>
<a-tag v-if="form.orderStatus === 5" color="red">退款被拒绝</a-tag>
<a-tag v-if="form.orderStatus === 6" color="orange">退款成功</a-tag>
<a-tag v-if="form.orderStatus === 7" color="pink">客户端申请退款</a-tag>
<a-tag v-if="form.orderStatus === 7" color="pink"
>客户端申请退款</a-tag
>
</a-descriptions-item>
<!-- 第三排-->
<a-descriptions-item
@@ -108,68 +110,68 @@
<template v-if="form.payStatus == 1">
<a-tag v-if="form.payType == 0">余额支付</a-tag>
<a-tag v-if="form.payType == 1">
<WechatOutlined class="tag-icon"/>
<WechatOutlined class="tag-icon" />
微信支付
</a-tag>
<a-tag v-if="form.payType == 2">积分</a-tag>
<a-tag v-if="form.payType == 3">
<AlipayCircleOutlined class="tag-icon"/>
<AlipayCircleOutlined class="tag-icon" />
支付宝
</a-tag>
<a-tag v-if="form.payType == 4">
<IdcardOutlined class="tag-icon"/>
<IdcardOutlined class="tag-icon" />
现金
</a-tag>
<a-tag v-if="form.payType == 5">
<IdcardOutlined class="tag-icon"/>
<IdcardOutlined class="tag-icon" />
POS机
</a-tag>
<a-tag v-if="form.payType == 6">
<IdcardOutlined class="tag-icon"/>
<IdcardOutlined class="tag-icon" />
VIP月卡
</a-tag>
<a-tag v-if="form.payType == 7">
<IdcardOutlined class="tag-icon"/>
<IdcardOutlined class="tag-icon" />
VIP年卡
</a-tag>
<a-tag v-if="form.payType == 8">
<IdcardOutlined class="tag-icon"/>
<IdcardOutlined class="tag-icon" />
VIP次卡
</a-tag>
<a-tag v-if="form.payType == 9">
<IdcardOutlined class="tag-icon"/>
<IdcardOutlined class="tag-icon" />
IC月卡
</a-tag>
<a-tag v-if="form.payType == 10">
<IdcardOutlined class="tag-icon"/>
<IdcardOutlined class="tag-icon" />
IC年卡
</a-tag>
<a-tag v-if="form.payType == 11">
<IdcardOutlined class="tag-icon"/>
<IdcardOutlined class="tag-icon" />
IC次卡
</a-tag>
<a-tag v-if="form.payType == 12">
<IdcardOutlined class="tag-icon"/>
<IdcardOutlined class="tag-icon" />
免费
</a-tag>
<a-tag v-if="form.payType == 13">
<IdcardOutlined class="tag-icon"/>
<IdcardOutlined class="tag-icon" />
VIP充值卡
</a-tag>
<a-tag v-if="form.payType == 14">
<IdcardOutlined class="tag-icon"/>
<IdcardOutlined class="tag-icon" />
IC充值卡
</a-tag>
<a-tag v-if="form.payType == 15">
<IdcardOutlined class="tag-icon"/>
<IdcardOutlined class="tag-icon" />
积分支付
</a-tag>
<a-tag v-if="form.payType == 16">
<IdcardOutlined class="tag-icon"/>
<IdcardOutlined class="tag-icon" />
VIP季卡
</a-tag>
<a-tag v-if="form.payType == 17">
<IdcardOutlined class="tag-icon"/>
<IdcardOutlined class="tag-icon" />
IC季卡
</a-tag>
</template>
@@ -204,10 +206,9 @@
<a-tag v-if="form.isSettled == 1" color="green">已结算</a-tag>
</a-descriptions-item>
<!-- <a-descriptions-item span="3">-->
<!-- <a-divider/>-->
<!-- </a-descriptions-item>-->
<!-- <a-descriptions-item span="3">-->
<!-- <a-divider/>-->
<!-- </a-descriptions-item>-->
</a-descriptions>
</a-card>
<a-card class="order-card" :bordered="false">
@@ -223,344 +224,343 @@
</template>
<script lang="ts" setup>
import {ref, reactive, watch} from 'vue';
import {Form} from 'ant-design-vue';
import {assignObject} from 'ele-admin-pro';
import {ColumnItem} from 'ele-admin-pro/es/ele-pro-table/types';
import {
CheckOutlined,
CloseOutlined,
CoffeeOutlined
} from '@ant-design/icons-vue';
import {ShopOrder} from '@/api/shop/shopOrder/model';
import {BszxPay} from '@/api/bszx/bszxPay/model';
import {pageBszxPay} from '@/api/bszx/bszxPay';
import {toDateString} from 'ele-admin-pro';
import {copyText} from "@/utils/common";
import { ref, reactive, watch } from 'vue';
import { Form } from 'ant-design-vue';
import { assignObject } from 'ele-admin-pro';
import { ColumnItem } from 'ele-admin-pro/es/ele-pro-table/types';
import {
CheckOutlined,
CloseOutlined,
CoffeeOutlined
} from '@ant-design/icons-vue';
import { ShopOrder } from '@/api/shop/shopOrder/model';
import { BszxPay } from '@/api/bszx/bszxPay/model';
import { pageBszxPay } from '@/api/bszx/bszxPay';
import { toDateString } from 'ele-admin-pro';
import { copyText } from '@/utils/common';
const useForm = Form.useForm;
const useForm = Form.useForm;
const props = defineProps<{
// 弹窗是否打开
visible: boolean;
// 修改回显的数据
data?: ShopOrder | null;
}>();
const props = defineProps<{
// 弹窗是否打开
visible: boolean;
// 修改回显的数据
data?: ShopOrder | null;
}>();
export interface step {
title?: String | undefined;
subTitle?: String | undefined;
description?: String | undefined;
}
// 是否是修改
const isUpdate = ref(false);
// 是否显示最大化切换按钮
const maxAble = ref(true);
// 订单信息
const orderInfo = ref<BszxPay[]>([]);
// 步骤条
const steps = ref<step[]>([
{
title: '报餐',
description: undefined
},
{
title: '付款',
description: undefined
},
{
title: '发餐',
description: undefined
},
{
title: '取餐',
description: undefined
},
{
title: '完成',
description: undefined
export interface step {
title?: String | undefined;
subTitle?: String | undefined;
description?: String | undefined;
}
]);
const active = ref(2);
const emit = defineEmits<{
(e: 'done'): void;
(e: 'update:visible', visible: boolean): void;
}>();
// 是否是修改
const isUpdate = ref(false);
// 是否显示最大化切换按钮
const maxAble = ref(true);
// 订单信息
const orderInfo = ref<BszxPay[]>([]);
// 订单信息
const form = reactive<ShopOrder>({
// 订单号
orderId: undefined,
// 订单编号
orderNo: undefined,
// 订单类型0商城订单 1预定订单/外卖 2会员卡
type: undefined,
// 快递/自提
deliveryType: undefined,
// 下单渠道0小程序预定 1俱乐部训练场 3活动订场
channel: undefined,
// 微信支付订单号
transactionId: undefined,
// 微信退款订单号
refundOrder: undefined,
// 商户ID
merchantId: undefined,
// 商户名称
merchantName: undefined,
// 商户编号
merchantCode: undefined,
// 使用的优惠券id
couponId: undefined,
// 使用的会员卡id
cardId: undefined,
// 关联管理员id
adminId: undefined,
// 核销管理员id
confirmId: undefined,
// IC卡号
icCard: undefined,
// 头像
avatar: undefined,
// 真实姓名
realName: undefined,
// 手机号码
phone: undefined,
// 收货地址
address: undefined,
//
addressLat: undefined,
//
addressLng: undefined,
// 自提店铺id
selfTakeMerchantId: undefined,
// 自提店铺
selfTakeMerchantName: undefined,
// 配送开始时间
sendStartTime: undefined,
// 配送结束时间
sendEndTime: undefined,
// 发货店铺id
expressMerchantId: undefined,
// 发货店铺
expressMerchantName: undefined,
// 订单总额
totalPrice: undefined,
// 减少的金额使用VIP会员折扣、优惠券抵扣、优惠券折扣后减去的价格
reducePrice: undefined,
// 实际付款
payPrice: undefined,
// 用于统计
price: undefined,
// 价钱,用于积分赠送
money: undefined,
// 退款金额
refundMoney: undefined,
// 教练价格
coachPrice: undefined,
// 购买数量
totalNum: undefined,
// 教练id
coachId: undefined,
// 支付的用户id
payUserId: undefined,
// 0余额支付, 1微信支付102微信Native2会员卡支付3支付宝4现金5POS机6VIP月卡7VIP年卡8VIP次卡9IC月卡10IC年卡11IC次卡12免费13VIP充值卡14IC充值卡15积分支付16VIP季卡17IC季卡18代付
payType: undefined,
// 代付支付方式,0余额支付, 1微信支付102微信Native2会员卡支付3支付宝4现金5POS机6VIP月卡7VIP年卡8VIP次卡9IC月卡10IC年卡11IC次卡12免费13VIP充值卡14IC充值卡15积分支付16VIP季卡17IC季卡18代付
friendPayType: undefined,
// 0未付款1已付款
payStatus: undefined,
// 0未使用1已完成2已取消3取消中4退款申请中5退款被拒绝6退款成功7客户端申请退款
orderStatus: undefined,
// 发货状态(10未发货 20已发货 30部分发货)
deliveryStatus: undefined,
// 发货时间
deliveryTime: undefined,
// 优惠类型0无、1抵扣优惠券、2折扣优惠券、3、VIP月卡、4VIP年卡5VIP次卡、6VIP会员卡、7IC月卡、8IC年卡、9IC次卡、10IC会员卡、11免费订单、12VIP充值卡、13IC充值卡、14VIP季卡、15IC季卡
couponType: undefined,
// 优惠说明
couponDesc: undefined,
// 二维码地址,保存订单号,支付成功后才生成
qrcode: undefined,
// vip月卡年卡、ic月卡年卡回退次数
returnNum: undefined,
// vip充值回退金额
returnMoney: undefined,
// 预约详情开始时间数组
startTime: undefined,
// 是否已开具发票0未开发票1已开发票2不能开具发票
isInvoice: undefined,
// 发票流水号
invoiceNo: undefined,
// 支付时间
payTime: undefined,
// 退款时间
refundTime: undefined,
// 申请退款时间
refundApplyTime: undefined,
// 过期时间
expirationTime: undefined,
// 对账情况0=未对账1=已对账3=已对账金额对不上4=未查询到该订单
checkBill: undefined,
// 订单是否已结算(0未结算 1已结算)
isSettled: undefined,
// 系统版本号 0当前版本 value=其他版本
version: undefined,
// 用户id
userId: undefined,
// 备注
comments: undefined,
// 排序号
sortNumber: undefined,
// 是否删除, 0否, 1是
deleted: undefined,
// 租户id
tenantId: undefined,
// 修改时间
updateTime: undefined,
// 创建时间
createTime: undefined,
// 自提码
selfTakeCode: undefined,
// 是否已收到赠品
hasTakeGift: undefined,
});
// 请求状态
const loading = ref(true);
const {resetFields} = useForm(form);
/* 更新visible */
const updateVisible = (value: boolean) => {
emit('update:visible', value);
};
const columns = ref<ColumnItem[]>([
{
title: '商品名称',
dataIndex: 'formName',
key: 'formName',
align: 'center',
width: 280
},
{
title: '金额',
dataIndex: 'price',
align: 'center'
},
{
title: '备注',
dataIndex: 'comments',
key: 'comments',
align: 'center'
},
{
title: '操作',
dataIndex: 'isFree',
align: 'center'
}
]);
/* 制作步骤条 */
const loadSteps = (order) => {
steps.value = [];
steps.value.push({
title: '下单'
});
steps.value.push({
title: '付款'
});
steps.value.push({
title: '发货'
});
steps.value.push({
title: '收货'
});
steps.value.push({
title: '完成'
});
// 下单
if (order.payStatus == 10) {
active.value = 0;
steps.value[0].description = order.createTime;
}
// 付款
if (order.payStatus == 20) {
active.value = 1;
steps.value[0].description = order.createTime;
steps.value[1].description = order.payTime;
}
// 发货
if (order.payStatus == 20 && order.deliveryStatus == 20) {
active.value = 2;
steps.value[0].description = order.createTime;
steps.value[1].description = order.payTime;
steps.value[2].description = order.deliveryTime;
}
// 收货
if (order.payStatus == 20 && order.receiptStatus == 20) {
active.value = 3;
steps.value[0].description = order.createTime;
steps.value[1].description = order.payTime;
steps.value[2].description = order.deliveryTime;
steps.value[3].description = order.receiptTime;
}
// 完成
if (order.payStatus == 20 && order.orderStatus == 30) {
active.value = 4;
steps.value[0].description = order.createTime;
steps.value[1].description = order.payTime;
steps.value[2].description = order.deliveryTime;
steps.value[3].description = order.receiptTime;
}
// 已取消
if (order.orderStatus == 20) {
active.value = 4;
}
};
// const getOrderInfo = () => {
// const orderId = props.data?.orderId;
// listOrderInfo({ orderId }).then((data) => {
// orderInfo.value = data.filter((d) => d.totalNum > 0);
// });
// };
/* 保存编辑 */
const save = () => {
};
watch(
() => props.visible,
(visible) => {
if (visible) {
if (props.data) {
loading.value = true;
assignObject(form, props.data);
pageBszxPay({orderNo: form.orderNo}).then((res) => {
if (res?.list) {
orderInfo.value = res?.list;
}
loading.value = false;
});
loadSteps(props.data);
}
} else {
resetFields();
// 步骤条
const steps = ref<step[]>([
{
title: '报餐',
description: undefined
},
{
title: '付款',
description: undefined
},
{
title: '发餐',
description: undefined
},
{
title: '取餐',
description: undefined
},
{
title: '完成',
description: undefined
}
}
);
]);
const active = ref(2);
const emit = defineEmits<{
(e: 'done'): void;
(e: 'update:visible', visible: boolean): void;
}>();
// 订单信息
const form = reactive<ShopOrder>({
// 订单号
orderId: undefined,
// 订单编号
orderNo: undefined,
// 订单类型0商城订单 1预定订单/外卖 2会员卡
type: undefined,
// 快递/自提
deliveryType: undefined,
// 下单渠道0小程序预定 1俱乐部训练场 3活动订场
channel: undefined,
// 微信支付订单号
transactionId: undefined,
// 微信退款订单号
refundOrder: undefined,
// 商户ID
merchantId: undefined,
// 商户名称
merchantName: undefined,
// 商户编号
merchantCode: undefined,
// 使用的优惠券id
couponId: undefined,
// 使用的会员卡id
cardId: undefined,
// 关联管理员id
adminId: undefined,
// 核销管理员id
confirmId: undefined,
// IC卡号
icCard: undefined,
// 头像
avatar: undefined,
// 真实姓名
realName: undefined,
// 手机号码
phone: undefined,
// 收货地址
address: undefined,
//
addressLat: undefined,
//
addressLng: undefined,
// 自提店铺id
selfTakeMerchantId: undefined,
// 自提店铺
selfTakeMerchantName: undefined,
// 配送开始时间
sendStartTime: undefined,
// 配送结束时间
sendEndTime: undefined,
// 发货店铺id
expressMerchantId: undefined,
// 发货店铺
expressMerchantName: undefined,
// 订单总额
totalPrice: undefined,
// 减少的金额使用VIP会员折扣、优惠券抵扣、优惠券折扣后减去的价格
reducePrice: undefined,
// 实际付款
payPrice: undefined,
// 用于统计
price: undefined,
// 价钱,用于积分赠送
money: undefined,
// 退款金额
refundMoney: undefined,
// 教练价格
coachPrice: undefined,
// 购买数量
totalNum: undefined,
// 教练id
coachId: undefined,
// 支付的用户id
payUserId: undefined,
// 0余额支付, 1微信支付102微信Native2会员卡支付3支付宝4现金5POS机6VIP月卡7VIP年卡8VIP次卡9IC月卡10IC年卡11IC次卡12免费13VIP充值卡14IC充值卡15积分支付16VIP季卡17IC季卡18代付
payType: undefined,
// 代付支付方式,0余额支付, 1微信支付102微信Native2会员卡支付3支付宝4现金5POS机6VIP月卡7VIP年卡8VIP次卡9IC月卡10IC年卡11IC次卡12免费13VIP充值卡14IC充值卡15积分支付16VIP季卡17IC季卡18代付
friendPayType: undefined,
// 0未付款1已付款
payStatus: undefined,
// 0未使用1已完成2已取消3取消中4退款申请中5退款被拒绝6退款成功7客户端申请退款
orderStatus: undefined,
// 发货状态(10未发货 20已发货 30部分发货)
deliveryStatus: undefined,
// 发货时间
deliveryTime: undefined,
// 优惠类型0无、1抵扣优惠券、2折扣优惠券、3、VIP月卡、4VIP年卡5VIP次卡、6VIP会员卡、7IC月卡、8IC年卡、9IC次卡、10IC会员卡、11免费订单、12VIP充值卡、13IC充值卡、14VIP季卡、15IC季卡
couponType: undefined,
// 优惠说明
couponDesc: undefined,
// 二维码地址,保存订单号,支付成功后才生成
qrcode: undefined,
// vip月卡年卡、ic月卡年卡回退次数
returnNum: undefined,
// vip充值回退金额
returnMoney: undefined,
// 预约详情开始时间数组
startTime: undefined,
// 是否已开具发票0未开发票1已开发票2不能开具发票
isInvoice: undefined,
// 发票流水号
invoiceNo: undefined,
// 支付时间
payTime: undefined,
// 退款时间
refundTime: undefined,
// 申请退款时间
refundApplyTime: undefined,
// 过期时间
expirationTime: undefined,
// 对账情况0=未对账1=已对账3=已对账金额对不上4=未查询到该订单
checkBill: undefined,
// 订单是否已结算(0未结算 1已结算)
isSettled: undefined,
// 系统版本号 0当前版本 value=其他版本
version: undefined,
// 用户id
userId: undefined,
// 备注
comments: undefined,
// 排序号
sortNumber: undefined,
// 是否删除, 0否, 1是
deleted: undefined,
// 租户id
tenantId: undefined,
// 修改时间
updateTime: undefined,
// 创建时间
createTime: undefined,
// 自提码
selfTakeCode: undefined,
// 是否已收到赠品
hasTakeGift: undefined
});
// 请求状态
const loading = ref(true);
const { resetFields } = useForm(form);
/* 更新visible */
const updateVisible = (value: boolean) => {
emit('update:visible', value);
};
const columns = ref<ColumnItem[]>([
{
title: '商品名称',
dataIndex: 'formName',
key: 'formName',
align: 'center',
width: 280
},
{
title: '金额',
dataIndex: 'price',
align: 'center'
},
{
title: '备注',
dataIndex: 'comments',
key: 'comments',
align: 'center'
},
{
title: '操作',
dataIndex: 'isFree',
align: 'center'
}
]);
/* 制作步骤条 */
const loadSteps = (order) => {
steps.value = [];
steps.value.push({
title: '下单'
});
steps.value.push({
title: '付款'
});
steps.value.push({
title: '发货'
});
steps.value.push({
title: '收货'
});
steps.value.push({
title: '完成'
});
// 下单
if (order.payStatus == 10) {
active.value = 0;
steps.value[0].description = order.createTime;
}
// 付款
if (order.payStatus == 20) {
active.value = 1;
steps.value[0].description = order.createTime;
steps.value[1].description = order.payTime;
}
// 发货
if (order.payStatus == 20 && order.deliveryStatus == 20) {
active.value = 2;
steps.value[0].description = order.createTime;
steps.value[1].description = order.payTime;
steps.value[2].description = order.deliveryTime;
}
// 收货
if (order.payStatus == 20 && order.receiptStatus == 20) {
active.value = 3;
steps.value[0].description = order.createTime;
steps.value[1].description = order.payTime;
steps.value[2].description = order.deliveryTime;
steps.value[3].description = order.receiptTime;
}
// 完成
if (order.payStatus == 20 && order.orderStatus == 30) {
active.value = 4;
steps.value[0].description = order.createTime;
steps.value[1].description = order.payTime;
steps.value[2].description = order.deliveryTime;
steps.value[3].description = order.receiptTime;
}
// 已取消
if (order.orderStatus == 20) {
active.value = 4;
}
};
// const getOrderInfo = () => {
// const orderId = props.data?.orderId;
// listOrderInfo({ orderId }).then((data) => {
// orderInfo.value = data.filter((d) => d.totalNum > 0);
// });
// };
/* 保存编辑 */
const save = () => {};
watch(
() => props.visible,
(visible) => {
if (visible) {
if (props.data) {
loading.value = true;
assignObject(form, props.data);
pageBszxPay({ orderNo: form.orderNo }).then((res) => {
if (res?.list) {
orderInfo.value = res?.list;
}
loading.value = false;
});
loadSteps(props.data);
}
} else {
resetFields();
}
}
);
</script>
<script lang="ts">
import * as MenuIcons from '@/layout/menu-icons';
import * as MenuIcons from '@/layout/menu-icons';
export default {
name: 'BszxOrderInfo',
components: MenuIcons
};
export default {
name: 'BszxOrderInfo',
components: MenuIcons
};
</script>

View File

@@ -64,10 +64,10 @@
import { ref, watch } from 'vue';
import { utils, writeFile } from 'xlsx';
import { message } from 'ant-design-vue';
import useSearch from "@/utils/use-search";
import {ShopOrder, ShopOrderParam} from "@/api/shop/shopOrder/model";
import {listShopOrder} from "@/api/shop/shopOrder";
import {getPayType} from "@/utils/shop";
import useSearch from '@/utils/use-search';
import { ShopOrder, ShopOrderParam } from '@/api/shop/shopOrder/model';
import { listShopOrder } from '@/api/shop/shopOrder';
import { getPayType } from '@/utils/shop';
const props = withDefaults(
defineProps<{
@@ -96,7 +96,7 @@
payStatus: undefined,
orderStatus: undefined,
payType: undefined,
isInvoice: undefined,
isInvoice: undefined
});
const reload = () => {
@@ -123,7 +123,7 @@
const dateRange = ref<[string, string]>(['', '']);
// 变量
const loading = ref(false);
const orders = ref<ShopOrder[]>([])
const orders = ref<ShopOrder[]>([]);
const xlsFileName = ref<string>();
// 导出
@@ -194,7 +194,6 @@
loading.value = false;
})
.finally(() => {});
};
watch(

View File

@@ -1,7 +1,7 @@
<template>
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
<template #extra>
<Extra/>
<Extra />
</template>
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-pro-table
@@ -23,16 +23,22 @@
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'name'">
<div @click="onSearch(record)" class="cursor-pointer">{{ record.name || '匿名' }}</div>
<div @click="onSearch(record)" class="cursor-pointer">{{
record.name || '匿名'
}}</div>
</template>
<template v-if="column.key === 'phone'">
<div v-if="record.mobile" class="text-gray-400">{{ record.mobile }}</div>
<div v-if="record.mobile" class="text-gray-400">{{
record.mobile
}}</div>
<div v-else class="text-gray-600">{{ record.phone }}</div>
</template>
<template v-if="column.key === 'payType'">
<template v-for="item in getPayType()">
<template v-if="record.payStatus == 1">
<span v-if="item.value == record.payType">{{ item.label }}</span>
<span v-if="item.value == record.payType">{{
item.label
}}</span>
</template>
<template v-else>
<span></span>
@@ -40,12 +46,19 @@
</template>
</template>
<template v-if="column.key === 'payStatus'">
<a-tag v-if="record.payStatus == 1" color="green" @click="updatePayStatus(record)">已付款</a-tag>
<a-tag v-if="record.payStatus == 0" @click="updatePayStatus(record)">未付款</a-tag>
<a-tag
v-if="record.payStatus == 1"
color="green"
@click="updatePayStatus(record)"
>已付款</a-tag
>
<a-tag v-if="record.payStatus == 0" @click="updatePayStatus(record)"
>未付款</a-tag
>
<a-tag v-if="record.payStatus == 3">未付款,占场中</a-tag>
</template>
<template v-if="column.key === 'image'">
<a-image :src="record.image" :width="50"/>
<a-image :src="record.image" :width="50" />
</template>
<template v-if="column.key === 'sex'">
<a-tag v-if="record.sex === 1"></a-tag>
@@ -53,18 +66,30 @@
</template>
<template v-if="column.key === 'deliveryStatus'">
<a-tag v-if="record.deliveryStatus == 10">未核销</a-tag>
<a-tag v-if="record.deliveryStatus == 20" color="green">已核销</a-tag>
<a-tag v-if="record.deliveryStatus == 30" color="bule">部分核销</a-tag>
<a-tag v-if="record.deliveryStatus == 20" color="green"
>核销</a-tag
>
<a-tag v-if="record.deliveryStatus == 30" color="bule"
>部分核销</a-tag
>
</template>
<template v-if="column.key === 'orderStatus'">
<a-tag v-if="record.orderStatus === 0">未完成</a-tag>
<a-tag v-if="record.orderStatus === 1" color="green">已完成</a-tag>
<a-tag v-if="record.orderStatus === 2" color="red">已取消</a-tag>
<a-tag v-if="record.orderStatus === 3" color="red">取消中</a-tag>
<a-tag v-if="record.orderStatus === 4" color="red">退款申请中</a-tag>
<a-tag v-if="record.orderStatus === 5" color="red">退款被拒绝</a-tag>
<a-tag v-if="record.orderStatus === 6" color="orange">退款成功</a-tag>
<a-tag v-if="record.orderStatus === 7" color="pink">客户端申请退款</a-tag>
<a-tag v-if="record.orderStatus === 4" color="red"
>退款申请中</a-tag
>
<a-tag v-if="record.orderStatus === 5" color="red"
>退款被拒绝</a-tag
>
<a-tag v-if="record.orderStatus === 6" color="orange"
>退款成功</a-tag
>
<a-tag v-if="record.orderStatus === 7" color="pink"
>客户端申请退款</a-tag
>
</template>
<template v-if="column.key === 'isInvoice'">
<a-tag v-if="record.isInvoice == 0">未开具</a-tag>
@@ -78,7 +103,7 @@
<template v-if="column.key === 'action'">
<a-space>
<a @click="openEdit(record)">修改</a>
<a-divider type="vertical"/>
<a-divider type="vertical" />
<a-popconfirm
title="确定要删除此记录吗?"
@confirm="remove(record)"
@@ -92,216 +117,218 @@
</a-card>
<!-- 编辑弹窗 -->
<OrderInfo v-model:visible="showEdit" :data="current" @done="reload"/>
<OrderInfo v-model:visible="showEdit" :data="current" @done="reload" />
</a-page-header>
</template>
<script lang="ts" setup>
import {ref} from 'vue';
import type {EleProTable} from 'ele-admin-pro';
import type {
DatasourceFunction,
ColumnItem
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue';
import {getPageTitle} from "@/utils/common";
import Extra from "@/views/bszx/extra.vue";
import {pageBszxOrder} from "@/api/bszx/bszxOrder";
import OrderInfo from './components/orderInfo.vue';
import {ShopOrder, ShopOrderParam} from "@/api/shop/shopOrder/model";
import {updateShopOrder} from "@/api/shop/shopOrder";
import {message} from "ant-design-vue";
import {updateUser} from "@/api/system/user";
import {getPayType} from '@/utils/shop';
import {repairOrder} from "@/api/bszx/bszxPay";
import { ref } from 'vue';
import type { EleProTable } from 'ele-admin-pro';
import type {
DatasourceFunction,
ColumnItem
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue';
import { getPageTitle } from '@/utils/common';
import Extra from '@/views/bszx/extra.vue';
import { pageBszxOrder } from '@/api/bszx/bszxOrder';
import OrderInfo from './components/orderInfo.vue';
import { ShopOrder, ShopOrderParam } from '@/api/shop/shopOrder/model';
import { updateShopOrder } from '@/api/shop/shopOrder';
import { message } from 'ant-design-vue';
import { updateUser } from '@/api/system/user';
import { getPayType } from '@/utils/shop';
import { repairOrder } from '@/api/bszx/bszxPay';
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
// 表格选中数据
const selection = ref<ShopOrder[]>([]);
// 当前编辑数据
const current = ref<ShopOrder | null>(null);
// 是否显示编辑弹窗
const showEdit = ref(false);
// 是否显示批量移动弹窗
const showMove = ref(false);
// 加载状态
const loading = ref(true);
// 表格选中数据
const selection = ref<ShopOrder[]>([]);
// 当前编辑数据
const current = ref<ShopOrder | null>(null);
// 是否显示编辑弹窗
const showEdit = ref(false);
// 是否显示批量移动弹窗
const showMove = ref(false);
// 加载状态
const loading = ref(true);
// 表格数据源
const datasource: DatasourceFunction = ({
page,
limit,
where,
orders,
filters
}) => {
if (filters) {
where.status = filters.status;
}
return pageBszxOrder({
...where,
...orders,
// 表格数据源
const datasource: DatasourceFunction = ({
page,
limit
});
};
// 表格列配置
const columns = ref<ColumnItem[]>([
{
title: '订单号',
dataIndex: 'orderNo',
key: 'orderNo',
align: 'center',
width: 200,
},
{
title: '姓名',
dataIndex: 'realName',
key: 'realName',
align: 'center'
},
{
title: '手机号码',
dataIndex: 'phone',
key: 'phone',
align: 'center'
},
{
title: '实付金额',
dataIndex: 'payPrice',
key: 'payPrice',
align: 'center',
customRender: ({text}) => '¥' + text
},
{
title: '支付方式',
dataIndex: 'payType',
key: 'payType',
align: 'center'
},
{
title: '支付状态',
dataIndex: 'payStatus',
key: 'payStatus',
align: 'center'
},
{
title: '核销状态',
dataIndex: 'deliveryStatus',
key: 'deliveryStatus',
align: 'center',
},
{
title: '开票状态',
dataIndex: 'isInvoice',
key: 'isInvoice',
align: 'center',
},
// {
// title: '订单状态',
// dataIndex: 'orderStatus',
// key: 'orderStatus',
// align: 'center',
// },
// {
// title: '支付时间',
// dataIndex: 'payTime',
// key: 'payTime',
// align: 'center',
// width: 180,
// sorter: true,
// ellipsis: true
// },
{
title: '下单时间',
dataIndex: 'createTime',
key: 'createTime',
align: 'center',
width: 180,
sorter: true,
ellipsis: true
},
// {
// title: '操作',
// key: 'action',
// width: 180,
// fixed: 'right',
// align: 'center',
// hideInSetting: true
// }
]);
/* 搜索 */
const reload = (where?: ShopOrderParam) => {
selection.value = [];
tableRef?.value?.reload({where: where});
};
const onSearch = (item: ShopOrder) => {
reload({userId: item.userId})
}
/* 打开编辑弹窗 */
const openEdit = (row?: ShopOrder) => {
current.value = row ?? null;
showEdit.value = true;
};
/* 打开批量移动弹窗 */
const openMove = () => {
showMove.value = true;
};
/**
* 修复订单支付状态
*/
const updatePayStatus = (record: ShopOrder) => {
// 修复订单
repairOrder(record).then(() => {
message.success('修复成功');
}).then(() => {
if(record.realName == '' || record.realName == undefined){
// 更新用户真实姓名
updateUser({
userId: record.userId,
realName: record.realName
})
}
reload();
})
}
/* 查询 */
const query = () => {
loading.value = true;
};
/* 自定义行属性 */
const customRow = (record: ShopOrder) => {
return {
// 行点击事件
onClick: () => {
// console.log(record);
},
// 行双击事件
onDblclick: () => {
openEdit(record);
limit,
where,
orders,
filters
}) => {
if (filters) {
where.status = filters.status;
}
return pageBszxOrder({
...where,
...orders,
page,
limit
});
};
};
query();
// 表格列配置
const columns = ref<ColumnItem[]>([
{
title: '订单号',
dataIndex: 'orderNo',
key: 'orderNo',
align: 'center',
width: 200
},
{
title: '姓名',
dataIndex: 'realName',
key: 'realName',
align: 'center'
},
{
title: '手机号码',
dataIndex: 'phone',
key: 'phone',
align: 'center'
},
{
title: '实付金额',
dataIndex: 'payPrice',
key: 'payPrice',
align: 'center',
customRender: ({ text }) => '¥' + text
},
{
title: '支付方式',
dataIndex: 'payType',
key: 'payType',
align: 'center'
},
{
title: '支付状态',
dataIndex: 'payStatus',
key: 'payStatus',
align: 'center'
},
{
title: '核销状态',
dataIndex: 'deliveryStatus',
key: 'deliveryStatus',
align: 'center'
},
{
title: '开票状态',
dataIndex: 'isInvoice',
key: 'isInvoice',
align: 'center'
},
// {
// title: '订单状态',
// dataIndex: 'orderStatus',
// key: 'orderStatus',
// align: 'center',
// },
// {
// title: '支付时间',
// dataIndex: 'payTime',
// key: 'payTime',
// align: 'center',
// width: 180,
// sorter: true,
// ellipsis: true
// },
{
title: '下单时间',
dataIndex: 'createTime',
key: 'createTime',
align: 'center',
width: 180,
sorter: true,
ellipsis: true
}
// {
// title: '操作',
// key: 'action',
// width: 180,
// fixed: 'right',
// align: 'center',
// hideInSetting: true
// }
]);
/* 搜索 */
const reload = (where?: ShopOrderParam) => {
selection.value = [];
tableRef?.value?.reload({ where: where });
};
const onSearch = (item: ShopOrder) => {
reload({ userId: item.userId });
};
/* 打开编辑弹窗 */
const openEdit = (row?: ShopOrder) => {
current.value = row ?? null;
showEdit.value = true;
};
/* 打开批量移动弹窗 */
const openMove = () => {
showMove.value = true;
};
/**
* 修复订单支付状态
*/
const updatePayStatus = (record: ShopOrder) => {
// 修复订单
repairOrder(record)
.then(() => {
message.success('修复成功');
})
.then(() => {
if (record.realName == '' || record.realName == undefined) {
// 更新用户真实姓名
updateUser({
userId: record.userId,
realName: record.realName
});
}
reload();
});
};
/* 查询 */
const query = () => {
loading.value = true;
};
/* 自定义行属性 */
const customRow = (record: ShopOrder) => {
return {
// 行点击事件
onClick: () => {
// console.log(record);
},
// 行双击事件
onDblclick: () => {
openEdit(record);
}
};
};
query();
</script>
<script lang="ts">
import * as MenuIcons from '@/layout/menu-icons';
import * as MenuIcons from '@/layout/menu-icons';
export default {
name: 'BszxOrder',
components: MenuIcons
};
export default {
name: 'BszxOrder',
components: MenuIcons
};
</script>
<style lang="less" scoped></style>

View File

@@ -8,7 +8,7 @@
placeholder="选择年级"
:options="gradeList"
@change="onGrade"
></a-select>
/>
<a-select
v-if="where.gradeName"
show-search
@@ -17,7 +17,7 @@
placeholder="选择年级"
:options="classList"
@change="onClass"
></a-select>
/>
<a-range-picker
v-model:value="dateRange"
@change="search"
@@ -35,196 +35,192 @@
</template>
<script lang="ts" setup>
import {ref, watch} from 'vue';
import {utils, writeFile} from 'xlsx';
import dayjs from 'dayjs';
import {message} from 'ant-design-vue';
import useSearch from "@/utils/use-search";
import {BszxPayParam} from "@/api/bszx/bszxPay/model";
import {BszxBm} from "@/api/bszx/bszxBm/model";
import {listBszxPay} from "@/api/bszx/bszxPay";
import {BszxClassParam} from "@/api/bszx/bszxClass/model";
import {listBszxGrade} from "@/api/bszx/bszxGrade";
import {listBszxClass} from "@/api/bszx/bszxClass";
import { ref, watch } from 'vue';
import { utils, writeFile } from 'xlsx';
import dayjs from 'dayjs';
import { message } from 'ant-design-vue';
import useSearch from '@/utils/use-search';
import { BszxPayParam } from '@/api/bszx/bszxPay/model';
import { BszxBm } from '@/api/bszx/bszxBm/model';
import { listBszxPay } from '@/api/bszx/bszxPay';
import { BszxClassParam } from '@/api/bszx/bszxClass/model';
import { listBszxGrade } from '@/api/bszx/bszxGrade';
import { listBszxClass } from '@/api/bszx/bszxClass';
const props = withDefaults(
defineProps<{
// 选中的角色
selection?: [];
}>(),
{}
);
const props = withDefaults(
defineProps<{
// 选中的角色
selection?: [];
}>(),
{}
);
const emit = defineEmits<{
(e: 'search', where?: BszxPayParam): void;
(e: 'add'): void;
(e: 'remove'): void;
(e: 'batchMove'): void;
}>();
const emit = defineEmits<{
(e: 'search', where?: BszxPayParam): void;
(e: 'add'): void;
(e: 'remove'): void;
(e: 'batchMove'): void;
}>();
// 表单数据
const {where} = useSearch<BszxPayParam>({
id: undefined,
keywords: '',
gradeName: undefined,
className: undefined,
createTimeStart: undefined,
createTimeEnd: undefined,
userId: undefined
});
const reload = () => {
emit('search', where);
};
/* 搜索 */
const search = () => {
const [d1, d2] = dateRange.value ?? [];
where.createTimeStart = d1 ? d1 + ' 00:00:00' : undefined;
where.createTimeEnd = d2 ? d2 + ' 23:59:59' : undefined;
emit('search', {
...where
// 表单数据
const { where } = useSearch<BszxPayParam>({
id: undefined,
keywords: '',
gradeName: undefined,
className: undefined,
createTimeStart: undefined,
createTimeEnd: undefined,
userId: undefined
});
};
const reload = () => {
emit('search', where);
};
const dateRange = ref<[string, string]>(['', '']);
// 变量
const loading = ref(false);
const bmList = ref<BszxBm[]>([])
const xlsFileName = ref<string>();
const branchId = ref<number>();
const gradeId = ref<number>();
const gradeList = ref<BszxClassParam[]>([]);
const classList = ref<BszxClassParam[]>([]);
const getGradeList = () => {
listBszxGrade({branch: branchId.value}).then(res => {
gradeList.value = res.map(d => {
d.value = Number(d.id);
d.label = d.name;
return d;
/* 搜索 */
const search = () => {
const [d1, d2] = dateRange.value ?? [];
where.createTimeStart = d1 ? d1 + ' 00:00:00' : undefined;
where.createTimeEnd = d2 ? d2 + ' 23:59:59' : undefined;
emit('search', {
...where
});
})
};
};
const getClassList = () => {
listBszxClass({gradeId: gradeId.value}).then(res => {
classList.value = res.map(d => {
d.value = Number(d.id);
d.label = d.name;
return d;
});
})
}
const dateRange = ref<[string, string]>(['', '']);
// 变量
const loading = ref(false);
const bmList = ref<BszxBm[]>([]);
const xlsFileName = ref<string>();
const branchId = ref<number>();
const gradeId = ref<number>();
const gradeList = ref<BszxClassParam[]>([]);
const classList = ref<BszxClassParam[]>([]);
const onGrade = (gradeName: number, item: any) => {
where.gradeName = item.name;
if (gradeName) {
console.log(item)
gradeId.value = item.id;
getClassList();
}
emit('search', where);
}
const onBranchId = () => {
getGradeList();
}
const onClass = (classId, item) => {
console.log(classId);
where.className = item.name;
reload();
}
// 导出
const handleExport = async () => {
loading.value = true;
const array: (string | number)[][] = [
[
'订单编号',
'姓名',
'手机号码',
'捐款金额',
'性别',
'年级',
'班级',
'居住地址',
'工作单位',
'职务',
'捐款时间'
]
];
// 按搜索结果导出
where.sceneType = 'Content';
await listBszxPay(where)
.then((list) => {
bmList.value = list;
list?.forEach((d: BszxBm) => {
array.push([
`${d.orderNo}`,
`${d.name}`,
`${d.mobile}`,
`${d.price}`,
`${d.sex == 1 ? '男' : ''}${d.sex == 2 ? '女' : '-'}`,
`${d.gradeName ? d.gradeName : '-'}`,
`${d.className ? d.className : '-'}`,
`${d.address ? d.address : '-'}`,
`${d.workUnit ? d.workUnit : '-'}`,
`${d.position ? d.position : '-'}`,
`${d.createTime}`
]);
const getGradeList = () => {
listBszxGrade({ branch: branchId.value }).then((res) => {
gradeList.value = res.map((d) => {
d.value = Number(d.id);
d.label = d.name;
return d;
});
const sheetName = `导出捐款记录${dayjs(new Date()).format('YYYYMMDD')}`;
const workbook = {
SheetNames: [sheetName],
Sheets: {}
};
const sheet = utils.aoa_to_sheet(array);
workbook.Sheets[sheetName] = sheet;
// 设置列宽
sheet['!cols'] = [
{wch: 10},
{wch: 40},
{wch: 20},
{wch: 20},
{wch: 60},
{wch: 15},
{wch: 10},
{wch: 10},
{wch: 20},
{wch: 10},
{wch: 20}
];
message.loading('正在导出...');
setTimeout(() => {
writeFile(
workbook,
`${
where.createTimeEnd ? xlsFileName.value + '_' : ''
}${sheetName}.xlsx`
);
loading.value = false;
}, 1000);
})
.catch((msg) => {
message.error(msg);
loading.value = false;
})
.finally(() => {
});
};
};
const getClassList = () => {
listBszxClass({ gradeId: gradeId.value }).then((res) => {
classList.value = res.map((d) => {
d.value = Number(d.id);
d.label = d.name;
return d;
});
});
};
getGradeList();
const onGrade = (gradeName: number, item: any) => {
where.gradeName = item.name;
if (gradeName) {
console.log(item);
gradeId.value = item.id;
getClassList();
}
emit('search', where);
};
watch(
() => props.totalPriceAmount,
(totalPriceAmount) => {
console.log(totalPriceAmount, 'totalPriceAmount')
}
);
const onBranchId = () => {
getGradeList();
};
const onClass = (classId, item) => {
console.log(classId);
where.className = item.name;
reload();
};
// 导出
const handleExport = async () => {
loading.value = true;
const array: (string | number)[][] = [
[
'订单编号',
'姓名',
'手机号码',
'捐款金额',
'性别',
'年级',
'班级',
'居住地址',
'工作单位',
'职务',
'捐款时间'
]
];
// 按搜索结果导出
where.sceneType = 'Content';
await listBszxPay(where)
.then((list) => {
bmList.value = list;
list?.forEach((d: BszxBm) => {
array.push([
`${d.orderNo}`,
`${d.name}`,
`${d.mobile}`,
`${d.price}`,
`${d.sex == 1 ? '男' : ''}${d.sex == 2 ? '女' : '-'}`,
`${d.gradeName ? d.gradeName : '-'}`,
`${d.className ? d.className : '-'}`,
`${d.address ? d.address : '-'}`,
`${d.workUnit ? d.workUnit : '-'}`,
`${d.position ? d.position : '-'}`,
`${d.createTime}`
]);
});
const sheetName = `导出捐款记录${dayjs(new Date()).format('YYYYMMDD')}`;
const workbook = {
SheetNames: [sheetName],
Sheets: {}
};
const sheet = utils.aoa_to_sheet(array);
workbook.Sheets[sheetName] = sheet;
// 设置列宽
sheet['!cols'] = [
{ wch: 10 },
{ wch: 40 },
{ wch: 20 },
{ wch: 20 },
{ wch: 60 },
{ wch: 15 },
{ wch: 10 },
{ wch: 10 },
{ wch: 20 },
{ wch: 10 },
{ wch: 20 }
];
message.loading('正在导出...');
setTimeout(() => {
writeFile(
workbook,
`${
where.createTimeEnd ? xlsFileName.value + '_' : ''
}${sheetName}.xlsx`
);
loading.value = false;
}, 1000);
})
.catch((msg) => {
message.error(msg);
loading.value = false;
})
.finally(() => {});
};
getGradeList();
watch(
() => props.totalPriceAmount,
(totalPriceAmount) => {
console.log(totalPriceAmount, 'totalPriceAmount');
}
);
</script>

View File

@@ -1,7 +1,7 @@
<template>
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
<template #extra>
<Extra/>
<Extra />
</template>
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-pro-table
@@ -25,14 +25,18 @@
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'name'">
<div @click="onSearch(record)" class="cursor-pointer">{{ record.name || '匿名' }}</div>
<div @click="onSearch(record)" class="cursor-pointer">{{
record.name || '匿名'
}}</div>
</template>
<template v-if="column.key === 'phone'">
<div v-if="record.mobile" class="text-gray-400">{{ record.mobile }}</div>
<div v-if="record.mobile" class="text-gray-400">{{
record.mobile
}}</div>
<div v-else class="text-gray-600">{{ record.phone }}</div>
</template>
<template v-if="column.key === 'image'">
<a-image :src="record.image" :width="50"/>
<a-image :src="record.image" :width="50" />
</template>
<template v-if="column.key === 'sex'">
<a-tag v-if="record.sex === 1"></a-tag>
@@ -49,7 +53,7 @@
<template v-if="column.key === 'action'">
<a-space>
<a @click="openEdit(record)">修改</a>
<a-divider type="vertical"/>
<a-divider type="vertical" />
<a-popconfirm
title="确定要删除此记录吗?"
@confirm="remove(record)"
@@ -60,277 +64,283 @@
</template>
</template>
<template #footer>
<span v-if="totalPriceAmount" class="text-red-500 font-bold">小计{{ totalPriceAmount.toFixed(2) }}</span>
<span v-if="totalPriceAmount" class="text-red-500 font-bold"
>小计{{ totalPriceAmount.toFixed(2) }}</span
>
</template>
</ele-pro-table>
</a-card>
<!-- 编辑弹窗 -->
<BszxPayEdit v-model:visible="showEdit" :data="current" @done="reload"/>
<BszxPayEdit v-model:visible="showEdit" :data="current" @done="reload" />
</a-page-header>
</template>
<script lang="ts" setup>
import {createVNode, ref} from 'vue';
import {message, Modal} from 'ant-design-vue';
import {ExclamationCircleOutlined} from '@ant-design/icons-vue';
import type {EleProTable} from 'ele-admin-pro';
import type {
DatasourceFunction,
ColumnItem
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue';
import BszxPayEdit from './components/bszxPayEdit.vue';
import {pageBszxPay, removeBszxPay, removeBatchBszxPay} from '@/api/bszx/bszxPay';
import type {BszxPay, BszxPayParam} from '@/api/bszx/bszxPay/model';
import {getPageTitle} from "@/utils/common";
import Extra from "@/views/bsyx/extra.vue";
import {PageResult} from "@/api";
import { createVNode, ref } from 'vue';
import { message, Modal } from 'ant-design-vue';
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
import type { EleProTable } from 'ele-admin-pro';
import type {
DatasourceFunction,
ColumnItem
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue';
import BszxPayEdit from './components/bszxPayEdit.vue';
import {
pageBszxPay,
removeBszxPay,
removeBatchBszxPay
} from '@/api/bszx/bszxPay';
import type { BszxPay, BszxPayParam } from '@/api/bszx/bszxPay/model';
import { getPageTitle } from '@/utils/common';
import Extra from '@/views/bsyx/extra.vue';
import { PageResult } from '@/api';
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
// 表格选中数据
const selection = ref<BszxPay[]>([]);
// 当前编辑数据
const current = ref<BszxPay | null>(null);
// 是否显示编辑弹窗
const showEdit = ref(false);
// 是否显示批量移动弹窗
const showMove = ref(false);
// 加载状态
const loading = ref(true);
const totalPriceAmount = ref<number>(0);
// 表格选中数据
const selection = ref<BszxPay[]>([]);
// 当前编辑数据
const current = ref<BszxPay | null>(null);
// 是否显示编辑弹窗
const showEdit = ref(false);
// 是否显示批量移动弹窗
const showMove = ref(false);
// 加载状态
const loading = ref(true);
const totalPriceAmount = ref<number>(0);
// 表格数据源
const datasource: DatasourceFunction = ({
page,
limit,
where,
orders,
filters
}) => {
if (filters) {
where.status = filters.status;
}
return pageBszxPay({
...where,
...orders,
// 表格数据源
const datasource: DatasourceFunction = ({
page,
limit
});
};
// 整理数据
const parseData = (data: PageResult<BszxPay>) => {
totalPriceAmount.value = 0;
data.list?.map((item) => {
if(item.price){
totalPriceAmount.value += Number(item.price)
limit,
where,
orders,
filters
}) => {
if (filters) {
where.status = filters.status;
}
})
return data;
};
// 表格列配置
const columns = ref<ColumnItem[]>([
{
title: '订单编号',
dataIndex: 'orderNo',
key: 'orderNo',
align: 'center',
width: 200,
},
{
title: '姓名',
dataIndex: 'name',
key: 'name',
align: 'center',
},
{
title: '手机号码',
dataIndex: 'phone',
key: 'phone',
align: 'center',
width: 120
},
{
title: '捐款金额',
dataIndex: 'price',
key: 'price',
width: 120,
align: 'center',
sorter: true,
customRender: ({text}) => '¥' + text
},
{
title: '性别',
dataIndex: 'sex',
key: 'sex',
align: 'center',
customRender: ({text}) => ['', '男', '女'][text]
},
{
title: '分部',
dataIndex: 'branchName',
key: 'branchName',
align: 'center',
},
{
title: '年级',
dataIndex: 'gradeName',
key: 'gradeName',
align: 'center',
},
{
title: '班级',
dataIndex: 'className',
key: 'className',
align: 'center',
},
{
title: '居住地址',
dataIndex: 'address',
key: 'address',
align: 'center',
},
{
title: '工作单位',
dataIndex: 'workUnit',
key: 'workUnit',
align: 'center',
},
{
title: '职务',
dataIndex: 'position',
key: 'position',
align: 'center',
},
// {
// title: '捐赠证书',
// dataIndex: 'certificate',
// key: 'certificate',
// align: 'center',
// },
{
title: '心愿',
dataIndex: 'comments',
key: 'comments',
align: 'center',
},
// {
// title: '状态',
// dataIndex: 'status',
// key: 'status',
// align: 'center',
// },
{
title: '捐款时间',
dataIndex: 'createTime',
key: 'createTime',
align: 'center',
width: 180,
sorter: true,
ellipsis: true
},
// {
// title: '操作',
// key: 'action',
// width: 180,
// fixed: 'right',
// align: 'center',
// hideInSetting: true
// }
]);
/* 搜索 */
const reload = (where?: BszxPayParam) => {
selection.value = [];
tableRef?.value?.reload({where: where});
};
const onSearch = (item: BszxPay) => {
reload({userId: item.userId})
}
/* 打开编辑弹窗 */
const openEdit = (row?: BszxPay) => {
current.value = row ?? null;
showEdit.value = true;
};
/* 打开批量移动弹窗 */
const openMove = () => {
showMove.value = true;
};
/* 删除单个 */
const remove = (row: BszxPay) => {
const hide = message.loading('请求中..', 0);
removeBszxPay(row.id)
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
return pageBszxPay({
...where,
...orders,
page,
limit
});
};
/* 批量删除 */
const removeBatch = () => {
if (!selection.value.length) {
message.error('请至少选择一条数据');
return;
}
Modal.confirm({
title: '提示',
content: '确定要删除选中的记录吗?',
icon: createVNode(ExclamationCircleOutlined),
maskClosable: true,
onOk: () => {
const hide = message.loading('请求中..', 0);
removeBatchBszxPay(selection.value.map((d) => d.id))
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
}
});
};
/* 查询 */
const query = () => {
loading.value = true;
};
/* 自定义行属性 */
const customRow = (record: BszxPay) => {
return {
// 行点击事件
onClick: () => {
// console.log(record);
},
// 行双击事件
onDblclick: () => {
// openEdit(record);
}
};
};
query();
// 整理数据
const parseData = (data: PageResult<BszxPay>) => {
totalPriceAmount.value = 0;
data.list?.map((item) => {
if (item.price) {
totalPriceAmount.value += Number(item.price);
}
});
return data;
};
// 表格列配置
const columns = ref<ColumnItem[]>([
{
title: '订单编号',
dataIndex: 'orderNo',
key: 'orderNo',
align: 'center',
width: 200
},
{
title: '姓名',
dataIndex: 'name',
key: 'name',
align: 'center'
},
{
title: '手机号码',
dataIndex: 'phone',
key: 'phone',
align: 'center',
width: 120
},
{
title: '捐款金额',
dataIndex: 'price',
key: 'price',
width: 120,
align: 'center',
sorter: true,
customRender: ({ text }) => '¥' + text
},
{
title: '性别',
dataIndex: 'sex',
key: 'sex',
align: 'center',
customRender: ({ text }) => ['', '男', '女'][text]
},
{
title: '分部',
dataIndex: 'branchName',
key: 'branchName',
align: 'center'
},
{
title: '年级',
dataIndex: 'gradeName',
key: 'gradeName',
align: 'center'
},
{
title: '班级',
dataIndex: 'className',
key: 'className',
align: 'center'
},
{
title: '居住地址',
dataIndex: 'address',
key: 'address',
align: 'center'
},
{
title: '工作单位',
dataIndex: 'workUnit',
key: 'workUnit',
align: 'center'
},
{
title: '职务',
dataIndex: 'position',
key: 'position',
align: 'center'
},
// {
// title: '捐赠证书',
// dataIndex: 'certificate',
// key: 'certificate',
// align: 'center',
// },
{
title: '心愿',
dataIndex: 'comments',
key: 'comments',
align: 'center'
},
// {
// title: '状态',
// dataIndex: 'status',
// key: 'status',
// align: 'center',
// },
{
title: '捐款时间',
dataIndex: 'createTime',
key: 'createTime',
align: 'center',
width: 180,
sorter: true,
ellipsis: true
}
// {
// title: '操作',
// key: 'action',
// width: 180,
// fixed: 'right',
// align: 'center',
// hideInSetting: true
// }
]);
/* 搜索 */
const reload = (where?: BszxPayParam) => {
selection.value = [];
tableRef?.value?.reload({ where: where });
};
const onSearch = (item: BszxPay) => {
reload({ userId: item.userId });
};
/* 打开编辑弹窗 */
const openEdit = (row?: BszxPay) => {
current.value = row ?? null;
showEdit.value = true;
};
/* 打开批量移动弹窗 */
const openMove = () => {
showMove.value = true;
};
/* 删除单个 */
const remove = (row: BszxPay) => {
const hide = message.loading('请求中..', 0);
removeBszxPay(row.id)
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
};
/* 批量删除 */
const removeBatch = () => {
if (!selection.value.length) {
message.error('请至少选择一条数据');
return;
}
Modal.confirm({
title: '提示',
content: '确定要删除选中的记录吗?',
icon: createVNode(ExclamationCircleOutlined),
maskClosable: true,
onOk: () => {
const hide = message.loading('请求中..', 0);
removeBatchBszxPay(selection.value.map((d) => d.id))
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
}
});
};
/* 查询 */
const query = () => {
loading.value = true;
};
/* 自定义行属性 */
const customRow = (record: BszxPay) => {
return {
// 行点击事件
onClick: () => {
// console.log(record);
},
// 行双击事件
onDblclick: () => {
// openEdit(record);
}
};
};
query();
</script>
<script lang="ts">
export default {
name: 'BszxPay'
};
export default {
name: 'BszxPay'
};
</script>
<style lang="less" scoped></style>

View File

@@ -78,7 +78,10 @@
import { ref, reactive, watch } from 'vue';
import { Form, message } from 'ant-design-vue';
import { assignObject, uuid } from 'ele-admin-pro';
import { addBszxPayRanking, updateBszxPayRanking } from '@/api/bszx/bszxPayRanking';
import {
addBszxPayRanking,
updateBszxPayRanking
} from '@/api/bszx/bszxPayRanking';
import { BszxPayRanking } from '@/api/bszx/bszxPayRanking/model';
import { useThemeStore } from '@/store/modules/theme';
import { storeToRefs } from 'pinia';
@@ -171,7 +174,9 @@
const formData = {
...form
};
const saveOrUpdate = isUpdate.value ? updateBszxPayRanking : addBszxPayRanking;
const saveOrUpdate = isUpdate.value
? updateBszxPayRanking
: addBszxPayRanking;
saveOrUpdate(formData)
.then((msg) => {
loading.value = false;
@@ -194,12 +199,12 @@
images.value = [];
if (props.data) {
assignObject(form, props.data);
if(props.data.image){
if (props.data.image) {
images.value.push({
uid: uuid(),
url: props.data.image,
status: 'done'
})
});
}
isUpdate.value = true;
} else {

View File

@@ -8,21 +8,25 @@
/>
<a-tooltip title="实际订单总金额(来自订单表)" class="flex px-4">
<span class="text-gray-400">实际订单总金额</span>
<span class="text-gray-700 font-bold">{{ formatNumber(bszxTotalPrice) }}</span>
<span class="text-gray-700 font-bold"
>{{ formatNumber(bszxTotalPrice) }}</span
>
</a-tooltip>
<a-tooltip title="排行榜统计金额(来自排行榜表)" class="flex px-4 ml-4">
<span class="text-gray-400">排行榜统计金额</span>
<span class="text-gray-700 font-bold">{{ formatNumber(rankingTotalPrice) }}</span>
<span class="text-gray-700 font-bold"
>{{ formatNumber(rankingTotalPrice) }}</span
>
</a-tooltip>
</a-space>
</template>
<script lang="ts" setup>
import useSearch from "@/utils/use-search";
import useSearch from '@/utils/use-search';
import { watch, ref, computed } from 'vue';
import { formatNumber } from 'ele-admin-pro/es';
import { BszxPayRankingParam } from "@/api/bszx/bszxPayRanking/model";
import { BszxPayRankingParam } from '@/api/bszx/bszxPayRanking/model';
import { useBszxStatisticsStore } from '@/store/modules/bszx-statistics';
// 使用百色中学统计数据 store
@@ -56,7 +60,7 @@
}>();
// 表单数据
const {where,resetFields} = useSearch<BszxPayRankingParam>({
const { where, resetFields } = useSearch<BszxPayRankingParam>({
id: undefined,
userId: undefined,
createTimeStart: undefined,
@@ -75,9 +79,9 @@
};
const onSearch = (text: string) => {
where.sceneType = text
where.sceneType = text;
search();
}
};
watch(
() => props.selection,

View File

@@ -1,7 +1,7 @@
<template>
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
<template #extra>
<Extra/>
<Extra />
</template>
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-pro-table
@@ -25,7 +25,7 @@
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'image'">
<a-image :src="record.image" :width="50"/>
<a-image :src="record.image" :width="50" />
</template>
<template v-if="column.key === 'status'">
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
@@ -34,7 +34,7 @@
<template v-if="column.key === 'action'">
<a-space>
<a @click="openEdit(record)">修改</a>
<a-divider type="vertical"/>
<a-divider type="vertical" />
<a-popconfirm
title="确定要删除此记录吗?"
@confirm="remove(record)"
@@ -48,195 +48,208 @@
</a-card>
<!-- 编辑弹窗 -->
<BszxPayRankingEdit v-model:visible="showEdit" :data="current" @done="reload"/>
<BszxPayRankingEdit
v-model:visible="showEdit"
:data="current"
@done="reload"
/>
</a-page-header>
</template>
<script lang="ts" setup>
import {createVNode, ref, onMounted} from 'vue';
import {message, Modal} from 'ant-design-vue';
import {ExclamationCircleOutlined} from '@ant-design/icons-vue';
import type {EleProTable} from 'ele-admin-pro';
import type {
DatasourceFunction,
ColumnItem
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue';
import BszxPayRankingEdit from './components/bszxPayRankingEdit.vue';
import {removeBszxPayRanking, removeBatchBszxPayRanking, ranking} from '@/api/bszx/bszxPayRanking';
import type {BszxPayRanking, BszxPayRankingParam} from '@/api/bszx/bszxPayRanking/model';
import {getPageTitle} from "@/utils/common";
import Extra from "@/views/bsyx/extra.vue";
import { useBszxStatisticsStore } from '@/store/modules/bszx-statistics';
import { createVNode, ref, onMounted } from 'vue';
import { message, Modal } from 'ant-design-vue';
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
import type { EleProTable } from 'ele-admin-pro';
import type {
DatasourceFunction,
ColumnItem
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue';
import BszxPayRankingEdit from './components/bszxPayRankingEdit.vue';
import {
removeBszxPayRanking,
removeBatchBszxPayRanking,
ranking
} from '@/api/bszx/bszxPayRanking';
import type {
BszxPayRanking,
BszxPayRankingParam
} from '@/api/bszx/bszxPayRanking/model';
import { getPageTitle } from '@/utils/common';
import Extra from '@/views/bsyx/extra.vue';
import { useBszxStatisticsStore } from '@/store/modules/bszx-statistics';
// 使用百色中学统计数据 store
const bszxStatisticsStore = useBszxStatisticsStore();
// 使用百色中学统计数据 store
const bszxStatisticsStore = useBszxStatisticsStore();
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
// 表格选中数据
const selection = ref<BszxPayRanking[]>([]);
// 当前编辑数据
const current = ref<BszxPayRanking | null>(null);
// 是否显示编辑弹窗
const showEdit = ref(false);
// 是否显示批量移动弹窗
const showMove = ref(false);
// 加载状态
const loading = ref(true);
// 排行榜总金额(本地计算)
const rankingTotalPrice = ref<number>(0);
// 表格选中数据
const selection = ref<BszxPayRanking[]>([]);
// 当前编辑数据
const current = ref<BszxPayRanking | null>(null);
// 是否显示编辑弹窗
const showEdit = ref(false);
// 是否显示批量移动弹窗
const showMove = ref(false);
// 加载状态
const loading = ref(true);
// 排行榜总金额(本地计算)
const rankingTotalPrice = ref<number>(0);
// 表格数据源
const datasource: DatasourceFunction = ({where}) => {
return ranking({...where}).then(data => {
// 计算排行榜总金额(用于对比显示)
let total = 0;
data.forEach((item) => {
if (item.totalPrice) {
total += item.totalPrice;
// 表格数据源
const datasource: DatasourceFunction = ({ where }) => {
return ranking({ ...where }).then((data) => {
// 计算排行榜总金额(用于对比显示)
let total = 0;
data.forEach((item) => {
if (item.totalPrice) {
total += item.totalPrice;
}
});
rankingTotalPrice.value = total;
// 不再在这里更新 store 数据,因为这里的数据是排行榜数据,不是真实的订单统计
// store 中的数据应该来自 bszxOrderTotal API代表真实的订单金额
return data;
});
};
// 表格列配置
const columns = ref<ColumnItem[]>([
{
key: 'index',
width: 48,
align: 'center',
fixed: 'left',
hideInSetting: true,
customRender: ({ index }) => index + (tableRef.value?.tableIndex ?? 0)
},
{
title: '项目名称',
dataIndex: 'formName',
key: 'formName'
},
{
title: '捐款人数',
dataIndex: 'number',
key: 'number',
align: 'center'
},
{
title: '获得捐款总金额',
dataIndex: 'totalPrice',
key: 'totalPrice',
align: 'center'
}
// {
// title: '操作',
// key: 'action',
// width: 180,
// fixed: 'right',
// align: 'center',
// hideInSetting: true
// }
]);
/* 搜索 */
const reload = (where?: BszxPayRankingParam) => {
selection.value = [];
tableRef?.value?.reload({ where: where });
};
// 初始化数据
onMounted(async () => {
try {
// 初始化百色中学统计数据
await bszxStatisticsStore.fetchBszxStatistics();
} catch (error) {
console.error('初始化百色中学统计数据失败:', error);
}
});
/* 打开编辑弹窗 */
const openEdit = (row?: BszxPayRanking) => {
current.value = row ?? null;
showEdit.value = true;
};
/* 打开批量移动弹窗 */
const openMove = () => {
showMove.value = true;
};
/* 删除单个 */
const remove = (row: BszxPayRanking) => {
const hide = message.loading('请求中..', 0);
removeBszxPayRanking(row.bszxPayRankingId)
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
};
/* 批量删除 */
const removeBatch = () => {
if (!selection.value.length) {
message.error('请至少选择一条数据');
return;
}
Modal.confirm({
title: '提示',
content: '确定要删除选中的记录吗?',
icon: createVNode(ExclamationCircleOutlined),
maskClosable: true,
onOk: () => {
const hide = message.loading('请求中..', 0);
removeBatchBszxPayRanking(
selection.value.map((d) => d.bszxPayRankingId)
)
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
}
});
rankingTotalPrice.value = total;
// 不再在这里更新 store 数据,因为这里的数据是排行榜数据,不是真实的订单统计
// store 中的数据应该来自 bszxOrderTotal API代表真实的订单金额
return data;
});
};
// 表格列配置
const columns = ref<ColumnItem[]>([
{
key: 'index',
width: 48,
align: 'center',
fixed: 'left',
hideInSetting: true,
customRender: ({index}) => index + (tableRef.value?.tableIndex ?? 0)
},
{
title: '项目名称',
dataIndex: 'formName',
key: 'formName'
},
{
title: '捐款人数',
dataIndex: 'number',
key: 'number',
align: 'center',
},
{
title: '获得捐款总金额',
dataIndex: 'totalPrice',
key: 'totalPrice',
align: 'center',
}
// {
// title: '操作',
// key: 'action',
// width: 180,
// fixed: 'right',
// align: 'center',
// hideInSetting: true
// }
]);
/* 搜索 */
const reload = (where?: BszxPayRankingParam) => {
selection.value = [];
tableRef?.value?.reload({where: where});
};
// 初始化数据
onMounted(async () => {
try {
// 初始化百色中学统计数据
await bszxStatisticsStore.fetchBszxStatistics();
} catch (error) {
console.error('初始化百色中学统计数据失败:', error);
}
});
/* 打开编辑弹窗 */
const openEdit = (row?: BszxPayRanking) => {
current.value = row ?? null;
showEdit.value = true;
};
/* 打开批量移动弹窗 */
const openMove = () => {
showMove.value = true;
};
/* 删除单个 */
const remove = (row: BszxPayRanking) => {
const hide = message.loading('请求中..', 0);
removeBszxPayRanking(row.bszxPayRankingId)
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
};
/* 批量删除 */
const removeBatch = () => {
if (!selection.value.length) {
message.error('请至少选择一条数据');
return;
}
Modal.confirm({
title: '提示',
content: '确定要删除选中的记录吗?',
icon: createVNode(ExclamationCircleOutlined),
maskClosable: true,
onOk: () => {
const hide = message.loading('请求中..', 0);
removeBatchBszxPayRanking(selection.value.map((d) => d.bszxPayRankingId))
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
}
});
};
/* 查询 */
const query = () => {
loading.value = true;
};
/* 自定义行属性 */
const customRow = (record: BszxPayRanking) => {
return {
// 行点击事件
onClick: () => {
// console.log(record);
},
// 行双击事件
onDblclick: () => {
openEdit(record);
}
};
};
query();
/* 查询 */
const query = () => {
loading.value = true;
};
/* 自定义行属性 */
const customRow = (record: BszxPayRanking) => {
return {
// 行点击事件
onClick: () => {
// console.log(record);
},
// 行双击事件
onDblclick: () => {
openEdit(record);
}
};
};
query();
</script>
<script lang="ts">
export default {
name: 'BszxPayRanking'
};
export default {
name: 'BszxPayRanking'
};
</script>
<style lang="less" scoped></style>

View File

@@ -1,60 +1,60 @@
<!-- 搜索表单 -->
<template>
<a-space style="flex-wrap: wrap" v-if="hasRole('superAdmin') || hasRole('admin') || hasRole('foundation')">
<a-button
type="text"
@click="openUrl('/bsyx/ranking')"
>捐款排行榜
<a-space
style="flex-wrap: wrap"
v-if="hasRole('superAdmin') || hasRole('admin') || hasRole('foundation')"
>
<a-button type="text" @click="openUrl('/bsyx/ranking')"
>捐款排行榜
</a-button>
</a-space>
</template>
<script lang="ts" setup>
import {watch,nextTick} from 'vue';
import {CmsWebsite} from '@/api/cms/cmsWebsite/model';
import {openUrl} from "@/utils/common";
import {message} from 'ant-design-vue';
import {removeSiteInfoCache} from "@/api/cms/cmsWebsite";
import {hasRole} from "@/utils/permission";
import { watch, nextTick } from 'vue';
import { CmsWebsite } from '@/api/cms/cmsWebsite/model';
import { openUrl } from '@/utils/common';
import { message } from 'ant-design-vue';
import { removeSiteInfoCache } from '@/api/cms/cmsWebsite';
import { hasRole } from '@/utils/permission';
const props = withDefaults(
defineProps<{
// 选中的角色
selection?: [];
website?: CmsWebsite;
count?: 0;
}>(),
{}
);
const props = withDefaults(
defineProps<{
// 选中的角色
selection?: [];
website?: CmsWebsite;
count?: 0;
}>(),
{}
);
const emit = defineEmits<{
(e: 'add'): void;
}>();
const emit = defineEmits<{
(e: 'add'): void;
}>();
const add = () => {
emit('add');
};
const add = () => {
emit('add');
};
// 清除缓存
const clearSiteInfoCache = () => {
removeSiteInfoCache('SiteInfo:' + localStorage.getItem('TenantId') + "*").then(
(msg) => {
// 清除缓存
const clearSiteInfoCache = () => {
removeSiteInfoCache(
'SiteInfo:' + localStorage.getItem('TenantId') + '*'
).then((msg) => {
if (msg) {
message.success(msg);
}
});
};
nextTick(() => {
if (localStorage.getItem('NotActive')) {
// IsActive.value = false
}
});
watch(
() => props.selection,
() => {}
);
};
nextTick(() => {
if(localStorage.getItem('NotActive')){
// IsActive.value = false
}
})
watch(
() => props.selection,
() => {
}
);
</script>

View File

@@ -133,151 +133,150 @@
</template>
<script lang="ts" setup>
import {ref, reactive, watch} from 'vue';
import {Form, message} from 'ant-design-vue';
import {assignObject, uuid} from 'ele-admin-pro';
import {addBszxBm, updateBszxBm} from '@/api/bszx/bszxBm';
import {BszxBm} from '@/api/bszx/bszxBm/model';
import {useThemeStore} from '@/store/modules/theme';
import {storeToRefs} from 'pinia';
import {ItemType} from 'ele-admin-pro/es/ele-image-upload/types';
import {FormInstance} from 'ant-design-vue/es/form';
import { ref, reactive, watch } from 'vue';
import { Form, message } from 'ant-design-vue';
import { assignObject, uuid } from 'ele-admin-pro';
import { addBszxBm, updateBszxBm } from '@/api/bszx/bszxBm';
import { BszxBm } from '@/api/bszx/bszxBm/model';
import { useThemeStore } from '@/store/modules/theme';
import { storeToRefs } from 'pinia';
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
import { FormInstance } from 'ant-design-vue/es/form';
// 是否是修改
const isUpdate = ref(false);
const useForm = Form.useForm;
// 是否开启响应式布局
const themeStore = useThemeStore();
const {styleResponsive} = storeToRefs(themeStore);
// 是否是修改
const isUpdate = ref(false);
const useForm = Form.useForm;
// 是否开启响应式布局
const themeStore = useThemeStore();
const { styleResponsive } = storeToRefs(themeStore);
const props = defineProps<{
// 弹窗是否打开
visible: boolean;
// 修改回显的数据
data?: BszxBm | null;
}>();
const props = defineProps<{
// 弹窗是否打开
visible: boolean;
// 修改回显的数据
data?: BszxBm | null;
}>();
const emit = defineEmits<{
(e: 'done'): void;
(e: 'update:visible', visible: boolean): void;
}>();
const emit = defineEmits<{
(e: 'done'): void;
(e: 'update:visible', visible: boolean): void;
}>();
// 提交状态
const loading = ref(false);
// 是否显示最大化切换按钮
const maxable = ref(true);
// 表格选中数据
const formRef = ref<FormInstance | null>(null);
const images = ref<ItemType[]>([]);
// 提交状态
const loading = ref(false);
// 是否显示最大化切换按钮
const maxable = ref(true);
// 表格选中数据
const formRef = ref<FormInstance | null>(null);
const images = ref<ItemType[]>([]);
// 用户信息
const form = reactive<BszxBm>({
id: undefined,
name: undefined,
sex: undefined,
sexName: undefined,
phone: undefined,
mobile: undefined,
className: undefined,
gradeName: undefined,
address: undefined,
workUnit: undefined,
position: undefined,
present: undefined,
age: undefined,
number: undefined,
extra: undefined,
certificate: undefined,
dateTime: undefined,
formData: undefined,
formId: undefined,
userId: undefined,
comments: undefined,
status: undefined,
deleted: undefined,
tenantId: undefined,
createTime: undefined,
sortNumber: 100
});
// 用户信息
const form = reactive<BszxBm>({
id: undefined,
name: undefined,
sex: undefined,
sexName: undefined,
phone: undefined,
mobile: undefined,
className: undefined,
gradeName: undefined,
address: undefined,
workUnit: undefined,
position: undefined,
present: undefined,
age: undefined,
number: undefined,
extra: undefined,
certificate: undefined,
dateTime: undefined,
formData: undefined,
formId: undefined,
userId: undefined,
comments: undefined,
status: undefined,
deleted: undefined,
tenantId: undefined,
createTime: undefined,
sortNumber: 100
});
/* 更新visible */
const updateVisible = (value: boolean) => {
emit('update:visible', value);
};
/* 更新visible */
const updateVisible = (value: boolean) => {
emit('update:visible', value);
};
// 表单验证规则
const rules = reactive({
appBszxBmName: [
{
required: true,
type: 'string',
message: '请填写应用-百色中学-报名记录名称',
trigger: 'blur'
}
]
});
const chooseSex = (data: any) => {
form.sex = data.key;
form.sexName = data.label;
};
const {resetFields} = useForm(form, rules);
/* 保存编辑 */
const save = () => {
if (!formRef.value) {
return;
}
formRef.value
.validate()
.then(() => {
loading.value = true;
const formData = {
...form
};
const saveOrUpdate = isUpdate.value ? updateBszxBm : addBszxBm;
saveOrUpdate(formData)
.then((msg) => {
loading.value = false;
message.success(msg);
updateVisible(false);
emit('done');
})
.catch((e) => {
loading.value = false;
message.error(e.message);
});
})
.catch(() => {
});
};
watch(
() => props.visible,
(visible) => {
if (visible) {
images.value = [];
if (props.data) {
assignObject(form, props.data);
if(props.data.sex){
form.sexName = props.data.sexName;
}
if (props.data.image) {
images.value.push({
uid: uuid(),
url: props.data.image,
status: 'done'
})
}
isUpdate.value = true;
} else {
isUpdate.value = false;
// 表单验证规则
const rules = reactive({
appBszxBmName: [
{
required: true,
type: 'string',
message: '请填写应用-百色中学-报名记录名称',
trigger: 'blur'
}
} else {
resetFields();
]
});
const chooseSex = (data: any) => {
form.sex = data.key;
form.sexName = data.label;
};
const { resetFields } = useForm(form, rules);
/* 保存编辑 */
const save = () => {
if (!formRef.value) {
return;
}
},
{immediate: true}
);
formRef.value
.validate()
.then(() => {
loading.value = true;
const formData = {
...form
};
const saveOrUpdate = isUpdate.value ? updateBszxBm : addBszxBm;
saveOrUpdate(formData)
.then((msg) => {
loading.value = false;
message.success(msg);
updateVisible(false);
emit('done');
})
.catch((e) => {
loading.value = false;
message.error(e.message);
});
})
.catch(() => {});
};
watch(
() => props.visible,
(visible) => {
if (visible) {
images.value = [];
if (props.data) {
assignObject(form, props.data);
if (props.data.sex) {
form.sexName = props.data.sexName;
}
if (props.data.image) {
images.value.push({
uid: uuid(),
url: props.data.image,
status: 'done'
});
}
isUpdate.value = true;
} else {
isUpdate.value = false;
}
} else {
resetFields();
}
},
{ immediate: true }
);
</script>

View File

@@ -1,12 +1,12 @@
<!-- 搜索表单 -->
<template>
<a-space :size="10" style="flex-wrap: wrap">
<!-- <a-button type="primary" class="ele-btn-icon" @click="add">-->
<!-- <template #icon>-->
<!-- <PlusOutlined />-->
<!-- </template>-->
<!-- <span>添加</span>-->
<!-- </a-button>-->
<!-- <a-button type="primary" class="ele-btn-icon" @click="add">-->
<!-- <template #icon>-->
<!-- <PlusOutlined />-->
<!-- </template>-->
<!-- <span>添加</span>-->
<!-- </a-button>-->
<a-radio-group v-model:value="where.branchId" @change="reload">
<a-radio-button :value="1">初中部</a-radio-button>
<a-radio-button :value="2">高中部</a-radio-button>
@@ -20,7 +20,7 @@
placeholder="选择年级"
:options="gradeList"
@change="onGrade"
></a-select>
/>
<a-select
v-if="where.gradeName"
show-search
@@ -29,7 +29,7 @@
placeholder="选择年级"
:options="classList"
@change="onClass"
></a-select>
/>
<a-input-search
allow-clear
placeholder="请输入关键词"
@@ -42,183 +42,179 @@
</template>
<script lang="ts" setup>
import {ref, watch} from 'vue';
import {utils, writeFile} from 'xlsx';
import dayjs from 'dayjs';
import {message} from 'ant-design-vue';
import {BszxBm, BszxBmParam} from "@/api/bszx/bszxBm/model";
import useSearch from "@/utils/use-search";
import {listBszxBm} from "@/api/bszx/bszxBm";
import {BszxClassParam} from "@/api/bszx/bszxClass/model";
import {listBszxGrade} from "@/api/bszx/bszxGrade";
import {listBszxClass} from "@/api/bszx/bszxClass";
import { PlusOutlined } from '@ant-design/icons-vue';
import { ref, watch } from 'vue';
import { utils, writeFile } from 'xlsx';
import dayjs from 'dayjs';
import { message } from 'ant-design-vue';
import { BszxBm, BszxBmParam } from '@/api/bszx/bszxBm/model';
import useSearch from '@/utils/use-search';
import { listBszxBm } from '@/api/bszx/bszxBm';
import { BszxClassParam } from '@/api/bszx/bszxClass/model';
import { listBszxGrade } from '@/api/bszx/bszxGrade';
import { listBszxClass } from '@/api/bszx/bszxClass';
import { PlusOutlined } from '@ant-design/icons-vue';
const props = withDefaults(
defineProps<{
// 选中的角色
selection?: [];
}>(),
{}
);
const props = withDefaults(
defineProps<{
// 选中的角色
selection?: [];
}>(),
{}
);
const emit = defineEmits<{
(e: 'search', where?: BszxBmParam): void;
(e: 'add'): void;
(e: 'remove'): void;
(e: 'batchMove'): void;
}>();
const emit = defineEmits<{
(e: 'search', where?: BszxBmParam): void;
(e: 'add'): void;
(e: 'remove'): void;
(e: 'batchMove'): void;
}>();
// 表单数据
const {where} = useSearch<BszxBmParam>({
id: undefined,
keywords: '',
className: undefined,
classId: undefined,
userId: undefined
});
// 表单数据
const { where } = useSearch<BszxBmParam>({
id: undefined,
keywords: '',
className: undefined,
classId: undefined,
userId: undefined
});
// 变量
const loading = ref(false);
const bmList = ref<BszxBm[]>([])
const xlsFileName = ref<string>();
const gradeId = ref<number>();
const gradeList = ref<BszxClassParam[]>([]);
const classList = ref<BszxClassParam[]>([]);
// 变量
const loading = ref(false);
const bmList = ref<BszxBm[]>([]);
const xlsFileName = ref<string>();
const gradeId = ref<number>();
const gradeList = ref<BszxClassParam[]>([]);
const classList = ref<BszxClassParam[]>([]);
const reload = () => {
emit('search', where);
};
const reload = () => {
emit('search', where);
};
// 新增
const add = () => {
emit('add');
};
// 新增
const add = () => {
emit('add');
};
const getGradeList = () => {
listBszxGrade({branch: where.branchId}).then(res => {
gradeList.value = res.map(d => {
d.value = Number(d.id);
d.label = d.name;
return d;
});
})
};
const getClassList = () => {
listBszxClass({gradeId: gradeId.value}).then(res => {
classList.value = res.map(d => {
d.value = Number(d.id);
d.label = d.name;
return d;
});
})
}
const onGrade = (gradeName: number, item: any) => {
where.gradeName = item.name;
if(gradeName){
console.log(item)
gradeId.value = item.id;
getClassList();
}
emit('search', where);
}
const onClass = (classId,item) => {
console.log(classId);
where.className = item.name;
reload();
}
// 导出
const handleExport = async () => {
loading.value = true;
const array: (string | number)[][] = [
[
'用户ID',
'姓名',
'性别',
'手机号码',
'班级',
'年级',
'居住地址',
'工作单位',
'职务',
'是否能到场',
'邀请函',
'报名时间'
]
];
// 按搜索结果导出
where.sceneType = 'Content';
await listBszxBm(where)
.then((list) => {
bmList.value = list;
list?.forEach((d: BszxBm) => {
array.push([
`${d.userId}`,
`${d.name}`,
`${d.sex}`,
`${d.phone}`,
`${d.className}`,
`${d.gradeName}`,
`${d.address}`,
`${d.workUnit}`,
`${d.position}`,
`${d.present}`,
`${d.certificate}`,
`${d.createTime}`
]);
const getGradeList = () => {
listBszxGrade({ branch: where.branchId }).then((res) => {
gradeList.value = res.map((d) => {
d.value = Number(d.id);
d.label = d.name;
return d;
});
const sheetName = `导出报名列表${dayjs(new Date()).format('YYYYMMDD')}`;
const workbook = {
SheetNames: [sheetName],
Sheets: {}
};
const sheet = utils.aoa_to_sheet(array);
workbook.Sheets[sheetName] = sheet;
// 设置列宽
sheet['!cols'] = [
{wch: 10},
{wch: 40},
{wch: 20},
{wch: 20},
{wch: 60},
{wch: 15},
{wch: 10},
{wch: 10},
{wch: 20},
{wch: 10},
{wch: 20}
];
message.loading('正在导出...');
setTimeout(() => {
writeFile(
workbook,
`${
where.createTimeEnd ? xlsFileName.value + '_' : ''
}${sheetName}.xlsx`
);
loading.value = false;
}, 1000);
})
.catch((msg) => {
message.error(msg);
loading.value = false;
})
.finally(() => {
});
};
};
const getClassList = () => {
listBszxClass({ gradeId: gradeId.value }).then((res) => {
classList.value = res.map((d) => {
d.value = Number(d.id);
d.label = d.name;
return d;
});
});
};
const onGrade = (gradeName: number, item: any) => {
where.gradeName = item.name;
if (gradeName) {
console.log(item);
gradeId.value = item.id;
getClassList();
}
emit('search', where);
};
getGradeList();
const onClass = (classId, item) => {
console.log(classId);
where.className = item.name;
reload();
};
watch(
() => props.selection,
() => {
}
);
// 导出
const handleExport = async () => {
loading.value = true;
const array: (string | number)[][] = [
[
'用户ID',
'姓名',
'性别',
'手机号码',
'班级',
'年级',
'居住地址',
'工作单位',
'职务',
'是否能到场',
'邀请函',
'报名时间'
]
];
// 按搜索结果导出
where.sceneType = 'Content';
await listBszxBm(where)
.then((list) => {
bmList.value = list;
list?.forEach((d: BszxBm) => {
array.push([
`${d.userId}`,
`${d.name}`,
`${d.sex}`,
`${d.phone}`,
`${d.className}`,
`${d.gradeName}`,
`${d.address}`,
`${d.workUnit}`,
`${d.position}`,
`${d.present}`,
`${d.certificate}`,
`${d.createTime}`
]);
});
const sheetName = `导出报名列表${dayjs(new Date()).format('YYYYMMDD')}`;
const workbook = {
SheetNames: [sheetName],
Sheets: {}
};
const sheet = utils.aoa_to_sheet(array);
workbook.Sheets[sheetName] = sheet;
// 设置列宽
sheet['!cols'] = [
{ wch: 10 },
{ wch: 40 },
{ wch: 20 },
{ wch: 20 },
{ wch: 60 },
{ wch: 15 },
{ wch: 10 },
{ wch: 10 },
{ wch: 20 },
{ wch: 10 },
{ wch: 20 }
];
message.loading('正在导出...');
setTimeout(() => {
writeFile(
workbook,
`${
where.createTimeEnd ? xlsFileName.value + '_' : ''
}${sheetName}.xlsx`
);
loading.value = false;
}, 1000);
})
.catch((msg) => {
message.error(msg);
loading.value = false;
})
.finally(() => {});
};
getGradeList();
watch(
() => props.selection,
() => {}
);
</script>

View File

@@ -1,7 +1,7 @@
<template>
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
<template #extra>
<!-- <Extra/>-->
<!-- <Extra/>-->
</template>
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-pro-table
@@ -25,7 +25,7 @@
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'name'">
<a-space>
<a-avatar :src="record.avatar"/>
<a-avatar :src="record.avatar" />
<span>{{ record.name }}</span>
</a-space>
</template>
@@ -58,249 +58,253 @@
</a-card>
<!-- 编辑弹窗 -->
<bszxBmEdit v-model:visible="showEdit" :data="current" @done="reload"/>
<bszxBmEdit v-model:visible="showEdit" :data="current" @done="reload" />
</a-page-header>
</template>
<script lang="ts" setup>
import {createVNode, ref} from 'vue';
import {message, Modal} from 'ant-design-vue';
import {ExclamationCircleOutlined} from '@ant-design/icons-vue';
import type {EleProTable} from 'ele-admin-pro';
import type {
DatasourceFunction,
ColumnItem
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue';
import BszxBmEdit from './components/bszxBmEdit.vue';
import {pageBszxBm, removeBszxBm, removeBatchBszxBm} from '@/api/bszx/bszxBm';
import type {BszxBm, BszxBmParam} from '@/api/bszx/bszxBm/model';
import {getPageTitle} from "@/utils/common";
import Extra from "@/views/bszx/extra.vue";
import { createVNode, ref } from 'vue';
import { message, Modal } from 'ant-design-vue';
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
import type { EleProTable } from 'ele-admin-pro';
import type {
DatasourceFunction,
ColumnItem
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue';
import BszxBmEdit from './components/bszxBmEdit.vue';
import {
pageBszxBm,
removeBszxBm,
removeBatchBszxBm
} from '@/api/bszx/bszxBm';
import type { BszxBm, BszxBmParam } from '@/api/bszx/bszxBm/model';
import { getPageTitle } from '@/utils/common';
import Extra from '@/views/bszx/extra.vue';
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
// 表格选中数据
const selection = ref<BszxBm[]>([]);
// 当前编辑数据
const current = ref<BszxBm | null>(null);
// 是否显示编辑弹窗
const showEdit = ref(false);
// 是否显示批量移动弹窗
const showMove = ref(false);
// 加载状态
const loading = ref(true);
// 表格选中数据
const selection = ref<BszxBm[]>([]);
// 当前编辑数据
const current = ref<BszxBm | null>(null);
// 是否显示编辑弹窗
const showEdit = ref(false);
// 是否显示批量移动弹窗
const showMove = ref(false);
// 加载状态
const loading = ref(true);
// 表格数据源
const datasource: DatasourceFunction = ({
page,
limit,
where,
orders,
filters
}) => {
// if (filters) {
// where.status = filters.status;
// }
return pageBszxBm({
...where,
...orders,
// 表格数据源
const datasource: DatasourceFunction = ({
page,
limit
});
};
// 表格列配置
const columns = ref<ColumnItem[]>([
{
key: 'index',
width: 90,
align: 'center',
fixed: 'left',
hideInSetting: true,
customRender: ({index}) => index + (tableRef.value?.tableIndex ?? 0)
},
{
title: '类型',
dataIndex: 'type',
key: 'type',
width: 120,
align: 'center',
customRender: ({text}) => ['校友', '单位', '爱心人士'][text]
},
{
title: '姓名',
dataIndex: 'name',
key: 'name',
width: 120
},
{
title: '手机号码',
dataIndex: 'mobile',
key: 'mobile',
width: 130,
align: 'center',
},
{
title: '性别',
dataIndex: 'sex',
key: 'sex',
width: 90,
align: 'center',
customRender: ({text}) => ['', '男', '女'][text]
},
{
title: '分部',
dataIndex: 'branchName',
key: 'branchName',
align: 'center',
},
{
title: '年级',
dataIndex: 'gradeName',
key: 'gradeName',
align: 'center',
},
{
title: '班级',
dataIndex: 'className',
key: 'className',
align: 'center',
},
{
title: '居住地址',
dataIndex: 'address',
key: 'address',
align: 'center',
},
{
title: '工作单位',
dataIndex: 'workUnit',
key: 'workUnit',
align: 'center',
},
{
title: '职务',
dataIndex: 'position',
key: 'position',
align: 'center',
},
{
title: '是否能到场',
dataIndex: 'present',
key: 'present',
align: 'center',
},
// {
// title: '状态',
// dataIndex: 'status',
// key: 'status',
// align: 'center',
// },
{
title: '报名时间',
dataIndex: 'createTime',
key: 'createTime',
width: 180,
align: 'center',
sorter: true,
ellipsis: true
},
{
title: '操作',
key: 'action',
width: 120,
fixed: 'right',
align: 'center',
hideInSetting: true
}
]);
/* 搜索 */
const reload = (where?: BszxBmParam) => {
selection.value = [];
tableRef?.value?.reload({where: where});
};
/* 打开编辑弹窗 */
const openEdit = (row?: BszxBm) => {
current.value = row ?? null;
showEdit.value = true;
};
/* 打开批量移动弹窗 */
const openMove = () => {
showMove.value = true;
};
/* 删除单个 */
const remove = (row: BszxBm) => {
const hide = message.loading('请求中..', 0);
removeBszxBm(row.id)
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
limit,
where,
orders,
filters
}) => {
// if (filters) {
// where.status = filters.status;
// }
return pageBszxBm({
...where,
...orders,
page,
limit
});
};
/* 批量删除 */
const removeBatch = () => {
if (!selection.value.length) {
message.error('请至少选择一条数据');
return;
}
Modal.confirm({
title: '提示',
content: '确定要删除选中的记录吗?',
icon: createVNode(ExclamationCircleOutlined),
maskClosable: true,
onOk: () => {
const hide = message.loading('请求中..', 0);
removeBatchBszxBm(selection.value.map((d) => d.id))
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
}
});
};
/* 查询 */
const query = () => {
loading.value = true;
};
/* 自定义行属性 */
const customRow = (record: BszxBm) => {
return {
// 行点击事件
onClick: () => {
// console.log(record);
},
// 行双击事件
onDblclick: () => {
openEdit(record);
}
};
};
query();
// 表格列配置
const columns = ref<ColumnItem[]>([
{
key: 'index',
width: 90,
align: 'center',
fixed: 'left',
hideInSetting: true,
customRender: ({ index }) => index + (tableRef.value?.tableIndex ?? 0)
},
{
title: '类型',
dataIndex: 'type',
key: 'type',
width: 120,
align: 'center',
customRender: ({ text }) => ['校友', '单位', '爱心人士'][text]
},
{
title: '姓名',
dataIndex: 'name',
key: 'name',
width: 120
},
{
title: '手机号码',
dataIndex: 'mobile',
key: 'mobile',
width: 130,
align: 'center'
},
{
title: '性别',
dataIndex: 'sex',
key: 'sex',
width: 90,
align: 'center',
customRender: ({ text }) => ['', '男', '女'][text]
},
{
title: '分部',
dataIndex: 'branchName',
key: 'branchName',
align: 'center'
},
{
title: '年级',
dataIndex: 'gradeName',
key: 'gradeName',
align: 'center'
},
{
title: '班级',
dataIndex: 'className',
key: 'className',
align: 'center'
},
{
title: '居住地址',
dataIndex: 'address',
key: 'address',
align: 'center'
},
{
title: '工作单位',
dataIndex: 'workUnit',
key: 'workUnit',
align: 'center'
},
{
title: '职务',
dataIndex: 'position',
key: 'position',
align: 'center'
},
{
title: '是否能到场',
dataIndex: 'present',
key: 'present',
align: 'center'
},
// {
// title: '状态',
// dataIndex: 'status',
// key: 'status',
// align: 'center',
// },
{
title: '报名时间',
dataIndex: 'createTime',
key: 'createTime',
width: 180,
align: 'center',
sorter: true,
ellipsis: true
},
{
title: '操作',
key: 'action',
width: 120,
fixed: 'right',
align: 'center',
hideInSetting: true
}
]);
/* 搜索 */
const reload = (where?: BszxBmParam) => {
selection.value = [];
tableRef?.value?.reload({ where: where });
};
/* 打开编辑弹窗 */
const openEdit = (row?: BszxBm) => {
current.value = row ?? null;
showEdit.value = true;
};
/* 打开批量移动弹窗 */
const openMove = () => {
showMove.value = true;
};
/* 删除单个 */
const remove = (row: BszxBm) => {
const hide = message.loading('请求中..', 0);
removeBszxBm(row.id)
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
};
/* 批量删除 */
const removeBatch = () => {
if (!selection.value.length) {
message.error('请至少选择一条数据');
return;
}
Modal.confirm({
title: '提示',
content: '确定要删除选中的记录吗?',
icon: createVNode(ExclamationCircleOutlined),
maskClosable: true,
onOk: () => {
const hide = message.loading('请求中..', 0);
removeBatchBszxBm(selection.value.map((d) => d.id))
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
}
});
};
/* 查询 */
const query = () => {
loading.value = true;
};
/* 自定义行属性 */
const customRow = (record: BszxBm) => {
return {
// 行点击事件
onClick: () => {
// console.log(record);
},
// 行双击事件
onDblclick: () => {
openEdit(record);
}
};
};
query();
</script>
<script lang="ts">
export default {
name: 'BszxBm'
};
export default {
name: 'BszxBm'
};
</script>
<style lang="less" scoped></style>

View File

@@ -159,12 +159,12 @@
images.value = [];
if (props.data) {
assignObject(form, props.data);
if(props.data.image){
if (props.data.image) {
images.value.push({
uid: uuid(),
url: props.data.image,
status: 'done'
})
});
}
isUpdate.value = true;
} else {

View File

@@ -45,7 +45,11 @@
</a-card>
<!-- 编辑弹窗 -->
<BszxBranchEdit v-model:visible="showEdit" :data="current" @done="reload" />
<BszxBranchEdit
v-model:visible="showEdit"
:data="current"
@done="reload"
/>
</div>
</div>
</template>
@@ -62,8 +66,15 @@
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue';
import BszxBranchEdit from './components/bszxBranchEdit.vue';
import { pageBszxBranch, removeBszxBranch, removeBatchBszxBranch } from '@/api/bszx/bszxBranch';
import type { BszxBranch, BszxBranchParam } from '@/api/bszx/bszxBranch/model';
import {
pageBszxBranch,
removeBszxBranch,
removeBatchBszxBranch
} from '@/api/bszx/bszxBranch';
import type {
BszxBranch,
BszxBranchParam
} from '@/api/bszx/bszxBranch/model';
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
@@ -105,19 +116,19 @@
dataIndex: 'id',
key: 'id',
align: 'center',
width: 90,
width: 90
},
{
title: '分部名称 ',
dataIndex: 'name',
key: 'name',
align: 'center',
align: 'center'
},
{
title: '排序(数字越小越靠前)',
dataIndex: 'sortNumber',
key: 'sortNumber',
align: 'center',
align: 'center'
},
{
title: '操作',

View File

@@ -33,7 +33,7 @@
style="width: 200px"
:options="options"
@change="handleChange"
></a-select>
/>
</a-form-item>
<a-form-item label="班级" name="name">
<a-input
@@ -74,8 +74,8 @@
import { storeToRefs } from 'pinia';
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
import { FormInstance } from 'ant-design-vue/es/form';
import {BszxGrade} from "@/api/bszx/bszxGrade/model";
import {listBszxGrade} from "@/api/bszx/bszxGrade";
import { BszxGrade } from '@/api/bszx/bszxGrade/model';
import { listBszxGrade } from '@/api/bszx/bszxGrade';
// 是否是修改
const isUpdate = ref(false);
@@ -143,17 +143,17 @@
const handleBranch = () => {
getBszxGradeList();
}
};
const getBszxGradeList = () => {
listBszxGrade({branch: form.branch}).then((list) => {
options.value = list.map(d => {
listBszxGrade({ branch: form.branch }).then((list) => {
options.value = list.map((d) => {
d.value = d.name;
d.label = d.name;
return d;
});
})
}
});
};
const { resetFields } = useForm(form, rules);
/* 保存编辑 */
@@ -188,7 +188,7 @@
() => props.visible,
(visible) => {
if (visible) {
getBszxGradeList()
getBszxGradeList();
images.value = [];
if (props.data) {
assignObject(form, props.data);

View File

@@ -3,7 +3,7 @@
<a-space :size="10" style="flex-wrap: wrap">
<a-button type="primary" class="ele-btn-icon" @click="add">
<template #icon>
<PlusOutlined/>
<PlusOutlined />
</template>
<span>添加</span>
</a-button>
@@ -18,7 +18,7 @@
placeholder="选择年级"
:options="gradeList"
@change="onGrade"
></a-select>
/>
<a-input-search
allow-clear
placeholder="请输入关键词"
@@ -31,72 +31,70 @@
</template>
<script lang="ts" setup>
import {PlusOutlined} from '@ant-design/icons-vue';
import {watch,ref} from 'vue';
import useSearch from "@/utils/use-search";
import {BszxClassParam} from "@/api/bszx/bszxClass/model";
import {listBszxGrade} from "@/api/bszx/bszxGrade";
import { PlusOutlined } from '@ant-design/icons-vue';
import { watch, ref } from 'vue';
import useSearch from '@/utils/use-search';
import { BszxClassParam } from '@/api/bszx/bszxClass/model';
import { listBszxGrade } from '@/api/bszx/bszxGrade';
const props = withDefaults(
defineProps<{
// 选中的角色
selection?: [];
}>(),
{}
);
const props = withDefaults(
defineProps<{
// 选中的角色
selection?: [];
}>(),
{}
);
const gradeList = ref<BszxClassParam[]>([]);
const gradeList = ref<BszxClassParam[]>([]);
const emit = defineEmits<{
(e: 'search', where?: BszxClassParam): void;
(e: 'add'): void;
(e: 'remove'): void;
(e: 'batchMove'): void;
}>();
const emit = defineEmits<{
(e: 'search', where?: BszxClassParam): void;
(e: 'add'): void;
(e: 'remove'): void;
(e: 'batchMove'): void;
}>();
// 表单数据
const { where, resetFields } = useSearch<BszxClassParam>({
gradeId: undefined,
eraId: undefined,
branch: undefined,
keywords: ''
});
// 表单数据
const {where, resetFields} = useSearch<BszxClassParam>({
gradeId: undefined,
eraId: undefined,
branch: undefined,
keywords: ''
});
// 新增
const add = () => {
emit('add');
};
// 新增
const add = () => {
emit('add');
};
const handleSearch = () => {
emit('search', where);
};
const handleSearch = () => {
emit('search', where);
}
/* 重置 */
const reset = () => {
resetFields();
handleSearch();
};
/* 重置 */
const reset = () => {
resetFields();
handleSearch();
};
const onGrade = (gradeId: number) => {
where.gradeId = gradeId;
handleSearch();
};
const onGrade = (gradeId: number) => {
where.gradeId = gradeId;
handleSearch();
}
const reload = () => {
listBszxGrade({}).then(res => {
gradeList.value = res.map(d => {
d.value = Number(d.id);
d.label = d.name;
return d;
const reload = () => {
listBszxGrade({}).then((res) => {
gradeList.value = res.map((d) => {
d.value = Number(d.id);
d.label = d.name;
return d;
});
});
})
}
reload();
watch(
() => props.selection,
() => {
},
{ immediate: true }
);
};
reload();
watch(
() => props.selection,
() => {},
{ immediate: true }
);
</script>

View File

@@ -1,18 +1,8 @@
<template>
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
<template #extra>
<a-button
type="text"
@click="openUrl('/bszx/grade')"
>年级设置
</a-button
>
<a-button
type="text"
@click="openUrl('/bszx/class')"
>班级设置
</a-button
>
<a-button type="text" @click="openUrl('/bszx/grade')">年级设置 </a-button>
<a-button type="text" @click="openUrl('/bszx/class')">班级设置 </a-button>
</template>
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-pro-table
@@ -35,7 +25,7 @@
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'image'">
<a-image :src="record.image" :width="50"/>
<a-image :src="record.image" :width="50" />
</template>
<template v-if="column.key === 'era'">
<span>{{ record.era }}</span>
@@ -47,7 +37,7 @@
<template v-if="column.key === 'action'">
<a-space>
<a @click="openEdit(record)">修改</a>
<a-divider type="vertical"/>
<a-divider type="vertical" />
<a-popconfirm
title="确定要删除此记录吗?"
@confirm="remove(record)"
@@ -61,184 +51,188 @@
</a-card>
<!-- 编辑弹窗 -->
<BszxClassEdit v-model:visible="showEdit" :data="current" @done="reload"/>
<BszxClassEdit v-model:visible="showEdit" :data="current" @done="reload" />
</a-page-header>
</template>
<script lang="ts" setup>
import {createVNode, ref} from 'vue';
import {message, Modal} from 'ant-design-vue';
import {ExclamationCircleOutlined} from '@ant-design/icons-vue';
import type {EleProTable} from 'ele-admin-pro';
import type {
DatasourceFunction,
ColumnItem
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue';
import BszxClassEdit from './components/bszxClassEdit.vue';
import {pageBszxClass, removeBszxClass, removeBatchBszxClass} from '@/api/bszx/bszxClass';
import type {BszxClass, BszxClassParam} from '@/api/bszx/bszxClass/model';
import {getPageTitle, openUrl} from "@/utils/common";
import { createVNode, ref } from 'vue';
import { message, Modal } from 'ant-design-vue';
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
import type { EleProTable } from 'ele-admin-pro';
import type {
DatasourceFunction,
ColumnItem
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue';
import BszxClassEdit from './components/bszxClassEdit.vue';
import {
pageBszxClass,
removeBszxClass,
removeBatchBszxClass
} from '@/api/bszx/bszxClass';
import type { BszxClass, BszxClassParam } from '@/api/bszx/bszxClass/model';
import { getPageTitle, openUrl } from '@/utils/common';
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
// 表格选中数据
const selection = ref<BszxClass[]>([]);
// 当前编辑数据
const current = ref<BszxClass | null>(null);
// 是否显示编辑弹窗
const showEdit = ref(false);
// 是否显示批量移动弹窗
const showMove = ref(false);
// 加载状态
const loading = ref(true);
// 表格选中数据
const selection = ref<BszxClass[]>([]);
// 当前编辑数据
const current = ref<BszxClass | null>(null);
// 是否显示编辑弹窗
const showEdit = ref(false);
// 是否显示批量移动弹窗
const showMove = ref(false);
// 加载状态
const loading = ref(true);
// 表格数据源
const datasource: DatasourceFunction = ({
page,
limit,
where,
orders,
filters
}) => {
if (filters) {
where.status = filters.status;
}
return pageBszxClass({
...where,
...orders,
// 表格数据源
const datasource: DatasourceFunction = ({
page,
limit
});
};
// 表格列配置
const columns = ref<ColumnItem[]>([
{
title: 'ID',
dataIndex: 'id',
key: 'id',
width: 120,
},
{
title: '初高中',
dataIndex: 'branch',
key: 'branch',
width: 120,
customRender: ({ text }) => ['','初中','高中'][text]
},
{
title: '年级',
dataIndex: 'gradeName',
key: 'gradeName',
width: 120
},
// {
// title: '年级',
// dataIndex: 'gradeId',
// key: 'gradeId',
// width: 120
// },
{
title: '班级',
dataIndex: 'name',
key: 'name'
},
{
title: '操作',
key: 'action',
width: 180,
fixed: 'right',
align: 'center',
hideInSetting: true
}
]);
/* 搜索 */
const reload = (where?: BszxClassParam) => {
selection.value = [];
tableRef?.value?.reload({where: where});
};
/* 打开编辑弹窗 */
const openEdit = (row?: BszxClass) => {
current.value = row ?? null;
showEdit.value = true;
};
/* 打开批量移动弹窗 */
const openMove = () => {
showMove.value = true;
};
/* 删除单个 */
const remove = (row: BszxClass) => {
const hide = message.loading('请求中..', 0);
removeBszxClass(row.id)
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
limit,
where,
orders,
filters
}) => {
if (filters) {
where.status = filters.status;
}
return pageBszxClass({
...where,
...orders,
page,
limit
});
};
/* 批量删除 */
const removeBatch = () => {
if (!selection.value.length) {
message.error('请至少选择一条数据');
return;
}
Modal.confirm({
title: '提示',
content: '确定要删除选中的记录吗?',
icon: createVNode(ExclamationCircleOutlined),
maskClosable: true,
onOk: () => {
const hide = message.loading('请求中..', 0);
removeBatchBszxClass(selection.value.map((d) => d.id))
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
}
});
};
/* 查询 */
const query = () => {
loading.value = true;
};
/* 自定义行属性 */
const customRow = (record: BszxClass) => {
return {
// 行点击事件
onClick: () => {
// console.log(record);
},
// 行双击事件
onDblclick: () => {
openEdit(record);
}
};
};
query();
// 表格列配置
const columns = ref<ColumnItem[]>([
{
title: 'ID',
dataIndex: 'id',
key: 'id',
width: 120
},
{
title: '初高中',
dataIndex: 'branch',
key: 'branch',
width: 120,
customRender: ({ text }) => ['', '初中', '高中'][text]
},
{
title: '年级',
dataIndex: 'gradeName',
key: 'gradeName',
width: 120
},
// {
// title: '年级',
// dataIndex: 'gradeId',
// key: 'gradeId',
// width: 120
// },
{
title: '班级',
dataIndex: 'name',
key: 'name'
},
{
title: '操作',
key: 'action',
width: 180,
fixed: 'right',
align: 'center',
hideInSetting: true
}
]);
/* 搜索 */
const reload = (where?: BszxClassParam) => {
selection.value = [];
tableRef?.value?.reload({ where: where });
};
/* 打开编辑弹窗 */
const openEdit = (row?: BszxClass) => {
current.value = row ?? null;
showEdit.value = true;
};
/* 打开批量移动弹窗 */
const openMove = () => {
showMove.value = true;
};
/* 删除单个 */
const remove = (row: BszxClass) => {
const hide = message.loading('请求中..', 0);
removeBszxClass(row.id)
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
};
/* 批量删除 */
const removeBatch = () => {
if (!selection.value.length) {
message.error('请至少选择一条数据');
return;
}
Modal.confirm({
title: '提示',
content: '确定要删除选中的记录吗?',
icon: createVNode(ExclamationCircleOutlined),
maskClosable: true,
onOk: () => {
const hide = message.loading('请求中..', 0);
removeBatchBszxClass(selection.value.map((d) => d.id))
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
}
});
};
/* 查询 */
const query = () => {
loading.value = true;
};
/* 自定义行属性 */
const customRow = (record: BszxClass) => {
return {
// 行点击事件
onClick: () => {
// console.log(record);
},
// 行双击事件
onDblclick: () => {
openEdit(record);
}
};
};
query();
</script>
<script lang="ts">
export default {
name: 'BszxClass'
};
export default {
name: 'BszxClass'
};
</script>
<style lang="less" scoped></style>

View File

@@ -16,9 +16,9 @@
<script lang="ts" setup>
import { PlusOutlined } from '@ant-design/icons-vue';
import useSearch from "@/utils/use-search";
import useSearch from '@/utils/use-search';
import { watch } from 'vue';
import {BszxGradeParam} from "@/api/bszx/bszxGrade/model";
import { BszxGradeParam } from '@/api/bszx/bszxGrade/model';
const props = withDefaults(
defineProps<{
@@ -36,7 +36,7 @@
}>();
// 表单数据
const {where} = useSearch<BszxGradeParam>({
const { where } = useSearch<BszxGradeParam>({
branch: undefined,
keywords: ''
});
@@ -48,7 +48,7 @@
const handleSearch = () => {
emit('search', where);
}
};
watch(
() => props.selection,
() => {}

View File

@@ -1,18 +1,8 @@
<template>
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
<template #extra>
<a-button
type="text"
@click="openUrl('/bszx/grade')"
>年级设置
</a-button
>
<a-button
type="text"
@click="openUrl('/bszx/class')"
>班级设置
</a-button
>
<a-button type="text" @click="openUrl('/bszx/grade')">年级设置 </a-button>
<a-button type="text" @click="openUrl('/bszx/class')">班级设置 </a-button>
</template>
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-pro-table
@@ -73,9 +63,13 @@
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue';
import BszxGradeEdit from './components/bszxGradeEdit.vue';
import { pageBszxGrade, removeBszxGrade, removeBatchBszxGrade } from '@/api/bszx/bszxGrade';
import {
pageBszxGrade,
removeBszxGrade,
removeBatchBszxGrade
} from '@/api/bszx/bszxGrade';
import type { BszxGrade, BszxGradeParam } from '@/api/bszx/bszxGrade/model';
import {getPageTitle, openUrl} from "@/utils/common";
import { getPageTitle, openUrl } from '@/utils/common';
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
@@ -124,7 +118,7 @@
dataIndex: 'branch',
key: 'branch',
width: 120,
customRender: ({ text }) => ['','初中','高中'][text]
customRender: ({ text }) => ['', '初中', '高中'][text]
},
{
title: '年级',
@@ -136,7 +130,7 @@
dataIndex: 'sortNumber',
key: 'sortNumber',
align: 'center',
width: 120,
width: 120
},
{
title: '操作',

View File

@@ -28,7 +28,7 @@
:labelStyle="{ width: '90px', color: '#808080' }"
>
<a-space class="flex items-center">
<a-avatar :src="form.avatar" size="small"/>
<a-avatar :src="form.avatar" size="small" />
{{ form.realName }}
</a-space>
</a-descriptions-item>
@@ -49,7 +49,9 @@
<a-tag v-if="form.orderStatus === 4" color="red">退款申请中</a-tag>
<a-tag v-if="form.orderStatus === 5" color="red">退款被拒绝</a-tag>
<a-tag v-if="form.orderStatus === 6" color="orange">退款成功</a-tag>
<a-tag v-if="form.orderStatus === 7" color="pink">客户端申请退款</a-tag>
<a-tag v-if="form.orderStatus === 7" color="pink"
>客户端申请退款</a-tag
>
</a-descriptions-item>
<!-- 第三排-->
<a-descriptions-item
@@ -108,68 +110,68 @@
<template v-if="form.payStatus == 1">
<a-tag v-if="form.payType == 0">余额支付</a-tag>
<a-tag v-if="form.payType == 1">
<WechatOutlined class="tag-icon"/>
<WechatOutlined class="tag-icon" />
微信支付
</a-tag>
<a-tag v-if="form.payType == 2">积分</a-tag>
<a-tag v-if="form.payType == 3">
<AlipayCircleOutlined class="tag-icon"/>
<AlipayCircleOutlined class="tag-icon" />
支付宝
</a-tag>
<a-tag v-if="form.payType == 4">
<IdcardOutlined class="tag-icon"/>
<IdcardOutlined class="tag-icon" />
现金
</a-tag>
<a-tag v-if="form.payType == 5">
<IdcardOutlined class="tag-icon"/>
<IdcardOutlined class="tag-icon" />
POS机
</a-tag>
<a-tag v-if="form.payType == 6">
<IdcardOutlined class="tag-icon"/>
<IdcardOutlined class="tag-icon" />
VIP月卡
</a-tag>
<a-tag v-if="form.payType == 7">
<IdcardOutlined class="tag-icon"/>
<IdcardOutlined class="tag-icon" />
VIP年卡
</a-tag>
<a-tag v-if="form.payType == 8">
<IdcardOutlined class="tag-icon"/>
<IdcardOutlined class="tag-icon" />
VIP次卡
</a-tag>
<a-tag v-if="form.payType == 9">
<IdcardOutlined class="tag-icon"/>
<IdcardOutlined class="tag-icon" />
IC月卡
</a-tag>
<a-tag v-if="form.payType == 10">
<IdcardOutlined class="tag-icon"/>
<IdcardOutlined class="tag-icon" />
IC年卡
</a-tag>
<a-tag v-if="form.payType == 11">
<IdcardOutlined class="tag-icon"/>
<IdcardOutlined class="tag-icon" />
IC次卡
</a-tag>
<a-tag v-if="form.payType == 12">
<IdcardOutlined class="tag-icon"/>
<IdcardOutlined class="tag-icon" />
免费
</a-tag>
<a-tag v-if="form.payType == 13">
<IdcardOutlined class="tag-icon"/>
<IdcardOutlined class="tag-icon" />
VIP充值卡
</a-tag>
<a-tag v-if="form.payType == 14">
<IdcardOutlined class="tag-icon"/>
<IdcardOutlined class="tag-icon" />
IC充值卡
</a-tag>
<a-tag v-if="form.payType == 15">
<IdcardOutlined class="tag-icon"/>
<IdcardOutlined class="tag-icon" />
积分支付
</a-tag>
<a-tag v-if="form.payType == 16">
<IdcardOutlined class="tag-icon"/>
<IdcardOutlined class="tag-icon" />
VIP季卡
</a-tag>
<a-tag v-if="form.payType == 17">
<IdcardOutlined class="tag-icon"/>
<IdcardOutlined class="tag-icon" />
IC季卡
</a-tag>
</template>
@@ -204,10 +206,9 @@
<a-tag v-if="form.isSettled == 1" color="green">已结算</a-tag>
</a-descriptions-item>
<!-- <a-descriptions-item span="3">-->
<!-- <a-divider/>-->
<!-- </a-descriptions-item>-->
<!-- <a-descriptions-item span="3">-->
<!-- <a-divider/>-->
<!-- </a-descriptions-item>-->
</a-descriptions>
</a-card>
<a-card class="order-card" :bordered="false">
@@ -223,344 +224,343 @@
</template>
<script lang="ts" setup>
import {ref, reactive, watch} from 'vue';
import {Form} from 'ant-design-vue';
import {assignObject} from 'ele-admin-pro';
import {ColumnItem} from 'ele-admin-pro/es/ele-pro-table/types';
import {
CheckOutlined,
CloseOutlined,
CoffeeOutlined
} from '@ant-design/icons-vue';
import {ShopOrder} from '@/api/shop/shopOrder/model';
import {BszxPay} from '@/api/bszx/bszxPay/model';
import {pageBszxPay} from '@/api/bszx/bszxPay';
import {toDateString} from 'ele-admin-pro';
import {copyText} from "@/utils/common";
import { ref, reactive, watch } from 'vue';
import { Form } from 'ant-design-vue';
import { assignObject } from 'ele-admin-pro';
import { ColumnItem } from 'ele-admin-pro/es/ele-pro-table/types';
import {
CheckOutlined,
CloseOutlined,
CoffeeOutlined
} from '@ant-design/icons-vue';
import { ShopOrder } from '@/api/shop/shopOrder/model';
import { BszxPay } from '@/api/bszx/bszxPay/model';
import { pageBszxPay } from '@/api/bszx/bszxPay';
import { toDateString } from 'ele-admin-pro';
import { copyText } from '@/utils/common';
const useForm = Form.useForm;
const useForm = Form.useForm;
const props = defineProps<{
// 弹窗是否打开
visible: boolean;
// 修改回显的数据
data?: ShopOrder | null;
}>();
const props = defineProps<{
// 弹窗是否打开
visible: boolean;
// 修改回显的数据
data?: ShopOrder | null;
}>();
export interface step {
title?: String | undefined;
subTitle?: String | undefined;
description?: String | undefined;
}
// 是否是修改
const isUpdate = ref(false);
// 是否显示最大化切换按钮
const maxAble = ref(true);
// 订单信息
const orderInfo = ref<BszxPay[]>([]);
// 步骤条
const steps = ref<step[]>([
{
title: '报餐',
description: undefined
},
{
title: '付款',
description: undefined
},
{
title: '发餐',
description: undefined
},
{
title: '取餐',
description: undefined
},
{
title: '完成',
description: undefined
export interface step {
title?: String | undefined;
subTitle?: String | undefined;
description?: String | undefined;
}
]);
const active = ref(2);
const emit = defineEmits<{
(e: 'done'): void;
(e: 'update:visible', visible: boolean): void;
}>();
// 是否是修改
const isUpdate = ref(false);
// 是否显示最大化切换按钮
const maxAble = ref(true);
// 订单信息
const orderInfo = ref<BszxPay[]>([]);
// 订单信息
const form = reactive<ShopOrder>({
// 订单号
orderId: undefined,
// 订单编号
orderNo: undefined,
// 订单类型0商城订单 1预定订单/外卖 2会员卡
type: undefined,
// 快递/自提
deliveryType: undefined,
// 下单渠道0小程序预定 1俱乐部训练场 3活动订场
channel: undefined,
// 微信支付订单号
transactionId: undefined,
// 微信退款订单号
refundOrder: undefined,
// 商户ID
merchantId: undefined,
// 商户名称
merchantName: undefined,
// 商户编号
merchantCode: undefined,
// 使用的优惠券id
couponId: undefined,
// 使用的会员卡id
cardId: undefined,
// 关联管理员id
adminId: undefined,
// 核销管理员id
confirmId: undefined,
// IC卡号
icCard: undefined,
// 头像
avatar: undefined,
// 真实姓名
realName: undefined,
// 手机号码
phone: undefined,
// 收货地址
address: undefined,
//
addressLat: undefined,
//
addressLng: undefined,
// 自提店铺id
selfTakeMerchantId: undefined,
// 自提店铺
selfTakeMerchantName: undefined,
// 配送开始时间
sendStartTime: undefined,
// 配送结束时间
sendEndTime: undefined,
// 发货店铺id
expressMerchantId: undefined,
// 发货店铺
expressMerchantName: undefined,
// 订单总额
totalPrice: undefined,
// 减少的金额使用VIP会员折扣、优惠券抵扣、优惠券折扣后减去的价格
reducePrice: undefined,
// 实际付款
payPrice: undefined,
// 用于统计
price: undefined,
// 价钱,用于积分赠送
money: undefined,
// 退款金额
refundMoney: undefined,
// 教练价格
coachPrice: undefined,
// 购买数量
totalNum: undefined,
// 教练id
coachId: undefined,
// 支付的用户id
payUserId: undefined,
// 0余额支付, 1微信支付102微信Native2会员卡支付3支付宝4现金5POS机6VIP月卡7VIP年卡8VIP次卡9IC月卡10IC年卡11IC次卡12免费13VIP充值卡14IC充值卡15积分支付16VIP季卡17IC季卡18代付
payType: undefined,
// 代付支付方式,0余额支付, 1微信支付102微信Native2会员卡支付3支付宝4现金5POS机6VIP月卡7VIP年卡8VIP次卡9IC月卡10IC年卡11IC次卡12免费13VIP充值卡14IC充值卡15积分支付16VIP季卡17IC季卡18代付
friendPayType: undefined,
// 0未付款1已付款
payStatus: undefined,
// 0未使用1已完成2已取消3取消中4退款申请中5退款被拒绝6退款成功7客户端申请退款
orderStatus: undefined,
// 发货状态(10未发货 20已发货 30部分发货)
deliveryStatus: undefined,
// 发货时间
deliveryTime: undefined,
// 优惠类型0无、1抵扣优惠券、2折扣优惠券、3、VIP月卡、4VIP年卡5VIP次卡、6VIP会员卡、7IC月卡、8IC年卡、9IC次卡、10IC会员卡、11免费订单、12VIP充值卡、13IC充值卡、14VIP季卡、15IC季卡
couponType: undefined,
// 优惠说明
couponDesc: undefined,
// 二维码地址,保存订单号,支付成功后才生成
qrcode: undefined,
// vip月卡年卡、ic月卡年卡回退次数
returnNum: undefined,
// vip充值回退金额
returnMoney: undefined,
// 预约详情开始时间数组
startTime: undefined,
// 是否已开具发票0未开发票1已开发票2不能开具发票
isInvoice: undefined,
// 发票流水号
invoiceNo: undefined,
// 支付时间
payTime: undefined,
// 退款时间
refundTime: undefined,
// 申请退款时间
refundApplyTime: undefined,
// 过期时间
expirationTime: undefined,
// 对账情况0=未对账1=已对账3=已对账金额对不上4=未查询到该订单
checkBill: undefined,
// 订单是否已结算(0未结算 1已结算)
isSettled: undefined,
// 系统版本号 0当前版本 value=其他版本
version: undefined,
// 用户id
userId: undefined,
// 备注
comments: undefined,
// 排序号
sortNumber: undefined,
// 是否删除, 0否, 1是
deleted: undefined,
// 租户id
tenantId: undefined,
// 修改时间
updateTime: undefined,
// 创建时间
createTime: undefined,
// 自提码
selfTakeCode: undefined,
// 是否已收到赠品
hasTakeGift: undefined,
});
// 请求状态
const loading = ref(true);
const {resetFields} = useForm(form);
/* 更新visible */
const updateVisible = (value: boolean) => {
emit('update:visible', value);
};
const columns = ref<ColumnItem[]>([
{
title: '商品名称',
dataIndex: 'formName',
key: 'formName',
align: 'center',
width: 280
},
{
title: '金额',
dataIndex: 'price',
align: 'center'
},
{
title: '备注',
dataIndex: 'comments',
key: 'comments',
align: 'center'
},
{
title: '操作',
dataIndex: 'isFree',
align: 'center'
}
]);
/* 制作步骤条 */
const loadSteps = (order) => {
steps.value = [];
steps.value.push({
title: '下单'
});
steps.value.push({
title: '付款'
});
steps.value.push({
title: '发货'
});
steps.value.push({
title: '收货'
});
steps.value.push({
title: '完成'
});
// 下单
if (order.payStatus == 10) {
active.value = 0;
steps.value[0].description = order.createTime;
}
// 付款
if (order.payStatus == 20) {
active.value = 1;
steps.value[0].description = order.createTime;
steps.value[1].description = order.payTime;
}
// 发货
if (order.payStatus == 20 && order.deliveryStatus == 20) {
active.value = 2;
steps.value[0].description = order.createTime;
steps.value[1].description = order.payTime;
steps.value[2].description = order.deliveryTime;
}
// 收货
if (order.payStatus == 20 && order.receiptStatus == 20) {
active.value = 3;
steps.value[0].description = order.createTime;
steps.value[1].description = order.payTime;
steps.value[2].description = order.deliveryTime;
steps.value[3].description = order.receiptTime;
}
// 完成
if (order.payStatus == 20 && order.orderStatus == 30) {
active.value = 4;
steps.value[0].description = order.createTime;
steps.value[1].description = order.payTime;
steps.value[2].description = order.deliveryTime;
steps.value[3].description = order.receiptTime;
}
// 已取消
if (order.orderStatus == 20) {
active.value = 4;
}
};
// const getOrderInfo = () => {
// const orderId = props.data?.orderId;
// listOrderInfo({ orderId }).then((data) => {
// orderInfo.value = data.filter((d) => d.totalNum > 0);
// });
// };
/* 保存编辑 */
const save = () => {
};
watch(
() => props.visible,
(visible) => {
if (visible) {
if (props.data) {
loading.value = true;
assignObject(form, props.data);
pageBszxPay({orderNo: form.orderNo}).then((res) => {
if (res?.list) {
orderInfo.value = res?.list;
}
loading.value = false;
});
loadSteps(props.data);
}
} else {
resetFields();
// 步骤条
const steps = ref<step[]>([
{
title: '报餐',
description: undefined
},
{
title: '付款',
description: undefined
},
{
title: '发餐',
description: undefined
},
{
title: '取餐',
description: undefined
},
{
title: '完成',
description: undefined
}
}
);
]);
const active = ref(2);
const emit = defineEmits<{
(e: 'done'): void;
(e: 'update:visible', visible: boolean): void;
}>();
// 订单信息
const form = reactive<ShopOrder>({
// 订单号
orderId: undefined,
// 订单编号
orderNo: undefined,
// 订单类型0商城订单 1预定订单/外卖 2会员卡
type: undefined,
// 快递/自提
deliveryType: undefined,
// 下单渠道0小程序预定 1俱乐部训练场 3活动订场
channel: undefined,
// 微信支付订单号
transactionId: undefined,
// 微信退款订单号
refundOrder: undefined,
// 商户ID
merchantId: undefined,
// 商户名称
merchantName: undefined,
// 商户编号
merchantCode: undefined,
// 使用的优惠券id
couponId: undefined,
// 使用的会员卡id
cardId: undefined,
// 关联管理员id
adminId: undefined,
// 核销管理员id
confirmId: undefined,
// IC卡号
icCard: undefined,
// 头像
avatar: undefined,
// 真实姓名
realName: undefined,
// 手机号码
phone: undefined,
// 收货地址
address: undefined,
//
addressLat: undefined,
//
addressLng: undefined,
// 自提店铺id
selfTakeMerchantId: undefined,
// 自提店铺
selfTakeMerchantName: undefined,
// 配送开始时间
sendStartTime: undefined,
// 配送结束时间
sendEndTime: undefined,
// 发货店铺id
expressMerchantId: undefined,
// 发货店铺
expressMerchantName: undefined,
// 订单总额
totalPrice: undefined,
// 减少的金额使用VIP会员折扣、优惠券抵扣、优惠券折扣后减去的价格
reducePrice: undefined,
// 实际付款
payPrice: undefined,
// 用于统计
price: undefined,
// 价钱,用于积分赠送
money: undefined,
// 退款金额
refundMoney: undefined,
// 教练价格
coachPrice: undefined,
// 购买数量
totalNum: undefined,
// 教练id
coachId: undefined,
// 支付的用户id
payUserId: undefined,
// 0余额支付, 1微信支付102微信Native2会员卡支付3支付宝4现金5POS机6VIP月卡7VIP年卡8VIP次卡9IC月卡10IC年卡11IC次卡12免费13VIP充值卡14IC充值卡15积分支付16VIP季卡17IC季卡18代付
payType: undefined,
// 代付支付方式,0余额支付, 1微信支付102微信Native2会员卡支付3支付宝4现金5POS机6VIP月卡7VIP年卡8VIP次卡9IC月卡10IC年卡11IC次卡12免费13VIP充值卡14IC充值卡15积分支付16VIP季卡17IC季卡18代付
friendPayType: undefined,
// 0未付款1已付款
payStatus: undefined,
// 0未使用1已完成2已取消3取消中4退款申请中5退款被拒绝6退款成功7客户端申请退款
orderStatus: undefined,
// 发货状态(10未发货 20已发货 30部分发货)
deliveryStatus: undefined,
// 发货时间
deliveryTime: undefined,
// 优惠类型0无、1抵扣优惠券、2折扣优惠券、3、VIP月卡、4VIP年卡5VIP次卡、6VIP会员卡、7IC月卡、8IC年卡、9IC次卡、10IC会员卡、11免费订单、12VIP充值卡、13IC充值卡、14VIP季卡、15IC季卡
couponType: undefined,
// 优惠说明
couponDesc: undefined,
// 二维码地址,保存订单号,支付成功后才生成
qrcode: undefined,
// vip月卡年卡、ic月卡年卡回退次数
returnNum: undefined,
// vip充值回退金额
returnMoney: undefined,
// 预约详情开始时间数组
startTime: undefined,
// 是否已开具发票0未开发票1已开发票2不能开具发票
isInvoice: undefined,
// 发票流水号
invoiceNo: undefined,
// 支付时间
payTime: undefined,
// 退款时间
refundTime: undefined,
// 申请退款时间
refundApplyTime: undefined,
// 过期时间
expirationTime: undefined,
// 对账情况0=未对账1=已对账3=已对账金额对不上4=未查询到该订单
checkBill: undefined,
// 订单是否已结算(0未结算 1已结算)
isSettled: undefined,
// 系统版本号 0当前版本 value=其他版本
version: undefined,
// 用户id
userId: undefined,
// 备注
comments: undefined,
// 排序号
sortNumber: undefined,
// 是否删除, 0否, 1是
deleted: undefined,
// 租户id
tenantId: undefined,
// 修改时间
updateTime: undefined,
// 创建时间
createTime: undefined,
// 自提码
selfTakeCode: undefined,
// 是否已收到赠品
hasTakeGift: undefined
});
// 请求状态
const loading = ref(true);
const { resetFields } = useForm(form);
/* 更新visible */
const updateVisible = (value: boolean) => {
emit('update:visible', value);
};
const columns = ref<ColumnItem[]>([
{
title: '商品名称',
dataIndex: 'formName',
key: 'formName',
align: 'center',
width: 280
},
{
title: '金额',
dataIndex: 'price',
align: 'center'
},
{
title: '备注',
dataIndex: 'comments',
key: 'comments',
align: 'center'
},
{
title: '操作',
dataIndex: 'isFree',
align: 'center'
}
]);
/* 制作步骤条 */
const loadSteps = (order) => {
steps.value = [];
steps.value.push({
title: '下单'
});
steps.value.push({
title: '付款'
});
steps.value.push({
title: '发货'
});
steps.value.push({
title: '收货'
});
steps.value.push({
title: '完成'
});
// 下单
if (order.payStatus == 10) {
active.value = 0;
steps.value[0].description = order.createTime;
}
// 付款
if (order.payStatus == 20) {
active.value = 1;
steps.value[0].description = order.createTime;
steps.value[1].description = order.payTime;
}
// 发货
if (order.payStatus == 20 && order.deliveryStatus == 20) {
active.value = 2;
steps.value[0].description = order.createTime;
steps.value[1].description = order.payTime;
steps.value[2].description = order.deliveryTime;
}
// 收货
if (order.payStatus == 20 && order.receiptStatus == 20) {
active.value = 3;
steps.value[0].description = order.createTime;
steps.value[1].description = order.payTime;
steps.value[2].description = order.deliveryTime;
steps.value[3].description = order.receiptTime;
}
// 完成
if (order.payStatus == 20 && order.orderStatus == 30) {
active.value = 4;
steps.value[0].description = order.createTime;
steps.value[1].description = order.payTime;
steps.value[2].description = order.deliveryTime;
steps.value[3].description = order.receiptTime;
}
// 已取消
if (order.orderStatus == 20) {
active.value = 4;
}
};
// const getOrderInfo = () => {
// const orderId = props.data?.orderId;
// listOrderInfo({ orderId }).then((data) => {
// orderInfo.value = data.filter((d) => d.totalNum > 0);
// });
// };
/* 保存编辑 */
const save = () => {};
watch(
() => props.visible,
(visible) => {
if (visible) {
if (props.data) {
loading.value = true;
assignObject(form, props.data);
pageBszxPay({ orderNo: form.orderNo }).then((res) => {
if (res?.list) {
orderInfo.value = res?.list;
}
loading.value = false;
});
loadSteps(props.data);
}
} else {
resetFields();
}
}
);
</script>
<script lang="ts">
import * as MenuIcons from '@/layout/menu-icons';
import * as MenuIcons from '@/layout/menu-icons';
export default {
name: 'BszxOrderInfo',
components: MenuIcons
};
export default {
name: 'BszxOrderInfo',
components: MenuIcons
};
</script>

View File

@@ -64,10 +64,10 @@
import { ref, watch } from 'vue';
import { utils, writeFile } from 'xlsx';
import { message } from 'ant-design-vue';
import useSearch from "@/utils/use-search";
import {ShopOrder, ShopOrderParam} from "@/api/shop/shopOrder/model";
import {listShopOrder} from "@/api/shop/shopOrder";
import {getPayType} from "@/utils/shop";
import useSearch from '@/utils/use-search';
import { ShopOrder, ShopOrderParam } from '@/api/shop/shopOrder/model';
import { listShopOrder } from '@/api/shop/shopOrder';
import { getPayType } from '@/utils/shop';
const props = withDefaults(
defineProps<{
@@ -96,7 +96,7 @@
payStatus: undefined,
orderStatus: undefined,
payType: undefined,
isInvoice: undefined,
isInvoice: undefined
});
const reload = () => {
@@ -123,7 +123,7 @@
const dateRange = ref<[string, string]>(['', '']);
// 变量
const loading = ref(false);
const orders = ref<ShopOrder[]>([])
const orders = ref<ShopOrder[]>([]);
const xlsFileName = ref<string>();
// 导出
@@ -194,7 +194,6 @@
loading.value = false;
})
.finally(() => {});
};
watch(

View File

@@ -1,7 +1,7 @@
<template>
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
<template #extra>
<Extra/>
<Extra />
</template>
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-pro-table
@@ -23,16 +23,22 @@
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'name'">
<div @click="onSearch(record)" class="cursor-pointer">{{ record.name || '匿名' }}</div>
<div @click="onSearch(record)" class="cursor-pointer">{{
record.name || '匿名'
}}</div>
</template>
<template v-if="column.key === 'phone'">
<div v-if="record.mobile" class="text-gray-400">{{ record.mobile }}</div>
<div v-if="record.mobile" class="text-gray-400">{{
record.mobile
}}</div>
<div v-else class="text-gray-600">{{ record.phone }}</div>
</template>
<template v-if="column.key === 'payType'">
<template v-for="item in getPayType()">
<template v-if="record.payStatus == 1">
<span v-if="item.value == record.payType">{{ item.label }}</span>
<span v-if="item.value == record.payType">{{
item.label
}}</span>
</template>
<template v-else>
<span></span>
@@ -40,12 +46,19 @@
</template>
</template>
<template v-if="column.key === 'payStatus'">
<a-tag v-if="record.payStatus == 1" color="green" @click="updatePayStatus(record)">已付款</a-tag>
<a-tag v-if="record.payStatus == 0" @click="updatePayStatus(record)">未付款</a-tag>
<a-tag
v-if="record.payStatus == 1"
color="green"
@click="updatePayStatus(record)"
>已付款</a-tag
>
<a-tag v-if="record.payStatus == 0" @click="updatePayStatus(record)"
>未付款</a-tag
>
<a-tag v-if="record.payStatus == 3">未付款,占场中</a-tag>
</template>
<template v-if="column.key === 'image'">
<a-image :src="record.image" :width="50"/>
<a-image :src="record.image" :width="50" />
</template>
<template v-if="column.key === 'sex'">
<a-tag v-if="record.sex === 1"></a-tag>
@@ -53,18 +66,30 @@
</template>
<template v-if="column.key === 'deliveryStatus'">
<a-tag v-if="record.deliveryStatus == 10">未核销</a-tag>
<a-tag v-if="record.deliveryStatus == 20" color="green">已核销</a-tag>
<a-tag v-if="record.deliveryStatus == 30" color="bule">部分核销</a-tag>
<a-tag v-if="record.deliveryStatus == 20" color="green"
>核销</a-tag
>
<a-tag v-if="record.deliveryStatus == 30" color="bule"
>部分核销</a-tag
>
</template>
<template v-if="column.key === 'orderStatus'">
<a-tag v-if="record.orderStatus === 0">未完成</a-tag>
<a-tag v-if="record.orderStatus === 1" color="green">已完成</a-tag>
<a-tag v-if="record.orderStatus === 2" color="red">已取消</a-tag>
<a-tag v-if="record.orderStatus === 3" color="red">取消中</a-tag>
<a-tag v-if="record.orderStatus === 4" color="red">退款申请中</a-tag>
<a-tag v-if="record.orderStatus === 5" color="red">退款被拒绝</a-tag>
<a-tag v-if="record.orderStatus === 6" color="orange">退款成功</a-tag>
<a-tag v-if="record.orderStatus === 7" color="pink">客户端申请退款</a-tag>
<a-tag v-if="record.orderStatus === 4" color="red"
>退款申请中</a-tag
>
<a-tag v-if="record.orderStatus === 5" color="red"
>退款被拒绝</a-tag
>
<a-tag v-if="record.orderStatus === 6" color="orange"
>退款成功</a-tag
>
<a-tag v-if="record.orderStatus === 7" color="pink"
>客户端申请退款</a-tag
>
</template>
<template v-if="column.key === 'isInvoice'">
<a-tag v-if="record.isInvoice == 0">未开具</a-tag>
@@ -78,7 +103,7 @@
<template v-if="column.key === 'action'">
<a-space>
<a @click="openEdit(record)">修改</a>
<a-divider type="vertical"/>
<a-divider type="vertical" />
<a-popconfirm
title="确定要删除此记录吗?"
@confirm="remove(record)"
@@ -92,216 +117,218 @@
</a-card>
<!-- 编辑弹窗 -->
<OrderInfo v-model:visible="showEdit" :data="current" @done="reload"/>
<OrderInfo v-model:visible="showEdit" :data="current" @done="reload" />
</a-page-header>
</template>
<script lang="ts" setup>
import {ref} from 'vue';
import type {EleProTable} from 'ele-admin-pro';
import type {
DatasourceFunction,
ColumnItem
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue';
import {getPageTitle} from "@/utils/common";
import Extra from "@/views/bszx/extra.vue";
import {pageBszxOrder} from "@/api/bszx/bszxOrder";
import OrderInfo from './components/orderInfo.vue';
import {ShopOrder, ShopOrderParam} from "@/api/shop/shopOrder/model";
import {updateShopOrder} from "@/api/shop/shopOrder";
import {message} from "ant-design-vue";
import {updateUser} from "@/api/system/user";
import {getPayType} from '@/utils/shop';
import {repairOrder} from "@/api/bszx/bszxPay";
import { ref } from 'vue';
import type { EleProTable } from 'ele-admin-pro';
import type {
DatasourceFunction,
ColumnItem
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue';
import { getPageTitle } from '@/utils/common';
import Extra from '@/views/bszx/extra.vue';
import { pageBszxOrder } from '@/api/bszx/bszxOrder';
import OrderInfo from './components/orderInfo.vue';
import { ShopOrder, ShopOrderParam } from '@/api/shop/shopOrder/model';
import { updateShopOrder } from '@/api/shop/shopOrder';
import { message } from 'ant-design-vue';
import { updateUser } from '@/api/system/user';
import { getPayType } from '@/utils/shop';
import { repairOrder } from '@/api/bszx/bszxPay';
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
// 表格选中数据
const selection = ref<ShopOrder[]>([]);
// 当前编辑数据
const current = ref<ShopOrder | null>(null);
// 是否显示编辑弹窗
const showEdit = ref(false);
// 是否显示批量移动弹窗
const showMove = ref(false);
// 加载状态
const loading = ref(true);
// 表格选中数据
const selection = ref<ShopOrder[]>([]);
// 当前编辑数据
const current = ref<ShopOrder | null>(null);
// 是否显示编辑弹窗
const showEdit = ref(false);
// 是否显示批量移动弹窗
const showMove = ref(false);
// 加载状态
const loading = ref(true);
// 表格数据源
const datasource: DatasourceFunction = ({
page,
limit,
where,
orders,
filters
}) => {
if (filters) {
where.status = filters.status;
}
return pageBszxOrder({
...where,
...orders,
// 表格数据源
const datasource: DatasourceFunction = ({
page,
limit
});
};
// 表格列配置
const columns = ref<ColumnItem[]>([
{
title: '订单号',
dataIndex: 'orderNo',
key: 'orderNo',
align: 'center',
width: 200,
},
{
title: '姓名',
dataIndex: 'realName',
key: 'realName',
align: 'center'
},
{
title: '手机号码',
dataIndex: 'phone',
key: 'phone',
align: 'center'
},
{
title: '实付金额',
dataIndex: 'payPrice',
key: 'payPrice',
align: 'center',
customRender: ({text}) => '¥' + text
},
{
title: '支付方式',
dataIndex: 'payType',
key: 'payType',
align: 'center'
},
{
title: '支付状态',
dataIndex: 'payStatus',
key: 'payStatus',
align: 'center'
},
{
title: '核销状态',
dataIndex: 'deliveryStatus',
key: 'deliveryStatus',
align: 'center',
},
{
title: '开票状态',
dataIndex: 'isInvoice',
key: 'isInvoice',
align: 'center',
},
{
title: '订单状态',
dataIndex: 'orderStatus',
key: 'orderStatus',
align: 'center',
},
// {
// title: '支付时间',
// dataIndex: 'payTime',
// key: 'payTime',
// align: 'center',
// width: 180,
// sorter: true,
// ellipsis: true
// },
{
title: '下单时间',
dataIndex: 'createTime',
key: 'createTime',
align: 'center',
width: 180,
sorter: true,
ellipsis: true
},
// {
// title: '操作',
// key: 'action',
// width: 180,
// fixed: 'right',
// align: 'center',
// hideInSetting: true
// }
]);
/* 搜索 */
const reload = (where?: ShopOrderParam) => {
selection.value = [];
tableRef?.value?.reload({where: where});
};
const onSearch = (item: ShopOrder) => {
reload({userId: item.userId})
}
/* 打开编辑弹窗 */
const openEdit = (row?: ShopOrder) => {
current.value = row ?? null;
showEdit.value = true;
};
/* 打开批量移动弹窗 */
const openMove = () => {
showMove.value = true;
};
/**
* 修复订单支付状态
*/
const updatePayStatus = (record: ShopOrder) => {
// 修复订单
repairOrder(record).then(() => {
message.success('修复成功');
}).then(() => {
if(record.realName == '' || record.realName == undefined){
// 更新用户真实姓名
updateUser({
userId: record.userId,
realName: record.realName
})
}
reload();
})
}
/* 查询 */
const query = () => {
loading.value = true;
};
/* 自定义行属性 */
const customRow = (record: ShopOrder) => {
return {
// 行点击事件
onClick: () => {
// console.log(record);
},
// 行双击事件
onDblclick: () => {
openEdit(record);
limit,
where,
orders,
filters
}) => {
if (filters) {
where.status = filters.status;
}
return pageBszxOrder({
...where,
...orders,
page,
limit
});
};
};
query();
// 表格列配置
const columns = ref<ColumnItem[]>([
{
title: '订单号',
dataIndex: 'orderNo',
key: 'orderNo',
align: 'center',
width: 200
},
{
title: '姓名',
dataIndex: 'realName',
key: 'realName',
align: 'center'
},
{
title: '手机号码',
dataIndex: 'phone',
key: 'phone',
align: 'center'
},
{
title: '实付金额',
dataIndex: 'payPrice',
key: 'payPrice',
align: 'center',
customRender: ({ text }) => '¥' + text
},
{
title: '支付方式',
dataIndex: 'payType',
key: 'payType',
align: 'center'
},
{
title: '支付状态',
dataIndex: 'payStatus',
key: 'payStatus',
align: 'center'
},
{
title: '核销状态',
dataIndex: 'deliveryStatus',
key: 'deliveryStatus',
align: 'center'
},
{
title: '开票状态',
dataIndex: 'isInvoice',
key: 'isInvoice',
align: 'center'
},
{
title: '订单状态',
dataIndex: 'orderStatus',
key: 'orderStatus',
align: 'center'
},
// {
// title: '支付时间',
// dataIndex: 'payTime',
// key: 'payTime',
// align: 'center',
// width: 180,
// sorter: true,
// ellipsis: true
// },
{
title: '下单时间',
dataIndex: 'createTime',
key: 'createTime',
align: 'center',
width: 180,
sorter: true,
ellipsis: true
}
// {
// title: '操作',
// key: 'action',
// width: 180,
// fixed: 'right',
// align: 'center',
// hideInSetting: true
// }
]);
/* 搜索 */
const reload = (where?: ShopOrderParam) => {
selection.value = [];
tableRef?.value?.reload({ where: where });
};
const onSearch = (item: ShopOrder) => {
reload({ userId: item.userId });
};
/* 打开编辑弹窗 */
const openEdit = (row?: ShopOrder) => {
current.value = row ?? null;
showEdit.value = true;
};
/* 打开批量移动弹窗 */
const openMove = () => {
showMove.value = true;
};
/**
* 修复订单支付状态
*/
const updatePayStatus = (record: ShopOrder) => {
// 修复订单
repairOrder(record)
.then(() => {
message.success('修复成功');
})
.then(() => {
if (record.realName == '' || record.realName == undefined) {
// 更新用户真实姓名
updateUser({
userId: record.userId,
realName: record.realName
});
}
reload();
});
};
/* 查询 */
const query = () => {
loading.value = true;
};
/* 自定义行属性 */
const customRow = (record: ShopOrder) => {
return {
// 行点击事件
onClick: () => {
// console.log(record);
},
// 行双击事件
onDblclick: () => {
openEdit(record);
}
};
};
query();
</script>
<script lang="ts">
import * as MenuIcons from '@/layout/menu-icons';
import * as MenuIcons from '@/layout/menu-icons';
export default {
name: 'BszxOrder',
components: MenuIcons
};
export default {
name: 'BszxOrder',
components: MenuIcons
};
</script>
<style lang="less" scoped></style>

View File

@@ -13,7 +13,7 @@
placeholder="选择年级"
:options="gradeList"
@change="onGrade"
></a-select>
/>
<a-select
v-if="where.gradeName"
show-search
@@ -22,7 +22,7 @@
placeholder="选择年级"
:options="classList"
@change="onClass"
></a-select>
/>
<a-input-search
allow-clear
placeholder="请输入关键词"
@@ -40,196 +40,192 @@
</template>
<script lang="ts" setup>
import {ref, watch} from 'vue';
import {utils, writeFile} from 'xlsx';
import dayjs from 'dayjs';
import {message} from 'ant-design-vue';
import useSearch from "@/utils/use-search";
import {BszxPayParam} from "@/api/bszx/bszxPay/model";
import {BszxBm} from "@/api/bszx/bszxBm/model";
import {listBszxPay} from "@/api/bszx/bszxPay";
import {BszxClassParam} from "@/api/bszx/bszxClass/model";
import {listBszxGrade} from "@/api/bszx/bszxGrade";
import {listBszxClass} from "@/api/bszx/bszxClass";
import { ref, watch } from 'vue';
import { utils, writeFile } from 'xlsx';
import dayjs from 'dayjs';
import { message } from 'ant-design-vue';
import useSearch from '@/utils/use-search';
import { BszxPayParam } from '@/api/bszx/bszxPay/model';
import { BszxBm } from '@/api/bszx/bszxBm/model';
import { listBszxPay } from '@/api/bszx/bszxPay';
import { BszxClassParam } from '@/api/bszx/bszxClass/model';
import { listBszxGrade } from '@/api/bszx/bszxGrade';
import { listBszxClass } from '@/api/bszx/bszxClass';
const props = withDefaults(
defineProps<{
// 选中的角色
selection?: [];
}>(),
{}
);
const props = withDefaults(
defineProps<{
// 选中的角色
selection?: [];
}>(),
{}
);
const emit = defineEmits<{
(e: 'search', where?: BszxPayParam): void;
(e: 'add'): void;
(e: 'remove'): void;
(e: 'batchMove'): void;
}>();
const emit = defineEmits<{
(e: 'search', where?: BszxPayParam): void;
(e: 'add'): void;
(e: 'remove'): void;
(e: 'batchMove'): void;
}>();
// 表单数据
const {where} = useSearch<BszxPayParam>({
id: undefined,
keywords: '',
gradeName: undefined,
className: undefined,
createTimeStart: undefined,
createTimeEnd: undefined,
userId: undefined
});
const reload = () => {
emit('search', where);
};
/* 搜索 */
const search = () => {
const [d1, d2] = dateRange.value ?? [];
where.createTimeStart = d1 ? d1 + ' 00:00:00' : undefined;
where.createTimeEnd = d2 ? d2 + ' 23:59:59' : undefined;
emit('search', {
...where
// 表单数据
const { where } = useSearch<BszxPayParam>({
id: undefined,
keywords: '',
gradeName: undefined,
className: undefined,
createTimeStart: undefined,
createTimeEnd: undefined,
userId: undefined
});
};
const reload = () => {
emit('search', where);
};
const dateRange = ref<[string, string]>(['', '']);
// 变量
const loading = ref(false);
const bmList = ref<BszxBm[]>([])
const xlsFileName = ref<string>();
const branchId = ref<number>();
const gradeId = ref<number>();
const gradeList = ref<BszxClassParam[]>([]);
const classList = ref<BszxClassParam[]>([]);
const getGradeList = () => {
listBszxGrade({branch: branchId.value}).then(res => {
gradeList.value = res.map(d => {
d.value = Number(d.id);
d.label = d.name;
return d;
/* 搜索 */
const search = () => {
const [d1, d2] = dateRange.value ?? [];
where.createTimeStart = d1 ? d1 + ' 00:00:00' : undefined;
where.createTimeEnd = d2 ? d2 + ' 23:59:59' : undefined;
emit('search', {
...where
});
})
};
};
const getClassList = () => {
listBszxClass({gradeId: gradeId.value}).then(res => {
classList.value = res.map(d => {
d.value = Number(d.id);
d.label = d.name;
return d;
});
})
}
const dateRange = ref<[string, string]>(['', '']);
// 变量
const loading = ref(false);
const bmList = ref<BszxBm[]>([]);
const xlsFileName = ref<string>();
const branchId = ref<number>();
const gradeId = ref<number>();
const gradeList = ref<BszxClassParam[]>([]);
const classList = ref<BszxClassParam[]>([]);
const onGrade = (gradeName: number, item: any) => {
where.gradeName = item.name;
if (gradeName) {
console.log(item)
gradeId.value = item.id;
getClassList();
}
emit('search', where);
}
const onBranchId = () => {
getGradeList();
}
const onClass = (classId, item) => {
console.log(classId);
where.className = item.name;
reload();
}
// 导出
const handleExport = async () => {
loading.value = true;
const array: (string | number)[][] = [
[
'订单编号',
'姓名',
'手机号码',
'捐款金额',
'性别',
'年级',
'班级',
'居住地址',
'工作单位',
'职务',
'捐款时间'
]
];
// 按搜索结果导出
where.sceneType = 'Content';
await listBszxPay(where)
.then((list) => {
bmList.value = list;
list?.forEach((d: BszxBm) => {
array.push([
`${d.orderNo}`,
`${d.name}`,
`${d.mobile}`,
`${d.price}`,
`${d.sex == 1 ? '男' : ''}${d.sex == 2 ? '女' : '-'}`,
`${d.gradeName ? d.gradeName : '-'}`,
`${d.className ? d.className : '-'}`,
`${d.address ? d.address : '-'}`,
`${d.workUnit ? d.workUnit : '-'}`,
`${d.position ? d.position : '-'}`,
`${d.createTime}`
]);
const getGradeList = () => {
listBszxGrade({ branch: branchId.value }).then((res) => {
gradeList.value = res.map((d) => {
d.value = Number(d.id);
d.label = d.name;
return d;
});
const sheetName = `导出捐款记录${dayjs(new Date()).format('YYYYMMDD')}`;
const workbook = {
SheetNames: [sheetName],
Sheets: {}
};
const sheet = utils.aoa_to_sheet(array);
workbook.Sheets[sheetName] = sheet;
// 设置列宽
sheet['!cols'] = [
{wch: 10},
{wch: 40},
{wch: 20},
{wch: 20},
{wch: 60},
{wch: 15},
{wch: 10},
{wch: 10},
{wch: 20},
{wch: 10},
{wch: 20}
];
message.loading('正在导出...');
setTimeout(() => {
writeFile(
workbook,
`${
where.createTimeEnd ? xlsFileName.value + '_' : ''
}${sheetName}.xlsx`
);
loading.value = false;
}, 1000);
})
.catch((msg) => {
message.error(msg);
loading.value = false;
})
.finally(() => {
});
};
};
const getClassList = () => {
listBszxClass({ gradeId: gradeId.value }).then((res) => {
classList.value = res.map((d) => {
d.value = Number(d.id);
d.label = d.name;
return d;
});
});
};
getGradeList();
const onGrade = (gradeName: number, item: any) => {
where.gradeName = item.name;
if (gradeName) {
console.log(item);
gradeId.value = item.id;
getClassList();
}
emit('search', where);
};
watch(
() => props.totalPriceAmount,
(totalPriceAmount) => {
console.log(totalPriceAmount, 'totalPriceAmount')
}
);
const onBranchId = () => {
getGradeList();
};
const onClass = (classId, item) => {
console.log(classId);
where.className = item.name;
reload();
};
// 导出
const handleExport = async () => {
loading.value = true;
const array: (string | number)[][] = [
[
'订单编号',
'姓名',
'手机号码',
'捐款金额',
'性别',
'年级',
'班级',
'居住地址',
'工作单位',
'职务',
'捐款时间'
]
];
// 按搜索结果导出
where.sceneType = 'Content';
await listBszxPay(where)
.then((list) => {
bmList.value = list;
list?.forEach((d: BszxBm) => {
array.push([
`${d.orderNo}`,
`${d.name}`,
`${d.mobile}`,
`${d.price}`,
`${d.sex == 1 ? '男' : ''}${d.sex == 2 ? '女' : '-'}`,
`${d.gradeName ? d.gradeName : '-'}`,
`${d.className ? d.className : '-'}`,
`${d.address ? d.address : '-'}`,
`${d.workUnit ? d.workUnit : '-'}`,
`${d.position ? d.position : '-'}`,
`${d.createTime}`
]);
});
const sheetName = `导出捐款记录${dayjs(new Date()).format('YYYYMMDD')}`;
const workbook = {
SheetNames: [sheetName],
Sheets: {}
};
const sheet = utils.aoa_to_sheet(array);
workbook.Sheets[sheetName] = sheet;
// 设置列宽
sheet['!cols'] = [
{ wch: 10 },
{ wch: 40 },
{ wch: 20 },
{ wch: 20 },
{ wch: 60 },
{ wch: 15 },
{ wch: 10 },
{ wch: 10 },
{ wch: 20 },
{ wch: 10 },
{ wch: 20 }
];
message.loading('正在导出...');
setTimeout(() => {
writeFile(
workbook,
`${
where.createTimeEnd ? xlsFileName.value + '_' : ''
}${sheetName}.xlsx`
);
loading.value = false;
}, 1000);
})
.catch((msg) => {
message.error(msg);
loading.value = false;
})
.finally(() => {});
};
getGradeList();
watch(
() => props.totalPriceAmount,
(totalPriceAmount) => {
console.log(totalPriceAmount, 'totalPriceAmount');
}
);
</script>

View File

@@ -1,7 +1,7 @@
<template>
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
<template #extra>
<Extra/>
<Extra />
</template>
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-pro-table
@@ -25,14 +25,18 @@
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'name'">
<div @click="onSearch(record)" class="cursor-pointer">{{ record.name || '匿名' }}</div>
<div @click="onSearch(record)" class="cursor-pointer">{{
record.name || '匿名'
}}</div>
</template>
<template v-if="column.key === 'phone'">
<div v-if="record.mobile" class="text-gray-400">{{ record.mobile }}</div>
<div v-if="record.mobile" class="text-gray-400">{{
record.mobile
}}</div>
<div v-else class="text-gray-600">{{ record.phone }}</div>
</template>
<template v-if="column.key === 'image'">
<a-image :src="record.image" :width="50"/>
<a-image :src="record.image" :width="50" />
</template>
<template v-if="column.key === 'sex'">
<a-tag v-if="record.sex === 1"></a-tag>
@@ -49,7 +53,7 @@
<template v-if="column.key === 'action'">
<a-space>
<a @click="openEdit(record)">修改</a>
<a-divider type="vertical"/>
<a-divider type="vertical" />
<a-popconfirm
title="确定要删除此记录吗?"
@confirm="remove(record)"
@@ -60,277 +64,283 @@
</template>
</template>
<template #footer>
<span v-if="totalPriceAmount" class="text-red-500 font-bold">小计{{ totalPriceAmount.toFixed(2) }}</span>
<span v-if="totalPriceAmount" class="text-red-500 font-bold"
>小计{{ totalPriceAmount.toFixed(2) }}</span
>
</template>
</ele-pro-table>
</a-card>
<!-- 编辑弹窗 -->
<BszxPayEdit v-model:visible="showEdit" :data="current" @done="reload"/>
<BszxPayEdit v-model:visible="showEdit" :data="current" @done="reload" />
</a-page-header>
</template>
<script lang="ts" setup>
import {createVNode, ref} from 'vue';
import {message, Modal} from 'ant-design-vue';
import {ExclamationCircleOutlined} from '@ant-design/icons-vue';
import type {EleProTable} from 'ele-admin-pro';
import type {
DatasourceFunction,
ColumnItem
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue';
import BszxPayEdit from './components/bszxPayEdit.vue';
import {pageBszxPay, removeBszxPay, removeBatchBszxPay} from '@/api/bszx/bszxPay';
import type {BszxPay, BszxPayParam} from '@/api/bszx/bszxPay/model';
import {getPageTitle} from "@/utils/common";
import Extra from "@/views/bszx/extra.vue";
import {PageResult} from "@/api";
import { createVNode, ref } from 'vue';
import { message, Modal } from 'ant-design-vue';
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
import type { EleProTable } from 'ele-admin-pro';
import type {
DatasourceFunction,
ColumnItem
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue';
import BszxPayEdit from './components/bszxPayEdit.vue';
import {
pageBszxPay,
removeBszxPay,
removeBatchBszxPay
} from '@/api/bszx/bszxPay';
import type { BszxPay, BszxPayParam } from '@/api/bszx/bszxPay/model';
import { getPageTitle } from '@/utils/common';
import Extra from '@/views/bszx/extra.vue';
import { PageResult } from '@/api';
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
// 表格选中数据
const selection = ref<BszxPay[]>([]);
// 当前编辑数据
const current = ref<BszxPay | null>(null);
// 是否显示编辑弹窗
const showEdit = ref(false);
// 是否显示批量移动弹窗
const showMove = ref(false);
// 加载状态
const loading = ref(true);
const totalPriceAmount = ref<number>(0);
// 表格选中数据
const selection = ref<BszxPay[]>([]);
// 当前编辑数据
const current = ref<BszxPay | null>(null);
// 是否显示编辑弹窗
const showEdit = ref(false);
// 是否显示批量移动弹窗
const showMove = ref(false);
// 加载状态
const loading = ref(true);
const totalPriceAmount = ref<number>(0);
// 表格数据源
const datasource: DatasourceFunction = ({
page,
limit,
where,
orders,
filters
}) => {
if (filters) {
where.status = filters.status;
}
return pageBszxPay({
...where,
...orders,
// 表格数据源
const datasource: DatasourceFunction = ({
page,
limit
});
};
// 整理数据
const parseData = (data: PageResult<BszxPay>) => {
totalPriceAmount.value = 0;
data.list?.map((item) => {
if(item.price){
totalPriceAmount.value += Number(item.price)
limit,
where,
orders,
filters
}) => {
if (filters) {
where.status = filters.status;
}
})
return data;
};
// 表格列配置
const columns = ref<ColumnItem[]>([
{
title: '订单编号',
dataIndex: 'orderNo',
key: 'orderNo',
align: 'center',
width: 200,
},
{
title: '姓名',
dataIndex: 'name',
key: 'name',
align: 'center',
},
{
title: '手机号码',
dataIndex: 'phone',
key: 'phone',
align: 'center',
width: 120
},
{
title: '捐款金额',
dataIndex: 'price',
key: 'price',
width: 120,
align: 'center',
sorter: true,
customRender: ({text}) => '¥' + text
},
{
title: '性别',
dataIndex: 'sex',
key: 'sex',
align: 'center',
customRender: ({text}) => ['', '男', '女'][text]
},
{
title: '分部',
dataIndex: 'branchName',
key: 'branchName',
align: 'center',
},
{
title: '年级',
dataIndex: 'gradeName',
key: 'gradeName',
align: 'center',
},
{
title: '班级',
dataIndex: 'className',
key: 'className',
align: 'center',
},
{
title: '居住地址',
dataIndex: 'address',
key: 'address',
align: 'center',
},
{
title: '工作单位',
dataIndex: 'workUnit',
key: 'workUnit',
align: 'center',
},
{
title: '职务',
dataIndex: 'position',
key: 'position',
align: 'center',
},
// {
// title: '捐赠证书',
// dataIndex: 'certificate',
// key: 'certificate',
// align: 'center',
// },
{
title: '心愿',
dataIndex: 'comments',
key: 'comments',
align: 'center',
},
// {
// title: '状态',
// dataIndex: 'status',
// key: 'status',
// align: 'center',
// },
{
title: '捐款时间',
dataIndex: 'createTime',
key: 'createTime',
align: 'center',
width: 180,
sorter: true,
ellipsis: true
},
// {
// title: '操作',
// key: 'action',
// width: 180,
// fixed: 'right',
// align: 'center',
// hideInSetting: true
// }
]);
/* 搜索 */
const reload = (where?: BszxPayParam) => {
selection.value = [];
tableRef?.value?.reload({where: where});
};
const onSearch = (item: BszxPay) => {
reload({userId: item.userId})
}
/* 打开编辑弹窗 */
const openEdit = (row?: BszxPay) => {
current.value = row ?? null;
showEdit.value = true;
};
/* 打开批量移动弹窗 */
const openMove = () => {
showMove.value = true;
};
/* 删除单个 */
const remove = (row: BszxPay) => {
const hide = message.loading('请求中..', 0);
removeBszxPay(row.id)
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
return pageBszxPay({
...where,
...orders,
page,
limit
});
};
/* 批量删除 */
const removeBatch = () => {
if (!selection.value.length) {
message.error('请至少选择一条数据');
return;
}
Modal.confirm({
title: '提示',
content: '确定要删除选中的记录吗?',
icon: createVNode(ExclamationCircleOutlined),
maskClosable: true,
onOk: () => {
const hide = message.loading('请求中..', 0);
removeBatchBszxPay(selection.value.map((d) => d.id))
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
}
});
};
/* 查询 */
const query = () => {
loading.value = true;
};
/* 自定义行属性 */
const customRow = (record: BszxPay) => {
return {
// 行点击事件
onClick: () => {
// console.log(record);
},
// 行双击事件
onDblclick: () => {
// openEdit(record);
}
};
};
query();
// 整理数据
const parseData = (data: PageResult<BszxPay>) => {
totalPriceAmount.value = 0;
data.list?.map((item) => {
if (item.price) {
totalPriceAmount.value += Number(item.price);
}
});
return data;
};
// 表格列配置
const columns = ref<ColumnItem[]>([
{
title: '订单编号',
dataIndex: 'orderNo',
key: 'orderNo',
align: 'center',
width: 200
},
{
title: '姓名',
dataIndex: 'name',
key: 'name',
align: 'center'
},
{
title: '手机号码',
dataIndex: 'phone',
key: 'phone',
align: 'center',
width: 120
},
{
title: '捐款金额',
dataIndex: 'price',
key: 'price',
width: 120,
align: 'center',
sorter: true,
customRender: ({ text }) => '¥' + text
},
{
title: '性别',
dataIndex: 'sex',
key: 'sex',
align: 'center',
customRender: ({ text }) => ['', '男', '女'][text]
},
{
title: '分部',
dataIndex: 'branchName',
key: 'branchName',
align: 'center'
},
{
title: '年级',
dataIndex: 'gradeName',
key: 'gradeName',
align: 'center'
},
{
title: '班级',
dataIndex: 'className',
key: 'className',
align: 'center'
},
{
title: '居住地址',
dataIndex: 'address',
key: 'address',
align: 'center'
},
{
title: '工作单位',
dataIndex: 'workUnit',
key: 'workUnit',
align: 'center'
},
{
title: '职务',
dataIndex: 'position',
key: 'position',
align: 'center'
},
// {
// title: '捐赠证书',
// dataIndex: 'certificate',
// key: 'certificate',
// align: 'center',
// },
{
title: '心愿',
dataIndex: 'comments',
key: 'comments',
align: 'center'
},
// {
// title: '状态',
// dataIndex: 'status',
// key: 'status',
// align: 'center',
// },
{
title: '捐款时间',
dataIndex: 'createTime',
key: 'createTime',
align: 'center',
width: 180,
sorter: true,
ellipsis: true
}
// {
// title: '操作',
// key: 'action',
// width: 180,
// fixed: 'right',
// align: 'center',
// hideInSetting: true
// }
]);
/* 搜索 */
const reload = (where?: BszxPayParam) => {
selection.value = [];
tableRef?.value?.reload({ where: where });
};
const onSearch = (item: BszxPay) => {
reload({ userId: item.userId });
};
/* 打开编辑弹窗 */
const openEdit = (row?: BszxPay) => {
current.value = row ?? null;
showEdit.value = true;
};
/* 打开批量移动弹窗 */
const openMove = () => {
showMove.value = true;
};
/* 删除单个 */
const remove = (row: BszxPay) => {
const hide = message.loading('请求中..', 0);
removeBszxPay(row.id)
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
};
/* 批量删除 */
const removeBatch = () => {
if (!selection.value.length) {
message.error('请至少选择一条数据');
return;
}
Modal.confirm({
title: '提示',
content: '确定要删除选中的记录吗?',
icon: createVNode(ExclamationCircleOutlined),
maskClosable: true,
onOk: () => {
const hide = message.loading('请求中..', 0);
removeBatchBszxPay(selection.value.map((d) => d.id))
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
}
});
};
/* 查询 */
const query = () => {
loading.value = true;
};
/* 自定义行属性 */
const customRow = (record: BszxPay) => {
return {
// 行点击事件
onClick: () => {
// console.log(record);
},
// 行双击事件
onDblclick: () => {
// openEdit(record);
}
};
};
query();
</script>
<script lang="ts">
export default {
name: 'BszxPay'
};
export default {
name: 'BszxPay'
};
</script>
<style lang="less" scoped></style>

View File

@@ -5,7 +5,9 @@
:visible="visible"
:maskClosable="false"
:maxable="maxable"
:title="isUpdate ? '编辑应用-百色中学-捐款记录' : '添加应用-百色中学-捐款记录'"
:title="
isUpdate ? '编辑应用-百色中学-捐款记录' : '添加应用-百色中学-捐款记录'
"
:body-style="{ paddingBottom: '28px' }"
@update:visible="updateVisible"
@ok="save"
@@ -250,12 +252,12 @@
images.value = [];
if (props.data) {
assignObject(form, props.data);
if(props.data.image){
if (props.data.image) {
images.value.push({
uid: uuid(),
url: props.data.image,
status: 'done'
})
});
}
isUpdate.value = true;
} else {

View File

@@ -17,10 +17,10 @@
import { utils, writeFile } from 'xlsx';
import dayjs from 'dayjs';
import { message } from 'ant-design-vue';
import useSearch from "@/utils/use-search";
import {BszxPayParam} from "@/api/bszx/bszxPay/model";
import {BszxBm} from "@/api/bszx/bszxBm/model";
import {listBszxPay} from "@/api/bszx/bszxPay";
import useSearch from '@/utils/use-search';
import { BszxPayParam } from '@/api/bszx/bszxPay/model';
import { BszxBm } from '@/api/bszx/bszxBm/model';
import { listBszxPay } from '@/api/bszx/bszxPay';
const props = withDefaults(
defineProps<{
@@ -50,7 +50,7 @@
// 变量
const loading = ref(false);
const bmList = ref<BszxBm[]>([])
const bmList = ref<BszxBm[]>([]);
const xlsFileName = ref<string>();
// 导出
@@ -131,7 +131,6 @@
loading.value = false;
})
.finally(() => {});
};
watch(

View File

@@ -3,7 +3,7 @@
<div class="cert-content" v-html="article.content"></div>
<div class="create-time text-right">
<span>广西百色中学</span>
<p>{{ toDateString(form.createTime, "YYYY-MM-dd") }}</p>
<p>{{ toDateString(form.createTime, 'YYYY-MM-dd') }}</p>
</div>
<!-- 二维码 -->
<div class="qrcode mt-10 text-center">
@@ -14,12 +14,12 @@
<script lang="ts" setup>
import { useRouter } from 'vue-router';
import { onMounted, ref,unref, reactive } from 'vue';
import { assignObject, toDateString } from "ele-admin-pro";
import {getBszxPay} from '@/api/bszx/bszxPay';
import { onMounted, ref, unref, reactive } from 'vue';
import { assignObject, toDateString } from 'ele-admin-pro';
import { getBszxPay } from '@/api/bszx/bszxPay';
import type { BszxPay } from '@/api/bszx/bszxPay/model';
import {getCmsArticle} from "@/api/cms/cmsArticle";
import {CmsArticle} from "@/api/cms/cmsArticle/model";
import { getCmsArticle } from '@/api/cms/cmsArticle';
import { CmsArticle } from '@/api/cms/cmsArticle/model';
// 二维码内容
const qrcode = ref('123');
@@ -64,31 +64,37 @@
createTime: undefined
});
/* 查询 */
const query = () => {
loading.value = true;
const { currentRoute } = useRouter();
const { params } = unref(currentRoute);
console.log(params.id,'query')
getBszxPay(Number(params?.id)).then(data => {
console.log(params.id, 'query');
getBszxPay(Number(params?.id)).then((data) => {
assignObject(form, data);
if(data.formId && data.formId > 0){
getCmsArticle(data.formId).then(result => {
if(result.content){
result.content = result?.content.replace('校友', data?.name + '___校友');
result.content = result?.content.replace('人民币', '人民币 ' + data?.price);
qrcode.value = 'https://website.websoft.top/bszx/pay-cert/' + data?.id;
if (data.formId && data.formId > 0) {
getCmsArticle(data.formId).then((result) => {
if (result.content) {
result.content = result?.content.replace(
'校友',
data?.name + '___校友'
);
result.content = result?.content.replace(
'人民币',
'人民币 ' + data?.price
);
qrcode.value =
'https://website.websoft.top/bszx/pay-cert/' + data?.id;
}
assignObject(article, result);
})
});
}
})
});
};
onMounted(() => {
query();
})
onMounted(() => {
query();
});
</script>
<script lang="ts">
@@ -98,15 +104,16 @@ onMounted(() => {
</script>
<style lang="less" scoped>
.cert-box{
width: 500px;
margin: 10px auto;
padding: 58px;
border-bottom: blue 1px solid;
background: url("https://oss.wsdns.cn/20250127/cb1088c3b1354a118477a0b1a3cdac41.png") no-repeat;
background-size: 100%;
}
.cert-content{
margin-top: 250px;
}
.cert-box {
width: 500px;
margin: 10px auto;
padding: 58px;
border-bottom: blue 1px solid;
background: url('https://oss.wsdns.cn/20250127/cb1088c3b1354a118477a0b1a3cdac41.png')
no-repeat;
background-size: 100%;
}
.cert-content {
margin-top: 250px;
}
</style>

View File

@@ -78,7 +78,10 @@
import { ref, reactive, watch } from 'vue';
import { Form, message } from 'ant-design-vue';
import { assignObject, uuid } from 'ele-admin-pro';
import { addBszxPayRanking, updateBszxPayRanking } from '@/api/bszx/bszxPayRanking';
import {
addBszxPayRanking,
updateBszxPayRanking
} from '@/api/bszx/bszxPayRanking';
import { BszxPayRanking } from '@/api/bszx/bszxPayRanking/model';
import { useThemeStore } from '@/store/modules/theme';
import { storeToRefs } from 'pinia';
@@ -172,7 +175,9 @@
const formData = {
...form
};
const saveOrUpdate = isUpdate.value ? updateBszxPayRanking : addBszxPayRanking;
const saveOrUpdate = isUpdate.value
? updateBszxPayRanking
: addBszxPayRanking;
saveOrUpdate(formData)
.then((msg) => {
loading.value = false;
@@ -195,12 +200,12 @@
images.value = [];
if (props.data) {
assignObject(form, props.data);
if(props.data.image){
if (props.data.image) {
images.value.push({
uid: uuid(),
url: props.data.image,
status: 'done'
})
});
}
isUpdate.value = true;
} else {

View File

@@ -8,21 +8,25 @@
/>
<a-tooltip title="实际订单总金额(来自订单表)" class="flex px-4">
<span class="text-gray-400">实际订单总金额</span>
<span class="text-gray-700 font-bold">{{ formatNumber(bszxTotalPrice) }}</span>
<span class="text-gray-700 font-bold"
>{{ formatNumber(bszxTotalPrice) }}</span
>
</a-tooltip>
<a-tooltip title="排行榜统计金额(来自排行榜表)" class="flex px-4 ml-4">
<span class="text-gray-400">排行榜统计金额</span>
<span class="text-gray-700 font-bold">{{ formatNumber(rankingTotalPrice) }}</span>
<span class="text-gray-700 font-bold"
>{{ formatNumber(rankingTotalPrice) }}</span
>
</a-tooltip>
</a-space>
</template>
<script lang="ts" setup>
import useSearch from "@/utils/use-search";
import useSearch from '@/utils/use-search';
import { watch, ref, computed } from 'vue';
import { formatNumber } from 'ele-admin-pro/es';
import { BszxPayRankingParam } from "@/api/bszx/bszxPayRanking/model";
import { BszxPayRankingParam } from '@/api/bszx/bszxPayRanking/model';
import { useBszxStatisticsStore } from '@/store/modules/bszx-statistics';
// 使用百色中学统计数据 store
@@ -56,7 +60,7 @@
}>();
// 表单数据
const {where,resetFields} = useSearch<BszxPayRankingParam>({
const { where, resetFields } = useSearch<BszxPayRankingParam>({
id: undefined,
userId: undefined,
createTimeStart: undefined,
@@ -75,9 +79,9 @@
};
const onSearch = (text: string) => {
where.sceneType = text
where.sceneType = text;
search();
}
};
watch(
() => props.selection,

View File

@@ -1,7 +1,7 @@
<template>
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
<template #extra>
<Extra/>
<Extra />
</template>
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-pro-table
@@ -25,7 +25,7 @@
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'image'">
<a-image :src="record.image" :width="50"/>
<a-image :src="record.image" :width="50" />
</template>
<template v-if="column.key === 'status'">
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
@@ -34,7 +34,7 @@
<template v-if="column.key === 'action'">
<a-space>
<a @click="openEdit(record)">修改</a>
<a-divider type="vertical"/>
<a-divider type="vertical" />
<a-popconfirm
title="确定要删除此记录吗?"
@confirm="remove(record)"
@@ -48,195 +48,208 @@
</a-card>
<!-- 编辑弹窗 -->
<BszxPayRankingEdit v-model:visible="showEdit" :data="current" @done="reload"/>
<BszxPayRankingEdit
v-model:visible="showEdit"
:data="current"
@done="reload"
/>
</a-page-header>
</template>
<script lang="ts" setup>
import {createVNode, ref, onMounted} from 'vue';
import {message, Modal} from 'ant-design-vue';
import {ExclamationCircleOutlined} from '@ant-design/icons-vue';
import type {EleProTable} from 'ele-admin-pro';
import type {
DatasourceFunction,
ColumnItem
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue';
import BszxPayRankingEdit from './components/bszxPayRankingEdit.vue';
import {removeBszxPayRanking, removeBatchBszxPayRanking, ranking} from '@/api/bszx/bszxPayRanking';
import type {BszxPayRanking, BszxPayRankingParam} from '@/api/bszx/bszxPayRanking/model';
import {getPageTitle} from "@/utils/common";
import Extra from "@/views/bszx/extra.vue";
import { useBszxStatisticsStore } from '@/store/modules/bszx-statistics';
import { createVNode, ref, onMounted } from 'vue';
import { message, Modal } from 'ant-design-vue';
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
import type { EleProTable } from 'ele-admin-pro';
import type {
DatasourceFunction,
ColumnItem
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue';
import BszxPayRankingEdit from './components/bszxPayRankingEdit.vue';
import {
removeBszxPayRanking,
removeBatchBszxPayRanking,
ranking
} from '@/api/bszx/bszxPayRanking';
import type {
BszxPayRanking,
BszxPayRankingParam
} from '@/api/bszx/bszxPayRanking/model';
import { getPageTitle } from '@/utils/common';
import Extra from '@/views/bszx/extra.vue';
import { useBszxStatisticsStore } from '@/store/modules/bszx-statistics';
// 使用百色中学统计数据 store
const bszxStatisticsStore = useBszxStatisticsStore();
// 使用百色中学统计数据 store
const bszxStatisticsStore = useBszxStatisticsStore();
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
// 表格选中数据
const selection = ref<BszxPayRanking[]>([]);
// 当前编辑数据
const current = ref<BszxPayRanking | null>(null);
// 是否显示编辑弹窗
const showEdit = ref(false);
// 是否显示批量移动弹窗
const showMove = ref(false);
// 加载状态
const loading = ref(true);
// 排行榜总金额(本地计算)
const rankingTotalPrice = ref<number>(0);
// 表格选中数据
const selection = ref<BszxPayRanking[]>([]);
// 当前编辑数据
const current = ref<BszxPayRanking | null>(null);
// 是否显示编辑弹窗
const showEdit = ref(false);
// 是否显示批量移动弹窗
const showMove = ref(false);
// 加载状态
const loading = ref(true);
// 排行榜总金额(本地计算)
const rankingTotalPrice = ref<number>(0);
// 表格数据源
const datasource: DatasourceFunction = ({where}) => {
return ranking({...where}).then(data => {
// 计算排行榜总金额(用于对比显示)
let total = 0;
data.forEach((item) => {
if(item.totalPrice){
total += item.totalPrice;
// 表格数据源
const datasource: DatasourceFunction = ({ where }) => {
return ranking({ ...where }).then((data) => {
// 计算排行榜总金额(用于对比显示)
let total = 0;
data.forEach((item) => {
if (item.totalPrice) {
total += item.totalPrice;
}
});
rankingTotalPrice.value = total;
// 不再在这里更新 store 数据,因为这里的数据是排行榜数据,不是真实的订单统计
// store 中的数据应该来自 bszxOrderTotal API代表真实的订单金额
return data;
});
};
// 表格列配置
const columns = ref<ColumnItem[]>([
{
key: 'index',
width: 48,
align: 'center',
fixed: 'left',
hideInSetting: true,
customRender: ({ index }) => index + (tableRef.value?.tableIndex ?? 0)
},
{
title: '项目名称',
dataIndex: 'formName',
key: 'formName'
},
{
title: '捐款人数',
dataIndex: 'number',
key: 'number',
align: 'center'
},
{
title: '获得捐款总金额',
dataIndex: 'totalPrice',
key: 'totalPrice',
align: 'center'
}
// {
// title: '操作',
// key: 'action',
// width: 180,
// fixed: 'right',
// align: 'center',
// hideInSetting: true
// }
]);
/* 搜索 */
const reload = (where?: BszxPayRankingParam) => {
selection.value = [];
tableRef?.value?.reload({ where: where });
};
// 初始化数据
onMounted(async () => {
try {
// 初始化百色中学统计数据
await bszxStatisticsStore.fetchBszxStatistics();
} catch (error) {
console.error('初始化百色中学统计数据失败:', error);
}
});
/* 打开编辑弹窗 */
const openEdit = (row?: BszxPayRanking) => {
current.value = row ?? null;
showEdit.value = true;
};
/* 打开批量移动弹窗 */
const openMove = () => {
showMove.value = true;
};
/* 删除单个 */
const remove = (row: BszxPayRanking) => {
const hide = message.loading('请求中..', 0);
removeBszxPayRanking(row.bszxPayRankingId)
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
};
/* 批量删除 */
const removeBatch = () => {
if (!selection.value.length) {
message.error('请至少选择一条数据');
return;
}
Modal.confirm({
title: '提示',
content: '确定要删除选中的记录吗?',
icon: createVNode(ExclamationCircleOutlined),
maskClosable: true,
onOk: () => {
const hide = message.loading('请求中..', 0);
removeBatchBszxPayRanking(
selection.value.map((d) => d.bszxPayRankingId)
)
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
}
});
rankingTotalPrice.value = total;
// 不再在这里更新 store 数据,因为这里的数据是排行榜数据,不是真实的订单统计
// store 中的数据应该来自 bszxOrderTotal API代表真实的订单金额
return data;
});
};
// 表格列配置
const columns = ref<ColumnItem[]>([
{
key: 'index',
width: 48,
align: 'center',
fixed: 'left',
hideInSetting: true,
customRender: ({ index }) => index + (tableRef.value?.tableIndex ?? 0)
},
{
title: '项目名称',
dataIndex: 'formName',
key: 'formName'
},
{
title: '捐款人数',
dataIndex: 'number',
key: 'number',
align: 'center',
},
{
title: '获得捐款总金额',
dataIndex: 'totalPrice',
key: 'totalPrice',
align: 'center',
}
// {
// title: '操作',
// key: 'action',
// width: 180,
// fixed: 'right',
// align: 'center',
// hideInSetting: true
// }
]);
/* 搜索 */
const reload = (where?: BszxPayRankingParam) => {
selection.value = [];
tableRef?.value?.reload({where: where});
};
// 初始化数据
onMounted(async () => {
try {
// 初始化百色中学统计数据
await bszxStatisticsStore.fetchBszxStatistics();
} catch (error) {
console.error('初始化百色中学统计数据失败:', error);
}
});
/* 打开编辑弹窗 */
const openEdit = (row?: BszxPayRanking) => {
current.value = row ?? null;
showEdit.value = true;
};
/* 打开批量移动弹窗 */
const openMove = () => {
showMove.value = true;
};
/* 删除单个 */
const remove = (row: BszxPayRanking) => {
const hide = message.loading('请求中..', 0);
removeBszxPayRanking(row.bszxPayRankingId)
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
};
/* 批量删除 */
const removeBatch = () => {
if (!selection.value.length) {
message.error('请至少选择一条数据');
return;
}
Modal.confirm({
title: '提示',
content: '确定要删除选中的记录吗?',
icon: createVNode(ExclamationCircleOutlined),
maskClosable: true,
onOk: () => {
const hide = message.loading('请求中..', 0);
removeBatchBszxPayRanking(selection.value.map((d) => d.bszxPayRankingId))
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
}
});
};
/* 查询 */
const query = () => {
loading.value = true;
};
/* 自定义行属性 */
const customRow = (record: BszxPayRanking) => {
return {
// 行点击事件
onClick: () => {
// console.log(record);
},
// 行双击事件
onDblclick: () => {
openEdit(record);
}
};
};
query();
/* 查询 */
const query = () => {
loading.value = true;
};
/* 自定义行属性 */
const customRow = (record: BszxPayRanking) => {
return {
// 行点击事件
onClick: () => {
// console.log(record);
},
// 行双击事件
onDblclick: () => {
openEdit(record);
}
};
};
query();
</script>
<script lang="ts">
export default {
name: 'BszxPayRanking'
};
export default {
name: 'BszxPayRanking'
};
</script>
<style lang="less" scoped></style>

View File

@@ -78,7 +78,10 @@
import { ref, reactive, watch } from 'vue';
import { Form, message } from 'ant-design-vue';
import { assignObject, uuid } from 'ele-admin-pro';
import { addBszxPayRanking, updateBszxPayRanking } from '@/api/bszx/bszxPayRanking';
import {
addBszxPayRanking,
updateBszxPayRanking
} from '@/api/bszx/bszxPayRanking';
import { BszxPayRanking } from '@/api/bszx/bszxPayRanking/model';
import { useThemeStore } from '@/store/modules/theme';
import { storeToRefs } from 'pinia';
@@ -170,7 +173,9 @@
const formData = {
...form
};
const saveOrUpdate = isUpdate.value ? updateBszxPayRanking : addBszxPayRanking;
const saveOrUpdate = isUpdate.value
? updateBszxPayRanking
: addBszxPayRanking;
saveOrUpdate(formData)
.then((msg) => {
loading.value = false;
@@ -193,12 +198,12 @@
images.value = [];
if (props.data) {
assignObject(form, props.data);
if(props.data.image){
if (props.data.image) {
images.value.push({
uid: uuid(),
url: props.data.image,
status: 'done'
})
});
}
isUpdate.value = true;
} else {

View File

@@ -4,8 +4,8 @@
<a-radio-group v-model:value="where.branch" @change="onBranch">
<a-radio-button :value="1">初中部</a-radio-button>
<a-radio-button :value="2">高中部</a-radio-button>
<!-- <a-radio-button :value="8">教职员工</a-radio-button>-->
<!-- <a-radio-button :value="9">其他</a-radio-button>-->
<!-- <a-radio-button :value="8">教职员工</a-radio-button>-->
<!-- <a-radio-button :value="9">其他</a-radio-button>-->
</a-radio-group>
<a-select
show-search
@@ -14,7 +14,7 @@
placeholder="选择年级"
:options="gradeList"
@change="onGrade"
></a-select>
/>
<a-select
v-if="where.gradeId"
show-search
@@ -23,195 +23,191 @@
placeholder="选择年级"
:options="classList"
@change="onClass"
></a-select>
<!-- <a-input-search-->
<!-- allow-clear-->
<!-- placeholder="请输入关键词"-->
<!-- style="width: 280px"-->
<!-- v-model:value="where.keywords"-->
<!-- @search="reload"-->
<!-- />-->
<!-- <a-button type="text" @click="handleExport">导出</a-button>-->
/>
<!-- <a-input-search-->
<!-- allow-clear-->
<!-- placeholder="请输入关键词"-->
<!-- style="width: 280px"-->
<!-- v-model:value="where.keywords"-->
<!-- @search="reload"-->
<!-- />-->
<!-- <a-button type="text" @click="handleExport">导出</a-button>-->
</a-space>
</template>
<script lang="ts" setup>
import {ref, watch} from 'vue';
import {utils, writeFile} from 'xlsx';
import dayjs from 'dayjs';
import {message} from 'ant-design-vue';
import {BszxBm} from "@/api/bszx/bszxBm/model";
import useSearch from "@/utils/use-search";
import {listBszxBm} from "@/api/bszx/bszxBm";
import {BszxClassParam} from "@/api/bszx/bszxClass/model";
import {listBszxGrade} from "@/api/bszx/bszxGrade";
import {listBszxClass} from "@/api/bszx/bszxClass";
import { ref, watch } from 'vue';
import { utils, writeFile } from 'xlsx';
import dayjs from 'dayjs';
import { message } from 'ant-design-vue';
import { BszxBm } from '@/api/bszx/bszxBm/model';
import useSearch from '@/utils/use-search';
import { listBszxBm } from '@/api/bszx/bszxBm';
import { BszxClassParam } from '@/api/bszx/bszxClass/model';
import { listBszxGrade } from '@/api/bszx/bszxGrade';
import { listBszxClass } from '@/api/bszx/bszxClass';
const props = withDefaults(
defineProps<{
// 选中的角色
selection?: [];
}>(),
{}
);
const props = withDefaults(
defineProps<{
// 选中的角色
selection?: [];
}>(),
{}
);
const emit = defineEmits<{
(e: 'search', where?: BszxClassParam): void;
(e: 'add'): void;
(e: 'remove'): void;
(e: 'batchMove'): void;
}>();
const emit = defineEmits<{
(e: 'search', where?: BszxClassParam): void;
(e: 'add'): void;
(e: 'remove'): void;
(e: 'batchMove'): void;
}>();
// 表单数据
const {where} = useSearch<BszxClassParam>({
id: undefined,
keywords: '',
name: undefined,
branch: undefined,
userId: undefined
});
// 表单数据
const { where } = useSearch<BszxClassParam>({
id: undefined,
keywords: '',
name: undefined,
branch: undefined,
userId: undefined
});
// 变量
const loading = ref(false);
const bmList = ref<BszxBm[]>([])
const xlsFileName = ref<string>();
const gradeId = ref<number>();
const gradeList = ref<BszxClassParam[]>([]);
const classList = ref<BszxClassParam[]>([]);
// 变量
const loading = ref(false);
const bmList = ref<BszxBm[]>([]);
const xlsFileName = ref<string>();
const gradeId = ref<number>();
const gradeList = ref<BszxClassParam[]>([]);
const classList = ref<BszxClassParam[]>([]);
const reload = () => {
emit('search', where);
};
const reload = () => {
emit('search', where);
};
const getGradeList = () => {
listBszxGrade({branch: where.branch}).then(res => {
gradeList.value = res.map(d => {
d.value = Number(d.id);
d.label = d.name;
return d;
});
})
};
const getClassList = () => {
listBszxClass({gradeId: gradeId.value}).then(res => {
classList.value = res.map(d => {
d.value = Number(d.id);
d.label = d.name;
return d;
});
})
}
const onBranch = () => {
getGradeList();
reload();
}
const onGrade = (gradeName: number, item: any) => {
where.gradeId = item.id;
if(gradeName){
console.log(item)
gradeId.value = item.id;
getClassList();
}
emit('search', where);
}
const onClass = (classId,item) => {
console.log(classId);
where.name = item.name;
reload();
}
// 导出
const handleExport = async () => {
loading.value = true;
const array: (string | number)[][] = [
[
'用户ID',
'姓名',
'性别',
'手机号码',
'班级',
'年级',
'居住地址',
'工作单位',
'职务',
'是否能到场',
'邀请函',
'报名时间'
]
];
// 按搜索结果导出
where.sceneType = 'Content';
await listBszxBm(where)
.then((list) => {
bmList.value = list;
list?.forEach((d: BszxBm) => {
array.push([
`${d.userId}`,
`${d.name}`,
`${d.sex}`,
`${d.phone}`,
`${d.className}`,
`${d.gradeName}`,
`${d.address}`,
`${d.workUnit}`,
`${d.position}`,
`${d.present}`,
`${d.certificate}`,
`${d.createTime}`
]);
const getGradeList = () => {
listBszxGrade({ branch: where.branch }).then((res) => {
gradeList.value = res.map((d) => {
d.value = Number(d.id);
d.label = d.name;
return d;
});
const sheetName = `导出报名列表${dayjs(new Date()).format('YYYYMMDD')}`;
const workbook = {
SheetNames: [sheetName],
Sheets: {}
};
const sheet = utils.aoa_to_sheet(array);
workbook.Sheets[sheetName] = sheet;
// 设置列宽
sheet['!cols'] = [
{wch: 10},
{wch: 40},
{wch: 20},
{wch: 20},
{wch: 60},
{wch: 15},
{wch: 10},
{wch: 10},
{wch: 20},
{wch: 10},
{wch: 20}
];
message.loading('正在导出...');
setTimeout(() => {
writeFile(
workbook,
`${
where.createTimeEnd ? xlsFileName.value + '_' : ''
}${sheetName}.xlsx`
);
loading.value = false;
}, 1000);
})
.catch((msg) => {
message.error(msg);
loading.value = false;
})
.finally(() => {
});
};
};
const getClassList = () => {
listBszxClass({ gradeId: gradeId.value }).then((res) => {
classList.value = res.map((d) => {
d.value = Number(d.id);
d.label = d.name;
return d;
});
});
};
const onBranch = () => {
getGradeList();
reload();
};
getGradeList();
const onGrade = (gradeName: number, item: any) => {
where.gradeId = item.id;
if (gradeName) {
console.log(item);
gradeId.value = item.id;
getClassList();
}
emit('search', where);
};
watch(
() => props.selection,
() => {
}
);
const onClass = (classId, item) => {
console.log(classId);
where.name = item.name;
reload();
};
// 导出
const handleExport = async () => {
loading.value = true;
const array: (string | number)[][] = [
[
'用户ID',
'姓名',
'性别',
'手机号码',
'班级',
'年级',
'居住地址',
'工作单位',
'职务',
'是否能到场',
'邀请函',
'报名时间'
]
];
// 按搜索结果导出
where.sceneType = 'Content';
await listBszxBm(where)
.then((list) => {
bmList.value = list;
list?.forEach((d: BszxBm) => {
array.push([
`${d.userId}`,
`${d.name}`,
`${d.sex}`,
`${d.phone}`,
`${d.className}`,
`${d.gradeName}`,
`${d.address}`,
`${d.workUnit}`,
`${d.position}`,
`${d.present}`,
`${d.certificate}`,
`${d.createTime}`
]);
});
const sheetName = `导出报名列表${dayjs(new Date()).format('YYYYMMDD')}`;
const workbook = {
SheetNames: [sheetName],
Sheets: {}
};
const sheet = utils.aoa_to_sheet(array);
workbook.Sheets[sheetName] = sheet;
// 设置列宽
sheet['!cols'] = [
{ wch: 10 },
{ wch: 40 },
{ wch: 20 },
{ wch: 20 },
{ wch: 60 },
{ wch: 15 },
{ wch: 10 },
{ wch: 10 },
{ wch: 20 },
{ wch: 10 },
{ wch: 20 }
];
message.loading('正在导出...');
setTimeout(() => {
writeFile(
workbook,
`${
where.createTimeEnd ? xlsFileName.value + '_' : ''
}${sheetName}.xlsx`
);
loading.value = false;
}, 1000);
})
.catch((msg) => {
message.error(msg);
loading.value = false;
})
.finally(() => {});
};
getGradeList();
watch(
() => props.selection,
() => {}
);
</script>

View File

@@ -1,7 +1,7 @@
<template>
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
<template #extra>
<Extra/>
<Extra />
</template>
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-pro-table
@@ -25,7 +25,7 @@
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'image'">
<a-image :src="record.image" :width="50"/>
<a-image :src="record.image" :width="50" />
</template>
<template v-if="column.key === 'status'">
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
@@ -34,7 +34,7 @@
<template v-if="column.key === 'action'">
<a-space>
<a @click="openEdit(record)">修改</a>
<a-divider type="vertical"/>
<a-divider type="vertical" />
<a-popconfirm
title="确定要删除此记录吗?"
@confirm="remove(record)"
@@ -48,179 +48,187 @@
</a-card>
<!-- 编辑弹窗 -->
<BszxPayRankingEdit v-model:visible="showEdit" :data="current" @done="reload"/>
<BszxPayRankingEdit
v-model:visible="showEdit"
:data="current"
@done="reload"
/>
</a-page-header>
</template>
<script lang="ts" setup>
import {createVNode, ref} from 'vue';
import {message, Modal} from 'ant-design-vue';
import {ExclamationCircleOutlined} from '@ant-design/icons-vue';
import type {EleProTable} from 'ele-admin-pro';
import type {
DatasourceFunction,
ColumnItem
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue';
import BszxPayRankingEdit from './components/bszxPayRankingEdit.vue';
import {removeBszxPayRanking, removeBatchBszxPayRanking, ranking2} from '@/api/bszx/bszxPayRanking';
import type {BszxPayRanking} from '@/api/bszx/bszxPayRanking/model';
import {getPageTitle} from "@/utils/common";
import Extra from "@/views/bszx/extra.vue";
import {BszxPayParam} from "@/api/bszx/bszxPay/model";
import { createVNode, ref } from 'vue';
import { message, Modal } from 'ant-design-vue';
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
import type { EleProTable } from 'ele-admin-pro';
import type {
DatasourceFunction,
ColumnItem
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue';
import BszxPayRankingEdit from './components/bszxPayRankingEdit.vue';
import {
removeBszxPayRanking,
removeBatchBszxPayRanking,
ranking2
} from '@/api/bszx/bszxPayRanking';
import type { BszxPayRanking } from '@/api/bszx/bszxPayRanking/model';
import { getPageTitle } from '@/utils/common';
import Extra from '@/views/bszx/extra.vue';
import { BszxPayParam } from '@/api/bszx/bszxPay/model';
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
// 表格选中数据
const selection = ref<BszxPayRanking[]>([]);
// 当前编辑数据
const current = ref<BszxPayRanking | null>(null);
// 是否显示编辑弹窗
const showEdit = ref(false);
// 是否显示批量移动弹窗
const showMove = ref(false);
// 加载状态
const loading = ref(true);
// 合计总金额
const totalPriceAmount = ref<number>(0);
// 表格选中数据
const selection = ref<BszxPayRanking[]>([]);
// 当前编辑数据
const current = ref<BszxPayRanking | null>(null);
// 是否显示编辑弹窗
const showEdit = ref(false);
// 是否显示批量移动弹窗
const showMove = ref(false);
// 加载状态
const loading = ref(true);
// 合计总金额
const totalPriceAmount = ref<number>(0);
// 表格数据源
const datasource: DatasourceFunction = ({where}) => {
return ranking2({...where}).then(data => {
return data;
});
};
// 表格列配置
const columns = ref<ColumnItem[]>([
{
key: 'index',
width: 48,
align: 'center',
fixed: 'left',
hideInSetting: true,
customRender: ({ index }) => index + (tableRef.value?.tableIndex ?? 0)
},
{
title: 'ID',
dataIndex: 'id'
},
{
title: '分部',
dataIndex: 'branchName',
key: 'branchName',
},
{
title: '所在年级',
dataIndex: 'gradeName',
key: 'gradeName'
},
{
title: '班级',
dataIndex: 'name',
key: 'name'
},
{
title: '累计捐款金额',
dataIndex: 'totalMoney',
key: 'totalMoney',
align: 'center',
},
// {
// title: '操作',
// key: 'action',
// width: 180,
// fixed: 'right',
// align: 'center',
// hideInSetting: true
// }
]);
/* 搜索 */
const reload = (where?: BszxPayParam) => {
selection.value = [];
tableRef?.value?.reload({where: where});
};
/* 打开编辑弹窗 */
const openEdit = (row?: BszxPayRanking) => {
current.value = row ?? null;
showEdit.value = true;
};
/* 打开批量移动弹窗 */
const openMove = () => {
showMove.value = true;
};
/* 删除单个 */
const remove = (row: BszxPayRanking) => {
const hide = message.loading('请求中..', 0);
removeBszxPayRanking(row.id)
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
// 表格数据源
const datasource: DatasourceFunction = ({ where }) => {
return ranking2({ ...where }).then((data) => {
return data;
});
};
/* 批量删除 */
const removeBatch = () => {
if (!selection.value.length) {
message.error('请至少选择一条数据');
return;
}
Modal.confirm({
title: '提示',
content: '确定要删除选中的记录吗?',
icon: createVNode(ExclamationCircleOutlined),
maskClosable: true,
onOk: () => {
const hide = message.loading('请求中..', 0);
removeBatchBszxPayRanking(selection.value.map((d) => d.id))
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
}
});
};
/* 查询 */
const query = () => {
loading.value = true;
};
/* 自定义行属性 */
const customRow = (record: BszxPayRanking) => {
return {
// 行点击事件
onClick: () => {
// console.log(record);
},
// 行双击事件
onDblclick: () => {
// openEdit(record);
}
};
};
query();
// 表格列配置
const columns = ref<ColumnItem[]>([
{
key: 'index',
width: 48,
align: 'center',
fixed: 'left',
hideInSetting: true,
customRender: ({ index }) => index + (tableRef.value?.tableIndex ?? 0)
},
{
title: 'ID',
dataIndex: 'id'
},
{
title: '分部',
dataIndex: 'branchName',
key: 'branchName'
},
{
title: '所在年级',
dataIndex: 'gradeName',
key: 'gradeName'
},
{
title: '班级',
dataIndex: 'name',
key: 'name'
},
{
title: '累计捐款金额',
dataIndex: 'totalMoney',
key: 'totalMoney',
align: 'center'
}
// {
// title: '操作',
// key: 'action',
// width: 180,
// fixed: 'right',
// align: 'center',
// hideInSetting: true
// }
]);
/* 搜索 */
const reload = (where?: BszxPayParam) => {
selection.value = [];
tableRef?.value?.reload({ where: where });
};
/* 打开编辑弹窗 */
const openEdit = (row?: BszxPayRanking) => {
current.value = row ?? null;
showEdit.value = true;
};
/* 打开批量移动弹窗 */
const openMove = () => {
showMove.value = true;
};
/* 删除单个 */
const remove = (row: BszxPayRanking) => {
const hide = message.loading('请求中..', 0);
removeBszxPayRanking(row.id)
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
};
/* 批量删除 */
const removeBatch = () => {
if (!selection.value.length) {
message.error('请至少选择一条数据');
return;
}
Modal.confirm({
title: '提示',
content: '确定要删除选中的记录吗?',
icon: createVNode(ExclamationCircleOutlined),
maskClosable: true,
onOk: () => {
const hide = message.loading('请求中..', 0);
removeBatchBszxPayRanking(selection.value.map((d) => d.id))
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
}
});
};
/* 查询 */
const query = () => {
loading.value = true;
};
/* 自定义行属性 */
const customRow = (record: BszxPayRanking) => {
return {
// 行点击事件
onClick: () => {
// console.log(record);
},
// 行双击事件
onDblclick: () => {
// openEdit(record);
}
};
};
query();
</script>
<script lang="ts">
export default {
name: 'BszxPayRanking'
};
export default {
name: 'BszxPayRanking'
};
</script>
<style lang="less" scoped></style>

View File

@@ -1,100 +1,71 @@
<!-- 搜索表单 -->
<template>
<a-space style="flex-wrap: wrap">
<a-button
type="text"
@click="openUrl(`/website/field`)"
>字段扩展
<a-button type="text" @click="openUrl(`/website/field`)"
>字段扩展
</a-button>
<a-button
type="text"
@click="openUrl('/website/dict')"
>字典管理
<a-button type="text" @click="openUrl('/website/dict')">字典管理 </a-button>
<a-button type="text" @click="openUrl('/website/domain')"
>域名管理
</a-button>
<a-button
type="text"
@click="openUrl('/website/domain')"
>域名管理
</a-button
>
<a-button
type="text"
@click="openUrl('/website/model')"
>模型管理
</a-button
>
<a-button
type="text"
@click="openUrl('/website/form')"
>表单管理
</a-button
>
<a-button
type="text"
@click="openUrl('/website/lang')"
>国际化
</a-button
>
<a-button
type="text"
@click="openUrl('/website/setting')"
>网站设置
</a-button
>
<a-button
type="text"
class="ele-btn-icon"
@click="clearSiteInfoCache">
<a-button type="text" @click="openUrl('/website/model')"
>模型管理
</a-button>
<a-button type="text" @click="openUrl('/website/form')">表单管理 </a-button>
<a-button type="text" @click="openUrl('/website/lang')">国际化 </a-button>
<a-button type="text" @click="openUrl('/website/setting')"
>网站设置
</a-button>
<a-button type="text" class="ele-btn-icon" @click="clearSiteInfoCache">
清除缓存
</a-button>
</a-space>
</template>
<script lang="ts" setup>
import {watch,nextTick} from 'vue';
import {CmsWebsite} from '@/api/cms/cmsWebsite/model';
import {openUrl} from "@/utils/common";
import {message} from 'ant-design-vue';
import {removeSiteInfoCache} from "@/api/cms/cmsWebsite";
import { watch, nextTick } from 'vue';
import { CmsWebsite } from '@/api/cms/cmsWebsite/model';
import { openUrl } from '@/utils/common';
import { message } from 'ant-design-vue';
import { removeSiteInfoCache } from '@/api/cms/cmsWebsite';
const props = withDefaults(
defineProps<{
// 选中的角色
selection?: [];
website?: CmsWebsite;
count?: 0;
}>(),
{}
);
const props = withDefaults(
defineProps<{
// 选中的角色
selection?: [];
website?: CmsWebsite;
count?: 0;
}>(),
{}
);
const emit = defineEmits<{
(e: 'add'): void;
}>();
const emit = defineEmits<{
(e: 'add'): void;
}>();
const add = () => {
emit('add');
};
const add = () => {
emit('add');
};
// 清除缓存
const clearSiteInfoCache = () => {
removeSiteInfoCache('SiteInfo:' + localStorage.getItem('TenantId') + "*").then(
(msg) => {
// 清除缓存
const clearSiteInfoCache = () => {
removeSiteInfoCache(
'SiteInfo:' + localStorage.getItem('TenantId') + '*'
).then((msg) => {
if (msg) {
message.success(msg);
}
});
};
nextTick(() => {
if (localStorage.getItem('NotActive')) {
// IsActive.value = false
}
});
watch(
() => props.selection,
() => {}
);
};
nextTick(() => {
if(localStorage.getItem('NotActive')){
// IsActive.value = false
}
})
watch(
() => props.selection,
() => {
}
);
</script>

View File

@@ -39,11 +39,8 @@
v-model:value="form.websiteName"
/>
</a-form-item>
<a-form-item label="网站域名" name="domain" v-if="form.type == 10">
<a-input
v-model:value="form.domain"
placeholder="huawei.com"
>
<a-form-item label="网站域名" name="domain" v-if="form.type == 10">
<a-input v-model:value="form.domain" placeholder="huawei.com">
<template #addonBefore>
<a-select v-model:value="form.prefix" style="width: 90px">
<a-select-option value="http://">http://</a-select-option>
@@ -52,7 +49,7 @@
</template>
</a-input>
</a-form-item>
<a-form-item label="AppId" name="websiteCode" v-if="form.type == 20">
<a-form-item label="AppId" name="websiteCode" v-if="form.type == 20">
<a-input
allow-clear
placeholder="请输入AppId"
@@ -120,294 +117,292 @@
</template>
<script lang="ts" setup>
import {ref, reactive, watch} from 'vue';
import {Form, message} from 'ant-design-vue';
import {assignObject, uuid} from 'ele-admin-pro';
import {addCmsWebsite, updateCmsWebsite} from '@/api/cms/cmsWebsite';
import {CmsWebsite} from '@/api/cms/cmsWebsite/model';
import {useThemeStore} from '@/store/modules/theme';
import {storeToRefs} from 'pinia';
import {FormInstance, type Rule} from 'ant-design-vue/es/form';
import {ItemType} from 'ele-admin-pro/es/ele-image-upload/types';
import {FileRecord} from '@/api/system/file/model';
import {checkExistence} from '@/api/cms/cmsDomain';
import {updateCmsDomain} from '@/api/cms/cmsDomain';
import {updateTenant} from "@/api/system/tenant";
import { ref, reactive, watch } from 'vue';
import { Form, message } from 'ant-design-vue';
import { assignObject, uuid } from 'ele-admin-pro';
import { addCmsWebsite, updateCmsWebsite } from '@/api/cms/cmsWebsite';
import { CmsWebsite } from '@/api/cms/cmsWebsite/model';
import { useThemeStore } from '@/store/modules/theme';
import { storeToRefs } from 'pinia';
import { FormInstance, type Rule } from 'ant-design-vue/es/form';
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
import { FileRecord } from '@/api/system/file/model';
import { checkExistence } from '@/api/cms/cmsDomain';
import { updateCmsDomain } from '@/api/cms/cmsDomain';
import { updateTenant } from '@/api/system/tenant';
// 是否是修改
const isUpdate = ref(false);
const useForm = Form.useForm;
// 是否开启响应式布局
const themeStore = useThemeStore();
const {styleResponsive} = storeToRefs(themeStore);
// 是否是修改
const isUpdate = ref(false);
const useForm = Form.useForm;
// 是否开启响应式布局
const themeStore = useThemeStore();
const { styleResponsive } = storeToRefs(themeStore);
const props = defineProps<{
// 弹窗是否打开
visible: boolean;
// 修改回显的数据
data?: CmsWebsite | null;
}>();
const props = defineProps<{
// 弹窗是否打开
visible: boolean;
// 修改回显的数据
data?: CmsWebsite | null;
}>();
const emit = defineEmits<{
(e: 'done'): void;
(e: 'update:visible', visible: boolean): void;
}>();
const emit = defineEmits<{
(e: 'done'): void;
(e: 'update:visible', visible: boolean): void;
}>();
// 提交状态
const loading = ref(false);
// 是否显示最大化切换按钮
const maxable = ref(true);
// 表格选中数据
const formRef = ref<FormInstance | null>(null);
const images = ref<ItemType[]>([]);
const websiteQrcode = ref<ItemType[]>([]);
const oldDomain = ref();
const files = ref<ItemType[]>([]);
// 提交状态
const loading = ref(false);
// 是否显示最大化切换按钮
const maxable = ref(true);
// 表格选中数据
const formRef = ref<FormInstance | null>(null);
const images = ref<ItemType[]>([]);
const websiteQrcode = ref<ItemType[]>([]);
const oldDomain = ref();
const files = ref<ItemType[]>([]);
// 用户信息
const form = reactive<CmsWebsite>({
websiteId: undefined,
websiteLogo: undefined,
websiteName: undefined,
websiteCode: undefined,
type: 20,
files: undefined,
keywords: '',
prefix: '',
domain: '',
adminUrl: '',
style: '',
icpNo: undefined,
email: undefined,
version: undefined,
websiteType: '',
running: 1,
expirationTime: undefined,
sortNumber: undefined,
comments: undefined,
status: undefined,
statusText: undefined
});
/* 更新visible */
const updateVisible = (value: boolean) => {
emit('update:visible', value);
};
// 表单验证规则
const rules = reactive({
// comments: [
// {
// required: true,
// type: 'string',
// message: '请填写小程序描述',
// trigger: 'blur'
// }
// ],
keywords: [
{
required: true,
type: 'string',
message: '请填写SEO关键词',
trigger: 'blur'
}
],
running: [
{
required: true,
type: 'number',
message: '请选择小程序状态',
trigger: 'change'
}
],
domain: [
{
required: true,
type: 'string',
message: '请填写小程序域名',
trigger: 'blur'
}
],
websiteCode: [
{
required: true,
type: 'string',
message: '请填写小程序码',
trigger: 'blur'
}
],
// websiteCode: [
// {
// required: true,
// type: 'string',
// message: '该域名已被使用',
// validator: (_rule: Rule, value: string) => {
// return new Promise<void>((resolve, reject) => {
// if (!value) {
// return reject('请输入二级域名');
// }
// checkExistence('domain', `${value}.wsdns.cn`)
// .then(() => {
// if (value === oldDomain.value) {
// return resolve();
// }
// reject('已存在');
// })
// .catch(() => {
// resolve();
// });
// });
// },
// trigger: 'blur'
// }
// ],
adminUrl: [
{
required: true,
type: 'string',
message: '请填写小程序后台管理地址',
trigger: 'blur'
}
],
icpNo: [
{
required: true,
type: 'string',
message: '请填写ICP备案号',
trigger: 'blur'
}
],
appSecret: [
{
required: true,
type: 'string',
message: '请填写小程序秘钥',
trigger: 'blur'
}
],
websiteName: [
{
required: true,
type: 'string',
message: '请填写小程序信息名称',
trigger: 'blur'
}
]
});
const chooseImage = (data: FileRecord) => {
images.value.push({
uid: data.id,
url: data.path,
status: 'done'
// 用户信息
const form = reactive<CmsWebsite>({
websiteId: undefined,
websiteLogo: undefined,
websiteName: undefined,
websiteCode: undefined,
type: 20,
files: undefined,
keywords: '',
prefix: '',
domain: '',
adminUrl: '',
style: '',
icpNo: undefined,
email: undefined,
version: undefined,
websiteType: '',
running: 1,
expirationTime: undefined,
sortNumber: undefined,
comments: undefined,
status: undefined,
statusText: undefined
});
form.websiteLogo = data.downloadUrl;
};
const onDeleteItem = (index: number) => {
images.value.splice(index, 1);
form.websiteLogo = '';
};
/* 更新visible */
const updateVisible = (value: boolean) => {
emit('update:visible', value);
};
const chooseFile = (data: FileRecord) => {
form.websiteCode = data.url;
files.value.push({
uid: data.id,
url: data.url,
status: 'done'
});
};
const onDeleteFile = (index: number) => {
files.value.splice(index, 1);
};
// const onWebsiteType = (text: string) => {
// form.websiteType = text;
// };
const {resetFields} = useForm(form, rules);
/* 保存编辑 */
const save = () => {
if (!formRef.value) {
return;
}
formRef.value
.validate()
.then(() => {
loading.value = true;
const saveOrUpdate = isUpdate.value ? updateCmsWebsite : addCmsWebsite;
if (!isUpdate.value) {
updateVisible(false);
message.loading('创建过程中请勿刷新页面!', 0)
// 表单验证规则
const rules = reactive({
// comments: [
// {
// required: true,
// type: 'string',
// message: '请填写小程序描述',
// trigger: 'blur'
// }
// ],
keywords: [
{
required: true,
type: 'string',
message: '请填写SEO关键词',
trigger: 'blur'
}
const formData = {
...form,
type: 20,
adminUrl: `mp.websoft.top`,
files: JSON.stringify(files.value),
};
saveOrUpdate(formData)
.then((msg) => {
loading.value = false;
updateVisible(false);
updateCmsDomain({
websiteId: form.websiteId,
domain: `${localStorage.getItem('TenantId')}.shoplnk.cn`
});
updateTenant({
tenantName: `${form.websiteName}`
}).then(() => {
})
localStorage.setItem('Domain', `${form.websiteCode}.shoplnk.cn`);
localStorage.setItem('WebsiteId', `${form.websiteId}`);
localStorage.setItem('WebsiteName', `${form.websiteName}`);
message.destroy();
message.success(msg);
// window.location.reload();
emit('done');
})
.catch((e) => {
loading.value = false;
message.destroy();
message.error(e.message);
});
})
.catch(() => {
],
running: [
{
required: true,
type: 'number',
message: '请选择小程序状态',
trigger: 'change'
}
],
domain: [
{
required: true,
type: 'string',
message: '请填写小程序域名',
trigger: 'blur'
}
],
websiteCode: [
{
required: true,
type: 'string',
message: '请填写小程序码',
trigger: 'blur'
}
],
// websiteCode: [
// {
// required: true,
// type: 'string',
// message: '该域名已被使用',
// validator: (_rule: Rule, value: string) => {
// return new Promise<void>((resolve, reject) => {
// if (!value) {
// return reject('请输入二级域名');
// }
// checkExistence('domain', `${value}.wsdns.cn`)
// .then(() => {
// if (value === oldDomain.value) {
// return resolve();
// }
// reject('已存在');
// })
// .catch(() => {
// resolve();
// });
// });
// },
// trigger: 'blur'
// }
// ],
adminUrl: [
{
required: true,
type: 'string',
message: '请填写小程序后台管理地址',
trigger: 'blur'
}
],
icpNo: [
{
required: true,
type: 'string',
message: '请填写ICP备案号',
trigger: 'blur'
}
],
appSecret: [
{
required: true,
type: 'string',
message: '请填写小程序秘钥',
trigger: 'blur'
}
],
websiteName: [
{
required: true,
type: 'string',
message: '请填写小程序信息名称',
trigger: 'blur'
}
]
});
const chooseImage = (data: FileRecord) => {
images.value.push({
uid: data.id,
url: data.path,
status: 'done'
});
};
form.websiteLogo = data.downloadUrl;
};
watch(
() => props.visible,
(visible) => {
if (visible) {
images.value = [];
files.value = [];
websiteQrcode.value = [];
if (props.data?.websiteId) {
assignObject(form, props.data);
if (props.data.websiteLogo) {
images.value.push({
uid: uuid(),
url: props.data.websiteLogo,
status: 'done'
});
}
if (props.data.files) {
files.value = JSON.parse(props.data.files);
}
if (props.data.websiteCode) {
oldDomain.value = props.data.websiteCode;
}
isUpdate.value = true;
} else {
isUpdate.value = false;
}
} else {
resetFields();
const onDeleteItem = (index: number) => {
images.value.splice(index, 1);
form.websiteLogo = '';
};
const chooseFile = (data: FileRecord) => {
form.websiteCode = data.url;
files.value.push({
uid: data.id,
url: data.url,
status: 'done'
});
};
const onDeleteFile = (index: number) => {
files.value.splice(index, 1);
};
// const onWebsiteType = (text: string) => {
// form.websiteType = text;
// };
const { resetFields } = useForm(form, rules);
/* 保存编辑 */
const save = () => {
if (!formRef.value) {
return;
}
},
{immediate: true}
);
formRef.value
.validate()
.then(() => {
loading.value = true;
const saveOrUpdate = isUpdate.value ? updateCmsWebsite : addCmsWebsite;
if (!isUpdate.value) {
updateVisible(false);
message.loading('创建过程中请勿刷新页面!', 0);
}
const formData = {
...form,
type: 20,
adminUrl: `mp.websoft.top`,
files: JSON.stringify(files.value)
};
saveOrUpdate(formData)
.then((msg) => {
loading.value = false;
updateVisible(false);
updateCmsDomain({
websiteId: form.websiteId,
domain: `${localStorage.getItem('TenantId')}.shoplnk.cn`
});
updateTenant({
tenantName: `${form.websiteName}`
}).then(() => {});
localStorage.setItem('Domain', `${form.websiteCode}.shoplnk.cn`);
localStorage.setItem('WebsiteId', `${form.websiteId}`);
localStorage.setItem('WebsiteName', `${form.websiteName}`);
message.destroy();
message.success(msg);
// window.location.reload();
emit('done');
})
.catch((e) => {
loading.value = false;
message.destroy();
message.error(e.message);
});
})
.catch(() => {});
};
watch(
() => props.visible,
(visible) => {
if (visible) {
images.value = [];
files.value = [];
websiteQrcode.value = [];
if (props.data?.websiteId) {
assignObject(form, props.data);
if (props.data.websiteLogo) {
images.value.push({
uid: uuid(),
url: props.data.websiteLogo,
status: 'done'
});
}
if (props.data.files) {
files.value = JSON.parse(props.data.files);
}
if (props.data.websiteCode) {
oldDomain.value = props.data.websiteCode;
}
isUpdate.value = true;
} else {
isUpdate.value = false;
}
} else {
resetFields();
}
},
{ immediate: true }
);
</script>

View File

@@ -24,10 +24,16 @@
<a-tag color="green">{{ siteStore.statusText }}</a-tag>
<a-popover title="小程序码">
<template #content>
<p><img :src="siteStore.mpQrCode" alt="小程序码" width="300" height="300"></p>
<p
><img
:src="siteStore.mpQrCode"
alt="小程序码"
width="300"
height="300"
/></p>
</template>
<a-tag>
<QrcodeOutlined/>
<QrcodeOutlined />
</a-tag>
</a-popover>
</a-space>
@@ -35,7 +41,6 @@
</a-col>
<a-col :span="3">
<div class="flex justify-center items-center h-full w-full">
</div>
</a-col>
</a-row>
@@ -52,7 +57,7 @@
:loading="loading"
>
<template #prefix>
<UserOutlined/>
<UserOutlined />
</template>
</a-statistic>
</a-card>
@@ -67,7 +72,7 @@
:loading="loading"
>
<template #prefix>
<AccountBookOutlined/>
<AccountBookOutlined />
</template>
</a-statistic>
</a-card>
@@ -82,7 +87,7 @@
:loading="loading"
>
<template #prefix>
<MoneyCollectOutlined/>
<MoneyCollectOutlined />
</template>
</a-statistic>
</a-card>
@@ -98,7 +103,7 @@
:loading="loading"
>
<template #prefix>
<ClockCircleOutlined/>
<ClockCircleOutlined />
</template>
</a-statistic>
</a-card>
@@ -130,7 +135,11 @@
{{ siteInfo?.expirationTime }}
</a-descriptions-item>
<a-descriptions-item label="技术支持">
<span class="cursor-pointer" @click="openNew(`https://websoft.top/order/3429.html`)">网宿软件</span>
<span
class="cursor-pointer"
@click="openNew(`https://websoft.top/order/3429.html`)"
>网宿软件</span
>
</a-descriptions-item>
</a-descriptions>
</a-card>
@@ -140,24 +149,28 @@
<a-col :span="12">
<a-card title="快捷操作" :bordered="false">
<a-space direction="vertical" style="width: 100%">
<a-button type="primary" block @click="$router.push('/website/index')">
<ShopOutlined/>
<a-button
type="primary"
block
@click="$router.push('/website/index')"
>
<ShopOutlined />
站点管理
</a-button>
<a-button block @click="$router.push('/website/order')">
<CalendarOutlined/>
<CalendarOutlined />
订单管理
</a-button>
<a-button block @click="$router.push('/system/user')">
<UserOutlined/>
<UserOutlined />
用户管理
</a-button>
<a-button block @click="$router.push('/system/login-record')">
<FileTextOutlined/>
<FileTextOutlined />
系统日志
</a-button>
<a-button block @click="$router.push('/system/setting')">
<SettingOutlined/>
<SettingOutlined />
系统设置
</a-button>
</a-space>
@@ -168,97 +181,100 @@
</template>
<script lang="ts" setup>
import {ref, onMounted, onUnmounted, computed} from 'vue';
import {
UserOutlined,
CalendarOutlined,
QrcodeOutlined,
ShopOutlined,
ClockCircleOutlined,
SettingOutlined,
AccountBookOutlined,
FileTextOutlined,
MoneyCollectOutlined
} from '@ant-design/icons-vue';
import {openNew} from "@/utils/common";
import { useSiteStore } from '@/store/modules/site';
import { useStatisticsStore } from '@/store/modules/statistics';
import { useBszxStatisticsStore } from '@/store/modules/bszx-statistics';
import { storeToRefs } from 'pinia';
import { ref, onMounted, onUnmounted, computed } from 'vue';
import {
UserOutlined,
CalendarOutlined,
QrcodeOutlined,
ShopOutlined,
ClockCircleOutlined,
SettingOutlined,
AccountBookOutlined,
FileTextOutlined,
MoneyCollectOutlined
} from '@ant-design/icons-vue';
import { openNew } from '@/utils/common';
import { useSiteStore } from '@/store/modules/site';
import { useStatisticsStore } from '@/store/modules/statistics';
import { useBszxStatisticsStore } from '@/store/modules/bszx-statistics';
import { storeToRefs } from 'pinia';
// 使用状态管理
const siteStore = useSiteStore();
const statisticsStore = useStatisticsStore();
const bszxStatisticsStore = useBszxStatisticsStore();
// 使用状态管理
const siteStore = useSiteStore();
const statisticsStore = useStatisticsStore();
const bszxStatisticsStore = useBszxStatisticsStore();
// 从 store 中获取响应式数据
const { siteInfo, loading: siteLoading } = storeToRefs(siteStore);
const { loading: statisticsLoading } = storeToRefs(statisticsStore);
const { loading: bszxLoading } = storeToRefs(bszxStatisticsStore);
// 从 store 中获取响应式数据
const { siteInfo, loading: siteLoading } = storeToRefs(siteStore);
const { loading: statisticsLoading } = storeToRefs(statisticsStore);
const { loading: bszxLoading } = storeToRefs(bszxStatisticsStore);
// 系统信息
const systemInfo = ref({
name: '小程序开发',
description: '基于Spring、SpringBoot、SpringMVC等技术栈构建的前后端分离开发平台',
version: '2.0.0',
status: '运行中',
logo: '/logo.png',
environment: '生产环境',
database: 'MySQL 8.0',
server: 'Linux CentOS 7.9',
expirationTime: '2024-01-01 09:00:00'
});
// 系统信息
const systemInfo = ref({
name: '小程序开发',
description:
'基于Spring、SpringBoot、SpringMVC等技术栈构建的前后端分离开发平台',
version: '2.0.0',
status: '运行中',
logo: '/logo.png',
environment: '生产环境',
database: 'MySQL 8.0',
server: 'Linux CentOS 7.9',
expirationTime: '2024-01-01 09:00:00'
});
// 计算属性
const runDays = computed(() => siteStore.runDays);
const userCount = computed(() => statisticsStore.userCount);
const orderCount = computed(() => statisticsStore.orderCount);
const totalBszxPrice = computed(() => bszxStatisticsStore.bszxTotalPrice);
// 计算属性
const runDays = computed(() => siteStore.runDays);
const userCount = computed(() => statisticsStore.userCount);
const orderCount = computed(() => statisticsStore.orderCount);
const totalBszxPrice = computed(() => bszxStatisticsStore.bszxTotalPrice);
// 加载状态
const loading = computed(() => siteLoading.value || statisticsLoading.value || bszxLoading.value);
// 加载状态
const loading = computed(
() => siteLoading.value || statisticsLoading.value || bszxLoading.value
);
onMounted(async () => {
// 加载网站信息和统计数据
try {
await Promise.all([
siteStore.fetchSiteInfo(),
statisticsStore.fetchStatistics(),
bszxStatisticsStore.fetchBszxStatistics() // 加载百色中学统计数据
]);
onMounted(async () => {
// 加载网站信息和统计数据
try {
await Promise.all([
siteStore.fetchSiteInfo(),
statisticsStore.fetchStatistics(),
bszxStatisticsStore.fetchBszxStatistics() // 加载百色中学统计数据
]);
// 开始自动刷新统计数据每5分钟
statisticsStore.startAutoRefresh();
bszxStatisticsStore.startAutoRefresh();
} catch (error) {
console.error('加载数据失败:', error);
}
});
// 开始自动刷新统计数据每5分钟
statisticsStore.startAutoRefresh();
bszxStatisticsStore.startAutoRefresh();
} catch (error) {
console.error('加载数据失败:', error);
}
});
onUnmounted(() => {
// 组件卸载时停止自动刷新
statisticsStore.stopAutoRefresh();
bszxStatisticsStore.stopAutoRefresh();
});
onUnmounted(() => {
// 组件卸载时停止自动刷新
statisticsStore.stopAutoRefresh();
bszxStatisticsStore.stopAutoRefresh();
});
</script>
<style scoped>
.system-info h2 {
margin-bottom: 8px;
}
.system-info h2 {
margin-bottom: 8px;
}
.stat-card {
text-align: center;
margin-bottom: 16px;
}
.stat-card {
text-align: center;
margin-bottom: 16px;
}
.stat-card :deep(.ant-statistic-title) {
font-size: 14px;
color: #666;
}
.stat-card :deep(.ant-statistic-title) {
font-size: 14px;
color: #666;
}
.stat-card :deep(.ant-statistic-content) {
font-size: 24px;
font-weight: 600;
}
.stat-card :deep(.ant-statistic-content) {
font-size: 24px;
font-weight: 600;
}
</style>

View File

@@ -1,65 +1,63 @@
<!-- 搜索表单 -->
<template>
<a-space style="flex-wrap: wrap" v-if="hasRole('superAdmin') || hasRole('admin') || hasRole('foundation')">
<a-button
type="text"
@click="openUrl('/bszx/ranking')"
>捐款排行榜
<a-space
style="flex-wrap: wrap"
v-if="hasRole('superAdmin') || hasRole('admin') || hasRole('foundation')"
>
<a-button type="text" @click="openUrl('/bszx/ranking')"
>捐款排行榜
</a-button>
<a-button
type="text"
@click="openUrl('/bszx/ranking2')"
>千班万元
<a-button type="text" @click="openUrl('/bszx/ranking2')"
>千班万元
</a-button>
</a-space>
</template>
<script lang="ts" setup>
import {watch,nextTick} from 'vue';
import {CmsWebsite} from '@/api/cms/cmsWebsite/model';
import {openUrl} from "@/utils/common";
import {message} from 'ant-design-vue';
import {removeSiteInfoCache} from "@/api/cms/cmsWebsite";
import {hasRole} from "@/utils/permission";
import { watch, nextTick } from 'vue';
import { CmsWebsite } from '@/api/cms/cmsWebsite/model';
import { openUrl } from '@/utils/common';
import { message } from 'ant-design-vue';
import { removeSiteInfoCache } from '@/api/cms/cmsWebsite';
import { hasRole } from '@/utils/permission';
const props = withDefaults(
defineProps<{
// 选中的角色
selection?: [];
website?: CmsWebsite;
count?: 0;
}>(),
{}
);
const props = withDefaults(
defineProps<{
// 选中的角色
selection?: [];
website?: CmsWebsite;
count?: 0;
}>(),
{}
);
const emit = defineEmits<{
(e: 'add'): void;
}>();
const emit = defineEmits<{
(e: 'add'): void;
}>();
const add = () => {
emit('add');
};
const add = () => {
emit('add');
};
// 清除缓存
const clearSiteInfoCache = () => {
removeSiteInfoCache('SiteInfo:' + localStorage.getItem('TenantId') + "*").then(
(msg) => {
// 清除缓存
const clearSiteInfoCache = () => {
removeSiteInfoCache(
'SiteInfo:' + localStorage.getItem('TenantId') + '*'
).then((msg) => {
if (msg) {
message.success(msg);
}
});
};
nextTick(() => {
if (localStorage.getItem('NotActive')) {
// IsActive.value = false
}
});
watch(
() => props.selection,
() => {}
);
};
nextTick(() => {
if(localStorage.getItem('NotActive')){
// IsActive.value = false
}
})
watch(
() => props.selection,
() => {
}
);
</script>

View File

@@ -19,13 +19,13 @@
styleResponsive ? { md: 19, sm: 19, xs: 24 } : { flex: '1' }
"
>
<!-- <a-form-item label="类型" name="type">-->
<!-- <a-input-->
<!-- allow-clear-->
<!-- placeholder="请输入类型"-->
<!-- v-model:value="form.type"-->
<!-- />-->
<!-- </a-form-item>-->
<!-- <a-form-item label="类型" name="type">-->
<!-- <a-input-->
<!-- allow-clear-->
<!-- placeholder="请输入类型"-->
<!-- v-model:value="form.type"-->
<!-- />-->
<!-- </a-form-item>-->
<a-form-item label="就诊原因" name="reason">
<a-textarea
:rows="4"
@@ -35,27 +35,27 @@
v-model:value="form.reason"
/>
</a-form-item>
<!-- <a-form-item label="挂号时间" name="evaluateTime">-->
<!-- <a-input-->
<!-- allow-clear-->
<!-- placeholder="请输入挂号时间"-->
<!-- v-model:value="form.evaluateTime"-->
<!-- />-->
<!-- </a-form-item>-->
<!-- <a-form-item label="医生" name="doctorId">-->
<!-- <a-input-->
<!-- allow-clear-->
<!-- placeholder="请输入医生"-->
<!-- v-model:value="form.doctorId"-->
<!-- />-->
<!-- </a-form-item>-->
<!-- <a-form-item label="患者" name="userId">-->
<!-- <a-input-->
<!-- allow-clear-->
<!-- placeholder="请输入患者"-->
<!-- v-model:value="form.userId"-->
<!-- />-->
<!-- </a-form-item>-->
<!-- <a-form-item label="挂号时间" name="evaluateTime">-->
<!-- <a-input-->
<!-- allow-clear-->
<!-- placeholder="请输入挂号时间"-->
<!-- v-model:value="form.evaluateTime"-->
<!-- />-->
<!-- </a-form-item>-->
<!-- <a-form-item label="医生" name="doctorId">-->
<!-- <a-input-->
<!-- allow-clear-->
<!-- placeholder="请输入医生"-->
<!-- v-model:value="form.doctorId"-->
<!-- />-->
<!-- </a-form-item>-->
<!-- <a-form-item label="患者" name="userId">-->
<!-- <a-input-->
<!-- allow-clear-->
<!-- placeholder="请输入患者"-->
<!-- v-model:value="form.userId"-->
<!-- />-->
<!-- </a-form-item>-->
<a-form-item label="备注" name="comments">
<a-textarea
:rows="4"
@@ -73,20 +73,20 @@
v-model:value="form.sortNumber"
/>
</a-form-item>
<!-- <a-form-item label="是否删除" name="isDelete">-->
<!-- <a-input-->
<!-- allow-clear-->
<!-- placeholder="请输入是否删除"-->
<!-- v-model:value="form.isDelete"-->
<!-- />-->
<!-- </a-form-item>-->
<!-- <a-form-item label="修改时间" name="updateTime">-->
<!-- <a-input-->
<!-- allow-clear-->
<!-- placeholder="请输入修改时间"-->
<!-- v-model:value="form.updateTime"-->
<!-- />-->
<!-- </a-form-item>-->
<!-- <a-form-item label="是否删除" name="isDelete">-->
<!-- <a-input-->
<!-- allow-clear-->
<!-- placeholder="请输入是否删除"-->
<!-- v-model:value="form.isDelete"-->
<!-- />-->
<!-- </a-form-item>-->
<!-- <a-form-item label="修改时间" name="updateTime">-->
<!-- <a-input-->
<!-- allow-clear-->
<!-- placeholder="请输入修改时间"-->
<!-- v-model:value="form.updateTime"-->
<!-- />-->
<!-- </a-form-item>-->
</a-form>
</ele-modal>
</template>
@@ -95,7 +95,10 @@
import { ref, reactive, watch } from 'vue';
import { Form, message } from 'ant-design-vue';
import { assignObject, uuid } from 'ele-admin-pro';
import { addClinicAppointment, updateClinicAppointment } from '@/api/clinic/clinicAppointment';
import {
addClinicAppointment,
updateClinicAppointment
} from '@/api/clinic/clinicAppointment';
import { ClinicAppointment } from '@/api/clinic/clinicAppointment/model';
import { useThemeStore } from '@/store/modules/theme';
import { storeToRefs } from 'pinia';
@@ -191,7 +194,9 @@
const formData = {
...form
};
const saveOrUpdate = isUpdate.value ? updateClinicAppointment : addClinicAppointment;
const saveOrUpdate = isUpdate.value
? updateClinicAppointment
: addClinicAppointment;
saveOrUpdate(formData)
.then((msg) => {
loading.value = false;
@@ -214,12 +219,12 @@
images.value = [];
if (props.data) {
assignObject(form, props.data);
if(props.data.image){
if (props.data.image) {
images.value.push({
uid: uuid(),
url: props.data.image,
status: 'done'
})
});
}
isUpdate.value = true;
} else {

View File

@@ -1,58 +1,62 @@
<template>
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-pro-table
ref="tableRef"
row-key="id"
:columns="columns"
:datasource="datasource"
:customRow="customRow"
tool-class="ele-toolbar-form"
class="sys-org-table"
>
<template #toolbar>
<search
@search="reload"
:selection="selection"
@add="openEdit"
@remove="removeBatch"
@batchMove="openMove"
/>
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-pro-table
ref="tableRef"
row-key="id"
:columns="columns"
:datasource="datasource"
:customRow="customRow"
tool-class="ele-toolbar-form"
class="sys-org-table"
>
<template #toolbar>
<search
@search="reload"
:selection="selection"
@add="openEdit"
@remove="removeBatch"
@batchMove="openMove"
/>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'userId'">
<div>{{ record.nickname }}</div>
<div class="text-gray-400">{{ record.phone }}</div>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'userId'">
<div>{{ record.nickname }}</div>
<div class="text-gray-400">{{ record.phone }}</div>
</template>
<template v-if="column.key === 'doctorId'">
<div>{{ record.doctorName }}</div>
<div class="text-gray-400">{{ record.doctorPosition }}</div>
</template>
<template v-if="column.key === 'image'">
<a-image :src="record.image" :width="50" />
</template>
<template v-if="column.key === 'status'">
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
</template>
<template v-if="column.key === 'action'">
<a-space>
<a @click="openEdit(record)">修改</a>
<a-divider type="vertical" />
<a-popconfirm
title="确定要删除此记录吗?"
@confirm="remove(record)"
>
<a class="ele-text-danger">删除</a>
</a-popconfirm>
</a-space>
</template>
<template v-if="column.key === 'doctorId'">
<div>{{ record.doctorName }}</div>
<div class="text-gray-400">{{ record.doctorPosition }}</div>
</template>
</ele-pro-table>
</a-card>
<template v-if="column.key === 'image'">
<a-image :src="record.image" :width="50" />
</template>
<template v-if="column.key === 'status'">
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
</template>
<template v-if="column.key === 'action'">
<a-space>
<a @click="openEdit(record)">修改</a>
<a-divider type="vertical" />
<a-popconfirm
title="确定要删除此记录吗?"
@confirm="remove(record)"
>
<a class="ele-text-danger">删除</a>
</a-popconfirm>
</a-space>
</template>
</template>
</ele-pro-table>
</a-card>
<!-- 编辑弹窗 -->
<ClinicAppointmentEdit v-model:visible="showEdit" :data="current" @done="reload" />
<!-- 编辑弹窗 -->
<ClinicAppointmentEdit
v-model:visible="showEdit"
:data="current"
@done="reload"
/>
</a-page-header>
</template>
@@ -67,10 +71,17 @@
ColumnItem
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue';
import {getPageTitle} from '@/utils/common';
import { getPageTitle } from '@/utils/common';
import ClinicAppointmentEdit from './components/clinicAppointmentEdit.vue';
import { pageClinicAppointment, removeClinicAppointment, removeBatchClinicAppointment } from '@/api/clinic/clinicAppointment';
import type { ClinicAppointment, ClinicAppointmentParam } from '@/api/clinic/clinicAppointment/model';
import {
pageClinicAppointment,
removeClinicAppointment,
removeBatchClinicAppointment
} from '@/api/clinic/clinicAppointment';
import type {
ClinicAppointment,
ClinicAppointmentParam
} from '@/api/clinic/clinicAppointment/model';
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
@@ -111,7 +122,7 @@
title: '主键ID',
dataIndex: 'id',
key: 'id',
width: 90,
width: 90
},
{
title: '患者',

View File

@@ -75,7 +75,10 @@
v-model:value="form.birthDate"
/>
</a-form-item>
<a-form-item label="区分职称等级(如主治医师、副主任医师)" name="professionalTitle">
<a-form-item
label="区分职称等级(如主治医师、副主任医师)"
name="professionalTitle"
>
<a-input
allow-clear
placeholder="请输入区分职称等级(如主治医师、副主任医师)"
@@ -117,7 +120,10 @@
v-model:value="form.resume"
/>
</a-form-item>
<a-form-item label="使用 JSON 存储多个证件文件路径(如执业证、学历证)" name="certificationFiles">
<a-form-item
label="使用 JSON 存储多个证件文件路径(如执业证、学历证)"
name="certificationFiles"
>
<a-input
allow-clear
placeholder="请输入使用 JSON 存储多个证件文件路径(如执业证、学历证)"
@@ -152,7 +158,10 @@
v-model:value="form.applyType"
/>
</a-form-item>
<a-form-item label="审核状态 (10待审核 20审核通过 30驳回)" name="applyStatus">
<a-form-item
label="审核状态 (10待审核 20审核通过 30驳回)"
name="applyStatus"
>
<a-input
allow-clear
placeholder="请输入审核状态 (10待审核 20审核通过 30驳回)"
@@ -217,7 +226,10 @@
import { ref, reactive, watch } from 'vue';
import { Form, message } from 'ant-design-vue';
import { assignObject, uuid } from 'ele-admin-pro';
import { addClinicDoctorApply, updateClinicDoctorApply } from '@/api/clinic/clinicDoctorApply';
import {
addClinicDoctorApply,
updateClinicDoctorApply
} from '@/api/clinic/clinicDoctorApply';
import { ClinicDoctorApply } from '@/api/clinic/clinicDoctorApply/model';
import { useThemeStore } from '@/store/modules/theme';
import { storeToRefs } from 'pinia';
@@ -332,7 +344,9 @@
const formData = {
...form
};
const saveOrUpdate = isUpdate.value ? updateClinicDoctorApply : addClinicDoctorApply;
const saveOrUpdate = isUpdate.value
? updateClinicDoctorApply
: addClinicDoctorApply;
saveOrUpdate(formData)
.then((msg) => {
loading.value = false;
@@ -355,12 +369,12 @@
images.value = [];
if (props.data) {
assignObject(form, props.data);
if(props.data.image){
if (props.data.image) {
images.value.push({
uid: uuid(),
url: props.data.image,
status: 'done'
})
});
}
isUpdate.value = true;
} else {

View File

@@ -1,50 +1,54 @@
<template>
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-pro-table
ref="tableRef"
row-key="id"
:columns="columns"
:datasource="datasource"
:customRow="customRow"
tool-class="ele-toolbar-form"
class="sys-org-table"
>
<template #toolbar>
<search
@search="reload"
:selection="selection"
@add="openEdit"
@remove="removeBatch"
@batchMove="openMove"
/>
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-pro-table
ref="tableRef"
row-key="id"
:columns="columns"
:datasource="datasource"
:customRow="customRow"
tool-class="ele-toolbar-form"
class="sys-org-table"
>
<template #toolbar>
<search
@search="reload"
:selection="selection"
@add="openEdit"
@remove="removeBatch"
@batchMove="openMove"
/>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'image'">
<a-image :src="record.image" :width="50" />
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'image'">
<a-image :src="record.image" :width="50" />
</template>
<template v-if="column.key === 'status'">
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
</template>
<template v-if="column.key === 'action'">
<a-space>
<a @click="openEdit(record)">修改</a>
<a-divider type="vertical" />
<a-popconfirm
title="确定要删除此记录吗?"
@confirm="remove(record)"
>
<a class="ele-text-danger">删除</a>
</a-popconfirm>
</a-space>
</template>
<template v-if="column.key === 'status'">
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
</template>
</ele-pro-table>
</a-card>
<template v-if="column.key === 'action'">
<a-space>
<a @click="openEdit(record)">修改</a>
<a-divider type="vertical" />
<a-popconfirm
title="确定要删除此记录吗?"
@confirm="remove(record)"
>
<a class="ele-text-danger">删除</a>
</a-popconfirm>
</a-space>
</template>
</template>
</ele-pro-table>
</a-card>
<!-- 编辑弹窗 -->
<ClinicDoctorApplyEdit v-model:visible="showEdit" :data="current" @done="reload" />
<!-- 编辑弹窗 -->
<ClinicDoctorApplyEdit
v-model:visible="showEdit"
:data="current"
@done="reload"
/>
</a-page-header>
</template>
@@ -59,10 +63,17 @@
ColumnItem
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue';
import {getPageTitle} from '@/utils/common';
import { getPageTitle } from '@/utils/common';
import ClinicDoctorApplyEdit from './components/clinicDoctorApplyEdit.vue';
import { pageClinicDoctorApply, removeClinicDoctorApply, removeBatchClinicDoctorApply } from '@/api/clinic/clinicDoctorApply';
import type { ClinicDoctorApply, ClinicDoctorApplyParam } from '@/api/clinic/clinicDoctorApply/model';
import {
pageClinicDoctorApply,
removeClinicDoctorApply,
removeBatchClinicDoctorApply
} from '@/api/clinic/clinicDoctorApply';
import type {
ClinicDoctorApply,
ClinicDoctorApplyParam
} from '@/api/clinic/clinicDoctorApply/model';
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
@@ -103,7 +114,7 @@
title: '主键ID',
dataIndex: 'applyId',
key: 'applyId',
width: 90,
width: 90
},
{
title: '类型 0医生',

View File

@@ -168,7 +168,10 @@
import { ref, reactive, watch } from 'vue';
import { Form, message } from 'ant-design-vue';
import { assignObject, uuid } from 'ele-admin-pro';
import { addClinicDoctorMedicalRecord, updateClinicDoctorMedicalRecord } from '@/api/clinic/clinicDoctorMedicalRecord';
import {
addClinicDoctorMedicalRecord,
updateClinicDoctorMedicalRecord
} from '@/api/clinic/clinicDoctorMedicalRecord';
import { ClinicDoctorMedicalRecord } from '@/api/clinic/clinicDoctorMedicalRecord/model';
import { useThemeStore } from '@/store/modules/theme';
import { storeToRefs } from 'pinia';
@@ -275,7 +278,9 @@
const formData = {
...form
};
const saveOrUpdate = isUpdate.value ? updateClinicDoctorMedicalRecord : addClinicDoctorMedicalRecord;
const saveOrUpdate = isUpdate.value
? updateClinicDoctorMedicalRecord
: addClinicDoctorMedicalRecord;
saveOrUpdate(formData)
.then((msg) => {
loading.value = false;
@@ -298,12 +303,12 @@
images.value = [];
if (props.data) {
assignObject(form, props.data);
if(props.data.image){
if (props.data.image) {
images.value.push({
uid: uuid(),
url: props.data.image,
status: 'done'
})
});
}
isUpdate.value = true;
} else {

View File

@@ -1,50 +1,54 @@
<template>
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-pro-table
ref="tableRef"
row-key="id"
:columns="columns"
:datasource="datasource"
:customRow="customRow"
tool-class="ele-toolbar-form"
class="sys-org-table"
>
<template #toolbar>
<search
@search="reload"
:selection="selection"
@add="openEdit"
@remove="removeBatch"
@batchMove="openMove"
/>
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-pro-table
ref="tableRef"
row-key="id"
:columns="columns"
:datasource="datasource"
:customRow="customRow"
tool-class="ele-toolbar-form"
class="sys-org-table"
>
<template #toolbar>
<search
@search="reload"
:selection="selection"
@add="openEdit"
@remove="removeBatch"
@batchMove="openMove"
/>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'image'">
<a-image :src="record.image" :width="50" />
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'image'">
<a-image :src="record.image" :width="50" />
</template>
<template v-if="column.key === 'status'">
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
</template>
<template v-if="column.key === 'action'">
<a-space>
<a @click="openEdit(record)">修改</a>
<a-divider type="vertical" />
<a-popconfirm
title="确定要删除此记录吗?"
@confirm="remove(record)"
>
<a class="ele-text-danger">删除</a>
</a-popconfirm>
</a-space>
</template>
<template v-if="column.key === 'status'">
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
</template>
</ele-pro-table>
</a-card>
<template v-if="column.key === 'action'">
<a-space>
<a @click="openEdit(record)">修改</a>
<a-divider type="vertical" />
<a-popconfirm
title="确定要删除此记录吗?"
@confirm="remove(record)"
>
<a class="ele-text-danger">删除</a>
</a-popconfirm>
</a-space>
</template>
</template>
</ele-pro-table>
</a-card>
<!-- 编辑弹窗 -->
<ClinicDoctorMedicalRecordEdit v-model:visible="showEdit" :data="current" @done="reload" />
<!-- 编辑弹窗 -->
<ClinicDoctorMedicalRecordEdit
v-model:visible="showEdit"
:data="current"
@done="reload"
/>
</a-page-header>
</template>
@@ -59,10 +63,17 @@
ColumnItem
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue';
import {getPageTitle} from '@/utils/common';
import { getPageTitle } from '@/utils/common';
import ClinicDoctorMedicalRecordEdit from './components/clinicDoctorMedicalRecordEdit.vue';
import { pageClinicDoctorMedicalRecord, removeClinicDoctorMedicalRecord, removeBatchClinicDoctorMedicalRecord } from '@/api/clinic/clinicDoctorMedicalRecord';
import type { ClinicDoctorMedicalRecord, ClinicDoctorMedicalRecordParam } from '@/api/clinic/clinicDoctorMedicalRecord/model';
import {
pageClinicDoctorMedicalRecord,
removeClinicDoctorMedicalRecord,
removeBatchClinicDoctorMedicalRecord
} from '@/api/clinic/clinicDoctorMedicalRecord';
import type {
ClinicDoctorMedicalRecord,
ClinicDoctorMedicalRecordParam
} from '@/api/clinic/clinicDoctorMedicalRecord/model';
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
@@ -103,7 +114,7 @@
title: '主键ID',
dataIndex: 'id',
key: 'id',
width: 90,
width: 90
},
{
title: '买家用户ID',

View File

@@ -19,20 +19,20 @@
styleResponsive ? { md: 19, sm: 19, xs: 24 } : { flex: '1' }
"
>
<!-- <a-form-item label="类型 0经销商 1企业 2集团" name="type">-->
<!-- <a-input-->
<!-- allow-clear-->
<!-- placeholder="请输入类型 0经销商 1企业 2集团"-->
<!-- v-model:value="form.type"-->
<!-- />-->
<!-- </a-form-item>-->
<!-- <a-form-item label="自增ID" name="userId">-->
<!-- <a-input-->
<!-- allow-clear-->
<!-- placeholder="请输入自增ID"-->
<!-- v-model:value="form.userId"-->
<!-- />-->
<!-- </a-form-item>-->
<!-- <a-form-item label="类型 0经销商 1企业 2集团" name="type">-->
<!-- <a-input-->
<!-- allow-clear-->
<!-- placeholder="请输入类型 0经销商 1企业 2集团"-->
<!-- v-model:value="form.type"-->
<!-- />-->
<!-- </a-form-item>-->
<!-- <a-form-item label="自增ID" name="userId">-->
<!-- <a-input-->
<!-- allow-clear-->
<!-- placeholder="请输入自增ID"-->
<!-- v-model:value="form.userId"-->
<!-- />-->
<!-- </a-form-item>-->
<a-form-item label="姓名" name="realName">
<a-input
allow-clear
@@ -128,7 +128,10 @@
import { ref, reactive, watch } from 'vue';
import { Form, message } from 'ant-design-vue';
import { assignObject, uuid } from 'ele-admin-pro';
import { addClinicDoctorUser, updateClinicDoctorUser } from '@/api/clinic/clinicDoctorUser';
import {
addClinicDoctorUser,
updateClinicDoctorUser
} from '@/api/clinic/clinicDoctorUser';
import { ClinicDoctorUser } from '@/api/clinic/clinicDoctorUser/model';
import { useThemeStore } from '@/store/modules/theme';
import { storeToRefs } from 'pinia';
@@ -231,7 +234,9 @@
const formData = {
...form
};
const saveOrUpdate = isUpdate.value ? updateClinicDoctorUser : addClinicDoctorUser;
const saveOrUpdate = isUpdate.value
? updateClinicDoctorUser
: addClinicDoctorUser;
saveOrUpdate(formData)
.then((msg) => {
loading.value = false;
@@ -254,12 +259,12 @@
images.value = [];
if (props.data) {
assignObject(form, props.data);
if(props.data.image){
if (props.data.image) {
images.value.push({
uid: uuid(),
url: props.data.image,
status: 'done'
})
});
}
isUpdate.value = true;
} else {

View File

@@ -1,50 +1,54 @@
<template>
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-pro-table
ref="tableRef"
row-key="id"
:columns="columns"
:datasource="datasource"
:customRow="customRow"
tool-class="ele-toolbar-form"
class="sys-org-table"
>
<template #toolbar>
<search
@search="reload"
:selection="selection"
@add="openEdit"
@remove="removeBatch"
@batchMove="openMove"
/>
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-pro-table
ref="tableRef"
row-key="id"
:columns="columns"
:datasource="datasource"
:customRow="customRow"
tool-class="ele-toolbar-form"
class="sys-org-table"
>
<template #toolbar>
<search
@search="reload"
:selection="selection"
@add="openEdit"
@remove="removeBatch"
@batchMove="openMove"
/>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'image'">
<a-image :src="record.image" :width="50" />
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'image'">
<a-image :src="record.image" :width="50" />
</template>
<template v-if="column.key === 'status'">
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
</template>
<template v-if="column.key === 'action'">
<a-space>
<a @click="openEdit(record)">修改</a>
<a-divider type="vertical" />
<a-popconfirm
title="确定要删除此记录吗?"
@confirm="remove(record)"
>
<a class="ele-text-danger">删除</a>
</a-popconfirm>
</a-space>
</template>
<template v-if="column.key === 'status'">
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
</template>
</ele-pro-table>
</a-card>
<template v-if="column.key === 'action'">
<a-space>
<a @click="openEdit(record)">修改</a>
<a-divider type="vertical" />
<a-popconfirm
title="确定要删除此记录吗?"
@confirm="remove(record)"
>
<a class="ele-text-danger">删除</a>
</a-popconfirm>
</a-space>
</template>
</template>
</ele-pro-table>
</a-card>
<!-- 编辑弹窗 -->
<ClinicDoctorUserEdit v-model:visible="showEdit" :data="current" @done="reload" />
<!-- 编辑弹窗 -->
<ClinicDoctorUserEdit
v-model:visible="showEdit"
:data="current"
@done="reload"
/>
</a-page-header>
</template>
@@ -59,10 +63,17 @@
ColumnItem
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue';
import {getPageTitle} from '@/utils/common';
import { getPageTitle } from '@/utils/common';
import ClinicDoctorUserEdit from './components/clinicDoctorUserEdit.vue';
import { pageClinicDoctorUser, removeClinicDoctorUser, removeBatchClinicDoctorUser } from '@/api/clinic/clinicDoctorUser';
import type { ClinicDoctorUser, ClinicDoctorUserParam } from '@/api/clinic/clinicDoctorUser/model';
import {
pageClinicDoctorUser,
removeClinicDoctorUser,
removeBatchClinicDoctorUser
} from '@/api/clinic/clinicDoctorUser';
import type {
ClinicDoctorUser,
ClinicDoctorUserParam
} from '@/api/clinic/clinicDoctorUser/model';
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
@@ -103,7 +114,7 @@
title: '用户ID',
dataIndex: 'userId',
key: 'userId',
width: 90,
width: 90
},
{
title: '姓名',

View File

@@ -1,16 +1,16 @@
<!-- 搜索表单 -->
<template>
<a-space :size="10" style="flex-wrap: wrap">
<!-- <a-button type="primary" class="ele-btn-icon" @click="add">-->
<!-- <template #icon>-->
<!-- <PlusOutlined />-->
<!-- </template>-->
<!-- <span>添加</span>-->
<!-- </a-button>-->
<!-- <a-radio-group v-model:value="where.type">-->
<!-- <a-radio-button :value="0" @click="push(`/user-verify`)">个人</a-radio-button>-->
<!-- <a-radio-button :value="1" @click="push(`/user-verify2`)">企业</a-radio-button>-->
<!-- </a-radio-group>-->
<!-- <a-button type="primary" class="ele-btn-icon" @click="add">-->
<!-- <template #icon>-->
<!-- <PlusOutlined />-->
<!-- </template>-->
<!-- <span>添加</span>-->
<!-- </a-button>-->
<!-- <a-radio-group v-model:value="where.type">-->
<!-- <a-radio-button :value="0" @click="push(`/user-verify`)">个人</a-radio-button>-->
<!-- <a-radio-button :value="1" @click="push(`/user-verify2`)">企业</a-radio-button>-->
<!-- </a-radio-group>-->
<a-input-search
allow-clear
placeholder="请输入关键词"
@@ -24,9 +24,9 @@
<script lang="ts" setup>
// import { PlusOutlined } from '@ant-design/icons-vue';
import { watch } from 'vue';
import useSearch from "@/utils/use-search";
import {UserVerifyParam} from "@/api/system/userVerify/model";
import {push} from "@/utils/common";
import useSearch from '@/utils/use-search';
import { UserVerifyParam } from '@/api/system/userVerify/model';
import { push } from '@/utils/common';
const props = withDefaults(
defineProps<{
@@ -44,7 +44,7 @@
}>();
// 表单数据
const {where} = useSearch<UserVerifyParam>({
const { where } = useSearch<UserVerifyParam>({
id: undefined,
type: undefined,
keywords: '',
@@ -58,7 +58,7 @@
const reload = () => {
emit('search', where);
}
};
watch(
() => props.selection,

View File

@@ -21,7 +21,9 @@
>
<a-form-item label="类型" name="type">
<a-tag v-if="form.type === 0">{{ ['个人', '企业'][form.type] }}</a-tag>
<a-tag color="pink" v-if="form.type === 1">{{ ['个人', '企业'][form.type] }}</a-tag>
<a-tag color="pink" v-if="form.type === 1">{{
['个人', '企业'][form.type]
}}</a-tag>
</a-form-item>
<a-form-item label="所属站点" name="organizationName">
<a-input
@@ -47,32 +49,32 @@
v-model:value="form.phone"
/>
</a-form-item>
<!-- <a-form-item label="证件号码" name="idCard">-->
<!-- <a-input-->
<!-- allow-clear-->
<!-- :disabled="form.status == 1"-->
<!-- placeholder="请输入证件号码"-->
<!-- v-model:value="form.idCard"-->
<!-- />-->
<!-- </a-form-item>-->
<!-- <a-form-item label="身份证(正面)" name="sfz1">-->
<!-- <SelectFile-->
<!-- :placeholder="`请选择图片`"-->
<!-- :limit="1"-->
<!-- :data="sfz1"-->
<!-- @done="chooseSfz1"-->
<!-- @del="onDeleteSfz1"-->
<!-- />-->
<!-- </a-form-item>-->
<!-- <a-form-item label="身份证(反面)" name="sfz2">-->
<!-- <SelectFile-->
<!-- :placeholder="`请选择图片`"-->
<!-- :limit="1"-->
<!-- :data="sfz2"-->
<!-- @done="chooseSfz2"-->
<!-- @del="onDeleteSfz2"-->
<!-- />-->
<!-- </a-form-item>-->
<!-- <a-form-item label="证件号码" name="idCard">-->
<!-- <a-input-->
<!-- allow-clear-->
<!-- :disabled="form.status == 1"-->
<!-- placeholder="请输入证件号码"-->
<!-- v-model:value="form.idCard"-->
<!-- />-->
<!-- </a-form-item>-->
<!-- <a-form-item label="身份证(正面)" name="sfz1">-->
<!-- <SelectFile-->
<!-- :placeholder="`请选择图片`"-->
<!-- :limit="1"-->
<!-- :data="sfz1"-->
<!-- @done="chooseSfz1"-->
<!-- @del="onDeleteSfz1"-->
<!-- />-->
<!-- </a-form-item>-->
<!-- <a-form-item label="身份证(反面)" name="sfz2">-->
<!-- <SelectFile-->
<!-- :placeholder="`请选择图片`"-->
<!-- :limit="1"-->
<!-- :data="sfz2"-->
<!-- @done="chooseSfz2"-->
<!-- @del="onDeleteSfz2"-->
<!-- />-->
<!-- </a-form-item>-->
<a-form-item label="状态" name="status">
<a-radio-group v-model:value="form.status">
<a-radio :value="1">审核通过</a-radio>
@@ -92,261 +94,259 @@
</template>
<script lang="ts" setup>
import {ref, reactive, watch} from 'vue';
import {Form, message} from 'ant-design-vue';
import {assignObject, uuid} from 'ele-admin-pro';
import {addUserVerify, updateUserVerify} from '@/api/system/userVerify';
import {UserVerify} from '@/api/system/userVerify/model';
import {useThemeStore} from '@/store/modules/theme';
import {storeToRefs} from 'pinia';
import {ItemType} from 'ele-admin-pro/es/ele-image-upload/types';
import {FormInstance} from 'ant-design-vue/es/form';
import {FileRecord} from '@/api/system/file/model';
import {listUserRole, updateUserRole} from "@/api/system/userRole";
import { ref, reactive, watch } from 'vue';
import { Form, message } from 'ant-design-vue';
import { assignObject, uuid } from 'ele-admin-pro';
import { addUserVerify, updateUserVerify } from '@/api/system/userVerify';
import { UserVerify } from '@/api/system/userVerify/model';
import { useThemeStore } from '@/store/modules/theme';
import { storeToRefs } from 'pinia';
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
import { FormInstance } from 'ant-design-vue/es/form';
import { FileRecord } from '@/api/system/file/model';
import { listUserRole, updateUserRole } from '@/api/system/userRole';
// 是否是修改
const isUpdate = ref(false);
const useForm = Form.useForm;
// 是否开启响应式布局
const themeStore = useThemeStore();
const {styleResponsive} = storeToRefs(themeStore);
// 是否是修改
const isUpdate = ref(false);
const useForm = Form.useForm;
// 是否开启响应式布局
const themeStore = useThemeStore();
const { styleResponsive } = storeToRefs(themeStore);
const props = defineProps<{
// 弹窗是否打开
visible: boolean;
// 修改回显的数据
data?: UserVerify | null;
}>();
const props = defineProps<{
// 弹窗是否打开
visible: boolean;
// 修改回显的数据
data?: UserVerify | null;
}>();
const emit = defineEmits<{
(e: 'done'): void;
(e: 'update:visible', visible: boolean): void;
}>();
const emit = defineEmits<{
(e: 'done'): void;
(e: 'update:visible', visible: boolean): void;
}>();
// 提交状态
const loading = ref(false);
// 是否显示最大化切换按钮
const maxable = ref(true);
// 表格选中数据
const formRef = ref<FormInstance | null>(null);
const images = ref<ItemType[]>([]);
const sfz1 = ref<ItemType[]>([]);
const sfz2 = ref<ItemType[]>([]);
const userRoleId = ref<number>(0);
// 提交状态
const loading = ref(false);
// 是否显示最大化切换按钮
const maxable = ref(true);
// 表格选中数据
const formRef = ref<FormInstance | null>(null);
const images = ref<ItemType[]>([]);
const sfz1 = ref<ItemType[]>([]);
const sfz2 = ref<ItemType[]>([]);
const userRoleId = ref<number>(0);
// 用户信息
const form = reactive<UserVerify>({
id: undefined,
userId: undefined,
type: undefined,
name: undefined,
realName: undefined,
phone: undefined,
idCard: undefined,
birthday: undefined,
sfz1: undefined,
sfz2: undefined,
organizationName: undefined,
status: undefined,
deleted: undefined,
tenantId: undefined,
createTime: undefined,
updateTime: undefined,
comments: ''
});
/* 更新visible */
const updateVisible = (value: boolean) => {
emit('update:visible', value);
};
// 表单验证规则
const rules = reactive({
type: [
{
required: true,
type: 'number',
message: '请选择类型',
trigger: 'blur'
}
],
realName: [
{
required: true,
type: 'string',
message: '请填写真实姓名',
trigger: 'blur'
}
],
idCard: [
{
required: true,
type: 'string',
message: '请填写证件号码',
trigger: 'blur'
}
],
phone: [
{
required: true,
type: 'string',
message: '请填写手机号码',
trigger: 'blur'
}
],
sfz1: [
{
required: true,
type: 'string',
message: '请上传身份证正面',
trigger: 'blur'
}
],
sfz2: [
{
required: true,
type: 'string',
message: '请上传身份证反面',
trigger: 'blur'
}
],
status: [
{
required: true,
type: 'number',
message: '请选择审核状态',
trigger: 'blur'
}
],
comments: [
{
required: true,
type: 'string',
message: '请填写驳回原因',
trigger: 'blur'
}
]
});
const chooseSfz1 = (data: FileRecord) => {
sfz1.value.push({
uid: data.id,
url: data.path,
status: 'done'
// 用户信息
const form = reactive<UserVerify>({
id: undefined,
userId: undefined,
type: undefined,
name: undefined,
realName: undefined,
phone: undefined,
idCard: undefined,
birthday: undefined,
sfz1: undefined,
sfz2: undefined,
organizationName: undefined,
status: undefined,
deleted: undefined,
tenantId: undefined,
createTime: undefined,
updateTime: undefined,
comments: ''
});
form.sfz1 = data.path;
};
const onDeleteSfz1 = (index: number) => {
sfz1.value.splice(index, 1);
form.sfz1 = '';
};
/* 更新visible */
const updateVisible = (value: boolean) => {
emit('update:visible', value);
};
const chooseSfz2 = (data: FileRecord) => {
sfz2.value.push({
uid: data.id,
url: data.path,
status: 'done'
});
form.sfz2 = data.path;
};
const onDeleteSfz2 = (index: number) => {
sfz2.value.splice(index, 1);
form.sfz2 = '';
};
const {resetFields} = useForm(form, rules);
/* 保存编辑 */
const save = async () => {
if (!formRef.value) {
return;
}
if(form.status == 0){
message.error('请选择审核状态');
return;
}
// 审核通过
if(form.status == 1){
const res = await listUserRole({userId: form.userId,roleId: 1701})
const role = res[0];
if(role){
role.roleId = 1738;
userRoleId.value = Number(role.id);
updateUserRole(role).then(() => {});
}
}
// 驳回
if(form.status == 2){
const res = await listUserRole({userId: form.userId,roleId: 1738})
const role = res[0];
if(role){
role.roleId = 1701;
userRoleId.value = Number(role.id);
updateUserRole(role).then(() => {});
}
}
formRef.value
.validate()
.then(() => {
loading.value = true;
const formData = {
...form,
userRoleId: userRoleId.value,
};
const saveOrUpdate = isUpdate.value ? updateUserVerify : addUserVerify;
saveOrUpdate(formData)
.then((msg) => {
loading.value = false;
message.success(msg);
updateVisible(false);
if(formData.status == 1){
}
emit('done');
})
.catch((e) => {
loading.value = false;
message.error(e.message);
});
})
.catch(() => {
});
};
watch(
() => props.visible,
(visible) => {
if (visible) {
images.value = [];
sfz1.value = [];
sfz2.value = [];
if (props.data) {
assignObject(form, props.data);
if (props.data.sfz1) {
sfz1.value.push({
uid: uuid(),
url: props.data.sfz1,
status: 'done'
})
}
if (props.data.sfz2) {
sfz2.value.push({
uid: uuid(),
url: props.data.sfz2,
status: 'done'
})
}
isUpdate.value = true;
} else {
isUpdate.value = false;
// 表单验证规则
const rules = reactive({
type: [
{
required: true,
type: 'number',
message: '请选择类型',
trigger: 'blur'
}
} else {
resetFields();
],
realName: [
{
required: true,
type: 'string',
message: '请填写真实姓名',
trigger: 'blur'
}
],
idCard: [
{
required: true,
type: 'string',
message: '请填写证件号码',
trigger: 'blur'
}
],
phone: [
{
required: true,
type: 'string',
message: '请填写手机号码',
trigger: 'blur'
}
],
sfz1: [
{
required: true,
type: 'string',
message: '请上传身份证正面',
trigger: 'blur'
}
],
sfz2: [
{
required: true,
type: 'string',
message: '请上传身份证反面',
trigger: 'blur'
}
],
status: [
{
required: true,
type: 'number',
message: '请选择审核状态',
trigger: 'blur'
}
],
comments: [
{
required: true,
type: 'string',
message: '请填写驳回原因',
trigger: 'blur'
}
]
});
const chooseSfz1 = (data: FileRecord) => {
sfz1.value.push({
uid: data.id,
url: data.path,
status: 'done'
});
form.sfz1 = data.path;
};
const onDeleteSfz1 = (index: number) => {
sfz1.value.splice(index, 1);
form.sfz1 = '';
};
const chooseSfz2 = (data: FileRecord) => {
sfz2.value.push({
uid: data.id,
url: data.path,
status: 'done'
});
form.sfz2 = data.path;
};
const onDeleteSfz2 = (index: number) => {
sfz2.value.splice(index, 1);
form.sfz2 = '';
};
const { resetFields } = useForm(form, rules);
/* 保存编辑 */
const save = async () => {
if (!formRef.value) {
return;
}
},
{immediate: true}
);
if (form.status == 0) {
message.error('请选择审核状态');
return;
}
// 审核通过
if (form.status == 1) {
const res = await listUserRole({ userId: form.userId, roleId: 1701 });
const role = res[0];
if (role) {
role.roleId = 1738;
userRoleId.value = Number(role.id);
updateUserRole(role).then(() => {});
}
}
// 驳回
if (form.status == 2) {
const res = await listUserRole({ userId: form.userId, roleId: 1738 });
const role = res[0];
if (role) {
role.roleId = 1701;
userRoleId.value = Number(role.id);
updateUserRole(role).then(() => {});
}
}
formRef.value
.validate()
.then(() => {
loading.value = true;
const formData = {
...form,
userRoleId: userRoleId.value
};
const saveOrUpdate = isUpdate.value ? updateUserVerify : addUserVerify;
saveOrUpdate(formData)
.then((msg) => {
loading.value = false;
message.success(msg);
updateVisible(false);
if (formData.status == 1) {
}
emit('done');
})
.catch((e) => {
loading.value = false;
message.error(e.message);
});
})
.catch(() => {});
};
watch(
() => props.visible,
(visible) => {
if (visible) {
images.value = [];
sfz1.value = [];
sfz2.value = [];
if (props.data) {
assignObject(form, props.data);
if (props.data.sfz1) {
sfz1.value.push({
uid: uuid(),
url: props.data.sfz1,
status: 'done'
});
}
if (props.data.sfz2) {
sfz2.value.push({
uid: uuid(),
url: props.data.sfz2,
status: 'done'
});
}
isUpdate.value = true;
} else {
isUpdate.value = false;
}
} else {
resetFields();
}
},
{ immediate: true }
);
</script>

View File

@@ -21,18 +21,20 @@
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'image'">
<a-image :src="record.image" :width="50"/>
<a-image :src="record.image" :width="50" />
</template>
<template v-if="column.key === 'status'">
<a-tag v-if="record.status === 0" color="orange">待审核</a-tag>
<a-tag v-if="record.status === 1" color="green">审核通过</a-tag>
<a-tag v-if="record.status === 2" color="red">已驳回</a-tag>
<div class="text-orange-500 py-1" v-if="record.status == 2">原因{{ record.comments }}</div>
<div class="text-orange-500 py-1" v-if="record.status == 2"
>原因{{ record.comments }}</div
>
</template>
<template v-if="column.key === 'action'">
<div v-if="hasPermission('sys:userVerify:update')">
<a @click="openEdit(record)">修改</a>
<a-divider type="vertical"/>
<a-divider type="vertical" />
<a-popconfirm
title="确定要删除此记录吗?"
@confirm="remove(record)"
@@ -46,233 +48,240 @@
</a-card>
<!-- 编辑弹窗 -->
<UserVerifyEdit v-model:visible="showEdit" :data="current" @done="reload"/>
<UserVerifyEdit v-model:visible="showEdit" :data="current" @done="reload" />
</a-page-header>
</template>
<script lang="ts" setup>
import {createVNode, ref} from 'vue';
import {message, Modal} from 'ant-design-vue';
import {ExclamationCircleOutlined} from '@ant-design/icons-vue';
import type {EleProTable} from 'ele-admin-pro';
import type {
DatasourceFunction,
ColumnItem
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue';
import UserVerifyEdit from './components/userVerifyEdit.vue';
import {pageUserVerify, removeUserVerify, removeBatchUserVerify} from '@/api/system/userVerify';
import type {UserVerify, UserVerifyParam} from '@/api/system/userVerify/model';
import {getPageTitle} from "@/utils/common";
import {hasPermission} from "@/utils/permission";
import { createVNode, ref } from 'vue';
import { message, Modal } from 'ant-design-vue';
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
import type { EleProTable } from 'ele-admin-pro';
import type {
DatasourceFunction,
ColumnItem
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue';
import UserVerifyEdit from './components/userVerifyEdit.vue';
import {
pageUserVerify,
removeUserVerify,
removeBatchUserVerify
} from '@/api/system/userVerify';
import type {
UserVerify,
UserVerifyParam
} from '@/api/system/userVerify/model';
import { getPageTitle } from '@/utils/common';
import { hasPermission } from '@/utils/permission';
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
// 表格选中数据
const selection = ref<UserVerify[]>([]);
// 当前编辑数据
const current = ref<UserVerify | null>(null);
// 是否显示编辑弹窗
const showEdit = ref(false);
// 是否显示批量移动弹窗
const showMove = ref(false);
// 加载状态
const loading = ref(true);
// 表格选中数据
const selection = ref<UserVerify[]>([]);
// 当前编辑数据
const current = ref<UserVerify | null>(null);
// 是否显示编辑弹窗
const showEdit = ref(false);
// 是否显示批量移动弹窗
const showMove = ref(false);
// 加载状态
const loading = ref(true);
// 表格数据源
const datasource: DatasourceFunction = ({
page,
limit,
where,
orders,
filters
}) => {
if (filters) {
where.status = filters.status;
}
where.type = 0;
return pageUserVerify({
...where,
...orders,
// 表格数据源
const datasource: DatasourceFunction = ({
page,
limit
});
};
// 表格列配置
const columns = ref<ColumnItem[]>([
{
title: '用户ID',
dataIndex: 'userId',
key: 'userId',
align: 'center',
width: 90
},
// {
// title: '所属站点',
// dataIndex: 'organizationName',
// key: 'organizationName',
// align: 'center'
// },
// {
// title: '类型',
// dataIndex: 'type',
// key: 'type',
// align: 'center',
// customRender: ({text}) => ['个人', '企业'][text]
// },
{
title: '真实姓名',
dataIndex: 'realName',
key: 'realName',
align: 'center',
},
// {
// title: '证件号码',
// dataIndex: 'idCard',
// key: 'idCard',
// align: 'center',
// },
{
title: '手机号码',
dataIndex: 'phone',
key: 'phone',
align: 'center',
},
// {
// title: '身份证',
// dataIndex: 'sfz1',
// key: 'sfz1',
// align: 'center',
// },
// {
// title: '营业执照',
// dataIndex: 'yyzz',
// key: 'yyzz',
// align: 'center',
// },
// {
// title: '其他',
// dataIndex: 'files',
// key: 'files',
// align: 'center',
// },
{
title: '状态',
dataIndex: 'status',
key: 'status',
align: 'center',
},
// {
// title: '驳回',
// dataIndex: 'comments',
// key: 'comments',
// align: 'center',
// },
{
title: '添加时间',
dataIndex: 'createTime',
key: 'createTime',
align: 'center',
sorter: true
},
{
title: '操作',
key: 'action',
width: 130,
fixed: 'right',
align: 'center',
hideInSetting: true
}
]);
/* 搜索 */
const reload = (where?: UserVerifyParam) => {
selection.value = [];
tableRef?.value?.reload({where: where});
};
/* 打开编辑弹窗 */
const openEdit = (row?: UserVerify) => {
current.value = row ?? null;
showEdit.value = true;
};
/* 打开批量移动弹窗 */
const openMove = () => {
showMove.value = true;
};
/* 删除单个 */
const remove = (row: UserVerify) => {
const hide = message.loading('请求中..', 0);
removeUserVerify(row.id)
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
limit,
where,
orders,
filters
}) => {
if (filters) {
where.status = filters.status;
}
where.type = 0;
return pageUserVerify({
...where,
...orders,
page,
limit
});
};
/* 批量删除 */
const removeBatch = () => {
if (!selection.value.length) {
message.error('请至少选择一条数据');
return;
}
Modal.confirm({
title: '提示',
content: '确定要删除选中的记录吗?',
icon: createVNode(ExclamationCircleOutlined),
maskClosable: true,
onOk: () => {
const hide = message.loading('请求中..', 0);
removeBatchUserVerify(selection.value.map((d) => d.id))
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
}
});
};
/* 查询 */
const query = () => {
loading.value = true;
};
/* 自定义行属性 */
const customRow = (record: UserVerify) => {
return {
// 行点击事件
onClick: () => {
// console.log(record);
},
// 行双击事件
onDblclick: () => {
if (hasPermission('sys:userVerify:update')) {
openEdit(record);
}
}
};
};
query();
// 表格列配置
const columns = ref<ColumnItem[]>([
{
title: '用户ID',
dataIndex: 'userId',
key: 'userId',
align: 'center',
width: 90
},
// {
// title: '所属站点',
// dataIndex: 'organizationName',
// key: 'organizationName',
// align: 'center'
// },
// {
// title: '类型',
// dataIndex: 'type',
// key: 'type',
// align: 'center',
// customRender: ({text}) => ['个人', '企业'][text]
// },
{
title: '真实姓名',
dataIndex: 'realName',
key: 'realName',
align: 'center'
},
// {
// title: '证件号码',
// dataIndex: 'idCard',
// key: 'idCard',
// align: 'center',
// },
{
title: '手机号码',
dataIndex: 'phone',
key: 'phone',
align: 'center'
},
// {
// title: '身份证',
// dataIndex: 'sfz1',
// key: 'sfz1',
// align: 'center',
// },
// {
// title: '营业执照',
// dataIndex: 'yyzz',
// key: 'yyzz',
// align: 'center',
// },
// {
// title: '其他',
// dataIndex: 'files',
// key: 'files',
// align: 'center',
// },
{
title: '状态',
dataIndex: 'status',
key: 'status',
align: 'center'
},
// {
// title: '驳回',
// dataIndex: 'comments',
// key: 'comments',
// align: 'center',
// },
{
title: '添加时间',
dataIndex: 'createTime',
key: 'createTime',
align: 'center',
sorter: true
},
{
title: '操作',
key: 'action',
width: 130,
fixed: 'right',
align: 'center',
hideInSetting: true
}
]);
/* 搜索 */
const reload = (where?: UserVerifyParam) => {
selection.value = [];
tableRef?.value?.reload({ where: where });
};
/* 打开编辑弹窗 */
const openEdit = (row?: UserVerify) => {
current.value = row ?? null;
showEdit.value = true;
};
/* 打开批量移动弹窗 */
const openMove = () => {
showMove.value = true;
};
/* 删除单个 */
const remove = (row: UserVerify) => {
const hide = message.loading('请求中..', 0);
removeUserVerify(row.id)
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
};
/* 批量删除 */
const removeBatch = () => {
if (!selection.value.length) {
message.error('请至少选择一条数据');
return;
}
Modal.confirm({
title: '提示',
content: '确定要删除选中的记录吗?',
icon: createVNode(ExclamationCircleOutlined),
maskClosable: true,
onOk: () => {
const hide = message.loading('请求中..', 0);
removeBatchUserVerify(selection.value.map((d) => d.id))
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
}
});
};
/* 查询 */
const query = () => {
loading.value = true;
};
/* 自定义行属性 */
const customRow = (record: UserVerify) => {
return {
// 行点击事件
onClick: () => {
// console.log(record);
},
// 行双击事件
onDblclick: () => {
if (hasPermission('sys:userVerify:update')) {
openEdit(record);
}
}
};
};
query();
</script>
<script lang="ts">
export default {
name: 'UserVerify'
};
export default {
name: 'UserVerify'
};
</script>
<style lang="less" scoped></style>

View File

@@ -168,7 +168,10 @@
import { ref, reactive, watch } from 'vue';
import { Form, message } from 'ant-design-vue';
import { assignObject, uuid } from 'ele-admin-pro';
import { addClinicMedicalHistory, updateClinicMedicalHistory } from '@/api/clinic/clinicMedicalHistory';
import {
addClinicMedicalHistory,
updateClinicMedicalHistory
} from '@/api/clinic/clinicMedicalHistory';
import { ClinicMedicalHistory } from '@/api/clinic/clinicMedicalHistory/model';
import { useThemeStore } from '@/store/modules/theme';
import { storeToRefs } from 'pinia';
@@ -276,7 +279,9 @@
const formData = {
...form
};
const saveOrUpdate = isUpdate.value ? updateClinicMedicalHistory : addClinicMedicalHistory;
const saveOrUpdate = isUpdate.value
? updateClinicMedicalHistory
: addClinicMedicalHistory;
saveOrUpdate(formData)
.then((msg) => {
loading.value = false;
@@ -299,12 +304,12 @@
images.value = [];
if (props.data) {
assignObject(form, props.data);
if(props.data.image){
if (props.data.image) {
images.value.push({
uid: uuid(),
url: props.data.image,
status: 'done'
})
});
}
isUpdate.value = true;
} else {

View File

@@ -1,50 +1,54 @@
<template>
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-pro-table
ref="tableRef"
row-key="id"
:columns="columns"
:datasource="datasource"
:customRow="customRow"
tool-class="ele-toolbar-form"
class="sys-org-table"
>
<template #toolbar>
<search
@search="reload"
:selection="selection"
@add="openEdit"
@remove="removeBatch"
@batchMove="openMove"
/>
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-pro-table
ref="tableRef"
row-key="id"
:columns="columns"
:datasource="datasource"
:customRow="customRow"
tool-class="ele-toolbar-form"
class="sys-org-table"
>
<template #toolbar>
<search
@search="reload"
:selection="selection"
@add="openEdit"
@remove="removeBatch"
@batchMove="openMove"
/>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'image'">
<a-image :src="record.image" :width="50" />
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'image'">
<a-image :src="record.image" :width="50" />
</template>
<template v-if="column.key === 'status'">
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
</template>
<template v-if="column.key === 'action'">
<a-space>
<a @click="openEdit(record)">修改</a>
<a-divider type="vertical" />
<a-popconfirm
title="确定要删除此记录吗?"
@confirm="remove(record)"
>
<a class="ele-text-danger">删除</a>
</a-popconfirm>
</a-space>
</template>
<template v-if="column.key === 'status'">
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
</template>
</ele-pro-table>
</a-card>
<template v-if="column.key === 'action'">
<a-space>
<a @click="openEdit(record)">修改</a>
<a-divider type="vertical" />
<a-popconfirm
title="确定要删除此记录吗?"
@confirm="remove(record)"
>
<a class="ele-text-danger">删除</a>
</a-popconfirm>
</a-space>
</template>
</template>
</ele-pro-table>
</a-card>
<!-- 编辑弹窗 -->
<ClinicMedicalHistoryEdit v-model:visible="showEdit" :data="current" @done="reload" />
<!-- 编辑弹窗 -->
<ClinicMedicalHistoryEdit
v-model:visible="showEdit"
:data="current"
@done="reload"
/>
</a-page-header>
</template>
@@ -59,10 +63,17 @@
ColumnItem
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue';
import {getPageTitle} from '@/utils/common';
import { getPageTitle } from '@/utils/common';
import ClinicMedicalHistoryEdit from './components/clinicMedicalHistoryEdit.vue';
import { pageClinicMedicalHistory, removeClinicMedicalHistory, removeBatchClinicMedicalHistory } from '@/api/clinic/clinicMedicalHistory';
import type { ClinicMedicalHistory, ClinicMedicalHistoryParam } from '@/api/clinic/clinicMedicalHistory/model';
import {
pageClinicMedicalHistory,
removeClinicMedicalHistory,
removeBatchClinicMedicalHistory
} from '@/api/clinic/clinicMedicalHistory';
import type {
ClinicMedicalHistory,
ClinicMedicalHistoryParam
} from '@/api/clinic/clinicMedicalHistory/model';
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
@@ -103,7 +114,7 @@
title: '主键ID',
dataIndex: 'id',
key: 'id',
width: 90,
width: 90
},
{
title: '买家用户ID',

View File

@@ -92,7 +92,10 @@
import { ref, reactive, watch } from 'vue';
import { Form, message } from 'ant-design-vue';
import { assignObject } from 'ele-admin-pro';
import { addClinicMedicine, updateClinicMedicine } from '@/api/clinic/clinicMedicine';
import {
addClinicMedicine,
updateClinicMedicine
} from '@/api/clinic/clinicMedicine';
import { ClinicMedicine } from '@/api/clinic/clinicMedicine/model';
import { useThemeStore } from '@/store/modules/theme';
import { storeToRefs } from 'pinia';
@@ -175,7 +178,9 @@
const formData = {
...form
};
const saveOrUpdate = isUpdate.value ? updateClinicMedicine : addClinicMedicine;
const saveOrUpdate = isUpdate.value
? updateClinicMedicine
: addClinicMedicine;
saveOrUpdate(formData)
.then((msg) => {
loading.value = false;

View File

@@ -1,50 +1,54 @@
<template>
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-pro-table
ref="tableRef"
row-key="id"
:columns="columns"
:datasource="datasource"
:customRow="customRow"
tool-class="ele-toolbar-form"
class="sys-org-table"
>
<template #toolbar>
<search
@search="reload"
:selection="selection"
@add="openEdit"
@remove="removeBatch"
@batchMove="openMove"
/>
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-pro-table
ref="tableRef"
row-key="id"
:columns="columns"
:datasource="datasource"
:customRow="customRow"
tool-class="ele-toolbar-form"
class="sys-org-table"
>
<template #toolbar>
<search
@search="reload"
:selection="selection"
@add="openEdit"
@remove="removeBatch"
@batchMove="openMove"
/>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'image'">
<a-image :src="record.image" :width="50" />
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'image'">
<a-image :src="record.image" :width="50" />
</template>
<template v-if="column.key === 'status'">
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
</template>
<template v-if="column.key === 'action'">
<a-space>
<a @click="openEdit(record)">修改</a>
<a-divider type="vertical" />
<a-popconfirm
title="确定要删除此记录吗?"
@confirm="remove(record)"
>
<a class="ele-text-danger">删除</a>
</a-popconfirm>
</a-space>
</template>
<template v-if="column.key === 'status'">
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
</template>
</ele-pro-table>
</a-card>
<template v-if="column.key === 'action'">
<a-space>
<a @click="openEdit(record)">修改</a>
<a-divider type="vertical" />
<a-popconfirm
title="确定要删除此记录吗?"
@confirm="remove(record)"
>
<a class="ele-text-danger">删除</a>
</a-popconfirm>
</a-space>
</template>
</template>
</ele-pro-table>
</a-card>
<!-- 编辑弹窗 -->
<ClinicMedicineEdit v-model:visible="showEdit" :data="current" @done="reload" />
<!-- 编辑弹窗 -->
<ClinicMedicineEdit
v-model:visible="showEdit"
:data="current"
@done="reload"
/>
</a-page-header>
</template>
@@ -59,10 +63,17 @@
ColumnItem
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue';
import {getPageTitle} from '@/utils/common';
import { getPageTitle } from '@/utils/common';
import ClinicMedicineEdit from './components/clinicMedicineEdit.vue';
import { pageClinicMedicine, removeClinicMedicine, removeBatchClinicMedicine } from '@/api/clinic/clinicMedicine';
import type { ClinicMedicine, ClinicMedicineParam } from '@/api/clinic/clinicMedicine/model';
import {
pageClinicMedicine,
removeClinicMedicine,
removeBatchClinicMedicine
} from '@/api/clinic/clinicMedicine';
import type {
ClinicMedicine,
ClinicMedicineParam
} from '@/api/clinic/clinicMedicine/model';
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
@@ -103,7 +114,7 @@
title: '主键ID',
dataIndex: 'id',
key: 'id',
width: 90,
width: 90
},
{
title: '药名',

View File

@@ -168,7 +168,10 @@
import { ref, reactive, watch } from 'vue';
import { Form, message } from 'ant-design-vue';
import { assignObject, uuid } from 'ele-admin-pro';
import { addClinicMedicineInout, updateClinicMedicineInout } from '@/api/clinic/clinicMedicineInout';
import {
addClinicMedicineInout,
updateClinicMedicineInout
} from '@/api/clinic/clinicMedicineInout';
import { ClinicMedicineInout } from '@/api/clinic/clinicMedicineInout/model';
import { useThemeStore } from '@/store/modules/theme';
import { storeToRefs } from 'pinia';
@@ -275,7 +278,9 @@
const formData = {
...form
};
const saveOrUpdate = isUpdate.value ? updateClinicMedicineInout : addClinicMedicineInout;
const saveOrUpdate = isUpdate.value
? updateClinicMedicineInout
: addClinicMedicineInout;
saveOrUpdate(formData)
.then((msg) => {
loading.value = false;
@@ -298,12 +303,12 @@
images.value = [];
if (props.data) {
assignObject(form, props.data);
if(props.data.image){
if (props.data.image) {
images.value.push({
uid: uuid(),
url: props.data.image,
status: 'done'
})
});
}
isUpdate.value = true;
} else {

View File

@@ -1,50 +1,54 @@
<template>
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-pro-table
ref="tableRef"
row-key="id"
:columns="columns"
:datasource="datasource"
:customRow="customRow"
tool-class="ele-toolbar-form"
class="sys-org-table"
>
<template #toolbar>
<search
@search="reload"
:selection="selection"
@add="openEdit"
@remove="removeBatch"
@batchMove="openMove"
/>
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-pro-table
ref="tableRef"
row-key="id"
:columns="columns"
:datasource="datasource"
:customRow="customRow"
tool-class="ele-toolbar-form"
class="sys-org-table"
>
<template #toolbar>
<search
@search="reload"
:selection="selection"
@add="openEdit"
@remove="removeBatch"
@batchMove="openMove"
/>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'image'">
<a-image :src="record.image" :width="50" />
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'image'">
<a-image :src="record.image" :width="50" />
</template>
<template v-if="column.key === 'status'">
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
</template>
<template v-if="column.key === 'action'">
<a-space>
<a @click="openEdit(record)">修改</a>
<a-divider type="vertical" />
<a-popconfirm
title="确定要删除此记录吗?"
@confirm="remove(record)"
>
<a class="ele-text-danger">删除</a>
</a-popconfirm>
</a-space>
</template>
<template v-if="column.key === 'status'">
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
</template>
</ele-pro-table>
</a-card>
<template v-if="column.key === 'action'">
<a-space>
<a @click="openEdit(record)">修改</a>
<a-divider type="vertical" />
<a-popconfirm
title="确定要删除此记录吗?"
@confirm="remove(record)"
>
<a class="ele-text-danger">删除</a>
</a-popconfirm>
</a-space>
</template>
</template>
</ele-pro-table>
</a-card>
<!-- 编辑弹窗 -->
<ClinicMedicineInoutEdit v-model:visible="showEdit" :data="current" @done="reload" />
<!-- 编辑弹窗 -->
<ClinicMedicineInoutEdit
v-model:visible="showEdit"
:data="current"
@done="reload"
/>
</a-page-header>
</template>
@@ -59,10 +63,17 @@
ColumnItem
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue';
import {getPageTitle} from '@/utils/common';
import { getPageTitle } from '@/utils/common';
import ClinicMedicineInoutEdit from './components/clinicMedicineInoutEdit.vue';
import { pageClinicMedicineInout, removeClinicMedicineInout, removeBatchClinicMedicineInout } from '@/api/clinic/clinicMedicineInout';
import type { ClinicMedicineInout, ClinicMedicineInoutParam } from '@/api/clinic/clinicMedicineInout/model';
import {
pageClinicMedicineInout,
removeClinicMedicineInout,
removeBatchClinicMedicineInout
} from '@/api/clinic/clinicMedicineInout';
import type {
ClinicMedicineInout,
ClinicMedicineInoutParam
} from '@/api/clinic/clinicMedicineInout/model';
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
@@ -103,7 +114,7 @@
title: '主键ID',
dataIndex: 'id',
key: 'id',
width: 90,
width: 90
},
{
title: '买家用户ID',

View File

@@ -77,7 +77,10 @@
import { ref, reactive, watch } from 'vue';
import { Form, message } from 'ant-design-vue';
import { assignObject, uuid } from 'ele-admin-pro';
import { addClinicMedicineStock, updateClinicMedicineStock } from '@/api/clinic/clinicMedicineStock';
import {
addClinicMedicineStock,
updateClinicMedicineStock
} from '@/api/clinic/clinicMedicineStock';
import { ClinicMedicineStock } from '@/api/clinic/clinicMedicineStock/model';
import { useThemeStore } from '@/store/modules/theme';
import { storeToRefs } from 'pinia';
@@ -171,7 +174,9 @@
const formData = {
...form
};
const saveOrUpdate = isUpdate.value ? updateClinicMedicineStock : addClinicMedicineStock;
const saveOrUpdate = isUpdate.value
? updateClinicMedicineStock
: addClinicMedicineStock;
saveOrUpdate(formData)
.then((msg) => {
loading.value = false;
@@ -194,12 +199,12 @@
images.value = [];
if (props.data) {
assignObject(form, props.data);
if(props.data.image){
if (props.data.image) {
images.value.push({
uid: uuid(),
url: props.data.image,
status: 'done'
})
});
}
isUpdate.value = true;
} else {

View File

@@ -1,50 +1,54 @@
<template>
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-pro-table
ref="tableRef"
row-key="id"
:columns="columns"
:datasource="datasource"
:customRow="customRow"
tool-class="ele-toolbar-form"
class="sys-org-table"
>
<template #toolbar>
<search
@search="reload"
:selection="selection"
@add="openEdit"
@remove="removeBatch"
@batchMove="openMove"
/>
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-pro-table
ref="tableRef"
row-key="id"
:columns="columns"
:datasource="datasource"
:customRow="customRow"
tool-class="ele-toolbar-form"
class="sys-org-table"
>
<template #toolbar>
<search
@search="reload"
:selection="selection"
@add="openEdit"
@remove="removeBatch"
@batchMove="openMove"
/>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'image'">
<a-image :src="record.image" :width="50" />
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'image'">
<a-image :src="record.image" :width="50" />
</template>
<template v-if="column.key === 'status'">
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
</template>
<template v-if="column.key === 'action'">
<a-space>
<a @click="openEdit(record)">修改</a>
<a-divider type="vertical" />
<a-popconfirm
title="确定要删除此记录吗?"
@confirm="remove(record)"
>
<a class="ele-text-danger">删除</a>
</a-popconfirm>
</a-space>
</template>
<template v-if="column.key === 'status'">
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
</template>
</ele-pro-table>
</a-card>
<template v-if="column.key === 'action'">
<a-space>
<a @click="openEdit(record)">修改</a>
<a-divider type="vertical" />
<a-popconfirm
title="确定要删除此记录吗?"
@confirm="remove(record)"
>
<a class="ele-text-danger">删除</a>
</a-popconfirm>
</a-space>
</template>
</template>
</ele-pro-table>
</a-card>
<!-- 编辑弹窗 -->
<ClinicMedicineStockEdit v-model:visible="showEdit" :data="current" @done="reload" />
<!-- 编辑弹窗 -->
<ClinicMedicineStockEdit
v-model:visible="showEdit"
:data="current"
@done="reload"
/>
</a-page-header>
</template>
@@ -59,10 +63,17 @@
ColumnItem
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue';
import {getPageTitle} from '@/utils/common';
import { getPageTitle } from '@/utils/common';
import ClinicMedicineStockEdit from './components/clinicMedicineStockEdit.vue';
import { pageClinicMedicineStock, removeClinicMedicineStock, removeBatchClinicMedicineStock } from '@/api/clinic/clinicMedicineStock';
import type { ClinicMedicineStock, ClinicMedicineStockParam } from '@/api/clinic/clinicMedicineStock/model';
import {
pageClinicMedicineStock,
removeClinicMedicineStock,
removeBatchClinicMedicineStock
} from '@/api/clinic/clinicMedicineStock';
import type {
ClinicMedicineStock,
ClinicMedicineStockParam
} from '@/api/clinic/clinicMedicineStock/model';
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
@@ -103,7 +114,7 @@
title: '主键ID',
dataIndex: 'id',
key: 'id',
width: 90,
width: 90
},
{
title: '药品',

View File

@@ -26,7 +26,10 @@
v-model:value="form.orderNo"
/>
</a-form-item>
<a-form-item label="订单类型0商城订单 1预定订单/外卖 2会员卡" name="type">
<a-form-item
label="订单类型0商城订单 1预定订单/外卖 2会员卡"
name="type"
>
<a-input
allow-clear
placeholder="请输入订单类型0商城订单 1预定订单/外卖 2会员卡"
@@ -47,7 +50,10 @@
v-model:value="form.deliveryType"
/>
</a-form-item>
<a-form-item label="下单渠道0小程序预定 1俱乐部训练场 3活动订场" name="channel">
<a-form-item
label="下单渠道0小程序预定 1俱乐部训练场 3活动订场"
name="channel"
>
<a-input
allow-clear
placeholder="请输入下单渠道0小程序预定 1俱乐部训练场 3活动订场"
@@ -215,7 +221,10 @@
v-model:value="form.totalPrice"
/>
</a-form-item>
<a-form-item label="减少的金额使用VIP会员折扣、优惠券抵扣、优惠券折扣后减去的价格" name="reducePrice">
<a-form-item
label="减少的金额使用VIP会员折扣、优惠券抵扣、优惠券折扣后减去的价格"
name="reducePrice"
>
<a-input
allow-clear
placeholder="请输入减少的金额使用VIP会员折扣、优惠券抵扣、优惠券折扣后减去的价格"
@@ -299,21 +308,30 @@
v-model:value="form.payUserId"
/>
</a-form-item>
<a-form-item label="0余额支付1微信支付2支付宝支付3银联支付4现金支付5POS机支付6免费7积分支付" name="payType">
<a-form-item
label="0余额支付1微信支付2支付宝支付3银联支付4现金支付5POS机支付6免费7积分支付"
name="payType"
>
<a-input
allow-clear
placeholder="请输入0余额支付1微信支付2支付宝支付3银联支付4现金支付5POS机支付6免费7积分支付"
v-model:value="form.payType"
/>
</a-form-item>
<a-form-item label="微信支付子类型JSAPI小程序支付NATIVE扫码支付" name="wechatPayType">
<a-form-item
label="微信支付子类型JSAPI小程序支付NATIVE扫码支付"
name="wechatPayType"
>
<a-input
allow-clear
placeholder="请输入微信支付子类型JSAPI小程序支付NATIVE扫码支付"
v-model:value="form.wechatPayType"
/>
</a-form-item>
<a-form-item label="0余额支付1微信支付2支付宝支付3银联支付4现金支付5POS机支付6免费7积分支付" name="friendPayType">
<a-form-item
label="0余额支付1微信支付2支付宝支付3银联支付4现金支付5POS机支付6免费7积分支付"
name="friendPayType"
>
<a-input
allow-clear
placeholder="请输入0余额支付1微信支付2支付宝支付3银联支付4现金支付5POS机支付6免费7积分支付"
@@ -327,14 +345,20 @@
v-model:value="form.payStatus"
/>
</a-form-item>
<a-form-item label="0未使用1已完成2已取消3取消中4退款申请中5退款被拒绝6退款成功7客户端申请退款" name="orderStatus">
<a-form-item
label="0未使用1已完成2已取消3取消中4退款申请中5退款被拒绝6退款成功7客户端申请退款"
name="orderStatus"
>
<a-input
allow-clear
placeholder="请输入0未使用1已完成2已取消3取消中4退款申请中5退款被拒绝6退款成功7客户端申请退款"
v-model:value="form.orderStatus"
/>
</a-form-item>
<a-form-item label="发货状态(10未发货 20已发货 30部分发货)" name="deliveryStatus">
<a-form-item
label="发货状态(10未发货 20已发货 30部分发货)"
name="deliveryStatus"
>
<a-input
allow-clear
placeholder="请输入发货状态(10未发货 20已发货 30部分发货)"
@@ -369,7 +393,10 @@
v-model:value="form.evaluateTime"
/>
</a-form-item>
<a-form-item label="优惠类型0无、1抵扣优惠券、2折扣优惠券、3、VIP月卡、4VIP年卡5VIP次卡、6VIP会员卡、7IC月卡、8IC年卡、9IC次卡、10IC会员卡、11免费订单、12VIP充值卡、13IC充值卡、14VIP季卡、15IC季卡" name="couponType">
<a-form-item
label="优惠类型0无、1抵扣优惠券、2折扣优惠券、3、VIP月卡、4VIP年卡5VIP次卡、6VIP会员卡、7IC月卡、8IC年卡、9IC次卡、10IC会员卡、11免费订单、12VIP充值卡、13IC充值卡、14VIP季卡、15IC季卡"
name="couponType"
>
<a-input
allow-clear
placeholder="请输入优惠类型0无、1抵扣优惠券、2折扣优惠券、3、VIP月卡、4VIP年卡5VIP次卡、6VIP会员卡、7IC月卡、8IC年卡、9IC次卡、10IC会员卡、11免费订单、12VIP充值卡、13IC充值卡、14VIP季卡、15IC季卡"
@@ -383,7 +410,10 @@
v-model:value="form.couponDesc"
/>
</a-form-item>
<a-form-item label="二维码地址,保存订单号,支付成功后才生成" name="qrcode">
<a-form-item
label="二维码地址,保存订单号,支付成功后才生成"
name="qrcode"
>
<a-input
allow-clear
placeholder="请输入二维码地址,保存订单号,支付成功后才生成"
@@ -411,7 +441,10 @@
v-model:value="form.startTime"
/>
</a-form-item>
<a-form-item label="是否已开具发票0未开发票1已开发票2不能开具发票" name="isInvoice">
<a-form-item
label="是否已开具发票0未开发票1已开发票2不能开具发票"
name="isInvoice"
>
<a-input
allow-clear
placeholder="请输入是否已开具发票0未开发票1已开发票2不能开具发票"
@@ -474,7 +507,10 @@
v-model:value="form.hasTakeGift"
/>
</a-form-item>
<a-form-item label="对账情况0=未对账1=已对账3=已对账金额对不上4=未查询到该订单" name="checkBill">
<a-form-item
label="对账情况0=未对账1=已对账3=已对账金额对不上4=未查询到该订单"
name="checkBill"
>
<a-input
allow-clear
placeholder="请输入对账情况0=未对账1=已对账3=已对账金额对不上4=未查询到该订单"
@@ -701,7 +737,9 @@
const formData = {
...form
};
const saveOrUpdate = isUpdate.value ? updateClinicOrder : addClinicOrder;
const saveOrUpdate = isUpdate.value
? updateClinicOrder
: addClinicOrder;
saveOrUpdate(formData)
.then((msg) => {
loading.value = false;
@@ -724,12 +762,12 @@
images.value = [];
if (props.data) {
assignObject(form, props.data);
if(props.data.image){
if (props.data.image) {
images.value.push({
uid: uuid(),
url: props.data.image,
status: 'done'
})
});
}
isUpdate.value = true;
} else {

View File

@@ -1,50 +1,54 @@
<template>
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-pro-table
ref="tableRef"
row-key="id"
:columns="columns"
:datasource="datasource"
:customRow="customRow"
tool-class="ele-toolbar-form"
class="sys-org-table"
>
<template #toolbar>
<search
@search="reload"
:selection="selection"
@add="openEdit"
@remove="removeBatch"
@batchMove="openMove"
/>
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-pro-table
ref="tableRef"
row-key="id"
:columns="columns"
:datasource="datasource"
:customRow="customRow"
tool-class="ele-toolbar-form"
class="sys-org-table"
>
<template #toolbar>
<search
@search="reload"
:selection="selection"
@add="openEdit"
@remove="removeBatch"
@batchMove="openMove"
/>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'image'">
<a-image :src="record.image" :width="50" />
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'image'">
<a-image :src="record.image" :width="50" />
</template>
<template v-if="column.key === 'status'">
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
</template>
<template v-if="column.key === 'action'">
<a-space>
<a @click="openEdit(record)">修改</a>
<a-divider type="vertical" />
<a-popconfirm
title="确定要删除此记录吗?"
@confirm="remove(record)"
>
<a class="ele-text-danger">删除</a>
</a-popconfirm>
</a-space>
</template>
<template v-if="column.key === 'status'">
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
</template>
</ele-pro-table>
</a-card>
<template v-if="column.key === 'action'">
<a-space>
<a @click="openEdit(record)">修改</a>
<a-divider type="vertical" />
<a-popconfirm
title="确定要删除此记录吗?"
@confirm="remove(record)"
>
<a class="ele-text-danger">删除</a>
</a-popconfirm>
</a-space>
</template>
</template>
</ele-pro-table>
</a-card>
<!-- 编辑弹窗 -->
<ClinicOrderEdit v-model:visible="showEdit" :data="current" @done="reload" />
<!-- 编辑弹窗 -->
<ClinicOrderEdit
v-model:visible="showEdit"
:data="current"
@done="reload"
/>
</a-page-header>
</template>
@@ -59,10 +63,17 @@
ColumnItem
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue';
import {getPageTitle} from '@/utils/common';
import { getPageTitle } from '@/utils/common';
import ClinicOrderEdit from './components/clinicOrderEdit.vue';
import { pageClinicOrder, removeClinicOrder, removeBatchClinicOrder } from '@/api/clinic/clinicOrder';
import type { ClinicOrder, ClinicOrderParam } from '@/api/clinic/clinicOrder/model';
import {
pageClinicOrder,
removeClinicOrder,
removeBatchClinicOrder
} from '@/api/clinic/clinicOrder';
import type {
ClinicOrder,
ClinicOrderParam
} from '@/api/clinic/clinicOrder/model';
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
@@ -103,7 +114,7 @@
title: '订单号',
dataIndex: 'orderId',
key: 'orderId',
width: 90,
width: 90
},
{
title: '订单编号',
@@ -346,7 +357,8 @@
width: 120
},
{
title: '0余额支付1微信支付2支付宝支付3银联支付4现金支付5POS机支付6免费7积分支付',
title:
'0余额支付1微信支付2支付宝支付3银联支付4现金支付5POS机支付6免费7积分支付',
dataIndex: 'payType',
key: 'payType',
width: 120
@@ -358,7 +370,8 @@
ellipsis: true
},
{
title: '0余额支付1微信支付2支付宝支付3银联支付4现金支付5POS机支付6免费7积分支付',
title:
'0余额支付1微信支付2支付宝支付3银联支付4现金支付5POS机支付6免费7积分支付',
dataIndex: 'friendPayType',
key: 'friendPayType',
width: 120
@@ -370,7 +383,8 @@
width: 120
},
{
title: '0未使用1已完成2已取消3取消中4退款申请中5退款被拒绝6退款成功7客户端申请退款',
title:
'0未使用1已完成2已取消3取消中4退款申请中5退款被拒绝6退款成功7客户端申请退款',
dataIndex: 'orderStatus',
key: 'orderStatus',
width: 120
@@ -406,7 +420,8 @@
width: 120
},
{
title: '优惠类型0无、1抵扣优惠券、2折扣优惠券、3、VIP月卡、4VIP年卡5VIP次卡、6VIP会员卡、7IC月卡、8IC年卡、9IC次卡、10IC会员卡、11免费订单、12VIP充值卡、13IC充值卡、14VIP季卡、15IC季卡',
title:
'优惠类型0无、1抵扣优惠券、2折扣优惠券、3、VIP月卡、4VIP年卡5VIP次卡、6VIP会员卡、7IC月卡、8IC年卡、9IC次卡、10IC会员卡、11免费订单、12VIP充值卡、13IC充值卡、14VIP季卡、15IC季卡',
dataIndex: 'couponType',
key: 'couponType',
width: 120
@@ -496,7 +511,8 @@
width: 120
},
{
title: '对账情况0=未对账1=已对账3=已对账金额对不上4=未查询到该订单',
title:
'对账情况0=未对账1=已对账3=已对账金额对不上4=未查询到该订单',
dataIndex: 'checkBill',
key: 'checkBill',
width: 120

View File

@@ -19,13 +19,13 @@
styleResponsive ? { md: 19, sm: 19, xs: 24 } : { flex: '1' }
"
>
<!-- <a-form-item label="类型 0经销商 1企业 2集团" name="type">-->
<!-- <a-input-->
<!-- allow-clear-->
<!-- placeholder="请输入类型 0经销商 1企业 2集团"-->
<!-- v-model:value="form.type"-->
<!-- />-->
<!-- </a-form-item>-->
<!-- <a-form-item label="类型 0经销商 1企业 2集团" name="type">-->
<!-- <a-input-->
<!-- allow-clear-->
<!-- placeholder="请输入类型 0经销商 1企业 2集团"-->
<!-- v-model:value="form.type"-->
<!-- />-->
<!-- </a-form-item>-->
<a-form-item v-if="isUpdate" label="用户ID" name="userId">
{{ form.userId }}
</a-form-item>
@@ -104,7 +104,10 @@
import { ref, reactive, watch } from 'vue';
import { Form, message } from 'ant-design-vue';
import { assignObject } from 'ele-admin-pro';
import { addClinicPatientUser, updateClinicPatientUser } from '@/api/clinic/clinicPatientUser';
import {
addClinicPatientUser,
updateClinicPatientUser
} from '@/api/clinic/clinicPatientUser';
import { ClinicPatientUser } from '@/api/clinic/clinicPatientUser/model';
import { useThemeStore } from '@/store/modules/theme';
import { storeToRefs } from 'pinia';
@@ -187,7 +190,9 @@
const formData = {
...form
};
const saveOrUpdate = isUpdate.value ? updateClinicPatientUser : addClinicPatientUser;
const saveOrUpdate = isUpdate.value
? updateClinicPatientUser
: addClinicPatientUser;
saveOrUpdate(formData)
.then((msg) => {
loading.value = false;

View File

@@ -1,63 +1,67 @@
<template>
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-pro-table
ref="tableRef"
row-key="id"
:columns="columns"
:datasource="datasource"
:customRow="customRow"
tool-class="ele-toolbar-form"
class="sys-org-table"
>
<template #toolbar>
<search
@search="reload"
:selection="selection"
@add="openEdit"
@remove="removeBatch"
@batchMove="openMove"
/>
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-pro-table
ref="tableRef"
row-key="id"
:columns="columns"
:datasource="datasource"
:customRow="customRow"
tool-class="ele-toolbar-form"
class="sys-org-table"
>
<template #toolbar>
<search
@search="reload"
:selection="selection"
@add="openEdit"
@remove="removeBatch"
@batchMove="openMove"
/>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'image'">
<a-image :src="record.image" :width="50" />
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'image'">
<a-image :src="record.image" :width="50" />
</template>
<template v-if="column.key === 'realName'">
<a-space>
<a-avatar :src="record.avatar" />
<div class="flex flex-col">
<div>{{ record.realName }}</div>
<div class="text-gray-400">{{ record.phone }}</div>
</div>
</a-space>
</template>
<template v-if="column.key === 'sex'">
<a-tag v-if="record.sex == '1'" color="blue"></a-tag>
<a-tag v-if="record.sex == '2'" color="pink"></a-tag>
</template>
<template v-if="column.key === 'status'">
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
</template>
<template v-if="column.key === 'action'">
<a-space>
<a @click="openEdit(record)">修改</a>
<a-divider type="vertical" />
<a-popconfirm
title="确定要删除此记录吗?"
@confirm="remove(record)"
>
<a class="ele-text-danger">删除</a>
</a-popconfirm>
</a-space>
</template>
<template v-if="column.key === 'realName'">
<a-space>
<a-avatar :src="record.avatar" />
<div class="flex flex-col">
<div>{{ record.realName }}</div>
<div class="text-gray-400">{{ record.phone }}</div>
</div>
</a-space>
</template>
</ele-pro-table>
</a-card>
<template v-if="column.key === 'sex'">
<a-tag v-if="record.sex == '1'" color="blue"></a-tag>
<a-tag v-if="record.sex == '2'" color="pink"></a-tag>
</template>
<template v-if="column.key === 'status'">
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
</template>
<template v-if="column.key === 'action'">
<a-space>
<a @click="openEdit(record)">修改</a>
<a-divider type="vertical" />
<a-popconfirm
title="确定要删除此记录吗?"
@confirm="remove(record)"
>
<a class="ele-text-danger">删除</a>
</a-popconfirm>
</a-space>
</template>
</template>
</ele-pro-table>
</a-card>
<!-- 编辑弹窗 -->
<ClinicPatientUserEdit v-model:visible="showEdit" :data="current" @done="reload" />
<!-- 编辑弹窗 -->
<ClinicPatientUserEdit
v-model:visible="showEdit"
:data="current"
@done="reload"
/>
</a-page-header>
</template>
@@ -72,10 +76,17 @@
ColumnItem
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue';
import {getPageTitle} from '@/utils/common';
import { getPageTitle } from '@/utils/common';
import ClinicPatientUserEdit from './components/clinicPatientUserEdit.vue';
import { pageClinicPatientUser, removeClinicPatientUser, removeBatchClinicPatientUser } from '@/api/clinic/clinicPatientUser';
import type { ClinicPatientUser, ClinicPatientUserParam } from '@/api/clinic/clinicPatientUser/model';
import {
pageClinicPatientUser,
removeClinicPatientUser,
removeBatchClinicPatientUser
} from '@/api/clinic/clinicPatientUser';
import type {
ClinicPatientUser,
ClinicPatientUserParam
} from '@/api/clinic/clinicPatientUser/model';
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
@@ -134,7 +145,7 @@
title: '性别',
dataIndex: 'sex',
key: 'sex',
align: 'center',
align: 'center'
},
{
title: '年龄',

View File

@@ -146,7 +146,10 @@
import { ref, reactive, watch } from 'vue';
import { Form, message } from 'ant-design-vue';
import { assignObject, uuid } from 'ele-admin-pro';
import { addClinicPrescription, updateClinicPrescription } from '@/api/clinic/clinicPrescription';
import {
addClinicPrescription,
updateClinicPrescription
} from '@/api/clinic/clinicPrescription';
import { ClinicPrescription } from '@/api/clinic/clinicPrescription/model';
import { useThemeStore } from '@/store/modules/theme';
import { storeToRefs } from 'pinia';
@@ -236,7 +239,9 @@
const formData = {
...form
};
const saveOrUpdate = isUpdate.value ? updateClinicPrescription : addClinicPrescription;
const saveOrUpdate = isUpdate.value
? updateClinicPrescription
: addClinicPrescription;
saveOrUpdate(formData)
.then((msg) => {
loading.value = false;

View File

@@ -1,50 +1,54 @@
<template>
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-pro-table
ref="tableRef"
row-key="id"
:columns="columns"
:datasource="datasource"
:customRow="customRow"
tool-class="ele-toolbar-form"
class="sys-org-table"
>
<template #toolbar>
<search
@search="reload"
:selection="selection"
@add="openEdit"
@remove="removeBatch"
@batchMove="openMove"
/>
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-pro-table
ref="tableRef"
row-key="id"
:columns="columns"
:datasource="datasource"
:customRow="customRow"
tool-class="ele-toolbar-form"
class="sys-org-table"
>
<template #toolbar>
<search
@search="reload"
:selection="selection"
@add="openEdit"
@remove="removeBatch"
@batchMove="openMove"
/>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'image'">
<a-image :src="record.image" :width="50" />
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'image'">
<a-image :src="record.image" :width="50" />
</template>
<template v-if="column.key === 'status'">
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
</template>
<template v-if="column.key === 'action'">
<a-space>
<a @click="openEdit(record)">修改</a>
<a-divider type="vertical" />
<a-popconfirm
title="确定要删除此记录吗?"
@confirm="remove(record)"
>
<a class="ele-text-danger">删除</a>
</a-popconfirm>
</a-space>
</template>
<template v-if="column.key === 'status'">
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
</template>
</ele-pro-table>
</a-card>
<template v-if="column.key === 'action'">
<a-space>
<a @click="openEdit(record)">修改</a>
<a-divider type="vertical" />
<a-popconfirm
title="确定要删除此记录吗?"
@confirm="remove(record)"
>
<a class="ele-text-danger">删除</a>
</a-popconfirm>
</a-space>
</template>
</template>
</ele-pro-table>
</a-card>
<!-- 编辑弹窗 -->
<ClinicPrescriptionEdit v-model:visible="showEdit" :data="current" @done="reload" />
<!-- 编辑弹窗 -->
<ClinicPrescriptionEdit
v-model:visible="showEdit"
:data="current"
@done="reload"
/>
</a-page-header>
</template>
@@ -59,10 +63,17 @@
ColumnItem
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue';
import {getPageTitle} from '@/utils/common';
import { getPageTitle } from '@/utils/common';
import ClinicPrescriptionEdit from './components/clinicPrescriptionEdit.vue';
import { pageClinicPrescription, removeClinicPrescription, removeBatchClinicPrescription } from '@/api/clinic/clinicPrescription';
import type { ClinicPrescription, ClinicPrescriptionParam } from '@/api/clinic/clinicPrescription/model';
import {
pageClinicPrescription,
removeClinicPrescription,
removeBatchClinicPrescription
} from '@/api/clinic/clinicPrescription';
import type {
ClinicPrescription,
ClinicPrescriptionParam
} from '@/api/clinic/clinicPrescription/model';
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
@@ -103,7 +114,7 @@
title: '主键ID',
dataIndex: 'id',
key: 'id',
width: 90,
width: 90
},
{
title: '患者',

View File

@@ -121,7 +121,10 @@
import { ref, reactive, watch } from 'vue';
import { Form, message } from 'ant-design-vue';
import { assignObject } from 'ele-admin-pro';
import { addClinicPrescriptionItem, updateClinicPrescriptionItem } from '@/api/clinic/clinicPrescriptionItem';
import {
addClinicPrescriptionItem,
updateClinicPrescriptionItem
} from '@/api/clinic/clinicPrescriptionItem';
import { ClinicPrescriptionItem } from '@/api/clinic/clinicPrescriptionItem/model';
import { useThemeStore } from '@/store/modules/theme';
import { storeToRefs } from 'pinia';
@@ -206,7 +209,9 @@
const formData = {
...form
};
const saveOrUpdate = isUpdate.value ? updateClinicPrescriptionItem : addClinicPrescriptionItem;
const saveOrUpdate = isUpdate.value
? updateClinicPrescriptionItem
: addClinicPrescriptionItem;
saveOrUpdate(formData)
.then((msg) => {
loading.value = false;

View File

@@ -1,50 +1,54 @@
<template>
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-pro-table
ref="tableRef"
row-key="id"
:columns="columns"
:datasource="datasource"
:customRow="customRow"
tool-class="ele-toolbar-form"
class="sys-org-table"
>
<template #toolbar>
<search
@search="reload"
:selection="selection"
@add="openEdit"
@remove="removeBatch"
@batchMove="openMove"
/>
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-pro-table
ref="tableRef"
row-key="id"
:columns="columns"
:datasource="datasource"
:customRow="customRow"
tool-class="ele-toolbar-form"
class="sys-org-table"
>
<template #toolbar>
<search
@search="reload"
:selection="selection"
@add="openEdit"
@remove="removeBatch"
@batchMove="openMove"
/>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'image'">
<a-image :src="record.image" :width="50" />
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'image'">
<a-image :src="record.image" :width="50" />
</template>
<template v-if="column.key === 'status'">
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
</template>
<template v-if="column.key === 'action'">
<a-space>
<a @click="openEdit(record)">修改</a>
<a-divider type="vertical" />
<a-popconfirm
title="确定要删除此记录吗?"
@confirm="remove(record)"
>
<a class="ele-text-danger">删除</a>
</a-popconfirm>
</a-space>
</template>
<template v-if="column.key === 'status'">
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
</template>
</ele-pro-table>
</a-card>
<template v-if="column.key === 'action'">
<a-space>
<a @click="openEdit(record)">修改</a>
<a-divider type="vertical" />
<a-popconfirm
title="确定要删除此记录吗?"
@confirm="remove(record)"
>
<a class="ele-text-danger">删除</a>
</a-popconfirm>
</a-space>
</template>
</template>
</ele-pro-table>
</a-card>
<!-- 编辑弹窗 -->
<ClinicPrescriptionItemEdit v-model:visible="showEdit" :data="current" @done="reload" />
<!-- 编辑弹窗 -->
<ClinicPrescriptionItemEdit
v-model:visible="showEdit"
:data="current"
@done="reload"
/>
</a-page-header>
</template>
@@ -59,10 +63,17 @@
ColumnItem
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue';
import {getPageTitle} from '@/utils/common';
import { getPageTitle } from '@/utils/common';
import ClinicPrescriptionItemEdit from './components/clinicPrescriptionItemEdit.vue';
import { pageClinicPrescriptionItem, removeClinicPrescriptionItem, removeBatchClinicPrescriptionItem } from '@/api/clinic/clinicPrescriptionItem';
import type { ClinicPrescriptionItem, ClinicPrescriptionItemParam } from '@/api/clinic/clinicPrescriptionItem/model';
import {
pageClinicPrescriptionItem,
removeClinicPrescriptionItem,
removeBatchClinicPrescriptionItem
} from '@/api/clinic/clinicPrescriptionItem';
import type {
ClinicPrescriptionItem,
ClinicPrescriptionItemParam
} from '@/api/clinic/clinicPrescriptionItem/model';
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
@@ -103,7 +114,7 @@
title: '自增ID',
dataIndex: 'id',
key: 'id',
width: 90,
width: 90
},
{
title: '关联处方',

View File

@@ -168,7 +168,10 @@
import { ref, reactive, watch } from 'vue';
import { Form, message } from 'ant-design-vue';
import { assignObject, uuid } from 'ele-admin-pro';
import { addClinicReport, updateClinicReport } from '@/api/clinic/clinicReport';
import {
addClinicReport,
updateClinicReport
} from '@/api/clinic/clinicReport';
import { ClinicReport } from '@/api/clinic/clinicReport/model';
import { useThemeStore } from '@/store/modules/theme';
import { storeToRefs } from 'pinia';
@@ -275,7 +278,9 @@
const formData = {
...form
};
const saveOrUpdate = isUpdate.value ? updateClinicReport : addClinicReport;
const saveOrUpdate = isUpdate.value
? updateClinicReport
: addClinicReport;
saveOrUpdate(formData)
.then((msg) => {
loading.value = false;
@@ -298,12 +303,12 @@
images.value = [];
if (props.data) {
assignObject(form, props.data);
if(props.data.image){
if (props.data.image) {
images.value.push({
uid: uuid(),
url: props.data.image,
status: 'done'
})
});
}
isUpdate.value = true;
} else {

View File

@@ -1,50 +1,54 @@
<template>
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-pro-table
ref="tableRef"
row-key="id"
:columns="columns"
:datasource="datasource"
:customRow="customRow"
tool-class="ele-toolbar-form"
class="sys-org-table"
>
<template #toolbar>
<search
@search="reload"
:selection="selection"
@add="openEdit"
@remove="removeBatch"
@batchMove="openMove"
/>
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-pro-table
ref="tableRef"
row-key="id"
:columns="columns"
:datasource="datasource"
:customRow="customRow"
tool-class="ele-toolbar-form"
class="sys-org-table"
>
<template #toolbar>
<search
@search="reload"
:selection="selection"
@add="openEdit"
@remove="removeBatch"
@batchMove="openMove"
/>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'image'">
<a-image :src="record.image" :width="50" />
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'image'">
<a-image :src="record.image" :width="50" />
</template>
<template v-if="column.key === 'status'">
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
</template>
<template v-if="column.key === 'action'">
<a-space>
<a @click="openEdit(record)">修改</a>
<a-divider type="vertical" />
<a-popconfirm
title="确定要删除此记录吗?"
@confirm="remove(record)"
>
<a class="ele-text-danger">删除</a>
</a-popconfirm>
</a-space>
</template>
<template v-if="column.key === 'status'">
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
</template>
</ele-pro-table>
</a-card>
<template v-if="column.key === 'action'">
<a-space>
<a @click="openEdit(record)">修改</a>
<a-divider type="vertical" />
<a-popconfirm
title="确定要删除此记录吗?"
@confirm="remove(record)"
>
<a class="ele-text-danger">删除</a>
</a-popconfirm>
</a-space>
</template>
</template>
</ele-pro-table>
</a-card>
<!-- 编辑弹窗 -->
<ClinicReportEdit v-model:visible="showEdit" :data="current" @done="reload" />
<!-- 编辑弹窗 -->
<ClinicReportEdit
v-model:visible="showEdit"
:data="current"
@done="reload"
/>
</a-page-header>
</template>
@@ -59,10 +63,17 @@
ColumnItem
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue';
import {getPageTitle} from '@/utils/common';
import { getPageTitle } from '@/utils/common';
import ClinicReportEdit from './components/clinicReportEdit.vue';
import { pageClinicReport, removeClinicReport, removeBatchClinicReport } from '@/api/clinic/clinicReport';
import type { ClinicReport, ClinicReportParam } from '@/api/clinic/clinicReport/model';
import {
pageClinicReport,
removeClinicReport,
removeBatchClinicReport
} from '@/api/clinic/clinicReport';
import type {
ClinicReport,
ClinicReportParam
} from '@/api/clinic/clinicReport/model';
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
@@ -103,7 +114,7 @@
title: '主键ID',
dataIndex: 'id',
key: 'id',
width: 90,
width: 90
},
{
title: '买家用户ID',

View File

@@ -168,7 +168,10 @@
import { ref, reactive, watch } from 'vue';
import { Form, message } from 'ant-design-vue';
import { assignObject, uuid } from 'ele-admin-pro';
import { addClinicVisitRecord, updateClinicVisitRecord } from '@/api/clinic/clinicVisitRecord';
import {
addClinicVisitRecord,
updateClinicVisitRecord
} from '@/api/clinic/clinicVisitRecord';
import { ClinicVisitRecord } from '@/api/clinic/clinicVisitRecord/model';
import { useThemeStore } from '@/store/modules/theme';
import { storeToRefs } from 'pinia';
@@ -261,7 +264,9 @@
const formData = {
...form
};
const saveOrUpdate = isUpdate.value ? updateClinicVisitRecord : addClinicVisitRecord;
const saveOrUpdate = isUpdate.value
? updateClinicVisitRecord
: addClinicVisitRecord;
saveOrUpdate(formData)
.then((msg) => {
loading.value = false;

View File

@@ -1,50 +1,54 @@
<template>
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-pro-table
ref="tableRef"
row-key="id"
:columns="columns"
:datasource="datasource"
:customRow="customRow"
tool-class="ele-toolbar-form"
class="sys-org-table"
>
<template #toolbar>
<search
@search="reload"
:selection="selection"
@add="openEdit"
@remove="removeBatch"
@batchMove="openMove"
/>
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-pro-table
ref="tableRef"
row-key="id"
:columns="columns"
:datasource="datasource"
:customRow="customRow"
tool-class="ele-toolbar-form"
class="sys-org-table"
>
<template #toolbar>
<search
@search="reload"
:selection="selection"
@add="openEdit"
@remove="removeBatch"
@batchMove="openMove"
/>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'image'">
<a-image :src="record.image" :width="50" />
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'image'">
<a-image :src="record.image" :width="50" />
</template>
<template v-if="column.key === 'status'">
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
</template>
<template v-if="column.key === 'action'">
<a-space>
<a @click="openEdit(record)">修改</a>
<a-divider type="vertical" />
<a-popconfirm
title="确定要删除此记录吗?"
@confirm="remove(record)"
>
<a class="ele-text-danger">删除</a>
</a-popconfirm>
</a-space>
</template>
<template v-if="column.key === 'status'">
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
</template>
</ele-pro-table>
</a-card>
<template v-if="column.key === 'action'">
<a-space>
<a @click="openEdit(record)">修改</a>
<a-divider type="vertical" />
<a-popconfirm
title="确定要删除此记录吗?"
@confirm="remove(record)"
>
<a class="ele-text-danger">删除</a>
</a-popconfirm>
</a-space>
</template>
</template>
</ele-pro-table>
</a-card>
<!-- 编辑弹窗 -->
<ClinicVisitRecordEdit v-model:visible="showEdit" :data="current" @done="reload" />
<!-- 编辑弹窗 -->
<ClinicVisitRecordEdit
v-model:visible="showEdit"
:data="current"
@done="reload"
/>
</a-page-header>
</template>
@@ -59,10 +63,17 @@
ColumnItem
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue';
import {getPageTitle} from '@/utils/common';
import { getPageTitle } from '@/utils/common';
import ClinicVisitRecordEdit from './components/clinicVisitRecordEdit.vue';
import { pageClinicVisitRecord, removeClinicVisitRecord, removeBatchClinicVisitRecord } from '@/api/clinic/clinicVisitRecord';
import type { ClinicVisitRecord, ClinicVisitRecordParam } from '@/api/clinic/clinicVisitRecord/model';
import {
pageClinicVisitRecord,
removeClinicVisitRecord,
removeBatchClinicVisitRecord
} from '@/api/clinic/clinicVisitRecord';
import type {
ClinicVisitRecord,
ClinicVisitRecordParam
} from '@/api/clinic/clinicVisitRecord/model';
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
@@ -103,7 +114,7 @@
title: '主键ID',
dataIndex: 'id',
key: 'id',
width: 90,
width: 90
},
{
title: '买家用户ID',

View File

@@ -61,10 +61,14 @@
/>
</div>
<div class="flex flex-col gap-2 mt-2">
<div class="w-[500px] space-y-2" v-for="(_, index) in images" :key="index">
<div
class="w-[500px] space-y-2"
v-for="(_, index) in images"
:key="index"
>
<a-input
v-model:value="images[index].title"
:placeholder="`请输入图片标题${index+1}`"
:placeholder="`请输入图片标题${index + 1}`"
/>
<a-input
v-model:value="images[index].path"
@@ -132,10 +136,7 @@
</a-form-item>
</template>
<template v-if="form.type == 4">
<a-form-item
label="文本"
name="comments"
>
<a-form-item label="文本" name="comments">
<a-textarea
:rows="4"
:maxlength="200"
@@ -145,10 +146,7 @@
</a-form-item>
</template>
<a-form-item label="链接" name="path" v-if="form.type == 4">
<a-input
v-model:value="form.path"
placeholder="https://"
/>
<a-input v-model:value="form.path" placeholder="https://" />
</a-form-item>
<a-form-item label="尺寸">
<a-space>
@@ -167,7 +165,9 @@
/>
</a-space>
<div class="pt-2">
<span class="text-gray-400">广告位尺寸大小(默认值100% * 500px)</span>
<span class="text-gray-400"
>广告位尺寸大小(默认值100% * 500px)</span
>
</div>
</a-form-item>
<a-form-item label="位置">
@@ -175,7 +175,7 @@
allow-clear
:tree-data="navigationList"
tree-default-expand-all
style="width: 500px;"
style="width: 500px"
placeholder="请选择所属栏目"
:value="form.categoryId || undefined"
:listHeight="700"
@@ -191,7 +191,12 @@
v-model:value="form.style"
/>
<div class="pt-2 none">
<a class="text-sm text-gray-400" href="https://tailwindcss.com/docs/padding" target="_blank">Tailwind 使用说明</a>
<a
class="text-sm text-gray-400"
href="https://tailwindcss.com/docs/padding"
target="_blank"
>Tailwind 使用说明</a
>
</div>
</a-form-item>
<a-form-item label="描述" name="comments" v-if="form.type != 4">
@@ -221,182 +226,185 @@
</template>
<script lang="ts" setup>
import {ref, reactive, watch} from 'vue';
import {Form, message} from 'ant-design-vue';
import {assignObject} from 'ele-admin-pro';
import {addCmsAd, updateCmsAd} from '@/api/cms/cmsAd';
import {CmsAd} from '@/api/cms/cmsAd/model';
import {useThemeStore} from '@/store/modules/theme';
import {storeToRefs} from 'pinia';
import {FormInstance} from 'ant-design-vue/es/form';
import {useI18n} from 'vue-i18n';
import {FileRecord} from '@/api/system/file/model';
import {CmsNavigation} from "@/api/cms/cmsNavigation/model";
import { ref, reactive, watch } from 'vue';
import { Form, message } from 'ant-design-vue';
import { assignObject } from 'ele-admin-pro';
import { addCmsAd, updateCmsAd } from '@/api/cms/cmsAd';
import { CmsAd } from '@/api/cms/cmsAd/model';
import { useThemeStore } from '@/store/modules/theme';
import { storeToRefs } from 'pinia';
import { FormInstance } from 'ant-design-vue/es/form';
import { useI18n } from 'vue-i18n';
import { FileRecord } from '@/api/system/file/model';
import { CmsNavigation } from '@/api/cms/cmsNavigation/model';
// 是否是修改
const isUpdate = ref(false);
const disabled = ref(true);
const useForm = Form.useForm;
// 是否开启响应式布局
const themeStore = useThemeStore();
const {styleResponsive} = storeToRefs(themeStore);
// 是否是修改
const isUpdate = ref(false);
const disabled = ref(true);
const useForm = Form.useForm;
// 是否开启响应式布局
const themeStore = useThemeStore();
const { styleResponsive } = storeToRefs(themeStore);
const props = defineProps<{
// 弹窗是否打开
visible: boolean;
// 修改回显的数据
data?: CmsAd | null;
// 栏目导航
navigationList?: CmsNavigation[];
}>();
const props = defineProps<{
// 弹窗是否打开
visible: boolean;
// 修改回显的数据
data?: CmsAd | null;
// 栏目导航
navigationList?: CmsNavigation[];
}>();
const emit = defineEmits<{
(e: 'done'): void;
(e: 'update:visible', visible: boolean): void;
}>();
const emit = defineEmits<{
(e: 'done'): void;
(e: 'update:visible', visible: boolean): void;
}>();
// 提交状态
const loading = ref(false);
// 已上传数据
const images = ref<any[]>([]);
const {locale} = useI18n();
// 是否显示最大化切换按钮
const maxable = ref(true);
// 表格选中数据
const formRef = ref<FormInstance | null>(null);
// 提交状态
const loading = ref(false);
// 已上传数据
const images = ref<any[]>([]);
const { locale } = useI18n();
// 是否显示最大化切换按钮
const maxable = ref(true);
// 表格选中数据
const formRef = ref<FormInstance | null>(null);
// 用户信息
const form = reactive<CmsAd>({
adId: undefined,
type: undefined,
code: undefined,
categoryId: undefined,
name: '',
style: '',
images: '',
imageList: undefined,
width: '',
height: '',
path: '',
status: 0,
comments: '',
lang: locale.value || undefined,
sortNumber: 100,
merchantId: undefined
});
/* 更新visible */
const updateVisible = (value: boolean) => {
emit('update:visible', value);
};
// 表单验证规则
const rules = {
name: [
{
required: true,
message: '请输入标题',
trigger: 'blur'
}
],
type: [
{
required: true,
message: '请选择类型',
trigger: 'blur'
}
],
images: [
{
required: true,
message: '请上传图片或视频',
trigger: 'blur',
validator: (_rule: any, _: string) => {
return new Promise<void>((resolve, reject) => {
if (images.value.length == 0) {
return reject('请上传图片或视频文件');
}
return resolve();
});
}
}
]
};
const {resetFields} = useForm(form, rules);
const chooseFile = (data: FileRecord) => {
images.value.push({
uid: data.id,
url: data.downloadUrl + '?x-oss-process=image/resize,m_fixed,w_2000/quality,Q_90',
status: 'done',
title: '', // 初始化标题为空
path: '' // 初始化链接为空
// 用户信息
const form = reactive<CmsAd>({
adId: undefined,
type: undefined,
code: undefined,
categoryId: undefined,
name: '',
style: '',
images: '',
imageList: undefined,
width: '',
height: '',
path: '',
status: 0,
comments: '',
lang: locale.value || undefined,
sortNumber: 100,
merchantId: undefined
});
form.images = data.downloadUrl + '?x-oss-process=image/resize,m_fixed,w_2000/quality,Q_90';
};
const onDeleteItem = (index: number) => {
images.value.splice(index, 1);
form.images = '';
};
/* 更新visible */
const updateVisible = (value: boolean) => {
emit('update:visible', value);
};
// 选择栏目
const onCategoryId = (id: number) => {
form.categoryId = id;
};
const onTypeChange = () => {
disabled.value = !disabled.value;
}
/* 保存编辑 */
const save = () => {
if (!formRef.value) {
return;
}
formRef.value
.validate()
.then(() => {
loading.value = true;
const formData = {
...form,
images: JSON.stringify(images.value)
};
const saveOrUpdate = isUpdate.value ? updateCmsAd : addCmsAd;
saveOrUpdate(formData)
.then((msg) => {
loading.value = false;
message.success(msg);
updateVisible(false);
emit('done');
})
.catch((e) => {
loading.value = false;
message.error(e.message);
});
})
.catch(() => {
});
};
watch(
() => props.visible,
(visible) => {
if (visible) {
if (props.data) {
assignObject(form, props.data);
images.value = props.data.imageList;
isUpdate.value = true;
} else {
images.value = [];
disabled.value = true;
isUpdate.value = false;
// 表单验证规则
const rules = {
name: [
{
required: true,
message: '请输入标题',
trigger: 'blur'
}
} else {
resetFields();
],
type: [
{
required: true,
message: '请选择类型',
trigger: 'blur'
}
],
images: [
{
required: true,
message: '请上传图片或视频',
trigger: 'blur',
validator: (_rule: any, _: string) => {
return new Promise<void>((resolve, reject) => {
if (images.value.length == 0) {
return reject('请上传图片或视频文件');
}
return resolve();
});
}
}
]
};
const { resetFields } = useForm(form, rules);
const chooseFile = (data: FileRecord) => {
images.value.push({
uid: data.id,
url:
data.downloadUrl +
'?x-oss-process=image/resize,m_fixed,w_2000/quality,Q_90',
status: 'done',
title: '', // 初始化标题为空
path: '' // 初始化链接为空
});
form.images =
data.downloadUrl +
'?x-oss-process=image/resize,m_fixed,w_2000/quality,Q_90';
};
const onDeleteItem = (index: number) => {
images.value.splice(index, 1);
form.images = '';
};
// 选择栏目
const onCategoryId = (id: number) => {
form.categoryId = id;
};
const onTypeChange = () => {
disabled.value = !disabled.value;
};
/* 保存编辑 */
const save = () => {
if (!formRef.value) {
return;
}
},
{immediate: true}
);
formRef.value
.validate()
.then(() => {
loading.value = true;
const formData = {
...form,
images: JSON.stringify(images.value)
};
const saveOrUpdate = isUpdate.value ? updateCmsAd : addCmsAd;
saveOrUpdate(formData)
.then((msg) => {
loading.value = false;
message.success(msg);
updateVisible(false);
emit('done');
})
.catch((e) => {
loading.value = false;
message.error(e.message);
});
})
.catch(() => {});
};
watch(
() => props.visible,
(visible) => {
if (visible) {
if (props.data) {
assignObject(form, props.data);
images.value = props.data.imageList;
isUpdate.value = true;
} else {
images.value = [];
disabled.value = true;
isUpdate.value = false;
}
} else {
resetFields();
}
},
{ immediate: true }
);
</script>

View File

@@ -1,7 +1,7 @@
<!-- 搜索表单 -->
<template>
<a-space :size="10" style="flex-wrap: wrap">
<a-button type="primary" class="ele-btn-icon" @click="add">
<a-button type="primary" class="ele-btn-icon" @click="add">
<template #icon>
<PlusOutlined />
</template>
@@ -32,9 +32,9 @@
<script lang="ts" setup>
import { PlusOutlined } from '@ant-design/icons-vue';
import { watch } from 'vue';
import {CmsNavigation} from "@/api/cms/cmsNavigation/model";
import {CmsAdParam} from "@/api/cms/cmsAd/model";
import useSearch from "@/utils/use-search";
import { CmsNavigation } from '@/api/cms/cmsNavigation/model';
import { CmsAdParam } from '@/api/cms/cmsAd/model';
import useSearch from '@/utils/use-search';
const props = withDefaults(
defineProps<{

View File

@@ -28,8 +28,8 @@
<a-tag v-if="record.type == 4">文本</a-tag>
</template>
<template v-if="column.key === 'name'">
<div>{{ record.name }}</div>
<div class="text-gray-400">{{ record.code }}</div>
<div>{{ record.name }}</div>
<div class="text-gray-400">{{ record.code }}</div>
</template>
<template v-if="column.key === 'categoryId'">
<span class="text-gray-400">{{ record.categoryName }}</span>
@@ -44,7 +44,7 @@
v-for="item in record.imageList"
:key="index"
>
<a-image :src="item.url" :width="80"/>
<a-image :src="item.url" :width="80" />
</template>
<template v-if="record.type == 4">
{{ record.comments }}
@@ -58,7 +58,7 @@
<template v-if="column.key === 'action'">
<a-space>
<a @click="openEdit(record)">修改</a>
<a-divider type="vertical"/>
<a-divider type="vertical" />
<a-popconfirm
title="确定要删除此记录吗?"
@confirm="remove(record)"
@@ -72,217 +72,222 @@
</a-card>
<!-- 编辑弹窗 -->
<CmsAdEdit v-model:visible="showEdit" :data="current" :navigationList="navigationList" @done="reload"/>
<CmsAdEdit
v-model:visible="showEdit"
:data="current"
:navigationList="navigationList"
@done="reload"
/>
</a-page-header>
</template>
<script lang="ts" setup>
import {createVNode, ref} from 'vue';
import {message, Modal} from 'ant-design-vue';
import {ExclamationCircleOutlined} from '@ant-design/icons-vue';
import type {EleProTable} from 'ele-admin-pro';
import {toTreeData} from 'ele-admin-pro';
import {useI18n} from 'vue-i18n';
import type {
DatasourceFunction,
ColumnItem
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue';
import CmsAdEdit from './components/cmsAdEdit.vue';
import {pageCmsAd, removeCmsAd, removeBatchCmsAd} from '@/api/cms/cmsAd';
import type {CmsAd, CmsAdParam} from '@/api/cms/cmsAd/model';
import {CmsNavigation} from "@/api/cms/cmsNavigation/model";
import {listCmsNavigation} from "@/api/cms/cmsNavigation";
import {getPageTitle} from "@/utils/common";
import { createVNode, ref } from 'vue';
import { message, Modal } from 'ant-design-vue';
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
import type { EleProTable } from 'ele-admin-pro';
import { toTreeData } from 'ele-admin-pro';
import { useI18n } from 'vue-i18n';
import type {
DatasourceFunction,
ColumnItem
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue';
import CmsAdEdit from './components/cmsAdEdit.vue';
import { pageCmsAd, removeCmsAd, removeBatchCmsAd } from '@/api/cms/cmsAd';
import type { CmsAd, CmsAdParam } from '@/api/cms/cmsAd/model';
import { CmsNavigation } from '@/api/cms/cmsNavigation/model';
import { listCmsNavigation } from '@/api/cms/cmsNavigation';
import { getPageTitle } from '@/utils/common';
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
// 国际化
const {locale} = useI18n();
// 表格选中数据
const selection = ref<CmsAd[]>([]);
// 当前编辑数据
const current = ref<CmsAd | null>(null);
// 是否显示编辑弹窗
const showEdit = ref(false);
// 是否显示批量移动弹窗
const showMove = ref(false);
// 栏目数据
const navigationList = ref<CmsNavigation[]>();
// 加载状态
const loading = ref(true);
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
// 国际化
const { locale } = useI18n();
// 表格选中数据
const selection = ref<CmsAd[]>([]);
// 当前编辑数据
const current = ref<CmsAd | null>(null);
// 是否显示编辑弹窗
const showEdit = ref(false);
// 是否显示批量移动弹窗
const showMove = ref(false);
// 栏目数据
const navigationList = ref<CmsNavigation[]>();
// 加载状态
const loading = ref(true);
// 表格数据源
const datasource: DatasourceFunction = ({
page,
limit,
where,
orders,
filters
}) => {
if (filters) {
where.status = filters.status;
}
where.lang = locale.value || undefined;
return pageCmsAd({
...where,
...orders,
// 表格数据源
const datasource: DatasourceFunction = ({
page,
limit
});
};
// 表格列配置
const columns = ref<ColumnItem[]>([
{
title: 'ID',
width: 90,
dataIndex: 'adId'
},
{
title: '名称',
dataIndex: 'name',
key: 'name',
ellipsis: true,
width: 180
},
{
title: '类型',
dataIndex: 'type',
key: 'type',
align: 'center',
width: 120
},
{
title: '广告图片',
dataIndex: 'images',
key: 'images'
},
{
title: '栏目名称',
dataIndex: 'categoryId',
key: 'categoryId',
align: 'center',
width: 180
},
{
title: '状态',
dataIndex: 'status',
key: 'status',
align: 'center',
width: 120
},
{
title: '操作',
key: 'action',
width: 120,
fixed: 'right',
align: 'center',
hideInSetting: true
}
]);
/* 搜索 */
const reload = (where?: CmsAdParam) => {
selection.value = [];
tableRef?.value?.reload({where: where});
};
/* 打开编辑弹窗 */
const openEdit = (row?: CmsAd) => {
current.value = row ?? null;
showEdit.value = true;
};
/* 打开批量移动弹窗 */
const openMove = () => {
showMove.value = true;
};
/* 删除单个 */
const remove = (row: CmsAd) => {
const hide = message.loading('请求中..', 0);
removeCmsAd(row.adId)
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
};
/* 批量删除 */
const removeBatch = () => {
if (!selection.value.length) {
message.error('请至少选择一条数据');
return;
}
Modal.confirm({
title: '提示',
content: '确定要删除选中的记录吗?',
icon: createVNode(ExclamationCircleOutlined),
maskClosable: true,
onOk: () => {
const hide = message.loading('请求中..', 0);
removeBatchCmsAd(selection.value.map((d) => d.adId))
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
limit,
where,
orders,
filters
}) => {
if (filters) {
where.status = filters.status;
}
});
};
/* 查询 */
const query = () => {
loading.value = true;
// 加载栏目数据
if (!navigationList.value) {
listCmsNavigation({}).then((res) => {
navigationList.value = toTreeData({
data: res?.map((d) => {
d.value = d.navigationId;
d.label = d.title;
if (!d.component) {
d.disabled = true;
}
return d;
}),
idField: 'navigationId',
parentIdField: 'parentId'
});
where.lang = locale.value || undefined;
return pageCmsAd({
...where,
...orders,
page,
limit
});
}
};
};
/* 自定义行属性 */
const customRow = (record: CmsAd) => {
return {
// 行点击事件
onClick: () => {
// console.log(record);
// 表格列配置
const columns = ref<ColumnItem[]>([
{
title: 'ID',
width: 90,
dataIndex: 'adId'
},
// 行双击事件
onDblclick: () => {
openEdit(record);
{
title: '名称',
dataIndex: 'name',
key: 'name',
ellipsis: true,
width: 180
},
{
title: '类型',
dataIndex: 'type',
key: 'type',
align: 'center',
width: 120
},
{
title: '广告图片',
dataIndex: 'images',
key: 'images'
},
{
title: '栏目名称',
dataIndex: 'categoryId',
key: 'categoryId',
align: 'center',
width: 180
},
{
title: '状态',
dataIndex: 'status',
key: 'status',
align: 'center',
width: 120
},
{
title: '操作',
key: 'action',
width: 120,
fixed: 'right',
align: 'center',
hideInSetting: true
}
]);
/* 搜索 */
const reload = (where?: CmsAdParam) => {
selection.value = [];
tableRef?.value?.reload({ where: where });
};
/* 打开编辑弹窗 */
const openEdit = (row?: CmsAd) => {
current.value = row ?? null;
showEdit.value = true;
};
/* 打开批量移动弹窗 */
const openMove = () => {
showMove.value = true;
};
/* 删除单个 */
const remove = (row: CmsAd) => {
const hide = message.loading('请求中..', 0);
removeCmsAd(row.adId)
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
};
/* 批量删除 */
const removeBatch = () => {
if (!selection.value.length) {
message.error('请至少选择一条数据');
return;
}
Modal.confirm({
title: '提示',
content: '确定要删除选中的记录吗?',
icon: createVNode(ExclamationCircleOutlined),
maskClosable: true,
onOk: () => {
const hide = message.loading('请求中..', 0);
removeBatchCmsAd(selection.value.map((d) => d.adId))
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
}
});
};
/* 查询 */
const query = () => {
loading.value = true;
// 加载栏目数据
if (!navigationList.value) {
listCmsNavigation({}).then((res) => {
navigationList.value = toTreeData({
data: res?.map((d) => {
d.value = d.navigationId;
d.label = d.title;
if (!d.component) {
d.disabled = true;
}
return d;
}),
idField: 'navigationId',
parentIdField: 'parentId'
});
});
}
};
};
query();
/* 自定义行属性 */
const customRow = (record: CmsAd) => {
return {
// 行点击事件
onClick: () => {
// console.log(record);
},
// 行双击事件
onDblclick: () => {
openEdit(record);
}
};
};
query();
</script>
<script lang="ts">
export default {
name: 'CmsAd'
};
export default {
name: 'CmsAd'
};
</script>
<style lang="less" scoped></style>

View File

@@ -172,7 +172,9 @@
const formData = {
...form
};
const saveOrUpdate = isUpdate.value ? updateCmsAdRecord : addCmsAdRecord;
const saveOrUpdate = isUpdate.value
? updateCmsAdRecord
: addCmsAdRecord;
saveOrUpdate(formData)
.then((msg) => {
loading.value = false;
@@ -195,12 +197,12 @@
images.value = [];
if (props.data) {
assignObject(form, props.data);
if(props.data.image){
if (props.data.image) {
images.value.push({
uid: uuid(),
url: props.data.image,
status: 'done'
})
});
}
isUpdate.value = true;
} else {

View File

@@ -45,7 +45,11 @@
</a-card>
<!-- 编辑弹窗 -->
<CmsAdRecordEdit v-model:visible="showEdit" :data="current" @done="reload" />
<CmsAdRecordEdit
v-model:visible="showEdit"
:data="current"
@done="reload"
/>
</div>
</div>
</template>
@@ -62,8 +66,15 @@
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue';
import CmsAdRecordEdit from './components/cmsAdRecordEdit.vue';
import { pageCmsAdRecord, removeCmsAdRecord, removeBatchCmsAdRecord } from '@/api/cms/cmsAdRecord';
import type { CmsAdRecord, CmsAdRecordParam } from '@/api/cms/cmsAdRecord/model';
import {
pageCmsAdRecord,
removeCmsAdRecord,
removeBatchCmsAdRecord
} from '@/api/cms/cmsAdRecord';
import type {
CmsAdRecord,
CmsAdRecordParam
} from '@/api/cms/cmsAdRecord/model';
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
@@ -105,49 +116,49 @@
dataIndex: 'adRecordId',
key: 'adRecordId',
align: 'center',
width: 90,
width: 90
},
{
title: '广告标题',
dataIndex: 'title',
key: 'title',
align: 'center',
align: 'center'
},
{
title: '图片地址',
dataIndex: 'path',
key: 'path',
align: 'center',
align: 'center'
},
{
title: '链接地址',
dataIndex: 'url',
key: 'url',
align: 'center',
align: 'center'
},
{
title: '广告位ID',
dataIndex: 'adId',
key: 'adId',
align: 'center',
align: 'center'
},
{
title: '排序(数字越小越靠前)',
dataIndex: 'sortNumber',
key: 'sortNumber',
align: 'center',
align: 'center'
},
{
title: '备注',
dataIndex: 'comments',
key: 'comments',
align: 'center',
align: 'center'
},
{
title: '状态, 0正常, 1冻结',
dataIndex: 'status',
key: 'status',
align: 'center',
align: 'center'
},
{
title: '创建时间',

View File

@@ -42,12 +42,12 @@
<script lang="ts" setup>
import { ref, reactive, watch } from 'vue';
import { Form, message } from 'ant-design-vue';
import { updateBatchCmsArticle } from "@/api/cms/cmsArticle";
import { updateBatchCmsArticle } from '@/api/cms/cmsArticle';
import { CmsArticle } from '@/api/cms/cmsArticle/model';
import { useThemeStore } from '@/store/modules/theme';
import { storeToRefs } from 'pinia';
import { FormInstance, RuleObject } from 'ant-design-vue/es/form';
import { CmsNavigation } from "@/api/cms/cmsNavigation/model";
import { CmsNavigation } from '@/api/cms/cmsNavigation/model';
// 是否是修改
const useForm = Form.useForm;
@@ -145,17 +145,17 @@
content: [
{
required: true,
type: "string",
message: "请输入文章内容",
trigger: "blur",
type: 'string',
message: '请输入文章内容',
trigger: 'blur',
validator: async (_rule: RuleObject, value: string) => {
if (content.value == "") {
return Promise.reject("请输入文字内容");
if (content.value == '') {
return Promise.reject('请输入文字内容');
}
return Promise.resolve();
}
}
],
]
});
// 选择栏目
@@ -175,18 +175,19 @@
.validate()
.then(() => {
loading.value = true;
props.selection?.map(d => d.articleId)
props.selection?.map((d) => d.articleId);
updateBatchCmsArticle({
ids: props.selection?.map(d => d.articleId),
ids: props.selection?.map((d) => d.articleId),
data: {
categoryId: form.categoryId
}
}).then((msg) => {
message.success(msg);
loading.value = false;
updateVisible(false);
emit('done');
})
.then((msg) => {
message.success(msg);
loading.value = false;
updateVisible(false);
emit('done');
})
.catch((e) => {
message.error(e.message);
});

View File

@@ -1,9 +1,9 @@
<!-- 搜索表单 -->
<template>
<a-space :size="10" style="flex-wrap: wrap">
<a-button type="primary" class="ele-btn-icon" @click="add">
<a-button type="primary" class="ele-btn-icon" @click="add">
<template #icon>
<PlusOutlined/>
<PlusOutlined />
</template>
<span>添加</span>
</a-button>
@@ -15,7 +15,7 @@
@click="removeBatch"
>
<template #icon>
<DeleteOutlined/>
<DeleteOutlined />
</template>
<span>批量删除</span>
</a-button>
@@ -26,19 +26,20 @@
>
移动
</a-button>
<a-radio-group v-model:value="type" @change="handleSearch" v-if="setting.setting?.articleReview">
<a-radio-group
v-model:value="type"
@change="handleSearch"
v-if="setting.setting?.articleReview"
>
<a-radio-button type="text" value="已发布"
>已发布({{ articleCount?.totalNum }})
</a-radio-button
>
>已发布({{ articleCount?.totalNum }})
</a-radio-button>
<a-radio-button value="待审核"
>待审核({{ articleCount?.totalNum2 }})
</a-radio-button
>
>待审核({{ articleCount?.totalNum2 }})
</a-radio-button>
<a-radio-button value="已驳回"
>已驳回({{ articleCount?.totalNum3 }})
</a-radio-button
>
>已驳回({{ articleCount?.totalNum3 }})
</a-radio-button>
</a-radio-group>
<a-tree-select
allow-clear
@@ -68,259 +69,261 @@
@search="reload"
/>
<a-button type="text" @click="reset">重置</a-button>
<a-button type="text" @click="handleExport">导出xls</a-button>
<a-button type="text" @click="openImport">导入xls</a-button>
<a-button type="text" @click="handleExport">导出xls</a-button>
<a-button type="text" @click="openImport">导入xls</a-button>
</a-space>
<!-- 导入弹窗 -->
<import v-model:visible="showImport" @done="reload"/>
<import v-model:visible="showImport" @done="reload" />
</template>
<script lang="ts" setup>
import {DeleteOutlined, PlusOutlined} from '@ant-design/icons-vue';
import {ref, watch} from 'vue';
import {message} from 'ant-design-vue';
import {utils, writeFile} from 'xlsx';
import {getCount, listCmsArticle} from '@/api/cms/cmsArticle';
import type {CmsArticle, CmsArticleCount, CmsArticleParam} from '@/api/cms/cmsArticle/model';
import useSearch from '@/utils/use-search';
import {CmsNavigation} from '@/api/cms/cmsNavigation/model';
import dayjs from 'dayjs';
import Import from "./Import.vue";
import {useWebsiteSettingStore} from "@/store/modules/setting";
import {openUrl} from "@/utils/common";
import { DeleteOutlined, PlusOutlined } from '@ant-design/icons-vue';
import { ref, watch } from 'vue';
import { message } from 'ant-design-vue';
import { utils, writeFile } from 'xlsx';
import { getCount, listCmsArticle } from '@/api/cms/cmsArticle';
import type {
CmsArticle,
CmsArticleCount,
CmsArticleParam
} from '@/api/cms/cmsArticle/model';
import useSearch from '@/utils/use-search';
import { CmsNavigation } from '@/api/cms/cmsNavigation/model';
import dayjs from 'dayjs';
import Import from './Import.vue';
import { useWebsiteSettingStore } from '@/store/modules/setting';
import { openUrl } from '@/utils/common';
const props = withDefaults(
defineProps<{
// 选中的角色
selection?: CmsArticle[];
merchantId?: number;
navigationList?: CmsNavigation[];
categoryId?: number;
}>(),
{}
);
const props = withDefaults(
defineProps<{
// 选中的角色
selection?: CmsArticle[];
merchantId?: number;
navigationList?: CmsNavigation[];
categoryId?: number;
}>(),
{}
);
const type = ref<string>();
const setting = useWebsiteSettingStore();
// 统计数据
const articleCount = ref<CmsArticleCount>();
const showChooseDict = ref<boolean>(false);
// 请求状态
const loading = ref(false);
const xlsFileName = ref<string>();
const articleList = ref<CmsArticle[]>([]);
// 是否显示用户导入弹窗
const showImport = ref(false);
const type = ref<string>();
const setting = useWebsiteSettingStore();
// 统计数据
const articleCount = ref<CmsArticleCount>();
const showChooseDict = ref<boolean>(false);
// 请求状态
const loading = ref(false);
const xlsFileName = ref<string>();
const articleList = ref<CmsArticle[]>([]);
// 是否显示用户导入弹窗
const showImport = ref(false);
// 表单数据
const {where, resetFields} = useSearch<CmsArticleParam>({
articleId: undefined,
model: undefined,
categoryId: undefined,
merchantId: undefined,
keywords: '',
sceneType: undefined,
userId: undefined
});
const emit = defineEmits<{
(e: 'search', where?: CmsArticleParam): void;
(e: 'add'): void;
(e: 'remove'): void;
(e: 'batchMove'): void;
}>();
// 新增
const add = () => {
emit('add');
};
// 批量删除
const removeBatch = () => {
emit('remove');
};
// 批量更新
const updateBatch = () => {
emit('batchMove');
}
/* 打开编辑弹窗 */
const openImport = () => {
showImport.value = true;
};
const handleSearch = (e) => {
const text = e.target.value;
if (text === '已发布') {
where.status = 0;
}
if (text === '待审核') {
where.status = 1;
}
if (text === '已驳回') {
where.status = 2;
}
emit('search', where);
};
const reload = () => {
getCount(where).then((data: any) => {
articleCount.value = data;
// 表单数据
const { where, resetFields } = useSearch<CmsArticleParam>({
articleId: undefined,
model: undefined,
categoryId: undefined,
merchantId: undefined,
keywords: '',
sceneType: undefined,
userId: undefined
});
emit('search', where);
};
// 按模型查找
const chooseModel = () => {
emit('search', where);
};
const emit = defineEmits<{
(e: 'search', where?: CmsArticleParam): void;
(e: 'add'): void;
(e: 'remove'): void;
(e: 'batchMove'): void;
}>();
// 按分类查询
const onCategoryId = (id: number) => {
where.categoryId = id;
emit('search', where);
};
// 新增
const add = () => {
emit('add');
};
// 导出
const handleExport = async () => {
loading.value = true;
const array: (string | number)[][] = [
[
'文章ID',
'文章标题',
'封面图片',
'所属栏目',
'栏目ID',
'父级栏目名称',
'父级栏目ID',
'文章内容',
'摘要',
'来源',
'实际阅读量',
'作者',
'发布时间',
'类型',
'模型',
'详情页模板',
'话题',
'关键词',
'产品概述',
'显示方式',
'客户端',
'文件列表',
'视频地址',
'点赞数',
'评论数',
'推荐',
'用户ID',
'商户ID',
'语言',
'排序',
`状态`,
'租户ID'
]
];
// 批量删除
const removeBatch = () => {
emit('remove');
};
// 按搜索结果导出
where.sceneType = 'Content';
await listCmsArticle(where)
.then((list) => {
articleList.value = list;
list?.forEach((d: CmsArticle) => {
array.push([
`${d.articleId}`,
`${d.title}`,
`${d.image}`,
`${d.categoryName}`,
`${d.categoryId}`,
`${d.parentName}`,
`${d.parentId}`,
`${d.content}`,
`${d.comments}`,
`${d.source}`,
`${d.actualViews}`,
`${d.author}`,
`${d.createTime}`,
`${d.type}`,
`${d.model}`,
`${d.detail}`,
`${d.topic}`,
`${d.tags}`,
`${d.overview}`,
`${d.showType}`,
`${d.platform}`,
`${d.files}`,
`${d.video}`,
`${d.likes}`,
`${d.commentNumbers}`,
`${d.recommend}`,
`${d.userId}`,
`${d.merchantId}`,
`${d.lang}`,
`${d.sortNumber}`,
`${d.status}`,
`${d.tenantId}`
]);
});
const sheetName = `导出文章列表${dayjs(new Date()).format('YYYYMMDD')}`;
const workbook = {
SheetNames: [sheetName],
Sheets: {}
};
const sheet = utils.aoa_to_sheet(array);
workbook.Sheets[sheetName] = sheet;
// 设置列宽
sheet['!cols'] = [
{wch: 10},
{wch: 40},
{wch: 20},
{wch: 20},
{wch: 60},
{wch: 15},
{wch: 10},
{wch: 10},
{wch: 20},
{wch: 10},
{wch: 20}
];
message.loading('正在导出...');
setTimeout(() => {
writeFile(
workbook,
`${
where.createTimeEnd ? xlsFileName.value + '_' : ''
}${sheetName}.xlsx`
);
loading.value = false;
}, 1000);
})
.catch((msg) => {
message.error(msg);
loading.value = false;
})
.finally(() => {
});
// 批量更新
const updateBatch = () => {
emit('batchMove');
};
};
/* 打开编辑弹窗 */
const openImport = () => {
showImport.value = true;
};
/* 重置 */
const reset = () => {
resetFields();
type.value = undefined;
reload();
openUrl(`/website/article`)
};
watch(
() => props.merchantId,
() => {
if (props.categoryId) {
where.categoryId = props.categoryId;
const handleSearch = (e) => {
const text = e.target.value;
if (text === '已发布') {
where.status = 0;
}
if (text === '待审核') {
where.status = 1;
}
if (text === '已驳回') {
where.status = 2;
}
emit('search', where);
};
const reload = () => {
getCount(where).then((data: any) => {
articleCount.value = data;
});
emit('search', where);
};
// 按模型查找
const chooseModel = () => {
emit('search', where);
};
// 按分类查询
const onCategoryId = (id: number) => {
where.categoryId = id;
emit('search', where);
};
// 导出
const handleExport = async () => {
loading.value = true;
const array: (string | number)[][] = [
[
'文章ID',
'文章标题',
'封面图片',
'所属栏目',
'栏目ID',
'父级栏目名称',
'父级栏目ID',
'文章内容',
'摘要',
'来源',
'实际阅读量',
'作者',
'发布时间',
'类型',
'模型',
'详情页模板',
'话题',
'关键词',
'产品概述',
'显示方式',
'客户端',
'文件列表',
'视频地址',
'点赞数',
'评论数',
'推荐',
'用户ID',
'商户ID',
'语言',
'排序',
`状态`,
'租户ID'
]
];
// 按搜索结果导出
where.sceneType = 'Content';
await listCmsArticle(where)
.then((list) => {
articleList.value = list;
list?.forEach((d: CmsArticle) => {
array.push([
`${d.articleId}`,
`${d.title}`,
`${d.image}`,
`${d.categoryName}`,
`${d.categoryId}`,
`${d.parentName}`,
`${d.parentId}`,
`${d.content}`,
`${d.comments}`,
`${d.source}`,
`${d.actualViews}`,
`${d.author}`,
`${d.createTime}`,
`${d.type}`,
`${d.model}`,
`${d.detail}`,
`${d.topic}`,
`${d.tags}`,
`${d.overview}`,
`${d.showType}`,
`${d.platform}`,
`${d.files}`,
`${d.video}`,
`${d.likes}`,
`${d.commentNumbers}`,
`${d.recommend}`,
`${d.userId}`,
`${d.merchantId}`,
`${d.lang}`,
`${d.sortNumber}`,
`${d.status}`,
`${d.tenantId}`
]);
});
const sheetName = `导出文章列表${dayjs(new Date()).format('YYYYMMDD')}`;
const workbook = {
SheetNames: [sheetName],
Sheets: {}
};
const sheet = utils.aoa_to_sheet(array);
workbook.Sheets[sheetName] = sheet;
// 设置列宽
sheet['!cols'] = [
{ wch: 10 },
{ wch: 40 },
{ wch: 20 },
{ wch: 20 },
{ wch: 60 },
{ wch: 15 },
{ wch: 10 },
{ wch: 10 },
{ wch: 20 },
{ wch: 10 },
{ wch: 20 }
];
message.loading('正在导出...');
setTimeout(() => {
writeFile(
workbook,
`${
where.createTimeEnd ? xlsFileName.value + '_' : ''
}${sheetName}.xlsx`
);
loading.value = false;
}, 1000);
})
.catch((msg) => {
message.error(msg);
loading.value = false;
})
.finally(() => {});
};
/* 重置 */
const reset = () => {
resetFields();
type.value = undefined;
reload();
},
{immediate: true}
);
openUrl(`/website/article`);
};
watch(
() => props.merchantId,
() => {
if (props.categoryId) {
where.categoryId = props.categoryId;
}
reload();
},
{ immediate: true }
);
</script>

View File

@@ -58,22 +58,22 @@
:color="record.status == 0 ? 'green' : 'red'"
class="cursor-pointer"
@click="onUpdate(record)"
>{{ record.statusText }}
>{{ record.statusText }}
</a-tag>
</template>
<template v-if="column.key === 'recommend'">
<a-space @click="onRecommend(record)">
<span v-if="record.recommend === 1" class="ele-text-success"
><CheckOutlined
><CheckOutlined
/></span>
<span v-else class="ele-text-placeholder"><CloseOutlined/></span>
<span v-else class="ele-text-placeholder"><CloseOutlined /></span>
</a-space>
</template>
<template v-if="column.key === 'action'">
<a @click="onShare(record)">预览</a>
<a-divider type="vertical"/>
<a-divider type="vertical" />
<a @click="openEdit(record)">修改</a>
<a-divider type="vertical"/>
<a-divider type="vertical" />
<a-popconfirm
title="确定要删除此记录吗?"
@confirm="remove(record)"
@@ -113,336 +113,330 @@
</template>
<script lang="ts" setup>
import {createVNode, ref, watch} from 'vue';
import {message, Modal} from 'ant-design-vue';
import {useI18n} from 'vue-i18n';
import {
CheckOutlined,
CloseOutlined,
ExclamationCircleOutlined
} from '@ant-design/icons-vue';
import type {EleProTable} from 'ele-admin-pro';
import type {
DatasourceFunction,
ColumnItem
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue';
import ArticleEdit from './components/articleEdit.vue';
import ArticleUpdate from './components/articleUpdate.vue';
import {
pageCmsArticle,
removeCmsArticle,
removeBatchCmsArticle,
updateCmsArticle, getCmsArticle
} from '@/api/cms/cmsArticle';
import type {CmsArticle, CmsArticleParam} from '@/api/cms/cmsArticle/model';
import {formatNumber} from 'ele-admin-pro/es';
import router from '@/router';
import {toTreeData} from 'ele-admin-pro';
import {
detail,
getPageTitle
} from '@/utils/common';
import {listCmsNavigation} from '@/api/cms/cmsNavigation';
import {CmsNavigation} from '@/api/cms/cmsNavigation/model';
import {CmsArticleCategory} from '@/api/cms/cmsArticleCategory/model';
import {listCmsArticleCategory} from '@/api/cms/cmsArticleCategory';
import Qrcode from '@/components/QrCode/index.vue';
import { createVNode, ref, watch } from 'vue';
import { message, Modal } from 'ant-design-vue';
import { useI18n } from 'vue-i18n';
import {
CheckOutlined,
CloseOutlined,
ExclamationCircleOutlined
} from '@ant-design/icons-vue';
import type { EleProTable } from 'ele-admin-pro';
import type {
DatasourceFunction,
ColumnItem
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue';
import ArticleEdit from './components/articleEdit.vue';
import ArticleUpdate from './components/articleUpdate.vue';
import {
pageCmsArticle,
removeCmsArticle,
removeBatchCmsArticle,
updateCmsArticle,
getCmsArticle
} from '@/api/cms/cmsArticle';
import type { CmsArticle, CmsArticleParam } from '@/api/cms/cmsArticle/model';
import { formatNumber } from 'ele-admin-pro/es';
import router from '@/router';
import { toTreeData } from 'ele-admin-pro';
import { detail, getPageTitle } from '@/utils/common';
import { listCmsNavigation } from '@/api/cms/cmsNavigation';
import { CmsNavigation } from '@/api/cms/cmsNavigation/model';
import { CmsArticleCategory } from '@/api/cms/cmsArticleCategory/model';
import { listCmsArticleCategory } from '@/api/cms/cmsArticleCategory';
import Qrcode from '@/components/QrCode/index.vue';
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
// 国际化
const {locale} = useI18n();
// 表格选中数据
const selection = ref<CmsArticle[]>([]);
// 当前编辑数据
const current = ref<CmsArticle | null>(null);
// 是否显示编辑弹窗
const showEdit = ref(false);
// 是否显示批量移动弹窗
const showMove = ref(false);
// 店铺ID
const merchantId = ref<number>();
// 栏目ID
const categoryId = ref<number>();
// 栏目数据
const navigationList = ref<CmsNavigation[]>();
// 文章分类
const categoryList = ref<CmsArticleCategory[]>();
// 是否显示二维码
const showQrcode = ref(false);
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
// 国际化
const { locale } = useI18n();
// 表格选中数据
const selection = ref<CmsArticle[]>([]);
// 当前编辑数据
const current = ref<CmsArticle | null>(null);
// 是否显示编辑弹窗
const showEdit = ref(false);
// 是否显示批量移动弹窗
const showMove = ref(false);
// 店铺ID
const merchantId = ref<number>();
// 栏目ID
const categoryId = ref<number>();
// 栏目数据
const navigationList = ref<CmsNavigation[]>();
// 文章分类
const categoryList = ref<CmsArticleCategory[]>();
// 是否显示二维码
const showQrcode = ref(false);
// 表格数据源
const datasource: DatasourceFunction = ({page, limit, where, orders}) => {
if (categoryId.value) {
where.categoryId = categoryId.value;
}
where.lang = locale.value || undefined;
return pageCmsArticle({
...where,
...orders,
page,
limit
});
};
// 表格列配置
const columns = ref<ColumnItem[]>([
{
title: 'ID',
dataIndex: 'articleId',
key: 'articleId',
align: 'center',
width: 90
},
{
title: '封面图',
dataIndex: 'image',
key: 'image',
width: 120,
align: 'center'
},
{
title: '文章标题',
dataIndex: 'title',
key: 'title'
},
{
title: '栏目名称',
dataIndex: 'categoryName',
key: 'categoryName',
width: 120,
align: 'center'
},
{
title: '所属栏目',
dataIndex: 'categoryId',
key: 'categoryId',
align: 'center',
hideInTable: true
},
{
title: '实际阅读量',
dataIndex: 'actualViews',
key: 'actualViews',
sorter: true,
width: 120,
align: 'center'
},
{
title: '虚拟阅读量',
dataIndex: 'virtualViews',
key: 'virtualViews',
width: 120,
align: 'center',
hideInTable: true
},
{
title: '推荐',
dataIndex: 'recommend',
key: 'recommend',
sorter: true,
width: 120,
align: 'center'
},
{
title: '状态',
dataIndex: 'status',
key: 'status',
sorter: true,
width: 120,
align: 'center'
},
{
title: '排序号',
dataIndex: 'sortNumber',
key: 'sortNumber',
sorter: true,
width: 120,
align: 'center'
},
{
title: '创建时间',
dataIndex: 'createTime',
key: 'createTime',
align: 'center',
width: 180,
sorter: true
},
{
title: '操作',
key: 'action',
width: 180,
fixed: 'right',
align: 'center',
hideInSetting: true
}
]);
/* 搜索 */
const reload = (where?: CmsArticleParam) => {
selection.value = [];
tableRef?.value?.reload({where: where});
};
/* 打开编辑弹窗 */
const openEdit = async (row?: CmsArticle) => {
current.value = row ?? null;
if(row?.articleId){
current.value = await getCmsArticle(row?.articleId);
}
showEdit.value = true;
};
/* 打开批量移动弹窗 */
const openMove = () => {
showMove.value = true;
};
// 分享二维码
const onShare = (row?: CmsArticle) => {
const data = {
isMobile: true,
...row
// 表格数据源
const datasource: DatasourceFunction = ({ page, limit, where, orders }) => {
if (categoryId.value) {
where.categoryId = categoryId.value;
}
where.lang = locale.value || undefined;
return pageCmsArticle({
...where,
...orders,
page,
limit
});
};
data.qrcode = `${detail(data)}`;
data.url = `${detail(row)}`;
current.value = data ?? null;
showQrcode.value = true;
};
const hideShare = () => {
showQrcode.value = false;
};
// 表格列配置
const columns = ref<ColumnItem[]>([
{
title: 'ID',
dataIndex: 'articleId',
key: 'articleId',
align: 'center',
width: 90
},
{
title: '封面图',
dataIndex: 'image',
key: 'image',
width: 120,
align: 'center'
},
{
title: '文章标题',
dataIndex: 'title',
key: 'title'
},
{
title: '栏目名称',
dataIndex: 'categoryName',
key: 'categoryName',
width: 120,
align: 'center'
},
{
title: '所属栏目',
dataIndex: 'categoryId',
key: 'categoryId',
align: 'center',
hideInTable: true
},
{
title: '实际阅读量',
dataIndex: 'actualViews',
key: 'actualViews',
sorter: true,
width: 120,
align: 'center'
},
{
title: '虚拟阅读量',
dataIndex: 'virtualViews',
key: 'virtualViews',
width: 120,
align: 'center',
hideInTable: true
},
{
title: '推荐',
dataIndex: 'recommend',
key: 'recommend',
sorter: true,
width: 120,
align: 'center'
},
{
title: '状态',
dataIndex: 'status',
key: 'status',
sorter: true,
width: 120,
align: 'center'
},
{
title: '排序号',
dataIndex: 'sortNumber',
key: 'sortNumber',
sorter: true,
width: 120,
align: 'center'
},
{
title: '创建时间',
dataIndex: 'createTime',
key: 'createTime',
align: 'center',
width: 180,
sorter: true
},
{
title: '操作',
key: 'action',
width: 180,
fixed: 'right',
align: 'center',
hideInSetting: true
}
]);
const onUpdate = (row?: CmsArticle) => {
const status = row?.status == 0 ? 1 : 0;
updateCmsArticle({...row, status}).then((msg) => {
message.success(msg);
reload();
});
};
/* 搜索 */
const reload = (where?: CmsArticleParam) => {
selection.value = [];
tableRef?.value?.reload({ where: where });
};
const onRecommend = (row: CmsArticle) => {
updateCmsArticle({
...row,
recommend: row.recommend == 1 ? 0 : 1
}).then((msg) => {
message.success(msg);
reload();
});
};
/* 打开编辑弹窗 */
const openEdit = async (row?: CmsArticle) => {
current.value = row ?? null;
if (row?.articleId) {
current.value = await getCmsArticle(row?.articleId);
}
showEdit.value = true;
};
/* 删除单个 */
const remove = (row: CmsArticle) => {
const hide = message.loading('请求中..', 0);
removeCmsArticle(row.articleId)
.then((msg) => {
hide();
/* 打开批量移动弹窗 */
const openMove = () => {
showMove.value = true;
};
// 分享二维码
const onShare = (row?: CmsArticle) => {
const data = {
isMobile: true,
...row
};
data.qrcode = `${detail(data)}`;
data.url = `${detail(row)}`;
current.value = data ?? null;
showQrcode.value = true;
};
const hideShare = () => {
showQrcode.value = false;
};
const onUpdate = (row?: CmsArticle) => {
const status = row?.status == 0 ? 1 : 0;
updateCmsArticle({ ...row, status }).then((msg) => {
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
};
/* 批量删除 */
const removeBatch = () => {
if (!selection.value.length) {
message.error('请至少选择一条数据');
return;
}
Modal.confirm({
title: '提示',
content: '确定要删除选中的记录吗?',
icon: createVNode(ExclamationCircleOutlined),
maskClosable: true,
onOk: () => {
const hide = message.loading('请求中..', 0);
removeBatchCmsArticle(selection.value.map((d) => d.articleId))
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
}
});
};
/* 自定义行属性 */
const customRow = (record: CmsArticle) => {
return {
// 行点击事件
onClick: () => {
// console.log(record);
},
// 行双击事件
onDblclick: () => {
openEdit(record);
}
};
};
// 加载栏目数据
if (!navigationList.value) {
listCmsNavigation({}).then((res) => {
navigationList.value = toTreeData({
data: res?.map((d) => {
d.value = d.navigationId;
d.label = d.title;
if (!d.component) {
d.disabled = true;
}
if (
d.model == 'index' ||
d.model == 'page' ||
d.model == 'order'
) {
d.disabled = true;
}
return d;
}),
idField: 'navigationId',
parentIdField: 'parentId'
});
});
}
// 加载文章分类
if (!categoryList.value) {
listCmsArticleCategory({}).then((res) => {
categoryList.value = toTreeData({
data: res?.map((d) => {
d.value = d.categoryId;
d.label = d.title;
return d;
}),
idField: 'categoryId',
parentIdField: 'parentId'
});
});
}
watch(
() => router.currentRoute.value.query,
(query) => {
if (query) {
categoryId.value = Number(query.id);
const onRecommend = (row: CmsArticle) => {
updateCmsArticle({
...row,
recommend: row.recommend == 1 ? 0 : 1
}).then((msg) => {
message.success(msg);
reload();
});
};
/* 删除单个 */
const remove = (row: CmsArticle) => {
const hide = message.loading('请求中..', 0);
removeCmsArticle(row.articleId)
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
};
/* 批量删除 */
const removeBatch = () => {
if (!selection.value.length) {
message.error('请至少选择一条数据');
return;
}
},
{immediate: true}
);
Modal.confirm({
title: '提示',
content: '确定要删除选中的记录吗?',
icon: createVNode(ExclamationCircleOutlined),
maskClosable: true,
onOk: () => {
const hide = message.loading('请求中..', 0);
removeBatchCmsArticle(selection.value.map((d) => d.articleId))
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
}
});
};
/* 自定义行属性 */
const customRow = (record: CmsArticle) => {
return {
// 行点击事件
onClick: () => {
// console.log(record);
},
// 行双击事件
onDblclick: () => {
openEdit(record);
}
};
};
// 加载栏目数据
if (!navigationList.value) {
listCmsNavigation({}).then((res) => {
navigationList.value = toTreeData({
data: res?.map((d) => {
d.value = d.navigationId;
d.label = d.title;
if (!d.component) {
d.disabled = true;
}
if (d.model == 'index' || d.model == 'page' || d.model == 'order') {
d.disabled = true;
}
return d;
}),
idField: 'navigationId',
parentIdField: 'parentId'
});
});
}
// 加载文章分类
if (!categoryList.value) {
listCmsArticleCategory({}).then((res) => {
categoryList.value = toTreeData({
data: res?.map((d) => {
d.value = d.categoryId;
d.label = d.title;
return d;
}),
idField: 'categoryId',
parentIdField: 'parentId'
});
});
}
watch(
() => router.currentRoute.value.query,
(query) => {
if (query) {
categoryId.value = Number(query.id);
reload();
}
},
{ immediate: true }
);
</script>
<script lang="ts">
export default {
name: 'CmsArticleV2'
};
export default {
name: 'CmsArticleV2'
};
</script>

View File

@@ -40,17 +40,15 @@
v-model:value="form.type"
/>
</a-form-item>
<a-form-item
label="分类图片"
name="image">
<SelectFile
:placeholder="`请选择图片`"
:limit="1"
:data="images"
@done="chooseImage"
@del="onDeleteItem"
/>
</a-form-item>
<a-form-item label="分类图片" name="image">
<SelectFile
:placeholder="`请选择图片`"
:limit="1"
:data="images"
@done="chooseImage"
@del="onDeleteItem"
/>
</a-form-item>
<a-form-item label="上级分类ID" name="parentId">
<a-input
allow-clear
@@ -110,7 +108,10 @@
v-model:value="form.comments"
/>
</a-form-item>
<a-form-item label="是否隐藏, 0否, 1是(仅注册路由不显示在左侧菜单)" name="hide">
<a-form-item
label="是否隐藏, 0否, 1是(仅注册路由不显示在左侧菜单)"
name="hide"
>
<a-input
allow-clear
placeholder="请输入是否隐藏, 0否, 1是(仅注册路由不显示在左侧菜单)"
@@ -159,7 +160,10 @@
import { ref, reactive, watch } from 'vue';
import { Form, message } from 'ant-design-vue';
import { assignObject, uuid } from 'ele-admin-pro';
import { addCmsArticleCategory, updateCmsArticleCategory } from '@/api/cms/cmsArticleCategory';
import {
addCmsArticleCategory,
updateCmsArticleCategory
} from '@/api/cms/cmsArticleCategory';
import { CmsArticleCategory } from '@/api/cms/cmsArticleCategory/model';
import { useThemeStore } from '@/store/modules/theme';
import { storeToRefs } from 'pinia';
@@ -263,7 +267,9 @@
const formData = {
...form
};
const saveOrUpdate = isUpdate.value ? updateCmsArticleCategory : addCmsArticleCategory;
const saveOrUpdate = isUpdate.value
? updateCmsArticleCategory
: addCmsArticleCategory;
saveOrUpdate(formData)
.then((msg) => {
loading.value = false;
@@ -286,12 +292,12 @@
images.value = [];
if (props.data) {
assignObject(form, props.data);
if(props.data.image){
if (props.data.image) {
images.value.push({
uid: uuid(),
url: props.data.image,
status: 'done'
})
});
}
isUpdate.value = true;
} else {

View File

@@ -45,7 +45,11 @@
</a-card>
<!-- 编辑弹窗 -->
<CmsArticleCategoryEdit v-model:visible="showEdit" :data="current" @done="reload" />
<CmsArticleCategoryEdit
v-model:visible="showEdit"
:data="current"
@done="reload"
/>
</div>
</div>
</template>
@@ -62,8 +66,15 @@
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue';
import CmsArticleCategoryEdit from './components/cmsArticleCategoryEdit.vue';
import { pageCmsArticleCategory, removeCmsArticleCategory, removeBatchCmsArticleCategory } from '@/api/cms/cmsArticleCategory';
import type { CmsArticleCategory, CmsArticleCategoryParam } from '@/api/cms/cmsArticleCategory/model';
import {
pageCmsArticleCategory,
removeCmsArticleCategory,
removeBatchCmsArticleCategory
} from '@/api/cms/cmsArticleCategory';
import type {
CmsArticleCategory,
CmsArticleCategoryParam
} from '@/api/cms/cmsArticleCategory/model';
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
@@ -105,109 +116,109 @@
dataIndex: 'categoryId',
key: 'categoryId',
align: 'center',
width: 90,
width: 90
},
{
title: '分类标识',
dataIndex: 'categoryCode',
key: 'categoryCode',
align: 'center',
align: 'center'
},
{
title: '分类名称',
dataIndex: 'title',
key: 'title',
align: 'center',
align: 'center'
},
{
title: '类型 0列表 1单页 2外链',
dataIndex: 'type',
key: 'type',
align: 'center',
align: 'center'
},
{
title: '分类图片',
dataIndex: 'image',
key: 'image',
align: 'center',
align: 'center'
},
{
title: '上级分类ID',
dataIndex: 'parentId',
key: 'parentId',
align: 'center',
align: 'center'
},
{
title: '路由/链接地址',
dataIndex: 'path',
key: 'path',
align: 'center',
align: 'center'
},
{
title: '组件路径',
dataIndex: 'component',
key: 'component',
align: 'center',
align: 'center'
},
{
title: '绑定的页面',
dataIndex: 'pageId',
key: 'pageId',
align: 'center',
align: 'center'
},
{
title: '用户ID',
dataIndex: 'userId',
key: 'userId',
align: 'center',
align: 'center'
},
{
title: '文章数量',
dataIndex: 'count',
key: 'count',
align: 'center',
align: 'center'
},
{
title: '排序(数字越小越靠前)',
dataIndex: 'sortNumber',
key: 'sortNumber',
align: 'center',
align: 'center'
},
{
title: '备注',
dataIndex: 'comments',
key: 'comments',
align: 'center',
align: 'center'
},
{
title: '是否隐藏, 0否, 1是(仅注册路由不显示在左侧菜单)',
dataIndex: 'hide',
key: 'hide',
align: 'center',
align: 'center'
},
{
title: '是否推荐',
dataIndex: 'recommend',
key: 'recommend',
align: 'center',
align: 'center'
},
{
title: '是否显示在首页',
dataIndex: 'showIndex',
key: 'showIndex',
align: 'center',
align: 'center'
},
{
title: '状态, 0正常, 1禁用',
dataIndex: 'status',
key: 'status',
align: 'center',
align: 'center'
},
{
title: '是否删除, 0否, 1是',
dataIndex: 'deleted',
key: 'deleted',
align: 'center',
align: 'center'
},
{
title: '创建时间',
@@ -222,7 +233,7 @@
title: '修改时间',
dataIndex: 'updateTime',
key: 'updateTime',
align: 'center',
align: 'center'
},
{
title: '操作',
@@ -279,7 +290,9 @@
maskClosable: true,
onOk: () => {
const hide = message.loading('请求中..', 0);
removeBatchCmsArticleCategory(selection.value.map((d) => d.cmsArticleCategoryId))
removeBatchCmsArticleCategory(
selection.value.map((d) => d.cmsArticleCategoryId)
)
.then((msg) => {
hide();
message.success(msg);

View File

@@ -120,7 +120,10 @@
import { ref, reactive, watch } from 'vue';
import { Form, message } from 'ant-design-vue';
import { assignObject, uuid } from 'ele-admin-pro';
import { addCmsArticleComment, updateCmsArticleComment } from '@/api/cms/cmsArticleComment';
import {
addCmsArticleComment,
updateCmsArticleComment
} from '@/api/cms/cmsArticleComment';
import { CmsArticleComment } from '@/api/cms/cmsArticleComment/model';
import { useThemeStore } from '@/store/modules/theme';
import { storeToRefs } from 'pinia';
@@ -220,7 +223,9 @@
const formData = {
...form
};
const saveOrUpdate = isUpdate.value ? updateCmsArticleComment : addCmsArticleComment;
const saveOrUpdate = isUpdate.value
? updateCmsArticleComment
: addCmsArticleComment;
saveOrUpdate(formData)
.then((msg) => {
loading.value = false;
@@ -243,12 +248,12 @@
images.value = [];
if (props.data) {
assignObject(form, props.data);
if(props.data.image){
if (props.data.image) {
images.value.push({
uid: uuid(),
url: props.data.image,
status: 'done'
})
});
}
isUpdate.value = true;
} else {

View File

@@ -45,7 +45,11 @@
</a-card>
<!-- 编辑弹窗 -->
<CmsArticleCommentEdit v-model:visible="showEdit" :data="current" @done="reload" />
<CmsArticleCommentEdit
v-model:visible="showEdit"
:data="current"
@done="reload"
/>
</div>
</div>
</template>
@@ -62,8 +66,15 @@
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue';
import CmsArticleCommentEdit from './components/cmsArticleCommentEdit.vue';
import { pageCmsArticleComment, removeCmsArticleComment, removeBatchCmsArticleComment } from '@/api/cms/cmsArticleComment';
import type { CmsArticleComment, CmsArticleCommentParam } from '@/api/cms/cmsArticleComment/model';
import {
pageCmsArticleComment,
removeCmsArticleComment,
removeBatchCmsArticleComment
} from '@/api/cms/cmsArticleComment';
import type {
CmsArticleComment,
CmsArticleCommentParam
} from '@/api/cms/cmsArticleComment/model';
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
@@ -105,79 +116,79 @@
dataIndex: 'commentId',
key: 'commentId',
align: 'center',
width: 90,
width: 90
},
{
title: '文章ID',
dataIndex: 'articleId',
key: 'articleId',
align: 'center',
align: 'center'
},
{
title: '评分 (10好评 20中评 30差评)',
dataIndex: 'score',
key: 'score',
align: 'center',
align: 'center'
},
{
title: '评价内容',
dataIndex: 'content',
key: 'content',
align: 'center',
align: 'center'
},
{
title: '是否为图片评价',
dataIndex: 'isPicture',
key: 'isPicture',
align: 'center',
align: 'center'
},
{
title: '评论者ID',
dataIndex: 'userId',
key: 'userId',
align: 'center',
align: 'center'
},
{
title: '被评价者ID',
dataIndex: 'toUserId',
key: 'toUserId',
align: 'center',
align: 'center'
},
{
title: '回复的评论ID',
dataIndex: 'replyCommentId',
key: 'replyCommentId',
align: 'center',
align: 'center'
},
{
title: '回复者ID',
dataIndex: 'replyUserId',
key: 'replyUserId',
align: 'center',
align: 'center'
},
{
title: '排序(数字越小越靠前)',
dataIndex: 'sortNumber',
key: 'sortNumber',
align: 'center',
align: 'center'
},
{
title: '备注',
dataIndex: 'comments',
key: 'comments',
align: 'center',
align: 'center'
},
{
title: '状态, 0未读, 1已读',
dataIndex: 'status',
key: 'status',
align: 'center',
align: 'center'
},
{
title: '是否删除, 0否, 1是',
dataIndex: 'deleted',
key: 'deleted',
align: 'center',
align: 'center'
},
{
title: '创建时间',
@@ -192,7 +203,7 @@
title: '修改时间',
dataIndex: 'updateTime',
key: 'updateTime',
align: 'center',
align: 'center'
},
{
title: '操作',
@@ -249,7 +260,9 @@
maskClosable: true,
onOk: () => {
const hide = message.loading('请求中..', 0);
removeBatchCmsArticleComment(selection.value.map((d) => d.cmsArticleCommentId))
removeBatchCmsArticleComment(
selection.value.map((d) => d.cmsArticleCommentId)
)
.then((msg) => {
hide();
message.success(msg);

View File

@@ -41,7 +41,10 @@
import { ref, reactive, watch } from 'vue';
import { Form, message } from 'ant-design-vue';
import { assignObject, uuid } from 'ele-admin-pro';
import { addCmsArticleContent, updateCmsArticleContent } from '@/api/cms/cmsArticleContent';
import {
addCmsArticleContent,
updateCmsArticleContent
} from '@/api/cms/cmsArticleContent';
import { CmsArticleContent } from '@/api/cms/cmsArticleContent/model';
import { useThemeStore } from '@/store/modules/theme';
import { storeToRefs } from 'pinia';
@@ -135,7 +138,9 @@
const formData = {
...form
};
const saveOrUpdate = isUpdate.value ? updateCmsArticleContent : addCmsArticleContent;
const saveOrUpdate = isUpdate.value
? updateCmsArticleContent
: addCmsArticleContent;
saveOrUpdate(formData)
.then((msg) => {
loading.value = false;
@@ -158,12 +163,12 @@
images.value = [];
if (props.data) {
assignObject(form, props.data);
if(props.data.image){
if (props.data.image) {
images.value.push({
uid: uuid(),
url: props.data.image,
status: 'done'
})
});
}
isUpdate.value = true;
} else {

View File

@@ -45,7 +45,11 @@
</a-card>
<!-- 编辑弹窗 -->
<CmsArticleContentEdit v-model:visible="showEdit" :data="current" @done="reload" />
<CmsArticleContentEdit
v-model:visible="showEdit"
:data="current"
@done="reload"
/>
</div>
</div>
</template>
@@ -62,8 +66,15 @@
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue';
import CmsArticleContentEdit from './components/cmsArticleContentEdit.vue';
import { pageCmsArticleContent, removeCmsArticleContent, removeBatchCmsArticleContent } from '@/api/cms/cmsArticleContent';
import type { CmsArticleContent, CmsArticleContentParam } from '@/api/cms/cmsArticleContent/model';
import {
pageCmsArticleContent,
removeCmsArticleContent,
removeBatchCmsArticleContent
} from '@/api/cms/cmsArticleContent';
import type {
CmsArticleContent,
CmsArticleContentParam
} from '@/api/cms/cmsArticleContent/model';
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
@@ -105,19 +116,19 @@
dataIndex: 'id',
key: 'id',
align: 'center',
width: 90,
width: 90
},
{
title: '文章ID',
dataIndex: 'articleId',
key: 'articleId',
align: 'center',
align: 'center'
},
{
title: '文章内容',
dataIndex: 'content',
key: 'content',
align: 'center',
align: 'center'
},
{
title: '创建时间',
@@ -183,7 +194,9 @@
maskClosable: true,
onOk: () => {
const hide = message.loading('请求中..', 0);
removeBatchCmsArticleContent(selection.value.map((d) => d.cmsArticleContentId))
removeBatchCmsArticleContent(
selection.value.map((d) => d.cmsArticleContentId)
)
.then((msg) => {
hide();
message.success(msg);

View File

@@ -41,7 +41,10 @@
import { ref, reactive, watch } from 'vue';
import { Form, message } from 'ant-design-vue';
import { assignObject, uuid } from 'ele-admin-pro';
import { addCmsArticleCount, updateCmsArticleCount } from '@/api/cms/cmsArticleCount';
import {
addCmsArticleCount,
updateCmsArticleCount
} from '@/api/cms/cmsArticleCount';
import { CmsArticleCount } from '@/api/cms/cmsArticleCount/model';
import { useThemeStore } from '@/store/modules/theme';
import { storeToRefs } from 'pinia';
@@ -135,7 +138,9 @@
const formData = {
...form
};
const saveOrUpdate = isUpdate.value ? updateCmsArticleCount : addCmsArticleCount;
const saveOrUpdate = isUpdate.value
? updateCmsArticleCount
: addCmsArticleCount;
saveOrUpdate(formData)
.then((msg) => {
loading.value = false;
@@ -158,12 +163,12 @@
images.value = [];
if (props.data) {
assignObject(form, props.data);
if(props.data.image){
if (props.data.image) {
images.value.push({
uid: uuid(),
url: props.data.image,
status: 'done'
})
});
}
isUpdate.value = true;
} else {

View File

@@ -45,7 +45,11 @@
</a-card>
<!-- 编辑弹窗 -->
<CmsArticleCountEdit v-model:visible="showEdit" :data="current" @done="reload" />
<CmsArticleCountEdit
v-model:visible="showEdit"
:data="current"
@done="reload"
/>
</div>
</div>
</template>
@@ -62,8 +66,15 @@
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue';
import CmsArticleCountEdit from './components/cmsArticleCountEdit.vue';
import { pageCmsArticleCount, removeCmsArticleCount, removeBatchCmsArticleCount } from '@/api/cms/cmsArticleCount';
import type { CmsArticleCount, CmsArticleCountParam } from '@/api/cms/cmsArticleCount/model';
import {
pageCmsArticleCount,
removeCmsArticleCount,
removeBatchCmsArticleCount
} from '@/api/cms/cmsArticleCount';
import type {
CmsArticleCount,
CmsArticleCountParam
} from '@/api/cms/cmsArticleCount/model';
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
@@ -105,19 +116,19 @@
dataIndex: 'id',
key: 'id',
align: 'center',
width: 90,
width: 90
},
{
title: '文章ID',
dataIndex: 'articleId',
key: 'articleId',
align: 'center',
align: 'center'
},
{
title: '用户ID',
dataIndex: 'userId',
key: 'userId',
align: 'center',
align: 'center'
},
{
title: '创建时间',
@@ -183,7 +194,9 @@
maskClosable: true,
onOk: () => {
const hide = message.loading('请求中..', 0);
removeBatchCmsArticleCount(selection.value.map((d) => d.cmsArticleCountId))
removeBatchCmsArticleCount(
selection.value.map((d) => d.cmsArticleCountId)
)
.then((msg) => {
hide();
message.success(msg);

View File

@@ -41,7 +41,10 @@
import { ref, reactive, watch } from 'vue';
import { Form, message } from 'ant-design-vue';
import { assignObject, uuid } from 'ele-admin-pro';
import { addCmsArticleLike, updateCmsArticleLike } from '@/api/cms/cmsArticleLike';
import {
addCmsArticleLike,
updateCmsArticleLike
} from '@/api/cms/cmsArticleLike';
import { CmsArticleLike } from '@/api/cms/cmsArticleLike/model';
import { useThemeStore } from '@/store/modules/theme';
import { storeToRefs } from 'pinia';
@@ -135,7 +138,9 @@
const formData = {
...form
};
const saveOrUpdate = isUpdate.value ? updateCmsArticleLike : addCmsArticleLike;
const saveOrUpdate = isUpdate.value
? updateCmsArticleLike
: addCmsArticleLike;
saveOrUpdate(formData)
.then((msg) => {
loading.value = false;
@@ -158,12 +163,12 @@
images.value = [];
if (props.data) {
assignObject(form, props.data);
if(props.data.image){
if (props.data.image) {
images.value.push({
uid: uuid(),
url: props.data.image,
status: 'done'
})
});
}
isUpdate.value = true;
} else {

View File

@@ -45,7 +45,11 @@
</a-card>
<!-- 编辑弹窗 -->
<CmsArticleLikeEdit v-model:visible="showEdit" :data="current" @done="reload" />
<CmsArticleLikeEdit
v-model:visible="showEdit"
:data="current"
@done="reload"
/>
</div>
</div>
</template>
@@ -62,8 +66,15 @@
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue';
import CmsArticleLikeEdit from './components/cmsArticleLikeEdit.vue';
import { pageCmsArticleLike, removeCmsArticleLike, removeBatchCmsArticleLike } from '@/api/cms/cmsArticleLike';
import type { CmsArticleLike, CmsArticleLikeParam } from '@/api/cms/cmsArticleLike/model';
import {
pageCmsArticleLike,
removeCmsArticleLike,
removeBatchCmsArticleLike
} from '@/api/cms/cmsArticleLike';
import type {
CmsArticleLike,
CmsArticleLikeParam
} from '@/api/cms/cmsArticleLike/model';
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
@@ -105,19 +116,19 @@
dataIndex: 'id',
key: 'id',
align: 'center',
width: 90,
width: 90
},
{
title: '文章ID',
dataIndex: 'articleId',
key: 'articleId',
align: 'center',
align: 'center'
},
{
title: '用户ID',
dataIndex: 'userId',
key: 'userId',
align: 'center',
align: 'center'
},
{
title: '创建时间',
@@ -183,7 +194,9 @@
maskClosable: true,
onOk: () => {
const hide = message.loading('请求中..', 0);
removeBatchCmsArticleLike(selection.value.map((d) => d.cmsArticleLikeId))
removeBatchCmsArticleLike(
selection.value.map((d) => d.cmsArticleLikeId)
)
.then((msg) => {
hide();
message.success(msg);

View File

@@ -134,7 +134,7 @@
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
import { FormInstance } from 'ant-design-vue/es/form';
import { FileRecord } from '@/api/system/file/model';
import {CmsNavigation} from "@/api/cms/cmsNavigation/model";
import { CmsNavigation } from '@/api/cms/cmsNavigation/model';
// 是否是修改
const isUpdate = ref(false);
@@ -255,12 +255,12 @@
images.value = [];
if (props.data) {
assignObject(form, props.data);
if(props.data.image){
if (props.data.image) {
images.value.push({
uid: uuid(),
url: props.data.image,
status: 'done'
})
});
}
isUpdate.value = true;
} else {

View File

@@ -60,7 +60,7 @@
// 表单数据
const { where, resetFields } = useSearch<CmsDesignParam>({
keywords: '',
categoryId: undefined,
categoryId: undefined
});
// 新增
@@ -89,11 +89,7 @@
if (!d.component) {
d.disabled = true;
}
if (
d.model == 'index' ||
d.model == 'page' ||
d.model == 'order'
) {
if (d.model == 'index' || d.model == 'page' || d.model == 'order') {
d.disabled = true;
}
return d;

View File

@@ -1,53 +1,53 @@
<template>
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
<template #extra>
<Extra/>
<Extra />
</template>
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-pro-table
ref="tableRef"
row-key="cmsDesignId"
:columns="columns"
:datasource="datasource"
:customRow="customRow"
tool-class="ele-toolbar-form"
class="sys-org-table"
>
<template #toolbar>
<search
@search="reload"
:selection="selection"
@add="openEdit"
@remove="removeBatch"
@batchMove="openMove"
/>
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-pro-table
ref="tableRef"
row-key="cmsDesignId"
:columns="columns"
:datasource="datasource"
:customRow="customRow"
tool-class="ele-toolbar-form"
class="sys-org-table"
>
<template #toolbar>
<search
@search="reload"
:selection="selection"
@add="openEdit"
@remove="removeBatch"
@batchMove="openMove"
/>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'image'">
<a-image :src="record.image" :width="50" />
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'image'">
<a-image :src="record.image" :width="50" />
</template>
<template v-if="column.key === 'status'">
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
</template>
<template v-if="column.key === 'action'">
<a-space>
<a @click="openEdit(record)">修改</a>
<a-divider type="vertical" />
<a-popconfirm
title="确定要删除此记录吗?"
@confirm="remove(record)"
>
<a class="ele-text-danger">删除</a>
</a-popconfirm>
</a-space>
</template>
<template v-if="column.key === 'status'">
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
</template>
</ele-pro-table>
</a-card>
<template v-if="column.key === 'action'">
<a-space>
<a @click="openEdit(record)">修改</a>
<a-divider type="vertical" />
<a-popconfirm
title="确定要删除此记录吗?"
@confirm="remove(record)"
>
<a class="ele-text-danger">删除</a>
</a-popconfirm>
</a-space>
</template>
</template>
</ele-pro-table>
</a-card>
<!-- 编辑弹窗 -->
<CmsDesignEdit v-model:visible="showEdit" :data="current" @done="reload" />
<!-- 编辑弹窗 -->
<CmsDesignEdit v-model:visible="showEdit" :data="current" @done="reload" />
</a-page-header>
</template>
@@ -64,10 +64,14 @@
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue';
import CmsDesignEdit from './components/cmsDesignEdit.vue';
import { pageCmsDesign, removeCmsDesign, removeBatchCmsDesign } from '@/api/cms/cmsDesign';
import {
pageCmsDesign,
removeCmsDesign,
removeBatchCmsDesign
} from '@/api/cms/cmsDesign';
import type { CmsDesign, CmsDesignParam } from '@/api/cms/cmsDesign/model';
import {getPageTitle} from "@/utils/common";
import Extra from "@/views/bszx/extra.vue";
import { getPageTitle } from '@/utils/common';
import Extra from '@/views/bszx/extra.vue';
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
@@ -112,7 +116,7 @@
dataIndex: 'pageId',
key: 'pageId',
align: 'center',
width: 90,
width: 90
},
{
title: '页面',

View File

@@ -42,12 +42,12 @@
v-model:value="form.hostValue"
/>
</a-form-item>
<!-- <a-form-item label="状态" name="status">-->
<!-- <a-radio-group v-model:value="form.status">-->
<!-- <a-radio :value="0">显示</a-radio>-->
<!-- <a-radio :value="1">隐藏</a-radio>-->
<!-- </a-radio-group>-->
<!-- </a-form-item>-->
<!-- <a-form-item label="状态" name="status">-->
<!-- <a-radio-group v-model:value="form.status">-->
<!-- <a-radio :value="0">显示</a-radio>-->
<!-- <a-radio :value="1">隐藏</a-radio>-->
<!-- </a-radio-group>-->
<!-- </a-form-item>-->
<a-form-item label="排序号" v-if="isUpdate" name="sortNumber">
<a-input-number
:min="0"

View File

@@ -3,52 +3,51 @@
<template #extra>
<CmsWebsiteSearch />
</template>
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-pro-table
ref="tableRef"
row-key="cmsDomainId"
:columns="columns"
:datasource="datasource"
:customRow="customRow"
tool-class="ele-toolbar-form"
class="sys-org-table"
>
<template #toolbar>
<search
@search="reload"
:selection="selection"
@add="openEdit"
@remove="removeBatch"
@batchMove="openMove"
/>
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-pro-table
ref="tableRef"
row-key="cmsDomainId"
:columns="columns"
:datasource="datasource"
:customRow="customRow"
tool-class="ele-toolbar-form"
class="sys-org-table"
>
<template #toolbar>
<search
@search="reload"
:selection="selection"
@add="openEdit"
@remove="removeBatch"
@batchMove="openMove"
/>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'image'">
<a-image :src="record.image" :width="50" />
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'image'">
<a-image :src="record.image" :width="50" />
</template>
<template v-if="column.key === 'status'">
<a-tag v-if="record.status === 0" color="red">待绑定</a-tag>
<a-tag v-if="record.status === 1" color="green">已绑定</a-tag>
</template>
<template v-if="column.key === 'action'">
<a-space v-if="record.status === 0">
<a @click="openEdit(record)">修改</a>
<a-divider type="vertical" />
<a-popconfirm
title="确定要删除此记录吗?"
@confirm="remove(record)"
>
<a class="ele-text-danger">删除</a>
</a-popconfirm>
</a-space>
</template>
<template v-if="column.key === 'status'">
<a-tag v-if="record.status === 0" color="red">待绑定</a-tag>
<a-tag v-if="record.status === 1" color="green">已绑定</a-tag>
</template>
</ele-pro-table>
</a-card>
<!-- 编辑弹窗 -->
<CmsDomainEdit v-model:visible="showEdit" :data="current" @done="reload" />
<template v-if="column.key === 'action'">
<a-space v-if="record.status === 0">
<a @click="openEdit(record)">修改</a>
<a-divider type="vertical" />
<a-popconfirm
title="确定要删除此记录吗?"
@confirm="remove(record)"
>
<a class="ele-text-danger">删除</a>
</a-popconfirm>
</a-space>
</template>
</template>
</ele-pro-table>
</a-card>
<!-- 编辑弹窗 -->
<CmsDomainEdit v-model:visible="showEdit" :data="current" @done="reload" />
</a-page-header>
</template>
@@ -64,10 +63,14 @@
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue';
import CmsDomainEdit from './components/cmsDomainEdit.vue';
import { pageCmsDomain, removeCmsDomain, removeBatchCmsDomain } from '@/api/cms/cmsDomain';
import {
pageCmsDomain,
removeCmsDomain,
removeBatchCmsDomain
} from '@/api/cms/cmsDomain';
import type { CmsDomain, CmsDomainParam } from '@/api/cms/cmsDomain/model';
import {getPageTitle} from "@/utils/common";
import CmsWebsiteSearch from "@/views/cms/cmsWebsite/components/search.vue";
import { getPageTitle } from '@/utils/common';
import CmsWebsiteSearch from '@/views/cms/cmsWebsite/components/search.vue';
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
@@ -94,9 +97,9 @@
if (filters) {
where.status = filters.status;
}
if(localStorage.getItem('WebsiteId')){
if (localStorage.getItem('WebsiteId')) {
where.websiteId = localStorage.getItem('WebsiteId');
}else {
} else {
where.userId = localStorage.getItem('UserId');
}
return pageCmsDomain({
@@ -121,7 +124,7 @@
title: '域名',
dataIndex: 'domain',
key: 'domain',
align: 'center',
align: 'center'
},
// {
// title: '主机记录',
@@ -139,7 +142,7 @@
title: '状态',
dataIndex: 'status',
key: 'status',
align: 'center',
align: 'center'
},
{
title: '创建时间',

View File

@@ -15,12 +15,10 @@
:model="form"
:rules="rules"
labelAlign="left"
:label-col="
styleResponsive ? { md: 4, sm: 5, xs: 24 } : { flex: '90px' }
"
:label-col="styleResponsive ? { md: 4, sm: 5, xs: 24 } : { flex: '90px' }"
:wrapper-col="
styleResponsive ? { md: 18, sm: 19, xs: 24 } : { flex: '1' }
"
styleResponsive ? { md: 18, sm: 19, xs: 24 } : { flex: '1' }
"
>
<a-form-item label="表单名称" name="name">
<a-input
@@ -64,7 +62,7 @@
@del="onDeleteItem"
/>
<div class="ele-text-placeholder"
>请上传jpgpng格式的图片图片尺寸750px*460px</div
>请上传jpgpng格式的图片图片尺寸750px*460px</div
>
</template>
</a-space>
@@ -85,7 +83,7 @@
@del="onDeleteVideoItem"
/>
<div class="ele-text-placeholder"
>请上传mp4格式的视频文件大小200M以内</div
>请上传mp4格式的视频文件大小200M以内</div
>
</template>
</a-space>
@@ -108,7 +106,7 @@
@del="onDeleteItem2"
/>
<div class="ele-text-placeholder"
>请上传jpgpng格式的图片图片尺寸750px*1624px</div
>请上传jpgpng格式的图片图片尺寸750px*1624px</div
>
</template>
</a-space>
@@ -152,53 +150,49 @@
@change="onSelect(element, index)"
>
<a-select-option value="text"
>单行文本</a-select-option
>单行文本</a-select-option
>
<a-select-option value="textarea"
>多行文本</a-select-option
>多行文本</a-select-option
>
<a-select-option value="radio"
>单选</a-select-option
>单选</a-select-option
>
<a-select-option value="checkbox"
>多选</a-select-option
>多选</a-select-option
>
<a-select-option value="phone"
>手机号码</a-select-option
>手机号码</a-select-option
>
<a-select-option value="email"
>邮箱</a-select-option
>
<a-select-option value="time"
>时间</a-select-option
>
<a-select-option value="date"
>日期</a-select-option
>邮箱</a-select-option
>
<a-select-option value="time">时间</a-select-option>
<a-select-option value="date">日期</a-select-option>
<a-select-option value="image"
>图片上传</a-select-option
>图片上传</a-select-option
>
</a-select>
</template>
</a-input>
<a-checkbox v-model:checked="element.checked"
>必填</a-checkbox
>必填</a-checkbox
>
<a
v-if="element.type == 'radio'"
@click="openRadioForm(element)"
>设置</a
>设置</a
>
<a
v-if="element.type == 'checkbox'"
@click="openCheckboxForm(element)"
>设置</a
>设置</a
>
<a-button
@click="removeItem(index)"
danger
style="margin-left: 10px"
>删除</a-button
>删除</a-button
>
</a-space>
</div>
@@ -207,7 +201,7 @@
</template>
</vue-draggable>
<a @click="addItem"
><PlusCircleOutlined style="margin-right: 4px" />新增</a
><PlusCircleOutlined style="margin-right: 4px" />新增</a
>
</div>
</a-form-item>
@@ -232,7 +226,7 @@
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
import { FormInstance } from 'ant-design-vue/es/form';
import { FileRecord } from '@/api/system/file/model';
import {Website} from "@/api/system/website/model";
import { Website } from '@/api/system/website/model';
// 是否是修改
const useForm = Form.useForm;

View File

@@ -3,51 +3,51 @@
<template #extra>
<CmsWebsiteSearch />
</template>
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-pro-table
ref="tableRef"
row-key="cmsFormId"
:columns="columns"
:datasource="datasource"
:customRow="customRow"
tool-class="ele-toolbar-form"
class="sys-org-table"
>
<template #toolbar>
<search
@search="reload"
:selection="selection"
@add="openEdit"
@remove="removeBatch"
@batchMove="openMove"
/>
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-pro-table
ref="tableRef"
row-key="cmsFormId"
:columns="columns"
:datasource="datasource"
:customRow="customRow"
tool-class="ele-toolbar-form"
class="sys-org-table"
>
<template #toolbar>
<search
@search="reload"
:selection="selection"
@add="openEdit"
@remove="removeBatch"
@batchMove="openMove"
/>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'image'">
<a-image :src="record.image" :width="50" />
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'image'">
<a-image :src="record.image" :width="50" />
</template>
<template v-if="column.key === 'status'">
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
</template>
<template v-if="column.key === 'action'">
<a-space>
<a @click="openEdit(record)">修改</a>
<a-divider type="vertical" />
<a-popconfirm
title="确定要删除此记录吗?"
@confirm="remove(record)"
>
<a class="ele-text-danger">删除</a>
</a-popconfirm>
</a-space>
</template>
<template v-if="column.key === 'status'">
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
</template>
</ele-pro-table>
</a-card>
<template v-if="column.key === 'action'">
<a-space>
<a @click="openEdit(record)">修改</a>
<a-divider type="vertical" />
<a-popconfirm
title="确定要删除此记录吗?"
@confirm="remove(record)"
>
<a class="ele-text-danger">删除</a>
</a-popconfirm>
</a-space>
</template>
</template>
</ele-pro-table>
</a-card>
<!-- 编辑弹窗 -->
<CmsFormEdit v-model:visible="showEdit" :data="current" @done="reload" />
<!-- 编辑弹窗 -->
<CmsFormEdit v-model:visible="showEdit" :data="current" @done="reload" />
</a-page-header>
</template>
@@ -63,10 +63,14 @@
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue';
import CmsFormEdit from './components/cmsFormEdit.vue';
import { pageCmsForm, removeCmsForm, removeBatchCmsForm } from '@/api/cms/cmsForm';
import {
pageCmsForm,
removeCmsForm,
removeBatchCmsForm
} from '@/api/cms/cmsForm';
import type { CmsForm, CmsFormParam } from '@/api/cms/cmsForm/model';
import {getPageTitle} from "@/utils/common";
import CmsWebsiteSearch from "@/views/cms/cmsWebsite/components/search.vue";
import { getPageTitle } from '@/utils/common';
import CmsWebsiteSearch from '@/views/cms/cmsWebsite/components/search.vue';
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
@@ -108,7 +112,7 @@
dataIndex: 'formId',
key: 'formId',
align: 'center',
width: 90,
width: 90
},
{
title: '表单标题',
@@ -120,14 +124,14 @@
dataIndex: 'status',
key: 'status',
width: 120,
align: 'center',
align: 'center'
},
{
title: '排序',
dataIndex: 'sortNumber',
key: 'sortNumber',
width: 120,
align: 'center',
align: 'center'
},
{
title: '创建时间',

View File

@@ -99,7 +99,10 @@
import { ref, reactive, watch } from 'vue';
import { Form, message } from 'ant-design-vue';
import { assignObject, uuid } from 'ele-admin-pro';
import { addCmsFormRecord, updateCmsFormRecord } from '@/api/cms/cmsFormRecord';
import {
addCmsFormRecord,
updateCmsFormRecord
} from '@/api/cms/cmsFormRecord';
import { CmsFormRecord } from '@/api/cms/cmsFormRecord/model';
import { useThemeStore } from '@/store/modules/theme';
import { storeToRefs } from 'pinia';
@@ -196,7 +199,9 @@
const formData = {
...form
};
const saveOrUpdate = isUpdate.value ? updateCmsFormRecord : addCmsFormRecord;
const saveOrUpdate = isUpdate.value
? updateCmsFormRecord
: addCmsFormRecord;
saveOrUpdate(formData)
.then((msg) => {
loading.value = false;
@@ -219,12 +224,12 @@
images.value = [];
if (props.data) {
assignObject(form, props.data);
if(props.data.image){
if (props.data.image) {
images.value.push({
uid: uuid(),
url: props.data.image,
status: 'done'
})
});
}
isUpdate.value = true;
} else {

View File

@@ -45,7 +45,11 @@
</a-card>
<!-- 编辑弹窗 -->
<CmsFormRecordEdit v-model:visible="showEdit" :data="current" @done="reload" />
<CmsFormRecordEdit
v-model:visible="showEdit"
:data="current"
@done="reload"
/>
</div>
</div>
</template>
@@ -62,8 +66,15 @@
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue';
import CmsFormRecordEdit from './components/cmsFormRecordEdit.vue';
import { pageCmsFormRecord, removeCmsFormRecord, removeBatchCmsFormRecord } from '@/api/cms/cmsFormRecord';
import type { CmsFormRecord, CmsFormRecordParam } from '@/api/cms/cmsFormRecord/model';
import {
pageCmsFormRecord,
removeCmsFormRecord,
removeBatchCmsFormRecord
} from '@/api/cms/cmsFormRecord';
import type {
CmsFormRecord,
CmsFormRecordParam
} from '@/api/cms/cmsFormRecord/model';
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
@@ -105,67 +116,67 @@
dataIndex: 'formRecordId',
key: 'formRecordId',
align: 'center',
width: 90,
width: 90
},
{
title: '手机号',
dataIndex: 'phone',
key: 'phone',
align: 'center',
align: 'center'
},
{
title: '表单数据',
dataIndex: 'formData',
key: 'formData',
align: 'center',
align: 'center'
},
{
title: '表单ID',
dataIndex: 'formId',
key: 'formId',
align: 'center',
align: 'center'
},
{
title: '用户ID',
dataIndex: 'userId',
key: 'userId',
align: 'center',
align: 'center'
},
{
title: '商户ID',
dataIndex: 'merchantId',
key: 'merchantId',
align: 'center',
align: 'center'
},
{
title: '姓名',
dataIndex: 'name',
key: 'name',
align: 'center',
align: 'center'
},
{
title: '排序(数字越小越靠前)',
dataIndex: 'sortNumber',
key: 'sortNumber',
align: 'center',
align: 'center'
},
{
title: '备注',
dataIndex: 'comments',
key: 'comments',
align: 'center',
align: 'center'
},
{
title: '状态, 0正常, 1冻结',
dataIndex: 'status',
key: 'status',
align: 'center',
align: 'center'
},
{
title: '是否删除, 0否, 1是',
dataIndex: 'deleted',
key: 'deleted',
align: 'center',
align: 'center'
},
{
title: '创建时间',

Some files were not shown because too many files have changed in this diff Show More