| | |
| | | disableAdd: false, |
| | | disableSave: false, |
| | | typeOptions: [], |
| | | subjects: [], |
| | | charType: '', |
| | | charInt: '', |
| | | vouDate: null, |
| | |
| | | if (BData) { |
| | | BID = BData.$BID || '' |
| | | } |
| | | |
| | | window.GLOB.CacheVoucher.delete(config.uuid) |
| | | |
| | | this.setState({ |
| | | config: fromJS(config).toJS(), |
| | |
| | | } |
| | | |
| | | loadData = () => { |
| | | const { book } = this.state |
| | | const { book, config } = this.state |
| | | |
| | | if (!book) return |
| | | |
| | |
| | | typeOptions: typeOptions, |
| | | charType: typeOptions[0] ? typeOptions[0].voucher_class : '', |
| | | charInt: typeOptions[0] ? typeOptions[0].voucher_char_int : '', |
| | | subjects: res.subjects || [], |
| | | }) |
| | | |
| | | let names = {} |
| | | let supplier = [] |
| | | let customer = [] |
| | | let department = [] |
| | | let project = [] |
| | | let inventory = [] |
| | | let employee = [] |
| | | let cash_flow = [] |
| | | |
| | | res.sup && res.sup.forEach(item => { |
| | | names[item.sup_type_code] = item.sup_type_name |
| | | }) |
| | | |
| | | res.supplier && res.supplier.forEach(item => { |
| | | supplier.push({value: item.suppliercode, label: item.suppliername}) |
| | | }) |
| | | |
| | | res.customer && res.customer.forEach(item => { |
| | | customer.push({value: item.customercode, label: item.customername}) |
| | | }) |
| | | |
| | | res.co_pro && res.co_pro.forEach(item => { |
| | | department.push({value: item.co_pro_code, label: item.co_pro_name}) |
| | | }) |
| | | |
| | | res.pm && res.pm.forEach(item => { |
| | | project.push({value: item.projectcode, label: item.projectname}) |
| | | }) |
| | | |
| | | res.materiel && res.materiel.forEach(item => { |
| | | inventory.push({value: item.productcode, label: item.productname}) |
| | | }) |
| | | |
| | | res.workers && res.workers.forEach(item => { |
| | | employee.push({value: item.workercode, label: item.workername}) |
| | | }) |
| | | |
| | | res.cash_flow && res.cash_flow.forEach(item => { |
| | | cash_flow.push({value: item.cash_flow_code, label: item.cash_flow_name}) |
| | | }) |
| | | |
| | | let message = { |
| | | subjects: res.subjects || [], |
| | | names: names, |
| | | supplier: supplier, |
| | | customer: customer, |
| | | department: department, |
| | | project: project, |
| | | inventory: inventory, |
| | | employee: employee, |
| | | cash_flow: cash_flow, |
| | | } |
| | | |
| | | window.GLOB.CacheVoucher.set(config.uuid, message) |
| | | |
| | | setTimeout(() => { |
| | | this.getVoucher() |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { config, disableSave, disableAdd, typeOptions, charType, charInt, data, vouDate, subjects } = this.state |
| | | const { config, disableSave, disableAdd, typeOptions, charType, charInt, data, vouDate } = this.state |
| | | |
| | | return ( |
| | | <div className="menu-voucher-wrap" style={config.style}> |
| | |
| | | <Button type="link" className="" onClick={this.triggerprint}>备注</Button> |
| | | </div> |
| | | </div> |
| | | <VoucherTable config={config} subjects={subjects} data={data}/> |
| | | <VoucherTable config={config} data={data}/> |
| | | </div> : null} |
| | | {config.wrap.type === 'check' ? <div className="voucher-body"> |
| | | <div className="pre-wrap"> |