| | |
| | | BID: '', |
| | | data: '', |
| | | tempId: '', |
| | | pageId: '', |
| | | config: null, |
| | | urlParam: null, |
| | | visible: false, |
| | | rePos: false, |
| | | loading: false, |
| | | auto: true |
| | | } |
| | | |
| | |
| | | this.setState({ |
| | | BID: param.id || '', |
| | | tempId: param.tempId, |
| | | urlParam: param |
| | | urlParam: param, |
| | | pageId: param.pageId || '' |
| | | }, () => { |
| | | setTimeout(() => { |
| | | this.getMenuParam() |
| | |
| | | componentDidMount() { |
| | | const _this = this |
| | | |
| | | Object.defineProperty(window, 'debug', { |
| | | configurable: true, |
| | | enumerable: true, |
| | | set(value) { |
| | | if (value + '' === 'false') { |
| | | window.debugger = false |
| | | window.GLOB.breakpoint = false |
| | | sessionStorage.removeItem('breakpoint') |
| | | } else { |
| | | window.debugger = true |
| | | window.GLOB.breakpoint = value + '' |
| | | sessionStorage.setItem('breakpoint', value) |
| | | if (window.GLOB.sysType !== 'cloud') { |
| | | Object.defineProperty(window, 'debugger', { |
| | | configurable: true, |
| | | enumerable: true, |
| | | set(value) { |
| | | if (value + '' === 'false') { |
| | | window.GLOB.debugger = false |
| | | } else { |
| | | window.GLOB.debugger = true |
| | | } |
| | | } |
| | | _this.debugChange() |
| | | } |
| | | }) |
| | | }) |
| | | |
| | | Object.defineProperty(window, 'debug', { |
| | | configurable: true, |
| | | enumerable: true, |
| | | set(value) { |
| | | if (value + '' === 'false') { |
| | | window.GLOB.debugger = false |
| | | window.GLOB.breakpoint = false |
| | | sessionStorage.removeItem('breakpoint') |
| | | } else { |
| | | window.GLOB.debugger = true |
| | | window.GLOB.breakpoint = value + '' |
| | | sessionStorage.setItem('breakpoint', value) |
| | | } |
| | | _this.debugChange() |
| | | } |
| | | }) |
| | | } |
| | | |
| | | document.onkeydown = (event) => { |
| | | let e = event || window.event |
| | |
| | | let _shortcut = `${preKey}+${keyCode}` |
| | | |
| | | if (window.GLOB.breakpoint && _shortcut === 'ctrl+67') { |
| | | window.debugger = false |
| | | window.GLOB.breakpoint = false |
| | | sessionStorage.removeItem('breakpoint') |
| | | |
| | |
| | | } |
| | | |
| | | // 测试系统打印查询语句 |
| | | if (window.GLOB.debugger === true || (window.debugger === true && window.GLOB.sysType !== 'cloud')) { |
| | | if (window.GLOB.debugger === true) { |
| | | _customScript && console.info(`${_dataresource ? '' : '/*不执行默认sql*/\n'}${_customScript}`) |
| | | _dataresource && console.info(_dataresource) |
| | | } |
| | |
| | | } |
| | | |
| | | print = () => { |
| | | const { config, printing } = this.state |
| | | const { config, printing, BID, tempId, pageId } = this.state |
| | | |
| | | if (printing) return |
| | | |
| | | this.setState({printing: true}) |
| | | |
| | | if (config.callback === 'true') { |
| | | this.setState({loading: true}) |
| | | |
| | | Api.genericInterface({ |
| | | func: 's_print_proc', |
| | | username: sessionStorage.getItem('User_Name') || '', |
| | | fullname: sessionStorage.getItem('Full_Name') || '', |
| | | BID: BID || '', |
| | | print_type: config.callNo || '', |
| | | MenuNo: config.MenuNo || '', |
| | | Menuid: tempId || '' |
| | | }).then(res => { |
| | | if (!res.status) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: res.message, |
| | | duration: 5 |
| | | }) |
| | | |
| | | this.setState({printing: false, loading: false}) |
| | | return |
| | | } |
| | | |
| | | this.setState({loading: false}) |
| | | |
| | | if (pageId) { |
| | | localStorage.setItem('menuUpdate', new Date().getTime() + ',' + pageId + ',menu') |
| | | } |
| | | |
| | | setTimeout(() => { |
| | | this.execPrint() |
| | | }, 300) |
| | | }) |
| | | } else { |
| | | this.execPrint() |
| | | } |
| | | } |
| | | |
| | | execPrint = () => { |
| | | const { config } = this.state |
| | | |
| | | let qrcodes = document.getElementsByClassName('qrcode-box') |
| | | |
| | |
| | | } |
| | | |
| | | let jubuData = document.getElementById('bill-print').innerHTML |
| | | |
| | | this.setState({printing: true}) |
| | | |
| | | try { |
| | | let iframe = document.createElement('IFRAME') |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { loadingview, viewlost, config, pages, auto, rePos } = this.state |
| | | const { loadingview, viewlost, config, pages, auto, rePos, loading } = this.state |
| | | |
| | | return ( |
| | | <div className="bill-print-wrap" > |
| | | {loadingview && <Spin size="large" />} |
| | | {loadingview || loading ? <Spin size="large" /> : null} |
| | | {pages ? <div id="bill-print"> |
| | | {pages.map((components, index) => (<div className={'print-page' + (auto ? ' auto' : '') + (rePos ? ' reset-position' : '')} key={index} style={{...config.style, overflow: 'hidden', boxSizing: 'border-box'}}><Row className="component-wrap">{this.getComponents(components)}</Row></div>))} |
| | | </div> : null} |