diff --git a/src/views/modules/operation-management/commodity/index.vue b/src/views/modules/operation-management/commodity/index.vue index 5225495..c5e03f9 100644 --- a/src/views/modules/operation-management/commodity/index.vue +++ b/src/views/modules/operation-management/commodity/index.vue @@ -71,7 +71,7 @@ - +
添加商品 批量删除 @@ -169,7 +169,7 @@ :total="pagination.total" class="pagination-container" > - +
diff --git a/src/views/modules/operation-management/notice/index.vue b/src/views/modules/operation-management/notice/index.vue index 9b76fc6..71b6a68 100644 --- a/src/views/modules/operation-management/notice/index.vue +++ b/src/views/modules/operation-management/notice/index.vue @@ -1,130 +1,65 @@ @@ -136,31 +71,15 @@ export default { components: { addOrUpdate, setSorting }, data() { return { - activeName: "5", - advanceSellStatus: "", dataList: [], formInline: { targetId: "", position: "3", + app: 1, }, - tableProp: { - "auto-resize": true, - border: true, - height: "auto", - "row-id": "id", - "show-overflow": false, - }, - selectList: [], - type: [ - { - value: 0, - label: "菜市场分类", - }, - { - value: 1, - label: "云店分类", - }, - ], + page: 1, + limit: 10, + total: 0, application: [ { label: "用户端", value: 1 }, { @@ -190,165 +109,72 @@ export default { app: 1, }; } - this.$nextTick(() => { - this.$refs.oTable.reload(); - }); + this.queryList(); }, methods: { - // getData() { - // this.$api.mer_admin - // .storeList({ marketId: this.formInline.marketId }) - // .then((res) => { - // this.storeList = res.data.data; - // this.formInline.shopId = res.data.data[0].shopId; - // this.$nextTick(() => { - // this.$refs.oTable.reload(); - // }); - // }); - // }, - addBanner() { - this.$refs.addOrUpdate.toggle().add(this.formInline); + handleQuery() { + this.page = 1; + this.queryList(); }, - changePosition(e) { - console.log(e, this.shopId, this.marketId); - - if (e == 3) { - this.formInline.targetId = this.shopId; - } else { - this.formInline.targetId = this.marketId; - } - console.log(e); - }, - queryList(pageNo, pageSize) { + queryList() { this.$api.mer_admin .noticePage({ - pageNumber: pageNo, - pageSize: pageSize, + pageNumber: this.page, + pageSize: this.limit, ...this.formInline, }) .then((res) => { - console.log(res); - this.$refs.oTable.complete( - res.data.data.data, - Number(res.data.data.total) - ); + this.dataList = res.data.data.data; + this.total = Number(res.data.data.total); }) .catch((err) => { - this.$refs.oTable.complete(false); + // Handle error }); }, + addBanner() { + this.$refs.addOrUpdate.add(this.formInline); + this.$refs.addOrUpdate.toggle(); + }, + updateBanner(row) { + this.$refs.addOrUpdate.update(row); + this.$refs.addOrUpdate.toggle(); + }, + deleteBanner(row) { + this.$api.mer_admin.noticeDelete({ id: row.id }).then((res) => { + this.queryList(); + }); + }, Reset() { this.formInline = { targetId: this.shopId, position: "3", app: 1, }; - this.$refs.oTable.reload(); + this.handleQuery(); }, - //排序 setSort() { this.$refs.setSorting.init(this.dataList); }, + handleSizeChange(val) { + this.limit = val; + this.queryList(); + }, + handleCurrentChange(val) { + this.page = val; + this.queryList(); + }, + getPosition(position) { + if (position == "1") { + return "首页"; + } else if (position == "2") { + return "菜市场详情页"; + } else if (position == "3") { + return "摊位详情"; + } + return ""; + }, }, computed: { - tableCols() { - return [ - // { type: "checkbox", width: "60px", fixed: "left" }, - { type: "seq", width: "60px", align: "center", title: "序号" }, - { - title: "公告通知", - align: "center", - field: "title", - }, - { - title: "位置", - align: "center", - field: "startTime", - type: "jsx", - width: "120px", - render: ({ row }) => { - let getPosition = (row) => { - if (row == "1") { - return "首页"; - } else if (row == "2") { - return "菜市场详情页"; - } else if (row == "3") { - return "摊位详情"; - } - }; - return {getPosition(row.position)}; - }, - }, - { - title: "状态", - align: "center", - field: "status", - type: "jsx", - width: "120px", - render: ({ row }) => { - return {row.status ? "已启用" : "已禁用"}; - }, - }, - { - title: "操作", - fixed: "right", - type: "jsx", - align: "center", - width: "220px", - render: ({ row }) => { - let updateBanner = () => { - this.$refs.addOrUpdate.toggle(row).update(); - }; - let deleteBanner = () => { - this.$api.mer_admin - .noticeDelete({ id: row.id }) - .then((res) => { - this.$refs.oTable.reload(); - }) - .catch((err) => { - this.$refs.oTable.reload(); - }); - }; - let onCancel = () => {}; - return ( -
- - 编辑 - - - - 删除 - - -
- ); - }, - }, - ]; - }, - tableEvent() { - return { - "checkbox-all": ({ records, reserves }) => { - this.selectList = [...records, ...reserves]; - }, - "checkbox-change": ({ records, reserves }) => { - this.selectList = [...records, ...reserves]; - }, - }; - }, ...mapState("userData", [ "isMerchant", "marketList", @@ -360,4 +186,24 @@ export default { }; - + + diff --git a/src/views/modules/operation-management/notice/popup/add-or-update.vue b/src/views/modules/operation-management/notice/popup/add-or-update.vue index cb227e5..75ebf27 100644 --- a/src/views/modules/operation-management/notice/popup/add-or-update.vue +++ b/src/views/modules/operation-management/notice/popup/add-or-update.vue @@ -1,218 +1,107 @@ + + +