ChronicDiseaseManage.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  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.tagSysName" 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="addIndeptTag">添加管理评估</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. type="index"
  21. :index = 'indexMethod'
  22. label="编号"
  23. :resizable = "false"
  24. width="60">
  25. </el-table-column>
  26. <el-table-column
  27. :resizable = "false"
  28. prop="gmtModified"
  29. label="操作时间"
  30. width="180">
  31. </el-table-column>
  32. <el-table-column
  33. :resizable = "false"
  34. prop="diseaseName"
  35. label="慢病名称">
  36. </el-table-column>
  37. <el-table-column
  38. :resizable = "false"
  39. prop="modifier"
  40. label="操作人">
  41. </el-table-column>
  42. <el-table-column
  43. :resizable = "false"
  44. prop="operate"
  45. label="操作">
  46. <template slot-scope="scope">
  47. <el-button @click="modifyIndeptTag(scope.row)" type="text" size="small">修改</el-button>
  48. <el-button @click="showDelDialog(scope.row.id)" class="delete" type="text" size="small">删除</el-button>
  49. </template>
  50. </el-table-column>
  51. </el-table>
  52. </div>
  53. <div class="pagination">
  54. <el-pagination v-if="total>pageSize"
  55. :current-page.sync="currentPage"
  56. @current-change="currentChange"
  57. background
  58. :page-size="pageSize"
  59. layout="total,prev, pager, next, jumper"
  60. :total="total">
  61. </el-pagination>
  62. </div>
  63. </div>
  64. </template>
  65. <script>
  66. import api from '@api/icss.js';
  67. export default {
  68. name: 'TemplateMaintenance',
  69. data: function() {
  70. return {
  71. list: [],
  72. tagTypes: [],
  73. Adscriptions: [],
  74. AdscriptionsType:[],
  75. AdscriptionsOwnTo:[],
  76. tagTypesList: [],
  77. filter: {
  78. tagType: [], //标签类型
  79. tagSysName: '', //标签系统名称
  80. },
  81. currentPage: 1,
  82. pageSize: 10,
  83. total: 0,
  84. }
  85. },
  86. created() {
  87. this.getDropList().then(() => {
  88. this.getDataList()
  89. })
  90. },
  91. methods: {
  92. getDropList() {
  93. let templateOwn = localStorage.getItem('icssEnumsData') ? JSON.parse(localStorage.getItem('icssEnumsData')).moduleTypeEnum : []
  94. let templateType = localStorage.getItem('icssEnumsData') ? JSON.parse(localStorage.getItem('icssEnumsData')).moduleInfoTypeEnum : []
  95. this.Adscriptions = templateOwn;
  96. this.AdscriptionsType = templateType
  97. return api.getDropList().then((res) =>{
  98. if(res.data.code === '0') {
  99. this.tagTypes = res.data.data[6];
  100. for (var i = 0; i < this.tagTypes.length; i++) {
  101. this.tagTypesList.push(this.tagTypes[i].val)
  102. }
  103. }
  104. })
  105. },
  106. getDataList() {
  107. const param = this.getFilterItems();
  108. api.queryEvaluationModulePages(param).then((res) => {
  109. const list = res.data.data.records
  110. for (var i = 0; i < list.length; i++) {
  111. for (var j = 0; j < this.tagTypes.length; j++) {
  112. if(list[i].tagType === this.tagTypes[j].val) {
  113. list[i].tagTypeCn = this.tagTypes[j].name;
  114. }
  115. }
  116. for (var z = 0; z < this.Adscriptions.length; z++) {
  117. if(list[i].type === this.Adscriptions[z].val) {
  118. list[i].typeCn = this.Adscriptions[z].name
  119. }
  120. }
  121. }
  122. this.list = list;
  123. this.total = res.data.data.total;
  124. })
  125. },
  126. filterDatas() {
  127. this.currentPage = 1;
  128. this.getDataList();
  129. },
  130. addIndeptTag() {
  131. this.$router.push({name:'ChronicDiseaseManageAdd'})
  132. },
  133. modifyIndeptTag(row) {
  134. this.$router.push({name:'ChronicDiseaseManageAdd',params:{isEdit:true,data:row}});
  135. },
  136. currentChange(next) {
  137. this.currentPage = next;
  138. this.getDataList();
  139. },
  140. getFilterItems() {
  141. const param = {
  142. current: this.currentPage,
  143. size: this.pageSize,
  144. diseaseName:this.filter.tagSysName,
  145. };
  146. return param;
  147. },
  148. indexMethod(index) {
  149. return ((this.currentPage - 1) * this.pageSize) + index + 1;
  150. },
  151. warning(msg,type){
  152. this.$message({
  153. showClose: true,
  154. message:msg,
  155. type:type||'warning'
  156. })
  157. },
  158. showConfirmDialog(msg,resolve){
  159. this.$alert(msg, '提示', {
  160. confirmButtonText: '确定',
  161. type: 'warning'
  162. }).then(() => {
  163. resolve();
  164. }).catch(() => {});
  165. },
  166. showDelDialog(id){
  167. this.showConfirmDialog('是否删除该标签?',()=>{
  168. api.delTemplate({ids:id}).then((res)=>{
  169. if(res.data.code=='0'){
  170. this.getDataList();
  171. this.warning(res.data.msg || '操作成功','success');
  172. }else{
  173. this.warning(res.data.msg);
  174. }
  175. }).catch((error)=>{
  176. this.warning(error);
  177. })
  178. });
  179. }
  180. }
  181. }
  182. </script>
  183. <style lang="less">
  184. .delete{
  185. color: red
  186. }
  187. .delete:hover {
  188. color: red;
  189. }
  190. </style>