|
@@ -494,7 +494,7 @@
|
|
:label="$t('label.originalQuantity')"
|
|
:label="$t('label.originalQuantity')"
|
|
width="80"
|
|
width="80"
|
|
align="center"
|
|
align="center"
|
|
- prop="oldQuantity"
|
|
|
|
|
|
+ prop="quantity"
|
|
></el-table-column>
|
|
></el-table-column>
|
|
|
|
|
|
<el-table-column
|
|
<el-table-column
|
|
@@ -547,12 +547,12 @@
|
|
>
|
|
>
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<div v-if="multipleSelection.indexOf(scope.row) == -1">
|
|
<div v-if="multipleSelection.indexOf(scope.row) == -1">
|
|
- <div>{{ scope.row | quantityFilter }}</div>
|
|
|
|
|
|
+ <div>{{ scope.row.newQuantity }}</div>
|
|
</div>
|
|
</div>
|
|
<div v-else>
|
|
<div v-else>
|
|
<!-- <tableEdit :row.sync="scope.row"></tableEdit> -->
|
|
<!-- <tableEdit :row.sync="scope.row"></tableEdit> -->
|
|
<el-input-number
|
|
<el-input-number
|
|
- v-model="scope.row.quantity"
|
|
|
|
|
|
+ v-model="scope.row.newQuantity"
|
|
@change="changeQuantity(scope.row)"
|
|
@change="changeQuantity(scope.row)"
|
|
size="mini"
|
|
size="mini"
|
|
:min="0"
|
|
:min="0"
|
|
@@ -810,6 +810,8 @@ import {
|
|
import { BigNumber } from "bignumber.js";
|
|
import { BigNumber } from "bignumber.js";
|
|
import tableEdit from "./tableEdit";
|
|
import tableEdit from "./tableEdit";
|
|
import i18n from "@/lang";
|
|
import i18n from "@/lang";
|
|
|
|
+import data2blob from "@/components/ImageCropper/utils/data2blob";
|
|
|
|
+import { dataURItoBlob } from "dropzone";
|
|
|
|
|
|
export default {
|
|
export default {
|
|
name: "createRefundDialog",
|
|
name: "createRefundDialog",
|
|
@@ -823,12 +825,6 @@ export default {
|
|
filters: {
|
|
filters: {
|
|
statusFilter(key) {
|
|
statusFilter(key) {
|
|
return statusKeyValue[key];
|
|
return statusKeyValue[key];
|
|
- },
|
|
|
|
- quantityFilter(row) {
|
|
|
|
- if (row.refundQuantity > 0) {
|
|
|
|
- return dcmSub(row.oldQuantity, row.refundQuantity);
|
|
|
|
- }
|
|
|
|
- return row.oldQuantity;
|
|
|
|
}
|
|
}
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
@@ -862,7 +858,7 @@ export default {
|
|
warehouseCode: "",
|
|
warehouseCode: "",
|
|
annexPath: "",
|
|
annexPath: "",
|
|
items: [],
|
|
items: [],
|
|
- oldQuantity: 0,
|
|
|
|
|
|
+ quantity: 0,
|
|
refundTaxAble: "0", //是否退税
|
|
refundTaxAble: "0", //是否退税
|
|
refundTaxAmount: 0.0, //退税金额
|
|
refundTaxAmount: 0.0, //退税金额
|
|
refundTotalAmount: 0.0, //总计退款金额 = 商品退款金额 + 退运费金额 + 退税金额 。 实际执行时,refundAmount=商品退款金额 + 退税金额;退运费金额单独计算
|
|
refundTotalAmount: 0.0, //总计退款金额 = 商品退款金额 + 退运费金额 + 退税金额 。 实际执行时,refundAmount=商品退款金额 + 退税金额;退运费金额单独计算
|
|
@@ -924,7 +920,7 @@ export default {
|
|
this.addRefundForm.warehouseCode = "";
|
|
this.addRefundForm.warehouseCode = "";
|
|
this.addRefundForm.annexPath = "";
|
|
this.addRefundForm.annexPath = "";
|
|
this.addRefundForm.items = [];
|
|
this.addRefundForm.items = [];
|
|
- this.addRefundForm.oldQuantity = 0.0;
|
|
|
|
|
|
+ this.addRefundForm.quantity = 0.0;
|
|
this.addRefundForm.refundTaxAble = "0"; //是否退税
|
|
this.addRefundForm.refundTaxAble = "0"; //是否退税
|
|
this.addRefundForm.refundTaxAmount = 0.0; //退税金额
|
|
this.addRefundForm.refundTaxAmount = 0.0; //退税金额
|
|
this.addRefundForm.refundTotalAmount = 0.0;
|
|
this.addRefundForm.refundTotalAmount = 0.0;
|
|
@@ -976,9 +972,17 @@ export default {
|
|
if (this.tableOrderDeatils[ind].refundFlag == "0") {
|
|
if (this.tableOrderDeatils[ind].refundFlag == "0") {
|
|
this.tableOrderDeatils[ind].refundQuantity = 0;
|
|
this.tableOrderDeatils[ind].refundQuantity = 0;
|
|
}
|
|
}
|
|
- this.tableOrderDeatils[
|
|
|
|
- ind
|
|
|
|
- ].oldQuantity = this.tableOrderDeatils[ind].quantity;
|
|
|
|
|
|
+ // 可用退款件数
|
|
|
|
+ if (this.tableOrderDeatils[ind].refundQuantity > 0) {
|
|
|
|
+ this.tableOrderDeatils[ind].newQuantity = dcmSub(
|
|
|
|
+ this.tableOrderDeatils[ind].quantity,
|
|
|
|
+ this.tableOrderDeatils[ind].refundQuantity
|
|
|
|
+ );
|
|
|
|
+ } else {
|
|
|
|
+ this.tableOrderDeatils[
|
|
|
|
+ ind
|
|
|
|
+ ].newQuantity = this.tableOrderDeatils[ind].quantity;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
//退商品金额计算
|
|
//退商品金额计算
|
|
@@ -1045,17 +1049,17 @@ export default {
|
|
},
|
|
},
|
|
// 重新计算退款的金额
|
|
// 重新计算退款的金额
|
|
reCalReturn() {
|
|
reCalReturn() {
|
|
- const data = this.multipleSelection;
|
|
|
|
|
|
+ let data = this.multipleSelection.map(item => {
|
|
|
|
+ return {
|
|
|
|
+ soOrderId: item.ordersId,
|
|
|
|
+ orderItemId: item.orderitemId,
|
|
|
|
+ ormOrderItemId: item.ormOrderItemId,
|
|
|
|
+ quantity: item.newQuantity
|
|
|
|
+ };
|
|
|
|
+ });
|
|
const formData = {
|
|
const formData = {
|
|
ormOrderId: this.queryOrmorder,
|
|
ormOrderId: this.queryOrmorder,
|
|
- promotionRefundDetails: data.map(item => {
|
|
|
|
- return {
|
|
|
|
- soOrderId: item.ordersId,
|
|
|
|
- orderItemId: item.orderitemId,
|
|
|
|
- ormOrderItemId: item.ormOrderItemId,
|
|
|
|
- quantity: item.quantity
|
|
|
|
- };
|
|
|
|
- })
|
|
|
|
|
|
+ promotionRefundDetails: data
|
|
};
|
|
};
|
|
this.listLoading = true;
|
|
this.listLoading = true;
|
|
checkSubmitRefund(formData)
|
|
checkSubmitRefund(formData)
|
|
@@ -1187,16 +1191,16 @@ export default {
|
|
},
|
|
},
|
|
checkSelectable(row) {
|
|
checkSelectable(row) {
|
|
// 虚拟商品不可选
|
|
// 虚拟商品不可选
|
|
- // if (row.skuCode === "108C4G1V000BXS") return false;
|
|
|
|
|
|
+ if (row.skuCode === "BXGYPD250300") return false;
|
|
if (row.refundQuantity > 0) {
|
|
if (row.refundQuantity > 0) {
|
|
- var refcount = dcmSub(row.oldQuantity, row.refundQuantity);
|
|
|
|
|
|
+ var refcount = dcmSub(row.quantity, row.refundQuantity);
|
|
//发生退款
|
|
//发生退款
|
|
if (refcount <= 0 && this.queryRefundType != "1") {
|
|
if (refcount <= 0 && this.queryRefundType != "1") {
|
|
return false; //不可选择
|
|
return false; //不可选择
|
|
}
|
|
}
|
|
row["maxq"] = refcount;
|
|
row["maxq"] = refcount;
|
|
} else {
|
|
} else {
|
|
- row["maxq"] = row.oldQuantity;
|
|
|
|
|
|
+ row["maxq"] = row.quantity;
|
|
}
|
|
}
|
|
|
|
|
|
// if( row.status == "delivery" && (row.exchangePurchaseFlag == 1)){
|
|
// if( row.status == "delivery" && (row.exchangePurchaseFlag == 1)){
|
|
@@ -1378,7 +1382,7 @@ export default {
|
|
}
|
|
}
|
|
var newobj = {
|
|
var newobj = {
|
|
productName: obj.productName,
|
|
productName: obj.productName,
|
|
- quantity: obj.quantity,
|
|
|
|
|
|
+ quantity: obj.newQuantity,
|
|
ormOrderItemId: obj.ormOrderItemId,
|
|
ormOrderItemId: obj.ormOrderItemId,
|
|
orderitemId: obj.orderitemId,
|
|
orderitemId: obj.orderitemId,
|
|
skuCode: obj.skuCode,
|
|
skuCode: obj.skuCode,
|
|
@@ -1518,7 +1522,7 @@ export default {
|
|
this.addRefundForm.warehouseCode = "";
|
|
this.addRefundForm.warehouseCode = "";
|
|
this.addRefundForm.annexPath = "";
|
|
this.addRefundForm.annexPath = "";
|
|
this.addRefundForm.items = [];
|
|
this.addRefundForm.items = [];
|
|
- this.addRefundForm.oldQuantity = 0.0;
|
|
|
|
|
|
+ this.addRefundForm.quantity = 0.0;
|
|
this.addRefundForm.refundTaxAble = "0"; //是否退税
|
|
this.addRefundForm.refundTaxAble = "0"; //是否退税
|
|
this.addRefundForm.refundTaxAmount = 0.0; //退税金额
|
|
this.addRefundForm.refundTaxAmount = 0.0; //退税金额
|
|
this.addRefundForm.refundTotalAmount = 0.0;
|
|
this.addRefundForm.refundTotalAmount = 0.0;
|