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.

735 lines
26 KiB

2 years ago
2 years ago
4 weeks ago
2 years ago
4 weeks ago
2 years ago
4 weeks ago
2 years ago
4 weeks ago
2 years ago
4 weeks ago
2 years ago
4 weeks ago
2 years ago
4 weeks ago
2 years ago
4 weeks ago
2 years ago
4 weeks ago
2 years ago
4 weeks ago
2 years ago
4 weeks ago
2 years ago
4 weeks ago
2 years ago
4 weeks ago
2 years ago
4 weeks ago
2 years ago
4 weeks ago
2 years ago
2 years ago
4 weeks ago
2 years ago
4 weeks ago
2 years ago
4 weeks ago
2 years ago
4 weeks ago
2 years ago
4 weeks ago
2 years ago
4 weeks ago
2 years ago
4 weeks ago
2 years ago
4 weeks ago
2 years ago
4 weeks ago
2 years ago
4 weeks ago
2 years ago
4 weeks ago
2 years ago
4 weeks ago
2 years ago
2 years ago
4 weeks ago
2 years ago
4 weeks ago
2 years ago
4 weeks 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
4 weeks ago
2 years ago
4 weeks ago
2 years ago
2 years ago
2 years ago
4 months ago
2 years ago
2 years ago
4 months ago
2 years ago
4 months ago
2 years ago
2 years ago
2 years ago
2 years ago
4 months ago
2 years ago
4 months ago
2 years ago
2 years ago
2 years ago
2 years ago
4 months ago
2 years ago
4 months ago
2 years ago
2 years ago
2 years ago
4 months ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
4 months ago
2 years ago
2 years ago
2 years ago
4 weeks ago
2 years ago
4 weeks ago
2 years ago
4 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
4 months ago
2 years ago
2 years ago
2 years ago
2 years 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 style="
  12. background-color: #fff;
  13. padding: 15px;
  14. border-radius: 8px;
  15. display: flex;
  16. flex-wrap: wrap;
  17. margin-bottom: 10px;
  18. height: 35px;
  19. margin-top: 7px;
  20. ">
  21. <div class="query">
  22. <span>体检单位</span>
  23. <el-input placeholder="请选择体检单位" v-model="patientRegister.query.cusOrgOCX" style="'width:350px" size="small"
  24. disabled>
  25. <el-button slot="append" icon="el-icon-search" @click="report.dialogCusOrgOCX = true"
  26. style="font-size: 20px"></el-button>
  27. </el-input>
  28. </div>
  29. <div class="query">
  30. <span>组合项目</span>
  31. <el-input placeholder="请选择组合项目" v-model="patientRegister.query.asbitemOCX" style="'width:350px" size="small"
  32. disabled>
  33. <el-button slot="append" icon="el-icon-search" @click="report.dialogAsbitemOCX = true"
  34. style="font-size: 20px"></el-button>
  35. </el-input>
  36. </div>
  37. <div class="query" v-if="!cut">
  38. <span>报表格式</span>
  39. <el-select v-model="registerType" placeholder="请选择" clearable style="width: 80px" size="small">
  40. <el-option label="按分组包含预登记" value="1" />
  41. <el-option label="按分组不包含预登记" value="2" />
  42. <el-option label="按分组实检(只检1项也算全部已检)" value="3" />
  43. </el-select>
  44. </div>
  45. <div class="query" v-if="cut">
  46. <span>报表格式</span>
  47. <el-select v-model="complexregisterType" placeholder="请选择" clearable style="width: 80px" size="small">
  48. <el-option label="按组合包含预登记" value="1" />
  49. <el-option label="按组合不包含预登记" value="2" />
  50. <el-option label="按组合实检" value="3" />
  51. <el-option label="按组合实检(只检1项也算全部已检)" value="4" />
  52. </el-select>
  53. </div>
  54. <div class="query">
  55. <el-checkbox v-model="checkbox" true-label="1" false-label="0" @change="bespeak" />
  56. <span style="margin-left: 5px">显示人员名单</span>
  57. </div>
  58. <div class="query">
  59. <el-checkbox v-model="isPersonalPayment" true-label="Y" false-label="N" />
  60. <span style="margin-left: 5px">包含个人支付和免费赠送</span>
  61. </div>
  62. <div class="query">
  63. <el-button size="small" @click="onSubmit" class="commonbutton">查询</el-button>
  64. </div>
  65. <div class="query">
  66. <!--旧导出方式 handleExportbtnExport('expUnitSettlement') -->
  67. <el-button size="small" class="commonbutton" @click="btnExport('expUnitSettlement')">导出excel</el-button>
  68. </div>
  69. <div class="query">
  70. <el-button size="small" @click="onPrint" class="commonbutton">打印</el-button>
  71. </div>
  72. </div>
  73. <div id="expUnitSettlement">
  74. <div id="expUnitSettlement0" style="background-color: #fff; padding: 15px; border-radius: 8px" ref="imageDom0" v-show="format == 0">
  75. <div>
  76. <el-table border :height="flag
  77. ? window.pageHeight < 600
  78. ? 415
  79. : window.pageHeight - 185 - 25
  80. : ''
  81. " :data="tableData" id="tableData" ref="tableData" style="width: 100%" show-summary
  82. :summary-method="summarizeRegisterCountes">
  83. <el-table-column label="单位结算统计">
  84. <template slot-scope="scope">
  85. <el-table :data="scope.row.groupDetails" border show-summary
  86. :summary-method="summarizeRegisterCount">
  87. <el-table-column label="分组" prop="customerOrgGroupName"></el-table-column>
  88. <el-table-column label="分组价格" prop="customerOrgGroupPrice"></el-table-column>
  89. <el-table-column label="人数" prop="patientCount"></el-table-column>
  90. <el-table-column label="总金额" prop="sumPrice"></el-table-column>
  91. </el-table>
  92. <el-table :data="scope.row.addItems" border show-summary :summary-method="summarizeRegisterCount2">
  93. <el-table-column label="加做项目" prop="asbitemName"></el-table-column>
  94. <el-table-column label="人数" prop="patientCount"></el-table-column>
  95. <el-table-column label="标准价格" prop="standardPrice"></el-table-column>
  96. <el-table-column label="应收价格" prop="price"></el-table-column>
  97. <el-table-column label="标准金额" prop="standardMoney"></el-table-column>
  98. <el-table-column label="应收金额" prop="sumPrice"></el-table-column>
  99. </el-table>
  100. </template>
  101. </el-table-column>
  102. </el-table>
  103. </div>
  104. </div>
  105. <div id="expUnitSettlement1" style="background-color: #fff; padding: 15px; border-radius: 8px" ref="imageDom1" v-show="format == 1">
  106. <div>
  107. <el-table border :height="flag
  108. ? window.pageHeight < 600
  109. ? 415
  110. : window.pageHeight - 185 - 25
  111. : ''
  112. " :data="stafftableData" id="stafftableData" ref="stafftableData" style="width: 100%" show-summary
  113. :summary-method="summarizeRegisterCountes">
  114. <el-table-column label="单位结算统计">
  115. <template slot-scope="scope">
  116. <el-table :data="scope.row.groupDetails" border>
  117. <el-table-column label="分组">
  118. <template slot-scope="scopes">
  119. <el-table :data="scopes.row.patients" border show-summary :summary-method="(params) =>
  120. summarizeRegisterCounts(
  121. params,
  122. scopes.row.sumPrice
  123. )
  124. ">
  125. <el-table-column :label="scopes.row.customerOrgGroupName +
  126. ' 价格:' +
  127. scopes.row.customerOrgGroupPrice
  128. ">
  129. <el-table-column label="姓名" prop="patientName"></el-table-column>
  130. <el-table-column label="条码号" prop="patientRegisterNo"
  131. :formatter="forceStringFormatter"></el-table-column>
  132. <el-table-column label="档案号" prop="patientNo" :formatter="forceStringFormatter">
  133. </el-table-column>
  134. <el-table-column label="性别" prop="sexName"></el-table-column>
  135. <el-table-column label="年龄" prop="age"></el-table-column>
  136. </el-table-column>
  137. </el-table>
  138. </template>
  139. </el-table-column>
  140. </el-table>
  141. <el-table :data="scope.row.addItems" border style="margin-top: 10px">
  142. <el-table-column label="加做项目">
  143. <template slot-scope="scopes">
  144. <el-table :data="scopes.row.patients" border show-summary :summary-method="(params) =>
  145. summarizeRegisterCounts(
  146. params,
  147. scopes.row.sumPrice
  148. )
  149. ">
  150. <el-table-column :label="scopes.row.asbitemName +
  151. ' 价格:' +
  152. scopes.row.price
  153. ">
  154. <el-table-column label="姓名" prop="patientName"></el-table-column>
  155. <el-table-column label="条码号" prop="patientRegisterNo" :formatter="forceStringFormatter"></el-table-column>
  156. <el-table-column label="档案号" prop="patientNo" :formatter="forceStringFormatter"></el-table-column>
  157. <el-table-column label="性别" prop="sexName"></el-table-column>
  158. <el-table-column label="年龄" prop="age"></el-table-column>
  159. </el-table-column>
  160. </el-table>
  161. </template>
  162. </el-table-column>
  163. </el-table>
  164. </template>
  165. </el-table-column>
  166. </el-table>
  167. </div>
  168. </div>
  169. <div id="expUnitSettlement2" style="background-color: #fff; padding: 15px; border-radius: 8px" ref="imageDom2" v-show="format == 2">
  170. <div>
  171. <el-table border :height="flag
  172. ? window.pageHeight < 600
  173. ? 415
  174. : window.pageHeight - 185 - 25
  175. : ''
  176. " :data="projecttableData" id="projecttableData" ref="projecttableData" style="width: 100%"
  177. show-summary :summary-method="projectsummarizeRegisterCount">
  178. <el-table-column label="单位结算统计">
  179. <el-table-column label="项目类别" prop="itmeTypeName"></el-table-column>
  180. <el-table-column label="组合项目" prop="asbitemName"></el-table-column>
  181. <el-table-column label="标准价格" prop="standardPrice"></el-table-column>
  182. <el-table-column label="价格" prop="chargePrice"></el-table-column>
  183. <el-table-column label="人数" prop="patientCount"></el-table-column>
  184. <el-table-column label="标准金额" prop="standardAmount"></el-table-column>
  185. <el-table-column label="折扣" prop="discount"></el-table-column>
  186. <el-table-column label="金额" prop="chargeAmount"></el-table-column>
  187. </el-table-column>
  188. </el-table>
  189. </div>
  190. </div>
  191. <div id="expUnitSettlement3" style="background-color: #fff; padding: 15px; border-radius: 8px" ref="imageDom3" v-show="format == 3">
  192. <div>
  193. <el-table border :height="flag
  194. ? window.pageHeight < 600
  195. ? 415
  196. : window.pageHeight - 185 - 25
  197. : ''
  198. " :data="projectcomplextableData" id="projectcomplextableData" ref="projectcomplextableData"
  199. style="width: 100%" show-summary :summary-method="projectcomplexsummarizeRegisterCountes">
  200. <el-table-column label="单位结算统计">
  201. <template slot-scope="scope">
  202. <el-table :data="scope.row.patients" border show-summary :summary-method="(params) =>
  203. projectcomplexsummarizeRegisterCounts(
  204. params,
  205. scope.row.chargeAmount
  206. )
  207. ">
  208. <el-table-column :label="scope.row.asbitemName +
  209. ' 价格:' +
  210. scope.row.chargePrice
  211. ">
  212. <el-table-column label="姓名" prop="patientName"></el-table-column>
  213. <el-table-column label="条码号" prop="patientRegisterNo" :formatter="forceStringFormatter"></el-table-column>
  214. <el-table-column label="档案号" prop="patientNo" :formatter="forceStringFormatter"></el-table-column>
  215. <el-table-column label="性别" prop="sexName"></el-table-column>
  216. <el-table-column label="年龄" prop="age"></el-table-column>
  217. </el-table-column>
  218. </el-table>
  219. </template>
  220. </el-table-column>
  221. </el-table>
  222. </div>
  223. </div>
  224. </div>
  225. </div>
  226. </div>
  227. <!--通用选单位体检次数分组的控件-->
  228. <el-dialog title="体检单位选择" :visible.sync="report.dialogCusOrgOCX" :close-on-click-modal="false" width="880px"
  229. height="600px">
  230. <CusOrgOCX :initDateType="'creationTime'" :useCustomerOrg="true" />
  231. </el-dialog>
  232. <!--通用选组合项目的控件-->
  233. <el-dialog title="组合项目选择" :visible.sync="report.dialogAsbitemOCX" :close-on-click-modal="false" width="700px"
  234. height="600px">
  235. <AsbitemOCX />
  236. </el-dialog>
  237. </div>
  238. </template>
  239. <script>
  240. import moment from "moment";
  241. import { mapState, mapActions } from "vuex";
  242. import { getapi, postapi, putapi, deletapi } from "@/api/api";
  243. import { exportToExcel } from "../../utlis/Export2Excel";
  244. import FileSaver from 'file-saver';
  245. import html2canvas from "html2canvas";
  246. import printJs from "print-js";
  247. import CusOrgOCX from "../../components/report/CusOrgOCX.vue";
  248. import AsbitemOCX from "../../components/report/AsbitemOCX.vue";
  249. export default {
  250. components: {
  251. CusOrgOCX,
  252. AsbitemOCX,
  253. },
  254. data() {
  255. return {
  256. tableData: [],
  257. flag: true,
  258. format: "0",
  259. registerType: "2",
  260. isPersonalPayment: "N",
  261. stafftableData: [],
  262. cut: false,
  263. checkbox: "0",
  264. projecttableData: [],
  265. projectcomplextableData: [],
  266. complexregisterType: "2",
  267. };
  268. },
  269. created() { },
  270. mounted() {
  271. if (this.report.dataAsbitemOCX.length > 0) {
  272. this.cut = true;
  273. if (this.checkbox == 0) {
  274. this.format = "2";
  275. } else {
  276. this.format = "3";
  277. }
  278. } else {
  279. this.cut = false;
  280. if (this.checkbox == 0) {
  281. this.format = "0";
  282. } else {
  283. this.format = "1";
  284. }
  285. }
  286. },
  287. computed: {
  288. ...mapState(["window", "dict", "patientRegister", "report"]),
  289. },
  290. watch: {
  291. "report.dataAsbitemOCX"(newVal, oldVal) {
  292. if (newVal.length > 0) {
  293. this.cut = true;
  294. if (this.checkbox == 0) {
  295. this.format = "2";
  296. } else {
  297. this.format = "3";
  298. }
  299. } else {
  300. this.cut = false;
  301. if (this.checkbox == 0) {
  302. this.format = "0";
  303. } else {
  304. this.format = "1";
  305. }
  306. }
  307. },
  308. },
  309. methods: {
  310. bespeak(e) {
  311. console.log(e);
  312. if (this.cut) {
  313. if (e == 0) {
  314. this.format = "2";
  315. } else {
  316. this.format = "3";
  317. }
  318. } else {
  319. if (e == 0) {
  320. this.format = "0";
  321. } else {
  322. this.format = "1";
  323. }
  324. }
  325. },
  326. onPrint() {
  327. this.flag = false;
  328. let index = "";
  329. if (this.format == 0) {
  330. index = "imageDom0";
  331. } else if (this.format == 1) {
  332. index = "imageDom1";
  333. } else if (this.format == 2) {
  334. index = "imageDom2";
  335. } else if (this.format == 3) {
  336. index = "imageDom3";
  337. }
  338. this.$nextTick(() => {
  339. let width = this.$refs[index].style.width;
  340. let cloneDom = this.$refs[index].cloneNode(true);
  341. let imageDom = this.$refs[index];
  342. cloneDom.style.position = "absolute";
  343. cloneDom.style.top = "0px";
  344. cloneDom.style.zIndex = "-1";
  345. cloneDom.style.width = width;
  346. console.log(cloneDom);
  347. imageDom.appendChild(cloneDom);
  348. html2canvas(cloneDom).then((canvas) => {
  349. // 转成图片,生成图片地址
  350. const url = canvas.toDataURL("image/png");
  351. printJs({
  352. printable: url,
  353. type: "image",
  354. documentTitle: "", // 标题
  355. style: `@media print { @page {size: auto; margin: 0 0 0 0; } body{margin:0 5px}canvas{page-break-after: always;page-break-inside: avoid;
  356. page-break-after: avoid;
  357. page-break-before: avoid;}}`, // 去除页眉页脚
  358. });
  359. });
  360. cloneDom.style.display = "none";
  361. this.flag = true;
  362. });
  363. },
  364. // 强制将单元格值转换为字符串
  365. forceStringFormatter(row, column, cellValue) {
  366. // 如果 cellValue 存在,则转为字符串;否则返回原值
  367. return cellValue ? "\u200C" + String(cellValue) : cellValue
  368. },
  369. //通用导出
  370. btnExport(elId) {
  371. // 获取HTML元素(表格)
  372. // let table = document.getElementById(elId); //.cloneNode(true)
  373. this.$nextTick(() => {
  374. // let refsTable = this.$refs[elId] //.cloneNode(true) true
  375. let table = document.getElementById(elId + this.format)
  376. // console.log('table,refsTable', table, refsTable)
  377. let tableData = table.innerHTML
  378. let fileName = moment(new Date()).format('yyyyMMDDHHmmss')
  379. let blob = new Blob([tableData], { type: "text/plain;charset=utf-8" });
  380. FileSaver.saveAs(blob, fileName + '.xls');
  381. })
  382. },
  383. onSubmit() {
  384. let body = {},
  385. customerOrgs = [],
  386. asbitemIds = [];
  387. if (this.report.dataCusOrgOCX.length > 0) {
  388. this.report.dataCusOrgOCX.forEach((e) => {
  389. let rd = {
  390. startDate: moment(e.startDate).format("yyyy-MM-DD"),
  391. endDate: moment(e.endDate).format("yyyy-MM-DD"),
  392. dateType:
  393. e.dateType == "summaryDate"
  394. ? "3"
  395. : e.dateType == "medicalStartDate"
  396. ? "2"
  397. : "1",
  398. };
  399. if (e.customerOrgId) {
  400. rd.customerOrgId = e.customerOrgId;
  401. if (e.customerOrgId == this.dict.personOrgId) {
  402. rd.customerOrgRegisterId = null;
  403. rd.customerOrgGroupId = [];
  404. } else {
  405. rd.customerOrgRegisterId = e.customerOrgRegister.id;
  406. rd.customerOrgGroupId = e.customerOrgGroupIds;
  407. }
  408. }
  409. customerOrgs.push(rd);
  410. });
  411. }
  412. if (this.report.dataAsbitemOCX.length > 0) {
  413. this.report.dataAsbitemOCX.forEach((e) => {
  414. asbitemIds.push(e.id);
  415. });
  416. }
  417. body.customerOrgs = customerOrgs;
  418. body.registerType = this.registerType;
  419. if (this.cut) {
  420. body.asbitemIds = asbitemIds;
  421. body.registerType = this.complexregisterType;
  422. }
  423. body.isPersonalPayment = this.isPersonalPayment;
  424. if (this.format == 0) {
  425. postapi(
  426. "/api/customerreport/getcustomerorgfeesettlementingroupreportreduce",
  427. body
  428. ).then((res) => {
  429. if (res.code != -1) {
  430. this.tableData = [];
  431. this.tableData.push(res.data);
  432. }
  433. });
  434. } else if (this.format == 1) {
  435. postapi(
  436. "/api/customerreport/getcustomerorgfeesettlementingroupreportdetail",
  437. body
  438. ).then((res) => {
  439. if (res.code != -1) {
  440. this.stafftableData = [];
  441. this.stafftableData.push(res.data);
  442. }
  443. });
  444. } else if (this.format == 2) {
  445. postapi(
  446. "/api/customerreport/getcustomerorgfeesettlementinasbitemreportreduce",
  447. body
  448. ).then((res) => {
  449. if (res.code != -1) {
  450. this.projecttableData = [];
  451. this.projecttableData = res.data.asbtiems;
  452. }
  453. });
  454. } else if (this.format == 3) {
  455. postapi(
  456. "/api/customerreport/getcustomerorgfeesettlementinasbitemreportdetail",
  457. body
  458. ).then((res) => {
  459. if (res.code != -1) {
  460. this.projectcomplextableData = [];
  461. this.projectcomplextableData = res.data.asbtiems;
  462. }
  463. });
  464. }
  465. },
  466. summarizeRegisterCount(param) {
  467. const { columns, data } = param;
  468. const sums = [];
  469. columns.forEach((column, index) => {
  470. if (index === 0) {
  471. sums[index] = "合计";
  472. return;
  473. }
  474. if (index === 3) {
  475. let sum = 0;
  476. data.forEach((data, index) => {
  477. sum = (Number(sum) + Number(data.sumPrice)).toFixed(2);
  478. });
  479. sums[index] = sum;
  480. return;
  481. }
  482. });
  483. return sums;
  484. },
  485. summarizeRegisterCount2(param) {
  486. const { columns, data } = param;
  487. const sums = [];
  488. columns.forEach((column, index) => {
  489. if (index === 0) {
  490. sums[index] = "合计";
  491. return;
  492. }
  493. if (index == 4) {
  494. let sum = 0;
  495. data.forEach((data, index) => {
  496. sum = (Number(sum) + Number(data.standardMoney)).toFixed(2);
  497. });
  498. sums[index] = sum;
  499. return;
  500. }
  501. if (index === 5) {
  502. let sum = 0;
  503. data.forEach((data, index) => {
  504. sum = (Number(sum) + Number(data.sumPrice)).toFixed(2);
  505. });
  506. sums[index] = sum;
  507. return;
  508. }
  509. });
  510. return sums;
  511. },
  512. summarizeRegisterCounts(param, e) {
  513. const { columns, data } = param;
  514. const sums = [];
  515. columns.forEach((column, index) => {
  516. if (index === 0) {
  517. sums[index] = "共" + data.length + "人";
  518. return;
  519. }
  520. if (index === 3) {
  521. sums[index] = "小计";
  522. return;
  523. }
  524. if (index === 4) {
  525. sums[index] = e;
  526. return;
  527. }
  528. });
  529. return sums;
  530. },
  531. summarizeRegisterCountes(param) {
  532. const { columns, data } = param;
  533. const sums = [];
  534. if (data.length > 0) {
  535. columns.forEach((column, index) => {
  536. if (index === 0) {
  537. let sumPrice = 0;
  538. let groupDetail = data[0].groupDetails;
  539. let addItem = data[0].addItems;
  540. for (let i = 0; i < groupDetail.length; i++) {
  541. sumPrice = (
  542. Number(sumPrice) + Number(groupDetail[i].sumPrice)
  543. ).toFixed(2);
  544. }
  545. for (let i = 0; i < addItem.length; i++) {
  546. sumPrice = (
  547. Number(sumPrice) + Number(addItem[i].sumPrice)
  548. ).toFixed(2);
  549. }
  550. sums[index] = "总计" + sumPrice;
  551. return;
  552. }
  553. });
  554. }
  555. return sums;
  556. },
  557. projectsummarizeRegisterCount(param) {
  558. const { columns, data } = param;
  559. const sums = [];
  560. columns.forEach((column, index) => {
  561. if (index === 0) {
  562. sums[index] = "总计";
  563. return;
  564. }
  565. const values = data.map((item) => Number(item[column.property]));
  566. if (!values.every((value) => isNaN(value))) {
  567. sums[index] = values.reduce((prev, curr) => {
  568. const value = Number(curr);
  569. if (!isNaN(value)) {
  570. return (Number(prev) + Number(curr)).toFixed(2);
  571. } else {
  572. return prev;
  573. }
  574. }, 0);
  575. } else {
  576. sums[index] = "";
  577. }
  578. });
  579. return sums;
  580. },
  581. projectcomplexsummarizeRegisterCounts(param, e) {
  582. const { columns, data } = param;
  583. const sums = [];
  584. columns.forEach((column, index) => {
  585. if (index === 0) {
  586. sums[index] = "共" + data.length + "人";
  587. return;
  588. }
  589. if (index === 3) {
  590. sums[index] = "小计";
  591. return;
  592. }
  593. if (index === 4) {
  594. sums[index] = e + "元";
  595. return;
  596. }
  597. });
  598. return sums;
  599. },
  600. projectcomplexsummarizeRegisterCountes(param) {
  601. const { columns, data } = param;
  602. const sums = [];
  603. columns.forEach((column, index) => {
  604. if (index === 0) {
  605. let sumPrice = 0;
  606. for (let i = 0; i < data.length; i++) {
  607. sumPrice = (
  608. Number(sumPrice) + Number(data[i].chargeAmount)
  609. ).toFixed(2);
  610. }
  611. sums[index] = "总计" + sumPrice;
  612. return;
  613. }
  614. });
  615. return sums;
  616. },
  617. // 旧的导出方式
  618. handleExport() {
  619. if (this.format == 0) {
  620. exportToExcel("#tableData", "单位体检结算", true, [2]);
  621. } else if (this.format == 1) {
  622. let index = 4;
  623. let list = [2, 4];
  624. for (
  625. let i = 0;
  626. i < this.stafftableData[0].groupDetails.length - 1;
  627. i++
  628. ) {
  629. index += this.stafftableData[0].groupDetails[i].patients.length + 3;
  630. list.push(index);
  631. }
  632. index += 4;
  633. list.push(index);
  634. for (let i = 0; i < this.stafftableData[0].addItems.length - 1; i++) {
  635. index += this.stafftableData[0].addItems[i].patients.length + 3;
  636. list.push(index);
  637. }
  638. exportToExcel("#stafftableData", "单位体检结算", true, list);
  639. } else if (this.format == 2) {
  640. exportToExcel("#projecttableData", "单位体检结算", false);
  641. } else if (this.format == 3) {
  642. let index = 2;
  643. let list = [2];
  644. for (let i = 0; i < this.projectcomplextableData.length - 1; i++) {
  645. index += this.projectcomplextableData[i].patients.length + 3;
  646. list.push(index);
  647. }
  648. exportToExcel("#projectcomplextableData", "单位体检结算", true, list);
  649. }
  650. },
  651. },
  652. updated() {
  653. this.$nextTick(() => {
  654. this.$refs.tableData.doLayout();
  655. this.$refs.projecttableData.doLayout();
  656. });
  657. },
  658. };
  659. </script>
  660. <style scoped>
  661. @import "../../assets/css/global_button.css";
  662. @import "../../assets/css/global_card.css";
  663. @import "../../assets/css/global_input.css";
  664. @import "../../assets/css/global_table.css";
  665. @import "../../assets/css/global.css";
  666. .query {
  667. margin-right: 10px;
  668. display: flex;
  669. justify-content: center;
  670. align-items: center;
  671. font-size: 14px;
  672. color: #232748;
  673. font-size: 400;
  674. font-family: "NotoSansSC-Regular";
  675. }
  676. .box {
  677. display: flex;
  678. flex-direction: column;
  679. }
  680. ::v-deep .el-input__inner {
  681. /*text-align: center;*/
  682. padding-left: 5px;
  683. padding-right: 15px;
  684. }
  685. ::v-deep .el-input__icon {
  686. width: 15px;
  687. /* 输入框下拉箭头或清除图标 默认 25 */
  688. }
  689. ::v-deep .el-input-group__append {
  690. padding: 0 5px;
  691. /* 控件默认 0 20px;*/
  692. }
  693. ::v-deep .el-icon-search:before {
  694. color: #00f;
  695. }
  696. ::v-deep .el-input-group {
  697. width: 75%;
  698. }
  699. .query:last-child {
  700. margin-right: 0;
  701. }
  702. </style>