diff --git a/public/pic/hisLog.jpg b/public/pic/hisLog.jpg
new file mode 100644
index 0000000..28d29ab
Binary files /dev/null and b/public/pic/hisLog.jpg differ
diff --git a/public/pic/peisReportFirstPage.jpg b/public/pic/peisReportFirstPage.jpg
new file mode 100644
index 0000000..836ad4c
Binary files /dev/null and b/public/pic/peisReportFirstPage.jpg differ
diff --git a/public/pic/peisReportPageHeader.jpg b/public/pic/peisReportPageHeader.jpg
new file mode 100644
index 0000000..b78f75b
Binary files /dev/null and b/public/pic/peisReportPageHeader.jpg differ
diff --git a/src/components/patientRegister/PatientRegisterList.vue b/src/components/patientRegister/PatientRegisterList.vue
index c45a2bf..aee5d42 100644
--- a/src/components/patientRegister/PatientRegisterList.vue
+++ b/src/components/patientRegister/PatientRegisterList.vue
@@ -11,6 +11,7 @@
{{ ldddw(dict.completeFlag, "id", scope.row.completeFlag, "displayName") }}
+
{{ scope.row.isLock == "Y" ? "是" : "否" }}
@@ -166,7 +167,16 @@
调整项目
- 打指引单
+ 指引单打印
+
+
+ 指引单预览
+
+
+ 指引单打印
+
+
+ 指引单预览
@@ -183,8 +193,8 @@
-
+
{{ guideMsg }}
@@ -194,7 +204,7 @@
import moment from "moment";
import { mapState, mapActions } from "vuex";
import { getapi, postapi, putapi, deletapi } from "@/api/api";
-import { dddw, objCopy, arrayReduce } from "@/utlis/proFunc";
+import { dddw, objCopy, arrayReduce, arrayExistObj } from "@/utlis/proFunc";
import PatientRegisterEdit from "../../components/patientRegister/PatientRegisterEdit.vue";
import Camera from "../../components/patientRegister/Camera.vue";
@@ -211,8 +221,8 @@ export default {
multipleSelection: [], //选中的数据列表
dialogVisible: false,
dialogCamera: false,
- dialogGuide:false,
- guideMsg:'guideMsg',
+ dialogGuide: false,
+ guideMsg: 'guideMsg',
tabChoosed: "1",
formInitData: {}, //体检登记初始表单数据
editTimes: 0,
@@ -227,54 +237,78 @@ export default {
...mapState(["window", "dict", "patientRegister", "customerOrg"]),
},
methods: {
- ...mapActions(["getCustomerOrgGroup", "getPatientRegisterAbs"]),
-
+ ...mapActions(["getCustomerOrgGroup", "getPatientRegisterAbs"]),
+
// 打印指引单(isPreview)
- async guidePrint(isPreview){
+ async guidePrint(ReportCode, isPreview) {
let token = localStorage.getItem('token');
let user = localStorage.getItem('user');
- let toOutShell = '';
+ let toOutShell = { ReportCode, token,
+ Parameters: [
+ { Name: 'printer', Value: user },
+ { Name: 'hisLog', Value: 'pic/hisLog.jpg' },
+ ],
+ };
let lfind = -1;
-
- if(this.multipleSelection.length < 1){
+
+ if (this.multipleSelection.length < 1) {
this.$message.info("请勾选要打印指引单的人员记录!");
return;
}
- this.multipleSelection.forEach((item,index) =>{
- getapi(`/api/app/printreport/getpatientregisterguidereport?PatientRegisterId=${item.id}`)
- .then((res) => {
- if (res.code != -1) {
- res.data;
- return this.$electronAPI.printPre('web 传入参数');
- }
- })
- .then(res => {
- if(res.toLowerCase() == 'success'){
- //更新打印次数
- return postapi('api/app/patientregister/updatepatientregisterguideprinttimesmany',[item.id])
- }
- })
- .then(res =>{
- if (res.code != -1) {
- //
- }
+ if (isPreview) {
+ //
+ //this.multipleSelection.forEach((item,index) =>{
+
+ getapi(`/api/app/printreport/getpatientregisterguidereport?PatientRegisterId=${this.multipleSelection[0].id}`)
+ .then((res) => {
+ if (res.code != -1) {
+ toOutShell.ReportTable = res.data;
+ console.log('JSON.stringify(toOutShell)', JSON.stringify(toOutShell));
+ return this.$peisAPI.printPre(JSON.stringify(toOutShell));
+ }
+ })
+ .catch(err => {
+ this.$message.warning(err);
+ });
+ // });
+ } else {
+ this.multipleSelection.forEach((item, index) => {
+ getapi(`/api/app/printreport/getpatientregisterguidereport?PatientRegisterId=${item.id}`)
+ .then((res) => {
+ if (res.code != -1) {
+ toOutShell.ReportTable = res.data;
+ console.log('JSON.stringify(toOutShell)', JSON.stringify(toOutShell));
+ return this.$peisAPI.print(JSON.stringify(toOutShell));
+ }
+ })
+ .then(res => {
+ if (res.toLowerCase() == 'success') {
+ //更新打印次数
+ return postapi('api/app/patientregister/updatepatientregisterguideprinttimesmany', [item.id])
+ }
+ })
+ .then(res => {
+ if (res.code != -1) {
+ lfind = arrayExistObj(this.patientRegister.prList, 'id', item.id)
+ if (lfind > -1) {
+ if (this.patientRegister.prList[lfind].guidePrintTimes) {
+ this.patientRegister.prList[lfind].guidePrintTimes = Number(this.patientRegister.prList[lfind].guidePrintTimes) + 1;
+ } else {
+ this.patientRegister.prList[lfind].guidePrintTimes = 1;
+ }
+ }
+
+ }
+ })
+ .catch(err => {
+ this.$message.warning(err);
+ });
});
- });
-
-
-
-
- console.log(msg);
-
-
-
-
-
-
+ }
},
-
+
handleSelectionChange(val) {
this.multipleSelection = val;
//console.log('this.multipleSelection',this.multipleSelection)
diff --git a/src/main.js b/src/main.js
index 0960d93..0ec0f6d 100644
--- a/src/main.js
+++ b/src/main.js
@@ -17,11 +17,11 @@ Vue.use(ElementUI);
console.log('vue',Vue.prototype)
Vue.prototype.$axios = axios;
-//全局注册 electronAPI 对象
+//全局注册外壳的 peisAPI 对象
try {
- Vue.prototype.$electronAPI = window.electronAPI;
+ Vue.prototype.$peisAPI = window.peisAPI;
} catch (error) {
- Vue.prototype.$electronAPI = null;
+ Vue.prototype.$peisAPI = null;
}