diff --git a/.env.production b/.env.production index 370d4f4..3fce6a9 100644 --- a/.env.production +++ b/.env.production @@ -1,4 +1,4 @@ VITE_NOW_TYPE = 'build' -VITE_PUSH_URL = 'ws://192.168.1.22:3133' -VITE_BASE_URL = 'https://shop.lihaink.cn' \ No newline at end of file +VITE_PUSH_URL ='wss://erp.lihaink.cn/pull' +VITE_BASE_URL = 'https://erp.lihaink.cn' \ No newline at end of file diff --git a/src/api/store.js b/src/api/store.js index a4f83ba..4b70cb8 100644 --- a/src/api/store.js +++ b/src/api/store.js @@ -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 }) } /** diff --git a/src/layout/myHeader.vue b/src/layout/myHeader.vue index fb31978..69f9994 100644 --- a/src/layout/myHeader.vue +++ b/src/layout/myHeader.vue @@ -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(() => { 打印自检 -
+
点击自动连接打印机
-
- 已连接打印机T58 +
+
已连接打印机T58
+
({{ printStore.printAddress }})
打印机已连接,是否重新连接 diff --git a/src/store/print.js b/src/store/print.js index 739dd39..af08e0e 100644 --- a/src/store/print.js +++ b/src/store/print.js @@ -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 } }) \ No newline at end of file diff --git a/src/views/saleHome/index.vue b/src/views/saleHome/index.vue index 4b04fa5..e3efb65 100644 --- a/src/views/saleHome/index.vue +++ b/src/views/saleHome/index.vue @@ -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) => {