MedicinePrompt.vue 6.7 KB

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