index.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="90px">
  4. <el-form-item label="患者姓名" prop="patientName">
  5. <el-input v-model="queryParams.patientName" placeholder="支持模糊查询" clearable @keyup.enter.native="handleQuery" />
  6. </el-form-item>
  7. <el-form-item label="审核状态" prop="auditStatus">
  8. <el-select v-model="queryParams.auditStatus" placeholder="请选择审核状态" >
  9. <el-option label="待审核" :value="0" />
  10. <el-option label="审核通过" :value="1" />
  11. <el-option label="审核不通过" :value="2" />
  12. </el-select>
  13. </el-form-item>
  14. <el-form-item label="创建时间" prop="dateRange">
  15. <el-date-picker
  16. v-model="dateRange"
  17. type="daterange"
  18. range-separator="至"
  19. start-placeholder="开始日期"
  20. end-placeholder="结束日期"
  21. value-format="yyyy-MM-dd HH:mm:ss"
  22. style="width: 350px" />
  23. </el-form-item>
  24. <el-form-item>
  25. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  26. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  27. <!-- <el-button type="success" icon="el-icon-check" size="mini" @click="quickFilter(1)">已审核</el-button> -->
  28. <el-button type="warning" icon="el-icon-time" size="mini" @click="quickFilter(0)">待审核</el-button>
  29. </el-form-item>
  30. </el-form>
  31. <el-table v-loading="loading" :data="list" border>
  32. <el-table-column label="处方ID" prop="prescribeId" align="center" width="100" />
  33. <el-table-column label="处方编号" prop="prescribeCode" align="center" width="140" />
  34. <el-table-column label="医生姓名" prop="doctorName" align="center" width="120" />
  35. <el-table-column label="患者姓名" prop="patientName" align="center" width="120" />
  36. <el-table-column label="患者性别" align="center" width="100">
  37. <template slot-scope="scope">
  38. {{ genderFormat(scope.row.patientGender) }}
  39. </template>
  40. </el-table-column>
  41. <el-table-column label="患者年龄" prop="patientAge" align="center" width="100" />
  42. <el-table-column label="处方图片" align="center" width="140">
  43. <template slot-scope="scope">
  44. <el-image v-if="scope.row.prescribeImgUrl" :src="scope.row.prescribeImgUrl" :preview-src-list="[scope.row.prescribeImgUrl]" style="width: 120px; height: 120px" fit="cover" />
  45. <span v-else>无</span>
  46. </template>
  47. </el-table-column>
  48. <el-table-column label="诊断信息" prop="diagnose" align="center" min-width="180" />
  49. <el-table-column label="拒绝原因" prop="auditReason" align="center" min-width="160" />
  50. <el-table-column label="审核时间" prop="auditTime" align="center" width="160" />
  51. <el-table-column label="审核状态" align="center" width="120">
  52. <template slot-scope="scope">
  53. {{ statusFormat(scope.row.auditStatus != null ? scope.row.auditStatus : scope.row.status) }}
  54. </template>
  55. </el-table-column>
  56. <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="220">
  57. <template slot-scope="scope">
  58. <el-button size="mini" type="text" :disabled="!isPending(scope.row)" @click="handleAudit(scope.row)">审核</el-button>
  59. <el-divider direction="vertical"></el-divider>
  60. <el-button size="mini" type="text" @click="viewDrugs(scope.row)">处方药品</el-button>
  61. <el-divider direction="vertical"></el-divider>
  62. <el-button size="mini" type="text" @click="handleRecord(scope.row)">审核记录</el-button>
  63. </template>
  64. </el-table-column>
  65. </el-table>
  66. <pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
  67. <el-dialog title="处方审核" :visible.sync="auditDialog.open" width="500px" append-to-body>
  68. <el-form :model="auditForm" ref="auditFormRef" label-width="90px">
  69. <el-form-item label="审核状态" prop="auditStatus">
  70. <el-radio-group v-model="auditForm.auditStatus">
  71. <el-radio :label="1">审核通过</el-radio>
  72. <el-radio :label="2">审核不通过</el-radio>
  73. </el-radio-group>
  74. </el-form-item>
  75. <el-form-item v-if="auditForm.auditStatus === 2" label="拒绝原因" prop="auditReason">
  76. <el-input type="textarea" v-model="auditForm.auditReason" placeholder="请填写拒绝原因" :rows="3" />
  77. </el-form-item>
  78. </el-form>
  79. <div slot="footer" class="dialog-footer">
  80. <el-button @click="auditDialog.open=false">取 消</el-button>
  81. <el-button type="primary" @click="submitAudit">确 定</el-button>
  82. </div>
  83. </el-dialog>
  84. <el-dialog title="处方药品" :visible.sync="drugsDialog.open" width="720px" append-to-body>
  85. <div v-if="drugsList && drugsList.length">
  86. <el-table :data="drugsList" border size="mini">
  87. <el-table-column label="药品图片" width="120" align="center">
  88. <template slot-scope="scope">
  89. <el-image v-if="scope.row.drugImgUrl" :src="scope.row.drugImgUrl" :preview-src-list="[scope.row.drugImgUrl]" style="width: 80px; height: 80px" fit="cover" />
  90. <span v-else>无</span>
  91. </template>
  92. </el-table-column>
  93. <el-table-column label="药品名称" prop="drugName" min-width="180" align="center" />
  94. <el-table-column label="药品规格" prop="drugSpec" min-width="160" align="center" />
  95. <el-table-column label="使用方法" prop="usageMethod" min-width="160" align="center" />
  96. <el-table-column label="药品数量" prop="drugNum" width="120" align="center" />
  97. </el-table>
  98. </div>
  99. <el-empty v-else description="暂无药品数据"></el-empty>
  100. <div slot="footer" class="dialog-footer">
  101. <el-button @click="drugsDialog.open=false">关 闭</el-button>
  102. </div>
  103. </el-dialog>
  104. <el-dialog title="审核记录" :visible.sync="recordDialogVisible" width="1000px" append-to-body>
  105. <el-table v-loading="recordLoading" :data="recordList" border style="width: 100%; margin-top: 10px;"
  106. max-height="400">
  107. <el-table-column label="审核药师" align="center" prop="drugDoctorName" />
  108. <el-table-column label="拒方原因" align="center" prop="auditReason" show-overflow-tooltip />
  109. <el-table-column label="处方图片" align="center" width="140">
  110. <template slot-scope="scope">
  111. <el-image v-if="scope.row.prescribeImgUrl" :src="scope.row.prescribeImgUrl"
  112. :preview-src-list="[scope.row.prescribeImgUrl]" style="width: 120px; height: 120px" fit="cover" />
  113. <span v-else>无</span>
  114. </template>
  115. </el-table-column>
  116. <el-table-column label="审核时间" align="center" prop="createTime" />
  117. <el-table-column label="审核状态" align="center" width="120">
  118. <template slot-scope="scope">
  119. {{ statusFormat(scope.row.auditStatus != null ? scope.row.auditStatus : scope.row.status) }}
  120. </template>
  121. </el-table-column>
  122. </el-table>
  123. </el-dialog>
  124. </div>
  125. </template>
  126. <script>
  127. import { getPrescribeList, auditPrescribe } from '@/api/prescribe'
  128. import { recordList } from '@/api/his/prescribe'
  129. export default {
  130. name: 'PrescribeAudit',
  131. data() {
  132. return {
  133. //审核记录数据
  134. recordLoading: false,
  135. recordList: [],
  136. recordDialogVisible: false,//审核记录弹窗控制
  137. loading: false,
  138. showSearch: true,
  139. total: 0,
  140. list: [],
  141. dateRange: [],
  142. queryParams: {
  143. pageNum: 1,
  144. pageSize: 10,
  145. patientName: undefined,
  146. auditStatus: 0,
  147. beginCreateTime: undefined,
  148. endCreateTime: undefined,
  149. type: 2
  150. },
  151. auditDialog: { open: false },
  152. auditForm: {
  153. prescribeId: undefined,
  154. auditStatus: 1,
  155. auditReason: ''
  156. },
  157. drugsDialog: { open: false },
  158. drugsList: [],
  159. }
  160. },
  161. created() {
  162. // 默认加载列表
  163. this.getList()
  164. },
  165. methods: {
  166. //审核记录
  167. handleRecord(row) {
  168. this.recordDialogVisible = true;
  169. this.recordLoading = true;
  170. recordList(row.prescribeId).then(res =>{
  171. this.recordLoading = false;
  172. this.recordList = res.data;
  173. })
  174. },
  175. genderFormat(val) {
  176. if (val === 1 || val === '1') return '男'
  177. if (val === 2 || val === '2') return '女'
  178. return '-'
  179. },
  180. statusFormat(val) {
  181. if (val === 0 || val === '0') return '待审核'
  182. if (val === 1 || val === '1') return '审核通过'
  183. if (val === 2 || val === '2') return '审核不通过'
  184. return '-'
  185. },
  186. handleQuery() {
  187. this.queryParams.pageNum = 1;
  188. this.queryParams.type = 2;
  189. if (this.dateRange && this.dateRange.length === 2) {
  190. this.queryParams.beginCreateTime = this.dateRange[0]
  191. this.queryParams.endCreateTime = this.dateRange[1]
  192. } else {
  193. this.queryParams.beginCreateTime = undefined
  194. this.queryParams.endCreateTime = undefined
  195. }
  196. this.getList()
  197. },
  198. resetQuery() {
  199. this.dateRange = []
  200. this.queryParams = {
  201. pageNum: 1,
  202. pageSize: 10,
  203. patientName: undefined,
  204. auditStatus: 0,
  205. beginCreateTime: undefined,
  206. endCreateTime: undefined,
  207. type: 2,
  208. }
  209. this.getList()
  210. },
  211. quickFilter(auditStatus) {
  212. this.queryParams.auditStatus = auditStatus
  213. this.handleQuery()
  214. },
  215. getList() {
  216. this.loading = true
  217. const params = { ...this.queryParams }
  218. if (params.auditStatus !== undefined) {
  219. params.status = params.auditStatus
  220. }
  221. getPrescribeList(params).then(res => {
  222. const data = res.data || res
  223. this.list = data.list || data.rows || []
  224. this.total = data.total || 0
  225. }).finally(() => {
  226. this.loading = false
  227. })
  228. },
  229. isPending(row) {
  230. const current = (row.auditStatus != null ? row.auditStatus : row.status)
  231. return (current === 0 || current === '0') && row.prescribeImgUrl
  232. },
  233. handleAudit(row) {
  234. const current = (row.auditStatus != null ? row.auditStatus : row.status)
  235. if (!(current === 0 || current === '0')) {
  236. this.$message.warning('仅待审核记录可操作')
  237. return
  238. }
  239. this.auditForm.prescribeId = row.prescribeId
  240. this.auditForm.auditStatus = (current === 1 || current === '1') ? 1 : (current === 2 || current === '2') ? 2 : 1
  241. this.auditForm.auditReason = row.auditReason || ''
  242. this.auditDialog.open = true
  243. },
  244. submitAudit() {
  245. if (this.auditForm.auditStatus === 2 && (!this.auditForm.auditReason || !this.auditForm.auditReason.trim())) {
  246. this.$message.error('请填写拒绝原因')
  247. return
  248. }
  249. const payload = { prescribeId: this.auditForm.prescribeId, status: this.auditForm.auditStatus, auditReason: this.auditForm.auditReason }
  250. auditPrescribe(payload).then(() => {
  251. this.$message.success('审核成功')
  252. this.auditDialog.open = false
  253. this.getList()
  254. }).catch(() => {
  255. this.$message.error('审核失败')
  256. })
  257. },
  258. viewDrugs(row) {
  259. const raw = row && row.drugs ? row.drugs : []
  260. this.drugsList = (raw || []).map(d => ({
  261. drugImgUrl: d.drugImgUrl || d.imgUrl || d.imageUrl || '',
  262. drugName: d.drugName || d.name || '-',
  263. drugSpec: d.drugSpec || d.spec || '-',
  264. usageMethod: d.usageMethod || d.usage || '-',
  265. drugNum: (d.drugNum != null ? d.drugNum : (d.num != null ? d.num : '-'))
  266. }))
  267. this.drugsDialog.open = true
  268. },
  269. }
  270. }
  271. </script>
  272. <style scoped>
  273. .app-container {
  274. padding: 20px;
  275. }
  276. </style>