Elizabeth's proactive approach involves introducing urinal toilet attachment , an ingenious concept that optimizes space and functionality.

prescriptionTemplate.vue 13KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486
  1. <template>
  2. <div class="main-contain new-main-contain">
  3. <div class="position">
  4. <bread-crumb :crumbs='crumbs'></bread-crumb>
  5. <el-button type="primary" @click="add">新增</el-button>
  6. </div>
  7. <div class="app-container" style="display:flex;flex: 1;padding: 10px 20px 0px 20px;">
  8. <div class="mainLeft">
  9. <div class="mainCell" style="margin-bottom:10px;">
  10. <el-input size="small" placeholder="请输入姓名" @input="searchAction"
  11. @keyup.enter.native='searchAction'
  12. v-model="search_input" class="filter-item"/>
  13. <el-button size="small" style="margin-left:10px;" class="filter-item" type="primary"
  14. @click="searchAction">
  15. 搜索
  16. </el-button>
  17. </div>
  18. <div>
  19. <el-table :data="data" :height="tableHeight" @row-click='choosePatient'
  20. @current-change='currentChange' border style="width: 100%;"
  21. :row-style="{ color: '#303133' }"
  22. :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
  23. highlight-current-row
  24. ref="tab">
  25. <el-table-column prop="name" label="姓名">
  26. <template slot-scope="scope">{{scope.row.name}}</template>
  27. </el-table-column>
  28. </el-table>
  29. </div>
  30. </div>
  31. <div class="mainRight">
  32. <el-table :data="templates" :height="tableHeight" @row-click='choosePatient'
  33. @current-change='currentChange' border style="width: 100%;"
  34. :row-style="{ color: '#303133' }"
  35. :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
  36. highlight-current-row
  37. ref="tab"
  38. >
  39. <el-table-column prop="name" label="模版名称" >
  40. <template slot-scope="scope">{{scope.row.name}}</template>
  41. </el-table-column>
  42. <el-table-column prop="name" label="透析模式" >
  43. <template slot-scope="scope">{{getMode(scope.row.mode)}}</template>
  44. </el-table-column>
  45. <el-table-column prop="name" label="操作">
  46. <template slot-scope="scope">
  47. <el-button size="mini" type="primary" @click="jumpDetail(scope.row)">编辑</el-button>
  48. <el-button size="mini" type="danger" @click="deleteTemplate(scope.row)">删除</el-button>
  49. </template>
  50. </el-table-column>
  51. </el-table>
  52. <el-pagination
  53. @size-change="handleSizeChange"
  54. @current-change="handleCurrentChange"
  55. :page-sizes="[10, 50, 100]"
  56. :page-size="10"
  57. background
  58. align="right"
  59. style="margin-top:20px;"
  60. layout="total, sizes, prev, pager, next, jumper"
  61. :total="total"
  62. >
  63. </el-pagination>
  64. </div>
  65. </div>
  66. </div>
  67. </template>
  68. <script>
  69. import BreadCrumb from '@/xt_pages/components/bread-crumb'
  70. import { getPatientList, getPrescriptiontemplateList,delHisPrescriptionTemplate } from '@/api/his/his_config'
  71. import { uParseTime } from '@/utils/tools'
  72. const moment = require('moment')
  73. export default {
  74. components: {
  75. BreadCrumb
  76. },
  77. data() {
  78. return {
  79. templates: [],
  80. tableHeight: '',
  81. fullHeight: document.documentElement.clientHeight,
  82. isloading: false,
  83. data: [],
  84. page: 1,
  85. limit: 10,
  86. patient_id: 0
  87. }
  88. },
  89. methods: {
  90. jumpDetail(row){
  91. this.$router.push("/outpatientDoctorStation/prescriptionTemplatedetail?id="+row.id+"&patient_id="+this.patient_id)
  92. },
  93. deleteTemplate(row){
  94. this.$confirm('处方模版删除后不可恢复,是否确认删除', '删除', {
  95. confirmButtonText: '确 定',
  96. cancelButtonText: '取 消',
  97. type: 'warning'
  98. }).then(() => {
  99. let params = {
  100. id:row.id
  101. }
  102. delHisPrescriptionTemplate(params).then(response => {
  103. if (response.data.state == 1) {
  104. this.GetPrescriptiontemplateList()
  105. }
  106. })
  107. }).catch(() => {
  108. })
  109. },
  110. getMode(id){
  111. let name = ''
  112. this.treatment_mode = Object.values(this.$store.getters.treatment_mode)
  113. this.treatment_mode.map(item => {
  114. if(item.id == id){
  115. name = item.name
  116. }
  117. })
  118. return name
  119. },
  120. handleSizeChange(val) {
  121. this.limit = val
  122. this.GetPrescriptiontemplateList()
  123. },
  124. handleCurrentChange(val) {
  125. this.page = val
  126. this.GetPrescriptiontemplateList()
  127. },
  128. GetPrescriptiontemplateList() {
  129. let params = {
  130. patient_id: this.patient_id,
  131. page: this.page,
  132. limit: this.limit
  133. }
  134. getPrescriptiontemplateList(params).then(response => {
  135. if (response.data.state == 1) {
  136. this.templates = response.data.data.list
  137. this.total = response.data.data.total
  138. }
  139. })
  140. },
  141. searchAction() {
  142. },choosePatient(val) {
  143. this.page = 1,
  144. this.limit = 10
  145. let params = {
  146. patient_id: val.id,
  147. page: this.page,
  148. limit: this.limit
  149. }
  150. getPrescriptiontemplateList(params).then(response => {
  151. if (response.data.state == 1) {
  152. this.templates = response.data.data.list
  153. this.total = response.data.data.total
  154. }
  155. })
  156. },
  157. getList(id) {
  158. getPatientList().then(response => {
  159. if (response.data.state == 1) {
  160. this.data = response.data.data.list
  161. this.$refs.tab.setCurrentRow(this.data[0])
  162. this.patient_id = this.data[0].id
  163. this.GetPrescriptiontemplateList()
  164. }
  165. })
  166. },
  167. getTime(val, temp) {
  168. if (val != 0) {
  169. return uParseTime(val, temp)
  170. } else {
  171. return ''
  172. }
  173. },add(){
  174. if(this.patient_id == 0){
  175. this.$message.error("请选择病人")
  176. return
  177. }
  178. this.$router.push("/outpatientDoctorStation/prescriptionTemplatedetail?id="+0+"&patient_id="+this.patient_id)
  179. }
  180. },
  181. created() {
  182. var nowDate = new Date()
  183. var nowYear = nowDate.getFullYear()
  184. var nowMonth = nowDate.getMonth() + 1
  185. var nowDay = nowDate.getDate()
  186. this.record_date =
  187. nowYear +
  188. '-' +
  189. (nowMonth < 10 ? '0' + nowMonth : nowMonth) +
  190. '-' +
  191. (nowDay < 10 ? '0' + nowDay : nowDay)
  192. this.getList()
  193. let tableHeight = document.body.clientHeight - 263
  194. this.tableHeight = tableHeight
  195. },
  196. mounted() {
  197. const that = this
  198. window.onresize = () => {
  199. return (() => {
  200. window.fullHeight = document.documentElement.clientHeight
  201. that.fullHeight = window.fullHeight
  202. })()
  203. }
  204. },
  205. watch: {
  206. fullHeight(val) {
  207. if (!this.timer) {
  208. this.fullHeight = val
  209. let tableHeight = val - 263
  210. this.tableHeight = tableHeight
  211. this.timer = true
  212. let that = this
  213. setTimeout(function() {
  214. that.timer = false
  215. }, 400)
  216. }
  217. }
  218. }
  219. }
  220. </script>
  221. <style lang="scss" scoped>
  222. .new-main-contain {
  223. height: 100%;
  224. display: flex;
  225. flex-direction: column;
  226. }
  227. .app-container {
  228. height: 100%;
  229. }
  230. .mainCell {
  231. height: 36px;
  232. display: flex;
  233. align-items: center;
  234. }
  235. .mainLeft {
  236. width: 200px;
  237. height: 100%;
  238. display: flex;
  239. flex-direction: column;
  240. .el-radio {
  241. margin-right: 5px;
  242. }
  243. }
  244. .mainRight {
  245. margin-left: 10px;
  246. flex: 1;
  247. height: 100%;
  248. display: flex;
  249. flex-direction: column;
  250. overflow-y: auto;
  251. .cellSpan {
  252. min-width: 80px;
  253. display: inline-block;
  254. margin-right: 10px;
  255. }
  256. }
  257. .mainCenter {
  258. display: flex;
  259. flex: 1;
  260. }
  261. .centerLeft {
  262. flex: 1;
  263. display: flex;
  264. flex-direction: column;
  265. position: relative;
  266. .el-form-item {
  267. width: 32%;
  268. margin-right: 1%;
  269. float: left;
  270. }
  271. .el-form-item__label {
  272. text-align: left;
  273. }
  274. }
  275. .backColor {
  276. background: #f6f8f9;
  277. height: 5px;
  278. margin-bottom: 5px;
  279. }
  280. .tabsBox {
  281. position: relative;
  282. height: 76%;
  283. overflow-y: auto;
  284. margin-bottom: 60px;
  285. .el-tabs__item {
  286. padding: 0 10px;
  287. }
  288. }
  289. .preTabs {
  290. height: 100%;
  291. display: flex;
  292. flex-direction: column;
  293. .el-tabs__content {
  294. flex: 1;
  295. overflow-y: auto;
  296. }
  297. }
  298. .costBox {
  299. width: 100%;
  300. height: 60px;
  301. background: #fff;
  302. position: absolute;
  303. bottom: 0;
  304. display: flex;
  305. align-items: center;
  306. }
  307. .addTab {
  308. position: absolute;
  309. right: 0;
  310. top: 14px;
  311. z-index: 20;
  312. }
  313. .centerRight {
  314. width: 300px;
  315. margin-left: 10px;
  316. display: flex;
  317. flex-direction: column;
  318. position: relative;
  319. }
  320. .rightTab {
  321. height: 40px;
  322. width: 100%;
  323. border: 1px solid #d2d2d2;
  324. box-sizing: border-box;
  325. p {
  326. width: 50%;
  327. height: 40px;
  328. line-height: 40px;
  329. text-align: center;
  330. background: #eee;
  331. float: left;
  332. }
  333. > p:last-child {
  334. border-left: 1px solid #d2d2d2;
  335. float: right;
  336. }
  337. .activeP {
  338. background: #409EFF;
  339. color: #fff;
  340. }
  341. }
  342. .comfirmBox {
  343. width: 100%;
  344. height: 60px;
  345. background: #fff;
  346. position: absolute;
  347. bottom: 0;
  348. display: flex;
  349. align-items: center;
  350. justify-content: space-between;
  351. }
  352. .mainHeader {
  353. width: 100%;
  354. background: #fff;
  355. position: fixed;
  356. z-index: 100;
  357. height: 36px;
  358. }
  359. .titleBox {
  360. position: fixed;
  361. z-index: 99;
  362. background: #fff;
  363. }
  364. .fixedCell {
  365. position: fixed;
  366. z-index: 99;
  367. right: 30px;
  368. background: #fff;
  369. width: 300px;
  370. display: flex;
  371. justify-content: space-between;
  372. }
  373. </style>
  374. <style lang="scss">
  375. .centerLeft {
  376. .el-form-item__label {
  377. text-align: left;
  378. }
  379. }
  380. .tabsBox {
  381. .el-tabs__item {
  382. padding: 0 10px;
  383. }
  384. .el-tabs--bottom .el-tabs--left > .el-tabs__header .el-tabs__item:nth-child(2), .el-tabs--bottom .el-tabs--right > .el-tabs__header .el-tabs__item:nth-child(2), .el-tabs--bottom.el-tabs--border-card > .el-tabs__header .el-tabs__item:nth-child(2), .el-tabs--bottom.el-tabs--card > .el-tabs__header .el-tabs__item:nth-child(2), .el-tabs--top .el-tabs--left > .el-tabs__header .el-tabs__item:nth-child(2), .el-tabs--top .el-tabs--right > .el-tabs__header .el-tabs__item:nth-child(2), .el-tabs--top.el-tabs--border-card > .el-tabs__header .el-tabs__item:nth-child(2), .el-tabs--top.el-tabs--card > .el-tabs__header .el-tabs__item:nth-child(2) {
  385. padding: 0 10px;
  386. }
  387. .el-tabs--bottom .el-tabs--left > .el-tabs__header .el-tabs__item:last-child, .el-tabs--bottom .el-tabs--right > .el-tabs__header .el-tabs__item:last-child, .el-tabs--bottom.el-tabs--border-card > .el-tabs__header .el-tabs__item:last-child, .el-tabs--bottom.el-tabs--card > .el-tabs__header .el-tabs__item:last-child, .el-tabs--top .el-tabs--left > .el-tabs__header .el-tabs__item:last-child, .el-tabs--top .el-tabs--right > .el-tabs__header .el-tabs__item:last-child, .el-tabs--top.el-tabs--border-card > .el-tabs__header .el-tabs__item:last-child, .el-tabs--top.el-tabs--card > .el-tabs__header .el-tabs__item:last-child {
  388. padding: 0 10px;
  389. }
  390. .el-tabs--card > .el-tabs__header .el-tabs__item.is-active.is-closable {
  391. padding: 0 10px;
  392. }
  393. }
  394. .centerRight {
  395. .el-tabs__nav-scroll {
  396. display: flex;
  397. }
  398. .el-tabs__nav {
  399. margin: 0 auto;
  400. }
  401. .el-table th .cell, .el-table td .cell {
  402. padding: 0 2px;
  403. }
  404. }
  405. .preTabs {
  406. .el-tabs__content {
  407. }
  408. }
  409. .rightTabs {
  410. height: 100%;
  411. .el-tabs__content {
  412. }
  413. }
  414. .centerDialog {
  415. .el-dialog__body {
  416. max-height: calc(100vh - 100px) !important;
  417. padding: 0 20px;
  418. }
  419. }
  420. </style>