Эх сурвалжийг харах

Merge branch '17025' of http://119.23.210.103:3000/wy/lh_firm_former into 17025

shenqilong 11 сар өмнө
parent
commit
6d83b56e06

+ 1 - 1
public/config.js

@@ -90,7 +90,7 @@
         // 系统版本
         // 系统版本
         VERSION: "1.0.0",
         VERSION: "1.0.0",
         // 系统名称
         // 系统名称
-        SYSTEM_NAME: "17025实验室质量管理系统",
+        SYSTEM_NAME: "金通检测/校准实验室质量管理系统(LQMS)",
         // 润乾报表根目录
         // 润乾报表根目录
         REPORT_PATH: "17025实验室质量管理系统",
         REPORT_PATH: "17025实验室质量管理系统",
     };
     };

+ 3 - 3
src/business/platform/data/templaterender/components/labelPrint.vue

@@ -25,12 +25,12 @@
                             src="../../../../../assets/images/login/logo.jpg"
                             src="../../../../../assets/images/login/logo.jpg"
                             class="logoImg"
                             class="logoImg"
                         >
                         >
-                        17025实验室质量管理系统
+                        金通检测/校准实验室质量管理系统(LQMS)
                     </p>
                     </p>
                     <template v-for="(o, i) in modelList">
                     <template v-for="(o, i) in modelList">
-                        <div
+                        <div 
                             v-if="item[o.value]"
                             v-if="item[o.value]"
-
+                            :key="o.id || i" 
                             class="item"
                             class="item"
                             :style="`width: ${o.width};`"
                             :style="`width: ${o.width};`"
                         >
                         >

+ 1 - 1
src/business/platform/data/templaterender/templates/list.vue

@@ -1033,8 +1033,8 @@ export default {
                         this.search()
                         this.search()
                         break
                         break
                     case 'add': // 添加
                     case 'add': // 添加
-                        this.handleEdit(null, command, position, selection, data)
                         this.addDataCont = button.initAddDataCont
                         this.addDataCont = button.initAddDataCont
+                        this.handleEdit(null, command, position, selection, data)
                         break
                         break
                     case 'edit': // 编辑
                     case 'edit': // 编辑
                     case 'detail': // 明细
                     case 'detail': // 明细

+ 1 - 1
src/constant.js

@@ -80,5 +80,5 @@ export const I18N_FALLBACK_LOCALE =
 
 
 export const ELEMENT_COLOR = __IBPS_CONFIG__.ELEMENT_COLOR || '#409EFF'
 export const ELEMENT_COLOR = __IBPS_CONFIG__.ELEMENT_COLOR || '#409EFF'
 export const SYSTEM_NAME =
 export const SYSTEM_NAME =
-    __IBPS_CONFIG__.SYSTEM_NAME || '17025实验室质量管理系统'
+    __IBPS_CONFIG__.SYSTEM_NAME || '金通检测/校准实验室质量管理系统(LQMS)'
 export const REPORT_PATH = __IBPS_CONFIG__.REPORT_PATH || ''
 export const REPORT_PATH = __IBPS_CONFIG__.REPORT_PATH || ''

+ 1 - 1
src/views/component/device/index.vue

@@ -465,7 +465,7 @@ export default {
                     { key: 'customPrint', label: '打印标签', icon: 'ibps-icon-cog', type: 'warning' },
                     { key: 'customPrint', label: '打印标签', icon: 'ibps-icon-cog', type: 'warning' },
                     { key: 'customExport', label: '导出数据', icon: 'ibps-icon-sign-in', type: 'primary' },
                     { key: 'customExport', label: '导出数据', icon: 'ibps-icon-sign-in', type: 'primary' },
                     { key: 'customImport', label: '导入数据', icon: 'ibps-icon-sign-in', type: 'primary' },
                     { key: 'customImport', label: '导入数据', icon: 'ibps-icon-sign-in', type: 'primary' },
-                    { key: 'customSetting', label: '设置分组配置', icon: 'ibps-icon-cogs', type: 'info' },
+                   // { key: 'customSetting', label: '设置分组配置', icon: 'ibps-icon-cogs', type: 'info' },
                     { key: 'customRemove', label: '删除', icon: 'ibps-icon-close', type: 'danger' }
                     { key: 'customRemove', label: '删除', icon: 'ibps-icon-close', type: 'danger' }
                 ],
                 ],
                 // 查询条件
                 // 查询条件

