| | |
| | | <view class="form-item"> |
| | | <view class="title">每箱数量:</view> |
| | | <view class="righton"> |
| | | <input disabled="" v-model="baseInfo.HMinQty" type="number" placeholder="请输入数量" @confirm="getNum()" @blur="getNum()"/> |
| | | <input disabled="" v-model="baseInfo.HMinQty" type="number" placeholder="请输入数量" @confirm="getNum()" |
| | | @blur="getNum()" /> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | |
| | | <view class="buttons"> |
| | | <button class="btn-b" size="mini" type="default" @tap="getList()">条码生成</button> |
| | | <!-- <button class="btn-c" size="mini" type="default" @tap="searchLabelPrinter()">搜索打印机</button> --> |
| | | <button :class="codeGenComplete == false? 'btn-a': 'btn-c'" :disabled="codeGenComplete == false" size="mini" type="default" |
| | | @tap="search">打印</button> |
| | | </view> |
| | | </view> |
| | | |
| | |
| | | <text>条码编号:</text>{{item.条码编号}} |
| | | </view> |
| | | </view> |
| | | <view class="detail" style="text-align: right;" @tap.stop="labelPrint(item)"><text style="color: orange;">点击打印条码</text></view> |
| | | <!-- <view class="detail" style="text-align: right;" @tap.stop="labelPrint(item)"><text |
| | | style="color: orange;">点击打印条码</text></view> --> |
| | | </uni-card> |
| | | </view> |
| | | |
| | | <view class="over" v-if="listData.length == 0">暂无数据</view> |
| | | <view class="over" v-if="listData.length != 0">已到底</view> |
| | | |
| | | <labelPrinterComponentVue ref="labelPrinter" :printInfo="printInfo" :printMode="'cpcl'"></labelPrinterComponentVue> |
| | | <labelPrinterComponentVue ref="labelPrinter" :printInfo="printInfo" :printMode="'cpcl'"> |
| | | </labelPrinterComponentVue> |
| | | |
| | | <!-- 打印机选择列表 --> |
| | | <view v-if="maskShow" class="uni-mask" @tap="maskShow = false"> |
| | | <scroll-view class="uni-scroll_box" scroll-y> |
| | | <view class="uni-list-box" v-for="(device, index) in discoveredDevices" :key="index" @tap="connectBT(device)"> |
| | | <view class="uni-list-box" v-for="(device, index) in discoveredDevices" :key="index" |
| | | @tap="connectBT(device)"> |
| | | <view class="uni-list_name">名称:{{ device.name }}</view> |
| | | <view class="uni-list_item">{{ connectedDeviceId === device.address?'已连接':'未连接' }}</view> |
| | | </view> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { getUserInfo } from "@/utils/auth.js"; |
| | | import { |
| | | getUserInfo |
| | | } from "@/utils/auth.js"; |
| | | import labelPrinterComponentVue from "@/components/labelPrinterComponent/labelPrinterComponent.vue" |
| | | // import bluetoothTool from '@/plugins/BluetoothTool.js' |
| | | // import permission from '@/plugins/permission.js' |
| | |
| | | // EImage |
| | | // } from "@psdk/esc"; |
| | | export default { |
| | | components: {labelPrinterComponentVue}, |
| | | components: { |
| | | labelPrinterComponentVue |
| | | }, |
| | | data() { |
| | | return { |
| | | codeGenComplete: false, |
| | | userInfo:getUserInfo(), |
| | | serverUrl: uni.getStorageSync('serverUrl')||'http://47.96.97.237/API', |
| | | OperationType:1,//数据类型 1添加 保存 2复制 3 编辑 |
| | |
| | | HMTONo: '', |
| | | HDate: '', |
| | | HSourceBillNo: '', |
| | | HMaker: getUserInfo()["Czymc"], |
| | | HCoilNO: '', |
| | | HFurnaceNO: '', |
| | | HFactory: '', |
| | | }, |
| | | sWhere:'', |
| | | listData:[], |
| | |
| | | getData(){ |
| | | uni.request({ |
| | | url: this.serverUrl + '/Cg_POInStockBill/loadCg_POInStockBill_Push', |
| | | data: { HInterID: this.linterid, HSubID: this.HEntryID }, |
| | | data: { |
| | | HInterID: this.linterid, |
| | | HSubID: this.HEntryID |
| | | }, |
| | | success: (res) => { |
| | | if(res.data.count == 1){ |
| | | var data = res.data.data |
| | |
| | | HMainID:data[0].linterid, |
| | | HSubID:data[0].hsubid, |
| | | HBillNo:data[0].单据号, |
| | | HSourceBillNo: data[0].采购订单号, |
| | | HSourceBillNo: data[0].单据号, |
| | | HOrderBillNo: data[0].采购订单号, |
| | | HMaterID:data[0].HMaterID, |
| | | HMaterNumber:data[0].物料代码, |
| | |
| | | } |
| | | |
| | | this.baseInfo.HBQty = Math.ceil(this.baseInfo.HQty / this.baseInfo.HMinQty) |
| | | |
| | | this.listData = data |
| | | }else{ |
| | | uni.showToast({ |
| | | title:res.data.Message, |
| | |
| | | getList(){ |
| | | let HBarCodeNoStr = |
| | | `${this.baseInfo.HBillNo}@${this.baseInfo.HSubID}@${this.baseInfo.HMaterNumber || ''}@${this.baseInfo.HMTONo || ''}@${this.baseInfo.HQty || 0}` |
| | | |
| | | var sMain = [] |
| | | sMain[0] = this.baseInfo |
| | | var sMainStr = JSON.stringify(sMain); |
| | |
| | | uni.request({ |
| | | url: this.serverUrl + '/Sc_BarCode/SaveBarCode_NoGenerate', |
| | | method:'POST', |
| | | data: { msg: sMainSub, CampanyName: CampanyName }, |
| | | data: { |
| | | msg: sMainSub, |
| | | CampanyName: CampanyName |
| | | }, |
| | | success: (res) => { |
| | | if(res.data.count == 1){ |
| | | this.listData = res.data.data |
| | | this.codeGenComplete = true |
| | | console.log(this.listData) |
| | | this.listData[0]['条码编号'] = HBarCodeNoStr |
| | | uni.showToast({ |
| | | title:res.data.Message, |
| | | icon:'none' |
| | |
| | | } |
| | | } catch (err) { |
| | | console.log("授权失败:", err); |
| | | } |
| | | }, |
| | | async search() { |
| | | // #ifndef APP-PLUS |
| | | uni.showModal({ |
| | | content: "不支持蓝牙打印功能,请切换手机...", |
| | | }) |
| | | return |
| | | // #endif |
| | | if (this.$printer.isConnected() === false) { |
| | | this.$refs.labelPrinter.openPopup() |
| | | } else { |
| | | let printContent = [] |
| | | let printInfoBuffer = [] |
| | | let count = 0 |
| | | for (let listOne of this.listData) { |
| | | let HBarCodeNoStr = |
| | | `${this.baseInfo.HBillNo}@${this.baseInfo.HSubID}@${this.baseInfo.HMaterNumber || ''}@${this.baseInfo.HMTONo || ''}@${this.baseInfo.HQty || 0}` |
| | | let pcsInfo = this.baseInfo.HPcsName ? '(' + this.baseInfo.HPcsName + ')' : '' |
| | | |
| | | printContent.push(`! 0 200 200 400 1 |
| | | PAGE-WIDTH 608 |
| | | SETQRVER 3 |
| | | B QR 475 15 Q 0 U 3 |
| | | LA,${HBarCodeNoStr} |
| | | ENDQR |
| | | T 24 0 0 30 供应商: ${this.baseInfo.HSupName} |
| | | T 55 0 0 55 (Supplier) |
| | | T 24 0 0 75 供应商料号: ${this.baseInfo.HMaterNumber} |
| | | 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.HCoilNO || ''} |
| | | T 55 0 0 190 (Style No.) |
| | | T 24 0 300 165 客户编号: ${this.baseInfo.HFactory || ''} |
| | | T 55 0 300 190 (Consumer No.) |
| | | 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.) |
| | | T 24 0 0 255 数量: ${ parseFloat(this.baseInfo.HQty || 0).toFixed(0) } ${pcsInfo} |
| | | T 55 0 0 280 (Quantity) |
| | | T 24 0 300 255 日期: ${this.baseInfo.HDate || ''} |
| | | T 55 0 300 280 (Date) |
| | | T 24 0 0 300 检验员: |
| | | T 55 0 0 325 (QC) |
| | | T 24 0 300 300 采购单号: ${this.baseInfo.HOrderBillNo || ''} |
| | | T 55 0 300 325 (Purchase Order No.) |
| | | T 24 0 0 345 检验结果: |
| | | T 55 0 0 370 (Inspection status) |
| | | BOX 240 345 260 365 4 |
| | | T 24 0 270 345 合格 |
| | | T 55 0 250 370 (Pass) |
| | | BOX 340 345 360 365 4 |
| | | T 24 0 370 345 不合格 |
| | | T 55 0 370 370 (Fail) |
| | | BOX 460 345 480 365 4 |
| | | T 24 0 490 345 特采 |
| | | T 55 0 440 370 (Spec. accepted) |
| | | FORM |
| | | PRINT`) |
| | | count++; |
| | | if (count == 10) { |
| | | printInfoBuffer.push(printContent.join("\r\n")) |
| | | count = 0 |
| | | printContent = [] |
| | | } |
| | | } |
| | | printInfoBuffer.push(printContent.join("\r\n")) |
| | | this.printInfo = JSON.stringify(printInfoBuffer) |
| | | |
| | | printInfoBuffer = [] |
| | | |
| | | await this.$nextTick(() => { |
| | | this.$refs.labelPrinter.execPrint() |
| | | }) |
| | | } |
| | | }, |
| | | async searchLabelPrinter() { |
| | |
| | | width: 640rpx; |
| | | margin: 20rpx auto; |
| | | } |
| | | |
| | | .form-item{ |
| | | display: flex; |
| | | align-items: center; |
| | | font-size: 28rpx; |
| | | padding: 6rpx 0; |
| | | |
| | | .title{ |
| | | width: 180rpx; |
| | | |
| | | text{ |
| | | color: red; |
| | | font-weight: bold; |
| | | } |
| | | } |
| | | |
| | | .right{ |
| | | width: 450rpx; |
| | | border-radius: 22rpx; |
| | | border: 1px solid #acacac; |
| | | } |
| | | |
| | | .righton{ |
| | | width: 450rpx; |
| | | border-radius: 22rpx; |
| | | border: 1px solid #e4e4e4; |
| | | background-color: #e4e4e4; |
| | | } |
| | | |
| | | input{ |
| | | width: 100%; |
| | | padding: 8rpx 20rpx; |
| | | font-size: 30rpx; |
| | | } |
| | | } |
| | | |
| | | .buttons{ |
| | | width: 100%; |
| | | display: flex; |
| | | justify-content: center; |
| | | margin-top: 20rpx; |
| | | |
| | | button{ |
| | | border-radius: 50rpx; |
| | | width: 220rpx; |
| | |
| | | line-height: 66rpx; |
| | | font-size: 28rpx; |
| | | } |
| | | |
| | | .btn-a{ |
| | | background-color: #acacac; |
| | | color: #fff; |
| | | } |
| | | |
| | | .btn-b{ |
| | | background-color: #41a863; |
| | | color: #fff; |
| | | } |
| | | |
| | | .btn-c{ |
| | | background-color: #3a78ff; |
| | | color: #fff; |
| | |
| | | |
| | | .list{ |
| | | width: 100%; |
| | | |
| | | .card-detail{ |
| | | width: 100%; |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | justify-content: space-between; |
| | | line-height: 120%; |
| | | |
| | | .detail{ |
| | | // width: 50%; |
| | | font-size: 26rpx; |
| | | margin-bottom: 12rpx; |
| | | color: #555; |
| | | margin-right: 20rpx; |
| | | |
| | | text{ |
| | | color: #999; |
| | | font-size: 26rpx; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .more{ |
| | | color: #888; |
| | | font-size: 24rpx; |
| | | display: flex; |
| | | border-top: 1px solid #eee; |
| | | padding-top: 20rpx; |
| | | |
| | | .part{ |
| | | width: 50%; |
| | | text-align: center; |
| | |
| | | background: #fff; |
| | | border-radius: 20rpx; |
| | | } |
| | | |
| | | .uni-list-box { |
| | | margin: 0 20rpx; |
| | | padding: 15rpx 0; |
| | | border-bottom: 1px #f5f5f5 solid; |
| | | box-sizing: border-box; |
| | | } |
| | | |
| | | .uni-list:last-child { |
| | | border: none; |
| | | } |
| | | |
| | | .uni-list_name { |
| | | font-size: 30rpx; |
| | | color: #333; |
| | | } |
| | | |
| | | .uni-list_item { |
| | | font-size: 24rpx; |
| | | color: #555; |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | </style> |