2 Commits

Author SHA1 Message Date
gyq
a282636266 1.新增订单手动退款 2.团购新增抖音团购核销 2024-07-19 16:31:40 +08:00
gyq
c155e8a805 新增抖音团购券核销 2024-07-17 18:02:01 +08:00
19 changed files with 534 additions and 97 deletions

View File

@@ -11,10 +11,6 @@ VITE_API_WSS = 'wss://cashier.sxczgkj.cn/client'
# 阿伟本地ws # 阿伟本地ws
# VITE_API_WSS = 'ws://192.168.2.17:9998/client' # VITE_API_WSS = 'ws://192.168.2.17:9998/client'
# 测试 php
# VITE_API_PHP_URL = 'http://192.168.2.33:1666/index.php/api'
# 正式 php # 正式 php
VITE_API_PHP_URL = 'http://czgdoumei.sxczgkj.com/index.php/api' VITE_API_PHP_URL = 'http://czgdoumei.sxczgkj.com/index.php/api'

View File

@@ -4,17 +4,8 @@ ENV = production
# 正式ws # 正式ws
VITE_API_WSS = 'wss://cashier.sxczgkj.cn/client' VITE_API_WSS = 'wss://cashier.sxczgkj.cn/client'
#测试ws
# VITE_API_WSS = 'wss://wxcashiertest.sxczgkj.cn/client'
# 测试 php
# VITE_API_PHP_URL = 'http://192.168.2.33:1666/index.php/api'
# 正式 php # 正式 php
VITE_API_PHP_URL = 'http://czgdoumei.sxczgkj.com/index.php/api' VITE_API_PHP_URL = 'http://czgdoumei.sxczgkj.com/index.php/api'
# 测试
# VITE_API_URL = 'https://cashier-client.sxczgkj.cn/cashier-client'
# 线上环境接口地址 # 线上环境接口地址
VITE_API_URL = 'https://cashierclient.sxczgkj.cn/cashier-client/' VITE_API_URL = 'https://cashierclient.sxczgkj.cn/cashier-client/'

17
.env.test Normal file
View File

@@ -0,0 +1,17 @@
# 线上环境
ENV = test
#测试ws
VITE_API_WSS = 'wss://wxcashiertest.sxczgkj.cn/client'
# 正式ws
# VITE_API_WSS = 'wss://cashier.sxczgkj.cn/client'
# 正式 php
VITE_API_PHP_URL = 'http://czgdoumei.sxczgkj.com/index.php/api'
# 测试
VITE_API_URL = 'https://cashier-client.sxczgkj.cn/cashier-client'
# 正式
# VITE_API_URL = 'https://cashierclient.sxczgkj.cn/cashier-client'

View File