+ 33 - 1
src/views/platform/org/employee/edit/index.vue

@@ -94,6 +94,13 @@
                 @action-event="handleActionEvent"
                 @action-event="handleActionEvent"
             />
             />
         </div>
         </div>
+         <personal-code
+            v-if="qrcodeVisible"
+            :visible.sync="qrcodeVisible"
+            :content="personalInfo"
+            :photo="employee.photo"
+            @close="visible => (qrcodeVisible = visible)"
+        />
     </el-dialog>
     </el-dialog>
 </template>
 </template>
 
 
@@ -106,6 +113,7 @@
     import PositionInfo from './position-info'
     import PositionInfo from './position-info'
     import RoleInfo from './role-info'
     import RoleInfo from './role-info'
     import GroupInfo from './group-info'
     import GroupInfo from './group-info'
+    import PersonalCode from './personal-qrcode'
 
 
     export default {
     export default {
         components: {
         components: {
@@ -114,7 +122,8 @@
             OrgInfo,
             OrgInfo,
             PositionInfo,
             PositionInfo,
             RoleInfo,
             RoleInfo,
-            GroupInfo
+            GroupInfo,
+            PersonalCode
         },
         },
         props: {
         props: {
             visible: Boolean,
             visible: Boolean,
@@ -161,11 +170,18 @@
                     orgItem: {} // 组织全部信息
                     orgItem: {} // 组织全部信息
                 },
                 },
                 employee: {},
                 employee: {},
+                qrcodeVisible: false,
                 toolbars: [
                 toolbars: [
                     {
                     {
                         key: 'save',
                         key: 'save',
                         hidden: () => { return this.readonly && this.formType == 'detail' }
                         hidden: () => { return this.readonly && this.formType == 'detail' }
                     },
                     },
+                    {
+                    key: 'qrcode',
+                    icon: 'ibps-icon-qrcode',
+                    label: '个人二维码',
+                    type: 'success'
+                    },
                     { key: 'cancel' }
                     { key: 'cancel' }
                 ]
                 ]
             }
             }
@@ -201,6 +217,9 @@
                     case 'save':
                     case 'save':
                         this.handleSave()
                         this.handleSave()
                         break
                         break
+                    case 'qrcode':
+                    this.handleQRCode()
+                    break
                     case 'cancel':
                     case 'cancel':
                         this.closeDialog()
                         this.closeDialog()
                         break
                         break
@@ -222,6 +241,19 @@
                         ActionUtils.saveErrorMessage()
                         ActionUtils.saveErrorMessage()
                     }
                     }
                 })
                 })
