1.新增套餐商品
This commit is contained in:
@@ -79,7 +79,7 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-table ref="douyin_table" :data="groupDetail.goods" border v-if="props.type == 2">
|
||||
<el-table ref="douyin_table" :data="groupDetail.goods" border v-else>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column label="名称" prop="title"></el-table-column>
|
||||
<el-table-column label="价格" prop="amount"></el-table-column>
|
||||
@@ -100,7 +100,7 @@
|
||||
import _ from "lodash";
|
||||
import { ref } from "vue";
|
||||
import icon from "@/assets/icon_scan.png";
|
||||
import { groupOrderorderInfo, groupOrdergroupScan, douyinfulfilmentcertificateprepare, douyincertificateprepare } from '@/api/group'
|
||||
import { groupOrderorderInfo, groupOrdergroupScan, douyinfulfilmentcertificateprepare, douyincertificateprepare, thirdPartyCoupon_list, certificateprepare } from '@/api/group'
|
||||
import { useUser } from "@/store/user.js";
|
||||
import BindShop from './bindShop.vue'
|
||||
const BindShopRef = ref(null)
|
||||
@@ -173,6 +173,23 @@ async function groupOrdergroupScanHandle() {
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
// 美团团购
|
||||
{
|
||||
let encrypted_codes = douyin_table.value.getSelectionRows()
|
||||
if (encrypted_codes.length) {
|
||||
groupDetailLoading.value = true
|
||||
let arr = encrypted_codes.map(item => item.encrypted_code)
|
||||
const res = await certificateprepare({
|
||||
couponCode: groupDetail.value.couponCode,
|
||||
num: encrypted_codes.length
|
||||
})
|
||||
} else {
|
||||
ElMessage.error('请选择核销项目')
|
||||
return
|
||||
}
|
||||
}
|
||||
break
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -221,6 +238,23 @@ async function submitHandle() {
|
||||
}, 100)
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
{
|
||||
const res = await thirdPartyCoupon_list({
|
||||
shopId: store.userInfo.shopId,
|
||||
code: scanCode.value
|
||||
});
|
||||
dialogVisible.value = false
|
||||
loading.value = false
|
||||
groupDetail.value = res
|
||||
detailVisible.value = true
|
||||
setTimeout(() => {
|
||||
groupDetail.value.goods.map(item => {
|
||||
douyin_table.value.toggleRowSelection(item)
|
||||
})
|
||||
}, 100)
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
@click="resetHandle">重置</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<el-button type="warning" :icon="FullScreen" @click="scanGroupRef.show()">核销团购券</el-button>
|
||||
<el-button type="warning" :icon="FullScreen" @click="showScanModalHandle">核销团购券</el-button>
|
||||
</div>
|
||||
<div class="tab_container">
|
||||
<el-table :data="tableData.list" height="540px" v-loading="tableData.loading"
|
||||
@@ -101,6 +101,24 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-table height="540px" :data="tableData.list" v-loading="tableData.loading"
|
||||
v-if="tableData.type == 3">
|
||||
<el-table-column label="名称" prop="dealTitle"></el-table-column>
|
||||
<el-table-column label="总金额" prop="couponBuyPrice" width="100">
|
||||
<template v-slot="scope">
|
||||
<span style="color: var(--primary-color);">¥{{ scope.row.couponBuyPrice }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" prop="couponStatusDesc" width="150"></el-table-column>
|
||||
<el-table-column label="使用时间" prop="couponUseTime" width="200"></el-table-column>
|
||||
<el-table-column label="操作" prop="douyinCodeGoods" width="100">
|
||||
<template v-slot="scope">
|
||||
<el-button type="danger" size="small" @click="cacelMeittuanHandle(scope.row)">
|
||||
撤销
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="pagination">
|
||||
<el-pagination v-model:current-page="tableData.page" v-model:page-size="tableData.size"
|
||||
@@ -112,11 +130,22 @@
|
||||
<scanGroup ref="scanGroupRef" :title="typeList.find(item => item.value == tableData.type).label"
|
||||
:type="tableData.type" @succcess="groupOrderlistAjax" />
|
||||
<refundDialog ref="refundDialogRef" @success="groupOrderlistAjax" />
|
||||
<el-dialog v-model="showMeituanUrlModal" title="注意">
|
||||
<span style="font-size: 18px;">您的店铺还未绑定美团,请绑定后操作!</span>
|
||||
<template #footer>
|
||||
<div class="dialog-footer" style="padding: 0 15px 15px;">
|
||||
<el-button @click="showMeituanUrlModal = false">取消</el-button>
|
||||
<el-button type="primary" @click="openMeituan">
|
||||
去绑定
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { groupOrderlist, douyinorderlist, douyinfulfilmentcertificatecancel } from '@/api/group'
|
||||
import { groupOrderlist, douyinorderlist, douyinfulfilmentcertificatecancel, thirdPartyCoupon_state, thirdPartyCoupon_bindUrl, meituan_orderlist, meituan_fulfilmentcertificatecancel } from '@/api/group'
|
||||
import { Search, RefreshRight, FullScreen } from '@element-plus/icons-vue'
|
||||
import { ElMessageBox, ElMessage } from 'element-plus'
|
||||
import { ref, onMounted, reactive } from 'vue'
|
||||
@@ -124,6 +153,7 @@ import scanGroup from './components/scanGroup.vue'
|
||||
import refundDialog from './components/refundDialog.vue'
|
||||
import { useUser } from "@/store/user.js"
|
||||
import BindShop from './components/bindShop.vue'
|
||||
import { shell } from 'electron'
|
||||
const store = useUser()
|
||||
|
||||
import { useGlobal } from '@/store/global.js'
|
||||
@@ -144,7 +174,7 @@ function typeStatus(t) {
|
||||
const tableData = reactive({
|
||||
resetLoading: false,
|
||||
proName: '',
|
||||
type: 2,
|
||||
type: 3,
|
||||
status: '',
|
||||
loading: false,
|
||||
list: [],
|
||||
@@ -171,6 +201,10 @@ const typeList = reactive([
|
||||
{
|
||||
value: 2,
|
||||
label: '抖音'
|
||||
},
|
||||
{
|
||||
value: 3,
|
||||
label: '美团'
|
||||
}
|
||||
])
|
||||
|
||||
@@ -229,6 +263,10 @@ function typeChange(e) {
|
||||
case 2:
|
||||
statusList.value = [...dmStatus]
|
||||
break;
|
||||
case 3:
|
||||
statusList.value = [...dmStatus]
|
||||
thirdPartyCoupon_state_ajax()
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -238,6 +276,54 @@ function typeChange(e) {
|
||||
groupOrderlistAjax()
|
||||
}
|
||||
|
||||
// 获取美团绑定状态
|
||||
const meituanStatus = ref(false)
|
||||
async function thirdPartyCoupon_state_ajax() {
|
||||
try {
|
||||
const res = await thirdPartyCoupon_state({
|
||||
shopId: store.userInfo.shopId
|
||||
})
|
||||
if (res.status == 0) {
|
||||
meituanStatus.value = false
|
||||
showMeituanUrlModal.value = true
|
||||
thirdPartyCoupon_bindUrl_ajax()
|
||||
} else {
|
||||
meituanStatus.value = true
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
}
|
||||
|
||||
// 获取美团绑定链接
|
||||
const meituanURL = ref('')
|
||||
const showMeituanUrlModal = ref(false)
|
||||
async function thirdPartyCoupon_bindUrl_ajax() {
|
||||
try {
|
||||
const res = await thirdPartyCoupon_bindUrl({
|
||||
shopId: store.userInfo.shopId
|
||||
})
|
||||
meituanURL.value = res
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
}
|
||||
|
||||
// 确认打开绑定美团链接
|
||||
function openMeituan() {
|
||||
showMeituanUrlModal.value = false
|
||||
shell.openExternal(meituanURL.value);
|
||||
}
|
||||
|
||||
function showScanModalHandle() {
|
||||
// 若果是美团并且没有绑定,则需要先绑定
|
||||
if (tableData.type == 3 && !meituanStatus.value) {
|
||||
showMeituanUrlModal.value = true
|
||||
return
|
||||
}
|
||||
scanGroupRef.value.show()
|
||||
}
|
||||
|
||||
// 状态
|
||||
function statusFilter(t) {
|
||||
return originStatus.find(item => item.value == t)?.label
|
||||
@@ -268,6 +354,21 @@ function cacelDouyinHandle(item) {
|
||||
}).catch(() => { })
|
||||
}
|
||||
|
||||
// 显示美团团购撤销
|
||||
function cacelMeittuanHandle(item) {
|
||||
ElMessageBox.confirm(
|
||||
'是否撤销该团购?',
|
||||
'注意').then(async () => {
|
||||
try {
|
||||
await meituan_fulfilmentcertificatecancel({ couponCode: item.couponCode })
|
||||
ElMessage.success('撤销成功')
|
||||
groupOrderlistAjax()
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
}).catch(() => { })
|
||||
}
|
||||
|
||||
// 获取团购订单数据
|
||||
async function groupOrderlistAjax() {
|
||||
try {
|
||||
@@ -300,6 +401,19 @@ async function groupOrderlistAjax() {
|
||||
tableData.list = res.list
|
||||
tableData.total = res.count
|
||||
break;
|
||||
case 3:
|
||||
// 获取美团购数据
|
||||
res = await meituan_orderlist({
|
||||
page: tableData.page,
|
||||
// status: tableData.status,
|
||||
// d_order_id: tableData.proName,
|
||||
date: ''
|
||||
})
|
||||
tableData.resetLoading = false
|
||||
tableData.loading = false
|
||||
tableData.list = res.list
|
||||
tableData.total = res.count
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user