You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

list.vue 4.8 KiB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. <template>
  2. <view class="page">
  3. <view class="wagesSec1">
  4. <view class="wagesSec1Top">
  5. <view class="text-xxl cuIcon cuIcon-back" @click="tapTime(0)"></view>
  6. <text>{{ today.y }} 年 {{ today.m }} 月</text>
  7. <view class="text-xxl cuIcon cuIcon-right" @click="tapTime(1)"></view>
  8. </view>
  9. <view class="wagesSec1T">¥{{ fsalary }}</view>
  10. <view class="wagesSec1Txt">{{ today.y }}年{{ today.m }}月实发工资</view>
  11. </view>
  12. <view class="wagesSec2">
  13. <view v-for="(item, i) in wagesData" :key="i">
  14. <view v-show="num == i">
  15. <view class="wagesSec2T">应发金额 <text class="span"></text></view>
  16. <view class="wagesSec2List">
  17. <view class="wagesSec2ListLi">基本工资<text class="span">¥ {{ item.BaseSalary }} </text></view>
  18. <view class="wagesSec2ListLi">职位补贴<text class="span">¥ {{ item.JobSubsidies }} </text></view>
  19. <view class="wagesSec2ListLi">绩效工资<text class="span">¥ {{ item.PerformanceBonus }} </text></view>
  20. <view class="wagesSec2ListLi">手机费<text class="span">¥ {{ item.MobilePhoneFee }} </text></view>
  21. <view class="wagesSec2ListLi">交通费<text class="span">¥ {{ item.TransportationFee }} </text></view>
  22. <view class="wagesSec2ListLi">全勤奖<text class="span">¥ {{ item.AttendanceBonus }} </text></view>
  23. <view class="wagesSec2ListLi">应发金额<text class="span">¥ {{ item.SSalary }} </text></view>
  24. </view>
  25. <view class="wagesSec2T">扣款金额 <text class="span"></text></view>
  26. <view class="wagesSec2List">
  27. <view class="wagesSec2ListLi">养老金保险<text class="span">¥ {{ item.PensionInsurance }} </text></view>
  28. <view class="wagesSec2ListLi">个人所得税<text class="span">¥ {{ item.PersonalIncomeTax }} </text></view>
  29. <view class="wagesSec2ListLi">事假<text class="span">¥ {{ item.PersonalLeave }} </text></view>
  30. <view class="wagesSec2ListLi">迟到<text class="span">¥ {{ item.Late }} </text></view>
  31. <view class="wagesSec2ListLi">病假<text class="span">¥ {{ item.Sick }} </text></view>
  32. <view class="wagesSec2ListLi">个人所得税<text class="span">¥ {{ item.PersonalIncomeTax }} </text></view>
  33. </view>
  34. </view>
  35. </view>
  36. <view style="text-align: center;padding: 10px 0;" v-show="num == -1"> 暂无数据!</view>
  37. </view>
  38. </view>
  39. </template>
  40. <script>
  41. import common from '@/common/js/common.js';
  42. export default{
  43. data() {
  44. return {
  45. today: null,
  46. wagesData: null,
  47. num: -1,
  48. fsalary: 0
  49. }
  50. },
  51. methods:{
  52. init() {
  53. let _this = this;
  54. _this.LOADING('加载数据中…');
  55. // _this.HIDE_LOADING();
  56. _this.HTTP_GET('Learun/EducationalAdministration/SalarySheet/list', '', '加载数据时出错').then(res => {
  57. _this.HIDE_LOADING();
  58. console.log(res);
  59. if (res) {
  60. // console.log(res);
  61. _this.wagesData = res;
  62. _this.jisuan()
  63. }
  64. });
  65. },
  66. tapTime(num) {
  67. let ytemp =0;
  68. let mtemp = 0;
  69. let ydata = parseInt(this.today.y) ;
  70. let mdata = parseInt(this.today.m);
  71. if (num == 0) {
  72. if (mdata == 1) { ytemp = ydata - 1, mtemp = 12 }
  73. else { ytemp = ydata, mtemp = mdata - 1 }
  74. } else {
  75. if (mdata == 12) { ytemp = ydata + 1, mtemp = 1 }
  76. else { ytemp = ydata, mtemp = mdata + 1 }
  77. }
  78. this.today.y=ytemp;
  79. this.today.m = mtemp<10?'0'+mtemp:mtemp;
  80. this.jisuan()
  81. },
  82. jisuan() {
  83. let _this = this;
  84. this.num = -1;
  85. this.fsalary = 0;
  86. this.wagesData.forEach((n, i) => {
  87. if(n.year == _this.today.y && n.month == parseInt(_this.today.m)){
  88. _this.num = i;
  89. _this.fsalary = n.Fsalary;
  90. }
  91. })
  92. // console.log(this.num)
  93. }
  94. },
  95. created() {
  96. let today = common.fmtDate().split('-');
  97. this.today = {
  98. y: today[0],
  99. m: today[1],
  100. d: today[2]
  101. };
  102. this.init()
  103. }
  104. }
  105. </script>
  106. <style lang="less" scoped>
  107. .wagesSec1 {
  108. padding: 14px 12px 30px;
  109. text-align: center;
  110. background: #0c86d8;
  111. }
  112. .wagesSec1Top {
  113. font-size: 0;
  114. }
  115. .wagesSec1Top > * {
  116. display: inline-block;
  117. vertical-align: middle;
  118. color: #bbdefb;
  119. }
  120. .wagesSec1Top text {
  121. width: 185px;
  122. font-size: 14px;
  123. }
  124. .wagesSec1T {
  125. margin-top: 20px;
  126. font-size: 28px;
  127. text-align: center;
  128. color: #fff;
  129. }
  130. .wagesSec1Txt {
  131. font-size: 12px;
  132. color: #bbdefb;
  133. text-align: center;
  134. margin-top: 5px;
  135. }
  136. .wagesSec2 {
  137. background: #fff;
  138. }
  139. .wagesSec2List {
  140. margin: 0px;
  141. padding: 0px;
  142. list-style: none;
  143. }
  144. .wagesSec2ListLi {
  145. list-style: none;
  146. }
  147. .wagesSec2T {
  148. font-size: 15px;
  149. color: #a0a0a0;
  150. padding: 0 12px;
  151. line-height: 40px;
  152. border-bottom: 1px solid #f0f3f5;
  153. }
  154. .wagesSec2T .span {
  155. display: inline-block;
  156. width: 5px;
  157. height: 5px;
  158. background: #ffba00;
  159. vertical-align: middle;
  160. border-radius: 50%;
  161. margin-left: 5px;
  162. position: relative;
  163. top: -2px;
  164. }
  165. .wagesSec2ListLi {
  166. line-height: 40px;
  167. border-bottom: 1px solid #f0f3f5;
  168. font-size: 13px;
  169. color: #646464;
  170. padding: 0 12px;
  171. }
  172. .wagesSec2ListLi .span {
  173. float: right;
  174. color: #8a8a8a;
  175. }
  176. </style>