| | |
| | | export const delAfterSaleReason = (id) => { |
| | | return deleteRequest(`/order/afterSaleReason/delByIds/${id}`) |
| | | } |
| | | //更新订单状态 |
| | | export const sendMessage = (id) => { |
| | | return getRequest(`/order/order/sendMessage/${id}`) |
| | | } |
| | | |
| | | // 添加售后原因 |
| | | export const addAfterSaleReason = (params) => { |
| | |
| | | <div class="single-page-con" :style="{ 'top': setting.isUseTabsRouter ? '100px' : '60px', height: setting.isUseTabsRouter ? 'calc(100% - 110px)' : 'calc(100% - 70px)' }"> |
| | | <div class="single-page"> |
| | | <!-- <keep-alive :include="cachePage"> --> |
| | | <keep-alive include="orderList"> |
| | | <router-view></router-view> |
| | | </keep-alive> |
| | | <!-- </keep-alive> --> |
| | | </div> |
| | | </div> |
| | |
| | | }, |
| | | }, |
| | | |
| | | watch: { |
| | | $route (to, from) { |
| | | // 正确打印路由对象的方法 |
| | | if(from.fullPath === "/member" && to.fullPath.includes("/orderList")){ |
| | | this.id = this.$route.query.id; |
| | | this.init(); |
| | | |
| | | } |
| | | }, |
| | | }, |
| | | mounted() { |
| | | this.id = this.$route.query.id; |
| | | this.init(); |
| | |
| | | }, |
| | | watch: { |
| | | $route (to, from) { |
| | | this.$router.go(0); |
| | | console.log("to:",to.fullPath) |
| | | console.log("form:",from.fullPath) |
| | | // 正确打印路由对象的方法 |
| | | if(from.fullPath === "/orderList" && to.fullPath.includes("/order-detail")){ |
| | | this.sn = this.$route.query.sn; |
| | | this.getDataList(); |
| | | this.getOrderPackage(); |
| | | } |
| | | }, |
| | | }, |
| | | methods: { |
| | |
| | | }, |
| | | }, |
| | | mounted () { |
| | | console.log("加载数据") |
| | | this.sn = this.$route.query.sn; |
| | | this.getDataList(); |
| | | this.getOrderPackage(); |
| | |
| | | :data="data" |
| | | ref="table" |
| | | sortable="custom" |
| | | ></Table> |
| | | > |
| | | <template slot="sn" slot-scope="{ row }"> |
| | | <div style="width: 100%" @click="detail(row)"> |
| | | <span>{{row.sn}}</span> |
| | | </div> |
| | | </template> |
| | | <template slot="nickName" slot-scope="{ row }"> |
| | | <div style="width: 100%" @click="handleNickNameClick(row)"> |
| | | <span >{{row.nickName}}</span> |
| | | </div> |
| | | |
| | | </template> |
| | | |
| | | </Table> |
| | | |
| | | <Row type="flex" justify="end" class="mt_10"> |
| | | <Page |
| | |
| | | key: "sn", |
| | | minWidth: 240, |
| | | tooltip: true, |
| | | slot: 'sn' |
| | | }, |
| | | |
| | | { |
| | |
| | | }, |
| | | { |
| | | title: "买家名称", |
| | | key: "memberName", |
| | | key: "nickName", |
| | | minWidth: 130, |
| | | tooltip: true, |
| | | slot:'nickName' |
| | | }, |
| | | |
| | | { |
| | |
| | | title: "操作", |
| | | key: "action", |
| | | align: "center", |
| | | width: 100, |
| | | width: 150, |
| | | render: (h, params) => { |
| | | return h( |
| | | "Button", |
| | | { |
| | | props: { type: "info", size: "small" }, |
| | | style: { marginRight: "5px" }, |
| | | on: { |
| | | click: () => { |
| | | this.detail(params.row); |
| | | const buttons = []; |
| | | |
| | | // 查看按钮 - 始终显示 |
| | | buttons.push( |
| | | h( |
| | | "Button", |
| | | { |
| | | props: { type: "info", size: "small" }, |
| | | style: { marginRight: "5px" }, |
| | | on: { |
| | | click: () => { |
| | | this.detail(params.row); |
| | | }, |
| | | }, |
| | | }, |
| | | }, |
| | | "查看" |
| | | "查看" |
| | | ) |
| | | ); |
| | | |
| | | // 根据订单状态为'PAID'时显示额外操作按钮 |
| | | if (params.row.orderStatus === 'PAID') { |
| | | buttons.push( |
| | | h( |
| | | "Button", |
| | | { |
| | | props: { type: "primary", size: "small" }, |
| | | style: { marginRight: "5px" }, |
| | | on: { |
| | | click: () => { |
| | | this.handlePaidOrder(params.row); |
| | | }, |
| | | }, |
| | | }, |
| | | "更新订单状态" |
| | | ) |
| | | ); |
| | | } |
| | | |
| | | return h('div', buttons); |
| | | }, |
| | | }, |
| | | |
| | |
| | | }; |
| | | }, |
| | | methods: { |
| | | handleNickNameClick(row){ |
| | | this.$options.filters.customRouterPush({ name: "member-detail", query: { id: row.memberId } }) |
| | | }, |
| | | // 初始化数据 |
| | | init() { |
| | | this.getDataList(); |
| | |
| | | // 跳转详情页面 |
| | | detail(v) { |
| | | let sn = v.sn; |
| | | this.$options.filters.customRouterPush({ |
| | | this.$router.push({ |
| | | name: "order-detail", |
| | | query: { sn: sn }, |
| | | }) |
| | | }, |
| | | // 处理已付款订单的操作 |
| | | handlePaidOrder(order) { |
| | | // 这里可以添加已付款订单的具体操作逻辑 |
| | | // 例如:显示确认对话框,发起发货请求等 |
| | | this.$Modal.confirm({ |
| | | title: '更新状态', |
| | | content: `确认对订单号:${order.sn} 进行更新状操作吗?`, |
| | | onOk: () => { |
| | | // 调用发货API |
| | | this.deliverOrder(order); |
| | | }, |
| | | onCancel: () => { |
| | | this.$Message.info('已取消操作'); |
| | | } |
| | | }); |
| | | }, |
| | | // 发货操作 |
| | | deliverOrder(order) { |
| | | console.log('------------->获取订单信息',order); |
| | | console.log('订单sn编号',order.sn); |
| | | // 这里可以调用相关的API进行发货操作 |
| | | API_Order.sendMessage(order.sn).then((res) => { |
| | | console.log('-------------->',res); |
| | | if (res.success) { |
| | | this.$Message.success('更新状态成功'); |
| | | this.getDataList(); // 刷新列表 |
| | | } else { |
| | | this.$Message.error('更新状态失败'); |
| | | } |
| | | }); |
| | | |
| | | // 暂时模拟操作 |
| | | this.$Message.success(`订单 ${order.sn} 更新状态成功!`); |
| | | // 刷新列表数据 |
| | | this.getDataList(); |
| | | }, |
| | | // 导出订单 |
| | | async exportOrder() { |
| | |
| | | this.videoTagList = res.data; |
| | | }) |
| | | this.upLoadVideoShow = true; |
| | | this.chooseTag = row.tagList.map(item => { |
| | | return item.tagName |
| | | }) |
| | | console.log('--------------------->',row.tagList) |
| | | if (row.tagList){ |
| | | this.chooseTag = row.tagList.map(item => { |
| | | return item.tagName |
| | | }) |
| | | } |
| | | console.log('选中列表---》',row.goodsList) |
| | | row.goodsList.forEach(item => { |
| | | item.goodsSkuId = item.id |
| | | }) |
| | | if (row.goodsList){ |
| | | row.goodsList.forEach(item => { |
| | | item.goodsSkuId = item.id |
| | | }) |
| | | } |
| | | |
| | | this.uploadVideoForm = { |
| | | id: '', |
| | | title: '', |
| | |
| | | } |
| | | |
| | | |
| | | // 遍历已选择的标签 |
| | | row.tagList.forEach(tag => { |
| | | // 检查标签是否已存在于videoTagList中 |
| | | const exists = this.videoTagList.some(item => item.tagName === tag.tagName); |
| | | // 如果不存在,则添加到选项列表 |
| | | if (!exists) { |
| | | this.videoTagList.push({ |
| | | id: tag.id, // 生成临时ID |
| | | tagName: tag.tagName |
| | | }); |
| | | } |
| | | }); |
| | | if (row.tagList){ |
| | | // 遍历已选择的标签 |
| | | row.tagList.forEach(tag => { |
| | | // 检查标签是否已存在于videoTagList中 |
| | | const exists = this.videoTagList.some(item => item.tagName === tag.tagName); |
| | | // 如果不存在,则添加到选项列表 |
| | | if (!exists) { |
| | | this.videoTagList.push({ |
| | | id: tag.id, // 生成临时ID |
| | | tagName: tag.tagName |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | this.uploadVideoForm = row |
| | | console.log("打印值",this.uploadVideoForm) |
| | | this.uploadVideoForm.fileInfo= {}; |