Authored by 郭成尧

invoice-modified

... ... @@ -5,7 +5,7 @@ const _ = require('lodash');
const crypto = global.yoho.crypto;
const processInvoiceData = (orderInfo, mobile, addresslist) => {
let invoices_title = '';
let invoices_title = false;
let invoices_type = '2';
let addressId = orderInfo.addressId &&
parseInt(crypto.encryption('', orderInfo.addressId), 10) || 0;
... ... @@ -23,16 +23,18 @@ const processInvoiceData = (orderInfo, mobile, addresslist) => {
}
// 发票信息处理
if (orderInfo.invoiceType && orderInfo.invoices_title) {
if (orderInfo.invoices_type && orderInfo.invoices_title) {
invoices_title = orderInfo.invoices_title;
invoices_type = orderInfo.invoices_type * 1;
}
let isCompany = invoices_title && invoices_title !== '个人';
return {
phone: mobile ? mobile : '',
completeTel: mobile,
isCompany: invoices_title !== '个人',
companyName: invoices_title === '个人' ? '个人(不可修改)' : invoices_title,
isCompany: isCompany,
companyName: isCompany ? invoices_title : '个人(不可修改)',
buyerTaxNumber: orderInfo.buyerTaxNumber,
isPaper: invoices_type === 1,
invoicesType: [
... ... @@ -44,11 +46,11 @@ const processInvoiceData = (orderInfo, mobile, addresslist) => {
invoiceTitle: [
{
type: '个人',
choosed: invoices_title === '个人'
choosed: !isCompany
},
{
type: '单位',
choosed: invoices_title !== '个人'
choosed: isCompany
}
]
};
... ...
... ... @@ -122,9 +122,9 @@ function confirmAction() {
}
}, function() {
orderInfo('invoices_type', eInvoiceType);
orderInfo('invoices_title', company);
orderInfo('invoices_title', title === '单位' ? company : '');
orderInfo('receiverMobile', tel);
orderInfo('buyerTaxNumber', buyerTaxNumber);
orderInfo('buyerTaxNumber', title === '单位' ? buyerTaxNumber : '');
if (isModifyTel && $copyTel !== tel) {
orderInfo('isModifyTel', true);
... ...