Просмотр исходного кода

feat(originCode): 添加行业属性到追溯二维码链接

liujt 3 месяцев назад
Родитель
Сommit
d571c2f91c
1 измененных файлов с 16 добавлено и 2 удалено
  1. 16 2
      src/views/produceOrder/originCode.vue

+ 16 - 2
src/views/produceOrder/originCode.vue

@@ -40,6 +40,7 @@
 </template>
 
 <script>
+  import { parameterGetByCode } from '@/api/system/dictionary-data';
   import QRCode from 'qrcode';
   export default {
     data() {
@@ -60,9 +61,22 @@
         url: '',
         workOrderId: '',
         qrCodeUrl: '',
-        QRvisible: false
+        QRvisible: false,
+        industryAttribute: ''
       };
     },
+    created() {
+      // 行业属性  0:通用行业;1:生物医药行业;2:电线电缆行业;
+      parameterGetByCode({
+        code: 'industry_attribute'
+      }).then((res) => {
+        console.log(res.value, '77777');
+        if (res.value) {
+          console.log(res, '33333333');
+          this.industryAttribute = res.value
+        }
+      });
+    },
     mounted() {},
 
     methods: {
@@ -71,7 +85,7 @@
         this.workOrderId = workOrderId;
 
         this.qrCodeUrl =
-          window.location.origin + `/traceability?id=${this.workOrderId}`;
+          window.location.origin + `/traceability?id=${this.workOrderId}&industry=${this.industryAttribute}`;
         // this.qrCodeUrl = `http://192.168.1.22:9999/traceability?id=${this.workOrderId}`;
 
         this.$nextTick(() => {