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

6
package-lock.json

@ -12,6 +12,7 @@
"crypto-js": "^4.1.1",
"element-ui": "^2.15.13",
"exceljs": "^4.3.0",
"file-saver": "^2.0.5",
"moment": "^2.29.4",
"sortablejs": "^1.15.0",
"vue": "^2.6.14",
@ -6149,6 +6150,11 @@
"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": {
"version": "7.0.1",
"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",
"element-ui": "^2.15.13",
"exceljs": "^4.3.0",
"file-saver": "^2.0.5",
"moment": "^2.29.4",
"sortablejs": "^1.15.0",
"vue": "^2.6.14",

23
src/components/patientRegister/PatientRegisterList.vue

@ -15,7 +15,7 @@
size="small" row-key="id"
@selection-change="handleSelectionChange"
@cell-contextmenu="onCellRightClick"
ref="info"
ref="info" id="elTable_prList"
:row-class-name="handleRowClassName"
>
<!-- 取消勾选改为选中
@ -183,6 +183,14 @@
>指引单预览</el-button
>
</div>
<div class="listBtn">
<el-button
type=""
class="btnClass"
@click="btnExport('elTable_prList')"
>人员信息导出</el-button
>
</div>
<!--
<div class="listBtn">
<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 { getapi, postapi, putapi, deletapi } from "@/api/api";
import Sortable from "sortablejs";
import FileSaver from 'file-saver';
import {
dddw,
@ -1640,6 +1649,18 @@ export default {
});
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);
},
},
//

22
src/views/customerOrg/patientRegisterImport.vue

@ -2,15 +2,21 @@
<div>
<el-card>
<div slot="header">批量预登记</div>
<div style="display: flex;margin-bottom: 10px;">
<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>
<div>
<el-button class="btnClass" @click="btnExport('tableData')">导入后结果状态导出</el-button>
</div>
</div>
</div>
<div id="tableData">
<el-table :data="tableData" border v-if="mode=='10'" :row-class-name="importRowClassName"
:height="window.pageHeight < 600 ? 405 : (window.pageHeight - 195)"
highlight-current-row size="small" :summary-method="getSummaries" show-summary>
@ -513,6 +519,7 @@
import moment from "moment"
import { mapState, mapActions } from "vuex";
import { read,readFile, utils } from "xlsx";
import FileSaver from 'file-saver';
import { getapi, postapi, putapi, deletapi } from "@/api/api";
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: {

Loading…
Cancel
Save