fix: resolve admin acceptance defects
This commit is contained in:
@@ -13,6 +13,13 @@
|
||||
><n-select
|
||||
v-model:value="form.hallId"
|
||||
:options="dict.getOptionUnRef('taskHallOption')" /></n-form-item-gi
|
||||
><n-form-item-gi label="关联商品" path="productId"
|
||||
><n-select
|
||||
v-model:value="form.productId"
|
||||
filterable
|
||||
:loading="productLoading"
|
||||
:options="productOptions"
|
||||
placeholder="请选择关联商品" /></n-form-item-gi
|
||||
><n-form-item-gi label="会员等级" :span="2" path="levelIds"
|
||||
><n-select
|
||||
v-model:value="form.levelIds"
|
||||
@@ -61,7 +68,7 @@
|
||||
import Editor from '@/components/Editor/editor.vue';
|
||||
import UploadImage from '@/components/Upload/uploadImage.vue';
|
||||
import { useDictStore } from '@/store/modules/dict';
|
||||
import { TaskEdit, TaskView } from '@/api/productTask';
|
||||
import { ProductList, TaskEdit, TaskView } from '@/api/productTask';
|
||||
const emit = defineEmits(['reload']),
|
||||
message = useMessage(),
|
||||
dict = useDictStore(),
|
||||
@@ -70,7 +77,9 @@
|
||||
saving = ref(false),
|
||||
formRef = ref(),
|
||||
dateRange = ref<any>(),
|
||||
commissionPercent = ref(0);
|
||||
commissionPercent = ref(0),
|
||||
productLoading = ref(false),
|
||||
productOptions = ref<any[]>([]);
|
||||
const init = () => ({
|
||||
id: 0,
|
||||
version: 0,
|
||||
@@ -80,6 +89,7 @@
|
||||
coverAttachmentId: 0,
|
||||
coverUrl: '',
|
||||
hallId: null,
|
||||
productId: null,
|
||||
levelIds: [],
|
||||
commission: '0.00',
|
||||
dailyLimit: 0,
|
||||
@@ -93,6 +103,7 @@
|
||||
description: { required: true, message: '请输入任务描述' },
|
||||
coverUrl: { required: true, message: '请上传任务封面' },
|
||||
hallId: { required: true, type: 'number', message: '请选择任务大厅' },
|
||||
productId: { required: true, type: 'number', message: '请选择关联商品' },
|
||||
levelIds: { required: true, type: 'array', min: 1, message: '请选择会员等级' },
|
||||
commission: { required: true, message: '请输入固定佣金' },
|
||||
};
|
||||
@@ -101,6 +112,16 @@
|
||||
commissionPercent.value = 0;
|
||||
dateRange.value = null;
|
||||
show.value = true;
|
||||
productLoading.value = true;
|
||||
try {
|
||||
const result: any = await ProductList({ page: 1, perPage: 500 });
|
||||
productOptions.value = (result.list || []).map((item) => ({
|
||||
label: `${item.name}(${item.productNo})`,
|
||||
value: item.id,
|
||||
}));
|
||||
} finally {
|
||||
productLoading.value = false;
|
||||
}
|
||||
if (row) {
|
||||
loading.value = true;
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user