From 0d473e2db6772ff8c1134781bf30c791386b5ffc Mon Sep 17 00:00:00 2001
From: yusijie <ysj@hz-kingdee.com>
Date: 星期四, 05 二月 2026 09:45:10 +0800
Subject: [PATCH] 惠康拆码,提交保存物料条码时,递入创建人参数调整
---
pages/tiaomachaima/tiaomachaimaCopy_HK.vue | 181 +++++++++++++++++++++++---------------------
1 files changed, 95 insertions(+), 86 deletions(-)
diff --git a/pages/tiaomachaima/tiaomachaimaCopy_HK.vue b/pages/tiaomachaima/tiaomachaimaCopy_HK.vue
index c07bb5a..3f3a2af 100644
--- a/pages/tiaomachaima/tiaomachaimaCopy_HK.vue
+++ b/pages/tiaomachaima/tiaomachaimaCopy_HK.vue
@@ -5,7 +5,7 @@
<view class="left">鏉$爜缂栧彿锛�</view>
<view class="right">
<input :focus="HBarCodeFocus" v-model="barCodeInfoMeta.barCodeNo" placeholder="璇锋壂鎻忔潯鐮�"
- @confirm="searchbarCodeInfo" />
+ @confirm="searchbarCodeInfo" />
</view>
<view>
<uni-icons type="scan"
@@ -33,7 +33,7 @@
:disabled="cantGenerate">鐢熸垚</button>
<button type="default" :class="cantPrint ? 'btn-disabled' : 'btn-c'" @click="PrintHBarCode"
:disabled="cantPrint">鎵撳嵃</button>
- <button type="primary" @click="printerLabel2">娴嬭瘯鎵撳嵃2</button>
+ <button type="primary" @click="printerLabel2">娴嬭瘯鎵撳嵃2</button>
</view>
</view>
<view class="divide"></view>
@@ -77,7 +77,7 @@
<view class="dWetail">
<text>鐗╂枡缂栫爜锛�</text>{{barCodeInfo['鐗╂枡浠g爜'] || ''}}
</view>
-
+
<view class="detail">
<text>瑙勬牸鍨嬪彿锛�</text>{{barCodeInfo['瑙勬牸鍨嬪彿'] || ''}}
</view>
@@ -127,7 +127,7 @@
</view>
<view class="over" v-if="barCodeSplitInfo.length == 0">鏆傛棤鏁版嵁</view>
<view class="over" v-if="barCodeSplitInfo.length != 0">宸插埌搴�</view>
-
+
</view>
</template>
@@ -135,7 +135,7 @@
const printer = uni.requireNativePlugin('LcPrinter');
const modal = uni.requireNativePlugin('modal');
var globalEvent = uni.requireNativePlugin('globalEvent');
-
+
// 鍦ㄥ叏灞�瀹氫箟涓�涓彉閲忔潵鏍囪瘑鏄惁宸茬粡鍒濆鍖�
var isPrinterInitialized = false;
@@ -156,16 +156,16 @@
splitNum: "",
billMaker: getUserInfo().Czymc,
},
- base64:"",
- barCodeInfo: {//鍘熸潯鐮佷俊鎭�
+ base64: "",
+ barCodeInfo: { //鍘熸潯鐮佷俊鎭�
},
- barCodeSplitInfo: [],//鎷嗙爜淇℃伅
+ barCodeSplitInfo: [], //鎷嗙爜淇℃伅
cantGenerate: true, // 鐢熸垚鎸夐挳鍒濆绂佺敤
cantPrint: true, // 鎵撳嵃鎸夐挳鍒濆绂佺敤
cantSplit: false, // 鎷嗙爜鎸夐挳鍒濆鍙敤
HBarCodeFocus: false,
- isPrinting:false,
+ isPrinting: false,
printInfo: "" //鎵撳嵃
};
},
@@ -188,15 +188,17 @@
printer.setConcentration({ //璁剧疆鎵撳嵃娴撳害銆俧ont_level 鍙栧�艰寖鍥达細1~39銆�
level: 39
});
-
+
},
printerLabel() {
const formatDate = new Date().toISOString().split('T')[0];
printer.setLineSpacing({
spacing: 1.2
});
-
- printer.setUnwindPaperLen({ length: 60 });
+
+ printer.setUnwindPaperLen({
+ length: 60
+ });
printer.setFontSize({
fontSize: 1
});
@@ -206,57 +208,57 @@
fontSize: 2,
isBold: false,
isUnderLine: false,
- content: '渚涘簲鍟嗗悕绉帮細'+this.barCodeInfo['渚涘簲鍟�']+'\r\n'
+ content: '渚涘簲鍟嗗悕绉帮細' + this.barCodeInfo['渚涘簲鍟�'] + '\r\n'
});
-
+
printer.printText2({
offset: 1,
- fontSize:2,
+ fontSize: 2,
isBold: false,
isUnderLine: false,
- content: '鐗╂枡浠g爜锛�'+this.barCodeInfo['鐗╂枡浠g爜']+'\r\n'
+ content: '鐗╂枡浠g爜锛�' + this.barCodeInfo['鐗╂枡浠g爜'] + '\r\n'
});
printer.printText2({
offset: 1,
fontSize: 2,
isBold: false,
isUnderLine: false,
- content: '鐗╂枡绠�绉帮細'+this.barCodeInfo['鐗╂枡绠�绉�']+'\r\n'
- });
- printer.printText2({
- offset: 1,
- fontSize:2,
- isBold: false,
- isUnderLine: false,
- content: '鏁伴噺锛�'+this.barCodeInfo['鍓╀綑鏁伴噺']+'\r\n'
+ content: '鐗╂枡绠�绉帮細' + this.barCodeInfo['鐗╂枡绠�绉�'] + '\r\n'
});
printer.printText2({
offset: 1,
fontSize: 2,
isBold: false,
isUnderLine: false,
- content: '宸ュ彿锛�'+this.barCodeInfo['宸ュ彿']+'\r\n'
+ content: '鏁伴噺锛�' + this.barCodeInfo['鍓╀綑鏁伴噺'] + '\r\n'
});
printer.printText2({
offset: 1,
fontSize: 2,
isBold: false,
isUnderLine: false,
- content: '鐢熶骇鏃ユ湡锛�'+this.barCodeInfo['鐢熶骇鏃ユ湡']+'\r\n'
+ content: '宸ュ彿锛�' + this.barCodeInfo['宸ュ彿'] + '\r\n'
});
printer.printText2({
offset: 1,
fontSize: 2,
isBold: false,
isUnderLine: false,
- content: '娴佹按鍙凤細'+this.barCodeInfo['娴佹按鍙�']+'\r\n'
+ content: '鐢熶骇鏃ユ湡锛�' + this.barCodeInfo['鐢熶骇鏃ユ湡'] + '\r\n'
});
printer.printText2({
offset: 1,
fontSize: 2,
isBold: false,
isUnderLine: false,
- content: '鎵撳嵃鏃ユ湡锛�'+formatDate+'\r\n'
+ content: '娴佹按鍙凤細' + this.barCodeInfo['娴佹按鍙�'] + '\r\n'
+ });
+ printer.printText2({
+ offset: 1,
+ fontSize: 2,
+ isBold: false,
+ isUnderLine: false,
+ content: '鎵撳嵃鏃ユ湡锛�' + formatDate + '\r\n'
});
printer.printQR2({
text: this.barCodeInfo['鏉$爜缂栧彿'],
@@ -273,57 +275,57 @@
fontSize: 2,
isBold: false,
isUnderLine: false,
- content: '渚涘簲鍟嗗悕绉帮細'+this.barCodeInfo['渚涘簲鍟�']+'\r\n'
+ content: '渚涘簲鍟嗗悕绉帮細' + this.barCodeInfo['渚涘簲鍟�'] + '\r\n'
});
-
+
printer.printText2({
offset: 1,
- fontSize:2,
+ fontSize: 2,
isBold: false,
isUnderLine: false,
- content: '鐗╂枡浠g爜锛�'+this.barCodeInfo['鐗╂枡浠g爜']+'\r\n'
+ content: '鐗╂枡浠g爜锛�' + this.barCodeInfo['鐗╂枡浠g爜'] + '\r\n'
});
printer.printText2({
offset: 1,
fontSize: 2,
isBold: false,
isUnderLine: false,
- content: '鐗╂枡绠�绉帮細'+this.barCodeInfo['鐗╂枡绠�绉�']+'\r\n'
- });
- printer.printText2({
- offset: 1,
- fontSize:2,
- isBold: false,
- isUnderLine: false,
- content: '鏁伴噺锛�'+this.barCodeSplitInfo[0]['HSplitNum']+'\r\n'
+ content: '鐗╂枡绠�绉帮細' + this.barCodeInfo['鐗╂枡绠�绉�'] + '\r\n'
});
printer.printText2({
offset: 1,
fontSize: 2,
isBold: false,
isUnderLine: false,
- content: '宸ュ彿锛�'+this.barCodeInfo['宸ュ彿']+'\r\n'
+ content: '鏁伴噺锛�' + this.barCodeSplitInfo[0]['HSplitNum'] + '\r\n'
});
printer.printText2({
offset: 1,
fontSize: 2,
isBold: false,
isUnderLine: false,
- content: '鐢熶骇鏃ユ湡锛�'+this.barCodeInfo['鐢熶骇鏃ユ湡']+'\r\n'
+ content: '宸ュ彿锛�' + this.barCodeInfo['宸ュ彿'] + '\r\n'
});
printer.printText2({
offset: 1,
fontSize: 2,
isBold: false,
isUnderLine: false,
- content: '娴佹按鍙凤細'+this.barCodeInfo['娴佹按鍙�']+'\r\n'
+ content: '鐢熶骇鏃ユ湡锛�' + this.barCodeInfo['鐢熶骇鏃ユ湡'] + '\r\n'
});
printer.printText2({
offset: 1,
fontSize: 2,
isBold: false,
isUnderLine: false,
- content: '鎵撳嵃鏃ユ湡锛�'+formatDate+'\r\n'
+ content: '娴佹按鍙凤細' + this.barCodeInfo['娴佹按鍙�'] + '\r\n'
+ });
+ printer.printText2({
+ offset: 1,
+ fontSize: 2,
+ isBold: false,
+ isUnderLine: false,
+ content: '鎵撳嵃鏃ユ湡锛�' + formatDate + '\r\n'
});
printer.printQR2({
text: this.barCodeSplitInfo[0]['HBarCode'],
@@ -337,23 +339,30 @@
},
printerLabel2() {
console.log('娴嬭瘯鎵撳嵃');
- const formatDate =new Date().toISOString().split('T')[0];
+ const formatDate = new Date().toISOString().split('T')[0];
console.log(formatDate)
CommonUtils.showTips({
- message:'姣嶆爣绛綷r\n'+'渚涘簲鍟嗗悕绉帮細'+this.barCodeInfo['渚涘簲鍟�']+'\r\n'+'鐗╂枡浠g爜锛�'+this.barCodeInfo['鐗╂枡浠g爜']+'\r\n'+'鐗╂枡绠�绉帮細'+this.barCodeInfo['鐗╂枡绠�绉�']+'\r\n'
- +'鏁伴噺锛�'+this.barCodeInfo['鍓╀綑鏁伴噺']+'\r\n'+'宸ュ彿锛�'+this.barCodeInfo['宸ュ彿']+'\r\n'+'鐢熶骇鏃ユ湡锛�'+this.barCodeInfo['鐢熶骇鏃ユ湡']+'\r\n'+'娴佹按鍙凤細'+this.barCodeInfo['娴佹按鍙�']+'\r\n'
- +'鎵撳嵃鏃ユ湡锛�'+formatDate+'\r\n'+this.barCodeInfo['鏉$爜缂栧彿']+'\r\n'
- +'瀛愭爣绛綷r\n'+'渚涘簲鍟嗗悕绉帮細'+this.barCodeInfo['渚涘簲鍟�']+'\r\n'+'鐗╂枡浠g爜锛�'+this.barCodeInfo['鐗╂枡浠g爜']+'\r\n'+'鐗╂枡绠�绉帮細'+this.barCodeInfo['鐗╂枡绠�绉�']+'\r\n'
- +'鏁伴噺锛�'+this.barCodeSplitInfo[0]['HSplitNum']+'\r\n'+'宸ュ彿锛�'+this.barCodeInfo['宸ュ彿']+'\r\n'+'鐢熶骇鏃ユ湡锛�'+this.barCodeInfo['鐢熶骇鏃ユ湡']+'\r\n'+'娴佹按鍙凤細'+this.barCodeInfo['娴佹按鍙�']+'\r\n'
- +'鎵撳嵃鏃ユ湡锛�'+formatDate+'\r\n'+this.barCodeSplitInfo[0]['HBarCode']+'\r\n'
-
- ,
+ message: '姣嶆爣绛綷r\n' + '渚涘簲鍟嗗悕绉帮細' + this.barCodeInfo['渚涘簲鍟�'] + '\r\n' + '鐗╂枡浠g爜锛�' + this.barCodeInfo[
+ '鐗╂枡浠g爜'] + '\r\n' + '鐗╂枡绠�绉帮細' + this.barCodeInfo['鐗╂枡绠�绉�'] + '\r\n' +
+ '鏁伴噺锛�' + this.barCodeInfo['鍓╀綑鏁伴噺'] + '\r\n' + '宸ュ彿锛�' + this.barCodeInfo['宸ュ彿'] + '\r\n' +
+ '鐢熶骇鏃ユ湡锛�' + this.barCodeInfo['鐢熶骇鏃ユ湡'] + '\r\n' + '娴佹按鍙凤細' + this.barCodeInfo['娴佹按鍙�'] + '\r\n' +
+ '鎵撳嵃鏃ユ湡锛�' + formatDate + '\r\n' + this.barCodeInfo['鏉$爜缂栧彿'] + '\r\n' +
+ '瀛愭爣绛綷r\n' + '渚涘簲鍟嗗悕绉帮細' + this.barCodeInfo['渚涘簲鍟�'] + '\r\n' + '鐗╂枡浠g爜锛�' + this.barCodeInfo[
+ '鐗╂枡浠g爜'] + '\r\n' + '鐗╂枡绠�绉帮細' + this.barCodeInfo['鐗╂枡绠�绉�'] + '\r\n' +
+ '鏁伴噺锛�' + this.barCodeSplitInfo[0]['HSplitNum'] + '\r\n' + '宸ュ彿锛�' + this.barCodeInfo['宸ュ彿'] +
+ '\r\n' + '鐢熶骇鏃ユ湡锛�' + this.barCodeInfo['鐢熶骇鏃ユ湡'] + '\r\n' + '娴佹按鍙凤細' + this.barCodeInfo['娴佹按鍙�'] +
+ '\r\n' +
+ '鎵撳嵃鏃ユ湡锛�' + formatDate + '\r\n' + this.barCodeSplitInfo[0]['HBarCode'] + '\r\n'
+
+ ,
})
printer.setLineSpacing({
spacing: 1.2
});
-
- printer.setUnwindPaperLen({ length: 60 });
+
+ printer.setUnwindPaperLen({
+ length: 60
+ });
printer.setFontSize({
fontSize: 1
});
@@ -363,57 +372,57 @@
fontSize: 2,
isBold: false,
isUnderLine: false,
- content: '渚涘簲鍟嗗悕绉帮細'+this.barCodeInfo['渚涘簲鍟�']+'\r\n'
+ content: '渚涘簲鍟嗗悕绉帮細' + this.barCodeInfo['渚涘簲鍟�'] + '\r\n'
});
-
+
printer.printText2({
offset: 1,
- fontSize:2,
+ fontSize: 2,
isBold: false,
isUnderLine: false,
- content: '鐗╂枡浠g爜锛�'+this.barCodeInfo['鐗╂枡浠g爜']+'\r\n'
+ content: '鐗╂枡浠g爜锛�' + this.barCodeInfo['鐗╂枡浠g爜'] + '\r\n'
});
printer.printText2({
offset: 1,
fontSize: 2,
isBold: false,
isUnderLine: false,
- content: '鐗╂枡绠�绉帮細'+this.barCodeInfo['鐗╂枡绠�绉�']+'\r\n'
- });
- printer.printText2({
- offset: 1,
- fontSize:2,
- isBold: false,
- isUnderLine: false,
- content: '鏁伴噺锛�'+this.barCodeInfo['鍓╀綑鏁伴噺']+'\r\n'
+ content: '鐗╂枡绠�绉帮細' + this.barCodeInfo['鐗╂枡绠�绉�'] + '\r\n'
});
printer.printText2({
offset: 1,
fontSize: 2,
isBold: false,
isUnderLine: false,
- content: '宸ュ彿锛�'+this.barCodeInfo['宸ュ彿']+'\r\n'
+ content: '鏁伴噺锛�' + this.barCodeInfo['鍓╀綑鏁伴噺'] + '\r\n'
});
printer.printText2({
offset: 1,
fontSize: 2,
isBold: false,
isUnderLine: false,
- content: '鐢熶骇鏃ユ湡锛�'+this.barCodeInfo['鐢熶骇鏃ユ湡']+'\r\n'
+ content: '宸ュ彿锛�' + this.barCodeInfo['宸ュ彿'] + '\r\n'
});
printer.printText2({
offset: 1,
fontSize: 2,
isBold: false,
isUnderLine: false,
- content: '娴佹按鍙凤細'+this.barCodeInfo['娴佹按鍙�']+'\r\n'
+ content: '鐢熶骇鏃ユ湡锛�' + this.barCodeInfo['鐢熶骇鏃ユ湡'] + '\r\n'
});
printer.printText2({
offset: 1,
fontSize: 2,
isBold: false,
isUnderLine: false,
- content: '鎵撳嵃鏃ユ湡锛�'+formatDate+'\r\n'
+ content: '娴佹按鍙凤細' + this.barCodeInfo['娴佹按鍙�'] + '\r\n'
+ });
+ printer.printText2({
+ offset: 1,
+ fontSize: 2,
+ isBold: false,
+ isUnderLine: false,
+ content: '鎵撳嵃鏃ユ湡锛�' + formatDate + '\r\n'
});
printer.printQR2({
text: this.barCodeInfo['鏉$爜缂栧彿'],
@@ -490,17 +499,17 @@
count
} = res1
if (count > 0) {
-
+
this.barCodeInfo = data[0]
this.barCodeSplitInfo = []
// 鎵弿鏉$爜鍚庨噸缃寜閽姸鎬�
this.resetButtonState();
-
- }else{
+
+ } else {
CommonUtils.showTips({
- message: "璇ユ潯鐮佷笉瀛樺湪锛�"+this.barCodeInfoMeta.barCodeNo,
+ message: "璇ユ潯鐮佷笉瀛樺湪锛�" + this.barCodeInfoMeta.barCodeNo,
})
- this.barCodeInfoMeta.barCodeNo="";
+ this.barCodeInfoMeta.barCodeNo = "";
}
},
(err) => {
@@ -585,7 +594,7 @@
},
(err) => {
CommonUtils.showTips({
- message: "鏉$爜鎷嗙爜鍑虹幇閿欒"+err,
+ message: "鏉$爜鎷嗙爜鍑虹幇閿欒" + err,
})
console.error(err)
}
@@ -605,7 +614,7 @@
});
}
let msg =
- `${this.barCodeInfoMeta["barCodeNo"]};${this.barCodeInfoMeta["splitNum"]};${JSON.stringify(this.barCodeSplitInfo)};${this.billMaker}`
+ `${this.barCodeInfoMeta["barCodeNo"]};${this.barCodeInfoMeta["splitNum"]};${JSON.stringify(this.barCodeSplitInfo)};${this.barCodeInfoMeta["billMaker"]}`
this.doRequest(
"/Sc_BarCode/SplitBarCode_Save", {
msg: msg
@@ -616,7 +625,7 @@
this.cantGenerate = true;
this.cantPrint = false;
this.cantSplit = true;
- this.barCodeInfoMeta.barCodeNo="";//娓呯┖杈撳叆妗�
+ this.barCodeInfoMeta.barCodeNo = ""; //娓呯┖杈撳叆妗�
uni.showToast({
title: '鐢熸垚鎴愬姛!'
});
@@ -631,9 +640,9 @@
(err) => {
console.log(err)
CommonUtils.showTips({
- message: "鏉$爜鐢熸垚鍑虹幇閿欒"+err,
+ message: "鏉$爜鐢熸垚鍑虹幇閿欒" + err,
})
-
+
},
"POST"
)
@@ -653,7 +662,7 @@
this.isPrinting = true;
try {
- this.printerLabel();//鎵撳嵃
+ this.printerLabel(); //鎵撳嵃
} catch (error) {
console.error('鎵撳嵃澶辫触:', error);
this.isPrinting = false;
@@ -694,7 +703,7 @@
// 椤甸潰鍒濆鍖栨椂璁剧疆鎸夐挳鐘舵��
this.resetButtonState();
// 娣诲姞鎵撳嵃鐘舵�佺洃鍚�
- if(!isPrinterInitialized){
+ if (!isPrinterInitialized) {
const self = this;
globalEvent.addEventListener('onPrintCallback', function(e) {
uni.showToast({
@@ -727,14 +736,14 @@
}
//鍒濆鍖栨墦鍗�
this.initPrinter();
-
+
},
onReady() {
-
+
},
onUnload() {
// 璋冪敤鍚屾鏂规硶
-
+
}
}
</script>
--
Gitblit v1.9.1