diff --git a/src/api/shop/shopGift/model/index.ts b/src/api/shop/shopGift/model/index.ts
index 2f5280d..fcd2de9 100644
--- a/src/api/shop/shopGift/model/index.ts
+++ b/src/api/shop/shopGift/model/index.ts
@@ -52,5 +52,6 @@ export interface ShopGift {
*/
export interface ShopGiftParam extends PageParam {
id?: number;
+ code?: string;
keywords?: string;
}
diff --git a/src/views/shop/shopDealerApply/components/shopDealerApplyEdit.vue b/src/views/shop/shopDealerApply/components/shopDealerApplyEdit.vue
index 014069e..25da65f 100644
--- a/src/views/shop/shopDealerApply/components/shopDealerApplyEdit.vue
+++ b/src/views/shop/shopDealerApply/components/shopDealerApplyEdit.vue
@@ -28,6 +28,7 @@
@@ -38,6 +39,7 @@
@@ -48,6 +50,7 @@
@@ -57,6 +60,7 @@
@@ -64,38 +68,6 @@
-
-
- 申请设置
-
-
-
-
-
-
-
- 需要审核
- 后台人工审核
-
-
- 免审核
- 自动通过
-
-
-
-
-
-
-
-
-
-
-
审核信息
@@ -104,7 +76,7 @@
-
+
待审核
等待审核
@@ -121,10 +93,11 @@
-
+
@@ -132,15 +105,20 @@
-
-
-
+
+
+
+
+
+
+
@@ -257,14 +235,17 @@
],
rejectReason: [
{
- validator: (rule: any, value: any) => {
- if (form.applyStatus === 30 && !value) {
- return Promise.reject('驳回时必须填写驳回原因');
- }
- return Promise.resolve();
- },
+ required: true,
+ message: '驳回时必须填写驳回原因',
trigger: 'blur'
}
+ ],
+ auditTime: [
+ {
+ required: true,
+ message: '审核时请选择审核时间',
+ trigger: 'change'
+ }
]
});
@@ -272,25 +253,71 @@
const { resetFields } = useForm(form, rules);
+ /* 处理审核状态变化 */
+ const handleStatusChange = (value: number) => {
+ // 当状态改为审核通过或驳回时,自动设置审核时间为当前时间
+ if ((value === 20 || value === 30) && !form.auditTime) {
+ form.auditTime = dayjs();
+ }
+ // 当状态改为待审核时,清空审核时间和驳回原因
+ if (value === 10) {
+ form.auditTime = undefined;
+ form.rejectReason = '';
+ }
+ };
+
/* 保存编辑 */
const save = () => {
if (!formRef.value) {
return;
}
+
+ // 动态验证规则
+ const validateFields: string[] = ['userId', 'realName', 'mobile', 'applyStatus'];
+
+ // 如果是驳回状态,需要验证驳回原因
+ if (form.applyStatus === 30) {
+ validateFields.push('rejectReason');
+ }
+
+ // 如果是审核通过或驳回状态,需要验证审核时间
+ if (form.applyStatus === 20 || form.applyStatus === 30) {
+ validateFields.push('auditTime');
+ }
+
formRef.value
- .validate()
+ .validate(validateFields)
.then(() => {
loading.value = true;
const formData = {
...form
};
- // 处理时间字段转换
- if (formData.applyTime && dayjs.isDayjs(formData.applyTime)) {
- formData.applyTime = formData.applyTime.valueOf();
+ // 处理时间字段转换 - 转换为ISO字符串格式
+ if (formData.applyTime) {
+ if (dayjs.isDayjs(formData.applyTime)) {
+ formData.applyTime = formData.applyTime.format('YYYY-MM-DD HH:mm:ss');
+ } else if (typeof formData.applyTime === 'number') {
+ formData.applyTime = dayjs(formData.applyTime).format('YYYY-MM-DD HH:mm:ss');
+ }
}
- if (formData.auditTime && dayjs.isDayjs(formData.auditTime)) {
- formData.auditTime = formData.auditTime.valueOf();
+
+ if (formData.auditTime) {
+ if (dayjs.isDayjs(formData.auditTime)) {
+ formData.auditTime = formData.auditTime.format('YYYY-MM-DD HH:mm:ss');
+ } else if (typeof formData.auditTime === 'number') {
+ formData.auditTime = dayjs(formData.auditTime).format('YYYY-MM-DD HH:mm:ss');
+ }
+ }
+
+ // 当审核状态为通过或驳回时,确保有审核时间
+ if ((formData.applyStatus === 20 || formData.applyStatus === 30) && !formData.auditTime) {
+ formData.auditTime = dayjs().format('YYYY-MM-DD HH:mm:ss');
+ }
+
+ // 当状态为待审核时,清空审核时间
+ if (formData.applyStatus === 10) {
+ formData.auditTime = undefined;
}
const saveOrUpdate = isUpdate.value ? updateShopDealerApply : addShopDealerApply;
@@ -315,7 +342,7 @@
if (visible) {
if (props.data) {
assignObject(form, props.data);
- // 处理时间字段
+ // 处理时间字段 - 确保转换为dayjs对象
if (props.data.applyTime) {
form.applyTime = dayjs(props.data.applyTime);
}
diff --git a/src/views/shop/shopDealerApply/index.vue b/src/views/shop/shopDealerApply/index.vue
index e0f92d6..830fa1d 100644
--- a/src/views/shop/shopDealerApply/index.vue
+++ b/src/views/shop/shopDealerApply/index.vue
@@ -117,9 +117,9 @@
// 表格列配置
const columns = ref([
{
- title: 'ID',
- dataIndex: 'applyId',
- key: 'applyId',
+ title: '用户ID',
+ dataIndex: 'userId',
+ key: 'userId',
align: 'center',
width: 80,
fixed: 'left'
diff --git a/src/views/shop/shopDealerUser/index.vue b/src/views/shop/shopDealerUser/index.vue
index 14d34a0..c970036 100644
--- a/src/views/shop/shopDealerUser/index.vue
+++ b/src/views/shop/shopDealerUser/index.vue
@@ -112,9 +112,9 @@ const datasource: DatasourceFunction = ({
// 表格列配置
const columns = ref([
{
- title: 'ID',
- dataIndex: 'id',
- key: 'id',
+ title: '用户ID',
+ dataIndex: 'userId',
+ key: 'userId',
align: 'center',
width: 80,
fixed: 'left'
diff --git a/src/views/shop/shopGift/components/makeCard.vue b/src/views/shop/shopGift/components/makeCard.vue
index 962797e..d96256c 100644
--- a/src/views/shop/shopGift/components/makeCard.vue
+++ b/src/views/shop/shopGift/components/makeCard.vue
@@ -22,17 +22,6 @@
-
-
-
- {{ item.name }}
-
-
-
批量生成
-
- 导出
-
+
+ 导出二维码