yyb
2025-10-20 f6fb40bfcfb844f96174e08ea0d3dfb4359377f7
pages/wareHouse/nuclearScale/nuclearscalerecord.vue
@@ -1,49 +1,26 @@
<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>
@@ -124,31 +101,18 @@
          </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>
@@ -277,8 +241,7 @@
          this.connectionStatus = "connecting";
          // 尝试重新连接
          jcapi.openPrinterByDevice(
            {
                  jcapi.openPrinterByDevice({
              address: savedConnection.address,
              name: savedConnection.name,
              deviceType: 0, // 设备类型:0-蓝牙,1-网络
@@ -536,8 +499,8 @@
          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);
@@ -611,7 +574,7 @@
          );
          this.getDrawLabelText(
            2,
            22.5,
                     23.5,
            25,
            8,
            "发货/装箱数:",
@@ -626,7 +589,7 @@
          );
          this.getDrawLabelText(
            2,
            27.5,
                     28.5,
            25,
            8,
            "生产日期:",
@@ -733,7 +696,7 @@
          );
          this.getDrawLabelText(
            17,
            22.5,
                     23.5,
            27,
            8,
            fh,
@@ -748,7 +711,7 @@
          );
          this.getDrawLabelText(
            14,
            27.5,
                     28.5,
            55,
            8,
            scdt,
@@ -810,8 +773,7 @@
          let imageJsonObj = jcapi.generateLabelJson();
          // 设置打印任务
          jcapi.startJob(
            {
                  jcapi.startJob({
              totalCount: 1,
              density: this.printDensity,
              labelType: this.labelType,
@@ -843,14 +805,14 @@
                }, 20000);
                jcapi.printData(
                  imageJsonObj,
                  {
                              imageJsonObj, {
                    printQuantity: 1,
                  },
                  function (r) {
                    if (r.code != 0) {
                      // 恢复原始回调
                      jcapi.didReadPrintCountInfo(originalPrintCountCallback);
                                    jcapi.didReadPrintCountInfo(
                                       originalPrintCountCallback);
                      // 结束当前打印任务
                      reject(new Error(r.msg || "打印失败"));
                    }
@@ -875,8 +837,7 @@
      // 设置为连接中状态
      this.connectionStatus = "connecting";
      jcapi.openPrinterByDevice(
        {
            jcapi.openPrinterByDevice({
          address: item.address,
          name: item.name,
          deviceType: 0, // 设备类型:0-蓝牙,1-网络