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.

460 lines
16 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. <template>
  2. <div>
  3. <!--组件主体-->
  4. <div :style="`height: ${tableHeight}px;font-size:14px;z-index:10;background-color: #f4f8ff;`">
  5. <div>
  6. <span>分诊房间</span>
  7. <el-select v-model="LocalConfig.doctorCheck.queueRoom" placeholder="分诊房间" clearable filterable
  8. style="width: 125px" size="small">
  9. <el-option v-for="item in dict.room" :key="item.id" :label="item.displayName" :value="item.id" />
  10. </el-select>
  11. </div>
  12. <div>
  13. <el-cascader :options="dict.itemTypeTree" v-model="LocalConfig.doctorCheck.queueItemTypeIds"
  14. popper-class="example" style="width: 195px" :props="{
  15. checkStrictly: true, expandTrigger: 'hover', label: 'displayName', value: 'id',
  16. id: 'id', children: 'treeChildren', multiple: true
  17. }" clearable filterable size="small" collapse-tags>
  18. </el-cascader>
  19. </div>
  20. <!--
  21. <div>
  22. <span>候诊人员</span>
  23. <el-input placeholder="候诊人员" v-model="patientName" size="small" style="width: 125px;" clearable />
  24. </div>
  25. -->
  26. <div style="display: flex;">
  27. <el-table :data="waitDetail" style="width: 100%;" border highlight-current-row @row-click="rowClickWait"
  28. :row-style="{ height: '28px' }" :height="Math.floor((tableHeight - 72) / 3)">
  29. <el-table-column prop="queueRegisterNumber" label="号" min-width="30" align="center" />
  30. <el-table-column prop="patientName" label="姓名" min-width="80" align="center" />
  31. <el-table-column prop="isVip" label="isVip" min-width="40" align="center">
  32. <template slot-scope="scope">
  33. <div style="font-family: 'Microsoft YaHei';">
  34. {{ scope.row.isVip == 'Y' ? '√' : '' }}
  35. </div>
  36. </template>
  37. </el-table-column>
  38. </el-table>
  39. <div style="margin-top: 20px;">
  40. <div>
  41. <el-button type="primary" class="commonbutton" @click="btnCall(waitRow.queueRegisterId, '1')"
  42. style="width: 40px;min-width: 40px;height: 26px;">呼叫</el-button>
  43. </div>
  44. <div style="margin: 10px 0;">
  45. <el-button type="primary" class="commonbutton"
  46. @click="getQueueRegisterList(LocalConfig.doctorCheck.queueRoom, LocalConfig.doctorCheck.queueItemTypeIds)"
  47. style="width: 40px;min-width: 40px;height: 26px;">刷新</el-button>
  48. </div>
  49. <div>
  50. <el-button type="primary" class="commonbutton" @click="fnQueue"
  51. style="width: 40px;min-width: 40px;height: 26px;">排队</el-button>
  52. </div>
  53. </div>
  54. </div>
  55. <div style="margin-top: 6px;">已呼人员</div>
  56. <div style="display: flex;">
  57. <el-table :data="alreadyCalledDetail" style="width: 100%;" border highlight-current-row
  58. @row-click="rowClickAlready" :row-style="{ height: '28px' }" :height="Math.floor((tableHeight - 72) / 3)">
  59. <el-table-column prop="queueRegisterNumber" label="号" min-width="30" align="center" />
  60. <el-table-column prop="patientName" label="姓名" min-width="80" align="center" />
  61. <el-table-column prop="isVip" label="isVip" min-width="40" align="center">
  62. <template slot-scope="scope">
  63. <div style="font-family: 'Microsoft YaHei';">
  64. {{ scope.row.isVip == 'Y' ? '√' : '' }}
  65. </div>
  66. </template>
  67. </el-table-column>
  68. </el-table>
  69. <div style="margin-top: 20px;">
  70. <div>
  71. <el-button type="primary" class="commonbutton" @click="btnCall(alreadyRow, '2')"
  72. style="width: 40px;min-width: 40px;height: 26px;">过号</el-button>
  73. </div>
  74. </div>
  75. </div>
  76. <div style="margin-top: 6px;">过号人员</div>
  77. <div style="display: flex;">
  78. <el-table :data="overNumberDetail" style="width: 100%;" border highlight-current-row @row-click="rowClickOver"
  79. :row-style="{ height: '28px' }" :height="Math.floor((tableHeight - 72) / 3)">
  80. <el-table-column prop="queueRegisterNumber" label="号" min-width="30" align="center" />
  81. <el-table-column prop="patientName" label="姓名" min-width="80" align="center" />
  82. <el-table-column prop="isVip" label="isVip" min-width="40" align="center">
  83. <template slot-scope="scope">
  84. <div style="font-family: 'Microsoft YaHei';">
  85. {{ scope.row.isVip == 'Y' ? '√' : '' }}
  86. </div>
  87. </template>
  88. </el-table-column>
  89. </el-table>
  90. <div style="margin-top: 20px;">
  91. <div>
  92. <el-button type="primary" class="commonbutton" @click="btnCall(overRow, '9')"
  93. style="width: 40px;min-width: 40px;height: 26px;">重呼</el-button>
  94. </div>
  95. <div style="margin: 10px 0;">
  96. <el-button type="primary" class="commonbutton" @click="btnCall(overRow, '0')"
  97. style="width: 40px;min-width: 40px;height: 26px;">退回</el-button>
  98. </div>
  99. </div>
  100. </div>
  101. </div>
  102. <!--组件弹窗-->
  103. <div>
  104. <!-- 修改信息 -->
  105. <el-dialog title="分诊排队" :visible.sync="dialogWin.queue" width="800px" :append-to-body="true"
  106. :close-on-click-modal="false">
  107. <Queue :refParams="queueParams" />
  108. </el-dialog>
  109. </div>
  110. </div>
  111. </template>
  112. <script>
  113. import { mapState } from 'vuex';
  114. import { getapi, postapi, putapi, deletapi } from "@/api/api";
  115. import { listOrderBy, setCheckStatusColor, deepCopy } from "../../utlis/proFunc"
  116. import Queue from "../../components/queue/Queue.vue";
  117. export default {
  118. components: {
  119. Queue
  120. },
  121. data() {
  122. return {
  123. queueParams: {},
  124. patientName: '',
  125. waitDetail: [],
  126. alreadyCalledDetail: [],
  127. overNumberDetail: [],
  128. waitRow: {},
  129. alreadyRow: {},
  130. overRow: {},
  131. LocalConfig: {
  132. doctorCheck: { // 医生诊台
  133. isQueue: 'N', //启用分诊排队
  134. queueRoom: '', //默认分诊房间
  135. queueItemTypeIds: [], // 检查类别
  136. isBroadcast: 'N', // 是否广播
  137. }
  138. },
  139. LocalConfigInit: {},
  140. interval: null, // 定时器句柄
  141. queue_refresh_interval: 15, // 叫号刷新时间间隔(秒)
  142. queue_play_voice_repeate_times: 2, // 语音重复播放次数
  143. queue_play_voice_repeate_interval: 1, // 语音重复播放时间间隔(秒)
  144. };
  145. },
  146. created() {
  147. },
  148. //挂载完成
  149. mounted() {
  150. this.fnMounted()
  151. },
  152. destroyed() {
  153. console.log('this.interval', JSON.stringify(this.interval))
  154. if (this.interval) clearInterval(this.interval)
  155. console.log('this.interval clearInterval', JSON.stringify(this.interval))
  156. },
  157. computed: {
  158. ...mapState(['window', 'dialogWin', 'dataTransOpts', 'dict', 'doctorCheck']),
  159. tableHeight() {
  160. return this.window.pageHeight < 600 ? 400 : this.window.pageHeight - 200
  161. },
  162. },
  163. methods: {
  164. setCheckStatusColor,
  165. tableRowClassName({ row, rowIndex }) {
  166. //console.log('tableRowClassName',rowIndex,row)
  167. if (row.completeFlag === '0') {
  168. return 'danger'; //未检
  169. } else if (row.completeFlag === '2') {
  170. return 'info'; //弃检
  171. }
  172. return '';
  173. },
  174. async fnMounted() {
  175. this.LocalConfigInit = deepCopy(this.LocalConfig)
  176. let LocalConfig = window.localStorage.getItem("LocalConfig") || null
  177. try {
  178. this.LocalConfig = Object.assign({}, deepCopy(this.LocalConfigInit), JSON.parse(LocalConfig) || {})
  179. } catch (error) {
  180. console.log('window.localStorage.getItem("LocalConfig")', error)
  181. }
  182. if (this.LocalConfig.doctorCheck.isQueue == 'Y') {
  183. this.dictInit().then(res => {
  184. if (!this.LocalConfig.doctorCheck.queueRoom) {
  185. if (res.data.length > 0) this.LocalConfig.doctorCheck.queueRoom = res.data[0].id
  186. }
  187. if (this.LocalConfig.doctorCheck.queueRoom) this.getQueueRegisterListByRoomId(this.LocalConfig.doctorCheck.queueRoom)
  188. })
  189. this.setQueueParams()
  190. try {
  191. let sysParam = await postapi('/api/app/SysParmValue/GetSysParmValueBySysParmId', { sysParmId: "queue_refresh_interval" })
  192. this.queue_refresh_interval = Number(sysParam.data || 15)
  193. } catch (error) {
  194. console.log(error)
  195. }
  196. // 壳端
  197. if (this.$peisAPI) {
  198. postapi('/api/app/SysParmValue/GetSysParmValueBySysParmId', { sysParmId: "queue_play_voice_repeate_times" })
  199. .then(res => {
  200. if (res.code > -1) this.queue_play_voice_repeate_times = Number(res.data || 2)
  201. })
  202. postapi('/api/app/SysParmValue/GetSysParmValueBySysParmId', { sysParmId: "queue_play_voice_repeate_interval" })
  203. .then(res => {
  204. if (res.code > -1) this.queue_play_voice_repeate_interval = Number(res.data || 1)
  205. })
  206. }
  207. // 启动自动刷新
  208. if (!this.interval && this.queue_refresh_interval != 0) {
  209. this.interval = setInterval(() => {
  210. this.getQueueRegisterList(this.LocalConfig.doctorCheck.queueRoom, this.LocalConfig.doctorCheck.queueItemTypeIds)
  211. }, this.queue_refresh_interval * 1000);
  212. }
  213. }
  214. },
  215. btnCall(refRow, completeFlag) {
  216. let row = Object.assign({}, refRow)
  217. switch (completeFlag) {
  218. case "0": // 退回
  219. if (!row.queueRegisterId) {
  220. if (this.overNumberDetail.length > 0) row = this.overNumberDetail[0]
  221. }
  222. if (!row.queueRegisterId) this.$message.warning({ showClose: true, message: '未可操作的数据,或未选择过号人员' })
  223. break;
  224. case "1": // 呼叫
  225. if (!row.queueRegisterId) {
  226. if (this.waitDetail.length > 0) row = this.waitDetail[0]
  227. }
  228. if (!row.queueRegisterId) this.$message.warning({ showClose: true, message: '未可操作的数据,或未选择候诊人员' })
  229. break;
  230. case "2": // 过号
  231. if (!row.queueRegisterId) {
  232. if (this.alreadyCalledDetail.length > 0) row = this.alreadyCalledDetail[0]
  233. }
  234. if (!row.queueRegisterId) this.$message.warning({ showClose: true, message: '未可操作的数据,或未选择已呼人员' })
  235. break;
  236. case "9": // 重呼
  237. if (!row.queueRegisterId) {
  238. if (this.overNumberDetail.length > 0) queueRegisterId = this.overNumberDetail[0]
  239. }
  240. if (!row.queueRegisterId) this.$message.warning({ showClose: true, message: '未可操作的数据,或未选择过号人员' })
  241. break;
  242. }
  243. // "patientRegisterId": "3a143cf9-0b1b-7765-a90a-b087c4aad1b9",
  244. // "patientRegisterNo": "003485"
  245. // 叫号即调人员信息出来
  246. if (row.patientRegisterNo) {
  247. this.dataTransOpts.tableS.patient_register.patientRegisterNo = row.patientRegisterNo
  248. this.dataTransOpts.refresh.patient_register.S++
  249. }
  250. if (row.queueRegisterId && completeFlag != '9') {
  251. postapi('/api/app/QueueRegister/UpdateQueueRegisterStatus', { queueRegisterId: row.queueRegisterId, completeFlag })
  252. .then(res => {
  253. if (res.code > -1) {
  254. this.getQueueRegisterList(this.LocalConfig.doctorCheck.queueRoom, this.LocalConfig.doctorCheck.queueItemTypeIds)
  255. if (this.$peisAPI && completeFlag == '1') this.outShellCall(row)
  256. }
  257. })
  258. } else if (completeFlag == '9') {
  259. if (this.$peisAPI) this.outShellCall(row)
  260. }
  261. },
  262. // 调用壳呼叫 api
  263. outShellCall(row) {
  264. let roomName = ''
  265. postapi('/api/app/Room/Get', { roomId: this.LocalConfig.doctorCheck.queueRoom })
  266. .then(res => {
  267. if (res.code > -1) {
  268. roomName = res.data.displayName
  269. return this.$peisAPI.getIsSpeechEnable()
  270. }
  271. })
  272. .then(res => {
  273. if (res == 'Y') return this.$peisAPI.speechConnect()
  274. })
  275. .then(res => {
  276. // queue_play_voice_repeate_times: 2, // 语音重复播放次数
  277. // queue_play_voice_repeate_interval: 1, // 语音重复播放时间间隔(秒)
  278. let toOutShell = { SendText: `${row.patientName}${roomName}检查`, RepatPlayNum: this.queue_play_voice_repeate_times, Delay: this.queue_play_voice_repeate_interval }
  279. return this.$peisAPI.speechSendText(JSON.stringify(toOutShell))
  280. })
  281. .catch(err => {
  282. // console.log('呼叫失败', err)
  283. this.$message.error({ showClose: true, message: err })
  284. })
  285. },
  286. dictInit() {
  287. return new Promise((resolve, reject) => {
  288. postapi('/api/app/Room/GetList')
  289. .then((res) => {
  290. if (res.code > -1) {
  291. this.dict.room = res.data
  292. // this.tableData = res.data.filter(e => {
  293. // return medicalCenterId ? (e.medicalCenterId == medicalCenterId) : e
  294. // });
  295. resolve(res)
  296. } else {
  297. reject(res.message)
  298. }
  299. })
  300. .catch(err => {
  301. reject(err)
  302. });
  303. })
  304. },
  305. getQueueRegisterList(roomId, itemType) {
  306. return new Promise((resolve, reject) => {
  307. this.waitDetail = []
  308. this.alreadyCalledDetail = []
  309. this.overNumberDetail = []
  310. this.waitRow = {}
  311. this.alreadyRow = {}
  312. this.overRow = {}
  313. let itemTypeIds = []
  314. itemType.forEach(e => {
  315. e.forEach(item => {
  316. itemTypeIds.push(item)
  317. });
  318. });
  319. if(roomId){
  320. postapi('/api/app/QueueRegister/GetQueueRegisterListByRoomId', { roomId, itemTypeIds })
  321. .then(res => {
  322. if (res.code > -1) {
  323. this.waitDetail = res.data.waitDetail
  324. this.alreadyCalledDetail = res.data.alreadyCalledDetail
  325. this.overNumberDetail = res.data.overNumberDetail
  326. resolve(res)
  327. } else {
  328. reject(res.message)
  329. }
  330. })
  331. .catch(err => {
  332. reject(err)
  333. })
  334. }else{
  335. reject('请选择房间')
  336. }
  337. })
  338. },
  339. // 获取房间排队信息 ByRoomId
  340. getQueueRegisterListByRoomId(roomId) {
  341. if (!roomId) {
  342. this.$message.warning({ showClose: true, message: '请选择房间' })
  343. return
  344. }
  345. this.getQueueRegisterList(roomId, this.LocalConfig.doctorCheck.queueItemTypeIds)
  346. },
  347. // 获取房间排队信息 ByRoomId
  348. getQueueRegisterListByItemTypeIds(itemTypeIds) {
  349. if(this.LocalConfig.doctorCheck.queueRoom){
  350. this.getQueueRegisterList(this.LocalConfig.doctorCheck.queueRoom, itemTypeIds)
  351. }
  352. },
  353. setQueueParams() {
  354. this.queueParams.patientRegisterId = this.dataTransOpts.tableS.patient_register.id
  355. },
  356. // 分诊排队
  357. fnQueue() {
  358. if (!this.queueParams.patientRegisterId) {
  359. this.$message.warning({ showClose: true, message: '未获取到人员信息' })
  360. return
  361. }
  362. this.queueParams = {
  363. patientRegisterId: this.queueParams.patientRegisterId
  364. }
  365. this.dataTransOpts.plus.queue++
  366. this.dialogWin.queue = true
  367. },
  368. // 选择候诊人员
  369. rowClickWait(row) {
  370. this.waitRow = row
  371. },
  372. // 选择过号人员
  373. rowClickAlready(row) {
  374. this.alreadyRow = row
  375. },
  376. // 选择过号人员
  377. rowClickOver(row) {
  378. this.overRow = row
  379. },
  380. },
  381. //监听事件
  382. watch: {
  383. //体检人员未切换时 也可以强制刷新数据
  384. "dataTransOpts.refresh.register_check.M": {
  385. // immediate:true,
  386. handler(newVal, oldVal) {
  387. console.log(`watch 组合项目列表 newVal: ${newVal} oldVal: ${oldVal} patient_register.id: ${this.dataTransOpts.tableS.patient_register.id}`);
  388. if (newVal != oldVal) {
  389. this.fnMounted()
  390. }
  391. }
  392. },
  393. }
  394. };
  395. </script>
  396. <style scoped>
  397. ::v-deep .el-collapse-item__header {
  398. height: 32px;
  399. line-height: 32px;
  400. background-color: #f4f8ff;
  401. color: #303133;
  402. cursor: pointer;
  403. font-size: 14px;
  404. font-weight: 700;
  405. text-align: center;
  406. padding: 0 0 0 50px;
  407. }
  408. </style>