| .hbuilderx/launch.json | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| pages/ZLGL/mojianjianyan/lastPieceCheckBill.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| pages/ZLGL/shoujianjianyan/firstCheckBill.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| pages/ZLGL/xunjianjianyan/PatrolProcCheckBill.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| pages/index/index.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| pages/index/tab1.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| pages/index/tab2.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| pages/shouliaotongzhi/table.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| pages/zutuo_xiaowei/form_xiaowei.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| utils/menuListApp.js | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
.hbuilderx/launch.json
@@ -21,11 +21,11 @@ "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" } ] pages/ZLGL/mojianjianyan/lastPieceCheckBill.vue
@@ -27,16 +27,7 @@ </uni-datetime-picker> </view> </view> <view class="form-item"> <view class="left">源单类型</view> <view class="right" style="position: relative" :class="!hasSourceBill?'':'disabled'"> <picker mode="selector" :range="HSourceBillTypeNameList" :disabled="hasSourceBill" @change="HSourceBillTypeNameChange"> <input type="text" placeholder="请选择源单类型" v-model="HSourceBillType" /> <view class="picker-overlay"></view> </picker> </view> </view> <view class="form-item"> <view class="left">源单单号</view> <view class="right" :class="!hasSourceBill?'':'disabled'"> @@ -52,13 +43,7 @@ " size="20" @click="toScanCode"></uni-icons> </view> </view> <view class="form-item"> <view class="left">生产资源</view> <view class="right"> <uni-combox :candidates="GySourceNameList" placeholder="请选择生产资源" v-model="hform.HSourceName" @update:modelValue="HSourceChange"></uni-combox> </view> </view> <view class="form-item"> <view class="left">任务单号</view> <view class="right disabled"> @@ -108,12 +93,7 @@ <view class="icon-wrapper-big"><uni-icons type="search" size="20" @click="showSelectorModule(hform, 7)"></uni-icons></view> </view> <view class="form-item"> <view class="left">批号</view> <view class="right"> <input type="text" value="" /> </view> </view> <view class="form-item"> <view class="left">判断结论</view> <view class="right none-border"> @@ -138,15 +118,27 @@ <view class="icon-wrapper-big"><uni-icons type="search" size="20" @click="showSelectorModule(hform, 8)"></uni-icons></view> </view> <view class="form-item"> <view class="left">备注</view> <view class="right"> <input type="text" v-model="hform.HRemark" value="" /> </view> </view> </view> <!-- 其他信息 --> <view class="bill-main-content" v-if="mainTabSelected == 2"> <view class="form-item"> <view class="left">源单类型</view> <view class="right" style="position: relative" :class="!hasSourceBill?'':'disabled'"> <picker mode="selector" :range="HSourceBillTypeNameList" :disabled="hasSourceBill" @change="HSourceBillTypeNameChange"> <input type="text" placeholder="请选择源单类型" v-model="HSourceBillType" /> <view class="picker-overlay"></view> </picker> </view> </view> <view class="form-item"> <view class="left">生产资源</view> <view class="right"> <uni-combox :candidates="GySourceNameList" placeholder="请选择生产资源" v-model="hform.HSourceName" @update:modelValue="HSourceChange"></uni-combox> </view> </view> <view class="form-item"> <view class="left">生产班次</view> <view class="right"> @@ -172,6 +164,18 @@ <input type="number" v-model="hform.HProcExchQty" /> </view> </view> <view class="form-item"> <view class="left">批号</view> <view class="right"> <input type="text" v-model="hform.HBatchNo" /> </view> </view> <view class="form-item"> <view class="left">备注</view> <view class="right"> <input type="text" v-model="hform.HRemark" value="" /> </view> </view> </view> <!-- 制单信息 --> <view class="bill-main-content" v-if="mainTabSelected == 3"> pages/ZLGL/shoujianjianyan/firstCheckBill.vue
@@ -28,16 +28,6 @@ </view> </view> <view class="form-item"> <view class="left">源单类型</view> <view class="right" style="position: relative" :class="!hasSourceBill?'':'disabled'"> <picker mode="selector" :range="HSourceBillTypeNameList" :disabled="hasSourceBill" @change="HSourceBillTypeNameChange"> <input type="text" placeholder="请选择源单类型" v-model="HSourceBillType" /> <view class="picker-overlay"></view> </picker> </view> </view> <view class="form-item"> <view class="left">源单单号</view> <view class="right" :class="!hasSourceBill?'':'disabled'"> <input type="text" :disabled="hasSourceBill" placeholder="请输入或扫描源单号" @@ -52,20 +42,7 @@ " size="20" @click="toScanCode"></uni-icons> </view> </view> <view class="form-item"> <view class="left">生产资源</view> <view class="right"> <uni-combox :candidates="GySourceNameList" placeholder="请选择生产资源" v-model="hform.HSourceName" @update:modelValue="HSourceChange"></uni-combox> </view> </view> <view class="form-item"> <view class="left">生产班次</view> <view class="right"> <uni-combox :candidates="GyWorkShiftNameList" placeholder="请选择生产班次" v-model="hform.HShiftsName" @update:modelValue="HWorkShiftChange"></uni-combox> </view> </view> <view class="form-item"> <view class="left">任务单号</view> <view class="right disabled"> @@ -113,12 +90,7 @@ <view class="icon-wrapper-big"><uni-icons type="search" size="20" @click="showSelectorModule(hform, 7)"></uni-icons></view> </view> <view class="form-item"> <view class="left">批号</view> <view class="right"> <input type="text" value="" /> </view> </view> <view class="form-item"> <view class="left">判断结论</view> <view class="right none-border"> @@ -143,15 +115,27 @@ <view class="icon-wrapper-big"><uni-icons type="search" size="20" @click="showSelectorModule(hform, 8)"></uni-icons></view> </view> <view class="form-item"> <view class="left">备注</view> <view class="right"> <input type="text" v-model="hform.HRemark" value="" /> </view> </view> </view> <!-- 其他信息 --> <view class="bill-main-content" v-if="mainTabSelected == 2"> <view class="form-item"> <view class="left">源单类型</view> <view class="right" style="position: relative" :class="!hasSourceBill?'':'disabled'"> <picker mode="selector" :range="HSourceBillTypeNameList" :disabled="hasSourceBill" @change="HSourceBillTypeNameChange"> <input type="text" placeholder="请选择源单类型" v-model="HSourceBillType" /> <view class="picker-overlay"></view> </picker> </view> </view> <view class="form-item"> <view class="left">生产资源</view> <view class="right"> <uni-combox :candidates="GySourceNameList" placeholder="请选择生产资源" v-model="hform.HSourceName" @update:modelValue="HSourceChange"></uni-combox> </view> </view> <view class="form-item"> <view class="left">生产班次</view> <view class="right"> @@ -159,22 +143,41 @@ v-model="hform.HShiftsName" @update:modelValue="HWorkShiftChange"></uni-combox> </view> </view> <!-- <view class="form-item"> <view class="left">生产班次</view> <view class="right"> <uni-combox :candidates="GyWorkShiftNameList" placeholder="请选择生产班次" v-model="hform.HShiftsName" @update:modelValue="HWorkShiftChange"></uni-combox> </view> </view> --> <view class="form-item"> <view class="left">异常临时处理方案</view> <view class="right"> <input type="text" v-model="hform.HErrTreatment" value="" /> </view> </view> <view class="form-item"> <!-- <view class="form-item"> <view class="left">任务单数量</view> <view class="right"> <input type="number" v-model="hform.HICMOQty" /> </view> </view> </view> --> <view class="form-item"> <view class="left">流转卡数量</view> <view class="right"> <input type="number" v-model="hform.HProcExchQty" /> </view> </view> <view class="form-item"> <view class="left">批号</view> <view class="right"> <input type="text" v-model="hform.HBatchNo" /> </view> </view> <view class="form-item"> <view class="left">备注</view> <view class="right"> <input type="text" v-model="hform.HRemark" value="" /> </view> </view> </view> @@ -241,6 +244,7 @@ </view> </view> </view> </view> </view> <!-- 子表区域 --> @@ -309,8 +313,11 @@ <view class="detail" v-if="checkItem.HUnit"> <text>单位:</text>{{ checkItem.HUnit }} </view> <view class="detail" v-if="checkItem.HQCStd"> <text>检验值:</text>{{ checkItem.HQCStd }} <!-- 只有定量分析才启用检验值 --> <view class="detail editable" v-show="checkItem.HAnalysisMethod == 2"> <text>检验值:</text> <input type="text" class="editable-input" @blur="calcHResult(checkItem)" v-model="checkItem.HInspectValQ" /> </view> <view class="detail" v-if="checkItem.HQCNote"> <text>检验记录:</text>{{ checkItem.HQCNote }} @@ -388,7 +395,7 @@ </view> <view class="detail editable"> <text>样本破坏数:</text> <view class="sampleDestory"> <view class="editable-input"> <input type="number" v-model="SamplingItem.HSampleDamageQty" /> </view> </view> @@ -628,6 +635,21 @@ }; }, methods: { // 检验值 计算是否合格 calcHResult(item){ // 非抽检条件下判断结论 console.log('item: ',item); if(item.HSampleSchemeID) { return } if(item.HInspectValQ >= item.HDownLimit && item.HInspectValQ <= item.HUpLimit){ this.checkItems[item.num].HResult = true return } this.checkItems[item.num].HResult = false }, // 源单类型选择 HSourceBillTypeNameChange(e) { this.HSourceBillType = this.HSourceBillTypeNameList[e.detail.value]; @@ -1104,7 +1126,7 @@ this.$refs.listPopup.showPopup(); }, getAnalysisMethodDisplay(val) { console.log("AnalysisMethodVal: ", val); console.log("AnalysisMethod: ", val); if (val) { return this.arrayAnalysisMethod.find((e) => e.value == val).name; } @@ -1709,8 +1731,8 @@ try { console.log('this.$refs: ', this.$refs); // 检查是否有未切换的检验值模块(是否包含set_SaveValue方法),如果有,则运行一次保存检验值的方法,根据检验值是否保存成功再执行下一步 if (typeof this.$refs.InspectValueModules != "undefined" && this.$refs.InspectValueModules.length > 0) { if (typeof this.$refs.InspectValueModules != "undefined" && this.$refs.InspectValueModules .length > 0) { // 加载有检验值模块 await this.$refs.InspectValueModules[0].set_SaveValue(); this.InspectValues[0] = this.$refs.InspectValueModules[0].InSpectValues; @@ -1787,7 +1809,7 @@ }, addNew() { uni.redirectTo({ url: "/pages/ZLGL/shoujianjianyan/firstCheckBillList?operationType=1", url: "/pages/ZLGL/shoujianjianyan/firstCheckBill?operationType=1", }); }, goBack() { @@ -1885,9 +1907,6 @@ return '其他检验' } }(), }); for (let i = 0; i < data.length; i++) { @@ -1933,9 +1952,7 @@ HStrictness: data[i].严格度, HInspectResultToSee: data[i].检验结果 }); } this.hasSourceBill = true } else { @@ -1957,9 +1974,7 @@ this.hform.HInterID = e.linterid || 0; if (this.operationType == 1) { await this.getMaxBillNo(); } else if (this.operationType == 2) { } else if (this.operationType == 3) { } else if (this.operationType == 2) {} else if (this.operationType == 3) { await this.RoadBillMain(); } @@ -2182,7 +2197,7 @@ flex-shrink: 0; } .sampleDestory { .editable-input { border: 1px solid #acacac; border-radius: 5rpx; padding: 0 12rpx; pages/ZLGL/xunjianjianyan/PatrolProcCheckBill.vue
@@ -27,21 +27,12 @@ </uni-datetime-picker> </view> </view> <view class="form-item"> <view class="left">源单类型</view> <view class="right" style="position: relative" :class="!hasSourceBill?'':'disabled'"> <picker mode="selector" :range="HSourceBillTypeNameList" :disabled="hasSourceBill" @change="HSourceBillTypeNameChange"> <input type="text" placeholder="请选择源单类型" v-model="HSourceBillType" /> <view class="picker-overlay"></view> </picker> </view> </view> <view class="form-item"> <view class="left">源单单号</view> <view class="right" :class="!hasSourceBill?'':'disabled'"> <input type="text" :disabled="hasSourceBill" placeholder="请输入或扫描源单号" v-model="hform.HSourceBillNo" @confirm="getSourceBillInfo(hform.HSourceBillNo)" /> <input type="text" :disabled="hasSourceBill" placeholder="请输入或扫描源单号" v-model="hform.HSourceBillNo" @confirm="getSourceBillInfo(hform.HSourceBillNo)" /> </view> <view class="icon-wrapper-big"> <uni-icons class="right-icon" type="scan" style=" @@ -52,20 +43,7 @@ " size="20" @click="toScanCode"></uni-icons> </view> </view> <view class="form-item"> <view class="left">生产资源</view> <view class="right"> <uni-combox :candidates="GySourceNameList" placeholder="请选择生产资源" v-model="hform.HSourceName" @update:modelValue="HSourceChange"></uni-combox> </view> </view> <view class="form-item"> <view class="left">生产班次</view> <view class="right"> <uni-combox :candidates="GyWorkShiftNameList" placeholder="请选择生产班次" v-model="hform.HShiftsName" @update:modelValue="HWorkShiftChange"></uni-combox> </view> </view> <view class="form-item"> <view class="left">任务单号</view> <view class="right disabled"> @@ -113,12 +91,7 @@ <view class="icon-wrapper-big"><uni-icons type="search" size="20" @click="showSelectorModule(hform, 7)"></uni-icons></view> </view> <view class="form-item"> <view class="left">批号</view> <view class="right"> <input type="text" value="" /> </view> </view> <view class="form-item"> <view class="left">判断结论</view> <view class="right none-border"> @@ -143,15 +116,34 @@ <view class="icon-wrapper-big"><uni-icons type="search" size="20" @click="showSelectorModule(hform, 8)"></uni-icons></view> </view> <view class="form-item"> <view class="left">备注</view> <view class="right"> <input type="text" v-model="hform.HRemark" value="" /> </view> </view> </view> <!-- 其他信息 --> <view class="bill-main-content" v-if="mainTabSelected == 2"> <view class="form-item"> <view class="left">源单类型</view> <view class="right" style="position: relative" :class="!hasSourceBill?'':'disabled'"> <picker mode="selector" :range="HSourceBillTypeNameList" :disabled="hasSourceBill" @change="HSourceBillTypeNameChange"> <input type="text" placeholder="请选择源单类型" v-model="HSourceBillType" /> <view class="picker-overlay"></view> </picker> </view> </view> <view class="form-item"> <view class="left">生产资源</view> <view class="right"> <uni-combox :candidates="GySourceNameList" placeholder="请选择生产资源" v-model="hform.HSourceName" @update:modelValue="HSourceChange"></uni-combox> </view> </view> <!-- <view class="form-item"> <view class="left">生产班次</view> <view class="right"> <uni-combox :candidates="GyWorkShiftNameList" placeholder="请选择生产班次" v-model="hform.HShiftsName" @update:modelValue="HWorkShiftChange"></uni-combox> </view> </view> --> <view class="form-item"> <view class="left">生产班次</view> <view class="right"> @@ -175,6 +167,18 @@ <view class="left">流转卡数量</view> <view class="right"> <input type="number" v-model="hform.HProcExchQty" /> </view> </view> <view class="form-item"> <view class="left">批号</view> <view class="right"> <input type="text" v-model="hform.HBatchNo" /> </view> </view> <view class="form-item"> <view class="left">备注</view> <view class="right"> <input type="text" v-model="hform.HRemark" value="" /> </view> </view> </view> @@ -1709,7 +1713,8 @@ try { console.log('this.$refs: ',this.$refs); // 检查是否有未切换的检验值模块(是否包含set_SaveValue方法),如果有,则运行一次保存检验值的方法,根据检验值是否保存成功再执行下一步 if (typeof this.$refs.InspectValueModules != "undefined" && this.$refs.InspectValueModules.length > 0) { if (typeof this.$refs.InspectValueModules != "undefined" && this.$refs.InspectValueModules .length > 0) { // 加载有检验值模块 await this.$refs.InspectValueModules[0].set_SaveValue(); this.InspectValues[0] = this.$refs.InspectValueModules[0].InSpectValues; pages/index/index.vue
@@ -6,14 +6,14 @@ </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> @@ -557,6 +557,7 @@ 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"];//id为0强制隐藏 }) }, switchHidden(index) { pages/index/tab1.vue
@@ -6,14 +6,14 @@ </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> @@ -248,6 +248,7 @@ }) Array.from(data).forEach(e => { this.itemData[e["HIndex"]].hidden = !CommonUtils.stringToBoolean(e["HShowMode"]) this.itemData[e["HIndex"]].id = e["HEntryID"];//id为0强制隐藏 }) }, switchHidden(index) { pages/index/tab2.vue
@@ -6,14 +6,14 @@ </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> @@ -455,11 +455,13 @@ }) Array.from(data).forEach(e => { this.itemData[e["HIndex"]].hidden = !CommonUtils.stringToBoolean(e["HShowMode"]) this.itemData[e["HIndex"]].id = e["HEntryID"];//id为0强制隐藏 }) }, switchHidden(index) { this.updateCount++; this.itemData[index].hidden = !this.itemData[index].hidden }, switchIconsModeHandler() { this.canEdit = !this.canEdit pages/shouliaotongzhi/table.vue
@@ -390,7 +390,7 @@ HMaterName, HCoilNO, HSupMaterNumber, HFurnaceNO, HFurnaceNO,//款号 HMaterModel, HQty, HPcsName, pages/zutuo_xiaowei/form_xiaowei.vue
@@ -85,7 +85,20 @@ <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"> @@ -105,10 +118,12 @@ </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> </template> @@ -124,8 +139,12 @@ import { MpaasScan } from "@/utils/mpaasScan.js" import labelPrinterComponentVue from "@/components/labelPrinterComponent/labelPrinterComponent.vue" import getdateTime from '../../utils/getdateTime'; export default { components: { labelPrinterComponentVue }, data() { return { // 计算列表高度 @@ -188,7 +207,10 @@ titleData: [], //不需要显示的字段 OperationType: 1, //从缓存列表中返回数据类型(1新增、2从缓存列表中返回) HBarCode_Pack_Temp: "", //从缓存列表中返回箱条码 //蓝牙相关信息 printInfo: "",//打印内容 maskShow: false,//蓝牙打印机显示绑定 printListData:[],// //展示表单 showResultTable: false, // 控制结果表格显示 resultTableData: [], // 结果表格数据 @@ -577,6 +599,7 @@ 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({ @@ -670,6 +693,7 @@ toAddNew() { // 重置数据,准备新增 this.showResultTable = false; this.EnableSubmit=true; this.resultTableData = []; this.HBarCode_Pack = ''; this.HBarCode = ''; @@ -685,7 +709,173 @@ }, 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: { @@ -744,7 +934,19 @@ 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; @@ -868,7 +1070,7 @@ left: 0; width: 100%; height: 100%; z-index: 9999; z-index: 2; .modal-mask { position: absolute; utils/menuListApp.js
@@ -51,7 +51,7 @@ let oMain = "" let oMainSub = [] Array.from(payload).forEach((one, index) => { if (one.hidden == true) { oMainSub.push({ HEntryID: one.id, HIndex: index, @@ -60,7 +60,7 @@ HShowMode: !one.hidden, HMenuName: menuName, }) } }) oMain = JSON.stringify(oMainSub) + ";" + user + ";" + menuName + ";" + deviceType