ConceptRelation.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  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="conceptName" 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
  16. :data="list"
  17. border
  18. style="width: 100%">
  19. <el-table-column
  20. :resizable = "false"
  21. type="index"
  22. :index = 'indexMethod'
  23. label="编号"
  24. width="60">
  25. </el-table-column>
  26. <el-table-column
  27. :resizable = "false"
  28. prop="operTime"
  29. label="操作时间"
  30. width="180">
  31. </el-table-column>
  32. <el-table-column
  33. :resizable = "false"
  34. prop="libNameType"
  35. label="医学标准术语"
  36. show-overflow-tooltip>
  37. </el-table-column>
  38. <el-table-column
  39. :resizable = "false"
  40. prop="otherNames"
  41. label="关联术语"
  42. show-overflow-tooltip>
  43. </el-table-column>
  44. <!-- <el-table-column
  45. label="状态">
  46. <template slot-scope="scope">
  47. <span :class="scope.row.isDeleted == 'N'?'':'delete'">
  48. {{scope.row.isDeleted == 'N'?'启用中':'已删除'}}
  49. </span>
  50. </template>
  51. </el-table-column> -->
  52. <el-table-column
  53. :resizable = "false"
  54. prop="operName"
  55. label="操作人">
  56. </el-table-column>
  57. <el-table-column
  58. label="操作"
  59. width="160"
  60. :resizable = "false">
  61. <template slot-scope="scope">
  62. <el-button type="text" size="small" :disabled="scope.row.isDeleted != 'N'" @click="modifyRelation(scope.row)">修改</el-button>
  63. <span style="margin:0 3px;">|</span>
  64. <el-button type="text" size="small" :class="scope.row.isDeleted == 'N'?'delete':'review'" @click="showDelDialog(scope.row)">{{scope.row.isDeleted == 'N'?'删除':'恢复'}}</el-button>
  65. </template>
  66. </el-table-column>
  67. </el-table>
  68. <div class="pagination">
  69. <el-pagination v-if="total>pageSize"
  70. :current-page.sync="currentPage"
  71. @current-change="currentChange"
  72. background
  73. :page-size="pageSize"
  74. layout="total,prev, pager, next, jumper"
  75. :total="total">
  76. </el-pagination>
  77. </div>
  78. </div>
  79. </div>
  80. </template>
  81. <script>
  82. import api from '@api/icss.js';
  83. export default {
  84. name: 'ConceptRelation', //诊断量表关联维护
  85. data: function() {
  86. return {
  87. list: [],
  88. conceptName:'',
  89. currentPage: 1,
  90. pageSize: 10,
  91. total: 0,
  92. }
  93. },
  94. created() {
  95. this.getDataList()
  96. },
  97. methods: {
  98. getDataList() {
  99. const param = this.getFilterItems();
  100. api.getConceptRelation(param).then((res) => {
  101. if(res.data.code == '0') {
  102. this.list = res.data.data.records
  103. this.total = res.data.data.total;
  104. }
  105. })
  106. },
  107. filterDatas() {
  108. this.currentPage = 1;
  109. this.getDataList();
  110. },
  111. addRelation() {
  112. this.$router.push({name:'AddConceptRelation'})
  113. },
  114. modifyRelation(row) {
  115. const param = {
  116. "conceptId": row.conceptId
  117. }
  118. api.getConceptRelationDet(param).then((res) => {
  119. if(res.data.code=='0'){
  120. const { data } = res.data
  121. this.$router.push({name:'AddConceptRelation',params:{isEdit:true,data:data}});
  122. } else {
  123. this.warning(res.data.msg);
  124. }
  125. }).catch((error)=>{
  126. this.warning(error)
  127. })
  128. },
  129. currentChange(next) {
  130. this.currentPage = next;
  131. this.getDataList();
  132. },
  133. getFilterItems() {
  134. const param = {
  135. current: this.currentPage,
  136. size: this.pageSize,
  137. name:this.conceptName
  138. };
  139. return param;
  140. },
  141. indexMethod(index) {
  142. return ((this.currentPage - 1) * this.pageSize) + index + 1;
  143. },
  144. getTagType(val) {
  145. return val
  146. },
  147. warning(msg,type){
  148. this.$message({
  149. showClose: true,
  150. message:msg,
  151. type:type||'warning'
  152. })
  153. },
  154. showConfirmDialog(msg,resolve){
  155. this.$alert(msg, '提示', {
  156. confirmButtonText: '确定',
  157. type: 'warning'
  158. }).then(() => {
  159. resolve();
  160. }).catch(() => {});
  161. },
  162. showDelDialog(row){
  163. this.showConfirmDialog('是否删除该关联?',()=>{
  164. const param = {
  165. "conceptId": row.conceptId,
  166. "isDeleted": row.isDeleted=== 'N'?'Y':'N',
  167. "relationId": 17
  168. }
  169. api.delConceptRelation(param).then((res)=>{
  170. if(res.data.code=='0'){
  171. this.getDataList();
  172. this.warning(res.data.msg || '操作成功','success');
  173. }else{
  174. this.warning(res.data.msg);
  175. }
  176. }).catch((error)=>{
  177. this.warning(error);
  178. })
  179. });
  180. }
  181. }
  182. }
  183. </script>
  184. <style lang="less">
  185. @import "../../less/admin.less";
  186. .delete{
  187. color: red;
  188. }
  189. .delete:hover {
  190. color: red;
  191. }
  192. .pagination {
  193. min-width: 1010px;
  194. }
  195. </style>