Browse Source

sz 单位添加公示二维码

xiao547607 5 years ago
parent
commit
038ccda388
5 changed files with 46 additions and 10 deletions
  1. 4 3
      .env.development
  2. 2 1
      .env.production
  3. 1 0
      package.json
  4. 34 6
      src/views/base/companyInfo-list.vue
  5. 5 0
      yarn.lock

+ 4 - 3
.env.development

@@ -1,5 +1,6 @@
-#VUE_APP_BACKEND_URL=http://wisdomhouse.sudaonline.net
-VUE_APP_BACKEND_URL=http://127.0.0.1:8086/smart-community-server
+VUE_APP_BACKEND_URL=http://wisdomhouse.sudaonline.net
+#VUE_APP_BACKEND_URL=http://127.0.0.1:8086/smart-community-server
 #VUE_APP_BACKEND_URL=http://192.168.33.26:8080/smart-community-server
 #VUE_APP_BACKEND_URL=http://zldb.xiaoxinda.com:8088/smart-community-server
-#VUE_APP_BACKEND_URL=http://kr6zr7.natappfree.cc/smart-community-server/
+#VUE_APP_BACKEND_URL=http://kr6zr7.natappfree.cc/smart-community-server/
+VUE_APP_COMPANY_HEALTH_URL=http://wisdomhousewechat.sudaonline.net/prevention/motemperature_gsq.html

+ 2 - 1
.env.production

@@ -1,3 +1,4 @@
 VUE_APP_BACKEND_URL=http://wisdomhouse.sudaonline.net
 VUE_APP_IMAGE_URL=http://wisdomhouseadmin.sudaonline.net
-#VUE_APP_BACKEND_URL=http://zldb.xiaoxinda.com:8088/smart-community-server
+#VUE_APP_BACKEND_URL=http://zldb.xiaoxinda.com:8088/smart-community-server
+VUE_APP_COMPANY_HEALTH_URL=http://wisdomhousewechat.sudaonline.net/prevention/motemperature_gsq.html

+ 1 - 0
package.json

@@ -14,6 +14,7 @@
     "element-ui": "^2.4.5",
     "js-cookie": "^2.2.1",
     "nprogress": "0.2.0",
+    "qrcodejs2": "^0.0.2",
     "vue": "^2.6.10",
     "vue-quill-editor": "^3.0.6",
     "vue-router": "^3.0.3",

+ 34 - 6
src/views/base/companyInfo-list.vue

@@ -74,14 +74,24 @@
       <el-table-column prop="position3Name" label="三级位置" width="180"></el-table-column>
       <el-table-column prop="position4Name" label="四级位置" width="180"></el-table-column>
       <el-table-column prop="position5Name" label="五级位置" width="180"></el-table-column>-->
-      <el-table-column prop="remark" sort-by="remark_" label="备注"></el-table-column>
-      <el-table-column label="操作" width="250" fixed="right">
+      <el-table-column prop="remark" sort-by="remark_" width="350" label="备注"></el-table-column>
+      <el-table-column label="操作" width="290">
         <template slot-scope="{row}">
           <el-row>
             <el-col>
               <el-link type="primary" :underline="false" @click="handleEdit(row)">编辑</el-link>-
               <el-link type="danger" :underline="false" @click="handleDelete(row)">删除</el-link>-
-              <el-link type="primary" :underline="false" @click="bindDevice(row)">绑定设备</el-link>
+              <el-link type="primary" :underline="false" @click="bindDevice(row)">绑定设备</el-link>-
+              <el-popover
+                placement="left"
+                width="300"
+                trigger="click"
+                @show="openQRCode(row)"
+                @hide="closeQRCode(row)"
+              >
+                <div :id="row.id" ref="qrCodeDiv"></div>
+                <el-link type="primary" :underline="false" slot="reference">健康公示二维码</el-link>
+              </el-popover>
             </el-col>
           </el-row>
         </template>
@@ -114,6 +124,7 @@ import companyInfoDetail from "./companyInfo-detail";
 import companyDeviceRelationList from "./companyDeviceRelation-list";
 import companyInfoApi from "@/api/base/companyInfo";
 
+import QRCode from "qrcodejs2";
 import NProgress from "nprogress"; // progress bar
 import "nprogress/nprogress.css"; // progress bar style
 
@@ -138,8 +149,9 @@ export default {
       modalTitle: "",
       businessKey: "",
       tableHeight: "",
-      showDeviceModal:false,
-      companyId:""
+      showDeviceModal: false,
+      companyId: "",
+      qrCode: ""
     };
   },
   created() {
@@ -273,6 +285,22 @@ export default {
       //绑定设备
       this.companyId = record.id;
       this.showDeviceModal = true;
+    },
+    openQRCode(record) {
+      document.getElementById(record.id).innerHTML = "";
+      var self = this;
+      var qrtext = process.env.VUE_APP_COMPANY_HEALTH_URL + "?companyId=" + record.id;
+      var qr = new QRCode(record.id, {
+        text: qrtext,
+        width: 300,
+        height: 300,
+        colorDark: "#333333", //二维码颜色
+        colorLight: "#ffffff", //二维码背景色
+        correctLevel: QRCode.CorrectLevel.L //容错率,L/M/H
+      });
+    },
+    closeQRCode(record) {
+      document.getElementById(record.id).innerHTML = "";
     }
   },
   mounted: function() {
@@ -280,7 +308,7 @@ export default {
   },
   components: {
     "companyInfo-detail": companyInfoDetail,
-    "companyDeviceRelation-list":companyDeviceRelationList
+    "companyDeviceRelation-list": companyDeviceRelationList
   }
 };
 </script>

+ 5 - 0
yarn.lock

@@ -6771,6 +6771,11 @@ q@^1.1.2:
   resolved "https://registry.npm.taobao.org/q/download/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7"
   integrity sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=
 
+qrcodejs2@^0.0.2:
+  version "0.0.2"
+  resolved "https://registry.yarnpkg.com/qrcodejs2/-/qrcodejs2-0.0.2.tgz#465afe5e39f19facecb932c11f7a186109146ae1"
+  integrity sha1-Rlr+Xjnxn6zsuTLBH3oYYQkUauE=
+
 qs@6.7.0:
   version "6.7.0"
   resolved "https://registry.npm.taobao.org/qs/download/qs-6.7.0.tgz?cache=0&sync_timestamp=1573195631718&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fqs%2Fdownload%2Fqs-6.7.0.tgz#41dc1a015e3d581f1621776be31afb2876a9b1bc"