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.

546 lines
16 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
1 year 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
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
1 year 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
2 years ago
2 years 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 style="position: relative;">
  4. <div class="middlebox">
  5. <div class="contenttitle">
  6. 客户报表 /
  7. <span class="contenttitleBold"
  8. >组合项目具体结果明细统计</span
  9. >
  10. </div>
  11. </div>
  12. <div :style="'display: block;'">
  13. <div style="background-color: #fff; padding: 15px; border-radius: 8px;display: flex;flex-wrap: wrap; margin-bottom: 10px;height:35px;margin-top: 7px;">
  14. <div class="query">
  15. <span>体检单位</span>
  16. <el-input
  17. placeholder="请选择体检单位"
  18. v-model="patientRegister.query.cusOrgOCX"
  19. style="width: 240px"
  20. size="small"
  21. disabled
  22. >
  23. <el-button
  24. slot="append"
  25. icon="el-icon-search"
  26. @click="report.dialogCusOrgOCX = true"
  27. style="font-size: 20px"
  28. ></el-button>
  29. </el-input>
  30. </div>
  31. <div class="query">
  32. <span>组合项目</span>
  33. <el-input
  34. placeholder="请选择组合项目"
  35. v-model="patientRegister.query.asbitemOCX"
  36. style="width: 240px"
  37. size="small"
  38. disabled
  39. >
  40. <el-button
  41. slot="append"
  42. icon="el-icon-search"
  43. @click="report.dialogAsbitemOCX = true"
  44. style="font-size: 20px"
  45. ></el-button>
  46. </el-input>
  47. </div>
  48. <div class="query">
  49. <span>检查状态</span>
  50. <el-select
  51. v-model="patientRegister.query.checkCompleteFlag"
  52. placeholder="请选择"
  53. clearable
  54. style="width: 80px"
  55. size="small"
  56. >
  57. <el-option
  58. v-for="item in dict.checkCompleteFlag"
  59. :key="item.id"
  60. :label="item.displayName"
  61. :value="item.id"
  62. >
  63. </el-option>
  64. </el-select>
  65. </div>
  66. <div class="query">
  67. <el-button @click="btnQuery" size="small" class="commonbutton">查询</el-button>
  68. </div>
  69. <div class="query">
  70. <el-button @click="handleExport" size="small" class="commonbutton">导出excel</el-button>
  71. </div>
  72. <div class="query">
  73. <el-button @click="onPrint" size="small" class="commonbutton">打印</el-button>
  74. </div>
  75. </div>
  76. <div style="background-color: #fff; padding: 15px; border-radius: 8px;">
  77. <div ref="imageDom">
  78. <el-table
  79. :data="dataList"
  80. border
  81. style="width: 100%"
  82. :height="flag
  83. ?window.pageHeight < 600 ? 415 : window.pageHeight - 185-20:''"
  84. row-key="id"
  85. highlight-current-row
  86. ref="dataList"
  87. :row-class-name="tableRowClassName"
  88. id="table"
  89. show-summary
  90. :summary-method="summarizeRegisterCount"
  91. :cell-style="tableRowClassNames"
  92. :header-cell-class-name="addClass"
  93. >
  94. <el-table-column prop="patientName" label="姓名"></el-table-column>
  95. <el-table-column prop="sexName" label="性别"></el-table-column>
  96. <el-table-column prop="age" label="年龄"></el-table-column>
  97. <el-table-column
  98. prop="medicalTimes"
  99. label="体检次数"
  100. ></el-table-column>
  101. <el-table-column
  102. v-for="(item, index) in columnData"
  103. :key="index"
  104. :prop="item.prop"
  105. :label="item.lable"
  106. align="left"
  107. >
  108. </el-table-column>
  109. </el-table>
  110. </div>
  111. </div>
  112. </div>
  113. </div>
  114. <!--通用选单位体检次数分组的控件-->
  115. <el-dialog
  116. title="体检单位选择"
  117. :visible.sync="report.dialogCusOrgOCX"
  118. :close-on-click-modal="false"
  119. width="880px"
  120. height="600px"
  121. >
  122. <CusOrgOCX :initDateType="'creationTime'" :useCustomerOrg="true" />
  123. </el-dialog>
  124. <!--通用选组合项目的控件-->
  125. <el-dialog
  126. title="组合项目选择"
  127. :visible.sync="report.dialogAsbitemOCX"
  128. :close-on-click-modal="false"
  129. width="700px"
  130. height="600px"
  131. >
  132. <AsbitemOCX />
  133. </el-dialog>
  134. </div>
  135. </template>
  136. <script>
  137. import moment from "moment";
  138. import { mapState, mapActions } from "vuex";
  139. import { getapi, postapi, putapi, deletapi } from "@/api/api";
  140. import {
  141. dddw,
  142. objCopy,
  143. arrayReduce,
  144. arrayExistObj,
  145. tcdate,
  146. } from "@/utlis/proFunc";
  147. import CusOrgOCX from "../../components/report/CusOrgOCX.vue";
  148. import AsbitemOCX from "../../components/report/AsbitemOCX.vue";
  149. import { exportToExcel } from "../../utlis/Export2Excel";
  150. import html2canvas from "html2canvas";
  151. import printJs from "print-js";
  152. export default {
  153. components: {
  154. CusOrgOCX,
  155. AsbitemOCX,
  156. },
  157. data() {
  158. return {
  159. dataList: [], //列表数据
  160. columnData: [],
  161. flag: true,
  162. category: [],
  163. };
  164. },
  165. created() {
  166. this.dictInit();
  167. },
  168. //挂载完成
  169. mounted() {
  170. // this.btnQuery();
  171. },
  172. computed: {
  173. ...mapState(["window", "dict", "patientRegister", "report"]),
  174. },
  175. methods: {
  176. moment,
  177. dddw,
  178. //数据初始化
  179. dictInit() {
  180. //性别
  181. // getapi("/api/app/sex").then((res) => {
  182. // if (res.code == 1) {
  183. // this.dict.sex = res.data;
  184. // }
  185. // });
  186. //体检中心
  187. getapi("/api/app/organization-units/organization-unit-by-is-peis").then(
  188. (res) => {
  189. if (res.code == 1) {
  190. this.dict.organization = res.data;
  191. }
  192. }
  193. );
  194. //体检单位树
  195. getapi("/api/app/customerorg/getbycodeall").then((res) => {
  196. if (res.code == 1) {
  197. this.patientRegister.customerOrgTreeAll = res.data;
  198. tcdate(this.patientRegister.customerOrgTreeAll);
  199. }
  200. });
  201. // //体检类别
  202. getapi("/api/app/medical-type/in-filter").then((res) => {
  203. if (res.code == 1) {
  204. this.dict.medicalType = res.data;
  205. }
  206. });
  207. // //人员类别
  208. // getapi("/api/app/personnel-type/in-filter").then((res) => {
  209. // if (res.code == 1) {
  210. // this.dict.personnelType = res.data.items;
  211. // }
  212. // });
  213. // //婚姻状况
  214. // getapi("/api/app/marital-statuses").then((res) => {
  215. // if (res.code == 1) {
  216. // this.dict.maritalStatus = res.data.items;
  217. // }
  218. // });
  219. // //性激素期
  220. // getapi("/api/app/sex-hormone-term/in-filter").then((res) => {
  221. // if (res.code == 1) {
  222. // this.dict.sexHormoneTerm = res.data.items;
  223. // }
  224. // });
  225. // //民族
  226. // getapi("/api/app/nation/in-filter").then((res) => {
  227. // if (res.code == 1) {
  228. // this.dict.nation = res.data.items;
  229. // }
  230. // });
  231. // //籍惯 ,出生地
  232. // getapi("/api/app/birth-place/in-filter").then((res) => {
  233. // if (res.code == 1) {
  234. // this.dict.birthPlace = res.data.items;
  235. // }
  236. // });
  237. // //套餐
  238. // postapi("/api/app/medicalpackage/GetBasicList", {}).then(
  239. // (res) => {
  240. // if (res.code == 1) {
  241. // this.dict.medicalPackage = res.data;
  242. // }
  243. // }
  244. // );
  245. // //分组,所有分组,不限单位,不限次数
  246. // getapi("/api/app/customer-org-group").then((res) => {
  247. // if (res.code == 1) {
  248. // this.dict.customerOrgGroupAll = res.data.items;
  249. // }
  250. // });
  251. // //支付方式
  252. // getapi("/api/app/pay-mode").then((res) => {
  253. // if (res.code == 1) {
  254. // this.dict.payMode = res.data;
  255. // }
  256. // });
  257. // //体检类别 树结构
  258. getapi("/api/app/item-type/by-code-all").then((res) => {
  259. if (res.code == 1) {
  260. this.dict.itemTypeTree = res.data;
  261. tcdate(this.dict.itemTypeTree);
  262. }
  263. });
  264. // postapi("/api/app/asbitem/getasbitemlist", {}).then((res) => {
  265. // if (res.code == 1) {
  266. // this.dict.asbItemAll = res.data;
  267. // }
  268. // });
  269. },
  270. tableRowClassName({ row, rowIndex }) {
  271. switch (row.completeFlag) {
  272. case "0":
  273. return "danger";
  274. case "2":
  275. return "info";
  276. default:
  277. return "";
  278. }
  279. },
  280. onPrint() {
  281. this.flag = false;
  282. this.$nextTick(() => {
  283. let width =this.$refs.imageDom.style.width;
  284. let cloneDom = this.$refs.imageDom.cloneNode(true);
  285. let imageDom = this.$refs.imageDom;
  286. cloneDom.style.position = "absolute";
  287. cloneDom.style.top = "0px";
  288. cloneDom.style.zIndex = "-1";
  289. cloneDom.style.width = width;
  290. imageDom.appendChild(cloneDom);
  291. html2canvas(cloneDom).then((canvas) => {
  292. // 转成图片,生成图片地址
  293. const url = canvas.toDataURL("image/png");
  294. printJs({
  295. printable: url,
  296. type: "image",
  297. documentTitle: "", // 标题
  298. style: `@media print { @page {size: auto; margin: 0 0 0 0; } body{margin:0 5px}canvas{page-break-after: always;page-break-inside: avoid;
  299. page-break-after: avoid;
  300. page-break-before: avoid;}}`, // 去除页眉页脚
  301. });
  302. });
  303. cloneDom.style.display = "none";
  304. this.flag = true;
  305. });
  306. },
  307. handleExport() {
  308. exportToExcel("#table", "组合项目结果明细", false);
  309. },
  310. tableRowClassNames({ row, column, rowIndex, columnIndex }) {
  311. if(column.label.length>2){
  312. let columnLabel= column.label.slice(-2)
  313. if(columnLabel=="小结"){
  314. return { backgroundColor: "#F5F7FA" };
  315. }
  316. }
  317. },
  318. addClass({ row, column, rowIndex, columnIndex }){
  319. if(column.label.length>2){
  320. let columnLabel= column.label.slice(-2)
  321. if(columnLabel=="小结"){
  322. return "backcolor";
  323. }
  324. }
  325. },
  326. summarizeRegisterCount(param) {
  327. const { columns, data } = param;
  328. const sums = [];
  329. columns.forEach((column, index) => {
  330. if (index === 0) {
  331. sums[index] = "合计";
  332. return;
  333. }
  334. if (index === 1) {
  335. sums[index] = "共" + data.length + "人";
  336. } else {
  337. sums[index] = "";
  338. }
  339. });
  340. return sums;
  341. },
  342. //查询
  343. btnQuery() {
  344. let body = {},
  345. customerOrgs = [],
  346. asbitemIds = [];
  347. if (this.report.dataCusOrgOCX.length > 0) {
  348. this.report.dataCusOrgOCX.forEach((e) => {
  349. let rd = {
  350. startDate: moment(e.startDate).format("yyyy-MM-DD"),
  351. endDate: moment(e.endDate).format("yyyy-MM-DD"),
  352. dateType:
  353. e.dateType == "summaryDate"
  354. ? "3"
  355. : e.dateType == "medicalStartDate"
  356. ? "2"
  357. : "1",
  358. };
  359. if (e.customerOrgId) {
  360. rd.customerOrgId = e.customerOrgId;
  361. if (e.customerOrgId == this.dict.personOrgId) {
  362. rd.customerOrgRegisterId = null;
  363. rd.customerOrgGroupId = [];
  364. } else {
  365. rd.customerOrgRegisterId = e.customerOrgRegister.id;
  366. rd.customerOrgGroupId = e.customerOrgGroupIds;
  367. }
  368. }
  369. customerOrgs.push(rd);
  370. });
  371. }
  372. if (this.report.dataAsbitemOCX.length > 0) {
  373. this.report.dataAsbitemOCX.forEach((e) => {
  374. asbitemIds.push(e.id);
  375. });
  376. }
  377. body.customerOrgs = customerOrgs;
  378. body.asbitemId = asbitemIds;
  379. if (this.patientRegister.query.checkCompleteFlag)
  380. body.completeFlag = this.patientRegister.query.checkCompleteFlag;
  381. //console.log('/api/app/peisreport/getpatientregisterreport',body)
  382. postapi("/api/customerreport/getasbitemspecificresultreport", body).then(
  383. (res) => {
  384. if (res.code != -1) {
  385. let bodys = res.data;
  386. let that = this;
  387. let template = {
  388. prop: "",
  389. lable: "",
  390. };
  391. that.columnData = [];
  392. that.category = [];
  393. for (let i = 0; i < bodys.length; i++) {
  394. for (let k = 0; k < bodys[i].registerChecks.length; k++) {
  395. that.category.push(bodys[i].registerChecks[k].checkName);
  396. }
  397. }
  398. that.category = Array.from(new Set(that.category));
  399. for (let m = 0; m < that.category.length; m++) {
  400. for (let i = 0; i < bodys.length; i++) {
  401. for (let k = 0; k < bodys[i].registerChecks.length; k++) {
  402. this.$set(
  403. bodys[i],
  404. // bodys[i].registerChecks[k].registerCheckId +
  405. bodys[i].registerChecks[k].checkName +
  406. "小结",
  407. bodys[i].registerChecks[k].registerCheckSummarys
  408. );
  409. if (bodys[i].registerChecks[k].checkName == that.category[m]) {
  410. for (let j = 0;j < bodys[i].registerChecks[k].registerCheckItems.length;j++) {
  411. let templatess = JSON.parse(JSON.stringify(template));
  412. templatess.prop =
  413. // bodys[i].registerChecks[k].registerCheckId +
  414. bodys[i].registerChecks[k].checkName +
  415. bodys[i].registerChecks[k].registerCheckItems[j]
  416. .itemName;
  417. templatess.lable =
  418. // bodys[i].registerChecks[k].checkName +
  419. // "/" +
  420. bodys[i].registerChecks[k].registerCheckItems[j]
  421. .itemName;
  422. that.columnData.push(templatess);
  423. this.$set(
  424. bodys[i],
  425. // bodys[i].registerChecks[k].registerCheckId +
  426. bodys[i].registerChecks[k].checkName +
  427. bodys[i].registerChecks[k].registerCheckItems[j]
  428. .itemName,
  429. bodys[i].registerChecks[k].registerCheckItems[j].result
  430. )
  431. }
  432. }
  433. }
  434. }
  435. let templates = JSON.parse(JSON.stringify(template));
  436. templates.prop =that.category[m] +"小结";
  437. templates.lable = that.category[m] + "小结";
  438. that.columnData.push(templates);
  439. }
  440. this.$nextTick(() => {
  441. this.$refs.dataList.doLayout();
  442. });
  443. let map = new Map();
  444. let qc = this.columnData.filter(
  445. (key) => !map.has(key.prop) && map.set(key.prop, 1)
  446. );
  447. // qc.sort(function (a, b) {
  448. // return a.lable < b.lable ? -1 : 1; //根据名称属性进行排序
  449. // })
  450. this.columnData = qc;
  451. this.dataList = bodys;
  452. }
  453. }
  454. );
  455. },
  456. },
  457. //监听事件
  458. watch: {
  459. //触发查询事件
  460. // "patientRegister.query.times"(newVal, oldVal) {
  461. // if (newVal != oldVal) {
  462. // //alert('触发查询事件')
  463. // this.query();
  464. // }
  465. // },
  466. },
  467. };
  468. </script>
  469. <style scoped>
  470. @import "../../assets/css/global_button.css";
  471. @import "../../assets/css/global_dialog.css";
  472. @import "../../assets/css/global_table.css";
  473. @import "../../assets/css/global_form.css";
  474. @import "../../assets/css/global_input.css";
  475. @import "../../assets/css/global.css";
  476. .query{
  477. margin-right: 10px;
  478. display: flex;
  479. justify-content: center;
  480. align-items: center;
  481. font-size: 14px;
  482. color: #232748;
  483. font-size: 400;
  484. font-family: "NotoSansSC-Regular";
  485. }
  486. .box {
  487. display: flex;
  488. flex-direction: column;
  489. }
  490. ::v-deep .el-table__header-wrapper th.backcolor {
  491. background-color: #F5F7FA;
  492. }
  493. ::v-deep .el-input__inner {
  494. /*text-align: center;*/
  495. padding-left: 5px;
  496. padding-right: 15px;
  497. }
  498. ::v-deep .el-input__icon {
  499. width: 15px;
  500. /* 输入框下拉箭头或清除图标 默认 25 */
  501. }
  502. ::v-deep .el-input-group__append {
  503. padding: 0 5px;
  504. /* 控件默认 0 20px;*/
  505. }
  506. ::v-deep .el-icon-search:before {
  507. color: #00F;
  508. }
  509. .query:last-child{
  510. margin-right: 0;
  511. }
  512. </style>