| | |
| | | subtype: card.subtype, |
| | | wrap: { name: '发票', width: card.width || 24, datatype: 'static' }, |
| | | style: { paddingLeft: '20px', paddingRight: '20px', paddingTop: '10px', paddingBottom: '10px' }, |
| | | setting: { interType: 'system' }, |
| | | setting: { interType: 'system', primaryKey: 'ID' }, |
| | | columns: [], |
| | | scripts: [], |
| | | buyer: { |
| | |
| | | // ['税率', 'tax_rate', 'Decimal(18,2)'], |
| | | ['一般纳税人税率', 'general_tax_rate', 'Decimal(18,2)'], |
| | | ['小规模纳税人征收率', 'small_tax_rate', 'Decimal(18,2)'], |
| | | ['是否享受优惠政策', 'free_tax_mark'], |
| | | ['优惠政策类型', 'vat_special_management'], |
| | | ] |
| | | |
| | | details.forEach((cell, index) => { |
| | |
| | | }) |
| | | |
| | | let cols = [ |
| | | ['ID', 'ID'], |
| | | ['开票申请单号', 'io'], |
| | | ['发票种类', 'invoice_type'], |
| | | ['购买方名称', 'from_to_name'], |
| | | ['购买方税号', 'from_to_tax_no'], |
| | |
| | | ['收款人', 'payee'], |
| | | ['复核人', 'reviewer'], |
| | | ['开票人', 'drawer'], |
| | | ['行号', 'invoice_lp'], |
| | | ['商品编码', 'productcode'], |
| | | ['商品名称', 'productname'], |
| | | ['规格型号', 'spec'], |
| | |
| | | this.updateComponent(_card) |
| | | } else { |
| | | let _card = fromJS(card).toJS() |
| | | |
| | | // _card.billSaveBtn = _card.billSaveBtn || {type: 'billsave', intertype: 'system', label: '保存单据'} |
| | | // _card.billOutBtn = _card.billOutBtn || {type: 'billout', intertype: 'custom', label: '提交开票', procMode: 'system'} |
| | | |
| | | this.setState({ |
| | | card: _card |
| | |
| | | |
| | | /* 发票主表字段 */ |
| | | |
| | | Declare @invoice_type Nvarchar(50), @from_to_name Nvarchar(50), @from_to_tax_no Nvarchar(50), @from_to_addr Nvarchar(100), @from_to_tel Nvarchar(50), @from_to_bank_name Nvarchar(50), @from_to_account_no Nvarchar(50), @from_to_mob Nvarchar(50), @from_to_email Nvarchar(50), @from_to_code Nvarchar(50), @orgname Nvarchar(50), @tax_no Nvarchar(50), @addr Nvarchar(100), @tel Nvarchar(50), @bank_name Nvarchar(50), @account_no Nvarchar(50), @remark Nvarchar(512), @payee Nvarchar(50), @reviewer Nvarchar(50), @drawer Nvarchar(50) |
| | | Declare @invoice_type Nvarchar(50), @from_to_name Nvarchar(50), @from_to_tax_no Nvarchar(50), @from_to_addr Nvarchar(100), @from_to_tel Nvarchar(50), @from_to_bank_name Nvarchar(50), @from_to_account_no Nvarchar(50), @from_to_mob Nvarchar(50), @from_to_email Nvarchar(50), @from_to_code Nvarchar(50), @orgname Nvarchar(50), @tax_no Nvarchar(50), @addr Nvarchar(100), @tel Nvarchar(50), @bank_name Nvarchar(50), @account_no Nvarchar(50), @remark Nvarchar(512), @payee Nvarchar(50), @reviewer Nvarchar(50), @drawer Nvarchar(50), @io Nvarchar(50), @orgcode Nvarchar(50), @total_net_amount Decimal(18,2), @total_tax Decimal(18,2), @total_amount Decimal(18,2) |
| | | |
| | | Select @invoice_type='', @from_to_name='', @from_to_tax_no='', @from_to_addr='', @from_to_tel='', @from_to_bank_name='', @from_to_account_no='', @from_to_mob='', @from_to_email='', @from_to_code='', @orgname='', @tax_no='', @addr='', @tel='', @bank_name='', @account_no='', @remark='', @payee='', @reviewer='', @drawer='' |
| | | Select @invoice_type='', @from_to_name='', @from_to_tax_no='', @from_to_addr='', @from_to_tel='', @from_to_bank_name='', @from_to_account_no='', @from_to_mob='', @from_to_email='', @from_to_code='', @orgname='', @tax_no='', @addr='', @tel='', @bank_name='', @account_no='', @remark='', @payee='', @reviewer='', @drawer='', @io='', @orgcode='', @total_net_amount=0, @total_tax=0, @total_amount=0 |
| | | |
| | | /* 发票明细临时表 */ |
| | | Declare @details_list table (productcode Nvarchar(50), productname Nvarchar(50), spec Nvarchar(50), unit Nvarchar(50), bill_count Decimal(18,10), unitprice Decimal(18,10), amount_line Decimal(18,2), tax_classify_code Nvarchar(50), tax_classify_name Nvarchar(50), tax_rate Decimal(18,2), tax_amount Decimal(18,2)) |
| | | Declare @details_list table (productcode Nvarchar(50), productname Nvarchar(50), spec Nvarchar(50), unit Nvarchar(50), bill_count Decimal(18,10), unitprice Decimal(18,10), amount_line Decimal(18,2), tax_classify_code Nvarchar(50), tax_classify_name Nvarchar(50), tax_rate Decimal(18,2), tax_amount Decimal(18,2), invoice_lp Nvarchar(50), jskey Nvarchar(50), data_type Nvarchar(50)) |
| | | |
| | | Insert into @details_list (productcode, productname, spec, unit, bill_count, unitprice, amount_line, tax_classify_code, tax_classify_name, tax_rate, tax_amount) |
| | | Insert into @details_list (productcode, productname, spec, unit, bill_count, unitprice, amount_line, tax_classify_code, tax_classify_name, tax_rate, tax_amount, invoice_lp, jskey, data_type) |
| | | |
| | | Select '', '', '', '', 0, 0, 0, '', '', 0, 0 |
| | | Select '', '', '', '', 0, 0, 0, '', '', 0, 0, '', '', '' |
| | | |
| | | ` |
| | | |
| | |
| | | </p> |
| | | <p className="note">{`/* 发票主表字段 */`}</p> |
| | | <p> |
| | | Declare @invoice_type Nvarchar(50), @from_to_name Nvarchar(50), @from_to_tax_no Nvarchar(50), @from_to_addr Nvarchar(100), @from_to_tel Nvarchar(50), @from_to_bank_name Nvarchar(50), @from_to_account_no Nvarchar(50), @from_to_mob Nvarchar(50), @from_to_email Nvarchar(50), @from_to_code Nvarchar(50), @orgname Nvarchar(50), @tax_no Nvarchar(50), @addr Nvarchar(100), @tel Nvarchar(50), @bank_name Nvarchar(50), @account_no Nvarchar(50), @remark Nvarchar(512), @payee Nvarchar(50), @reviewer Nvarchar(50), @drawer Nvarchar(50) |
| | | Declare @invoice_type Nvarchar(50), @from_to_name Nvarchar(50), @from_to_tax_no Nvarchar(50), @from_to_addr Nvarchar(100), @from_to_tel Nvarchar(50), @from_to_bank_name Nvarchar(50), @from_to_account_no Nvarchar(50), @from_to_mob Nvarchar(50), @from_to_email Nvarchar(50), @from_to_code Nvarchar(50), @orgname Nvarchar(50), @tax_no Nvarchar(50), @addr Nvarchar(100), @tel Nvarchar(50), @bank_name Nvarchar(50), @account_no Nvarchar(50), @remark Nvarchar(512), @payee Nvarchar(50), @reviewer Nvarchar(50), @drawer Nvarchar(50), @io Nvarchar(50), @orgcode Nvarchar(50), @total_net_amount Decimal(18,2), @total_tax Decimal(18,2), @total_amount Decimal(18,2) |
| | | </p> |
| | | <p> |
| | | Select @invoice_type='', @from_to_name='', @from_to_tax_no='', @from_to_addr='', @from_to_tel='', @from_to_bank_name='', @from_to_account_no='', @from_to_mob='', @from_to_email='', @from_to_code='', @orgname='', @tax_no='', @addr='', @tel='', @bank_name='', @account_no='', @remark='', @payee='', @reviewer='', @drawer='' |
| | | Select @invoice_type='', @from_to_name='', @from_to_tax_no='', @from_to_addr='', @from_to_tel='', @from_to_bank_name='', @from_to_account_no='', @from_to_mob='', @from_to_email='', @from_to_code='', @orgname='', @tax_no='', @addr='', @tel='', @bank_name='', @account_no='', @remark='', @payee='', @reviewer='', @drawer='', @io='', @orgcode='', @total_net_amount=0, @total_tax=0, @total_amount=0 |
| | | </p> |
| | | <p className="note">{`/* 发票明细临时表 */`}</p> |
| | | <p> |
| | | Declare @details_list table (productcode Nvarchar(50), productname Nvarchar(50), spec Nvarchar(50), unit Nvarchar(50), bill_count Decimal(18,10), unitprice Decimal(18,10), amount_line Decimal(18,2), tax_classify_code Nvarchar(50), tax_classify_name Nvarchar(50), tax_rate Decimal(18,2), tax_amount Decimal(18,2)) |
| | | Declare @details_list table (productcode Nvarchar(50), productname Nvarchar(50), spec Nvarchar(50), unit Nvarchar(50), bill_count Decimal(18,10), unitprice Decimal(18,10), amount_line Decimal(18,2), tax_classify_code Nvarchar(50), tax_classify_name Nvarchar(50), tax_rate Decimal(18,2), tax_amount Decimal(18,2), invoice_lp Nvarchar(50), jskey Nvarchar(50), data_type Nvarchar(50)) |
| | | </p> |
| | | <p> |
| | | Insert into @details_list (productcode, productname, spec, unit, bill_count, unitprice, amount_line, tax_classify_code, tax_classify_name, tax_rate, tax_amount) |
| | | Insert into @details_list (productcode, productname, spec, unit, bill_count, unitprice, amount_line, tax_classify_code, tax_classify_name, tax_rate, tax_amount, invoice_lp, jskey, data_type) |
| | | </p> |
| | | <p> |
| | | Select '', '', '', '', 0, 0, 0, '', '', 0, 0 |
| | | Select '', '', '', '', 0, 0, 0, '', '', 0, 0, '', '', '' |
| | | </p> |
| | | <p className="note">{`/* 前置脚本 */`}</p> |
| | | <p> |
| | |
| | | |
| | | state = { |
| | | BID: '', |
| | | ID: Utils.getuuid(), |
| | | io: '', |
| | | invTypes: [ |
| | | {value: '1', label: '电子发票(增值税专用发票)'}, |
| | | {value: '2', label: '电子发票(普通发票)'}, |
| | |
| | | reviewer: '', |
| | | drawer: '', |
| | | details: [], |
| | | oriDetails: [], |
| | | book: null, |
| | | loading: false, |
| | | saveType: '', |
| | |
| | | cell.field = 'tax_rate' |
| | | cell.label = '税率' |
| | | } |
| | | if (['Description', 'id', 'small_tax_rate'].includes(cell.field)) { |
| | | if (['Description', 'id', 'small_tax_rate', 'free_tax_mark', 'vat_special_management'].includes(cell.field)) { |
| | | cell.Hide = 'true' |
| | | } else if (['spec'].includes(cell.field)) { |
| | | cell.Width = 150 |
| | |
| | | if (result.status) { |
| | | |
| | | this.setState({ |
| | | ID: result.data[0][config.setting.primaryKey] || Utils.getuuid(), |
| | | io: '', |
| | | details: [], |
| | | oriDetails: [], |
| | | loading: false |
| | | }) |
| | | |
| | |
| | | } |
| | | |
| | | saveBill = () => { |
| | | const { config, saveType } = this.state |
| | | const { config, book, saveType } = this.state |
| | | |
| | | if (saveType) return |
| | | |
| | |
| | | LText: sql, |
| | | exec_type: window.GLOB.execType || 'y', |
| | | timestamp: moment().format('YYYY-MM-DD HH:mm:ss'), |
| | | BID: book.id |
| | | } |
| | | |
| | | param.secretkey = Utils.encrypt('', param.timestamp) |
| | |
| | | } |
| | | |
| | | outBill = () => { |
| | | const { config, saveType } = this.state |
| | | const { config, book, saveType } = this.state |
| | | |
| | | if (saveType) return |
| | | |
| | |
| | | |
| | | let param = { |
| | | func: 'sPC_TableData_InUpDe', |
| | | // BID: BID || '', |
| | | LText: sql, |
| | | key_back_type: 'Y', |
| | | exec_type: window.GLOB.execType || 'y', |
| | | timestamp: moment().format('YYYY-MM-DD HH:mm:ss'), |
| | | BID: book.id |
| | | } |
| | | |
| | | param.secretkey = Utils.encrypt('', param.timestamp) |
| | |
| | | } |
| | | |
| | | getPreSql = (btn) => { |
| | | const { book, details, invoice_type, from_to_name, from_to_tax_no, from_to_addr, from_to_tel, from_to_bank_name, from_to_account_no, from_to_mob, from_to_email, from_to_code, orgname, tax_no, addr, tel, bank_name, account_no, remark, reviewer, drawer, payee } = this.state |
| | | const { book, ID, io, details, oriDetails, invoice_type, from_to_name, from_to_tax_no, from_to_addr, from_to_tel, from_to_bank_name, from_to_account_no, from_to_mob, from_to_email, from_to_code, orgname, tax_no, addr, tel, bank_name, account_no, remark, reviewer, drawer, payee } = this.state |
| | | |
| | | let BID = book.id |
| | | let userName = sessionStorage.getItem('User_Name') || '' |
| | | let fullName = sessionStorage.getItem('Full_Name') || '' |
| | | let RoleID = sessionStorage.getItem('role_id') || '' |
| | |
| | | let city = sessionStorage.getItem('city') || '' |
| | | let district = sessionStorage.getItem('district') || '' |
| | | let address = sessionStorage.getItem('address') || '' |
| | | let options = fromJS(oriDetails).toJS() |
| | | let price = 0 |
| | | let tax = 0 |
| | | |
| | | let lines = details.map(line => `Select '${line.productcode}', '${line.productname}', '${line.spec}', '${line.unit}', ${line.bill_count}, ${line.unitprice}, ${line.amount_line}, '${line.tax_classify_code}', '${line.tax_classify_name}', ${line.tax_rate}, ${line.tax_amount}`) |
| | | let lines = details.map(line => { |
| | | let _sql = `Select '${line.productcode}', '${line.productname}', '${line.spec}', '${line.unit}', ${line.bill_count}, ${line.unitprice}, ${line.amount_line}, '${line.tax_classify_code}', '${line.tax_classify_name}', ${line.tax_rate}, ${line.tax_amount}, '${line.invoice_lp || ''}', '${line.uuid}'` |
| | | let data_type = 'add' |
| | | |
| | | price += line.amount_line * 100 |
| | | tax += line.tax_amount * 100 |
| | | |
| | | if (options.length) { |
| | | options = options.filter(option => { |
| | | if (option.uuid === line.uuid) { |
| | | data_type = 'upt' |
| | | return false |
| | | } |
| | | return true |
| | | }) |
| | | } |
| | | |
| | | return _sql + `, '${data_type}'` |
| | | }) |
| | | |
| | | let _total = (price - tax) / 100 |
| | | price = price / 100 |
| | | tax = tax / 100 |
| | | |
| | | if (options.length) { |
| | | options.forEach(line => { |
| | | lines.push(`Select '${line.productcode}', '${line.productname}', '${line.spec}', '${line.unit}', ${line.bill_count}, ${line.unitprice}, ${line.amount_line}, '${line.tax_classify_code}', '${line.tax_classify_name}', ${line.tax_rate}, ${line.tax_amount}, '${line.invoice_lp || ''}', '${line.uuid}', 'del'`) |
| | | }) |
| | | } |
| | | |
| | | lines = lines.join(' union all ') |
| | | |
| | | let _script = '' |
| | |
| | | Select @UserName='${userName}', @FullName='${fullName}', @RoleID='${RoleID}', @mk_departmentcode='${departmentcode}', @mk_organization='${organization}', @mk_user_type='${mk_user_type}', @mk_nation='${nation}', @mk_province='${province}', @mk_city='${city}', @mk_district='${district}', @mk_address='${address}', @ErrorCode='', @retmsg='', @account_id='${book.account_id || ''}', @account_year_id='${book.account_year_id || ''}', @account_code='${book.account_code || ''}', @account_year_code='${book.account_year_code || ''}', @bid='' |
| | | |
| | | /* 发票主表字段 */ |
| | | Declare @invoice_type Nvarchar(50), @from_to_name Nvarchar(50), @from_to_tax_no Nvarchar(50), @from_to_addr Nvarchar(100), @from_to_tel Nvarchar(50), @from_to_bank_name Nvarchar(50), @from_to_account_no Nvarchar(50), @from_to_mob Nvarchar(50), @from_to_email Nvarchar(50), @from_to_code Nvarchar(50), @orgname Nvarchar(50), @tax_no Nvarchar(50), @addr Nvarchar(100), @tel Nvarchar(50), @bank_name Nvarchar(50), @account_no Nvarchar(50), @remark Nvarchar(512), @payee Nvarchar(50), @reviewer Nvarchar(50), @drawer Nvarchar(50) |
| | | Declare @invoice_type Nvarchar(50), @from_to_name Nvarchar(50), @from_to_tax_no Nvarchar(50), @from_to_addr Nvarchar(100), @from_to_tel Nvarchar(50), @from_to_bank_name Nvarchar(50), @from_to_account_no Nvarchar(50), @from_to_mob Nvarchar(50), @from_to_email Nvarchar(50), @from_to_code Nvarchar(50), @orgname Nvarchar(50), @tax_no Nvarchar(50), @addr Nvarchar(100), @tel Nvarchar(50), @bank_name Nvarchar(50), @account_no Nvarchar(50), @remark Nvarchar(512), @payee Nvarchar(50), @reviewer Nvarchar(50), @drawer Nvarchar(50), @io Nvarchar(50), @orgcode Nvarchar(50), @total_net_amount Decimal(18,2), @total_tax Decimal(18,2), @total_amount Decimal(18,2) |
| | | |
| | | Select @invoice_type='${invoice_type}', @from_to_name='${from_to_name}', @from_to_tax_no='${from_to_tax_no}', @from_to_addr='${from_to_addr}', @from_to_tel='${from_to_tel}', @from_to_bank_name='${from_to_bank_name}', @from_to_account_no='${from_to_account_no}', @from_to_mob='${from_to_mob}', @from_to_email='${from_to_email}', @from_to_code='${from_to_code}', @orgname='${orgname}', @tax_no='${tax_no}', @addr='${addr}', @tel='${tel}', @bank_name='${bank_name}', @account_no='${account_no}', @remark='${remark}', @payee='${payee}', @reviewer='${reviewer}', @drawer='${drawer}' |
| | | Select @invoice_type='${invoice_type}', @from_to_name='${from_to_name}', @from_to_tax_no='${from_to_tax_no}', @from_to_addr='${from_to_addr}', @from_to_tel='${from_to_tel}', @from_to_bank_name='${from_to_bank_name}', @from_to_account_no='${from_to_account_no}', @from_to_mob='${from_to_mob}', @from_to_email='${from_to_email}', @from_to_code='${from_to_code}', @orgname='${orgname}', @tax_no='${tax_no}', @addr='${addr}', @tel='${tel}', @bank_name='${bank_name}', @account_no='${account_no}', @remark='${remark}', @payee='${payee}', @reviewer='${reviewer}', @drawer='${drawer}', @io='${io}', @orgcode='${book.orgcode || ''}', @total_net_amount=${_total}, @total_tax=${tax}, @total_amount=${price} |
| | | |
| | | /* 发票明细临时表 */ |
| | | |
| | | Declare @details_list table (productcode Nvarchar(50), productname Nvarchar(50), spec Nvarchar(50), unit Nvarchar(50), bill_count Decimal(18,10), unitprice Decimal(18,10), amount_line Decimal(18,2), tax_classify_code Nvarchar(50), tax_classify_name Nvarchar(50), tax_rate Decimal(18,2), tax_amount Decimal(18,2)) |
| | | Declare @details_list table (productcode Nvarchar(50), productname Nvarchar(50), spec Nvarchar(50), unit Nvarchar(50), bill_count Decimal(18,10), unitprice Decimal(18,10), amount_line Decimal(18,2), tax_classify_code Nvarchar(50), tax_classify_name Nvarchar(50), tax_rate Decimal(18,2), tax_amount Decimal(18,2), invoice_lp Nvarchar(50), jskey Nvarchar(50), data_type Nvarchar(50)) |
| | | |
| | | Insert into @details_list (productcode, productname, spec, unit, bill_count, unitprice, amount_line, tax_classify_code, tax_classify_name, tax_rate, tax_amount) |
| | | Insert into @details_list (productcode, productname, spec, unit, bill_count, unitprice, amount_line, tax_classify_code, tax_classify_name, tax_rate, tax_amount, invoice_lp, jskey, data_type) |
| | | |
| | | ${lines} |
| | | |
| | |
| | | |
| | | aaa: select @ErrorCode as ErrorCode,@retmsg as retmsg` |
| | | |
| | | sql = sql.replace(/@ID@/ig, `''`) |
| | | sql = sql.replace(/@BID@/ig, `''`) |
| | | sql = sql.replace(/@ID@/ig, `'${ID}'`) |
| | | sql = sql.replace(/@BID@/ig, `'${BID}'`) |
| | | sql = sql.replace(/@LoginUID@/ig, `'${sessionStorage.getItem('LoginUID') || ''}'`) |
| | | sql = sql.replace(/@SessionUid@/ig, `'${localStorage.getItem('SessionUid') || ''}'`) |
| | | sql = sql.replace(/@UserID@/ig, `'${sessionStorage.getItem('UserID') || ''}'`) |
| | |
| | | |
| | | if (['bill_count', 'unitprice', 'amount_line'].includes(key)) { |
| | | line[key] = value || 0 |
| | | if (isNaN(line[key])) { |
| | | line[key] = 0 |
| | | } |
| | | if (line[key]) { |
| | | if (key === 'bill_count') { |
| | | line[key] = Math.round(line[key] * 10000000000) / 10000000000 |
| | |
| | | line.bill_count = Math.round(line.amount_line / line.unitprice * 10000000000) / 10000000000 |
| | | } |
| | | } |
| | | } else if (key === 'amount_line') { |
| | | line.bill_count = 0 |
| | | } |
| | | |
| | | if (line.amount_line) { |
| | |
| | | <Input defaultValue={line.unit || ''} onChange={(e) => this.onChange(e.target.value, 'unit')}/> |
| | | </div> |
| | | <div className="mk-td"> |
| | | <InputNumber value={bill_count} onChange={(val) => this.setState({bill_count: val})} onBlur={(e) => this.onChange(e.target.value, 'bill_count')}/> |
| | | <InputNumber value={bill_count} formatter={value => `${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')} parser={value => value.replace(/,*/g, '')} onChange={(val) => this.setState({bill_count: val})} onBlur={() => this.onChange(bill_count, 'bill_count')}/> |
| | | </div> |
| | | <div className="mk-td"> |
| | | <InputNumber value={unitprice} onChange={(val) => this.setState({unitprice: val})} onBlur={(e) => this.onChange(e.target.value, 'unitprice')}/> |
| | | <InputNumber value={unitprice} formatter={value => `${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')} parser={value => value.replace(/,*/g, '')} onChange={(val) => this.setState({unitprice: val})} onBlur={() => this.onChange(unitprice, 'unitprice')}/> |
| | | </div> |
| | | <div className="mk-td"> |
| | | <InputNumber value={amount_line} onChange={(val) => this.setState({amount_line: val})} onBlur={(e) => this.onChange(e.target.value, 'amount_line')}/> |
| | | <InputNumber value={amount_line} formatter={value => `${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')} parser={value => value.replace(/,*/g, '')} onChange={(val) => this.setState({amount_line: val})} onBlur={() => this.onChange(amount_line, 'amount_line')}/> |
| | | </div> |
| | | <div className="mk-td mk-right">{line.tax_name}</div> |
| | | <div className="mk-td mk-right">{line.tax_amount.toFixed(2)} <span className="del-line" onClick={() => delLine(line.uuid)}></span> </div> |
| | | <div className="mk-td mk-right">{line.tax_amount.toFixed(2).replace(/\B(?=(\d{3})+(?!\d))/g, ',')} <span className="del-line" onClick={() => delLine(line.uuid)}></span> </div> |
| | | </div> |
| | | } |
| | | } |
| | |
| | | data.forEach(item => { |
| | | if (!item.productcode) return |
| | | |
| | | price += item.amount_line |
| | | tax += item.tax_amount |
| | | price += item.amount_line * 100 |
| | | tax += item.tax_amount * 100 |
| | | }) |
| | | |
| | | price = price / 100 |
| | | tax = tax / 100 |
| | | |
| | | this.setState({total: {price, tax, sum: price, sumName: this.changeMoneyToChinese(price)}}) |
| | | } |
| | |
| | | item.tax_rate = prod.tax_rate || 0 |
| | | item.tax_name = prod.tax_rate * 100 + '%' |
| | | |
| | | if (prod.vat_special_management && prod.free_tax_mark === 'true') { |
| | | item.tax_name = prod.vat_special_management |
| | | } |
| | | |
| | | item.productcode = prod.productcode |
| | | item.Description = prod.Description |
| | | item.tax_classify_code = prod.tax_classify_code |
| | |
| | | } |
| | | |
| | | return <div className="mk-tr" key={item.uuid} onClick={() => this.checkLine(item.uuid)}> |
| | | <div className="mk-td mk-left">{item.productname || '**'}</div> |
| | | <div className="mk-td mk-left">{item.productname || ''}</div> |
| | | <div className="mk-td mk-left">{item.spec || ''}</div> |
| | | <div className="mk-td mk-left">{item.unit || ''}</div> |
| | | <div className="mk-td mk-right">{item.bill_count || ''}</div> |
| | | <div className="mk-td mk-right">{item.unitprice || ''}</div> |
| | | <div className="mk-td mk-right">{item.amount_line || ''}</div> |
| | | <div className="mk-td mk-right">{`${item.bill_count || ''}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')}</div> |
| | | <div className="mk-td mk-right">{`${item.unitprice || ''}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')}</div> |
| | | <div className="mk-td mk-right">{`${item.amount_line || ''}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')}</div> |
| | | <div className="mk-td mk-right">{item.tax_name}</div> |
| | | <div className="mk-td mk-right">{item.tax_amount.toFixed(2)}</div> |
| | | <div className="mk-td mk-right">{item.tax_amount.toFixed(2).replace(/\B(?=(\d{3})+(?!\d))/g, ',')}<span className="del-line" onClick={() => this.delLine(item.uuid)}></span></div> |
| | | </div> |
| | | })} |
| | | <div className="mk-total"> |
| | |
| | | <div className="mk-td"></div> |
| | | <div className="mk-td"></div> |
| | | <div className="mk-td"></div> |
| | | <div className="mk-td">¥{total.price}</div> |
| | | <div className="mk-td">¥{`${total.price}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')}</div> |
| | | <div className="mk-td"></div> |
| | | <div className="mk-td">¥{total.tax}</div> |
| | | <div className="mk-td">¥{`${total.tax}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')}</div> |
| | | </div> |
| | | <div className="mk-upcase"> |
| | | <div className="mk-td">价税合计(大写)</div> |
| | | <div className="mk-td">{total.sumName}</div> |
| | | <div className="mk-td">(小写)¥{total.sum}</div> |
| | | <div className="mk-td">(小写)¥{`${total.sum}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')}</div> |
| | | </div> |
| | | <Modal |
| | | title="商品信息" |
| | |
| | | right: -40px; |
| | | top: 5px; |
| | | font-size: 26px; |
| | | border: 1px solid #d9d9d9; |
| | | border-radius: 32px; |
| | | border: 1px solid var(--inv-color, #13509c); |
| | | width: 30px; |
| | | height: 30px; |
| | | transition: all 0.3s; |
| | |
| | | top: 13px; |
| | | width: 12px; |
| | | height: 1px; |
| | | background: #b8b8b8; |
| | | background: var(--inv-color, #13509c); |
| | | transition: all 0.3s; |
| | | } |
| | | .plus-line::after { |
| | |
| | | top: 13px; |
| | | width: 12px; |
| | | height: 1px; |
| | | background: #b8b8b8; |
| | | background: var(--inv-color, #13509c); |
| | | transform: rotate(90deg); |
| | | transition: all 0.3s; |
| | | } |
| | | .plus-line:hover { |
| | | border-color: #26C281; |
| | | |
| | | .del-line { |
| | | display: none; |
| | | } |
| | | .plus-line:hover::before, .plus-line:hover::after { |
| | | background: #26C281; |
| | | } |
| | | .del-line:hover { |
| | | border-color: #ff4d4f; |
| | | } |
| | | .del-line:hover::before { |
| | | background: #ff4d4f; |
| | | .mk-tr:hover { |
| | | .del-line { |
| | | display: flex; |
| | | } |
| | | .del-line::after { |
| | | content: ' '; |
| | | position: absolute; |
| | | top: -6px; |
| | | width: 12px; |
| | | height: 40px; |
| | | left: -12px; |
| | | } |
| | | } |
| | | |
| | | .mk-th, .mk-tr, .mk-total { |
| | |
| | | } |
| | | } |
| | | |
| | | if (val !== '') { |
| | | if (col.prefix) { |
| | | val = col.prefix + val |
| | | } |
| | | if (col.postfix) { |
| | | val = val + col.postfix |
| | | } |
| | | } |
| | | |
| | | _row[col.Column] = val |
| | | }) |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | if (val !== '') { |
| | | if (col.prefix) { |
| | | val = col.prefix + val |
| | | } |
| | | if (col.postfix) { |
| | | val = val + col.postfix |
| | | } |
| | | } |
| | | |
| | | _row[col.Column] = val |
| | | }) |
| | | |
| | |
| | | render() { |
| | | const { config } = this.props |
| | | const { value, precision } = this.state |
| | | |
| | | if (precision === null) { |
| | | |
| | | if (config.format === 'thdSeparator') { |
| | | if (precision === null) { |
| | | return (<InputNumber id={config.uuid} formatter={value => `${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')} parser={value => value.replace(/,*/g, '')} value={value} disabled={config.readonly} onChange={this.handleChange} onPressEnter={this.handleSubmit}/>) |
| | | } else { |
| | | return (<InputNumber id={config.uuid} formatter={value => `${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')} parser={value => value.replace(/,*/g, '')} value={value} precision={precision} disabled={config.readonly} onChange={this.handleChange} onPressEnter={this.handleSubmit} />) |
| | | } |
| | | } else if (precision === null) { |
| | | return (<InputNumber id={config.uuid} value={value} disabled={config.readonly} onChange={this.handleChange} onPressEnter={this.handleSubmit}/>) |
| | | } else { |
| | | return (<InputNumber id={config.uuid} value={value} precision={precision} disabled={config.readonly} onChange={this.handleChange} onPressEnter={this.handleSubmit} />) |
| | | } |
| | | // <InputNumber |
| | | // id={config.uuid} |
| | | // formatter={value => `${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')} |
| | | // parser={value => value.replace(/,*/g, '')} |
| | | // value={value} |
| | | // precision={precision} |
| | | // disabled={config.readonly} |
| | | // onChange={this.handleChange} |
| | | // onPressEnter={this.handleSubmit} |
| | | // /> |
| | | } |
| | | } |
| | | |
| | |
| | | val += '格式化:百分比;' |
| | | } |
| | | } |
| | | if (record.prefix) { |
| | | val += `前缀:${record.prefix};` |
| | | } |
| | | if (record.postfix) { |
| | | val += `后缀:${record.postfix};` |
| | | } |
| | | |
| | | return <div>{val}<EditOutlined className="edit-other" onClick={() => {this.setState({visible: true, line: fromJS(record).toJS()})}} /></div> |
| | | } else if (record.type === 'text') { |
| | |
| | | } else if (record.textFormat === 'YYYY-MM-DD HH:mm:ss') { |
| | | val += '格式化:YYYY-MM-DD HH:mm:ss;' |
| | | } |
| | | } |
| | | if (record.prefix) { |
| | | val += `前缀:${record.prefix};` |
| | | } |
| | | if (record.postfix) { |
| | | val += `后缀:${record.postfix};` |
| | | } |
| | | |
| | | return <div>{val}<EditOutlined className="edit-other" onClick={() => {this.setState({visible: true, line: fromJS(record).toJS()})}} /></div> |
| | |
| | | onCancel={() => {this.setState({visible: false, line: null})}} |
| | | destroyOnClose |
| | | > |
| | | <OtherForm line={line} onChange={(values) => this.setState({line: values})}/> |
| | | <OtherForm line={line} submit={this.lineSubmit} onChange={(values) => this.setState({line: values})}/> |
| | | </Modal> |
| | | </div> |
| | | ) |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { Form, Row, Col, Radio, Tooltip, Select } from 'antd' |
| | | import { Form, Row, Col, Radio, Tooltip, Select, Input } from 'antd' |
| | | import { QuestionCircleOutlined } from '@ant-design/icons' |
| | | // import './index.scss' |
| | | |
| | |
| | | )} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | <Col span={8}> |
| | | <Form.Item label="前缀"> |
| | | {getFieldDecorator('prefix', { |
| | | initialValue: line.prefix || '' |
| | | })( |
| | | <Input autoComplete="off" onChange={(e) => this.onChange('prefix', e.target.value)} onPressEnter={this.props.submit}/> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={8}> |
| | | <Form.Item label="后缀"> |
| | | {getFieldDecorator('postfix', { |
| | | initialValue: line.postfix || '' |
| | | })( |
| | | <Input autoComplete="off" onChange={(e) => this.onChange('postfix', e.target.value)} onPressEnter={this.props.submit}/> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | </Row> |
| | | </Form> |
| | | ) |
| | |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'format', |
| | | label: '格式化', |
| | | tooltip: '使用千分位时,数值将以千分位格式显示,提交时为原数值。', |
| | | initVal: card.format || '', |
| | | forbid: appType === 'mob', |
| | | options: [{ |
| | | value: '', |
| | | text: '无' |
| | | }, { |
| | | value: 'thdSeparator', |
| | | text: '千分位' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'colorType', |
| | | label: '颜色类型', |
| | | initVal: card.colorType || 'hex', |
| | |
| | | |
| | | const modalTypeOptions = { |
| | | text: ['initval', 'readonly', 'required', 'hidden', 'readin', 'fieldlength', 'regular', 'interception', 'span', 'labelwidth', 'encryption', 'tooltip', 'extra', 'enter', 'cursor', 'scan', 'splitline', 'placeholder', 'place', 'marginTop', 'marginBottom', 'lenControl', 'inputType', 'constant', 'mkfocus'], |
| | | number: ['initval', 'readonly', 'hidden', 'decimal', 'min', 'max', 'readin', 'span', 'labelwidth', 'tooltip', 'extra', 'enter', 'cursor', 'splitline', 'place', 'marginTop', 'marginBottom', 'mkfocus'], |
| | | number: ['initval', 'readonly', 'hidden', 'decimal', 'min', 'max', 'readin', 'span', 'labelwidth', 'tooltip', 'extra', 'enter', 'cursor', 'splitline', 'place', 'marginTop', 'marginBottom', 'mkfocus', 'format'], |
| | | select: ['initval', 'readonly', 'required', 'hidden', 'readin', 'resourceType', 'declare', 'linkSubField', 'span', 'labelwidth', 'tooltip', 'extra', 'place', 'enter', 'splitline', 'dropdown', 'marginTop', 'marginBottom', 'pickerMode'], |
| | | checkbox: ['initval', 'readonly', 'required', 'hidden', 'readin', 'resourceType', 'fieldlength', 'span', 'labelwidth', 'tooltip', 'extra', 'place', 'splitline', 'arrange', 'marginTop', 'marginBottom'], |
| | | radio: ['initval', 'readonly', 'required', 'hidden', 'readin', 'resourceType', 'declare', 'linkSubField', 'span', 'labelwidth', 'tooltip', 'extra', 'place', 'splitline', 'arrange', 'marginTop', 'marginBottom'], |