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.

1699 lines
61 KiB

2 years ago
  1. <template>
  2. <div>
  3. <!--组件主体-->
  4. <div style="display: flex">
  5. <div :style="'width:' + (window.pageWidth - 125) + 'px;'" @contextmenu.prevent="onContextmenu">
  6. <div>
  7. <el-table :data="tableData" border
  8. :height="window.pageHeight < 600 ? 248 : Math.floor(((window.pageHeight - 250) * 2) / 3)"
  9. highlight-current-row @row-click="rowClick" size="small" row-key="id"
  10. @selection-change="handleSelectionChange" @cell-contextmenu="onCellRightClick" ref="info" id="info"
  11. :row-class-name="handleRowClassName">
  12. <el-table-column type="selection" width="40" align="center"></el-table-column>
  13. <el-table-column v-for="(item, index) in dragCol" :key="index" :type="dragCol[index].type"
  14. :min-width="dragCol[index].minWidth" :align="dragCol[index].align" :label="item.label"
  15. :prop="dragCol[index].prop" :sortable="dragCol[index].type || dragCol[index].prop == 'sn' ? false : true">
  16. <template slot-scope="scope" v-if="!(dragCol[index].type)">
  17. <div v-if="!dragCol[index].type">
  18. <div v-if="dragCol[index].prop == 'sn'">
  19. {{ scope.$index + 1 }}
  20. </div>
  21. <div v-else-if="dragCol[index].prop == 'completeFlag'"
  22. :style="`color: ${setPrStatusColor(scope.row.isAudit, scope.row.completeFlag)}`">
  23. {{ scope.row.isAudit == 'Y' ? "已审核" : dddw(dict.completeFlag, "id", scope.row.completeFlag,
  24. "displayName") }}
  25. </div>
  26. <div v-else-if="dragCol[index].prop == 'qztlType'">
  27. {{ dddw(dict.qztlType, "id", scope.row.qztlType, "displayName") }}
  28. </div>
  29. <div v-else-if="dragCol[index].prop == 'guidePrintTimes'">
  30. <i class="el-icon-printer" v-if="scope.row.guidePrintTimes > 0"
  31. style="font-size: 20px; color: green" />
  32. </div>
  33. <div v-else-if="dragCol[index].prop == 'isLock'">
  34. <i class="el-icon-lock" v-if="scope.row.isLock == 'Y'" style="font-size: 20px; color: red" />
  35. </div>
  36. <div v-else-if="dragCol[index].prop == 'isVip'
  37. || dragCol[index].prop == 'isUpload'
  38. || dragCol[index].prop == 'qztlIsMain'
  39. || dragCol[index].prop == 'qztlIsCy'
  40. || dragCol[index].prop == 'qztlIsCw'
  41. || dragCol[index].prop == 'qztlIsGt'
  42. || dragCol[index].prop == 'qztlIsWh'
  43. || dragCol[index].prop == 'qztlIsFj'
  44. ">
  45. {{ scope.row[dragCol[index].prop] == "Y" ? "是" : "否" }}
  46. </div>
  47. <div v-else-if="dragCol[index].prop == 'customerOrgParentName'">
  48. {{ scope.row.customerOrgParentName
  49. ? scope.row.customerOrgParentName
  50. : scope.row.customerOrgName }}
  51. </div>
  52. <div v-else-if="dragCol[index].prop == 'sexId'">
  53. {{ dddw(dict.sex, "id", scope.row[dragCol[index].prop], "displayName") }}
  54. </div>
  55. <div v-else-if="dragCol[index].prop == 'groupPack'">
  56. <div
  57. v-if="scope.row.medicalPackageId !== dict.personOrgId && scope.row.customerOrgId === dict.personOrgId">
  58. {{ dddw(dict.medicalPackage, "id", scope.row.medicalPackageId, "displayName") }}
  59. </div>
  60. <div
  61. v-if="scope.row.medicalPackageId !== dict.personOrgId && scope.row.customerOrgId !== dict.personOrgId">
  62. {{ dddw(dict.customerOrgGroupAll, "id", scope.row.customerOrgGroupId, "displayName") }}
  63. </div>
  64. </div>
  65. <div v-else-if="dragCol[index].prop == 'nationId'">
  66. {{ dddw(dict.nation, "id", scope.row[dragCol[index].prop], "displayName") }}
  67. </div>
  68. <div v-else-if="dragCol[index].prop == 'birthDate'">
  69. {{ scope.row[dragCol[index].prop] ? moment(scope.row[dragCol[index].prop]).format('yyyy-MM-DD') : ''
  70. }}
  71. </div>
  72. <div v-else-if="dragCol[index].prop == 'maritalStatusId'">
  73. {{ dddw(dict.maritalStatus, "id", scope.row[dragCol[index].prop], "displayName") }}
  74. </div>
  75. <div v-else-if="dragCol[index].prop == 'medicalTypeId'">
  76. {{ dddw(dict.medicalType, "id", scope.row[dragCol[index].prop], "displayName") }}
  77. </div>
  78. <div v-else-if="dragCol[index].prop == 'personnelTypeId'">
  79. {{ dddw(dict.personnelType, "id", scope.row[dragCol[index].prop], "displayName") }}
  80. </div>
  81. <div v-else-if="dragCol[index].prop == 'idNo'">
  82. {{ scope.row[dragCol[index].prop] }}&#031;
  83. </div>
  84. <div v-else-if="dragCol[index].prop == 'customerOrgName'">
  85. {{ scope.row[dragCol[index].prop] == scope.row['customerOrgParentName'] ?
  86. '' : scope.row[dragCol[index].prop] }}
  87. </div>
  88. <div v-else>
  89. {{ scope.row[dragCol[index].prop] }}
  90. </div>
  91. </div>
  92. </template>
  93. </el-table-column>
  94. <!--
  95. "sexHormoneTermId": "00000000-0000-0000-0000-000000000000",
  96. "interposeMeasure": null,
  97. "medicalConclusionId": "00000000-0000-0000-0000-000000000000",
  98. "reportPrintTimes": 0,
  99. "isMedicalStart": "N",
  100. "medicalStartDate": "6/28/2023",
  101. "isRecoverGuide": "N",
  102. "summaryDate": "",
  103. "summaryDoctor": null,
  104. "isAudit": "N",
  105. "auditDoctor": null,
  106. "auditDate": "",
  107. "isNameHide": "N",
  108. "isPhoneFollow": "N",
  109. "thirdInfo": null,
  110. "guidePrintTimes": null,
  111. "remark": null,
  112. "medicalCenterId": "00000000-0000-0000-0000-000000000000",
  113. "customerOrgRegisterId": "00000000-0000-0000-0000-000000000000",
  114. "lastModifierName": "",
  115. "lastModificationTime": null,
  116. "lastModifierId": null,
  117. "creatorId": null,
  118. "id": "3a0c196d-a6d0-37fe-5c32-4806bdc4530f"
  119. -->
  120. </el-table>
  121. <div style="display: flex;justify-content:space-between;">
  122. <div></div>
  123. <div>
  124. <span style="font-size:12px;">{{ loadOpts.totalCount }} 条记录当前显示{{ tableData.length }}
  125. </span>
  126. </div>
  127. </div>
  128. </div>
  129. <!-- 组合项目 基本信息 -->
  130. <el-tabs v-model="tabChoosed" style="margin-top: -22px;">
  131. <!-- 组合项目 -->
  132. <el-tab-pane label="危急值" name="1">
  133. </el-tab-pane>
  134. <el-tab-pane label="随访计划" name="2">
  135. <FollowPlan />
  136. </el-tab-pane>
  137. <el-tab-pane label="随访记录" name="3">
  138. <FollowPlan />
  139. </el-tab-pane>
  140. </el-tabs>
  141. </div>
  142. <div style="margin-left: 10px;">
  143. <div class="listBtn">
  144. <el-button type="success" class="commonbutton" @click="btnImportOrgData">制定随访计划</el-button>
  145. </div>
  146. <div class="listBtn">
  147. <el-button type="success" class="commonbutton" @click="btnAdd">新增随访记录</el-button>
  148. </div>
  149. </div>
  150. </div>
  151. <!--组件弹窗-->
  152. <div>
  153. <!-- 体检人员登记 :title="patientRegister.patientRegisterRd.id ? '体检人员--编辑' : '体检人员--新增'" -->
  154. <el-dialog :title="dataTransOpts.tableS.patient_register.id ? '体检人员--编辑' : '体检人员--新增'"
  155. :visible.sync="dialogWin.PatientRegisterEdit" :close-on-click-modal="false" fullscreen
  156. @close="close_dialogWin_PatientRegisterEdit">
  157. <!-- :formInitData="patientRegister.patientRegisterRd" -->
  158. <PatientRegisterEdit :isDoctor="'1'" :patientRegisterId="patientRegister.patientRegisterRd.id"
  159. :editTimes="editTimes" :refFuncSetData="refFuncSetData" />
  160. </el-dialog>
  161. <!-- 修改信息 -->
  162. <el-dialog :title="`修改信息--${upBaseInfo.label}`" :visible.sync="upBaseInfo.visble" width="400" :show-close="false"
  163. :append-to-body="true" :close-on-click-modal="false">
  164. <div>
  165. <div style="display: flex;margin-bottom: 20px;">
  166. <span style="padding: 5px 0 0 10px; width:100px;">{{ upBaseInfo.label }}</span>
  167. <el-input v-model="upBaseInfo.value" size="small"></el-input>
  168. </div>
  169. <div style="display: flex;justify-content: space-between;">
  170. <div></div>
  171. <div>
  172. <el-button class="commonbutton" @click="btnUpBaseInfo">提交</el-button>
  173. <el-button class="commonbutton" @click="close_dialogWin_upBaseInfo">关闭</el-button>
  174. </div>
  175. </div>
  176. </div>
  177. </el-dialog>
  178. <!-- 分诊排队 -->
  179. <el-dialog title="分诊排队" :visible.sync="dialogWin.queue" width="800px" :append-to-body="true"
  180. :close-on-click-modal="false">
  181. <Queue :refParams="queueParams" />
  182. </el-dialog>
  183. <!-- 拍照 -->
  184. <el-dialog title="拍照" :visible.sync="patientRegister.cameraVisble" width="400" height="800" :show-close="false"
  185. :append-to-body="true" :close-on-click-modal="false">
  186. <Camera :id="patientRegister.patientRegisterId" />
  187. </el-dialog>
  188. <!-- 导入企业数据 -->
  189. <el-dialog title="导入企业数据" :visible.sync="dialogWin.ImportOrgData" width="800px" :append-to-body="true"
  190. :close-on-click-modal="false">
  191. <ImportOrgData />
  192. </el-dialog>
  193. <!-- 列排序 -->
  194. <el-dialog title="列排序" :visible.sync="dialogColSort" width="300px" :append-to-body="true"
  195. :close-on-click-modal="false">
  196. <el-table id="elTable_dragCol" :data="dragColDesign" row-key="prop" border height="600">
  197. <el-table-column type="index" label="序号" width="40" align="center">
  198. </el-table-column>
  199. <el-table-column label="列名" prop="label" min-width="120" align="center"></el-table-column>
  200. </el-table>
  201. <span slot="footer" class="dialog-footer">
  202. <el-button class="commonbutton" @click="dialogColSort = false">取消</el-button>
  203. <el-button class="commonbutton" @click="btnDragColDesignOk">确定</el-button>
  204. </span>
  205. </el-dialog>
  206. <!-- 批量调整分组 -->
  207. <el-dialog title="批量调整分组" :visible.sync="dialogWin.PatientRegisterEditGroupBatch" width="600px" height="800px"
  208. :append-to-body="true" :close-on-click-modal="false">
  209. <PatientRegisterEditGroupBatch :multipleSelection="multipleSelection" />
  210. </el-dialog>
  211. <!-- 批量调整项目 -->
  212. <el-dialog title="批量调整项目" :visible.sync="dialogWin.PatientRegisterEditItemBatch" width="610px" height="800px"
  213. :append-to-body="true" :close-on-click-modal="false">
  214. <PatientRegisterEditItemBatch :multipleSelection="multipleSelection" />
  215. </el-dialog>
  216. <!-- 批量调整检查项目医生 -->
  217. <el-dialog title="批量调整检查项目医生" :visible.sync="dialogWin.PatientRegisterEditDoctorBatch" width="610px"
  218. :append-to-body="true" :close-on-click-modal="false">
  219. <PatientRegisterEditDoctorBatch :multipleSelection="multipleSelection" />
  220. </el-dialog>
  221. <!-- 通用进度条 -->
  222. <el-dialog title="数据处理中……" :visible.sync="elProgress.display" width="600px" height="400" :show-close="false"
  223. :close-on-click-modal="false" :append-to-body="true">
  224. <ElProgressOCX />
  225. </el-dialog>
  226. <!--通用本地参数设置-->
  227. <el-dialog title="本地参数设置" :visible.sync="dialogWin.LocalConfig" :close-on-click-modal="false"
  228. :append-to-body="true" width="800px" height="600px">
  229. <LocalConfig />
  230. </el-dialog>
  231. </div>
  232. </div>
  233. </template>
  234. <script>
  235. import moment from "moment";
  236. import { mapState, mapActions } from "vuex";
  237. import { getapi, postapi, putapi, deletapi } from "@/api/api";
  238. import Sortable from "sortablejs";
  239. import FileSaver from 'file-saver';
  240. import html2canvas from 'html2canvas';
  241. import {
  242. getPagePriv, checkPagePriv,
  243. dddw,
  244. objCopy,
  245. arrayReduce,
  246. arrayExistObj,
  247. deepCopy, setPrStatusColor
  248. } from "../../utlis/proFunc";
  249. import FollowPlan from "../../components/follow/FollowPlan.vue";
  250. export default {
  251. components: {
  252. FollowPlan,
  253. },
  254. data() {
  255. return {
  256. pagePriv: {
  257. routeUrlorPageName: 'patientRegister', //当前页面归属路由或归属页面权限名称
  258. privs: [] // 页面权限
  259. },
  260. peisid: null,
  261. startPoint: -1, // 多选起点 -1 表示选择
  262. endPoint: -1, // 多选终点 -1 表示未选择
  263. tableData: [], //表格数据
  264. tableDataCurrentRow: {}, // 当前被选中的行
  265. multipleSelection: [], //选中的数据列表
  266. dialogCamera: false,
  267. tabChoosed: "1",
  268. formInitData: {}, //体检登记初始表单数据
  269. editTimes: 0,
  270. rClickRow: null, //右击的行
  271. rClickColumn: null, //右击的列(预留)
  272. dragColDesign: [], // 待调整的排序的序
  273. //拖动列
  274. dragCol: [
  275. { label: "序号", prop: "sn", minWidth: 40, align: "center" },
  276. { label: "锁住", prop: "isLock", minWidth: 55, align: "center" },
  277. { label: "单位", prop: "customerOrgParentName", minWidth: 180, align: "center" },
  278. { label: "部门", prop: "customerOrgName", minWidth: 120, align: "center" },
  279. { label: "姓名", prop: "patientName", minWidth: 80, align: "center" },
  280. { label: "性别", prop: "sexId", minWidth: 55, align: "center" },
  281. { label: "年龄", prop: "age", minWidth: 55, align: "center" },
  282. { label: "条码号", prop: "patientRegisterNo", minWidth: 150, align: "center" },
  283. { label: "档案号", prop: "patientNo", minWidth: 100, align: "center" },
  284. { label: "体检次数", prop: "medicalTimes", minWidth: 80, align: "center" },
  285. { label: "分组/套餐", prop: "groupPack", minWidth: 150, align: "center" },
  286. { label: "民族", prop: "nationId", minWidth: 55, align: "center" },
  287. { label: "身份证", prop: "idNo", minWidth: 160, align: "center" },
  288. { label: "出生日期", prop: "birthDate", minWidth: 80, align: "center" },
  289. { label: "邮箱", prop: "email", minWidth: 150, align: "center" },
  290. { label: "手机", prop: "mobileTelephone", minWidth: 130, align: "center" },
  291. { label: "电话", prop: "telephone", minWidth: 130, align: "center" },
  292. { label: "地址", prop: "address", minWidth: 400, align: "" },
  293. { label: "体检卡号", prop: "medicalCardNo", minWidth: 80, align: "center" },
  294. { label: "工卡号", prop: "jobCardNo", minWidth: 80, align: "center" },
  295. { label: "婚姻状况", prop: "maritalStatusId", minWidth: 80, align: "center" },
  296. { label: "体检类别", prop: "medicalTypeId", minWidth: 80, align: "center" },
  297. { label: "人员类别", prop: "personnelTypeId", minWidth: 80, align: "center" },
  298. { label: "职务", prop: "jobPost", minWidth: 200, align: "center" },
  299. { label: "职称", prop: "jobTitle", minWidth: 80, align: "center" },
  300. { label: "介绍人", prop: "salesman", minWidth: 80, align: "center" },
  301. { label: "是否VIP", prop: "isVip", minWidth: 80, align: "center" },
  302. { label: "体检进度", prop: "completeFlag", minWidth: 80, align: "center" },
  303. { label: "打印", prop: "guidePrintTimes", minWidth: 55, align: "center" },
  304. { label: "登记人", prop: "creatorName", minWidth: 80, align: "center" },
  305. { label: "登记日期", prop: "creationTime", minWidth: 140, align: "center" },
  306. { label: "体检日期", prop: "medicalStartDate", minWidth: 140, align: "center" },
  307. { label: "是否上传", prop: "isUpload", minWidth: 80, align: "center" },
  308. { label: "高原/健康", prop: "qztlType", minWidth: 90, align: "center" },
  309. { label: "行车", prop: "qztlIsMain", minWidth: 50, align: "center" },
  310. { label: "从业", prop: "qztlIsCy", minWidth: 50, align: "center" },
  311. { label: "普速", prop: "qztlIsCw", minWidth: 50, align: "center" },
  312. { label: "高铁", prop: "qztlIsGt", minWidth: 50, align: "center" },
  313. { label: "职害", prop: "qztlIsWh", minWidth: 50, align: "center" },
  314. { label: "复检", prop: "qztlIsFj", minWidth: 50, align: "center" },
  315. ],
  316. dialogColSort: false,
  317. dom: null, //用于滚动加载数据
  318. lazyLoading: false, //是否懒加载中
  319. loadOpts: {
  320. totalCount: 0,
  321. skipCount: 0,
  322. maxResultCount: 100,
  323. },
  324. loadOptsInit: {},
  325. upBaseInfo: {
  326. visble: false,
  327. label: "姓名",
  328. value: "",
  329. colName: "patientName",
  330. patientRegisterId: ""
  331. },
  332. queueParams: {}, // 分诊排队参数
  333. LocalConfig: {
  334. normal: {
  335. maxResultCount: 100, //分页时单页记录数
  336. },
  337. },
  338. LocalConfigInit: {},
  339. };
  340. },
  341. created() {
  342. //获取用户当前页面的权限
  343. let userPriv = window.sessionStorage.getItem('userPriv')
  344. if (userPriv) this.pagePriv.privs = deepCopy(getPagePriv(this.pagePriv.routeUrlorPageName))
  345. this.LocalConfigInit = deepCopy(this.LocalConfig)
  346. let LocalConfig = window.localStorage.getItem("LocalConfig") || null
  347. // console.log('LocalConfig',LocalConfig)
  348. try {
  349. this.LocalConfig = Object.assign({}, deepCopy(this.LocalConfigInit), JSON.parse(LocalConfig) || {})
  350. } catch (error) {
  351. console.log('window.localStorage.getItem("LocalConfig")', error)
  352. }
  353. // console.log('this.LocalConfig',this.LocalConfig)
  354. this.loadOpts.maxResultCount = Number(this.LocalConfig.normal.maxResultCount||100)
  355. this.loadOptsInit = Object.assign({}, this.loadOpts)
  356. },
  357. //挂载完成
  358. mounted() {
  359. this.quickAsb = this.dict.asbItemAll;
  360. this.peisid = window.sessionStorage.getItem('peisid');
  361. this.$nextTick(() => {
  362. this.scrollFull()
  363. })
  364. },
  365. computed: {
  366. ...mapState([
  367. "window",
  368. "dataTransOpts",
  369. "dialogWin",
  370. "dict",
  371. "elProgress",
  372. "patientRegister",
  373. "customerOrg",
  374. ]),
  375. },
  376. methods: {
  377. ...mapActions(["getCustomerOrgGroup", "getPatientRegisterAbs"]),
  378. moment, dddw, deepCopy, checkPagePriv, setPrStatusColor,
  379. // 扩展定义表格行样式
  380. handleRowClassName({ row, rowIndex }) {
  381. // highLightBg 为 'selected'的高亮
  382. //// console.log(rowIndex, row)
  383. //return row.highLightBg == 'selected' ? 'high-light-bg' : '';
  384. if (row.choosed) {
  385. return "current-row";
  386. } else {
  387. return "";
  388. }
  389. },
  390. // 行选择
  391. rowSelected(rows) {
  392. rows.forEach((e) => {
  393. this.$refs["info"].toggleRowSelection(e, true);
  394. });
  395. },
  396. refFuncSetData(item, v) {
  397. setData(this, item, v)
  398. },
  399. // 打印指引单(isPreview)
  400. async guidePrint(ReportCode, isPreview) {
  401. if (!this.$peisAPI) {
  402. this.$message.info({ showClose: true, message: "此功能,需要在壳客户端才可运行!" });
  403. return;
  404. }
  405. let token = window.sessionStorage.getItem("token");
  406. let user = window.sessionStorage.getItem("user");
  407. let toOutShell = {
  408. ReportCode,
  409. token,
  410. isBuildImage: 'N',
  411. IsUploadPdf: 'N',
  412. preViewCanPrint: "N",
  413. Parameters: [
  414. { Name: "printer", Value: user },
  415. { Name: "hisLog", Value: "pic/hisLog.jpg" },
  416. { Name: 'pageFooter', Value: 'pic/peisQrCode.jpg' },
  417. ],
  418. };
  419. let lfind = -1;
  420. //选中(取消勾选)start -------------------------
  421. // this.multipleSelection = []
  422. // this.tableData.forEach(e => {
  423. // if (e.choosed) {
  424. // this.multipleSelection.push(deepCopy(e))
  425. // }
  426. // })
  427. //选中(取消勾选) end  -------------------------
  428. if (this.multipleSelection.length < 1) {
  429. this.$message.info({ showClose: true, message: "请勾选要打印指引单的人员记录!" });
  430. return;
  431. }
  432. if (isPreview) {
  433. /*
  434. //this.multipleSelection.forEach((item,index) =>{
  435. postapi(
  436. `/api/app/printreport/getpatientregisterguidereport?PatientRegisterId=${this.multipleSelection[0].id}`
  437. )
  438. .then((res) => {
  439. if (res.code != -1) {
  440. toOutShell.ReportTable = res.data;
  441. // console.log(
  442. "JSON.stringify(toOutShell)",
  443. JSON.stringify(toOutShell)
  444. );
  445. return this.$peisAPI.printPre(JSON.stringify(toOutShell));
  446. }
  447. })
  448. .then(res => {
  449. // console.log('this.$peisAPI.printPre', res)
  450. if (JSON.parse(res).code < 0) {
  451. this.$message.warning(JSON.parse(res).message);
  452. }
  453. })
  454. .catch((err) => {
  455. // console.log('打印指引单', err)
  456. this.$message.warning({ showClose: true, message: err });
  457. });
  458. */
  459. toOutShell.BusinessCode = this.multipleSelection[0].id
  460. if (this.multipleSelection[0].completeFlag == '0') {
  461. this.$message.warning({ showClose: true, message: '预登记人员,不可执行此操作!' })
  462. return
  463. }
  464. this.$peisAPI.printPre(JSON.stringify(toOutShell))
  465. .then(res => {
  466. if (JSON.parse(res).code < 0) {
  467. this.$message.warning({ showClose: true, message: JSON.parse(res).message });
  468. }
  469. })
  470. .catch((err) => {
  471. // console.log('打印指引单', err)
  472. this.$message.warning({ showClose: true, message: `${err}` });
  473. });
  474. } else {
  475. this.elProgress.display = true;
  476. this.elProgress.percentage = 0;
  477. for (let i = 0; i < this.multipleSelection.length; i++) {
  478. try {
  479. let patientregisterId = this.multipleSelection[i].id
  480. if (this.multipleSelection[i].completeFlag == '0') {
  481. this.$message.warning({ showClose: true, message: `${this.multipleSelection[i].patientName} 为预登记人员,不可打印指引单` });
  482. continue
  483. }
  484. toOutShell.BusinessCode = patientregisterId
  485. let resPeisAPI = await this.$peisAPI.print(JSON.stringify(toOutShell));
  486. if (JSON.parse(resPeisAPI).code < 0) continue
  487. let resPrintTimes = await postapi("/api/app/patientregister/updatepatientregisterguideprinttimesmany", [patientregisterId]);
  488. if (resPrintTimes.code == -1) continue
  489. lfind = arrayExistObj(this.tableData, "id", patientregisterId);
  490. if (lfind > -1) {
  491. if (this.tableData[lfind].guidePrintTimes) {
  492. this.tableData[lfind].guidePrintTimes = Number(this.tableData[lfind].guidePrintTimes) + 1;
  493. } else {
  494. this.tableData[lfind].guidePrintTimes = 1;
  495. }
  496. }
  497. } catch (error) {
  498. // console.log('打印指引单', error)
  499. this.$message.warning({ showClose: true, message: `${error}` });
  500. }
  501. this.elProgress.percentage = Math.floor(
  502. ((i + 1) * 100) / this.multipleSelection.length
  503. );
  504. }
  505. this.elProgress.display = false;
  506. }
  507. },
  508. // 指引单新打印方式,promise
  509. guidePrintPromise(ReportCode, isPreview, row) {
  510. return new Promise((resolve, reject) => {
  511. if (!this.$peisAPI) reject("此功能,需要在壳客户端才可运行!")
  512. let token = window.sessionStorage.getItem("token");
  513. let user = window.sessionStorage.getItem("user");
  514. let toOutShell = {
  515. ReportCode,
  516. token,
  517. isBuildImage: 'N',
  518. IsUploadPdf: 'N',
  519. preViewCanPrint: "N",
  520. Parameters: [
  521. { Name: "printer", Value: user },
  522. { Name: "hisLog", Value: "pic/hisLog.jpg" },
  523. { Name: 'pageFooter', Value: 'pic/peisQrCode.jpg' },
  524. ],
  525. };
  526. if (!row.completeFlag || row.completeFlag == '0') reject('预登记人员,不可执行此操作!')
  527. toOutShell.BusinessCode = row.id
  528. console.log(JSON.stringify(toOutShell))
  529. if (isPreview) {
  530. this.$peisAPI.printPre(JSON.stringify(toOutShell))
  531. .then(res => {
  532. let lres = JSON.parse(res)
  533. if (lres.code > -1) {
  534. resolve(lres)
  535. } else {
  536. reject(lres.message)
  537. }
  538. })
  539. .catch((err) => {
  540. reject(err)
  541. });
  542. } else {
  543. this.$peisAPI.print(JSON.stringify(toOutShell))
  544. .then(res => {
  545. let lres = JSON.parse(res)
  546. if (lres.code > -1) {
  547. return postapi("/api/app/patientregister/updatepatientregisterguideprinttimesmany", [row.id]);
  548. } else {
  549. reject(lres.message)
  550. }
  551. })
  552. .then(res => {
  553. if (res && res.code > -1) {
  554. let lfind = arrayExistObj(this.tableData, "id", row.id);
  555. if (lfind > -1) {
  556. if (this.tableData[lfind].guidePrintTimes) {
  557. this.tableData[lfind].guidePrintTimes = Number(this.tableData[lfind].guidePrintTimes) + 1;
  558. } else {
  559. this.tableData[lfind].guidePrintTimes = 1;
  560. }
  561. }
  562. }
  563. resolve(res)
  564. })
  565. .catch((err) => {
  566. reject(err)
  567. });
  568. }
  569. })
  570. },
  571. printGuideLisPacs(row) {
  572. return new Promise((resolve, reject) => {
  573. this.guidePrintPromise("0008", false, row)
  574. .then(res => {
  575. return this.lisPrint(row, "0002", false)
  576. })
  577. .then(res => {
  578. return this.pacsPrint(row, "0004", false)
  579. })
  580. .then(res => {
  581. resolve(res)
  582. })
  583. .catch(err => {
  584. reject(err)
  585. })
  586. })
  587. },
  588. async printPromise() {
  589. if (this.multipleSelection.length < 1) {
  590. this.$message.info({ showClose: true, message: "请勾选要打印人员检验检查条码的记录!" });
  591. return;
  592. }
  593. this.elProgress.display = true;
  594. this.elProgress.percentage = 0;
  595. for (let i = 0; i < this.multipleSelection.length; i++) {
  596. let row = this.multipleSelection[i]
  597. try {
  598. await this.printGuideLisPacs(row)
  599. } catch (error) {
  600. console.log('printPromise', error)
  601. }
  602. this.elProgress.percentage = Math.floor(
  603. ((i + 1) * 100) / this.multipleSelection.length
  604. );
  605. }
  606. this.elProgress.display = false;
  607. },
  608. handleSelectionChange(rows) {
  609. //this.multipleSelection = rows;
  610. //// console.log('this.multipleSelection',this.multipleSelection)
  611. // rows.forEach((item) => {
  612. // item.highLightBg = "selected";
  613. // });
  614. // // 取消全选
  615. // if (!rows.length) {
  616. // this.tableData.forEach((item) => {
  617. // item.highLightBg = "";
  618. // });
  619. // }
  620. this.multipleSelection = rows;
  621. },
  622. //设置新增/编辑的form数据
  623. setForm(formData) {
  624. this.patientRegister.patientRegisterRd = deepCopy(formData)
  625. if (!this.patientRegister.patientRegisterRd.id) {
  626. this.patientRegister.patientRegisterRd.customerOrgId = this.patientRegister.query.customerOrgId
  627. }
  628. },
  629. //点击体检次数行
  630. rowClick(row) {
  631. // 按住了shift键
  632. // if (this.window.shift) {
  633. // //清除所有选择
  634. // this.tableData.forEach((e, index) => {
  635. // e.choosed = false;
  636. // e.index = index;
  637. // });
  638. // if (this.startPoint == -1) {
  639. // this.tableData[row.index].choosed = true;
  640. // this.startPoint = row.index;
  641. // } else {
  642. // if (this.startPoint > row.index) {
  643. // for (let i = row.index; i <= this.startPoint; i++) {
  644. // this.tableData[i].choosed = true;
  645. // }
  646. // } else if (this.startPoint <= row.index) {
  647. // for (let i = this.startPoint; i <= row.index; i++) {
  648. // this.tableData[i].choosed = true;
  649. // }
  650. // }
  651. // }
  652. // } else if (this.window.ctrl) { // 按住了ctrl 键
  653. // this.tableData[row.index].choosed = true;
  654. // if (this.startPoint == -1) {
  655. // this.startPoint = row.index;
  656. // }
  657. // } else {
  658. // // 未按住了ctrl 、shift 键
  659. // //清除所有选择
  660. // // console.log("清除所有选择");
  661. // this.tableData.forEach((e, index) => {
  662. // e.choosed = false;
  663. // e.index = index;
  664. // });
  665. // // console.log(this.tableData, row.index);
  666. // // console.log(this.tableData[row.index].choosed);
  667. // this.tableData[row.index].choosed = true;
  668. // this.startPoint = row.index;
  669. // }
  670. //选中了多个点编辑时,排序最前的作为当前选中的
  671. // console.log('row.index <= this.startPoint', row.index, this.startPoint)
  672. // let lfind = -1
  673. // for (let i = 0; i < this.tableData.length; i++) {
  674. // if (this.tableData[i].choosed) {
  675. // lfind = i
  676. // break
  677. // }
  678. // }
  679. // if (lfind > -1) {
  680. // 弹出编辑框,只有在编辑框显示时,才去触发获取数据
  681. this.dataTransOpts.tableS.patient_register = deepCopy(row)
  682. this.tableDataCurrentRow = deepCopy(row)
  683. this.dataTransOpts.refresh.register_check_asbitem.M++ //触发所选组合项目刷新
  684. // }
  685. },
  686. // 导入企业(青藏公司)数据
  687. btnImportOrgData() {
  688. //
  689. this.dataTransOpts.plus.ImportOrgData++
  690. this.dialogWin.ImportOrgData = true
  691. },
  692. //体检次数 相关操作
  693. btnAdd() {
  694. if (!this.peisid || this.peisid == 'null') {
  695. this.$message.warning({ showClose: true, message: "该用户未选归属体检中心,不能执行此操作!" });
  696. return
  697. }
  698. let customerOrgId = this.patientRegister.query.customerOrgId;
  699. if (!customerOrgId) {
  700. this.$message.warning({ showClose: true, message: "请选择单位或个人" });
  701. return;
  702. }
  703. // this.patientRegister.patientRegisterRdInit.customerOrgId = customerOrgId
  704. // this.setForm(this.patientRegister.patientRegisterRdInit)
  705. // this.patientRegister.patientRegisterAbs = [];
  706. // this.patientRegister.patientRegisterRd.id = ''
  707. // this.dialogWin.PatientRegisterEdit = true;
  708. // this.editTimes++; //触发表单窗口,数据更新
  709. // this.getPatientRegisterAbs();
  710. this.dataTransOpts.tableS.patient_register.id = ''
  711. this.dialogWin.PatientRegisterEdit = true;
  712. this.dataTransOpts.plus.clearPatientRegisterQuery++ //触发清空人员登记界面的查询条件
  713. setTimeout(() => {
  714. this.dataTransOpts.refresh.patient_register.S++ //触发人员信息刷新
  715. }, 10);
  716. },
  717. //批量正式登记
  718. btnAddBatch(completeFlag) {
  719. let patientRegisterIds = []
  720. //取消勾选,换成选择的方式 start
  721. // this.multipleSelection = [];
  722. // this.tableData.forEach((e) => {
  723. // if (e.choosed && e.completeFlag == '0') {
  724. // this.multipleSelection.push(e);
  725. // patientRegisterIds.push(e.id)
  726. // }
  727. // });
  728. //取消勾选,换成选择的方式 end
  729. if (this.multipleSelection.length < 1) {
  730. this.$message.info({ showClose: true, message: "请勾选要操作的记录!" });
  731. return;
  732. }
  733. this.multipleSelection.forEach(e => {
  734. switch (completeFlag) {
  735. case '0':
  736. if (e.completeFlag == '1') patientRegisterIds.push(e.id)
  737. break;
  738. case '1':
  739. if (e.completeFlag == '0') patientRegisterIds.push(e.id)
  740. break;
  741. }
  742. });
  743. if (patientRegisterIds.length == 0) {
  744. this.$message.info({ showClose: true, message: "没有可操作的数据!" });
  745. return;
  746. }
  747. let body = { completeFlag, patientRegisterIds }
  748. postapi('/api/app/patientregister/updatepatientregistercompleteflagormedicalstartdate', body)
  749. .then(res => {
  750. if (res.code != -1) {
  751. // console.log('操作成功!')
  752. patientRegisterIds.forEach(e => {
  753. let lfind = arrayExistObj(this.tableData, 'id', e)
  754. if (lfind > -1) this.tableData[lfind].completeFlag = completeFlag
  755. });
  756. }
  757. })
  758. .catch(err => {
  759. this.$message.error({ showClose: true, message: `操作失败 ${err}` });
  760. });
  761. },
  762. // 单个编辑
  763. btnEdit() {
  764. // if (!this.patientRegister.patientRegisterRd.id) {
  765. if (!this.dataTransOpts.tableS.patient_register.id) {
  766. this.$message.warning({ showClose: true, message: "请选择要操作的记录" });
  767. return;
  768. }
  769. //// console.log(this.patientRegister.patientRegisterRd,this.tableData)
  770. // 触发数据刷新
  771. this.dataTransOpts.refresh.patient_register.S++ //触发人员信息刷新(会同时刷新组合项目)
  772. this.dataTransOpts.plus.clearPatientRegisterQuery++ //触发清空人员登记界面的查询条件
  773. this.dialogWin.PatientRegisterEdit = true;
  774. },
  775. //新增或编辑后选中记录
  776. async close_dialogWin_PatientRegisterEdit() {
  777. // 如果 dataTransOpts.tableS.patient_register.id 为空(未增加),则不做处理
  778. let id = this.dataTransOpts.tableS.patient_register.id
  779. if (!id) {
  780. id = this.tableDataCurrentRow.id
  781. }
  782. if (!id) return
  783. this.dataTransOpts.tableS.patient_register.id = id
  784. let res = await postapi('/api/app/patientregister/getlistinfilter', { patientRegisterNo: this.dataTransOpts.tableS.patient_register.patientRegisterNo })
  785. if (res.code != 1) return
  786. let currentRow = res.data.items[0]
  787. // this.tableData.forEach(e => {
  788. // e.choosed = false
  789. // });
  790. let lfind = arrayExistObj(this.tableData, 'id', this.dataTransOpts.tableS.patient_register.id)
  791. if (lfind > -1) {
  792. objCopy(currentRow, this.tableData[lfind])
  793. } else {
  794. lfind = this.tableData.length
  795. currentRow.index = lfind
  796. currentRow.choosed = true
  797. this.tableData.push(currentRow)
  798. }
  799. // 刷新 register_check_asbitem 表记录
  800. if (lfind > -1) {
  801. this.dataTransOpts.refresh.register_check_asbitem.M++
  802. }
  803. },
  804. //拍照
  805. openCamera() {
  806. if (!this.patientRegister.patientRegisterId) {
  807. this.$message.warning({ showClose: true, message: "请选择要操作的记录" });
  808. return;
  809. }
  810. this.patientRegister.cameraVisble = true;
  811. },
  812. //删除(可批量删除)
  813. // /api/app/patient-register/many?PatientRegisterIds=3a0c2cac-f44c-f407-9504-c1fc5e80a159&PatientRegisterIds=3a0c2cb3-d10c-ed70-db6a-b835e75ce641
  814. btnDel() {
  815. //选中(取消勾选)start -------------------------
  816. // this.multipleSelection = []
  817. // this.tableData.forEach(e => {
  818. // if (e.choosed) {
  819. // this.multipleSelection.push(deepCopy(e))
  820. // }
  821. // })
  822. //选中(取消勾选) end -------------------------
  823. if (this.multipleSelection.length < 1) {
  824. this.$message.warning({ showClose: true, message: "请先勾选要操作的记录" });
  825. return;
  826. }
  827. let patientRegisterIds = [];
  828. for (let i = 0; i < this.multipleSelection.length; i++) {
  829. patientRegisterIds.push(this.multipleSelection[i]["id"]);
  830. }
  831. this.$confirm("此操作将永久删除该记录, 是否继续?", "提示", {
  832. confirmButtonText: "是",
  833. cancelButtonText: "否",
  834. type: "warning",
  835. })
  836. .then(() => {
  837. //// console.log('{patientRegisterIds}',{patientRegisterIds})
  838. return postapi('/api/app/patient-register/delete-many', {
  839. patientRegisterIds,
  840. });
  841. })
  842. .then((res) => {
  843. if (res.code != -1) {
  844. // console.log("操作成功");
  845. this.dataTransOpts.tableS.patient_register.id = ''
  846. setTimeout(() => {
  847. this.dataTransOpts.refresh.register_check_asbitem.M++
  848. }, 10);
  849. arrayReduce(this.tableData, this.multipleSelection, 'id=id') //清除列表记录
  850. // this.setForm(this.patientRegister.patientRegisterRdInit)
  851. // this.getPatientRegisterAbs();
  852. }
  853. })
  854. .catch((err) => {
  855. if (err == "cancel") {
  856. this.$message.info({ showClose: true, message: "已取消操作" });
  857. }
  858. });
  859. },
  860. //查询
  861. async Query() {
  862. // 查询时,清掉明细数据 (滚动时不清)
  863. this.dataTransOpts.tableS.patient_register.id = ''
  864. this.tableDataCurrentRow = {} // 清除选择
  865. this.tableData = []
  866. setTimeout(() => {
  867. this.dataTransOpts.refresh.register_check_asbitem.M++ //触发所选组合项目刷新
  868. }, 10);
  869. this.loadOpts = Object.assign(this.loadOpts, this.loadOptsInit)
  870. await this.getPrList()
  871. },
  872. //数据量多时,滚动加载
  873. async load() {
  874. this.loadOpts.skipCount++
  875. await this.getPrList()
  876. },
  877. // 获取列表数据
  878. async getPrList() {
  879. if (this.loadOpts.skipCount != 0 && this.loadOpts.skipCount * this.loadOpts.maxResultCount >= this.loadOpts.totalCount) return
  880. // console.log('getPrList', this.loadOpts)
  881. let body = {
  882. skipCount: this.loadOpts.skipCount,
  883. maxResultCount: this.loadOpts.maxResultCount
  884. };
  885. // console.log(`this.patientRegister.query`, this.patientRegister.query);
  886. if (this.patientRegister.query.customerOrgFlag) {
  887. // if (this.patientRegister.query.CustomerOrgParentId) {
  888. // body.customerOrgId = this.patientRegister.query.CustomerOrgParentId;
  889. // } else {
  890. // if (this.patientRegister.query.customerOrgId)
  891. // body.customerOrgId = this.patientRegister.query.customerOrgId;
  892. // }
  893. if (this.patientRegister.query.customerOrgId) body.customerOrgId = this.patientRegister.query.customerOrgId;
  894. if (this.patientRegister.query.customerOrgId
  895. && this.patientRegister.query.customerOrgId != this.dict.personOrgId
  896. && this.patientRegister.query.customerOrgRegister.id) {
  897. body.customerOrgRegisterId = this.patientRegister.query.customerOrgRegister.id
  898. }
  899. }
  900. if (this.patientRegister.query.sex)
  901. body.sexId = this.patientRegister.query.sex;
  902. if (this.patientRegister.query.patientName)
  903. body.patientName = this.patientRegister.query.patientName;
  904. if (this.patientRegister.query.medicalTypeIds && this.patientRegister.query.medicalTypeIds.length > 0)
  905. body.medicalTypeIds = this.patientRegister.query.medicalTypeIds;
  906. if (this.patientRegister.query.completeFlags && this.patientRegister.query.completeFlags.length > 0)
  907. body.completeFlags = this.patientRegister.query.completeFlags;
  908. //StartDate EndDate
  909. if (
  910. this.patientRegister.query.startDate &&
  911. this.patientRegister.query.endDate
  912. ) {
  913. body.dateType = this.patientRegister.query.dateType
  914. body.startDate = moment(this.patientRegister.query.startDate).format(
  915. "yyyy-MM-DD"
  916. );
  917. body.endDate = moment(this.patientRegister.query.endDate).format(
  918. "yyyy-MM-DD"
  919. );
  920. if (body.startDate > body.endDate) {
  921. this.$message.warning({ showClose: true, message: "起始日期不能大于截止日期,数据校验不通过!" });
  922. return;
  923. }
  924. }
  925. if (this.patientRegister.query.phone)
  926. body.phone = this.patientRegister.query.phone;
  927. if (this.patientRegister.query.idCardNo)
  928. body = {
  929. idNo: this.patientRegister.query.idCardNo,
  930. skipCount: this.loadOpts.skipCount,
  931. maxResultCount: this.loadOpts.maxResultCount
  932. };
  933. if (this.patientRegister.query.patientNo)
  934. body = {
  935. patientNo: this.patientRegister.query.patientNo,
  936. skipCount: this.loadOpts.skipCount,
  937. maxResultCount: this.loadOpts.maxResultCount
  938. };
  939. if (this.patientRegister.query.patientRegisterNo)
  940. body = {
  941. patientRegisterNo: this.patientRegister.query.patientRegisterNo,
  942. skipCount: this.loadOpts.skipCount,
  943. maxResultCount: this.loadOpts.maxResultCount
  944. };
  945. // console.log("/api/app/patientregister/getlistinfilter", body);
  946. postapi("/api/app/patientregister/getlistinfilter", body)
  947. .then(res => {
  948. if (res.code > -1) {
  949. // 刷新最大记录数
  950. this.loadOpts.totalCount = res.data.totalCount
  951. let curLoad = res.data.items
  952. // let oldCount = 0
  953. // 处理分组/套餐 排序混乱的问题
  954. curLoad.forEach(e => {
  955. if(e.customerOrgId == this.dict.personOrgId){
  956. e.groupPack = e.medicalPackageId
  957. }else{
  958. e.groupPack = e.customerOrgGroupId
  959. }
  960. });
  961. if (body.skipCount == 0) { //查询
  962. this.tableData = [];
  963. }
  964. this.tableData = this.tableData.concat(curLoad)
  965. // else {
  966. // // 懒加载 ,原数据集不用清空
  967. // oldCount = this.tableData.length
  968. // }
  969. // curLoad.forEach((e, index) => {
  970. // this.tableData.push(Object.assign({ index: Number(oldCount) + Number(index), choosed: false }, e))
  971. // })
  972. //如果 有选中 记录,则刷新其对应的组合项目
  973. if (this.dataTransOpts.tableS.patient_register.id) {
  974. this.dataTransOpts.refresh.register_check_asbitem.M++
  975. }
  976. }
  977. })
  978. },
  979. //滚动加载数据
  980. scrollFull() {
  981. this.dom = this.$refs['info'].bodyWrapper
  982. // console.log('this.dom', this.dom)
  983. this.dom.addEventListener('scroll', async () => {
  984. // // console.log('scrollTop',this.dom.scrollTop,'clientHeight',this.dom.clientHeight,'scrollHeight',this.dom.scrollHeight);
  985. if (this.dom.scrollTop + this.dom.clientHeight + 20 > this.dom.scrollHeight && !this.lazyLoading) {
  986. // 获取到的不是全部数据 当滚动到底部
  987. // console.log('scrollTop', this.dom.scrollTop, 'clientHeight', this.dom.clientHeight, 'scrollHeight', this.dom.scrollHeight);
  988. if ((Number(this.loadOpts.skipCount) + 1) * Number(this.loadOpts.maxResultCount) >= Number(this.loadOpts.totalCount)) {
  989. this.lazyLoading = false
  990. } else {
  991. this.lazyLoading = true
  992. await this.load()
  993. this.lazyLoading = false
  994. // this.dom.scrollTop = this.dom.scrollTop - 100
  995. }
  996. }
  997. })
  998. },
  999. close_dialogWin_upBaseInfo() {
  1000. this.upBaseInfo.visble = false
  1001. this.close_dialogWin_PatientRegisterEdit()
  1002. },
  1003. btnUpBaseInfo() {
  1004. let body = {
  1005. patientRegisterId: this.upBaseInfo.patientRegisterId,
  1006. // "patientName": "string",
  1007. // "mobileTelephone": "string",
  1008. // "idNo": "string"
  1009. }
  1010. body[this.upBaseInfo.colName] = this.upBaseInfo.value
  1011. postapi('/api/app/PatientRegister/UpdatePatientRegisterBaseInfoByPatientRegisterId', body).then(res => {
  1012. if (res.code > -1) {
  1013. this.close_dialogWin_upBaseInfo()
  1014. }
  1015. })
  1016. },
  1017. // 修改基本信息
  1018. fnUpBaseInfo(row, baseInfoType) {
  1019. this.dataTransOpts.tableS.patient_register.id = row.id
  1020. this.upBaseInfo.visble = true
  1021. this.upBaseInfo.patientRegisterId = row.id
  1022. this.upBaseInfo.colName = baseInfoType
  1023. switch (baseInfoType) {
  1024. case "idNo":
  1025. this.upBaseInfo.label = "新身份证号"
  1026. break;
  1027. case "mobileTelephone":
  1028. this.upBaseInfo.label = "新手机号"
  1029. break;
  1030. default:
  1031. this.upBaseInfo.label = "新姓名"
  1032. break;
  1033. }
  1034. this.upBaseInfo.value = row[baseInfoType]
  1035. },
  1036. // 分诊排队
  1037. fnQueue(row) {
  1038. this.queueParams = {
  1039. patientRegisterId: row.id
  1040. }
  1041. this.dialogWin.queue = true
  1042. this.dataTransOpts.plus.queue++
  1043. },
  1044. //右击菜单
  1045. onCellRightClick(row, column) {
  1046. this.rClickRow = { ...row }; //右击的行记录
  1047. this.rClickColumn = { ...column }; //右击的列(预留)
  1048. // console.log(row, column.property);
  1049. },
  1050. onContextmenu(event) {
  1051. //// console.log('onContextmenu',event);
  1052. if (!this.rClickRow) return false;
  1053. let row = { ...this.rClickRow };
  1054. let items = [] //菜单项
  1055. if (checkPagePriv(this.pagePriv.privs, '修改姓名') && row.completeFlag != '0')
  1056. items.push({
  1057. label: "修改姓名",
  1058. onClick: () => {
  1059. this.fnUpBaseInfo(row, 'patientName');
  1060. },
  1061. })
  1062. if (checkPagePriv(this.pagePriv.privs, '修改手机号') && row.completeFlag != '0')
  1063. items.push({
  1064. label: "修改手机号",
  1065. onClick: () => {
  1066. this.fnUpBaseInfo(row, 'mobileTelephone');
  1067. },
  1068. })
  1069. if (checkPagePriv(this.pagePriv.privs, '修改身份证号') && row.completeFlag != '0')
  1070. items.push({
  1071. label: "修改身份证号",
  1072. onClick: () => {
  1073. this.fnUpBaseInfo(row, 'idNo');
  1074. },
  1075. })
  1076. if (checkPagePriv(this.pagePriv.privs, '分诊排队') && row.completeFlag != '0')
  1077. items.push({
  1078. label: "分诊排队",
  1079. onClick: () => {
  1080. this.fnQueue(row);
  1081. },
  1082. })
  1083. if (checkPagePriv(this.pagePriv.privs, '发送检验申请') && row.completeFlag != '0')
  1084. items.push({
  1085. label: "发送检验申请",
  1086. onClick: () => {
  1087. this.lisRequest(row);
  1088. },
  1089. })
  1090. if (checkPagePriv(this.pagePriv.privs, '预览人员条码') && row.completeFlag != '0')
  1091. items.push({
  1092. label: "预览人员条码",
  1093. onClick: () => {
  1094. this.guidePrintPromise("0008", true, row);
  1095. },
  1096. })
  1097. if (checkPagePriv(this.pagePriv.privs, '预览检验条码') && row.completeFlag != '0')
  1098. items.push({
  1099. label: "预览检验条码",
  1100. onClick: () => {
  1101. this.lisPrint(row, "0002", true);
  1102. },
  1103. })
  1104. if (checkPagePriv(this.pagePriv.privs, '打印检验条码') && row.completeFlag != '0')
  1105. items.push({
  1106. label: "打印检验条码",
  1107. onClick: () => {
  1108. this.lisPrint(row, "0002", false);
  1109. },
  1110. })
  1111. if (checkPagePriv(this.pagePriv.privs, '预览Pacs条码') && row.completeFlag != '0')
  1112. items.push({
  1113. label: "预览Pacs条码",
  1114. onClick: () => {
  1115. this.pacsPrint(row, "0004", true);
  1116. },
  1117. })
  1118. if (checkPagePriv(this.pagePriv.privs, '打印Pacs条码') && row.completeFlag != '0')
  1119. items.push({
  1120. label: "打印Pacs条码",
  1121. onClick: () => {
  1122. this.pacsPrint(row, "0004", false);
  1123. },
  1124. })
  1125. if (checkPagePriv(this.pagePriv.privs, '导入检查结果') && row.completeFlag != '0')
  1126. items.push({
  1127. label: "导入检查结果",
  1128. onClick: () => {
  1129. this.importResult('pacs', row);
  1130. },
  1131. })
  1132. if (checkPagePriv(this.pagePriv.privs, '导入检验结果') && row.completeFlag != '0')
  1133. items.push({
  1134. label: "导入检验结果",
  1135. onClick: () => {
  1136. this.importResult('lis', row);
  1137. },
  1138. })
  1139. if (checkPagePriv(this.pagePriv.privs, '批量更新组合项目明细') && this.multipleSelection.length > 0)
  1140. items.push({
  1141. label: "批量更新组合项目明细",
  1142. onClick: () => {
  1143. this.btnItemBatch();
  1144. },
  1145. })
  1146. if (checkPagePriv(this.pagePriv.privs, '调整检查项目医生') && this.multipleSelection.length > 0)
  1147. items.push({
  1148. label: "调整检查项目医生",
  1149. onClick: () => {
  1150. this.dataTransOpts.plus.PatientRegisterEditDoctorBatch++ //如果放在弹窗显示后面,在首次加载子组件时,会触发两次数据处理
  1151. this.dialogWin.PatientRegisterEditDoctorBatch = true;
  1152. },
  1153. })
  1154. items.push({ label: "----------------", })
  1155. this.$contextmenu({
  1156. items,
  1157. event,
  1158. //x: event.clientX,
  1159. //y: event.clientY,
  1160. customClass: "custom-class",
  1161. zIndex: 3,
  1162. minWidth: 80,
  1163. });
  1164. this.rClickRow = null;
  1165. return false;
  1166. },
  1167. //批量更新分组按钮
  1168. btnGroupBatch() {
  1169. let customerOrgId = this.patientRegister.query.customerOrgId;
  1170. if (!customerOrgId) {
  1171. this.$message.warning({ showClose: true, message: "请选择单位" });
  1172. return;
  1173. }
  1174. //取消勾选,换成选择的方式 start
  1175. // this.multipleSelection = [];
  1176. // this.tableData.forEach((e) => {
  1177. // if (e.choosed) this.multipleSelection.push(e);
  1178. // });
  1179. //取消勾选,换成选择的方式 end
  1180. if (this.multipleSelection.length < 1) {
  1181. this.$message.info({ showClose: true, message: "请选择要操作的记录!" });
  1182. return;
  1183. }
  1184. this.dataTransOpts.plus.PatientRegisterEditGroupBatch++
  1185. this.dialogWin.PatientRegisterEditGroupBatch = true;
  1186. },
  1187. //批量更新组合项目
  1188. btnAsbBatch() {
  1189. let customerOrgId = this.patientRegister.query.customerOrgId;
  1190. if (!customerOrgId) {
  1191. this.$message.warning({ showClose: true, message: "请选择单位" });
  1192. return;
  1193. }
  1194. //取消勾选,换成选择的方式 start
  1195. // this.multipleSelection = [];
  1196. // this.tableData.forEach((e) => {
  1197. // if (e.choosed) this.multipleSelection.push(e);
  1198. // });
  1199. //取消勾选,换成选择的方式 end
  1200. if (this.multipleSelection.length < 1) {
  1201. this.$message.warning({ showClose: true, message: "请选择要操作的记录" })
  1202. return
  1203. }
  1204. this.dataTransOpts.plus.PatientRegisterEditItemBatch++ //如果放在弹窗显示后面,在首次加载子组件时,会触发两次数据处理
  1205. this.dialogWin.PatientRegisterEditItemBatch = true;
  1206. },
  1207. //批量更新组合项目
  1208. async btnItemBatch() {
  1209. if (this.multipleSelection.length < 1) {
  1210. this.$message.warning({ showClose: true, message: "请选择要操作的记录" })
  1211. return
  1212. }
  1213. this.elProgress.display = true;
  1214. this.elProgress.percentage = 0;
  1215. for (let i = 0; i < this.multipleSelection.length; i++) {
  1216. let patientRegisterId = this.multipleSelection[i].id
  1217. try {
  1218. await postapi('/api/app/RegisterCheckItem/SyncRegisterCheckItem', { patientRegisterId })
  1219. } catch (error) {
  1220. console.log('printPromise', error)
  1221. }
  1222. this.elProgress.percentage = Math.floor(
  1223. ((i + 1) * 100) / this.multipleSelection.length
  1224. );
  1225. }
  1226. this.elProgress.display = false;
  1227. },
  1228. //检验申请
  1229. async lisRequest(row) {
  1230. let isPrintLisRequest = false;
  1231. let res = null;
  1232. if (row.completeFlag == '0') {
  1233. this.$message.info({ showClose: true, message: "预登记人员,不可执行此操作!" });
  1234. return;
  1235. }
  1236. try {
  1237. res = await postapi(`/api/app/lisrequest/setlisrequest?PatientRegisterId=${row.id}`);
  1238. // console.log(`/ api / app / lisrequest / setlisrequest ? PatientRegisterId = ${ prId }`,res);
  1239. } catch (error) {
  1240. return;
  1241. }
  1242. if (res.code > -1) {
  1243. isPrintLisRequest = true;
  1244. }
  1245. //重复申请,重打
  1246. if (res.code == -1 && res.message.indexOf("已申请") > -1) {
  1247. isPrintLisRequest = true;
  1248. }
  1249. if (!isPrintLisRequest) return;
  1250. try {
  1251. await this.$confirm("是否打印检验申请单?", "提示", {
  1252. confirmButtonText: "是",
  1253. cancelButtonText: "否",
  1254. type: "info",
  1255. showClose: false,
  1256. closeOnClickModal: false,
  1257. closeOnPressEscape: false,
  1258. });
  1259. } catch (error) {
  1260. return;
  1261. }
  1262. //打印检验申请单
  1263. this.lisPrint(row, "0003", false);
  1264. },
  1265. //检验条码打印 改造成 promise
  1266. lisPrint(row, ReportCode, isPreview) {
  1267. return new Promise((resolve, reject) => {
  1268. if (!this.$peisAPI) reject("此功能,需要在壳客户端才可运行!");
  1269. if (!row.completeFlag || row.completeFlag == '0') reject("预登记人员,不可执行此操作!")
  1270. let token = window.sessionStorage.getItem("token");
  1271. let user = window.sessionStorage.getItem("user");
  1272. let toOutShell = {
  1273. ReportCode,
  1274. token,
  1275. IsMoreLabel: 'Y',
  1276. isBuildImage: 'N',
  1277. IsUploadPdf: 'N',
  1278. preViewCanPrint: "N",
  1279. Parameters: [
  1280. { Name: "printer", Value: user },
  1281. { Name: "hisLog", Value: "pic/hisLog.jpg" },
  1282. ],
  1283. BusinessCode: row.id
  1284. };
  1285. console.log('this.$peisAPI.toOutShell', toOutShell)
  1286. if (isPreview) {
  1287. this.$peisAPI.printPre(JSON.stringify(toOutShell))
  1288. .then(res => {
  1289. console.log('this.$peisAPI.printPre', res)
  1290. let lres = JSON.parse(res)
  1291. if (lres.code > -1) {
  1292. resolve(lres)
  1293. } else {
  1294. reject(lres.message);
  1295. }
  1296. })
  1297. .catch((err) => {
  1298. reject(err);
  1299. });
  1300. } else {
  1301. this.$peisAPI.print(JSON.stringify(toOutShell))
  1302. .then(res => {
  1303. console.log('this.$peisAPI.print', res)
  1304. let lres = JSON.parse(res)
  1305. if (lres.code < 0) {
  1306. reject(lres.message);
  1307. } else {
  1308. return postapi("/api/app/lisrequest/updatelisrequestisprint", {
  1309. operateType: 1,
  1310. patientRegisterId: row.id,
  1311. });
  1312. }
  1313. })
  1314. .then(res => {
  1315. if (res && res.code < 0) {
  1316. reject(res.message);
  1317. } else {
  1318. resolve(res)
  1319. }
  1320. })
  1321. .catch((err) => {
  1322. reject(err);
  1323. });
  1324. }
  1325. })
  1326. },
  1327. //pacs条码打印
  1328. pacsPrint(row, ReportCode, isPreview) {
  1329. return new Promise((resolve, reject) => {
  1330. if (!this.$peisAPI) reject("此功能,需要在壳客户端才可运行!");
  1331. if (!row.completeFlag || row.completeFlag == '0') reject("预登记人员,不可执行此操作!")
  1332. let token = window.sessionStorage.getItem("token");
  1333. let user = window.sessionStorage.getItem("user");
  1334. let toOutShell = {
  1335. ReportCode,
  1336. token,
  1337. IsMoreLabel: 'Y',
  1338. isBuildImage: 'N',
  1339. IsUploadPdf: 'N',
  1340. preViewCanPrint: "N",
  1341. Parameters: [
  1342. { Name: "printer", Value: user },
  1343. { Name: "hisLog", Value: "pic/hisLog.jpg" },
  1344. ],
  1345. BusinessCode: row.id
  1346. };
  1347. console.log('this.$peisAPI.print', toOutShell)
  1348. if (isPreview) {
  1349. this.$peisAPI.printPre(JSON.stringify(toOutShell))
  1350. .then(res => {
  1351. console.log('this.$peisAPI.printPre', res)
  1352. let lres = JSON.parse(res)
  1353. if (lres.code > -1) {
  1354. resolve(lres)
  1355. } else {
  1356. reject(lres.message);
  1357. }
  1358. })
  1359. .catch((err) => {
  1360. reject(err);
  1361. });
  1362. } else {
  1363. this.$peisAPI.print(JSON.stringify(toOutShell))
  1364. .then(res => {
  1365. console.log('this.$peisAPI.print', res)
  1366. let lres = JSON.parse(res)
  1367. if (lres.code > -1) {
  1368. resolve(lres)
  1369. } else {
  1370. reject(lres.message);
  1371. }
  1372. })
  1373. .catch((err) => {
  1374. reject(err);
  1375. });
  1376. }
  1377. })
  1378. },
  1379. // 导入检查检验结果
  1380. importResult(checkType, row) {
  1381. let url = '/api/app/ImportLisResult/ImportResultByPatientRegisterId'
  1382. switch (checkType) {
  1383. case 'pacs':
  1384. url = '/api/app/ImportPacsResult/ImportResultByPatientRegisterId'
  1385. postapi(url, { patientRegisterId: row.id })
  1386. .then(res => {
  1387. if (res.code > -1) {
  1388. return postapi('/api/app/ImportElectrocardiogramResult/ImportElectrocardiogramResultByPatientRegisterId', { patientRegisterId: row.id })
  1389. }
  1390. })
  1391. .then(res => {
  1392. if (res && res.code > -1) {
  1393. this.$message.success({ showClose: true, message: '导入成功!' })
  1394. this.rowClick(row)
  1395. }
  1396. })
  1397. break;
  1398. default:
  1399. postapi(url, { patientRegisterId: row.id }).then(res => {
  1400. if (res.code > -1) {
  1401. this.$message.success({ showClose: true, message: '导入成功!' })
  1402. this.rowClick(row)
  1403. }
  1404. })
  1405. break;
  1406. }
  1407. },
  1408. //通用导出
  1409. btnExport(elId) {
  1410. // 获取HTML元素(表格)
  1411. // let table = document.getElementById(elId); //.cloneNode(true)
  1412. this.$nextTick(() => {
  1413. // let refsTable = this.$refs[elId] //.cloneNode(true) true
  1414. let table = document.getElementById(elId)
  1415. // console.log('table,refsTable', table, refsTable)
  1416. let tableData = table.innerHTML
  1417. let fileName = moment(new Date()).format('yyyyMMDDHHmmss')
  1418. let blob = new Blob([tableData], { type: "text/plain;charset=utf-8" });
  1419. FileSaver.saveAs(blob, fileName + '.xls');
  1420. // 导出图片
  1421. // 使用html2canvas将HTML元素转换为画布
  1422. // let cloneTable = table.cloneNode(true) //[elId]
  1423. /*
  1424. html2canvas(table).then(canvas => {
  1425. // 创建一个a元素用于下载
  1426. const link = document.createElement('a');
  1427. link.href = canvas.toDataURL('image/jpeg');
  1428. link.download = fileName + '.jpg';
  1429. document.body.appendChild(link);
  1430. link.click();
  1431. //document.body.removeChild(link);
  1432. // // 创建一个PDF对象
  1433. // var pdf = new jsPDF();
  1434. // // 设置PDF的尺寸
  1435. // pdf.addImage(canvas.toDataURL('image/png'), 'PNG', 0, 0, canvas.width, canvas.height);
  1436. // // 导出PDF
  1437. // pdf.save('员工信息表.pdf');
  1438. });
  1439. */
  1440. })
  1441. },
  1442. btnDragColDesign() {
  1443. this.dragColDesign = deepCopy(this.dragCol)
  1444. this.dialogColSort = true
  1445. this.rowDrag()
  1446. },
  1447. btnDragColDesignOk() {
  1448. this.dragCol = deepCopy(this.dragColDesign)
  1449. this.dialogColSort = false
  1450. },
  1451. //拖拽
  1452. rowDrag() {
  1453. this.$nextTick(() => {
  1454. const el = document.querySelector("#elTable_dragCol tbody");
  1455. // console.log('el0', el)
  1456. const that = this;
  1457. Sortable.create(el, {
  1458. animation: 150, // ms, number 单位:ms,定义排序动画的时间
  1459. //拖拽结束
  1460. onEnd({ newIndex, oldIndex }) {
  1461. that.isshow = false;
  1462. const currRow = that.dragColDesign.splice(oldIndex, 1)[0];
  1463. that.dragColDesign.splice(newIndex, 0, currRow);
  1464. // console.log('el', el)
  1465. },
  1466. });
  1467. });
  1468. },
  1469. },
  1470. //监听事件
  1471. watch: {
  1472. "patientRegister.query.customerOrgId": {
  1473. // immediate: true, // 立即执行
  1474. // deep: true, // 深度监听复杂类型内变化
  1475. handler(newVal, oldVal) {
  1476. //// console.log('watch:patientRegister.query.customerOrgId:',newVal,oldVal)
  1477. // 单位变化时,清除当前列表信息
  1478. if (newVal && newVal != oldVal) {
  1479. this.tableData = []
  1480. this.dataTransOpts.tableM.register_check_asbitem = []
  1481. }
  1482. }
  1483. },
  1484. //触发查询事件
  1485. "patientRegister.query.times"(newVal, oldVal) {
  1486. if (newVal != oldVal) {
  1487. //alert('触发查询事件')
  1488. this.Query();
  1489. }
  1490. },
  1491. //新增后,触发赋值
  1492. // "patientRegister.patientRegisterRd.id"(newVal, oldVal) {
  1493. // if (newVal != oldVal) {
  1494. // //// console.log('patientRegister.patientRegisterRd.customerOrgId',this.patientRegister.patientRegisterRd.customerOrgId)
  1495. // objCopy(this.patientRegister.patientRegisterRd, this.form);
  1496. // }
  1497. // },
  1498. },
  1499. };
  1500. </script>
  1501. <style scoped>
  1502. @import "../../assets/css/global_input.css";
  1503. @import "../../assets/css/global_table.css";
  1504. @import "../../assets/css/global.css";
  1505. .box {
  1506. display: flex;
  1507. }
  1508. .listBtn {
  1509. margin-top: 5px;
  1510. text-align: center;
  1511. }
  1512. .btnClass {
  1513. width: 100px;
  1514. }
  1515. </style>