openInvoice.php
5.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<?php
use yii\helpers\Url;
$this->title = '订单开票';
$this->params['breadcrumbs'][] = '交易管理';
$this->params['breadcrumbs'][] = '订单详情';
$this->params['breadcrumbs'][] = $this->title;
?>
<style>
.red-cls{color:red;}
</style>
<div class="panel panel-default">
<div class="panel-heading">
<p class="panel-title">
开票信息
</p>
</div>
<div class="panel-body instant">
<div class="form-group col-sm-12">
<label class="col-sm-4 control-label text-right">类型:</label>
<div class="col-sm-4 text-left form-inline">
<input class="form-control type" type="radio" name="type" value="0" checked="checked">公司
<input class="form-control type" type="radio" name="type" value="1">个人
</div>
</div>
<div class="form-group col-sm-12">
<label class="col-sm-4 control-label text-right">抬头*:</label>
<div class="col-sm-4 text-left">
<input class="form-control" type="text" name="head" id="head" value="">
</div>
</div>
<div class="form-group col-sm-12">
<label class="col-sm-4 control-label text-right">纳税人识别码:</label>
<div class="col-sm-4 text-left">
<input class="form-control" type="text" name="taxpayer_id_number" id="taxpayer_id_number" value="">
</div>
</div>
<div class="form-group col-sm-12">
<label class="col-sm-4 control-label text-right">email*:</label>
<div class="col-sm-4 text-left">
<input class="form-control" type="email" name="email" id="email" value="">
</div>
</div>
<div class="form-group col-sm-12">
<label class="col-sm-4 control-label text-right">备注:</label>
<div class="col-sm-4 text-left">
<input class="form-control" type="text" name="remark" id="remark" value="">
</div>
</div>
<div class="form-group col-sm-12">
<label class="col-sm-4 control-label text-right">开票公司注册地:</label>
<div class="col-sm-4 text-left">
<input class="form-control" type="text" name="register_address" id="register_address" value="">
</div>
</div>
<div class="form-group col-sm-12">
<label class="col-sm-4 control-label text-right">开票公司电话:</label>
<div class="col-sm-4 text-left">
<input class="form-control" type="text" name="register_tel" id="register_tel" value="">
</div>
</div>
<div class="form-group col-sm-12">
<label class="col-sm-4 control-label text-right">开票公司开户行:</label>
<div class="col-sm-4 text-left">
<input class="form-control" type="text" name="bank" id="bank" value="">
</div>
</div>
<div class="form-group col-sm-12">
<label class="col-sm-4 control-label text-right">开票公司开户行账号:</label>
<div class="col-sm-4 text-left">
<input class="form-control" type="text" name="bank_account" id="bank_account" value="">
</div>
</div>
<div class="form-group col-sm-12">
<label class="col-sm-4 control-label text-right">其他订单号:</label>
<div class="col-sm-4 text-left">
<input class="form-control" type="text" name="order_nos" id="order_nos" value="" placeholder="多个单用逗号分开前后并去除空格" />
</div>
</div>
<div class="form-group col-sm-12">
<label class="col-sm-4 control-label text-right">开票金额:</label>
<div class="col-sm-4 text-left">
<input class="form-control" type="number" name="amount" id="amount" value=""> <span class="red-cls">不能大于订单实付金额。线下支付的这里必填</span>
</div>
</div>
</div>
<div class="panel-footer text-center">
<button type="button" class="btn btn-primary ladda-button" data-style="slide-up" id="openInvoiceBtn">提交</button>
</div>
</div>
<input type="hidden" value="<?=$id ?>" id="id">
<script type="text/javascript">
var postURL = '<?=Url::toRoute("/trade/order/do-open-invoice/",['orderId' => $id])?>';
$(document).ready(function () {
$('#openInvoiceBtn').click(function(e){
var that = $(this);
if (!confirm('确认开票信息了么?')) {
return false;
}
that.attr('disabled', true);
$.post(postURL,{
'orderId': $('#id').val(),
'type': $('.type:checked').val(),
'head': $('#head').val(),
'taxpayer_id_number': $('#taxpayer_id_number').val(),
'email': $('#email').val(),
'remark': $('#remark').val(),
'register_address': $('#register_address').val(),
'register_tel': $('#register_tel').val(),
'bank': $('#bank').val(),
'bank_account': $('#bank_account').val(),
'order_nos': $('#order_nos').val(),
'amount': $('#amount').val(),
},function(res){
if (res.success) {
alert('开票成功,过2分钟后请查阅邮箱');
} else {
alert(res.error);
}
that.removeAttr('disabled');
},'json')
})
});
</script>