| | |
| | | border-color: $color6; |
| | | } |
| | | // 下拉框 |
| | | .ant-select:not(.ant-select-disabled) { |
| | | .ant-select-selection:hover { |
| | | border-color: $color5; |
| | | } |
| | | } |
| | | .ant-select-focused .ant-select-selection, .ant-select-selection:focus, .ant-select-selection:active { |
| | | border-color: $color5; |
| | |
| | | background-color: $color6; |
| | | } |
| | | // 输入框 |
| | | .ant-input:hover { |
| | | .ant-input:not([disabled]):hover { |
| | | border-color: $color5; |
| | | } |
| | | .ant-input:focus, .ant-input:active { |
| | |
| | | border-color: $color5; |
| | | box-shadow: 0 0 0 2px $color2; |
| | | } |
| | | .ant-input-number:hover, .ant-input-number:focus, .ant-input-number:active, .ant-input-number-input:hover, .ant-input-number-input:focus, .ant-input-number-input:active, .ant-input-number-focused:hover, .ant-input-number-focused:focus, .ant-input-number-focused:active { |
| | | .ant-input-number:not(.ant-input-number-disabled):hover, .ant-input-number:focus, .ant-input-number:active, .ant-input-number-input:hover, .ant-input-number-input:focus, .ant-input-number-input:active, .ant-input-number-focused:hover, .ant-input-number-focused:focus, .ant-input-number-focused:active { |
| | | border-color: $color5; |
| | | } |
| | | .ant-input-number:focus, .ant-input-number:active { |
| | |
| | | const MKCheckbox = asyncComponent(() => import('./mkCheckbox')) |
| | | const StyleInput = asyncComponent(() => import('./styleInput')) |
| | | const MKFileUpload = asyncComponent(() => import('@/tabviews/zshare/fileupload')) |
| | | const MkPrintTemps = asyncComponent(() => import('@/menu/components/share/actioncomponent/actionform/mkPrintTemps')) |
| | | const MKColor = asyncComponent(() => import('@/mob/colorsketch')) |
| | | // const MKColor = asyncComponent(() => import('@/tabviews/zshare/mutilform/mkColor')) |
| | | const MkEditIcon = asyncComponent(() => import('@/components/mkIcon')) |
| | |
| | | </Col> |
| | | ) |
| | | return |
| | | } else if (item.type === 'printTemps') { |
| | | content = <MkPrintTemps onChange={(val) => this.recordChange({[item.field]: val})}/> |
| | | } |
| | | |
| | | if (!content) return |
| | | |
| | | if (item.help) { |
| | | let help = null |
| | | if (typeof(item.help) === 'function') { |
| | | help = item.help(this.record) |
| | | } else { |
| | | help = <span style={{fontSize: '12px'}}>{item.help}</span> |
| | | } |
| | | fields.push( |
| | | <Col span={item.span || 12} key={index}> |
| | | <Form.Item label={label} help={<span style={{fontSize: '12px'}}>{item.help}</span>}> |
| | | <Form.Item label={label} help={help}> |
| | | {getFieldDecorator(item.field, { |
| | | initialValue: item.initval, |
| | | rules: item.rules |
| | |
| | | <ToolOutlined /> |
| | | </Popover> |
| | | <div className="voucher-box"> |
| | | {card.wrap.type === 'createVoucher' ? <div className="voucher-header"> |
| | | <Button className="add-background header-btn">保存并新增</Button> |
| | | <Button className="add-background header-btn">保存</Button> |
| | | <Button className="print-background header-btn">打印</Button> |
| | | <Button className="out-background header-btn">更多</Button> |
| | | {card.wrap.type === 'createVoucher' ? <div className="voucher-header" style={{padding: `10px ${card.wrap.space || 0}px`}}> |
| | | <Button>保存并新增</Button> |
| | | <Button>保存</Button> |
| | | <Button>打印</Button> |
| | | <Button>更多</Button> |
| | | </div> : null} |
| | | {card.wrap.type === 'checkVoucher' ? <div className="voucher-header"> |
| | | <Button className="add-background header-btn">保存</Button> |
| | | <Button className="print-background header-btn">打印</Button> |
| | | <Button className="out-background header-btn">关闭</Button> |
| | | {card.wrap.type === 'checkVoucher' ? <div className="voucher-header" style={{padding: `10px ${card.wrap.space || 0}px`}}> |
| | | <Button>保存</Button> |
| | | <Button>打印</Button> |
| | | <Button>审核</Button> |
| | | <Button>关闭</Button> |
| | | </div> : null} |
| | | <div className="voucher-body" style={{padding: `0px ${card.wrap.space || 0}px`}}> |
| | | {card.wrap.type === 'createVoucher' || card.wrap.type === 'checkVoucher' ? <div className="pre-wrap"> |
| | |
| | | 模板类型: |
| | | <div>日常支出<DownOutlined/></div> |
| | | </div> |
| | | <Button className="close-temp header-btn">关闭</Button> |
| | | <Button className="save-temp header-btn">保存</Button> |
| | | <Button>关闭</Button> |
| | | <Button>保存</Button> |
| | | </div> : null} |
| | | <VoucherTable config={card}/> |
| | | {card.wrap.type === 'createVoucher' || card.wrap.type === 'checkVoucher' ? <div className="user">制单人:</div> : null} |
| | |
| | | padding: 10px; |
| | | border-bottom: 1px solid #eeeeee; |
| | | |
| | | .header-btn { |
| | | .ant-btn { |
| | | height: 28px; |
| | | min-width: 80px; |
| | | margin-right: 10px; |
| | | background-color: #ffffff; |
| | | border-color: #d8d8d8; |
| | | color: rgba(0, 0, 0, 0.65); |
| | | } |
| | | } |
| | | .voucher-body { |
| | |
| | | } |
| | | } |
| | | } |
| | | .header-btn { |
| | | float: right; |
| | | margin-left: 10px; |
| | | } |
| | | .pre-wrap { |
| | | padding: 10px 0px; |
| | | >.ant-btn { |
| | | margin-right: 10px; |
| | | background-color: #ffffff; |
| | | border-color: #d8d8d8; |
| | | color: rgba(0, 0, 0, 0.65); |
| | | } |
| | | } |
| | | .voucher-date { |
| | | display: inline-block; |
| | |
| | | .user { |
| | | padding-top: 15px; |
| | | } |
| | | } |
| | | |
| | | .add-background { |
| | | background: #26C281; |
| | | border-color: #26C281; |
| | | color: #ffffff; |
| | | } |
| | | .print-background { |
| | | background-color: #8E44AD; |
| | | border-color: #8E44AD; |
| | | color: #ffffff; |
| | | } |
| | | .out-background { |
| | | background-color: rgb(50, 197, 210); |
| | | border-color: rgb(50, 197, 210); |
| | | color: #ffffff; |
| | | } |
| | | .save-temp { |
| | | background-color: #1890ff; |
| | | border-color: #1890ff; |
| | | color: #ffffff; |
| | | } |
| | | .close-temp { |
| | | background-color: #ffffff; |
| | | border-color: #f5222d; |
| | | color: #f5222d; |
| | | } |
| | | |
| | | .system-background { |
| | | background: #1890ff; |
| | | border-color: #1890ff; |
| | | color: #ffffff; |
| | | } |
| | | } |
| | | .menu-voucher-box::after { |
| | |
| | | import React from 'react' |
| | | import MenuUtils from '@/utils/utils-custom.js' |
| | | |
| | | /** |
| | |
| | | {field: 'voucherType', values: ['createVoucher', 'checkVoucher']}, |
| | | {field: 'voucherTypeText', values: ['createVoucher', 'checkVoucher']}, |
| | | {field: 'voucherSign', values: ['createVoucher', 'checkVoucher']}, |
| | | {field: 'printTemp', values: ['createVoucher', 'checkVoucher']}, |
| | | {field: 'supModule', values: ['checkTemp', 'checkVoucher']}, |
| | | {field: 'attachStatus', values: ['createVoucher', 'checkVoucher']}, |
| | | ] |
| | |
| | | ] |
| | | }, |
| | | { |
| | | type: 'printTemps', |
| | | field: 'printTemp', |
| | | label: '打印模板', |
| | | initval: wrap.printTemp || '', |
| | | help: (record) => { |
| | | if (record.printTemp) { |
| | | return <span onClick={() => { |
| | | sessionStorage.setItem('mk-print-temp', record.printTemp) |
| | | window.open('#/hs') |
| | | |
| | | setTimeout(() => { |
| | | sessionStorage.removeItem('mk-print-temp') |
| | | }, 50) |
| | | }} style={{color: '#1890ff', cursor: 'pointer', fontSize: '13px'}}>#查看模板</span> |
| | | } |
| | | return '' |
| | | }, |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'number', |
| | | field: 'space', |
| | | label: '留白', |
| | |
| | | showSearch |
| | | allowClear |
| | | value={value} |
| | | dropdownMatchSelectWidth={false} |
| | | filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0} |
| | | onSelect={this.selectChange} |
| | | onChange={(val) => val === undefined && this.selectChange('')} |
| | |
| | | wrapClassName="mk-flow-type" |
| | | visible={visible} |
| | | width={400} |
| | | maskClosable={false} |
| | | closable={false} |
| | | onCancel={() => this.setState({visible: false})} |
| | | footer={[ |
| | | <Button key="cancel" className="mk-green" onClick={() => this.execAddProcess('flowstart')}>发起</Button>, |
| | | <Button key="confirm" className="mk-primary" onClick={() => this.execAddProcess('flowcheck')}>审批</Button> |
| | |
| | | } |
| | | ] |
| | | })( |
| | | <InputNumber readOnly={nodetype !== 'node' && nodetype !== 'edge'} precision={0}/> |
| | | <InputNumber readOnly={nodetype !== 'node' && nodetype !== 'edge' && nodetype !== 'end'} precision={0}/> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | |
| | | import ResetRemark from './resetRemark' |
| | | import ResetAttach from './resetAttach' |
| | | import LoadFromTemp from './loadFromTemp' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import './index.scss' |
| | | |
| | | const PrintVoucher = asyncComponent(() => import('./printVoucher')) |
| | | const { confirm } = Modal |
| | | |
| | | class VoucherModule extends Component { |
| | |
| | | username: sessionStorage.getItem('User_Name'), |
| | | remark: '', |
| | | attachments: 0, |
| | | vouAduited: false, |
| | | attachlist: [], |
| | | oriAttachs: [], |
| | | tempTypes: [], |
| | |
| | | |
| | | let data = [] |
| | | if (res.voucher) { |
| | | let disabled = res.voucher_status === 'true' |
| | | data = res.voucher.map(line => { |
| | | line.uuid = line.subject_id || '' |
| | | |
| | |
| | | line.exratename = line.foreign_exratename || '' |
| | | line.local_currency = line.local_exratecode || '' |
| | | line.foreign_currency_type = line.foreign_type || '' |
| | | line.$disabled = disabled |
| | | |
| | | if (line.sup) { |
| | | line.supAccounts = line.sup.map(cell => { |
| | |
| | | data: data, |
| | | attachlist: files, |
| | | vouDate: res.fibvoucherdate ? moment(res.fibvoucherdate, 'YYYY-MM-DD') : null, |
| | | charType: res.voucher_class, |
| | | charType: res.voucher_class || 'keeping', |
| | | vouAduited: res.voucher_status === 'true', |
| | | charName: res.voucher_char, |
| | | charInt: res.voucher_char_int, |
| | | // orgcode: res.orgcode, |
| | |
| | | this.setState({status: 'change', attachlist: vals, attachments: num}) |
| | | } |
| | | |
| | | triggermore = () => { |
| | | |
| | | } |
| | | |
| | | triggerclose = () => { |
| | | const { config, status } = this.state |
| | | |
| | |
| | | }) |
| | | } |
| | | |
| | | render() { |
| | | const { type, status, loading, config, orgcode, orgname, typeOptions, tempTypes, charType, charName, charInt, data, vouDate, username, remark, attachments, title, attachlist, tempTypeClass } = this.state |
| | | triggerPrint = () => { |
| | | const { config, BID } = this.state |
| | | |
| | | if (!config.wrap.printTemp) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '尚未设置打印模板!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | window.open('#/billprint/' + window.btoa(window.encodeURIComponent(JSON.stringify({ id: BID, tempId: config.wrap.printTemp, pageId: config.$pageId || '', dataM: sessionStorage.getItem('dataM') })))) |
| | | } |
| | | |
| | | triggerAduit = () => { |
| | | const { book, BID, voucherCode, username } = this.state |
| | | |
| | | if (!book) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '请选择账套!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | let param = { |
| | | func: 's_fcc_voucher_sub', |
| | | ID: BID, |
| | | status: 10, |
| | | statusname: '已审核', |
| | | voucher_code: voucherCode || '', |
| | | username: username, |
| | | fullname: sessionStorage.getItem('Full_Name') || '' |
| | | } |
| | | |
| | | const that = this |
| | | |
| | | confirm({ |
| | | content: '确定要审核吗?', |
| | | onOk() { |
| | | Api.genericInterface(param).then(res => { |
| | | if (!res.status) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: res.message, |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | Modal.success({ |
| | | title: '已经通过审核' |
| | | }) |
| | | |
| | | that.getVoucher() |
| | | }) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | | } |
| | | |
| | | triggerUnAduit = () => { |
| | | const { book, BID, voucherCode, username } = this.state |
| | | |
| | | if (!book) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '请选择账套!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | let param = { |
| | | func: 's_fcc_voucher_sub', |
| | | ID: BID, |
| | | status: 0, |
| | | statusname: '取消审核', |
| | | voucher_code: voucherCode || '', |
| | | username: username, |
| | | fullname: sessionStorage.getItem('Full_Name') || '' |
| | | } |
| | | |
| | | const that = this |
| | | |
| | | confirm({ |
| | | content: '确认要取消审核吗?', |
| | | onOk() { |
| | | Api.genericInterface(param).then(res => { |
| | | if (!res.status) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: res.message, |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | Modal.success({ |
| | | title: '审核已取消' |
| | | }) |
| | | |
| | | that.getVoucher() |
| | | }) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | | } |
| | | |
| | | render() { |
| | | const { type, status, loading, config, orgcode, typeOptions, tempTypes, charType, charInt, data, vouDate, username, remark, attachments, title, attachlist, tempTypeClass, vouAduited } = this.state |
| | | |
| | | if (type === 'checkVoucher') { |
| | | return ( |
| | | <div className="menu-voucher-wrap" style={config.style}> |
| | | {type === 'createVoucher' ? <div className="voucher-header"> |
| | | <Button className="add-background header-btn" disabled={status === 'empty'} onClick={() => this.triggersave('add')}>保存并新增</Button> |
| | | <Button className="add-background header-btn" disabled={status === 'empty' || status === 'saved'} onClick={() => this.triggersave()}>保存</Button> |
| | | <PrintVoucher ID={config.uuid + 'print'} data={data} orgname={orgname} vouDate={vouDate} charName={charName} charInt={charInt} attachments={attachments} disabled={status !== 'saved'}/> |
| | | <div className="voucher-header" style={{padding: `10px ${config.wrap.space || 0}px`}}> |
| | | {!vouAduited ?<Button disabled={status === 'empty' || status === 'saved'} onClick={() => this.triggersave()}>保存</Button> : null} |
| | | {/* <PrintVoucher ID={config.uuid + 'print'} data={data} orgname={orgname} vouDate={vouDate} charName={charName} charInt={charInt} attachments={attachments} disabled={status !== 'saved'}/> */} |
| | | <Button disabled={status !== 'saved'} onClick={this.triggerPrint}>打印</Button> |
| | | {vouAduited ? |
| | | <Button onClick={this.triggerUnAduit}>取消审核</Button> : |
| | | <Button onClick={this.triggerAduit}>审核</Button>} |
| | | <Button onClick={this.triggerclose}>关闭</Button> |
| | | </div> |
| | | <div className="voucher-body" style={{padding: `0px ${config.wrap.space || 0}px`}}> |
| | | <div className="pre-wrap"> |
| | | <div className="voucher-code"> |
| | | <Select value={charType} disabled={vouAduited} dropdownClassName="mk-vcode-dropdown" onChange={(val, option) => this.setState({status: 'change', charType: val, charName: option.props.charname, charInt: option.props.charint})}> |
| | | {typeOptions.map(option => |
| | | <Select.Option key={option.id} value={option.voucher_class} charname={option.voucher_char} charint={option.voucher_char_int}>{option.voucher_char}</Select.Option> |
| | | )} |
| | | </Select> |
| | | <InputNumber precision={0} min={1} disabled={vouAduited} value={charInt} autoComplete="off" onChange={(val) => this.setState({status: 'change', charInt: val})}/> 号 |
| | | </div> |
| | | <div className="voucher-date"> |
| | | 日期:<DatePicker value={vouDate} disabled={vouAduited} onChange={this.changeVouDate}/> |
| | | </div> |
| | | <div className="voucher-text"> |
| | | <Input value={title} placeholder="凭证文本" disabled={vouAduited} autoComplete="off" onChange={(e) => this.setState({status: 'change', title: e.target.value})}/> |
| | | </div> |
| | | <div className="voucher-affix"> |
| | | 附单据 <InputNumber precision={0} disabled={vouAduited} value={attachments || 0} autoComplete="off" onChange={this.changeAttach}/> 张 |
| | | <ResetAttach config={config} disabled={vouAduited} orgcode={orgcode} voucherCode={this.state.voucherCode} attachlist={attachlist} onChange={this.resetAttachList}/> |
| | | <ResetRemark remark={remark} disabled={vouAduited} ID={config.uuid + 'remark'} onChange={(val) => this.setState({status: 'change', remark: val})}/> |
| | | </div> |
| | | </div> |
| | | <VoucherTable config={config} loading={loading} data={data} onChange={this.dataChange}/> |
| | | </div> |
| | | <div className="user" style={{paddingLeft: `${config.wrap.space || 0}px`}}>制单人:{username}</div> |
| | | </div> |
| | | ) |
| | | } else if (type === 'createVoucher') { |
| | | return ( |
| | | <div className="menu-voucher-wrap" style={config.style}> |
| | | <div className="voucher-header" style={{padding: `10px ${config.wrap.space || 0}px`}}> |
| | | <Button disabled={status === 'empty'} onClick={() => this.triggersave('add')}>保存并新增</Button> |
| | | <Button disabled={status === 'empty' || status === 'saved'} onClick={() => this.triggersave()}>保存</Button> |
| | | <Button disabled={status !== 'saved'} onClick={this.triggerPrint}>打印</Button> |
| | | <Dropdown overlay={<div className="mk-voucher-dropdown-wrap"> |
| | | <SaveAsTemp tempTypes={tempTypes} onChange={this.triggerTempsave}/> |
| | | <div className="split"></div> |
| | | <LoadFromTemp tempTypes={tempTypes} onChange={this.triggerTempLoad}/> |
| | | </div>} trigger={['click']}> |
| | | <Button className="out-background header-btn" onClick={this.triggermore}>更多</Button> |
| | | </div>} trigger={['hover']} placement="bottomCenter"> |
| | | <Button>更多</Button> |
| | | </Dropdown> |
| | | </div> : null} |
| | | {type === 'checkVoucher' ? <div className="voucher-header"> |
| | | <Button className="add-background header-btn" disabled={status === 'empty' || status === 'saved'} onClick={() => this.triggersave()}>保存</Button> |
| | | <PrintVoucher ID={config.uuid + 'print'} data={data} orgname={orgname} vouDate={vouDate} charName={charName} charInt={charInt} attachments={attachments} disabled={status !== 'saved'}/> |
| | | <Button className="out-background header-btn" onClick={this.triggerclose}>关闭</Button> |
| | | </div> : null} |
| | | </div> |
| | | <div className="voucher-body" style={{padding: `0px ${config.wrap.space || 0}px`}}> |
| | | {type === 'createVoucher' || type === 'checkVoucher' ? <div className="pre-wrap"> |
| | | <div className="pre-wrap"> |
| | | <div className="voucher-code"> |
| | | <Select value={charType} dropdownClassName="mk-vcode-dropdown" onChange={(val, option) => this.setState({status: 'change', charType: val, charName: option.props.charName, charInt: option.props.charint})}> |
| | | <Select value={charType} dropdownClassName="mk-vcode-dropdown" onChange={(val, option) => this.setState({status: 'change', charType: val, charName: option.props.charname, charInt: option.props.charint})}> |
| | | {typeOptions.map(option => |
| | | <Select.Option key={option.id} value={option.voucher_class} charName={option.voucher_char} charint={option.voucher_char_int}>{option.voucher_char}</Select.Option> |
| | | <Select.Option key={option.id} value={option.voucher_class} charname={option.voucher_char} charint={option.voucher_char_int}>{option.voucher_char}</Select.Option> |
| | | )} |
| | | </Select> |
| | | <InputNumber precision={0} min={1} value={charInt} autoComplete="off" onChange={(val) => this.setState({status: 'change', charInt: val})}/> 号 |
| | |
| | | <ResetAttach config={config} orgcode={orgcode} voucherCode={this.state.voucherCode} attachlist={attachlist} onChange={this.resetAttachList}/> |
| | | <ResetRemark remark={remark} ID={config.uuid + 'remark'} onChange={(val) => this.setState({status: 'change', remark: val})}/> |
| | | </div> |
| | | </div> : null} |
| | | {type === 'createTemp' || type === 'checkTemp' ? <div className="pre-temp-wrap"> |
| | | </div> |
| | | <VoucherTable config={config} loading={loading} data={data} onChange={this.dataChange}/> |
| | | </div> |
| | | <div className="user" style={{paddingLeft: `${config.wrap.space || 0}px`}}>制单人:{username}</div> |
| | | </div> |
| | | ) |
| | | } else { |
| | | return ( |
| | | <div className="menu-voucher-wrap" style={config.style}> |
| | | <div className="voucher-body" style={{padding: `0px ${config.wrap.space || 0}px`}}> |
| | | <div className="pre-temp-wrap"> |
| | | <div className="temp-text"> |
| | | <span>模板名称:</span><Input value={title} placeholder="模板名称" autoComplete="off" onChange={(e) => this.setState({title: e.target.value})}/> |
| | | </div> |
| | |
| | | </Select> |
| | | </div> |
| | | <div className="temp-action"> |
| | | <Button className="save-temp header-btn" onClick={() => this.triggerTempsave()}>保存</Button> |
| | | <Button className="close-temp header-btn" onClick={this.triggerclose}>关闭</Button> |
| | | <Button onClick={() => this.triggerTempsave()}>保存</Button> |
| | | <Button onClick={this.triggerclose}>关闭</Button> |
| | | </div> |
| | | </div> : null} |
| | | </div> |
| | | <VoucherTable config={config} loading={loading} data={data} onChange={this.dataChange}/> |
| | | </div> |
| | | {type === 'createVoucher' || type === 'checkVoucher' ? <div className="user">制单人:{username}</div> : null} |
| | | </div> |
| | | ) |
| | | } |
| | | } |
| | | } |
| | | |
| | | export default VoucherModule |
| | |
| | | padding: 10px; |
| | | border-bottom: 1px solid #eeeeee; |
| | | |
| | | .header-btn { |
| | | .ant-btn { |
| | | height: 28px; |
| | | min-width: 80px; |
| | | margin-right: 10px; |
| | | background-color: #ffffff; |
| | | border-color: #d8d8d8; |
| | | color: rgba(0, 0, 0, 0.65); |
| | | } |
| | | .ant-btn[disabled] { |
| | | background-color: #dadada!important; |
| | | border-color: #dadada!important; |
| | | color: #ffffff!important; |
| | | } |
| | | .ant-btn:not([disabled]):hover { |
| | | background-color: var(--mk-sys-color); |
| | | border-color: var(--mk-sys-color); |
| | | color: #ffffff; |
| | | } |
| | | } |
| | | .voucher-body { |
| | |
| | | .ant-btn { |
| | | margin-left: 15px; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | .add-background { |
| | | background: #26C281; |
| | | border-color: #26C281; |
| | | color: #ffffff; |
| | | } |
| | | .print-background { |
| | | background-color: #8E44AD; |
| | | border-color: #8E44AD; |
| | | color: #ffffff; |
| | | } |
| | | .out-background { |
| | | background-color: rgb(50, 197, 210); |
| | | border-color: rgb(50, 197, 210); |
| | | color: #ffffff; |
| | | } |
| | | |
| | | .save-temp { |
| | | background-color: var(--mk-sys-color); |
| | | .ant-btn:hover { |
| | | color: var(--mk-sys-color); |
| | | border-color: var(--mk-sys-color); |
| | | color: #ffffff; |
| | | } |
| | | .close-temp { |
| | | background-color: #ffffff; |
| | | border-color: #f5222d; |
| | | color: #f5222d; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .system-background { |
| | | background: var(--mk-sys-color); |
| | | border-color: var(--mk-sys-color); |
| | | color: #ffffff; |
| | | } |
| | | .user { |
| | | padding: 15px 30px 0px; |
| | | } |
| | |
| | | border: 1px solid #d8d8d8; |
| | | border-radius: 4px; |
| | | min-height: 66px; |
| | | overflow: hidden; |
| | | |
| | | .ant-btn { |
| | | display: block; |
| | | width: 100%; |
| | | border: none; |
| | | color: rgba(0, 0, 0, 0.65); |
| | | border-radius: 0; |
| | | } |
| | | .ant-btn:not([disabled]):hover { |
| | | background-color: var(--mk-sys-color); |
| | | border-color: var(--mk-sys-color); |
| | | color: #ffffff; |
| | | } |
| | | .split { |
| | | width: 100%; |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { disabled } = this.props |
| | | const { visible, upVisible, docVisible, files, list, documents, loading } = this.state |
| | | |
| | | return ( |
| | |
| | | destroyOnClose |
| | | > |
| | | {loading ? <Spin /> : null} |
| | | <Button type="link" className="attach-type-btn" disabled={loading} onClick={() => this.setState({upVisible: true})}>上传新文件</Button> |
| | | <Button type="link" className="attach-type-btn" disabled={loading} onClick={() => this.setState({docVisible: true, selectDocs: []})}>从会计电子档案选择</Button> |
| | | <Button type="link" className="attach-type-btn" disabled={loading || disabled} onClick={() => this.setState({upVisible: true})}>上传新文件</Button> |
| | | <Button type="link" className="attach-type-btn" disabled={loading || disabled} onClick={() => this.setState({docVisible: true, selectDocs: []})}>从会计电子档案选择</Button> |
| | | <div className="attach-selected-list"> |
| | | {list.map(item => { |
| | | return <div className="attach-item" key={item.id}> |
| | |
| | | <div>{item.data_name ? item.data_name + ' / ' : ''}{item.attachments_title}</div> |
| | | </div> |
| | | <div> |
| | | <DeleteOutlined onClick={() => this.deleteFile(item.id)}/> |
| | | {!disabled ? <DeleteOutlined onClick={() => this.deleteFile(item.id)}/> : null} |
| | | </div> |
| | | </div> |
| | | })} |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { ID } = this.props |
| | | const { ID, disabled } = this.props |
| | | const { visible, remark } = this.state |
| | | |
| | | return ( |
| | |
| | | onCancel={() => { this.setState({ visible: false })}} |
| | | destroyOnClose |
| | | > |
| | | <TextArea id={ID} defaultValue={remark} rows={6}/> |
| | | <TextArea id={ID} disabled={disabled} defaultValue={remark} rows={6}/> |
| | | </Modal> |
| | | </> |
| | | ) |
| | |
| | | if (record.type === 'total') { |
| | | children = <div className="content-wrap" style={{lineHeight: '60px'}}>合计: {val}</div> |
| | | colSpan = 2 |
| | | } else if (record.$disabled) { |
| | | children = <div className="content-wrap">{val}</div> |
| | | } else { |
| | | extra = <PlusOutlined onClick={this.plusLine}/> |
| | | |
| | |
| | | <span><InputNumber precision={4} className="inner-input" id={col.uuid + record.uuid + 'price'} defaultValue={record.net_unitprice || 0} onChange={(val) => this.onChange(val)} onPressEnter={this.pricePress} onBlur={this.priceBlur}/></span> |
| | | </span> |
| | | </div> |
| | | } else if (record.$disabled) { |
| | | countNode = <div className="count-wrap"> |
| | | <span style={{marginRight: '5px'}}> |
| | | <span>数量:</span> |
| | | <span>{record.fcc_count || 0}</span> |
| | | </span> |
| | | <span> |
| | | <span>单价:</span> |
| | | <span>{record.net_unitprice || 0}</span> |
| | | </span> |
| | | </div> |
| | | } else { |
| | | countNode = <div className="count-wrap"> |
| | | <span style={{marginRight: '5px'}} onClick={this.editCount}> |
| | |
| | | <span><InputNumber precision={2} className="inner-input" id={col.uuid + record.uuid + 'origin'} defaultValue={record.foreign_amount || 0} onChange={(val) => this.onChange(val)} onPressEnter={this.originPress} onBlur={this.originBlur}/></span> |
| | | </span> |
| | | </div> |
| | | } else if (record.$disabled) { |
| | | currencyNode = <div className="count-wrap"> |
| | | <span style={{marginRight: '5px'}}> |
| | | <span>货币:</span> |
| | | <span>{record.exratename || ''}</span> |
| | | </span> |
| | | <span style={{marginRight: '5px'}}> |
| | | <span>汇率:</span> |
| | | <span>{record.unitratio || 1}</span> |
| | | </span> |
| | | <span> |
| | | <span>原币:</span> |
| | | <span>{record.foreign_amount || 0}</span> |
| | | </span> |
| | | </div> |
| | | } else { |
| | | currencyNode = <div className="count-wrap"> |
| | | <span style={{marginRight: '5px'}} onClick={this.editCurrency}> |
| | |
| | | } |
| | | } |
| | | |
| | | if (record.$disabled) { |
| | | children = <div className="content-wrap"> |
| | | {val} |
| | | {countNode} |
| | | {currencyNode} |
| | | </div> |
| | | } else { |
| | | children = <div className="content-wrap" onClick={this.focus}> |
| | | {val} |
| | | {countNode} |
| | | {currencyNode} |
| | | </div> |
| | | } |
| | | } |
| | | } |
| | | } else if (col.field === 'debit') { |
| | |
| | | } |
| | | vals = (val * 100).toFixed(0).split('').reverse() |
| | | } |
| | | |
| | | if (record.$disabled) { |
| | | children = <div className={'money-uint' + (down ? ' down' : '')}> |
| | | <span>{vals[10] || ''}</span> <span>{vals[9] || ''}</span> <span>{vals[8] || ''}</span> <span>{vals[7] || ''}</span> <span>{vals[6] || ''}</span> <span>{vals[5] || ''}</span> |
| | | <span>{vals[4] || ''}</span> <span>{vals[3] || ''}</span> <span>{vals[2] || ''}</span> <span>{vals[1] || ''}</span> <span className="last">{vals[0] || ''}</span> |
| | | </div> |
| | | } else { |
| | | children = <div className={'money-uint' + (down ? ' down' : '')} onClick={this.focus}> |
| | | <span>{vals[10] || ''}</span> <span>{vals[9] || ''}</span> <span>{vals[8] || ''}</span> <span>{vals[7] || ''}</span> <span>{vals[6] || ''}</span> <span>{vals[5] || ''}</span> |
| | | <span>{vals[4] || ''}</span> <span>{vals[3] || ''}</span> <span>{vals[2] || ''}</span> <span>{vals[1] || ''}</span> <span className="last">{vals[0] || ''}</span> |
| | | </div> |
| | | } |
| | | } |
| | | } else if (col.field === 'credit') { |
| | | if (record.type !== 'total' && !record.$disabled) { |
| | | extra = <CloseOutlined onClick={this.delVoucher}/> |
| | | } |
| | | |
| | | if (editing) { |
| | | children = <InputNumber id={col.uuid + record.uuid} precision={2} defaultValue={record.credit} onChange={(val) => this.onChange(val)} onPressEnter={this.enterPress} onBlur={this.onBlur}/> |
| | |
| | | } |
| | | vals = (val * 100).toFixed(0).split('').reverse() |
| | | } |
| | | |
| | | if (record.$disabled) { |
| | | children = <div className={'money-uint' + (down ? ' down' : '')}> |
| | | <span>{vals[10] || ''}</span> <span>{vals[9] || ''}</span> <span>{vals[8] || ''}</span> <span>{vals[7] || ''}</span> <span>{vals[6] || ''}</span> <span>{vals[5] || ''}</span> |
| | | <span>{vals[4] || ''}</span> <span>{vals[3] || ''}</span> <span>{vals[2] || ''}</span> <span>{vals[1] || ''}</span> <span className="last">{vals[0] || ''}</span> |
| | | </div> |
| | | } else { |
| | | children = <div className={'money-uint' + (down ? ' down' : '')} onClick={this.focus}> |
| | | <span>{vals[10] || ''}</span> <span>{vals[9] || ''}</span> <span>{vals[8] || ''}</span> <span>{vals[7] || ''}</span> <span>{vals[6] || ''}</span> <span>{vals[5] || ''}</span> |
| | | <span>{vals[4] || ''}</span> <span>{vals[3] || ''}</span> <span>{vals[2] || ''}</span> <span>{vals[1] || ''}</span> <span className="last">{vals[0] || ''}</span> |
| | | </div> |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | class VoucherTable extends Component { |
| | | static propTpyes = { |
| | | config: PropTypes.object, // 菜单Id |
| | | data: PropTypes.any, // 表格数据 |
| | | loading: PropTypes.bool, // 表格加载中 |
| | | onChange: PropTypes.func, // 表格变动 |
| | | config: PropTypes.object, |
| | | data: PropTypes.any, |
| | | loading: PropTypes.bool, |
| | | onChange: PropTypes.func |
| | | } |
| | | |
| | | state = { |
| | | data: [], |
| | | edData: [], |
| | | tableId: '', // 表格ID |
| | | columns: null, // 显示列 |
| | | tableId: '', |
| | | columns: null, |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | |
| | | return item |
| | | }) |
| | | |
| | | let disabled = _data[0] && _data[0].$disabled ? true : false |
| | | |
| | | if (_data.length < 4) { |
| | | for (let i = _data.length - 1; i < 4; i++) { |
| | | _data.push({uuid: Utils.getguid(), index: i + 1, subject_voucher_text: '', subject_code: '', subject_name: '', debit: '', credit: ''}) |
| | | _data.push({uuid: Utils.getguid(), $disabled: disabled, index: i + 1, subject_voucher_text: '', subject_code: '', subject_name: '', debit: '', credit: ''}) |
| | | } |
| | | } |
| | | return _data |