OrganizationInfo.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. <!-- 机构信息 By_liucf -->
  2. <template>
  3. <div>
  4. <crumbs title="机构信息">
  5. <el-form :inline="true" class="demo-form-inline">
  6. <el-form-item label="注册时间:">
  7. <el-date-picker v-model="time" size="mini" type="daterange" value-format="yyyy-MM-dd HH:mm:ss" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']"></el-date-picker>
  8. </el-form-item>
  9. <el-form-item label="机构名称:">
  10. <el-input size="mini" v-model="name" clearable placeholder="机构名称" @keyup.enter.native="getSearch"></el-input>
  11. </el-select>
  12. </el-form-item>
  13. <el-form-item>
  14. <el-button size="mini" @click="getSearch">确认</el-button>
  15. <el-button size="mini" type="warning" @click="addOrganization">添加机构</el-button>
  16. <el-button size="mini" type="primary" @click="exportOrganizeInfo">导出</el-button>
  17. </el-form-item>
  18. </el-form>
  19. </crumbs>
  20. <div class="contents">
  21. <el-table :data="list"
  22. border
  23. style="width: 100%">
  24. <el-table-column
  25. type="index"
  26. :index="indexMethod"
  27. label="编号"
  28. width="60">
  29. </el-table-column>
  30. <el-table-column
  31. prop="orgGmtCreate"
  32. label="注册时间"
  33. :show-overflow-tooltip="true">
  34. </el-table-column>
  35. <el-table-column
  36. prop="orgName"
  37. label="注册机构">
  38. </el-table-column>
  39. <el-table-column
  40. prop="orgPrincipal"
  41. label="机构负责人">
  42. </el-table-column>
  43. <el-table-column
  44. prop="orgType"
  45. label="机构属性"
  46. :formatter="formatType">
  47. </el-table-column>
  48. <el-table-column
  49. prop="orgAddress"
  50. label="机构地址">
  51. </el-table-column>
  52. <el-table-column
  53. prop="linkman"
  54. label="超管名称">
  55. </el-table-column>
  56. <el-table-column
  57. fixed="right"
  58. label="操作"
  59. width="100">
  60. <template slot-scope="scope">
  61. <el-button v-if="scope.row.authStatus==1" type="text" size="small" @click="handleModifined(scope.$index, scope.row)">修改</el-button>
  62. <el-button v-else type="text" size="small" style="color: #c9c9c9;cursor: text;">修改</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/admin.js';
  79. import utils from '@api/utils.js';
  80. export default {
  81. name: 'OrganizationInfo',
  82. data: function () {
  83. return {
  84. list: [],
  85. status: [],
  86. cacheData: {},
  87. cachePage: null,
  88. currentPage: 1,
  89. pageSize: 10,
  90. total: 0,
  91. time:'',
  92. name:'',
  93. includedComponents: "OrganizationInfo"
  94. }
  95. },
  96. created() {
  97. let page = Number(sessionStorage.getItem('cachePage'));
  98. if(page){
  99. this.currentPage = page;
  100. this.getDataList();
  101. sessionStorage.setItem('cachePage',null);
  102. }else{
  103. this.getDataList();
  104. }
  105. },
  106. methods: {
  107. apiMethods(params){
  108. api.getOrganizationInfo(params).then((res) => {
  109. if (res.data.code == '0') {
  110. const data = res.data.data;
  111. this.list = data.records;
  112. this.total = data.total;
  113. }
  114. }).catch((error) => {
  115. console.log(error);
  116. });
  117. },
  118. getDataList() {//获取机构信息
  119. let param = {};
  120. if(this.time){
  121. param = {
  122. 'size':this.pageSize,
  123. 'current':this.currentPage,
  124. 'startTime':this.time[0],
  125. 'endTime':this.time[1],
  126. 'orgName':this.name.trim(),
  127. };
  128. }else{
  129. param = {
  130. 'size':this.pageSize,
  131. 'current':this.currentPage,
  132. 'orgName':this.name.trim(),
  133. };
  134. }
  135. this.apiMethods(param);
  136. },
  137. indexMethod(index) {
  138. return ((this.currentPage - 1) * this.pageSize) + index + 1;
  139. },
  140. currentChange(next) {
  141. this.currentPage = next;
  142. this.getDataList();
  143. },
  144. addOrganization(){//添加机构
  145. this.$router.push({path:'LT-KHZX-TJJG'});
  146. },
  147. exportOrganizeInfo() {//导出
  148. const canExport = utils.exportCondition(this.time);
  149. if(typeof canExport == 'string'){
  150. this.$message({
  151. showClose: true,
  152. message:canExport,
  153. type:'warning'
  154. });
  155. return;
  156. }
  157. const searchTime = this.time;
  158. const param = {
  159. "endTime": searchTime[1],
  160. "startTime": searchTime[0],
  161. "orgName": this.name||undefined
  162. };
  163. api.exportOrganizeInfo(param).then((res) => {
  164. if (res.data.code = '0') {
  165. utils.downloadExportedData(res.data, '机构信息表.xls');
  166. this.$message({showClose: true, message: "导出成功", type: 'success'});
  167. } else {
  168. this.$message({
  169. showClose: true,
  170. message: res.data.msg,
  171. type: 'warning'
  172. });
  173. }
  174. }).catch((error) => {
  175. this.$message({
  176. showClose: true,
  177. message: "服务器正忙...",
  178. type: 'warning'
  179. });
  180. });
  181. },
  182. formatType:function(row,column,cellValue){//处理机构属性
  183. if(cellValue ==0){
  184. return "连锁医疗结构";
  185. }else if(cellValue ==1){
  186. return "卫计局";
  187. }else if(cellValue ==2){
  188. return "基础医疗单位";
  189. }else if(cellValue ==3){
  190. return "医疗诊所";
  191. }else if(cellValue ==99){
  192. return "其他";
  193. }else{
  194. return null;
  195. }
  196. },
  197. handleModifined(index,colData){
  198. // this.cachePage = this.currentPage;
  199. sessionStorage.setItem('cachePage',this.currentPage);
  200. this.$router.push({path:'LT-KHZX-XGJG',query:{info:colData}});
  201. },
  202. getSearch(){//搜索
  203. this.currentPage = 1;//重置
  204. this.getDataList();
  205. }
  206. }
  207. }
  208. </script>
  209. <style lang="less" scoped>
  210. @import "../../less/admin.less";
  211. </style>