对接支付优惠

This commit is contained in:
gyq
2025-03-11 09:10:49 +08:00
parent 5cf2355d28
commit 3df0cce9ec
31 changed files with 1527 additions and 846 deletions

View File

@@ -18,7 +18,7 @@
<div class="box_content_left_top_item">
<div class="box_content_left_top_item_top">
<div style="color:#ff5252; font-size: 30px;">
{{ infoData.orderNum || 0 }}
{{ infoData.orderCount || 0 }}
</div>
<div style="margin-top: 6px; color: #666;">
总订单
@@ -26,7 +26,7 @@
</div>
<div class="box_content_left_top_item_top">
<div style="color:#ff5252; font-size: 30px;">
{{ formatDecimal(infoData.amount || 0) }}
{{ formatDecimal(infoData.handAmount || 0) }}
</div>
<div style="margin-top: 6px; color: #666;">
营业额
@@ -47,7 +47,7 @@
</div>
<div class="box_content_left_top_item_botton">
<div style=" font-size: 20px;">
{{ formatDecimal(infoData.returnAmount || 0) }}
{{ formatDecimal(infoData.refundAmount || 0) }}
</div>
<div style="margin-top: 6px;">
退款金额
@@ -59,7 +59,7 @@
</div>
</div>
<div class="box_content_left_bottom">
<el-table :data="infoData.detailList" border style="width: 100%;" height="360px">
<el-table :data="infoData.detailList" border style="width: 100%;" height="382px">
<el-table-column prop="productName" label="商品名称" />
<el-table-column prop="skuName" label="规格名称" />
<el-table-column prop="num" label="商品数量" />
@@ -73,6 +73,14 @@
</div>
<div class="box_content_right">
<div class="top">
<div class="box_content_right_tiem">
<div class="box_content_right_tiemleft">
店铺
</div>
<div class="box_content_right_tiemright">
{{ infoData.shopName }}
</div>
</div>
<div class="box_content_right_tiem">
<div class="box_content_right_tiemleft">
上岗时间
@@ -86,38 +94,39 @@
交班时间
</div>
<div class="box_content_right_tiemright">
{{ dayjs(infoData.loginOutTime).format("YYYY-MM-DD HH:mm:ss") }}
{{ dayjs(infoData.handoverTime).format("YYYY-MM-DD HH:mm:ss") }}
</div>
</div>
<div class="box_content_right_tiem">
<!-- <div class="box_content_right_tiem">
<div class="box_content_right_tiemleft">
终端名称
</div>
<div class="box_content_right_tiemright">
{{ infoData.equipment || '无' }}
</div>
</div>
<div class="box_content_right_tiem">
</div> -->
<!-- <div class="box_content_right_tiem">
<div class="box_content_right_tiemleft">
备用金
</div>
<div class="box_content_right_tiemright">
{{ infoData.pettyCash || '无' }}
</div>
</div>
</div> -->
<div class="box_content_right_tiem">
<div class="box_content_right_tiemleft">
收营员
</div>
<div class="box_content_right_tiemright">
{{ infoData.userName || '无' }}
{{ infoData.staffName || '无' }}
</div>
</div>
</div>
<div class="footer">
<div class="is_shop">
<div class="button">
<el-checkbox v-model="isPrint" border label="是否打印商品销售数据" style="width: 100%" />
<el-checkbox v-model="isPrint" :true-value="1" :false-value="0" border
label="是否打印商品销售数据" style="width: 100%" />
</div>
</div>
<div class="box_content_right_tiembutton" :loading="loading" @click="exit">
@@ -133,40 +142,29 @@
</template>
<script setup>
import { ipcRenderer } from "electron";
import { ref, onMounted } from 'vue'
import { useRoute } from 'vue-router'
import { ref } from 'vue'
import { ElMessage, dayjs } from 'element-plus'
import { tglogout } from '@/api/group.js'
import { shopInfoqueryDuty, loginlogout, handoverData, handoverprint } from '@/api/work/index.js'
import useStorage from '@/utils/useStorage'
import { handoverTotal, handover, handoverData, handoverNetworkPrint } from '@/api/account.js'
import { useRouter } from "vue-router";
import { bySubType } from "@/api/device";
import { useUser } from "@/store/user.js";
import { useSocket } from "@/store/socket.js";
import { formatDecimal } from '@/utils/index.js'
import { usePrint } from "@/store/print.js";
import { staffPermission } from '@/api/user.js'
const printStore = usePrint();
const socket = useSocket();
const store = useUser();
const router = useRouter();
const dialogVisible = ref(false) //交班
//详情数据
const infoData = ref({})
const loading = ref(false);
const isPrint = ref(true)
const isPrint = ref(1)
// 查看交班记录
async function checkRecord() {
try {
const res = await staffPermission('yun_xu_cha_kan_suo_you_jiao_ban_ji_lu')
// await staffPermission('yun_xu_cha_kan_suo_you_jiao_ban_ji_lu')
router.push('/workrecord')
} catch (error) {
console.log(error);
@@ -176,84 +174,46 @@ async function checkRecord() {
// 开始交班
const exit = async () => {
try {
await staffPermission('yun_xu_jiao_ban')
let data = {}
// 获取交班打印小票数据
data = await handoverData({
id: infoData.value.id
})
// await staffPermission('yun_xu_jiao_ban')
const res = await handover(isPrint.value)
const data = await handoverData(res)
if (printStore.deviceNoteList.length) {
loading.value = true;
// 使用本地打印机 打印交班数据
data.printTime = dayjs().format('YYYY-MM-DD HH:mm:ss')
data.printShop = isPrint.value
printStore.printWork(data)
// return
await loginlogout({
status: 1
})
useStorage.del('userInfo')
useStorage.del('token')
useStorage.del('douyin')
useStorage.del('categorysActive')
useStorage.del('updateFlag')
ElMessage.success("交班成功");
setTimeout(() => {
router.replace({
name: "login",
});
}, 1000);
loading.value = false;
} else {
console.log('云打印交班数据');
loading.value = true;
await tglogout()
// 退出登录
await loginlogout({
status: 1
})
// 打印交班数据
await handoverprint({
id: infoData.value.id,
isprintProduct: isPrint.value
})
// useStorage.clear()
useStorage.del('userInfo')
useStorage.del('token')
useStorage.del('douyin')
useStorage.del('categorysActive')
useStorage.del('updateFlag')
ElMessage.success("交班成功");
setTimeout(() => {
router.replace({
name: "login",
});
}, 1000);
loading.value = false;
// 使用云打印机 打印交班数据
await handoverNetworkPrint(data.id)
}
socket.close()
logoutHandle()
} catch (error) {
console.log(error);
loading.value = false;
}
}
// 退出登录
async function logoutHandle() {
try {
loading.value = true;
await store.logout()
ElMessage.success("交班成功");
setTimeout(() => {
router.replace({
name: "login",
});
}, 1000);
} catch (error) {
console.log('退出失败');
}
loading.value = false;
}
// 获取交班打印数据前置
const infoshopInfoqueryDutys = async () => {
try {
let res = await shopInfoqueryDuty({
page: 1,
pageSize: 10
})
let res = await handoverTotal()
infoData.value = res
} catch (error) {
console.log(error);
@@ -269,11 +229,6 @@ function show() {
defineExpose({
show
})
onMounted(() => {
// getPrintList()
// bySubTypeAjax()
})
</script>
<style scoped lang="scss">
@@ -286,7 +241,7 @@ onMounted(() => {
justify-content: space-between;
align-items: center;
background: #fff;
padding: 6px 10px;
padding: 10px;
border-radius: 6px;
color: #161718;
text-decoration: none;

View File

@@ -1,75 +1,75 @@
<template>
<div class="box">
<div class="box_top" @click="clickrecord">
<div class="box_top_left" @click="router.back()">
<el-icon size="20">
<ArrowLeft />
</el-icon>
<div class="box_top_right">
交班记录
<div class="contenr_wrap" style="flex: 1;">
<div class="box">
<div class="box_top" @click="clickrecord">
<div class="box_top_left" @click="router.back()">
<el-icon size="20">
<ArrowLeft />
</el-icon>
<div class="box_top_right">
交班记录
</div>
</div>
</div>
</div>
<div class="box_content">
<div class="box_content_left">
<div class="box_content_left_top">
<div class="box_content_left_top_item">
<div class="box_content_left_top_item_top">
<div>
{{ infoData.total }}
<div class="box_content">
<div class="box_content_left">
<div class="box_content_left_top">
<div class="box_content_left_top_item">
<div class="box_content_left_top_item_top">
<div>
{{ infoData.total }}
</div>
<div>
交班数
</div>
</div>
<div>
交班数
</div>
</div>
<div class="box_content_left_top_item_top">
<div>
{{ infoData.amount }}
</div>
<div>
总收款
<div class="box_content_left_top_item_top">
<div>
{{ infoData.amount }}
</div>
<div>
总收款
</div>
</div>
</div>
</div>
</div>
<div class="box_content_left_bouttom">
<div class="box_content_left_bouttomox">
<div class="box_content_left_bouttom_item" v-for="(item, index) in infoData.pageInfo.list"
:key="index">
<div class="wbox_content_left_bouttom_item_top">
<div>
{{ dayjs(item.loginTime).format("YYYY-MM-DD HH:mm:ss") }}
<div class="box_content_left_bouttom">
<div class="box_content_left_bouttomox">
<div class="box_content_left_bouttom_item" v-for="(item, index) in infoData.list"
:key="index">
<div class="wbox_content_left_bouttom_item_top">
<div>
{{ item.loginTime }}
</div>
<div>
{{ item.handAmount }}
</div>
</div>
<div>
{{ item.amount }}
<div class="wbox_content_left_bouttom_item_topone">
<div style="display: flex;">
<span>收营员</span>
<span style="font-weight: bold;">{{ item.staffName }}</span>
</div>
<div style="display: flex;">
<span>总订单数</span>
<span style="font-weight: bold;">{{ item.orderCount }}</span>
</div>
</div>
</div>
<div class="wbox_content_left_bouttom_item_topone">
<div style="display: flex;">
<span>收营员</span>
<span style="font-weight: bold;">{{ item.userName }}</span>
</div>
<div style="display: flex;">
<span>总订单数</span>
<span style="font-weight: bold;">{{ item.orderNum }}</span>
</div>
</div>
<div class="wbox_content_left_bouttom_item_topone">
<div style="display: flex;">
<span>起止时间</span>
<span style="font-weight: bold;"> {{
dayjs(item.loginTime).format("YYYY-MM-DD HH:mm:ss") }}</span>
</div>
<div style="display: flex;">
<span>备用金</span>
<span style="font-weight: bold;">{{ item.pettyCash }}</span>
<div class="wbox_content_left_bouttom_item_topone">
<div style="display: flex;">
<span>起止时间</span>
<span style="font-weight: bold;"> {{ item.loginTime }}</span>
</div>
<div style="display: flex;">
<span>挂账金额</span>
<span style="font-weight: bold;">{{ item.creditAmount }}</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- <div class="box_content_right">
<!-- <div class="box_content_right">
<div class="box_content_right_tiem">
<div class="box_content_right_tiemleft">
上岗时间
@@ -114,36 +114,43 @@
关班/退出
</div>
</div> -->
</div>
</div>
</div>
</template>
<script setup>
import { ref, onMounted } from 'vue'
import { reactive, onMounted } from 'vue'
import { useRouter } from 'vue-router'
import { shopinfoqueryDutyFlow } from '@/api/work/index.js'
import { handoverRecordPage } from '@/api/account.js'
import { useUser } from "@/store/user.js"
import { ElMessage, dayjs } from 'element-plus'
const router = useRouter()
const store = useUser()
const record = ref(true)//交班记录
//详情数据
const infoData = ref({
pageInfo: {
list: []
}
const infoData = reactive({
list: [],
total: 0,
amount: 0
})
// 获取交班总记录
const infoshopInfoqueryDuty = async () => {
let res = await shopinfoqueryDutyFlow({
shopId: store.userInfo.shopId,
let res = await handoverRecordPage({
page: 1,
pageSize: 10
size: 99999
})
infoData.value = res
console.log(infoData.value)
infoData.list = res.records
infoData.total = +res.totalRow
let amount = 0
res.records.map(item => {
amount += item.handAmount
})
infoData.amount = amount
}
onMounted(() => {
infoshopInfoqueryDuty()
@@ -152,7 +159,7 @@ onMounted(() => {
<style scoped lang="scss">
.box {
width: 100%;
width: 100vw;
padding: 16px;
height: 100vh;
background-color: #efefef;
@@ -162,8 +169,8 @@ onMounted(() => {
justify-content: space-between;
align-items: center;
background: #fff;
padding: 6px 10px;
border-radius: 6px;
padding: 10px;
border-radius: 10px;
/* 取消下划线效果 */
.box_top_left {
@@ -191,7 +198,7 @@ onMounted(() => {
background: #fff;
width: 100%;
height: 100%;
border-radius: 6px;
border-radius: 10px;
// padding: 30px 20px;
.box_content_left_top {