lion 5 months ago
commit ab2bd0835a

@ -1656,13 +1656,38 @@ export default {
} }
// input // input
if (wanInput) wanInput.value = wanTotal === 0 ? '0' : wanTotal; //
if (qianInput) qianInput.value = qianTotal === 0 ? '0' : qianTotal; const totalAmount = wanTotal * 10000 + qianTotal * 1000 + baiTotal * 100 + shiTotal * 10 + yuanTotal + jiaoTotal * 0.1 + fenTotal * 0.01;
if (baiInput) baiInput.value = baiTotal === 0 ? '0' : baiTotal;
if (shiInput) shiInput.value = shiTotal === 0 ? '0' : shiTotal; // input
if (yuanInput) yuanInput.value = yuanTotal === 0 ? '0' : yuanTotal; if (wanInput) {
if (jiaoInput) jiaoInput.value = jiaoTotal === 0 ? '0' : jiaoTotal; // 10000
if (fenInput) fenInput.value = fenTotal === 0 ? '0' : fenTotal; wanInput.value = totalAmount >= 10000 ? (wanTotal === 0 ? '0' : wanTotal) : '';
}
if (qianInput) {
// 1000
qianInput.value = totalAmount >= 1000 ? (qianTotal === 0 ? '0' : qianTotal) : '';
}
if (baiInput) {
// 100
baiInput.value = totalAmount >= 100 ? (baiTotal === 0 ? '0' : baiTotal) : '';
}
if (shiInput) {
// 10
shiInput.value = totalAmount >= 10 ? (shiTotal === 0 ? '0' : shiTotal) : '';
}
if (yuanInput) {
// 1
yuanInput.value = totalAmount >= 1 ? (yuanTotal === 0 ? '0' : yuanTotal) : '';
}
if (jiaoInput) {
// 0.1
jiaoInput.value = totalAmount >= 0.1 ? (jiaoTotal === 0 ? '0' : jiaoTotal) : '';
}
if (fenInput) {
// 0.01
fenInput.value = totalAmount >= 0.01 ? (fenTotal === 0 ? '0' : fenTotal) : '';
}
this.otherTotal = wanTotal * 10000 + qianTotal * 1000 + baiTotal * 100 + shiTotal * 10 + yuanTotal + jiaoTotal * 0.1 + fenTotal * 0.01 this.otherTotal = wanTotal * 10000 + qianTotal * 1000 + baiTotal * 100 + shiTotal * 10 + yuanTotal + jiaoTotal * 0.1 + fenTotal * 0.01
this.otherTotal = this.otherTotal.toFixed(2) this.otherTotal = this.otherTotal.toFixed(2)

