From 70199a05916e30a3e031dbce693f9018900966a5 Mon Sep 17 00:00:00 2001 From: zxl <763096477@qq.com> Date: 星期五, 12 九月 2025 18:55:58 +0800 Subject: [PATCH] 管理端 --- manager/src/views/order/cardPack/cardPack.vue | 502 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ manager/src/api/cardPack.js | 10 + 2 files changed, 512 insertions(+), 0 deletions(-) diff --git a/manager/src/api/cardPack.js b/manager/src/api/cardPack.js new file mode 100644 index 0000000..52e1b9c --- /dev/null +++ b/manager/src/api/cardPack.js @@ -0,0 +1,10 @@ +import service from "../libs/axios"; + + +export const getCardPackData = (params) =>{ + return service({ + url: "/cardPack", + method: "GET", + params: params + }) +} diff --git a/manager/src/views/order/cardPack/cardPack.vue b/manager/src/views/order/cardPack/cardPack.vue new file mode 100644 index 0000000..c2d1b6f --- /dev/null +++ b/manager/src/views/order/cardPack/cardPack.vue @@ -0,0 +1,502 @@ +<template> + <div class="management"> + <Card> + <!-- 娲诲姩琛ㄦ牸 --> + <Form + ref="searchForm" + + :model="searchForm" + inline + :label-width="70" + class="search-form" + > + <Form-item label="浼氬憳鏄电О" prop="nickName"> + <Input + type="text" + v-model="searchForm.nickName" + placeholder="璇疯緭鍏ヤ細鍛樻樀绉�" + clearable + style="width: 160px" + /> + </Form-item> + <Button + @click="handleSearch" + type="primary" + icon="ios-search" + class="search-btn" + >鎼滅储</Button> + </Form> + + <Table + :loading="loading" + border + :columns="columns" + :data="data" + ref="table" + class="table" + > + <template slot="sn" slot-scope="{ row }"> + <span>{{row.sn}}</span> + </template> + <!-- 鎿嶄綔鎸夐挳鎻掓Ы --> + <template slot-scope="{ row }" slot="action"> + <div class="action-btns"> + <Button + type="info" + size="small" + @click="showCardPack(row)" + >绀煎搧鍗″寘</Button> + + </div> + </template> + <template slot="nickName" slot-scope="{ row }"> + <span >{{row.nickName}}</span> + </template> + </Table> + + <!-- 鍒嗛〉 --> + <Row type="flex" justify="end" class="page-footer"> + <Page + :current="searchForm.pageNumber" + :total="total" + :page-size="searchForm.pageSize" + @on-change="changePage" + @on-page-size-change="changePageSize" + :page-size-opts="[10, 20, 50]" + size="small" + show-total + show-elevator + show-sizer + ></Page> + </Row> + + <!-- 妯℃�佹 --> + <Modal + v-model="modelShow" + title="绀煎寘鍗�" + @on-cancel="modelClose" + width="1000" + class="modal" + > + <Form + ref="cardPackForm" + :model="cardPackListForm" + inline + :label-width="70" + class="search-form" + > + <Form-item label="棰嗗彇浜哄悕绉�" prop="userNickName"> + <Input + type="text" + v-model="cardPackListForm.userNickName" + placeholder="璇疯緭鍏ヤ細鍛樻樀绉�" + clearable + style="width: 160px" + /> + </Form-item> + <Form-item label="鍟嗗搧鍚嶇О" prop="skuName"> + <Input + type="text" + v-model="cardPackListForm.skuName" + placeholder="璇疯緭鍏ヤ細鍛樻樀绉�" + clearable + style="width: 160px" + /> + </Form-item> + <Button + @click="cardPackLisHandleSearch" + type="primary" + icon="ios-search" + class="search-btn" + >鎼滅储</Button> + </Form> + <Table + :loading="cardPackLoading" + border + :columns="cardPackColumns" + :data="cardPackList" + class="table" + + ></Table> + <Row type="flex" justify="end" class="page-footer"> + <Page + :current="cardPackListForm.pageNumber" + :total="cardPackTotal" + :page-size="cardPackListForm.pageSize" + @on-change="cardPackChangePage" + @on-page-size-change="cardPackPageSize" + :page-size-opts="[5, 20, 50]" + size="small" + show-total + show-elevator + show-sizer + ></Page> + </Row> + </Modal> + </Card> + </div> +</template> + +<script> +import { getCardPackData } from '@/api/cardPack' +import { getOrderList } from '@/api/order' +export default { + name: "CarPack", + data() { + return { + modelShow:false, + + loading: false, + cardPackLoading: false, + // 鎼滅储琛ㄥ崟 + searchForm: { + nickName:'', + couponFlag: 'COUPON', + pageNumber: 1, + pageSize: 10 + }, + cardPackListForm:{ + skuName:'', + userNickName:'', + orderId:'', + pageNumber: 1, + pageSize: 10 + }, + //鍒楄〃鏁版嵁 + data: [], + cardPackList:[], + total: 0, + cardPackTotal:0, + // 琛ㄦ牸鍒楅厤缃� + columns: [ + { + title: "璁㈠崟鍙�", + key: "sn", + minWidth: 240, + tooltip: true, + slot: 'sn' + }, + + { + title: "璁㈠崟鏉ユ簮", + key: "clientType", + width: 120, + render: (h, params) => { + if (params.row.clientType == "H5") { + return h("div", {}, "绉诲姩绔�"); + } else if (params.row.clientType == "PC") { + return h("div", {}, "PC绔�"); + } else if (params.row.clientType == "WECHAT_MP") { + return h("div", {}, "灏忕▼搴忕"); + } else if (params.row.clientType == "APP") { + return h("div", {}, "绉诲姩搴旂敤绔�"); + } else { + return h("div", {}, params.row.clientType); + } + }, + }, + { + title: "璁㈠崟绫诲瀷", + key: "orderPromotionType", + width: 120, + render: (h, params) => { + if (params.row.orderPromotionType == "NORMAL") { + return h("div", [ + h("tag", { props: { color: "blue" } }, "鏅�氳鍗�"), + ]); + } else if (params.row.orderPromotionType == "PINTUAN") { + return h("div", [ + h("tag", { props: { color: "volcano" } }, "鎷煎洟璁㈠崟"), + ]); + } else if (params.row.orderPromotionType == "GIFT") { + return h("div", [ + h("tag", { props: { color: "green" } }, "璧犲搧璁㈠崟"), + ]); + } else if (params.row.orderPromotionType == "POINTS") { + return h("div", [ + h("tag", { props: { color: "geekblue" } }, "绉垎璁㈠崟"), + ]); + } else if (params.row.orderPromotionType == "KANJIA") { + return h("div", [ + h("tag", { props: { color: "pink" } }, "鐮嶄环璁㈠崟"), + ]); + } + }, + }, + { + title: "涔板鍚嶇О", + key: "nickName", + minWidth: 130, + tooltip: true, + slot:'nickName' + }, + + { + title: "璁㈠崟閲戦", + key: "flowPrice", + minWidth: 100, + tooltip: true, + render: (h, params) => { + return h("priceColorScheme", {props:{value:params.row.flowPrice,color:this.$mainColor}} ); + }, + + }, + + { + title: "璁㈠崟鐘舵��", + key: "orderStatus", + minWidth: 100, + render: (h, params) => { + if (params.row.orderStatus == "UNPAID") { + return h("div", [ + h("tag", { props: { color: "magenta" } }, "鏈粯娆�"), + ]); + } else if (params.row.orderStatus == "PAID") { + return h("div", [ + h("tag", { props: { color: "blue" } }, "宸蹭粯娆�"), + ]); + } else if (params.row.orderStatus == "UNDELIVERED") { + return h("div", [ + h("tag", { props: { color: "geekblue" } }, "寰呭彂璐�"), + ]); + } else if (params.row.orderStatus == "STAY_PICKED_UP") { + return h("div", [ + h("tag", { props: { color: "geekblue" } }, "寰呰嚜鎻�"), + ]); + } else if (params.row.orderStatus == "DELIVERED") { + return h("div", [ + h("tag", { props: { color: "cyan" } }, "宸插彂璐�"), + ]); + } else if (params.row.orderStatus == "COMPLETED") { + return h("div", [ + h("tag", { props: { color: "green" } }, "宸插畬鎴�"), + ]); + } else if (params.row.orderStatus == "TAKE") { + return h("div", [ + h("tag", { props: { color: "volcano" } }, "寰呮牳楠�"), + ]); + } else if (params.row.orderStatus == "CANCELLED") { + return h("div", [ + h("tag", { props: { color: "red" } }, "宸插叧闂�"), + ]); + } + }, + }, + { + title: "涓嬪崟鏃堕棿", + key: "createTime", + width: 170, + }, + { + title:"鏀惰揣浜�", + key:"consigneeName", + width: 170, + }, + { + title:"鎵嬫満鍙�", + key:"consigneeMobile", + width: 170, + }, + { + title: "鎿嶄綔", + key: "action", + align: "center", + width: 150, + fixed:"right", + render: (h, params) => { + const buttons = []; + + // 鏌ョ湅鎸夐挳 - 濮嬬粓鏄剧ず + buttons.push( + h( + "Button", + { + props: { type: "info", size: "small" }, + style: { marginRight: "5px" }, + on: { + click: () => { + this.showCardPack(params.row); + }, + }, + }, + "鏌ョ湅" + ) + ); + return h('div', buttons); + }, + }, + ], + + cardPackColumns : [ + { + title: '浼樻儬鍒窱D', + key: 'couponId', + align: 'center', + width: 180 + }, + { + title: '浼樻儬鍒稿悕绉�', + key: 'couponName', + align: 'center', + width: 120 + }, + { + title: '浼樻儬鍒哥紪鍙�', + key: 'couponNo', + align: 'center', + width: 120 + }, + { + title: '鍟嗗搧鍚嶇О', + key: 'skuName', + align: 'center', + width: 120 + }, + { + title: '璁㈠崟ID', + key: 'orderId', + align: 'center', + width: 220 + }, + { + title: '棰嗗彇鐘舵��', + key: 'claimStatus', + align: 'center', + width: 120, + // 杞崲claimStatus鏄剧ず鏂囨湰 + render: (h, params) => { + const status = params.row.claimStatus; + let text = '鏈煡'; + let color = '#999'; + + if (status === 'CLAIM') { + text = '宸查鍙�'; + color = '#00B42A'; + } else if (status === 'NOT_CLAIM') { + text = '鏈鍙�'; + color = '#FF7D00'; + } + + return h('span', { + style: { color } + }, text); + } + }, + { + title: '棰嗗彇浜�', + key: 'userNickName', + align: 'center', + minWidth: 80 + }, + { + title: '鍒嗕韩鐘舵��', + key: 'shareStatus', + align: 'center', + minWidth: 120, + // 杞崲shareStatus鏄剧ず鏂囨湰 + render: (h, params) => { + const status = params.row.shareStatus; + let text = '鏈煡'; + let color = '#999'; + + if (status === 'SHARED') { + text = '宸插垎浜�'; + color = '#00B42A'; + } else if (status === 'NOT_SHARE') { + text = '鏈垎浜�'; + color = '#FF7D00'; + } + + return h('span', { + style: { color } + }, text); + } + } + ], + } + }, + mounted(){ + //鍒濆鍖� + this.getData(); + }, + methods: { + // 鎼滅储 + handleSearch() { + this.searchForm.pageNumber = 1; + this.searchForm.pageSize = 10; + this.getData(); + }, + cardPackLisHandleSearch(){ + this.cardPackListForm.pageNumber = 1; + this.cardPackListForm.pageSize = 10; + + this.getCardPackData() + }, + cardPackChangePage(page) { + this.cardPackListForm.pageNumber = page + this.getCardPackData() + }, + + // 鏀瑰彉姣忛〉鏉℃暟 + cardPackPageSize(pageSize) { + this.cardPackListForm.pageNumber = 1 + this.cardPackListForm.pageSize = pageSize + this.getCardPackData() + }, + + + changePage(page) { + this.searchForm.pageNumber = page + this.getData() + }, + + // 鏀瑰彉姣忛〉鏉℃暟 + changePageSize(pageSize) { + this.searchForm.pageNumber = 1 + this.searchForm.pageSize = pageSize + this.getData() + }, + + getData(){ + this.loading = true; + getOrderList(this.searchForm).then(res =>{ + this.loading = false; + if (res.success) { + this.data = res.result.records; + this.total = res.result.total; + } + }) + }, + showCardPack(row){ + this.modelShow = true; + this.cardPackListForm.orderId = row.sn; + //閲嶇疆椤电爜 + this.cardPackListForm.pageSize = 10; + this.cardPackListForm.pageNumber=1; + this.cardPackTotal = 0; + this.getCardPackData() + + }, + getCardPackData(){ + //鑾峰緱鏁版嵁 + this.cardPackLoading = true; + getCardPackData(this.cardPackListForm).then(res =>{ + this.cardPackLoading = false; + if (res.code === 200){ + this.cardPackList = res.data; + this.cardPackTotal = res.total; + } + }) + }, + + modelClose(){ + this.modelShow = false + } + + } +} +</script> + +<style lang="scss" scoped> + +</style> -- Gitblit v1.8.0