2023-09-20 21:33:11 +08:00
|
|
|
|
<template>
|
|
|
|
|
|
<div class="p-15">
|
2024-06-28 21:00:31 +08:00
|
|
|
|
<!-- 退款设置弹出框 -->
|
|
|
|
|
|
<el-dialog :title="'设置退款金额'" :visible.sync="dialogVisible" :append-to-body="true" width="30%">
|
|
|
|
|
|
<el-form label-position="left">
|
2024-08-06 20:32:30 +08:00
|
|
|
|
<el-form-item label="退款金额" label-width="80px">
|
2024-06-28 21:00:31 +08:00
|
|
|
|
<el-input placeholder="输入金额,不可超过订单总金额" v-model="refundPrice">
|
|
|
|
|
|
<template slot="append">元</template>
|
|
|
|
|
|
</el-input>
|
|
|
|
|
|
<div class="fc-w">{{ refundType === 'buyer' ? `买家申请退款金额${refundApply_price}元,此订单总额为${refundTotal_price}元` :
|
2024-08-06 20:32:30 +08:00
|
|
|
|
`此订单总额为${refundTotal_price}元`
|
2024-06-28 21:00:31 +08:00
|
|
|
|
}}</div>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-form>
|
|
|
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
|
|
|
<el-button size="medium" @click="dialogVisible = false">关闭</el-button>
|
2024-08-07 12:57:10 +08:00
|
|
|
|
<el-button size="medium" type="danger" @click="refund">确认退款</el-button>
|
2024-06-28 21:00:31 +08:00
|
|
|
|
</span>
|
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
<!-- 任务tab -->
|
2023-09-20 21:33:11 +08:00
|
|
|
|
<el-collapse v-model="activeNames" accordion>
|
2024-06-21 19:09:05 +08:00
|
|
|
|
<template v-if="list.length != 0">
|
2024-08-08 20:35:46 +08:00
|
|
|
|
<el-collapse-item class="mainFontColor w-100 flex column mc ofa" v-for="(item, index) in list" :key="index" :name="item.id">
|
2023-11-09 21:39:50 +08:00
|
|
|
|
<template slot="title">
|
2024-08-08 20:35:46 +08:00
|
|
|
|
<div class="w-100" :class="activeNames === item.id ? 'fc-b fb' : ''">
|
2024-06-26 15:59:53 +08:00
|
|
|
|
<div class="l w-30">
|
2023-11-09 21:39:50 +08:00
|
|
|
|
订单ID:{{ item.id }}
|
|
|
|
|
|
</div>
|
2024-08-06 20:32:30 +08:00
|
|
|
|
<div v-if="type == '未接单'" class="r w-70 fr p-r-15">
|
2024-08-07 12:57:10 +08:00
|
|
|
|
付款时间:{{ parseTime(item.paid_time, '{m}-{d} {h}:{i}') }}
|
2024-06-26 15:24:15 +08:00
|
|
|
|
</div>
|
2024-08-06 20:32:30 +08:00
|
|
|
|
<div v-else-if="type == '已接单'" class="r w-70 fr p-r-15">
|
2024-08-07 12:57:10 +08:00
|
|
|
|
接单时间:{{ parseTime(item.received_time, '{m}-{d} {h}:{i}') }}
|
2024-08-06 20:32:30 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<div v-else-if="type == '已发货'" class="r w-70 fr p-r-15">
|
2024-08-07 12:57:10 +08:00
|
|
|
|
发货时间:{{ parseTime(item.shipped_time, '{m}-{d} {h}:{i}') }}
|
2024-08-06 20:32:30 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<div v-else-if="type == '退款申请中'" class="r w-70 fr p-r-15">
|
2024-08-07 12:57:10 +08:00
|
|
|
|
申请时间:{{ parseTime(item.refundapply_time, '{m}-{d} {h}:{i}') }}
|
2023-11-09 21:39:50 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
2024-08-08 20:35:46 +08:00
|
|
|
|
<el-descriptions direction="vertical" :column="3" border>
|
2024-06-21 19:09:05 +08:00
|
|
|
|
<el-descriptions-item label="状态">{{ item.shipment_status }}
|
2023-09-20 21:33:11 +08:00
|
|
|
|
</el-descriptions-item>
|
2023-11-09 21:39:50 +08:00
|
|
|
|
<el-descriptions-item label="订单号">{{ item.order_sn }}</el-descriptions-item>
|
|
|
|
|
|
<el-descriptions-item label="取餐号">{{ item.food_sn }}</el-descriptions-item>
|
|
|
|
|
|
<el-descriptions-item label="收货人">{{ item.receiver }}</el-descriptions-item>
|
2023-09-20 21:33:11 +08:00
|
|
|
|
<el-descriptions-item label="手机号">{{ item.tel }}</el-descriptions-item>
|
2025-06-25 12:16:44 +08:00
|
|
|
|
<el-descriptions-item label="收货地块">{{ item.receive_site_name }}</el-descriptions-item>
|
2023-11-09 21:39:50 +08:00
|
|
|
|
<el-descriptions-item label="总重量">{{ item.total_weight }}克</el-descriptions-item>
|
|
|
|
|
|
<el-descriptions-item label="总价">{{ item.total_price }}元</el-descriptions-item>
|
|
|
|
|
|
<el-descriptions-item label="货品总数">{{ item.total_num }}件</el-descriptions-item>
|
2023-09-20 21:33:11 +08:00
|
|
|
|
<el-descriptions-item label="订单详情" span="3">
|
2024-08-08 20:35:46 +08:00
|
|
|
|
<el-table v-for="spu, index in item.product_snapshot" :key="index" :data="spu.sku_arr" :stripe="true" class="w-100">
|
2024-06-26 15:59:53 +08:00
|
|
|
|
<el-table-column prop="sku_name" :label="spu.spu_name">
|
2023-09-20 21:33:11 +08:00
|
|
|
|
</el-table-column>
|
2024-08-08 20:35:46 +08:00
|
|
|
|
<el-table-column label="商品编号" min-width="140px" show-overflow-tooltip>
|
2023-11-09 21:39:50 +08:00
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
|
{{ scope.row.sku_number }}
|
|
|
|
|
|
</template>
|
2023-09-20 21:33:11 +08:00
|
|
|
|
</el-table-column>
|
2024-08-08 20:35:46 +08:00
|
|
|
|
<el-table-column label="数量" width="70px" show-overflow-tooltip>
|
2023-11-09 21:39:50 +08:00
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
|
{{ scope.row.sku_totol }}{{ scope.row.sku_unit }}
|
|
|
|
|
|
</template>
|
2023-09-20 21:33:11 +08:00
|
|
|
|
</el-table-column>
|
|
|
|
|
|
</el-table>
|
|
|
|
|
|
</el-descriptions-item>
|
2024-06-21 19:09:05 +08:00
|
|
|
|
<el-descriptions-item :label="item.refund_status == '未申请' ? '客户备注' : '退货缘由'" span="3">
|
2025-01-08 17:28:16 +08:00
|
|
|
|
{{ item.refund_status == '未申请' ? (item.remark || '无') : (item.refund_remark || '无') }}
|
2023-09-20 21:33:11 +08:00
|
|
|
|
</el-descriptions-item>
|
|
|
|
|
|
<el-descriptions-item label="操作" span="3">
|
2024-08-06 20:32:30 +08:00
|
|
|
|
<el-button-group v-if="type == '退款申请中'">
|
2024-06-28 21:00:31 +08:00
|
|
|
|
<el-button @click="setRefundItem(item, index, 'buyer'); dialogVisible = true"
|
|
|
|
|
|
:loading="refundIndex === index" :disabled="refundIndex === index" type="danger"
|
2024-08-07 18:12:20 +08:00
|
|
|
|
icon="iconfont icon-zhengque">
|
2024-06-28 21:00:31 +08:00
|
|
|
|
<font class="m-l-5">{{ refundIndex === index ? '退款中...' : '同意退款' }}</font>
|
2023-09-20 21:33:11 +08:00
|
|
|
|
</el-button>
|
2024-06-21 19:37:58 +08:00
|
|
|
|
<el-button @click="questAss(item.id, 'refund_status', '拒绝退')" type="warning" icon="iconfont icon-cuowu">
|
2023-09-20 21:33:11 +08:00
|
|
|
|
<font class="m-l-5">拒绝退款</font>
|
|
|
|
|
|
</el-button>
|
|
|
|
|
|
</el-button-group>
|
2024-08-06 20:32:30 +08:00
|
|
|
|
<el-button-group v-else-if="type == '未接单'">
|
2024-06-28 21:00:31 +08:00
|
|
|
|
<el-button @click="setRefundItem(item, index, 'seller'); dialogVisible = true"
|
|
|
|
|
|
:loading="refundIndex === index" :disabled="refundIndex === index" type="danger"
|
|
|
|
|
|
icon="iconfont icon-cuowu">
|
|
|
|
|
|
<font class="m-l-5">{{ refundIndex === index ? '退款中...' : '取消订单' }}</font>
|
|
|
|
|
|
</el-button>
|
|
|
|
|
|
<el-button @click="orderPrint(index)" type="info" icon="iconfont icon-dayin">
|
|
|
|
|
|
<font class="m-l-5">打印小票</font>
|
|
|
|
|
|
</el-button>
|
2024-06-21 19:37:58 +08:00
|
|
|
|
<el-button @click="questAss(item.id, 'shipment_status', '已接单')" type="primary"
|
2024-06-21 19:09:05 +08:00
|
|
|
|
icon="iconfont icon-chengjie">
|
|
|
|
|
|
<font class="m-l-5">确认接单</font>
|
2023-09-20 21:33:11 +08:00
|
|
|
|
</el-button>
|
|
|
|
|
|
</el-button-group>
|
2024-08-06 20:32:30 +08:00
|
|
|
|
<el-button-group v-else-if="type == '已接单'">
|
2024-06-28 21:00:31 +08:00
|
|
|
|
<el-button @click="setRefundItem(item, index, 'seller'); dialogVisible = true"
|
|
|
|
|
|
:loading="refundIndex === index" :disabled="refundIndex === index" type="danger"
|
|
|
|
|
|
icon="iconfont icon-cuowu">
|
|
|
|
|
|
<font class="m-l-5">{{ refundIndex === index ? '退款中...' : '取消订单' }}</font>
|
2023-09-20 21:33:11 +08:00
|
|
|
|
</el-button>
|
2024-06-28 21:00:31 +08:00
|
|
|
|
<el-button @click="orderPrint(index)" type="info" icon="iconfont icon-dayin">
|
|
|
|
|
|
<font class="m-l-5">打印小票</font>
|
2023-09-20 21:33:11 +08:00
|
|
|
|
</el-button>
|
|
|
|
|
|
</el-button-group>
|
2024-08-06 20:32:30 +08:00
|
|
|
|
<el-button-group v-else-if="type == '已发货'">
|
2024-08-07 12:57:10 +08:00
|
|
|
|
<template v-for="plane in planes">
|
|
|
|
|
|
<el-button v-if="plane.id===item.by_plane_id" @click="handlerRouterPlane(`/planes/index/${plane.id}/${plane.name}`)" type="primary" icon="iconfont icon-wurenji">
|
|
|
|
|
|
<font class="m-l-5">{{ plane.name }}</font>
|
|
|
|
|
|
</el-button>
|
|
|
|
|
|
</template>
|
2024-06-21 19:09:05 +08:00
|
|
|
|
</el-button-group>
|
2023-09-20 21:33:11 +08:00
|
|
|
|
</el-descriptions-item>
|
|
|
|
|
|
</el-descriptions>
|
|
|
|
|
|
</el-collapse-item>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<div v-else class="p-t-60 p-b-60 seatFontColor fc">
|
|
|
|
|
|
<i class="iconfont icon-meiyoushuju f-s-100"></i>
|
|
|
|
|
|
<div>空空如也</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</el-collapse>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
|
import { parseTime } from '@/utils/index'
|
2024-06-27 20:43:05 +08:00
|
|
|
|
import { questAss, refund } from '@/utils/api/table'
|
2023-09-20 21:33:11 +08:00
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
|
data () {
|
|
|
|
|
|
return {
|
2024-06-28 21:00:31 +08:00
|
|
|
|
activeNames: [],
|
|
|
|
|
|
dialogVisible: false, // 弹出窗口 显隐
|
|
|
|
|
|
refundIndex: null, // 标记 索引 操作对应索引的按钮ui样式等
|
|
|
|
|
|
tempRefundIndex: null,
|
|
|
|
|
|
refundTotal_price: null, // 退款订单的总额
|
|
|
|
|
|
refundApply_price: null, // 客户申请退款 的金额
|
|
|
|
|
|
refundPrice: null, // 退款额 ps:传订单总价 为退款的默认值
|
|
|
|
|
|
refundOrder_sn: null, // 退款订单号
|
2025-06-25 12:16:44 +08:00
|
|
|
|
refundShop_id: null, // 退款单位id
|
2024-08-06 20:32:30 +08:00
|
|
|
|
refundType: null // 退款类型
|
2023-09-20 21:33:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
2023-11-09 21:39:50 +08:00
|
|
|
|
props: {
|
2024-08-06 20:32:30 +08:00
|
|
|
|
list: {
|
|
|
|
|
|
type: Array,
|
|
|
|
|
|
required: true
|
|
|
|
|
|
},
|
|
|
|
|
|
type: {
|
|
|
|
|
|
type: String,
|
|
|
|
|
|
required: true,
|
|
|
|
|
|
default: ''
|
|
|
|
|
|
}
|
2023-11-09 21:39:50 +08:00
|
|
|
|
},
|
2023-09-20 21:33:11 +08:00
|
|
|
|
computed: {
|
2024-08-07 12:57:10 +08:00
|
|
|
|
planes () {
|
|
|
|
|
|
const planes = this.$store.state.airList
|
|
|
|
|
|
if (planes.length > 0) {
|
|
|
|
|
|
return planes
|
|
|
|
|
|
}
|
|
|
|
|
|
return []
|
|
|
|
|
|
}
|
2023-09-20 21:33:11 +08:00
|
|
|
|
},
|
|
|
|
|
|
methods: {
|
2024-08-06 20:32:30 +08:00
|
|
|
|
parseTime, // 时间戳格式化
|
2024-06-04 18:12:32 +08:00
|
|
|
|
questAss, // 修改订单
|
2024-08-07 12:57:10 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 跳转到执行飞机的控制页面
|
|
|
|
|
|
* @param path 飞机控制页面路由
|
|
|
|
|
|
*/
|
|
|
|
|
|
handlerRouterPlane (path) {
|
2024-08-07 13:01:06 +08:00
|
|
|
|
this.$router.push(path)
|
2024-08-07 12:57:10 +08:00
|
|
|
|
this.$emit('close-drawer')
|
|
|
|
|
|
},
|
2024-07-01 16:44:13 +08:00
|
|
|
|
/**
|
2024-08-06 20:32:30 +08:00
|
|
|
|
* 封装退款函数 同步后续操作
|
|
|
|
|
|
*/
|
|
|
|
|
|
async refund () {
|
|
|
|
|
|
const res = await refund(this.refundOrder_sn, this.refundShop_id, this.refundPrice, this.refundType)
|
|
|
|
|
|
if (res.data.status === 1) { // 退款申请成功时
|
|
|
|
|
|
this.dialogVisible = false // 退款弹出框 关闭
|
|
|
|
|
|
this.refundIndex = this.tempRefundIndex // 标记退款订单 的索引 方便做ui样式
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 退款事件 设置对应订单信息 到“标记退款订单”
|
|
|
|
|
|
* @param item 订单信息
|
|
|
|
|
|
* @param index 订单索引
|
|
|
|
|
|
* @param refundType 退款类型 'buyer'买家申请 'seller'卖家主动
|
2024-07-01 16:44:13 +08:00
|
|
|
|
*/
|
2024-06-28 21:00:31 +08:00
|
|
|
|
setRefundItem (item, index, refundType) {
|
|
|
|
|
|
this.tempRefundIndex = index
|
2025-01-15 19:06:43 +08:00
|
|
|
|
this.refundTotal_price = Number(item.total_price) + Number(item.transport_price) + Number(item.pack_price)
|
2024-06-28 21:00:31 +08:00
|
|
|
|
this.refundApply_price = item.apply_price
|
|
|
|
|
|
if (refundType === 'buyer') { // 如果买家申请 默认退款表单显示买家申请值
|
|
|
|
|
|
this.refundPrice = item.apply_price
|
2025-01-15 19:06:43 +08:00
|
|
|
|
} else { // 否则 主动退 默认退款表单 显示为退款额上限 即订单总价+打包费+运费
|
|
|
|
|
|
this.refundPrice = Number(item.total_price) + Number(item.transport_price) + Number(item.pack_price)
|
2024-06-28 21:00:31 +08:00
|
|
|
|
}
|
|
|
|
|
|
this.refundOrder_sn = item.order_sn
|
|
|
|
|
|
this.refundShop_id = item.shop_id
|
|
|
|
|
|
this.refundType = refundType
|
|
|
|
|
|
},
|
2023-09-20 21:33:11 +08:00
|
|
|
|
/**
|
2023-11-09 21:39:50 +08:00
|
|
|
|
* @description: 通过蓝牙打印机并打印小票
|
|
|
|
|
|
* @param {number} index 订单列表下标索引
|
|
|
|
|
|
*/
|
2023-09-20 21:33:11 +08:00
|
|
|
|
orderPrint (index) {
|
|
|
|
|
|
// 订单文本编辑
|
|
|
|
|
|
// console.log(this.list[index])
|
|
|
|
|
|
// let con
|
|
|
|
|
|
// con = '无人机外卖送餐#' + this.list[index].food_sn + '\n\n'
|
|
|
|
|
|
// this.btPrint(con, '10', '1')
|
|
|
|
|
|
// con = ''
|
|
|
|
|
|
// con += '------------客户信息------------\n'
|
|
|
|
|
|
// con += '昵称:' + this.list[index].name + '\n'
|
|
|
|
|
|
// const tel = this.list[index].tel.substr(0, 3) + '****' + this.list[index].tel.substr(7)
|
|
|
|
|
|
// con += '电话:' + tel + '\n\n'
|
|
|
|
|
|
// con += '------------订单信息------------\n'
|
|
|
|
|
|
// this.btPrint(con, '0', '0')
|
|
|
|
|
|
// con = ''
|
|
|
|
|
|
// con += '取餐号:' + this.list[index].food_sn + '\n'
|
|
|
|
|
|
// this.btPrint(con, '31', '0')
|
|
|
|
|
|
// con = ''
|
|
|
|
|
|
// con += '单号:' + this.list[index].order_sn + '\n'
|
2025-06-25 12:16:44 +08:00
|
|
|
|
// con += '收货地块:' + this.list[index].receive_site_name + '\n'
|
2023-09-20 21:33:11 +08:00
|
|
|
|
// con += '下单时间:' + this.parseTime(this.list[index].addtime) + '\n\n'
|
|
|
|
|
|
// if (this.list[index].remark !== '') {
|
|
|
|
|
|
// con += '------------客户备注------------\n'
|
|
|
|
|
|
// con += this.list[index].remark + '\n\n'
|
|
|
|
|
|
// }
|
|
|
|
|
|
// con += '--------------商品--------------\n'
|
|
|
|
|
|
// this.list[index].products.forEach(element => {
|
|
|
|
|
|
// con += 'ID:' + element.pid + '\n'
|
|
|
|
|
|
// con += '品名:' + element.name + '\n'
|
|
|
|
|
|
// if (element.pro_buff !== '') {
|
|
|
|
|
|
// con += '规格: ' + element.pro_buff + '\n'
|
|
|
|
|
|
// }
|
|
|
|
|
|
// con += '数量:' + element.num + '\n'
|
|
|
|
|
|
// con += '单价:' + element.price + '\n'
|
|
|
|
|
|
// con += '················\n'
|
|
|
|
|
|
// })
|
|
|
|
|
|
// con += '货品总数:' + this.list[index].product_num + '\n'
|
|
|
|
|
|
// con += '货品总额:' + this.list[index].price + '\n\n'
|
|
|
|
|
|
// con += '---------加盟无人机送餐---------\n'
|
|
|
|
|
|
// this.btPrint(con, '0', '0')
|
|
|
|
|
|
// con = ''
|
|
|
|
|
|
// var data = 'https://flicube.com'
|
|
|
|
|
|
// var align = 1
|
|
|
|
|
|
// var model = 49
|
|
|
|
|
|
// var size = 32
|
|
|
|
|
|
// var eclevel = 50
|
|
|
|
|
|
// BTPrinter.printQRCode(function (data) {
|
|
|
|
|
|
// console.log('Success')
|
|
|
|
|
|
// console.log(data)
|
|
|
|
|
|
// }, function (err) {
|
|
|
|
|
|
// console.log('Error')
|
|
|
|
|
|
// console.log(err)
|
|
|
|
|
|
// }, data, align, model, size, eclevel)
|
|
|
|
|
|
// con += '\n请扫上列二维码关注我们\n\n\n'
|
|
|
|
|
|
// this.btPrint(con, '0', '1')
|
|
|
|
|
|
},
|
|
|
|
|
|
/**
|
2023-11-09 21:39:50 +08:00
|
|
|
|
* @description: cordova 打印api接口
|
|
|
|
|
|
* @param {string} str 内容
|
|
|
|
|
|
* @param {string} size 字体大小预设
|
|
|
|
|
|
* @param {string} algin 对齐
|
|
|
|
|
|
*/
|
2023-09-20 21:33:11 +08:00
|
|
|
|
btPrint (str, size = '0', align = '0') {
|
|
|
|
|
|
// BTPrinter.printTitle(function (data) {
|
|
|
|
|
|
// console.log('Success')
|
|
|
|
|
|
// console.log(data)
|
|
|
|
|
|
// }, function (err) {
|
|
|
|
|
|
// console.log('Error')
|
|
|
|
|
|
// console.log(err)
|
|
|
|
|
|
// }, str, size, align)// string, size, align
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
watch: {
|
2024-06-28 21:00:31 +08:00
|
|
|
|
list () {
|
|
|
|
|
|
this.refundIndex = null
|
|
|
|
|
|
this.tempRefundIndex = null
|
|
|
|
|
|
}
|
2023-09-20 21:33:11 +08:00
|
|
|
|
},
|
2023-11-09 21:39:50 +08:00
|
|
|
|
created () {
|
2023-09-20 21:33:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
2023-11-09 21:39:50 +08:00
|
|
|
|
<style lang="scss" scoped>
|
2024-06-26 16:42:01 +08:00
|
|
|
|
@import "@/styles/theme.scss";
|
2023-11-09 21:39:50 +08:00
|
|
|
|
.orterTit {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
|
}
|
|
|
|
|
|
</style>
|