wangfukang 3 weeks ago
parent
commit
aa22e44da6
  1. 4
      src/api/app.js
  2. 162
      src/views/app/business/bus/bus.vue
  3. 4
      src/views/app/business/courier/courier.vue
  4. 77
      src/views/app/business/logistics/logistics.vue
  5. 66
      src/views/app/business/problemFeedback/problemFeedback.vue
  6. 31
      src/views/app/data-statistics/data-statistics.vue
  7. 311
      src/views/sys/order-manage/logisticsAddress.vue
  8. 57
      src/views/sys/order-manage/orderManage.vue
  9. 2
      vue.config.js

4
src/api/app.js

@ -200,6 +200,10 @@ export const giveCoupon = (params) => {
return postRequest('/mall/coupon/send', params)
}
export const getCouponIssueRecords = (params) => {
return postRequest('/mall/coupon/issueRecords', params)
}
export const getAllLogiticsCompanyData = () => {
return getRequest('/app/logitics/getAll')
}

162
src/views/app/business/bus/bus.vue

@ -127,6 +127,30 @@
<Button type="text" @click="Visiable = false">关闭</Button>
</div>
</Modal>
<Modal title="发放详情" v-model="detailVisible" :mask-closable="false" :scrollable="true" :width="1000">
<div style="margin-bottom: 12px;">
<span>优惠券名称{{detailCoupon.name}}</span>
<span style="margin-left: 24px;">券ID{{detailCoupon.id}}</span>
</div>
<Form inline :label-width="80">
<FormItem label="用户手机号">
<Input v-model="detailSearchForm.mobile" clearable style="width: 200px" @on-enter="handleIssueSearch"></Input>
</FormItem>
<FormItem style="margin-left: -35px">
<Button @click="handleIssueSearch" type="primary" icon="ios-search">搜索</Button>
<Button @click="handleIssueReset">重置</Button>
</FormItem>
</Form>
<Table :loading="detailLoading" border :columns="detailColumns" :data="detailData" :size="tableSize"></Table>
<Row type="flex" justify="end" class="page">
<Page :current="detailSearchForm.pageNum" :total="detailTotal" :page-size="detailSearchForm.pageSize"
@on-change="changeIssuePage" @on-page-size-change="changeIssuePageSize" :page-size-opts="[10, 20, 50]"
size="small" show-total show-elevator show-sizer></Page>
</Row>
<div slot="footer">
<Button type="text" @click="detailVisible = false">关闭</Button>
</div>
</Modal>
<addEdit :data="form" :type="showType" v-model="showCompany" @on-submit="getDataList" />
</div>
</template>
@ -135,6 +159,7 @@
import {
getCouponData,
giveCoupon,
getCouponIssueRecords,
} from "@/api/app";
import addEdit from "./addEdit.vue";
export default {
@ -160,6 +185,18 @@
couponId:'',
giveNum:''
},
detailVisible: false,
detailLoading: false,
detailCoupon: {},
detailData: [],
detailTotal: 0,
detailSearchForm: {
pageNum: 1,
pageSize: 10,
regionId: JSON.parse(this.getStore("user")).departmentId,
couponId: '',
mobile: ''
},
selectList: [],
dictData: [{
title: "通用",
@ -332,7 +369,7 @@
"a", {
on: {
click: () => {
this.edit(params.row);
this.showIssueDetail(params.row);
},
},
},
@ -357,6 +394,74 @@
},
},
],
detailColumns: [{
type: "index",
width: 60,
align: "center",
},
{
title: "用户手机号",
key: "mobile",
minWidth: 130,
},
{
title: "用户ID",
key: "userId",
minWidth: 170,
},
{
title: "抵扣面额",
key: "discountAmount",
width: 100,
},
{
title: "使用门槛",
key: "minAmount",
width: 100,
},
{
title: "状态",
key: "status",
width: 100,
render: (h, params) => {
return h(
"div",
this.getCouponStatus(params.row.status)
);
}
},
{
title: "发放时间",
key: "receiveTime",
width: 175,
render: (h, params) => {
return h(
"div",
params.row.receiveTime ? this.getTime(params.row.receiveTime) : ""
);
}
},
{
title: "有效期",
key: "validStartTime",
width: 320,
render: (h, params) => {
let re = "";
if (params.row.validStartTime && params.row.validEndTime) {
re = this.getTime(params.row.validStartTime) + "-" + this.getTime(params.row.validEndTime);
}
return h(
"div",
re
);
}
},
{
title: "订单ID",
key: "orderId",
minWidth: 180,
},
],
data: [],
total: 0,
Visiable: false,
@ -371,6 +476,49 @@
this.couponsData = v
this.giveData.couponId = v.id
},
showIssueDetail(v) {
this.detailVisible = true;
this.detailCoupon = v;
this.detailSearchForm.pageNum = 1;
this.detailSearchForm.pageSize = 10;
this.detailSearchForm.couponId = v.id;
this.detailSearchForm.mobile = "";
this.getIssueRecords();
},
getIssueRecords() {
this.detailLoading = true;
getCouponIssueRecords(this.detailSearchForm).then((res) => {
this.detailLoading = false;
if (res.success) {
this.detailData = res.result.records;
this.detailTotal = res.result.total;
if (this.detailData.length == 0 && this.detailSearchForm.pageNum > 1) {
this.detailSearchForm.pageNum -= 1;
this.getIssueRecords();
}
}
});
},
changeIssuePage(v) {
this.detailSearchForm.pageNum = v;
this.getIssueRecords();
},
changeIssuePageSize(v) {
this.detailSearchForm.pageNum = 1;
this.detailSearchForm.pageSize = v;
this.getIssueRecords();
},
handleIssueSearch() {
this.detailSearchForm.pageNum = 1;
this.detailSearchForm.mobile = this.detailSearchForm.mobile ? this.detailSearchForm.mobile.trim() : "";
this.getIssueRecords();
},
handleIssueReset() {
this.detailSearchForm.pageNum = 1;
this.detailSearchForm.pageSize = 10;
this.detailSearchForm.mobile = "";
this.getIssueRecords();
},
submit(){
this.loading = true;
if(this.giveData.type == 0){
@ -402,6 +550,18 @@
// -- ::
return `${year}-${month}-${day} ${hour}:${minute}:${second}`;
},
getCouponStatus(status) {
if (status == 0) {
return "未使用";
} else if (status == 1) {
return "已挂起";
} else if (status == 2) {
return "已使用";
} else if (status == 3) {
return "已过期";
}
return "";
},
checkStatus(v){
this.searchForm.applyScene = v

4
src/views/app/business/courier/courier.vue

@ -402,7 +402,7 @@
);
}
return h("div", [
h(
/* h(
"a", {
on: {
click: () => {
@ -411,7 +411,7 @@
},
},
"编辑"
),
), */
h("Divider", {
props: {
type: "vertical",

77
src/views/app/business/logistics/logistics.vue

@ -6,8 +6,8 @@
<div class="search">
<Card>
<Tabs v-model="tabName" :animated="false" @on-click="changeOrderTab">
<TabPane label="抢单大厅" name="hall"></TabPane>
<TabPane label="配送中订单" name="delivery"></TabPane>
<TabPane :label="'抢单大厅(' + hallTotalCount + ')'" name="hall"></TabPane>
<TabPane :label="'配送中订单(' + deliveryTotalCount + ')'" name="delivery"></TabPane>
<TabPane label="配送时长设置" name="setting"></TabPane>
<TabPane label="客服设置" name="service"></TabPane>
</Tabs>
@ -251,7 +251,8 @@
transferActionTitle: "指派配送员",
transferActionType: "assign",
currentRegionId: regionId,
suppressAreaChange: false
suppressAreaChange: false,
countRefreshTimer: null
};
},
computed: {
@ -260,12 +261,20 @@
},
activeSearchForm() {
return this.tabName === "hall" ? this.hallSearchForm : this.deliverySearchForm;
},
hallTotalCount() {
return this.toNumber(this.hallCounts.waimai) + this.toNumber(this.hallCounts.kuaidi) + this.toNumber(this.hallCounts.paotui) + this.toNumber(this.hallCounts.zhipai);
},
deliveryTotalCount() {
return this.toNumber(this.deliveryCounts.daiqu) + this.toNumber(this.deliveryCounts.daisong);
}
},
methods: {
init() {
this.columns = this.buildOrderColumns();
this.getLogisticsInfo();
this.refreshOrderCounts();
this.startCountRefreshTimer();
this.getSetting();
this.getCustomerServiceSetting();
},
@ -406,6 +415,7 @@
}];
},
changeOrderTab(v) {
this.tabName = v;
if (v === "setting") {
this.getSetting();
return;
@ -416,21 +426,27 @@
}
this.total = 0;
this.data = [];
this.activeSearchForm.pageNum = 1;
this.activeSearchForm.getAreaId = "";
this.activeSearchForm.putAreaId = "";
const form = v === "hall" ? this.hallSearchForm : this.deliverySearchForm;
form.pageNum = 1;
form.getAreaId = "";
form.putAreaId = "";
this.syncAreaTreeText();
this.getLogisticsInfo();
this.$nextTick(() => {
this.getLogisticsInfo();
this.refreshOrderCounts();
});
},
changeHallTab(v) {
this.hallSearchForm.pageNum = 1;
this.hallSearchForm.deliveryType = HALL_TYPE_MAP[v];
this.getLogisticsInfo();
this.refreshOrderCounts();
},
changeDeliveryTab(v) {
this.deliverySearchForm.pageNum = 1;
this.deliverySearchForm.status = DELIVERY_STATUS_MAP[v];
this.getLogisticsInfo();
this.refreshOrderCounts();
},
handleGetAreaChange(v) {
if (this.suppressAreaChange) return;
@ -449,6 +465,7 @@
handleSearch() {
this.activeSearchForm.pageNum = 1;
this.getLogisticsInfo();
this.refreshOrderCounts();
},
handleReset() {
const form = this.activeSearchForm;
@ -469,6 +486,7 @@
this.suppressAreaChange = false;
});
this.getLogisticsInfo();
this.refreshOrderCounts();
},
changePage(v) {
this.activeSearchForm.pageNum = v;
@ -520,7 +538,6 @@
const result = res.result || {};
this.data = this.normalizeRecords(result.records);
this.total = Number(result.total) || 0;
this.setHallCounts(result);
}
}).finally(() => {
this.loading = false;
@ -539,8 +556,41 @@
}).finally(() => {
this.loading = false;
});
},
refreshOrderCounts() {
this.getHallOrderCounts();
this.getDeliveryStatusCounts();
},
startCountRefreshTimer() {
this.clearCountRefreshTimer();
this.countRefreshTimer = setInterval(() => {
this.refreshOrderCounts();
}, 30000);
},
clearCountRefreshTimer() {
if (this.countRefreshTimer) {
clearInterval(this.countRefreshTimer);
this.countRefreshTimer = null;
}
},
getHallOrderCounts() {
const params = this.cleanParams({
...this.hallSearchForm,
pageNum: 1,
pageSize: 1
});
delete params.paths;
delete params.waimaiData;
delete params.kuaidiData;
delete params.workerId;
delete params.deliveryType;
delete params.order;
getAdminDeliveryHallData(params).then((res) => {
if (this.isSuccess(res)) {
this.setHallCounts(res.result || {});
}
});
},
getDeliveryStatusCounts() {
const buildParams = (status) => {
const params = this.cleanParams({
@ -574,14 +624,6 @@
if (item.deliveryType == 2) this.hallCounts.kuaidi = Number(item.orderCount) || 0;
if (item.deliveryType == 3) this.hallCounts.paotui = Number(item.orderCount) || 0;
});
if (!orderCount.length && this.hallSearchForm.deliveryType != 4) {
if (this.hallSearchForm.deliveryType == 1) this.hallCounts.waimai = this.total;
if (this.hallSearchForm.deliveryType == 2) this.hallCounts.kuaidi = this.total;
if (this.hallSearchForm.deliveryType == 3) this.hallCounts.paotui = this.total;
}
if (this.hallSearchForm.deliveryType == 4 && result.zhipaiCount == null) {
this.hallCounts.zhipai = this.total;
}
},
normalizeRecords(records) {
return Array.isArray(records) ? records : [];
@ -891,5 +933,8 @@
mounted() {
this.init();
},
beforeDestroy() {
this.clearCountRefreshTimer();
},
};
</script>

66
src/views/app/business/problemFeedback/problemFeedback.vue

@ -33,6 +33,12 @@
size="small" show-total show-elevator show-sizer></Page>
</Row>
</Card>
<Modal title="订单详情" v-model="Visiable" :mask-closable="false" :scrollabele="true" :width="1000">
<logistics-address v-if="Visiable" @closePage="closePage" ref="dialog"></logistics-address>
<div slot="footer" v-show="Visiable">
<Button type="text" @click="Visiable = false">关闭</Button>
</div>
</Modal>
</div>
</template>
@ -43,10 +49,18 @@
JiangLiList,
closeMiandan
} from "@/api/app";
import {
getOrderDetail
} from "@/api/index";
import logisticsAddress from "@/views/sys/order-manage/logisticsAddress";
export default {
name: "logiticsCompany",
components: {
logisticsAddress,
},
data() {
return {
Visiable: false,
form: {
orderNumber:'',
freeAmount:'',
@ -95,6 +109,24 @@
title: "交易时间",
key: "dealingsTime",
align: "center",
},
{
title: "操作",
key: "action",
width: 120,
align: "center",
render: (h, params) => {
return h(
"a", {
on: {
click: () => {
this.showFreeOrderDetail(params.row);
},
},
},
"查看订单"
);
},
}
],
data:[],
@ -106,6 +138,10 @@
this.getDataList();
this.getJiangLiList();
},
closePage(){
this.Visiable = false;
this.getJiangLiList();
},
getJiangLiList(){
JiangLiList(this.searchForm).then((res) => {
if (res.success) {
@ -131,6 +167,36 @@
}
});
},
showDetail(v) {
for (let attr in v) {
if (v[attr] == null) {
v[attr] = "";
}
}
let str = JSON.stringify(v);
let data = JSON.parse(str);
this.Visiable = true;
this.$nextTick(() => {
this.$refs.dialog.initRecharge(data);
});
},
showFreeOrderDetail(row) {
if (!row.linkId) {
this.$Message.warning("当前记录没有关联订单");
return;
}
getOrderDetail(row.linkId).then((res) => {
if (res.success) {
this.showDetail(res.result || {
id: row.linkId
});
} else {
this.$Message.error(res.message || "查询订单详情失败");
}
}).catch((err) => {
this.$Message.error((err && err.message) || "查询订单详情失败");
});
},
add() {
addMiandan(this.form).then((res) => {
if (res.success) {

31
src/views/app/data-statistics/data-statistics.vue

@ -8,7 +8,7 @@
<TabPane label="拼团单" name="0"></TabPane>
<TabPane label="外卖单" name="1"></TabPane>
<TabPane label="跑腿单" name="2"></TabPane>
<TabPane label="i/e投诉举报" name="3"></TabPane>
<TabPane :label="renderIeReportTabLabel" name="3"></TabPane>
</Tabs>
<Row v-if="tabName !== '3'" @keydown.enter.native="handleSearch">
<Form ref="searchForm" :model="searchForm" inline :label-width="70">
@ -396,6 +396,7 @@
ieReportLoading: false,
ieReportList: [],
ieReportTotal: 0,
ieReportPendingCount: 0,
ieReportModalVisible: false,
ieReportHandleForm: {
reportId: "",
@ -447,6 +448,7 @@
this.selectDate = [dayTime, dayTime]
this.searchForm.startDate = dayTime
this.searchForm.endDate = dayTime
this.getIeReportPendingCount()
},
methods: {
resolveRegionId() {
@ -464,6 +466,16 @@
this.handleIeReportSearch()
}
},
renderIeReportTabLabel(h) {
return h("Badge", {
props: {
count: this.ieReportPendingCount,
overflowCount: 99
}
}, [
h("span", "i/e投诉举报")
])
},
handleIeReportSearch() {
this.ieReportSearch.pageNumber = 1
this.getIeReports()
@ -479,10 +491,25 @@
const data = res.result || res
this.ieReportList = data.records || []
this.ieReportTotal = data.total || 0
if (params.status === 0) {
this.ieReportPendingCount = this.ieReportTotal
}
}).finally(() => {
this.ieReportLoading = false
})
},
getIeReportPendingCount() {
const params = {
pageNumber: 1,
pageSize: 1,
status: 0,
regionId: this.resolveRegionId()
}
ieReportPage(params).then(res => {
const data = res.result || res
this.ieReportPendingCount = data.total || (data.records || []).length
})
},
changeIeReportPage(page) {
this.ieReportSearch.pageNumber = page
this.getIeReports()
@ -505,6 +532,7 @@
ieReportHandle(this.ieReportHandleForm).then(() => {
this.$Message.success("处理成功")
this.getIeReports()
this.getIeReportPendingCount()
})
},
deleteIeReport(row) {
@ -515,6 +543,7 @@
ieReportDelete(row.id).then(() => {
this.$Message.success("删除成功")
this.getIeReports()
this.getIeReportPendingCount()
})
}
})

311
src/views/sys/order-manage/logisticsAddress.vue

@ -5,6 +5,11 @@
<div class="title">订单信息</div>
<div>订单编号{{orderData.numberCode}}</div>
<div>支付订单编号{{'ORDER'+orderData.id}}</div>
<div>订单状态{{getOrderStatusText(orderData)}}</div>
<div>创建时间{{orderData.createTime | formatDateTime}}</div>
<div v-if="orderData.payTime">支付时间{{orderData.payTime | formatDateTime}}</div>
<div v-if="orderData.groupInfo && orderData.groupInfo.successTime">成团时间{{orderData.groupInfo.successTime | formatDateTime}}</div>
<div v-if="orderData.deliveryType == 2 && orderData.shopMakeTime">核销时间{{orderData.shopMakeTime | formatDateTime}}</div>
</div>
<div class="waiceng">
<div class="title">用户信息</div>
@ -27,51 +32,44 @@
</div>
</div>
<div style="display: flex;" v-if="orderData.status ==7 || orderData.status ==11">
<div class="waiceng" style="width: 70%;">
<div class="title" style="color:red">申请退款信息-用户全部退款</div>
<div class="box" v-for="(item,index) in orderData.goodsList" :key="index">
<div style="flex:1;">{{item.productName}}</div>
<div class="price"> X{{item.quantity}}</div>
<div class="price">¥{{item.price}}</div>
</div>
<div class="box">
<div style="flex:1;">餐盒费</div>
<div class="price">¥{{orderData.packageFee}}</div>
</div>
<div class="box">
<div style="flex:1;">配送费</div>
<div class="price">¥{{orderData.deliveryFee}}</div>
</div>
<div class="zong">
合计退款<span style="color:red;">¥{{orderData.totalAmount}}</span></div>
</div>
<div style="background: #fff;padding: 10px;border-radius: 10px;width: 30%;margin: 10;">
<div style="background: #fff;padding: 10px;border-radius: 10px;width: 100%;margin: 10;">
<div class="title">售后原因说明</div>
<textarea name="" id="" cols="30" rows="10" style="width: 100%;border: 1px solid #eee;"></textarea>
<textarea name="" id="" cols="30" rows="10" style="width: 100%;border: 1px solid #eee;" :value="getCurrentRefundRecord().reason || orderData.reason || ''" readonly></textarea>
<div style="display: flex;">
<div class='btn' @click="returnAmountAllow(orderData,1)">同意退款</div>
<div class='btn' @click="returnAmountAllow(orderData,0)">拒绝退款</div>
<div class='btn' @click="returnAmountAllow(getCurrentRefundRecord(),1)">同意退款</div>
<div class='btn' @click="returnAmountAllow(getCurrentRefundRecord(),0)">拒绝退款</div>
</div>
</div>
</div>
<div style="display: flex;">
<div class="waiceng" style="width: 69%;">
<div class="title">商品信息</div>
<div class="box" v-for="(item,index) in orderData.goodsList" :key="index">
<div style="flex:1;">{{item.productName}}</div>
<div class="goods-row" v-for="(item,index) in orderData.goodsList" :key="index">
<img v-if="item.productPicture" class="goods-img" :src="item.productPicture" />
<div class="goods-info">
<div>{{item.productName}}</div>
<div v-if="item.specs" class="goods-spec">{{formatSpecs(item.specs)}}</div>
</div>
<div class="price"> X{{item.quantity}}</div>
<div class="price">¥{{item.price}}</div>
</div>
<div class="box">
<div class="box" v-if="orderData.packageFee != null && orderData.packageFee > 0">
<div style="flex:1;">餐盒费</div>
<div class="price">¥{{orderData.packageFee}}</div>
</div>
<div class="box">
<div class="box" v-if="orderData.deliveryType == 1">
<div style="flex:1;">配送费</div>
<div class="price">¥{{orderData.deliveryFee}}</div>
</div>
<div class="zong">活动优惠<span style="color:red;">¥0</span> 下单返佣<span style="color:red;">¥0</span>
合计<span style="color:#11cd6e;">¥{{orderData.totalAmount}}</span></div>
<div class="box" v-if="orderData.freeAmount != null && orderData.freeAmount > 0">
<div style="flex:1;color:#ff6f2c;font-weight:700;">锦鲤免单</div>
<div class="price" style="color:#ff6f2c;font-weight:700;">¥{{orderData.freeAmount}}</div>
</div>
<div class="box" v-if="orderData.userCouponNum != null && orderData.userCouponNum > 0">
<div style="flex:1;">优惠券</div>
<div class="price">-¥{{orderData.userCouponNum}}</div>
</div>
<div class="zong">{{orderData.status == 0 ? '待支付' : '实付'}}<span style="color:#11cd6e;">¥{{orderData.totalAmount}}</span></div>
<div v-if="orderData.chouyong" class="zong">平台服务费:<span class="blue-color">¥{{(orderData.chouyong).toFixed(2)}}</span> </div>
<div v-if="orderData.yujishouru" class="zong">商家预计收入:<span class="blue-color">¥{{(orderData.yujishouru).toFixed(2)}}</span> </div>
</div>
@ -92,6 +90,59 @@
</div>
</div>
</div>
<div class="waiceng" v-if="orderData.mallRefundRecord && orderData.mallRefundRecord.length > 0">
<div class="title">退款/售后</div>
<div class="refund-card" v-for="(item,index) in orderData.mallRefundRecord" :key="index">
<div class="refund-row">
<span>申请时间</span>
<span>{{item.createTime | formatDateTime}}</span>
</div>
<div class="refund-row">
<span>金额</span>
<span>¥{{item.refundAmount}}</span>
</div>
<div class="refund-goods-row" v-for="(goods,goodsIndex) in getRefundItems(item)" :key="goodsIndex">
<img v-if="goods.productPicture" class="goods-img" :src="goods.productPicture" />
<div class="goods-info">
<div>{{goods.productName}}</div>
<div v-if="goods.specs" class="goods-spec">{{formatSpecs(goods.specs)}}</div>
<div v-if="goods.packageFee != undefined && goods.packageFee > 0 && orderData.packageFee > 0" class="goods-spec">餐盒费 ¥{{goods.packageFee}}</div>
</div>
<div class="price">X{{goods.quantity}}</div>
<div class="price">¥{{goods.price}}</div>
</div>
<div class="refund-row">
<span>原因</span>
<span>{{item.reason || ""}}</span>
</div>
<div class="refund-row" v-if="item.pictures != null && item.pictures != ''">
<span>图片</span>
<span>
<img class="refund-image" v-for="(picture,pictureIndex) in getPictureList(item.pictures)" :key="pictureIndex" :src="picture" />
</span>
</div>
<div class="refund-row">
<span>退款/售后类型</span>
<span>{{getRefundTypeText(item)}}<template v-if="item.refundTypeStatus != null"> | {{getRefundTypeStatusText(item)}}</template></span>
</div>
<div class="refund-row">
<span>退款/售后状态</span>
<span>{{getRefundStatusText(item.status)}}</span>
</div>
<div class="refund-row" v-if="(item.status == 2 || item.status == 5) && item.rejectReason">
<span>拒绝原因</span>
<span>{{item.rejectReason}}</span>
</div>
<div class="refund-row" v-if="item.status == 0 || item.status == 3">
<span>自动退款时间</span>
<span>{{getAutoRefundTime(item.createTime)}} 之前对方未处理系统会自动退款</span>
</div>
<div class="refund-row" v-if="item.successTime != null">
<span>处理退款/售后时间</span>
<span>{{item.successTime | formatDateTime}}</span>
</div>
</div>
</div>
</div>
</template>
@ -108,10 +159,15 @@
name: "logisticsAddress",
data() {
return {
orderData: {},
orderData: {
deliveryInfo: {},
goodsList: [],
mallRefundRecord: []
},
returnFormData:{},
refundReason: "",
refundLoading: false
refundLoading: false,
refundActionData: null
};
},
filters: {
@ -130,43 +186,69 @@
methods: {
initRecharge(data) {
this.refundReason = "";
if(data.status == 7 || data.status == 11){
this.orderData = data
this.orderData.goodsList = this.orderData.items
this.orderData.deliveryInfo = this.orderData.mallDeliveryOrder
this.orderData.deliveryType = this.orderData.deliveryInfo.deliveryType
this.orderData.deliveryFee = this.orderData.deliveryInfo.deliveryFee
this.orderData.packageFee = data.mallOrder.packageFee
this.orderData.numberCode = this.orderData.mallDeliveryOrder.numberCode
}else{
this.refundActionData = data;
const orderId = data.orderId || (data.mallOrder && data.mallOrder.id) || data.id;
const shopId = data.shopId || (data.mallOrder && data.mallOrder.shopId);
if (shopId) {
getByShopId({
"shopId": data.shopId
"shopId": shopId
}).then((res) => {
if (res.success) {
this.orderDetail(data.id,res.result)
this.orderDetail(orderId, res.result, data)
} else {
this.orderDetail(orderId, {}, data)
}
});
} else {
this.orderDetail(orderId, {}, data)
}
},
orderDetail(id,shopTakeaway) {
orderDetail(id,shopTakeaway, sourceData) {
getOrderDetail(id).then((res) => {
this.loading = false;
if (res.success) {
this.orderData = res.result
this.orderData = this.normalizeOrderData(res.result)
if ((!this.orderData.mallRefundRecord || this.orderData.mallRefundRecord.length == 0) && sourceData && sourceData.refundAmount != null) {
this.orderData.mallRefundRecord = [sourceData];
}
//
let price = this.orderData.goodsAmount+this.orderData.packageFee
let price = (this.orderData.goodsAmount || 0) + (this.orderData.packageFee || 0)
if(this.orderData.orderType == 1){
this.orderData.chouyong = price/100 * shopTakeaway.commissionRateOne
this.orderData.chouyong = price/100 * (shopTakeaway.commissionRateOne || 0)
this.orderData.yujishouru = price - this.orderData.chouyong
}else{
this.orderData.chouyong = price/100 * shopTakeaway.commissionRateMore
this.orderData.chouyong = price/100 * (shopTakeaway.commissionRateMore || 0)
this.orderData.yujishouru = price - this.orderData.chouyong
}
}
});
},
normalizeOrderData(data) {
return Object.assign({
deliveryInfo: {},
goodsList: [],
mallRefundRecord: []
}, data || {}, {
deliveryInfo: (data && data.deliveryInfo) || {},
goodsList: (data && data.goodsList) || [],
mallRefundRecord: (data && data.mallRefundRecord) || []
});
},
getCurrentRefundRecord() {
const records = this.orderData.mallRefundRecord || [];
const pendingRecord = records.find((item) => item.status == 0 || item.status == 3);
return pendingRecord || this.refundActionData || this.orderData;
},
getRefundItems(item) {
if (item && item.items && item.items.length > 0) return item.items;
return [];
},
returnAmountAllow(item,status){
if (!item) {
this.$Message.warning("未找到退款/售后记录");
return;
}
let titleText = status == 1 ? '确定同意该申请吗?' : '确定拒绝该申请吗?';
//退
@ -199,16 +281,17 @@
});
},
processReturn(item,status){
if (!item) return;
let url = ''
//退
if(item.status == 7){
if(item.status == 7 || item.status == 0){
//
if(status == 0){
this.returnFormData.status = 2
}else{
this.returnFormData.status = 1
}
}else if(item.status == 11){
}else if(item.status == 11 || item.status == 3){
//
if(status == 0){
this.returnFormData.status = 5
@ -216,11 +299,12 @@
this.returnFormData.status = 4
}
}
const order = item.mallOrder || this.orderData || {};
this.returnFormData.id = item.id;
this.returnFormData.linkId = item.linkId;
this.returnFormData.orderId = item.orderId;
this.returnFormData.deliveryType = item.mallOrder.deliveryType;
this.returnFormData.orderType = item.mallOrder.orderType;
this.returnFormData.orderId = item.orderId || order.id;
this.returnFormData.deliveryType = order.deliveryType;
this.returnFormData.orderType = order.orderType;
this.returnFormData.refundAmount = item.refundAmount;
this.returnFormData.refundType = item.refundType;
this.returnFormData.refundTypeStatus = item.refundTypeStatus;
@ -246,7 +330,73 @@
return diffMinutes;
},
canAdminRefundOrder() {
return this.orderData.status != 6 && this.orderData.status != 8 && this.orderData.status != 12;
return this.orderData.status != 0 && this.orderData.status != 6 && this.orderData.status != 8 && this.orderData.status != 12;
},
formatSpecs(data) {
if (data == null || data === "") return "";
let str = typeof data === "object" ? JSON.stringify(data) : String(data);
return str.replace(/[{}"]/g, "");
},
getPictureList(pictures) {
if (pictures == null || pictures === "") return [];
if (Array.isArray(pictures)) {
return pictures.filter((item) => item != null && item !== "");
}
return String(pictures).split(",").map((item) => item.trim()).filter((item) => item !== "");
},
getRefundTypeText(item) {
if (!item) return "";
if (item.refundType == 1) return "退商品";
if (item.refundType == 2) return "退配送费";
return "全额退款";
},
getRefundTypeStatusText(item) {
if (!item) return "";
if (item.refundTypeStatus == 1) return "商家退款";
if (item.refundTypeStatus == 2) return "配送员退款";
if (item.refundTypeStatus == 3) {
return item.linkId && String(item.linkId).indexOf("W") != -1 ? "配送员退款" : "商家退款";
}
return "平台退款";
},
getRefundStatusText(status) {
if (status == 0) return "处理退款中";
if (status == 1) return "同意退款";
if (status == 2) return "拒绝退款";
if (status == 3) return "处理售后中";
if (status == 4) return "同意售后";
if (status == 5) return "拒绝售后";
return "";
},
getOrderStatusText(item) {
if (!item) return "";
if (item.status == 0) return "待支付";
if (item.status == 2) return item.shopDelivery == 1 ? "等待商家配送接单" : "等待配送员接单";
if (item.status == 3 && item.deliveryType == 1 && item.deliveryInfo && item.deliveryInfo.transferDelivery == 1 && !item.deliveryInfo.transferArriveTime) return "等待商家送达中转点";
if (item.status == 3 && item.deliveryType == 1 && item.deliveryInfo && item.deliveryInfo.transferDelivery == 1 && item.deliveryInfo.transferArriveTime) return "待配送员取货";
if (item.status == 3 && item.deliveryType == 1) return item.shopDelivery == 1 ? "商家配送已接单" : "配送员已接单";
if (item.status == 3 && item.deliveryType == 2) return "待消费";
if (item.status == 4 && item.deliveryType == 1) return item.deliveryInfo && item.deliveryInfo.transferDelivery == 1 ? "中转配送中" : "配送员已取货";
if (item.status == 5) return "订单已完成";
if (item.status == 6) return "订单已取消";
if (item.status == 7) return "等待同意退款";
if (item.status == 8) return "订单已退款";
if (item.status == 11) return "售后中";
if (item.status == 12) return "订单已售后";
return "";
},
getAutoRefundTime(value) {
if (!value) return "";
const date = new Date(value);
if (isNaN(date.getTime())) return "";
date.setHours(date.getHours() + 1);
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, "0");
const day = String(date.getDate()).padStart(2, "0");
const hours = String(date.getHours()).padStart(2, "0");
const minutes = String(date.getMinutes()).padStart(2, "0");
const seconds = String(date.getSeconds()).padStart(2, "0");
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
},
adminRefundOrder() {
if (this.refundLoading || !this.orderData.id) return;
@ -320,6 +470,63 @@
height: 30px px;
}
.goods-row,
.refund-goods-row {
display: flex;
align-items: center;
padding: 8px 0;
border-bottom: 1px solid #eee;
}
.goods-img {
width: 54px;
height: 54px;
margin-right: 10px;
border-radius: 4px;
object-fit: cover;
}
.goods-info {
flex: 2;
}
.goods-spec {
margin-top: 4px;
color: #999;
font-size: 12px;
}
.refund-card {
margin-top: 10px;
padding: 10px;
border: 1px solid #eee;
border-radius: 6px;
}
.refund-row {
display: flex;
padding: 6px 0;
border-bottom: 1px solid #f3f3f3;
}
.refund-row span:first-child {
width: 130px;
color: #777;
font-weight: 700;
}
.refund-row span:last-child {
flex: 1;
}
.refund-image {
width: 80px;
height: 80px;
margin-right: 8px;
border-radius: 4px;
object-fit: cover;
}
.text {
font-weight: bold;
color: #777;

57
src/views/sys/order-manage/orderManage.vue

@ -287,6 +287,7 @@
selectList: [],
tabName: "1",
tabName1: "10",
statusTabOrder: ["10", "0", "1", "2", "13", "3", "4", "5", "6", "8", "9", "11", "12"],
orderTypeTabs: [{
label: "饭团订单",
name: "1"
@ -409,6 +410,10 @@
}
],
deliveryStatusTabs: [{
label: "全部",
name: "10"
},
{
label: "待接单",
name: "3"
},
@ -641,15 +646,6 @@
return h("span", this.getRefundStatusText(params.row.status));
}
},
{
title: "退款原因",
key: "refundTypeStatus",
width: 210,
align: "center",
render: (h, params) => {
return h("span", this.getRefundTypeStatusText(params.row.refundTypeStatus));
}
},
{
title: "退款类型",
key: "refundType",
@ -673,6 +669,15 @@
}, [h("span", params.row.reason || "无")]);
}
},
{
title: "退款责任方",
key: "refundTypeStatus",
width: 210,
align: "center",
render: (h, params) => {
return h("span", this.getRefundTypeStatusText(params.row.refundTypeStatus));
}
},
{
title: "原因图片",
key: "pictures",
@ -865,10 +870,11 @@
return !e.hidden;
})
},
availableStatusTabs() {
return this.getStatusTabsByType(this.searchForm.searchType);
},
currentStatusTabs() {
if (this.searchForm.searchType == "2") return this.deliveryStatusTabs;
if (this.searchForm.searchType == "3" || this.searchForm.searchType == "4") return this.groupStatusTabs;
return this.statusTabs;
return this.sortStatusTabs(this.availableStatusTabs);
},
currentColumns() {
if (this.isRefundTab) return this.refundColumns;
@ -994,12 +1000,35 @@
return;
}
this.searchForm.searchType = v
if (!this.currentStatusTabs.some((item) => item.name == this.tabName1)) {
this.tabName1 = this.currentStatusTabs[0].name;
if (!this.availableStatusTabs.some((item) => item.name == this.tabName1)) {
this.tabName1 = this.getDefaultStatusTabName(v);
this.searchForm.searchStatus = this.tabName1;
}
this.getLogisticsInfo()
},
getStatusTabsByType(type) {
if (type == "2") return this.deliveryStatusTabs;
if (type == "3" || type == "4") return this.groupStatusTabs;
return this.statusTabs;
},
sortStatusTabs(tabs) {
return tabs.slice().sort((a, b) => {
const aIndex = this.statusTabOrder.indexOf(a.name);
const bIndex = this.statusTabOrder.indexOf(b.name);
return (aIndex == -1 ? Number.MAX_SAFE_INTEGER : aIndex) - (bIndex == -1 ? Number.MAX_SAFE_INTEGER : bIndex);
});
},
getDefaultStatusTabName(type) {
const defaultStatusMap = {
"2": "10",
"3": "10",
"4": "10"
};
const statusTabs = this.availableStatusTabs;
const defaultStatus = defaultStatusMap[type];
if (defaultStatus && statusTabs.some((item) => item.name == defaultStatus)) return defaultStatus;
return statusTabs[0].name;
},
checkStatus(v) {
this.searchForm.orderStatus = v
},

2
vue.config.js

@ -8,7 +8,7 @@ module.exports = {
proxy: {
'/hiver': {
target: 'https://hbkuaishi.com', // 正式1
// target: 'http://192.168.100.30:8888', // 本地
// target: 'http://192.168.100.34:8888', // 本地
ws: false
},
'/foo': {

Loading…
Cancel
Save