@ -487,13 +487,37 @@ export default {
} }
// input // input
if (wanInput) wanInput.value = wanTotal === 0 ? '0' : wanTotal; //
if (qianInput) qianInput.value = qianTotal === 0 ? '0' : qianTotal; const totalAmount = wanTotal * 10000 + qianTotal * 1000 + baiTotal * 100 + shiTotal * 10 + yuanTotal + jiaoTotal * 0.1 + fenTotal * 0.01;
if (baiInput) baiInput.value = baiTotal === 0 ? '0' : baiTotal;
if (shiInput) shiInput.value = shiTotal === 0 ? '0' : shiTotal; if (wanInput) {
if (yuanInput) yuanInput.value = yuanTotal === 0 ? '0' : yuanTotal; // 10000
if (jiaoInput) jiaoInput.value = jiaoTotal === 0 ? '0' : jiaoTotal; wanInput.value = totalAmount >= 10000 ? (wanTotal === 0 ? '0' : wanTotal) : '';
if (fenInput) fenInput.value = fenTotal === 0 ? '0' : fenTotal; }
if (qianInput) {
// 1000
qianInput.value = totalAmount >= 1000 ? (qianTotal === 0 ? '0' : qianTotal) : '';
}
if (baiInput) {
// 100
baiInput.value = totalAmount >= 100 ? (baiTotal === 0 ? '0' : baiTotal) : '';
}
if (shiInput) {
// 10
shiInput.value = totalAmount >= 10 ? (shiTotal === 0 ? '0' : shiTotal) : '';
}
if (yuanInput) {
// 1
yuanInput.value = totalAmount >= 1 ? (yuanTotal === 0 ? '0' : yuanTotal) : '';
}
if (jiaoInput) {
// 0.1
jiaoInput.value = totalAmount >= 0.1 ? (jiaoTotal === 0 ? '0' : jiaoTotal) : '';
}
if (fenInput) {
// 0.01
fenInput.value = totalAmount >= 0.01 ? (fenTotal === 0 ? '0' : fenTotal) : '';
}
let otherTotal = wanTotal * 10000 + qianTotal * 1000 + baiTotal * 100 + shiTotal * 10 + yuanTotal + jiaoTotal * 0.1 + fenTotal * 0.01 let otherTotal = wanTotal * 10000 + qianTotal * 1000 + baiTotal * 100 + shiTotal * 10 + yuanTotal + jiaoTotal * 0.1 + fenTotal * 0.01
@ -590,7 +614,7 @@ export default {
span.style[key] = style[key] span.style[key] = style[key]
}) })
// widthheightInput // widthheightInput
span.style.width = '100%' span.style.width = style.width//'100%'
span.style.height = style.height span.style.height = style.height
span.style.whiteSpace = 'normal' span.style.whiteSpace = 'normal'
span.style.wordBreak = 'break-all' span.style.wordBreak = 'break-all'
@ -659,7 +683,7 @@ export default {
span.style[key] = style[key] span.style[key] = style[key]
}) })
// widthheighttextarea // widthheighttextarea
span.style.width = style.width span.style.width = style.width
span.style.height = style.height span.style.height = style.height
span.style.display = 'block' span.style.display = 'block'
span.style.textAlign = 'center' span.style.textAlign = 'center'
@ -769,16 +793,25 @@ export default {
const orientation = this.printOrientation || 'portrait'; const orientation = this.printOrientation || 'portrait';
const margin = orientation === 'portrait' const margin = orientation === 'portrait'
? '10mm 10mm 10mm 2mm' ? '5mm 5mm 10mm 2mm' //
: '10mm 10mm 10mm 10mm'; : '5mm 5mm 10mm 5mm'; //
const win = window.open('', '_blank') const win = window.open('', '_blank')
// //
const isPortrait = orientation === 'portrait'; const isPortrait = orientation === 'portrait';
const pageWidth = isPortrait ? 280 : 297; const pageWidth = isPortrait ? 290 : 297;
const scale = 0.9;
const offset = 7; //
const translateX = ((pageWidth - pageWidth * scale) / 2+offset).toFixed(2) + 'mm'; const hasTravelExpense = this.getForms && this.getForms.includes('差旅报销单');
const hasUtilityBill = this.getForms && this.getForms.includes('水电费结算单');
const hasReimbursementForm2 = this.getForms && this.getForms.includes('报销贴单2');
const scale = hasTravelExpense ? 0.66 : 0.9;
const offset = hasTravelExpense ? 62 : 5;
const translateX = ((pageWidth - pageWidth * scale) / 2 + offset).toFixed(2) + 'mm';
// .
// table { width: 100%; border-collapse: collapse;table-layout: fixed; text-align: center; margin: 0 auto; }
// td { border: 1px solid #000; padding: 8px; min-width: 100px; word-break: break-all; text-align: center; vertical-align: middle; }
// th { text-align: center; vertical-align: middle; }
win.document.write(` win.document.write(`
<html> <html>
<head> <head>
@ -786,7 +819,7 @@ export default {
<style> <style>
@page { size: A4 ${orientation}; margin: ${margin}; } @page { size: A4 ${orientation}; margin: ${margin}; }
body { body {
margin: 0; margin: 0;
padding: 0; padding: 0;
width: ${pageWidth}mm; width: ${pageWidth}mm;
display: flex; display: flex;
@ -803,9 +836,54 @@ export default {
padding: 0; padding: 0;
} }
.form-container { width: 100% !important; margin: 0 auto; } .form-container { width: 100% !important; margin: 0 auto; }
table { width: 100%; border-collapse: collapse;table-layout: fixed; text-align: center; margin: 0 auto; } table { width: 100%; border-collapse: collapse;table-layout: fixed; margin: 0 auto; }
td { border: 1px solid #000; padding: 8px; min-width: 100px; word-break: break-all; text-align: center; vertical-align: middle; } td { border: 1px solid #000; padding: 8px; min-width: 100px; word-break: break-all; vertical-align: middle; }
th { text-align: center; vertical-align: middle; } th { vertical-align: middle; }
/* 资金划拨单最后一列宽度调整 */
${this.getForms && this.getForms.includes('资金划拨审批单') ? `
/* 改变表格布局方式 */
table {
table-layout: auto !important;
width: 100% !important;
}
/* 设置各列宽度比例 */
table td:nth-child(1) { width: 20% !important; }
table td:nth-child(2) { width: 20% !important; }
table td:nth-child(3) { width: 20% !important; }
table td:nth-child(4) {
width: 40% !important;
min-width: 500px !important;
max-width: none !important;
word-break: break-all !important;
white-space: normal !important;
overflow-wrap: break-word !important;
}
/* 处理跨列情况 */
table td[colspan] { width: auto !important; min-width: auto !important; }
/* 确保所有文本内容正常换行 */
table td * {
white-space: normal !important;
word-break: break-all !important;
overflow-wrap: break-word !important;
}
` : ''}
/* 水电费结算单特殊行高控制 */
${hasUtilityBill ? `
table td { height: 80px !important; min-height: 60px !important; line-height: 1.8 !important; }
table tr { height: 80px !important; min-height: 60px !important; }
` : ''}
/* 报销贴单2特殊行高控制 */
${hasReimbursementForm2 ? `
table td { height: 80px !important; min-height: 80px !important; line-height: 2.0 !important; }
table tr { height: 80px !important; min-height: 80px !important; }
` : ''}
@media print { @media print {
body { body {
width: ${pageWidth}mm; width: ${pageWidth}mm;

@ -1,600 +1,280 @@
<template> <template>
<div v-if="registration"> <div v-if="registration">
<xy-dialog title="打印预览" :is-show.sync="isShow" :width="70" ok-text="" @on-ok="print"> <xy-dialog title="打印预览" :is-show.sync="isShow" :width="70" @on-ok="print" ok-text="">
<template v-slot:normalContent> <template v-slot:normalContent>
<div class="print-table1" id="printtable1" ref="printtable">
<div id="printtable1" ref="printtable" class="print-table1"> <div class="print-table1-title">苏州市河道管理处资金划拨审批单</div>
<!-- 苏州市河道管理处报销贴单 -->
<div class="print-table1-title">苏州市河道管理处报销贴单</div> <div class="print-table1-grid">
<div class="print-table1-subtitle"> <div style="grid-area: tb1-1" class="print-table1-grid-top">项目名称<span
<div>科室</div> style="font-weight: 600">{{registration.contract.name}}</span></div>
<div><span></span><span></span><span></span></div> <div style="grid-area: tb1-2;justify-content: center;align-items: center;flex-direction: column;">
</div> <div>本次为第 <span style="font-weight: 600;padding: 0 1vw;">{{payIndex}}</span> 次付款</div>
<div class="print-table2-grid"> <div>{{registration.remark}}</div>
<div class="purpose">用途说明</div> </div>
<div class="amount">金额</div> <div style="grid-area: tb2-1" class="print-table1-grid-top">承包商/供货商<span
<div class="claimant bmnone">报销(领款)</div> style="font-weight: 600">{{registration.contract.supply}}</span></div>
<div class="sign bmnone" /> <div style="grid-area: tb2-2" class="print-table1-grid-top">合同服务时间<span
style="font-weight: 600">{{registration.contract.start_date}} -
<div class="purpose2" /> {{registration.contract.end_date}}</span></div>
<div class="amount2" />
<div class="claimant2 btnone" /> <div style="grid-area: tb3-1" class="print-table1-grid-title1">付款情形</div>
<div class="sign2 btnone" /> <div style="grid-area: tb3-2" class="print-table1-grid-title1">金额单位</div>
<div style="grid-area: tb3-3" class="print-table1-grid-title1">备注</div>
<div class="purpose3" />
<div class="amount3" /> <div style="grid-area: tb4-1" class="print-table1-grid-center">A</div>
<div class="section-head bmnone">科室负责人</div> <div style="grid-area: tb4-2" class="print-table1-grid-center">合同金额</div>
<div class="sign3 bmnone" /> <div style="grid-area: tb4-3" class="print-table1-grid-center">{{priceFormat(registration.contract.money)}}
<div class="purpose3-1" /> </div>
<div class="amount3-1" /> <div style="grid-area: tb4-4"></div>
<div class="section-head-1 btnone" /> <div style="grid-area: tb5-1" class="print-table1-grid-center">B</div>
<div class="sign3-1 btnone" /> <div style="grid-area: tb5-2" class="print-table1-grid-center">审计金额</div>
<div style="grid-area: tb5-3" class="print-table1-grid-center">{{priceFormat(registration.contract.audit_money)}}</div>
<div class="purpose4" /> <div style="grid-area: tb5-4"></div>
<div class="amount4" /> <div style="grid-area: tb6-1" class="print-table1-grid-center">C</div>
<div class="audit bmnone">财审科审核</div> <div style="grid-area: tb6-2" class="print-table1-grid-center">前期累计已付款</div>
<div class="sign4 bmnone" /> <div style="grid-area: tb6-3" class="print-table1-grid-center">{{priceFormat(registration.total_act_money)}}
<div class="purpose4-1" /> </div>
<div class="amount4-1" /> <div style="grid-area: tb6-4"></div>
<div class="audit-1 btnone" /> <div style="grid-area: tb7-1" class="print-table1-grid-center">D</div>
<div class="sign4-1 btnone" /> <div style="grid-area: tb7-2" class="print-table1-grid-center">本期扣款</div>
<div style="grid-area: tb7-3" class="print-table1-grid-center">{{priceFormat(registration.discount_money)}}
<div class="purpose5" /> </div>
<div class="amount5" /> <div style="grid-area: tb7-4"></div>
<div class="sub-lead bmnone">分管领导审核</div> <div style="grid-area: tb8-1" class="print-table1-grid-center">E</div>
<div class="sign5 bmnone" /> <div style="grid-area: tb8-2;font-weight: 600" class="print-table1-grid-center">本期应付款</div>
<div class="purpose5-1" /> <div style="grid-area: tb8-3;font-weight: 600" class="print-table1-grid-center">
<div class="amount5-1" /> {{priceFormat(registration.apply_money)}}</div>
<div class="sub-lead-1 btnone" /> <div style="grid-area: tb8-4;padding-left: 0.6vw;display: block;">
<div class="sign5-1 btnone" /> <div style="display: flex;align-items: center;">
<div><span v-if="registration.type == '预付款'"></span></div>
<div class="purpose6" /> <div style="padding-left: 1.6vw"><span v-if="registration.type == '进度款'"></span></div>
<div class="amount6" /> <div style="padding-left: 1.6vw"><span v-if="registration.type == '结算款'"></span></div>
<div class="fin-sub-lead bmnone">财务分管领导审核</div> </div>
<div class="sign6 bmnone" /> <div style="display: flex;align-items: center;">
<div class="purpose6-1" /> <div><span v-if="registration.type == '质保金'"></span></div>
<div class="amount6-1" /> <div
<div class="fin-sub-lead-1 btnone" /> style="height: 1.8vw;min-width: 6vw;border-bottom: 2px #000 solid;margin-left: 2vw;font-size: 15px;">
<div class="sign6-1 btnone" /> <span v-if="registration.type!='进度款'&&registration.type!='质保金'&&registration.type!='结算款'">
{{registration.type}} </span>
<div class="total">合计</div> </div>
<div class="total1" /> <div>其他</div>
<div class="approver bmnone">单位负责人审批</div> </div>
<div class="sign7 bmnone" /> </div>
<div style="grid-area: tb9-1" class="print-table1-grid-center">F</div>
<div class="total-capital">报销金额(大写)</div> <div style="grid-area: tb9-2" class="print-table1-grid-center">累计支付</div>
<div class="total-capital1"> </div> <div style="grid-area: tb9-3" class="print-table1-grid-center">
<div class="approver-1 btnone" /> {{priceFormat(Number(registration.total_act_money)+Number(registration.apply_money))}}</div>
<div class="sign7-1 btnone" /> <div style="grid-area: tb9-4"></div>
<div style="grid-area: tb10-1" class="print-table1-grid-center">G</div>
</div> <div style="grid-area: tb10-2" class="print-table1-grid-center">累计扣款</div>
<div style="grid-area: tb10-3" class="print-table1-grid-center">
<div style="text-align: right;padding-top: 0.3vw;font-size: 1.5vw;"> {{priceFormat(Number(registration.total_discount_money)+Number(registration.discount_money))}}</div>
打印时间{{ new Date().getFullYear() }}.{{ new Date().getMonth()+1 }}.{{ new Date().getDate() }}</div> <div style="grid-area: tb10-4"></div>
</div> <div style="grid-area: tb11-1" class="print-table1-grid-center">H</div>
<!-- 苏州市河道管理处资金划拨审批单 --> <div style="grid-area: tb11-2" class="print-table1-grid-center">质保金</div>
<div id="printtable1" ref="printtable" class="print-table1"> <div style="grid-area: tb11-3;align-items: center;">
<div class="print-table1-title">苏州市河道管理处资金划拨审批单</div> {{guaranteeRate(registration.contract.guarantee_money,registration.contract.money,registration.contract.audit_money)}}%质保期{{registration.contract.guarantee_year}}需审计的以审计价为计费依据
</div>
<div class="print-table1-grid">
<div style="grid-area: tb1-1" class="print-table1-grid-top">项目名称<span <div style="grid-area: tb12" class="print-table1-grid-bottom1">
style="font-weight: 600" 资金列支渠道{{moneyWayFormat(registration.money_way_detail)}}
>{{ registration.contract.name }}</span></div> </div>
<div style="grid-area: tb1-2;justify-content: center;align-items: center;flex-direction: column;">
<div>本次为第 <span style="font-weight: 600;padding: 0 1vw;">{{ payIndex }}</span> 次付款</div> <div style="grid-area: tb13-1;" class="print-table1-grid-bottom2">
<div>{{ registration.remark }}</div> <div>
</div> <div>业务科室</div>
<div style="grid-area: tb2-1" class="print-table1-grid-top">承包商/供货商<span <div style="padding-top: 1vw;"> 经办人</div>
style="font-weight: 600" </div>
>{{ registration.contract.supply }}</span></div> </div>
<div style="grid-area: tb2-2" class="print-table1-grid-top">合同服务时间<span <div style="grid-area: tb13-2" class="print-table1-grid-bottom2">业务科室负责人</div>
style="font-weight: 600" <div style="grid-area: tb13-3" class="print-table1-grid-bottom2">业务科室分管领导</div>
>{{ registration.contract.start_date }} - <div style="grid-area: tb14-1;" class="print-table1-grid-bottom3">财务审计科</div>
{{ registration.contract.end_date }}</span></div> <div style="grid-area: tb14-2;" class="print-table1-grid-bottom3">财务审计科分管领导</div>
<div style="grid-area: tb14-3;" class="print-table1-grid-bottom3">单位负责人</div>
<div style="grid-area: tb3-1" class="print-table1-grid-title1">付款情形</div> </div>
<div style="grid-area: tb3-2" class="print-table1-grid-title1">金额单位</div>
<div style="grid-area: tb3-3" class="print-table1-grid-title1">备注</div> <div style="text-align: right;padding-top: 0.3vw;font-size: 1.5vw;">
打印时间{{new Date().getFullYear()}}.{{new Date().getMonth()+1}}.{{new Date().getDate()}}</div>
<div style="grid-area: tb4-1" class="print-table1-grid-center">A</div> </div>
<div style="grid-area: tb4-2" class="print-table1-grid-center">合同金额</div> </template>
<div style="grid-area: tb4-3" class="print-table1-grid-center">{{ priceFormat(registration.contract.money) }} </xy-dialog>
</div>
<div style="grid-area: tb4-4" /> </div>
<div style="grid-area: tb5-1" class="print-table1-grid-center">B</div> </template>
<div style="grid-area: tb5-2" class="print-table1-grid-center">审计金额</div>
<div style="grid-area: tb5-3" class="print-table1-grid-center"> <script>
{{ priceFormat(registration.contract.audit_money) }} import {
</div> detailFundLog,
<div style="grid-area: tb5-4" /> getFundLog
<div style="grid-area: tb6-1" class="print-table1-grid-center">C</div> } from "@/api/paymentRegistration/fundLog"
<div style="grid-area: tb6-2" class="print-table1-grid-center">前期累计已付款</div>
<div style="grid-area: tb6-3" class="print-table1-grid-center">{{ priceFormat(registration.total_act_money) }} import html2canvas from 'html2canvas'
</div> import * as printJS from "print-js";
<div style="grid-area: tb6-4" /> import {
<div style="grid-area: tb7-1" class="print-table1-grid-center">D</div> parseTime,
<div style="grid-area: tb7-2" class="print-table1-grid-center">本期扣款</div> moneyRecovery
<div style="grid-area: tb7-3" class="print-table1-grid-center">{{ priceFormat(registration.discount_money) }} } from "@/utils";
</div>
<div style="grid-area: tb7-4" /> export default {
<div style="grid-area: tb8-1" class="print-table1-grid-center">E</div> data() {
<div style="grid-area: tb8-2;font-weight: 600" class="print-table1-grid-center">本期应付款</div> return {
<div style="grid-area: tb8-3;font-weight: 600" class="print-table1-grid-center"> isShow: false,
{{ priceFormat(registration.apply_money) }} registration: null,
</div> beforeTotalMoney: 0,
<div style="grid-area: tb8-4;padding-left: 0.6vw;display: block;"> payIndex: 1,
<div style="display: flex;align-items: center;"> }
<div><span v-if="registration.type == '预付款'"></span></div> },
<div style="padding-left: 1.6vw"><span v-if="registration.type == '进度款'"></span></div> methods: {
<div style="padding-left: 1.6vw"><span v-if="registration.type == '结算款'"></span></div> moneyWayFormat(arr) {
</div> let res = arr.map(item => {
<div style="display: flex;align-items: center;"> return item.value
<div><span v-if="registration.type == '质保金'"></span></div> })
<div return res.toString()
style="height: 1.8vw;min-width: 6vw;border-bottom: 2px #000 solid;margin-left: 2vw;font-size: 15px;" },
> guaranteeRate(gua, money, auditmoney) {
<span v-if="registration.type!='进度款'&&registration.type!='质保金'&&registration.type!='结算款'"> let _money = money;
{{ registration.type }} </span> if(auditmoney&&auditmoney>0) _money=auditmoney;
</div> if (gua && _money) return ((moneyRecovery(gua) / _money) * 100).toFixed(2)
<div>其他</div> },
</div>
</div> async getDetailFundLog(id) {
<div style="grid-area: tb9-1" class="print-table1-grid-center">F</div> let res = await detailFundLog({
<div style="grid-area: tb9-2" class="print-table1-grid-center">累计支付</div> id
<div style="grid-area: tb9-3" class="print-table1-grid-center"> })
{{ priceFormat(Number(registration.total_act_money)+Number(registration.apply_money)) }} this.registration = res
</div> let res1 = await getFundLog({
<div style="grid-area: tb9-4" /> page_size: 999,
<div style="grid-area: tb10-1" class="print-table1-grid-center">G</div> contract_id: this.registration.contract.id
<div style="grid-area: tb10-2" class="print-table1-grid-center">累计扣款</div> })
<div style="grid-area: tb10-3" class="print-table1-grid-center"> if (res1.data.length > 0) {
{{ priceFormat(Number(registration.total_discount_money)+Number(registration.discount_money)) }} res1.data.map(item => {
</div> this.beforeTotalMoney += Number(item.act_money)
<div style="grid-area: tb10-4" /> })
<div style="grid-area: tb11-1" class="print-table1-grid-center">H</div> this.beforeTotalMoney -= Number(this.registration.act_money)
<div style="grid-area: tb11-2" class="print-table1-grid-center">质保金</div> } else {
<div style="grid-area: tb11-3;align-items: center;"> this.beforeTotalMoney = 0
{{ guaranteeRate(registration.contract.guarantee_money,registration.contract.money,registration.contract.audit_money) }}%质保期{{ registration.contract.guarantee_year }}需审计的以审计价为计费依据 }
</div>
let nowIndex = res?.id
<div style="grid-area: tb12" class="print-table1-grid-bottom1"> let idList = res1.data.map(item => {
资金列支渠道{{ moneyWayFormat(registration.money_way_detail) }} return item.id
</div> })
<div style="grid-area: tb13-1;" class="print-table1-grid-bottom2"> //
<div> idList.sort((a, b) => {
<div>业务科室</div> return a - b;
<div style="padding-top: 1vw;"> 经办人</div> })
</div>
</div> console.log("nowIndex", nowIndex)
<div style="grid-area: tb13-2" class="print-table1-grid-bottom2">业务科室负责人</div> console.log("idList", idList)
<div style="grid-area: tb13-3" class="print-table1-grid-bottom2">业务科室分管领导</div> this.payIndex = idList.indexOf(nowIndex) + 1
<div style="grid-area: tb14-1;" class="print-table1-grid-bottom3">财务审计科</div> },
<div style="grid-area: tb14-2;" class="print-table1-grid-bottom3">财务审计科分管领导</div>
<div style="grid-area: tb14-3;" class="print-table1-grid-bottom3">单位负责人</div> async print() {
</div> let canvas = await html2canvas(this.$refs['printtable'], {
backgroundColor: null,
<div style="text-align: right;padding-top: 0.3vw;font-size: 1.5vw;"> useCORS: true,
打印时间{{ new Date().getFullYear() }}.{{ new Date().getMonth()+1 }}.{{ new Date().getDate() }}</div> })
</div> printJS({
printable: canvas.toDataURL(),
</template> type: 'image',
</xy-dialog> documentTitle: '苏州市河道管理处资金划拨审批单',
style: '@page{margin:auto;}'
</div> })
</template> }
},
<script> computed: {
import { dateFormat() {
detailFundLog, return function(date) {
getFundLog return parseTime(new Date(date))
} from '@/api/paymentRegistration/fundLog' }
},
import html2canvas from 'html2canvas' priceFormat() {
import * as printJS from 'print-js' return function(price) {
import { return Number(price).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, '$1,')
parseTime, }
moneyRecovery }
} from '@/utils' }
}
export default { </script>
data() {
return { <style scoped lang="scss">
isShow: false, .print-table1 {
registration: null, box-sizing: border-box;
beforeTotalMoney: 0,
payIndex: 1 &-title {
} font-size: 2vw;
}, letter-spacing: 2px;
computed: { text-align: center;
dateFormat() { font-weight: 600;
return function(date) { border: none;
return parseTime(new Date(date))
} padding: 1.6vw 0;
}, }
priceFormat() {
return function(price) { &-grid {
return Number(price).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, '$1,') font-size: 1.75vw;
} border: 1px #000 solid;
} display: grid;
}, grid-template-rows: repeat(14, auto);
methods: { grid-template-columns: repeat(6, 1fr);
moneyWayFormat(arr) { grid-template-areas:
const res = arr.map(item => { "tb1-1 tb1-1 tb1-1 tb1-2 tb1-2 tb1-2"
return item.value "tb2-1 tb2-1 tb2-1 tb2-2 tb2-2 tb2-2"
}) "tb3-1 tb3-1 tb3-2 tb3-2 tb3-3 tb3-3"
return res.toString() "tb4-1 tb4-2 tb4-3 tb4-3 tb4-4 tb4-4"
}, "tb5-1 tb5-2 tb5-3 tb5-3 tb5-4 tb5-4"
guaranteeRate(gua, money, auditmoney) { "tb6-1 tb6-2 tb6-3 tb6-3 tb6-4 tb6-4"
let _money = money "tb7-1 tb7-2 tb7-3 tb7-3 tb7-4 tb7-4"
if (auditmoney && auditmoney > 0) _money = auditmoney "tb8-1 tb8-2 tb8-3 tb8-3 tb8-4 tb8-4"
if (gua && _money) return ((moneyRecovery(gua) / _money) * 100).toFixed(2) "tb9-1 tb9-2 tb9-3 tb9-3 tb9-4 tb9-4"
}, "tb10-1 tb10-2 tb10-3 tb10-3 tb10-4 tb10-4"
"tb11-1 tb11-2 tb11-3 tb11-3 tb11-3 tb11-3"
async getDetailFundLog(id) { "tb12 tb12 tb12 tb12 tb12 tb12"
const res = await detailFundLog({ "tb13-1 tb13-1 tb13-2 tb13-2 tb13-3 tb13-3"
id "tb14-1 tb14-1 tb14-2 tb14-2 tb14-3 tb14-3";
})
this.registration = res &>div {
const res1 = await getFundLog({ border: 1px #000 solid;
page_size: 999, display: flex;
contract_id: this.registration.contract.id
}) }
if (res1.data.length > 0) {
res1.data.map(item => { &-top {
this.beforeTotalMoney += Number(item.act_money)
}) padding: 0.4vw 0 3.6vw 0.4vw;
this.beforeTotalMoney -= Number(this.registration.act_money) }
} else {
this.beforeTotalMoney = 0 &-title1 {
} text-align: center;
justify-content: center;
const nowIndex = res?.id
const idList = res1.data.map(item => { padding: 0.2vw 0;
return item.id }
})
&-center {
// text-align: center;
idList.sort((a, b) => { justify-content: center;
return a - b align-items: center;
})
padding: 1vw 0;
console.log('nowIndex', nowIndex) }
console.log('idList', idList)
this.payIndex = idList.indexOf(nowIndex) + 1 &-bottom1 {
},
padding: 0.4vw 0 4vw 0.4vw;
async print() { }
const canvas = await html2canvas(this.$refs['printtable'], {
backgroundColor: null, &-bottom2 {
useCORS: true
}) padding: 0.4vw 0 4vw 0.4vw;
printJS({ }
printable: canvas.toDataURL(),
type: 'image', &-bottom3 {
documentTitle: '苏州市河道管理处资金划拨审批单',
style: '@page{margin:auto;}' padding: 0.4vw 0 6vw 0.4vw;
}) }
} }
} }
} </style>
</script>
<style scoped lang="scss">
.print-table1 {
box-sizing: border-box;
&-title {
font-size: 2vw;
letter-spacing: 2px;
text-align: center;
font-weight: 600;
border: none;
padding: 1.6vw 0;
}
&-subtitle {
display: flex;
align-items: center;
justify-content: space-between;
font-size: 2vw;
font-weight: 600;
span {
margin-left: 20px;
}
}
&-grid {
font-size: 1.75vw;
border: 1px #000 solid;
display: grid;
grid-template-rows: repeat(14, auto);
grid-template-columns: repeat(6, 1fr);
grid-template-areas:
"tb1-1 tb1-1 tb1-1 tb1-2 tb1-2 tb1-2"
"tb2-1 tb2-1 tb2-1 tb2-2 tb2-2 tb2-2"
"tb3-1 tb3-1 tb3-2 tb3-2 tb3-3 tb3-3"
"tb4-1 tb4-2 tb4-3 tb4-3 tb4-4 tb4-4"
"tb5-1 tb5-2 tb5-3 tb5-3 tb5-4 tb5-4"
"tb6-1 tb6-2 tb6-3 tb6-3 tb6-4 tb6-4"
"tb7-1 tb7-2 tb7-3 tb7-3 tb7-4 tb7-4"
"tb8-1 tb8-2 tb8-3 tb8-3 tb8-4 tb8-4"
"tb9-1 tb9-2 tb9-3 tb9-3 tb9-4 tb9-4"
"tb10-1 tb10-2 tb10-3 tb10-3 tb10-4 tb10-4"
"tb11-1 tb11-2 tb11-3 tb11-3 tb11-3 tb11-3"
"tb12 tb12 tb12 tb12 tb12 tb12"
"tb13-1 tb13-1 tb13-2 tb13-2 tb13-3 tb13-3"
"tb14-1 tb14-1 tb14-2 tb14-2 tb14-3 tb14-3";
&>div {
border: 1px #000 solid;
display: flex;
}
&-top {
padding: 0.4vw 0 3.6vw 0.4vw;
}
&-title1 {
text-align: center;
justify-content: center;
padding: 0.2vw 0;
}
&-center {
text-align: center;
justify-content: center;
align-items: center;
padding: 1vw 0;
}
&-bottom1 {
padding: 0.4vw 0 4vw 0.4vw;
}
&-bottom2 {
padding: 0.4vw 0 4vw 0.4vw;
}
&-bottom3 {
padding: 0.4vw 0 6vw 0.4vw;
}
}
}
.print-table2-grid {
font-size: 1.75vw;
border: 1px #000 solid;
display: grid;
// grid-template-rows: repeat(14, auto);
grid-auto-rows: minmax(min-content, max-content);
grid-template-columns: repeat(4, 1fr);
grid-template-areas:
"purpose amount claimant sign"
"purpose2 amount2 claimant2 sign2"
"purpose3 amount3 section-head sign3"
"purpose3-1 amount3-1 section-head-1 sign3-1"
"purpose4 amount4 audit sign4"
"purpose4-1 amount4-1 audit-1 sign4-1"
"purpose5 amount5 sub-lead sign5"
"purpose5-1 amount5-1 sub-lead-1 sign5-1"
"purpose6 amount6 fin-sub-lead sign6"
"purpose6-1 amount6-1 fin-sub-lead-1 sign6-1"
"total total1 approver sign7"
"total-capital total-capital1 approver-1 sign7-1";
&>div {
border: 1px #000 solid;
display: flex;
height: 45px;
}
.bmnone{
border-bottom:none
}
.btnone{
border-top:none
}
/* 用途说明 */
/* 用途说明 */
.purpose {
grid-area: purpose;
}
.purpose2 {
grid-area: purpose2;
}
.purpose3 {
grid-area: purpose3;
}
.purpose4 {
grid-area: purpose4;
}
.purpose5 {
grid-area: purpose5;
}
.purpose6 {
grid-area: purpose6;
}
.purpose3-1 {
grid-area: purpose3-1;
}
.purpose4-1 {
grid-area: purpose4-1;
}
.purpose5-1 {
grid-area: purpose5-1;
}
.purpose6-1 {
grid-area: purpose6-1;
}
/* 金额 */
.amount {
grid-area: amount;
}
.amount2 {
grid-area: amount2;
}
.amount3 {
grid-area: amount3;
}
.amount4 {
grid-area: amount4;
}
.amount5 {
grid-area: amount5;
}
.amount6 {
grid-area: amount6;
}
.amount3-1 {
grid-area: amount3-1;
}
.amount4 {
grid-area: amount4-1;
}
.amount5 {
grid-area: amount5-1;
}
.amount6 {
grid-area: amount6-1;
}
/* 报销(领款)人 */
.claimant {
grid-area: claimant;
}
.claimant2 {
grid-area: claimant2;
}
.sign {
grid-area: sign;
}
.sign2 {
grid-area: sign2;
}
.sign3 {
grid-area: sign3;
}
.sign4 {
grid-area: sign4;
}
.sign5 {
grid-area: sign5;
}
.sign6 {
grid-area: sign6;
}
.sign7 {
grid-area: sign7;
}
.sign3-1 {
grid-area: sign3-1;
}
.sign4-1 {
grid-area: sign4-1;
}
.sign5-1 {
grid-area: sign5-1;
}
.sign6-1 {
grid-area: sign6-1;
}
.sign7-1 {
grid-area: sign7-1;
}
/* 科室负责人 */
.section-head {
grid-area: section-head;
}
.section-head-1 {
grid-area: section-head-1;
}
/* 财审科审核 */
.audit {
grid-area: audit;
}
.audit-1 {
grid-area: audit-1;
}
/* 分管领导审核 */
.sub-lead {
grid-area: sub-lead;
}
.sub-lead-1 {
grid-area: sub-lead-1;
}
/* 财务分管领导审核 */
.fin-sub-lead {
grid-area: fin-sub-lead;
}
.fin-sub-lead-1 {
grid-area: fin-sub-lead-1;
}
/* 合计 */
.total {
grid-area: total;
}
.total1 {
grid-area: total1;
}
/* 报销金额(大写) */
.total-capital {
grid-area: total-capital;
}
.total-capital-1 {
grid-area: total-capital-1;
}
/* 单位负责人审批 */
.approver {
grid-area: approver;
}
.approver-1 {
grid-area: approver-1;
}
}
</style>

Loading…
Cancel
Save