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.

1609 lines
55 KiB

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