于继渤 пре 3 година
родитељ
комит
5a07859051

+ 2 - 0
src/api/pages/common/common.js

@@ -167,6 +167,8 @@ export default {
     getColourForSet:'get_colour_for_set',
     //商标设定放大镜详细查询
     getLogoForSet:'get_logo_for_set',
+    
+    getPrintingData:'get_printing_data',
   }
 }
 

+ 7 - 1
src/components-app/base/dk-app-field/dk-app-field.vue

@@ -185,7 +185,7 @@ export default {
     placeholderTxt:{
       type: String,
       default: ''
-    }
+    },
   }
   ,
   data() {
@@ -211,6 +211,12 @@ export default {
         this.model = n
       }
     },
+    placeholderTxt(n, o){
+      //监听请输入 文字发生改变
+        if(n){
+          this.placeholder =  this.placeholderTxt 
+        }
+    }
   },
   mounted() {
   },

+ 5 - 0
src/locale/lang/zh-CN.js

@@ -1466,6 +1466,9 @@ export const appColumns = {
   appCurrentNode: '当前工序',
   appLableInput: '请输入{param}',
   appPrint: '打印',
+  appVehicleBarcode: '载具条码',
+  appWuliaoBarcode: '物料条码',
+  appSheBeiBarcode: '设备条码',
 }
 /**
  * @desc   : app按钮
@@ -1532,6 +1535,8 @@ export const appOthers = {
   appCheckBarcode: '请输入条码',
   appCheckBarcodeIsCheck: '请验证产品条码',
   appMoldingBathSearchPlaceholder: '请输入成型批次',
+  appBarcode: '条码',
+  appSelectWords: '请验证{search-name}',
   /**
    * @desc   : 上卸模 函数名称
    * @author : 于继渤

+ 109 - 7
src/view-app/app/prod-management/barcode-printing/index.vue

@@ -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'
+   
   },