对接支付优惠

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;