BdClockinMonthList.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  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 :md="6" :sm="8">
  8. <a-form-item label="人员">
  9. <a-input placeholder="请输入人员" v-model="queryParam.personName"></a-input>
  10. </a-form-item>
  11. </a-col>
  12. <a-col :md="6" :sm="8">
  13. <a-form-item label="账号">
  14. <a-input placeholder="请输入账号" v-model="queryParam.personId"></a-input>
  15. </a-form-item>
  16. </a-col>
  17. <a-col :md="6" :sm="8">
  18. <a-form-item label="日期">
  19. <a-month-picker valueFormat="YYYY-MM" @change="onChange" placeholder="请输入日期" v-model="queryParam.monthTime"></a-month-picker>
  20. </a-form-item>
  21. </a-col>
  22. <a-col :md="6" :sm="8">
  23. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  24. <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  25. <a-button type="primary" @click="syMonthReport" icon="reload" style="margin-left: 8px">同步至U8</a-button>
  26. </span>
  27. </a-col>
  28. </a-row>
  29. </a-form>
  30. </div>
  31. <!-- table区域-begin -->
  32. <div>
  33. <a-table class="j-table-force-nowrap" ref="table" size="middle" bordered rowKey="id" :columns="columns"
  34. :dataSource="dataSource" :pagination="ipagination" :loading="loading" :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
  35. @change="handleTableChange">
  36. <span slot="syU8" slot-scope="text, record, index">
  37. <a v-if="record.syU8 == 1 ">是</a>
  38. <a v-if="record.syU8 == 0 ">否</a>
  39. </span>
  40. </a-table>
  41. </div>
  42. <!-- table区域-end -->
  43. <!-- 表单区域 -->
  44. <!-- <ViewClockIn-modal ref="modalForm" @ok="modalFormOk"></ViewClockIn-modal> -->
  45. </a-card>
  46. </template>
  47. <script>
  48. import {
  49. JeecgListMixin
  50. } from '@/mixins/JeecgListMixin'
  51. import {getAction, postAction, deleteAction,putAction} from '@/api/manage'
  52. import JDictSelectTag from '@/components/dict/JDictSelectTag'
  53. import moment from 'moment';
  54. import 'moment/locale/zh-cn';
  55. export default {
  56. name: 'ViewClockInList',
  57. mixins: [JeecgListMixin],
  58. components: {
  59. JDictSelectTag
  60. },
  61. data() {
  62. return {
  63. moment,
  64. description: '考勤月报',
  65. // 表头
  66. columns: [
  67. {
  68. title: '日期',
  69. align: 'center',
  70. dataIndex: 'monthTime'
  71. },
  72. {
  73. title: '人员姓名',
  74. align: 'center',
  75. dataIndex: 'personName'
  76. },
  77. {
  78. title: '账号',
  79. align: 'center',
  80. dataIndex: 'personId'
  81. },
  82. {
  83. title: '考勤天数',
  84. align: 'center',
  85. dataIndex: 'workDay'
  86. },
  87. {
  88. title: '实际考勤天数',
  89. align: 'center',
  90. dataIndex: 'workDayReal'
  91. },
  92. {
  93. title: '本月加班时长',
  94. align: 'center',
  95. dataIndex: 'duration'
  96. },
  97. {
  98. title: '事假时长(时)',
  99. align: 'center',
  100. dataIndex: 'holidayTimeSj'
  101. },
  102. {
  103. title: '病假时长(天)',
  104. align: 'center',
  105. dataIndex: 'holidayTimeBj'
  106. },
  107. {
  108. title: '是否同步U8',
  109. align: 'center',scopedSlots: {
  110. customRender: 'syU8'
  111. }
  112. }
  113. ],
  114. url: {
  115. list: '/viewClockIn/bdClockinMonth/list',
  116. syMonthReport: '/viewClockIn/viewClockIn/syMonthReport'
  117. },
  118. }
  119. },
  120. computed: {
  121. importExcelUrl: function() {
  122. return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
  123. }
  124. },
  125. methods: {
  126. onChange(date, dateString) {
  127. console.log(date, dateString);
  128. // this.value = "2021-01-01"
  129. },
  130. syMonthReport() {
  131. let ids = "";
  132. var conText = "";
  133. let sqp1 = this.getQueryParams();
  134. if(sqp1['monthTime'] == 'undefined' || sqp1['monthTime'] == null || sqp1['monthTime'] == ''){
  135. this.$message.warning('请选择同步月份!');
  136. return false;
  137. }
  138. let nowDate = moment(sqp1['monthTime']).format('YYYY-MM');
  139. let that = this;
  140. for (var a = 0; a < this.selectedRowKeys.length; a++) {
  141. ids += this.selectedRowKeys[a] + ",";
  142. }
  143. if(ids == ""){
  144. conText = "是否同步所有员工" + nowDate + "月报?";
  145. }else{
  146. conText = "是否同步所选员工" + nowDate + "月报? 所选数量:" + this.selectedRowKeys.length;
  147. }
  148. that.$confirm({
  149. title: conText,
  150. content: "同步后不可修改,请确认操作!",
  151. onOk: function () {
  152. putAction(that.url.syMonthReport, {viewDate:nowDate,ids:ids}).then((res) => {
  153. if (res.success) {
  154. that.$message.success("同步成功");
  155. that.loadData();
  156. }else{
  157. that.$message.warning(res.message);
  158. }
  159. }).finally(() => {
  160. })
  161. }
  162. });
  163. }
  164. }
  165. }
  166. </script>
  167. <style scoped>
  168. @import '~@assets/less/common.less'
  169. </style>