PhysicalExamTemplate.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. <template>
  2. <div>
  3. <crumbs title="查体模板维护">
  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-TJCTMB" 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="gmtOperate"
  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="operatorName"
  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)">详情</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: 'PhysicalExamTemplate',
  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.getPhysicalExamTempByDepId('isEdit', row)
  97. },
  98. getPhysicalExamTempByDepId(type, row) {
  99. const param = {'deptId': row.id,};
  100. api.getPhysicalExamTempByDepId(param).then((res)=>{
  101. const {code,data,msg} = res.data;
  102. if(code=='0'){
  103. const item = Object.assign({},row,data);
  104. this.$router.push({name:'AddPhysicalExamTemp',params:{[type]:true,data:item}});
  105. }else{
  106. this.$message({
  107. message: msg,
  108. type: 'warning'
  109. });
  110. }
  111. });
  112. },
  113. filterDatas(){
  114. this.currentPage = 1;
  115. this.getDataList();
  116. },
  117. getDataList() {
  118. const param = this.getFilterItems();
  119. // const param = {
  120. // 'name':''
  121. // };
  122. api.getPhysicalExamTempList(param).then((res) => {
  123. if (res.data.code == '0') {
  124. const data = res.data.data;
  125. this.list = data.records;
  126. this.total = data.total;
  127. }
  128. }).catch((error) => {
  129. console.log(error);
  130. });
  131. },
  132. getDetailList(row) {
  133. this.getPhysicalExamTempByDepId('isDetail', row)
  134. },
  135. getFilterItems() {
  136. const param = {
  137. deptName: this.filter.proName,
  138. current: this.currentPage,
  139. size: this.pageSize
  140. };
  141. return param;
  142. },
  143. indexMethod(index) {
  144. return ((this.currentPage - 1) * this.pageSize) + index + 1;
  145. },
  146. currentChange(next) {
  147. this.currentPage = next;
  148. if (this.cacheData[next]) { //如果已请求过该页数据,则使用缓存不重复请求
  149. this.list = this.cacheData[next];
  150. } else {
  151. this.getDataList();
  152. }
  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. this.showConfirmDialog('是否删除该科室查体模板?',()=>{
  171. api.delPhysicalExamTemp({'deptId':id}).then((res)=>{
  172. if(res.data.code=='0'){
  173. this.warning(res.data.msg||'操作成功','success');
  174. this.getDataList();
  175. }else{
  176. this.warning(res.data.msg);
  177. }
  178. }).catch((error)=>{
  179. this.warning(error);
  180. })
  181. });
  182. }
  183. }
  184. }
  185. </script>
  186. <style lang="less">
  187. @import "../../less/admin.less";
  188. .status-span{
  189. font-size: 12px;
  190. margin-right:10px;
  191. color: unset;
  192. }
  193. .delete{
  194. color: red
  195. }
  196. </style>