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.

1671 lines
60 KiB

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