MedicalTerm.vue 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341
  1. <template>
  2. <div>
  3. <crumbs title="医院术语关联" style="min-width: 980px">
  4. <el-form :inline="true" class="demo-form-inline">
  5. <el-form-item label="医院名称:">
  6. <el-input size="mini" v-model="filter.name" placeholder="请输入" clearable></el-input>
  7. </el-form-item>
  8. <el-form-item>
  9. <el-button size="mini" @click="filterDatas">检索</el-button>
  10. <!-- <el-button size="mini" type="warning" @click="addRelation">添加方案</el-button> -->
  11. </el-form-item>
  12. </el-form>
  13. </crumbs>
  14. <div class="contents">
  15. <el-table :data="list" border style="width: 100%">
  16. <el-table-column :resizable="false" type="index" :index="indexMethod" label="编号" width="60"></el-table-column>
  17. <el-table-column :resizable="false" prop="name" label="医院名称" show-overflow-tooltip></el-table-column>
  18. <el-table-column :resizable="false" prop="connect" label="术语关联">
  19. <template slot-scope="scope">
  20. <el-switch
  21. v-model="scope.row.connect"
  22. @change="handleStatusChange(scope.row)"
  23. :active-value="1"
  24. :inactive-value="0"
  25. active-color="#4BC4D7"
  26. inactive-color="#BBBBBB"
  27. ></el-switch>
  28. <span class="titlwSwitchStatus">{{scope.row.connect === 1 ? '开' : '关'}}</span>
  29. </template>
  30. </el-table-column>
  31. <el-table-column :resizable="false" prop="diseaseNum" label="诊断关联">
  32. <template slot-scope="scope">
  33. <span
  34. class="relation"
  35. @click="goRelationPage('Disease',scope.row)"
  36. >{{scope.row.diseaseNum}}</span>
  37. </template>
  38. </el-table-column>
  39. <el-table-column :resizable="false" prop="lisNum" label="检验关联">
  40. <template slot-scope="scope">
  41. <span class="relation" @click="goRelationPage('Lis',scope.row)">{{scope.row.lisNum}}</span>
  42. </template>
  43. </el-table-column>
  44. <el-table-column :resizable="false" prop="pacsNum" label="检查关联">
  45. <template slot-scope="scope">
  46. <span class="relation" @click="goRelationPage('Pacs',scope.row)">{{scope.row.pacsNum}}</span>
  47. </template>
  48. </el-table-column>
  49. <el-table-column :resizable="false" prop="drugNum" label="药品关联">
  50. <template slot-scope="scope">
  51. <span
  52. class="relation"
  53. @click="goRelationPage('DrugManage',scope.row)"
  54. >{{scope.row.drugNum}}</span>
  55. </template>
  56. </el-table-column>
  57. <el-table-column :resizable="false" prop="operationNum" label="手术/操作关联">
  58. <template slot-scope="scope">
  59. <span
  60. class="relation"
  61. @click="goRelationPage('Operation',scope.row)"
  62. >{{scope.row.operationNum}}</span>
  63. </template>
  64. </el-table-column>
  65. <el-table-column :resizable="false" prop="transfusionNum" label="输血关联">
  66. <template slot-scope="scope">
  67. <span
  68. class="relation"
  69. @click="goRelationPage('Fusion',scope.row)"
  70. >{{scope.row.transfusionNum}}</span>
  71. </template>
  72. </el-table-column>
  73. <el-table-column :resizable="false" prop="deptNum" label="科室关联">
  74. <template slot-scope="scope">
  75. <span
  76. class="relation"
  77. @click="goRelationPage('DeptManage',scope.row)"
  78. >{{scope.row.deptNum}}</span>
  79. </template>
  80. </el-table-column>
  81. </el-table>
  82. <div class="pagination">
  83. <el-pagination
  84. :current-page.sync="currentPage"
  85. @current-change="currentChange"
  86. background
  87. :page-size="pageSize"
  88. :page-sizes="pageSizeArr"
  89. @size-change="handleSizeChange"
  90. :layout="pageLayout"
  91. :total="total"
  92. ></el-pagination>
  93. </div>
  94. </div>
  95. </div>
  96. </template>
  97. <script>
  98. import api from '@api/cdss.js';
  99. import config from '@api/config.js';
  100. import utils from '@api/utils.js';
  101. export default {
  102. name: 'Plan',
  103. data: function() {
  104. return {
  105. list: [],
  106. searched: false,
  107. filter: {
  108. name: '' //标准诊断名称
  109. },
  110. currentPage: 1,
  111. pageSize: config.pageSize,
  112. pageSizeArr: config.pageSizeArr,
  113. pageLayout: config.pageLayout,
  114. total: 0
  115. };
  116. },
  117. created() {
  118. const that = this;
  119. //返回时避免参数未赋值就获取列表
  120. setTimeout(function() {
  121. that.getDataList();
  122. });
  123. // 非首页 编辑页返回 设置 this.currentPage
  124. if (Object.keys(this.$route.params).length !== 0) {
  125. this.currentPage = this.$route.params.currentPage;
  126. }
  127. },
  128. watch: {
  129. filter: {
  130. handler: function() {
  131. this.searched = false;
  132. },
  133. deep: true
  134. }
  135. },
  136. beforeRouteEnter(to, from, next) {
  137. next(vm => {
  138. //const pm = to.param;
  139. Object.assign(vm, to.params);
  140. vm.inCurrentPage = to.params.currentPage;
  141. });
  142. },
  143. methods: {
  144. handleSizeChange(val) {
  145. this.pageSize = val;
  146. this.currentPage = utils.getCurrentPage(
  147. this.currentPage,
  148. this.total,
  149. this.pageSize
  150. );
  151. this.getDataList();
  152. },
  153. // 获取列表数据
  154. async getDataList(isTurnPage) {
  155. let params = await this.getFilterItems(isTurnPage);
  156. this.searched = true;
  157. const loading = this.$loading({
  158. lock: true,
  159. text: 'Loading',
  160. spinner: 'el-icon-loading',
  161. background: 'rgba(0, 0, 0, 0.7)'
  162. });
  163. api.getMappingListPageCDSS(params).then(res => {
  164. loading.close();
  165. if (res.data.code === '0') {
  166. this.list = res.data.data && res.data.data.records;
  167. }
  168. this.total = res.data.data && res.data.data.total;
  169. if (this.inCurrentPage !== undefined) {
  170. this.currentPage = this.inCurrentPage;
  171. this.inCurrentPage = undefined;
  172. }
  173. });
  174. },
  175. // 处理列表请求数据参数
  176. async getFilterItems(isTurnPage) {
  177. //翻页时筛选条件没点确定则清空
  178. if (isTurnPage && !this.searched) {
  179. this.clearFilter();
  180. }
  181. const param = {
  182. current: this.inCurrentPage || this.currentPage,
  183. size: this.pageSize,
  184. name: this.filter.name.trim()
  185. };
  186. return param;
  187. },
  188. filterDatas() {
  189. this.currentPage = 1;
  190. this.getDataList();
  191. },
  192. // 页面跳转
  193. goRelationPage(from, row) {
  194. const item = Object.assign({}, row);
  195. // const pam = this.searched
  196. // ? {
  197. // currentPage: this.currentPage,
  198. // pageSize: this.pageSize,
  199. // filter: this.filter
  200. // }
  201. // : { currentPage: this.currentPage, pageSize: this.pageSize };
  202. this.$router.push({
  203. name: from,
  204. // params: Object.assign(pam, { from, data: item })
  205. params: { data: { ...item } }
  206. });
  207. },
  208. currentChange(next) {
  209. this.currentPage = next;
  210. this.getDataList(true);
  211. },
  212. // 清空搜索参数
  213. clearFilter() {
  214. this.filter = {
  215. name: ''
  216. };
  217. },
  218. indexMethod(index) {
  219. return (this.currentPage - 1) * this.pageSize + index + 1;
  220. },
  221. // 医院关联处理
  222. handleStatusChange(row) {
  223. console.log(row, '=状态');
  224. let connectInfo = row.connect == 1 ? '开启' : '关闭';
  225. this.$alert(`确定要${connectInfo}${row.name}的术语关联吗?`, '提示', {
  226. confirmButtonText: '确定',
  227. // cancelButtonText: '取消',
  228. type: 'warning'
  229. })
  230. .then(() => {
  231. api
  232. .modifyConnectStatusCDSS({
  233. connect: row.connect,
  234. id: row.hospitalId
  235. })
  236. .then(res => {
  237. if (res.data.code === '0') {
  238. this.getDataList();
  239. this.$message({
  240. type: 'success',
  241. message: '操作成功!'
  242. });
  243. }
  244. });
  245. })
  246. .catch(() => {
  247. this.getDataList();
  248. this.$message({
  249. type: 'info',
  250. message: '已取消'
  251. });
  252. });
  253. }
  254. }
  255. };
  256. </script>
  257. <style lang="less" scoped>
  258. @import '../../less/admin.less';
  259. .delete {
  260. color: red;
  261. }
  262. .delete:hover {
  263. color: red;
  264. }
  265. .pagination {
  266. min-width: 1010px;
  267. }
  268. .disable {
  269. border-color: transparent;
  270. }
  271. .el-message-box {
  272. /deep/.cancelBtn {
  273. background-color: #d7d7d7;
  274. border-color: transparent;
  275. }
  276. /deep/ .delBtn {
  277. background-color: #ff545b !important;
  278. border-color: transparent !important;
  279. }
  280. /deep/ .confirmBtn2 {
  281. position: relative;
  282. right: 0px !important;
  283. }
  284. }
  285. .exportBoxL {
  286. /deep/ .el-message-box__btns {
  287. margin-top: 20px;
  288. }
  289. /deep/ .el-message-box__message {
  290. text-align: left;
  291. }
  292. /deep/ .el-message-box__btns {
  293. // text-align: center;
  294. margin-bottom: 24px;
  295. }
  296. /deep/ .leftbtn {
  297. margin-right: 46px;
  298. background-color: #d7d7d7;
  299. border-color: transparent;
  300. }
  301. /deep/ .cancelSureL {
  302. // text-align: center;
  303. display: none;
  304. }
  305. /deep/ .sureL {
  306. float: right;
  307. }
  308. }
  309. .contents {
  310. .is-plain {
  311. color: #dad7d7;
  312. }
  313. .is-plain:hover {
  314. color: #dad7d7;
  315. }
  316. }
  317. .el-table__row {
  318. /deep/ .is-disabled {
  319. border-color: transparent !important;
  320. }
  321. }
  322. .relation {
  323. color: #009dd9;
  324. cursor: pointer;
  325. }
  326. .titlwSwitchStatus {
  327. margin-left: 16px;
  328. }
  329. </style>