dedsudiyu hace 11 meses
padre
commit
1ae4b94eed

+ 6 - 6
README.md

@@ -101,12 +101,12 @@
 |  ---- | ---- | ---- | ---- | 
 | type:12 | 化学品终端-扫码双人认证 | doorId,subId,macId,code | 前端生成 - 用于微信公共扫码-双人认证 |
 | type:11 | 化学品终端-扫码单人登录 | code,subId,macId | 前端生成 - 用于微信公共扫码-单人登录 |
-| type:10 | 实验室关联危险源 | -- | 前端生成 |
-| type:9 | 化学品 | -- | 前端生成 |
-| type:8 | 化学品柜 | -- | 前端生成 |
-| type:7 | 培训课程 | -- | 前端生成 |
-| type:6 | 专项检查 | -- | 前端生成 |
-| type:5 | 实验室详情 | -- | 前端生成 - 用于微信公共扫码-查看实验室详情,安全检查扫码跳安全检查 |
+| type:10 | 实验室关联危险源设备 | code | 前端生成 - 小程序专项检查扫码 |
+| type:9 | 化学品 | -- | 安卓生成 - 用于微信公共扫码-查看化学品 |  
+| type:8 | 化学品柜 | -- | 安卓生成 - 用于微信公共扫码-查看化学品柜 |
+| type:7 | 培训课程 | -- | 安卓生成 - 用于微信公共扫码-查看培训课程 |
+| type:6 | 专项检查 | -- | 安卓生成 - 未知应用方式 |
+| type:5 | 实验室详情 | code | 前端生成 - 用于微信公共扫码-查看实验室详情,小程序安全检查页面扫码 |
 | type:3 | 危险源列表 | code | 前端生成 - 用于微信公共扫码-查看详情 |
 | type:2 | 安全制度 | code | 前端生成 - 用于微信公共扫码-查看详情 |
 | type:1 | MSDS说明书 | code | 前端生成 - 用于微信公共扫码-查看详情|

+ 1 - 1
src/assets/styles/commonality.scss

@@ -808,7 +808,7 @@
     top: 0;
     bottom: 0;
     left: 0;
-    z-index: 1001;
+    z-index: 11;
     -webkit-box-shadow: 2px 0 6px rgba(0,21,41,.35);
     overflow: hidden;
     padding:0 20px;

+ 28 - 25
src/components/qrCodeDialog/index.vue

