From 626e1bcfb9297d066f75d1ab207e9e14f8ec7c00 Mon Sep 17 00:00:00 2001
From: wtt <1985833171@qq.com>
Date: 星期三, 12 十一月 2025 16:58:32 +0800
Subject: [PATCH] 添加小卫组托单打印和列表强制隐藏功能
---
pages/shouliaotongzhi/table.vue | 2
pages/zutuo_xiaowei/form_xiaowei.vue | 216 +++++++++++++++++++++++++++++++++++++++++-
manifest.json | 4
utils/menuListApp.js | 20 ++--
pages.json | 18 ++-
.hbuilderx/launch.json | 4
pages/index/index.vue | 10 +
7 files changed, 242 insertions(+), 32 deletions(-)
diff --git a/.hbuilderx/launch.json b/.hbuilderx/launch.json
index a7d9080..4dd14cd 100644
--- a/.hbuilderx/launch.json
+++ b/.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"
}
]
diff --git a/manifest.json b/manifest.json
index 53123f8..44c6034 100644
--- a/manifest.json
+++ b/manifest.json
@@ -2,8 +2,8 @@
"name" : "鏅轰簯LMES",
"appid" : "__UNI__B002F49",
"description" : "",
- "versionName" : "2.0.12",
- "versionCode" : 212,
+ "versionName" : "2.0.15",
+ "versionCode" : 215,
"transformPx" : false,
/* 5+App鐗规湁鐩稿叧 */
"app-plus" : {
diff --git a/pages.json b/pages.json
index 4b08faf..2dc40c7 100644
--- a/pages.json
+++ b/pages.json
@@ -920,7 +920,14 @@
"style": {
"navigationBarTitleText": "鏉$爜绠$悊"
}
- }, {
+ },
+ {
+ "path": "pages/tiaomaguanli/table_son",
+ "style": {
+ "navigationBarTitleText": "鏉$爜绠$悊_son"
+ }
+ },
+ {
"path": "pages/weiwairuku/table",
"style": {
"navigationBarTitleText": "濮斿鍏ュ簱",
@@ -1226,9 +1233,9 @@
"path": "pages/zhuangxiangdan/form",
"style": {
"navigationBarTitleText": "瑁呯鍗�"
-
-
-{
+ }
+ },
+ {
"path": "pages/chaixiang/form",
"style": {
"navigationBarTitleText": "鎷嗙"
@@ -1245,8 +1252,7 @@
"style": {
"navigationBarTitleText": "缁勬墭-灏忓崼"
}
- }
- },
+ },
{
"path": "pages/zhuangxiangdan/table",
"style": {
diff --git a/pages/index/index.vue b/pages/index/index.vue
index 9c2ef99..d114244 100644
--- a/pages/index/index.vue
+++ b/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>
@@ -53,7 +53,7 @@
img: '../../static/icon/icon8.png',
text: '鏀舵枡閫氱煡鍗曟潯鐮佹墦鍗�',
url: '/pages/tiaomaguanli/table?HBillType=1103',
- id: 1,
+ id: 1,//id涓�0寮哄埗涓嶆樉绀�
hidden: false,
},
{
@@ -287,9 +287,10 @@
id: 32,
hidden: false,
},{
+ img: '../../static/icon/icon16.png',
text: '瑁呯鍗�',
url: '/pages/zhuangxiangdan/form',
- id: 30,
+ id: 34,
hidden: false,
},
@@ -543,6 +544,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"]//鐢ㄤ簬鏁版嵁搴撹缃ā鍧楅殣钘�
})
},
switchHidden(index) {
diff --git a/pages/shouliaotongzhi/table.vue b/pages/shouliaotongzhi/table.vue
index 2cd19e2..bc78b53 100644
--- a/pages/shouliaotongzhi/table.vue
+++ b/pages/shouliaotongzhi/table.vue
@@ -390,7 +390,7 @@
HMaterName,
HCoilNO,
HSupMaterNumber,
- HFurnaceNO,
+ HFurnaceNO,//娆惧彿
HMaterModel,
HQty,
HPcsName,
diff --git a/pages/zutuo_xiaowei/form_xiaowei.vue b/pages/zutuo_xiaowei/form_xiaowei.vue
index 08b7514..f38ed97 100644
--- a/pages/zutuo_xiaowei/form_xiaowei.vue
+++ b/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>
</view>
</template>
@@ -124,9 +139,13 @@
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,
@@ -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); // 瑙f瀽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;
diff --git a/utils/menuListApp.js b/utils/menuListApp.js
index 14d15eb..e176ca5 100644
--- a/utils/menuListApp.js
+++ b/utils/menuListApp.js
@@ -51,16 +51,16 @@
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
--
Gitblit v1.9.1