| | |
| | | <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" |
| | | > |
| | | <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="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 |
| | | > |
| | | <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)" |
| | | > |
| | | <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">{{ index + 1 }}</view> |
| | | </view> |
| | |
| | | </view> |
| | | </u-cell-group> |
| | | <view class="loadmore" @click="getmoreList()"> |
| | | <u-loadmore |
| | | :status="status" |
| | | :load-text="loadText" |
| | | @loadmore="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" |
| | | > |
| | | <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 v-for="(item, index) in listDevice" :key="index" @click="tapQuery(item)" class="device-item"> |
| | | <view class="device-name"> |
| | | <text>名称:</text> |
| | | <text>{{ item.name || "未知设备" }}</text> |
| | |
| | | this.connectionStatus = "connecting"; |
| | | |
| | | // 尝试重新连接 |
| | | jcapi.openPrinterByDevice( |
| | | { |
| | | jcapi.openPrinterByDevice({ |
| | | address: savedConnection.address, |
| | | name: savedConnection.name, |
| | | deviceType: 0, // 设备类型:0-蓝牙,1-网络 |
| | |
| | | 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, 21, 42, 0.3, 0, LineType.Solid); |
| | | this.getDrawLabelLine(1, 27, 67, 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.getDrawLabelText( |
| | | 2, |
| | | 22.5, |
| | | 23.5, |
| | | 25, |
| | | 8, |
| | | "发货/装箱数:", |
| | |
| | | ); |
| | | this.getDrawLabelText( |
| | | 2, |
| | | 27.5, |
| | | 28.5, |
| | | 25, |
| | | 8, |
| | | "生产日期:", |
| | |
| | | ); |
| | | this.getDrawLabelText( |
| | | 17, |
| | | 22.5, |
| | | 23.5, |
| | | 27, |
| | | 8, |
| | | fh, |
| | |
| | | ); |
| | | this.getDrawLabelText( |
| | | 14, |
| | | 27.5, |
| | | 28.5, |
| | | 55, |
| | | 8, |
| | | scdt, |
| | |
| | | let imageJsonObj = jcapi.generateLabelJson(); |
| | | |
| | | // 设置打印任务 |
| | | jcapi.startJob( |
| | | { |
| | | jcapi.startJob({ |
| | | totalCount: 1, |
| | | density: this.printDensity, |
| | | labelType: this.labelType, |
| | |
| | | }, 20000); |
| | | |
| | | jcapi.printData( |
| | | imageJsonObj, |
| | | { |
| | | imageJsonObj, { |
| | | printQuantity: 1, |
| | | }, |
| | | function (r) { |
| | | if (r.code != 0) { |
| | | // 恢复原始回调 |
| | | jcapi.didReadPrintCountInfo(originalPrintCountCallback); |
| | | jcapi.didReadPrintCountInfo( |
| | | originalPrintCountCallback); |
| | | // 结束当前打印任务 |
| | | reject(new Error(r.msg || "打印失败")); |
| | | } |
| | |
| | | // 设置为连接中状态 |
| | | this.connectionStatus = "connecting"; |
| | | |
| | | jcapi.openPrinterByDevice( |
| | | { |
| | | jcapi.openPrinterByDevice({ |
| | | address: item.address, |
| | | name: item.name, |
| | | deviceType: 0, // 设备类型:0-蓝牙,1-网络 |