wagesdetails.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454
  1. <template>
  2. <div>
  3. <cu-custom bgColor="bg-gradual-pink" :isBack="true">
  4. <block slot="backText">返回</block>
  5. <block slot="content">薪资查询</block>
  6. </cu-custom>
  7. <div class='month'>
  8. <ul style="list-style-type:none;">
  9. <li class='arrow' @click='pickPre(currentYear,currentMonth)'>上个月</li>
  10. <li class='year-month'>
  11. <span class='choose-year'>{{ currentYear }}年</span>
  12. <span class='choose-month'>{{ currentMonth }}月</span>
  13. </li>
  14. <li class='arrow' @click='pickNext(currentYear,currentMonth)'>下个月</li>
  15. </ul>
  16. <br>
  17. </div>
  18. <div v-for='(item,index) in data'>
  19. <div style="margin-top: 10px;margin-left: 20px;">
  20. <strong style="font-size: 16px;" >{{currentYear}}年{{ currentMonth }}月</strong>
  21. <br>
  22. <br>
  23. <span style="color: #A3A7B1;">应发:&nbsp{{item.yingfa}}</span>
  24. <span class="items">实发:&nbsp{{item.shifa}}</span>
  25. </div>
  26. <br>
  27. <div style="background-color: #FFFFFF;">
  28. <div>
  29. <br>
  30. <strong style="margin-left: 20px;">收入明细</strong>
  31. <br>
  32. <div style="width: 100%; height: 1px; border-top: solid #ACC0D8 1px;margin-top: 10px;"></div>
  33. </div>
  34. <div>
  35. <ul>
  36. <li class="s">
  37. <div style="width: 10;height: 10px;"></div>
  38. <span class="fontColr">当月基本工资</span>
  39. <span style="width: 10px;height: 10px;" class="money"></span>
  40. <span class="money">{{item.srWages}}</span>
  41. <br>
  42. <div style="width: 100%; height: 1px; border-top: solid #ACC0D8 1px;margin-top: 10px;"></div>
  43. <div style="width: 10;height: 10px;"></div>
  44. </li>
  45. <li class="s">
  46. <span class="fontColr">绩效工资</span>
  47. <span style="width: 10px;height: 10px;" class="money"></span>
  48. <span class="money">{{item.srJxWages}}</span>
  49. <br>
  50. <div style="width: 100%; height: 1px; border-top: solid #ACC0D8 1px;margin-top: 10px;"></div>
  51. <div style="width: 10;height: 10px;"></div>
  52. </li>
  53. <li class="s">
  54. <span class="fontColr">考勤工资</span>
  55. <span style="width: 10px;height: 10px;" class="money"></span>
  56. <span class="money">{{item.kqWages}}</span>
  57. <br>
  58. <div style="width: 100%; height: 1px; border-top: solid #ACC0D8 1px;margin-top: 10px;"></div>
  59. <div style="width: 10;height: 10px;"></div>
  60. </li>
  61. <li class="s">
  62. <span class="fontColr">考勤天数</span>
  63. <span style="width: 10px;height: 10px;" class="money"></span>
  64. <span class="money">{{item.kqCount}}</span>
  65. <br>
  66. <div style="width: 100%; height: 1px; border-top: solid #ACC0D8 1px;margin-top: 10px;"></div>
  67. <div style="width: 10;height: 10px;"></div>
  68. </li>
  69. <li class="s">
  70. <span class="fontColr">加班费</span>
  71. <span style="width: 10px;height: 10px;" class="money"></span>
  72. <span class="money">{{item.srJbWages}}</span>
  73. <br>
  74. <div style="width: 100%; height: 1px; border-top: solid #ACC0D8 1px;margin-top: 10px;"></div>
  75. <div style="width: 10;height: 10px;"></div>
  76. </li>
  77. <li class="s">
  78. <span class="fontColr">加班天数</span>
  79. <span style="width: 10px;height: 10px;" class="money"></span>
  80. <span class="money">{{item.jbCount}}</span>
  81. <br>
  82. <div style="width: 100%; height: 1px; border-top: solid #ACC0D8 1px;margin-top: 10px;"></div>
  83. <div style="width: 10;height: 10px;"></div>
  84. </li>
  85. <li class="s">
  86. <span class="fontColr">高温费</span>
  87. <span style="width: 10px;height: 10px;" class="money"></span>
  88. <span class="money">{{item.srGwWages}}</span>
  89. <br>
  90. <div style="width: 100%; height: 1px; border-top: solid #ACC0D8 1px;margin-top: 10px;"></div>
  91. <div style="width: 10;height: 10px;"></div>
  92. </li>
  93. </ul>
  94. </div>
  95. </div>
  96. <br>
  97. <div style="background-color: #FFFFFF;">
  98. <div>
  99. <br>
  100. <strong style="margin-left: 20px;">扣款明细</strong>
  101. <br>
  102. <div style="width: 100%; height: 1px; border-top: solid #ACC0D8 1px;margin-top: 10px;"></div>
  103. </div>
  104. <div>
  105. <ul>
  106. <li class="s">
  107. <div style="width: 10;height: 10px;"></div>
  108. <span class="fontColr">病假扣款</span>
  109. <span style="width: 10px;height: 10px;" class="money"></span>
  110. <span style="float: right;">{{item.kkLack}}</span>
  111. <br>
  112. <div style="width: 100%; height: 1px; border-top: solid #ACC0D8 1px;margin-top: 10px;"></div>
  113. <div style="width: 10;height: 10px;"></div>
  114. </li>
  115. <li class="s">
  116. <span class="fontColr">病假天数</span>
  117. <span style="width: 10px;height: 10px;" class="money"></span>
  118. <span style="float: right;">{{item.bjCount}}</span>
  119. <br>
  120. <div style="width: 100%; height: 1px; border-top: solid #ACC0D8 1px;margin-top: 10px;"></div>
  121. <br>
  122. </li>
  123. <li class="s">
  124. <br>
  125. <strong >扣款合计</strong>
  126. <span style="width: 10px;height: 10px;" class="money"></span>
  127. <span class="money">{{item.kkOther}}</span>
  128. <br>
  129. <br>
  130. </li>
  131. </ul>
  132. </div>
  133. </div>
  134. <br>
  135. <div style="background-color: #FFFFFF;">
  136. <div>
  137. <br>
  138. <strong style="margin-left: 20px;">当月五险一金&nbsp;(个人缴纳部分)</strong>
  139. <br>
  140. <div style="width: 100%; height: 1px; border-top: solid #ACC0D8 1px;margin-top: 10px;"></div>
  141. </div>
  142. <div>
  143. <ul>
  144. <li class="s">
  145. <div style="width: 10;height: 10px;"></div>
  146. <span class="fontColr">养老个人缴纳部分</span>
  147. <span style="width: 10px;height: 10px;" class="money"></span>
  148. <span style="float: right;">{{item.grPension}}</span>
  149. <br>
  150. <div style="width: 100%; height: 1px; border-top: solid #ACC0D8 1px;margin-top: 10px;"></div>
  151. <div style="width: 10;height: 10px;"></div>
  152. </li>
  153. <li class="s">
  154. <span class="fontColr">失业个人缴纳部分</span>
  155. <span style="width: 10px;height: 10px;" class="money"></span>
  156. <span style="float: right;">{{item.grCause}}</span>
  157. <br>
  158. <div style="width: 100%; height: 1px; border-top: solid #ACC0D8 1px;margin-top: 10px;"></div>
  159. <div style="width: 10;height: 10px;"></div>
  160. </li>
  161. <li class="s">
  162. <span class="fontColr">医疗个人缴纳部分</span>
  163. <span style="width: 10px;height: 10px;" class="money"></span>
  164. <span style="float: right;">{{item.grMedical}}</span>
  165. <br>
  166. <div style="width: 100%; height: 1px; border-top: solid #ACC0D8 1px;margin-top: 10px;"></div>
  167. <div style="width: 10;height: 10px;"></div>
  168. </li>
  169. <li class="s">
  170. <span class="fontColr">公积金个人缴纳部分</span>
  171. <span style="width: 10px;height: 10px;" class="money"></span>
  172. <span style="float: right;">{{item.grFund}}</span>
  173. <br>
  174. <div style="width: 100%; height: 1px; border-top: solid #ACC0D8 1px;margin-top: 10px;"></div>
  175. <br>
  176. </li>
  177. </ul>
  178. </div>
  179. </div>
  180. <br>
  181. <div style="background-color: #FFFFFF;">
  182. <div>
  183. <br>
  184. <strong style="margin-left: 20px;">当月五险一金&nbsp;(公司缴纳部分)</strong>
  185. <br>
  186. <div style="width: 100%; height: 1px; border-top: solid #ACC0D8 1px;margin-top: 10px;"></div>
  187. </div>
  188. <div>
  189. <ul>
  190. <li class="s">
  191. <div style="width: 10;height: 10px;"></div>
  192. <span class="fontColr">养老金公司缴纳部分</span>
  193. <span style="width: 10px;height: 10px;" class="money"></span>
  194. <span style="float: right;">{{item.gsPension}}</span>
  195. <br>
  196. <div style="width: 100%; height: 1px; border-top: solid #ACC0D8 1px;margin-top: 10px;"></div>
  197. <div style="width: 10;height: 10px;"></div>
  198. </li>
  199. <li class="s">
  200. <span class="fontColr">失业公司缴纳部分</span>
  201. <span style="width: 10px;height: 10px;" class="money"></span>
  202. <span style="float: right;">{{item.gsCause}}</span>
  203. <br>
  204. <div style="width: 100%; height: 1px; border-top: solid #ACC0D8 1px;margin-top: 10px;"></div>
  205. <div style="width: 10;height: 10px;"></div>
  206. </li>
  207. <li class="s">
  208. <span class="fontColr">医疗公司缴纳部分</span>
  209. <span style="width: 10px;height: 10px;" class="money"></span>
  210. <span style="float: right;">{{item.gsMedical}}</span>
  211. <br>
  212. <div style="width: 100%; height: 1px; border-top: solid #ACC0D8 1px;margin-top: 10px;"></div>
  213. <div style="width: 10;height: 10px;"></div>
  214. </li>
  215. <li class="s">
  216. <span class="fontColr">公积金公司缴纳部分</span>
  217. <span style="width: 10px;height: 10px;" class="money"></span>
  218. <span style="float: right;">{{item.gsFund}}</span>
  219. <br>
  220. <div style="width: 100%; height: 1px; border-top: solid #ACC0D8 1px;margin-top: 10px;"></div>
  221. <div style="width: 10;height: 10px;"></div>
  222. </li>
  223. <li class="s">
  224. <span class="fontColr">工伤险公司缴纳部分</span>
  225. <span style="width: 10px;height: 10px;" class="money"></span>
  226. <span style="float: right;">{{item.gsInjury}}</span>
  227. <br>
  228. <div style="width: 100%; height: 1px; border-top: solid #ACC0D8 1px;margin-top: 10px;"></div>
  229. <div style="width: 10;height: 10px;"></div>
  230. </li>
  231. <li class="s">
  232. <span class="fontColr">生育险公司缴纳部分</span>
  233. <span style="width: 10px;height: 10px;" class="money"></span>
  234. <span style="float: right;">{{item.gsBirth}}</span>
  235. <br>
  236. <div style="width: 100%; height: 1px; border-top: solid #ACC0D8 1px;margin-top: 10px;"></div>
  237. <br>
  238. </li>
  239. </ul>
  240. </div>
  241. </div>
  242. <br>
  243. <div style="background-color: #FFFFFF;">
  244. <div>
  245. <br>
  246. <strong style="margin-left: 20px;">税单</strong>
  247. <br>
  248. <div style="width: 100%; height: 1px; border-top: solid #ACC0D8 1px;margin-top: 10px;"></div>
  249. </div>
  250. <div>
  251. <ul>
  252. <li class="s">
  253. <div style="width: 10;height: 10px;"></div>
  254. <span class="fontColr">个税</span>
  255. <span style="width: 10px;height: 10px;" class="money"></span>
  256. <span style="float: right;">{{item.sdPersonal}}</span>
  257. <br>
  258. <div style="width: 100%; height: 1px; border-top: solid #ACC0D8 1px;margin-top: 10px;"></div>
  259. <div style="width: 10;height: 10px;"></div>
  260. </li>
  261. </ul>
  262. </div>
  263. </div>
  264. <br>
  265. </div>
  266. </div>
  267. </template>
  268. <script>
  269. export default {
  270. data() {
  271. return {
  272. wagesDate:"",
  273. data:[],
  274. userUrl:'/salary/salaryCard/querySalary',
  275. currentMonth: 1,
  276. currentYear: 1970,
  277. }
  278. },
  279. created(){
  280. this.querywages()
  281. this.initData()
  282. },
  283. methods:{
  284. initData: function(cur) {
  285. // var leftcount = 0 // 存放剩余数量
  286. var date
  287. if (cur) {
  288. date = new Date(cur)
  289. } else {
  290. var now = new Date()
  291. var d = new Date(this.formatDate(now.getFullYear(), now.getMonth(), 1))
  292. d.setDate(35)
  293. date = new Date(this.formatDate(d.getFullYear(), d.getMonth() + 1, 1))
  294. }
  295. this.currentYear = date.getFullYear()
  296. this.currentMonth = date.getMonth() + 1
  297. var str = this.formatDate(
  298. this.currentYear,
  299. this.currentMonth,
  300. )
  301. },
  302. pickPre: function(year, month) {
  303. var d = new Date(this.formatDate(year, month, 1))
  304. d.setDate(0)
  305. this.initData(this.formatDate(d.getFullYear(), d.getMonth() + 1, 1))
  306. this.querywages()
  307. },
  308. pickNext: function(year, month) {
  309. var d = new Date(this.formatDate(year, month, 1))
  310. var ds=this.formatDate(year, month, null);
  311. var nowDate = new Date();
  312. var dt=this.formatDate(nowDate.getFullYear(),nowDate.getMonth(),null);
  313. if(ds<=dt){
  314. d.setDate(35)
  315. this.initData(this.formatDate(d.getFullYear(), d.getMonth() + 1, 1))
  316. this.querywages()
  317. }
  318. },
  319. // 返回 类似 2016-01-02 格式的字符串
  320. formatDate: function(year, month, day) {
  321. var y = year
  322. var m = month
  323. if (m < 10) m = '0' + m
  324. var d = day
  325. if(day!=null &&day !=""){
  326. if (d < 10) d = '0' + d
  327. return y + '-' + m + '-' + d
  328. }else{
  329. return y + '-' + m
  330. }
  331. },
  332. querywages(){
  333. var id=this.$store.getters.userid;
  334. var deptid=uni.getStorageSync('id');
  335. if(deptid!=null&&deptid!=""){
  336. id=deptid;
  337. }
  338. var date=this.formatDate(this.currentYear,this.currentMonth);
  339. this.$http.get(this.userUrl,{params:{userId:id,date:date}}).then(res=>{
  340. console.log("res",res)
  341. this.data=res.data.data;
  342. //this.wagesDate=this.formatt(this.data[0].wagesDate);
  343. }).catch(err => {
  344. console.log(err);
  345. });
  346. },
  347. formatt:function(e){
  348. var date = new Date(e);
  349. var n="年";
  350. var year=date.getFullYear();
  351. var seperator1 = "月";
  352. var month = date.getMonth() + 1;
  353. var currentdate = year +n+ month + seperator1;
  354. return currentdate;
  355. },
  356. }
  357. }
  358. </script>
  359. <style>
  360. .month ul {
  361. margin: 0;
  362. padding: 0;
  363. display: flex;
  364. justify-content: space-between;
  365. height: 35px;
  366. }
  367. .year-month {
  368. display: flex;
  369. align-items: center;
  370. justify-content: space-around;
  371. margin-top: 10px;
  372. }
  373. .choose-month {
  374. text-align: center;
  375. font-size: 12px;
  376. }
  377. .arrow {
  378. padding: 15px;
  379. color: #999999;
  380. }
  381. .month ul li {
  382. font-size: 12px;
  383. text-transform: uppercase;
  384. letter-spacing: 3px;
  385. }
  386. #calendar {
  387. font-size: 12px;
  388. width: 100%;
  389. margin: 0 auto;
  390. box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.1),
  391. 0 1px 5px 0 rgba(0, 0, 0, 0.12);
  392. }
  393. .month {
  394. width: 100%;
  395. color: #333333;
  396. }
  397. .items{
  398. margin-left: 20px;
  399. color: #A3A7B1;
  400. }
  401. .s{
  402. list-style-type:none;
  403. margin-left: -20px;
  404. }
  405. .fontColr{
  406. color: #A3A7B1;
  407. }
  408. .money{
  409. float: right;
  410. color: #0081FF;
  411. }
  412. .top{
  413. background-color: #5677AC;
  414. width: 100%;
  415. height: 40px;
  416. }
  417. </style>