From 837098a3d2c84f712449536632d0eacfe1adf144 Mon Sep 17 00:00:00 2001 From: Jruome <2559028966@qq.com> Date: Fri, 9 Jun 2023 20:12:20 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=A1=E7=90=86=E7=AB=AF=20=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E5=8F=91=E8=B4=A7=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yudao-ui-admin/src/api/shop/rechargeOrder.js | 9 +++ .../src/views/shop/rechargeOrder/index.vue | 65 ++++++++++++++++++- 2 files changed, 71 insertions(+), 3 deletions(-) diff --git a/yudao-ui-admin/src/api/shop/rechargeOrder.js b/yudao-ui-admin/src/api/shop/rechargeOrder.js index 56ff58af4..79a02925b 100644 --- a/yudao-ui-admin/src/api/shop/rechargeOrder.js +++ b/yudao-ui-admin/src/api/shop/rechargeOrder.js @@ -43,6 +43,15 @@ export function refundRechargeOrder(data) { }) } +// 发货状态更改 +export function updateByIds(query) { + return request({ + url: '/shop/recharge-order/updateByIds', + method: 'post', + data: query + }) +} + // 获得订单分页 export function getRechargeOrderPage(query) { return request({ diff --git a/yudao-ui-admin/src/views/shop/rechargeOrder/index.vue b/yudao-ui-admin/src/views/shop/rechargeOrder/index.vue index 44eaf8bf6..56f15363e 100644 --- a/yudao-ui-admin/src/views/shop/rechargeOrder/index.vue +++ b/yudao-ui-admin/src/views/shop/rechargeOrder/index.vue @@ -22,6 +22,12 @@ + + + + + + @@ -43,11 +49,23 @@ 导出 + + 批量更新发货状态 + - + + + + { + handleChange(value,scope.row) + })"> + + @@ -67,6 +85,11 @@ + + + {{scope.row.status? "已发货" : "未发货"}} + + @@ -117,6 +140,7 @@ import { updateRechargeOrder, deleteRechargeOrder, getRechargeOrder, + updateByIds, getRechargeOrderPage, exportRechargeOrderExcel, refundRechargeOrder @@ -214,13 +238,42 @@ export default { proTotalPrice: [{ required: true, message: "商品总价不能为空", trigger: "blur" }], beforePayPrice: [{ required: true, message: "改价前支付金额不能为空", trigger: "blur" }], isAlterPrice: [{ required: true, message: "是否改价,0-否,1-是不能为空", trigger: "blur" }], - } + }, + multipleSelection: [] }; }, created() { this.getList(); }, methods: { + handleChange(bool, value){ + if(bool){ + this.multipleSelection.push(value.id) + }else { + this.multipleSelection.splice(this.multipleSelection.indexOf(value.id),1) + } + }, + async handleGoods(){ + if(this.multipleSelection.length){ + await updateByIds({ids:this.multipleSelection,status:true}) + this.getList(); + }else { + this.$modal.msgWarning("请勾选需要更改发货状态的订单") + } + }, + handleSelectionChange(val) { + if(!this.multipleSelection.length){ + + this.$refs.multipleTable.clearSelection() + this.multipleSelection = arr.map(item => item.id) + arr.forEach(row => { + this.$refs.multipleTable.toggleRowSelection(row); + }); + }else { + this.$refs.multipleTable.clearSelection() + this.multipleSelection = [] + } + }, handleReview(row, status){ }, @@ -229,7 +282,13 @@ export default { this.loading = true; // 执行查询 getRechargeOrderPage(this.queryParams).then(response => { - this.list = response.data.list; + const arr = response.data.list.map((item) => { + return { + ...item, + bool:item.status + } + }) + this.list = arr; this.total = response.data.total; this.loading = false; });