@@ -1 +1,201 @@
"use strict";const o=require("path"),e=require("electron"),p=require("os");let i;e.app.whenReady().then(()=>{i=new e.BrowserWindow({title:"银收客",width:1024,height:768,fullscreenable:!0,fullscreen:!process.env.VITE_DEV_SERVER_URL,simpleFullscreen:!0,frame:!!process.env.VITE_DEV_SERVER_URL,webPreferences:{nodeIntegration:!0,contextIsolation:!1}}),process.env.VITE_DEV_SERVER_URL?i.loadURL(process.env.VITE_DEV_SERVER_URL):i.loadFile(o.resolve(__dirname,"../dist/index.html")),e.app.on("activate",()=>{e.BrowserWindow.getAllWindows().length===0&&createWindow()}),e.ipcMain.on("quitHandler",(n,t)=>{i=null,e.app.exit()}),e.ipcMain.on("getPrintList",()=>{i.webContents.getPrintersAsync().then(n=>{i.webContents.send("printList",n)})}),e.ipcMain.on("getOSmacSync",()=>{let n="";p.networkInterfaces().WLAN?(n=p.networkInterfaces().WLAN[0].mac,console.log("wlan.mac===",n)):(n=p.networkInterfaces().以太网[0].mac,console.log("以太网.mac===",n)),i.webContents.send("getOSmacRes",n)});const r=new e.BrowserWindow({show:!1,width:464,height:1726,webPreferences:{nodeIntegration:!0,contextIsolation:!1}});process.env.VITE_DEV_SERVER_URL?r.loadFile(o.join(__dirname,"../public/print.html")):r.loadFile(o.resolve(__dirname,"../dist/print.html")),e.ipcMain.on("printerInfoSync",(n,t)=>{r.webContents.send("getParams",t)}),e.ipcMain.on("printStart",(n,t)=>{console.log(t);let a=JSON.parse(t).deviceName;r.webContents.print({silent:!0,deviceName:a,pageSize:{width:58e3,height:216e3},scaleFactor:80,landscape:!1,margins:{marginType:"none",top:0,bottom:0,left:0,right:0},dpi:{horizontal:203,vertical:203}})});const s=new e.BrowserWindow({show:!1,width:464,height:1726,webPreferences:{nodeIntegration:!0,contextIsolation:!1}});process.env.VITE_DEV_SERVER_URL?s.loadFile(o.join(__dirname,"../public/work_print.html")):s.loadFile(o.resolve(__dirname,"../dist/work_print.html")),e.ipcMain.on("printerWorkSync",(n,t)=>{s.webContents.send("getParams",t)}),e.ipcMain.on("printWorkStart",(n,t)=>{let a=JSON.parse(t).deviceName;s.webContents.print({silent:!0,deviceName:a,pageSize:{width:58e3,height:216e3},scaleFactor:80,landscape:!1,margins:{marginType:"none",top:0,bottom:0,left:0,right:0},dpi:{horizontal:203,vertical:203}})});const l=new e.BrowserWindow({show:!1,width:360,height:240,webPreferences:{nodeIntegration:!0,contextIsolation:!1}});process.env.VITE_DEV_SERVER_URL?l.loadFile(o.join(__dirname,"../public/tag_print.html")):l.loadFile(o.resolve(__dirname,"../dist/tag_print.html")),e.ipcMain.on("printerTagSync",(n,t)=>{console.log(t),l.webContents.send("getParams",t)}),e.ipcMain.on("printTagStart",(n,t)=>{let a=JSON.parse(t).deviceName;l.webContents.print({silent:!0,deviceName:a,pageSize:{width:45e3,height:3e4},scaleFactor:80,landscape:!1,margins:{marginType:"none",top:0,bottom:0,left:0,right:0},dpi:{horizontal:203,vertical:203}})}),e.app.requestSingleInstanceLock()?e.app.on("second-instance",(n,t,c)=>{i&&(i.isMinimized()&&i.restore(),i.focus(),i.show())}):e.app.quit(),i.on("close",n=>{n.preventDefault(),i.webContents.send("showCloseDialog")})});e.app.on("window-all-closed",()=>{process.platform!=="darwin"&&e.app.quit()}); "use strict";
const path = require("path");
const electron = require("electron");
const os = require("os");
let win;
electron.app.whenReady().then(() => {
win = new electron.BrowserWindow({
title: "银收客",
width: 1024,
height: 768,
fullscreenable: true,
fullscreen: process.env.VITE_DEV_SERVER_URL ? false : true,
simpleFullscreen: true,
frame: process.env.VITE_DEV_SERVER_URL ? true : false,
webPreferences: {
// 集成网页和 Node.js也就是在渲染进程中可以调用 Node.js 方法
nodeIntegration: true,
contextIsolation: false
}
});
if (process.env.VITE_DEV_SERVER_URL) {
win.loadURL(process.env.VITE_DEV_SERVER_URL);
} else {
win.loadFile(path.resolve(__dirname, "../dist/index.html"));
}
electron.app.on("activate", () => {
if (electron.BrowserWindow.getAllWindows().length === 0) {
createWindow();
}
});
electron.ipcMain.on("quitHandler", (_, msg) => {
win = null;
electron.app.exit();
});
electron.ipcMain.on("getPrintList", () => {
win.webContents.getPrintersAsync().then((res) => {
win.webContents.send("printList", res);
});
});
electron.ipcMain.on("getOSmacSync", () => {
let mac = "";
if (os.networkInterfaces().WLAN) {
mac = os.networkInterfaces().WLAN[0].mac;
console.log("wlan.mac===", mac);
} else {
mac = os.networkInterfaces()["以太网"][0].mac;
console.log("以太网.mac===", mac);
}
win.webContents.send("getOSmacRes", mac);
});
const printWin = new electron.BrowserWindow({
show: false,
width: 464,
height: 1726,
webPreferences: {
// 集成网页和 Node.js也就是在渲染进程中可以调用 Node.js 方法
nodeIntegration: true,
contextIsolation: false
}
});
if (process.env.VITE_DEV_SERVER_URL) {
printWin.loadFile(path.join(__dirname, "../public/print.html"));
} else {
printWin.loadFile(path.resolve(__dirname, "../dist/print.html"));
}
electron.ipcMain.on("printerInfoSync", (event, arg) => {
printWin.webContents.send("getParams", arg);
});
electron.ipcMain.on("printStart", (event, arg) => {
console.log(arg);
const _parmas = JSON.parse(arg);
let name = _parmas.deviceName;
printWin.webContents.print({
silent: true,
deviceName: name,
pageSize: {
width: 58e3,
height: 216e3
},
scaleFactor: 80,
landscape: false,
margins: {
marginType: "none",
top: 0,
bottom: 0,
left: 0,
right: 0
},
dpi: {
horizontal: 203,
vertical: 203
}
});
});
const workPrintWin = new electron.BrowserWindow({
show: false,
width: 464,
height: 1726,
webPreferences: {
nodeIntegration: true,
contextIsolation: false
}
});
if (process.env.VITE_DEV_SERVER_URL) {
workPrintWin.loadFile(path.join(__dirname, "../public/work_print.html"));
} else {
workPrintWin.loadFile(path.resolve(__dirname, "../dist/work_print.html"));
}
electron.ipcMain.on("printerWorkSync", (event, arg) => {
workPrintWin.webContents.send("getParams", arg);
});
electron.ipcMain.on("printWorkStart", (event, arg) => {
const _parmas = JSON.parse(arg);
let name = _parmas.deviceName;
workPrintWin.webContents.print({
silent: true,
deviceName: name,
pageSize: {
width: 58e3,
height: 216e3
},
scaleFactor: 80,
landscape: false,
margins: {
marginType: "none",
top: 0,
bottom: 0,
left: 0,
right: 0
},
dpi: {
horizontal: 203,
vertical: 203
}
});
});
const tagPrintWin = new electron.BrowserWindow({
show: false,
width: 360,
height: 240,
webPreferences: {
nodeIntegration: true,
contextIsolation: false
}
});
if (process.env.VITE_DEV_SERVER_URL) {
tagPrintWin.loadFile(path.join(__dirname, "../public/tag_print.html"));
} else {
tagPrintWin.loadFile(path.resolve(__dirname, "../dist/tag_print.html"));
}
electron.ipcMain.on("printerTagSync", (event, arg) => {
console.log(arg);
tagPrintWin.webContents.send("getParams", arg);
});
electron.ipcMain.on("printTagStart", (event, arg) => {
const _parmas = JSON.parse(arg);
let name = _parmas.deviceName;
tagPrintWin.webContents.print({
silent: true,
deviceName: name,
pageSize: {
width: 45e3,
height: 3e4
},
scaleFactor: 80,
landscape: false,
margins: {
marginType: "none",
top: 0,
bottom: 0,
left: 0,
right: 0
},
dpi: {
horizontal: 203,
vertical: 203
}
});
});
const gotTheLock = electron.app.requestSingleInstanceLock();
if (!gotTheLock) {
electron.app.quit();
} else {
electron.app.on("second-instance", (event, commandLine, workingDirectory) => {
if (win) {
if (win.isMinimized())
win.restore();
win.focus();
win.show();
}
});
}
win.on("close", (e) => {
e.preventDefault();
win.webContents.send("showCloseDialog");
});
});
electron.app.on("window-all-closed", () => {
if (process.platform !== "darwin")
electron.app.quit();
});

