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

@@ -1,7 +1,7 @@
<!-- setup 无法设置组件名称组件名称keepAlive必须 -->
<script lang="ts">
export default {
name: 'goods',
name: 'goods'
};
</script>
@@ -16,12 +16,13 @@ import {
Edit,
Refresh,
Delete,
View,
View
} from '@element-plus/icons-vue';
import { listSpuPages, deleteSpu } from '@/api/pms/goods';
import { listCascadeCategories } from '@/api/pms/category';
import { listCategoryOptions } from '@/api/pms/category';
import { GoodsItem, GoodsQueryParam } from '@/types/api/pms/goods';
import { moneyFormatter } from '@/utils/filter';
import { Option } from '@/types/common';
const dataTableRef = ref(ElTable);
const router = useRouter();
@@ -38,12 +39,12 @@ const state = reactive({
total: 0,
queryParams: {
pageNum: 1,
pageSize: 10,
pageSize: 10
} as GoodsQueryParam,
goodsList: [] as GoodsItem[],
categoryOptions: [],
categoryOptions: [] as Option[],
goodDetail: undefined,
dialogVisible: false,
dialogVisible: false
});
const {
@@ -54,7 +55,7 @@ const {
categoryOptions,
goodDetail,
total,
dialogVisible,
dialogVisible
} = toRefs(state);
function handleQuery() {
@@ -71,7 +72,7 @@ function resetQuery() {
pageNum: 1,
pageSize: 10,
name: undefined,
categoryId: undefined,
categoryId: undefined
};
handleQuery();
}
@@ -88,7 +89,7 @@ function handleAdd() {
function handleUpdate(row: any) {
router.push({
path: 'goods-detail',
query: { goodsId: row.id, categoryId: row.categoryId },
query: { goodsId: row.id, categoryId: row.categoryId }
});
}
@@ -97,7 +98,7 @@ function handleDelete(row: any) {
ElMessageBox.confirm('是否确认删除选中的数据项?', '警告', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
type: 'warning'
})
.then(function () {
return deleteSpu(ids);
@@ -119,8 +120,8 @@ function handleSelectionChange(selection: any) {
}
onMounted(() => {
listCascadeCategories({}).then((response) => {
state.categoryOptions = ref(response.data);
listCategoryOptions().then(({ data }) => {
categoryOptions.value = data;
});
handleQuery();
});