Commit 3bd002b6 authored by v-yuchenglong's avatar v-yuchenglong

update:新订单列表退款子列表修改

parent bc8ee4ae
......@@ -140,7 +140,7 @@ exports.orderRefundReject = async ctx => {
// 获取订单管理列表
exports.newGetOrderList = async ctx => {
const url = `${GROUPMEAL_URI}/order/background/op_order_list`;
const url = `${GROUPMEAL_URI}/order/background/order_list`;
const opts = {
url,
method: "GET"
......
......@@ -102,7 +102,7 @@ router.get(`${API_VERSION}/order/oldbackground/order_refund_reject`, groupmeal.o
router.post(`${API_VERSION}/order/oldbackground/order_refund`, groupmeal.orderRefund);
// 新订单管理
router.get(`${API_VERSION}/order/background/op_order_list`, groupmeal.newGetOrderList);
router.get(`${API_VERSION}/order/background/order_list`, groupmeal.newGetOrderList);
router.get(`${API_VERSION}/order/background/order_condition_marketing_list`, groupmeal.newGetMarketingList);
router.get(`${API_VERSION}/order/background/order_condition_goods_list`, groupmeal.newGetGoodsList);
router.get(`${API_VERSION}/order/background/order_condition_take_place_list`, groupmeal.newGetSubShopList);
......
......@@ -311,7 +311,7 @@ export default {
// 查看详情
handleLook(row) {
this.$router.push({
path: "/op/groupmeal/orderManagement",
path: "/op/groupmeal/newOrderManagement",
query: {
marketing_id: row.activiteId,
marketing_type: row.marketing_type
......
......@@ -315,25 +315,13 @@
></el-checkbox>
</el-row>
<el-row>
<el-col :span="6">单价:{{ item.price }}</el-col>
<el-col :span="6">数量:{{ item.goods_num }}</el-col>
<el-col :span="6">实付:{{ item.payment }}</el-col>
</el-row>
<el-row>
可退数量:
<el-input-number
v-model="item.refundableQuantity"
@change="handleChange"
:min="1"
:max="1"
></el-input-number>
</el-row>
<el-row>
退款金额(可退金额{{ item.amountToRefund }}元):
<el-input
v-model="item.amountToRefund"
style="width: 150px"
></el-input>
<el-checkbox
class="check-wrap"
v-model="item.restoreInventory"
label="恢复库存"
name="type"
></el-checkbox>
</el-row>
</div>
<template #footer>
......@@ -438,19 +426,15 @@ export default {
totalNum: null, //总条数
// 退款
refundShow:false, // 退款状态
refundShow: false, // 退款状态
checkAll: false, // 全选
isIndeterminate: false,
refundGoods: [
{
refundedGoodsSel: false,
payment: "",
restoreInventory: false,
goods_name: "",
price: "", // 单价
goods_num: "", // 数量
payment: "", // 实付
refundableQuantity: "",
refundAmount: "",
amountToRefund: "",
},
],
};
......@@ -554,7 +538,6 @@ export default {
async printOrderMet(forcePrint) {
const params = {
marketing_id: this.orderQueryObj.marketing_id,
// marketing_id: "1NJETU",
force_print: forcePrint ? "1" : "",
};
const res = await newOrderPrint(params);
......@@ -601,10 +584,6 @@ export default {
}
res = await this.printOrderMet(true);
// if (res.code !== 0) {
// this.$message.error("打印失败");
// }
},
// 获取订单列表
......@@ -681,19 +660,10 @@ export default {
const res = await newOrderItemList(params);
this.refundGoods = res.result;
for (var i in res.result) {
this.refundGoods[i].refundableQuantity = Number(
res.result[i].goods_num - res.result[i].refund_count
);
this.refundGoods[i].payment = Number(
res.result[i].payment
//res.result[i].payment - res.result[i].refund_amount
);
// console.log( res.result[i]);
this.refundGoods[i].amountToRefund = Number(
res.result[i].payment - res.result[i].refund_amount
);
this.refundGoods[i].payment = Number(res.result[i].payment);
}
},
// 退款确认
async handleConfirmRefund() {
const isCheckAllSelected = () => this.refundGoods.refundedGoodsSel;
......@@ -703,6 +673,17 @@ export default {
return this.refundGoods.filter(isSelected);
};
for (var i in this.refundGoods) {
if (
this.refundGoods[i].refundedGoodsSel == true &&
this.refundGoods[i].restoreInventory == true
) {
this.refundGoods[i].refund_type = "1";
} else {
this.refundGoods[i].refund_type = "2";
}
}
const convertToNumber = (str) => {
return !Number.isNaN(parseFloat(str)) ? parseFloat(str) : 0;
};
......@@ -712,6 +693,7 @@ export default {
order_item_id: item.order_item_id,
refund_num: item.refundableQuantity || 0,
refund_amount: convertToNumber(item.amountToRefund),
refund_type: item.refund_type,
};
};
......@@ -725,17 +707,12 @@ export default {
}
itemsToRefund = itemsToRefund.map(processRefundItem);
// if ((itemsToRefund.length = 0)) {
// this.$message.error("请选择退款商品");
// return;
// }
const res = await newRefundOrder(orderId, itemsToRefund);
if (res.code === 0) {
this.$message.success("退款成功");
this.refundShow = false;
return;
}
// this.refundShow = false;
this.$message.error(res.reason);
},
},
......@@ -755,9 +732,9 @@ export default {
word-break: break-all;
}
}
.refundCon /deep/ .el-row{
margin-bottom: 15px;
display: flex;
align-items: center;
.refundCon /deep/ .el-row {
margin-bottom: 15px;
display: flex;
align-items: center;
}
</style>
......@@ -630,9 +630,6 @@ export default {
// 获取订单列表
async getOrderListMet() {
if (this.$route.query.marketing_type == "4") {
this.orderQueryObj.marketing_id = this.$route.query.marketing_id;
}
try {
const res = await getOrderList(this.orderQueryObj);
this.goodsNum = res.goods_num; // 商品共计
......
......@@ -119,7 +119,7 @@ export function getOrderExportURL(eventId, type) {
// 获取订单列表
export async function newGetOrderList(params) {
const res = await axios.get("/api/v1/order/background/op_order_list", {
const res = await axios.get("/api/v1/order/background/order_list", {
params
});
return res;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment