于继渤 2 лет назад
Родитель
Сommit
8f4d028ec9

+ 1 - 1
.env.test

@@ -1,7 +1,7 @@
 NODE_ENV='production'
 VUE_APP_BUILD_TYPE='test'
 VUE_APP_SERVER_URL='https://s.dev01.dkiboss.com:6010/api'
-VUE_APP_EXPORT_URL='https://s.dev01.dkiboss.com:5000/'
+VUE_APP_EXPORT_URL='https://s.dev01.dkiboss.com:6010/file/'
 VUE_APP_UPLOAD_URL='https://s.dev01.dkiboss.com:6010/api/basic-server/file/upload'
 VUE_APP_LOGS_URL='https://ibossmp.dongkesoft.com:7050/logs'
 VUE_APP_IMG_URL='https://hgscrm-dev.oss-cn-shenzhen.aliyuncs.com/'

+ 24 - 0
src/api/pages/mst/work-sop.js

@@ -0,0 +1,24 @@
+
+/**
+ * @desc   : 作业指导书服务
+ * @author : 洪旭东
+ * @date   : 2023-07-26 15:40
+ */
+export default {
+  workSopService:{
+    prefix:'/mdm-server/mst/work_sop/',
+    getByModel:'get_by_model',
+  }
+}
+
+
+/**
+ * @desc   : 路由
+ * @author : 洪旭东
+ * @date   : 2023-07-26 15:40
+ */
+export const routeUrl = {
+  workSop: {
+    preview: {key: 'preview', method: 'preview'},
+  },
+}

BIN
src/assets/images/app-image/book.png


+ 26 - 5
src/components-app/base/dk-app-nav-bar/dk-app-nav-bar.vue

@@ -34,6 +34,8 @@
         <slot name="right">
           <!-- 三个点-->
           <van-icon v-if="rightIcon" name="ellipsis" size="25px" />
+          <!-- 指导书-->
+          <van-icon v-if="rightIconBook" :name="rightIconBookPath" size="25" @click="rightIconBookClick"/>
         </slot>
       </template>
     </van-nav-bar>
