This commit is contained in:
parent
eb1a881d92
commit
92dc991f5d
|
@ -1,4 +1,4 @@
|
|||
VITE_NOW_TYPE = 'build'
|
||||
|
||||
VITE_PUSH_URL = 'ws://192.168.1.22:3133'
|
||||
VITE_BASE_URL = 'https://shop.lihaink.cn'
|
||||
VITE_PUSH_URL ='wss://erp.lihaink.cn/pull'
|
||||
VITE_BASE_URL = 'https://erp.lihaink.cn'
|
|
@ -118,7 +118,7 @@ export function saleOrderListApi(data) {
|
|||
* @description 采购订单提交
|
||||
*/
|
||||
export function createOrderApi(data) {
|
||||
return request.get(`/order/OpurchaseOrder/createOrder`, { params: data })
|
||||
return request.post(`/order/OpurchaseOrder/createOrder`, { params: data })
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -34,6 +34,7 @@ const connect = () => {
|
|||
if (res.h5) ElMessage.error("请使用APP连接打印机");
|
||||
else {
|
||||
printStore.setConnect(false);
|
||||
printStore.setPrintAddress('');
|
||||
dialogVisible.value = false;
|
||||
uni.postMessage({
|
||||
data: {
|
||||
|
@ -87,8 +88,10 @@ onMounted(() => {
|
|||
function (event) {
|
||||
// alert(JSON.stringify(event.data));
|
||||
if (event.data.type === "connect") {
|
||||
let str = event.data.data.address;
|
||||
printStore.setConnect(true);
|
||||
ElMessage.success("已连接打印机T58");
|
||||
printStore.setPrintAddress(str);
|
||||
ElMessage.success("已连接打印机T58("+str+")");
|
||||
}
|
||||
},
|
||||
false
|
||||
|
@ -128,13 +131,14 @@ onUnmounted(() => {
|
|||
<span>打印自检</span>
|
||||
</el-button>
|
||||
</div>
|
||||
<div style="margin-right: 1rem" v-if="!printStore.is_connect">
|
||||
<div style="margin-right: 1rem" v-if="!printStore.is_connect||!printStore.printAddress">
|
||||
<el-button @click="connect" type="warning">
|
||||
<span>点击自动连接打印机</span>
|
||||
</el-button>
|
||||
</div>
|
||||
<div style="margin-right: 1rem" v-else @click="dialogVisible = true">
|
||||
已连接打印机T58
|
||||
<div style="margin-right: 1rem;font-size: 0.9rem;" v-else @click="dialogVisible = true">
|
||||
<div>已连接打印机T58</div>
|
||||
<div style="font-size: 0.7rem;color: #ccc;">({{ printStore.printAddress }})</div>
|
||||
</div>
|
||||
<el-dialog v-model="dialogVisible" title="提示" width="500">
|
||||
<span>打印机已连接,是否重新连接</span>
|
||||
|
|
|
@ -4,6 +4,7 @@ import { ref } from "vue"
|
|||
export const usePrintStore = defineStore('print', () => {
|
||||
|
||||
const is_connect = ref(localStorage.getItem('is_connect'));
|
||||
const printAddress = ref(localStorage.getItem('print_address'));
|
||||
|
||||
|
||||
const setConnect = (e)=>{
|
||||
|
@ -11,8 +12,15 @@ export const usePrintStore = defineStore('print', () => {
|
|||
localStorage.setItem('is_connect',e);
|
||||
}
|
||||
|
||||
const setPrintAddress = (e)=>{
|
||||
printAddress.value = e;
|
||||
localStorage.setItem('print_address',e);
|
||||
}
|
||||
|
||||
return {
|
||||
is_connect,
|
||||
setConnect
|
||||
setConnect,
|
||||
printAddress,
|
||||
setPrintAddress
|
||||
}
|
||||
})
|
|
@ -146,7 +146,7 @@ const onPrint = (data)=>{
|
|||
pay_number: data.transaction_id, //支付单号
|
||||
goods: goods, //商品列表
|
||||
};
|
||||
if (goods.length > 0) {
|
||||
if (goods.length > 0 && data.out_trade_no) {
|
||||
let str = printTicket(obj);
|
||||
console.log(str);
|
||||
uni.getEnv((res) => {
|
||||
|
|
Loading…
Reference in New Issue