@@ -78,32 +78,35 @@
       //初始化
       initialize(){
         let self = this;
-        this.$set(this,'vueQrCodeData', this.identification+'?code='+this.qrCodeDialogData.parameter+'&type='+this.qrCodeDialogData.type);
-        this.$set(this,'dialogType',true);
-        this.$nextTick(function () {
-          // DOM 更新了
-          setTimeout(function(){
-            //获取二维码数据
-            let imgbase64 = self.$refs.vueQr.imgUrl;
-            let img = new Image();
-            img.src = imgbase64;
-            //获取canvas容器
-            let myCanvas = document.getElementById( "myCanvas" ).getContext( '2d' );
-            //清空画布-设置背景白色
-            myCanvas.fillStyle = "#FFFFFF";
-            myCanvas.clearRect(0, 0, 300, 240);
-            myCanvas.fillRect(0, 0, 300, 240);
-            //绘制二维码
-            myCanvas.drawImage( img, 50, 0 );
-            if(self.qrCodeDialogData.codeName){
-              //设置水印
-              myCanvas.font = "bold 14px 'Fira Sans'";
-              myCanvas.fillStyle = 'rgba(0,0,0,1)'; //水印颜色
-              //绘制水印
-              myCanvas.fillText(self.qrCodeDialogData.codeName, (300-(self.qrCodeDialogData.codeName.length*14))/2, 215); //左下
-            }
-          },100);
+        this.$nextTick(()=>{
+          this.$set(this,'vueQrCodeData', this.identification+'?code='+this.qrCodeDialogData.parameter+'&type='+this.qrCodeDialogData.type);
+          this.$set(this,'dialogType',true);
+          this.$nextTick(function () {
+            // DOM 更新了
+            setTimeout(function(){
+              //获取二维码数据
+              let imgbase64 = self.$refs.vueQr.imgUrl;
+              let img = new Image();
+              img.src = imgbase64;
+              //获取canvas容器
+              let myCanvas = document.getElementById( "myCanvas" ).getContext( '2d' );
+              //清空画布-设置背景白色
+              myCanvas.fillStyle = "#FFFFFF";
+              myCanvas.clearRect(0, 0, 300, 240);
+              myCanvas.fillRect(0, 0, 300, 240);
+              //绘制二维码
+              myCanvas.drawImage( img, 50, 0 );
+              if(self.qrCodeDialogData.codeName){
+                //设置水印
+                myCanvas.font = "bold 14px 'Fira Sans'";
+                myCanvas.fillStyle = 'rgba(0,0,0,1)'; //水印颜色
+                //绘制水印
+                myCanvas.fillText(self.qrCodeDialogData.codeName, (300-(self.qrCodeDialogData.codeName.length*14))/2, 215); //左下
+              }
+            },100);
+          })
         })
+
       },
       buttonClick(type){
         if(type == 1){

+ 1 - 1
src/views/integratedManagement/laboratoryManagement/hazard/index.vue

@@ -37,7 +37,7 @@
           <el-table-column label="二维码" align="center" width="100">
             <template slot-scope="scope">
               <div style="height:23px;" @click="dialogQrCodeOn(scope.row)">
-                <vue-qr style="height:23px;width:23px;cursor:pointer;" :text="identification+'?code='+scope.row.hazardId+'&type=1'" :size="200"></vue-qr>
+                <vue-qr style="height:23px;width:23px;cursor:pointer;" :text="identification+'?code='+scope.row.hazardId+'&type=3'" :size="200"></vue-qr>
               </div>
             </template>
           </el-table-column>

+ 1 - 18
src/views/integratedManagement/laboratoryManagement/subject/associationConfiguration.vue

@@ -162,12 +162,6 @@
               <p class="look-code-p" @click="dialogQrCodeOn(item)">查看二维码</p>
             </div>
           </el-form-item>
-          <!--<el-form-item label="" class="form-item" label-width="20px">-->
-            <!--<span class="del-hazard el-icon-circle-close" @click="delHazard(index)"></span>-->
-          <!--</el-form-item>-->
-          <!--<el-form-item label="" class="form-item" v-if="item.hazardRelId"  label-width="20px">-->
-            <!--<p class="look-code-p" @click="dialogQrCodeOn(item)">查看二维码</p>-->
-          <!--</el-form-item>-->
         </div>
       </el-form>
     </div>
@@ -331,7 +325,7 @@
       dialogQrCodeOn(row){
         this.$set(this,'qrCodeDialogData',{
           download:true,
-          type:'1',                                                     //二维码类型 用于区分二维码功能类型
+          type:'10',                                                     //二维码类型 用于区分二维码功能类型
           parameter:row.hazardRelId,                                             //二维码参数
           name:row.anotherName,                                                //二维码名称用于下载时命名
           codeName:row.anotherName,                                            //二维码图片下名称展示(非必传)
@@ -411,17 +405,6 @@
         this.ids = selection.map(item => item.id)
         this.multiple = !selection.length
       },
-      //二维码组件开关
-      qrCodeDialogButton(id,name){
-        this.$set(this,'qrCodeDialogData',{
-          download:true,
-          type:'10',                                                     //二维码类型 用于区分二维码功能类型
-          parameter:id,                                             //二维码参数
-          name:name,                                                //二维码名称用于下载时命名
-          codeName:name,                                            //二维码图片下名称展示(非必传)
-        });
-        this.$refs['qrCodeDialog'].initialize();
-      },
       //删除选中危险源
       delHazard(index){
         this.form.hazardSubRelInnerList.splice(index, 1);

+ 2 - 2
src/views/integratedManagement/laboratoryManagement/subject/index.vue

@@ -254,13 +254,13 @@
             let list = [];
             this.codeList.forEach((item)=>{
               list.push({
-                code:item.subId,
+                code:item.infoId+'&subId='+item.subId,
                 name:item.subName
               })
             })
             this.$set(this,'batchQrCodeDialogData',{
               title:'实验室二维码批量下载',                                               //弹窗名称(非必传)
-              type:'1',                                                     //二维码类型 用于区分二维码功能类型
+              type:'5',                                                     //二维码类型 用于区分二维码功能类型
               codeList:list
             });
             this.$nextTick(function () {

+ 2 - 2
src/views/integratedManagement/laboratoryManagement/subject/infoPage.vue

@@ -20,7 +20,7 @@
           </div>
           <div class="right-code-img" @click="clickCode">
             <vue-qr style="display: block;height:60px;width:60px;cursor:pointer;margin:0 10px 0 0;"
-                    :text="identification+'?code='+subjectData.infoId+'&type=5'" :size="300">
+                    :text="identification+'?code='+subjectData.infoId+'&subId='+subjectData.subId+'&type=5'" :size="300">
             </vue-qr>
           </div>
         </div>
@@ -397,7 +397,7 @@
             // title:this.subjectData.subName,                                               //弹窗名称(非必传)
             download:true,                                                //二维码下载按钮(非必传)
             type:'5',                                                     //二维码类型 用于区分二维码功能类型
-            parameter:this.subjectData.infoId,                                             //二维码参数
+            parameter:this.subjectData.infoId+'&subId='+this.subjectData.subId,                                             //二维码参数
             name:this.subjectData.subName,                                                //二维码名称用于下载时命名(非必传)
             codeName:this.subjectData.subName,                                            //二维码图片下名称展示(非必传)
           });

+ 20 - 14
src/views/safetyEducationExam/safeLearning/safe_book/index.vue

@@ -61,8 +61,8 @@
           <el-table-column label="查看次数" align="left" prop="scanCount" width="100"/>
           <el-table-column label="二维码" align="left" width="100">
             <template slot-scope="scope">
-              <div @click="dialogQrCodeOn(scope.row.qrCodeUrl)">
-                <vue-qr style="height:23px;width:23px;cursor:pointer;" :text="scope.row.qrCodeUrl" :size="200"></vue-qr>
+              <div @click="dialogQrCodeOn(scope.row)">
+                <vue-qr style="height:23px;width:23px;cursor:pointer;" :text="identification+'?code='+scope.row.id+'&type=2'" :size="200"></vue-qr>
               </div>
             </template>
           </el-table-column>
@@ -92,8 +92,6 @@
         />
       </div>
     </div>
-
-
     <!-- 添加或修改实验室安全制度对话框 -->
     <el-dialog :title="title" class="safe-book-el-dialog" :visible.sync="open" width="1000px" append-to-body :close-on-click-modal="false">
       <el-form ref="form" :model="form" :rules="rules" label-width="80px">
@@ -147,14 +145,13 @@
       </div>
     </el-dialog>
     <!-- 二维码展示 -->
-    <el-dialog title="二维码" class="qr-codeUrl-dialog" :visible.sync="dialogQrCodeType" width="300px" append-to-body :close-on-click-modal="false">
-      <vue-qr style="display: block;height:200px;width:200px;cursor:pointer;margin:0 auto;" :text="dialogQrCodeUrl" :size="200"></vue-qr>
-    </el-dialog>
+    <qr-code-dialog ref="qrCodeDialog" :qrCodeDialogData="qrCodeDialogData"></qr-code-dialog>
   </div>
 </template>
 
 <script>
-import {
+  import qrCodeDialog from "@/components/qrCodeDialog/index.vue"
+  import {
   examSafeBookList,
   examSafeBook,
   examSafeBookAdd,
@@ -167,7 +164,8 @@ import vueQr from 'vue-qr'
 export default {
   components:{
     pdf,
-    vueQr
+    vueQr,
+    qrCodeDialog
   },
   name: "Safe_book",
   data() {
@@ -233,8 +231,9 @@ export default {
       //pdf相关
       numPages: null, // pdf 总页数
       //二维码展示数据
-      dialogQrCodeType:false,
-      dialogQrCodeUrl:"",
+      qrCodeDialogData:{},
+      //二维码规则 服务器域名,需与微信后台开发配置内一致.
+      identification: localStorage.getItem('codeOnlineAdd'),
     };
   },
   created() {
@@ -247,9 +246,16 @@ export default {
     clearType(){
       this.$set(this.queryParams,'type',null);
     },
-    dialogQrCodeOn(url){
-      this.dialogQrCodeUrl = url;
-      this.dialogQrCodeType = true;
+    //展示二维码
+    dialogQrCodeOn(row){
+      this.$set(this,'qrCodeDialogData',{
+        download:true,
+        type:'1',                                                     //二维码类型 用于区分二维码功能类型
+        parameter:row.id,                                             //二维码参数
+        name:row.name,                                                //二维码名称用于下载时命名
+        codeName:row.name,                                            //二维码图片下名称展示(非必传)
+      });
+      this.$refs['qrCodeDialog'].initialize();
     },
     //上传
     handleAvatarSuccess(res, file) {