home.js
5.4 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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
// pages/main/finalpay/home.js
var app = getApp();
var baseUrl = app.globalData.baseUrl;
Page({
data: {
declare_status: "",//申报状态"0" //待申报 "1" //申报成功
refund_status: "",//退税状态
pay_status: "",//补税状态
declaring_unit_status: "4",//1:本单位申报,2:本单位其他申报,3:其他单位申报,4:待确认申报
payinfo:{},
unitInfo: [],
showUnit:false,
declaring_unit_id:"",
showModal_selfDeclare:false,
declare_status_arr:["待申报","申报成功"],
refund_status_arr: ["待退税", "退税中", "退税成功", "退税失败","放弃退税"],
pay_status_arr: ["无需补税", "待补税","补税成功"],
},
onLoad: function(options) {
this.getPayInfo();
},
onReady: function() {
},
onShow: function() {
},
yearPick: function() {
},
getPayInfo:function(){
var that = this
this.Authorization = getApp().globalData.Authorization;
wx.request({
url: baseUrl + "payroll/v1/settlement-tax/declare-detail",
header: {
'Authorization': this.Authorization
},
data: { 'years': '2019' },
success: function (result) {
console.log("payinfo",result)
if (result.statusCode==200) {
that.setData({
payinfo: result.data
})
}
},
})
},
getUnitInfo:function(){//获取申报单位
var that = this
this.Authorization = getApp().globalData.Authorization;
that.setData({
showUnit: true
})
wx.request({
url: baseUrl + "payroll/v1/settlement-tax/declare-unit",
header: {
'Authorization': this.Authorization
},
data: { },
success: function (result) {
console.log("unitInfo", result.data)
if (result.statusCode == 200) {
that.setData({
unitInfo: result.data.items
})
}
},
complete:function(e){
that.setData({
showUnit:true
})
}
})
},
updateDeclareState: function (id) {//是否在本单位申报
var that = this
this.Authorization = getApp().globalData.Authorization;
wx.request({
url: baseUrl + "payroll/v1/settlement-tax/record",
header: {
'Authorization': this.Authorization
},
data: { 'declaring_unit_id': id },
success: function (result) {
console.log("declareinfo", result)
if (result.statusCode == 200) {
that.setData({
})
}
},
})
},
// 是否放弃退税,(是:"5",否:"")
forgiveRefund: function () {
var that = this
this.Authorization = getApp().globalData.Authorization;
wx.request({
url: baseUrl + "payroll/v1/settlement-tax/record",
header: {
'Authorization': this.Authorization
},
data: { 'refund_status': '' },
success: function (result) {
console.log("refund", result)
if (result.statusCode == 200) {
that.setData({
})
}
},
})
},
// 确认提交申请退税
forgiveRefund: function () {
var that = this
this.Authorization = getApp().globalData.Authorization;
wx.request({
url: baseUrl + "payroll/v1/settlement-tax/record",
header: {
'Authorization': this.Authorization
},
data: {
"name": "xxxx", //姓名,
"bank": "xxxx", //开户行,
"bank_card_no": "xxxx", //银行卡号,
"bank_province": "xxxx", //银行省份,
},
success: function (result) {
console.log("refund", result)
if (result.statusCode == 200) {
that.setData({
})
}
},
})
},
// 跳转到H5页面测试
skipH5_01: function() {
wx.navigateTo({
url: '../../common/webview?type=1',
})
},
skipH5_02: function() {
wx.navigateTo({
url: '../../common/webview?type=2',
})
},
finalpay_detail: function() {
wx.navigateTo({
url: 'incomeDetail/incomeDetail',
})
},
declareHere: function() {
this.getUnitInfo()
},
declareNotHere: function() {
var that = this
wx.showModal({
title: '',
content: '确认不在本单位进行汇算清缴申报吗?',
confirmColor: '#357aeb',
success(res) {
if (res.confirm) {
console.log('用户点击确定')
that.updateDeclareState("")
} else if (res.cancel) {
console.log('用户点击取消')
}
}
})
},
unitPick:function(e){//选择申报单位
console.log("unitPick",e)
this.setData({
declaring_unit_id: e.currentTarget.id,
showUnit: false
})
this.updateDeclareState(e.currentTarget.id)
},
selfdeclare_close(){//关闭自行申报弹窗
this.setData({
showModal_selfDeclare: false
})
},
declareBySelf:function(){//查看自行申报方式
this.setData({
showModal_selfDeclare: true
})
},
godeclareHistory:function(){
wx.redirectTo({
url: '../advancepayment/adPayHome',
})
},
noOtherUnitInfo:function(){//没有其他单位个税申报
},
otherUnitInfo: function () {//有其他单位个税申报
wx.navigateTo({
url: 'addUnitInfo/addUnitInfo',
})
},
onHide: function() {
},
onUnload: function() {
},
onPullDownRefresh: function() {
},
onReachBottom: function() {
},
onShareAppMessage: function() {
}
})