check_details.html 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. {extend name="common/common2" /}
  2. {block name="main"}
  3. <div class="row">
  4. <div class="col-sm-12">
  5. <div class="ibox float-e-margins">
  6. <div class="ibox-content">
  7. <div id="vueapp">
  8. <div style="min-height:500px;overflow: auto;padding: 15px 20px;">
  9. <h4>打卡记录</h4>
  10. <p v-if="info && info.classId === 0">
  11. 未安排考勤
  12. </p>
  13. <el-timeline v-if="info">
  14. <template v-for="(item,index) in info.content">
  15. <el-timeline-item :key="index" :timestamp="`第${Number(index) + 1}次上班 ${item.stime}`" placement="top">
  16. <div>
  17. <div v-if="item.slist && item.slist.length > 0">
  18. <div v-for="(item2,index2) in item.slist" :key="index2">
  19. <h4>
  20. {{ item2.create_time }} ~~
  21. <span>
  22. {{ item2.result }}
  23. <el-link v-if="info.status === 1 && item2.effective === 1 && (item2.status === 1||item2.status === 2)" type="warning" @click="changeAttendance(info.id,item.stime,1,item2.status)">
  24. 修改
  25. </el-link>
  26. </span>
  27. </h4>
  28. </div>
  29. </div>
  30. <div v-if="info.status === 1 && !item.slist || item.slist.length === 0">
  31. <el-link type="warning" @click="changeAttendance(info.id,item.stime,1,0)">
  32. 缺卡
  33. </el-link>
  34. </div>
  35. </div>
  36. </el-timeline-item>
  37. <el-timeline-item :key="`aa${index}`" :timestamp="`第${Number(index) + 1}次下班 ${item.etime}`" placement="top">
  38. <div>
  39. <div v-if="item.elist && item.elist.length > 0">
  40. <div v-for="(item2,index2) in item.elist" :key="index2">
  41. <h4>
  42. {{ item2.create_time }} ~~
  43. <span>
  44. {{ item2.result }}
  45. <el-link v-if="info.status === 1 && item2.effective === 1 && (item2.status === 1||item2.status === 2)" type="warning" @click="changeAttendance(info.id,item.etime,2,item2.status)">
  46. 修改
  47. </el-link>
  48. </span>
  49. </h4>
  50. </div>
  51. </div>
  52. <div v-if="info.status === 1 && !item.elist || item.elist.length === 0">
  53. <el-link type="warning" @click="changeAttendance(info.id,item.etime,2,0)">
  54. 缺卡
  55. </el-link>
  56. </div>
  57. </div>
  58. </el-timeline-item>
  59. </template>
  60. </el-timeline>
  61. <div v-if="info && info.leave.length > 0">
  62. <h4>请假记录</h4>
  63. <el-table :data="info.leave" style="width: 100%">
  64. <el-table-column prop="leaveType" label="请假类型" />
  65. <el-table-column prop="curDays" label="请假天数" />
  66. <el-table-column prop="startTime" label="开始时间" />
  67. <el-table-column prop="endTime" label="结束时间" />
  68. </el-table>
  69. </div>
  70. <el-dialog
  71. v-if="2"
  72. title="修改打卡信息"
  73. width="400px"
  74. :visible.sync="dialogFormVisible2"
  75. :append-to-body="true"
  76. center
  77. @close="handleCloseDialog2"
  78. >
  79. <el-form ref="form" :model="form" label-width="100px">
  80. <el-form-item label="操作" prop="enable">
  81. <el-radio v-model="form.type" label="1">
  82. 正常
  83. </el-radio>
  84. <el-radio v-model="form.type" label="2">
  85. <span v-if="form.cate === 1">迟到</span>
  86. <span v-if="form.cate === 2">早退</span>
  87. </el-radio>
  88. </el-form-item>
  89. <el-form-item label="分钟" prop="min">
  90. <el-input v-model="form.min" type="number" min="0" placeholder="" />
  91. </el-form-item>
  92. <el-form-item>
  93. <el-button type="primary" :loading="flag" @click="submitbtn('form')">
  94. 确定
  95. </el-button>
  96. </el-form-item>
  97. </el-form>
  98. </el-dialog>
  99. </div>
  100. </div>
  101. </div>
  102. </div>
  103. </div>
  104. </div>
  105. {/block}
  106. {block name="script"}
  107. <script>
  108. var info = <?=json_encode($info)?>;
  109. new Vue({
  110. el: '#vueapp',
  111. data: function() {
  112. return {
  113. info: info,
  114. dialogFormVisible2:false,
  115. form : {
  116. type: '1',
  117. time: '',
  118. min: 0,
  119. id: 0,
  120. cate: 1,
  121. status: 0,
  122. },
  123. flag:false
  124. }
  125. },
  126. watch: {
  127. },
  128. methods: {
  129. // 修改打卡结果
  130. changeAttendance(id, time, cate, status) {
  131. console.log(id, time, cate, status);
  132. this.form = {
  133. type: '1',
  134. time,
  135. min: 0,
  136. id,
  137. cate,
  138. status,
  139. };
  140. this.dialogFormVisible2 = true;
  141. },
  142. handleCloseDialog2() {
  143. this.dialogFormVisible2 = false;
  144. },
  145. submitbtn() { //eslint-disable-line
  146. if (Number(this.form.type) === 2 && Number(this.form.min) <= 0) {
  147. layer.msg('分钟数必须大于0')
  148. return false;
  149. }
  150. // this.flag = true;
  151. let that = this;
  152. $.ajax({
  153. url: "{:url('AttendanceRecord/changeAttendance')}",
  154. type: 'POST',
  155. data: this.form,
  156. success: function(data){
  157. console.log(data);
  158. if(data.code == 1){
  159. this.flag = false;
  160. this.dialogFormVisible2 = false;
  161. window.location.reload();
  162. }else{
  163. layer.msg('操作失败')
  164. }
  165. that.flag = false;
  166. },
  167. error: function (){
  168. that.flag = false;
  169. }
  170. });
  171. }
  172. }
  173. })
  174. </script>
  175. {/block}