wtt
2025-09-11 8446232ae5dbee360a585e311c4bf4d25fc9e4e7
pages/caigoudingdan/generate.vue
@@ -39,8 +39,8 @@
         </view>
         <view class="form-item">
            <view class="title">每箱数量:</view>
            <view class="right">
               <input v-model="baseInfo.HMinQty" type="number" placeholder="请输入数量" @confirm="getNum()"
            <view class="righton">
               <input disabled v-model="baseInfo.HMinQty" type="number" placeholder="请输入数量" @confirm="getNum()"
                  @blur="getNum()" />
            </view>
         </view>
@@ -55,8 +55,8 @@
      <view style="width: 100%;height: 16rpx;background-color: #e5e5e5;"></view>
      <view class="list" v-for="(item,index) in listData" :key="index">
         <uni-card :title="item.物料代码" :extra="'No. ' + Number(index+1)" style="margin: 10px;">
      <view class="list" v-for="(item,index) in listData" :key="item['行号']">
         <uni-card :title="item.物料代码" :extra="'行号. ' + item['行号']" style="margin: 10px;">
            <view class="card-detail">
               <view class="detail">
                  <text>物料名称:</text>{{item.物料名称}}
@@ -111,7 +111,7 @@
            baseInfo: {
               HMainID: '',
               HSubID: '',
               HOrderBillNo: '',
               HInnerBillNo: '',
               HMaterID: '',
               // barCodeNo: '',
               HBillNo: '',
@@ -133,9 +133,9 @@
               HSourceBillNo: '',
               HMaker: getUserInfo()["Czymc"],
               HSupNumber: '',
               HStyleNo: '',
               HGroup: '',
               HCustomNo: '',
               HCoilNO: '',
               HFurnaceNO: '',
               HFactory: '',
            },
            sWhere: '',
            listData: [],
@@ -149,7 +149,11 @@
         console.log("页面传递参数: ", e)
         this.OperationType = e.OperationType
         this.billNo = e.billNo
         this.baseInfo.HBillNo = e.billNo
         this.baseInfo.HBillLineNo = e.lineNo
         this.lineNo = e.lineNo
         this.baseInfo.HSourceBillNo = e.billNo
         this.baseInfo.HInnerBillNo = e.billNo
         this.getData()
      },
      methods: {
@@ -171,7 +175,7 @@
                        HMaterNumber: d['物料编码'],
                        HMaterName: d['物料名称'],
                        HMaterModel: d['规格型号'],
                        // HBatchNo: d['批号'],
                        HBatchNo: d['批号'],
                        HQty: d['数量'],
                        HMinQty: d['数量'],
                        HBQty: d['数量'],
@@ -181,14 +185,14 @@
                        HUnitID: d['HUnitID'],
                        HPcsName: d['计量单位'],
                        HSupNameShort: d['供应商'],
                        HMTONo: d['计划跟踪号'],
                        HMTONo: d['计划跟踪号'].trim(),
                        HMainID: d['hmainid'],
                        HSubID: d['HEntryID'],
                        HMaterID: d['HMaterID'],
                        HDate: d['日期'],
                        HStyleNo: d['款号'],
                        HGroup: d['分组'],
                        HCustomNo: d['客户编号']
                        HCoilNO: d['款号'],
                        HFurnaceNO: d['分组'],
                        HFactory: d['客户编号']
                     })
                     console.log(this.baseInfo)
                     // CommonUtils.playSound(1)
