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.

913 lines
32 KiB

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
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
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. <template>
  2. <div>
  3. <!--组件主体-->
  4. <div style="display: flex">
  5. <div :style="'width:' + (window.pageWidth - 200 - 145) + 'px;'">
  6. <div>
  7. <el-table @body-scrolling="load" :data="tableData" border highlight-current-row
  8. :height="window.pageHeight < 600 ? 238 : Math.floor((window.pageHeight - 243) * 2 / 3)" @row-click="rowClick"
  9. size="small" row-key="id" @selection-change="handleSelectionChange" ref="info" id="info"
  10. :row-class-name="handleRowClassName">
  11. <!-- 取消勾选改为选中
  12. <el-table-column type="selection" width="40" show-overflow-tooltip/>
  13. :height="window.pageHeight < 600 ? 202 : Math.floor(((window.pageHeight - 302) * 2) / 3)"
  14. -->
  15. <el-table-column v-for="(item, index) in headerCols" :key="`col_${index}`"
  16. :min-width="dropCol[index].minWidth" :align="dropCol[index].align" :label="item.label"
  17. :prop="dropCol[index].prop" :sortable="dropCol[index].prop == 'sn' ? false : true">
  18. <template slot-scope="scope">
  19. <div v-if="dropCol[index].prop == 'sn'">
  20. {{ scope.$index + 1 }}
  21. </div>
  22. <div v-else-if="dropCol[index].prop == 'completeFlag'">
  23. {{ dddw(dict.completeFlag, "id", scope.row.completeFlag, "displayName") }}
  24. </div>
  25. <div v-else-if="dropCol[index].prop == 'guidePrintTimes'">
  26. <i class="el-icon-printer" v-if="scope.row.guidePrintTimes > 0" style="font-size: 20px; color: green" />
  27. </div>
  28. <div v-else-if="dropCol[index].prop == 'isLock'
  29. || dropCol[index].prop == 'isVip'
  30. || dropCol[index].prop == 'isUpload'
  31. ">
  32. {{ scope.row[dropCol[index].prop] == "Y" ? "是" : "否" }}
  33. </div>
  34. <div v-else-if="dropCol[index].prop == 'customerOrgParentName'">
  35. {{ scope.row.customerOrgParentName
  36. ? scope.row.customerOrgParentName
  37. : scope.row.customerOrgName }}
  38. </div>
  39. <div v-else-if="dropCol[index].prop == 'sexId'">
  40. {{ dddw(dict.sex, "id", scope.row[dropCol[index].prop], "displayName") }}
  41. </div>
  42. <div v-else-if="dropCol[index].prop == 'groupPack'">
  43. <div
  44. v-if="scope.row.medicalPackageId !== dict.personOrgId && scope.row.customerOrgId === dict.personOrgId">
  45. {{ dddw(dict.medicalPackage, "id", scope.row.medicalPackageId, "displayName") }}
  46. </div>
  47. <div
  48. v-if="scope.row.medicalPackageId !== dict.personOrgId && scope.row.customerOrgId !== dict.personOrgId">
  49. {{ dddw(dict.customerOrgGroupAll, "id", scope.row.customerOrgGroupId, "displayName") }}
  50. </div>
  51. </div>
  52. <div v-else-if="dropCol[index].prop == 'nationId'">
  53. {{ dddw(dict.nation, "id", scope.row[dropCol[index].prop], "displayName") }}
  54. </div>
  55. <div v-else-if="dropCol[index].prop == 'birthDate'
  56. || dropCol[index].prop == 'creationTime'">
  57. {{ scope.row[dropCol[index].prop] ? moment(scope.row[dropCol[index].prop]).format('yyyy-MM-DD') : '' }}
  58. </div>
  59. <div v-else-if="dropCol[index].prop == 'maritalStatusId'">
  60. {{ dddw(dict.maritalStatus, "id", scope.row[dropCol[index].prop], "displayName") }}
  61. </div>
  62. <div v-else-if="dropCol[index].prop == 'medicalTypeId'">
  63. {{ dddw(dict.medicalType, "id", scope.row[dropCol[index].prop], "displayName") }}
  64. </div>
  65. <div v-else-if="dropCol[index].prop == 'personnelTypeId'">
  66. {{ dddw(dict.personnelType, "id", scope.row[dropCol[index].prop], "displayName") }}
  67. </div>
  68. <div v-else>
  69. {{ scope.row[dropCol[index].prop] }}
  70. </div>
  71. </template>
  72. </el-table-column>
  73. <!--
  74. "sexHormoneTermId": "00000000-0000-0000-0000-000000000000",
  75. "interposeMeasure": null,
  76. "medicalConclusionId": "00000000-0000-0000-0000-000000000000",
  77. "reportPrintTimes": 0,
  78. "isMedicalStart": "N",
  79. "medicalStartDate": "6/28/2023",
  80. "isRecoverGuide": "N",
  81. "summaryDate": "",
  82. "summaryDoctor": null,
  83. "isAudit": "N",
  84. "auditDoctor": null,
  85. "auditDate": "",
  86. "isNameHide": "N",
  87. "isPhoneFollow": "N",
  88. "thirdInfo": null,
  89. "guidePrintTimes": null,
  90. "remark": null,
  91. "medicalCenterId": "00000000-0000-0000-0000-000000000000",
  92. "customerOrgRegisterId": "00000000-0000-0000-0000-000000000000",
  93. "lastModifierName": "",
  94. "lastModificationTime": null,
  95. "lastModifierId": null,
  96. "creatorId": null,
  97. "id": "3a0c196d-a6d0-37fe-5c32-4806bdc4530f"
  98. -->
  99. </el-table>
  100. <div style="display: flex;justify-content:space-between;">
  101. <div></div>
  102. <div>
  103. <span style="font-size:12px;">{{ loadOpts.totalCount }} 条记录当前显示{{ tableData.length }}
  104. </span>
  105. </div>
  106. </div>
  107. </div>
  108. <!-- 给合项目 基本信息 -->
  109. <el-tabs v-model="tabChoosed" style="margin-top: -22px;">
  110. <!-- 给合项目 -->
  111. <el-tab-pane label="预览" name="1">
  112. <embed :src="lisLabel" type="application/pdf" width="100%" style="margin-top: -56px;"
  113. :height="(window.pageHeight < 600 ? 119 : Math.floor((window.pageHeight - 243) / 3)) + 56" />
  114. </el-tab-pane>
  115. </el-tabs>
  116. </div>
  117. <div style="margin-left: 5px;">
  118. <div v-show="checkPagePriv(pagePriv.privs, '全选')" class="listBtn">
  119. <el-button type="success" class="commonbutton" @click="btnChooseAll(1)">全选</el-button>
  120. </div>
  121. <div v-show="checkPagePriv(pagePriv.privs, '取消全选')" class="listBtn">
  122. <el-button type="success" class="commonbutton" @click="btnChooseAll(0)">取消全选</el-button>
  123. </div>
  124. <div v-show="checkPagePriv(pagePriv.privs, '预览设置')" class="listBtn">
  125. <el-button type="primary" class="commonbutton" @click="btnPrintPre">预览设置</el-button>
  126. </div>
  127. <div v-show="checkPagePriv(pagePriv.privs, '打印')" class="listBtn">
  128. <el-button type="danger" class="commonbutton" @click="btnPrint">打印</el-button>
  129. </div>
  130. <div v-show="checkPagePriv(pagePriv.privs, '发送申请')" class="listBtn">
  131. <el-button type="" class="commonbutton" @click="btnSendLis">发送申请</el-button>
  132. </div>
  133. <div v-show="checkPagePriv(pagePriv.privs, '撤消申请')" class="listBtn">
  134. <el-button type="" class="commonbutton" @click="btnUndoLis">撤消申请</el-button>
  135. </div>
  136. <div style="margin-top: 5px;">
  137. <el-image style="width: 110px; height: 115px;" :src="peoplePhoto">
  138. <div slot="placeholder" class="image-slot">
  139. 加载中<span class="dot">...</span>
  140. </div>
  141. </el-image>
  142. </div>
  143. </div>
  144. </div>
  145. <!--组件弹窗-->
  146. <div>
  147. <!-- 通用进度条 -->
  148. <el-dialog title="数据处理中……" :visible.sync="elProgress.display" width="600px" height="400" :show-close="false"
  149. :close-on-click-modal="false" :append-to-body="true">
  150. <ElProgressOCX />
  151. </el-dialog>
  152. </div>
  153. </div>
  154. </template>
  155. <script>
  156. import moment from "moment";
  157. import { mapState, mapActions } from "vuex";
  158. import { getapi, postapi, putapi, deletapi } from "@/api/api";
  159. import { photoParse } from "../../utlis/proFunc"
  160. import Sortable from "sortablejs";
  161. import FileSaver from 'file-saver';
  162. import html2canvas from 'html2canvas';
  163. import {
  164. getPagePriv, checkPagePriv,
  165. dddw,
  166. objCopy,
  167. arrayReduce,
  168. arrayExistObj,
  169. deepCopy,
  170. } from "../../utlis/proFunc";
  171. import ElProgressOCX from "../../components/report/ElProgressOCX.vue";
  172. export default {
  173. components: {
  174. ElProgressOCX,
  175. },
  176. data() {
  177. return {
  178. pagePriv: {
  179. routeUrlorPageName: 'patientLis', //当前页面归属路由或归属页面权限名称
  180. privs: [] // 页面权限
  181. },
  182. peisid: null,
  183. startPoint: -1, // 多选起点 -1 表示选择
  184. endPoint: -1, // 多选终点 -1 表示未选择
  185. tableData: [], //表格数据
  186. tableDataCurrentRow: {}, // 当前被选中的行
  187. multipleSelection: [], //选中的数据列表
  188. tabChoosed: "1",
  189. rClickRow: null, //右击的行
  190. rClickColumn: null, //右击的列(预留)
  191. //动态列
  192. headerCols: [],
  193. //拖动列
  194. dropCol: [
  195. { label: "序号", prop: "sn", minWidth: 40, align: "center" },
  196. { label: "体检进度", prop: "completeFlag", minWidth: 80, align: "center" },
  197. { label: "打印", prop: "guidePrintTimes", minWidth: 55, align: "center" },
  198. { label: "锁住", prop: "isLock", minWidth: 55, align: "center" },
  199. { label: "单位", prop: "customerOrgParentName", minWidth: 180, align: "center" },
  200. { label: "部门", prop: "customerOrgName", minWidth: 120, align: "center" },
  201. { label: "姓名", prop: "patientName", minWidth: 80, align: "center" },
  202. { label: "性别", prop: "sexId", minWidth: 55, align: "center" },
  203. { label: "年龄", prop: "age", minWidth: 55, align: "center" },
  204. { label: "颜色", prop: "lisrequest", minWidth: 120, align: "center" },
  205. { label: "容器", prop: "lisrequest", minWidth: 120, align: "center" },
  206. { label: "项目分组", prop: "lisrequest", minWidth: 120, align: "center" },
  207. { label: "申请项目", prop: "lisrequest", minWidth: 120, align: "center" },
  208. { label: "检验码号", prop: "lisrequest", minWidth: 120, align: "center" },
  209. { label: "人员条码号", prop: "patientRegisterNo", minWidth: 150, align: "center" },
  210. { label: "档案号", prop: "patientNo", minWidth: 100, align: "center" },
  211. { label: "体检次数", prop: "medicalTimes", minWidth: 80, align: "center" },
  212. { label: "分组/套餐", prop: "groupPack", minWidth: 150, align: "center" },
  213. { label: "民族", prop: "nationId", minWidth: 55, align: "center" },
  214. { label: "身份证", prop: "idNo", minWidth: 150, align: "center" },
  215. { label: "出生日期", prop: "birthDate", minWidth: 80, align: "center" },
  216. { label: "邮箱", prop: "email", minWidth: 150, align: "center" },
  217. { label: "手机", prop: "mobileTelephone", minWidth: 100, align: "center" },
  218. { label: "电话", prop: "telephone", minWidth: 100, align: "center" },
  219. { label: "地址", prop: "address", minWidth: 300, align: "" },
  220. { label: "体检卡号", prop: "medicalCardNo", minWidth: 80, align: "center" },
  221. { label: "工卡号", prop: "jobCardNo", minWidth: 80, align: "center" },
  222. { label: "婚姻状况", prop: "maritalStatusId", minWidth: 80, align: "center" },
  223. { label: "体检类别", prop: "medicalTypeId", minWidth: 80, align: "center" },
  224. { label: "人员类别", prop: "personnelTypeId", minWidth: 80, align: "center" },
  225. { label: "职务", prop: "jobPost", minWidth: 80, align: "center" },
  226. { label: "职称", prop: "jobTitle", minWidth: 80, align: "center" },
  227. { label: "介绍人", prop: "salesman", minWidth: 80, align: "center" },
  228. { label: "是否VIP", prop: "isVip", minWidth: 80, align: "center" },
  229. { label: "登记人", prop: "creatorName", minWidth: 80, align: "center" },
  230. { label: "登记日期", prop: "creationTime", minWidth: 80, align: "center" },
  231. { label: "是否上传", prop: "isUpload", minWidth: 80, align: "center" },
  232. ],
  233. dom: null, //用于滚动加载数据
  234. lazyLoading: false, //是否懒加载中
  235. loadOpts: {
  236. totalCount: 0,
  237. skipCount: 0,
  238. maxResultCount: 100,
  239. },
  240. loadOptsInit: {},
  241. oneClick: 0, // 1 表示行单击一次
  242. DbClick: 0, // 1 表示行有单击第二次
  243. printPre: 0,
  244. lisLabel: '', // data:application/pdf;base64,
  245. };
  246. },
  247. created() {
  248. //获取用户当前页面的权限
  249. let userPriv = window.sessionStorage.getItem('userPriv')
  250. if (userPriv) this.pagePriv.privs = deepCopy(getPagePriv(this.pagePriv.routeUrlorPageName))
  251. this.loadOptsInit = Object.assign({}, this.loadOpts)
  252. },
  253. //挂载完成
  254. mounted() {
  255. // 初始化可以拖动的列
  256. this.headerCols = deepCopy(this.dropCol)
  257. this.dropCol = this.columnDrop(this.dropCol);
  258. this.$nextTick(() => {
  259. this.scrollFull()
  260. })
  261. },
  262. computed: {
  263. ...mapState([
  264. "window",
  265. "dataTransOpts",
  266. "dialogWin",
  267. "dict",
  268. "elProgress",
  269. "patientRegister",
  270. "customerOrg",
  271. ]),
  272. // 照片显示
  273. peoplePhoto() {
  274. return photoParse(this.tableDataCurrentRow.photo)
  275. },
  276. // 表体高度
  277. tableHeight() {
  278. let fixHeight = this.window.pageHeight < 600 ? 600 : this.window.pageHeight
  279. return Math.floor((fixHeight - 243) * 2 / 3)
  280. }
  281. },
  282. methods: {
  283. ...mapActions(["getCustomerOrgGroup", "getPatientRegisterAbs"]),
  284. moment, dddw, deepCopy, checkPagePriv,
  285. // 扩展定义表格行样式
  286. handleRowClassName({ row, rowIndex }) {
  287. // highLightBg 为 'selected'的高亮
  288. //console.log(rowIndex, row)
  289. //return row.highLightBg == 'selected' ? 'high-light-bg' : '';
  290. if (row.choosed) {
  291. return "current-row";
  292. } else {
  293. return "";
  294. }
  295. },
  296. // 全选 取消全选
  297. btnChooseAll(type) {
  298. if (type == 1) {
  299. // 全选
  300. this.tableData.forEach(e => {
  301. e.choosed = true;
  302. e.highLightBg = "selected";
  303. });
  304. this.multipleSelection = deepCopy(this.tableData)
  305. } else {
  306. this.tableData.forEach(e => {
  307. e.choosed = false;
  308. e.highLightBg = "";
  309. });
  310. this.multipleSelection = []
  311. this.$refs['info'].setCurrentRow();
  312. }
  313. },
  314. // 行选择
  315. rowSelected(rows) {
  316. rows.forEach((e) => {
  317. this.$refs["info"].toggleRowSelection(e, true);
  318. });
  319. },
  320. refFuncSetData(item, v) {
  321. setData(this, item, v)
  322. },
  323. handleSelectionChange(rows) {
  324. //this.multipleSelection = rows;
  325. //console.log('this.multipleSelection',this.multipleSelection)
  326. rows.forEach((item) => {
  327. item.highLightBg = "selected";
  328. });
  329. // 取消全选
  330. if (!rows.length) {
  331. this.tableData.forEach((item) => {
  332. item.highLightBg = "";
  333. });
  334. }
  335. this.multipleSelection = JSON.parse(JSON.stringify(rows));
  336. },
  337. //点击体检次数行
  338. rowClick(row) {
  339. /*
  340. if (this.oneClick == 0) {
  341. this.oneClick = 1;
  342. } else {
  343. this.DbClick = 1;
  344. }
  345. //双击事件
  346. if (this.DbClick == 1) { //第一次点击的节点和第二次点击的节点id相同
  347. this.rowClickRetrieve(row)
  348. return;
  349. }
  350. setTimeout(() => { //300ms内没有第二次点击,执行单击事件
  351. if (this.oneClick == 1 && this.DbClick == 0) this.rowClickRetrieve(row)
  352. }, 300)
  353. */
  354. this.rowClickRetrieve(row)
  355. },
  356. rowClickRetrieve(row) {
  357. this.oneClick = 0;
  358. this.DbClick = 0;
  359. // 按住了shift键
  360. if (this.window.shift) {
  361. //清除所有选择
  362. this.tableData.forEach((e, index) => {
  363. e.choosed = false;
  364. e.index = index;
  365. });
  366. if (this.startPoint == -1) {
  367. this.tableData[row.index].choosed = true;
  368. this.startPoint = row.index;
  369. } else {
  370. if (this.startPoint > row.index) {
  371. for (let i = row.index; i <= this.startPoint; i++) {
  372. this.tableData[i].choosed = true;
  373. }
  374. } else if (this.startPoint <= row.index) {
  375. for (let i = this.startPoint; i <= row.index; i++) {
  376. this.tableData[i].choosed = true;
  377. }
  378. }
  379. }
  380. } else if (this.window.ctrl) { // 按住了ctrl 键
  381. this.tableData[row.index].choosed = true;
  382. if (this.startPoint == -1) {
  383. this.startPoint = row.index;
  384. }
  385. } else {
  386. // 未按住了ctrl 、shift 键
  387. //清除所有选择
  388. console.log("清除所有选择");
  389. this.tableData.forEach((e, index) => {
  390. e.choosed = false;
  391. e.index = index;
  392. });
  393. console.log(this.tableData, row.index);
  394. console.log(this.tableData[row.index].choosed);
  395. this.tableData[row.index].choosed = true;
  396. this.startPoint = row.index;
  397. }
  398. //选中了多个点编辑时,排序最前的作为当前选中的
  399. console.log('row.index <= this.startPoint', row.index, this.startPoint)
  400. let lfind = -1
  401. for (let i = 0; i < this.tableData.length; i++) {
  402. if (this.tableData[i].choosed) {
  403. lfind = i
  404. break
  405. }
  406. }
  407. if (lfind > -1) {
  408. // 弹出编辑框,只有在编辑框显示时,才去触发获取数据
  409. this.dataTransOpts.tableS.patient_register.id = this.tableData[lfind].id
  410. this.tableDataCurrentRow = deepCopy(this.tableData[lfind])
  411. //触发条码预览
  412. if (this.$peisAPI) this.lisPrint(this.dataTransOpts.tableS.patient_register.id, "0002", "Y", "Y")
  413. }
  414. },
  415. //查询
  416. async Query() {
  417. // 查询时,清掉明细数据 (滚动时不清)
  418. this.dataTransOpts.tableS.patient_register.id = ''
  419. this.tableDataCurrentRow = {} // 清除选择
  420. this.tableData = []
  421. setTimeout(() => {
  422. this.dataTransOpts.refresh.register_check_asbitem.M++ //触发所选组合项目刷新
  423. }, 10);
  424. this.loadOpts = Object.assign(this.loadOpts, this.loadOptsInit)
  425. await this.getPrList()
  426. },
  427. //数据量多时,滚动加载
  428. async load() {
  429. this.loadOpts.skipCount++
  430. await this.getPrList()
  431. },
  432. // 获取列表数据
  433. async getPrList() {
  434. if (this.loadOpts.skipCount != 0 && this.loadOpts.skipCount * this.loadOpts.maxResultCount >= this.loadOpts.totalCount) return
  435. console.log('getPrList', this.loadOpts)
  436. let body = {
  437. skipCount: this.loadOpts.skipCount,
  438. maxResultCount: this.loadOpts.maxResultCount
  439. };
  440. console.log(`this.patientRegister.query`, this.patientRegister.query);
  441. if (this.patientRegister.query.customerOrgFlag) {
  442. // if (this.patientRegister.query.CustomerOrgParentId) {
  443. // body.customerOrgId = this.patientRegister.query.CustomerOrgParentId;
  444. // } else {
  445. // if (this.patientRegister.query.customerOrgId)
  446. // body.customerOrgId = this.patientRegister.query.customerOrgId;
  447. // }
  448. if (this.patientRegister.query.customerOrgId) body.customerOrgId = this.patientRegister.query.customerOrgId;
  449. if (this.patientRegister.query.customerOrgId
  450. && this.patientRegister.query.customerOrgId != this.dict.personOrgId
  451. && this.patientRegister.query.customerOrgRegister.id) {
  452. body.customerOrgRegisterId = this.patientRegister.query.customerOrgRegister.id
  453. }
  454. }
  455. if (this.patientRegister.query.sex)
  456. body.sexId = this.patientRegister.query.sex;
  457. if (this.patientRegister.query.patientName)
  458. body.patientName = this.patientRegister.query.patientName;
  459. if (this.patientRegister.query.completeFlag)
  460. body.completeFlag = this.patientRegister.query.completeFlag;
  461. //StartDate EndDate
  462. if (
  463. this.patientRegister.query.startDate &&
  464. this.patientRegister.query.endDate
  465. ) {
  466. body.startDate = moment(this.patientRegister.query.startDate).format(
  467. "yyyy-MM-DD"
  468. );
  469. body.endDate = moment(this.patientRegister.query.endDate).format(
  470. "yyyy-MM-DD"
  471. );
  472. if (body.startDate > body.endDate) {
  473. this.$message.warning({ showClose: true, message: "起始日期不能大于截止日期,数据校验不通过!" });
  474. return;
  475. }
  476. }
  477. if (this.patientRegister.query.phone)
  478. body.phone = this.patientRegister.query.phone;
  479. if (this.patientRegister.query.idCardNo)
  480. body = { idNo: this.patientRegister.query.idCardNo };
  481. if (this.patientRegister.query.patientNo)
  482. body = { patientNo: this.patientRegister.query.patientNo };
  483. if (this.patientRegister.query.patientRegisterNo)
  484. body = {
  485. patientRegisterNo: this.patientRegister.query.patientRegisterNo,
  486. };
  487. console.log("/api/app/LisRequest/GetListInFilter", body);
  488. // /api/app/patientregister/getlistinfilter
  489. postapi("/api/app/patientregister/getlistinfilter", body)
  490. .then(res => {
  491. if (res.code != -1) {
  492. // 刷新最大记录数
  493. this.loadOpts.totalCount = res.data.totalCount
  494. let curLoad = res.data.items
  495. let oldCount = 0
  496. if (body.skipCount == 0) { //查询
  497. this.tableData = [];
  498. } else {
  499. // 懒加载 ,原数据集不用清空
  500. oldCount = this.tableData.length
  501. }
  502. curLoad.forEach((e, index) => {
  503. this.tableData.push(Object.assign({ index: Number(oldCount) + Number(index), choosed: false }, e))
  504. })
  505. //如果 有选中 记录,则刷新其对应的组合项目
  506. if (this.dataTransOpts.tableS.patient_register.id) {
  507. this.dataTransOpts.refresh.register_check_asbitem.M++
  508. }
  509. }
  510. })
  511. },
  512. //滚动加载数据
  513. scrollFull() {
  514. this.dom = this.$refs['info'].bodyWrapper
  515. console.log('this.dom', this.dom)
  516. this.dom.addEventListener('scroll', async () => {
  517. // console.log('scrollTop',this.dom.scrollTop,'clientHeight',this.dom.clientHeight,'scrollHeight',this.dom.scrollHeight);
  518. if (this.dom.scrollTop + this.dom.clientHeight + 20 > this.dom.scrollHeight && !this.lazyLoading) {
  519. // 获取到的不是全部数据 当滚动到底部
  520. console.log('scrollTop', this.dom.scrollTop, 'clientHeight', this.dom.clientHeight, 'scrollHeight', this.dom.scrollHeight);
  521. if ((Number(this.loadOpts.skipCount) + 1) * Number(this.loadOpts.maxResultCount) >= Number(this.loadOpts.totalCount)) {
  522. this.lazyLoading = false
  523. } else {
  524. this.lazyLoading = true
  525. await this.load()
  526. this.lazyLoading = false
  527. // this.dom.scrollTop = this.dom.scrollTop - 100
  528. }
  529. }
  530. })
  531. },
  532. // 预览设置
  533. btnPrintPre() {
  534. },
  535. // 打印
  536. btnPrint() {
  537. },
  538. // 发送检验申请
  539. btnSendLis() {
  540. console.log('btnSendLis')
  541. },
  542. // 撤消检验申请
  543. btnUndoLis() {
  544. console.log('btnUndoLis')
  545. },
  546. //检验申请
  547. async lisRequest(prId) {
  548. let isPrintLisRequest = false;
  549. let res = null;
  550. if (prId.length < 1) {
  551. this.$message.info({ showClose: true, message: "人员信息尚未保存,不可执行此操作!" });
  552. return;
  553. }
  554. try {
  555. res = await postapi(
  556. `/api/app/lisrequest/setlisrequest?PatientRegisterId=${prId}`
  557. );
  558. console.log(
  559. `/api/app/lisrequest/setlisrequest?PatientRegisterId=${prId}`,
  560. res
  561. );
  562. } catch (error) {
  563. return;
  564. }
  565. if (res.code > -1) {
  566. // this.$message.info("发送检验申请成功!");
  567. isPrintLisRequest = true;
  568. }
  569. //重复申请,重打
  570. if (res.code == -1 && res.message.indexOf("已申请") > -1) {
  571. isPrintLisRequest = true;
  572. }
  573. if (!isPrintLisRequest) return;
  574. try {
  575. await this.$confirm("是否打印检验申请单?", "提示", {
  576. confirmButtonText: "是",
  577. cancelButtonText: "否",
  578. type: "info",
  579. showClose: false,
  580. closeOnClickModal: false,
  581. closeOnPressEscape: false,
  582. });
  583. } catch (error) {
  584. return;
  585. }
  586. //打印检验申请单
  587. this.lisPrint(prId, "0003", false);
  588. },
  589. //检验条码打印
  590. lisPrint(prId, ReportCode, isPreview, IsUploadPdf) {
  591. if (!this.$peisAPI) {
  592. this.$message.info({ showClose: true, message: "此功能,需要在壳客户端才可运行!" });
  593. return;
  594. }
  595. let token = window.sessionStorage.getItem("token");
  596. let user = window.sessionStorage.getItem("user");
  597. let toOutShell = {
  598. ReportCode,
  599. token,
  600. isBuildImage: 'N',
  601. IsUploadPdf,
  602. preViewCanPrint: "N",
  603. Parameters: [
  604. { Name: "printer", Value: user },
  605. { Name: "hisLog", Value: "pic/hisLog.jpg" },
  606. ],
  607. BusinessCode: prId
  608. };
  609. if (isPreview) {
  610. this.$peisAPI.printPre(JSON.stringify(toOutShell))
  611. .then(res => {
  612. let lres = JSON.parse(res)
  613. if (lres.code < 0) {
  614. this.$message.warning({ showClose: true, message: JSON.parse(res).message });
  615. }else if(IsUploadPdf == 'Y'){
  616. this.lisLabel = 'data:application/pdf;base64,' + lres.data
  617. }
  618. })
  619. .catch((err) => {
  620. console.log('打印检验条码错误', err)
  621. this.$message.warning({ showClose: true, message: `${err}` });
  622. });
  623. } else {
  624. this.$peisAPI.print(JSON.stringify(toOutShell))
  625. .then(res => {
  626. if (JSON.parse(res).code < 0) {
  627. this.$message.warning({ showClose: true, message: JSON.parse(res).message });
  628. } else {
  629. return postapi("/api/app/lisrequest/updatelisrequestisprint", {
  630. operateType: 1,
  631. patientRegisterId: prId,
  632. });
  633. }
  634. })
  635. .then(res => {
  636. if (res && res.code < 0) {
  637. this.$message.error({ showClose: true, message: `${res.message}` });
  638. }
  639. })
  640. .catch((err) => {
  641. console.log('打印检验条码错误', err)
  642. this.$message.error({ showClose: true, message: `${err}` });
  643. });
  644. }
  645. },
  646. //pacs条码打印
  647. pacsPrint(prId, ReportCode, isPreview) {
  648. if (!this.$peisAPI) {
  649. this.$message.info("此功能,需要在壳客户端才可运行!");
  650. return;
  651. }
  652. let token = window.sessionStorage.getItem("token");
  653. let user = window.sessionStorage.getItem("user");
  654. let toOutShell = {
  655. ReportCode,
  656. token,
  657. isBuildImage: 'N',
  658. IsUploadPdf: 'N',
  659. preViewCanPrint: "Y",
  660. Parameters: [
  661. { Name: "printer", Value: user },
  662. { Name: "hisLog", Value: "pic/hisLog.jpg" },
  663. ],
  664. BusinessCode: prId
  665. };
  666. if (isPreview) {
  667. this.$peisAPI.printPre(JSON.stringify(toOutShell))
  668. .then(res => {
  669. if (JSON.parse(res).code < 0) {
  670. this.$message.warning({ showClose: true, message: JSON.parse(res).message });
  671. }
  672. })
  673. .catch((err) => {
  674. console.log('打印pacs条码错误', err)
  675. this.$message.warning({ showClose: true, message: `${err}` });
  676. });
  677. } else {
  678. this.$peisAPI.print(JSON.stringify(toOutShell))
  679. .then(res => {
  680. if (JSON.parse(res).code < 0) {
  681. this.$message.warning({ showClose: true, message: JSON.parse(res).message });
  682. } else {
  683. return postapi("/api/app/lisrequest/updatelisrequestisprint", {
  684. operateType: 1,
  685. patientRegisterId: prId,
  686. });
  687. }
  688. })
  689. .then(res => {
  690. if (res && res.code < 0) {
  691. this.$message.error({ showClose: true, message: `${res.message}` });
  692. }
  693. })
  694. .catch((err) => {
  695. console.log('打印pacs条码错误', err)
  696. this.$message.error({ showClose: true, message: `${err}` });
  697. });
  698. }
  699. },
  700. columnDrop(dropCol) {
  701. //获取dom节点
  702. const wrapperTr = document.querySelector(".el-table__header-wrapper tr");
  703. Sortable.create(wrapperTr, {
  704. animation: 180,
  705. delay: 0,
  706. // 元素被选中
  707. onChoose: function (/**Event*/ evt) {
  708. //console.log('onChoose',evt,evt.oldIndex)
  709. evt.oldIndex; // element index within parent
  710. },
  711. // 元素未被选中的时候(从选中到未选中)
  712. onUnchoose: function (/**Event*/ evt) {
  713. // same properties as onEnd
  714. },
  715. // 开始拖拽的时候
  716. onStart: function (/**Event*/ evt) {
  717. //console.log('onStart',evt,evt.oldIndex)
  718. evt.oldIndex; // element index within parent
  719. },
  720. onEnd: (evt) => {
  721. const oldItem = dropCol[evt.oldIndex]; // dropCol[evt.oldIndex - 1];
  722. if (oldItem) {
  723. dropCol.splice(evt.oldIndex, 1);
  724. dropCol.splice(evt.newIndex, 0, oldItem);
  725. }
  726. //console.log(this.headerCols, oldItem, dropCol);
  727. },
  728. });
  729. return dropCol;
  730. },
  731. //通用导出
  732. btnExport(elId) {
  733. // 获取HTML元素(表格)
  734. // let table = document.getElementById(elId); //.cloneNode(true)
  735. this.$nextTick(() => {
  736. let refsTable = this.$refs[elId] //.cloneNode(true) true
  737. let table = document.getElementById(elId)
  738. console.log('table,refsTable', table, refsTable)
  739. let tableData = table.innerHTML
  740. let fileName = moment(new Date()).format('yyyyMMDDHHmmss')
  741. let blob = new Blob([tableData], { type: "text/plain;charset=utf-8" });
  742. FileSaver.saveAs(blob, fileName + '.xls');
  743. // 导出图片
  744. // 使用html2canvas将HTML元素转换为画布
  745. // let cloneTable = table.cloneNode(true) //[elId]
  746. html2canvas(table).then(canvas => {
  747. // 创建一个a元素用于下载
  748. const link = document.createElement('a');
  749. link.href = canvas.toDataURL('image/jpeg');
  750. link.download = fileName + '.jpg';
  751. document.body.appendChild(link);
  752. link.click();
  753. //document.body.removeChild(link);
  754. // // 创建一个PDF对象
  755. // var pdf = new jsPDF();
  756. // // 设置PDF的尺寸
  757. // pdf.addImage(canvas.toDataURL('image/png'), 'PNG', 0, 0, canvas.width, canvas.height);
  758. // // 导出PDF
  759. // pdf.save('员工信息表.pdf');
  760. });
  761. })
  762. },
  763. },
  764. //监听事件
  765. watch: {
  766. "patientRegister.query.customerOrgId": {
  767. // immediate: true, // 立即执行
  768. // deep: true, // 深度监听复杂类型内变化
  769. handler(newVal, oldVal) {
  770. //console.log('watch:patientRegister.query.customerOrgId:',newVal,oldVal)
  771. // 单位变化时,清除当前列表信息
  772. if (newVal && newVal != oldVal) {
  773. this.tableData = []
  774. this.dataTransOpts.tableM.register_check_asbitem = []
  775. }
  776. }
  777. },
  778. //触发查询事件
  779. "patientRegister.query.times"(newVal, oldVal) {
  780. if (newVal != oldVal) {
  781. //alert('触发查询事件')
  782. this.Query();
  783. }
  784. },
  785. //新增后,触发赋值
  786. // "patientRegister.patientRegisterRd.id"(newVal, oldVal) {
  787. // if (newVal != oldVal) {
  788. // //console.log('patientRegister.patientRegisterRd.customerOrgId',this.patientRegister.patientRegisterRd.customerOrgId)
  789. // objCopy(this.patientRegister.patientRegisterRd, this.form);
  790. // }
  791. // },
  792. },
  793. };
  794. </script>
  795. <style scoped>
  796. @import "../../assets/css/global_input.css";
  797. @import "../../assets/css/global_table.css";
  798. @import "../../assets/css/global.css";
  799. .box {
  800. display: flex;
  801. }
  802. .listBtn {
  803. margin-top: 5px;
  804. text-align: center;
  805. }
  806. .btnClass {
  807. width: 100px;
  808. }
  809. </style>