ViewClockUserInfo.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712
  1. <template>
  2. <a-card :bordered="false">
  3. <!-- table区域-begin -->
  4. <div class="ant-alert ant-alert-info" style="margin-bottom: 10px;margin-top: -40px;">
  5. <!--<i class="anticon anticon-info-circle ant-alert-icon"></i>
  6. 已选择 <a style="font-weight: 600">{{selectedRowKeys.length }}</a>项
  7. <a style="margin-left: 24px" @click="onClearSelected">清空</a> -->
  8. <i class="anticon anticon-info-circle ant-alert-icon"></i>
  9. 姓名: <a style="margin-right: 40px"> {{userName }}</a>
  10. <i class="anticon anticon-info-circle ant-alert-icon"></i>
  11. 部门: <a style="margin-right: 40px">{{deptName}}</a>
  12. <i class="anticon anticon-info-circle ant-alert-icon"></i>
  13. 员工类型: <a style="margin-right: 40px">{{userType}}</a>
  14. <i class="anticon anticon-info-circle ant-alert-icon"></i>
  15. 月份:
  16. <!-- <a style="font-weight: 600;margin-right: 6px" @click="onClearSelected"> < </a> -->
  17. <a-month-picker format="YYYY-MM" placeholder="请输入考勤月份" v-model="headMonth" @change="onDateChange"/>
  18. <!-- <a style="font-weight: 600;margin-left: 6px" @click="onClearSelected"> > </a> -->
  19. <i class="anticon anticon-info-circle ant-alert-icon"></i>
  20. <a style="margin-left: 40px" @click="errorInfoShow()">异常打卡</a>
  21. <i class="anticon anticon-info-circle ant-alert-icon"></i>
  22. <a style="margin-left: 40px" @click="jiaBanInfoShow()">加班打卡</a>
  23. <i class="anticon anticon-info-circle ant-alert-icon"></i>
  24. <a-dropdown style="margin-left: 40px" v-has="'viewClockUserInfo:more'">
  25. <a class="ant-dropdown-link">
  26. 更多操作 <a-icon type="down"/>
  27. </a>
  28. <!-- 123-->
  29. <a-menu slot="overlay">
  30. <a-menu-item v-has="'viewClockUserInfo:fuxin'">
  31. <a-popconfirm title="确定对所选记录付薪吗?" @confirm="() => handleInfo('1')">
  32. <a>付薪</a>
  33. </a-popconfirm>
  34. </a-menu-item>
  35. <a-menu-item v-has="'viewClockUserInfo:tiaoxiu'">
  36. <a-popconfirm title="确定对所选记录累计调休吗?" @confirm="() => handleInfo('2')">
  37. <a>累计调休</a>
  38. </a-popconfirm>
  39. </a-menu-item>
  40. <a-menu-item v-has="'viewClockUserInfo:hulue'">
  41. <a-popconfirm title="确定对所选记录忽略吗?" @confirm="() => handleInfo('3')">
  42. <a>忽略</a>
  43. </a-popconfirm>
  44. </a-menu-item>
  45. </a-menu>
  46. </a-dropdown>
  47. </div>
  48. <a-table
  49. :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
  50. ref="table"
  51. size="middle"
  52. bordered
  53. rowKey="viewDate"
  54. :columns="columns"
  55. :dataSource="dataSource"
  56. :pagination="ipagination"
  57. :loading="loading"
  58. @change="handleTableChange" :scroll="{ x: 1000, y: 550 }">
  59. <span slot="ShiftTime" slot-scope="text, record, index">
  60. {{record.shiftRealTimeS}} - {{record.shiftRealTimeX}}
  61. </span>
  62. <span slot="customTime" slot-scope="text, record, index">
  63. {{text.slice(10)}}
  64. </span>
  65. <span slot="customDuration" slot-scope="text, record, index">
  66. <!-- <a-tag @click="workInfo(record)" color="pink" v-if="record.workOvertime != null && record.workOvertime > 0 ">
  67. {{text}}
  68. </a-tag>
  69. <a @click="workInfo(record)" v-else>{{text}}</a> -->
  70. <span v-if="record.setInfo > 0 ">
  71. <a-tag title="点击查看加班详情" @click="workInfo(record)" color="pink" >{{text}}</a-tag>
  72. </span>
  73. <span v-if="record.setInfo == 0 ">
  74. <a-tag title="点击查看加班详情" @click="workInfo(record)" color="#87d068" >{{text}}</a-tag>
  75. </span>
  76. </span>
  77. <a-badge slot="shiftType" slot-scope="text, record, index">
  78. <!-- ruleType 上班类型 1.固定时间上下班,2.按班次上下班,3.自由上下班 -->
  79. <a-tag color="pink" v-if="record.showState == '1'">
  80. 异常
  81. </a-tag>
  82. <a-tag color="#87d068" v-if="record.showState == '2'">
  83. 正常
  84. </a-tag>
  85. <a-icon v-if="record.showState == '2'" title="该员工在未排班或休息班打卡" slot="count" type="exclamation-circle" style="color: #f52b02" />
  86. <a-tag color="#87d068" v-if="record.showState == '0'">
  87. 正常
  88. </a-tag>
  89. </a-badge>
  90. <span slot="action" slot-scope="text, record">
  91. <!-- <a v-has="'viewClockUserInfo:jiaozhun'" @click="handleEdit(record)">校准</a> -->
  92. <a v-has="'viewClockUserInfo:jiaozhun'" @click="showModal(record)">校准</a>
  93. <!-- <a-popconfirm v-has="'viewClockUserInfo:jiaozhun'" title="确定忽略此异常吗?" @confirm="() => errorInfo(record)">
  94. <a>校准</a>
  95. </a-popconfirm>-->
  96. <a-divider type="vertical"/>
  97. <a-dropdown v-has="'viewClockUserInfo:more'">
  98. <a class="ant-dropdown-link">
  99. 更多 <a-icon type="down"/>
  100. </a>
  101. <a-menu slot="overlay">
  102. <a-menu-item v-has="'viewClockUserInfo:fuxin'">
  103. <a-popconfirm title="确定付薪吗?" @confirm="() => fuXinInfo('2','1',record)">
  104. <a>付薪</a>
  105. </a-popconfirm>
  106. </a-menu-item>
  107. <a-menu-item v-has="'viewClockUserInfo:tiaoxiu'">
  108. <a-popconfirm title="确定累计调休吗?" @confirm="() => fuXinInfo('2','2',record)">
  109. <a>累计调休</a>
  110. </a-popconfirm>
  111. </a-menu-item>
  112. <a-menu-item v-has="'viewClockUserInfo:hulue'">
  113. <a-popconfirm title="确定忽略吗?" @confirm="() => fuXinInfo('2','3',record)">
  114. <a>忽略</a>
  115. </a-popconfirm>
  116. </a-menu-item>
  117. </a-menu>
  118. </a-dropdown>
  119. </span>
  120. </a-table>
  121. <!-- table区域-end -->
  122. <!-- 表单区域 -->
  123. <Jiao-Zhun-Modal ref="modalForm" @ok="modalFormOk"></Jiao-Zhun-Modal>
  124. <Select-User-Modal ref="selectUserModal" @selectFinished="selectOK"></Select-User-Modal>
  125. <dept-role-user-modal ref="deptRoleUser"></dept-role-user-modal>
  126. <a-modal width="1200px"
  127. v-model="modal2Visible" title="加班信息详情" :footer="null"
  128. centered @ok="() => (modal2Visible = false)" >
  129. <a-table :columns="columns2" :data-source="data" rowKey="id">
  130. <span slot="action" slot-scope="text, record">
  131. <a-dropdown v-has="'viewClockUserInfo:more'">
  132. <a class="ant-dropdown-link">
  133. 更多 <a-icon type="down"/>
  134. </a>
  135. <a-menu slot="overlay">
  136. <a-menu-item v-has="'viewClockUserInfo:fuxin'">
  137. <a-popconfirm title="确定付薪吗?" @confirm="() => fuXinInfo('1','1',record)">
  138. <a>付薪</a>
  139. </a-popconfirm>
  140. </a-menu-item>
  141. <a-menu-item v-has="'viewClockUserInfo:tiaoxiu'">
  142. <a-popconfirm title="确定累计调休吗?" @confirm="() => fuXinInfo('1','2',record)">
  143. <a>累计调休</a>
  144. </a-popconfirm>
  145. </a-menu-item>
  146. <a-menu-item v-has="'viewClockUserInfo:hulue'">
  147. <a-popconfirm title="确定忽略吗?" @confirm="() => fuXinInfo('1','3',record)">
  148. <a>忽略</a>
  149. </a-popconfirm>
  150. </a-menu-item>
  151. </a-menu>
  152. </a-dropdown>
  153. </span>
  154. </a-table>
  155. </a-modal>
  156. <a-modal
  157. title="校准忽略本次异常"
  158. :visible="visible"
  159. :confirm-loading="confirmLoading"
  160. @ok="handleOk"
  161. @cancel="handleCancel"
  162. >
  163. <a-input placeholder="请填写忽略原因" v-model="errorText"></a-input>
  164. </a-modal>
  165. </a-card>
  166. </template>
  167. <script>
  168. import {JeecgListMixin} from '@/mixins/JeecgListMixin'
  169. import {getAction, postAction, deleteAction,putAction} from '@/api/manage'
  170. import SelectUserModal from '../modules/SelectUserModal'
  171. import JiaoZhunModal from './JiaoZhunModal'
  172. import DeptRoleUserModal from '../modules/DeptRoleUserModal'
  173. import moment from 'moment';
  174. import 'moment/locale/zh-cn';
  175. import {
  176. fuXinInfo
  177. } from '@/api/api'
  178. export default {
  179. name: "DeptUserInfo",
  180. mixins: [JeecgListMixin],
  181. components: {
  182. DeptRoleUserModal,
  183. SelectUserModal,
  184. JiaoZhunModal
  185. },
  186. data() {
  187. return {
  188. errorViewDate:'',
  189. errorSt:'',
  190. errorUserId:'',
  191. errorText: '',//校准弹框属性
  192. visible: false,//校准弹框属性
  193. confirmLoading: false,//校准弹框属性
  194. durationCommitDate:'',//加班申请时间
  195. durationBeginDate:'',//加班开始时间
  196. durationEndDate:'',//加班结束时间
  197. duration:'',//加班时长
  198. demo:'',//加班事由
  199. modal2Visible: false,
  200. moment,
  201. description: '员工考勤信息',
  202. userName:'',//标题员工姓名
  203. deptName:'',//标题员工部门
  204. userType:'',//标题员工类型
  205. headMonth:'',//标题选择月份
  206. newMonth:'',//更改时选择的月份
  207. currentDeptId: '',
  208. data : [],//加班信息弹框
  209. columns2:[{
  210. title: '加班申请时间',
  211. align: "center",
  212. dataIndex: 'commitDate'
  213. },{
  214. title: '加班开始时间',
  215. align: "center",
  216. dataIndex: 'beginDate'
  217. },{
  218. title: '加班结束时间',
  219. align: "center",
  220. dataIndex: 'endDate'
  221. },{
  222. title: '加班时长',
  223. align: "center",
  224. dataIndex: 'duration'
  225. },{
  226. title: '加班事由',
  227. align: "center",
  228. dataIndex: 'demo'
  229. },{
  230. title: '处理方式',
  231. align: "center",
  232. dataIndex: 'setInfo'
  233. },
  234. {
  235. title: '操作',
  236. dataIndex: 'action',
  237. scopedSlots: {customRender: 'action'},
  238. align: "center",
  239. width: 120
  240. }],
  241. // 表头
  242. columns: [{
  243. title: '日期',
  244. align: "center",
  245. dataIndex: 'viewDate'
  246. },
  247. {
  248. title: '星期',
  249. align: "center",
  250. dataIndex: 'weekDate'
  251. },
  252. {
  253. title: '班次',
  254. align: "center",
  255. dataIndex: 'name'
  256. },
  257. {
  258. title: '班次时间',
  259. align: "center",
  260. scopedSlots: {
  261. customRender: 'ShiftTime'
  262. }
  263. },
  264. {
  265. title: '状态',
  266. align: "center",
  267. scopedSlots: {customRender: 'shiftType'},
  268. },
  269. {
  270. title: '最早打卡时间',
  271. align: "center",
  272. dataIndex: 'gotoTime',
  273. scopedSlots: {
  274. customRender: 'customTime'
  275. }
  276. },
  277. {
  278. title: '最迟打卡时间',
  279. align: "center",
  280. dataIndex: 'closingTime',
  281. scopedSlots: {
  282. customRender: 'customTime'
  283. }
  284. },
  285. {
  286. title: '打卡次数',
  287. align: "center",
  288. dataIndex: 'attendanceCount'
  289. },
  290. // {
  291. // title: '加班申请',
  292. // align: "center",
  293. // dataIndex: 'demo',
  294. // width: 200
  295. // },
  296. {
  297. title: '加班时间',
  298. align: "center",
  299. dataIndex: 'duration',
  300. width: 100,
  301. scopedSlots: {
  302. customRender: 'customDuration'
  303. }
  304. },
  305. {
  306. title: '校准人',
  307. align: "center",
  308. dataIndex: 'jzBy'
  309. },
  310. {
  311. title: '操作',
  312. dataIndex: 'action',
  313. scopedSlots: {customRender: 'action'},
  314. align: "center",
  315. width: 120
  316. }],
  317. url: {
  318. handleInfo: '/viewClockIn/viewClockIn/handleInfo',
  319. errorInfo: '/viewClockIn/viewClockIn/errorInfo',
  320. getJiaBan: '/workOvertime/workOvertime/getJiaBan',
  321. list: '/viewClockIn/viewClockIn/list',
  322. // list: "/sys/user/departUserList",
  323. edit: "/sys/user/editSysDepartWithUser",
  324. delete: "/sys/user/deleteUserInDepart",
  325. deleteBatch: "/sys/user/deleteUserInDepartBatch",
  326. }
  327. }
  328. },
  329. created() {
  330. let yy = new Date().getFullYear();
  331. let mm = new Date().getMonth()+1;
  332. // let dd = new Date().getDate();
  333. this.headMonth = yy+"-"+mm;
  334. },
  335. methods: {
  336. handleInfo(st){
  337. if(this.selectedRowKeys.length < 1){
  338. this.$message.warning("您没有选择任何数据");
  339. return;
  340. }
  341. let that = this;
  342. //st:1付薪 2累计调休 3忽略
  343. let ids = "";
  344. let username = "";
  345. let dataSource = this.dataSource;
  346. // console.log("-===="+this.dataSource);
  347. let userIds = "";
  348. this.selectUserRows = [];
  349. for (let i = 0, len = dataSource.length; i < len; i++) {
  350. if (this.selectedRowKeys.includes(dataSource[i].viewDate)) {
  351. if(dataSource[i].duration == null || dataSource[i].duration == ''){
  352. this.$message.warning(dataSource[i].viewDate+"该员工当日没有加班申请信息,请勿此操作");
  353. return;
  354. }
  355. username = dataSource[i].username;
  356. ids += dataSource[i].viewDate + ",";
  357. }
  358. }
  359. putAction(this.url.handleInfo, {viewDate:ids,st:st,username:username}).then((res) => {
  360. if (res.success) {
  361. that.$message.success("操作成功");
  362. that.loadData();
  363. } else {
  364. that.$message.warning(res.message);
  365. that.loadData();
  366. }
  367. }).finally(() => {
  368. that.selectedRowKeys = [];
  369. })
  370. },
  371. errorInfoShow(){
  372. this.queryParam.showState=1;
  373. this.loadData(1);
  374. this.queryParam.showState=null;
  375. },
  376. jiaBanInfoShow(){
  377. this.queryParam.duration=1;
  378. this.loadData(1);
  379. this.queryParam.duration=null;
  380. },
  381. showModal(record) {
  382. this.errorViewDate = record.viewDate;
  383. this.errorUserId = record.userId;
  384. this.errorSt = record.errorState;
  385. this.errorText = record.errorText;
  386. this.visible = true;
  387. },
  388. handleOk(e) {
  389. if(this.errorSt == 0){
  390. this.$message.warning("已校准过,无需再次校准");
  391. return;
  392. }
  393. if(this.errorText == null || this.errorText == ''){
  394. this.$message.warning("请填写忽略原因");
  395. return;
  396. }
  397. let that = this;
  398. this.confirmLoading = true;
  399. putAction(this.url.errorInfo, {viewDate:this.errorViewDate,userId:this.errorUserId,errorText:this.errorText}).then((res) => {
  400. if (res.success) {
  401. that.$message.success("操作成功");
  402. that.loadData();
  403. } else {
  404. that.$message.warning(res.message);
  405. that.loadData();
  406. }
  407. }).finally(() => {
  408. this.confirmLoading = false;
  409. this.visible = false;
  410. })
  411. },
  412. handleCancel(e) {
  413. console.log('Clicked cancel button');
  414. this.visible = false;
  415. },
  416. onDateChange: function (value, dateString) {
  417. this.newMonth = dateString;
  418. this.$emit('clearSelectedDepartKeys');
  419. // this.userName = e.node.dataRef.title;
  420. this.queryParam.mDate=dateString;
  421. this.loadData(1);
  422. // console.log(value+"------------"+dateString);
  423. },
  424. searchReset() {
  425. this.queryParam = {}
  426. this.loadData(1);
  427. },
  428. loadData(arg) {
  429. if (!this.url.list) {
  430. this.$message.error("请设置url.list属性!")
  431. return
  432. }
  433. if (!this.userName) {
  434. return
  435. }
  436. //加载数据 若传入参数1则加载第一页的内容
  437. if (arg === 1) {
  438. this.ipagination.current = 1;
  439. }
  440. //if (this.currentDeptId === '') return;
  441. let params = this.getQueryParams();//查询条件
  442. params.depId = this.currentDeptId;
  443. // params = {'endViewDate':'userName'}
  444. // console.log("============="+params.userName);
  445. getAction(this.url.list, params).then((res) => {
  446. if (res.success && res.result) {
  447. this.dataSource = res.result.records;
  448. this.ipagination.total = res.result.total;
  449. }
  450. })
  451. },
  452. batchDel: function () {
  453. if (!this.url.deleteBatch) {
  454. this.$message.error("请设置url.deleteBatch属性!")
  455. return
  456. }
  457. if (!this.currentDeptId) {
  458. this.$message.error("未选中任何部门,无法取消部门与用户的关联!")
  459. return
  460. }
  461. if (this.selectedRowKeys.length <= 0) {
  462. this.$message.warning('请选择一条记录!');
  463. return;
  464. } else {
  465. var ids = "";
  466. for (var a = 0; a < this.selectedRowKeys.length; a++) {
  467. ids += this.selectedRowKeys[a] + ",";
  468. }
  469. var that = this;
  470. console.log(this.currentDeptId);
  471. this.$confirm({
  472. title: "确认取消",
  473. content: "是否取消用户与选中部门的关联?",
  474. onOk: function () {
  475. deleteAction(that.url.deleteBatch, {depId: that.currentDeptId, userIds: ids}).then((res) => {
  476. if (res.success) {
  477. that.$message.success("删除用户与选中部门关系成功!");
  478. that.loadData();
  479. that.onClearSelected();
  480. } else {
  481. that.$message.warning(res.message);
  482. }
  483. });
  484. }
  485. });
  486. }
  487. },
  488. handleDelete: function (id) {
  489. if (!this.url.delete) {
  490. this.$message.error("请设置url.delete属性!")
  491. return
  492. }
  493. if (!this.currentDeptId) {
  494. this.$message.error("未选中任何部门,无法取消部门与用户的关联!")
  495. return
  496. }
  497. var that = this;
  498. deleteAction(that.url.delete, {depId: this.currentDeptId, userId: id}).then((res) => {
  499. if (res.success) {
  500. that.$message.success("删除用户与选中部门关系成功!");
  501. if (this.selectedRowKeys.length>0){
  502. for(let i =0; i<this.selectedRowKeys.length;i++){
  503. if (this.selectedRowKeys[i] == id){
  504. this.selectedRowKeys.splice(i,1);
  505. break;
  506. }
  507. }
  508. }
  509. that.loadData();
  510. } else {
  511. that.$message.warning(res.message);
  512. }
  513. });
  514. },
  515. open(selectedKeys, e) {
  516. if(e.node.dataRef.orgType == 1 || e.node.dataRef.orgType == 2 || e.node.dataRef.orgType == 3){
  517. // this.$message.warn("点击左侧加减号,展开或者收起菜单!")
  518. return;
  519. }
  520. this.queryParam = {}
  521. let arr = e.node.dataRef.title.split('(');//姓名
  522. let arr2 = e.node.$parent.title.split('(');//上级部门
  523. this.userName = arr[0];//e.node.dataRef.title;
  524. this.deptName = arr2[0];//e.node.$parent.title;
  525. this.userType = e.node.dataRef.orgType;//员工类型
  526. this.queryParam.userName= arr[0];//e.node.dataRef.title;
  527. this.queryParam.mDate=moment(this.headMonth).format('YYYY-MM');
  528. this.loadData(1);
  529. },
  530. clearList() {
  531. this.currentDeptId = '';
  532. this.dataSource = [];
  533. },
  534. hasSelectDept() {
  535. if (this.currentDeptId == '') {
  536. this.$message.error("请选择一个部门!")
  537. return false;
  538. }
  539. return true;
  540. },
  541. handleAddUserDepart() {
  542. if (this.currentDeptId == '' ) {
  543. this.$message.error("请选择一个部门!")
  544. } else {
  545. this.$refs.selectUserModal.visible = true;
  546. }
  547. },
  548. handleEdit: function (record) {
  549. this.$refs.modalForm.title = "校准";
  550. this.$refs.modalForm.departDisabled = true;
  551. this.$refs.modalForm.disableSubmit = false;
  552. this.$refs.modalForm.startDate = record.gotoTime;
  553. this.$refs.modalForm.endDate = record.closingTime;
  554. if(record.gotoTime == null || record.gotoTime == ''){
  555. this.$refs.modalForm.startDate = record.viewDate;
  556. }
  557. if(record.closingTime == null || record.closingTime == ''){
  558. this.$refs.modalForm.endDate = record.viewDate;
  559. }
  560. this.$refs.modalForm.startDateYs = record.gotoTime;
  561. this.$refs.modalForm.endDateYs = record.closingTime;
  562. this.$refs.modalForm.jzTime = record.jzTime;
  563. this.$refs.modalForm.jzBy = record.jzBy;
  564. this.$refs.modalForm.viewDate = record.viewDate;
  565. this.$refs.modalForm.username = record.userId;
  566. this.$refs.modalForm.setInfo = record.setInfo;
  567. this.$refs.modalForm.add(record);
  568. },
  569. handleAdd: function () {
  570. if (this.currentDeptId == '') {
  571. this.$message.error("请选择一个部门!")
  572. } else {
  573. this.$refs.modalForm.departDisabled = true;
  574. this.$refs.modalForm.userDepartModel.departIdList = [this.currentDeptId]; //传入一个部门id
  575. this.$refs.modalForm.add();
  576. this.$refs.modalForm.title = "新增";
  577. }
  578. },
  579. selectOK(data) {
  580. let params = {};
  581. params.depId = this.currentDeptId;
  582. params.userIdList = [];
  583. for (var a = 0; a < data.length; a++) {
  584. params.userIdList.push(data[a]);
  585. }
  586. postAction(this.url.edit, params).then((res) => {
  587. if (res.success) {
  588. this.$message.success(res.message);
  589. this.loadData();
  590. } else {
  591. this.$message.warning(res.message);
  592. }
  593. })
  594. },
  595. errorInfo(record){//校准
  596. if(record.errorState == 0){
  597. this.$message.warning("已校准过,无需再次校准");
  598. return;
  599. }
  600. let that = this;
  601. putAction(this.url.errorInfo, {viewDate:record.viewDate,userId:record.userId}).then((res) => {
  602. if (res.success) {
  603. that.$message.success("操作成功");
  604. that.loadData();
  605. } else {
  606. that.$message.warning(res.message);
  607. that.loadData();
  608. }
  609. }).finally(() => {
  610. })
  611. },
  612. fuXinInfo(w,st,record){//薪资操作
  613. // w 1:弹框中方法,2列表中方法
  614. // st 1付薪,2累计调休,3忽略
  615. // if(record.setInfo != '' && record.setInfo != null){
  616. // this.$message.warning("已设置过,不能再次设置");
  617. // return;
  618. // }
  619. if(record.duration == '' || record.duration == null){
  620. this.$message.warning("该员工当日没有加班申请信息");
  621. return;
  622. }
  623. let userId = null;
  624. if(record.userId == '' || record.userId == null){
  625. userId = record.person;
  626. }else{
  627. userId = record.userId;
  628. }
  629. let that = this;
  630. fuXinInfo({viewDate:record.viewDate,viewDate1:record.beginDate,userId:userId,pkId:record.id,st:st,w:w}).then((res) => {
  631. if (res.success) {
  632. that.$message.success("已成功设置");
  633. that.loadData();
  634. } else {
  635. that.$message.warning(res.message);
  636. that.loadData();
  637. }
  638. });
  639. that.modal2Visible = false;
  640. },
  641. workInfo(record){//点击加班时间事件
  642. let that = this;
  643. putAction(this.url.getJiaBan, {viewDate:record.viewDate,username:record.username}).then((res) => {
  644. that.data = res;
  645. }).finally(() => {
  646. that.modal2Visible = true;
  647. })
  648. }
  649. }
  650. }
  651. </script>
  652. <style scoped>
  653. /** Button按钮间距 */
  654. .ant-btn {
  655. margin-left: 3px
  656. }
  657. .ant-card {
  658. margin-left: -30px;
  659. margin-right: -30px;
  660. }
  661. .table-page-search-wrapper {
  662. margin-top: -16px;
  663. margin-bottom: 16px;
  664. }
  665. </style>