addUnitInfo.js
2.2 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
// pages/main/finalpay/addUnitInfo/addUnitInfo.js
var app = getApp();
var baseUrl = app.globalData.baseUrl;
Page({
data: {
year: 2019,
unit_id:"",
},
onLoad: function(options) {
this.setData({
unit_id:options.unit_id
})
},
onReady: function() {
},
onShow: function() {
},
formSubmit: function(e) { //提交
console.log("formSubmit", e);
var formdata = e.detail.value
if (formdata.total_salary || formdata.total_salary || formdata.remuneration_labor || formdata.author_payment || formdata.special_manage_cost || formdata.other_free_income || formdata.personal_endowment || formdata.personal_medical || formdata.personal_unemployment || formdata.personal_house_fund || formdata.childrens_education || formdata.continuing_education || formdata.housing_loan_interest || formdata.housing_rent || formdata.caring_old_people || formdata.serious_illness_medical || formdata.annuity || formdata.commercial_insurance || formdata.tax_extension || formdata.other_fee || formdata.donation_deducted || formdata.years_bouns || formdata.tax_savings || formdata.accumulated_withholding_tax){
this.submitRequest(formdata)
}else{
this.showToast("请输入内容")
return
}
},
submitRequest: function(request_data) {
var that = this
this.Authorization = getApp().globalData.Authorization;
wx.request({
url: baseUrl + "payroll/v1/settlement-tax/record",
header: {
'Authorization': this.Authorization
},
method: "POST",
data: {
"declaring_unit_id":that.data.unit_id,
"item": request_data,
"years": that.data.year
},
success: function(result) {
console.log("refund", result)
if (result.statusCode == 200) {
that.showToast("提交成功!")
}
},
})
},
showToast: function(data) {
if (data && data.length > 0) {
wx.showToast({
title: data,
icon: "none",
duration: 2000
})
}
},
onHide: function() {
},
onUnload: function() {
},
onPullDownRefresh: function() {
},
onReachBottom: function() {
},
onShareAppMessage: function() {
}
})