You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

836 lines
29 KiB

2 years ago
5 months ago
2 years ago
5 months ago
2 years ago
5 months ago
2 years ago
5 months ago
2 years ago
5 months ago
2 years ago
5 months ago
2 years ago
5 months ago
2 years ago
5 months ago
4 months ago
5 months ago
2 years ago
5 months ago
2 years ago
5 months ago
2 years ago
5 months ago
2 years ago
5 months ago
2 years ago
5 months ago
2 years ago
5 months ago
2 years ago
5 months ago
2 years ago
5 months ago
2 years ago
5 months ago
2 years ago
5 months ago
2 years ago
5 months ago
2 years ago
5 months ago
2 years ago
5 months ago
2 years ago
5 months ago
2 years ago
5 months ago
2 years ago
5 months ago
2 years ago
5 months ago
2 years ago
5 months ago
4 months ago
5 months ago
2 years ago
5 months ago
2 years ago
5 months ago
2 years ago
5 months ago
2 years ago
5 months ago
2 years ago
5 months ago
2 years ago
5 months ago
2 years ago
5 months ago
2 years ago
5 months ago
2 years ago
5 months ago
2 years ago
5 months ago
2 years ago
5 months ago
2 years ago
5 months ago
2 years ago
5 months ago
2 years ago
5 months ago
4 months ago
5 months ago
2 years ago
2 years ago
5 months ago
2 years ago
2 years ago
2 years ago
5 months ago
2 years ago
2 years ago
5 months ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
5 months ago
2 years ago
5 months ago
2 years ago
5 months ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
5 months ago
2 years ago
5 months ago
2 years ago
2 years ago
  1. <template>
  2. <div class="box">
  3. <div>
  4. <div class="middlebox">
  5. <div class="contenttitle">
  6. 客户报表 /
  7. <span class="contenttitleBold">单位体检报表</span>
  8. </div>
  9. </div>
  10. <div :style="'display: block;'">
  11. <div
  12. style="
  13. background-color: #fff;
  14. padding: 15px;
  15. border-radius: 8px;
  16. display: flex;
  17. flex-wrap: wrap;
  18. margin-bottom: 10px;
  19. height: 35px;
  20. margin-top: 7px;
  21. "
  22. >
  23. <div class="query">
  24. <span>体检单位</span>
  25. <el-input
  26. placeholder="请选择体检单位"
  27. v-model="patientRegister.query.cusOrgOCX"
  28. style="width: 240px"
  29. size="small"
  30. disabled
  31. >
  32. <el-button
  33. slot="append"
  34. icon="el-icon-search"
  35. @click="report.dialogCusOrgOCX = true"
  36. style="font-size: 20px"
  37. ></el-button>
  38. </el-input>
  39. </div>
  40. <div class="query">
  41. <span>报表格式</span>
  42. <el-select
  43. v-model="format"
  44. placeholder="请选择"
  45. style="width: 80px"
  46. @change="changeValue"
  47. size="small"
  48. >
  49. <el-option label="标准格式" value="0" />
  50. <el-option label="精简格式" value="1" />
  51. <el-option label="Word格式" value="2" />
  52. </el-select>
  53. </div>
  54. <div class="query">
  55. <el-button @click="btnQuery" size="small" class="commonbutton"
  56. >查询</el-button
  57. >
  58. </div>
  59. <div class="query">
  60. <el-button
  61. size="small"
  62. class="commonbutton"
  63. :disabled="format == 2"
  64. @click="handleExport"
  65. >导出excel</el-button
  66. >
  67. </div>
  68. <div class="query">
  69. <el-button
  70. size="small"
  71. class="commonbutton"
  72. :disabled="format == 2"
  73. @click="onPrint"
  74. >打印</el-button
  75. >
  76. </div>
  77. </div>
  78. <div v-show="format == 0" ref="imageDom0">
  79. <div
  80. style="background-color: #fff; padding: 15px; border-radius: 8px"
  81. >
  82. <el-table
  83. border
  84. :height="
  85. flag
  86. ? window.pageHeight < 600
  87. ? 415
  88. : window.pageHeight - 185 - 25
  89. : ''
  90. "
  91. :data="tableData"
  92. id="standardTableData"
  93. ref="standardTableData"
  94. style="width: 100%"
  95. :header-cell-class-name="headerStyle"
  96. >
  97. <el-table-column :label="reportTitle">
  98. <el-table-column
  99. :label="`单位: ${customerOrgName || ''} 体检次数 ${
  100. medicalTimes || ''
  101. } 开始月份 ${startMonth || ''} 结束月份 ${
  102. endMonth || ''
  103. }`"
  104. >
  105. <template slot-scope="scope">
  106. <el-table
  107. :data="scope.row.patientRegisterPositiveReports.details"
  108. border
  109. show-summary
  110. :summary-method="summarizeRegisterCounts"
  111. :header-cell-class-name="headerStyle"
  112. >
  113. <el-table-column label="人员阳性结果清单">
  114. <el-table-column
  115. :label="`${
  116. scope.row.patientRegisterPositiveReports
  117. .startDate || ''
  118. }
  119. ${
  120. scope.row.patientRegisterPositiveReports.endDate ||
  121. ''
  122. }
  123. 男性
  124. ${scope.row.patientRegisterPositiveReports.maleCount}
  125. 女性
  126. ${
  127. scope.row.patientRegisterPositiveReports.femaleCount
  128. }
  129. `"
  130. >
  131. <el-table-column
  132. prop="patientNo"
  133. label="档案号"
  134. width="120"
  135. />
  136. <el-table-column
  137. prop="patientName"
  138. label="姓名"
  139. width="120"
  140. />
  141. <el-table-column
  142. prop="sexName"
  143. label="性别"
  144. width="50"
  145. />
  146. <el-table-column prop="age" label="年龄" width="80" />
  147. <el-table-column
  148. prop="medicalTimes"
  149. label="次数"
  150. width="50"
  151. />
  152. <el-table-column
  153. prop="mobileTelephone"
  154. label="手机号码"
  155. width="120"
  156. />
  157. <el-table-column
  158. prop="diagnosisNames"
  159. label="诊断名称"
  160. />
  161. </el-table-column>
  162. </el-table-column>
  163. </el-table>
  164. <el-table
  165. :data="
  166. scope.row.positivePatientRegisterReportStandards.details
  167. "
  168. border
  169. :header-cell-class-name="headerStyle"
  170. style="margin-top: 15px"
  171. >
  172. <el-table-column label="阳性结果人员清单">
  173. <el-table-column
  174. :label="`${
  175. scope.row.patientRegisterPositiveReports
  176. .startDate || ''
  177. }
  178. ${
  179. scope.row.patientRegisterPositiveReports.endDate ||
  180. ''
  181. }
  182. 男性
  183. ${scope.row.patientRegisterPositiveReports.maleCount}
  184. 女性
  185. ${
  186. scope.row.patientRegisterPositiveReports.femaleCount
  187. }
  188. `"
  189. >
  190. <template slot-scope="scopes">
  191. <el-table
  192. :data="scopes.row.patientRegisters"
  193. border
  194. show-summary
  195. :summary-method="summarizeRegisterCounts"
  196. >
  197. <el-table-column
  198. :label="scopes.row.diagnosisName"
  199. >
  200. <el-table-column
  201. label="部门名称"
  202. prop="departmentName"
  203. ></el-table-column>
  204. <el-table-column
  205. label="姓名"
  206. prop="patientName"
  207. ></el-table-column>
  208. <el-table-column
  209. label="性别"
  210. prop="sexName"
  211. ></el-table-column>
  212. <el-table-column prop="age" label="年龄">
  213. </el-table-column>
  214. <el-table-column
  215. prop="patientRegisterNo"
  216. label="条码号"
  217. >
  218. </el-table-column>
  219. <el-table-column
  220. prop="patientNo"
  221. label="档案号"
  222. >
  223. </el-table-column>
  224. <el-table-column
  225. prop="medicalTimes"
  226. label="体检次数"
  227. >
  228. </el-table-column>
  229. <el-table-column prop="telephone" label="电话">
  230. </el-table-column>
  231. <el-table-column
  232. prop="mobileTelephone"
  233. label="手机号"
  234. >
  235. </el-table-column>
  236. </el-table-column>
  237. </el-table>
  238. </template>
  239. </el-table-column>
  240. </el-table-column>
  241. </el-table>
  242. <el-table
  243. :data="scope.row.diseaseCountStatisticsReports.details"
  244. border
  245. :header-cell-class-name="headerStyle"
  246. show-summary
  247. :summary-method="summarizeRegisterCount"
  248. style="margin-top: 15px"
  249. >
  250. <el-table-column label="疾病人数统计">
  251. <el-table-column
  252. :label="`${
  253. scope.row.patientRegisterPositiveReports
  254. .startDate || ''
  255. }
  256. ${
  257. scope.row.patientRegisterPositiveReports.endDate ||
  258. ''
  259. }
  260. 男性
  261. ${scope.row.patientRegisterPositiveReports.maleCount}
  262. 女性
  263. ${
  264. scope.row.patientRegisterPositiveReports.femaleCount
  265. }
  266. `"
  267. >
  268. <el-table-column label="序号" type="index">
  269. </el-table-column>
  270. <el-table-column prop="diagnosisName" label="疾病" />
  271. <el-table-column prop="patientCount" label="人数" />
  272. <el-table-column
  273. prop="percentage"
  274. label="占总检人员百分比"
  275. />
  276. </el-table-column>
  277. </el-table-column>
  278. </el-table>
  279. </template>
  280. </el-table-column>
  281. </el-table-column>
  282. </el-table>
  283. </div>
  284. </div>
  285. <div v-show="format == 1" ref="imageDom1">
  286. <div
  287. style="background-color: #fff; padding: 15px; border-radius: 8px"
  288. >
  289. <el-table
  290. border
  291. :height="
  292. flag
  293. ? window.pageHeight < 600
  294. ? 415
  295. : window.pageHeight - 185 - 25
  296. : ''
  297. "
  298. :data="reducetableData"
  299. id="reducetableData"
  300. ref="reducetableData"
  301. style="width: 100%"
  302. :header-cell-class-name="headerStyle"
  303. >
  304. <el-table-column :label="reducereportTitle">
  305. <el-table-column
  306. :label="`单位: ${customerOrgName || ''} 体检次数 ${
  307. medicalTimes || ''
  308. } 开始月份 ${startMonth || ''} 结束月份 ${
  309. endMonth || ''
  310. }`"
  311. >
  312. <template slot-scope="scope">
  313. <el-table
  314. :data="scope.row.patientRegisterPositiveReports.details"
  315. border
  316. show-summary
  317. :summary-method="summarizeRegisterCounts"
  318. :header-cell-class-name="headerStyle"
  319. >
  320. <el-table-column label="人员阳性结果清单">
  321. <el-table-column
  322. :label="`${
  323. scope.row.patientRegisterPositiveReports
  324. .startDate || ''
  325. }
  326. ${
  327. scope.row.patientRegisterPositiveReports.endDate ||
  328. ''
  329. }
  330. 男性
  331. ${scope.row.patientRegisterPositiveReports.maleCount}
  332. 女性
  333. ${
  334. scope.row.patientRegisterPositiveReports.femaleCount
  335. }
  336. `"
  337. >
  338. <el-table-column
  339. prop="patientNo"
  340. label="档案号"
  341. width="120"
  342. />
  343. <el-table-column
  344. prop="patientName"
  345. label="姓名"
  346. width="120"
  347. />
  348. <el-table-column
  349. prop="sexName"
  350. label="性别"
  351. width="50"
  352. />
  353. <el-table-column prop="age" label="年龄" width="80" />
  354. <el-table-column
  355. prop="medicalTimes"
  356. label="次数"
  357. width="50"
  358. />
  359. <el-table-column
  360. prop="mobileTelephone"
  361. label="手机号码"
  362. width="120"
  363. />
  364. <el-table-column
  365. prop="diagnosisNames"
  366. label="诊断名称"
  367. />
  368. </el-table-column>
  369. </el-table-column>
  370. </el-table>
  371. <el-table
  372. :data="
  373. scope.row.positivePatientRegisterReportReduces.details
  374. "
  375. border
  376. :header-cell-class-name="headerStyle"
  377. show-summary
  378. :summary-method="summarizeRegisterCount"
  379. style="margin-top: 15px"
  380. >
  381. <el-table-column label="阳性结果人员清单">
  382. <el-table-column
  383. :label="`${
  384. scope.row.patientRegisterPositiveReports
  385. .startDate || ''
  386. }
  387. ${
  388. scope.row.patientRegisterPositiveReports.endDate ||
  389. ''
  390. }
  391. 男性
  392. ${scope.row.patientRegisterPositiveReports.maleCount}
  393. 女性
  394. ${
  395. scope.row.patientRegisterPositiveReports.femaleCount
  396. }
  397. `"
  398. >
  399. <el-table-column label="序号" type="index">
  400. </el-table-column>
  401. <el-table-column prop="diagnosisName" label="诊断" />
  402. <el-table-column prop="patientCount" label="人数" />
  403. <el-table-column
  404. prop="percentage"
  405. label="占总检人员百分比"
  406. />
  407. </el-table-column>
  408. </el-table-column>
  409. </el-table>
  410. <el-table
  411. :data="scope.row.diseaseCountStatisticsReports.details"
  412. border
  413. :header-cell-class-name="headerStyle"
  414. show-summary
  415. :summary-method="summarizeRegisterCount"
  416. style="margin-top: 15px"
  417. >
  418. <el-table-column label="疾病人数统计">
  419. <el-table-column
  420. :label="`${
  421. scope.row.patientRegisterPositiveReports
  422. .startDate || ''
  423. }
  424. ${
  425. scope.row.patientRegisterPositiveReports.endDate ||
  426. ''
  427. }
  428. 男性
  429. ${scope.row.patientRegisterPositiveReports.maleCount}
  430. 女性
  431. ${
  432. scope.row.patientRegisterPositiveReports.femaleCount
  433. }
  434. `"
  435. >
  436. <el-table-column label="序号" type="index">
  437. </el-table-column>
  438. <el-table-column prop="diagnosisName" label="疾病" />
  439. <el-table-column prop="patientCount" label="人数" />
  440. <el-table-column
  441. prop="percentage"
  442. label="占总检人员百分比"
  443. />
  444. </el-table-column>
  445. </el-table-column>
  446. </el-table>
  447. </template>
  448. </el-table-column>
  449. </el-table-column>
  450. </el-table>
  451. </div>
  452. </div>
  453. <div v-show="format == 2" ref="imageDom2">
  454. <div
  455. style="background-color: #fff; padding: 15px; border-radius: 8px"
  456. >
  457. <div
  458. :style="
  459. 'display: flex;justify-content: center;align-items: center;height:' +
  460. (window.pageHeight < 600 ? 415 : window.pageHeight - 185 - 25) +
  461. 'px;'
  462. "
  463. >
  464. <div v-show="reportUrl == ''">无数据</div>
  465. <a :href="reportUrl" v-show="reportUrl != ''">
  466. <el-button>下载Word报表</el-button>
  467. </a>
  468. </div>
  469. </div>
  470. </div>
  471. </div>
  472. </div>
  473. <!--通用选单位体检次数分组的控件-->
  474. <el-dialog
  475. title="体检单位选择"
  476. :visible.sync="report.dialogCusOrgOCX"
  477. :close-on-click-modal="false"
  478. width="880px"
  479. height="600px"
  480. >
  481. <CusOrgOCX
  482. :useCustomerOrg="true"
  483. :initDateType="'creationTime'"
  484. :isUnit="true"
  485. />
  486. </el-dialog>
  487. </div>
  488. </template>
  489. <script>
  490. import moment from "moment";
  491. import { mapState, mapActions } from "vuex";
  492. import { getapi, postapi, putapi, deletapi } from "@/api/api";
  493. import {
  494. dddw,
  495. objCopy,
  496. arrayReduce,
  497. arrayExistObj,
  498. tcdate,
  499. } from "@/utlis/proFunc";
  500. import CusOrgOCX from "../../components/report/CusOrgOCX.vue";
  501. import { exportToExcel } from "../../utlis/Export2Excel";
  502. import html2canvas from "html2canvas";
  503. import printJs from "print-js";
  504. export default {
  505. components: {
  506. CusOrgOCX,
  507. },
  508. data() {
  509. return {
  510. format: "0",
  511. flag: true,
  512. tableData: [],
  513. reducetableData: [],
  514. reportTitle: "",
  515. customerOrgName: "",
  516. medicalTimes: null,
  517. startMonth: "",
  518. endMonth: "",
  519. startDate: "",
  520. endDate: "",
  521. sumMedicalNumber: null,
  522. maleMedicalNumber: null,
  523. femaleMedicalNumber: null,
  524. otherMedicalNumber: null,
  525. reducereportTitle: "",
  526. reducecustomerOrgName: "",
  527. reducemedicalTimes: null,
  528. reducestartMonth: "",
  529. reduceendMonth: "",
  530. reducestartDate: "",
  531. reduceendDate: "",
  532. reducesumMedicalNumber: null,
  533. reducemaleMedicalNumber: null,
  534. reducefemaleMedicalNumber: null,
  535. reduceotherMedicalNumber: null,
  536. reportUrl: "",
  537. };
  538. },
  539. created() {
  540. // this.dictInit();
  541. },
  542. //挂载完成
  543. mounted() {
  544. // this.btnQuery();
  545. },
  546. computed: {
  547. ...mapState(["window", "dict", "patientRegister", "report"]),
  548. },
  549. methods: {
  550. btnQuery() {
  551. let body = {},
  552. customerOrgs = [];
  553. if (this.report.dataCusOrgOCX.length > 0) {
  554. this.report.dataCusOrgOCX.forEach((e) => {
  555. let rd = {
  556. startDate: moment(e.startDate).format("yyyy-MM-DD"),
  557. endDate: moment(e.endDate).format("yyyy-MM-DD"),
  558. dateType:
  559. e.dateType == "summaryDate"
  560. ? "3"
  561. : e.dateType == "medicalStartDate"
  562. ? "2"
  563. : "1",
  564. };
  565. if (e.customerOrgId) {
  566. rd.customerOrgId = e.customerOrgId;
  567. if (e.customerOrgId == this.dict.personOrgId) {
  568. rd.customerOrgRegisterId = null;
  569. rd.customerOrgGroupId = [];
  570. } else {
  571. rd.customerOrgRegisterId = e.customerOrgRegister.id;
  572. rd.customerOrgGroupId = e.customerOrgGroupIds;
  573. }
  574. }
  575. customerOrgs.push(rd);
  576. });
  577. }
  578. body.customerOrgs = customerOrgs;
  579. if (this.completeFlag) body.completeFlag = this.completeFlag;
  580. body.isAudit = this.classification;
  581. if (this.format == 0) {
  582. postapi(
  583. "/api/customerreport/getunitphysicalexaminationreportstandard",
  584. body
  585. ).then((res) => {
  586. if (res.code != -1) {
  587. this.tableData = [];
  588. this.tableData.push(res.data);
  589. this.reportTitle = res.data.reportTitle;
  590. this.customerOrgName = res.data.customerOrgName;
  591. this.medicalTimes = res.data.medicalTimes;
  592. this.startMonth = res.data.startMonth;
  593. this.endMonth = res.data.endMonth;
  594. this.startDate = res.data.startDate;
  595. this.endDate = res.data.endDate;
  596. this.sumMedicalNumber = res.data.sumMedicalNumber;
  597. this.maleMedicalNumber = res.data.maleMedicalNumber;
  598. this.femaleMedicalNumber = res.data.femaleMedicalNumber;
  599. this.otherMedicalNumber = res.data.otherMedicalNumber;
  600. }
  601. });
  602. } else if (this.format == 1) {
  603. postapi(
  604. "/api/customerreport/getunitphysicalexaminationreportreduce",
  605. body
  606. ).then((res) => {
  607. if (res.code != -1) {
  608. this.reducetableData = [];
  609. this.reducetableData.push(res.data);
  610. this.reducereportTitle = res.data.reportTitle;
  611. this.reducecustomerOrgName = res.data.customerOrgName;
  612. this.reducemedicalTimes = res.data.medicalTimes;
  613. this.reducestartMonth = res.data.startMonth;
  614. this.reduceendMonth = res.data.endMonth;
  615. this.reducestartDate = res.data.startDate;
  616. this.reduceendDate = res.data.endDate;
  617. this.reducesumMedicalNumber = res.data.sumMedicalNumber;
  618. this.reducemaleMedicalNumber = res.data.maleMedicalNumber;
  619. this.reducefemaleMedicalNumber = res.data.femaleMedicalNumber;
  620. this.reduceotherMedicalNumber = res.data.otherMedicalNumber;
  621. }
  622. });
  623. } else {
  624. postapi(
  625. "/api/customerreport/getunitphysicalexaminationreportexportword",
  626. body
  627. ).then((res) => {
  628. if (res.code != -1) {
  629. const sysConfig = JSON.parse(
  630. window.sessionStorage.getItem("sysConfig")
  631. );
  632. this.reportUrl = sysConfig.apiurl + res.data.reportUrl;
  633. }
  634. });
  635. }
  636. },
  637. summarizeRegisterCounts(param) {
  638. const { columns, data } = param;
  639. const sums = [];
  640. columns.forEach((column, index) => {
  641. if (index === 0) {
  642. sums[index] = "合计";
  643. return;
  644. }
  645. if (index === 1) {
  646. sums[index] = data.length + "人";
  647. return;
  648. }
  649. });
  650. return sums;
  651. },
  652. summarizeRegisterCount(param) {
  653. const { columns, data } = param;
  654. const sums = [];
  655. columns.forEach((column, index) => {
  656. if (index === 0) {
  657. sums[index] = "合计";
  658. return;
  659. }
  660. const values = data.map((item) => Number(item[column.property]));
  661. if (index === 2) {
  662. sums[index] = values.reduce((prev, curr) => {
  663. const value = Number(curr);
  664. if (!isNaN(value)) {
  665. return prev + curr;
  666. } else {
  667. return prev;
  668. }
  669. }, 0);
  670. sums[index] += " 人";
  671. }
  672. });
  673. return sums;
  674. },
  675. headerStyle({ row, column, rowIndex, columnIndex }) {
  676. if (rowIndex === 1) {
  677. return "left-align";
  678. }
  679. },
  680. changeValue(value) {
  681. if (value == 0) {
  682. this.$nextTick(() => {
  683. this.$refs.standardTableData.doLayout();
  684. });
  685. } else if (value == 1) {
  686. this.$nextTick(() => {
  687. this.$refs.reducetableData.doLayout();
  688. });
  689. }
  690. },
  691. handleExport() {
  692. if (this.format == 0) {
  693. let name = "北京神豚软件开发有限公司体检报告";
  694. if (this.reportTitle != "") {
  695. name = this.reportTitle;
  696. }
  697. let index = 3;
  698. let list = [];
  699. list.push(index);
  700. index += this.tableData[0].patientRegisterPositiveReports.details.length + 7;
  701. list.push(index);
  702. for (
  703. let i = 0;
  704. i <
  705. this.tableData[0].positivePatientRegisterReportStandards.details
  706. .length -
  707. 1;
  708. i++
  709. ) {
  710. index +=
  711. this.tableData[0].positivePatientRegisterReportStandards.details[i]
  712. .patientRegisters.length + 4;
  713. list.push(index);
  714. }
  715. exportToExcel("#standardTableData", name, true, list);
  716. } else if (this.format == 1) {
  717. let name = "北京神豚软件开发有限公司体检报告";
  718. if (this.reducereportTitle != "") {
  719. name = this.reducereportTitle;
  720. }
  721. let index = 3;
  722. let list = [];
  723. list.push(index);
  724. exportToExcel("#reducetableData", name, true, list);
  725. }
  726. },
  727. onPrint() {
  728. this.flag = false;
  729. let index = "";
  730. if (this.format == 0) {
  731. index = "imageDom0";
  732. } else if (this.format == 1) {
  733. index = "imageDom1";
  734. } else {
  735. index = "imageDom2";
  736. }
  737. this.$nextTick(() => {
  738. let width = this.$refs[index].style.width;
  739. let cloneDom = this.$refs[index].cloneNode(true);
  740. let imageDom = this.$refs[index];
  741. cloneDom.style.position = "absolute";
  742. cloneDom.style.top = "0px";
  743. cloneDom.style.zIndex = "-1";
  744. cloneDom.style.width = width;
  745. imageDom.appendChild(cloneDom);
  746. html2canvas(cloneDom).then((canvas) => {
  747. // 转成图片,生成图片地址
  748. const url = canvas.toDataURL("image/png");
  749. printJs({
  750. printable: url,
  751. type: "image",
  752. documentTitle: "", // 标题
  753. style: `@media print { @page {size: auto; margin: 0 0 0 0; } body{margin:0 5px}canvas{page-break-after: always;page-break-inside: avoid;
  754. page-break-after: avoid;
  755. page-break-before: avoid;}}`, // 去除页眉页脚
  756. });
  757. });
  758. cloneDom.style.display = "none";
  759. this.flag = true;
  760. });
  761. },
  762. },
  763. };
  764. </script>
  765. <style scoped>
  766. @import "../../assets/css/global_button.css";
  767. @import "../../assets/css/global_dialog.css";
  768. @import "../../assets/css/global_table.css";
  769. @import "../../assets/css/global_form.css";
  770. @import "../../assets/css/global_input.css";
  771. @import "../../assets/css/global.css";
  772. .query {
  773. margin-right: 10px;
  774. display: flex;
  775. justify-content: center;
  776. align-items: center;
  777. font-size: 14px;
  778. color: #232748;
  779. font-size: 400;
  780. font-family: "NotoSansSC-Regular";
  781. }
  782. .box {
  783. display: flex;
  784. flex-direction: column;
  785. }
  786. ::v-deep .el-table__header-wrapper th.backcolor {
  787. background-color: #f5f7fa;
  788. }
  789. :deep .left-align .cell {
  790. text-align: left !important;
  791. }
  792. ::v-deep .el-input__inner {
  793. /*text-align: center;*/
  794. padding-left: 5px;
  795. padding-right: 15px;
  796. }
  797. ::v-deep .el-input__icon {
  798. width: 15px;
  799. /* 输入框下拉箭头或清除图标 默认 25 */
  800. }
  801. ::v-deep .el-input-group__append {
  802. padding: 0 5px;
  803. /* 控件默认 0 20px;*/
  804. }
  805. ::v-deep .el-icon-search:before {
  806. color: #00f;
  807. }
  808. .query:last-child {
  809. margin-right: 0;
  810. }
  811. </style>