Payroll.vue 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  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="6" :lg="7" :md="8" :sm="24">
  8. <a-form-item label="组织">
  9. <a-select v-model="queryParam.orgName">
  10. <a-select-option value="all">所有</a-select-option>
  11. <a-select-option value="Apparel Group">Apparel Group</a-select-option>
  12. <a-select-option value="宁波森语">宁波森语</a-select-option>
  13. <a-select-option value="马菲羊">马菲羊</a-select-option>
  14. </a-select>
  15. </a-form-item>
  16. </a-col>
  17. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  18. <a-form-item label="时间">
  19. <a-month-picker placeholder="请选择" :allowClear="false" v-model="yearWithMonth" @change="onChange" style="width:100% !important"/>
  20. </a-form-item>
  21. </a-col>
  22. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  23. <a-form-item label="类型">
  24. <a-select v-model="queryParam.type">
  25. <a-select-option value="all">所有</a-select-option>
  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>
  30. </a-form-item>
  31. </a-col>
  32. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  33. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  34. <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  35. <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  36. </span>
  37. </a-col>
  38. </a-row>
  39. </a-form>
  40. </div>
  41. <!-- 操作按钮区域 -->
  42. <div class="table-operator">
  43. <a-button @click="createPayroll" type="primary" icon="plus">生成工资单</a-button>
  44. </div>
  45. <!-- table区域-begin -->
  46. <div>
  47. <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
  48. <i class="anticon anticon-info-circle ant-alert-icon"></i>
  49. <span>已选择</span>
  50. <a style="font-weight: 600">
  51. {{ selectedRowKeys.length }}
  52. </a>
  53. <span>项</span>
  54. <a style="margin-left: 24px" @click="onClearSelected">清空</a>
  55. </div>
  56. <a-table
  57. ref="table"
  58. size="middle"
  59. bordered
  60. rowKey="id"
  61. :columns="columns"
  62. :dataSource="dataSource"
  63. :pagination="ipagination"
  64. :scroll="{x: 1000}"
  65. :loading="loading"
  66. :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
  67. @change="handleTableChange">
  68. <span slot="operation" slot-scope="text, record">
  69. <a @click="handleDetail(record)" >查看详情</a>
  70. <a-divider type="vertical" />
  71. <a @click="handleDownload(record)" >下载</a>
  72. <a-divider type="vertical" />
  73. <a @click="handleexport(record)" >导出</a>
  74. </span>
  75. </a-table>
  76. </div>
  77. <!-- table区域-end -->
  78. <!-- 表单区域 -->
  79. <PayrollDetail ref="PayrollDetail"></PayrollDetail>
  80. <AnnualLeavePayroll ref="AnnualLeavePayroll"></AnnualLeavePayroll>
  81. <OvertimePayroll ref="OvertimePayroll"></OvertimePayroll>
  82. <uploadModal ref="uploadModal"></uploadModal>
  83. </a-card>
  84. </template>
  85. <script>
  86. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  87. import { getAction } from '@/api/manage'
  88. import moment from 'moment'
  89. import PayrollDetail from './modules/PayrollDetail.vue'
  90. import AnnualLeavePayroll from './modules/AnnualLeavePayroll.vue'
  91. import OvertimePayroll from './modules/OvertimePayroll.vue'
  92. import uploadModal from './modules/uploadModal.vue'
  93. import JSearchSelectTag from '@/components/dict/JSearchSelectTag'
  94. export default {
  95. name: "Payroll",
  96. mixins: [JeecgListMixin],
  97. components: {
  98. moment,
  99. PayrollDetail,
  100. JSearchSelectTag,
  101. uploadModal,
  102. AnnualLeavePayroll,
  103. OvertimePayroll
  104. },
  105. data () {
  106. return {
  107. description: '工资单列表',
  108. yearWithMonth:'',
  109. selectedRowKeys:[],
  110. selectedRows:[],
  111. // 表头
  112. columns: [
  113. {
  114. title: '序号',
  115. width: 80,
  116. align:"center",
  117. dataIndex: 'index',
  118. customRender:function (t, r, index) {
  119. return parseInt(index)+1;
  120. }
  121. },
  122. {
  123. title: '类型',
  124. align:"center",
  125. dataIndex: 'type'
  126. },
  127. {
  128. title: '组织',
  129. align:"center",
  130. dataIndex: 'orgName'
  131. },
  132. {
  133. title: '发放人数',
  134. align:"center",
  135. dataIndex: 'numberPeople'
  136. },
  137. {
  138. title: '发放薪水',
  139. align:"center",
  140. dataIndex: 'salary'
  141. },
  142. {
  143. title: '缴纳个税',
  144. align:"center",
  145. dataIndex: 'personalTax'
  146. },
  147. {
  148. title: '生成时间',
  149. align:"center",
  150. dataIndex: 'generationTime'
  151. },
  152. {
  153. title: '版本',
  154. align:"center",
  155. dataIndex: 'version'
  156. },
  157. {
  158. title: '操作',
  159. align:"center",
  160. dataIndex: 'operation',
  161. width: 200,
  162. scopedSlots: { customRender: 'operation' }
  163. },
  164. ],
  165. queryParam:{},
  166. dataSource:[],
  167. // 请求参数
  168. // url: {
  169. // },
  170. }
  171. },
  172. computed: {},
  173. created () {
  174. this.getTableList()
  175. },
  176. methods: {
  177. onChange(data){
  178. this.yearWithMonth = data
  179. this.queryParam.yearWithMonth = this.yearWithMonth?moment(this.yearWithMonth).format('YYYY-MM'):''
  180. },
  181. getTableList(){
  182. this.loading = true
  183. getAction('/salary/salaryManagement/list',this.queryParam).then(res=>{
  184. if(res.success){
  185. this.loading = false
  186. this.dataSource =res.result.records
  187. this.ipagination = {
  188. total: res.result.total,
  189. current: res.result.current,
  190. pageSize: res.result.size
  191. }
  192. }else{
  193. this.$message.error(res.message);
  194. }
  195. })
  196. },
  197. createPayroll(){
  198. this.$refs.uploadModal.visible = true
  199. },
  200. handleDetail(record){
  201. if(record.type=='加班工资单'){
  202. this.$refs.OvertimePayroll.visible = true
  203. this.$refs.OvertimePayroll.detail(record.id)
  204. }else if(record.type=='年休工资单'){
  205. this.$refs.AnnualLeavePayroll.visible = true
  206. }else if(record.type=='月度工资'){
  207. this.$refs.PayrollDetail.visible = true
  208. this.$refs.PayrollDetail.detail(record.id)
  209. }
  210. },
  211. handleDownload(record){
  212. },
  213. handleexport(record){
  214. },
  215. onSelectChange(selectedRowKeys, selectionRows) {
  216. this.selectedRowKeys = selectedRowKeys;
  217. this.selectedRows = selectionRows;
  218. },
  219. handleTableChange(pagination, filters, sorter) {
  220. this.queryParam.pageNo = pagination.current
  221. this.queryParam.pageSize = pagination.pageSize
  222. this.getTableList()
  223. },
  224. }
  225. }
  226. </script>
  227. <style scoped>
  228. @import '~@assets/less/common.less'
  229. </style>