提交 a47a8d31f851695a38ee7aaaaf74b562e1a74e8c

作者 pangy
1 个父辈 943f405b

预扣预缴 工资明细 优化

... ... @@ -9,7 +9,7 @@ Page({
9 9 Authorization: null,
10 10 data: {
11 11 // tab切换
12   - isshow : false,
  12 + // isshow : false,
13 13 currentTab: 0,
14 14 taxDatas: [],
15 15 salaryDatas: {},
... ... @@ -110,6 +110,7 @@ Page({
110 110 item.payroll_date = format.formatTime_date(item.payroll_date)
111 111 item.count_date = format.formatDate_min(item.start_time) + '-' + format.formatDate_min(item.end_time)
112 112 item.detals = this.handleDetailsData(item)
  113 + item.isshow = false
113 114 }
114 115 return items;
115 116 },
... ... @@ -155,9 +156,14 @@ Page({
155 156
156 157 gospan:function(e){
157 158 console.log(e)
  159 + var item = this.data.salaryDatas[e.currentTarget.id]
  160 + item.isshow = !item.isshow
158 161 this.setData({
159   - isshow: !this.data.isshow
  162 + salaryDatas: this.data.salaryDatas
160 163 })
  164 + // this.setData({
  165 + // isshow: !this.data.isshow
  166 + // })
161 167 // console.log('idddddd',e.currentTarget.id)
162 168 // if (!e.currentTarget.id) return
163 169 // var that = this
... ... @@ -187,11 +193,14 @@ Page({
187 193 var detail = JSON.parse(data['detail'])
188 194 var details = []
189 195 for (var i = 0; i < titles.length; ++i) {
190   - var titleData = titles[i]
191   - var value = detail[titleData['key']]
192   -
  196 + var titleData = titles[i]
  197 + var value = detail[titleData['key']]
  198 + var title = titleData['title']
  199 + if (!title){
  200 + title = titleData['original_column']
  201 + }
193 202 details.push({
194   - title: titleData['title'],
  203 + title: title,
195 204 value: value
196 205 })
197 206 }
... ...
... ... @@ -47,16 +47,16 @@
47 47 <text class='text_999_28'>应发金额:<text class='text_333_28'>{{item.pay_salary}}</text></text>
48 48 <text class='text_999_28'>实发:<text class='text_333_28 text_color_28'>¥{{item.salary}}</text></text>
49 49 <view class='divide_line_f5f5f5' style='margin:20rpx 0'></view>
50   - <view wx:if="{{!isshow}}" bindtap='gospan' id='{{item.id}}'>
  50 + <view wx:if="{{!item.isshow}}" bindtap='gospan' id='{{index}}'>
51 51 <text style='font-size:28rpx;color:#4e8fe7;text-align:left'>展开</text>
52 52 <image class='head_image_wrap_down' src='/images/arrow_blue_down.png'></image>
53 53 </view>
54   - <view wx:if="{{isshow}}" bindtap='gospan'>
  54 + <view wx:if="{{item.isshow}}" bindtap='gospan' id='{{index}}'>
55 55 <text style='font-size:28rpx;color:#4e8fe7;text-align:left'>收起</text>
56 56 <image class='head_image_wrap_up' src='/images/arrow_blue_up.png'></image>
57 57 <view class='divide_line_f5f5f5' style='margin:30rpx 0'></view>
58 58 </view>
59   - <view wx:if="{{isshow}}" wx:for="{{item.detals}}" wx:for-item='detal'>
  59 + <view wx:if="{{item.isshow}}" wx:for="{{item.detals}}" wx:for-item='detal'>
60 60 <view>
61 61 <text class='text_999_28'>{{detal.title}}</text>
62 62 <text class='text_999_28' style='color:#333;text-align:right;float: right'>{{detal.value}}</text>
... ...
注册登录 后发表评论