pengjun 2 years ago
parent
commit
e141fc924f
  1. 6
      package-lock.json
  2. 1
      package.json
  3. 31
      src/components/patientRegister/PatientRegisterList.vue
  4. 32
      src/views/customerOrg/patientRegisterImport.vue

6
package-lock.json

@ -12,6 +12,7 @@
"crypto-js": "^4.1.1", "crypto-js": "^4.1.1",
"element-ui": "^2.15.13", "element-ui": "^2.15.13",
"exceljs": "^4.3.0", "exceljs": "^4.3.0",
"file-saver": "^2.0.5",
"moment": "^2.29.4", "moment": "^2.29.4",
"sortablejs": "^1.15.0", "sortablejs": "^1.15.0",
"vue": "^2.6.14", "vue": "^2.6.14",
@ -6149,6 +6150,11 @@
"node": "^10.12.0 || >=12.0.0" "node": "^10.12.0 || >=12.0.0"
} }
}, },
"node_modules/file-saver": {
"version": "2.0.5",
"resolved": "https://registry.npmmirror.com/file-saver/-/file-saver-2.0.5.tgz",
"integrity": "sha512-P9bmyZ3h/PRG+Nzga+rbdI4OEpNDzAVyy74uVO9ATgzLK6VtAsYybF/+TOCvrc0MO793d6+42lLyZTw7/ArVzA=="
},
"node_modules/fill-range": { "node_modules/fill-range": {
"version": "7.0.1", "version": "7.0.1",
"resolved": "https://registry.npmmirror.com/fill-range/-/fill-range-7.0.1.tgz", "resolved": "https://registry.npmmirror.com/fill-range/-/fill-range-7.0.1.tgz",

1
package.json

@ -15,6 +15,7 @@
"crypto-js": "^4.1.1", "crypto-js": "^4.1.1",
"element-ui": "^2.15.13", "element-ui": "^2.15.13",
"exceljs": "^4.3.0", "exceljs": "^4.3.0",
"file-saver": "^2.0.5",
"moment": "^2.29.4", "moment": "^2.29.4",
"sortablejs": "^1.15.0", "sortablejs": "^1.15.0",
"vue": "^2.6.14", "vue": "^2.6.14",

31
src/components/patientRegister/PatientRegisterList.vue

@ -15,7 +15,7 @@
size="small" row-key="id" size="small" row-key="id"
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
@cell-contextmenu="onCellRightClick" @cell-contextmenu="onCellRightClick"
ref="info"
ref="info" id="elTable_prList"
:row-class-name="handleRowClassName" :row-class-name="handleRowClassName"
> >
<!-- 取消勾选改为选中 <!-- 取消勾选改为选中
@ -114,11 +114,11 @@
--> -->
</el-table> </el-table>
<div style="display: flex;justify-content:space-between;"> <div style="display: flex;justify-content:space-between;">
<div></div>
<div>
<span style="font-size:12px;">{{loadOpts.totalCount}} 条记录当前显示{{patientRegister.prList.length}} </span>
</div>
<div></div>
<div>
<span style="font-size:12px;">{{loadOpts.totalCount}} 条记录当前显示{{patientRegister.prList.length}} </span>
</div> </div>
</div>
</div> </div>
<!-- 给合项目 基本信息 --> <!-- 给合项目 基本信息 -->
<el-tabs v-model="tabChoosed" style="margin-top: -22px;"> <el-tabs v-model="tabChoosed" style="margin-top: -22px;">
@ -183,6 +183,14 @@
>指引单预览</el-button >指引单预览</el-button
> >
</div> </div>
<div class="listBtn">
<el-button
type=""
class="btnClass"
@click="btnExport('elTable_prList')"
>人员信息导出</el-button
>
</div>
<!-- <!--
<div class="listBtn"> <div class="listBtn">
<el-button type="" class="btnClass commonbutton" @click="rowSelected(patientRegister.prList)">选中</el-button> <el-button type="" class="btnClass commonbutton" @click="rowSelected(patientRegister.prList)">选中</el-button>
@ -452,6 +460,7 @@ import moment from "moment";
import { mapState, mapActions } from "vuex"; import { mapState, mapActions } from "vuex";
import { getapi, postapi, putapi, deletapi } from "@/api/api"; import { getapi, postapi, putapi, deletapi } from "@/api/api";
import Sortable from "sortablejs"; import Sortable from "sortablejs";
import FileSaver from 'file-saver';
import { import {
dddw, dddw,
@ -1640,6 +1649,18 @@ export default {
}); });
return dropCol; return dropCol;
}, },
//
btnExport(elId){
let table = document.getElementById(elId);
let tableData = table.innerHTML
let fileName = moment(new Date()).format('yyyyMMDDHHmmss') + '.xls'
let blob = new Blob([tableData],{type:"text/plain;charset=utf-8"});
FileSaver.saveAs(blob, fileName);
},
}, },
// //

32
src/views/customerOrg/patientRegisterImport.vue

@ -2,15 +2,21 @@
<div> <div>
<el-card> <el-card>
<div slot="header">批量预登记</div> <div slot="header">批量预登记</div>
<div style="display: flex;margin-bottom: 10px;">
<div>
<a :underline="false" href="/files/单位体检人员名单导入模板.xlsx"><el-button class="btnClass">下载导入模版</el-button></a>
</div>
<div>
<el-button class="btnClass" @click="seq = 0">导入</el-button>
<div style="display: flex;margin-bottom: 10px;justify-content:space-between;">
<div></div>
<div style="display: flex;">
<div>
<a :underline="false" href="/files/单位体检人员名单导入模板.xlsx"><el-button class="btnClass">下载导入模版</el-button></a>
</div>
<div>
<el-button class="btnClass" @click="seq = 0">导入</el-button>
</div>
<div>
<el-button class="btnClass" @click="btnExport('tableData')">导入后结果状态导出</el-button>
</div>
</div> </div>
</div> </div>
<div>
<div id="tableData">
<el-table :data="tableData" border v-if="mode=='10'" :row-class-name="importRowClassName" <el-table :data="tableData" border v-if="mode=='10'" :row-class-name="importRowClassName"
:height="window.pageHeight < 600 ? 405 : (window.pageHeight - 195)" :height="window.pageHeight < 600 ? 405 : (window.pageHeight - 195)"
highlight-current-row size="small" :summary-method="getSummaries" show-summary> highlight-current-row size="small" :summary-method="getSummaries" show-summary>
@ -513,6 +519,7 @@
import moment from "moment" import moment from "moment"
import { mapState, mapActions } from "vuex"; import { mapState, mapActions } from "vuex";
import { read,readFile, utils } from "xlsx"; import { read,readFile, utils } from "xlsx";
import FileSaver from 'file-saver';
import { getapi, postapi, putapi, deletapi } from "@/api/api"; import { getapi, postapi, putapi, deletapi } from "@/api/api";
import { arrayExistObj ,arrayFilter ,dddw, tcdate } from '@/utlis/proFunc'; import { arrayExistObj ,arrayFilter ,dddw, tcdate } from '@/utlis/proFunc';
@ -1567,6 +1574,17 @@ export default {
}, },
//
btnExport(elId){
let table = document.getElementById(elId);
let tableData = table.innerHTML
let fileName = moment(new Date()).format('yyyyMMDDHHmmss') + '.xls'
let blob = new Blob([tableData],{type:"text/plain;charset=utf-8"});
FileSaver.saveAs(blob, fileName);
},
}, },
watch: { watch: {

Loading…
Cancel
Save