ChronicDiseaseStructureList.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  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="name"
  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. AdscriptionsType:[],
  74. AdscriptionsOwnTo:[],
  75. tagTypesList: [],
  76. filter: {
  77. tagType: [], //标签类型
  78. tagSysName: '', //标签系统名称
  79. },
  80. currentPage: 1,
  81. pageSize: 10,
  82. total: 0,
  83. }
  84. },
  85. created() {
  86. this.getDropList().then(() => {
  87. this.getDataList()
  88. })
  89. },
  90. methods: {
  91. getDropList() {
  92. let templateType = localStorage.getItem('icssEnumsData') ? JSON.parse(localStorage.getItem('icssEnumsData')).moduleInfoTypeEnum : []
  93. this.AdscriptionsType = templateType
  94. return api.getDropList().then((res) =>{
  95. if(res.data.code === '0') {
  96. localStorage.setItem('DiseaseManage',JSON.stringify(res.data.data[8]))
  97. this.tagTypes = res.data.data[6];
  98. for (var i = 0; i < this.tagTypes.length; i++) {
  99. this.tagTypesList.push(this.tagTypes[i].val)
  100. }
  101. }
  102. })
  103. },
  104. getDataList() {
  105. const param = this.getFilterItems();
  106. api.scaleContentStructure(param).then((res) => {
  107. const list = res.data.data.records
  108. for (var i = 0; i < list.length; i++) {
  109. for (var j = 0; j < this.tagTypes.length; j++) {
  110. if(list[i].tagType === this.tagTypes[j].val) {
  111. list[i].tagTypeCn = this.tagTypes[j].name;
  112. }
  113. }
  114. }
  115. this.list = list;
  116. this.total = res.data.data.total;
  117. })
  118. },
  119. filterDatas() {
  120. this.currentPage = 1;
  121. this.getDataList();
  122. },
  123. addIndeptTag() {
  124. this.$router.push({name:'ChronicDiseaseAdd'})
  125. },
  126. modifyIndeptTag(row) {
  127. api.detailsTag({id:row.id}).then((res)=>{
  128. const {code,data,msg} = res.data;
  129. if(code=='0'){
  130. this.$router.push({name:'ChronicDiseaseAdd',params:{isEdit:true,data:data}});
  131. }else{
  132. this.$message({
  133. message: msg,
  134. type: 'warning'
  135. });
  136. }
  137. });
  138. },
  139. currentChange(next) {
  140. this.currentPage = next;
  141. this.getDataList();
  142. },
  143. getFilterItems() {
  144. const param = {
  145. current: this.currentPage,
  146. size: this.pageSize,
  147. tagName: this.filter.tagSysName,
  148. };
  149. return param;
  150. },
  151. indexMethod(index) {
  152. return ((this.currentPage - 1) * this.pageSize) + index + 1;
  153. },
  154. warning(msg,type){
  155. this.$message({
  156. showClose: true,
  157. message:msg,
  158. type:type||'warning'
  159. })
  160. },
  161. showConfirmDialog(msg,resolve){
  162. this.$alert(msg, '提示', {
  163. confirmButtonText: '确定',
  164. type: 'warning'
  165. }).then(() => {
  166. resolve();
  167. }).catch(() => {});
  168. },
  169. showDelDialog(id){
  170. let tmpArr = []
  171. tmpArr.push(id)
  172. this.showConfirmDialog('是否删除该标签?',()=>{
  173. api.deleteScale({ids:tmpArr}).then((res)=>{
  174. if(res.data.code=='0'){
  175. this.getDataList();
  176. this.warning(res.data.msg || '操作成功','success');
  177. }else{
  178. this.warning(res.data.msg);
  179. }
  180. }).catch((error)=>{
  181. this.warning(error);
  182. })
  183. });
  184. }
  185. }
  186. }
  187. </script>
  188. <style lang="less">
  189. .delete{
  190. color: red
  191. }
  192. .delete:hover {
  193. color: red;
  194. }
  195. </style>