diff --git a/src/api/sylive/activity/index.js b/src/api/sylive/activity/index.js index 7aafa8a..21626fa 100644 --- a/src/api/sylive/activity/index.js +++ b/src/api/sylive/activity/index.js @@ -14,34 +14,6 @@ export async function pageActivity(params) { return Promise.reject(new Error(res.data.message)); } -/** - * 分页查询活动订单 - * @param params 查询条件 - */ -export async function pageOrder(params) { - const res = await request.get('/sylive/activity/order', { - params - }); - if (res.data.code === 0) { - return res.data.data; - } - return Promise.reject(new Error(res.data.message)); -} - -/** - * 查询活动订单 - * @param params 查询条件 - */ -export async function orderExport(params) { - const res = await request.get('/sylive/activity/order_export', { - params - }); - if (res.data.code === 0) { - return res.data.data; - } - return Promise.reject(new Error(res.data.message)); -} - /** * 根据id查询活动 * @param id 活动id diff --git a/src/api/sylive/goods/index.js b/src/api/sylive/goods/index.js index 660ab7f..08d8b94 100644 --- a/src/api/sylive/goods/index.js +++ b/src/api/sylive/goods/index.js @@ -65,13 +65,13 @@ export async function updateGoods(data) { } /** - * 修改活动状态 - * @param userId 活动id + * 修改商品状态 + * @param itemId 商品id * @param status 状态 */ -export async function updateGoodsStatus(id, status) { +export async function updateGoodsStatus(itemId, status) { const res = await request.put('/sylive/goods/status', { - id, + itemId, status }); if (res.data.code === 0) { diff --git a/src/api/sylive/order/index.js b/src/api/sylive/order/index.js index c90673e..1a9bb37 100644 --- a/src/api/sylive/order/index.js +++ b/src/api/sylive/order/index.js @@ -41,13 +41,15 @@ export async function getOrder(id) { } /** - * 修改订单 - * @param data 订单信息 + * 导出订单 + * @param params 查询条件 */ -export async function updateOrder(data) { - const res = await request.put('/sylive/order', data); +export async function exportOrder(params) { + const res = await request.get('/sylive/order/export', { + params + }); if (res.data.code === 0) { - return res.data.message; + return res.data.data; } return Promise.reject(new Error(res.data.message)); } diff --git a/src/views/sylive/activity/components/activity-item.vue b/src/views/sylive/activity/components/activity-item.vue index b7010ee..b46a8a6 100644 --- a/src/views/sylive/activity/components/activity-item.vue +++ b/src/views/sylive/activity/components/activity-item.vue @@ -6,7 +6,7 @@ :append-to-body="true" :close-on-click-modal="true" custom-class="ele-dialog-form" - title="编辑商品" + title="编辑权益商品" @update:visible="updateVisible" > diff --git a/src/views/sylive/activity/index.vue b/src/views/sylive/activity/index.vue index d40d1be..06a088e 100644 --- a/src/views/sylive/activity/index.vue +++ b/src/views/sylive/activity/index.vue @@ -83,12 +83,11 @@ @@ -261,7 +260,7 @@ this.current = row.coupon; this.showEditCoupon = true; } else if (command === 'goods') { - this.$router.replace('/sylive/activity/goods?id=' + row.activityId); + this.$router.replace('/sylive/goods?id=' + row.activityId); } }, /* 打开数据统计页 */ @@ -328,7 +327,7 @@ }, /* 打开活动订单页 */ openOrder(activityId) { - this.$router.replace('/sylive/activity/order?id=' + activityId); + this.$router.replace('/sylive/order?id=' + activityId); }, /* 删除 */ remove(row) { diff --git a/src/views/sylive/activity/order/components/order-search.vue b/src/views/sylive/activity/order/components/order-search.vue deleted file mode 100644 index 8f2a562..0000000 --- a/src/views/sylive/activity/order/components/order-search.vue +++ /dev/null @@ -1,96 +0,0 @@ - - - - diff --git a/src/views/sylive/activity/order/index.vue b/src/views/sylive/activity/order/index.vue deleted file mode 100644 index 898bed2..0000000 --- a/src/views/sylive/activity/order/index.vue +++ /dev/null @@ -1,238 +0,0 @@ - - - diff --git a/src/views/sylive/activity/goods/components/goods-edit.vue b/src/views/sylive/goods/components/goods-edit.vue similarity index 98% rename from src/views/sylive/activity/goods/components/goods-edit.vue rename to src/views/sylive/goods/components/goods-edit.vue index 51d3702..640c154 100644 --- a/src/views/sylive/activity/goods/components/goods-edit.vue +++ b/src/views/sylive/goods/components/goods-edit.vue @@ -100,7 +100,7 @@ }, data() { const defaultForm = { - id: null, + itemId: null, activityId: null, title: '', price: '', @@ -241,12 +241,13 @@ this.editversion = false; if (visible) { this.editversion = true; - if (this.data.id) { + if (this.data.itemId) { this.$util.assignObject(this.form, { ...this.data }); this.isUpdate = true; } else { + this.form.banner = []; this.form.activityId = this.data.activityId; this.isUpdate = false; } diff --git a/src/views/sylive/activity/goods/components/goods-search.vue b/src/views/sylive/goods/components/goods-search.vue similarity index 95% rename from src/views/sylive/activity/goods/components/goods-search.vue rename to src/views/sylive/goods/components/goods-search.vue index 7a8c4b8..6558a5a 100644 --- a/src/views/sylive/activity/goods/components/goods-search.vue +++ b/src/views/sylive/goods/components/goods-search.vue @@ -9,7 +9,7 @@ - + diff --git a/src/views/sylive/activity/goods/index.vue b/src/views/sylive/goods/index.vue similarity index 71% rename from src/views/sylive/activity/goods/index.vue rename to src/views/sylive/goods/index.vue index e8485fb..e81b7eb 100644 --- a/src/views/sylive/activity/goods/index.vue +++ b/src/views/sylive/goods/index.vue @@ -8,6 +8,7 @@ ref="table" :columns="columns" :datasource="datasource" + :selection.sync="selection" cache-key="syliveActivityGoodsTable" > @@ -31,6 +32,37 @@ 删除 + + + + @@ -49,16 +81,18 @@ removeGoodss, updateGoodsStatus } from '@/api/sylive/goods'; - const ROUTE_PATH = '/sylive/activity/goods'; + const ROUTE_PATH = '/sylive/goods'; export default { - name: 'syliveActivityGoods', + name: 'syliveGoods', components: { GoodsSearch, GoodsEdit }, data() { return { // 加载状态 title: '周边好物', loading: true, + // 表格选中数据 + selection: [], // 当前编辑数据 current: null, // 是否显示编辑弹窗 @@ -66,6 +100,13 @@ activityId: null, // 表格列配置 columns: [ + { + columnKey: 'selection', + type: 'selection', + width: 45, + align: 'center', + fixed: 'left' + }, { columnKey: 'index', type: 'index', @@ -75,75 +116,67 @@ fixed: 'left' }, { - prop: 'uname', - label: '姓名', - showOverflowTooltip: true, - minWidth: 80 - }, - { - prop: 'mobile', - label: '手机号', - showOverflowTooltip: true, - minWidth: 80 - }, - { - prop: 'item_title', - label: '商品标题', + prop: 'title', + label: '标题', sortable: 'custom', showOverflowTooltip: true, minWidth: 150 }, { - prop: 'total_price', - label: '订单价格', + prop: 'stock', + label: '库存', sortable: 'custom', showOverflowTooltip: true, - minWidth: 70 + minWidth: 80 }, { - prop: 'pay_time', - label: '付款时间', + prop: 'price', + label: '价格', sortable: 'custom', showOverflowTooltip: true, - minWidth: 110, - formatter: (_row, _column, cellValue) => { - return this.$util.toDateString(cellValue); - } + minWidth: 80 + }, + { + prop: 'sort', + label: '排序', + sortable: 'custom', + showOverflowTooltip: true, + minWidth: 80 + }, + { + prop: 'timeStart', + label: '抢购开始时间', + sortable: 'custom', + showOverflowTooltip: true, + minWidth: 120 }, { prop: 'createTime', label: '创建时间', sortable: 'custom', showOverflowTooltip: true, - minWidth: 110, + minWidth: 120, formatter: (_row, _column, cellValue) => { return this.$util.toDateString(cellValue); } }, { - prop: 'area', - label: '区域', - showOverflowTooltip: true, - minWidth: 80 - }, - { - prop: 'stores', - label: '门店', - showOverflowTooltip: true, - minWidth: 80 - }, - { - prop: 'consultant', - label: '顾问', - showOverflowTooltip: true, - minWidth: 60 - }, - { - prop: 'statusName', + prop: 'status', label: '状态', + align: 'center', sortable: 'custom', - showOverflowTooltip: true, - minWidth: 60 + width: 90, + resizable: false, + slot: 'status', + showOverflowTooltip: true + }, + { + columnKey: 'action', + label: '操作', + width: 200, + align: 'center', + resizable: false, + slot: 'action' } ] }; @@ -165,7 +198,7 @@ this.loading = false; // 修改页签标题 if (this.$route.path === ROUTE_PATH) { - this.title = data.title + '-周边好物'; + this.title = data.title + '-商品'; setPageTabTitle(this.title); } }) @@ -181,9 +214,10 @@ /* 显示编辑 */ openEdit(item) { if (!item) { - item.activityId = this.activityId; + this.current = { activityId: this.activityId }; + } else { + this.current = item; } - this.current = item; this.showEdit = true; }, /* 删除 */ @@ -206,7 +240,7 @@ this.$message.error('请至少选择一条数据'); return; } - this.$confirm('确定要删除选中的活动吗?', '提示', { + this.$confirm('确定要删除选中的商品吗?', '提示', { type: 'warning' }) .then(() => { @@ -227,7 +261,7 @@ /* 更改状态 */ editStatus(row) { const loading = this.$loading({ lock: true }); - updateGoodsStatus(row.activityId, row.status) + updateGoodsStatus(row.itemId, row.status) .then((msg) => { loading.close(); this.$message.success(msg); diff --git a/src/views/sylive/order/components/order-search.vue b/src/views/sylive/order/components/order-search.vue index e436fb9..b8ae875 100644 --- a/src/views/sylive/order/components/order-search.vue +++ b/src/views/sylive/order/components/order-search.vue @@ -7,27 +7,43 @@ @submit.native.prevent > - - - - - - + - + - + - - - + + + + + + - + + + + + + + + + - + + + + + + + + + + +