Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a282636266 | |||
| c155e8a805 |
@@ -11,10 +11,6 @@ VITE_API_WSS = 'wss://cashier.sxczgkj.cn/client'
|
||||
# 阿伟本地ws
|
||||
# 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
|
||||
VITE_API_PHP_URL = 'http://czgdoumei.sxczgkj.com/index.php/api'
|
||||
|
||||
|
||||
@@ -4,17 +4,8 @@ ENV = production
|
||||
# 正式ws
|
||||
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
|
||||
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/'
|
||||
17
.env.test
Normal file
17
.env.test
Normal 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'
|
||||
@@ -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();
|
||||
});
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
{
|
||||
"name": "vite-electron",
|
||||
"private": true,
|
||||
"version": "1.4.3",
|
||||
"version": "1.4.7",
|
||||
"main": "dist-electron/main.js",
|
||||
"scripts": {
|
||||
"dev": "chcp 65001 && vite",
|
||||
"build": "node ./addVersion.js && vite build && electron-builder",
|
||||
"build:test": "vite build --mode test && electron-builder",
|
||||
"preview": "vite preview",
|
||||
"build:win": "node ./addVersion.js && vite build && electron-builder --w"
|
||||
},
|
||||
|
||||
@@ -171,8 +171,8 @@ const updateInfo = _.throttle(function () {
|
||||
// let info = navigator.connection
|
||||
console.log(isOnLine);
|
||||
// console.log(info);
|
||||
if (store.userInfo && store.userInfo.shopId) {
|
||||
if (isOnLine) {
|
||||
if (store.userInfo && store.userInfo.shopId) {
|
||||
if (isOnLine) {
|
||||
console.log('有网了重新连接ws~');
|
||||
socket.init();
|
||||
} else {
|
||||
@@ -193,7 +193,6 @@ onMounted(() => {
|
||||
}
|
||||
|
||||
ipcRenderer.on('showCloseDialog', (event, arg) => {
|
||||
console.log('阻止系统关闭软件');
|
||||
ElMessageBox.confirm("确定要关闭软件吗?")
|
||||
.then(() => {
|
||||
ipcRenderer.send("quitHandler", "退出吧");
|
||||
|
||||
@@ -119,3 +119,29 @@ export function douyinfulfilmentcertificatecancel(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,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -29,10 +29,10 @@ export function orderorderDetail(params) {
|
||||
* @param {*} params
|
||||
* @returns
|
||||
*/
|
||||
export function payreturnOrder(data, pwd) {
|
||||
export function payreturnOrder(data, pwd, isOnline) {
|
||||
return request({
|
||||
method: "post",
|
||||
url: `pay/returnOrder?pwd=${pwd}`,
|
||||
url: `pay/returnOrder?pwd=${pwd}&isOnline=${isOnline}`,
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ const service = axios.create({
|
||||
baseURL:
|
||||
import.meta.env.MODE == "development"
|
||||
? "/php/"
|
||||
: import.meta.env.VITE_API_URL,
|
||||
: import.meta.env.VITE_API_PHP_URL,
|
||||
// withCredentials: true, // 跨域请求时发送 cookies
|
||||
timeout: 5000, // 请求超时
|
||||
});
|
||||
|
||||
@@ -141,10 +141,10 @@ const deviceRoute = ref({
|
||||
});
|
||||
|
||||
async function statusChange(e, item) {
|
||||
console.log(e, item);
|
||||
try {
|
||||
await tbPrintMachinePost(item, "put");
|
||||
tbPrintMachineGetAjax();
|
||||
printStore.init();
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
|
||||
104
src/views/group_buy/components/bindShop.vue
Normal file
104
src/views/group_buy/components/bindShop.vue
Normal 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>
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
<template>
|
||||
<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="left">
|
||||
<el-image :src="icon" style="width: 60px; height: 60px"></el-image>
|
||||
@@ -79,8 +79,7 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-table ref="douyin_table" :data="groupDetail.goods" border v-if="props.type == 2"
|
||||
@selection-change="douyinSelectionChange">
|
||||
<el-table ref="douyin_table" :data="groupDetail.goods" border v-if="props.type == 2">
|
||||
<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>
|
||||
@@ -93,6 +92,7 @@
|
||||
@click="groupOrdergroupScanHandle">确认核销</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<BindShop ref="BindShopRef" @success="submitHandle()" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -102,6 +102,8 @@ import { ref } from "vue";
|
||||
import icon from "@/assets/icon_scan.png";
|
||||
import { groupOrderorderInfo, groupOrdergroupScan, douyinfulfilmentcertificateprepare, douyincertificateprepare } from '@/api/group'
|
||||
import { useUser } from "@/store/user.js";
|
||||
import BindShop from './bindShop.vue'
|
||||
const BindShopRef = ref(null)
|
||||
const store = useUser();
|
||||
import {
|
||||
queryMembermember,
|
||||
@@ -110,6 +112,10 @@ import {
|
||||
accountPaymember,
|
||||
} from "@/api/member/index.js";
|
||||
import { ElMessage } from "element-plus";
|
||||
|
||||
import { useGlobal } from '@/store/global.js'
|
||||
const global = useGlobal()
|
||||
|
||||
const emits = defineEmits(["success"]);
|
||||
|
||||
const props = defineProps({
|
||||
@@ -151,13 +157,20 @@ async function groupOrdergroupScanHandle() {
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
groupDetailLoading.value = true
|
||||
let encrypted_codes = groupDetail.value.goods.map(item => item.encrypted_code)
|
||||
const res = await douyincertificateprepare({
|
||||
verify_token: groupDetail.value.verify_token,
|
||||
encrypted_codes: encrypted_codes.join(','),
|
||||
id: groupDetail.value.id
|
||||
})
|
||||
let encrypted_codes = douyin_table.value.getSelectionRows()
|
||||
if (encrypted_codes.length) {
|
||||
groupDetailLoading.value = true
|
||||
let arr = encrypted_codes.map(item => item.encrypted_code)
|
||||
console.log(encrypted_codes);
|
||||
const res = await douyincertificateprepare({
|
||||
verify_token: groupDetail.value.verify_token,
|
||||
encrypted_codes: arr.join(','),
|
||||
id: groupDetail.value.id
|
||||
})
|
||||
} else {
|
||||
ElMessage.error('请选择核销项目')
|
||||
return
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@@ -171,17 +184,12 @@ async function groupOrdergroupScanHandle() {
|
||||
emits('succcess')
|
||||
} catch (error) {
|
||||
groupDetailLoading.value = false
|
||||
console.log(error);
|
||||
console.log('groupOrdergroupScanHandle.error', error);
|
||||
}
|
||||
}
|
||||
|
||||
const douyin_table = ref(null)
|
||||
|
||||
// 选择要核销的券
|
||||
function douyinSelectionChange(e) {
|
||||
console.log(e);
|
||||
}
|
||||
|
||||
// 核销券码
|
||||
async function submitHandle() {
|
||||
try {
|
||||
@@ -202,6 +210,7 @@ async function submitHandle() {
|
||||
const res = await douyinfulfilmentcertificateprepare({
|
||||
object_id: decodeURI(scanCode.value),
|
||||
});
|
||||
dialogVisible.value = false
|
||||
loading.value = false
|
||||
groupDetail.value = res
|
||||
detailVisible.value = true
|
||||
@@ -217,7 +226,10 @@ async function submitHandle() {
|
||||
}
|
||||
} catch (error) {
|
||||
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);
|
||||
|
||||
function show() {
|
||||
global.updateData(false)
|
||||
dialogVisible.value = true;
|
||||
setTimeout(() => {
|
||||
inputRef.value.focus();
|
||||
@@ -262,6 +275,7 @@ function show() {
|
||||
}
|
||||
|
||||
function close() {
|
||||
global.updateData(true)
|
||||
dialogVisible.value = false;
|
||||
}
|
||||
|
||||
@@ -274,6 +288,7 @@ defineExpose({
|
||||
show,
|
||||
close,
|
||||
loading,
|
||||
submitHandle
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<div class="cart_wrap card">
|
||||
<div class="header">
|
||||
<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"
|
||||
:label="item.label"></el-option>
|
||||
</el-select>
|
||||
@@ -79,14 +79,16 @@
|
||||
<template v-slot="scope">
|
||||
<div class="goods_list">
|
||||
<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 }}
|
||||
</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 }}
|
||||
</div>
|
||||
<div class="item" style="margin-right: 10px;">
|
||||
<el-tag type="success" disable-transitions size="default" effect="light" round>
|
||||
<div class="item"
|
||||
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 }}
|
||||
</el-tag>
|
||||
</div>
|
||||
@@ -101,9 +103,9 @@
|
||||
</el-table>
|
||||
</div>
|
||||
<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 v-model:current-page="tableData.page" v-model:page-size="tableData.size"
|
||||
layout="total, prev, pager, next" :total="tableData.total" background
|
||||
@current-change="paginationChange" @size-change="paginationChange">
|
||||
</el-pagination>
|
||||
</div>
|
||||
</div>
|
||||
@@ -121,6 +123,7 @@ import { ref, onMounted, reactive } from 'vue'
|
||||
import scanGroup from './components/scanGroup.vue'
|
||||
import refundDialog from './components/refundDialog.vue'
|
||||
import { useUser } from "@/store/user.js"
|
||||
import BindShop from './components/bindShop.vue'
|
||||
const store = useUser()
|
||||
|
||||
import { useGlobal } from '@/store/global.js'
|
||||
@@ -129,10 +132,19 @@ const global = useGlobal()
|
||||
const scanGroupRef = ref(null)
|
||||
const refundDialogRef = ref(null)
|
||||
|
||||
function typeStatus(t) {
|
||||
const m = {
|
||||
0: 'warning',
|
||||
1: 'success',
|
||||
2: 'danger'
|
||||
}
|
||||
return m[t]
|
||||
}
|
||||
|
||||
const tableData = reactive({
|
||||
resetLoading: false,
|
||||
proName: '',
|
||||
type: 1,
|
||||
type: 2,
|
||||
status: '',
|
||||
loading: false,
|
||||
list: [],
|
||||
@@ -162,7 +174,8 @@ const typeList = reactive([
|
||||
}
|
||||
])
|
||||
|
||||
const statusList = reactive([
|
||||
// 本店团购订单状态
|
||||
const originStatus = [
|
||||
{
|
||||
value: 'unpaid',
|
||||
label: '待付款'
|
||||
@@ -187,16 +200,51 @@ const statusList = reactive([
|
||||
value: 'cancelled',
|
||||
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) {
|
||||
return statusList.find(item => item.value == t)?.label
|
||||
return originStatus.find(item => item.value == t)?.label
|
||||
}
|
||||
|
||||
// 分页变化
|
||||
function paginationChange(e) {
|
||||
tableData.page = e
|
||||
groupOrderlistAjax()
|
||||
}
|
||||
|
||||
@@ -243,7 +291,9 @@ async function groupOrderlistAjax() {
|
||||
case 2:
|
||||
// 获取抖音团购数据
|
||||
res = await douyinorderlist({
|
||||
page: tableData.page
|
||||
page: tableData.page,
|
||||
status: tableData.status,
|
||||
d_order_id: tableData.proName
|
||||
})
|
||||
tableData.resetLoading = false
|
||||
tableData.loading = false
|
||||
@@ -260,7 +310,7 @@ async function groupOrderlistAjax() {
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
groupOrderlistAjax()
|
||||
typeChange(tableData.type)
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
@@ -12,19 +12,23 @@
|
||||
<el-text class="t">{{ masterId }}</el-text>
|
||||
</div>
|
||||
<div class="select_user" @click="fastCashierRef.show()" v-if="!memberInfo.telephone">
|
||||
<el-icon class="icon">
|
||||
<WalletFilled />
|
||||
</el-icon>
|
||||
<el-text class="t">快捷收银</el-text>
|
||||
<div class="left">
|
||||
<el-icon class="icon">
|
||||
<WalletFilled />
|
||||
</el-icon>
|
||||
<el-text class="t">快捷收银</el-text>
|
||||
</div>
|
||||
<el-icon class="arrow">
|
||||
<ArrowRight />
|
||||
</el-icon>
|
||||
</div>
|
||||
<div class="select_user" v-else @click="clearMember">
|
||||
<el-icon class="icon">
|
||||
<UserFilled />
|
||||
</el-icon>
|
||||
<el-text class="t">{{ memberInfo.telephone }}</el-text>
|
||||
<div class="left">
|
||||
<el-icon class="icon">
|
||||
<UserFilled />
|
||||
</el-icon>
|
||||
<el-text class="t">{{ memberInfo.telephone }}</el-text>
|
||||
</div>
|
||||
<el-icon class="arrow">
|
||||
<Close />
|
||||
</el-icon>
|
||||
@@ -418,7 +422,7 @@ onMounted(() => {
|
||||
.menu {
|
||||
background-color: var(--el-color-warning);
|
||||
color: #fff;
|
||||
width: 100px;
|
||||
width: 60px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
@@ -437,7 +441,7 @@ onMounted(() => {
|
||||
}
|
||||
|
||||
.number {
|
||||
flex: 1;
|
||||
width: 50px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
@@ -450,24 +454,31 @@ onMounted(() => {
|
||||
}
|
||||
|
||||
.select_user {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
background-color: var(--el-color-info-light-8);
|
||||
padding: 0 var(--el-font-size-base);
|
||||
|
||||
.icon {
|
||||
color: var(--el-color-primary);
|
||||
font-size: 18px;
|
||||
}
|
||||
.left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.t {
|
||||
font-size: var(--el-font-size-base);
|
||||
padding: 0 10px;
|
||||
.icon {
|
||||
color: var(--el-color-primary);
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.t {
|
||||
font-size: var(--el-font-size-base);
|
||||
margin-left: 4px;
|
||||
}
|
||||
}
|
||||
|
||||
.arrow {
|
||||
color: #999;
|
||||
font-size: 20px;
|
||||
font-size: 16px;
|
||||
position: relative;
|
||||
top: 2px;
|
||||
}
|
||||
|
||||
@@ -22,7 +22,16 @@
|
||||
<el-input v-model="form.loginName" placeholder="请输入11位手机号码"></el-input>
|
||||
</el-form-item>
|
||||
<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>
|
||||
<div style="width: 100%; display: flex; justify-content: flex-end">
|
||||
@@ -54,7 +63,8 @@
|
||||
import packageData from "../../package.json";
|
||||
import logo from "@/assets/logo.png";
|
||||
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 { ipcRenderer } from "electron";
|
||||
import { RandomNumBoth } from "@/utils";
|
||||
@@ -69,6 +79,7 @@ const socket = useSocket();
|
||||
const router = useRouter();
|
||||
const formRef = ref(null);
|
||||
const loading = ref(false);
|
||||
const passwordType = ref('password')
|
||||
|
||||
const form = reactive({
|
||||
serialNumber: RandomNumBoth(1000, 9999),
|
||||
@@ -110,12 +121,6 @@ const submitHandle = () => {
|
||||
store
|
||||
.userlogin(form)
|
||||
.then(async (res) => {
|
||||
// const douyin = await douyincheckIn({
|
||||
// token: res.token,
|
||||
// loginName: res.loginName,
|
||||
// clientType: 'pc'
|
||||
// })
|
||||
// useStorage.set('douyin', douyin.userInfo)
|
||||
ElMessage.success("登录成功");
|
||||
socket.init();
|
||||
setTimeout(() => {
|
||||
@@ -123,6 +128,12 @@ const submitHandle = () => {
|
||||
name: "home",
|
||||
});
|
||||
}, 1000);
|
||||
const douyin = await douyincheckIn({
|
||||
token: res.token,
|
||||
loginName: res.loginName,
|
||||
clientType: 'pc'
|
||||
})
|
||||
useStorage.set('douyin', douyin.userInfo)
|
||||
})
|
||||
.catch((err) => {
|
||||
loading.value = false;
|
||||
@@ -138,6 +149,10 @@ const logout = () => {
|
||||
})
|
||||
.catch(() => { });
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
passwordType.icon = Hide
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
@@ -15,8 +15,10 @@
|
||||
<div v-else style="width: 100%; text-align: center; margin: 30px 0">
|
||||
暂无数据
|
||||
</div>
|
||||
<el-pagination background v-if="ordereData.list.length" layout="prev, pager, next"
|
||||
style="margin-top: 20px" :total="Number(ordereData.total)" @current-change="handleCurrentChange" />
|
||||
<el-pagination background v-if="ordereData.list.length" v-model:current-page="ordereData.page"
|
||||
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 label="销售" name="closed">
|
||||
<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>
|
||||
<el-pagination v-if="ordereData.list.length" background layout="prev, pager, next"
|
||||
style="margin-top: 20px" :total="Number(ordereData.total)" @current-change="handleCurrentChange" />
|
||||
<el-pagination background v-if="ordereData.list.length" v-model:current-page="ordereData.page"
|
||||
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 label="退单" name="refund">
|
||||
<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>
|
||||
<el-pagination v-if="ordereData.list.length" background layout="prev, pager, next"
|
||||
style="margin-top: 20px" :total="Number(ordereData.total)" @current-change="handleCurrentChange" />
|
||||
<el-pagination background v-if="ordereData.list.length" v-model:current-page="ordereData.page"
|
||||
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 label="快捷收银" name="cash">
|
||||
<cashTable />
|
||||
@@ -251,9 +257,12 @@
|
||||
¥{{ refundamount > 0 ? refundamount : "0.00" }}
|
||||
</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">
|
||||
<el-button type="primary" style="width: 100%; height: 100%" :loading="buttonloading"
|
||||
@click="payreturnOrderclick">
|
||||
@click="payreturnOrderclick(true)">
|
||||
<span v-if="!buttonloading">支付退回</span>
|
||||
<span v-else>支付退回...</span>
|
||||
</el-button>
|
||||
@@ -322,9 +331,12 @@ const buttonloading = ref(); //loading
|
||||
function dateConfirm(time) {
|
||||
ordereData.startTime = time[0]
|
||||
ordereData.endTime = time[1]
|
||||
ordereData.page = 1
|
||||
asyncorderfindOrder();
|
||||
}
|
||||
|
||||
// 是否线上退款
|
||||
const isOnline = ref(true)
|
||||
// 获取支付密码
|
||||
async function passwordSuccess(pwd) {
|
||||
try {
|
||||
@@ -345,7 +357,7 @@ async function passwordSuccess(pwd) {
|
||||
});
|
||||
if (arr.length != 0) {
|
||||
// await payreturnOrder(arr, md5(pwd));
|
||||
await payreturnOrder(arr, '');
|
||||
await payreturnOrder(arr, '', isOnline.value);
|
||||
changechecked.value = false;
|
||||
recharge.value = false;
|
||||
itemboxshow.value = false;
|
||||
@@ -355,7 +367,7 @@ async function passwordSuccess(pwd) {
|
||||
asyncorderfindOrder();
|
||||
} else {
|
||||
buttonloading.value = false;
|
||||
ElMessage.error("以没有退款项目!");
|
||||
ElMessage.error("没有退款项目!");
|
||||
}
|
||||
} catch (error) {
|
||||
buttonloading.value = false;
|
||||
@@ -363,7 +375,9 @@ async function passwordSuccess(pwd) {
|
||||
}
|
||||
|
||||
const payreturnOrderclick = lodash.debounce(
|
||||
async () => {
|
||||
async (e) => {
|
||||
console.log(e);
|
||||
isOnline.value = e
|
||||
//搜索手机号
|
||||
if (refundamount.value == 0) {
|
||||
buttonloading.value = false;
|
||||
@@ -866,19 +880,13 @@ onMounted(() => {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
|
||||
.recharge_footer_itemright_botton_boxoneabsolute {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
color: #c0c0c0;
|
||||
}
|
||||
|
||||
.recharge_footer_itemright_botton_boxonetext {
|
||||
font-size: 26px;
|
||||
height: 60px;
|
||||
line-height: 60px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, defineEmits } from 'vue'
|
||||
import { ref } from 'vue'
|
||||
|
||||
const emit = defineEmits(['close'])
|
||||
|
||||
|
||||
@@ -215,6 +215,7 @@ const exit = async () => {
|
||||
// useStorage.clear()
|
||||
useStorage.del('userInfo')
|
||||
useStorage.del('token')
|
||||
useStorage.del('douyin')
|
||||
ElMessage.success("交班成功");
|
||||
setTimeout(() => {
|
||||
router.replace({
|
||||
|
||||
@@ -34,5 +34,8 @@ export default defineConfig(({ command, mode }) => {
|
||||
"@": path.resolve(__dirname, "./src"),
|
||||
},
|
||||
},
|
||||
esbuild: {
|
||||
drop: ["console"],
|
||||
},
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user