StaticInfo.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438
  1. <template>
  2. <div>
  3. <crumbs title="医学术语静态知识维护" style="min-width: 1088px">
  4. <el-form :inline="true" class="demo-form-inline">
  5. <el-form-item label="术语分类:" class="selectMedicine">
  6. <el-select size="mini" v-model="filter.libType" placeholder="请选择" clearable>
  7. <el-option
  8. v-for="item in typeList"
  9. :label="item.name"
  10. :value="item.orderNo"
  11. :key="item.orderNo"
  12. ></el-option>
  13. </el-select>
  14. </el-form-item>
  15. <el-form-item label="标准术语:">
  16. <el-input size="mini" maxlength="50" v-model="filter.term" placeholder="请输入" clearable></el-input>
  17. </el-form-item>
  18. <el-form-item label="状态:" class="selectMedicine">
  19. <el-select size="mini" v-model="filter.status" placeholder="请选择" clearable>
  20. <el-option v-for="item in stateList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  21. </el-select>
  22. </el-form-item>
  23. <el-form-item class="dododo">
  24. <el-button size="mini" @click="filterDatas">检索</el-button>
  25. <el-button
  26. size="mini"
  27. type="warning"
  28. @click="reIdentification"
  29. >{{!reLoading?'更新图谱标识':'正在更新中...'}}</el-button>
  30. <el-button size="mini" type="warning" @click="addMedicalPrompt">添加静态知识</el-button>
  31. </el-form-item>
  32. </el-form>
  33. </crumbs>
  34. <div class="contents">
  35. <el-table :data="list" border style="width: 100%">
  36. <el-table-column type="index" :index="indexMethod" label="编号" width="80"></el-table-column>
  37. <el-table-column prop="gmtModified" label="操作时间" width="180"></el-table-column>
  38. <el-table-column prop="name" label="标准术语" :show-overflow-tooltip="true"></el-table-column>
  39. <el-table-column prop="typeName" label="术语分类" width="120"></el-table-column>
  40. <el-table-column prop="title" label="内容概览" width="240" :show-overflow-tooltip="true"></el-table-column>
  41. <el-table-column label="状态" width="160">
  42. <template slot-scope="scope">
  43. <span v-if="scope.row.status===1">启用</span>
  44. <span v-if="scope.row.status===0">禁用</span>
  45. </template>
  46. </el-table-column>
  47. <el-table-column label="操作" width="140">
  48. <template slot-scope="scope">
  49. <el-button v-if="scope.row.status===0" type="text" size="small" class="is-disabled">修改</el-button>
  50. <el-button
  51. v-if="scope.row.status===1"
  52. type="text"
  53. size="small"
  54. @click="toEditProduct(scope.row)"
  55. >修改</el-button>
  56. <span style="margin:0 3px;">|</span>
  57. <el-button type="text" size="small" @click="toCopyProduct(scope.row)">复制</el-button>
  58. <span style="margin:0 3px;">|</span>
  59. <el-button
  60. v-if="scope.row.status===0"
  61. type="text"
  62. size="small"
  63. @click="showReuseDialog(scope.row)"
  64. >启用</el-button>
  65. <el-button
  66. v-if="scope.row.status===1"
  67. type="text"
  68. size="small"
  69. class="delete"
  70. @click="showDelDialog(scope.row)"
  71. >禁用</el-button>
  72. </template>
  73. </el-table-column>
  74. </el-table>
  75. <el-pagination
  76. :current-page.sync="currentPage"
  77. @current-change="currentChange"
  78. background
  79. :page-size="pageSize"
  80. class="pagepage pagepage"
  81. :page-sizes="pageSizeArr"
  82. @size-change="handleSizeChange"
  83. :layout="pageLayout"
  84. :total="total"
  85. ></el-pagination>
  86. </div>
  87. </div>
  88. </template>
  89. <script>
  90. import api from '@api/cdss.js';
  91. import config from '@api/config.js';
  92. import utils from '@api/utils.js';
  93. export default {
  94. name: 'MedicinePrompt',
  95. data: function() {
  96. return {
  97. list: [],
  98. cacheData: {},
  99. currentPage: 1,
  100. pageSize: config.pageSize,
  101. pageSizeArr: config.pageSizeArr,
  102. pageLayout: config.pageLayout,
  103. total: 0,
  104. linkIn: [],
  105. pays: [],
  106. typeList: [],
  107. stateList: [
  108. { id: 1, name: '启用' },
  109. { id: 0, name: '禁用' }
  110. ],
  111. searched: false,
  112. filter: {
  113. term: '',
  114. title: '',
  115. status: '',
  116. libType: ''
  117. },
  118. reLoading: false //更新图谱标识
  119. };
  120. },
  121. created() {
  122. const that = this;
  123. //返回时避免参数未赋值就获取列表
  124. setTimeout(function() {
  125. // that.getDataList();
  126. // that.getListDicCDSS();
  127. });
  128. // this.typeList = config.emData;
  129. // 非首页 编辑页返回 设置 this.currentPage
  130. if (Object.keys(this.$route.params).length !== 0) {
  131. this.currentPage = this.$route.params.currentPage;
  132. }
  133. },
  134. watch: {
  135. filter: {
  136. handler: function() {
  137. this.searched = false;
  138. },
  139. deep: true
  140. }
  141. },
  142. beforeRouteEnter(to, from, next) {
  143. next(vm => {
  144. //const pm = to.param;
  145. Object.assign(vm, to.params);
  146. vm.inCurrentPage = to.params.currentPage;
  147. });
  148. },
  149. methods: {
  150. //更新图谱标识
  151. reIdentification() {
  152. this.reLoading = true;
  153. api.BatchUpdateHasInfoStatus().then(res => {
  154. this.reLoading = false;
  155. if (res.data.code === '0' && res.data.data === true) {
  156. // 更新成功
  157. this.warning('更新成功', 'success');
  158. } else {
  159. // 更新失败
  160. this.warning('更新失败');
  161. }
  162. });
  163. },
  164. getListDicCDSS() {
  165. api.getListDicCDSS().then(res => {
  166. if (res.data.code === '0') {
  167. this.typeList = res.data.data && res.data.data['10'];
  168. }
  169. });
  170. },
  171. handleSizeChange(val) {
  172. this.pageSize = val;
  173. this.currentPage = utils.getCurrentPage(
  174. this.currentPage,
  175. this.total,
  176. this.pageSize
  177. );
  178. this.getDataList();
  179. },
  180. addMedicalPrompt() {
  181. const pam = this.searched
  182. ? {
  183. currentPage: this.currentPage,
  184. pageSize: this.pageSize,
  185. filter: this.filter
  186. }
  187. : { currentPage: this.currentPage, pageSize: this.pageSize };
  188. this.$router.push({ name: 'AddDevKnow', params: pam });
  189. },
  190. toEditProduct(row) {
  191. const pam = this.searched
  192. ? {
  193. currentPage: this.currentPage,
  194. pageSize: this.pageSize,
  195. filter: this.filter
  196. }
  197. : { currentPage: this.currentPage, pageSize: this.pageSize };
  198. this.$router.push({
  199. name: 'AddDevKnow',
  200. params: Object.assign(pam, { data: row, isEdit: true })
  201. });
  202. },
  203. toCopyProduct(row) {
  204. const pam = this.searched
  205. ? {
  206. currentPage: this.currentPage,
  207. pageSize: this.pageSize,
  208. filter: this.filter
  209. }
  210. : { currentPage: this.currentPage, pageSize: this.pageSize };
  211. this.$router.push({
  212. name: 'AddDevKnow',
  213. params: Object.assign(pam, { data: row, isCopy: true })
  214. });
  215. },
  216. filterDatas() {
  217. this.currentPage = 1;
  218. this.getDataList();
  219. },
  220. getDataList(isTurnPage) {
  221. const param = this.getFilterItems(isTurnPage);
  222. this.searched = true;
  223. const loading = this.$loading({
  224. lock: true,
  225. text: 'Loading',
  226. spinner: 'el-icon-loading',
  227. background: 'rgba(0, 0, 0, 0.7)'
  228. });
  229. api
  230. .getConceptKnowledgeList(param)
  231. .then(res => {
  232. loading.close();
  233. if (res.data.code == '0') {
  234. const data = res.data.data;
  235. // 类型:1-诊断、2-药品、3-检验套餐、4-检验细项、5-检查、6-检查子项 7-手术和操作
  236. let temp = [
  237. '',
  238. '诊断',
  239. '药品',
  240. '检验套餐',
  241. '检验细项',
  242. '检查',
  243. '检查子项',
  244. '手术和操作'
  245. ];
  246. this.list = data.records = data.records.filter(item => {
  247. item.typeName = temp[item.type];
  248. return item;
  249. });
  250. this.cacheData[param.current] = data.records;
  251. this.total = data.total;
  252. if (this.inCurrentPage !== undefined) {
  253. this.currentPage = this.inCurrentPage;
  254. this.inCurrentPage = undefined;
  255. }
  256. }
  257. })
  258. .catch(error => {
  259. if (error.code === '900010001') {
  260. return false;
  261. }
  262. console.log(error);
  263. });
  264. },
  265. clearFilter() {
  266. this.filter = {
  267. term: '',
  268. title: '',
  269. status: '',
  270. libType: ''
  271. };
  272. },
  273. getFilterItems(isTurnPage) {
  274. //翻页时筛选条件没点确定则清空
  275. if (isTurnPage && !this.searched) {
  276. this.clearFilter();
  277. }
  278. const param = {
  279. name: this.filter.term.trim(),
  280. title: this.filter.title,
  281. current: this.inCurrentPage || this.currentPage,
  282. size: this.pageSize,
  283. status: this.filter.status,
  284. type: this.filter.libType
  285. };
  286. return param;
  287. },
  288. indexMethod(index) {
  289. return (this.currentPage - 1) * this.pageSize + index + 1;
  290. },
  291. currentChange(next) {
  292. this.currentPage = next;
  293. /*if (this.cacheData[next]) { //如果已请求过该页数据,则使用缓存不重复请求
  294. this.list = this.cacheData[next];
  295. } else {*/
  296. this.getDataList(true);
  297. //}
  298. },
  299. warning(msg, type) {
  300. this.$message({
  301. showClose: true,
  302. message: msg,
  303. type: type || 'warning'
  304. });
  305. },
  306. showConfirmDialog(msg, resolve, type) {
  307. let showInfo = '启用';
  308. let btnNameClass = 'confirmBtn1';
  309. if (type === 'Del') {
  310. showInfo = '禁用';
  311. btnNameClass = 'delBtn';
  312. }
  313. this.$alert(msg, '提示', {
  314. confirmButtonText: showInfo,
  315. // cancelButtonText: '取消',
  316. // cancelButtonClass: 'cancelBtn',
  317. // confirmButtonClass: btnNameClass,
  318. type: 'warning'
  319. })
  320. .then(() => {
  321. resolve();
  322. })
  323. .catch(() => {});
  324. },
  325. showDelDialog(row) {
  326. this.showConfirmDialog(
  327. '确定禁用该静态知识?',
  328. () => {
  329. api
  330. .delConceptInfo({ id: row.id, status: 0 })
  331. .then(res => {
  332. if (res.data.code == '0') {
  333. if (!this.searched) {
  334. //未点确认时清空搜索条件
  335. this.clearFilter();
  336. }
  337. this.warning(res.data.msg || '操作成功', 'success');
  338. this.getDataList();
  339. } else {
  340. this.warning(res.data.msg);
  341. }
  342. })
  343. .catch(error => {
  344. if (error.code === '900010001') {
  345. return false;
  346. }
  347. this.warning(error);
  348. });
  349. },
  350. 'Del'
  351. );
  352. },
  353. showReuseDialog(row) {
  354. this.showConfirmDialog(
  355. '确定启用该静态知识?',
  356. () => {
  357. api
  358. .delConceptInfo({ id: row.id, status: 1 })
  359. .then(res => {
  360. if (res.data.code == '0') {
  361. this.currentPage = 1; //恢复数据跳转到筛选条件下首页
  362. this.warning(res.data.msg || '操作成功', 'success');
  363. this.getDataList();
  364. } else {
  365. this.warning(res.data.msg);
  366. }
  367. })
  368. .catch(error => {
  369. if (error.code === '900010001') {
  370. return false;
  371. }
  372. this.warning(error);
  373. });
  374. },
  375. 'Reuse'
  376. );
  377. }
  378. }
  379. };
  380. </script>
  381. <style lang="less" scoped>
  382. @import '../../less/admin.less';
  383. .status-span {
  384. font-size: 12px;
  385. margin-right: 10px;
  386. color: unset;
  387. }
  388. .dododo {
  389. margin-top: 1px !important;
  390. }
  391. .pagepage {
  392. .el-input.el-input--mini.el-input--suffix input {
  393. height: 28px;
  394. line-height: 28px;
  395. }
  396. .el-pagination__sizes {
  397. margin-right: 20px !important;
  398. }
  399. }
  400. .el-message-box {
  401. /deep/ .cancelBtn {
  402. background-color: #d7d7d7;
  403. border-color: transparent;
  404. }
  405. /deep/ .delBtn {
  406. background-color: #ff545b !important;
  407. border-color: transparent !important;
  408. }
  409. /deep/ .confirmBtn1 {
  410. position: relative;
  411. right: 0px !important;
  412. }
  413. }
  414. .selectMedicine {
  415. // /deep/ .el-input__suffix-inner {
  416. // position: relative;
  417. // top: -1px;
  418. // }
  419. /deep/ .el-icon-circle-close {
  420. position: relative;
  421. // top: -2px;
  422. left: 12px;
  423. }
  424. }
  425. body {
  426. .el-tooltip__popper {
  427. max-width: 400px;
  428. }
  429. }
  430. </style>