SalarysStatistics.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361
  1. <template>
  2. <a-card :bordered="false">
  3. <!-- 查询区域 -->
  4. <div class="table-page-search-wrapper">
  5. <a-form layout="inline" @keyup.enter.native="searchQuery">
  6. <a-row :gutter="24">
  7. <a-col :xl="5" :lg="7" :md="8" :sm="24">
  8. <a-form-item label="时间">
  9. <a-range-picker
  10. style="width: 100% !important"
  11. v-model="DateTime"
  12. :allowClear = 'false'
  13. format="YYYY-MM"
  14. :mode="mode2"
  15. :open="open"
  16. :placeholder="['开始时间', '结束时间']"
  17. @panelChange="handlePanelChange2"
  18. @openChange="onDateChange"
  19. @change="changeData"
  20. />
  21. </a-form-item>
  22. </a-col>
  23. <a-col :xl="5" :lg="7" :md="8" :sm="24">
  24. <a-form-item label="公司">
  25. <a-select v-model="queryParam.orgName">
  26. <a-select-option value="">所有</a-select-option>
  27. <a-select-option value="正织">正织</a-select-option>
  28. <a-select-option value="森语">森语</a-select-option>
  29. <a-select-option value="马菲羊">马菲羊</a-select-option>
  30. </a-select>
  31. </a-form-item>
  32. </a-col>
  33. <a-col :xl="5" :lg="7" :md="8" :sm="24">
  34. <a-form-item label="部门">
  35. <j-search-select-tag v-model="queryParam.sysOrgCode" placeholder="请选择部门"
  36. dict="sys_depart,depart_name,depart_name,org_type='3' or org_code='TBD' order by org_code"/>
  37. </a-form-item>
  38. </a-col>
  39. <a-col :xl="5" :lg="7" :md="8" :sm="24">
  40. <a-form-item label="姓名">
  41. <j-search-select-tag v-model="queryParam.name" placeholder="请选择名称"
  42. dict="sys_user,realname,realname" allowClear/>
  43. </a-form-item>
  44. </a-col>
  45. <a-col :xl="5" :lg="7" :md="8" :sm="24">
  46. <a-form-item label="雇佣状态">
  47. <a-select v-model="queryParam.syHireType" mode="multiple">
  48. <a-select-option value="">所有</a-select-option>
  49. <a-select-option value="在职">在职</a-select-option>
  50. <a-select-option value="离职">离职</a-select-option>
  51. <a-select-option value="退休返聘">退休返聘</a-select-option>
  52. <a-select-option value="运维">运维</a-select-option>
  53. </a-select>
  54. </a-form-item>
  55. </a-col>
  56. <a-col :xl="4" :lg="7" :md="8" :sm="24">
  57. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  58. <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  59. <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  60. </span>
  61. </a-col>
  62. </a-row>
  63. </a-form>
  64. </div>
  65. <!-- 操作按钮区域 -->
  66. <a-table
  67. ref="tableRef"
  68. size="middle"
  69. bordered
  70. rowKey="userId"
  71. :columns="columns"
  72. :dataSource="dataSource"
  73. :pagination="ipagination"
  74. :scroll="{x: 2000}"
  75. :loading="loading"
  76. :footer="showTotal"
  77. @change="handleTableChange">
  78. </a-table>
  79. </div>
  80. <!-- table区域-end -->
  81. <!-- 表单区域 -->
  82. </a-card>
  83. </template>
  84. <script>
  85. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  86. import { getAction } from '@/api/manage'
  87. import moment from 'moment'
  88. import JSearchSelectTag from '@/components/dict/JSearchSelectTag'
  89. export default {
  90. name: "SalarysStatistics",
  91. mixins: [JeecgListMixin],
  92. components: {
  93. moment,
  94. JSearchSelectTag
  95. },
  96. data () {
  97. return {
  98. description: '薪资统计',
  99. DateTime:[moment().subtract(1, 'months'),moment().subtract(1, 'months'),],
  100. mode2: ['month', 'month'],
  101. open:false,
  102. // 表头
  103. columns: [
  104. {
  105. title: '序号',
  106. width: 80,
  107. align:"center",
  108. dataIndex: 'code',
  109. customRender:function (text, record, index) {
  110. if(record.name=='合计'){
  111. return ''
  112. }else{
  113. return parseInt(index)+1;
  114. }
  115. },
  116. fixed:'left'
  117. },
  118. {
  119. title: '姓名',
  120. align:"center",
  121. dataIndex: 'name',
  122. width: 100,
  123. fixed:'left'
  124. },
  125. {
  126. title: '基本薪资',
  127. align:"center",
  128. dataIndex: 'beforeAdjustment',
  129. },
  130. {
  131. title: '话费补贴',
  132. align:"center",
  133. dataIndex: 'phoneBill'
  134. },
  135. {
  136. title: '午餐补贴',
  137. align:"center",
  138. dataIndex: 'lunch'
  139. },
  140. {
  141. title: '住房补贴',
  142. align:"center",
  143. dataIndex: 'housingSubsidies',
  144. },
  145. {
  146. title: '全勤奖',
  147. align:"center",
  148. dataIndex: 'fullAttendance'
  149. },
  150. {
  151. title: '加班工资',
  152. align:"center",
  153. dataIndex: 'overtimePay'
  154. },
  155. {
  156. title: '年休工资',
  157. align:"center",
  158. dataIndex: 'yearSalary'
  159. },
  160. {
  161. title: '合计应发',
  162. align:"center",
  163. dataIndex: 'totalPayable'
  164. },
  165. {
  166. title: '社保',
  167. align:"center",
  168. dataIndex: 'socialSecurity'
  169. },
  170. {
  171. title: '公积金',
  172. align:"center",
  173. dataIndex: 'accumulationFund'
  174. },
  175. {
  176. title: '个税',
  177. align:"center",
  178. dataIndex: 'personalTax'
  179. },
  180. {
  181. title: '迟到',
  182. align:"center",
  183. dataIndex: 'latenessCost'
  184. },
  185. {
  186. title: '事假',
  187. align:"center",
  188. dataIndex: 'personalCost'
  189. },
  190. {
  191. title: '病假',
  192. align:"center",
  193. dataIndex: 'sickCost'
  194. },
  195. {
  196. title: '婚假',
  197. align:"center",
  198. dataIndex: 'marriageCost'
  199. },
  200. {
  201. title: '丧假',
  202. align:"center",
  203. dataIndex: 'funeralCost'
  204. },
  205. {
  206. title: '合计应扣',
  207. align:"center",
  208. dataIndex: 'totalDeduction'
  209. },
  210. {
  211. title: '实发合计',
  212. align:"center",
  213. dataIndex: 'actualOccurrence',
  214. width: 120,
  215. fixed:'right'
  216. },
  217. ],
  218. ipagination:{},
  219. queryParam:{
  220. beginDate:moment().subtract(1, 'months').format('YYYY-MM'),
  221. endDate:moment().subtract(1, 'months').format('YYYY-MM'),
  222. syHireType:['在职','退休反聘']
  223. },
  224. dataSource:[{}],
  225. // 请求参数
  226. // url: {
  227. // },
  228. }
  229. },
  230. watch:{
  231. dataSource(){
  232. this.$nextTick(()=>{
  233. const dom = this.$refs.tableRef.$el.getElementsByClassName('ant-table-body')[0];
  234. dom.addEventListener(
  235. 'scroll',
  236. () => {
  237. this.$refs.tableInfo.$el.querySelectorAll(
  238. '.ant-table-body'
  239. )[0].scrollLeft = dom.scrollLeft
  240. },
  241. true
  242. )
  243. })
  244. }
  245. },
  246. computed: {
  247. // 合计展示
  248. totalDataSource(){
  249. // 开票成本-衬衣 合计
  250. var item = {
  251. "name":"合计"
  252. };
  253. var allNumber = 0
  254. for (let row of this.dataSource){
  255. allNumber += row.actualOccurrence*1;
  256. }
  257. item.actualOccurrence= parseFloat(allNumber.toFixed(2));
  258. return [item];
  259. }
  260. },
  261. created () {
  262. this.getTableList()
  263. },
  264. methods: {
  265. getTableList(){
  266. var param = Object.assign({}, this.queryParam)
  267. param.syHireType = (param.syHireType).toString()
  268. getAction('/salary/salaryManagement/querySalaryTotalList',param).then(res=>{
  269. if(res.success){
  270. this.dataSource =res.result.records
  271. this.ipagination = {
  272. total: res.result.total,
  273. current: res.result.current,
  274. pageSize: res.result.size
  275. }
  276. }else{
  277. this.$message.error(res.message);
  278. }
  279. })
  280. },
  281. changeData(value){
  282. this.DateTime = value
  283. },
  284. onDateChange(status) {
  285. if(status){
  286. this.open = true;
  287. }else{
  288. this.open = false
  289. }
  290. },
  291. handlePanelChange2(value,mode){
  292. if (this.DateTime[1] && this.DateTime[1]._d != value[1]._d) {
  293. this.open = false;
  294. }
  295. this.DateTime = value
  296. this.queryParam.beginDate = this.DateTime[0]&&this.DateTime[0]!==''?moment(this.DateTime[0]).format('YYYY-MM'):''
  297. this.queryParam.endDate = this.DateTime[1]&&this.DateTime[1]!==''?moment(this.DateTime[1]).format('YYYY-MM'):''
  298. this.mode2 = [mode[0] === 'date' ? 'month' : mode[0], mode[1] === 'date' ? 'month' : mode[1]];
  299. },
  300. searchQuery(){
  301. this.queryParam.pageNo = 1
  302. this.getTableList()
  303. },
  304. searchReset(){
  305. this.queryParam={
  306. beginDate:moment().subtract(1, 'months').format('YYYY-MM'),
  307. endDate:moment().subtract(1, 'months').format('YYYY-MM'),
  308. syHireType:['在职','退休反聘']
  309. }
  310. this.getTableList()
  311. },
  312. handleTableChange(pagination, filters, sorter) {
  313. this.queryParam.pageNo = pagination.current
  314. this.queryParam.pageSize = pagination.pageSize
  315. this.getTableList()
  316. },
  317. showTotal(data) {
  318. return (
  319. <a-table
  320. ref="tableInfo"
  321. pagination={false}
  322. columns={this.columns}
  323. dataSource={this.totalDataSource || []}
  324. showHeader={false}
  325. scroll={{x:2000 }}
  326. ></a-table>
  327. )
  328. },
  329. }
  330. }
  331. </script>
  332. <style scoped lang="less">
  333. // @import '~@assets/less/common.less';
  334. /deep/ .ant-table-footer .ant-table-body {
  335. overflow: hidden !important;
  336. }
  337. /deep/.ant-table-footer{
  338. padding:0 !important;
  339. overflow: hidden !important;
  340. }
  341. /deep/.ant-table-fixed-left{
  342. min-width:180px !important
  343. }
  344. /deep/.ant-table-bordered .ant-table-thead > tr > th{
  345. min-width: 120px !important;
  346. }
  347. /deep/ .ant-table-bordered .ant-table-tbody > tr > td{
  348. min-width: 120px !important;
  349. }
  350. </style>