@@ -224,13 +228,14 @@
            if (this.$printer.isConnected() === false) {
               this.$refs.labelPrinter.openPopup()
            } else {
               let HBarCodeNoStr =
               `${this.baseInfo.HBillNo}@${this.baseInfo.HBillLineNo}@${this.baseInfo.HMaterNumber || ''}@${this.baseInfo.HMTONo || ''}@${this.baseInfo.HQty || 0}@${this.baseInfo.HSupNumber  || ''}`
               let pcsInfo = this.baseInfo.HPcsName ? '(' + this.baseInfo.HPcsName + ')' : ''
               let printContent = []
               let printInfoBuffer = []
               let count = 0
               for (let listOne of this.listData) {
                  let HBarCodeNoStr =
                     `${this.baseInfo.HBillNo}@${this.baseInfo.HBillLineNo}@${this.baseInfo.HMaterNumber || ''}@${this.baseInfo.HMTONo || ''}@${this.baseInfo.HQty || 0}@${this.baseInfo.HSupNumber  || ''}`
                  let pcsInfo = this.baseInfo.HPcsName ? '(' + this.baseInfo.HPcsName + ')' : ''
                  printContent.push(`! 0 200 200 400 1
PAGE-WIDTH 608
SETQRVER 3
@@ -243,11 +248,11 @@
T 55 0 0 100 (Supplier Sku No.)
T 24 0 0 120 物料名称: ${this.baseInfo.HMaterName}
T 55 0 0 145 (Material Code)
T 24 0 0 165 款号: ${this.baseInfo.HStyleNo}
T 24 0 0 165 款号: ${this.baseInfo.HCoilNO}
T 55 0 0 190 (Style No.)
T 24 0 300 165 客户编号: ${this.baseInfo.HCustomNo}
T 24 0 300 165 客户编号: ${this.baseInfo.HFactory}
T 55 0 300 190 (Consumer No.)
T 24 0 0 210 分组: ${this.baseInfo.HGroup || ''}
T 24 0 0 210 分组: ${this.baseInfo.HFurnaceNO || ''}
T 55 0 0 235 (Group) 
T 24 0 300 210 规格: ${this.baseInfo.HMaterModel}
T 55 0 300 235 (SKU NO.) 
@@ -291,7 +296,7 @@
         },
         getList() {
            let HBarCodeNoStr =
                `${this.baseInfo.HBillNo}@${this.baseInfo.HBillLineNo}@${this.baseInfo.HMaterNumber || ''}@${this.baseInfo.HMTONo || ''}@${this.baseInfo.HQty || 0}@${this.baseInfo.HSupNumber  || ''}`
               `${this.baseInfo.HBillNo}@${this.baseInfo.HBillLineNo}@${this.baseInfo.HMaterNumber || ''}@${this.baseInfo.HMTONo || ''}@${this.baseInfo.HQty || 0}@${this.baseInfo.HSupNumber  || ''}`
            var sMain = []
            sMain[0] = this.baseInfo
            var sMainStr = JSON.stringify(sMain);
@@ -306,53 +311,59 @@
            //获取当前登录人员
            var UserName = uni.getStorageSync('HUserName');
            let sMainSub = sMainStr + ';' + HOrgType + ';' + HSourceBillType + ';' + HSelectBarCodeType + ';' +
                CampanyName + ';' + UserName + ';' + HBarCodeNoStr;
               CampanyName + ';' + UserName + ';' + HBarCodeNoStr +
               ';' + this.baseInfo.HFactory + ';' + this.baseInfo.HCoilNO +
               ';' + this.baseInfo.HFurnaceNO  + '';
            CommonUtils.doRequest(
                "/Sc_BarCode/SaveBarCode_NoGenerate", {
                    msg: sMainSub,
                    CampanyName: CampanyName
                },
                (res) => {
                    console.log(res)
                    let {
                        data,
                        count,
                        Message
                    } = res.data
                    if (count > 0) {
                        // this.generatedBarCode = data[0]['条码编号']/
                        // console.log(this.generatedBarCode)
                        uni.showToast({
                            icon: 'none',
                            title: Message
                        })
               "/Sc_BarCode/SaveBarCode_NoGenerate", {
                  msg: sMainSub,
                  CampanyName: CampanyName
               },
               (res) => {
                  console.log(res)
                  let {
                     data,
                     count,
                     Message
                  } = res.data
                  if (count > 0) {
                     // this.generatedBarCode = data[0]['条码编号']/
                     // console.log(this.generatedBarCode)
                     uni.showToast({
                        icon: 'none',
                        title: Message
                     })
                     this.codeGenComplete = true
                        this.buttonStatus = {
                            btn1: true,
                            btn2: false
                        }
                    } else {
                        this.buttonStatus = {
                            btn1: false,
                            btn2: false
                        }
                        uni.showToast({
                            icon: 'none',
                            title: Message
                        })
                    }
                },
                (err) => {
                    this.buttonStatus = {
                        btn1: false,
                        btn2: false
                    }
                    uni.showToast({
                        icon: 'none',
                        title: err
                    })
                },
                "POST"
                     this.buttonStatus = {
                        btn1: true,
                        btn2: false
                     }
                     for (let listOne of this.listData) {
                        listOne['条码编号'] = HBarCodeNoStr
                     }
                  } else {
                     this.buttonStatus = {
                        btn1: false,
                        btn2: false
                     }
                     uni.showToast({
                        icon: 'none',
                        title: Message
                     })
                  }
               },
               (err) => {
                  this.buttonStatus = {
                     btn1: false,
                     btn2: false
                  }
                  uni.showToast({
                     icon: 'none',
                     title: err
                  })
               },
               "POST"
            )
         }
      }
@@ -381,20 +392,20 @@
      }
      .right {
         width: 450rpx;
         flex: 1;
         border-radius: 22rpx;
         border: 1px solid #acacac;
      }
      .righton {
         width: 450rpx;
         flex: 1;
         border-radius: 22rpx;
         border: 1px solid #e4e4e4;
         background-color: #e4e4e4;
      }
      input {
         width: 100%;
         width: inherit;
         padding: 8rpx 20rpx;
         font-size: 30rpx;
      }
@@ -437,6 +448,7 @@
   .list {
      width: 100%;
      word-break: break-all;
      .card-detail {
         width: 100%;