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

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

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