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.

552 lines
19 KiB

3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
2 months ago
3 months ago
3 months ago
3 months ago
3 months ago
2 months ago
3 months ago
3 months ago
2 months ago
3 months ago
2 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
2 months ago
3 months ago
3 months ago
3 months ago
3 months ago
15 hours ago
3 months ago
15 hours ago
3 months ago
15 hours ago
3 months ago
3 months ago
3 months ago
15 hours ago
3 months ago
15 hours ago
3 months ago
15 hours ago
1 month ago
1 month ago
1 month ago
15 hours ago
1 month ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
2 months ago
3 months ago
3 months ago
  1. <template>
  2. <div @contextmenu="onContextmenu">
  3. <div style="display: flex; flex-wrap: wrap;height:70px; width: 100%;overflow-y: auto;">
  4. <div>
  5. <span class="query">条码号</span>
  6. <el-input ref="tmh" placeholder="条码号" v-model="prBase.patientRegisterNo" size="small" style="width: 120px;"
  7. clearable />
  8. </div>
  9. <div>
  10. <el-tooltip content="点击显示该人员调查问卷信息" placement="top">
  11. <el-button type="primary" style="margin-left: 5px;margin-top: 3px; height: 22px;padding: 2px 2px;"
  12. @click="btnQuestion">档案号</el-button>
  13. </el-tooltip>
  14. <el-input placeholder="档案号" v-model="prBase.patientNo" size="small" style="width: 90px;" clearable />
  15. </div>
  16. <div>
  17. <span class="query">姓名</span>
  18. <el-input placeholder="姓名" v-model="prBase.patientName" size="small" style="width: 100px;" clearable />
  19. </div>
  20. <div>
  21. <span class="query">检查条码</span>
  22. <el-input placeholder="检查条码" v-model="prBase.pacsNo" size="small" style="width: 120px;" clearable />
  23. </div>
  24. <div>
  25. <span class="query">检验条码</span>
  26. <el-input placeholder="检验条码" v-model="prBase.lisNo" size="small" style="width: 120px;" clearable />
  27. </div>
  28. <div>
  29. <el-button type="primary" style="margin-left: 5px;margin-top: 3px; height: 22px;padding: 2px 2px;"
  30. @click="readIdCard">读身份证</el-button>
  31. <el-input placeholder="身份证号" v-model="prBase.idNo" size="small" style="width: 150px;" clearable />
  32. </div>
  33. <div>
  34. <span class="query">手机</span>
  35. <el-input placeholder="手机号" v-model="prBase.mobileTelephone" style="width: 120px;" size="small" clearable />
  36. </div>
  37. <div>
  38. <span class="query">性别</span>
  39. <!--
  40. <el-select v-model="prBase.sexId" style="width: 80px;" size="small" disabled>
  41. <el-option v-for="item in dict.sex" :key="item.id" :label="item.displayName" :value="item.id" />
  42. </el-select>
  43. -->
  44. <el-input v-model="prBase.sexName" size="small" style="width: 40px;" disabled />
  45. </div>
  46. <div>
  47. <span class="query">年龄</span>
  48. <el-input v-model="prBase.age" size="small" style="width: 40px;" disabled />
  49. </div>
  50. <div>
  51. <span class="query">体检次数</span>
  52. <el-input v-model="prBase.medicalTimes" size="small" style="width: 40px;" disabled />
  53. </div>
  54. <div>
  55. <span class="query">婚姻</span>
  56. <!--
  57. <el-select v-model="prBase.maritalStatusId" style="width: 80px;" size="small" disabled>
  58. <el-option v-for="item in dict.maritalStatus" :key="item.id" :label="item.displayName" :value="item.id" />
  59. </el-select>
  60. -->
  61. <el-input v-model="prBase.maritalStatusName" size="small" style="width: 40px;" disabled />
  62. </div>
  63. <div>
  64. <span class="query">体检日期</span>
  65. <el-input :value="prBase.medicalStartDate ? lmoment(prBase.medicalStartDate, 'yyyy-MM-DD') : ''"
  66. style="width: 100px;" size="small" disabled></el-input>
  67. </div>
  68. <div>
  69. <span class="query">单位</span>
  70. <el-input v-model="prBase.customerOrgParentName" style="width: 150px;" size="small" disabled />
  71. </div>
  72. <div>
  73. <span class="query">部门</span>
  74. <el-input v-model="prBase.customerOrgName" style="width: 120px;" size="small" disabled />
  75. </div>
  76. <div>
  77. <span class="query">体检类别</span>
  78. <!--
  79. <el-select v-model="prBase.medicalTypeId" disabled style="width: 100px;" size="small">
  80. <el-option v-for="item in dict.medicalType" :key="item.id" :label="item.displayName" :value="item.id" />
  81. </el-select>
  82. -->
  83. <el-input v-model="prBase.medicalTypeName" style="width: 100px;" size="small" disabled />
  84. </div>
  85. <div>
  86. <span class="query">人员类别</span>
  87. <!--
  88. <el-select v-model="prBase.personnelTypeId" disabled style="width: 100px;" size="small">
  89. <el-option v-for="item in dict.personnelType" :key="item.id" :label="item.displayName" :value="item.id" />
  90. </el-select>
  91. -->
  92. <el-input v-model="prBase.personnelTypeName" style="width: 100px;" size="small" disabled />
  93. </div>
  94. <div>
  95. <span class="query">民族</span>
  96. <!--
  97. <el-select v-model="prBase.nationId" disabled style="width: 100px;" size="small">
  98. <el-option v-for="item in dict.nation" :key="item.id" :label="item.displayName" :value="item.id" />
  99. </el-select>
  100. -->
  101. <el-input v-model="prBase.nationName" style="width: 80px;" size="small" disabled />
  102. </div>
  103. </div>
  104. <!-- 体检人员记录列表 -->
  105. <el-dialog title="体检人员列表" :visible.sync="dialogWin.PatientRegisterForChoose" width="800px" :show-close="false"
  106. :close-on-click-modal="false" :append-to-body="true">
  107. <PatientRegisterForChoose :params="PatientRegisterList" @chooseBak="chooseBak" />
  108. </el-dialog>
  109. <el-dialog title="调查问卷" :visible.sync="dialogWin.question" width="800px" :close-on-click-modal="false"
  110. :append-to-body="true">
  111. <Question :refParams="questionParams" />
  112. </el-dialog>
  113. </div>
  114. </template>
  115. <script>
  116. import moment from "moment";
  117. import { mapState, mapMutations } from "vuex";
  118. import { getapi, postapi, putapi, deletapi } from "@/api/api";
  119. import { dddw, deepCopy, objCopy, opjCopy, parsIcCardtoLocal } from '../../utlis/proFunc'
  120. import PatientRegisterForChoose from "../../components/patientRegister/PatientRegisterForChoose.vue";
  121. import Question from "../../components/doctorCheck/Question.vue";
  122. export default {
  123. components: {
  124. PatientRegisterForChoose, Question
  125. },
  126. props: ["refParams"],
  127. data() {
  128. return {
  129. dialogVisible: false,
  130. prBase: {
  131. id: '', //体检登记ID
  132. patientRegisterNo: '', //条码号
  133. pacsNo: '', //
  134. lisNo: '',
  135. patientNo: '', //档案号
  136. patientName: '', //姓名
  137. sexId: '', //性别
  138. sexName: '', //性别
  139. idNo: '', // 身份证号
  140. age: '', // 年龄
  141. medicalTimes: '', //体检次数
  142. maritalStatusId: '', //婚姻
  143. maritalStatusName: '', //婚姻
  144. medicalStartDate: '', //体检日期
  145. customerOrgParentName: '', //单位
  146. customerOrgName: '', //部门
  147. medicalTypeId: '', //体检类别
  148. medicalTypeName: '', //体检类别
  149. personnelTypeId: '', //人员类别
  150. personnelTypeName: '', //人员类别
  151. nationId: '', //民族
  152. nationName: '', //民族
  153. mobileTelephone: '', //手机
  154. },
  155. prBaseInit: {},
  156. PatientRegisterList: [], // 参数
  157. userId: '',
  158. // 调查问卷参数
  159. questionParams: {
  160. idNo: '', // 身份证号
  161. refresh: 0, // 刷新调查问卷
  162. }
  163. };
  164. },
  165. created() {
  166. this.prBaseInit = deepCopy(this.prBase)
  167. },
  168. //挂载完成
  169. mounted() {
  170. // 监听来自 Electron 的调用 右击事件
  171. if (this.$peisAPI) {
  172. try {
  173. this.$peisAPI.onContextMenuAction((data) => {
  174. this.onContextMenuDIY(data)
  175. });
  176. } catch (error) {
  177. console.error(error)
  178. }
  179. }
  180. // 回车替代查询
  181. this.enterToQuery()
  182. this.userId = window.sessionStorage.getItem("userId")
  183. //获取体检登记信息 (检查医生诊台 与 总检医生诊台 切换时用到)
  184. this.getPatientRegister(this.prBase.patientRegisterNo)
  185. this.$nextTick(() => {
  186. this.$refs['tmh'].focus(); //打开光标定位到条码栏里
  187. });
  188. },
  189. computed: {
  190. ...mapState(["dict", "dialogWin", "dataTransOpts", "doctorCheck", "sumDoctorCheck"]),
  191. },
  192. methods: {
  193. ...mapMutations(['doctorCheckPrBaseInit', 'sumPREditInit']),
  194. dddw, moment,
  195. // 选择人员返回
  196. chooseBak(chooseData) {
  197. console.log('chooseBak', chooseData)
  198. this.prBase.patientRegisterNo = chooseData.patientRegisterNo
  199. this.onQueryByOnlyNo('patientRegisterNo')
  200. },
  201. //查询后触发相关信息处理
  202. afterFind(rd) {
  203. this.$emit("triggerQuery", rd)
  204. },
  205. btnQuestion() {
  206. if (!this.prBase.idNo) {
  207. this.$message.warning({ showClose: true, message: '该人员无身份证号,无调查问卷!' })
  208. return
  209. }
  210. this.dialogWin.question = true
  211. this.questionParams.idNo = this.prBase.idNo
  212. this.questionParams.refresh++
  213. },
  214. //读身份证
  215. readIdCard() {
  216. if (!this.$peisAPI) {
  217. this.$message.info({ showClose: true, message: "此功能,需要在壳客户端才可运行!" })
  218. return
  219. }
  220. this.$peisAPI.peopleIcCard().then(res => {
  221. console.log('peopleIcCard', res)
  222. let lres = JSON.parse(res)
  223. if (lres.code > -1) {
  224. let idNos = parsIcCardtoLocal(lres.data, this.dict.sex, this.dict.nation)
  225. this.prBase.patientName = idNos.Name
  226. this.prBase.idNo = idNos.IDCode
  227. this.onQueryByOnlyNo('idNo')
  228. } else {
  229. this.$message.error({ showClose: true, message: lres.message })
  230. }
  231. })
  232. .catch(err => {
  233. this.$message.error({ showClose: true, message: `读取身份证失败,原因:${err}` })
  234. })
  235. },
  236. // 根据pacs条码查询
  237. onQueryByPacsNo(checkRequestNo) {
  238. postapi('/api/app/PatientRegister/GetPatientRegisterNoByCheckRequestNo', { checkRequestNo }).then(res => {
  239. if (res.code > 0) {
  240. this.prBase.patientRegisterNo = res.data.patientRegisterNo
  241. this.onQueryByOnlyNo('patientRegisterNo', 'pacsNo')
  242. }
  243. })
  244. },
  245. // 根据lis条码查询
  246. onQueryByLisNo(lisRequestNo) {
  247. postapi('/api/app/PatientRegister/GetPatientRegisterNoByLisRequestNo', { lisRequestNo }).then(res => {
  248. if (res.code > 0) {
  249. this.prBase.patientRegisterNo = res.data.patientRegisterNo
  250. this.onQueryByOnlyNo('patientRegisterNo', 'lisNo')
  251. }
  252. })
  253. },
  254. //按条码号、档案、身份证 查个人数据
  255. // noType -- 查询关键值字段名
  256. // storeCol -- 保留字段值不刷新(用检查条码与检验条码查时)
  257. onQueryByOnlyNo(noType, storeCol) {
  258. let noVal = this.prBase[noType] //唯一号的值
  259. if (!noVal) return
  260. let body = {}
  261. if (noType == 'idNo') noVal = noVal.toUpperCase()
  262. body[noType] = noVal
  263. let storeObj = {}
  264. let patientRegister = { id: '' }
  265. if (storeCol) storeObj[storeCol] = this.prBase[storeCol]
  266. patientRegister[noType] = noVal
  267. this.prBase = deepCopy(patientRegister)
  268. postapi('/api/app/patientregister/GetAlreadyRegisterPatientRegisterByNo', body)
  269. .then((res) => {
  270. if (res.code > -1) {
  271. this.prBase = Object.assign({},this.prBase, res.data, storeObj)
  272. // ---------- 如果是总检与审核医生不可选时,则总检与审核默认当前用户,此功能放至保存时触发
  273. if (this.prBase.completeFlag != '3') this.prBase.summaryDoctorId = this.prBase.summaryDoctorId || this.userId
  274. if (this.prBase.completeFlag == '3' && this.prBase.isAudit == 'N') {
  275. this.prBase.auditDoctorId = this.prBase.auditDoctorId || this.userId
  276. }
  277. // ----------
  278. console.log('res.data',res.data)
  279. console.log('this.prBase',this.prBase)
  280. console.log('storeObj',storeObj)
  281. }
  282. this.afterFind(this.prBase)
  283. });
  284. },
  285. //按手机号或姓名查找客户信息
  286. onQueryByNotOnlyNo(valType) {
  287. let noVal = this.prBase[valType] //唯一号的值
  288. if (!noVal) return
  289. let body = {
  290. isFilterPreRegistration: 'Y' //是否需要过滤预登记数据 Y=过滤预登记数据 N=不过滤 默认为N (备注:只有CompleteFlag参数的值不为0的情况才有效,null值也有效)
  291. }
  292. let noType = valType
  293. if (valType == 'mobileTelephone') noType = 'phone'
  294. body[noType] = noVal
  295. let patientRegister = { id: '' }
  296. patientRegister[valType] = noVal
  297. this.prBase = deepCopy(patientRegister)
  298. postapi('/api/app/patientregister/getlistinfilter', body)
  299. .then(res => {
  300. if (res.code > -1) {
  301. if (res.data.items.length == 1) {
  302. this.prBase = res.data.items[0]
  303. if (this.prBase.completeFlag != '3') this.prBase.summaryDoctorId = this.userId
  304. if (this.prBase.completeFlag == '3' && this.prBase.isAudit == 'N') {
  305. this.prBase.auditDoctorId = this.userId
  306. }
  307. this.dataTransOpts.refresh.patient_register.S++
  308. // this.getPatientRegister(res.data.items[0].id)
  309. } else if (res.data.items.length > 1) {
  310. this.PatientRegisterList = res.data.items
  311. if (Array.isArray(this.PatientRegisterList) && this.PatientRegisterList.length > 0) {
  312. this.PatientRegisterList.forEach(e => {
  313. e.groupPack = e.medicalPackageName || e.customerOrgGroupName
  314. e.org = e.customerOrgParentName || e.customerOrgName
  315. e.dept = e.customerOrgParentName == e.customerOrgName ? '' : e.customerOrgName
  316. });
  317. }
  318. this.dialogWin.PatientRegisterForChoose = true // 弹窗
  319. this.dataTransOpts.plus.PatientRegisterForChoose++
  320. } else {
  321. this.afterFind(this.prBase)
  322. }
  323. }
  324. })
  325. },
  326. //根据patientRegisterNo 获取 人员信息
  327. getPatientRegister(patientRegisterNo) {
  328. // this.afterFind({ id: '', patientRegisterNo: '' })
  329. if (!patientRegisterNo) return
  330. let body = { patientRegisterNo }
  331. postapi('/api/app/patientregister/GetAlreadyRegisterPatientRegisterByNo', body)
  332. .then((res) => {
  333. if (res.code > -1) {
  334. this.prBase = res.data
  335. if (this.prBase.completeFlag != '3') this.prBase.summaryDoctorId = this.userId
  336. if (this.prBase.completeFlag == '3' && this.prBase.isAudit == 'N') {
  337. this.prBase.auditDoctorId = this.userId
  338. }
  339. }
  340. })
  341. .finally(() => {
  342. this.afterFind(this.prBase)
  343. });
  344. },
  345. lmoment(date, forMat) {
  346. return moment(new Date(date)).format(forMat);
  347. },
  348. //回车替代查询
  349. enterToQuery() {
  350. // console.log('enterToTab');
  351. this.$nextTick(() => {
  352. let inputs = document.querySelectorAll(["input"]); //用数组可以读取多个标签的元素 //.inline-input
  353. // 为每个输入框添加键盘事件监听器
  354. inputs.forEach((input, i) => {
  355. // console.log('input',input);
  356. input.addEventListener('keydown', (event) => {
  357. if (event.keyCode === 13) {
  358. // 阻止回车键的默认行为(换行)
  359. event.preventDefault();
  360. // 如果按下的是回车查询
  361. console.log(input.getAttribute('placeholder'), input.value)
  362. let placeholder = input.getAttribute('placeholder')
  363. switch (placeholder) {
  364. case '条码号':
  365. if (input.value) this.onQueryByOnlyNo('patientRegisterNo') //this.onQueryByPatientRegisterNo()
  366. input.select()
  367. break;
  368. case '档案号':
  369. if (input.value) this.onQueryByOnlyNo('patientNo') //this.onQueryByPatientNo()
  370. input.select()
  371. break;
  372. case '身份证号':
  373. if (input.value) this.onQueryByOnlyNo('idNo') //this.onQueryByPatientNo()
  374. input.select()
  375. break;
  376. case '检查条码':
  377. if (input.value) this.onQueryByPacsNo(input.value)
  378. input.select()
  379. break;
  380. case '检验条码':
  381. if (input.value) this.onQueryByLisNo(input.value)
  382. input.select()
  383. break;
  384. case '姓名':
  385. if (input.value) this.onQueryByNotOnlyNo('patientName') //this.getlistinfilterByName(input.value)
  386. input.select()
  387. break;
  388. case '手机号':
  389. if (input.value) this.onQueryByNotOnlyNo('mobileTelephone') //this.getlistinfilterByName(input.value)
  390. input.select()
  391. break;
  392. }
  393. }
  394. });
  395. input.addEventListener('click', (event) => {
  396. let placeholder = input.getAttribute('placeholder')
  397. switch (placeholder) {
  398. case '条码号':
  399. case '档案号':
  400. case '姓名':
  401. case '检查条码':
  402. case '检验条码':
  403. input.select()
  404. break;
  405. }
  406. });
  407. });
  408. });
  409. },
  410. // 右击菜单
  411. onContextmenu(event) {
  412. if (!this.$peisAPI) {
  413. return
  414. }
  415. let menus = [
  416. // { type: 'separator' },
  417. // { label: '测试菜单', itemId: '测试菜单', enabled: true },
  418. // {
  419. // label: '更多操作',
  420. // submenu: [
  421. // { label: '子菜单', itemId: '子菜单', enabled: true }
  422. // ]
  423. // }
  424. ]
  425. this.$peisAPI.showContextMenu(menus)
  426. .then(res => {
  427. console.log('res', res)
  428. })
  429. .catch(err => {
  430. console.log('err', err)
  431. })
  432. .finally(() => {
  433. console.log('finally')
  434. })
  435. },
  436. // 自定义右击事件
  437. onContextMenuDIY(data) {
  438. //this.$message({showClose:true,message:data})
  439. }
  440. },
  441. watch: {
  442. // "doctorCheck.prBase.id":{
  443. // immediate:true,
  444. // handler(newVal, oldVal) {
  445. // // debugger
  446. // // console.log("watch 2doctorCheck.prBase.id newVal:", newVal, " oldVal:", oldVal);
  447. // // if (newVal != oldVal) {
  448. // objCopy(this.doctorCheck.prBase,this.prBase)
  449. // // this.prBase = Object.assign({},this.doctorCheck.prBase)
  450. // // }
  451. // // console.log(222);
  452. // }
  453. // },
  454. // 强制刷新人员登记信息
  455. "refParams.brushQueryDisp": {
  456. // immediate:true,
  457. handler(newVal, oldVal) {
  458. console.log(`watch 组合项目列表 newVal: ${newVal} oldVal: ${oldVal} patientRegisterId: ${this.refParams.id}`);
  459. if (newVal && newVal != oldVal) {
  460. // this.getPatientRegister(this.prBase.patientRegisterNo)
  461. // this.dataTransOpts.refresh.register_check.M++
  462. this.prBase = Object.assign({}, this.prBase, this.refParams)
  463. }
  464. }
  465. },
  466. // 重置查询条件
  467. "refParams.resetTimes": {
  468. // immediate:true,
  469. handler(newVal, oldVal) {
  470. console.log(`watch.refParams.resetTimes newVal: ${newVal} oldVal: ${oldVal}`);
  471. if (newVal && newVal != oldVal) {
  472. this.prBase = Object.assign({}, this.prBase, this.prBaseInit)
  473. this.$nextTick(() => {
  474. this.$refs['tmh'].focus(); //打开光标定位到条码栏里
  475. });
  476. }
  477. }
  478. },
  479. },
  480. };
  481. </script>
  482. <style scoped>
  483. .query {
  484. margin-left: 10px;
  485. margin-right: 2px;
  486. padding: 1px 1px;
  487. font-size: 14px;
  488. }
  489. ::v-deep .test .el-input__inner {
  490. background-color: yellow !important;
  491. color: red !important;
  492. }
  493. </style>