mirror of
https://github.com/crmeb/CRMEB.git
synced 2026-10-28 13:31:04 +00:00
fix(实物商品): 订单编辑弹窗状态展示改为与列表同口径计算业务状态
This commit is contained in:
parent
137b719187
commit
7446bf25a4
@ -363,7 +363,7 @@ class OrderController extends AuthController
|
||||
return app('json')->fail('参数错误');
|
||||
}
|
||||
$order = $centerServices->getOne(['order_no' => $orderNo],
|
||||
'order_no, total_price, pay_price, pay_postage, coupon_price, deduction_price, use_integral_num, extra_info');
|
||||
'order_no, status_code, delivery_time, is_del, total_price, pay_price, pay_postage, coupon_price, deduction_price, use_integral_num, extra_info');
|
||||
if (!$order) {
|
||||
return app('json')->fail('订单不存在');
|
||||
}
|
||||
@ -376,7 +376,8 @@ class OrderController extends AuthController
|
||||
$data['give_integral'] = $extraInfo['give_integral'] ?? 0;
|
||||
$data['use_integral'] = $data['use_integral_num'] ?? $extraInfo['use_integral_num'] ?? 0;
|
||||
$data['backed_integral'] = $extraInfo['backed_integral'] ?? 0;
|
||||
unset($data['extra_info']);
|
||||
// 仅保留配送方式,供前端与列表同口径计算业务状态(待发货/待收货/待到店)
|
||||
$data['extra_info'] = ['delivery_type' => (string)($extraInfo['delivery_type'] ?? '')];
|
||||
return app('json')->success($data);
|
||||
}
|
||||
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<span class="label">订单状态:</span>
|
||||
<span class="value">{{ getStatusLabel(orderInfo.status_code) }}</span>
|
||||
<span class="value">{{ businessStatus.text }}</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="24" style="margin-top: 8px">
|
||||
@ -104,9 +104,9 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive } from 'vue';
|
||||
import { ref, reactive, computed } from 'vue';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { saveEditOrder, getEditOrderForm, saveOrderIntegral } from '../normalOrder';
|
||||
import { saveEditOrder, getEditOrderForm, saveOrderIntegral, getOrderBusinessStatus } from '../normalOrder';
|
||||
|
||||
defineOptions({ name: 'orderEdit' });
|
||||
|
||||
@ -133,6 +133,9 @@ const integralData = reactive({
|
||||
back_integral: 0,
|
||||
});
|
||||
|
||||
/** 订单状态与列表/详情同口径(待支付/待发货/待收货/待到店/待评价等) */
|
||||
const businessStatus = computed(() => getOrderBusinessStatus(orderInfo.value || {}));
|
||||
|
||||
/** 打开弹窗 */
|
||||
function open(no) {
|
||||
orderNo.value = no || '';
|
||||
@ -220,18 +223,6 @@ function handleClose() {
|
||||
visible.value = false;
|
||||
}
|
||||
|
||||
function getStatusLabel(code) {
|
||||
const map = {
|
||||
pending_payment: '待支付',
|
||||
processing: '进行中',
|
||||
completed: '已完成',
|
||||
canceled: '已取消',
|
||||
refunding: '退款中',
|
||||
refunded: '已退款',
|
||||
};
|
||||
return map[code] || code || '--';
|
||||
}
|
||||
|
||||
defineExpose({ open });
|
||||
</script>
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user