订单部分退款
This commit is contained in:
parent
d0a08f85db
commit
894ee06e8e
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -162,7 +162,7 @@
|
|||
</el-table-column>
|
||||
<el-table-column label="实付金额" align="center" prop="realAmount" :show-overflow-tooltip="true" width="80">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ (scope.row.realAmount/100).toFixed(2) }}</span>
|
||||
<span>{{ ((scope.row.payableAmount-scope.row.refundAmount)/100).toFixed(2) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true" width="80"/>
|
||||
|
|
@ -189,14 +189,14 @@
|
|||
type="text"
|
||||
@click="handleView(scope.row)"
|
||||
>详情</el-button>
|
||||
<!-- <el-button
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text" v-if="scope.row.orderStateMix==1||scope.row.orderStateMix==11"
|
||||
type="text" v-if="scope.row.orderState==1||scope.row.orderState==2"
|
||||
@click="handleRefundPart(scope.row)"
|
||||
>部分退款</el-button>-->
|
||||
>部分退款</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text" v-if="scope.row.orderState==1||scope.row.orderState==4"
|
||||
type="text" v-if="scope.row.orderState==1||scope.row.orderState==2||scope.row.orderState==4"
|
||||
@click="handleRefund(scope.row)"
|
||||
>退单</el-button>
|
||||
<!-- <el-button
|
||||
|
|
@ -296,11 +296,6 @@
|
|||
<template slot="label"> 餐次</template>
|
||||
{{ orderInfoData.mealtimeName }}
|
||||
</el-descriptions-item>
|
||||
|
||||
<!-- <el-descriptions-item>
|
||||
<template slot="label"> 餐桌名称</template>
|
||||
|
||||
</el-descriptions-item> -->
|
||||
<el-descriptions-item>
|
||||
<template slot="label"> 订单金额</template>
|
||||
{{ (orderInfoData.payableAmount/100).toFixed(2) }}
|
||||
|
|
@ -315,16 +310,13 @@
|
|||
{{ (orderInfoData.couponAmount/100).toFixed(2) }}
|
||||
</el-descriptions-item> -->
|
||||
<el-descriptions-item>
|
||||
<template slot="label"> 实付金额</template>
|
||||
{{ (orderInfoData.realAmount/100).toFixed(2) }}
|
||||
<template slot="label"> 实付金额</template>
|
||||
{{ ((orderInfoData.payableAmount-orderInfoData.refundAmount)/100).toFixed(2) }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template slot="label"> 退款金额</template>
|
||||
{{ (orderInfoData.refundAmount/100).toFixed(2) }}
|
||||
</el-descriptions-item>
|
||||
<!-- <el-descriptions-item>
|
||||
<template slot="label"> 核身方式</template>
|
||||
<div v-for="item in nuclearModeOptions" :key="item.key" v-if="item.key==orderInfoData.nuClearMode">
|
||||
{{ item.value }}
|
||||
</div>
|
||||
</el-descriptions-item> -->
|
||||
|
||||
<el-descriptions-item>
|
||||
<template slot="label"> 支付方式</template>
|
||||
<dict-tag :options="dict.type.sm_order_pay_type" :value="orderInfoData.payType"/>
|
||||
|
|
@ -402,17 +394,17 @@
|
|||
<el-col :span="22">
|
||||
<el-radio-group v-model="refundType" @change="choseRefundTypeRadio">
|
||||
<el-radio label="1" style="font-size: 14px;margin-bottom: 10px;">按数量退款</el-radio>
|
||||
<el-radio label="2" style="font-size: 14px;margin-bottom: 10px;">按金额退款</el-radio>
|
||||
<!-- <el-radio label="2" style="font-size: 14px;margin-bottom: 10px;">按金额退款</el-radio> -->
|
||||
</el-radio-group>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-table :data="orderDetailList" @selection-change="handleSelectionChange" v-if="refundType==1">
|
||||
<el-table-column type="selection" width="50" align="center"/>
|
||||
<el-table :data="orderDetailList" @selection-change="handleSelectionChange" :row-key="(row)=>{return row.detailId}" v-if="refundType==1">
|
||||
<el-table-column type="selection" width="50" align="center" :selectable="selectable"/>
|
||||
<el-table-column label="菜品名称" align="center" prop="goodsName" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="菜品价格" align="center" prop="prefPrice" :show-overflow-tooltip="true">
|
||||
<el-table-column label="菜品单价" align="center" prop="salePrice" :show-overflow-tooltip="true">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ (scope.row.prefPrice/100).toFixed(2) }}</span>
|
||||
<span>{{ (scope.row.salePrice/100).toFixed(2) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="菜品数量" align="center" prop="quantity" :show-overflow-tooltip="true"/>
|
||||
|
|
@ -421,7 +413,7 @@
|
|||
<span>{{ (scope.row.totalAmount/100).toFixed(2) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="可退款数量" align="center" prop="quantity" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="可退款数量" align="center" prop="unRefundNum" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="已退款数量" align="center" prop="refundNum" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="退款金额" align="center" prop="refundAmount" :show-overflow-tooltip="true">
|
||||
<template slot-scope="scope">
|
||||
|
|
@ -429,9 +421,9 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="退款数量" align="center" prop="refundNum" :show-overflow-tooltip="true" width="100">
|
||||
<el-table-column label="退款数量" align="center" prop="goRefundNum" :show-overflow-tooltip="true" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.refundNum" placeholder="退款数量" maxlength="20" clearable style="width: 100%" @change="inputNum(scope.row)" @input="(v)=>(scope.row.refundNum=v.replace(/[^\d]/g,''))"/>
|
||||
<el-input v-model="scope.row.goRefundNum" placeholder="退款数量" maxlength="20" clearable style="width: 100%" @change="inputNum(scope.row)" @input="(v)=>(scope.row.goRefundNum=v.replace(/[^\d]/g,''))"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="退款金额" align="center" prop="refundMoney" :show-overflow-tooltip="true" width="100">
|
||||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -110,20 +110,22 @@
|
|||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
size="mini" :disabled="multiple"
|
||||
@click="handleBatchRefund"
|
||||
>批量退单</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
size="mini" :disabled="multiple"
|
||||
@click="handleBatchWriteOff"
|
||||
>批量核销</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
size="mini" :disabled="multiple"
|
||||
@click="handleBatchWriteOff"
|
||||
>批量核销</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
size="mini" :disabled="multiple"
|
||||
@click="handleBatchRefund"
|
||||
>批量退单</el-button>
|
||||
</el-col>
|
||||
<!--
|
||||
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
|
|
@ -157,20 +159,10 @@
|
|||
<template slot-scope="scope">
|
||||
<span>{{ (scope.row.payableAmount/100).toFixed(2) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="配送费" align="center" prop="deliveryAmount" :show-overflow-tooltip="true" width="80">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ (scope.row.deliveryAmount/100).toFixed(2) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="包装费" align="center" prop="packingAmount" :show-overflow-tooltip="true" width="80">
|
||||
<el-table-column label="实付金额" align="center" :show-overflow-tooltip="true" width="80">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ (scope.row.packingAmount/100).toFixed(2) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="实付金额" align="center" prop="realAmount" :show-overflow-tooltip="true" width="80">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ (scope.row.realAmount/100).toFixed(2) }}</span>
|
||||
<span>{{ ((scope.row.payableAmount-scope.row.refundAmount)/100).toFixed(2) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="支付方式" align="center" prop="payType" :show-overflow-tooltip="true" width="100">
|
||||
|
|
@ -201,11 +193,11 @@
|
|||
type="text"
|
||||
@click="handleView(scope.row)"
|
||||
>详情</el-button>
|
||||
<!-- <el-button
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text" v-if="scope.row.orderStateMix==1||scope.row.orderStateMix==11"
|
||||
type="text" v-if="scope.row.orderState==1||scope.row.orderState==2"
|
||||
@click="handleRefundPart(scope.row)"
|
||||
>部分退款</el-button>-->
|
||||
>部分退款</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text" v-if="scope.row.orderState==1||scope.row.orderState==2||scope.row.orderState==4"
|
||||
|
|
@ -290,7 +282,15 @@
|
|||
<el-descriptions-item>
|
||||
<template slot="label"> 订单金额</template>
|
||||
{{ (orderInfoData.payableAmount/100).toFixed(2) }}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template slot="label"> 实付金额</template>
|
||||
{{ ((orderInfoData.payableAmount-orderInfoData.refundAmount)/100).toFixed(2) }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template slot="label"> 退款金额</template>
|
||||
{{ (orderInfoData.refundAmount/100).toFixed(2) }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template slot="label"> 配送费</template>
|
||||
{{ (orderInfoData.deliveryAmount/100).toFixed(2) }}
|
||||
|
|
@ -300,10 +300,6 @@
|
|||
<template slot="label"> 包装费</template>
|
||||
{{ (orderInfoData.packingAmount/100).toFixed(2) }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template slot="label"> 实付金额</template>
|
||||
{{ (orderInfoData.realAmount/100).toFixed(2) }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template slot="label"> 支付方式</template>
|
||||
<dict-tag :options="dict.type.sm_order_pay_type" :value="orderInfoData.payType"/>
|
||||
|
|
@ -368,17 +364,17 @@
|
|||
<el-col :span="22">
|
||||
<el-radio-group v-model="refundType" @change="choseRefundTypeRadio">
|
||||
<el-radio label="1" style="font-size: 14px;margin-bottom: 10px;">按数量退款</el-radio>
|
||||
<el-radio label="2" style="font-size: 14px;margin-bottom: 10px;">按金额退款</el-radio>
|
||||
<!-- <el-radio label="2" style="font-size: 14px;margin-bottom: 10px;">按金额退款</el-radio> -->
|
||||
</el-radio-group>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-table :data="orderDetailList" @selection-change="handleSelectionChange" v-if="refundType==1">
|
||||
<el-table-column type="selection" width="50" align="center"/>
|
||||
<el-table-column label="菜品名称" align="center" prop="goodsDishesName" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="菜品价格" align="center" prop="prefPrice" :show-overflow-tooltip="true">
|
||||
<el-table :data="orderDetailList" @selection-change="handleSelectionChange" :row-key="(row)=>{return row.detailId}" v-if="refundType==1">
|
||||
<el-table-column type="selection" width="50" align="center" :selectable="selectable"/>
|
||||
<el-table-column label="菜品名称" align="center" prop="goodsName" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="菜品单价" align="center" prop="salePrice" :show-overflow-tooltip="true">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ (scope.row.prefPrice/100).toFixed(2) }}</span>
|
||||
<span>{{ (scope.row.salePrice/100).toFixed(2) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="菜品数量" align="center" prop="quantity" :show-overflow-tooltip="true"/>
|
||||
|
|
@ -387,17 +383,17 @@
|
|||
<span>{{ (scope.row.totalAmount/100).toFixed(2) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="可退款数量" align="center" prop="quantity" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="已退款数量" align="center" prop="goodsRefundNum" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="可退款数量" align="center" prop="unRefundNum" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="已退款数量" align="center" prop="refundNum" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="退款金额" align="center" prop="refundAmount" :show-overflow-tooltip="true">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ (scope.row.refundAmount/100).toFixed(2) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="退款数量" align="center" prop="refundNum" :show-overflow-tooltip="true" width="100">
|
||||
<el-table-column label="退款数量" align="center" prop="goRefundNum" :show-overflow-tooltip="true" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.refundNum" placeholder="退款数量" maxlength="20" clearable style="width: 100%" @change="inputNum(scope.row)" @input="(v)=>(scope.row.refundNum=v.replace(/[^\d]/g,''))"/>
|
||||
<el-input v-model="scope.row.goRefundNum" placeholder="退款数量" maxlength="20" clearable style="width: 100%" @change="inputNum(scope.row)" @input="(v)=>(scope.row.goRefundNum=v.replace(/[^\d]/g,''))"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="退款金额" align="center" prop="refundMoney" :show-overflow-tooltip="true" width="100">
|
||||
|
|
@ -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)
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -128,14 +128,9 @@
|
|||
<span>{{ (scope.row.payableAmount/100).toFixed(2) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="配送费" align="center" prop="deliveryAmount" :show-overflow-tooltip="true" width="80">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ (scope.row.deliveryAmount/100).toFixed(2) }}</span>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="实付金额" align="center" prop="realAmount" :show-overflow-tooltip="true" width="80">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ (scope.row.realAmount/100).toFixed(2) }}</span>
|
||||
<span>{{ ((scope.row.payableAmount-scope.row.refundAmount)/100).toFixed(2) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="支付方式" align="center" prop="payType" :show-overflow-tooltip="true" width="100">
|
||||
|
|
@ -167,15 +162,15 @@
|
|||
type="text" v-if="scope.row.orderState==1||scope.row.orderState==4"
|
||||
@click="handleRefund(scope.row)"
|
||||
>退单</el-button>
|
||||
<!-- <el-button
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text" v-if="scope.row.orderStateMix==1||scope.row.orderStateMix==11"
|
||||
type="text" v-if="scope.row.orderState==1||scope.row.orderState==2"
|
||||
@click="handleRefundPart(scope.row)"
|
||||
>部分退款</el-button>
|
||||
|
||||
<!--
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text" v-if="scope.row.orderStateMix==1"
|
||||
type="text" v-if="scope.row.orderState==1"
|
||||
@click="writeOffOrder(scope.row)"
|
||||
>核销</el-button> -->
|
||||
|
||||
|
|
@ -234,21 +229,15 @@
|
|||
<el-descriptions-item>
|
||||
<template slot="label"> 订单金额</template>
|
||||
{{ (orderInfoData.payableAmount/100).toFixed(2) }}
|
||||
</el-descriptions-item>
|
||||
<!-- <el-descriptions-item>
|
||||
<template slot="label"> 配送费</template>
|
||||
{{ (orderInfoData.deliveryAmount/100).toFixed(2) }}
|
||||
</el-descriptions-item> -->
|
||||
<el-descriptions-item>
|
||||
<template slot="label"> 实付金额</template>
|
||||
{{ (orderInfoData.realAmount/100).toFixed(2) }}
|
||||
</el-descriptions-item>
|
||||
<!-- <el-descriptions-item>
|
||||
<template slot="label"> 配送方式</template>
|
||||
<div v-for="item in deliveryTypeOptions" :key="item.key" v-if="item.key==orderInfoData.deliveryType">
|
||||
{{ item.value }}
|
||||
</div>
|
||||
</el-descriptions-item> -->
|
||||
<el-descriptions-item>
|
||||
<template slot="label"> 实付金额</template>
|
||||
{{ ((orderInfoData.payableAmount-orderInfoData.refundAmount)/100).toFixed(2) }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template slot="label"> 退款金额</template>
|
||||
{{ (orderInfoData.refundAmount/100).toFixed(2) }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template slot="label"> 支付方式</template>
|
||||
<dict-tag :options="dict.type.sm_order_pay_type" :value="orderInfoData.payType"/>
|
||||
|
|
@ -279,9 +268,9 @@
|
|||
<div style="margin: 10px 0;font-weight: bold;font-size: 16px;color: #000;">商品信息</div>
|
||||
<el-table :data="orderInfoData.orderDetailList">
|
||||
<el-table-column label="商品名称" align="center" prop="goodsName" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="单价(元)" align="center" prop="prefPrice" :show-overflow-tooltip="true">
|
||||
<el-table-column label="单价(元)" align="center" prop="salePrice" :show-overflow-tooltip="true">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ (scope.row.prefPrice/100).toFixed(2) }}</span>
|
||||
<span>{{ (scope.row.salePrice/100).toFixed(2) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="数量" align="center" prop="quantity" :show-overflow-tooltip="true"/>
|
||||
|
|
@ -290,7 +279,7 @@
|
|||
<span>{{ (scope.row.totalAmount/100).toFixed(2) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="退款数量" align="center" prop="goodsRefundNum" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="退款数量" align="center" prop="refundNum" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="退款金额(元)" align="center" prop="refundAmount" :show-overflow-tooltip="true">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ (scope.row.refundAmount/100).toFixed(2) }}</span>
|
||||
|
|
@ -307,11 +296,12 @@
|
|||
|
||||
<!-- 部分退款对话框 -->
|
||||
<el-dialog title="部分退款" :visible.sync="openPart" width="80%" append-to-body>
|
||||
<el-table :data="orderDetailList">
|
||||
<el-table :data="orderDetailList" @selection-change="handleSelectionChange" :row-key="(row)=>{return row.detailId}">
|
||||
<el-table-column type="selection" width="50" align="center" :selectable="selectable"/>
|
||||
<el-table-column label="商品名称" align="center" prop="goodsName" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="商品单价" align="center" prop="prefPrice" :show-overflow-tooltip="true">
|
||||
<el-table-column label="商品单价" align="center" prop="salePrice" :show-overflow-tooltip="true">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ (scope.row.prefPrice/100).toFixed(2) }}</span>
|
||||
<span>{{ (scope.row.salePrice/100).toFixed(2) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="商品数量" align="center" prop="quantity" :show-overflow-tooltip="true"/>
|
||||
|
|
@ -320,17 +310,17 @@
|
|||
<span>{{ (scope.row.totalAmount/100).toFixed(2) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="可退款数量" align="center" prop="quantity" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="已退款数量" align="center" prop="goodsRefundNum" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="可退款数量" align="center" prop="unRefundNum" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="已退款数量" align="center" prop="refundNum" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="已退款金额" align="center" prop="refundAmount" :show-overflow-tooltip="true">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ (scope.row.refundAmount/100).toFixed(2) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="退款数量" align="center" prop="refundNum" :show-overflow-tooltip="true" width="100">
|
||||
<el-table-column label="退款数量" align="center" prop="goRefundNum" :show-overflow-tooltip="true" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.refundNum" placeholder="退款数量" maxlength="20" clearable style="width: 100%" @change="inputNum(scope.row)" @input="(v)=>(scope.row.refundNum=v.replace(/[^\d]/g,''))"/>
|
||||
<el-input v-model="scope.row.goRefundNum" placeholder="退款数量" maxlength="20" clearable style="width: 100%" @change="inputNum(scope.row)" @input="(v)=>(scope.row.goRefundNum=v.replace(/[^\d]/g,''))"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="退款金额" align="center" prop="refundMoney" :show-overflow-tooltip="true" width="100">
|
||||
|
|
@ -350,18 +340,9 @@
|
|||
</el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="100" class-name="small-padding fixed-width" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<!-- <el-button
|
||||
size="mini" style="color: red;"
|
||||
type="text"
|
||||
@click="refundPartMoney(scope.row)"
|
||||
>退款</el-button> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="openPart=false">确 定</el-button>
|
||||
<el-button type="primary" @click="confirmRefund">确 定</el-button>
|
||||
<el-button @click="openPart=false">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue