提交 95e2642511924df81d01720623cc1b91b185c50f

作者 pangy
1 个父辈 b6dd52ae

预扣预缴 接口

@@ -9,36 +9,7 @@ Page({ @@ -9,36 +9,7 @@ Page({
9 // tab切换 9 // tab切换
10 isshow: false, 10 isshow: false,
11 currentTab: 0, 11 currentTab: 0,
12 - taxDatas: {  
13 - "id": "154024896031100928",  
14 - "created_at": 1511525284,  
15 - "updated_at": 1511525284,  
16 - "tenant_id": "122371433052508160",  
17 - "taxation_method": "salary", // 个税申报类型:"0101"-工资薪金 "0401"-劳务报酬  
18 - "sub_taxation_method": "salary", // 正常工资薪金子类型:"0101"-正常工资薪金 "0107"-内退一次性补偿 "0108"-解除劳动合同一次性补偿 "0109"-个人股票期权行权收入 "0110"-企业年金 "0111"-提前退休一次性补贴 "0103"-全年一次性奖金收入  
19 - "province": "北京市",  
20 - "province_code": "110000",  
21 - "city": "市辖区",  
22 - "city_code": "110100",  
23 - "district": "东城",  
24 - "district_code": "110101",  
25 - "name": "徐恒堂", //姓名  
26 - "credential_type": "居民身份证",  
27 - "credential_number": "110221198301270632", //证件号码  
28 - "option_date": 152135596800,  
29 - "personal_income": 475.6, //当期收入额  
30 - "tax_free_income": 475.6, //当期免税收入  
31 - "special_deduction": 475.6, //累计专项扣除(专项扣除合计)  
32 - "reduction_cost": 475.6, //累计基本减除(减除费用)  
33 - "special_additional_deduction": 475.6, //累计专项附加扣除(专项附加扣除合计)  
34 - "other_deduction": 475.6, //累计法定扣除(其他扣除合计)  
35 - "accumulated_taxable_income": 475.6, //累计应纳税所得额  
36 - "tax_rate": 0.6, //税率  
37 - "deduction_number": 475.6, //速算扣除数  
38 - "accumulated_withholding_tax": 475.6, //累计应扣缴税额  
39 - "prepay_tax": 475.6, //已预交税额  
40 - "refund_tax": 475.6, //本期应缴税额(应补退税额)  
41 - }, 12 + taxDatas: {},
42 choosed_date: '', 13 choosed_date: '',
43 long_date: 0 14 long_date: 0
44 }, 15 },
@@ -63,7 +34,7 @@ Page({ @@ -63,7 +34,7 @@ Page({
63 console.log('成功', result) 34 console.log('成功', result)
64 if (result.personal_income){ 35 if (result.personal_income){
65 self.setData({ 36 self.setData({
66 - taxDatas: result 37 + taxDatas: result.data
67 }) 38 })
68 } 39 }
69 40
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 var format = require('../../../utils/util.js'); 2 var format = require('../../../utils/util.js');
3 var app = getApp(); 3 var app = getApp();
4 var baseUrl = app.globalData.baseUrl; 4 var baseUrl = app.globalData.baseUrl;
5 - 5 +const Sub_taxation_method = {"0101":'正常工资薪金', "0107": "内退一次性补偿" ,"0108": "解除劳动合同一次性补偿", "0109": "个人股票期权行权收入", "0110": "企业年金", "0111": "提前退休一次性补贴", "0103": "全年一次性奖金收入"}
6 Page({ 6 Page({
7 loadCount:0, 7 loadCount:0,
8 timestamp: 0, 8 timestamp: 0,
@@ -11,29 +11,7 @@ Page({ @@ -11,29 +11,7 @@ Page({
11 // tab切换 11 // tab切换
12 isshow : false, 12 isshow : false,
13 currentTab: 0, 13 currentTab: 0,
14 - taxDatas: [{  
15 - "id": "154024896031100928",  
16 - "created_at": 1511525284,  
17 - "updated_at": 1511525284,  
18 - "tenant_id": "122371433052508160",  
19 - "taxation_method": "salary", // 个税申报类型:"0101"-工资薪金 "0401"-劳务报酬  
20 - "sub_taxation_method": "salary", // 正  
21 - "province": "北京市",  
22 - "province_code": "110000",  
23 - "city": "市辖区",  
24 - "city_code": "110100",  
25 - "district": "东城",  
26 - "district_code": "110101",  
27 - "name": "徐恒堂", //姓名  
28 - "credential_type": "身份证",  
29 - "credential_number": "110221198301270632", //证件号码  
30 - "personal_tax": 475.6, //本期应缴税额  
31 - "prepay_tax": 475.6, //已预交税额  
32 - "accumulated_taxable_income": 475.6, //累计应纳税所得额  
33 - "accumulated_withholding_tax": 475.6, //累计应扣缴税额  
34 - "prepay_tax": 475.6, //已预交税额  
35 - "option_date": 152135596800  
36 - }], 14 + taxDatas: [],
37 salaryDatas: {}, 15 salaryDatas: {},
38 choosed_date: '' 16 choosed_date: ''
39 }, 17 },
@@ -55,9 +33,10 @@ Page({ @@ -55,9 +33,10 @@ Page({
55 header: { 33 header: {
56 'Authorization': this.Authorization 34 'Authorization': this.Authorization
57 }, 35 },
  36 + data: { 'declare_month': timestamp },
58 success: function (result) { 37 success: function (result) {
59 that.setData({ 38 that.setData({
60 - taxDatas: result.items 39 + taxDatas: that.handleTaxData(result.data.items)
61 }) 40 })
62 41
63 }, 42 },
@@ -95,7 +74,21 @@ Page({ @@ -95,7 +74,21 @@ Page({
95 }) 74 })
96 75
97 }, 76 },
98 - 77 + handleTaxData: function (items) {
  78 + for (var i = 0; i < items.length; ++i) {
  79 + var item = items[i]
  80 + var method
  81 + if (item.taxation_method == '0101'){
  82 + if (item.sub_taxation_method && Sub_taxation_method[item.sub_taxation_method]){
  83 + method = '工资薪金-' + Sub_taxation_method[item.sub_taxation_method]
  84 + }
  85 + } else if (item.taxation_method == '0401') {
  86 + method = '劳务报酬'
  87 + }
  88 + item.method
  89 + }
  90 + return items;
  91 + },
99 handleSalaryData: function (items) { 92 handleSalaryData: function (items) {
100 for (var i = 0; i < items.length; ++i) { 93 for (var i = 0; i < items.length; ++i) {
101 var item = items[i] 94 var item = items[i]
@@ -17,10 +17,10 @@ @@ -17,10 +17,10 @@
17 <view wx:if="{{currentTab==0}}"> 17 <view wx:if="{{currentTab==0}}">
18 <view wx:for="{{taxDatas}}" style='margin-bottom:20rpx'> 18 <view wx:for="{{taxDatas}}" style='margin-bottom:20rpx'>
19 <view class='card_rectangle_bg_column' style='padding:30rpx' id='{{item.id}}' bindtap='goItemDetails'> 19 <view class='card_rectangle_bg_column' style='padding:30rpx' id='{{item.id}}' bindtap='goItemDetails'>
20 - <text style='text-align:left;font-size: 28rpx;color: #333;font-family: PingFangSC-Semibold;'>所得项目:{{item.taxation_method=='salary'?'工资薪金':'劳务报酬'}}</text> 20 + <text style='text-align:left;font-size: 28rpx;color: #333;font-family: PingFangSC-Semibold;'>所得项目:{{item.method}}</text>
21 <view class='divide_line_f5f5f5' style='margin:30rpx 0'></view> 21 <view class='divide_line_f5f5f5' style='margin:30rpx 0'></view>
22 - <!-- <text class='text_666_28'>累计收入额:{{item.}}</text> -->  
23 - <!-- <text class='text_666_28'>当期收入额:{{item.}}</text> --> 22 + <!-- <text class='text_666_28'>累计收入额:{{item.personal_income}}</text> -->
  23 + <text class='text_666_28'>当期收入额:{{item.personal_income}}</text>
24 <text class='text_666_28'>累计应缴纳所得额:{{item.accumulated_taxable_income}}</text> 24 <text class='text_666_28'>累计应缴纳所得额:{{item.accumulated_taxable_income}}</text>
25 <text class='text_666_28'>累计应扣缴税额:{{item.accumulated_withholding_tax}}</text> 25 <text class='text_666_28'>累计应扣缴税额:{{item.accumulated_withholding_tax}}</text>
26 <text class='text_666_28'>已预交税额:{{item.prepay_tax}}</text> 26 <text class='text_666_28'>已预交税额:{{item.prepay_tax}}</text>
注册登录 后发表评论