| | |
| | | "type" : "uni-app:app-ios" |
| | | }, |
| | | { |
| | | "customPlaygroundType" : "local", |
| | | "customPlaygroundType" : "device", |
| | | "localRepoPath" : "D:/WorkBench/ZY_APP_Dev/STUWMS/unpackage/debug", |
| | | "openVueDevtools" : true, |
| | | "packageName" : "com.shebeiguanli.www", |
| | | "playground" : "custom", |
| | | "playground" : "standard", |
| | | "type" : "uni-app:app-android" |
| | | } |
| | | ] |
| | |
| | | "name" : "智云LMES", |
| | | "appid" : "__UNI__B002F49", |
| | | "description" : "", |
| | | "versionName" : "2.0.12", |
| | | "versionCode" : 212, |
| | | "versionName" : "2.0.15", |
| | | "versionCode" : 215, |
| | | "transformPx" : false, |
| | | /* 5+App特有相关 */ |
| | | "app-plus" : { |
| | |
| | | "style": { |
| | | "navigationBarTitleText": "条码管理" |
| | | } |
| | | }, { |
| | | }, |
| | | { |
| | | "path": "pages/tiaomaguanli/table_son", |
| | | "style": { |
| | | "navigationBarTitleText": "条码管理_son" |
| | | } |
| | | }, |
| | | { |
| | | "path": "pages/weiwairuku/table", |
| | | "style": { |
| | | "navigationBarTitleText": "委外入库", |
| | |
| | | "path": "pages/zhuangxiangdan/form", |
| | | "style": { |
| | | "navigationBarTitleText": "装箱单" |
| | | |
| | | |
| | | { |
| | | } |
| | | }, |
| | | { |
| | | "path": "pages/chaixiang/form", |
| | | "style": { |
| | | "navigationBarTitleText": "拆箱" |
| | |
| | | "style": { |
| | | "navigationBarTitleText": "组托-小卫" |
| | | } |
| | | } |
| | | }, |
| | | }, |
| | | { |
| | | "path": "pages/zhuangxiangdan/table", |
| | | "style": { |
| | |
| | | </view> |
| | | </view> |
| | | <view class="mains"> |
| | | <view v-if="!canEdit" :hidden="item.hidden" class="box" v-for="(item,index) in itemData" :key="index" |
| | | <view v-if="!canEdit" :hidden="item.hidden||!item.id" class="box" v-for="(item,index) in itemData" :key="index" |
| | | @tap="toUrl(item)"> |
| | | <image :src="item.img" mode=""></image> |
| | | <view class="texts"> |
| | | {{item.text}} |
| | | </view> |
| | | </view> |
| | | <view :enable-hidden="item.hidden" v-if="canEdit" class="box edit" v-for="(item,index) in itemData" |
| | | <view :enable-hidden="item.hidden" :hidden="!item.id" v-if="canEdit" class="box edit" v-for="(item,index) in itemData" |
| | | :key="index" @tap="switchHidden(index)"> |
| | | <uni-icons class="edit-mark" color="red" type="closeempty"></uni-icons> |
| | | <image :src="item.img" mode=""></image> |
| | |
| | | img: '../../static/icon/icon8.png', |
| | | text: '收料通知单条码打印', |
| | | url: '/pages/tiaomaguanli/table?HBillType=1103', |
| | | id: 1, |
| | | id: 1,//id为0强制不显示 |
| | | hidden: false, |
| | | }, |
| | | { |
| | |
| | | id: 32, |
| | | hidden: false, |
| | | },{ |
| | | img: '../../static/icon/icon16.png', |
| | | text: '装箱单', |
| | | url: '/pages/zhuangxiangdan/form', |
| | | id: 30, |
| | | id: 34, |
| | | hidden: false, |
| | | }, |
| | | |
| | |
| | | Array.from(data).forEach(e => { |
| | | this.itemData[e["HIndex"]].hidden = !CommonUtils.stringToBoolean(e["HShowMode"]) |
| | | this.itemData[e["HIndex"]].HMaker = e["HMaker"] |
| | | this.itemData[e["HIndex"]].id = e["HEntryID"]//用于数据库设置模块隐藏 |
| | | }) |
| | | }, |
| | | switchHidden(index) { |
| | |
| | | HMaterName, |
| | | HCoilNO, |
| | | HSupMaterNumber, |
| | | HFurnaceNO, |
| | | HFurnaceNO,//款号 |
| | | HMaterModel, |
| | | HQty, |
| | | HPcsName, |
| | |
| | | <button class="btn-d" size="mini" @tap="cmdDelete">删除</button> |
| | | <button class="btn-c" size="mini" @tap="cmdExit">退出</button> |
| | | </view> |
| | | |
| | | <!-- 打印模块 --> |
| | | <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_name">名称:{{ device.name }}</view> |
| | | <view class="uni-list_item">{{ connectedDeviceId === device.address?'已连接':'未连接' }}</view> |
| | | </view> |
| | | </scroll-view> |
| | | </view> |
| | | <view v-if="showResultTable" class="result-modal"> |
| | | <view class="modal-mask" @tap="closeResultTable"></view> |
| | | <view class="modal-content"> |
| | |
| | | </view> |
| | | <view class="modal-footer"> |
| | | <button class="btn-a" size="mini" @tap="toAddNew">新增</button> |
| | | <button class="btn-a" size="mini" @tap="search">打印</button> |
| | | <view style="flex: 1;"></view> |
| | | <button class="btn-c" size="mini" @tap="closeResultTable">关闭</button> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | |
| | | </view> |
| | | </view> |
| | | </template> |
| | |
| | | import { |
| | | MpaasScan |
| | | } from "@/utils/mpaasScan.js" |
| | | import labelPrinterComponentVue from "@/components/labelPrinterComponent/labelPrinterComponent.vue" |
| | | import getdateTime from '../../utils/getdateTime'; |
| | | export default { |
| | | data() { |
| | | components: { |
| | | labelPrinterComponentVue |
| | | }, |
| | | data() { |
| | | return { |
| | | // 计算列表高度 |
| | | bottomBtnTop: 0, |
| | |
| | | titleData: [], //不需要显示的字段 |
| | | OperationType: 1, //从缓存列表中返回数据类型(1新增、2从缓存列表中返回) |
| | | HBarCode_Pack_Temp: "", //从缓存列表中返回箱条码 |
| | | |
| | | //蓝牙相关信息 |
| | | printInfo: "",//打印内容 |
| | | maskShow: false,//蓝牙打印机显示绑定 |
| | | printListData:[],// |
| | | //展示表单 |
| | | showResultTable: false, // 控制结果表格显示 |
| | | resultTableData: [], // 结果表格数据 |
| | |
| | | if (count == 1) { |
| | | console.log('条码生成成功:', res.data.data[0]['条码编号']); |
| | | this.HBarCode_Pack = res.data.data[0]['条码编号']; |
| | | this.printListData = res.data.data;//条码信息保存用于打印 |
| | | resolve(this.HBarCode_Pack); // 解析Promise |
| | | } else { |
| | | uni.showToast({ |
| | |
| | | toAddNew() { |
| | | // 重置数据,准备新增 |
| | | this.showResultTable = false; |
| | | this.EnableSubmit=true; |
| | | this.resultTableData = []; |
| | | this.HBarCode_Pack = ''; |
| | | this.HBarCode = ''; |
| | |
| | | }, |
| | | cmdExit() { |
| | | uni.navigateBack() |
| | | } |
| | | }, |
| | | //打印模块函数 |
| | | /** |
| | | * 打印函数 |
| | | */ |
| | | 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 |
| | | uni.showLoading() |
| | | console.log('this.listData: ', this.printListData); |
| | | for (let listOne of this.printListData) { |
| | | let Message = await this.getPrintTemplate(listOne.HInterID, listOne.HItemID) |
| | | printContent.push(Message) |
| | | count++; |
| | | if (count == 10) { |
| | | printInfoBuffer.push(printContent.join("\r\n")) |
| | | count = 0 |
| | | printContent = [] |
| | | } |
| | | } |
| | | uni.hideLoading() |
| | | printInfoBuffer.push(printContent.join("\r\n")) |
| | | this.printInfo = JSON.stringify(printInfoBuffer) |
| | | printInfoBuffer = [] |
| | | |
| | | await this.$nextTick(() => { |
| | | this.$refs.labelPrinter.execPrint() |
| | | }) |
| | | } |
| | | }, |
| | | /** 获取打印模板 |
| | | * @param {Object} HInterID |
| | | * @param {Object} HItemID |
| | | */ |
| | | async getPrintTemplate(HInterID,HItemID) { |
| | | console.log('data: ', { |
| | | HOrginationName: uni.getStorageSync("Organization"), |
| | | HBillSubType: this.HBillType, |
| | | HInterID: HInterID, |
| | | HItemID: HItemID, |
| | | }) |
| | | return new Promise((resolve, reject) => { |
| | | CommonUtils.doRequest2({ |
| | | url: "/Sc_BarCode/Get_BarCodePrintCode_CPCL", |
| | | data: { |
| | | HOrginationName: uni.getStorageSync("Organization"), |
| | | HBillSubType: this.HBillType, |
| | | HInterID: HInterID, |
| | | HItemID: HItemID, |
| | | }, |
| | | resFunction: (res) => { |
| | | let { |
| | | Message, |
| | | count |
| | | } = res.data |
| | | if (count == 1) { |
| | | console.log('Message: ',Message); |
| | | resolve(Message) |
| | | } else { |
| | | uni.showToast({ |
| | | icon: 'none', |
| | | title: Message |
| | | }) |
| | | reject(); |
| | | } |
| | | }, |
| | | errFunction: (err) => { |
| | | reject(); |
| | | }, |
| | | |
| | | }) |
| | | }) |
| | | }, |
| | | /** |
| | | * 查找打印机 |
| | | */ |
| | | async searchLabelPrinter() { |
| | | // 查找打印机 |
| | | var that = this |
| | | // 使用openBluetoothAdapter 接口,免去主动申请权限的麻烦 |
| | | uni.openBluetoothAdapter({ |
| | | success: async (res) => { |
| | | await this.checkPermission(); |
| | | console.log('start discovery devices'); |
| | | this.discoveredDevices = []; |
| | | console.log(res) |
| | | bluetoothTool.discoveryNewDevice(); |
| | | this.maskShow = true |
| | | }, |
| | | fail: async (e) => { |
| | | console.error(e) |
| | | switch (e.code) { |
| | | case "10009": |
| | | this.showToast("此设备不支持设备搜索功能!"); |
| | | break; |
| | | default: |
| | | console.error(e); |
| | | } |
| | | } |
| | | }) |
| | | |
| | | }, |
| | | onDevice(device) { |
| | | console.log("监听寻找到新设备的事件---------------") |
| | | console.log(device) |
| | | if (typeof device === 'undefined') return; |
| | | if (typeof device.name === 'undefined') return; |
| | | console.log(device.name); |
| | | if (device.name === '') return; |
| | | if (device.name === null) return; |
| | | if (device.name.toUpperCase().endsWith('_BLE') || |
| | | device.name.toUpperCase().endsWith('-LE') || |
| | | device.name.toUpperCase().endsWith('-BLE')) return; |
| | | const isDuplicate = this.discoveredDevices.find(item => item.address === device.address); |
| | | if (isDuplicate) return; |
| | | this.discoveredDevices.push(device); |
| | | }, |
| | | connectBT(device) { |
| | | const vm = this; |
| | | uni.showLoading({ |
| | | title: '连接中' |
| | | }); |
| | | bluetoothTool.connDevice(device.address, (result) => { |
| | | console.log(result) |
| | | uni.hideLoading() |
| | | if (result) { |
| | | // // console.log(result); |
| | | bluetoothTool.cancelDiscovery(); |
| | | // console.log(vm.$printer) |
| | | vm.$printer.init(new FakeConnectedDevice()); |
| | | vm.connectedDeviceId = device.address; |
| | | uni.showToast({ |
| | | icon: 'none', |
| | | title: '连接成功' |
| | | }) |
| | | this.maskShow = false |
| | | } else { |
| | | uni.showToast({ |
| | | icon: 'none', |
| | | title: '连接失败' |
| | | }) |
| | | } |
| | | }); |
| | | }, |
| | | stopSearchBT() { |
| | | console.log("停止搜寻附近的蓝牙外围设备---------------") |
| | | bluetoothTool.cancelDiscovery(); |
| | | }, |
| | | closeBluetooth() { |
| | | console.log("停止蓝牙连接") |
| | | const vm = this; |
| | | if (vm.connectedDeviceId != '') { |
| | | bluetoothTool.closeBtSocket(); |
| | | vm.connectedDeviceId = ""; |
| | | } |
| | | }, |
| | | |
| | | }, |
| | | computed: { |
| | | listTableHeight: { |
| | |
| | | padding: 8rpx 20rpx; |
| | | font-size: 30rpx; |
| | | } |
| | | |
| | | .uni-mask { |
| | | position: fixed; |
| | | top: 0; |
| | | left: 0; |
| | | bottom: 0; |
| | | z-index: 3; |
| | | display: flex; |
| | | align-items: center; |
| | | width: 100%; |
| | | background: rgba(0, 0, 0, 0.6); |
| | | padding: 0 30rpx; |
| | | box-sizing: border-box; |
| | | } |
| | | .form { |
| | | display: flex; |
| | | flex-direction: column; |
| | |
| | | left: 0; |
| | | width: 100%; |
| | | height: 100%; |
| | | z-index: 9999; |
| | | z-index: 2; |
| | | |
| | | .modal-mask { |
| | | position: absolute; |
| | |
| | | let oMain = "" |
| | | let oMainSub = [] |
| | | Array.from(payload).forEach((one, index) => { |
| | | if (one.hidden == true) { |
| | | oMainSub.push({ |
| | | HEntryID: one.id, |
| | | HIndex: index, |
| | | HName: one.text, |
| | | HPicNum: one.img, |
| | | HShowMode: !one.hidden, |
| | | HMenuName: menuName, |
| | | }) |
| | | } |
| | | |
| | | oMainSub.push({ |
| | | HEntryID: one.id, |
| | | HIndex: index, |
| | | HName: one.text, |
| | | HPicNum: one.img, |
| | | HShowMode: !one.hidden, |
| | | HMenuName: menuName, |
| | | }) |
| | | |
| | | }) |
| | | oMain = JSON.stringify(oMainSub) + ";" + user + ";" + menuName + ";" + |
| | | deviceType |