master
xy 2 years ago
parent 02114fd6df
commit fb8ab01da2

@ -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",

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;
}
.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 {

@ -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'

@ -84,8 +84,18 @@
</div>
<div class="print-btn">
<Button size="large" type="primary" @click="toPrint"></Button>
<Button size="large" type="primary" @click="toPrint" v-if="info.childrens.length > 0"></Button>
<Button shape="circle" size="large" type="primary" @click="toPrint"></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>
</template>
@ -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();
}
}
</script>
@ -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;
}
}
}
</style>
<style>
.ms-mobile-select {
position: fixed!important;
}
</style>

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

@ -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;

@ -3,7 +3,7 @@
<div class="box" ref="box">
<div class="container" ref="container" :style="transform">
<div class="no">
序列号{{ info.bianma }}
序列号{{ info.shouquanshubianhao }}
</div>
<div class="qrcode">
<div ref="qrcode"></div>
@ -15,7 +15,10 @@
</div>
<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>
<p>特此证明</p>
@ -23,6 +26,8 @@
<p>苏州市总工会权益保障部</p>
<p>{{ $moment(new Date()).format('YYYY年M月DD日') }}</p>
</div>
<img class="seal" :src="require('@/assets/seal.png')" alt="">
</div>
</div>
</div>
@ -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 {

@ -342,12 +342,58 @@ export default {
{
prop: 'unit',
label: '工作/学习单位',
minWidth: 120,
customFn:row => {
return (
<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',
label: '操作',

@ -219,9 +219,16 @@
>
</template>
<template #import>
<Button type="primary" @click="$refs['imports'].show()"
>导入</Button
>
<el-upload
:headers="{
Authorization: `Bearer ${getToken()}`,
}"
:show-file-list="false"
:action="action"
:on-sucess="importSuccess"
:file-list="fileList">
<Button type="primary">导入</Button>
</el-upload>
</template>
<template #export>
<Button
@ -276,12 +283,6 @@
:form-info="form"
ref="drawer"
></drawer>
<imports
:table-name="customForm.tableName"
:form-info="form"
ref="imports"
@refresh="$refs['xyTable'].getTableData()"
></imports>
</div>
</template>
@ -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)

Loading…
Cancel
Save