| ¶Ô±ÈÐÂÎļþ |
| | |
| | | const jcapi = uni.requireNativePlugin("JCSDK-JCApiModule"); |
| | | |
| | | let state = { |
| | | connectedDevice: null, |
| | | connectionStatus: "disconnected", // disconnected | connecting | connected |
| | | listeners: [], |
| | | }; |
| | | |
| | | /** éç¥ææè®¢é
é¡µé¢ */ |
| | | function notify() { |
| | | state.listeners.forEach(fn => fn({ |
| | | connectedDevice: state.connectedDevice, |
| | | connectionStatus: state.connectionStatus, |
| | | })); |
| | | } |
| | | |
| | | /** 页é¢è®¢é
èçç¶æ */ |
| | | function onChange(fn) { |
| | | state.listeners.push(fn); |
| | | fn({ |
| | | connectedDevice: state.connectedDevice, |
| | | connectionStatus: state.connectionStatus, |
| | | }); |
| | | } |
| | | |
| | | /** åå§åï¼å
¨å±åªé䏿¬¡ï¼ */ |
| | | function init() { |
| | | jcapi.initSDK(); |
| | | |
| | | const saved = uni.getStorageSync("bluetoothConnection"); |
| | | if (saved) { |
| | | state.connectedDevice = saved; |
| | | state.connectionStatus = "connected"; |
| | | } |
| | | |
| | | // æå¼çå¬ |
| | | jcapi.didReadPrintErrorInfo((r) => { |
| | | if (r.code === 23) { |
| | | state.connectedDevice = null; |
| | | state.connectionStatus = "disconnected"; |
| | | uni.removeStorageSync("bluetoothConnection"); |
| | | notify(); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /** æç´¢è®¾å¤ */ |
| | | function searchDevices() { |
| | | return new Promise((resolve, reject) => { |
| | | uni.openBluetoothAdapter({ |
| | | success() { |
| | | jcapi.getBluetoothDevices(list => { |
| | | resolve(list || []); |
| | | }); |
| | | }, |
| | | fail: reject |
| | | }); |
| | | }); |
| | | } |
| | | |
| | | /** è¿æ¥è®¾å¤ */ |
| | | function connect(device) { |
| | | return new Promise((resolve, reject) => { |
| | | state.connectionStatus = "connecting"; |
| | | notify(); |
| | | |
| | | jcapi.openPrinterByDevice({ |
| | | address: device.address, |
| | | name: device.name, |
| | | deviceType: 0, |
| | | }, (r) => { |
| | | if (r.code === 0) { |
| | | state.connectedDevice = device; |
| | | state.connectionStatus = "connected"; |
| | | uni.setStorageSync("bluetoothConnection", device); |
| | | notify(); |
| | | resolve(device); |
| | | } else { |
| | | state.connectionStatus = "disconnected"; |
| | | notify(); |
| | | reject(r); |
| | | } |
| | | }); |
| | | }); |
| | | } |
| | | |
| | | function isConnected() { |
| | | return state.connectionStatus === "connected"; |
| | | } |
| | | |
| | | function getCurrentDevice() { |
| | | return state.connectedDevice; |
| | | } |
| | | |
| | | export default { |
| | | init, |
| | | onChange, |
| | | searchDevices, |
| | | connect, |
| | | isConnected, |
| | | getCurrentDevice, |
| | | }; |
| | |
| | | <template> |
| | | <view class="page"> |
| | | <view class="finishProductIn-locno-bg" /> |
| | | <u-navbar title="æ ¸ç£
è®°å½" :background="background" :border-bottom="false" :title-bold="true" title-color="#000" |
| | | back-icon-color="#000"> |
| | | <view class="navbar-right" slot="right" @click="goPrintAll"> |
| | | å
¨é¨æå° |
| | | </view> |
| | | </u-navbar> |
| | | <view class="wrap"> |
| | | <!-- è¿æ¥åæå°ç¶ææç¤ºå¨ --> |
| | | <view class="status-indicator" :class="{ |
| | | <view class="page"> |
| | | <view class="finishProductIn-locno-bg" /> |
| | | <u-navbar |
| | | title="" |
| | | :background="background" |
| | | :border-bottom="false" |
| | | :title-bold="true" |
| | | title-color="#000" |
| | | back-icon-color="#000" |
| | | > |
| | | <view class="navbar-right" slot="right"> |
| | | <text class="bluetooth-btn" @click="searchDevice"> |
| | | {{ connectedDevice ? `å·²è¿æ¥ï¼${connectedDevice.name}` : "è¿æ¥èç" }} |
| | | </text> |
| | | <text class="print-all-btn" @click="goPrintAll">å
¨é¨æå°</text> |
| | | </view> |
| | | </u-navbar> |
| | | <view class="wrap"> |
| | | <!-- è¿æ¥åæå°ç¶ææç¤ºå¨ --> |
| | | <view |
| | | class="status-indicator" |
| | | :class="{ |
| | | connected: connectionStatus === 'connected', |
| | | connecting: connectionStatus === 'connecting', |
| | | disconnected: connectionStatus === 'disconnected', |
| | | }"> |
| | | <text class="status-text">{{ getConnectionStatusText() }}</text> |
| | | <text class="print-status" v-if="printStatus !== 'idle'">- {{ getPrintStatusText() }}</text> |
| | | </view> |
| | | <scroll-view class="finishProductIn-locno-scroll-list" scroll-y="true" @scrolltolower="getmoreList()"> |
| | | <u-cell-group class="finishProductIn-locno-scroll-list-group" :border="false"> |
| | | <view class="content" v-for="(item, index) in list" :key="item.locNo" :index="index" |
| | | @click="selectNo(item)"> |
| | | <view class="content-header"> |
| | | <view class="content-header-title">{{ list.length - index }}</view> |
| | | </view> |
| | | <view class="content-body"> |
| | | <view class="row-list"> |
| | | <view class="_label"> |
| | | <view class="_label-icon-1"> </view> |
| | | <view class="_label-name">æ¹æ¬¡å·ï¼</view> |
| | | </view> |
| | | <view class="_content"> |
| | | {{ item.batchNo }} |
| | | </view> |
| | | </view> |
| | | <view class="row-list"> |
| | | <view class="_label"> |
| | | <view class="_label-icon-2"> </view> |
| | | <view class="_label-name">产åæè¿°ï¼</view> |
| | | </view> |
| | | <view class="_content"> |
| | | {{ item.partDescription }} |
| | | </view> |
| | | </view> |
| | | <view class="row-list"> |
| | | <view class="_label"> |
| | | <view class="_label-icon-3"> </view> |
| | | <view class="_label-name">é¶ä»¶å·ï¼</view> |
| | | </view> |
| | | <view class="_content"> |
| | | {{ item.partNo }} |
| | | </view> |
| | | </view> |
| | | <view class="row-list"> |
| | | <view class="_label"> |
| | | <view class="_label-icon-1"> </view> |
| | | <view class="_label-name">æ¯éï¼</view> |
| | | </view> |
| | | <view class="_content"> |
| | | {{ item.newGrossWeight }} |
| | | </view> |
| | | </view> |
| | | <view class="row-list"> |
| | | <view class="_label"> |
| | | <view class="_label-icon-2"> </view> |
| | | <view class="_label-name">çéï¼</view> |
| | | </view> |
| | | <view class="_content"> |
| | | {{ item.newWeight }} |
| | | </view> |
| | | </view> |
| | | <view class="row-list"> |
| | | <view class="_label"> |
| | | <view class="_label-icon-3"> </view> |
| | | <view class="_label-name">åéï¼</view> |
| | | </view> |
| | | <view class="_content"> |
| | | {{ item.newNetWeight }} |
| | | </view> |
| | | </view> |
| | | <view class="row-list"> |
| | | <view class="_label"> |
| | | <view class="_label-icon-1"> </view> |
| | | <view class="_label-name">æ ¸ç£
ééï¼</view> |
| | | </view> |
| | | <view class="_content"> |
| | | {{ item.verificationWeight }} |
| | | </view> |
| | | </view> |
| | | <view class="row-list"> |
| | | <view class="_label"> |
| | | <view class="_label-icon-2"> </view> |
| | | <view class="_label-name">å车çéï¼</view> |
| | | </view> |
| | | <view class="_content"> |
| | | {{ item.forkliftWeight }} |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </u-cell-group> |
| | | <view class="loadmore" @click="getmoreList()"> |
| | | <u-loadmore :status="status" :load-text="loadText" @loadmore="getmoreList()" /> |
| | | </view> |
| | | </scroll-view> |
| | | </view> |
| | | <u-toast ref="uToast" /> |
| | | <u-modal v-model="maskShow" title="" :show-confirm-button="false"> |
| | | <view @touchmove.stop.prevent="moveHandle" @click="maskclose"> |
| | | <scroll-view class="uni-scroll_box" scroll-y @touchmove.stop.prevent="moveHandle" |
| | | @click.stop="moveHandle"> |
| | | <view class="modal-title">éæ©èç设å¤</view> |
| | | <view v-if="listDevice.length === 0" class="empty-tip">ææ è®¾å¤</view> |
| | | <view v-for="(item, index) in listDevice" :key="index" @click="tapQuery(item)" class="device-item"> |
| | | <view class="device-name"> |
| | | <text>åç§°ï¼</text> |
| | | <text>{{ item.name || "æªç¥è®¾å¤" }}</text> |
| | | </view> |
| | | <view class="device-uuid"> |
| | | <text>UUID:</text> |
| | | <text>{{ item.address || "æ å°å" }}</text> |
| | | </view> |
| | | </view> |
| | | </scroll-view> |
| | | </view> |
| | | </u-modal> |
| | | </view> |
| | | }" |
| | | > |
| | | <text class="status-text">{{ getConnectionStatusText() }}</text> |
| | | <text class="print-status" v-if="printStatus !== 'idle'" |
| | | >- {{ getPrintStatusText() }}</text |
| | | > |
| | | </view> |
| | | <scroll-view |
| | | class="finishProductIn-locno-scroll-list" |
| | | scroll-y="true" |
| | | @scrolltolower="getmoreList()" |
| | | > |
| | | <u-cell-group |
| | | class="finishProductIn-locno-scroll-list-group" |
| | | :border="false" |
| | | > |
| | | <view |
| | | class="content" |
| | | v-for="(item, index) in list" |
| | | :key="item.locNo" |
| | | :index="index" |
| | | @click="selectNo(item)" |
| | | > |
| | | <view class="content-header"> |
| | | <view class="content-header-title">{{ |
| | | list.length - index |
| | | }}</view> |
| | | </view> |
| | | <view class="content-body"> |
| | | <view class="row-list"> |
| | | <view class="_label"> |
| | | <view class="_label-icon-1"> </view> |
| | | <view class="_label-name">æ¹æ¬¡å·ï¼</view> |
| | | </view> |
| | | <view class="_content"> |
| | | {{ item.batchNo }} |
| | | </view> |
| | | </view> |
| | | <view class="row-list"> |
| | | <view class="_label"> |
| | | <view class="_label-icon-2"> </view> |
| | | <view class="_label-name">产åæè¿°ï¼</view> |
| | | </view> |
| | | <view class="_content"> |
| | | {{ item.partDescription }} |
| | | </view> |
| | | </view> |
| | | <view class="row-list"> |
| | | <view class="_label"> |
| | | <view class="_label-icon-3"> </view> |
| | | <view class="_label-name">é¶ä»¶å·ï¼</view> |
| | | </view> |
| | | <view class="_content"> |
| | | {{ item.partNo }} |
| | | </view> |
| | | </view> |
| | | <view class="row-list"> |
| | | <view class="_label"> |
| | | <view class="_label-icon-1"> </view> |
| | | <view class="_label-name">æ¯éï¼</view> |
| | | </view> |
| | | <view class="_content"> |
| | | {{ item.newGrossWeight }} |
| | | </view> |
| | | </view> |
| | | <view class="row-list"> |
| | | <view class="_label"> |
| | | <view class="_label-icon-2"> </view> |
| | | <view class="_label-name">çéï¼</view> |
| | | </view> |
| | | <view class="_content"> |
| | | {{ item.newWeight }} |
| | | </view> |
| | | </view> |
| | | <view class="row-list"> |
| | | <view class="_label"> |
| | | <view class="_label-icon-3"> </view> |
| | | <view class="_label-name">åéï¼</view> |
| | | </view> |
| | | <view class="_content"> |
| | | {{ item.newNetWeight }} |
| | | </view> |
| | | </view> |
| | | <view class="row-list"> |
| | | <view class="_label"> |
| | | <view class="_label-icon-1"> </view> |
| | | <view class="_label-name">æ ¸ç£
ééï¼</view> |
| | | </view> |
| | | <view class="_content"> |
| | | {{ item.verificationWeight }} |
| | | </view> |
| | | </view> |
| | | <view class="row-list"> |
| | | <view class="_label"> |
| | | <view class="_label-icon-2"> </view> |
| | | <view class="_label-name">å车çéï¼</view> |
| | | </view> |
| | | <view class="_content"> |
| | | {{ item.forkliftWeight }} |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </u-cell-group> |
| | | <view class="loadmore" @click="getmoreList()"> |
| | | <u-loadmore |
| | | :status="status" |
| | | :load-text="loadText" |
| | | @loadmore="getmoreList()" |
| | | /> |
| | | </view> |
| | | </scroll-view> |
| | | </view> |
| | | <u-toast ref="uToast" /> |
| | | <u-modal v-model="maskShow" title="" :show-confirm-button="false"> |
| | | <view @touchmove.stop.prevent="moveHandle" @click="maskclose"> |
| | | <scroll-view |
| | | class="uni-scroll_box" |
| | | scroll-y |
| | | @touchmove.stop.prevent="moveHandle" |
| | | @click.stop="moveHandle" |
| | | > |
| | | <view class="modal-title">éæ©èç设å¤</view> |
| | | <view v-if="listDevice.length === 0" class="empty-tip">ææ è®¾å¤</view> |
| | | <view |
| | | v-for="(item, index) in listDevice" |
| | | :key="index" |
| | | @click="tapQuery(item)" |
| | | class="device-item" |
| | | > |
| | | <view class="device-name"> |
| | | <text>åç§°ï¼</text> |
| | | <text>{{ item.name || "æªç¥è®¾å¤" }}</text> |
| | | </view> |
| | | <view class="device-uuid"> |
| | | <text>UUID:</text> |
| | | <text>{{ item.address || "æ å°å" }}</text> |
| | | </view> |
| | | </view> |
| | | </scroll-view> |
| | | </view> |
| | | </u-modal> |
| | | </view> |
| | | </template> |
| | | <script> |
| | | import content_bg from "@/static/custom/finishProductIn/locNoBg.png"; |
| | | const jcapi = uni.requireNativePlugin("JCSDK-JCApiModule"); |
| | | import content_bg from "@/static/custom/finishProductIn/locNoBg.png"; |
| | | import bluetooth from "@/common/bluetoothPrinter.js"; |
| | | |
| | | // äºç»´ç ç±»å |
| | | const QrCodeType = { |
| | | QrCode: 31, |
| | | PDF417: 32, |
| | | DataMatrix: 33, |
| | | AZTEC: 34, |
| | | }; |
| | | // 线æ¡ç±»å |
| | | const LineType = { |
| | | Solid: 1, // å®çº¿ |
| | | Dotted: 2, // è线ï¼é»è®¤èå®1:1ç¸é´ï¼ |
| | | }; |
| | | // æ¢è¡æ¹å¼ |
| | | const LineModeType = { |
| | | Justified: 1, // 宽é«åºå®ï¼å
容èªéåºï¼åå·/åé´è·/è¡é´è·ææ¯ä¾ç¼©æ¾ï¼ |
| | | AutoHeight: 2, // 宽度åºå®ï¼é«åº¦èªéåº |
| | | Fixed: 4, // 宽é«åºå®ï¼è¶
åºé¨åè£åª |
| | | Adapt: 6, // 宽é«åºå®ï¼å
容è¶
è¿æ¶é¢è®¾å®½é«èªå¨ç¼©å° |
| | | }; |
| | | export default { |
| | | data() { |
| | | return { |
| | | background: { |
| | | backgroundImage: `url(${content_bg})`, |
| | | backgroundAttachment: "fixed", |
| | | backgroundSize: "100% auto", |
| | | backgroundRepeat: "no-repeat", |
| | | }, |
| | | keywords: "", |
| | | list: [], |
| | | total: 0, |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | status: "loading", |
| | | loadText: { |
| | | loadmore: "å è½½æ´å¤...", |
| | | loading: "åªåå è½½ä¸...", |
| | | nomore: "æ²¡ææ´å¤äº", |
| | | }, |
| | | maskShow: false, |
| | | listDevice: [], //èçè®¾å¤æ°æ® |
| | | printQueue: [], // æå°éå |
| | | printing: false, // æ¯å¦æ£å¨æå° |
| | | printDensity: 3, // é»è®¤æå°æµåº¦ |
| | | labelType: 1, // é»è®¤æ ç¾ç±»å |
| | | // 1ï¼é´é纸 |
| | | // 2ï¼é»æ 纸 |
| | | // 3ï¼è¿ç»çº¸ |
| | | // 4ï¼å®å纸 |
| | | // 5ï¼éæçº¸ |
| | | printMode: 2, // é»è®¤æå°æ¨¡å¼ |
| | | // 1ï¼çæ |
| | | // 2ï¼çè½¬å° |
| | | connectedDevice: null, // å·²è¿æ¥çæå°æº |
| | | connectionStatus: "disconnected", // è¿æ¥ç¶æ: disconnected, connecting, connected |
| | | printStatus: "idle", // æå°ç¶æ: idle, printing, error |
| | | errorMessage: "", // éè¯¯ä¿¡æ¯ |
| | | verificationNo: "", |
| | | failedPrintJobs: [], |
| | | }; |
| | | }, |
| | | onLoad(options) { |
| | | this.verificationNo = JSON.parse( |
| | | decodeURIComponent(options.verificationNo) |
| | | ); |
| | | this.getlist(); |
| | | // åå§åSDK |
| | | jcapi.initSDK(); |
| | | const jcapi = uni.requireNativePlugin("JCSDK-JCApiModule"); |
| | | |
| | | // å°è¯æ¢å¤ä¹åçèçè¿æ¥ç¶æ |
| | | this.restoreBluetoothConnection(); |
| | | // äºç»´ç ç±»å |
| | | const QrCodeType = { |
| | | QrCode: 31, |
| | | PDF417: 32, |
| | | DataMatrix: 33, |
| | | AZTEC: 34, |
| | | }; |
| | | // 线æ¡ç±»å |
| | | const LineType = { |
| | | Solid: 1, // å®çº¿ |
| | | Dotted: 2, // è线ï¼é»è®¤èå®1:1ç¸é´ï¼ |
| | | }; |
| | | // æ¢è¡æ¹å¼ |
| | | const LineModeType = { |
| | | Justified: 1, // 宽é«åºå®ï¼å
容èªéåºï¼åå·/åé´è·/è¡é´è·ææ¯ä¾ç¼©æ¾ï¼ |
| | | AutoHeight: 2, // 宽度åºå®ï¼é«åº¦èªéåº |
| | | Fixed: 4, // 宽é«åºå®ï¼è¶
åºé¨åè£åª |
| | | Adapt: 6, // 宽é«åºå®ï¼å
容è¶
è¿æ¶é¢è®¾å®½é«èªå¨ç¼©å° |
| | | }; |
| | | export default { |
| | | data() { |
| | | return { |
| | | background: { |
| | | backgroundImage: `url(${content_bg})`, |
| | | backgroundAttachment: "fixed", |
| | | backgroundSize: "100% auto", |
| | | backgroundRepeat: "no-repeat", |
| | | }, |
| | | keywords: "", |
| | | list: [], |
| | | total: 0, |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | status: "loading", |
| | | loadText: { |
| | | loadmore: "å è½½æ´å¤...", |
| | | loading: "åªåå è½½ä¸...", |
| | | nomore: "æ²¡ææ´å¤äº", |
| | | }, |
| | | maskShow: false, |
| | | listDevice: [], //èçè®¾å¤æ°æ® |
| | | printQueue: [], // æå°éå |
| | | printing: false, // æ¯å¦æ£å¨æå° |
| | | printDensity: 10, // é»è®¤æå°æµåº¦ |
| | | labelType: 1, // é»è®¤æ ç¾ç±»å |
| | | // 1ï¼é´é纸 |
| | | // 2ï¼é»æ 纸 |
| | | // 3ï¼è¿ç»çº¸ |
| | | // 4ï¼å®å纸 |
| | | // 5ï¼éæçº¸ |
| | | printMode: 2, // é»è®¤æå°æ¨¡å¼ |
| | | // 1ï¼çæ |
| | | // 2ï¼çè½¬å° |
| | | connectedDevice: null, |
| | | connectionStatus: "disconnected", |
| | | printStatus: "idle", // æå°ç¶æ: idle, printing, error |
| | | errorMessage: "", // éè¯¯ä¿¡æ¯ |
| | | verificationNo: "", |
| | | failedPrintJobs: [], |
| | | }; |
| | | }, |
| | | onLoad(options) { |
| | | this.verificationNo = JSON.parse( |
| | | decodeURIComponent(options.verificationNo) |
| | | ); |
| | | |
| | | // çå¬é¡µç åè° |
| | | jcapi.didReadPrintCountInfo(function(r) { |
| | | console.log("页ç ", r); |
| | | }); |
| | | bluetooth.init(); |
| | | |
| | | // çå¬é误åè° |
| | | jcapi.didReadPrintErrorInfo((r) => { |
| | | console.log("é误", r); |
| | | if (r.code == 23) { |
| | | // æå°æºæå¼è¿æ¥ |
| | | this.connectedDevice = null; |
| | | // æ¸
餿¬å°åå¨çè¿æ¥ä¿¡æ¯ |
| | | uni.removeStorageSync("bluetoothConnection"); |
| | | uni.showToast({ |
| | | icon: "none", |
| | | title: "æå°æºè¿æ¥å·²æå¼ï¼è¯·éæ°è¿æ¥", |
| | | duration: 2 * 1000, |
| | | }); |
| | | } else { |
| | | uni.showToast({ |
| | | icon: "none", |
| | | title: JSON.stringify(r), |
| | | duration: 2 * 1000, |
| | | }); |
| | | } |
| | | }); |
| | | }, |
| | | methods: { |
| | | restoreBluetoothConnection() { |
| | | try { |
| | | // 仿¬å°åå¨è·åä¹åä¿åçè¿æ¥ä¿¡æ¯ |
| | | const savedConnection = uni.getStorageSync("bluetoothConnection"); |
| | | if (savedConnection && savedConnection.address) { |
| | | console.log("å°è¯æ¢å¤èçè¿æ¥:", savedConnection); |
| | | // è®¾ç½®ä¸ºè¿æ¥ä¸ç¶æ |
| | | this.connectionStatus = "connecting"; |
| | | bluetooth.onChange(({ connectedDevice, connectionStatus }) => { |
| | | this.connectedDevice = connectedDevice; |
| | | this.connectionStatus = connectionStatus; |
| | | }); |
| | | |
| | | // å°è¯éæ°è¿æ¥ |
| | | jcapi.openPrinterByDevice({ |
| | | address: savedConnection.address, |
| | | name: savedConnection.name, |
| | | deviceType: 0, // 设å¤ç±»åï¼0-èçï¼1-ç½ç» |
| | | }, |
| | | (r) => { |
| | | if (r.code == 0) { |
| | | this.connectedDevice = savedConnection; |
| | | this.connectionStatus = "connected"; |
| | | console.log("èçè¿æ¥å·²æ¢å¤"); |
| | | } else { |
| | | this.connectionStatus = "disconnected"; |
| | | // 妿éè¿å¤±è´¥ï¼æ¸
é¤ä¿åçè¿æ¥ä¿¡æ¯ |
| | | uni.removeStorageSync("bluetoothConnection"); |
| | | console.log("èçéè¿å¤±è´¥:", r); |
| | | } |
| | | } |
| | | ); |
| | | } |
| | | } catch (e) { |
| | | console.error("æ¢å¤èçè¿æ¥å¤±è´¥:", e); |
| | | } |
| | | }, |
| | | getmoreList() { |
| | | if (this.pageSize >= this.total) { |
| | | this.status = "nomore"; |
| | | return; |
| | | } |
| | | this.status = "loading"; |
| | | setTimeout(() => { |
| | | this.pageSize += this.pageSize; |
| | | this.getlist(); |
| | | }, 1000); |
| | | }, |
| | | getlist() { |
| | | this.$u.api.NuclearScaleEntry.queryPacking({ |
| | | current: this.pageNum, |
| | | size: this.pageSize, |
| | | verificationNo: this.verificationNo, |
| | | }).then((res) => { |
| | | this.list = res.data; |
| | | this.total = res.data.length; |
| | | if (this.pageSize >= this.total) { |
| | | this.status = "nomore"; |
| | | } else { |
| | | this.status = "loadmore"; |
| | | } |
| | | }); |
| | | }, |
| | | search(value) { |
| | | if (value) { |
| | | this.list = []; |
| | | this.pageSize = 10; |
| | | this.$u.api.NuclearScaleEntry.queryPacking({ |
| | | current: this.pageNum, |
| | | size: this.pageSize, |
| | | moNo: value, |
| | | }).then((res) => { |
| | | this.list = res.data.records; |
| | | this.total = res.data.total; |
| | | if (this.pageSize >= this.total) { |
| | | this.status = "nomore"; |
| | | } else { |
| | | this.status = "loadmore"; |
| | | } |
| | | }); |
| | | } else { |
| | | this.getlist(); |
| | | } |
| | | }, |
| | | // æ£æ¥èçè¿æ¥ç¶æ |
| | | async checkBluetoothConnection() { |
| | | if (!this.connectedDevice) { |
| | | this.connectionStatus = "disconnected"; |
| | | return false; |
| | | } |
| | | this.getlist(); |
| | | }, |
| | | |
| | | // è®¾ç½®ä¸ºè¿æ¥ä¸ç¶æ |
| | | this.connectionStatus = "connecting"; |
| | | // 页é¢å¸è½½æ¶ä¸ä¸»å¨æå¼èçè¿æ¥ï¼ä¿æè¿æ¥ç¶æ |
| | | onUnload() { |
| | | // 䏿§è¡æå¼è¿æ¥æä½ï¼ä¿æèçè¿æ¥ |
| | | }, |
| | | methods: { |
| | | // restoreBluetoothConnection() { |
| | | // try { |
| | | // // 仿¬å°åå¨è·åä¹åä¿åçè¿æ¥ä¿¡æ¯ |
| | | // const savedConnection = uni.getStorageSync("bluetoothConnection"); |
| | | // if (savedConnection && savedConnection.address) { |
| | | // console.log("å°è¯æ¢å¤èçè¿æ¥:", savedConnection); |
| | | // // ç´æ¥è®¾ç½®ä¸ºå·²è¿æ¥ç¶æï¼é¿å
ä¸å¿
è¦çéè¿ |
| | | // // å®é
è¿æ¥ç¶æä¼éè¿SDKçåè°èªå¨æ´æ° |
| | | // this.connectedDevice = savedConnection; |
| | | // this.connectionStatus = "connected"; |
| | | // console.log("èçè¿æ¥ç¶æå·²æ¢å¤"); |
| | | |
| | | // å¢å¼ºè¿æ¥ç¶ææ£æµ |
| | | return new Promise((resolve) => { |
| | | // ç®åè¿æ¥ç¶ææ£æµï¼ç´æ¥ä½¿ç¨å·²è®°å½çè¿æ¥ç¶æ |
| | | if (this.connectedDevice) { |
| | | this.connectionStatus = "connected"; |
| | | resolve(true); |
| | | } else { |
| | | this.connectionStatus = "disconnected"; |
| | | uni.showToast({ |
| | | icon: "none", |
| | | title: "æå°æºæªè¿æ¥ï¼è¯·å
è¿æ¥", |
| | | duration: 2000, |
| | | }); |
| | | resolve(false); |
| | | } |
| | | }); |
| | | }, |
| | | // // éªè¯è¿æ¥æ¯å¦ççææï¼éè¿åéä¸ä¸ªç®åçå½ä»¤ææ£æ¥ç¶æ |
| | | // // è¿é䏿§è¡å®é
çéè¿æä½ï¼èæ¯ä¾èµSDKçè¿æ¥ç¶æåè° |
| | | // // å¦æè¿æ¥å·²æå¼ï¼SDKä¼éè¿didReadPrintErrorInfoåè°éç¥æä»¬ |
| | | // } |
| | | // } catch (e) { |
| | | // console.error("æ¢å¤èçè¿æ¥å¤±è´¥:", e); |
| | | // this.connectionStatus = "disconnected"; |
| | | // } |
| | | // }, |
| | | getmoreList() { |
| | | if (this.pageSize >= this.total) { |
| | | this.status = "nomore"; |
| | | return; |
| | | } |
| | | this.status = "loading"; |
| | | setTimeout(() => { |
| | | this.pageSize += this.pageSize; |
| | | this.getlist(); |
| | | }, 1000); |
| | | }, |
| | | getlist() { |
| | | this.$u.api.NuclearScaleEntry.queryPacking({ |
| | | current: this.pageNum, |
| | | size: this.pageSize, |
| | | verificationNo: this.verificationNo, |
| | | }).then((res) => { |
| | | this.list = res.data; |
| | | this.total = res.data.length; |
| | | if (this.pageSize >= this.total) { |
| | | this.status = "nomore"; |
| | | } else { |
| | | this.status = "loadmore"; |
| | | } |
| | | }); |
| | | }, |
| | | search(value) { |
| | | if (value) { |
| | | this.list = []; |
| | | this.pageSize = 10; |
| | | this.$u.api.NuclearScaleEntry.queryPacking({ |
| | | current: this.pageNum, |
| | | size: this.pageSize, |
| | | moNo: value, |
| | | }).then((res) => { |
| | | this.list = res.data.records; |
| | | this.total = res.data.total; |
| | | if (this.pageSize >= this.total) { |
| | | this.status = "nomore"; |
| | | } else { |
| | | this.status = "loadmore"; |
| | | } |
| | | }); |
| | | } else { |
| | | this.getlist(); |
| | | } |
| | | }, |
| | | checkBluetoothConnection() { |
| | | return bluetooth.isConnected(); |
| | | }, |
| | | |
| | | // æ·»å å°æå°éå |
| | | addToPrintQueue(items) { |
| | | if (!Array.isArray(items)) { |
| | | items = [items]; |
| | | } |
| | | // // ç´æ¥ä½¿ç¨å·²è®°å½çè¿æ¥ç¶æï¼é¿å
ä¸å¿
è¦çè¿æ¥æ£æ¥ |
| | | // // å®é
è¿æ¥ç¶æä¼éè¿SDKçåè°èªå¨æ´æ° |
| | | // this.connectionStatus = "connected"; |
| | | // return true; |
| | | // }, |
| | | |
| | | this.printQueue.push(...items); |
| | | // 妿ä¸å¨æå°ä¸ï¼åå¼å§å¤çéå |
| | | if (!this.printing) { |
| | | this.processPrintQueue(); |
| | | } |
| | | }, |
| | | // æ·»å å°æå°éå |
| | | addToPrintQueue(items) { |
| | | if (!Array.isArray(items)) { |
| | | items = [items]; |
| | | } |
| | | |
| | | // å¤çæå°éå |
| | | async processPrintQueue() { |
| | | while (this.printQueue.length > 0) { |
| | | // æ£æ¥è¿æ¥ç¶æ |
| | | const isConnected = await this.checkBluetoothConnection(); |
| | | if (!isConnected) { |
| | | // 妿æªè¿æ¥ï¼æ¾ç¤ºèçè¿æ¥å¯¹è¯æ¡ |
| | | this.searchDevice(); |
| | | // 䏿¯ç´æ¥returnï¼èæ¯çå¾
ç¨æ·è¿æ¥ååç»§ç»å¤ç |
| | | return; |
| | | } |
| | | this.printQueue.push(...items); |
| | | // 妿ä¸å¨æå°ä¸ï¼åå¼å§å¤çéå |
| | | if (!this.printing) { |
| | | this.processPrintQueue(); |
| | | } |
| | | }, |
| | | |
| | | this.printing = true; |
| | | this.printStatus = "printing"; |
| | | // å¤çæå°éå |
| | | async processPrintQueue() { |
| | | while (this.printQueue.length > 0) { |
| | | // æ£æ¥è¿æ¥ç¶æ |
| | | const isConnected = await this.checkBluetoothConnection(); |
| | | if (!isConnected) { |
| | | // 妿æªè¿æ¥ï¼æ¾ç¤ºèçè¿æ¥å¯¹è¯æ¡ |
| | | this.searchDevice(); |
| | | // 䏿¯ç´æ¥returnï¼èæ¯çå¾
ç¨æ·è¿æ¥ååç»§ç»å¤ç |
| | | return; |
| | | } |
| | | |
| | | // ååºéåä¸ç第ä¸ä¸ªä»»å¡ |
| | | const item = this.printQueue.shift(); |
| | | this.printing = true; |
| | | this.printStatus = "printing"; |
| | | |
| | | try { |
| | | // æ§è¡æå° |
| | | await this.printQrCode(item); |
| | | // ååºéåä¸ç第ä¸ä¸ªä»»å¡ |
| | | const item = this.printQueue.shift(); |
| | | |
| | | // æå°æååç»§ç»å¤çä¸ä¸ä¸ª |
| | | uni.showToast({ |
| | | title: "æå°æå", |
| | | icon: "success", |
| | | duration: 1000, |
| | | }); |
| | | try { |
| | | // æ§è¡æå° |
| | | await this.printQrCode(item); |
| | | |
| | | // çæå»¶è¿ï¼é¿å
æå°æºç¼åæº¢åº |
| | | await new Promise((resolve) => setTimeout(resolve, 1000)); |
| | | } catch (error) { |
| | | console.error("æå°åºé:", error); |
| | | this.printStatus = "error"; |
| | | this.errorMessage = error.message || "æå°æ¶åçæªç¥é误"; |
| | | this.printing = false; |
| | | // æå°æååç»§ç»å¤çä¸ä¸ä¸ª |
| | | uni.showToast({ |
| | | title: "æå°æå", |
| | | icon: "success", |
| | | duration: 1000, |
| | | }); |
| | | |
| | | // è®°å½å¤±è´¥çä»»å¡ï¼ä¸éæ°æ·»å å°éå |
| | | this.failedPrintJobs = this.failedPrintJobs || []; |
| | | this.failedPrintJobs.push(item); |
| | | // çæå»¶è¿ï¼é¿å
æå°æºç¼åæº¢åº |
| | | await new Promise((resolve) => setTimeout(resolve, 1000)); |
| | | } catch (error) { |
| | | console.error("æå°åºé:", error); |
| | | this.printStatus = "error"; |
| | | this.errorMessage = error.message || "æå°æ¶åçæªç¥é误"; |
| | | this.printing = false; |
| | | |
| | | uni.showToast({ |
| | | title: `æå°å¤±è´¥: ${this.errorMessage}`, |
| | | icon: "none", |
| | | duration: 2000, |
| | | }); |
| | | // ç»§ç»å¤çä¸ä¸ä¸ªä»»å¡ |
| | | continue; |
| | | } |
| | | } |
| | | // è®°å½å¤±è´¥çä»»å¡ï¼ä¸éæ°æ·»å å°éå |
| | | this.failedPrintJobs = this.failedPrintJobs || []; |
| | | this.failedPrintJobs.push(item); |
| | | |
| | | this.printing = false; |
| | | this.printStatus = "idle"; |
| | | }, |
| | | // æå°åä¸ªä¿¡æ¯ |
| | | selectNo(item) { |
| | | let that = this; |
| | | uni.showModal({ |
| | | title: "æç¤º", |
| | | content: "æ¯å¦æå°è£
ç®±åï¼", |
| | | showCancel: true, |
| | | success: async function(res) { |
| | | if (res.confirm) { |
| | | // æ·»å å°æå°éå |
| | | that.addToPrintQueue(item); |
| | | } |
| | | }, |
| | | }); |
| | | }, |
| | | uni.showToast({ |
| | | title: `æå°å¤±è´¥: ${this.errorMessage}`, |
| | | icon: "none", |
| | | duration: 2000, |
| | | }); |
| | | // ç»§ç»å¤çä¸ä¸ä¸ªä»»å¡ |
| | | continue; |
| | | } |
| | | } |
| | | |
| | | // æå°å
¨é¨ä¿¡æ¯ |
| | | goPrintAll() { |
| | | let that = this; |
| | | uni.showModal({ |
| | | title: "æç¤º", |
| | | content: `æ¯å¦æå°å
¨é¨${that.list.length}æ¡è£
ç®±åï¼`, |
| | | showCancel: true, |
| | | success: async function(res) { |
| | | if (res.confirm) { |
| | | // æ·»å å°æå°éå |
| | | that.addToPrintQueue([...that.list]); |
| | | } |
| | | }, |
| | | }); |
| | | }, |
| | | moveHandle() {}, |
| | | maskclose() {}, |
| | | //æå°äºç»´ç |
| | | printQrCode(item) { |
| | | return new Promise(async (resolve, reject) => { |
| | | // const params = { |
| | | // rwMatlBindId: item.id |
| | | // }; |
| | | try { |
| | | // let res = await this.$u.api.dailyPaper.zongjianLabelInfo(params) |
| | | if (!item) { |
| | | this.$refs.uToast.show({ |
| | | title: "æªæ¥è¯¢å°è¯¥æ ç¾ä¿¡æ¯ï¼", |
| | | type: "warning ", |
| | | }); |
| | | reject(new Error("æªæ¥è¯¢å°è¯¥æ ç¾ä¿¡æ¯")); |
| | | return; |
| | | } |
| | | this.printing = false; |
| | | this.printStatus = "idle"; |
| | | }, |
| | | // æå°åä¸ªä¿¡æ¯ |
| | | selectNo(item) { |
| | | let that = this; |
| | | uni.showModal({ |
| | | title: "æç¤º", |
| | | content: "æ¯å¦æå°è£
ç®±åï¼", |
| | | success(res) { |
| | | if (res.confirm) { |
| | | // æ batchNo åå¹¶ |
| | | const sameBatchList = that.list.filter( |
| | | (i) => i.batchNo === item.batchNo |
| | | ); |
| | | that.addToPrintQueue(sameBatchList); |
| | | } |
| | | }, |
| | | }); |
| | | }, |
| | | |
| | | const ht = item.contractNo; |
| | | const lj = item.partNo; |
| | | const ljms = item.ccontrProModel; |
| | | const fh = item.newNetWeight; |
| | | const scdt = item.productionDate; |
| | | const scph = item.batchNo; |
| | | const shdw = item.customerName; |
| | | const fhdw = "æ±ä¸åéææ¯æéå
¬å¸"; |
| | | // æå°å
¨é¨ä¿¡æ¯ |
| | | goPrintAll() { |
| | | let that = this; |
| | | uni.showModal({ |
| | | title: "æç¤º", |
| | | content: `æ¯å¦æå°å
¨é¨${that.list.length}æ¡è£
ç®±åï¼`, |
| | | showCancel: true, |
| | | success: async function (res) { |
| | | if (res.confirm) { |
| | | // æ·»å å°æå°éå |
| | | that.addToPrintQueue([...that.list]); |
| | | } |
| | | }, |
| | | }); |
| | | }, |
| | | moveHandle() {}, |
| | | maskclose() {}, |
| | | //æå°äºç»´ç |
| | | printQrCode(item) { |
| | | return new Promise(async (resolve, reject) => { |
| | | // const params = { |
| | | // rwMatlBindId: item.id |
| | | // }; |
| | | try { |
| | | // let res = await this.$u.api.dailyPaper.zongjianLabelInfo(params) |
| | | if (!item) { |
| | | this.$refs.uToast.show({ |
| | | title: "æªæ¥è¯¢å°è¯¥æ ç¾ä¿¡æ¯ï¼", |
| | | type: "warning ", |
| | | }); |
| | | reject(new Error("æªæ¥è¯¢å°è¯¥æ ç¾ä¿¡æ¯")); |
| | | return; |
| | | } |
| | | |
| | | // åå§åç»æ¿ |
| | | jcapi.initDrawingBoard({ |
| | | width: 70, |
| | | height: 49, |
| | | rotate: 90, |
| | | }); |
| | | const ht = item.contractNo; |
| | | const lj = item.partNo; |
| | | const ljms = item.ccontrProModel; |
| | | const fh = item.newNetWeight; |
| | | const scdt = item.productionDate; |
| | | const scph = item.batchNo; |
| | | const shdw = item.customerName; |
| | | const fhdw = "æ±ä¸åéææ¯æéå
¬å¸"; |
| | | |
| | | // ç»å¶äºç»´ç |
| | | const qrContent = { |
| | | company: item.customerNo, |
| | | line_no: item.lineNo, |
| | | lot_batch_no: item.batchNo, |
| | | order_no: item.contractNo, |
| | | part_no: item.partNo, |
| | | total_qty: item.newNetWeight, |
| | | qty_arrived: item.newNetWeight, |
| | | release_no: item.relNo, |
| | | }; |
| | | // åå§åç»æ¿ |
| | | jcapi.initDrawingBoard({ |
| | | width: 70, |
| | | height: 49, |
| | | rotate: 90, |
| | | }); |
| | | |
| | | jcapi.drawLabelQrCode({ |
| | | x: 43.5, |
| | | y: 2, |
| | | width: 24, |
| | | height: 24, |
| | | value: qrContent, |
| | | rotate: 0, |
| | | codeType: QrCodeType.QrCode, |
| | | }); |
| | | // ç»å¶äºç»´ç |
| | | const qrContent = { |
| | | company: item.customerNo, |
| | | line_no: item.lineNo, |
| | | lot_batch_no: item.batchNo, |
| | | order_no: item.contractNo, |
| | | part_no: item.partNo, |
| | | total_qty: item.newNetWeight, |
| | | qty_arrived: item.newNetWeight, |
| | | release_no: item.relNo, |
| | | }; |
| | | |
| | | // ç»å¶æ¨ªçº¿ |
| | | this.getDrawLabelLine(1, 1, 67, 0.5, 0, LineType.Solid); |
| | | this.getDrawLabelLine(1, 6, 42, 0.3, 0, LineType.Solid); |
| | | this.getDrawLabelLine(1, 11, 42, 0.3, 0, LineType.Solid); |
| | | this.getDrawLabelLine(1, 16, 42, 0.3, 0, LineType.Solid); |
| | | this.getDrawLabelLine(1, 23, 42, 0.3, 0, LineType.Solid); |
| | | this.getDrawLabelLine(1, 27.5, 67, 0.3, 0, LineType.Solid); |
| | | this.getDrawLabelLine(1, 32, 67, 0.3, 0, LineType.Solid); |
| | | this.getDrawLabelLine(1, 37, 67, 0.3, 0, LineType.Solid); |
| | | this.getDrawLabelLine(1, 42, 67, 0.3, 0, LineType.Solid); |
| | | this.getDrawLabelLine(1, 47, 67, 0.5, 0, LineType.Solid); |
| | | jcapi.drawLabelQrCode({ |
| | | x: 43.5, |
| | | y: 2, |
| | | width: 24, |
| | | height: 24, |
| | | value: qrContent, |
| | | rotate: 0, |
| | | codeType: QrCodeType.QrCode, |
| | | }); |
| | | |
| | | //ç»å¶ç«çº¿ |
| | | this.getDrawLabelLine(1, 1, 0.5, 46, 0, LineType.Solid); // ç«çº¿1 |
| | | this.getDrawLabelLine(43, 1, 0.3, 26, 0, LineType.Solid); // ç«çº¿2 |
| | | this.getDrawLabelLine(68, 1, 0.5, 46, 0, LineType.Solid); // ç«çº¿3 |
| | | // ç»å¶æ¨ªçº¿ |
| | | this.getDrawLabelLine(1, 1, 67, 0.5, 0, LineType.Solid); |
| | | this.getDrawLabelLine(1, 6, 42, 0.3, 0, LineType.Solid); |
| | | this.getDrawLabelLine(1, 11, 42, 0.3, 0, LineType.Solid); |
| | | this.getDrawLabelLine(1, 16, 42, 0.3, 0, LineType.Solid); |
| | | this.getDrawLabelLine(1, 23, 42, 0.3, 0, LineType.Solid); |
| | | this.getDrawLabelLine(1, 27.5, 67, 0.3, 0, LineType.Solid); |
| | | this.getDrawLabelLine(1, 32, 67, 0.3, 0, LineType.Solid); |
| | | this.getDrawLabelLine(1, 37, 67, 0.3, 0, LineType.Solid); |
| | | this.getDrawLabelLine(1, 42, 67, 0.3, 0, LineType.Solid); |
| | | this.getDrawLabelLine(1, 47, 67, 0.5, 0, LineType.Solid); |
| | | |
| | | // ç»å¶ææ¬ |
| | | this.getDrawLabelText( |
| | | 3, |
| | | 2.5, |
| | | 40, |
| | | 8, |
| | | "ä¸å¤©ç§æè£
ç®±æ¸
å", |
| | | 2.5, |
| | | 0, |
| | | LineModeType.AutoHeight, |
| | | 0, |
| | | 0, |
| | | 1, |
| | | 1, |
| | | 1 |
| | | ); |
| | | this.getDrawLabelText( |
| | | 2, |
| | | 7, |
| | | 25, |
| | | 8, |
| | | "ååå·:", |
| | | 2.5, |
| | | 0, |
| | | LineModeType.AutoHeight, |
| | | 0, |
| | | 0, |
| | | 0, |
| | | 1, |
| | | 1 |
| | | ); |
| | | this.getDrawLabelText( |
| | | 2, |
| | | 12, |
| | | 25, |
| | | 8, |
| | | "é¶ä»¶å·:", |
| | | 2.5, |
| | | 0, |
| | | LineModeType.AutoHeight, |
| | | 0, |
| | | 0, |
| | | 0, |
| | | 1, |
| | | 1 |
| | | ); |
| | | this.getDrawLabelText( |
| | | 2, |
| | | 17, |
| | | 25, |
| | | 8, |
| | | "é¶ä»¶æè¿°:", |
| | | 2.5, |
| | | 0, |
| | | LineModeType.AutoHeight, |
| | | 0, |
| | | 0, |
| | | 0, |
| | | 1, |
| | | 1 |
| | | ); |
| | | this.getDrawLabelText( |
| | | 2, |
| | | 23.5, |
| | | 25, |
| | | 8, |
| | | "åè´§/è£
ç®±æ°:", |
| | | 2.5, |
| | | 0, |
| | | LineModeType.AutoHeight, |
| | | 0, |
| | | 0, |
| | | 0, |
| | | 1, |
| | | 1 |
| | | ); |
| | | this.getDrawLabelText( |
| | | 2, |
| | | 28.5, |
| | | 25, |
| | | 8, |
| | | "çäº§æ¥æ:", |
| | | 2.5, |
| | | 0, |
| | | LineModeType.AutoHeight, |
| | | 0, |
| | | 0, |
| | | 0, |
| | | 1, |
| | | 1 |
| | | ); |
| | | this.getDrawLabelText( |
| | | 2, |
| | | 32.5, |
| | | 25, |
| | | 8, |
| | | "ç产æ¹å·:", |
| | | 2.5, |
| | | 0, |
| | | LineModeType.AutoHeight, |
| | | 0, |
| | | 0, |
| | | 0, |
| | | 1, |
| | | 1 |
| | | ); |
| | | this.getDrawLabelText( |
| | | 2, |
| | | 37.5, |
| | | 25, |
| | | 8, |
| | | "åè´§åä½:", |
| | | 2.5, |
| | | 0, |
| | | LineModeType.AutoHeight, |
| | | 0, |
| | | 0, |
| | | 0, |
| | | 1, |
| | | 1 |
| | | ); |
| | | this.getDrawLabelText( |
| | | 2, |
| | | 42.5, |
| | | 25, |
| | | 8, |
| | | "æ¶è´§åä½:", |
| | | 2.5, |
| | | 0, |
| | | LineModeType.AutoHeight, |
| | | 0, |
| | | 0, |
| | | 0, |
| | | 1, |
| | | 1 |
| | | ); |
| | | //ç»å¶ç«çº¿ |
| | | this.getDrawLabelLine(1, 1, 0.5, 46, 0, LineType.Solid); // ç«çº¿1 |
| | | this.getDrawLabelLine(43, 1, 0.3, 26, 0, LineType.Solid); // ç«çº¿2 |
| | | this.getDrawLabelLine(68, 1, 0.5, 46, 0, LineType.Solid); // ç«çº¿3 |
| | | |
| | | // å¡«å
åæ°å¼ |
| | | this.getDrawLabelText( |
| | | 11, |
| | | 7, |
| | | 30, |
| | | 8, |
| | | ht, |
| | | 2.5, |
| | | 0, |
| | | LineModeType.AutoHeight, |
| | | 0, |
| | | 0, |
| | | 0, |
| | | 0, |
| | | 1 |
| | | ); |
| | | this.getDrawLabelText( |
| | | 11, |
| | | 12, |
| | | 32, |
| | | 8, |
| | | lj, |
| | | 2.5, |
| | | 0, |
| | | LineModeType.AutoHeight, |
| | | 0, |
| | | 0, |
| | | 0, |
| | | 0, |
| | | 1 |
| | | ); |
| | | this.getDrawLabelText( |
| | | 14, |
| | | 17, |
| | | 30, |
| | | 8, |
| | | ljms, |
| | | 2.5, |
| | | 0, |
| | | LineModeType.AutoHeight, |
| | | 0, |
| | | 0, |
| | | 0, |
| | | 0, |
| | | 1 |
| | | ); |
| | | this.getDrawLabelText( |
| | | 17, |
| | | 23.5, |
| | | 27, |
| | | 8, |
| | | fh, |
| | | 2.5, |
| | | 0, |
| | | LineModeType.AutoHeight, |
| | | 0, |
| | | 0, |
| | | 0, |
| | | 0, |
| | | 1 |
| | | ); |
| | | this.getDrawLabelText( |
| | | 14, |
| | | 28.5, |
| | | 55, |
| | | 8, |
| | | scdt, |
| | | 2.5, |
| | | 0, |
| | | LineModeType.AutoHeight, |
| | | 0, |
| | | 0, |
| | | 0, |
| | | 0, |
| | | 1 |
| | | ); |
| | | this.getDrawLabelText( |
| | | 14, |
| | | 32.7, |
| | | 55, |
| | | 8, |
| | | scph, |
| | | 2.5, |
| | | 0, |
| | | LineModeType.AutoHeight, |
| | | 0, |
| | | 0, |
| | | 0, |
| | | 0, |
| | | 1 |
| | | ); |
| | | this.getDrawLabelText( |
| | | 14, |
| | | 37.5, |
| | | 55, |
| | | 8, |
| | | fhdw, |
| | | 2.5, |
| | | 0, |
| | | LineModeType.AutoHeight, |
| | | 0, |
| | | 0, |
| | | 0, |
| | | 0, |
| | | 1 |
| | | ); |
| | | this.getDrawLabelText( |
| | | 14, |
| | | 42.5, |
| | | 55, |
| | | 8, |
| | | shdw, |
| | | 2.5, |
| | | 0, |
| | | LineModeType.AutoHeight, |
| | | 0, |
| | | 0, |
| | | 0, |
| | | 0, |
| | | 1 |
| | | ); |
| | | // çææå°æ°æ® |
| | | let imageJsonObj = jcapi.generateLabelJson(); |
| | | // ç»å¶ææ¬ |
| | | this.getDrawLabelText( |
| | | 3, |
| | | 2.5, |
| | | 40, |
| | | 8, |
| | | "ä¸å¤©ç§æè£
ç®±æ¸
å", |
| | | 2.5, |
| | | 0, |
| | | LineModeType.AutoHeight, |
| | | 0, |
| | | 0, |
| | | 1, |
| | | 1, |
| | | 1 |
| | | ); |
| | | this.getDrawLabelText( |
| | | 2, |
| | | 7, |
| | | 25, |
| | | 8, |
| | | "ååå·:", |
| | | 2.5, |
| | | 0, |
| | | LineModeType.AutoHeight, |
| | | 0, |
| | | 0, |
| | | 0, |
| | | 1, |
| | | 1 |
| | | ); |
| | | this.getDrawLabelText( |
| | | 2, |
| | | 12, |
| | | 25, |
| | | 8, |
| | | "é¶ä»¶å·:", |
| | | 2.5, |
| | | 0, |
| | | LineModeType.AutoHeight, |
| | | 0, |
| | | 0, |
| | | 0, |
| | | 1, |
| | | 1 |
| | | ); |
| | | this.getDrawLabelText( |
| | | 2, |
| | | 17, |
| | | 25, |
| | | 8, |
| | | "é¶ä»¶æè¿°:", |
| | | 2.5, |
| | | 0, |
| | | LineModeType.AutoHeight, |
| | | 0, |
| | | 0, |
| | | 0, |
| | | 1, |
| | | 1 |
| | | ); |
| | | this.getDrawLabelText( |
| | | 2, |
| | | 23.5, |
| | | 25, |
| | | 8, |
| | | "åè´§/è£
ç®±æ°:", |
| | | 2.5, |
| | | 0, |
| | | LineModeType.AutoHeight, |
| | | 0, |
| | | 0, |
| | | 0, |
| | | 1, |
| | | 1 |
| | | ); |
| | | this.getDrawLabelText( |
| | | 2, |
| | | 28.5, |
| | | 25, |
| | | 8, |
| | | "çäº§æ¥æ:", |
| | | 2.5, |
| | | 0, |
| | | LineModeType.AutoHeight, |
| | | 0, |
| | | 0, |
| | | 0, |
| | | 1, |
| | | 1 |
| | | ); |
| | | this.getDrawLabelText( |
| | | 2, |
| | | 32.5, |
| | | 25, |
| | | 8, |
| | | "ç产æ¹å·:", |
| | | 2.5, |
| | | 0, |
| | | LineModeType.AutoHeight, |
| | | 0, |
| | | 0, |
| | | 0, |
| | | 1, |
| | | 1 |
| | | ); |
| | | this.getDrawLabelText( |
| | | 2, |
| | | 37.5, |
| | | 25, |
| | | 8, |
| | | "åè´§åä½:", |
| | | 2.5, |
| | | 0, |
| | | LineModeType.AutoHeight, |
| | | 0, |
| | | 0, |
| | | 0, |
| | | 1, |
| | | 1 |
| | | ); |
| | | this.getDrawLabelText( |
| | | 2, |
| | | 42.5, |
| | | 25, |
| | | 8, |
| | | "æ¶è´§åä½:", |
| | | 2.5, |
| | | 0, |
| | | LineModeType.AutoHeight, |
| | | 0, |
| | | 0, |
| | | 0, |
| | | 1, |
| | | 1 |
| | | ); |
| | | |
| | | // 设置æå°ä»»å¡ |
| | | jcapi.startJob({ |
| | | totalCount: 1, |
| | | density: this.printDensity, |
| | | labelType: this.labelType, |
| | | printMode: this.printMode, |
| | | }, |
| | | function(r) { |
| | | if (r.code == 0) { |
| | | // æå°æ°æ® |
| | | // åå¨åå§æå°è®¡æ°åè° |
| | | const originalPrintCountCallback = |
| | | jcapi.didReadPrintCountInfo._callback; |
| | | // ä¸´æ¶æå°è®¡æ°åè°ï¼ç¨äºç¡®è®¤æå°å®æ |
| | | const tempPrintCountCallback = (printResult) => { |
| | | // æ¢å¤åå§åè° |
| | | jcapi.didReadPrintCountInfo(originalPrintCountCallback); |
| | | // æ¸
餿å°è¶
æ¶ |
| | | clearTimeout(printTimeout); |
| | | // ç»æå½åæå°ä»»å¡ |
| | | // è§£æPromise表示æå°å®æ |
| | | resolve(); |
| | | }; |
| | | // 设置临æ¶åè° |
| | | jcapi.didReadPrintCountInfo(tempPrintCountCallback); |
| | | // å¡«å
åæ°å¼ |
| | | this.getDrawLabelText( |
| | | 11, |
| | | 7, |
| | | 30, |
| | | 8, |
| | | ht, |
| | | 2.5, |
| | | 0, |
| | | LineModeType.AutoHeight, |
| | | 0, |
| | | 0, |
| | | 0, |
| | | 0, |
| | | 1 |
| | | ); |
| | | this.getDrawLabelText( |
| | | 11, |
| | | 12, |
| | | 32, |
| | | 8, |
| | | lj, |
| | | 2.5, |
| | | 0, |
| | | LineModeType.AutoHeight, |
| | | 0, |
| | | 0, |
| | | 0, |
| | | 0, |
| | | 1 |
| | | ); |
| | | this.getDrawLabelText( |
| | | 14, |
| | | 17, |
| | | 30, |
| | | 8, |
| | | ljms, |
| | | 2.5, |
| | | 0, |
| | | LineModeType.AutoHeight, |
| | | 0, |
| | | 0, |
| | | 0, |
| | | 0, |
| | | 1 |
| | | ); |
| | | this.getDrawLabelText( |
| | | 17, |
| | | 23.5, |
| | | 27, |
| | | 8, |
| | | fh, |
| | | 2.5, |
| | | 0, |
| | | LineModeType.AutoHeight, |
| | | 0, |
| | | 0, |
| | | 0, |
| | | 0, |
| | | 1 |
| | | ); |
| | | this.getDrawLabelText( |
| | | 14, |
| | | 28.5, |
| | | 55, |
| | | 8, |
| | | scdt, |
| | | 2.5, |
| | | 0, |
| | | LineModeType.AutoHeight, |
| | | 0, |
| | | 0, |
| | | 0, |
| | | 0, |
| | | 1 |
| | | ); |
| | | this.getDrawLabelText( |
| | | 14, |
| | | 32.7, |
| | | 55, |
| | | 8, |
| | | scph, |
| | | 2.5, |
| | | 0, |
| | | LineModeType.AutoHeight, |
| | | 0, |
| | | 0, |
| | | 0, |
| | | 0, |
| | | 1 |
| | | ); |
| | | this.getDrawLabelText( |
| | | 14, |
| | | 37.5, |
| | | 55, |
| | | 8, |
| | | fhdw, |
| | | 2.5, |
| | | 0, |
| | | LineModeType.AutoHeight, |
| | | 0, |
| | | 0, |
| | | 0, |
| | | 0, |
| | | 1 |
| | | ); |
| | | this.getDrawLabelText( |
| | | 14, |
| | | 42.5, |
| | | 55, |
| | | 8, |
| | | shdw, |
| | | 2.5, |
| | | 0, |
| | | LineModeType.AutoHeight, |
| | | 0, |
| | | 0, |
| | | 0, |
| | | 0, |
| | | 1 |
| | | ); |
| | | // çææå°æ°æ® |
| | | let imageJsonObj = jcapi.generateLabelJson(); |
| | | |
| | | // æ·»å æå°è¶
æ¶å¤ç |
| | | const printTimeout = setTimeout(() => { |
| | | jcapi.didReadPrintCountInfo(originalPrintCountCallback); |
| | | reject(new Error("æå°è¶
æ¶æªååº")); |
| | | }, 20000); |
| | | // 设置æå°ä»»å¡ |
| | | jcapi.startJob( |
| | | { |
| | | totalCount: 1, |
| | | density: this.printDensity, |
| | | labelType: this.labelType, |
| | | printMode: this.printMode, |
| | | }, |
| | | function (r) { |
| | | if (r.code == 0) { |
| | | // æå°æ°æ® |
| | | // åå¨åå§æå°è®¡æ°åè° |
| | | const originalPrintCountCallback = |
| | | jcapi.didReadPrintCountInfo._callback; |
| | | // ä¸´æ¶æå°è®¡æ°åè°ï¼ç¨äºç¡®è®¤æå°å®æ |
| | | const tempPrintCountCallback = (printResult) => { |
| | | // æ¢å¤åå§åè° |
| | | jcapi.didReadPrintCountInfo(originalPrintCountCallback); |
| | | // æ¸
餿å°è¶
æ¶ |
| | | clearTimeout(printTimeout); |
| | | // ç»æå½åæå°ä»»å¡ |
| | | // è§£æPromise表示æå°å®æ |
| | | resolve(); |
| | | }; |
| | | // 设置临æ¶åè° |
| | | jcapi.didReadPrintCountInfo(tempPrintCountCallback); |
| | | |
| | | jcapi.printData( |
| | | imageJsonObj, { |
| | | printQuantity: 1, |
| | | }, |
| | | function(r) { |
| | | if (r.code != 0) { |
| | | // æ¢å¤åå§åè° |
| | | jcapi.didReadPrintCountInfo( |
| | | originalPrintCountCallback); |
| | | // ç»æå½åæå°ä»»å¡ |
| | | reject(new Error(r.msg || "æå°å¤±è´¥")); |
| | | } |
| | | // æå°æ°æ®åéæååçå¾
æå°è®¡æ°åè°ç¡®è®¤å®é
æå°å®æ |
| | | } |
| | | ); |
| | | } else { |
| | | reject(new Error(r.msg || "设置æå°ä»»å¡å¤±è´¥")); |
| | | } |
| | | } |
| | | ); |
| | | } catch (error) { |
| | | reject(error); |
| | | } |
| | | }); |
| | | }, |
| | | tapQuery(item) { |
| | | this.maskShow = false; |
| | | // è¿æ¥æå°æº |
| | | let _this = this; |
| | | // æ·»å æå°è¶
æ¶å¤ç |
| | | const printTimeout = setTimeout(() => { |
| | | jcapi.didReadPrintCountInfo(originalPrintCountCallback); |
| | | reject(new Error("æå°è¶
æ¶æªååº")); |
| | | }, 20000); |
| | | |
| | | // è®¾ç½®ä¸ºè¿æ¥ä¸ç¶æ |
| | | this.connectionStatus = "connecting"; |
| | | jcapi.printData( |
| | | imageJsonObj, |
| | | { |
| | | printQuantity: 1, |
| | | }, |
| | | function (r) { |
| | | if (r.code != 0) { |
| | | // æ¢å¤åå§åè° |
| | | jcapi.didReadPrintCountInfo(originalPrintCountCallback); |
| | | // ç»æå½åæå°ä»»å¡ |
| | | reject(new Error(r.msg || "æå°å¤±è´¥")); |
| | | } |
| | | // æå°æ°æ®åéæååçå¾
æå°è®¡æ°åè°ç¡®è®¤å®é
æå°å®æ |
| | | } |
| | | ); |
| | | } else { |
| | | reject(new Error(r.msg || "设置æå°ä»»å¡å¤±è´¥")); |
| | | } |
| | | } |
| | | ); |
| | | } catch (error) { |
| | | reject(error); |
| | | } |
| | | }); |
| | | }, |
| | | async tapQuery(item) { |
| | | this.maskShow = false; |
| | | try { |
| | | await bluetooth.connect(item); |
| | | uni.showToast({ title: "è¿æ¥æå" }); |
| | | |
| | | jcapi.openPrinterByDevice({ |
| | | address: item.address, |
| | | name: item.name, |
| | | deviceType: 0, // 设å¤ç±»åï¼0-èçï¼1-ç½ç» |
| | | }, |
| | | function(r) { |
| | | // å¨tapQueryæ¹æ³ä¸ï¼è¿æ¥æåæ¶æ·»å ä¿åè¿æ¥ä¿¡æ¯ç代ç |
| | | if (r.code == 0) { |
| | | _this.connectedDevice = item; |
| | | _this.connectionStatus = "connected"; |
| | | // ä¿åè¿æ¥ä¿¡æ¯å°æ¬å°åå¨ |
| | | uni.setStorageSync("bluetoothConnection", item); |
| | | uni.showToast({ |
| | | title: "è¿æ¥æå", |
| | | duration: 1500, |
| | | }); |
| | | // å¼å§å¤çæå°éå |
| | | if (_this.printQueue.length > 0) { |
| | | _this.processPrintQueue(); |
| | | } |
| | | } else { |
| | | _this.connectionStatus = "disconnected"; |
| | | uni.showToast({ |
| | | title: "è¿æ¥å¤±è´¥: " + (r.msg || "æªç¥é误"), |
| | | icon: "none", |
| | | duration: 2000, |
| | | }); |
| | | } |
| | | } |
| | | ); |
| | | }, |
| | | //æå°ç¸å
³ |
| | | searchDevice() { |
| | | let _this = this; |
| | | uni.openBluetoothAdapter({ |
| | | // 确认èçæ¯å¦æå¼ |
| | | success(r) { |
| | | uni.showLoading({ |
| | | title: "æç´¢ä¸...", |
| | | }); |
| | | // æªæäºèçç¸å
³æéåæªæå¼ææºå®ä½ä¼æç´¢ä¸å°è®¾å¤ |
| | | jcapi.getBluetoothDevices(function(r) { |
| | | console.log("device:" + JSON.stringify(r)); |
| | | // æç´¢å°è®¾å¤åè° |
| | | uni.hideLoading(); |
| | | // 妿ä¹åæè¿æ¥ç设å¤ä½ä¸å¨æç´¢ç»æä¸ï¼è¯´æè®¾å¤å·²æ´æ¢ |
| | | if ( |
| | | _this.connectedDevice && |
| | | !r.some((dev) => dev.address === _this.connectedDevice.address) |
| | | ) { |
| | | _this.connectedDevice = null; |
| | | uni.showToast({ |
| | | icon: "none", |
| | | title: "å·²è¿æ¥çèç设å¤å·²æ´æ¢ï¼è¯·éæ°éæ©", |
| | | duration: 2000, |
| | | }); |
| | | } |
| | | _this.listDevice = r; |
| | | _this.maskShow = true; |
| | | }); |
| | | }, |
| | | fail(e) { |
| | | uni.showModal({ |
| | | title: "æç¤º", |
| | | content: "æå¼èç失败ï¼è¯·æ£æ¥èçæ¯å¦å¼å¯", |
| | | showCancel: false, |
| | | }); |
| | | console.log("å¼å¯èç设å¤å¤±è´¥" + e); |
| | | }, |
| | | }); |
| | | }, |
| | | // ç»å¶æ¨ªçº¿ |
| | | getDrawLabelLine(x, y, width, height, rotate, lineType) { |
| | | jcapi.drawLabelLine({ |
| | | x: x, |
| | | y: y, |
| | | width: width, |
| | | height: height, |
| | | rotate: rotate, |
| | | lineType: lineType, |
| | | }); |
| | | }, |
| | | // å¡«å²æåæ é¢ |
| | | getDrawLabelText( |
| | | x, |
| | | y, |
| | | width, |
| | | height, |
| | | value, |
| | | fontSize, |
| | | rotate, |
| | | lineMode, |
| | | lineSpace, |
| | | letterSpace, |
| | | textAlignHorizontal, |
| | | textAlignVertical, |
| | | bold |
| | | ) { |
| | | jcapi.drawLabelText({ |
| | | x: x, |
| | | y: y, |
| | | width: width, |
| | | height: height, |
| | | value: value, |
| | | fontSize: fontSize, |
| | | rotate: rotate, |
| | | lineMode: lineMode, |
| | | lineSpace: lineSpace, |
| | | letterSpace: letterSpace, |
| | | textAlignHorizontal: textAlignHorizontal, |
| | | textAlignVertical: textAlignVertical, |
| | | bold: bold, |
| | | }); |
| | | }, |
| | | getConnectionStatusText() { |
| | | switch (this.connectionStatus) { |
| | | case "connected": |
| | | return "èçå·²è¿æ¥"; |
| | | case "connecting": |
| | | return "èçè¿æ¥ä¸..."; |
| | | default: |
| | | return "èçæªè¿æ¥"; |
| | | } |
| | | }, |
| | | getPrintStatusText() { |
| | | switch (this.printStatus) { |
| | | case "printing": |
| | | const total = this.printQueue.length + 1; // éåä¸å©ä½ + å½åæ£å¨æå° |
| | | const current = total - this.printQueue.length; |
| | | return `æå°ä¸(${current}/${total})`; |
| | | case "error": |
| | | return `æå°é误: ${this.errorMessage}`; |
| | | default: |
| | | return "就绪"; |
| | | } |
| | | }, |
| | | //å·æ°ä¸ä¸ä¸ªé¡µé¢ |
| | | refreshLastPage(no) { |
| | | // åç¥ A.vue æ´æ°æ°æ® |
| | | // è·å页颿 |
| | | let pages = getCurrentPages(); |
| | | // 妿ææå°ä»»å¡ï¼ç»§ç»æå° |
| | | if (this.printQueue.length) { |
| | | this.processPrintQueue(); |
| | | } |
| | | } catch (e) { |
| | | uni.showToast({ |
| | | icon: "none", |
| | | title: "è¿æ¥å¤±è´¥", |
| | | }); |
| | | } |
| | | }, |
| | | |
| | | // è·åä¸ä¸é¡µæ |
| | | let prevPage = pages[pages.length - 2]; |
| | | //æå°ç¸å
³ |
| | | async searchDevice() { |
| | | try { |
| | | uni.showLoading({ title: "æç´¢ä¸..." }); |
| | | const devices = await bluetooth.searchDevices(); |
| | | uni.hideLoading(); |
| | | |
| | | // 触åä¸ä¸é¡µ upData 彿°(å¹¶æºå¸¦åæ°) |
| | | prevPage.$vm.setNo(no); |
| | | this.listDevice = devices; |
| | | this.maskShow = true; |
| | | } catch (e) { |
| | | uni.hideLoading(); |
| | | uni.showModal({ |
| | | title: "æç¤º", |
| | | content: "请确认èçåå®ä½å·²å¼å¯", |
| | | showCancel: false, |
| | | }); |
| | | } |
| | | }, |
| | | |
| | | // è¿åä¸ä¸é¡µ |
| | | uni.navigateBack({ |
| | | delta: 1, |
| | | }); |
| | | }, |
| | | }, |
| | | }; |
| | | // ç»å¶æ¨ªçº¿ |
| | | getDrawLabelLine(x, y, width, height, rotate, lineType) { |
| | | jcapi.drawLabelLine({ |
| | | x: x, |
| | | y: y, |
| | | width: width, |
| | | height: height, |
| | | rotate: rotate, |
| | | lineType: lineType, |
| | | }); |
| | | }, |
| | | // å¡«å²æåæ é¢ |
| | | getDrawLabelText( |
| | | x, |
| | | y, |
| | | width, |
| | | height, |
| | | value, |
| | | fontSize, |
| | | rotate, |
| | | lineMode, |
| | | lineSpace, |
| | | letterSpace, |
| | | textAlignHorizontal, |
| | | textAlignVertical, |
| | | bold |
| | | ) { |
| | | jcapi.drawLabelText({ |
| | | x: x, |
| | | y: y, |
| | | width: width, |
| | | height: height, |
| | | value: value, |
| | | fontSize: fontSize, |
| | | rotate: rotate, |
| | | lineMode: lineMode, |
| | | lineSpace: lineSpace, |
| | | letterSpace: letterSpace, |
| | | textAlignHorizontal: textAlignHorizontal, |
| | | textAlignVertical: textAlignVertical, |
| | | bold: bold, |
| | | }); |
| | | }, |
| | | getConnectionStatusText() { |
| | | switch (this.connectionStatus) { |
| | | case "connected": |
| | | return "èçå·²è¿æ¥"; |
| | | case "connecting": |
| | | return "èçè¿æ¥ä¸..."; |
| | | default: |
| | | return "èçæªè¿æ¥"; |
| | | } |
| | | }, |
| | | getPrintStatusText() { |
| | | switch (this.printStatus) { |
| | | case "printing": |
| | | const total = this.printQueue.length + 1; // éåä¸å©ä½ + å½åæ£å¨æå° |
| | | const current = total - this.printQueue.length; |
| | | return `æå°ä¸(${current}/${total})`; |
| | | case "error": |
| | | return `æå°é误: ${this.errorMessage}`; |
| | | default: |
| | | return "就绪"; |
| | | } |
| | | }, |
| | | //å·æ°ä¸ä¸ä¸ªé¡µé¢ |
| | | refreshLastPage(no) { |
| | | // åç¥ A.vue æ´æ°æ°æ® |
| | | // è·å页颿 |
| | | let pages = getCurrentPages(); |
| | | |
| | | // è·åä¸ä¸é¡µæ |
| | | let prevPage = pages[pages.length - 2]; |
| | | |
| | | // 触åä¸ä¸é¡µ upData 彿°(å¹¶æºå¸¦åæ°) |
| | | prevPage.$vm.setNo(no); |
| | | |
| | | // è¿åä¸ä¸é¡µ |
| | | uni.navigateBack({ |
| | | delta: 1, |
| | | }); |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | <style lang="scss"> |
| | | .finishProductIn-locno-bg { |
| | | background-color: #f6f9ff; |
| | | background-image: url("~@/static/custom/finishProductIn/locNoBg.png"); |
| | | // background: linear-gradient(180deg,rgba(206,227,254,1),rgba(206,227,254,1) 20%,rgba(206,227,254,0.5) 40%,rgba(206,227,254,0.25) 60%,rgba(206,227,254,0.08) 80%,rgba(206,227,254,0)); |
| | | padding: 0 20rpx; |
| | | background-attachment: fixed; |
| | | background-size: 100% auto; |
| | | background-repeat: no-repeat; |
| | | position: fixed; |
| | | top: 0; |
| | | bottom: 0; |
| | | width: 100%; |
| | | z-index: -1; |
| | | } |
| | | .finishProductIn-locno-bg { |
| | | background-color: #f6f9ff; |
| | | background-image: url("~@/static/custom/finishProductIn/locNoBg.png"); |
| | | // background: linear-gradient(180deg,rgba(206,227,254,1),rgba(206,227,254,1) 20%,rgba(206,227,254,0.5) 40%,rgba(206,227,254,0.25) 60%,rgba(206,227,254,0.08) 80%,rgba(206,227,254,0)); |
| | | padding: 0 20rpx; |
| | | background-attachment: fixed; |
| | | background-size: 100% auto; |
| | | background-repeat: no-repeat; |
| | | position: fixed; |
| | | top: 0; |
| | | bottom: 0; |
| | | width: 100%; |
| | | z-index: -1; |
| | | } |
| | | |
| | | .finishProductIn-locno-search { |
| | | padding: 40rpx 30rpx 20rpx 30rpx; |
| | | } |
| | | .finishProductIn-locno-search { |
| | | padding: 40rpx 30rpx 20rpx 30rpx; |
| | | } |
| | | |
| | | .wrap .finishProductIn-locno-scroll-list { |
| | | height: calc(100vh - var(--window-top) - var(--window-bottom) - 242rpx); |
| | | width: 100%; |
| | | } |
| | | .wrap .finishProductIn-locno-scroll-list { |
| | | height: calc(100vh - var(--window-top) - var(--window-bottom) - 242rpx); |
| | | width: 100%; |
| | | } |
| | | |
| | | .finishProductIn-locno-scroll-list-group { |
| | | ::v-deep .u-cell-item-box { |
| | | background-color: rgba(250, 252, 255, 0.36) !important; |
| | | padding: 0rpx 30rpx; |
| | | } |
| | | .finishProductIn-locno-scroll-list-group { |
| | | ::v-deep .u-cell-item-box { |
| | | background-color: rgba(250, 252, 255, 0.36) !important; |
| | | padding: 0rpx 30rpx; |
| | | } |
| | | |
| | | .content { |
| | | font-size: 12px; |
| | | background-color: #ffffff; |
| | | box-sizing: border-box; |
| | | border-radius: 10rpx; |
| | | margin: 0rpx 0rpx 16rpx; |
| | | padding: 20rpx 8rpx; |
| | | box-shadow: none; |
| | | display: flex; |
| | | align-items: center; |
| | | .content { |
| | | font-size: 12px; |
| | | background-color: #ffffff; |
| | | box-sizing: border-box; |
| | | border-radius: 10rpx; |
| | | margin: 0rpx 0rpx 16rpx; |
| | | padding: 20rpx 8rpx; |
| | | box-shadow: none; |
| | | display: flex; |
| | | align-items: center; |
| | | |
| | | .content-header { |
| | | width: 40rpx; |
| | | height: 90rpx; |
| | | display: flex; |
| | | align-items: center; |
| | | .content-header { |
| | | width: 40rpx; |
| | | height: 90rpx; |
| | | display: flex; |
| | | align-items: center; |
| | | |
| | | .content-header-icon { |
| | | background-image: url("~@/static/custom/moveWareHouse/header_icon.png"); |
| | | background-size: 100% auto; |
| | | background-repeat: no-repeat; |
| | | height: 28rpx; |
| | | width: 28rpx; |
| | | } |
| | | .content-header-icon { |
| | | background-image: url("~@/static/custom/moveWareHouse/header_icon.png"); |
| | | background-size: 100% auto; |
| | | background-repeat: no-repeat; |
| | | height: 28rpx; |
| | | width: 28rpx; |
| | | } |
| | | |
| | | .content-header-title { |
| | | margin-left: 11rpx; |
| | | font-size: 26rpx; |
| | | font-weight: bold; |
| | | color: #3d52f5; |
| | | } |
| | | } |
| | | .content-header-title { |
| | | margin-left: 11rpx; |
| | | font-size: 26rpx; |
| | | font-weight: bold; |
| | | color: #3d52f5; |
| | | } |
| | | } |
| | | |
| | | .content-body { |
| | | flex: 1; |
| | | background: #f5f9ff; |
| | | border-radius: 10rpx; |
| | | padding: 0rpx 23rpx; |
| | | .content-body { |
| | | flex: 1; |
| | | background: #f5f9ff; |
| | | border-radius: 10rpx; |
| | | padding: 0rpx 23rpx; |
| | | |
| | | .row-list { |
| | | height: 60rpx; |
| | | display: flex; |
| | | flex-direction: row; |
| | | padding: 0px; |
| | | align-items: center; |
| | | } |
| | | .row-list { |
| | | height: 60rpx; |
| | | display: flex; |
| | | flex-direction: row; |
| | | padding: 0px; |
| | | align-items: center; |
| | | } |
| | | |
| | | .row-list ._label { |
| | | display: flex; |
| | | flex: 0.8; |
| | | color: #909399; |
| | | align-items: center; |
| | | .row-list ._label { |
| | | display: flex; |
| | | flex: 0.8; |
| | | color: #909399; |
| | | align-items: center; |
| | | |
| | | ._label-icon-1 { |
| | | background-image: url("~@/static/custom/moveWareHouse/label-icon-1.png"); |
| | | background-size: 100% auto; |
| | | background-repeat: no-repeat; |
| | | height: 26rpx; |
| | | width: 26rpx; |
| | | } |
| | | ._label-icon-1 { |
| | | background-image: url("~@/static/custom/moveWareHouse/label-icon-1.png"); |
| | | background-size: 100% auto; |
| | | background-repeat: no-repeat; |
| | | height: 26rpx; |
| | | width: 26rpx; |
| | | } |
| | | |
| | | ._label-icon-2 { |
| | | background-image: url("~@/static/custom/moveWareHouse/label-icon-2.png"); |
| | | background-size: 100% auto; |
| | | background-repeat: no-repeat; |
| | | height: 26rpx; |
| | | width: 26rpx; |
| | | } |
| | | ._label-icon-2 { |
| | | background-image: url("~@/static/custom/moveWareHouse/label-icon-2.png"); |
| | | background-size: 100% auto; |
| | | background-repeat: no-repeat; |
| | | height: 26rpx; |
| | | width: 26rpx; |
| | | } |
| | | |
| | | ._label-icon-3 { |
| | | background-image: url("~@/static/custom/moveWareHouse/label-icon-3.png"); |
| | | background-size: 100% auto; |
| | | background-repeat: no-repeat; |
| | | height: 26rpx; |
| | | width: 26rpx; |
| | | } |
| | | ._label-icon-3 { |
| | | background-image: url("~@/static/custom/moveWareHouse/label-icon-3.png"); |
| | | background-size: 100% auto; |
| | | background-repeat: no-repeat; |
| | | height: 26rpx; |
| | | width: 26rpx; |
| | | } |
| | | |
| | | ._label-name { |
| | | margin-left: 11rpx; |
| | | font-size: 26rpx; |
| | | font-weight: 500; |
| | | color: #666666; |
| | | } |
| | | } |
| | | ._label-name { |
| | | margin-left: 11rpx; |
| | | font-size: 26rpx; |
| | | font-weight: 500; |
| | | color: #666666; |
| | | } |
| | | } |
| | | |
| | | .row-list ._content { |
| | | flex: 1.5; |
| | | text-align: right; |
| | | color: #909399; |
| | | font-size: 24rpx; |
| | | } |
| | | .row-list ._content { |
| | | flex: 1.5; |
| | | text-align: right; |
| | | color: #909399; |
| | | font-size: 24rpx; |
| | | } |
| | | |
| | | .row-list .s1 { |
| | | color: #d35651; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | .row-list .s1 { |
| | | color: #d35651; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | .navbar-right { |
| | | font-weight: 500; |
| | | font-size: 13px; |
| | | color: #0b0b0b; |
| | | line-height: 36rpx; |
| | | margin-right: 32rpx; |
| | | } |
| | | .navbar-right { |
| | | font-weight: 500; |
| | | font-size: 13px; |
| | | color: #0b0b0b; |
| | | line-height: 36rpx; |
| | | margin-right: 32rpx; |
| | | } |
| | | |
| | | /* æ¨¡ææ¡æ ·å¼ä¼å */ |
| | | .u-modal { |
| | | --modal-width: 85% !important; |
| | | --modal-radius: 16rpx !important; |
| | | --modal-bg-color: #ffffff !important; |
| | | } |
| | | /* æ¨¡ææ¡æ ·å¼ä¼å */ |
| | | .u-modal { |
| | | --modal-width: 85% !important; |
| | | --modal-radius: 16rpx !important; |
| | | --modal-bg-color: #ffffff !important; |
| | | } |
| | | |
| | | /* æ¨¡ææ¡å
容åºå */ |
| | | .uni-scroll_box { |
| | | height: 500rpx !important; |
| | | padding: 20rpx; |
| | | } |
| | | /* æ¨¡ææ¡å
容åºå */ |
| | | .uni-scroll_box { |
| | | height: 500rpx !important; |
| | | padding: 20rpx; |
| | | } |
| | | |
| | | /* 设å¤åè¡¨é¡¹æ ·å¼ */ |
| | | .device-item { |
| | | background-color: #f5f9ff; |
| | | border-radius: 12rpx; |
| | | padding: 20rpx; |
| | | margin-bottom: 16rpx; |
| | | box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.05); |
| | | } |
| | | /* 设å¤åè¡¨é¡¹æ ·å¼ */ |
| | | .device-item { |
| | | background-color: #f5f9ff; |
| | | border-radius: 12rpx; |
| | | padding: 20rpx; |
| | | margin-bottom: 16rpx; |
| | | box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.05); |
| | | } |
| | | |
| | | /* 设å¤åç§°æ ·å¼ */ |
| | | .device-name { |
| | | font-size: 28rpx; |
| | | font-weight: 500; |
| | | color: #333333; |
| | | margin-bottom: 10rpx; |
| | | display: flex; |
| | | justify-content: space-between; |
| | | } |
| | | /* 设å¤åç§°æ ·å¼ */ |
| | | .device-name { |
| | | font-size: 28rpx; |
| | | font-weight: 500; |
| | | color: #333333; |
| | | margin-bottom: 10rpx; |
| | | display: flex; |
| | | justify-content: space-between; |
| | | } |
| | | |
| | | /* UUIDææ¬æ ·å¼ */ |
| | | .device-uuid { |
| | | font-size: 28rpx; |
| | | font-weight: 500; |
| | | color: #333333; |
| | | margin-bottom: 10rpx; |
| | | display: flex; |
| | | justify-content: space-between; |
| | | } |
| | | /* UUIDææ¬æ ·å¼ */ |
| | | .device-uuid { |
| | | font-size: 28rpx; |
| | | font-weight: 500; |
| | | color: #333333; |
| | | margin-bottom: 10rpx; |
| | | display: flex; |
| | | justify-content: space-between; |
| | | } |
| | | |
| | | /* æ¨¡ææ¡æ é¢ */ |
| | | .modal-title { |
| | | font-size: 32rpx; |
| | | font-weight: bold; |
| | | color: #333333; |
| | | text-align: center; |
| | | margin-bottom: 20rpx; |
| | | padding-bottom: 10rpx; |
| | | border-bottom: 1rpx solid #eeeeee; |
| | | } |
| | | /* æ¨¡ææ¡æ é¢ */ |
| | | .modal-title { |
| | | font-size: 32rpx; |
| | | font-weight: bold; |
| | | color: #333333; |
| | | text-align: center; |
| | | margin-bottom: 20rpx; |
| | | padding-bottom: 10rpx; |
| | | border-bottom: 1rpx solid #eeeeee; |
| | | } |
| | | |
| | | /* ç©ºç¶ææç¤º */ |
| | | .empty-tip { |
| | | text-align: center; |
| | | padding: 100rpx 0; |
| | | color: #999999; |
| | | font-size: 28rpx; |
| | | } |
| | | /* ç©ºç¶ææç¤º */ |
| | | .empty-tip { |
| | | text-align: center; |
| | | padding: 100rpx 0; |
| | | color: #999999; |
| | | font-size: 28rpx; |
| | | } |
| | | |
| | | .status-indicator { |
| | | padding: 8rpx 16rpx; |
| | | font-size: 24rpx; |
| | | text-align: center; |
| | | color: #fff; |
| | | background-color: #666; |
| | | .status-indicator { |
| | | padding: 8rpx 16rpx; |
| | | font-size: 24rpx; |
| | | text-align: center; |
| | | color: #fff; |
| | | background-color: #666; |
| | | |
| | | &.connected { |
| | | background-color: #07c160; |
| | | } |
| | | &.connected { |
| | | background-color: #07c160; |
| | | } |
| | | |
| | | &.connecting { |
| | | background-color: #ff976a; |
| | | } |
| | | &.connecting { |
| | | background-color: #ff976a; |
| | | } |
| | | |
| | | &.disconnected { |
| | | background-color: #f53f3f; |
| | | } |
| | | &.disconnected { |
| | | background-color: #f53f3f; |
| | | } |
| | | |
| | | .print-status { |
| | | margin-left: 10rpx; |
| | | font-size: 22rpx; |
| | | } |
| | | } |
| | | .print-status { |
| | | margin-left: 10rpx; |
| | | font-size: 22rpx; |
| | | } |
| | | } |
| | | </style> |