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; });