diff --git a/src/api/order/offline.js b/src/api/order/offline.js index a6c777f1..8cab4949 100644 --- a/src/api/order/offline.js +++ b/src/api/order/offline.js @@ -33,7 +33,7 @@ export function orderDetailInfoApi(data) { // 订单-部分退款 export function refundOrderPartApi(data) { return request({ - url: '/smart-canteen/api/v2/web/order/part/refund', + url: '/smart-canteen/order/part_refund', method: 'post', headers: { "merchant-id":"378915229716713472", diff --git a/src/api/order/reserve.js b/src/api/order/reserve.js index 09d6c9ea..77b5196d 100644 --- a/src/api/order/reserve.js +++ b/src/api/order/reserve.js @@ -31,7 +31,7 @@ export function orderDetailInfoApi(data) { // 订单-部分退款 export function refundOrderPartApi(data) { return request({ - url: '/smart-canteen/api/v2/web/order/part/refund', + url: '/smart-canteen/order/part_refund', method: 'post', headers: { "merchant-id":"378915229716713472", diff --git a/src/api/superStore/orderShenhe.js b/src/api/superStore/orderShenhe.js index 38997331..5a865578 100644 --- a/src/api/superStore/orderShenhe.js +++ b/src/api/superStore/orderShenhe.js @@ -126,7 +126,7 @@ export function orderDetailInfoApi(data) { // 订单-部分退款 export function refundOrderPartApi(data) { return request({ - url: '/smart-canteen/api/v2/web/order/part/refund', + url: '/smart-canteen/order/part_refund', method: 'post', headers: { "merchant-id":"378915229716713472", @@ -150,7 +150,7 @@ export function refundOrderApi(data) { // 订单-核销 export function writeOffOrderApi(data) { return request({ - url: '/smart-canteen/api/v2/web/order/write/off', + url: '/smart-canteen/order/write-off', method: 'post', headers: { "merchant-id":"378915229716713472", diff --git a/src/api/superStore/superOrder.js b/src/api/superStore/superOrder.js index c927aae7..0a54910f 100644 --- a/src/api/superStore/superOrder.js +++ b/src/api/superStore/superOrder.js @@ -123,7 +123,7 @@ export function orderDetailInfoApi(data) { // 订单-部分退款 export function refundOrderPartApi(data) { return request({ - url: '/smart-canteen/api/v2/web/order/part/refund', + url: '/smart-canteen/order/part_refund', method: 'post', headers: { "merchant-id":"378915229716713472", @@ -147,7 +147,7 @@ export function refundOrderApi(data) { // 订单-核销 export function writeOffOrderApi(data) { return request({ - url: '/smart-canteen/api/v2/web/order/write/off', + url: '/smart-canteen/order/write-off', method: 'post', headers: { "merchant-id":"378915229716713472", diff --git a/src/views/order/offlineManagement/index.vue b/src/views/order/offlineManagement/index.vue index f5ceb6bc..3de483d8 100644 --- a/src/views/order/offlineManagement/index.vue +++ b/src/views/order/offlineManagement/index.vue @@ -162,7 +162,7 @@ @@ -189,14 +189,14 @@ type="text" @click="handleView(scope.row)" >详情 - + >部分退款 退单 {{ (orderInfoData.payableAmount/100).toFixed(2) }} @@ -315,16 +310,13 @@ {{ (orderInfoData.couponAmount/100).toFixed(2) }} --> - - {{ (orderInfoData.realAmount/100).toFixed(2) }} + + {{ ((orderInfoData.payableAmount-orderInfoData.refundAmount)/100).toFixed(2) }} + + + + {{ (orderInfoData.refundAmount/100).toFixed(2) }} - - @@ -402,17 +394,17 @@ 按数量退款 - 按金额退款 + - - + + - + @@ -421,7 +413,7 @@ {{ (scope.row.totalAmount/100).toFixed(2) }} - + - + @@ -671,7 +663,7 @@ this.loading = true; let param = { ...this.queryParams, - "orderTypeList":[4,11], + "orderTypeList":[11], "startDate":this.formatDate(this.dateRange[0]), "endDate":this.formatDate(this.dateRange[1]) } @@ -705,29 +697,31 @@ this.$set(this.rowData,"refundMoney","") console.log(this.rowData) this.orderDetailList.forEach((item,index)=>{ - this.$set(this.orderDetailList[index],"refundNum",item.quantity) - this.$set(this.orderDetailList[index],"refundMoney",Number(item.quantity)*(item.prefPrice).toFixed(2)) + this.$set(this.orderDetailList[index],"unRefundNum",item.quantity-item.refundNum) + this.$set(this.orderDetailList[index],"goRefundNum",item.unRefundNum) + this.$set(this.orderDetailList[index],"refundMoney",Number(item.quantity)*(item.salePrice).toFixed(2)) }) this.refundList=[] this.openPart = true; }, inputNum(row){ - if(Number(row.refundNum)>row.quantity){ + if(Number(row.goRefundNum)>row.unRefundNum){ this.$modal.msgError("退款数量不能大于可退款数量!"); - row.refundNum=row.quantity + row.goRefundNum=row.unRefundNum } - row.refundMoney = Number(row.refundNum)*(row.prefPrice).toFixed(2) - }, - choseRefundTypeRadio(e){ - + row.refundMoney = Number(row.goRefundNum)*(row.salePrice).toFixed(2) }, + choseRefundTypeRadio(e){}, handleSelectionChange(selection){ console.log(selection) this.refundList = selection.map((item) => { - let obj = {'detailId':item.detailId,'quantity':item.refundNum} + let obj = {'detailId':item.detailId,'quantity':item.goRefundNum} return obj }) }, + selectable(row){ + return row.unRefundNum>0 + }, confirmRefund(){ if(this.refundType==1){ if(this.refundList.length==0){ @@ -735,11 +729,11 @@ }else{ console.log(this.refundList) let param = { - detailRefundList:this.refundList, + orderPartRefundDetailList:this.refundList, orderId:this.rowData.orderId } refundOrderPartApi(param).then(response => { - if(response.data.resultCode==10000){ + if(response.code==200){ this.$modal.msgSuccess("退款成功"); } this.getList() @@ -755,7 +749,7 @@ orderId:this.rowData.orderId } refundOrderPartApi(param).then(response => { - if(response.data.resultCode==10000){ + if(response.code==200){ this.$modal.msgSuccess("退款成功"); } this.getList() @@ -808,7 +802,7 @@ this.ableList = [] this.unableList = [] this.batchList.forEach(item=>{ - if(item.orderStateMix==1||item.orderStateMix==11){ + if(item.orderState==1||item.orderState==2){ this.ableList.push(item) }else{ this.unableList.push(item) @@ -822,7 +816,7 @@ this.ableList = [] this.unableList = [] this.batchList.forEach(item=>{ - if(item.orderStateMix==1){ + if(item.orderState==1){ this.ableList.push(item) }else{ this.unableList.push(item) diff --git a/src/views/order/reserveManagement/index.vue b/src/views/order/reserveManagement/index.vue index 82733be9..a89a4da6 100644 --- a/src/views/order/reserveManagement/index.vue +++ b/src/views/order/reserveManagement/index.vue @@ -110,20 +110,22 @@ - + >部分退款 {{ (orderInfoData.payableAmount/100).toFixed(2) }} - + + + + {{ ((orderInfoData.payableAmount-orderInfoData.refundAmount)/100).toFixed(2) }} + + + + {{ (orderInfoData.refundAmount/100).toFixed(2) }} + {{ (orderInfoData.deliveryAmount/100).toFixed(2) }} @@ -300,10 +300,6 @@ {{ (orderInfoData.packingAmount/100).toFixed(2) }} - - - {{ (orderInfoData.realAmount/100).toFixed(2) }} - @@ -368,17 +364,17 @@ 按数量退款 - 按金额退款 + - - - - + + + + @@ -387,17 +383,17 @@ {{ (scope.row.totalAmount/100).toFixed(2) }} - - + + - + @@ -669,29 +665,34 @@ export default { this.$set(this.rowData,"refundMoney","") console.log(this.rowData) this.orderDetailList.forEach((item,index)=>{ - this.$set(this.orderDetailList[index],"refundNum",item.quantity) - this.$set(this.orderDetailList[index],"refundMoney",Number(item.quantity)*(item.prefPrice).toFixed(2)) + this.$set(this.orderDetailList[index],"unRefundNum",item.quantity-item.refundNum) + this.$set(this.orderDetailList[index],"goRefundNum",item.unRefundNum) + this.$set(this.orderDetailList[index],"refundMoney",Number(item.quantity)*(item.salePrice).toFixed(2)) }) this.refundList=[] this.openPart = true; }, inputNum(row){ - if(Number(row.refundNum)>row.quantity){ + if(Number(row.goRefundNum)>row.unRefundNum){ this.$modal.msgError("退款数量不能大于可退款数量!"); - row.refundNum=row.quantity + row.goRefundNum=row.unRefundNum } - row.refundMoney = Number(row.refundNum)*(row.prefPrice).toFixed(2) - }, - choseRefundTypeRadio(e){ - + row.refundMoney = Number(row.goRefundNum)*(row.salePrice).toFixed(2) }, + //数量退款/金额退款 + choseRefundTypeRadio(e){}, + //部分退款多选 handleSelectionChange(selection){ console.log(selection) this.refundList = selection.map((item) => { - let obj = {'detailId':item.detailId,'quantity':item.refundNum} + let obj = {'detailId':item.detailId,'quantity':item.goRefundNum} return obj }) }, + selectable(row){ + return row.unRefundNum>0 + }, + //部分退款提交 confirmRefund(){ if(this.refundType==1){ if(this.refundList.length==0){ @@ -699,11 +700,11 @@ export default { }else{ console.log(this.refundList) let param = { - detailRefundList:this.refundList, + orderPartRefundDetailList:this.refundList, orderId:this.rowData.orderId } refundOrderPartApi(param).then(response => { - if(response.data.resultCode==10000){ + if(response.code==200){ this.$modal.msgSuccess("退款成功"); } this.getList() @@ -719,7 +720,7 @@ export default { orderId:this.rowData.orderId } refundOrderPartApi(param).then(response => { - if(response.data.resultCode==10000){ + if(response.code==200){ this.$modal.msgSuccess("退款成功"); } this.getList() @@ -772,7 +773,7 @@ export default { this.ableList = [] this.unableList = [] this.batchList.forEach(item=>{ - if(item.orderStateMix==1||item.orderStateMix==11){ + if(item.orderState==1||item.orderState==2){ this.ableList.push(item) }else{ this.unableList.push(item) @@ -786,7 +787,7 @@ export default { this.ableList = [] this.unableList = [] this.batchList.forEach(item=>{ - if(item.orderStateMix==1){ + if(item.orderState==1){ this.ableList.push(item) }else{ this.unableList.push(item) @@ -800,8 +801,6 @@ export default { if(this.handleType=="退单"){ this.ableList.forEach(item=>{ let param = { - backType: 1, - macOrderId:item.macOrderId, orderId:item.orderId } refundOrderApi(param).then(response => { @@ -815,7 +814,7 @@ export default { if(this.handleType=="核销"){ this.ableList.forEach(item=>{ let param = { - orderId:item.orderId + orderIdList:[item.orderId ] } writeOffOrderApi(param).then(response => { if(response.code!=200){ @@ -825,9 +824,10 @@ export default { }) this.$modal.msgSuccess("核销成功"); } + this.openRemind = true + this.$refs.multipleTable.clearSelection() setTimeout(()=>{ - this.getList() - this.$refs.multipleTable.clearSelection() + this.getList() },1000) } }, diff --git a/src/views/superstore/superOrder/index.vue b/src/views/superstore/superOrder/index.vue index 7c831e63..d18ca76b 100644 --- a/src/views/superstore/superOrder/index.vue +++ b/src/views/superstore/superOrder/index.vue @@ -128,14 +128,9 @@ {{ (scope.row.payableAmount/100).toFixed(2) }} - @@ -167,15 +162,15 @@ type="text" v-if="scope.row.orderState==1||scope.row.orderState==4" @click="handleRefund(scope.row)" >退单 - @@ -234,21 +229,15 @@ {{ (orderInfoData.payableAmount/100).toFixed(2) }} - - - - - {{ (orderInfoData.realAmount/100).toFixed(2) }} - + + + {{ ((orderInfoData.payableAmount-orderInfoData.refundAmount)/100).toFixed(2) }} + + + + {{ (orderInfoData.refundAmount/100).toFixed(2) }} + @@ -279,9 +268,9 @@
商品信息
- + @@ -290,7 +279,7 @@ {{ (scope.row.totalAmount/100).toFixed(2) }} - + - - + + - + @@ -350,18 +340,9 @@ - - - @@ -458,6 +439,7 @@ orderInfoData: {}, //部分退款 openPart:false, + refundList:[], orderDetailList:[], rowData:{}, refundRules:{ @@ -573,39 +555,48 @@ this.$set(this.rowData,"refundMoney","") console.log(this.rowData) this.orderDetailList.forEach((item,index)=>{ - this.$set(this.orderDetailList[index],"refundNum",item.quantity) - this.$set(this.orderDetailList[index],"refundMoney",Number(item.quantity)*(item.prefPrice).toFixed(2)) + this.$set(this.orderDetailList[index],"unRefundNum",item.quantity-item.refundNum) + this.$set(this.orderDetailList[index],"goRefundNum",item.unRefundNum) + this.$set(this.orderDetailList[index],"refundMoney",Number(item.quantity)*(item.salePrice).toFixed(2)) }) + this.refundList=[] this.openPart = true; }, inputNum(row){ - if(Number(row.refundNum)>row.quantity){ - this.$modal.msgError("退款数量不能大于可退款数量!"); - row.refundNum=row.quantity + if(Number(row.goRefundNum)>row.unRefundNum){ + this.$modal.msgError("退款数量不能大于可退款数量!"); + row.goRefundNum=row.unRefundNum } - row.refundMoney = Number(row.refundNum)*(row.prefPrice).toFixed(2) + row.refundMoney = Number(row.goRefundNum)*(row.salePrice).toFixed(2) }, - refundPartMoney(){ - + selectable(row){ + return row.unRefundNum>0 + }, + //部分退款多选 + handleSelectionChange(selection){ + console.log(selection) + this.refundList = selection.map((item) => { + let obj = {'detailId':item.detailId,'quantity':item.goRefundNum} + return obj + }) }, confirmRefund(){ - if(this.refundList.length==0){ - this.$modal.msgError("请先勾选退款商品!"); - }else{ - console.log(this.refundList) - let param = { - detailRefundList:this.refundList, - orderId:this.rowData.orderId - } - refundOrderPartApi(param).then(response => { - if(response.data.resultCode==10000){ - this.$modal.msgSuccess("退款成功"); - } - this.getList() - this.openPart = false; - }); + if(this.refundList.length==0){ + this.$modal.msgError("请先勾选退款商品!"); + }else{ + console.log(this.refundList) + let param = { + orderPartRefundDetailList:this.refundList, + orderId:this.rowData.orderId } - + refundOrderPartApi(param).then(response => { + if(response.code==200){ + this.$modal.msgSuccess("退款成功"); + } + this.getList() + this.openPart = false; + }); + } }, /** 退单按钮操作 */ handleRefund(row) { @@ -646,7 +637,7 @@ this.ableList = [] this.unableList = [] this.batchList.forEach(item=>{ - if(item.orderStateMix==1||item.orderStateMix==11){ + if(item.orderState==1||item.orderState==2){ this.ableList.push(item) }else{ this.unableList.push(item) @@ -660,7 +651,7 @@ this.ableList = [] this.unableList = [] this.batchList.forEach(item=>{ - if(item.orderStateMix==1){ + if(item.orderState==1){ this.ableList.push(item) }else{ this.unableList.push(item)