提交 1b4d745b authored 作者: 钟是志's avatar 钟是志

打印功能调整

上级 14400a35
...@@ -173,16 +173,19 @@ export default class ViewPrint extends Component { ...@@ -173,16 +173,19 @@ export default class ViewPrint extends Component {
let LODOPObj = window.LODOP; let LODOPObj = window.LODOP;
LODOPObj.On_Return_Remain = true; LODOPObj.On_Return_Remain = true;
LODOPObj.On_Return = (TaskId, Value) => { LODOPObj.On_Return = (TaskId, Value) => {
console.log(TaskId);
if (Number(Value) === 1) { if (Number(Value) === 1) {
message.info(`正在打印第${printIndex + 1}张, 共${viewData.length}张`); message.info(`正在打印第${this.state.printIndex + 1}张, 共${viewData.length}张`);
this.printedDataSave(printIndex); this.printedDataSave(printIndex);
} }
this.setState({ printIndex: this.state.printIndex + 1 }, () => { this.setState({ printIndex: this.state.printIndex + 1 }, () => {
if (this.state.printIndex < length) { if (this.state.printIndex < length) {
this.printOne(); this.printOne();
} else { } else {
LODOPObj.On_Return_Remain = false;
this.setState({ this.setState({
loading: false, loading: false,
printIndex: 0,
}); });
} }
}); });
...@@ -251,6 +254,7 @@ export default class ViewPrint extends Component { ...@@ -251,6 +254,7 @@ export default class ViewPrint extends Component {
name={'打印设备选择'} name={'打印设备选择'}
handleClick={() => { handleClick={() => {
window.LODOP.SELECT_PRINTER(); window.LODOP.SELECT_PRINTER();
debugger;
this.setState({ this.setState({
preaparePrint: true, preaparePrint: true,
}); });
...@@ -262,6 +266,10 @@ export default class ViewPrint extends Component { ...@@ -262,6 +266,10 @@ export default class ViewPrint extends Component {
handleClick={() => { handleClick={() => {
if (!preaparePrint) { if (!preaparePrint) {
message.warning('请先选择打印设备'); message.warning('请先选择打印设备');
window.LODOP.SELECT_PRINTER();
this.setState({
preaparePrint: true,
});
return false; return false;
} }
this.printPreview(); this.printPreview();
...@@ -272,6 +280,10 @@ export default class ViewPrint extends Component { ...@@ -272,6 +280,10 @@ export default class ViewPrint extends Component {
name={'打印'} name={'打印'}
handleClick={() => { handleClick={() => {
if (!preaparePrint) { if (!preaparePrint) {
window.LODOP.SELECT_PRINTER();
this.setState({
preaparePrint: true,
});
message.warning('请先选择打印设备'); message.warning('请先选择打印设备');
return false; return false;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论