Commit 389dbb6a by huaying

Merge branch 'bugfix/积分订单导出订单时间限制'

parents 8a484afa fa67060d
...@@ -19,7 +19,8 @@ ...@@ -19,7 +19,8 @@
<div class="operate-top"> <div class="operate-top">
<div class="fl"> <div class="fl">
<div class="search-item m-r-10"> <div class="search-item m-r-10">
<span>下单时间</span><el-date-picker <span>下单时间</span
><el-date-picker
class="date-picker" class="date-picker"
@change="changeTime" @change="changeTime"
v-model="dateValue" v-model="dateValue"
...@@ -39,7 +40,7 @@ ...@@ -39,7 +40,7 @@
<el-input <el-input
placeholder="请输入关键词搜索" placeholder="请输入关键词搜索"
v-model.trim="searchValue" v-model.trim="searchValue"
style="width:280px;" style="width: 280px"
clearable clearable
@keyup.enter.native="handleInputSearch(searchValue)" @keyup.enter.native="handleInputSearch(searchValue)"
@clear="handleInputSearch(searchValue)" @clear="handleInputSearch(searchValue)"
...@@ -48,7 +49,7 @@ ...@@ -48,7 +49,7 @@
v-model="searchType" v-model="searchType"
slot="prepend" slot="prepend"
placeholder="请选择" placeholder="请选择"
style="width:100px;" style="width: 100px"
> >
<el-option label="订单编号" :value="1" /> <el-option label="订单编号" :value="1" />
<el-option label="卡券名称" :value="2" /> <el-option label="卡券名称" :value="2" />
...@@ -80,19 +81,29 @@ ...@@ -80,19 +81,29 @@
<div class="fr"> <div class="fr">
<el-button <el-button
@click="exportExcel" @click="exportExcel"
v-if="integralMallProId && $getButtonLimit($buttonCode.couponExchangeExport)" v-if="
integralMallProId && $getButtonLimit($buttonCode.couponExchangeExport)
"
type="primary" type="primary"
:limit-code="$buttonCode.couponExchangeExport" :limit-code="$buttonCode.couponExchangeExport"
> >
<i class="iconfont icon-icon_yunxiazai" style="margin-right:5px" />导出订单 <i
class="iconfont icon-icon_yunxiazai"
style="margin-right: 5px"
/>导出订单
</el-button> </el-button>
<el-button <el-button
@click="exportExcelAll" @click="exportExcelAll"
v-if="!integralMallProId && $getButtonLimit($buttonCode.couponExchangeExport)" v-if="
!integralMallProId && $getButtonLimit($buttonCode.couponExchangeExport)
"
type="primary" type="primary"
:limit-code="$buttonCode.couponExchangeExport" :limit-code="$buttonCode.couponExchangeExport"
> >
<i class="iconfont icon-icon_yunxiazai" style="margin-right:5px" />导出订单 <i
class="iconfont icon-icon_yunxiazai"
style="margin-right: 5px"
/>导出订单
</el-button> </el-button>
</div> </div>
</div> </div>
...@@ -119,27 +130,60 @@ ...@@ -119,27 +130,60 @@
<!-- 折扣券 --> <!-- 折扣券 -->
<!-- <img v-if="scope.row.cardType === 1" src="../../../static/img/zhe.png" alt="" /> --> <!-- <img v-if="scope.row.cardType === 1" src="../../../static/img/zhe.png" alt="" /> -->
<!-- 兑换券 --> <!-- 兑换券 -->
<img v-if="scope.row.giftMainPic" :src="scope.row.giftMainPic" alt=""> <img v-if="scope.row.giftMainPic" :src="scope.row.giftMainPic" alt="" />
<img v-if="scope.row.cardType === 2 && !scope.row.giftMainPic" src="../../../static/img/quan02.png" alt=""> <img
v-if="scope.row.cardType === 2 && !scope.row.giftMainPic"
src="../../../static/img/quan02.png"
alt=""
/>
<!-- 抵金券 --> <!-- 抵金券 -->
<img v-if="scope.row.cardType === 0 && !scope.row.giftMainPic" src="../../../static/img/quan01.png" alt=""> <img
v-if="scope.row.cardType === 0 && !scope.row.giftMainPic"
src="../../../static/img/quan01.png"
alt=""
/>
<!-- 折扣券 --> <!-- 折扣券 -->
<img v-if="scope.row.cardType === 1 && !scope.row.giftMainPic" src="../../../static/img/quan03.png" alt=""> <img
v-if="scope.row.cardType === 1 && !scope.row.giftMainPic"
src="../../../static/img/quan03.png"
alt=""
/>
<!-- 商场券 --> <!-- 商场券 -->
<img v-if="scope.row.cardType === 3 && !scope.row.giftMainPic" src="../../../static/img/quan04.png" alt> <img
v-if="scope.row.cardType === 3 && !scope.row.giftMainPic"
src="../../../static/img/quan04.png"
alt
/>
<div class="info-name"> <div class="info-name">
<p class="pro-ellipsis"> <p class="pro-ellipsis">
{{ scope.row.giftName }} {{ scope.row.giftName }}
</p> </p>
<el-tooltip :content="scope.row.proReferId" placement="top" v-if="scope.row.proReferId.indexOf(',') === -1"> <el-tooltip
<p style="font-size:13px;color:#909399;overflow: hidden;text-overflow:ellipsis;white-space: nowrap;"> :content="scope.row.proReferId"
placement="top"
v-if="scope.row.proReferId.indexOf(',') === -1"
>
<p
style="
font-size: 13px;
color: #909399;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
"
>
卡券编号:{{ scope.row.proReferId }} 卡券编号:{{ scope.row.proReferId }}
</p> </p>
</el-tooltip> </el-tooltip>
<p style="font-size:13px;color:#909399" v-if="scope.row.proReferId.indexOf(',') === -1"> <p
style="font-size: 13px; color: #909399"
v-if="scope.row.proReferId.indexOf(',') === -1"
>
<span v-if="scope.row.status === 2">已领取</span> <span v-if="scope.row.status === 2">已领取</span>
<span v-if="scope.row.status <= 1 && scope.row.status != -2">待领取</span> <span v-if="scope.row.status <= 1 && scope.row.status != -2"
>待领取</span
>
<span v-if="scope.row.status != -2"> / </span> <span v-if="scope.row.status != -2"> / </span>
<span v-if="scope.row.useStatus === 5">已使用</span> <span v-if="scope.row.useStatus === 5">已使用</span>
<span v-if="scope.row.useStatus === 0">待使用</span> <span v-if="scope.row.useStatus === 0">待使用</span>
...@@ -156,25 +200,43 @@ ...@@ -156,25 +200,43 @@
sortable="custom" sortable="custom"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<p style="line-height:18px"> <p style="line-height: 18px">
{{ scope.row.createTime ? getTime(scope.row.createTime) : '--' }} {{ scope.row.createTime ? getTime(scope.row.createTime) : "--" }}
</p> </p>
<p style="line-height:18px" class="gray-color"> <p style="line-height: 18px" class="gray-color">
{{ scope.row.createTime ? getSeconds(scope.row.createTime) : '--' }} {{ scope.row.createTime ? getSeconds(scope.row.createTime) : "--" }}
</p> </p>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="creatorName" label="优惠券创建人" min-width="130px" /> <el-table-column prop="creatorName" label="优惠券创建人" min-width="130px" />
<el-table-column prop="definedCode" label="订单编号" min-width="170px"> <el-table-column prop="definedCode" label="订单编号" min-width="170px">
<template slot-scope="scope"> <template slot-scope="scope">
<el-dropdown @visible-change="i => getOrderInfo(i, scope.row.integralMallProExchangeId)" trigger="click" class="drop-list"> <el-dropdown
<span class="el-dropdown-link"> {{ scope.row.definedCode }}<i class="iconfont icon-icon-" /> </span> @visible-change="
(i) => getOrderInfo(i, scope.row.integralMallProExchangeId)
"
trigger="click"
class="drop-list"
>
<span class="el-dropdown-link">
{{ scope.row.definedCode }}<i class="iconfont icon-icon-" />
</span>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
<el-dropdown-item command="orderInfo.definedCode"> <el-dropdown-item command="orderInfo.definedCode">
订单编号:{{ orderInfo.orderNumber }} 订单编号:{{ orderInfo.orderNumber }}
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item command="orderInfo.definedCode"> <el-dropdown-item command="orderInfo.definedCode">
兑换渠道:{{ orderInfo.source === '0' ? '小程序' : orderInfo.source === '1' ? '二维码扫描' : orderInfo.source === '3' ? '常规兑换' : orderInfo.source === '2' ? '其他' : '' }} 兑换渠道:{{
orderInfo.source === "0"
? "小程序"
: orderInfo.source === "1"
? "二维码扫描"
: orderInfo.source === "3"
? "常规兑换"
: orderInfo.source === "2"
? "其他"
: ""
}}
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item command="orderInfo.definedCode"> <el-dropdown-item command="orderInfo.definedCode">
商户支付号:{{ orderInfo.merchantNumber }} 商户支付号:{{ orderInfo.merchantNumber }}
...@@ -183,19 +245,28 @@ ...@@ -183,19 +245,28 @@
支付流水号:{{ orderInfo.payNumber }} 支付流水号:{{ orderInfo.payNumber }}
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item command="orderInfo.definedCode"> <el-dropdown-item command="orderInfo.definedCode">
下单时间:{{ orderInfo.orderTime ? getTimeAll(orderInfo.orderTime) : '--' }} 下单时间:{{
orderInfo.orderTime ? getTimeAll(orderInfo.orderTime) : "--"
}}
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item command="orderInfo.definedCode"> <el-dropdown-item command="orderInfo.definedCode">
付款时间:{{ orderInfo.payTime ? getTimeAll(orderInfo.payTime) : '--' }} 付款时间:{{
orderInfo.payTime ? getTimeAll(orderInfo.payTime) : "--"
}}
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item command="orderInfo.definedCode"> <el-dropdown-item command="orderInfo.definedCode">
发货时间:{{ orderInfo.deliveryTime ? getTimeAll(orderInfo.deliveryTime) : '--' }} 发货时间:{{
orderInfo.deliveryTime ? getTimeAll(orderInfo.deliveryTime) : "--"
}}
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item command="orderInfo.definedCode"> <el-dropdown-item command="orderInfo.definedCode">
交易完成时间:{{ orderInfo.finishTime ? getTimeAll(orderInfo.finishTime) : '--' }} 交易完成时间:{{
orderInfo.finishTime ? getTimeAll(orderInfo.finishTime) : "--"
}}
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item command="orderInfo.definedCode"> <el-dropdown-item command="orderInfo.definedCode">
收货信息:{{ orderInfo.definedCode }} {{ orderInfo.consignee }} {{ orderInfo.consigneePhone }} {{ orderInfo.receivingAddress }} 收货信息:{{ orderInfo.definedCode }} {{ orderInfo.consignee }}
{{ orderInfo.consigneePhone }} {{ orderInfo.receivingAddress }}
</el-dropdown-item> </el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
...@@ -203,7 +274,11 @@ ...@@ -203,7 +274,11 @@
</el-table-column> </el-table-column>
<el-table-column label="会员" min-width="150px"> <el-table-column label="会员" min-width="150px">
<template slot-scope="scope"> <template slot-scope="scope">
<memberInfo :memberObj="scope.row" :requestProject="requestProject" :placement="placement" /> <memberInfo
:memberObj="scope.row"
:requestProject="requestProject"
:placement="placement"
/>
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column prop="memberCardStatus" label="会员状态" min-width="120px"> <!-- <el-table-column prop="memberCardStatus" label="会员状态" min-width="120px">
...@@ -218,12 +293,8 @@ ...@@ -218,12 +293,8 @@
min-width="120px" min-width="120px"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<p style="line-height:18px"> <p style="line-height: 18px">积分:{{ scope.row.unitCostIntegral }}</p>
积分:{{ scope.row.unitCostIntegral }} <p style="line-height: 18px">现金:¥{{ scope.row.payCost }}</p>
</p>
<p style="line-height:18px">
现金:¥{{ scope.row.payCost }}
</p>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
...@@ -233,15 +304,21 @@ ...@@ -233,15 +304,21 @@
min-width="170px" min-width="170px"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<p style="line-height:18px"> <p style="line-height: 18px">
<span v-if="scope.row.status <= 0">交易关闭</span> <span v-if="scope.row.status <= 0">交易关闭</span>
<span v-if="scope.row.status === 2 || scope.row.status === 1">买家已付款</span> <span v-if="scope.row.status === 2 || scope.row.status === 1"
>买家已付款</span
>
<span v-if="scope.row.status === 11">待付款</span> <span v-if="scope.row.status === 11">待付款</span>
</p> </p>
<p style="line-height:18px"> <p style="line-height: 18px">
<el-button <el-button
type="text" type="text"
v-if="scope.row.status === 11 && scope.row.refundStatus !== 2 && $getButtonLimit($buttonCode.couponExchangeClose)" v-if="
scope.row.status === 11 &&
scope.row.refundStatus !== 2 &&
$getButtonLimit($buttonCode.couponExchangeClose)
"
@click="closeOrderNoPay(scope.row)" @click="closeOrderNoPay(scope.row)"
:limit-code="$buttonCode.couponExchangeClose" :limit-code="$buttonCode.couponExchangeClose"
> >
...@@ -253,13 +330,13 @@ ...@@ -253,13 +330,13 @@
<template slot="empty"> <template slot="empty">
<div class="no-data-wrap"> <div class="no-data-wrap">
<div class="no-data-icon"> <div class="no-data-icon">
<img src="../../../static/img/no-data_icon.png"> <img src="../../../static/img/no-data_icon.png" />
</div> </div>
<p>暂无数据</p> <p>暂无数据</p>
</div> </div>
</template> </template>
</el-table> </el-table>
<div class="pagination-conteiner" style="background:#fff;"> <div class="pagination-conteiner" style="background: #fff">
<div class="pagination"> <div class="pagination">
<dm-pagination <dm-pagination
v-if="total != 0" v-if="total != 0"
...@@ -385,7 +462,7 @@ export default { ...@@ -385,7 +462,7 @@ export default {
const params = { const params = {
creatorName: v, creatorName: v,
}; };
request.get('/api-integral-mall/list-creator', { params }).then(res => { request.get('/api-integral-mall/list-creator', { params }).then((res) => {
if (res.data.errorCode === 0) { if (res.data.errorCode === 0) {
if (res.data.result) { if (res.data.result) {
cb(res.data.result); cb(res.data.result);
...@@ -399,7 +476,7 @@ export default { ...@@ -399,7 +476,7 @@ export default {
}); });
}, },
getStatus () { getStatus () {
request.post('/api-integral-mall/is-show-self ').then(res => { request.post('/api-integral-mall/is-show-self ').then((res) => {
if (res.data.errorCode === 0) { if (res.data.errorCode === 0) {
this.showFlag = res.data.result.showFlag; this.showFlag = res.data.result.showFlag;
// this.openFlag = res.data.result.openFlag; // this.openFlag = res.data.result.openFlag;
...@@ -445,7 +522,8 @@ export default { ...@@ -445,7 +522,8 @@ export default {
} }
this.params = { this.params = {
orderStatus: this.orderStatus, orderStatus: this.orderStatus,
changeType: this.changeType, // changeType: this.changeType,
changeType: -1,
searchParams: this.searchValue, searchParams: this.searchValue,
searchType: this.searchType, searchType: this.searchType,
beginTime: this.beginTime, beginTime: this.beginTime,
...@@ -461,17 +539,27 @@ export default { ...@@ -461,17 +539,27 @@ export default {
// 计算自然月 // 计算自然月
natureMonth (curDate, step) { natureMonth (curDate, step) {
if (!curDate || !step) return curDate; if (!curDate || !step) return curDate;
if (typeof curDate === 'string') curDate = new Date(curDate.replace(/[\/|\.]/g, '-')); // new Date(str) 对str格式的,ios只支持yyyy-MM-dd if (typeof curDate === 'string') {
curDate = new Date(curDate.replace(/[\/|\.]/g, '-'));
} // new Date(str) 对str格式的,ios只支持yyyy-MM-dd
const targetDateLastDay = new Date(curDate.getFullYear(), curDate.getMonth() + step + 1, 0); const targetDateLastDay = new Date(
const targetDate = new Date(curDate.getFullYear(), curDate.getMonth() + step, Math.min(curDate.getDate(), targetDateLastDay.getDate())); curDate.getFullYear(),
curDate.getMonth() + step + 1,
0,
);
const targetDate = new Date(
curDate.getFullYear(),
curDate.getMonth() + step,
Math.min(curDate.getDate(), targetDateLastDay.getDate()),
);
return this.formatDate(targetDate, 'yyyy-MM-dd'); return this.formatDate(targetDate, 'yyyy-MM-dd');
}, },
formatDate (dateObj, format) { formatDate (dateObj, format) {
const month = dateObj.getMonth() + 1; const month = dateObj.getMonth() + 1;
const date = dateObj.getDate(); const date = dateObj.getDate();
return format.replace(/yyyy|MM|dd/g, field => { return format.replace(/yyyy|MM|dd/g, (field) => {
switch (field) { switch (field) {
case 'yyyy': case 'yyyy':
return dateObj.getFullYear(); return dateObj.getFullYear();
...@@ -496,8 +584,8 @@ export default { ...@@ -496,8 +584,8 @@ export default {
return; return;
} }
const data = this.natureMonth(this.beginTime, 3); const data = this.natureMonth(this.beginTime, 3);
this.endTime = this.endTime.split(' ')[0]; const endTimes = this.endTime.split(' ')[0];
if (new Date(data).getTime() - 1 * 24 * 1000 < new Date(this.endTime).getTime()) { if (new Date(data).getTime() - 1 * 24 * 1000 < new Date(endTimes).getTime()) {
this.$message.error('导出订单不支持导出超过3个月时长的数据,请重新选择时间'); this.$message.error('导出订单不支持导出超过3个月时长的数据,请重新选择时间');
return; return;
} }
...@@ -525,18 +613,20 @@ export default { ...@@ -525,18 +613,20 @@ export default {
const params = { const params = {
integralMallProExchangeId: integralMallProExchangeId, integralMallProExchangeId: integralMallProExchangeId,
}; };
request.get('/api-integral-mall/get-order-information', { params }).then(res => { request
if (res.data.errorCode === 0) { .get('/api-integral-mall/get-order-information', { params })
// this.loading = false; .then((res) => {
if (res.data.result) { if (res.data.errorCode === 0) {
this.orderInfo = res.data.result; // this.loading = false;
if (res.data.result) {
this.orderInfo = res.data.result;
} else {
this.orderInfo = {};
}
} else { } else {
this.orderInfo = {}; this.$message.error(res.data.message);
} }
} else { });
this.$message.error(res.data.message);
}
});
} }
}, },
// 排序 // 排序
...@@ -580,25 +670,27 @@ export default { ...@@ -580,25 +670,27 @@ export default {
integralMallProId: this.integralMallProId ? this.integralMallProId : '', integralMallProId: this.integralMallProId ? this.integralMallProId : '',
}; };
this.loading = true; this.loading = true;
request.post('/api-integral-mall/page-undeliver', qs.stringify(params)).then(res => { request
if (res.data.errorCode === 0) { .post('/api-integral-mall/page-undeliver', qs.stringify(params))
if (res.data.result.rows) { .then((res) => {
this.tableData = res.data.result.rows; if (res.data.errorCode === 0) {
this.total = res.data.result.total; if (res.data.result.rows) {
for (const item of this.tableData) { this.tableData = res.data.result.rows;
if (item.sku) { this.total = res.data.result.total;
item.sku = JSON.parse(item.sku); for (const item of this.tableData) {
if (item.sku) {
item.sku = JSON.parse(item.sku);
}
} }
} else {
this.tableData = [];
this.total = 0;
} }
this.loading = false;
} else { } else {
this.tableData = []; this.$message.error(res.data.message);
this.total = 0;
} }
this.loading = false; });
} else {
this.$message.error(res.data.message);
}
});
}, },
// 关闭订单 // 关闭订单
// closeOrder(item) { // closeOrder(item) {
...@@ -612,7 +704,7 @@ export default { ...@@ -612,7 +704,7 @@ export default {
integralMallProExchangeId: item.integralMallProExchangeId, integralMallProExchangeId: item.integralMallProExchangeId,
optType: 4, optType: 4,
}; };
request.get('/api-integral-mall/order-opt', { params }).then(res => { request.get('/api-integral-mall/order-opt', { params }).then((res) => {
if (res.data.errorCode === 0) { if (res.data.errorCode === 0) {
this.$message.success('关闭订单成功'); this.$message.success('关闭订单成功');
this.getList(); this.getList();
...@@ -626,8 +718,8 @@ export default { ...@@ -626,8 +718,8 @@ export default {
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
/deep/.el-tabs__header .el-tabs__nav-wrap::after { /deep/.el-tabs__header .el-tabs__nav-wrap::after {
content: ""; content: "";
height: 1px!important; height: 1px !important;
} }
.m-r-10 { .m-r-10 {
margin-right: 10px; margin-right: 10px;
......
...@@ -871,11 +871,11 @@ export default { ...@@ -871,11 +871,11 @@ export default {
return; return;
} }
const data = this.natureMonth(this.beginTime, 3); const data = this.natureMonth(this.beginTime, 3);
this.endTime = this.endTime.split(' ')[0]; const endTimes = this.endTime.split(' ')[0];
// console.log(this.endTime.split(' '), 'iiii'); // console.log(this.endTime.split(' '), 'iiii');
// console.log(data, typeof data, '选择时间', this.endTime, typeof this.endTime); // console.log(data, typeof data, '选择时间', this.endTime, typeof this.endTime);
// console.log(new Date(data).getTime(), new Date(this.endTime).getTime()); // console.log(new Date(data).getTime(), new Date(this.endTime).getTime());
if (new Date(data).getTime() - 1 * 24 * 1000 < new Date(this.endTime).getTime()) { if (new Date(data).getTime() - 1 * 24 * 1000 < new Date(endTimes).getTime()) {
this.$message.error('导出订单不支持导出超过3个月时长的数据,请重新选择时间'); this.$message.error('导出订单不支持导出超过3个月时长的数据,请重新选择时间');
return; return;
} }
......
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