add print logic

This commit is contained in:
lb
2023-08-11 16:23:58 +08:00
parent 4addca6d97
commit 62f625197f
4 changed files with 271 additions and 1 deletions

View File

@@ -61,6 +61,8 @@
}
" />
<Overlay v-if="overlayVisible" />
<PrintDom ref="print" v-if="printDOMmount" @destroy="printDOMmount = false" />
</div>
</template>
@@ -74,6 +76,7 @@ import DialogUpload from "@/components/DialogUpload.vue";
import Overlay from "@/components/Overlay.vue";
import moment from "moment";
import AttachmentDialog from "@/components/attachmentDialog.vue";
import PrintDom from "../../components/PrintDom.vue";
const DIALOG_WITH_MENU = "DialogWithMenu";
const DIALOG_JUST_FORM = "DialogJustForm";
@@ -90,6 +93,7 @@ export default {
DialogUpload,
Overlay,
AttachmentDialog,
PrintDom,
},
props: {
navigator: {
@@ -176,6 +180,7 @@ export default {
cachedSearchCondition: {},
needAttachmentDialog: false,
tableSelectedIds: [],
printDOMmount: false,
};
},
inject: ["urls"],
@@ -566,7 +571,7 @@ export default {
break;
}
case "sync": {
this.$confirm(`是否开始同步`, "提示", {
return this.$confirm(`是否开始同步`, "提示", {
confirmButtonText: "同步",
cancelButtonText: "我再想想",
type: "warning",
@@ -610,6 +615,18 @@ export default {
});
});
}
case "print": {
return this.$confirm("开始打印么", "提示", {
confirmButtonText: "确认",
cancelButtonText: "我再想想",
type: "warning",
}).then(() => {
this.printDOMmount = true;
this.$nextTick(() => {
this.$refs["print"].print(data);
});
});
}
}
},