EmrApply.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. <template>
  2. <xc-table :local-data="reqData" :height="220">
  3. <el-table-column fixed="left" width="150">
  4. <template #header>
  5. <el-button type="success" icon="Plus" title="添加申请" @click="addReqClick"/>
  6. <el-button type="primary" icon="Search" title="查询数据" @click="queryData"/>
  7. </template>
  8. <template #default="{row}">
  9. <el-button type="danger" icon="Delete" title="删除" @click="deleteClick(row)"/>
  10. <el-button type="warning" icon="Edit" title="编辑" @click="editClick(row)"/>
  11. </template>
  12. </el-table-column>
  13. <el-table-column label="住院号" prop="patNo" width="70"/>
  14. <el-table-column label="修改时间" prop="editDate" width="80"/>
  15. <el-table-column label="状态" prop="reqStatusName" width="50">
  16. <template #default="{row}">
  17. <span v-html="row.reqStatusHtml"></span>
  18. </template>
  19. </el-table-column>
  20. <el-table-column label="申请备注" prop="reqRemarks" show-overflow-tooltip/>
  21. <el-table-column label="审核备注" prop="reviewNotes" show-overflow-tooltip/>
  22. </xc-table>
  23. <xc-dialog-v2 v-model="dialog" width="30%" title="申请">
  24. <el-form label-width="80px" :rules="rules" ref="formRef" :model="fromData">
  25. <el-row>
  26. <el-col :span="24">
  27. <el-form-item label="住院号:" prop="inpatient">
  28. <el-input style="width: 120px" v-model="fromData.inpatientNo" @blur="model=$event.target.value.trim()"/>
  29. </el-form-item>
  30. </el-col>
  31. <el-col :span="24">
  32. <el-form-item label="次数:" prop="times">
  33. <el-input-number v-model="fromData.times" :min="1"/>
  34. </el-form-item>
  35. </el-col>
  36. <el-col :span="24">
  37. <el-form-item label="时间:" prop="editDate">
  38. <el-date-picker type="date"
  39. :disabled-date="disabledDate"
  40. v-model="fromData.editDate"
  41. value-format="YYYY-MM-DD"
  42. format="YYYY-MM-DD"/>
  43. </el-form-item>
  44. </el-col>
  45. <el-col :span="24">
  46. <el-form-item label="备注:" prop="reqRemarks">
  47. <el-input type="textarea" rows="3" maxlength="50" show-word-limit v-model="fromData.reqRemarks"/>
  48. </el-form-item>
  49. </el-col>
  50. <el-col :span="24">
  51. <el-form-item label="">
  52. <el-button @click="submit">提交</el-button>
  53. </el-form-item>
  54. </el-col>
  55. </el-row>
  56. </el-form>
  57. </xc-dialog-v2>
  58. </template>
  59. <script setup name='EmrApply'>
  60. import XcTable from "@/components/xiao-chan/xc-table/XcTable.vue";
  61. import XcDialogV2 from "@/components/xiao-chan/dialog/XcDialogV2.vue";
  62. import {deleteDisEmrDis, getDisReqEmr, saveDisEmrReq} from "@/api/zhu-yuan-yi-sheng/emr-patient";
  63. import {getServerDateApi} from "@/api/public-api";
  64. import moment from "moment";
  65. let reqData = $ref([])
  66. let dialog = $ref(false)
  67. let fromData = $ref({
  68. patNo: '',
  69. inpatient: '',
  70. times: 1,
  71. editDate: null,
  72. reqRemarks: '',
  73. })
  74. let formRef = $ref(null)
  75. let rules = $ref({
  76. inpatientNo: [{required: true, message: '字段值不可为空'}],
  77. reqRemarks: [{required: true, message: '字段值不可为空'}],
  78. editDate: [{required: true, message: '字段值不可为空'}],
  79. })
  80. const addReqClick = () => {
  81. fromData = {
  82. patNo: '',
  83. inpatient: '',
  84. times: 1,
  85. editDate: null,
  86. reqRemarks: '',
  87. }
  88. dialog = true
  89. }
  90. // 点击编辑
  91. const editClick = (val) => {
  92. let temp = val.patNo.split("_")
  93. fromData = val
  94. fromData.inpatientNo = temp[0]
  95. fromData.times = parseInt(temp[1])
  96. dialog = true
  97. }
  98. // 确认申请
  99. const submit = () => {
  100. formRef.validate(valid => {
  101. if (!valid) return
  102. fromData.patNo = fromData.inpatientNo + '_' + fromData.times
  103. saveDisEmrReq(fromData).then((res) => {
  104. dialog = false
  105. queryData()
  106. })
  107. })
  108. }
  109. // 删除申请
  110. const deleteClick = (val) => {
  111. deleteDisEmrDis(val.patNo).then(() => {
  112. queryData()
  113. })
  114. }
  115. const queryData = () => {
  116. getDisReqEmr(1).then((res) => {
  117. reqData = res
  118. })
  119. }
  120. let newDate = null
  121. let manDate = null
  122. const disabledDate = (time) => {
  123. return time.getTime() < newDate.getTime() || time.getTime() > manDate.getTime()
  124. }
  125. onMounted(async () => {
  126. queryData()
  127. newDate = new Date(await getServerDateApi())
  128. manDate = new Date(moment(newDate).add(7, 'days'))
  129. })
  130. </script>
  131. <style scoped lang="scss">
  132. </style>