yusheng пре 1 година
родитељ
комит
4205033165

+ 23 - 0
src/components/jimureport/api.js

@@ -0,0 +1,23 @@
+import request from '@/utils/request';
+
+export async function getServiceurl () {
+  const res = await request.get('sys/jimureport/getServiceurl');
+  if (res.data.code == 0 && res.data.data) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+export async function getPrintMap () {
+  const res = await request.get('sys/jimureport/getPrintMap');
+  if (res.data.code == 0 && res.data.data) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+export async function getJmPrintViewUrl (code) {
+  const res = await request.get('sys/jimureport/getJmPrintViewUrl/'+code);
+  if (res.data.code == 0 && res.data.data) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 23 - 0
src/components/jimureport/browse.vue

@@ -0,0 +1,23 @@
+<template>
+  <iframe
+    :src="url"
+    width="100%"
+    style="height: calc(100vh - 100px)"
+    frameborder="0"
+    allowfullscreen="true"
+  ></iframe>
+</template>
+
+<script>
+  export default {
+    props: {
+      url: ''
+    },
+    data() {
+      return {};
+    },
+
+    methods: {}
+  };
+</script>
+<style scoped lang="scss"></style>

+ 52 - 0
src/components/jimureport/browseModal.vue

@@ -0,0 +1,52 @@
+<template>
+  <div>
+    <ele-modal
+      :visible.sync="showEditFlag"
+      :close-on-click-modal="false"
+      custom-class="ele-dialog-form"
+      append-to-body
+      :fullscreen="true"
+    >
+      <browse :url="fileUrl"></browse
+    ></ele-modal>
+    <el-link type="primary" @click="open">{{ text }}</el-link>
+  </div>
+</template>
+
+<script>
+  import { getToken } from '@/utils/token-util';
+  import { getJmPrintViewUrl } from './api.js';
+  import browse from './browse.vue';
+
+  export default {
+    components: {
+      browse
+    },
+    props: {
+      text: {
+        default: '打印预览'
+      },
+      businessId: {
+        default: ''
+      },
+      businessCode: {
+        default: ''
+      }
+    },
+    data() {
+      return {
+        fileUrl: '',
+        showEditFlag: false
+      };
+    },
+
+    methods: {
+      async open() {
+        this.showEditFlag = true;
+        let url = await getJmPrintViewUrl(this.businessCode);
+        this.fileUrl = `${url}?token=${getToken()}&id=${this.businessId}`;
+      }
+    }
+  };
+</script>
+<style scoped lang="scss"></style>

+ 1 - 1
src/views/login/index.vue

@@ -110,7 +110,7 @@
   import I18nIcon from '@/layout/components/i18n-icon.vue';
   import { getToken } from '@/utils/token-util';
   import { login, getCaptcha, sub } from '@/api/login';
-
+  
   export default {
     // eslint-disable-next-line vue/multi-word-component-names
     name: 'Login',

+ 8 - 11
src/views/maintenance/equipment/workOrder/index.vue

@@ -28,14 +28,16 @@
         </template>
         <!-- 操作列 -->
         <template v-slot:action="{ row }">
-          <el-link
-            v-if="row.orderStatus === 3"
+          <!-- <el-link
+           
             type="primary"
             :underline="false"
             @click="handleExport(row)"
           >
             预览打印
-          </el-link>
+          </el-link> -->
+          <jimureportBrowse  v-if="row.orderStatus === 3" :businessId="row.id" businessCode="qmsprint"></jimureportBrowse>
+
           <el-link
             v-if="row.orderStatus !== 3 && row.orderStatus !== 4"
             type="primary"
@@ -94,17 +96,17 @@
   import signingUpWork from '@/views/maintenance/components/signingUpWork.vue';
   import { getWordOrderDetail } from '@/api/maintenance/patrol_maintenance';
 
+  import jimureportBrowse from '@/components/jimureport/browseModal.vue';
   import printWorkOrder from './components/printWorkOrder.vue';
 
   import { getToken } from '@/utils/token-util';
-
   export default {
     components: {
       WorkSearch,
       redeployOther,
       signingUpWork,
       edit,
-      printWorkOrder
+      printWorkOrder,jimureportBrowse
     },
     data() {
       return {
@@ -289,12 +291,7 @@
       handlePrint(row, val) {
         this.$refs.printRef11.open(row.id, val);
       },
-      handleExport(row) {
-        const url = `http://192.168.120.128:8085/jmreport/view/1059771706421719040?token=${getToken()}&id=${
-          row.id
-        }`;
-        window.open(url, '_blank');
-      }
+
     }
   };
 </script>