MedicinePrompt.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. <template>
  2. <div>
  3. <crumbs title="医学术语静态知识维护">
  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 label="标签系统名称:">
  9. <el-input size="mini" v-model="filter.term" placeholder="术语标签" clearable></el-input>
  10. </el-form-item>
  11. <el-form-item>
  12. <el-button size="mini" @click="filterDatas">确认</el-button>
  13. <router-link to="/admin/LT-YXSYKWH-TJYXSYJTZS" style="margin:0 10px">
  14. <el-button size="mini" type="warning">添加静态知识</el-button>
  15. </router-link>
  16. </el-form-item>
  17. </el-form>
  18. </crumbs>
  19. <div class="contents">
  20. <el-table :data="list"
  21. border
  22. style="width: 100%">
  23. <el-table-column
  24. type="index"
  25. :index="indexMethod"
  26. label="编号"
  27. width="60">
  28. </el-table-column>
  29. <el-table-column
  30. prop="gmtModified"
  31. label="操作时间"
  32. width="180"
  33. :show-overflow-tooltip="true">
  34. </el-table-column>
  35. <el-table-column
  36. prop="name"
  37. label="医学标准术语">
  38. </el-table-column>
  39. <el-table-column
  40. prop="title"
  41. label="静态知识名称"
  42. width="240">
  43. </el-table-column>
  44. <el-table-column
  45. prop="modifier"
  46. label="操作人"
  47. width="80">
  48. </el-table-column>
  49. <el-table-column
  50. label="操作" width="120">
  51. <template slot-scope="scope">
  52. <el-button type="text" size="small" @click="toEditProduct(scope.row)">修改</el-button>
  53. <span style="margin:0 3px;">|</span>
  54. <el-button type="text" size="small" @click="showDelDialog(scope.row.id)">删除</el-button>
  55. </template>
  56. </el-table-column>
  57. </el-table>
  58. <el-pagination v-if="total>pageSize"
  59. :current-page.sync="currentPage"
  60. @current-change="currentChange"
  61. background
  62. :page-size="pageSize"
  63. layout="total,prev, pager, next, jumper"
  64. :total="total">
  65. </el-pagination>
  66. </div>
  67. </div>
  68. </template>
  69. <script>
  70. import api from '@api/icss.js';
  71. import utils from '@api/utils.js';
  72. export default {
  73. name: 'MedicinePrompt',
  74. data: function () {
  75. return {
  76. list: [],
  77. cacheData: {},
  78. currentPage: 1,
  79. pageSize: 10,
  80. total: 0,
  81. linkIn:[],
  82. pays:[],
  83. filter: {
  84. name: '',
  85. tagName:''
  86. }
  87. }
  88. },
  89. created() {
  90. this.getDataList();
  91. },
  92. methods: {
  93. toEditProduct(row){
  94. this.$router.push({
  95. name:'AddMedicinePrompt',
  96. params: {data:row,isEdit:true}
  97. })
  98. },
  99. filterDatas(){
  100. this.currentPage = 1;
  101. this.getDataList();
  102. },
  103. getDataList() {
  104. const param = this.getFilterItems();
  105. // const param = {
  106. // 'name':''
  107. // };
  108. api.getConceptKnowledgeList(param).then((res) => {
  109. if (res.data.code == '0') {
  110. const data = res.data.data;
  111. this.list = data.records;
  112. this.cacheData[param.current] = data.records;
  113. this.total = data.total;
  114. }
  115. }).catch((error) => {
  116. console.log(error);
  117. });
  118. },
  119. getDetailList(id) {
  120. const param = {'id': id,};
  121. this.$router.push({name:'PromptDetail', params:{id: id}})
  122. },
  123. getFilterItems() {
  124. const param = {
  125. term:this.filter.name,
  126. conecpt_name:this.filter.term,
  127. current: this.currentPage,
  128. size: this.pageSize
  129. };
  130. return param;
  131. },
  132. indexMethod(index) {
  133. return ((this.currentPage - 1) * this.pageSize) + index + 1;
  134. },
  135. currentChange(next) {
  136. this.currentPage = next;
  137. if (this.cacheData[next]) { //如果已请求过该页数据,则使用缓存不重复请求
  138. this.list = this.cacheData[next];
  139. } else {
  140. this.getDataList();
  141. }
  142. },
  143. warning(msg,type){
  144. this.$message({
  145. showClose: true,
  146. message:msg,
  147. type:type||'warning'
  148. })
  149. },
  150. showConfirmDialog(msg,resolve){
  151. this.$alert(msg, '提示', {
  152. confirmButtonText: '确定',
  153. type: 'warning'
  154. }).then(() => {
  155. resolve();
  156. }).catch(() => {});
  157. },
  158. showDelDialog(id){
  159. this.showConfirmDialog('是否删除该静态知识?',()=>{
  160. api.delConceptInfo({id}).then((res)=>{
  161. if(res.data.code=='0'){
  162. this.warning(res.data.msg||'操作成功','success');
  163. this.getDataList();
  164. }else{
  165. this.warning(res.data.msg);
  166. }
  167. }).catch((error)=>{
  168. this.warning(error);
  169. })
  170. });
  171. }
  172. }
  173. }
  174. </script>
  175. <style lang="less">
  176. @import "../../less/admin.less";
  177. .status-span{
  178. font-size: 12px;
  179. margin-right:10px;
  180. color: unset;
  181. }
  182. </style>