| | |
| | | { |
| | | "path": "pages/tiaomadaying/tiaomadaying", |
| | | "style": { |
| | | "navigationBarTitleText": "来料条码打印" |
| | | "navigationBarTitleText": "采购条码打印" |
| | | } |
| | | }, |
| | | { |
| | |
| | | <picker :range="arrayOrganization" :value="Organization" @change="OrganizationChange"> |
| | | <view class="right" style="display: flex;align-items: center;"> |
| | | <input type="text" disabled v-model="Organization" placeholder="请选择当前组织"> |
| | | <uni-icons type="forward" color="#808080" style="border-left: 1px solid #aaaaaa;padding: 0 8rpx;" size="18"></uni-icons> |
| | | <uni-icons type="forward" color="#808080" |
| | | style="border-left: 1px solid #aaaaaa;padding: 0 8rpx;" size="18"></uni-icons> |
| | | </view> |
| | | </picker> |
| | | </view> |
| | |
| | | <view class="apibtn" @tap="changeApi=true">修改服务器地址</view> --> |
| | | </view> |
| | | </view> |
| | | <hFormAlert v-if="changeApi" placeholder="请输入服务器地址" @confirm="confirm" @cancel="cancel"></hFormAlert> |
| | | <!-- <hFormAlert v-if="changeApi" placeholder="请输入服务器地址" @confirm="confirm" @cancel="cancel"></hFormAlert> --> |
| | | <uni-popup ref="popup" type="center"> |
| | | <uni-popup-dialog title="服务器设置" mode="input" @confirm="confirmHandler"> |
| | | <view class="popup-content"> |
| | | <picker class="pop-item" :range="arrayServerOrganization" :value="serverOrganization" |
| | | @change="serverOrganizationChange"> |
| | | <view class="right" style="display: flex;align-items: center;"> |
| | | <input type="text" disabled v-model="serverOrganization" placeholder="请选择当前组织"> |
| | | <uni-icons type="forward" color="#808080" |
| | | style="border-left: 1px solid #aaaaaa;padding: 0 8rpx;" size="18"></uni-icons> |
| | | </view> |
| | | </picker> |
| | | <view class="pop-item"> |
| | | <input type="text" :value="serverUrlCache" placeholder="请输入服务器地址" /> |
| | | </view> |
| | | </view> |
| | | </uni-popup-dialog> |
| | | </uni-popup> |
| | | |
| | | <view class="btn" @tap="submit">登 录</view> |
| | | <view class="btn apibtn" @tap="changeApi=true">服务器设置</view> |
| | | <!-- <view class="btn apibtn" @tap="changeApi=true">服务器设置</view> --> |
| | | <view class="btn apibtn" @click="openServerSettingHandler">服务器设置</view> |
| | | </view> |
| | | </view> |
| | | </template> |
| | | |
| | | <script> |
| | | import { setLoginData,setUserInfo} from "@/utils/auth.js"; |
| | | import { |
| | | setLoginData, |
| | | setUserInfo |
| | | } from "@/utils/auth.js"; |
| | | import hFormAlert from '@/components/h-form-alert/h-form-alert.vue'; |
| | | export default { |
| | | components: { |
| | |
| | | arrayDataBases:[], |
| | | DataBases:'', |
| | | |
| | | arrayServerOrganization: ["浙江智云迈思", "温州海诚"], |
| | | arrayServerOrganizationValues: [ |
| | | 'http://47.96.97.237/API/', |
| | | 'http://122.228.39.234:7177/API/' |
| | | ], |
| | | serverOrganization: '', |
| | | arrayOrganization:[], |
| | | Organization:'', |
| | | HOrgNameList:[], |
| | |
| | | PassWord:'',//123456 |
| | | changeApi:false, |
| | | serverUrl: uni.getStorageSync('serverUrl')||'http://47.96.97.237/API', |
| | | serverUrlCache: '', |
| | | } |
| | | }, |
| | | onLoad() { |
| | |
| | | this.UserName = logindata.UserName |
| | | this.PassWord = logindata.PassWord |
| | | } |
| | | |
| | | this.serverUrlCache = this.serverUrl |
| | | console.log('this.serverUrlCache: ',this.serverUrlCache); |
| | | let index = this.arrayServerOrganizationValues.findIndex((e) => { |
| | | return e == this.serverUrlCache |
| | | }) |
| | | if (index == -1) { |
| | | index = 0 |
| | | } |
| | | this.serverOrganization = this.arrayServerOrganization[index] |
| | | this.getOrganization() |
| | | // this.getDataBases() |
| | | this.getDataBases() |
| | | }, |
| | | methods: { |
| | | confirm(e){ |
| | |
| | | this.changeApi = false |
| | | this.getOrganization() |
| | | }, |
| | | confirmHandler() { |
| | | uni.setStorageSync('serverUrl', this.serverUrlCache) |
| | | this.serverUrl = this.serverUrlCache |
| | | // this.changeApi = false |
| | | this.getOrganization() |
| | | }, |
| | | cancel(){ |
| | | this.changeApi = false |
| | | }, |
| | | openServerSettingHandler() { |
| | | this.$refs.popup.open() |
| | | }, |
| | | getDataBases(){ |
| | | uni.request({ |
| | |
| | | this.arrayOrganization[i] = res.data.data[i].Name |
| | | this.HOrgNameList[i] = res.data.data[i].ID |
| | | } |
| | | this.Organization = res.data.data[0].Name |
| | | this.HOrgName = res.data.data[0].ID |
| | | this.$forceUpdate(); |
| | | }, |
| | | fail: (res) => { |
| | |
| | | // console.log(e.detail.value) |
| | | this.Organization = this.arrayOrganization[e.detail.value] |
| | | this.HOrgName = this.HOrgNameList[e.detail.value] |
| | | }, |
| | | serverOrganizationChange(e) { |
| | | // console.log(e.detail.value) |
| | | let index = e.detail.value |
| | | this.serverOrganization = this.arrayServerOrganization[index] |
| | | this.serverUrlCache = this.arrayServerOrganizationValues[index] |
| | | }, |
| | | submit(){ |
| | | if(!this.Organization){ |
| | |
| | | left: 0; |
| | | z-index: -1; |
| | | } |
| | | |
| | | .container{ |
| | | width: 100%; |
| | | height: 100%; |
| | |
| | | flex-direction: column; |
| | | align-items: center; |
| | | justify-content: center; |
| | | |
| | | .title{ |
| | | margin-top: 174rpx; |
| | | font-size: 47rpx; |
| | | font-weight: bold; |
| | | color: #FFFFFF; |
| | | } |
| | | |
| | | .box{ |
| | | width: 682rpx; |
| | | position: relative; |
| | | top: 120rpx; |
| | | display: flex; |
| | | justify-content: center; |
| | | |
| | | .logo{ |
| | | width: 155rpx; |
| | | height: 155rpx; |
| | |
| | | z-index: 9; |
| | | background-color: rgba(255, 255, 255, 0.5); |
| | | border-radius: 100%; |
| | | |
| | | image{ |
| | | width: 100%; |
| | | height: 100%; |
| | |
| | | background-color: #f0f3f7; |
| | | } |
| | | } |
| | | |
| | | .login{ |
| | | width: 100%; |
| | | height: 480rpx; |
| | |
| | | border-radius: 25rpx 0 25rpx 0; |
| | | box-shadow: 0 6rpx 24rpx 8rpx rgba(21, 99, 210, 0.14); |
| | | padding-top: 160rpx; |
| | | |
| | | .item{ |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: flex-end; |
| | | margin-right: 38rpx; |
| | | margin-bottom: 70rpx; |
| | | |
| | | .left{ |
| | | font-size: 34rpx; |
| | | font-weight: 400; |
| | | color: #3C3C3C; |
| | | } |
| | | |
| | | .right{ |
| | | width: 441rpx; |
| | | height: 68rpx; |
| | | background: #EBEBEB; |
| | | border-radius: 10rpx; |
| | | |
| | | input{ |
| | | height: 100%; |
| | | padding: 0 30rpx; |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | // .api{ |
| | | // margin-left: 30rpx; |
| | | // font-size: 27rpx; |
| | |
| | | // } |
| | | } |
| | | } |
| | | |
| | | .btn{ |
| | | width: 540rpx; |
| | | height: 92rpx; |
| | |
| | | text-align: center; |
| | | font-size: 36rpx; |
| | | } |
| | | |
| | | .apibtn{ |
| | | margin-top: 50rpx; |
| | | background: #eec18e; |
| | | box-shadow: 0rpx 0rpx 44rpx 7rpx rgba(253, 186, 118, 0.3); |
| | | } |
| | | } |
| | | |
| | | .popup-content { |
| | | box-sizing: border-box; |
| | | display: flex; |
| | | flex-direction: column; |
| | | gap: 30rpx; |
| | | |
| | | .pop-item { |
| | | border: #EBEBEB 2rpx solid; |
| | | border-radius: 10rpx; |
| | | padding: 14rpx 8rpx; |
| | | } |
| | | |
| | | >picker { |
| | | background-color: #EBEBEB; |
| | | } |
| | | } |
| | | </style> |
| | |
| | | <view class="item"> |
| | | <view class="left">条码编号:</view> |
| | | <view class="right"> |
| | | <input name="HBarCode" v-model="lailiaoInfo.barCodeNo" placeholder="请扫描来料条码" /> |
| | | <input name="HBarCode" v-model="lailiaoInfo.barCodeNo" |
| | | placeholder="请扫描商品条码" /> |
| | | </view> |
| | | <view> |
| | | <uni-icons type="scan" |
| | |
| | | </view> |
| | | </view> |
| | | <view class="operation-zone"> |
| | | <button class="btn-c" :disabled="buttonStatus.btn1 == false" @click="GenereateBarCode">生成</button> |
| | | <!-- <button class="btn-c" @click="GenereateBarCode">生成</button> --> |
| | | <button class="btn-c" :disabled="buttonStatus.btn2 == false" @click="print">打印</button> |
| | | <view></view> |
| | | <button class="btn-c" @click="setClearLailiaoInfo">新增</button> |
| | |
| | | // await this.$nextTick(() => { |
| | | // this.$refs.labelPrinter.execPrint() |
| | | // }) |
| | | |
| | | // T 24 0 300 280 计划跟踪号: ${this.lailiaoInfo.HMTONo || ''} |
| | | this.printInfo = `! 0 200 200 400 1 |
| | | PAGE-WIDTH 608 |
| | | SETQRVER 3 |
| | | B QR 500 30 M 2 U 3 |
| | | LA,${this.generatedBarCode} |
| | | B QR 440 30 M 4 U 6 |
| | | LA,${this.lailiaoInfo.barCodeNo} |
| | | ENDQR |
| | | T 24 0 30 30 供应商: ${this.lailiaoInfo.HSupName} |
| | | T 24 0 30 80 供应商料号: |
| | | T 24 0 30 130 物料编码: ${this.lailiaoInfo.HMaterName} |
| | | T 24 0 30 180 物料分组: |
| | | T 24 0 300 180 规格型号: ${this.lailiaoInfo.HMaterModel} |
| | | T 24 0 30 230 数量: ${this.lailiaoInfo.HQty} |
| | | T 24 0 300 230 日期: |
| | | T 24 0 30 280 检验员: |
| | | T 24 0 300 280 计划跟踪号: ${this.lailiaoInfo.HMTONo || ''} |
| | | T 24 0 30 330 检验结果: |
| | | T 24 0 10 30 供应商: ${this.lailiaoInfo.HSupName} |
| | | T 24 0 10 55 (eng) |
| | | T 24 0 10 80 供应商料号: ${this.lailiaoInfo.HMaterNumber} |
| | | T 24 0 10 105 (eng) |
| | | T 24 0 10 130 物料名称: ${this.lailiaoInfo.HMaterName} |
| | | T 24 0 5 155 (eng) |
| | | T 24 0 5 180 分组: ${this.lailiaoInfo.HBatchNo} |
| | | T 24 0 5 205 (eng) |
| | | T 24 0 300 180 规格: ${this.lailiaoInfo.HMaterModel} |
| | | T 24 0 300 205 (eng) |
| | | T 24 0 10 230 数量: ${this.lailiaoInfo.HQty} (${this.lailiaoInfo.HPcsName}) |
| | | T 24 0 5 255 (eng) |
| | | T 24 0 300 230 日期: ${this.lailiaoInfo.HDate} |
| | | T 24 0 300 255 (eng) |
| | | T 24 0 5 280 检验员: |
| | | T 24 0 5 305 (eng) |
| | | T 24 0 300 280 采购单号: ${this.lailiaoInfo.HBillNo || ''} |
| | | T 24 0 300 305 (eng) |
| | | T 24 0 5 330 检验结果: |
| | | T 24 0 5 355 (eng) |
| | | BOX 260 330 280 350 4 |
| | | T 24 0 290 330 合格 |
| | | T 24 0 290 355 (eng) |
| | | BOX 360 330 380 350 4 |
| | | T 24 0 390 330 不合格 |
| | | T 24 0 390 355 (eng) |
| | | BOX 480 330 500 350 4 |
| | | T 24 0 510 330 特采 |
| | | T 24 0 510 355 (eng) |
| | | FORM |
| | | PRINT` |
| | | |
| | |
| | | }) |
| | | } |
| | | let d = data[row - 1] |
| | | console.log('条码接收数据: ',d) |
| | | this.lailiaoInfo = Object.assign(this.lailiaoInfo, { |
| | | HMaterNumber: d['物料编码'], |
| | | HMaterName: d['物料名称'], |
| | |
| | | HQty: d['数量'], |
| | | HMinQty: d['数量'], |
| | | HBQty: d['数量'], |
| | | HDate: d['日期'], |
| | | HSupID: d['HSupID'], |
| | | HSupName: d['供应商'], |
| | | HSupNameShort: d['供应商'], |
| | | HMTONo: d['订单跟踪号'], |
| | | HMTONo: d['计划跟踪号'], |
| | | HMainID: d['linterid'], |
| | | HSubID: d['HEntryID'], |
| | | HMaterID: d['HMaterID'], |
| | | HPcsName: d['计量单位'] |
| | | }) |
| | | }, |
| | | setClearLailiaoInfo() { |
| | |
| | | console.log('条码内容:' + res.result); |
| | | this.lailiaoInfo.barCodeNo = res.result; |
| | | if (res.result.includes("@") === false) { |
| | | this.buttonStatus.btn2 = false |
| | | return uni.showToast({ |
| | | icon: 'none', |
| | | title: '条码格式错误,请重新扫描...' |
| | |
| | | } = res.data |
| | | if (count > 0) { |
| | | this.setLailiaoInfo(data, Row) |
| | | this.buttonStatus.btn2 = true |
| | | } |
| | | }, |
| | | (error) => { |
| | | |
| | | this.buttonStatus.btn2 = false |
| | | } |
| | | ) |
| | | |
| | |
| | | //获取选择的工厂代码 |
| | | let CampanyName = "xxx"; |
| | | //获取选择的源单类型 |
| | | let HSourceBillType = "来料通知单"; |
| | | let HSourceBillType = "采购订单"; |
| | | //获取选择的条码类型 |
| | | let HSelectBarCodeType = "唯一条码"; |
| | | let HSelectBarCodeType = "品种条码"; |
| | | //获取当前登录人员 |
| | | let UserName = uni.getStorageSync('HUserName'); |
| | | let sMainSub = sMainStr + ';' + HOrgType + ';' + HSourceBillType + ';' + HSelectBarCodeType + ';' + |
| | | CampanyName + ';' + UserName; |
| | | |
| | | CommonUtils.doRequest( |
| | | "/Sc_BarCode/Sub_SaveBill", { |
| | | msg: sMainSub, |
| | | CampanyName: CampanyName |
| | | }, |
| | | (res) => { |
| | | console.log(res) |
| | | let { |
| | | data, |
| | | count, |
| | | Message |
| | | } = res.data |
| | | if (count > 0) { |
| | | this.buttonStatus = { |
| | | btn1: false, |
| | | btn2: true |
| | | } |
| | | this.generatedBarCode = data[0]['条码编号'] |
| | | console.log(this.generatedBarCode) |
| | | uni.showToast({ |
| | | icon: 'none', |
| | | title: Message |
| | | }) |
| | | } else { |
| | | uni.showToast({ |
| | | icon: 'none', |
| | | title: Message |
| | | }) |
| | | } |
| | | }, |
| | | (err) => { |
| | | // CommonUtils.doRequest( |
| | | // "/Sc_BarCode/Sub_SaveBill", { |
| | | // msg: sMainSub, |
| | | // CampanyName: CampanyName |
| | | // }, |
| | | // (res) => { |
| | | // console.log(res) |
| | | // let { |
| | | // data, |
| | | // count, |
| | | // Message |
| | | // } = res.data |
| | | // if (count > 0) { |
| | | // this.buttonStatus = { |
| | | // btn1: false, |
| | | // btn2: true |
| | | // } |
| | | // this.generatedBarCode = data[0]['条码编号'] |
| | | // console.log(this.generatedBarCode) |
| | | // uni.showToast({ |
| | | // icon: 'none', |
| | | // title: Message |
| | | // }) |
| | | // } else { |
| | | // uni.showToast({ |
| | | // icon: 'none', |
| | | // title: Message |
| | | // }) |
| | | // } |
| | | // }, |
| | | // (err) => { |
| | | |
| | | }, |
| | | "POST" |
| | | ) |
| | | // }, |
| | | // "POST" |
| | | // ) |
| | | }, |
| | | exit() { |
| | | uni.navigateBack() |
| | |
| | | |
| | | //6.0以后的如果需要利用本机查找周围的wifi和蓝牙设备, 申请权限 |
| | | if(Build.VERSION.SDK_INT >= 6.0){ |
| | | |
| | | console.log('Build.VERSION.SDK_INT: ',Build.VERSION.SDK_INT); |
| | | } |
| | | let options = this.options |
| | | |
| | | btFindReceiver = plus.android.implements("io.dcloud.android.content.BroadcastReceiver", { |
| | | "onReceive": function(context, intent) { |
| | | plus.android.importClass(context); |
| | | plus.android.importClass(intent); |
| | | let action = intent.getAction(); |
| | | |
| | | console.log(BluetoothDevice) |
| | | if(BluetoothDevice.ACTION_FOUND == action) { // 找到设备 |
| | | let device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE); |
| | | let newDevice = { |
| | |
| | | } |
| | | } |
| | | }); |
| | | |
| | | let filter = new IntentFilter(); |
| | | filter.addAction(BluetoothDevice.ACTION_FOUND); |
| | | filter.addAction(BluetoothAdapter.ACTION_DISCOVERY_FINISHED); |