YzActOrderModify.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489
  1. <template>
  2. <page-layer>
  3. <template #header>
  4. <el-input size="small" placeholder="在此输入住院号" @keyup.enter="query" v-model.trim="inpatientNo" clearable
  5. prefix-icon="Search" style="width: 300px">
  6. <template #prepend>住院号</template>
  7. </el-input>
  8. <el-input size="small" placeholder="在此输入医嘱号" oninput="value=value.replace(/[^\d]/g,'')"
  9. v-model.trim="actOrderNo" clearable prefix-icon="Search" style="width: 300px">
  10. <template #prepend>医嘱号</template>
  11. </el-input>
  12. <el-button type="primary" icon="Search" @click="query">查询</el-button>
  13. <el-button type="info" @click="chakan" icon="View">查看申请状态</el-button>
  14. </template>
  15. <template #aside>
  16. <el-table :height="tableHeight" stripe highlight-current-row
  17. :data="cptTable.slice((currentPage - 1) * pageSize, currentPage * pageSize)" style="text-align: center">
  18. <el-table-column label="医嘱号" prop="actOrderNo"></el-table-column>
  19. <el-table-column label="医嘱名称" show-overflow-tooltip prop="orderName"></el-table-column>
  20. <el-table-column label="操作" width="100">
  21. <template #default="scope">
  22. <el-button-group>
  23. <el-button text @click="tianjia(scope.row)" type="primary">添加</el-button>
  24. <el-button text @click="danGeShenQingClick(scope.row)" type="primary">申请</el-button>
  25. </el-button-group>
  26. </template>
  27. </el-table-column>
  28. </el-table>
  29. <el-pagination
  30. @current-change="handleCurrentChange"
  31. :page-size="pageSize"
  32. :current-page="currentPage"
  33. small
  34. style="background-color: white"
  35. layout="prev, pager, next"
  36. :total="cptTable.length"
  37. >
  38. </el-pagination>
  39. </template>
  40. <template #main>
  41. <!-- 申请修改医嘱的开始时间和结束时间 -->
  42. <span>开始时间:</span>
  43. <el-date-picker type="datetime" placeholder="选择开始时间" v-model="tianJiaShenHe.startTime"></el-date-picker>
  44. <el-divider direction="vertical"></el-divider>
  45. <span>结束时间:</span>
  46. <el-date-picker type="datetime" placeholder="选择结束时间" v-model="tianJiaShenHe.endTime"></el-date-picker>
  47. <el-divider direction="vertical"></el-divider>
  48. <el-button @click="tijiaoshenqing" type="success">提交</el-button>
  49. <el-divider></el-divider>
  50. <!-- 这里是添加审核医嘱到表格中 -->
  51. <el-table :data="tianJiaShenHe.list" :height="tableHeight - 28">
  52. <el-table-column label="患者姓名" width="70" prop="patientName"></el-table-column>
  53. <el-table-column label="住院号" width="70" prop="inpatientNo"></el-table-column>
  54. <el-table-column label="医嘱号" show-overflow-tooltip width="70" prop="actOrderNo"></el-table-column>
  55. <el-table-column label="医嘱名称" show-overflow-tooltip prop="orderName"></el-table-column>
  56. <el-table-column label="频次" prop="frequCode"></el-table-column>
  57. <el-table-column label="医嘱时间" prop="orderTime"></el-table-column>
  58. <el-table-column label="开始时间" prop="startTime"></el-table-column>
  59. <el-table-column label="结束时间" prop="endTime"></el-table-column>
  60. <el-table-column label="删除">
  61. <template #default="scope">
  62. <el-button type="danger" size="small" icon="Delete" @click="shanchu(scope.$index)">删除</el-button>
  63. </template>
  64. </el-table-column>
  65. </el-table>
  66. <!-- 这里是查看审核状态的 -->
  67. <el-dialog v-model="dialogFormVisible" title="审核状态" :width="900">
  68. 住院号:
  69. <el-input style="width: 120px" clearable @blur="shenHeInpatientNo = $event.target.value.trim()"
  70. v-model="shenHeInpatientNo"></el-input>
  71. 医嘱号:
  72. <el-input oninput="value=value.replace(/[^\d]/g,'')" style="width: 120px"
  73. @blur="shenHeActOrderNo = $event.target.value.trim()" v-model="shenHeActOrderNo"></el-input>
  74. <el-divider direction="vertical"></el-divider>
  75. <el-button @click="queryZhuangTaiClick" type="primary">查询</el-button>
  76. <el-table :data="dialogTable" :height="tableHeight - 300">
  77. <el-table-column type="index"></el-table-column>
  78. <el-table-column label="住院号" prop="inpatientNo"></el-table-column>
  79. <el-table-column label="医嘱号" prop="actOrderNo"></el-table-column>
  80. <el-table-column label="审核状态">
  81. <template #default="scope">
  82. <span v-html="yZauditStatus(scope.row.auditFlag)"></span>
  83. </template>
  84. </el-table-column>
  85. <el-table-column label="申请备注" show-overflow-tooltip prop="proposeRemark"></el-table-column>
  86. <el-table-column label="审核人" prop="auditStaff"></el-table-column>
  87. <el-table-column label="审核备注" show-overflow-tooltip prop="auditRemark"></el-table-column>
  88. <el-table-column label="审核时间" width="80" prop="auditTime"></el-table-column>
  89. </el-table>
  90. <el-pagination
  91. layout="prev, pager, next, total"
  92. @current-change="shenHeXinXiCurrentChange"
  93. :total="shenHeXinxiTotal"
  94. :page-size="shenHeXinXiPageSize"
  95. background
  96. ></el-pagination>
  97. </el-dialog>
  98. <el-drawer v-model="danGeShenQingDrawer" title="申请修改医嘱" size="50%">
  99. <div style="margin-left: 20px; width: 90%">
  100. <el-descriptions border title="基本信息">
  101. <el-descriptions-item>
  102. <template #label>
  103. <i class="el-icon-user"></i>
  104. 患者姓名
  105. </template>
  106. {{ danGeShenQingDrawerData.patientName }}
  107. </el-descriptions-item>
  108. <el-descriptions-item>
  109. <template #label>
  110. <i class="el-icon-s-order"></i>
  111. 住院号
  112. </template>
  113. {{ danGeShenQingDrawerData.inpatientNo }}
  114. </el-descriptions-item>
  115. <el-descriptions-item>
  116. <template #label>
  117. <i class="el-icon-s-order"></i>
  118. 医嘱号
  119. </template>
  120. {{ danGeShenQingDrawerData.actOrderNo }}
  121. </el-descriptions-item>
  122. <el-descriptions-item>
  123. <template #label>
  124. <i class="el-icon-s-claim"></i>
  125. 医嘱名称
  126. </template>
  127. {{ danGeShenQingDrawerData.orderName }}
  128. </el-descriptions-item>
  129. <el-descriptions-item>
  130. <template #label>
  131. <i class="el-icon-house"></i>
  132. 病房
  133. </template>
  134. {{ danGeShenQingDrawerData.wardCode }}
  135. </el-descriptions-item>
  136. <el-descriptions-item>
  137. <template #label>
  138. <i class="el-icon-tickets"></i>
  139. 频次
  140. </template>
  141. {{ danGeShenQingDrawerData.frequCode }}
  142. </el-descriptions-item>
  143. <el-descriptions-item>
  144. <template #label>
  145. <i class="el-icon-time"></i>
  146. 医嘱时间
  147. </template>
  148. {{ danGeShenQingDrawerData.orderTime }}
  149. </el-descriptions-item>
  150. <el-descriptions-item>
  151. <template #label>
  152. <i class="el-icon-time"></i>
  153. 开始时间
  154. </template>
  155. {{ danGeShenQingDrawerData.startTime }}
  156. </el-descriptions-item>
  157. <el-descriptions-item>
  158. <template #label>
  159. <i class="el-icon-time"></i>
  160. 结束时间
  161. </template>
  162. {{ danGeShenQingDrawerData.endTime }}
  163. </el-descriptions-item>
  164. </el-descriptions>
  165. <el-divider></el-divider>
  166. <el-row>
  167. <el-col :span="12">
  168. 开始时间:
  169. <el-date-picker type="datetime" placeholder="修改开始时间"
  170. v-model="danGeShenQingDrawerData.newStartTime"></el-date-picker>
  171. </el-col>
  172. <el-col :span="12">
  173. 结束时间:
  174. <el-date-picker type="datetime" placeholder="修改结束时间"
  175. v-model="danGeShenQingDrawerData.newEndTime"></el-date-picker>
  176. </el-col>
  177. <el-col :span="24">
  178. <br/>
  179. <el-input
  180. type="textarea"
  181. placeholder="申请备注"
  182. maxlength="250"
  183. @blur="danGeShenQingDrawerData.proposeRemark = $event.target.value.trim()"
  184. show-word-limit
  185. v-model="danGeShenQingDrawerData.proposeRemark"
  186. ></el-input>
  187. </el-col>
  188. </el-row>
  189. <br/>
  190. <el-button type="primary" @click="danGeShenQingSubmit">提交</el-button>
  191. </div>
  192. </el-drawer>
  193. </template>
  194. </page-layer>
  195. </template>
  196. <script>
  197. import {reactive, ref} from '@vue/reactivity'
  198. import {ElMessage, ElMessageBox} from 'element-plus'
  199. import store from '@/store'
  200. import {yZauditStatus} from '@/utils/computed'
  201. import {yzModifyApply, yzQuery, chaKanZhuangTai, danGeShenQing} from '@/api/yz-data-mod/yz-xiugaiy'
  202. import {formatDatetime} from '@/utils/date'
  203. import {computed} from 'vue'
  204. import router from '@/router'
  205. import PageLayer from "@/layout/PageLayer";
  206. export default {
  207. name: 'YzActOrderModify',
  208. components: {PageLayer},
  209. setup() {
  210. const windowSize = store.state.app.windowSize
  211. const tableHeight = windowSize.h - 70
  212. const inpatientNo = ref('')
  213. const actOrderNo = ref('')
  214. const handleCurrentChange = (val) => {
  215. currentPage.value = val
  216. }
  217. const currentPage = ref(1)
  218. const pageSize = ref(30)
  219. const zhiYin = ref(false)
  220. const queryTerm = reactive({
  221. actOrderNo: '',
  222. inpatientNo: '',
  223. })
  224. /**
  225. * 在输入医嘱的时候修值行这个方法
  226. * 动态的在 returnData 这个数据里面 查找到数据
  227. * 数据有变化就执行 这个方法*/
  228. const cptTable = computed(() => {
  229. return dataTable.value.filter((item) => {
  230. return item.actOrderNo.toString().indexOf(actOrderNo.value) > -1
  231. })
  232. })
  233. /**
  234. * 提交修改审核
  235. * 需要判断 是否选择了数据 以及修改的时间 必须填写一项
  236. * 修改成功后把表格里面的值清空
  237. * */
  238. const tijiaoshenqing = () => {
  239. if (!tianJiaShenHe.value.startTime && !tianJiaShenHe.value.endTime) {
  240. ElMessage.warning({
  241. title: '错误',
  242. message: '至少选择一项,需要修改的时间 (^~^;)ゞ',
  243. showClose: true,
  244. })
  245. return
  246. }
  247. if (tianJiaShenHe.value.list.length > 0) {
  248. ElMessageBox.prompt('共有 ' + tianJiaShenHe.value.list.length + ' 条申请。', '请填写申请备注', {
  249. confirmButtonText: '确定',
  250. cancelButtonText: '取消',
  251. type: 'info',
  252. inputPattern: /\S/,
  253. inputErrorMessage: '必填项不能为空,且不得超过100字 (∩•̀ω•́)⊃-*⋆',
  254. })
  255. .then(({value}) => {
  256. tianJiaShenHe.value.proposeRemark = value
  257. if (value.length > 100) {
  258. ElMessage({
  259. type: ' warning',
  260. title: '错误',
  261. message: '审核备注不超过100字',
  262. showClose: true,
  263. })
  264. } else {
  265. tianJiaShenHe.value.startTime = formatDatetime(tianJiaShenHe.value.startTime)
  266. tianJiaShenHe.value.endTime = formatDatetime(tianJiaShenHe.value.endTime)
  267. tianJiaShenHe.value.proposer = store.state.user.info.code
  268. yzModifyApply(tianJiaShenHe.value).then((res) => {
  269. actOrderNos.value = []
  270. tianJiaShenHe.value = {}
  271. tianJiaShenHe.value.list = []
  272. })
  273. }
  274. })
  275. .catch(() => {
  276. })
  277. } else {
  278. ElMessage({
  279. type: 'warning',
  280. title: '错误',
  281. message: '还没有选择要申请医嘱',
  282. showClose: true,
  283. })
  284. }
  285. }
  286. const dialogFormVisible = ref(false)
  287. const dialogTable = ref([])
  288. //审核信息点击分页
  289. const shenHeXinXiCurrentChange = (val) => {
  290. shenHeXinXiCurrentPage.value = val
  291. chaKanZhuangTai(store.state.user.info.code, resShenHeActOrderNo, resShenHeInpatientNo, shenHeXinXiCurrentPage.value, shenHeXinXiPageSize.value).then((res) => {
  292. resShenHeInpatientNo = shenHeInpatientNo.value
  293. resShenHeActOrderNo = shenHeActOrderNo.value
  294. dialogFormVisible.value = true
  295. shenHeXinxiTotal.value = res.total
  296. dialogTable.value = res.data
  297. })
  298. }
  299. const shenHeXinxiTotal = ref(0)
  300. const shenHeXinXiPageSize = ref(10)
  301. const shenHeXinXiCurrentPage = ref(1)
  302. // 审核信息中 查询修改的数据
  303. const shenHeInpatientNo = ref('')
  304. const shenHeActOrderNo = ref('')
  305. let resShenHeInpatientNo = ''
  306. let resShenHeActOrderNo = ''
  307. /**
  308. * 点击查看 申请的状态
  309. */
  310. const chakan = () => {
  311. chaKanZhuangTai(store.state.user.info.code, resShenHeActOrderNo, resShenHeInpatientNo, shenHeXinXiCurrentPage.value, shenHeXinXiPageSize.value).then((res) => {
  312. dialogFormVisible.value = true
  313. shenHeXinxiTotal.value = res.total
  314. dialogTable.value = res.data
  315. })
  316. }
  317. //根据条件查询
  318. const queryZhuangTaiClick = () => {
  319. chaKanZhuangTai(store.state.user.info.code, shenHeActOrderNo.value, shenHeInpatientNo.value, shenHeXinXiCurrentPage.value, shenHeXinXiPageSize.value).then((res) => {
  320. resShenHeInpatientNo = shenHeInpatientNo.value
  321. resShenHeActOrderNo = shenHeActOrderNo.value
  322. dialogFormVisible.value = true
  323. shenHeXinxiTotal.value = res.total
  324. dialogTable.value = res.data
  325. })
  326. }
  327. //返回数据到页面中
  328. const dataTable = ref([])
  329. //执行添加医嘱 到 表格中
  330. const tianJiaShenHe = ref({
  331. list: [],
  332. startTime: '',
  333. endTime: '',
  334. proposeRemark: '',
  335. proposer: '',
  336. })
  337. //一个用来保存 需要修改的医嘱的数组
  338. const actOrderNos = ref([])
  339. /**
  340. * 点击添加把选中的数据添加到新的数据里面并显示到页面中
  341. * 不可以重复的添加
  342. */
  343. const tianjia = (val) => {
  344. if (actOrderNos.value.indexOf(val.actOrderNo) > -1) {
  345. ElMessage({
  346. title: '失败',
  347. message: '请勿重复添加 ( * ̄▽ ̄)o ─═≡※:☆',
  348. type: 'warning',
  349. showClose: true,
  350. })
  351. } else {
  352. actOrderNos.value.push(val.actOrderNo)
  353. tianJiaShenHe.value.list.push(val)
  354. }
  355. }
  356. //删除申请表格里面的数据
  357. const shanchu = (index) => {
  358. tianJiaShenHe.value.list.splice(index, 1)
  359. actOrderNos.value.splice(index, 1)
  360. }
  361. //调用通知
  362. const choice = () => {
  363. ElMessage({
  364. type: 'warning',
  365. message: '至少填写一项,要修改的时间',
  366. showClose: true,
  367. duration: 2000,
  368. })
  369. }
  370. /**
  371. * 查询数据
  372. * 通过住院号和医嘱号 查找,住院号是必填的
  373. * */
  374. const query = () => {
  375. if (!inpatientNo.value) {
  376. ElMessage({
  377. type: 'warning',
  378. message: '住院号必填',
  379. showClose: true,
  380. duration: 2000,
  381. })
  382. return
  383. }
  384. queryTerm.actOrderNo = actOrderNo.value
  385. queryTerm.inpatientNo = inpatientNo.value
  386. yzQuery(queryTerm)
  387. .then((res) => {
  388. dataTable.value = res
  389. })
  390. .catch(() => {
  391. dataTable.value = []
  392. })
  393. }
  394. /**
  395. * 单个修改医嘱
  396. */
  397. const danGeShenQingDrawer = ref(false)
  398. const danGeShenQingClick = (val) => {
  399. danGeShenQingDrawer.value = true
  400. danGeShenQingDrawerData.value = val
  401. }
  402. const danGeShenQingDrawerData = ref()
  403. const danGeShenQingSubmit = () => {
  404. if (!danGeShenQingDrawerData.value.newStartTime && !danGeShenQingDrawerData.value.newEndTime) {
  405. choice()
  406. return
  407. } else if (!danGeShenQingDrawerData.value.proposeRemark) {
  408. ElMessage({
  409. type: 'warning',
  410. message: '申请备注不能为空',
  411. showClose: true,
  412. duration: 2500,
  413. })
  414. return
  415. }
  416. danGeShenQingDrawerData.value.newStartTime = formatDatetime(danGeShenQingDrawerData.value.newStartTime)
  417. danGeShenQingDrawerData.value.newEndTime = formatDatetime(danGeShenQingDrawerData.value.newEndTime)
  418. danGeShenQing(danGeShenQingDrawerData.value).then((res) => {
  419. danGeShenQingDrawer.value = false
  420. })
  421. }
  422. onActivated(() => {
  423. let patNo = router.currentRoute.value.query.patNo
  424. if (patNo) {
  425. inpatientNo.value = patNo
  426. query()
  427. }
  428. })
  429. return {
  430. actOrderNo,
  431. inpatientNo,
  432. query,
  433. tableHeight,
  434. queryTerm,
  435. handleCurrentChange,
  436. dataTable,
  437. currentPage,
  438. pageSize,
  439. tijiaoshenqing,
  440. chakan,
  441. dialogFormVisible,
  442. dialogTable,
  443. yZauditStatus,
  444. tianjia,
  445. tianJiaShenHe,
  446. shanchu,
  447. cptTable,
  448. zhiYin,
  449. danGeShenQingClick,
  450. danGeShenQingDrawer,
  451. danGeShenQingDrawerData,
  452. danGeShenQingSubmit,
  453. shenHeXinXiCurrentChange,
  454. shenHeXinxiTotal,
  455. shenHeXinXiPageSize,
  456. shenHeXinXiCurrentPage,
  457. shenHeInpatientNo,
  458. shenHeActOrderNo,
  459. queryZhuangTaiClick,
  460. }
  461. },
  462. }
  463. </script>
  464. <style></style>