+            },
+             handleQRCode () {
+            this.personalInfo = JSON.stringify({
+                id: this.employee.id,
+                account: this.employee.account,
+                name: this.employee.name,
+                mobile: this.employee.mobile,
+                email: this.employee.email,
+                gender: this.employee.gender,
+                dept: this.employee.posItemList.map(i => i.name).join(','),
+                role: this.employee.roleItemList.map(i => i.name).join(',')
+            })
+            this.qrcodeVisible = true
             },
             },
             checkPhone(value) {
             checkPhone(value) {
                 const reg = /^((13[0-9])|(14[5,7])|(15[0-3,5-9])|(17[0,3,5-8])|(18[0-9])|166|198|199|(147))\d{8}$/
                 const reg = /^((13[0-9])|(14[5,7])|(15[0-3,5-9])|(17[0,3,5-8])|(18[0-9])|166|198|199|(147))\d{8}$/

+ 216 - 0
src/views/platform/org/employee/edit/personal-qrcode.vue

@@ -0,0 +1,216 @@
+<template>
+    <div>
+        <el-dialog
+            :title="`${formatContent.name} 的${formatName}`"
+            :visible.sync="dialogVisible"
+            :close-on-click-modal="false"
+            :close-on-press-escape="false"
+            append-to-body
+            class="personal-qrcode"
+            width="50%"
+            center
+            @close="closeDialog"
+        >
+            <el-tabs v-model="activeName" @tab-click="handleClick">
+                <el-tab-pane label="二维码" name="erweima">
+                    <div id="my-QRCode" ref="myQRCode" class="qrCode" />
+                </el-tab-pane>
+                <el-tab-pane label="条形码" name="tiaoxingma">
+                    <div class="oneQr">
+                        <vue-barcode
+                            :value="formatTcodeValue"
+                            :display-value="false"
+                            :width="1"
+                        >生成条形码失败</vue-barcode>
+                    </div>
+                </el-tab-pane>
+            </el-tabs>
+            <div slot="footer" class="el-dialog--center">
+                <ibps-toolbar :actions="toolbars" @action-event="handleActionEvent" />
+            </div>
+        </el-dialog>
+        <vue-easy-print ref="easyPrintRef">
+            <vue-barcode
+                style="text-align: center; margin-top: 30px"
+                :value="formatContent.id"
+                :display-value="false"
+            >生成条形码失败</vue-barcode>
+        </vue-easy-print>
+    </div>
+</template>
+
+<script>
+import QRCode from 'qrcodejs2' // 引入qrcode
+import VueBarcode from 'vue-barcode'
+import vueEasyPrint from 'vue-easy-print'
+
+import { getFile } from '@/utils/avatar'
+export default {
+    name: 'qrcode',
+    components: {
+        VueBarcode,
+        vueEasyPrint
+    },
+    props: {
+        visible: {
+            type: Boolean,
+            default: false
+        },
+        content: {
+            type: String,
+            default: ''
+        },
+        photo: {
+            type: String,
+            default: ''
+        }
+    },
+    data () {
+        return {
+            code: '',
+            dialogVisible: this.visible,
+            toolbars: [
+                {
+                    key: 'download',
+                    icon: 'ibps-icon-downlaod',
+                    label: '下载',
+                    type: 'primary'
+                },
+                {
+                    key: 'cancel',
+                    icon: 'ibps-icon-close',
+                    label: '关闭',
+                    type: 'drange'
+                }
+            ],
+            activeName: 'erweima' // 二维码条形码切换
+        }
+    },
+    computed: {
+        formatContent () {
+            return JSON.parse(this.content)
+        },
+        formatName () {
+            return this.activeName === 'erweima' ? '二维码' : '条形码'
+        },
+        formatTcodeValue () {
+            return JSON.stringify({ id: JSON.parse(this.content).id })
+        }
+    },
+    watch: {
+        visible: {
+            handler (val, oldVal) {
+                this.dialogVisible = this.visible
+                if (val) {
+                    this.$nextTick(() => {
+                        this.qrcodeRender()
+                    })
+                }
+            },
+            immediate: true
+        }
+    },
+    methods: {
+        qrcodeRender () {
+            console.log('qrcodeRender')
+            if (this.code) {
+                this.$refs.myQRCode.innerHTML = ''
+            }
+            this.code = new QRCode('my-QRCode', {
+                width: 250,
+                height: 250,
+                text: this.content,
+                colorDark: '#000000', // 前景色
+                colorLight: '#FFFFFF', // 背景色
+                correctLevel: QRCode.CorrectLevel.Q // 纠错能力拉满
+            })
+            this.logoRender()
+        },
+        // 中心logo
+        logoRender () {
+            const logo = new Image()
+            logo.setAttribute('crossOrigin', 'Anonymous') // 解决CORS 策略报错
+            logo.src = getFile(this.photo)
+            logo.onload = () => {
+                const qrImg = document.getElementById('my-QRCode').getElementsByTagName('img')[0]
+                const canvas = document.getElementById('my-QRCode').getElementsByTagName('canvas')[0]
+                const ctx = canvas.getContext('2d')
+                ctx.drawImage(
+                    logo,
+                    (250 - 250 / 3.7) / 2,
+                    (250 - 250 / 3.7) / 2,
+                    250 / 3.7,
+                    250 / 3.7
+                )
+                qrImg.src = canvas.toDataURL()
+            }
+        },
+        handleActionEvent ({ key }) {
+            switch (key) {
+                case 'download':
+                    this.handleDownload()
+                    break
+                case 'cancel':
+                    this.closeDialog()
+                    break
+                default:
+                    break
+            }
+        },
+        handleDownload () {
+            if (this.activeName === 'erweima') {
+                const myCanvas = document.getElementById('my-QRCode').getElementsByTagName('canvas')
+                const a = document.createElement('a')
+                a.href = myCanvas[0].toDataURL('image/png')
+                a.download = this.formatContent.name + '的二维码'
+                a.click()
+            } else if (this.activeName === 'tiaoxingma') {
+                const svgElement = document.querySelector('.oneQr').getElementsByTagName('svg')[0]
+                const svgContent = svgElement.outerHTML
+                const svgDataURL = 'data:image/svg+xml;base64,' + btoa(svgContent)
+                const canvas = document.createElement('canvas')
+                const context = canvas.getContext('2d')
+                canvas.width = svgElement.width.baseVal.value
+                canvas.height = svgElement.height.baseVal.value
+                const img = new Image()
+                img.onload = () => {
+                    context.drawImage(img, 0, 0)
+                    const imageDataURL = canvas.toDataURL('image/png')
+                    const a = document.createElement('a')
+                    a.href = imageDataURL
+                    a.download = this.formatContent.name + '的条形码'
+                    a.click()
+                }
+                img.src = svgDataURL
+            }
+        },
+        closeDialog () {
+            this.$emit('close', false)
+        },
+        handleClick () {}
+    }
+}
+</script>
+
+<style lang="scss" scoped>
+.personal-qrcode {
+  ::v-deep {
+    .el-dialog {
+      margin-top: calc((100vh - 450px) / 2) !important;
+      .el-dialog__body {
+        #my-QRCode {
+          img {
+            margin: 40px auto;
+          }
+        }
+      }
+    }
+    .el-tabs__nav-wrap {
+      padding-left: 20px;
+    }
+  }
+}
+.oneQr {
+  text-align: center;
+}
+</style>

+ 1 - 1
src/views/platform/org/employee/list.vue

@@ -126,7 +126,7 @@ export default {
                     { prop: 'account', label: this.$t('platform.org.employee.prop.account'), width: 150 },
                     { prop: 'account', label: this.$t('platform.org.employee.prop.account'), width: 150 },
                     // { prop: 'wcAccount', label: this.$t('platform.org.employee.prop.wcAccount'),width:120},
                     // { prop: 'wcAccount', label: this.$t('platform.org.employee.prop.wcAccount'),width:120},
                     { prop: 'orgName', label: this.$t('platform.org.employee.prop.orgPath'), sortable: false, width: 250 },
                     { prop: 'orgName', label: this.$t('platform.org.employee.prop.orgPath'), sortable: false, width: 250 },
-                    { prop: 'qq', label: '客户单位名称', width: 250 },
+                   // { prop: 'qq', label: '客户单位名称', width: 250 },
                     { prop: 'status', label: this.$t('platform.org.employee.prop.status'), tags: statusOptions, width: 100 },
                     { prop: 'status', label: this.$t('platform.org.employee.prop.status'), tags: statusOptions, width: 100 },
                     { prop: 'createTime', label: this.$t('common.field.createTime') }
                     { prop: 'createTime', label: this.$t('common.field.createTime') }
                 ],
                 ],

+ 2 - 2
src/views/system/login/page.vue

@@ -6,10 +6,10 @@
                     <div class="logoTitle">
                     <div class="logoTitle">
                         <h1 class="login-title">
                         <h1 class="login-title">
                             <!-- <img src="../../../assets/images/login/logo.jpg" class="logoImg"> -->
                             <!-- <img src="../../../assets/images/login/logo.jpg" class="logoImg"> -->
-                            <!-- 17025实验室质量管理系统 -->
+                            <!-- 金通检测/校准实验室质量管理系统(LQMS) -->
                             <div style="height: 50px;" />
                             <div style="height: 50px;" />
                         </h1>
                         </h1>
-                        <h1 class="login-title" style="font-size: 52px">17025实验室质量管理系统</h1>
+                        <h1 class="login-title" style="font-size: 52px">金通检测/校准实验室质量管理系统(LQMS)</h1>
                     </div>
                     </div>
 
 
                     <div class="jbd-login-page-main">
                     <div class="jbd-login-page-main">