Commit 23e09dc0d6e486c670c5aee3ab2d18f01b4980c4

Authored by 杨泽宇
1 parent d05f6949

回执单下载

src/views/fee/index.vue
... ... @@ -158,11 +158,11 @@ const handleChange = (value: number, pageSize: number) => {
158 158 * @param {object} obj 缴费状态改变
159 159 */
160 160 const handlePay = (value: number | null) => {
161   - if(!value) {
162   - data.params.query.payType = null
  161 + if (!value) {
  162 + data.params.query.payType = null;
163 163 }
164   - getList()
165   -}
  164 + getList();
  165 +};
166 166 /**
167 167 * 查看回执单
168 168 * @param {object} obj 一条表格对象
... ... @@ -410,13 +410,6 @@ const handleCancel = () => {
410 410 form.visible = false;
411 411 };
412 412 /**
413   - * 表格每一行是否可选中
414   - * @param {array} row 每一行数据对象
415   - */
416   -// const isSelectable = (row: any) => {
417   -// return ~~row.status === 0 && ~~row.payStatus === 0;
418   -// };
419   -/**
420 413 * 表单提交
421 414 */
422 415 const submitForm = (formEl: InstanceType<typeof ElForm> | undefined) => {
... ...
src/views/fee/paper.vue
1 1 <script setup lang="ts">
2   -import { reactive, ref, getCurrentInstance } from "vue";
  2 +import { reactive, ref, getCurrentInstance, onMounted } from "vue";
3 3 import { parseTime, globalFilters } from "@/utils/tool";
4 4 import { bankType } from "./config";
5 5 /**
... ... @@ -17,10 +17,127 @@ const props = withDefaults(defineProps&lt;Props&gt;(), {
17 17 },
18 18 },
19 19 });
  20 +/**
  21 + * @method getPic
  22 + * @description 下载回执单响应
  23 + */
  24 +const getPic = () => {
  25 + let can: any = document.querySelector("#fee-canv");
  26 + let url = can.toDataURL("image/png");
  27 + let aDom = document.createElement("a");
  28 + aDom.download = "物业费回执单.png";
  29 + aDom.href = url;
  30 + document.body.appendChild(aDom);
  31 + aDom.click();
  32 + document.body.removeChild(aDom);
  33 +};
  34 +/**
  35 + * @method drawCanvas
  36 + * @description 数据生成canvas
  37 + */
  38 +const drawCanvas = () => {
  39 + let canvas: any = document.querySelector("#fee-canv");
  40 + let ctx: any = canvas.getContext("2d");
  41 + canvas.width = 1000;
  42 + canvas.height = 360;
  43 + canvas.style.border = "2px solid #000";
  44 + let rectH: number = 45,
  45 + rectW: number = 500,
  46 + labelW: number = 150;
  47 + ctx.lineWidth = 2;
  48 +
  49 + // 画横线
  50 + for (let i = 1; i < canvas.height; i++) {
  51 + ctx.moveTo(0, rectH * i);
  52 + ctx.lineTo(canvas.width, rectH * i);
  53 + }
  54 + // 画左侧label右侧边框
  55 + let ind = 1;
  56 + ctx.moveTo(labelW, 45);
  57 + while (ind <= canvas.height / rectH) {
  58 + ctx.lineTo(labelW, rectH * ind);
  59 + ind++;
  60 + }
  61 + // 画右侧label边框
  62 + ctx.moveTo(rectW, 45);
  63 + ctx.lineTo(rectW, rectH * 2);
  64 + ctx.moveTo(rectW, 135);
  65 + ctx.lineTo(rectW, rectH * 5);
  66 +
  67 + ctx.moveTo(rectW + labelW, 45);
  68 + ctx.lineTo(rectW + labelW, rectH * 2);
  69 + ctx.moveTo(rectW + labelW, 135);
  70 + ctx.lineTo(rectW + labelW, rectH * 5);
  71 +
  72 + // 画四周边框
  73 + ctx.moveTo(0, 45);
  74 + ctx.lineTo(0, rectH * 8);
  75 +
  76 + ctx.moveTo(canvas.width, 45);
  77 + ctx.lineTo(canvas.width, rectH * 8);
  78 +
  79 + // 填入内容
  80 + ctx.font = "18px bold 黑体";
  81 + ctx.fillStyle = "#000000";
  82 + ctx.textBaseline = "middle";
  83 + ctx.fillText("回单类型", 38, 69);
  84 + ctx.fillText(props.paperData.receiptType, 170, 69);
  85 +
  86 + ctx.fillText("缴费项目", 538, 69);
  87 + ctx.fillText(props.paperData.receiptName, 670, 69);
  88 +
  89 + ctx.fillText("收费单位", 38, 114);
  90 + ctx.fillText(props.paperData.propertyName, 170, 114);
  91 +
  92 + ctx.fillText("缴费房屋", 38, 159);
  93 + ctx.fillText(props.paperData.locality, 170, 159);
  94 + ctx.fillText("缴费人", 538, 159);
  95 + ctx.fillText(props.paperData.payerName, 670, 159);
  96 +
  97 + ctx.fillText("金额(大写)", 38, 204);
  98 + ctx.fillText(props.paperData.rmb, 170, 204);
  99 + ctx.fillText("金额(小写)", 538, 204);
  100 + ctx.fillText((props.paperData.totalFee / 100).toFixed(2), 670, 204);
  101 +
  102 + ctx.fillText("支付方式", 38, 249);
  103 + ctx.fillText(globalFilters(props.paperData.bankPayType, bankType), 170, 249);
  104 +
  105 + ctx.fillText("账单周期", 38, 294);
  106 + ctx.fillText(
  107 + `${parseTime(new Date(props.paperData.beginTime).getTime(), "", "/").slice(
  108 + 0,
  109 + 7
  110 + )} - ${parseTime(
  111 + new Date(props.paperData.endTime).getTime(),
  112 + "",
  113 + "/"
  114 + ).slice(0, 7)}`,
  115 + 170,
  116 + 294
  117 + );
  118 +
  119 + ctx.fillText("支付时间", 38, 339);
  120 + ctx.fillText(
  121 + parseTime(new Date(props.paperData.payTime).getTime(), "", "/"),
  122 + 170,
  123 + 339
  124 + );
  125 +
  126 + ctx.fillText(`电子回执单号码:${props.paperData.receiptId}`, 0, 24);
  127 + ctx.stroke();
  128 +};
  129 +onMounted(() => {
  130 + drawCanvas();
  131 +});
20 132 </script>
21 133  
22 134 <template>
23   - <p>电子回执单号码:{{ paperData.receiptId }}</p>
  135 + <el-row
  136 + style="display: flex; justify-content: space-between; padding-bottom: 10px"
  137 + >
  138 + <p>电子回执单号码:{{ paperData.receiptId }}</p>
  139 + <el-button type="success" @click="getPic">下载</el-button>
  140 + </el-row>
24 141 <div class="paper-table">
25 142 <el-row class="paper-table-line">
26 143 <el-col :span="12">
... ... @@ -110,9 +227,18 @@ const props = withDefaults(defineProps&lt;Props&gt;(), {
110 227 <el-col :span="20">
111 228 <div class="paper-table-content">
112 229 {{
113   - parseTime(new Date(paperData.beginTime).getTime(), "", "/").slice(0, 7)
  230 + parseTime(new Date(paperData.beginTime).getTime(), "", "/").slice(
  231 + 0,
  232 + 7
  233 + )
  234 + }}
  235 + -
  236 + {{
  237 + parseTime(new Date(paperData.endTime).getTime(), "", "/").slice(
  238 + 0,
  239 + 7
  240 + )
114 241 }}
115   - - {{ parseTime(new Date(paperData.endTime).getTime(), "", "/").slice(0, 7) }}
116 242 </div>
117 243 </el-col>
118 244 </el-col>
... ... @@ -130,6 +256,12 @@ const props = withDefaults(defineProps&lt;Props&gt;(), {
130 256 </el-col>
131 257 </el-row>
132 258 </div>
  259 + <template style="z-index: -1">
  260 + <canvas
  261 + id="fee-canv"
  262 + style="padding: 40px; margin-top: -500px; opacity: 0"
  263 + ></canvas>
  264 + </template>
133 265 </template>
134 266  
135 267 <style lang="scss" scoped>
... ... @@ -137,6 +269,7 @@ const props = withDefaults(defineProps&lt;Props&gt;(), {
137 269 border-top: 2px solid #000;
138 270 border-left: 2px solid #000;
139 271 border-right: 2px solid #000;
  272 + z-index: 1000;
140 273 &-line {
141 274 border-bottom: 2px solid #000;
142 275 display: flex;
... ...
src/views/user/cnlive_login.vue
... ... @@ -28,6 +28,7 @@ let loading = ref(false);
28 28 let errorMsg = reactive({
29 29 text: "手机号或密码错误",
30 30 show: false,
  31 + downLoadUrl: 'http://systk.cnlive.com/download.html'
31 32 });
32 33 let menu = reactive({
33 34 data: [],
... ... @@ -146,7 +147,7 @@ onMounted(() =&gt; {
146 147 </div>
147 148  
148 149 <div class="cnlive-download">
149   - <a href="http://www.cnlive.com/download.html">下载网家家APP</a>
  150 + <a href="http://systk.cnlive.com/download.html">下载网家家APP</a>
150 151 </div>
151 152 </div>
152 153 </nav>
... ... @@ -156,7 +157,7 @@ onMounted(() =&gt; {
156 157 <div class="cnlive-main-board">
157 158 <div class="cnlive-main-board-form">
158 159 <div class="cnlive-main-board-form-title">
159   - <h3>智慧社区平台</h3>
  160 + <h3>数字社区平台</h3>
160 161 </div>
161 162 <div class="cnlive-main-board-form-input">
162 163 <el-form
... ... @@ -228,12 +229,9 @@ onMounted(() =&gt; {
228 229  
229 230 <div class="cnlive-footer">
230 231 <p>
231   - 网家家APP、Cnlive.com 《信息网络传播视听节目许可证》,许可证号:0105123
232   - </p>
233   - <p>京ICP证090477号、京ICP备11041453号-1、京公网安备11010802024488号</p>
234   - <p>
235   - 社会信用代码91110000667507432R
  232 + 网家家APP、Cnlive.com 《信息网络传播视听节目许可证》、许可证号:0105123
236 233 </p>
  234 + <p>京ICP证090477号、京ICP备11041453号-1、京公网安备11010802024488号、联系电话:010-65832485</p>
237 235 </div>
238 236 </div>
239 237 </template>
... ... @@ -305,18 +303,17 @@ onMounted(() =&gt; {
305 303 width: 658px;
306 304 padding-left: 151px;
307 305 &-title {
308   - color: cyan;
309 306 h3 {
310 307 padding-bottom: 45px;
311 308 margin-top: 190px;
312 309 line-height: 42px;
313 310 font-weight: 600;
314   - color: #171717;
  311 + color: #333333;
315 312 font-size: 30px;
316 313 text-align: left;
317   - background: url(https://cnlive-resweb.ks3-cn-beijing.ksyuncs.com/sites/cnlive_web/new-images/huang-icon.png)
318   - 0 50px no-repeat;
319   - background-size: 27px 5px;
  314 + // background: url(https://cnlive-resweb.ks3-cn-beijing.ksyuncs.com/sites/cnlive_web/new-images/huang-icon.png)
  315 + // 0 50px no-repeat;
  316 + // background-size: 27px 5px;
320 317 }
321 318 }
322 319 &-input {
... ...