master
xy 2 years ago
parent 02114fd6df
commit fb8ab01da2

@ -27,6 +27,7 @@
"js-cookie": "2.2.0", "js-cookie": "2.2.0",
"jspdf": "^2.5.1", "jspdf": "^2.5.1",
"less-loader": "^5.0.0", "less-loader": "^5.0.0",
"mobile-select": "^1.4.0",
"moment": "^2.29.2", "moment": "^2.29.2",
"normalize.css": "7.0.0", "normalize.css": "7.0.0",
"nprogress": "0.2.0", "nprogress": "0.2.0",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 231 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 128 KiB

@ -36,8 +36,7 @@
transition: opacity 1.5s; transition: opacity 1.5s;
} }
.sidebar-name-logo { .sidebar-name-logo {
width: 120px; height: 16px;
height: 22px;
} }
.sidebarLogoFade-enter, .sidebarLogoFade-enter,
@ -66,6 +65,7 @@
height: 38px; height: 38px;
vertical-align: middle; vertical-align: middle;
margin-right: 12px; margin-right: 12px;
object-fit: contain;
} }
& .sidebar-title { & .sidebar-title {

@ -26,7 +26,7 @@ router.beforeEach(async(to, from, next) => {
return return
} }
if (hasToken) { if (hasToken && hasToken !== 'undefined') {
if (to.path === '/login' || to.path === '/h5/login') { if (to.path === '/login' || to.path === '/h5/login') {
// if is logged in, redirect to the home page // if is logged in, redirect to the home page
let isH5 = to.path !== '/login' let isH5 = to.path !== '/login'

@ -84,8 +84,18 @@
</div> </div>
<div class="print-btn"> <div class="print-btn">
<Button size="large" type="primary" @click="toPrint"></Button> <Button shape="circle" size="large" type="primary" @click="toPrint"></Button>
<Button size="large" type="primary" @click="toPrint" v-if="info.childrens.length > 0"></Button> <template v-show="info.childrens.length > 0">
<Dropdown class="print-btn__dropdown" style="margin-left: 40px" @on-click="name =>toPrint(null,name)">
<Button shape="circle" type="primary" size="large">
子女在档证明打印
</Button>
<DropdownMenu slot="list">
<DropdownItem v-for="child in info.childrens" :name="child.id">{{ child.name }}</DropdownItem>
</DropdownMenu>
</Dropdown>
<Button class="print-btn__print" shape="circle" size="large" type="primary">子女在档证明打印</Button>
</template>
</div> </div>
</div> </div>
</template> </template>
@ -94,9 +104,12 @@
import { getAgeByIdcard, getSex } from "@/utils"; import { getAgeByIdcard, getSex } from "@/utils";
import { getToken } from "@/utils/auth"; import { getToken } from "@/utils/auth";
import { userInfo } from "@/api/h5"; import { userInfo } from "@/api/h5";
import MobileSelect from 'mobile-select';
export default { export default {
data() { data() {
return { return {
msInstance: null,
info: { info: {
user: {}, user: {},
logs: [], 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: { computed: {
age () { age () {
@ -238,8 +273,17 @@ export default {
return this.info.user.idcard ? getSex(this.info.user.idcard) : '-'; return this.info.user.idcard ? getSex(this.info.user.idcard) : '-';
} }
}, },
async mounted() {
await this.getUserInfo();
this.$nextTick(() => {
this.createMobileSelect()
});
},
destroyed() {
this.msInstance.destroy();
},
created() { created() {
this.getUserInfo(); //this.getUserInfo();
} }
} }
</script> </script>
@ -337,8 +381,6 @@ export default {
padding-bottom: 20px; padding-bottom: 20px;
& > Button { & > Button {
border-radius: 12px;
& + Button { & + Button {
margin-left: 40px; margin-left: 40px;
@ -354,6 +396,12 @@ export default {
.log-table2 { .log-table2 {
display: none; display: none;
} }
.print-btn__print {
opacity: 0;
position: fixed;
left: 100vw;
}
} }
@media (max-width: 768px) { @media (max-width: 768px) {
.page { .page {
@ -389,18 +437,26 @@ export default {
} }
.print-btn { .print-btn {
justify-content: space-evenly;
margin-top: 20px; margin-top: 20px;
& > Button { & > Button {
flex: 1; width: 44vw;
font-size: 14px; font-size: 14px;
zoom: .8;
& + Button { }
margin-left: 4vw;
} &__dropdown {
display: none;
} }
} }
} }
</style> </style>
<style>
.ms-mobile-select {
position: fixed!important;
}
</style>

@ -228,6 +228,7 @@ export default {
width: 40px; width: 40px;
height: 40px; height: 40px;
border-radius: 100%; border-radius: 100%;
object-fit: contain;
margin-right: 16px; margin-right: 16px;
} }

@ -65,7 +65,7 @@ export default {
height: 100%; height: 100%;
width: 66vw; width: 66vw;
float: right; float: right;
background: url("../../../assets/bg.jpg") no-repeat; background: url("../../../assets/h5bkg.jpeg") no-repeat;
background-size: cover; background-size: cover;
position: relative; position: relative;

@ -3,7 +3,7 @@
<div class="box" ref="box"> <div class="box" ref="box">
<div class="container" ref="container" :style="transform"> <div class="container" ref="container" :style="transform">
<div class="no"> <div class="no">
序列号{{ info.bianma }} 序列号{{ info.shouquanshubianhao }}
</div> </div>
<div class="qrcode"> <div class="qrcode">
<div ref="qrcode"></div> <div ref="qrcode"></div>
@ -15,7 +15,10 @@
</div> </div>
<div class="text"> <div class="text">
兹有 <span>{{ info.name }}</span> 身份证号 <span>{{ info.idcard }}</span> 经苏州州市总工会审核评定为{{ new Date().getFullYear() }}年度苏州市总工会 <span>{{ type.get(info.kunnanleixing) }}家庭</span> 兹有<span>{{ info.name }}</span>身份证号<span>{{ info.idcard }}</span>经苏州州市总工会审核评定为{{ new Date().getFullYear() }}年度苏州市总工会<span>{{ info.kunnanleixing }}家庭</span>
<template v-if="showChild">
<span>{{ printChild.name }}</span>身份证号码<span>{{ printChild.idcard }}</span>系其家庭成员
</template>
<br> <br>
<p>特此证明</p> <p>特此证明</p>
@ -23,6 +26,8 @@
<p>苏州市总工会权益保障部</p> <p>苏州市总工会权益保障部</p>
<p>{{ $moment(new Date()).format('YYYY年M月DD日') }}</p> <p>{{ $moment(new Date()).format('YYYY年M月DD日') }}</p>
</div> </div>
<img class="seal" :src="require('@/assets/seal.png')" alt="">
</div> </div>
</div> </div>
</div> </div>
@ -47,6 +52,7 @@ export default {
data() { data() {
return { return {
info: {}, info: {},
printChild: {},
container: { container: {
w: 0, w: 0,
h: 0, h: 0,
@ -144,7 +150,7 @@ export default {
download () { download () {
this.isToImg = true; this.isToImg = true;
html2canvas(this.$refs['container'],{ html2canvas(this.$refs['container'],{
backgroundColor: null, backgroundColor: '#ffffff',
allowTaint: false, allowTaint: false,
taintTest: false, taintTest: false,
logging: false, logging: false,
@ -176,7 +182,14 @@ export default {
// delete page; // 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 => { }).catch(err => {
this.isToImg = false; this.isToImg = false;
}) })
@ -204,6 +217,11 @@ export default {
type: window.atob(this.$route.query.isChild) == 0 ? 1 : 2 type: window.atob(this.$route.query.isChild) == 0 ? 1 : 2
}) })
}).catch(err => this.isToImg = true) }).catch(err => this.isToImg = true)
},
getPrintChild (childrens) {
const childId = window.atob(this.$route.query.isChild);
this.printChild = childrens.find(i => i.id == childId);
} }
}, },
computed: { computed: {
@ -213,6 +231,9 @@ export default {
}, },
isReduction () { isReduction () {
return this.container.offsetX !== 0 || this.container.offsetY !== 0 || this.container.scale !== 1 return this.container.offsetX !== 0 || this.container.offsetY !== 0 || this.container.scale !== 1
},
showChild () {
return window.atob(this.$route.query.isChild) != 0
} }
}, },
created() { created() {
@ -231,6 +252,7 @@ export default {
console.log(res) console.log(res)
this.info = res.user; this.info = res.user;
this.getPrintChild(res.childrens);
this.init(); this.init();
this.creatQrCode(); this.creatQrCode();
}) })
@ -253,7 +275,7 @@ export default {
height: 100vh; height: 100vh;
max-width: 600px; max-width: 600px;
max-height: 800px; max-height: 800px;
background: #fff; background: #eee;
overflow: hidden; overflow: hidden;
margin: auto; margin: auto;
@ -261,6 +283,7 @@ export default {
.container { .container {
width: 100%; width: 100%;
height: 100%; height: 100%;
background: #fff;
position: relative; position: relative;
@ -305,7 +328,8 @@ export default {
top: 36%; top: 36%;
padding: 0 5em; padding: 0 5em;
text-indent: 2em; text-indent: 2em;
line-height: 3; line-height: 2.8;
word-break: keep-all;
& > span { & > span {
text-decoration: underline; text-decoration: underline;
@ -319,6 +343,15 @@ export default {
padding-top: 2em; padding-top: 2em;
padding-right: 1em; padding-right: 1em;
} }
.seal {
right: 14%;
width: 9vw;
min-width: 55px;
object-fit: cover;
filter: saturate(5);
position: absolute;
}
} }
} }
.reduction { .reduction {

@ -342,12 +342,58 @@ export default {
{ {
prop: 'unit', prop: 'unit',
label: '工作/学习单位', label: '工作/学习单位',
minWidth: 120,
customFn:row => { customFn:row => {
return ( return (
<el-input size="mini" clearable={true} v-model={row.unit}></el-input> <el-input size="mini" clearable={true} v-model={row.unit}></el-input>
) )
} }
}, },
{
prop: 'nianji',
label: '年级',
width: 100,
customFn:row => {
return (
<el-input size="mini" clearable={true} v-model={row.nianji}></el-input>
)
}
},
{
prop: 'yibao',
label: '医保',
width: 120,
customFn:row => {
return (
<el-select v-model={row.yibao} clearable={true}>
{
[
{
key: '本市职工医保',
value: 1
},
{
key: '本市居民医保',
value: 2
},
{
key: '本市学生医保',
value: 3
},
{
key: '外地医保',
value: 4
},
{
key: '无医保',
value: 5
}
].map(i => (<el-option label={i.key} value={i.value}></el-option>))
}
</el-select>
)
}
},
{ {
prop: 'delete', prop: 'delete',
label: '操作', label: '操作',

@ -219,9 +219,16 @@
> >
</template> </template>
<template #import> <template #import>
<Button type="primary" @click="$refs['imports'].show()" <el-upload
>导入</Button :headers="{
> Authorization: `Bearer ${getToken()}`,
}"
:show-file-list="false"
:action="action"
:on-sucess="importSuccess"
:file-list="fileList">
<Button type="primary">导入</Button>
</el-upload>
</template> </template>
<template #export> <template #export>
<Button <Button
@ -276,12 +283,6 @@
:form-info="form" :form-info="form"
ref="drawer" ref="drawer"
></drawer> ></drawer>
<imports
:table-name="customForm.tableName"
:form-info="form"
ref="imports"
@refresh="$refs['xyTable'].getTableData()"
></imports>
</div> </div>
</template> </template>
@ -296,18 +297,17 @@ import { show } from "@/api/system/customForm";
import * as XLSX from "xlsx"; import * as XLSX from "xlsx";
import { saveAs } from "file-saver"; import { saveAs } from "file-saver";
import { listdept } from "@/api/system/department" import { listdept } from "@/api/system/department"
import {getToken} from "@/utils/auth";
import add from "./component/add.vue"; import add from "./component/add.vue";
import LxHeader from "@/components/LxHeader/index.vue"; import LxHeader from "@/components/LxHeader/index.vue";
import headerContent from "@/components/LxHeader/XyContent.vue"; import headerContent from "@/components/LxHeader/XyContent.vue";
import drawer from "@/views/component/drawer.vue"; import drawer from "@/views/component/drawer.vue";
import imports from "@/views/component/imports.vue";
export default { export default {
components: { components: {
LxHeader, LxHeader,
headerContent, headerContent,
drawer, drawer,
imports,
add add
}, },
mixins: [authMixin], mixins: [authMixin],
@ -316,6 +316,7 @@ export default {
}, },
data() { data() {
return { return {
fileList: [],
op, op,
select: { select: {
table_name: "", table_name: "",
@ -336,19 +337,67 @@ export default {
}; };
}, },
methods: { methods: {
toPrint (row,isChild = 0) { importSuccess (response, file, fileList) {
console.log(row); 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({ const url = this.$router.resolve({
path: '/print', path: '/print',
query: { query: {
bm: window.btoa(row.bianma), bm: window.btoa(row.bianma),
isChild: window.btoa(isChild) isChild: window.btoa(pickChild)
} }
}) })
window.open(url.href) window.open(url.href)
}, },
getToken,
index, index,
destroy, destroy,
download, download,
@ -442,7 +491,9 @@ export default {
i._params = keys.map(key => { i._params = keys.map(key => {
return { return {
key, 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: { computed: {
action () {
return `${process.env.VUE_APP_BASE_API}/api/admin/other/record-import`
},
columnArrTest() { columnArrTest() {
return function (field) { return function (field) {
return this.form.find((i) => i.field === field) return this.form.find((i) => i.field === field)

Loading…
Cancel
Save