@@ -90,7 +92,20 @@ export default {
     actions: {
       type: Array,
       default: () => [] //默认值
+    },
+    rightIconBook:{
+      type: Boolean,
+      default: false
+    },
+    rightIconBookPath:{
+      type: String,
+      default: require("@/assets/images/app-image/book.png")
+    },
+    sopPath:{
+      type: String,
+      default: ''
     }
+ 
   },
   data() {
     return {
@@ -105,13 +120,19 @@ export default {
       if (item.toRouter) {
         this.$router.push({ name: item.toRouter })
       }
-      if(item.type === 1){
-          //点击事件
-          this.$emit('toApp',{
-            item:item
-          })
+      if (item.type === 1) {
+        //点击事件
+        this.$emit('toApp', {
+          item: item
+        })
       }
 
+    },
+
+    rightIconBookClick(){
+
+      window.open(process.env.VUE_APP_EXPORT_URL + this.sopPath)
+      
     }
   }
 

+ 13 - 1
src/view-app/app/piecework-procedure/climb-kiln/index.vue

@@ -476,7 +476,19 @@ export default {
      * @date   : 2023/2/10 11:46
      */
     saveData() {
-      return this.excute(this.$service.appCollectService, this.$service.appCollectService.add, this.params, 'userPwd', true);
+      return this.excute(this.$service.appCollectService, this.$service.appCollectService.add, this.params, 'userPwd', true).then(res=>{
+        if (res.code == this.$config.SUCCESS_CODE) {
+          //成功返回打印机数据
+          if(res.data && res.data.length>0){
+            let printList = res.data
+            for(let i of printList ){
+              for(let item of i.printLayout){
+                this.$printUtil.print(item.layoutData,i.printData,item.printerCode)
+              }
+            }
+          }
+        }
+      })
     },
     /**
      * @desc   : 对话框逻辑后的处理(掉接口 返回不是200的对话框)

+ 35 - 1
src/view-app/app/piecework-procedure/finish-check/index.vue

@@ -2,7 +2,7 @@
   <!--  成检      功能(functionCode) index  -->
   <div class="main-app">
     <!-- 顶部导航栏 -->
-    <dk-app-nav-bar :title="appActiveTitle" @click-left="onClickLeft"></dk-app-nav-bar>
+    <dk-app-nav-bar :title="appActiveTitle" @click-left="onClickLeft" :rightIconBook="rightIconBook" :sopPath="sopPath"></dk-app-nav-bar>
     <!-- 选择工位 -->
     <dk-app-field v-if="stationList.length > 0" v-model="formData.stationName" :label="$t('stationName')" :readonly="true"
       @click="showStation = true" placeholderType="choose" is-link arrow-direction="down" />
@@ -96,6 +96,7 @@ export default {
     let self = this
     return {
       gradeFlag: null,
+      rightIconBook:false,
       stationList: [],      //工位list数据源
       gradeKindList: [],      //工位list数据源
       showStation: false,
@@ -324,6 +325,7 @@ export default {
             this.defectFlag = false
           }
           this.getGradeData()
+          this.getByModel(res.data.modelId)
          
         }
       })
@@ -630,6 +632,16 @@ export default {
             this.defectFlag = false
             this.getProcessNode()
             this.appToastSuccess(this.$t('I_002'))
+
+              //成功返回打印机数据
+              if (res.data && res.data.length > 0) {
+              let printList = res.data
+              for (let i of printList) {
+                for (let item of i.printLayout) {
+                  this.$printUtil.print(item.layoutData, i.printData, item.printerCode)
+                }
+              }
+            }
           }
         })
       }
@@ -668,6 +680,28 @@ export default {
       this.productionDefectList.splice(e.index, 1)
     },
 
+
+    /**
+     * @desc   : 显示作业指导书
+     * @author : 于继渤
+     * @date   : 2023/8/3 10:34
+     */
+     getByModel(modelId) {
+      let params = {}
+      params.ftyId = this.$store.state.user.ftyId
+      params.modelId = modelId
+      this.excute(this.$service.workSopService, this.$service.workSopService.getByModel, params).then(res => {
+        if (res.code === this.$config.SUCCESS_CODE) {
+          if(res.data && res.data.sopPath){
+            this.rightIconBook = true
+            this.sopPath =  res.data.sopPath
+          }else{
+            this.rightIconBook = false
+          }
+        }
+      })
+    },
+
   },
   mounted() {
     // 设置滚动的位置和高度

+ 43 - 1
src/view-app/app/piecework-procedure/half-check/index.vue

@@ -2,7 +2,8 @@
   <!--  半检      功能(functionCode) index : -->
   <div class="main-app">
     <!-- 顶部导航栏 -->
-    <dk-app-nav-bar :title="appActiveTitle" @click-left="onClickLeft"></dk-app-nav-bar>
+    <dk-app-nav-bar :title="appActiveTitle" @click-left="onClickLeft" :rightIconBook="rightIconBook" :sopPath="sopPath">
+    </dk-app-nav-bar>
     <!-- 选择工位 -->
     <dk-app-field v-if="stationList.length > 0" v-model="formData.stationName" :label="$t('stationName')" :readonly="true"
       @click="showStation = true" placeholderType="choose" is-link arrow-direction="down" />
@@ -114,6 +115,7 @@ export default {
         { label: '选项2', value: 'option2' },
         { label: '选项3', value: 'option3' },
       ],
+      rightIconBook: false,
       gradeFlag: null,
       stationList: [],      //工位list数据源
       showStation: false,
@@ -311,6 +313,11 @@ export default {
           } else {
             this.gradeFlag = this.$libaray.checkButtonHasRight('half-check-recharge')
           }
+
+          this.getByModel(res.data.modelId)
+
+
+
           if (res.data.opnGradeKind && ((res.data.opnGradeKind.indexOf(this.$t('appExcellent')) === -1))) {
             this.defectFlag = true
           } else {
@@ -641,6 +648,7 @@ export default {
         this.setParams()
         return this.excute(this.$service.appCollectService, this.$service.appCollectService.add, this.params).then(res => {
           if (res.code === this.$config.SUCCESS_CODE) {
+
             this.formData.barCode = ''//产品条码
             this.formData.ftyId = this.$store.state.user.ftyId//工厂ID
             this.formData.gradeKindName = ''//产品等级
@@ -658,6 +666,17 @@ export default {
             this.defectFlag = false
             this.getProcessNode()
             this.appToastSuccess(this.$t('I_002'))
+
+
+            //成功返回打印机数据
+            if (res.data && res.data.length > 0) {
+              let printList = res.data
+              for (let i of printList) {
+                for (let item of i.printLayout) {
+                  this.$printUtil.print(item.layoutData, i.printData, item.printerCode)
+                }
+              }
+            }
           }
         })
       }
@@ -699,6 +718,29 @@ export default {
       this.productionDefectDelIdList.push(this.productionDefectList[e.index].prodDefectId)
       this.productionDefectList.splice(e.index, 1)
     },
+
+    /**
+     * @desc   : 显示作业指导书
+     * @author : 于继渤
+     * @date   : 2023/8/3 10:34
+     */
+    getByModel(modelId) {
+      let params = {}
+      params.ftyId = this.$store.state.user.ftyId
+      params.modelId = modelId
+      this.excute(this.$service.workSopService, this.$service.workSopService.getByModel, params).then(res => {
+        if (res.code === this.$config.SUCCESS_CODE) {
+          if (res.data && res.data.sopPath) {
+            this.rightIconBook = true
+            this.sopPath = res.data.sopPath
+          } else {
+            this.rightIconBook = false
+
+          }
+        }
+      })
+    },
+
   },
   mounted() {
     // 设置滚动的位置和高度

+ 13 - 1
src/view-app/app/piecework-procedure/in-kiln/index.vue

@@ -350,7 +350,19 @@ export default {
      */
     saveData() {
 
-      return this.excute(this.$service.appCollectService, this.$service.appCollectService.add, this.params, 'saveData', true);
+      return this.excute(this.$service.appCollectService, this.$service.appCollectService.add, this.params, 'saveData', true).then(res=>{
+        if (res.code == this.$config.SUCCESS_CODE) {
+          //成功返回打印机数据
+          if(res.data && res.data.length>0){
+            let printList = res.data
+            for(let i of printList ){
+              for(let item of i.printLayout){
+                this.$printUtil.print(item.layoutData,i.printData,item.printerCode)
+              }
+            }
+          }
+        }
+      })
     },
     /**
      * @desc   : 对话框逻辑后的处理(掉接口 返回不是200的对话框)

+ 13 - 1
src/view-app/app/piecework-procedure/out-kiln/index.vue

@@ -343,7 +343,19 @@ export default {
      * @date   : 2023/2/10 11:46
      */
     saveData() {
-      return this.excute(this.$service.appCollectService, this.$service.appCollectService.add, this.params, 'saveData', true);
+      return this.excute(this.$service.appCollectService, this.$service.appCollectService.add, this.params, 'saveData', true).then(res=>{
+        if (res.code == this.$config.SUCCESS_CODE) {
+          //成功返回打印机数据
+          if(res.data && res.data.length>0){
+            let printList = res.data
+            for(let i of printList ){
+              for(let item of i.printLayout){
+                this.$printUtil.print(item.layoutData,i.printData,item.printerCode)
+              }
+            }
+          }
+        }
+      })
     },
     /**
      * @desc   : 对话框逻辑后的处理(掉接口 返回不是200的对话框)

+ 13 - 1
src/view-app/app/piecework-procedure/recover/index.vue

@@ -314,7 +314,19 @@ export default {
      * @date   : 2023/2/10 11:46
      */
     saveData() {
-      return this.excute(this.$service.appCollectService, this.$service.appCollectService.add, this.params, 'saveData', true);
+      return this.excute(this.$service.appCollectService, this.$service.appCollectService.add, this.params, 'saveData', true).then(res=>{
+        if (res.code == this.$config.SUCCESS_CODE) {
+          //成功返回打印机数据
+          if(res.data && res.data.length>0){
+            let printList = res.data
+            for(let i of printList ){
+              for(let item of i.printLayout){
+                this.$printUtil.print(item.layoutData,i.printData,item.printerCode)
+              }
+            }
+          }
+        }
+      })
     },
     /**
      * @desc   : 对话框逻辑后的处理(掉接口 返回不是200的对话框)

+ 13 - 1
src/view-app/app/piecework-procedure/register/index.vue

@@ -588,7 +588,19 @@ export default {
      * @date   : 2023/2/10 11:46
      */
     saveData() {
-      return this.excute(this.$service.appCollectService, this.$service.appCollectService.add, this.params, 'saveData', true);
+      return this.excute(this.$service.appCollectService, this.$service.appCollectService.add, this.params, 'saveData', true).then(res=>{
+        if (res.code == this.$config.SUCCESS_CODE) {
+          //成功返回打印机数据
+          if(res.data && res.data.length>0){
+            let printList = res.data
+            for(let i of printList ){
+              for(let item of i.printLayout){
+                this.$printUtil.print(item.layoutData,i.printData,item.printerCode)
+              }
+            }
+          }
+        }
+      })
     },
     /**
      * @desc   : 对话框逻辑后的处理(掉接口 返回不是200的对话框)

+ 13 - 1
src/view-app/app/piecework-procedure/shaping/index.vue

@@ -177,7 +177,19 @@ export default {
      * @date   : 2023/2/10 11:46
      */
     saveData() {
-      return this.excute(this.$service.appMouldService, this.$service.appMouldService.insert, this.params);
+      return this.excute(this.$service.appMouldService, this.$service.appMouldService.insert, this.params).then(res=>{
+        if (res.code == this.$config.SUCCESS_CODE) {
+          //成功返回打印机数据
+          if(res.data && res.data.length>0){
+            let printList = res.data
+            for(let i of printList ){
+              for(let item of i.printLayout){
+                this.$printUtil.print(item.layoutData,i.printData,item.printerCode)
+              }
+            }
+          }
+        }
+      })
     },
     // endregion
 

+ 10 - 0
src/view-app/app/piecework-procedure/uninstall-kiln/index.vue

@@ -349,6 +349,16 @@ export default {
           if (!IsPieceSingleFlag) {
             this.tableRowData = []
           }
+
+
+          if(res.data && res.data.length>0){
+            let printList = res.data
+            for(let i of printList ){
+              for(let item of i.printLayout){
+                this.$printUtil.print(item.layoutData,i.printData,item.printerCode)
+              }
+            }
+          }
         }
       })