PhysicalExamTemplate.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  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. api.getPhysicalExamTempByDepId({deptId:row.id}).then((res)=>{
  97. const {code,data,msg} = res.data;
  98. if(code=='0'){
  99. const item = Object.assign({},row,data);
  100. console.log('item', item)
  101. this.$router.push({name:'AddPhysicalExamTemp',params:{isEdit:true,data:item}});
  102. }else{
  103. this.$message({
  104. message: msg,
  105. type: 'warning'
  106. });
  107. }
  108. });
  109. // this.$router.push({
  110. // name:'AddPhysicalExamTemp',
  111. // params: {info:row}
  112. // })
  113. },
  114. filterDatas(){
  115. this.currentPage = 1;
  116. this.getDataList();
  117. },
  118. getDataList() {
  119. const param = this.getFilterItems();
  120. // const param = {
  121. // 'name':''
  122. // };
  123. api.getPhysicalExamTempList(param).then((res) => {
  124. if (res.data.code == '0') {
  125. console.log('PhysicalExamTempList', res)
  126. const data = res.data.data;
  127. this.list = data.records;
  128. this.total = data.total;
  129. }
  130. }).catch((error) => {
  131. console.log(error);
  132. });
  133. },
  134. getDetailList(row) {
  135. const param = {'deptId': row.id,};
  136. api.getPhysicalExamTempByDepId(param).then((res)=>{
  137. const {code,data,msg} = res.data;
  138. if(code=='0'){
  139. const item = Object.assign({},row,data);
  140. this.$router.push({name:'AddPhysicalExamTemp',params:{isDetail:true,data:item}});
  141. }else{
  142. this.$message({
  143. message: msg,
  144. type: 'warning'
  145. });
  146. }
  147. });
  148. },
  149. getFilterItems() {
  150. const param = {
  151. name: this.filter.proName,
  152. current: this.currentPage,
  153. size: this.pageSize
  154. };
  155. return param;
  156. },
  157. indexMethod(index) {
  158. return ((this.currentPage - 1) * this.pageSize) + index + 1;
  159. },
  160. currentChange(next) {
  161. this.currentPage = next;
  162. if (this.cacheData[next]) { //如果已请求过该页数据,则使用缓存不重复请求
  163. this.list = this.cacheData[next];
  164. } else {
  165. this.getDataList();
  166. }
  167. },
  168. warning(msg,type){
  169. this.$message({
  170. showClose: true,
  171. message:msg,
  172. type:type||'warning'
  173. })
  174. },
  175. showConfirmDialog(msg,resolve){
  176. this.$alert(msg, '提示', {
  177. confirmButtonText: '确定',
  178. type: 'warning'
  179. }).then(() => {
  180. resolve();
  181. }).catch(() => {});
  182. },
  183. showDelDialog(id){
  184. this.showConfirmDialog('是否删除该科室症状?',()=>{
  185. api.delPhysicalExamTemp({'deptId':id}).then((res)=>{
  186. if(res.data.code=='0'){
  187. this.warning(res.data.msg||'操作成功','success');
  188. this.getDataList();
  189. }else{
  190. this.warning(res.data.msg);
  191. }
  192. }).catch((error)=>{
  193. this.warning(error);
  194. })
  195. });
  196. }
  197. }
  198. }
  199. </script>
  200. <style lang="less">
  201. @import "../../less/admin.less";
  202. .status-span{
  203. font-size: 12px;
  204. margin-right:10px;
  205. color: unset;
  206. }
  207. .delete{
  208. color: red
  209. }
  210. </style>