Commit 1c7c96ea by caoyanzhi

update: 卡券状态调整

parent a501c482
......@@ -136,8 +136,8 @@
prop="status"
label="状态"
>
<template slot-scope="scope">
<span v-if="scope.row.status === -1">所有</span>
<div slot-scope="scope" v-html="formatStatus(scope.row)">
<!-- <span v-if="scope.row.status === -1">所有</span>
<span v-if="scope.row.status === 3">待领取</span>
<span v-if="scope.row.status === 4">待使用</span>
<span v-if="scope.row.status === 5">已使用</span>
......@@ -145,8 +145,8 @@
<span v-if="scope.row.status === 7">已销毁</span>
<span v-if="scope.row.status === 8">已占用</span>
<span v-if="scope.row.status === 9">转赠中</span>
<span v-if="scope.row.status === 10">已转赠</span>
</template>
<span v-if="scope.row.status === 10">已转赠</span> -->
</div>
</el-table-column>
<el-table-column
prop="saleAmount"
......@@ -358,6 +358,30 @@ export default {
};
},
methods: {
formatStatus(row) {
let _content = '';
const { status } = row;
console.log(row)
let isOverdue = Date.now() >= row.limitTime;
if (status == 3) {
_content = `<div class="${isOverdue ? 'dm-status--info' : 'dm-status--error'}">${isOverdue ? '已过期' : '待领取'}</div>`;
} else if (status == 4) {
_content = `<div class="${isOverdue ? 'dm-status--info' : 'dm-status--primary'}">${isOverdue ? '已过期' : '待使用'}</div>`;
} else if (status == 5) {
_content = `<div class="dm-status--warning">已使用</div>`;
} else if (status == 6) {
_content = `<div class="dm-status--info">已过期</div>`;
} else if (status == 7) {
_content = `<div class="dm-status--error">已销毁</div>`;
} else if (status == 8) {
_content = `<div class="dm-status--info">已占用</div>`;
} else if (status == 9) {
_content = `<div class="dm-status--warning">转赠中</div>`;
} else if (status == 10) {
_content = `<div class="dm-status--info">已转赠</div>`;
}
return _content;
},
// 销核数据条件插件
checkOrder() {
doFetch(url.checkCard, {
......
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