|
|
@@ -5,6 +5,16 @@
|
|
|
<!-- 顶部导航栏 -->
|
|
|
<dk-app-nav-bar :title="title" @click-left="onClickLeft"></dk-app-nav-bar>
|
|
|
|
|
|
+
|
|
|
+ <van-tabs v-model="active" @click="onClick">
|
|
|
+ <van-tab :title="$t('appProductBarcode')"></van-tab>
|
|
|
+ <van-tab :title="$t('appMouldUniqueCode')"></van-tab>
|
|
|
+ <van-tab :title="$t('appVehicleBarcode')"></van-tab>
|
|
|
+ <van-tab :title="$t('appWuliaoBarcode')"></van-tab>
|
|
|
+ <van-tab :title="$t('appSheBeiBarcode')"></van-tab>
|
|
|
+
|
|
|
+ </van-tabs>
|
|
|
+
|
|
|
<!-- 模板分类 -->
|
|
|
<dk-app-field :label="$t('appPrintTemplate')" v-model="formData.printLayoutName" :readonly="true"
|
|
|
@click="openDropdown('labelPrintLayout')" placeholderType="choose" is-link arrow-direction="down" />
|
|
|
@@ -12,9 +22,18 @@
|
|
|
<dk-app-field v-model="formData.printerName" :label="$t('appPrinter')" :readonly="true"
|
|
|
@click="openDropdown('labelPrinter')" placeholderType="choose" is-link arrow-direction="down" />
|
|
|
|
|
|
- <!-- 产品条码-->
|
|
|
- <dk-app-field v-model="formData.mouldKindName" :label="$t('appProductBarcode')"
|
|
|
- @changeBarCode="queryBarCode"></dk-app-field>
|
|
|
+ <!-- 条码-->
|
|
|
+ <dk-app-field ref="barcode" v-model="formData.barcode" :placeholderTxtFlag="true" :placeholderFlag="false"
|
|
|
+ :placeholderTxt="'请输入' + barcodeLabel" :label="barcodeLabel" @changeBarCode="queryBarCode"></dk-app-field>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
<!-- 打印 -->
|
|
|
<div class="app_save_bottom-class">
|
|
|
@@ -61,12 +80,16 @@ export default {
|
|
|
let self = this
|
|
|
return {
|
|
|
title: '',
|
|
|
+ active: 0,
|
|
|
+ barcodeLabel: '',
|
|
|
+ titleFlagNum: null,
|
|
|
loading: false,
|
|
|
workStationAllFlag: false,
|
|
|
labelPrinterFlag: false, //打印机
|
|
|
labelPrintLayoutFlag: false, //打印模板
|
|
|
ids: [],
|
|
|
formData: {
|
|
|
+ id: null,
|
|
|
printerId: null, //打印机
|
|
|
printerName: '',
|
|
|
printLayoutId: null, //打印机模板
|
|
|
@@ -164,7 +187,23 @@ export default {
|
|
|
* @date : 2023/2/10 11:46
|
|
|
*/
|
|
|
queryBarCode() {
|
|
|
-
|
|
|
+ let params = {
|
|
|
+ code: this.formData.barcode,
|
|
|
+ ftyId: this.$store.state.user.ftyId,
|
|
|
+ dataSourceCode: this.dataSourceCode,
|
|
|
+ }
|
|
|
+ this.excute(this.$service.appCommonService, this.$service.appCommonService.getPrintingData, params, '', true).then(res => {
|
|
|
+ if (res.code === this.$config.SUCCESS_CODE) {
|
|
|
+ if (res.data && res.data.id) {
|
|
|
+ this.formData.id = res.data.id
|
|
|
+ } else {
|
|
|
+ this.$appDialog.alert({ message: this.$t('W_002', { 'param': this.$t('appBarcode') }) }).then(() => {
|
|
|
+ this.formData.barcode = ''
|
|
|
+ this.setFocus('barcode')
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
|
|
|
// endregion
|
|
|
@@ -184,6 +223,12 @@ export default {
|
|
|
* @date : 2023/2/10 11:46
|
|
|
*/
|
|
|
validData(flag) {
|
|
|
+ if (!this.formData.id) {
|
|
|
+ this.appToastFail(this.$t('appSelectWords', { 'search-name': this.barcodeLabel }))
|
|
|
+ this.setFocus('barcode')
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
if (!this.formData.printerId) { //打印机
|
|
|
this.appToastFail(this.$t('selectWords', { 'search-name': this.$t('appPrinter') }))
|
|
|
return false;
|
|
|
@@ -196,19 +241,76 @@ export default {
|
|
|
return true;
|
|
|
},
|
|
|
/**
|
|
|
- * @desc : 保存方法
|
|
|
+ * @desc : 打印方法
|
|
|
* @author : 于继渤
|
|
|
* @date : 2023/2/10 11:46
|
|
|
*/
|
|
|
saveData() {
|
|
|
- // return this.excute(this.$service.appMouldService, this.$service.appMouldService.insert, this.params);
|
|
|
+ return this.excute(this.$service.modelCarrierService,
|
|
|
+ this.$service.modelCarrierService.print + '/' + this.formData.printLayoutId + '/' + this.formData.printerId + '/' + this.formData.id, {});
|
|
|
},
|
|
|
+ /**
|
|
|
+ * @desc : 清除
|
|
|
+ * @author : 于继渤
|
|
|
+ * @date : 2023/2/10 11:46
|
|
|
+ */
|
|
|
+ clear() {
|
|
|
+ this.formData = {
|
|
|
+ id: null,
|
|
|
+ printerId: null, //打印机
|
|
|
+ printerName: '',
|
|
|
+ printLayoutId: null, //打印机模板
|
|
|
+ printLayoutName: '',
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onClick(e) {
|
|
|
+ console.log(e)
|
|
|
+ if (e === 0) {
|
|
|
+ this.barcodeLabel = this.$t('appProductBarcode')
|
|
|
+ this.dataSourceCode = 'product'
|
|
|
+ }
|
|
|
+ if (e === 1) {
|
|
|
+ this.barcodeLabel = this.$t('appMouldUniqueCode')
|
|
|
+
|
|
|
+ }
|
|
|
+ if (e === 2) {
|
|
|
+ this.barcodeLabel = this.$t('appVehicleBarcode')
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ if (e === 3) {
|
|
|
+ this.barcodeLabel = this.$t('appWuliaoBarcode')
|
|
|
+
|
|
|
+ }
|
|
|
+ if (e === 4) {
|
|
|
+ this.barcodeLabel = this.$t('appSheBeiBarcode')
|
|
|
+
|
|
|
+ }
|
|
|
+ this.formData = {
|
|
|
+ id: null,
|
|
|
+ printerId: null, //打印机
|
|
|
+ printerName: '',
|
|
|
+ printLayoutId: null, //打印机模板
|
|
|
+ printLayoutName: '',
|
|
|
+ }
|
|
|
+ //焦点输入框
|
|
|
+ this.setFocus('barcode')
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
// endregion
|
|
|
|
|
|
},
|
|
|
+ mounted(){
|
|
|
+ this.setFocus('barcode')
|
|
|
+ },
|
|
|
created() {
|
|
|
//设置标题
|
|
|
- this.title = '' + this.$t('appStationPrinterSettingsTitle')
|
|
|
+ this.title = this.$t('appStationPrinterSettingsTitle')
|
|
|
+ this.barcodeLabel = this.$t('appProductBarcode')
|
|
|
+ this.dataSourceCode = 'product'
|
|
|
+
|
|
|
},
|
|
|
|
|
|
|