Browse Source

小结报错

master
pengjun 2 years ago
parent
commit
9a521fbef0
  1. 4
      src/components/itemSet/ReferenceRange.vue
  2. 4
      src/components/patientRegister/PatientRegisterEdit.vue
  3. 89
      src/components/patientRegister/PatientRegisterList.vue

4
src/components/itemSet/ReferenceRange.vue

@ -289,8 +289,8 @@ export default {
// //
addtoedit() { addtoedit() {
//
getapi("/api/app/sex").then((res) => {
//
getapi("/api/app/for-sex").then((res) => {
this.forSexId = res.data; this.forSexId = res.data;
}); });
// //

4
src/components/patientRegister/PatientRegisterEdit.vue

@ -1476,7 +1476,7 @@ export default {
this.refreshRegister(Object.assign({},res.data)) this.refreshRegister(Object.assign({},res.data))
// //
if (this.patientRegister.photo.indexOf("data:image") > -1) savePeoplePhoto(res.data.id, this.patientRegister.photo);
if (this.patientRegister.photo && this.patientRegister.photo.indexOf("data:image") > -1) savePeoplePhoto(res.data.id, this.patientRegister.photo);
} }
} }
); );
@ -1823,7 +1823,7 @@ export default {
if (res.code != -1) { if (res.code != -1) {
console.log("操作成功"); console.log("操作成功");
// //
if (this.patientRegister.photo.indexOf("data:image") > -1) savePeoplePhoto(this.form.id, this.patientRegister.photo);
if (this.patientRegister.photo && this.patientRegister.photo.indexOf("data:image") > -1) savePeoplePhoto(this.form.id, this.patientRegister.photo);
objCopy(this.form, this.patientRegister.patientRegisterRd); objCopy(this.form, this.patientRegister.patientRegisterRd);
this.refreshRegister(Object.assign({},this.form)) this.refreshRegister(Object.assign({},this.form))

89
src/components/patientRegister/PatientRegisterList.vue

@ -6,7 +6,7 @@
" "
@contextmenu.prevent="onContextmenu" @contextmenu.prevent="onContextmenu"
> >
<div>
<div id="info">
<el-table @body-scrolling="load" <el-table @body-scrolling="load"
:data="patientRegister.prList" :data="patientRegister.prList"
border :height="window.pageHeight < 600 ? 202 : Math.floor(((window.pageHeight - 302) * 2) / 3)" border :height="window.pageHeight < 600 ? 202 : Math.floor(((window.pageHeight - 302) * 2) / 3)"
@ -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" id="elTable_prList"
ref="info"
:row-class-name="handleRowClassName" :row-class-name="handleRowClassName"
> >
<!-- 取消勾选改为选中 <!-- 取消勾选改为选中
@ -133,6 +133,10 @@
<el-button type="success" class="btnClass" @click="btnAdd">人员登记</el-button <el-button type="success" class="btnClass" @click="btnAdd">人员登记</el-button
> >
</div> </div>
<div class="listBtn">
<el-button type="success" class="btnClass" @click="btnAddBatch">批量正式登记</el-button
>
</div>
<div class="listBtn"> <div class="listBtn">
<el-button type="primary" class="btnClass" @click="btnEdit" <el-button type="primary" class="btnClass" @click="btnEdit"
>编辑</el-button >编辑</el-button
@ -187,7 +191,7 @@
<el-button <el-button
type="" type=""
class="btnClass" class="btnClass"
@click="btnExport('elTable_prList')"
@click="btnExport('info')"
>人员信息导出</el-button >人员信息导出</el-button
> >
</div> </div>
@ -463,6 +467,7 @@ 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 FileSaver from 'file-saver';
import html2canvas from 'html2canvas';
import { import {
dddw, dddw,
@ -470,7 +475,7 @@ import {
arrayReduce, arrayReduce,
arrayExistObj, arrayExistObj,
deepCopy, deepCopy,
} from "@/utlis/proFunc";
} from "../../utlis/proFunc";
import PatientRegisterEdit from "../../components/patientRegister/PatientRegisterEdit.vue"; import PatientRegisterEdit from "../../components/patientRegister/PatientRegisterEdit.vue";
import Camera from "../../components/patientRegister/Camera.vue"; import Camera from "../../components/patientRegister/Camera.vue";
@ -847,6 +852,42 @@ export default {
console.log('编辑/新增的 form :',patientRegister) console.log('编辑/新增的 form :',patientRegister)
}, },
//
btnAddBatch(){
let patientRegisterIds = []
// start
this.multipleSelection = [];
this.patientRegister.prList.forEach((e) => {
if (e.choosed && e.completeFlag == '0'){
this.multipleSelection.push(e);
patientRegisterIds.push(e.id)
}
});
// end
if (patientRegisterIds.length < 1) {
this.$message.info("请选择状态为预登记的记录!");
return;
}
let completeFlag = '1'
let body = { completeFlag, patientRegisterIds }
postapi('/api/app/patientregister/updatepatientregistercompleteflagormedicalstartdate',body)
.then(res =>{
if(res.code != -1){
console.log('操作成功!')
patientRegisterIds.forEach(e => {
let lfind = arrayExistObj(this.patientRegister.prList,'id',e)
if(lfind > -1) this.patientRegister.prList[lfind].completeFlag = completeFlag
});
}
})
.catch(err =>{
this.$message.error(`操作失败 ${err}`);
});
},
//
btnEdit() { btnEdit() {
if (!this.patientRegister.patientRegisterRd.id) { if (!this.patientRegister.patientRegisterRd.id) {
this.$message.warning("请选择要操作的记录"); this.$message.warning("请选择要操作的记录");
@ -1674,13 +1715,41 @@ export default {
// //
btnExport(elId){ 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);
// HTML
// let table = document.getElementById(elId); //.cloneNode(true)
this.$nextTick(() => {
let table = document.getElementById(elId)
console.log('table',table)
// let table = this.$refs[elId] //.cloneNode(true) true
let tableData = table.innerHTML
let fileName = moment(new Date()).format('yyyyMMDDHHmmss')
let blob = new Blob([tableData],{type:"text/plain;charset=utf-8"});
FileSaver.saveAs(blob, fileName + '.xls');
//
// 使html2canvasHTML
html2canvas(table).then(canvas => {
// a
const link = document.createElement('a');
link.href = canvas.toDataURL('image/png');
link.download = fileName + '.png';
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
// // PDF
// var pdf = new jsPDF();
// // PDF
// pdf.addImage(canvas.toDataURL('image/png'), 'PNG', 0, 0, canvas.width, canvas.height);
// // PDF
// pdf.save('.pdf');
});
})
}, },
}, },

Loading…
Cancel
Save