| | |
| | | <view class="operation-zone"> |
| | | <button class="btn-c" @click="searchbarCodeInfoMeta">拆码</button> |
| | | <button type="default" :class="cantGenerate?'':'btn-c'" @click="SaveBarCodeCreate" |
| | | :disabled="cantGenerate">生成</button> |
| | | <button type="default" :class="cantPrint?'':'btn-c'" @click="PrintHBarCode" :disabled="cantPrint" >打印</button> |
| | | :disabled="cantGenerate = false">生成</button> |
| | | <button type="default" :class="cantPrint?'':'btn-c'" @click="PrintHBarCode" |
| | | :disabled="cantPrint = false">打印</button> |
| | | </view> |
| | | </view> |
| | | <view class="divide"></view> |
| | |
| | | CommonUtils, |
| | | userInfo: getUserInfo(), |
| | | serverUrl: 'http://192.168.2.227:8082/API', |
| | | // serverUrl: 'http://47.96.97.237/API/', |
| | | barCodeInfoMeta: { |
| | | barCodeNo: "", |
| | | splitNum: "", |
| | |
| | | }) |
| | | } |
| | | this.doRequest( |
| | | urlEncode, |
| | | null, |
| | | function(res) { |
| | | urlEncode, {}, |
| | | (res) => { |
| | | console.log(res) |
| | | let res1 = res.data |
| | | let {data,count} = res1 |
| | | let { |
| | | data, |
| | | count |
| | | } = res1 |
| | | if (count > 0) { |
| | | this.barCodeInfo = data[0] |
| | | this.barCodeSplitInfo= [] |
| | | } |
| | | }, |
| | | function(err) { |
| | | (err) => { |
| | | console.err(err) |
| | | } |
| | | ) |
| | | }, |
| | | dialogInputConfirm(val) { |
| | | this.itemCache["HSplitNum"] = val |
| | | |
| | | // 关闭窗口后,恢复默认内容 |
| | | this.$refs.inputDialog.close() |
| | | |
| | | }, |
| | | //拆码按钮调用 |
| | | async searchbarCodeInfoMeta() { |
| | |
| | | title: '拆分数量不能大于条码原数量!' |
| | | }); |
| | | } |
| | | this.doRequest( |
| | | "/Sc_BarCode/SplitBarCode_Sub", { |
| | | HBarCodeNo: this.barCodeInfoMeta.barCodeNo |
| | | |
| | | uni.request({ |
| | | url: this.serverUrl + '/Sc_BarCode/SplitBarCode_Sub', |
| | | data: { |
| | | HBarCodeNo: this.barCodeInfoMeta.barCodeNo, |
| | | }, |
| | | function(res) { |
| | | console.log(res) |
| | | success: (res) => { |
| | | this.barCodeSplitInfo = [] |
| | | if (res.data.count > 0) { |
| | | |
| | |
| | | } |
| | | |
| | | //拆分条码:数量为 splitNum |
| | | let barCodeItem1 = JSON.parse(JSON.stringify(res.data.data.SubBarCodes[0])); |
| | | barCodeItem1.HSplitNum = this.barCodeInfoMeta.splitNum; |
| | | barCodeItem1.HBarCode = res.data.data.NextBarCode; |
| | | this.barCodeSplitInfo.push(barCodeItem1); |
| | | // let barCodeItem1 = JSON.parse(JSON.stringify(res.data.data.SubBarCodes[0])); |
| | | let HSplitNum = this.barCodeInfoMeta.splitNum; |
| | | let HBarCode = res.data.data.NextBarCode; |
| | | console.log('HBarCode: ',HBarCode); |
| | | this.barCodeSplitInfo.push({ |
| | | HSplitNum: this.barCodeInfoMeta.splitNum, |
| | | HBarCode: res.data.data.NextBarCode |
| | | }); |
| | | |
| | | //更新原先条码数量 |
| | | this.barCodeInfo['剩余数量'] = this.barCodeInfo['数量'] - this.barCodeInfoMeta.splitNum; |
| | |
| | | }); |
| | | } |
| | | }, |
| | | function(err) { |
| | | fail: (err) => { |
| | | console.error(err) |
| | | } |
| | | ) |
| | | }) |
| | | |
| | | // this.doRequest( |
| | | // "/Sc_BarCode/SplitBarCode_Sub", |
| | | // { |
| | | // HBarCodeNo: this.barCodeInfoMeta.barCodeNo, |
| | | // }, |
| | | // (res) => { |
| | | // this.barCodeSplitInfo = [] |
| | | // if (res.data.count > 0) { |
| | | |
| | | // if (res.data.data.length < 1) { |
| | | // return uni.showToast({ |
| | | // icon: 'none', |
| | | // title: Message |
| | | // }); |
| | | // } |
| | | |
| | | // //拆分条码:数量为 splitNum |
| | | // let barCodeItem1 = JSON.parse(JSON.stringify(res.data.data.SubBarCodes[0])); |
| | | // HSplitNum = this.barCodeInfoMeta.splitNum; |
| | | // HBarCode = res.data.NextBarCode; |
| | | // this.barCodeSplitInfo.push({ |
| | | // HSplitNum: this.barCodeInfoMeta.splitNum, |
| | | // HBarCode: res.data.NextBarCode |
| | | // }); |
| | | |
| | | // //更新原先条码数量 |
| | | // this.barCodeInfo['剩余数量'] = this.barCodeInfo['数量'] - this.barCodeInfoMeta.splitNum; |
| | | |
| | | // this.cantGenerate = false; |
| | | // } else { |
| | | // uni.showToast({ |
| | | // icon: 'none', |
| | | // title: '没有找到对应的单据' |
| | | // }); |
| | | // } |
| | | // }, |
| | | // (err) => { |
| | | // console.error(err) |
| | | // } |
| | | // ) |
| | | }, |
| | | //保存方法 |
| | | SaveBarCodeCreate() { |
| | |
| | | "/Sc_BarCode/SplitBarCode_Save", { |
| | | msg: msg |
| | | }, |
| | | function(res) { |
| | | (res) => { |
| | | if (res.data.code == 1) { |
| | | this.cantGenerate = true |
| | | this.cantPrint=false |
| | |
| | | } |
| | | |
| | | }, |
| | | function(err) { |
| | | (err) => { |
| | | console.err(err) |
| | | }, |
| | | "POST" |
| | |
| | | async PrintHBarCode() { |
| | | if (this.$printer.isConnected() === false) { |
| | | this.$refs.labelPrinter.openPopup() |
| | | } |
| | | else |
| | | { |
| | | } else { |
| | | let HBarCodeNoStr =`${this.barCodeSplitInfo[0]['HBarCode']}` |
| | | this.printInfo = `! 0 200 200 400 1 |
| | | PAGE-WIDTH 608 |
| | |
| | | B QR 475 15 Q 0 U 3 |
| | | LA,${HBarCodeNoStr} |
| | | ENDQR |
| | | T 24 0 0 30 供应商: ${this.lailiaoInfo.HSupName} |
| | | T 24 0 0 30 供应商: |
| | | T 55 0 0 55 (Supplier) |
| | | T 24 0 0 75 供应商料号: ${this.lailiaoInfo.HMaterNumber} |
| | | T 24 0 0 75 供应商料号: |
| | | T 55 0 0 100 (Supplier Sku No.) |
| | | T 24 0 0 120 物料名称: ${this.lailiaoInfo.HMaterName} |
| | | T 24 0 0 120 物料名称: |
| | | T 55 0 0 145 (Material Code) |
| | | T 24 0 0 165 款号: ${this.lailiaoInfo.HCoilNO} |
| | | T 24 0 0 165 款号: |
| | | T 55 0 0 190 (Style No.) |
| | | T 24 0 300 165 客户编号: ${this.lailiaoInfo.HFactory} |
| | | T 24 0 300 165 客户编号: |
| | | T 55 0 300 190 (Consumer No.) |
| | | T 24 0 0 210 分组: ${this.lailiaoInfo.HFurnaceNO || ''} |
| | | T 24 0 0 210 分组: |
| | | T 55 0 0 235 (Group) |
| | | T 24 0 300 210 规格: ${this.lailiaoInfo.HMaterModel} |
| | | T 24 0 300 210 规格: |
| | | T 55 0 300 235 (SKU NO.) |
| | | T 24 0 0 255 数量: ${ parseFloat(this.lailiaoInfo.HQty || 0).toFixed(0) } ${pcsInfo} |
| | | T 24 0 0 255 数量: |
| | | T 55 0 0 280 (Quantity) |
| | | T 24 0 300 255 日期: ${this.lailiaoInfo.HDate || ''} |
| | | T 24 0 300 255 日期: |
| | | T 55 0 300 280 (Date) |
| | | T 24 0 0 300 检验员: |
| | | T 55 0 0 325 (QC) |
| | | T 24 0 300 300 采购单号: ${this.lailiaoInfo.HBillNo || ''} |
| | | T 24 0 300 300 采购单号: |
| | | T 55 0 300 325 (Purchase Order No.) |
| | | T 24 0 0 345 检验结果: |
| | | T 55 0 0 370 (Inspection status) |
| | |
| | | T 55 0 440 370 (Spec. accepted) |
| | | FORM |
| | | PRINT` |
| | | console.log('printInfo: ',this.printInfo); |
| | | await this.$nextTick(() => { |
| | | this.$refs.labelPrinter.execPrint() |
| | | }) |
| | |
| | | }) |
| | | } |
| | | }, |
| | | onLoad() { |
| | | } |
| | | onLoad() {} |
| | | } |
| | | </script> |
| | | |