View File

@@ -1,11 +1,12 @@
{ {
"name": "vite-electron", "name": "vite-electron",
"private": true, "private": true,
"version": "1.4.3", "version": "1.4.7",
"main": "dist-electron/main.js", "main": "dist-electron/main.js",
"scripts": { "scripts": {
"dev": "chcp 65001 && vite", "dev": "chcp 65001 && vite",
"build": "node ./addVersion.js && vite build && electron-builder", "build": "node ./addVersion.js && vite build && electron-builder",
"build:test": "vite build --mode test && electron-builder",
"preview": "vite preview", "preview": "vite preview",
"build:win": "node ./addVersion.js && vite build && electron-builder --w" "build:win": "node ./addVersion.js && vite build && electron-builder --w"
}, },

View File

@@ -171,8 +171,8 @@ const updateInfo = _.throttle(function () {
// let info = navigator.connection // let info = navigator.connection
console.log(isOnLine); console.log(isOnLine);
// console.log(info); // console.log(info);
if (store.userInfo && store.userInfo.shopId) { if (store.userInfo && store.userInfo.shopId) {
if (isOnLine) { if (isOnLine) {
console.log('有网了重新连接ws~'); console.log('有网了重新连接ws~');
socket.init(); socket.init();
} else { } else {
@@ -193,7 +193,6 @@ onMounted(() => {
} }
ipcRenderer.on('showCloseDialog', (event, arg) => { ipcRenderer.on('showCloseDialog', (event, arg) => {
console.log('阻止系统关闭软件');
ElMessageBox.confirm("确定要关闭软件吗?") ElMessageBox.confirm("确定要关闭软件吗?")
.then(() => { .then(() => {
ipcRenderer.send("quitHandler", "退出吧"); ipcRenderer.send("quitHandler", "退出吧");

View File

@@ -119,3 +119,29 @@ export function douyinfulfilmentcertificatecancel(data) {
data, data,
}); });
} }
/**
* 门店列表
* @param {*} data
* @returns
*/
export function douyinstorelist(data) {
return request_php({
method: "post",
url: "douyin/storelist",
data,
});
}
/**
* 绑定门店
* @param {*} data
* @returns
*/
export function douyinbindstore(data) {
return request_php({
method: "post",
url: "douyin/bindstore",
data,
});
}

View File

@@ -29,10 +29,10 @@ export function orderorderDetail(params) {
* @param {*} params * @param {*} params
* @returns * @returns
*/ */
export function payreturnOrder(data, pwd) { export function payreturnOrder(data, pwd, isOnline) {
return request({ return request({
method: "post", method: "post",
url: `pay/returnOrder?pwd=${pwd}`, url: `pay/returnOrder?pwd=${pwd}&isOnline=${isOnline}`,
data, data,
}); });
} }

View File

@@ -7,7 +7,7 @@ const service = axios.create({
baseURL: baseURL:
import.meta.env.MODE == "development" import.meta.env.MODE == "development"
? "/php/" ? "/php/"
: import.meta.env.VITE_API_URL, : import.meta.env.VITE_API_PHP_URL,
// withCredentials: true, // 跨域请求时发送 cookies // withCredentials: true, // 跨域请求时发送 cookies
timeout: 5000, // 请求超时 timeout: 5000, // 请求超时
}); });

View File

@@ -141,10 +141,10 @@ const deviceRoute = ref({
}); });
async function statusChange(e, item) { async function statusChange(e, item) {
console.log(e, item);
try { try {
await tbPrintMachinePost(item, "put"); await tbPrintMachinePost(item, "put");
tbPrintMachineGetAjax(); tbPrintMachineGetAjax();
printStore.init();
} catch (error) { } catch (error) {
console.log(error); console.log(error);
} }

View File

@@ -0,0 +1,104 @@
<template>
<el-dialog title="绑定门店" v-model="showDialog" width="80%">
<div class="dialog">
<div class="tips">注意门店绑定后无法更改请谨慎选择</div>
<el-table :data="tableData.list" height="240px" border v-loading="tableData.loading">
<el-table-column label="门店名称" prop="poi_name"></el-table-column>
<el-table-column label="门店地址" prop="address"></el-table-column>
<el-table-column label="操作" width="120px">
<template v-slot="scope">
<el-button type="primary" size="small"
@click="bindShopHandle(scope.row.poi_id)">选择门店</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination @current-change="paginationChange" :current-page="tableData.page"
:page-size="tableData.size" layout="total, prev, pager, next, jumper" :total="tableData.total"
background>
</el-pagination>
</div>
</div>
</el-dialog>
</template>
<script setup>
import { ElMessage } from 'element-plus'
import { onMounted, reactive, ref } from 'vue';
import { douyinstorelist, douyinbindstore } from '@/api/group.js'
const emits = defineEmits(['success'])
const showDialog = ref(false)
const tableData = reactive({
page: 1,
size: 10,
total: 0,
loading: false,
list: []
})
// 绑定门店
async function bindShopHandle(poi_id) {
try {
await douyinbindstore({
poi_id: poi_id
})
showDialog.value = false
ElMessage.success('绑定成功')
emits('success')
} catch (error) {
console.log(error);
}
}
// 分页变化
function paginationChange(e) {
tableData.page = e
getTableData()
}
// 获取门店列表
async function getTableData() {
try {
tableData.loading = true
const { list, count } = await douyinstorelist({
page: tableData.page,
size: tableData.size
})
tableData.loading = false
tableData.list = list
tableData.total = count
} catch (error) {
console.log(error);
}
}
// 显示
function show() {
showDialog.value = true;
getTableData()
}
defineExpose({
show
})
</script>
<style scoped lang="scss">
.tips {
color: var(--el-color-danger);
padding-bottom: 14px;
}
.pagination {
display: flex;
padding: 0 14px;
margin-top: 14px;
}
.dialog {
padding: 14px;
}
</style>

View File

@@ -2,7 +2,7 @@
<template> <template>
<div class="dialog"> <div class="dialog">
<el-dialog :title="`核销${props.title}团购券`" width="600" v-model="dialogVisible" @open="reset"> <el-dialog :title="`核销${props.title}团购券`" width="600" v-model="dialogVisible" @open="reset" @close="close">
<div class="content"> <div class="content">
<div class="left"> <div class="left">
<el-image :src="icon" style="width: 60px; height: 60px"></el-image> <el-image :src="icon" style="width: 60px; height: 60px"></el-image>
@@ -79,8 +79,7 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </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-if="props.type == 2">
@selection-change="douyinSelectionChange">
<el-table-column type="selection" width="55" /> <el-table-column type="selection" width="55" />
<el-table-column label="名称" prop="title"></el-table-column> <el-table-column label="名称" prop="title"></el-table-column>
<el-table-column label="价格" prop="amount"></el-table-column> <el-table-column label="价格" prop="amount"></el-table-column>
@@ -93,6 +92,7 @@
@click="groupOrdergroupScanHandle">确认核销</el-button> @click="groupOrdergroupScanHandle">确认核销</el-button>
</div> </div>
</el-dialog> </el-dialog>
<BindShop ref="BindShopRef" @success="submitHandle()" />
</div> </div>
</template> </template>
@@ -102,6 +102,8 @@ import { ref } from "vue";
import icon from "@/assets/icon_scan.png"; import icon from "@/assets/icon_scan.png";
import { groupOrderorderInfo, groupOrdergroupScan, douyinfulfilmentcertificateprepare, douyincertificateprepare } from '@/api/group' import { groupOrderorderInfo, groupOrdergroupScan, douyinfulfilmentcertificateprepare, douyincertificateprepare } from '@/api/group'
import { useUser } from "@/store/user.js"; import { useUser } from "@/store/user.js";
import BindShop from './bindShop.vue'
const BindShopRef = ref(null)
const store = useUser(); const store = useUser();
import { import {
queryMembermember, queryMembermember,
@@ -110,6 +112,10 @@ import {
accountPaymember, accountPaymember,
} from "@/api/member/index.js"; } from "@/api/member/index.js";
import { ElMessage } from "element-plus"; import { ElMessage } from "element-plus";
import { useGlobal } from '@/store/global.js'
const global = useGlobal()
const emits = defineEmits(["success"]); const emits = defineEmits(["success"]);
const props = defineProps({ const props = defineProps({
@@ -151,13 +157,20 @@ async function groupOrdergroupScanHandle() {
break; break;
case 2: case 2:
{ {
groupDetailLoading.value = true let encrypted_codes = douyin_table.value.getSelectionRows()
let encrypted_codes = groupDetail.value.goods.map(item => item.encrypted_code) if (encrypted_codes.length) {
const res = await douyincertificateprepare({ groupDetailLoading.value = true
verify_token: groupDetail.value.verify_token, let arr = encrypted_codes.map(item => item.encrypted_code)
encrypted_codes: encrypted_codes.join(','), console.log(encrypted_codes);
id: groupDetail.value.id const res = await douyincertificateprepare({
}) verify_token: groupDetail.value.verify_token,
encrypted_codes: arr.join(','),
id: groupDetail.value.id
})
} else {
ElMessage.error('请选择核销项目')
return
}
} }
break; break;
default: default:
@@ -171,17 +184,12 @@ async function groupOrdergroupScanHandle() {
emits('succcess') emits('succcess')
} catch (error) { } catch (error) {
groupDetailLoading.value = false groupDetailLoading.value = false
console.log(error); console.log('groupOrdergroupScanHandle.error', error);
} }
} }
const douyin_table = ref(null) const douyin_table = ref(null)
// 选择要核销的券
function douyinSelectionChange(e) {
console.log(e);
}
// 核销券码 // 核销券码
async function submitHandle() { async function submitHandle() {
try { try {
@@ -202,6 +210,7 @@ async function submitHandle() {
const res = await douyinfulfilmentcertificateprepare({ const res = await douyinfulfilmentcertificateprepare({
object_id: decodeURI(scanCode.value), object_id: decodeURI(scanCode.value),
}); });
dialogVisible.value = false
loading.value = false loading.value = false
groupDetail.value = res groupDetail.value = res
detailVisible.value = true detailVisible.value = true
@@ -217,7 +226,10 @@ async function submitHandle() {
} }
} catch (error) { } catch (error) {
loading.value = false loading.value = false
console.log(error); console.log('submitHandle.error', error);
if (error.code == 4399) {
BindShopRef.value.show()
}
} }
} }
@@ -255,6 +267,7 @@ const inputChange = _.debounce(function (e) {
}, 500); }, 500);
function show() { function show() {
global.updateData(false)
dialogVisible.value = true; dialogVisible.value = true;
setTimeout(() => { setTimeout(() => {
inputRef.value.focus(); inputRef.value.focus();
@@ -262,6 +275,7 @@ function show() {
} }
function close() { function close() {
global.updateData(true)
dialogVisible.value = false; dialogVisible.value = false;
} }
@@ -274,6 +288,7 @@ defineExpose({
show, show,
close, close,
loading, loading,
submitHandle
}); });
</script> </script>

View File

@@ -3,7 +3,7 @@
<div class="cart_wrap card"> <div class="cart_wrap card">
<div class="header"> <div class="header">
<div class="left"> <div class="left">
<el-select v-model="tableData.type" placeholder="核销类型"> <el-select v-model="tableData.type" placeholder="核销类型" @change="typeChange">
<el-option v-for="item in typeList" :key="item.value" :value="item.value" <el-option v-for="item in typeList" :key="item.value" :value="item.value"
:label="item.label"></el-option> :label="item.label"></el-option>
</el-select> </el-select>
@@ -79,14 +79,16 @@
<template v-slot="scope"> <template v-slot="scope">
<div class="goods_list"> <div class="goods_list">
<div class="row" v-for="item in scope.row.douyinCodeGoods" :key="item.id"> <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;"> <div class="item" style="width: 240px;">
{{ item.title }} {{ item.title }}
</div> </div>
<div class="item" style="flex: 1;margin-right: 10px;color: var(--primary-color);"> <div class="item" style="width: 100px;color: var(--primary-color);">
{{ item.pay_amount }} {{ item.pay_amount }}
</div> </div>
<div class="item" style="margin-right: 10px;"> <div class="item"
<el-tag type="success" disable-transitions size="default" effect="light" round> style="margin-right: 10px;display: flex;justify-content: flex-end;">
<el-tag :type="typeStatus(item.status)" disable-transitions size="default"
effect="light" round>
{{ item.status_text }} {{ item.status_text }}
</el-tag> </el-tag>
</div> </div>
@@ -101,9 +103,9 @@
</el-table> </el-table>
</div> </div>
<div class="pagination"> <div class="pagination">
<el-pagination @current-change="paginationChange" :current-page="tableData.page" <el-pagination v-model:current-page="tableData.page" v-model:page-size="tableData.size"
:page-size="tableData.size" layout="total, prev, pager, next, jumper" :total="tableData.total" layout="total, prev, pager, next" :total="tableData.total" background
background> @current-change="paginationChange" @size-change="paginationChange">
</el-pagination> </el-pagination>
</div> </div>
</div> </div>
@@ -121,6 +123,7 @@ import { ref, onMounted, reactive } from 'vue'
import scanGroup from './components/scanGroup.vue' import scanGroup from './components/scanGroup.vue'
import refundDialog from './components/refundDialog.vue' import refundDialog from './components/refundDialog.vue'
import { useUser } from "@/store/user.js" import { useUser } from "@/store/user.js"
import BindShop from './components/bindShop.vue'
const store = useUser() const store = useUser()
import { useGlobal } from '@/store/global.js' import { useGlobal } from '@/store/global.js'
@@ -129,10 +132,19 @@ const global = useGlobal()
const scanGroupRef = ref(null) const scanGroupRef = ref(null)
const refundDialogRef = ref(null) const refundDialogRef = ref(null)
function typeStatus(t) {
const m = {
0: 'warning',
1: 'success',
2: 'danger'
}
return m[t]
}
const tableData = reactive({ const tableData = reactive({
resetLoading: false, resetLoading: false,
proName: '', proName: '',
type: 1, type: 2,
status: '', status: '',
loading: false, loading: false,
list: [], list: [],
@@ -162,7 +174,8 @@ const typeList = reactive([
} }
]) ])
const statusList = reactive([ // 本店团购订单状态
const originStatus = [
{ {
value: 'unpaid', value: 'unpaid',
label: '待付款' label: '待付款'
@@ -187,16 +200,51 @@ const statusList = reactive([
value: 'cancelled', value: 'cancelled',
label: '已取消' label: '已取消'
} }
]) ]
// 抖音美团
const dmStatus = [
{
value: 0,
label: '等待验券'
},
{
value: 1,
label: '成功'
},
{
value: 2,
label: '失败'
}
]
const statusList = ref([])
// 切换筛选条件
function typeChange(e) {
switch (e) {
case 1:
statusList.value = [...originStatus]
break;
case 2:
statusList.value = [...dmStatus]
break;
default:
break;
}
tableData.status = ''
tableData.page = 1
tableData.list = []
groupOrderlistAjax()
}
// 状态 // 状态
function statusFilter(t) { function statusFilter(t) {
return statusList.find(item => item.value == t)?.label return originStatus.find(item => item.value == t)?.label
} }
// 分页变化 // 分页变化
function paginationChange(e) { function paginationChange(e) {
tableData.page = e
groupOrderlistAjax() groupOrderlistAjax()
} }
@@ -243,7 +291,9 @@ async function groupOrderlistAjax() {
case 2: case 2:
// 获取抖音团购数据 // 获取抖音团购数据
res = await douyinorderlist({ res = await douyinorderlist({
page: tableData.page page: tableData.page,
status: tableData.status,
d_order_id: tableData.proName
}) })
tableData.resetLoading = false tableData.resetLoading = false
tableData.loading = false tableData.loading = false
@@ -260,7 +310,7 @@ async function groupOrderlistAjax() {
} }
onMounted(() => { onMounted(() => {
groupOrderlistAjax() typeChange(tableData.type)
}) })
</script> </script>

View File

@@ -12,19 +12,23 @@
<el-text class="t">{{ masterId }}</el-text> <el-text class="t">{{ masterId }}</el-text>
</div> </div>
<div class="select_user" @click="fastCashierRef.show()" v-if="!memberInfo.telephone"> <div class="select_user" @click="fastCashierRef.show()" v-if="!memberInfo.telephone">
<el-icon class="icon"> <div class="left">
<WalletFilled /> <el-icon class="icon">
</el-icon> <WalletFilled />
<el-text class="t">快捷收银</el-text> </el-icon>
<el-text class="t">快捷收银</el-text>
</div>
<el-icon class="arrow"> <el-icon class="arrow">
<ArrowRight /> <ArrowRight />
</el-icon> </el-icon>
</div> </div>
<div class="select_user" v-else @click="clearMember"> <div class="select_user" v-else @click="clearMember">
<el-icon class="icon"> <div class="left">
<UserFilled /> <el-icon class="icon">
</el-icon> <UserFilled />
<el-text class="t">{{ memberInfo.telephone }}</el-text> </el-icon>
<el-text class="t">{{ memberInfo.telephone }}</el-text>
</div>
<el-icon class="arrow"> <el-icon class="arrow">
<Close /> <Close />
</el-icon> </el-icon>
@@ -418,7 +422,7 @@ onMounted(() => {
.menu { .menu {
background-color: var(--el-color-warning); background-color: var(--el-color-warning);
color: #fff; color: #fff;
width: 100px; width: 60px;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
@@ -437,7 +441,7 @@ onMounted(() => {
} }
.number { .number {
flex: 1; width: 50px;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
@@ -450,24 +454,31 @@ onMounted(() => {
} }
.select_user { .select_user {
flex: 1;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between;
background-color: var(--el-color-info-light-8); background-color: var(--el-color-info-light-8);
padding: 0 var(--el-font-size-base); padding: 0 var(--el-font-size-base);
.icon { .left {
color: var(--el-color-primary); display: flex;
font-size: 18px; align-items: center;
}
.t { .icon {
font-size: var(--el-font-size-base); color: var(--el-color-primary);
padding: 0 10px; font-size: 20px;
}
.t {
font-size: var(--el-font-size-base);
margin-left: 4px;
}
} }
.arrow { .arrow {
color: #999; color: #999;
font-size: 20px; font-size: 16px;
position: relative; position: relative;
top: 2px; top: 2px;
} }

View File

@@ -22,7 +22,16 @@
<el-input v-model="form.loginName" placeholder="请输入11位手机号码"></el-input> <el-input v-model="form.loginName" placeholder="请输入11位手机号码"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="登录密码" prop="password"> <el-form-item label="登录密码" prop="password">
<el-input v-model="form.password" type="password" placeholder="请输入登录密码"></el-input> <el-input v-model="form.password" :type="passwordType" placeholder="请输入登录密码">
<template #suffix>
<el-icon class="el-input__icon" v-if="passwordType == 'password'" @click="passwordType = 'text'">
<Hide />
</el-icon>
<el-icon class="el-input__icon" v-else @click="passwordType = 'password'">
<View />
</el-icon>
</template>
</el-input>
</el-form-item> </el-form-item>
<!-- <el-form-item> <!-- <el-form-item>
<div style="width: 100%; display: flex; justify-content: flex-end"> <div style="width: 100%; display: flex; justify-content: flex-end">
@@ -54,7 +63,8 @@
import packageData from "../../package.json"; import packageData from "../../package.json";
import logo from "@/assets/logo.png"; import logo from "@/assets/logo.png";
import { ElMessage, ElMessageBox } from "element-plus"; import { ElMessage, ElMessageBox } from "element-plus";
import { reactive, ref } from "vue"; import { Hide, View } from '@element-plus/icons-vue'
import { onMounted, reactive, ref } from "vue";
import { useRouter } from "vue-router"; import { useRouter } from "vue-router";
import { ipcRenderer } from "electron"; import { ipcRenderer } from "electron";
import { RandomNumBoth } from "@/utils"; import { RandomNumBoth } from "@/utils";
@@ -69,6 +79,7 @@ const socket = useSocket();
const router = useRouter(); const router = useRouter();
const formRef = ref(null); const formRef = ref(null);
const loading = ref(false); const loading = ref(false);
const passwordType = ref('password')
const form = reactive({ const form = reactive({
serialNumber: RandomNumBoth(1000, 9999), serialNumber: RandomNumBoth(1000, 9999),
@@ -110,12 +121,6 @@ const submitHandle = () => {
store store
.userlogin(form) .userlogin(form)
.then(async (res) => { .then(async (res) => {
// const douyin = await douyincheckIn({
// token: res.token,
// loginName: res.loginName,
// clientType: 'pc'
// })
// useStorage.set('douyin', douyin.userInfo)
ElMessage.success("登录成功"); ElMessage.success("登录成功");
socket.init(); socket.init();
setTimeout(() => { setTimeout(() => {
@@ -123,6 +128,12 @@ const submitHandle = () => {
name: "home", name: "home",
}); });
}, 1000); }, 1000);
const douyin = await douyincheckIn({
token: res.token,
loginName: res.loginName,
clientType: 'pc'
})
useStorage.set('douyin', douyin.userInfo)
}) })
.catch((err) => { .catch((err) => {
loading.value = false; loading.value = false;
@@ -138,6 +149,10 @@ const logout = () => {
}) })
.catch(() => { }); .catch(() => { });
}; };
onMounted(() => {
passwordType.icon = Hide
})
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">

View File

@@ -15,8 +15,10 @@
<div v-else style="width: 100%; text-align: center; margin: 30px 0"> <div v-else style="width: 100%; text-align: center; margin: 30px 0">
暂无数据 暂无数据
</div> </div>
<el-pagination background v-if="ordereData.list.length" layout="prev, pager, next" <el-pagination background v-if="ordereData.list.length" v-model:current-page="ordereData.page"
style="margin-top: 20px" :total="Number(ordereData.total)" @current-change="handleCurrentChange" /> v-model:page-size="ordereData.size" :page-sizes="[10, 30, 50, 100]" layout="prev, pager, next"
style="margin-top: 20px" :total="Number(ordereData.total)" @size-change="handleCurrentChange"
@current-change="handleCurrentChange" />
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="销售" name="closed"> <el-tab-pane label="销售" name="closed">
<add :loading="ordereData.loading" :ordereData="ordereData" @emititemboxshow="emititemboxshow" <add :loading="ordereData.loading" :ordereData="ordereData" @emititemboxshow="emititemboxshow"
@@ -25,8 +27,10 @@
<div v-else style="width: 100%; text-align: center; margin: 30px 0"> <div v-else style="width: 100%; text-align: center; margin: 30px 0">
暂无数据 暂无数据
</div> </div>
<el-pagination v-if="ordereData.list.length" background layout="prev, pager, next" <el-pagination background v-if="ordereData.list.length" v-model:current-page="ordereData.page"
style="margin-top: 20px" :total="Number(ordereData.total)" @current-change="handleCurrentChange" /> v-model:page-size="ordereData.size" :page-sizes="[10, 30, 50, 100]" layout="prev, pager, next"
style="margin-top: 20px" :total="Number(ordereData.total)" @size-change="handleCurrentChange"
@current-change="handleCurrentChange" />
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="退单" name="refund"> <el-tab-pane label="退单" name="refund">
<add :loading="ordereData.loading" :ordereData="ordereData" @emititemboxshow="emititemboxshow" <add :loading="ordereData.loading" :ordereData="ordereData" @emititemboxshow="emititemboxshow"
@@ -35,8 +39,10 @@
<div v-else style="width: 100%; text-align: center; margin: 30px 0"> <div v-else style="width: 100%; text-align: center; margin: 30px 0">
暂无数据 暂无数据
</div> </div>
<el-pagination v-if="ordereData.list.length" background layout="prev, pager, next" <el-pagination background v-if="ordereData.list.length" v-model:current-page="ordereData.page"
style="margin-top: 20px" :total="Number(ordereData.total)" @current-change="handleCurrentChange" /> v-model:page-size="ordereData.size" :page-sizes="[10, 30, 50, 100]" layout="prev, pager, next"
style="margin-top: 20px" :total="Number(ordereData.total)" @size-change="handleCurrentChange"
@current-change="handleCurrentChange" />
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="快捷收银" name="cash"> <el-tab-pane label="快捷收银" name="cash">
<cashTable /> <cashTable />
@@ -251,9 +257,12 @@
¥{{ refundamount > 0 ? refundamount : "0.00" }} ¥{{ refundamount > 0 ? refundamount : "0.00" }}
</div> </div>
</div> </div>
<div class="recharge_footer_itemright_botton_boxtow" style="margin-right: 10px;">
<el-button style="width: 100%; height: 100%" @click="payreturnOrderclick(false)">手动退款</el-button>
</div>
<div class="recharge_footer_itemright_botton_boxtow"> <div class="recharge_footer_itemright_botton_boxtow">
<el-button type="primary" style="width: 100%; height: 100%" :loading="buttonloading" <el-button type="primary" style="width: 100%; height: 100%" :loading="buttonloading"
@click="payreturnOrderclick"> @click="payreturnOrderclick(true)">
<span v-if="!buttonloading">支付退回</span> <span v-if="!buttonloading">支付退回</span>
<span v-else>支付退回...</span> <span v-else>支付退回...</span>
</el-button> </el-button>
@@ -322,9 +331,12 @@ const buttonloading = ref(); //loading
function dateConfirm(time) { function dateConfirm(time) {
ordereData.startTime = time[0] ordereData.startTime = time[0]
ordereData.endTime = time[1] ordereData.endTime = time[1]
ordereData.page = 1
asyncorderfindOrder(); asyncorderfindOrder();
} }
// 是否线上退款
const isOnline = ref(true)
// 获取支付密码 // 获取支付密码
async function passwordSuccess(pwd) { async function passwordSuccess(pwd) {
try { try {
@@ -345,7 +357,7 @@ async function passwordSuccess(pwd) {
}); });
if (arr.length != 0) { if (arr.length != 0) {
// await payreturnOrder(arr, md5(pwd)); // await payreturnOrder(arr, md5(pwd));
await payreturnOrder(arr, ''); await payreturnOrder(arr, '', isOnline.value);
changechecked.value = false; changechecked.value = false;
recharge.value = false; recharge.value = false;
itemboxshow.value = false; itemboxshow.value = false;
@@ -355,7 +367,7 @@ async function passwordSuccess(pwd) {
asyncorderfindOrder(); asyncorderfindOrder();
} else { } else {
buttonloading.value = false; buttonloading.value = false;
ElMessage.error("没有退款项目!"); ElMessage.error("没有退款项目!");
} }
} catch (error) { } catch (error) {
buttonloading.value = false; buttonloading.value = false;
@@ -363,7 +375,9 @@ async function passwordSuccess(pwd) {
} }
const payreturnOrderclick = lodash.debounce( const payreturnOrderclick = lodash.debounce(
async () => { async (e) => {
console.log(e);
isOnline.value = e
//搜索手机号 //搜索手机号
if (refundamount.value == 0) { if (refundamount.value == 0) {
buttonloading.value = false; buttonloading.value = false;
@@ -866,19 +880,13 @@ onMounted(() => {
position: relative; position: relative;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center;
.recharge_footer_itemright_botton_boxoneabsolute { .recharge_footer_itemright_botton_boxoneabsolute {
position: absolute;
top: 0;
left: 0;
color: #c0c0c0; color: #c0c0c0;
} }
.recharge_footer_itemright_botton_boxonetext { .recharge_footer_itemright_botton_boxonetext {
font-size: 26px; font-size: 26px;
height: 60px;
line-height: 60px;
} }
} }

View File

@@ -30,7 +30,7 @@
</template> </template>
<script setup> <script setup>
import { ref, defineEmits } from 'vue' import { ref } from 'vue'
const emit = defineEmits(['close']) const emit = defineEmits(['close'])

View File

@@ -215,6 +215,7 @@ const exit = async () => {
// useStorage.clear() // useStorage.clear()
useStorage.del('userInfo') useStorage.del('userInfo')
useStorage.del('token') useStorage.del('token')
useStorage.del('douyin')
ElMessage.success("交班成功"); ElMessage.success("交班成功");
setTimeout(() => { setTimeout(() => {
router.replace({ router.replace({

View File

@@ -34,5 +34,8 @@ export default defineConfig(({ command, mode }) => {
"@": path.resolve(__dirname, "./src"), "@": path.resolve(__dirname, "./src"),
}, },
}, },
esbuild: {
drop: ["console"],
},
}; };
}); });