CommonSymptom.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. <template>
  2. <div>
  3. <crumbs title="icss科室维护系统">
  4. <el-form :inline="true" class="demo-form-inline">
  5. <el-form-item label="科室名称:">
  6. <el-input size="mini" v-model="filter.proName" placeholder="科室名称"></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-YXSJWH-TJCJZZ" 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. :resizable = "false"
  22. type="index"
  23. :index="indexMethod"
  24. label="编号"
  25. width="60">
  26. </el-table-column>
  27. <el-table-column
  28. :resizable = "false"
  29. prop="gmtModified"
  30. label="操作时间"
  31. :show-overflow-tooltip="true">
  32. </el-table-column>
  33. <el-table-column
  34. :resizable = "false"
  35. prop="name"
  36. label="科室名称">
  37. </el-table-column>
  38. <el-table-column
  39. :resizable = "false"
  40. prop="userName"
  41. label="操作人"
  42. width="180">
  43. </el-table-column>
  44. <el-table-column
  45. :resizable = "false"
  46. label="操作" width="200">
  47. <template slot-scope="scope">
  48. <el-button type="text" size="small" @click="toEditProduct(scope.row)">修改</el-button>
  49. <span style="margin:0 3px;">|</span>
  50. <el-button type="text" size="small" class="delete" @click="showDelDialog(scope.row.id)">删除</el-button>
  51. </template>
  52. </el-table-column>
  53. <el-table-column
  54. :resizable = "false"
  55. label="详情">
  56. <template slot-scope="scope">
  57. <el-button type="text" size="small" @click="getDetailList(scope.row.id)">详情</el-button>
  58. </template>
  59. </el-table-column>
  60. </el-table>
  61. <el-pagination v-if="total>pageSize"
  62. :current-page.sync="currentPage"
  63. @current-change="currentChange"
  64. background
  65. :page-size="pageSize"
  66. layout="total,prev, pager, next, jumper"
  67. :total="total">
  68. </el-pagination>
  69. </div>
  70. </div>
  71. </template>
  72. <script>
  73. import api from '@api/icss.js';
  74. import utils from '@api/utils.js';
  75. export default {
  76. name: 'CommonSymptom',
  77. data: function () {
  78. return {
  79. list: [], //常见症状列表
  80. cacheData: {},
  81. currentPage: 1,
  82. pageSize: 10,
  83. total: 0,
  84. linkIn:[],
  85. pays:[],
  86. filter: {
  87. proName: ''
  88. }
  89. }
  90. },
  91. created() {
  92. this.getDataList();
  93. },
  94. methods: {
  95. toEditProduct(row){
  96. this.$router.push({
  97. name:'AddCommonSymptom',
  98. params: {info:row}
  99. })
  100. },
  101. filterDatas(){
  102. this.currentPage = 1;
  103. this.getDataList();
  104. },
  105. getDataList() {
  106. const param = this.getFilterItems();
  107. // const param = {
  108. // 'name':''
  109. // };
  110. api.commonSymptomList(param).then((res) => {
  111. if (res.data.code == '0') {
  112. console.log('commonSymptomList', res)
  113. const data = res.data.data;
  114. this.list = data.records;
  115. this.total = data.total;
  116. }
  117. }).catch((error) => {
  118. console.log(error);
  119. });
  120. },
  121. getDetailList(id) {
  122. const param = {'id': id,};
  123. this.$router.push({name:'AddCommonSymptom', params:{id: id}})
  124. /*api.getDeptInfoDetials(param).then((res) => {
  125. if (res.data.code == '0') {
  126. this.$router.push({name:'DeptInfoDetail', params:{id: id}})
  127. // console.log("详情接口调用成功");
  128. } else {
  129. this.$message({
  130. showClose: true,
  131. message:res.data.msg,
  132. type:'warning'
  133. });
  134. this.getDataList() //刷新列表
  135. }
  136. }).catch((error) => {
  137. console.log(error);
  138. });*/
  139. },
  140. getFilterItems() {
  141. const param = {
  142. name: this.filter.proName,
  143. current: this.currentPage,
  144. size: this.pageSize
  145. };
  146. return param;
  147. },
  148. indexMethod(index) {
  149. return ((this.currentPage - 1) * this.pageSize) + index + 1;
  150. },
  151. currentChange(next) {
  152. this.currentPage = next;
  153. if (this.cacheData[next]) { //如果已请求过该页数据,则使用缓存不重复请求
  154. this.list = this.cacheData[next];
  155. } else {
  156. this.getDataList();
  157. }
  158. },
  159. warning(msg,type){
  160. this.$message({
  161. showClose: true,
  162. message:msg,
  163. type:type||'warning'
  164. })
  165. },
  166. showConfirmDialog(msg,resolve){
  167. this.$alert(msg, '提示', {
  168. confirmButtonText: '确定',
  169. type: 'warning'
  170. }).then(() => {
  171. resolve();
  172. }).catch(() => {});
  173. },
  174. showDelDialog(id){
  175. this.showConfirmDialog('是否删除该科室症状?',()=>{
  176. api.delCommonSymptom({'deptId':id}).then((res)=>{
  177. if(res.data.code=='0'){
  178. this.warning(res.data.msg||'操作成功','success');
  179. this.getDataList();
  180. }else{
  181. this.warning(res.data.msg);
  182. }
  183. }).catch((error)=>{
  184. this.warning(error);
  185. })
  186. });
  187. }
  188. }
  189. }
  190. </script>
  191. <style lang="less">
  192. @import "../../less/admin.less";
  193. .status-span{
  194. font-size: 12px;
  195. margin-right:10px;
  196. color: unset;
  197. }
  198. .delete{
  199. color: red
  200. }
  201. </style>