mirror of
https://gitee.com/ShopeX/ECShopX_mobile-frontend
synced 2026-08-14 17:41:45 +08:00
发票恩替修复
This commit is contained in:
@@ -15,6 +15,7 @@ const initialState = {
|
||||
invoice_type_code: '02', // 01:数电票(增值税专用发票) 02:数电票(普通发票)
|
||||
invoice_type: 'individual', // individual:个人 enterprise:企业
|
||||
company_title: '', // 抬头名称
|
||||
individual_title: '', // 个人抬头
|
||||
company_tax_number: '', // 公司税号
|
||||
company_address: '', // 公司地址
|
||||
company_telephone: '', // 公司电话
|
||||
@@ -63,10 +64,11 @@ function Invoice(props) {
|
||||
const params = Taro.getStorageSync('invoice_params')
|
||||
console.log('params:', params)
|
||||
if (params && Object.keys(params).length > 0) {
|
||||
const invoiceParams = {
|
||||
let invoiceParams = {
|
||||
invoice_type_code: params?.invoice_type_code || '02',
|
||||
invoice_type: params?.invoice_type || 'individual',
|
||||
company_title: params?.company_title || '',
|
||||
company_title: params?.invoice_type == 'enterprise' ? params?.company_title : '',
|
||||
individual_title: params?.invoice_type != 'enterprise' ? params?.company_title : '',
|
||||
company_tax_number: params?.company_tax_number || '',
|
||||
company_address: params?.company_address || '',
|
||||
company_telephone: params?.company_telephone || '',
|
||||
@@ -74,6 +76,7 @@ function Invoice(props) {
|
||||
bank_account: params?.bank_account || '',
|
||||
email: params?.email || ''
|
||||
}
|
||||
|
||||
setState((draft) => {
|
||||
draft.info = invoiceParams
|
||||
})
|
||||
@@ -106,12 +109,13 @@ function Invoice(props) {
|
||||
let nInfo = {
|
||||
invoice_type: type == 0 ? 'enterprise' : 'individual',
|
||||
invoice_type_code: info.invoice_type_code,
|
||||
company_title: title,
|
||||
email: info?.email
|
||||
}
|
||||
if (type == 0) {
|
||||
nInfo = {
|
||||
...nInfo,
|
||||
company_title: title,
|
||||
individual_title: info?.individual_title,
|
||||
company_tax_number: taxNumber,
|
||||
company_address: companyAddress,
|
||||
company_telephone: telephone,
|
||||
@@ -121,6 +125,8 @@ function Invoice(props) {
|
||||
} else {
|
||||
nInfo = {
|
||||
...nInfo,
|
||||
company_title: info?.company_title,
|
||||
individual_title: title,
|
||||
invoice_type_code: '02'
|
||||
}
|
||||
}
|
||||
@@ -146,7 +152,8 @@ function Invoice(props) {
|
||||
let params = {
|
||||
invoice_type_code: info?.invoice_type_code,
|
||||
invoice_type: info?.invoice_type,
|
||||
company_title: info?.company_title,
|
||||
company_title:
|
||||
info?.invoice_type == 'enterprise' ? info?.company_title : info.individual_title,
|
||||
email: info?.email
|
||||
}
|
||||
if (params.invoice_type === 'enterprise') {
|
||||
@@ -197,7 +204,7 @@ function Invoice(props) {
|
||||
|
||||
const isFull = () => {
|
||||
if (info?.invoice_type === 'individual') {
|
||||
return info?.company_title && info?.email
|
||||
return info?.individual_title && info?.email
|
||||
} else if (info?.invoice_type === 'enterprise') {
|
||||
return info?.company_title && info?.company_tax_number && info?.email
|
||||
}
|
||||
@@ -321,11 +328,11 @@ function Invoice(props) {
|
||||
{info?.invoice_type === 'individual' && (
|
||||
<SpCell title='抬头名称'>
|
||||
<AtInput
|
||||
name='company_title'
|
||||
value={info?.company_title}
|
||||
name='individual_title'
|
||||
value={info?.individual_title}
|
||||
placeholder='必填'
|
||||
placeholderClass='input-placeholder'
|
||||
onChange={(e) => handleChange('company_title', e)}
|
||||
onChange={(e) => handleChange('individual_title', e)}
|
||||
/>
|
||||
</SpCell>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user