CommonSymptom.vue 6.7 KB

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