|
@@ -5,7 +5,7 @@ const _ = require('lodash'); |
|
@@ -5,7 +5,7 @@ const _ = require('lodash'); |
5
|
const crypto = global.yoho.crypto;
|
5
|
const crypto = global.yoho.crypto;
|
6
|
|
6
|
|
7
|
const processInvoiceData = (orderInfo, mobile, addresslist) => {
|
7
|
const processInvoiceData = (orderInfo, mobile, addresslist) => {
|
8
|
- let invoices_title = '';
|
8
|
+ let invoices_title = false;
|
9
|
let invoices_type = '2';
|
9
|
let invoices_type = '2';
|
10
|
let addressId = orderInfo.addressId &&
|
10
|
let addressId = orderInfo.addressId &&
|
11
|
parseInt(crypto.encryption('', orderInfo.addressId), 10) || 0;
|
11
|
parseInt(crypto.encryption('', orderInfo.addressId), 10) || 0;
|
|
@@ -23,16 +23,18 @@ const processInvoiceData = (orderInfo, mobile, addresslist) => { |
|
@@ -23,16 +23,18 @@ const processInvoiceData = (orderInfo, mobile, addresslist) => { |
23
|
}
|
23
|
}
|
24
|
|
24
|
|
25
|
// 发票信息处理
|
25
|
// 发票信息处理
|
26
|
- if (orderInfo.invoiceType && orderInfo.invoices_title) {
|
26
|
+ if (orderInfo.invoices_type && orderInfo.invoices_title) {
|
27
|
invoices_title = orderInfo.invoices_title;
|
27
|
invoices_title = orderInfo.invoices_title;
|
28
|
invoices_type = orderInfo.invoices_type * 1;
|
28
|
invoices_type = orderInfo.invoices_type * 1;
|
29
|
}
|
29
|
}
|
30
|
|
30
|
|
|
|
31
|
+ let isCompany = invoices_title && invoices_title !== '个人';
|
|
|
32
|
+
|
31
|
return {
|
33
|
return {
|
32
|
phone: mobile ? mobile : '',
|
34
|
phone: mobile ? mobile : '',
|
33
|
completeTel: mobile,
|
35
|
completeTel: mobile,
|
34
|
- isCompany: invoices_title !== '个人',
|
|
|
35
|
- companyName: invoices_title === '个人' ? '个人(不可修改)' : invoices_title,
|
36
|
+ isCompany: isCompany,
|
|
|
37
|
+ companyName: isCompany ? invoices_title : '个人(不可修改)',
|
36
|
buyerTaxNumber: orderInfo.buyerTaxNumber,
|
38
|
buyerTaxNumber: orderInfo.buyerTaxNumber,
|
37
|
isPaper: invoices_type === 1,
|
39
|
isPaper: invoices_type === 1,
|
38
|
invoicesType: [
|
40
|
invoicesType: [
|
|
@@ -44,11 +46,11 @@ const processInvoiceData = (orderInfo, mobile, addresslist) => { |
|
@@ -44,11 +46,11 @@ const processInvoiceData = (orderInfo, mobile, addresslist) => { |
44
|
invoiceTitle: [
|
46
|
invoiceTitle: [
|
45
|
{
|
47
|
{
|
46
|
type: '个人',
|
48
|
type: '个人',
|
47
|
- choosed: invoices_title === '个人'
|
49
|
+ choosed: !isCompany
|
48
|
},
|
50
|
},
|
49
|
{
|
51
|
{
|
50
|
type: '单位',
|
52
|
type: '单位',
|
51
|
- choosed: invoices_title !== '个人'
|
53
|
+ choosed: isCompany
|
52
|
}
|
54
|
}
|
53
|
]
|
55
|
]
|
54
|
};
|
56
|
};
|