Authored by 张丽霞

电子发票数据组装

... ... @@ -427,37 +427,37 @@
<span class="invoice-list-type">发票内容</span>
<div class="invoice-line first-line">
<div class="blind">
<input checked="true" type="radio" value="1" name="content" />
<input checked="true" type="radio" value="服饰" name="content"/>
<label>服饰</label>
</div>
<div class="blind">
<input type="radio" value="2" name="content" />
<input type="radio" value="图书" name="content"/>
<label>图书</label>
</div>
<div class="blind">
<input type="radio" value="3" name="content" />
<input type="radio" value="配件" name="content"/>
<label>配件</label>
</div>
<div class="blind">
<input type="radio" value="4" name="content" />
<input type="radio" value="日用品" name="content"/>
<label>日用品</label>
</div class="blind">
<div class="blind">
<input type="radio" value="5" name="content" />
<input type="radio" value="办公用品" name="content"/>
<label>办公用品</label>
</div>
<div class="blind">
<input type="radio" value="6" name="content" />
<input type="radio" value="体育用品" name="content"/>
<label>体育用品</label>
</div>
<div class="blind">
<input type="radio" value="7" name="content" />
<input type="radio" value="数码产品" name="content"/>
<label>数码产品</label>
</div>
</div>
... ...
... ... @@ -11,14 +11,15 @@ var $ = require('yoho.jquery'),
$eReceiptBtn = $('.receipt-type .e-receipt'),
$paperReceiptBtn = $('.receipt-type .paper-receipt');
var address = require('./address');
var address = require('./address'),
receiptTitle = "个人";
var dialog = require('../common/dialog');
var accMul = function(arg1, arg2) {
var m = 0,
s1 = arg1.toString(),
s2 = arg2.toString();
s1 = arg1.toString(),
s2 = arg2.toString();
try {
m += s1.split('.')[1].length;
... ... @@ -875,9 +876,47 @@ $invoiceCheck.click(function(){
});
//电子发票
$receiptInfoSaveBtn.click(function(){
function saveReceiptInfo() {
var passInfoVerify = true,
receiptType,
receiptContent,
receiptMobile,
verifymobile;
if ($eReceiptBtn.hasClass('receipt-type-selected')) {
receiptType = "电子发票";
} else {
receiptType = "纸质发票";
}
if (receiptTitle !== "个人") {
$('.input-line').each(function(){
if ($(this).find('input').val() === '') {
$(this).find('.enpty-input').removeClass('hide');
passInfoVerify = false;
};
})
receiptMobile = $('#input-mobile').val();
verifymobile = /[0-9]{11}/;
if (!verifymobile.test(receiptMobile)) {
$('.invoice-phone .enpty-input').removeClass('hide');
passInfoVerify = false;
};
if (!passInfoVerify) {
return;
} else {
receiptTitle = $('#input-organization-name').val();
}
}
receiptContent = $('input[name="content"]:checked').val();
$receiptInfo.addClass('hide');
$('.invoice-content').removeClass('hide');
}
$receiptInfoSaveBtn.click(function(){
saveReceiptInfo();
});
$receiptInfoCancelBtn.click(function(){
... ... @@ -905,12 +944,12 @@ $paperReceiptBtn.click(function(){
$('.invoice-title').change(function(){
var selectType = $('input[name="title"]:checked').val();
if (selectType === "1") {
console.log('个人');
receiptTitle = "个人";
$('.invoice-title').addClass('invoice-title-personal-hight');
$('.invoice-title .input-line').addClass('hide');
$('.invoice-phone').addClass('hide');
} else {
console.log('单位');
receiptTitle = "单位";
$('.invoice-title').removeClass('invoice-title-personal-hight');
$('.invoice-title .input-line').removeClass('hide');
$('.invoice-phone').removeClass('hide');
... ...
... ... @@ -717,7 +717,7 @@
input {
width: 200px;
height: 30px;
margin-top: 5px;
font-size: 14px;
}
}
... ...