feat: 新增营销优惠券管理模块

Former-commit-id: 4f09599f46bfa63c1c7be10b799ae72d52c30435
This commit is contained in:
郝先瑞
2022-07-17 21:37:41 +08:00
parent c14a00a14f
commit d8ac40f915
6 changed files with 311 additions and 193 deletions

View File

@@ -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();