diff --git a/package.json b/package.json index bd76555..7a3296a 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,7 @@ "js-cookie": "2.2.0", "jspdf": "^2.5.1", "less-loader": "^5.0.0", + "mobile-select": "^1.4.0", "moment": "^2.29.2", "normalize.css": "7.0.0", "nprogress": "0.2.0", diff --git a/public/favicon.ico b/public/favicon.ico index c48d62c..c124bf7 100644 Binary files a/public/favicon.ico and b/public/favicon.ico differ diff --git a/src/api/other/index.js b/src/api/other/index.js new file mode 100644 index 0000000..e69de29 diff --git a/src/assets/h5bkg.jpeg b/src/assets/h5bkg.jpeg new file mode 100644 index 0000000..0b4ce17 Binary files /dev/null and b/src/assets/h5bkg.jpeg differ diff --git a/src/assets/logo-mini.png b/src/assets/logo-mini.png index 8ecb6ba..9b5b32b 100644 Binary files a/src/assets/logo-mini.png and b/src/assets/logo-mini.png differ diff --git a/src/assets/logo.png b/src/assets/logo.png index 6405818..16fc0ee 100644 Binary files a/src/assets/logo.png and b/src/assets/logo.png differ diff --git a/src/assets/seal.png b/src/assets/seal.png new file mode 100644 index 0000000..a34da65 Binary files /dev/null and b/src/assets/seal.png differ diff --git a/src/layout/components/Sidebar/Logo.vue b/src/layout/components/Sidebar/Logo.vue index a8e6806..8c8f39e 100644 --- a/src/layout/components/Sidebar/Logo.vue +++ b/src/layout/components/Sidebar/Logo.vue @@ -36,8 +36,7 @@ transition: opacity 1.5s; } .sidebar-name-logo { - width: 120px; - height: 22px; + height: 16px; } .sidebarLogoFade-enter, @@ -66,6 +65,7 @@ height: 38px; vertical-align: middle; margin-right: 12px; + object-fit: contain; } & .sidebar-title { diff --git a/src/permission.js b/src/permission.js index 5919bdb..27d0e10 100644 --- a/src/permission.js +++ b/src/permission.js @@ -26,7 +26,7 @@ router.beforeEach(async(to, from, next) => { return } - if (hasToken) { + if (hasToken && hasToken !== 'undefined') { if (to.path === '/login' || to.path === '/h5/login') { // if is logged in, redirect to the home page let isH5 = to.path !== '/login' diff --git a/src/views/h5/index.vue b/src/views/h5/index.vue index 0702e89..2170406 100644 --- a/src/views/h5/index.vue +++ b/src/views/h5/index.vue @@ -84,8 +84,18 @@ @@ -94,9 +104,12 @@ import { getAgeByIdcard, getSex } from "@/utils"; import { getToken } from "@/utils/auth"; import { userInfo } from "@/api/h5"; + +import MobileSelect from 'mobile-select'; export default { data() { return { + msInstance: null, info: { user: {}, logs: [], @@ -229,6 +242,28 @@ export default { } }) }, + + createMobileSelect () { + this.msInstance = new MobileSelect({ + trigger: '.print-btn__print', + title: '打印子女选择', + triggerDisplayValue: false, + wheels: [ + { + data: this.info.childrens + } + ], + keyMap: { + id: 'id', + value: 'name' + }, + onChange: (data, indexArr, instance) => { + if (data[0]?.id) { + this.toPrint(null,data[0]?.id) + } + } + }) + } }, computed: { age () { @@ -238,8 +273,17 @@ export default { return this.info.user.idcard ? getSex(this.info.user.idcard) : '-'; } }, + async mounted() { + await this.getUserInfo(); + this.$nextTick(() => { + this.createMobileSelect() + }); + }, + destroyed() { + this.msInstance.destroy(); + }, created() { - this.getUserInfo(); + //this.getUserInfo(); } } @@ -337,8 +381,6 @@ export default { padding-bottom: 20px; & > Button { - border-radius: 12px; - & + Button { margin-left: 40px; @@ -354,6 +396,12 @@ export default { .log-table2 { display: none; } + .print-btn__print { + opacity: 0; + + position: fixed; + left: 100vw; + } } @media (max-width: 768px) { .page { @@ -389,18 +437,26 @@ export default { } .print-btn { + justify-content: space-evenly; margin-top: 20px; & > Button { - flex: 1; + width: 44vw; font-size: 14px; + zoom: .8; - & + Button { + } - margin-left: 4vw; - } + + &__dropdown { + display: none; } } } + diff --git a/src/views/h5/login/component/loginPanel.vue b/src/views/h5/login/component/loginPanel.vue index 8d4b95d..efd5319 100644 --- a/src/views/h5/login/component/loginPanel.vue +++ b/src/views/h5/login/component/loginPanel.vue @@ -228,6 +228,7 @@ export default { width: 40px; height: 40px; border-radius: 100%; + object-fit: contain; margin-right: 16px; } diff --git a/src/views/h5/login/login.vue b/src/views/h5/login/login.vue index abc2e97..c8b2c3d 100644 --- a/src/views/h5/login/login.vue +++ b/src/views/h5/login/login.vue @@ -65,7 +65,7 @@ export default { height: 100%; width: 66vw; float: right; - background: url("../../../assets/bg.jpg") no-repeat; + background: url("../../../assets/h5bkg.jpeg") no-repeat; background-size: cover; position: relative; diff --git a/src/views/print/index.vue b/src/views/print/index.vue index 81488b4..04eed80 100644 --- a/src/views/print/index.vue +++ b/src/views/print/index.vue @@ -3,7 +3,7 @@
- 序列号:{{ info.bianma }} + 序列号:{{ info.shouquanshubianhao }}
@@ -15,7 +15,10 @@
- 兹有 {{ info.name }} (身份证号: {{ info.idcard }} )经苏州州市总工会审核评定为{{ new Date().getFullYear() }}年度苏州市总工会 {{ type.get(info.kunnanleixing) }}家庭 。 + 兹有{{ info.name }}(身份证号:{{ info.idcard }})经苏州州市总工会审核评定为{{ new Date().getFullYear() }}年度苏州市总工会{{ info.kunnanleixing }}家庭 。 +

特此证明!

@@ -23,6 +26,8 @@

苏州市总工会权益保障部

{{ $moment(new Date()).format('YYYY年M月DD日') }}

+ +
@@ -47,6 +52,7 @@ export default { data() { return { info: {}, + printChild: {}, container: { w: 0, h: 0, @@ -144,7 +150,7 @@ export default { download () { this.isToImg = true; html2canvas(this.$refs['container'],{ - backgroundColor: null, + backgroundColor: '#ffffff', allowTaint: false, taintTest: false, logging: false, @@ -176,7 +182,14 @@ export default { // delete page; } // 保存文件 - pdf.save(`困难职工证明-${this.info.name}.pdf`); + //pdf.save(`困难职工证明-${this.info.name}.pdf`); + let file = pdf.output('blob',{ + filename: `困难职工证明-${this.info.name}.pdf` + }) + let a = document.createElement('a'); + a.href = URL.createObjectURL(file); + a.download = `困难职工证明-${this.info.name}.pdf`; + a.click(); }).catch(err => { this.isToImg = false; }) @@ -204,6 +217,11 @@ export default { type: window.atob(this.$route.query.isChild) == 0 ? 1 : 2 }) }).catch(err => this.isToImg = true) + }, + + getPrintChild (childrens) { + const childId = window.atob(this.$route.query.isChild); + this.printChild = childrens.find(i => i.id == childId); } }, computed: { @@ -213,6 +231,9 @@ export default { }, isReduction () { return this.container.offsetX !== 0 || this.container.offsetY !== 0 || this.container.scale !== 1 + }, + showChild () { + return window.atob(this.$route.query.isChild) != 0 } }, created() { @@ -231,6 +252,7 @@ export default { console.log(res) this.info = res.user; + this.getPrintChild(res.childrens); this.init(); this.creatQrCode(); }) @@ -253,7 +275,7 @@ export default { height: 100vh; max-width: 600px; max-height: 800px; - background: #fff; + background: #eee; overflow: hidden; margin: auto; @@ -261,6 +283,7 @@ export default { .container { width: 100%; height: 100%; + background: #fff; position: relative; @@ -305,7 +328,8 @@ export default { top: 36%; padding: 0 5em; text-indent: 2em; - line-height: 3; + line-height: 2.8; + word-break: keep-all; & > span { text-decoration: underline; @@ -319,6 +343,15 @@ export default { padding-top: 2em; padding-right: 1em; } + .seal { + right: 14%; + width: 9vw; + min-width: 55px; + object-fit: cover; + filter: saturate(5); + + position: absolute; + } } } .reduction { diff --git a/src/views/record/component/add.vue b/src/views/record/component/add.vue index d89a564..738906f 100644 --- a/src/views/record/component/add.vue +++ b/src/views/record/component/add.vue @@ -342,12 +342,58 @@ export default { { prop: 'unit', label: '工作/学习单位', + minWidth: 120, customFn:row => { return ( ) } }, + { + prop: 'nianji', + label: '年级', + width: 100, + customFn:row => { + return ( + + ) + } + }, + { + prop: 'yibao', + label: '医保', + width: 120, + customFn:row => { + return ( + + { + [ + { + key: '本市职工医保', + value: 1 + }, + { + key: '本市居民医保', + value: 2 + }, + { + key: '本市学生医保', + value: 3 + }, + { + key: '外地医保', + value: 4 + }, + { + key: '无医保', + value: 5 + } + ].map(i => ()) + } + + ) + } + }, { prop: 'delete', label: '操作', diff --git a/src/views/record/index.vue b/src/views/record/index.vue index 64aeaa5..08b27ea 100644 --- a/src/views/record/index.vue +++ b/src/views/record/index.vue @@ -219,9 +219,16 @@ > @@ -296,18 +297,17 @@ import { show } from "@/api/system/customForm"; import * as XLSX from "xlsx"; import { saveAs } from "file-saver"; import { listdept } from "@/api/system/department" +import {getToken} from "@/utils/auth"; import add from "./component/add.vue"; import LxHeader from "@/components/LxHeader/index.vue"; import headerContent from "@/components/LxHeader/XyContent.vue"; import drawer from "@/views/component/drawer.vue"; -import imports from "@/views/component/imports.vue"; export default { components: { LxHeader, headerContent, drawer, - imports, add }, mixins: [authMixin], @@ -316,6 +316,7 @@ export default { }, data() { return { + fileList: [], op, select: { table_name: "", @@ -336,19 +337,67 @@ export default { }; }, methods: { - toPrint (row,isChild = 0) { - console.log(row); + importSuccess (response, file, fileList) { + console.log(response) + }, + + async toPrint (row,isChild = 0) { + let pickChild = 0; + if (isChild) { + const h = this.$createElement; + await this.$msgbox({ + title: '打印子女选择', + message: h('Table',{ + key: Math.random(), + props: { + size: 'small', + data: row.id_childrens_record_id_relation, + columns: [ + { + type: 'index', + width: 46, + label: ' ' + }, + { + key: 'name', + title: '姓名' + } + ], + 'highlight-row': true + }, + on: { + ['on-current-change']:row => { + pickChild = row.id + } + } + }), + beforeClose: (action, instance, done) => { + if (action === 'confirm') { + if (pickChild) { + done(); + } else { + this.$message({ + type: 'warning', + message: '请选择要打印的子女' + }) + } + } else { + done(); + } + } + }) + } const url = this.$router.resolve({ path: '/print', query: { bm: window.btoa(row.bianma), - isChild: window.btoa(isChild) + isChild: window.btoa(pickChild) } }) window.open(url.href) }, - + getToken, index, destroy, download, @@ -442,7 +491,9 @@ export default { i._params = keys.map(key => { return { key, - value: i.select_item[key] + value: /^\d*$/.test(i.select_item[key]) + ? Number(i.select_item[key]) + : i.select_item[key], } }) } @@ -580,6 +631,10 @@ export default { }, computed: { + action () { + return `${process.env.VUE_APP_BASE_API}/api/admin/other/record-import` + }, + columnArrTest() { return function (field) { return this.form.find((i) => i.field === field)