feat: 新增营销优惠券管理模块
Former-commit-id: 4f09599f46bfa63c1c7be10b799ae72d52c30435
This commit is contained in:
@@ -41,34 +41,35 @@ import { ElCascaderPanel, ElMessage } from 'element-plus';
|
||||
import { CaretRight } from '@element-plus/icons-vue';
|
||||
|
||||
// API 引用
|
||||
import { listCascadeCategories } from '@/api/pms/category';
|
||||
import { listCategoryOptions } from '@/api/pms/category';
|
||||
import { computed } from '@vue/reactivity';
|
||||
import { Option } from '@/types/common';
|
||||
|
||||
const emit = defineEmits(['next', 'update:modelValue']);
|
||||
const props = defineProps({
|
||||
modelValue: {
|
||||
type: Object,
|
||||
default: () => {},
|
||||
},
|
||||
default: () => {}
|
||||
}
|
||||
});
|
||||
|
||||
const goodsInfo: any = computed({
|
||||
get: () => props.modelValue,
|
||||
set: (value) => {
|
||||
set: value => {
|
||||
emit('update:modelValue', value);
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
const state = reactive({
|
||||
categoryOptions: [],
|
||||
pathLabels: [],
|
||||
categoryOptions: [] as Option[],
|
||||
pathLabels: []
|
||||
});
|
||||
|
||||
const { categoryOptions, pathLabels } = toRefs(state);
|
||||
|
||||
function loadData() {
|
||||
listCascadeCategories().then((response) => {
|
||||
state.categoryOptions = response.data;
|
||||
listCategoryOptions().then(({ data }) => {
|
||||
state.categoryOptions = data;
|
||||
if (goodsInfo.value.id) {
|
||||
nextTick(() => {
|
||||
handleCategoryChange();
|
||||
|
||||
Reference in New Issue
Block a user