新增抖音团购核销

This commit is contained in:
gyq
2024-07-01 09:41:33 +08:00
parent 105ad4ee52
commit 78672a0cf9
11 changed files with 513 additions and 51 deletions

View File

@@ -3,6 +3,10 @@
<div class="cart_wrap card">
<div class="header">
<div class="left">
<el-select v-model="tableData.type" placeholder="核销类型">
<el-option v-for="item in typeList" :key="item.value" :value="item.value"
:label="item.label"></el-option>
</el-select>
<el-input placeholder="搜索订单" v-model="tableData.proName" @focus="
global.updateData(false)" @blur="global.updateData(true)"></el-input>
<el-select v-model="tableData.status" placeholder="订单状态">
@@ -15,10 +19,11 @@
@click="resetHandle">重置</el-button>
</div>
</div>
<el-button type="warning" :icon="MagicStick" @click="scanGroupRef.show()">核销团购券</el-button>
<el-button type="warning" :icon="FullScreen" @click="scanGroupRef.show()">核销团购券</el-button>
</div>
<div class="tab_container">
<el-table :data="tableData.list" height="540px" v-loading="tableData.loading">
<el-table :data="tableData.list" height="540px" v-loading="tableData.loading"
v-if="tableData.type == 1">
<el-table-column label="订单号" prop="orderNo" width="100px"></el-table-column>
<el-table-column label="优惠卷" prop="proImg" width="200px">
<template v-slot="scope">
@@ -62,6 +67,38 @@
</template>
</el-table-column>
</el-table>
<el-table :data="tableData.list" height="540px" v-loading="tableData.loading"
v-if="tableData.type == 2">
<el-table-column label="抖音订单号" prop="d_order_id" width="240"></el-table-column>
<el-table-column label="总金额" prop="pay_amount" width="100">
<template v-slot="scope">
<span style="color: var(--primary-color);">{{ scope.row.pay_amount }}</span>
</template>
</el-table-column>
<el-table-column label="商品信息" prop="douyinCodeGoods">
<template v-slot="scope">
<div class="goods_list">
<div class="row" v-for="item in scope.row.douyinCodeGoods" :key="item.id">
<div class="item" style="flex: 1;white-space: nowrap;margin-right: 10px;">
{{ item.title }}
</div>
<div class="item" style="flex: 1;margin-right: 10px;color: var(--primary-color);">
{{ item.pay_amount }}
</div>
<div class="item" style="margin-right: 10px;">
<el-tag type="success" disable-transitions size="default" effect="light" round>
{{ item.status_text }}
</el-tag>
</div>
<div class="item" style="flex: 1;display: flex;justify-content: flex-end;">
<el-button type="danger" size="small" v-if="item.is_show_cacel_banner"
@click="cacelDouyinHandle(item)">撤销</el-button>
</div>
</div>
</div>
</template>
</el-table-column>
</el-table>
</div>
<div class="pagination">
<el-pagination @current-change="paginationChange" :current-page="tableData.page"
@@ -70,14 +107,16 @@
</el-pagination>
</div>
</div>
<scanGroup ref="scanGroupRef" @succcess="groupOrderlistAjax" />
<scanGroup ref="scanGroupRef" :title="typeList.find(item => item.value == tableData.type).label"
:type="tableData.type" @succcess="groupOrderlistAjax" />
<refundDialog ref="refundDialogRef" @success="groupOrderlistAjax" />
</div>
</template>
<script setup>
import { groupOrderlist } from '@/api/group'
import { Search, RefreshRight, MagicStick } from '@element-plus/icons-vue'
import { groupOrderlist, douyinorderlist, douyinfulfilmentcertificatecancel } from '@/api/group'
import { Search, RefreshRight, FullScreen } from '@element-plus/icons-vue'
import { ElMessageBox, ElMessage } from 'element-plus'
import { ref, onMounted, reactive } from 'vue'
import scanGroup from './components/scanGroup.vue'
import refundDialog from './components/refundDialog.vue'
@@ -93,6 +132,7 @@ const refundDialogRef = ref(null)
const tableData = reactive({
resetLoading: false,
proName: '',
type: 2,
status: '',
loading: false,
list: [],
@@ -110,6 +150,18 @@ function payTypeFilter(t) {
return m[t]
}
// 订单类型
const typeList = reactive([
{
value: 1,
label: '自营'
},
{
value: 2,
label: '抖音'
}
])
const statusList = reactive([
{
value: 'unpaid',
@@ -157,21 +209,50 @@ function resetHandle() {
groupOrderlistAjax()
}
// 显示团购核销撤销
function cacelDouyinHandle(item) {
ElMessageBox.confirm(
'是否撤销该团购?',
'注意').then(async () => {
await douyinfulfilmentcertificatecancel({ verify_id: item.verify_id, certificate_id: item.certificate_id })
ElMessage.success('撤销成功')
groupOrderlistAjax()
}).catch(() => { })
}
// 获取团购订单数据
async function groupOrderlistAjax() {
try {
tableData.loading = true
const res = await groupOrderlist({
shopId: store.userInfo.shopId,
proName: tableData.proName,
status: tableData.status,
page: tableData.page,
size: tableData.size
})
tableData.resetLoading = false
tableData.loading = false
tableData.list = res.list
tableData.total = res.total
let res = ''
switch (tableData.type) {
case 1:
// 获取本店团购数据
res = await groupOrderlist({
shopId: store.userInfo.shopId,
proName: tableData.proName,
status: tableData.status,
page: tableData.page,
size: tableData.size
})
tableData.resetLoading = false
tableData.loading = false
tableData.list = res.list
tableData.total = res.total
break;
case 2:
// 获取抖音团购数据
res = await douyinorderlist({
page: tableData.page
})
tableData.resetLoading = false
tableData.loading = false
tableData.list = res.list
tableData.total = res.count
break;
default:
break;
}
} catch (error) {
tableData.loading = false
console.log(error);
@@ -336,4 +417,15 @@ onMounted(() => {
}
}
}
.goods_list {
.row {
display: flex;
align-items: center;
&:not(:first-child) {
margin-top: 10px;
}
}
}
</style>