1.交班新增选择是否打印商品销售数据
This commit is contained in:
@@ -2,12 +2,12 @@
|
||||
<el-drawer size="100%" :with-header="false" direction="btt" v-model="dialogVisible">
|
||||
<div class="box">
|
||||
<div class="box_top">
|
||||
<router-link to="/" class="box_top_left">
|
||||
<div class="box_top_left" @click="dialogVisible = false">
|
||||
<el-icon size="20">
|
||||
<ArrowLeft />
|
||||
</el-icon>
|
||||
<div style="margin-left: 10px;">返回</div>
|
||||
</router-link>
|
||||
</div>
|
||||
<router-link to='/workrecord' class="box_top_right">
|
||||
交班记录
|
||||
</router-link>
|
||||
@@ -26,7 +26,7 @@
|
||||
</div>
|
||||
<div class="box_content_left_top_item_top">
|
||||
<div style="color:#ff5252; font-size: 30px;">
|
||||
{{ infoData.amount || 0 }}
|
||||
¥{{ formatDecimal(infoData.amount || 0) }}
|
||||
</div>
|
||||
<div style="margin-top: 6px; color: #666;">
|
||||
营业额
|
||||
@@ -36,83 +36,95 @@
|
||||
<div class="box_content_left_top_item">
|
||||
<div class="box_content_left_top_item_botton">
|
||||
<div style=" font-size: 20px;">
|
||||
{{ infoData.cashAmount || 0 }}
|
||||
¥{{ formatDecimal(infoData.cashAmount || 0) }}
|
||||
</div>
|
||||
<div style="margin-top: 6px;">
|
||||
现金支付
|
||||
</div>
|
||||
<div style="margin-top: 6px;font-size: 14px;">
|
||||
<!-- <div style="margin-top: 6px;font-size: 14px;">
|
||||
查看详情
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
<div class="box_content_left_top_item_botton">
|
||||
<div style=" font-size: 20px;">
|
||||
{{ infoData.returnAmount || 0 }}
|
||||
¥{{ formatDecimal(infoData.returnAmount || 0) }}
|
||||
</div>
|
||||
<div style="margin-top: 6px;">
|
||||
退款金额
|
||||
</div>
|
||||
<div style="margin-top: 6px;font-size: 14px;">
|
||||
<!-- <div style="margin-top: 6px;font-size: 14px;">
|
||||
查看详情
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box_content_left_bottom">
|
||||
<el-table :data="infoData.detailList" style="width: 100%;" height="400px">
|
||||
<el-table :data="infoData.detailList" border style="width: 100%;" height="360px">
|
||||
<el-table-column prop="productName" label="商品名称" />
|
||||
<el-table-column prop="skuName" label="规格名称" />
|
||||
<el-table-column prop="num" label="商品数量" />
|
||||
<el-table-column prop="amount" label="商品金额" />
|
||||
<el-table-column prop="amount" label="商品金额">
|
||||
<template v-slot="scope">
|
||||
¥{{ formatDecimal(scope.row.amount || 0) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box_content_right">
|
||||
<div class="box_content_right_tiem">
|
||||
<div class="box_content_right_tiemleft">
|
||||
上岗时间:
|
||||
<div class="top">
|
||||
<div class="box_content_right_tiem">
|
||||
<div class="box_content_right_tiemleft">
|
||||
上岗时间:
|
||||
</div>
|
||||
<div class="box_content_right_tiemright">
|
||||
{{ dayjs(infoData.loginTime).format("YYYY-MM-DD HH:mm:ss") }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="box_content_right_tiemright">
|
||||
{{ dayjs(infoData.loginTime).format("YYYY-MM-DD HH:mm:ss") }}
|
||||
<div class="box_content_right_tiem">
|
||||
<div class="box_content_right_tiemleft">
|
||||
交班时间:
|
||||
</div>
|
||||
<div class="box_content_right_tiemright">
|
||||
{{ dayjs(infoData.loginOutTime).format("YYYY-MM-DD HH:mm:ss") }}
|
||||
</div>
|
||||
</div>
|
||||
<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 class="box_content_right_tiemleft">
|
||||
备用金:
|
||||
</div>
|
||||
<div class="box_content_right_tiemright">
|
||||
{{ infoData.pettyCash || '无' }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="box_content_right_tiem">
|
||||
<div class="box_content_right_tiemleft">
|
||||
收营员:
|
||||
</div>
|
||||
<div class="box_content_right_tiemright">
|
||||
{{ infoData.userName || '无' }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box_content_right_tiem">
|
||||
<div class="box_content_right_tiemleft">
|
||||
交班时间:
|
||||
<div class="footer">
|
||||
<div class="is_shop">
|
||||
<div class="button">
|
||||
<el-checkbox v-model="isPrint" border label="是否打印商品销售数据" style="width: 100%" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="box_content_right_tiemright">
|
||||
{{ dayjs(infoData.loginOutTime).format("YYYY-MM-DD HH:mm:ss") }}
|
||||
<div class="box_content_right_tiembutton" :loading="loading" @click="exit">
|
||||
<span v-if="!loading">交班/关班</span>
|
||||
<span v-else>交班/关班中....</span>
|
||||
</div>
|
||||
</div>
|
||||
<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 class="box_content_right_tiemleft">
|
||||
备用金:
|
||||
</div>
|
||||
<div class="box_content_right_tiemright">
|
||||
{{ infoData.pettyCash || '无' }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="box_content_right_tiem">
|
||||
<div class="box_content_right_tiemleft">
|
||||
收营员:
|
||||
</div>
|
||||
<div class="box_content_right_tiemright">
|
||||
{{ infoData.userName || '无' }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="box_content_right_tiembutton" :loading="loading" @click="exit">
|
||||
<span v-if="!loading">交班/关班</span>
|
||||
<span v-else>交班/关班中....</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -122,23 +134,23 @@
|
||||
|
||||
<script setup>
|
||||
import { ipcRenderer } from "electron";
|
||||
|
||||
import { ref, onMounted } from 'vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { ElMessage, dayjs } from 'element-plus'
|
||||
import { shopInfoqueryDuty, loginlogout, handoverData } from '@/api/work/index.js'
|
||||
import { shopInfoqueryDuty, loginlogout, handoverData, handoverprint } from '@/api/work/index.js'
|
||||
import useStorage from '@/utils/useStorage'
|
||||
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'
|
||||
const socket = useSocket();
|
||||
|
||||
const store = useUser();
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
const dialogVisible = ref(true) //交班
|
||||
const dialogVisible = ref(false) //交班
|
||||
//详情数据
|
||||
const infoData = ref({})
|
||||
const loading = ref(false);
|
||||
@@ -146,6 +158,8 @@ const loading = ref(false);
|
||||
const printList = ref([]);
|
||||
const localPrintList = ref([])
|
||||
|
||||
const isPrint = ref(true)
|
||||
|
||||
// 获取打印机状态
|
||||
async function bySubTypeAjax() {
|
||||
try {
|
||||
@@ -188,6 +202,7 @@ function checkLocalPrint(deviceName) {
|
||||
const exit = async () => {
|
||||
try {
|
||||
if (printList.value.length) {
|
||||
console.log('本地打印');
|
||||
if (!checkLocalPrint(printList.value[0].config.deviceName)) {
|
||||
loading.value = true;
|
||||
let res = await loginlogout({
|
||||
@@ -196,6 +211,7 @@ const exit = async () => {
|
||||
// useStorage.clear()
|
||||
useStorage.del('userInfo')
|
||||
useStorage.del('token')
|
||||
useStorage.del('douyin')
|
||||
ElMessage.success("交班成功");
|
||||
setTimeout(() => {
|
||||
router.replace({
|
||||
@@ -225,13 +241,24 @@ const exit = async () => {
|
||||
loading.value = false;
|
||||
}
|
||||
} else {
|
||||
console.log('云打印');
|
||||
loading.value = true;
|
||||
let res = await loginlogout({
|
||||
|
||||
// 退出登录
|
||||
await loginlogout({
|
||||
status: 1
|
||||
})
|
||||
|
||||
// 打印交班数据
|
||||
await handoverprint({
|
||||
id: infoData.value.id,
|
||||
isprintProduct: isPrint.value
|
||||
})
|
||||
|
||||
// useStorage.clear()
|
||||
useStorage.del('userInfo')
|
||||
useStorage.del('token')
|
||||
useStorage.del('douyin')
|
||||
ElMessage.success("交班成功");
|
||||
setTimeout(() => {
|
||||
router.replace({
|
||||
@@ -245,6 +272,8 @@ const exit = async () => {
|
||||
loading.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
// 获取交班打印数据前置
|
||||
const infoshopInfoqueryDutys = async () => {
|
||||
try {
|
||||
let res = await shopInfoqueryDuty({
|
||||
@@ -253,14 +282,23 @@ const infoshopInfoqueryDutys = async () => {
|
||||
})
|
||||
infoData.value = res
|
||||
} catch (error) {
|
||||
|
||||
console.log(error);
|
||||
}
|
||||
|
||||
}
|
||||
onMounted(() => {
|
||||
getPrintList()
|
||||
bySubTypeAjax()
|
||||
|
||||
function show() {
|
||||
dialogVisible.value = true
|
||||
infoshopInfoqueryDutys()
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
show
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
// getPrintList()
|
||||
// bySubTypeAjax()
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -311,7 +349,6 @@ onMounted(() => {
|
||||
.box_content_left_top {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
border-bottom: 1px solid #ccc;
|
||||
padding-bottom: 20px;
|
||||
|
||||
.box_content_left_top_item {
|
||||
@@ -361,21 +398,17 @@ onMounted(() => {
|
||||
.box_content_right {
|
||||
width: 30%;
|
||||
height: 100%;
|
||||
background: #fff;
|
||||
margin-left: 10px;
|
||||
border-radius: 6px;
|
||||
padding: 10px 12px;
|
||||
position: relative;
|
||||
|
||||
.box_content_right_tiem:nth-child(1) {
|
||||
margin-top: 0;
|
||||
}
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 10px;
|
||||
|
||||
.box_content_right_tiem {
|
||||
margin-top: 10px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 10px;
|
||||
|
||||
.box_content_right_tiemleft {
|
||||
color: #9e9e9e;
|
||||
@@ -384,11 +417,7 @@ onMounted(() => {
|
||||
}
|
||||
|
||||
.box_content_right_tiembutton {
|
||||
position: absolute;
|
||||
bottom: 10px;
|
||||
left: 5%;
|
||||
background: #ba5050;
|
||||
width: 90%;
|
||||
border-radius: 5px;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
@@ -399,4 +428,44 @@ onMounted(() => {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.top {
|
||||
flex: 1;
|
||||
background-color: #fff;
|
||||
padding: 10px 0;
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
.footer {
|
||||
padding: 10px;
|
||||
background: #fff;
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
.is_shop {
|
||||
.button {
|
||||
flex: 1;
|
||||
margin-bottom: 10px;
|
||||
|
||||
:deep(.el-checkbox.el-checkbox--large) {
|
||||
height: var(--el-component-size-large);
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
:deep(.el-checkbox__inner) {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
|
||||
&::after {
|
||||
border-width: 2px;
|
||||
top: 0;
|
||||
left: 4px;
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.el-checkbox__label) {
|
||||
font-size: var(--el-font-size-base) !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user