check.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. <template>
  2. <div>
  3. <div v-loading="loading" v-if="ding_enable">
  4. <workpoints :initia_arr="initia_arr" v-if="!loading" :initia_head="initia_head" :obj="obj" @initia="initia" />
  5. </div>
  6. <div v-else class="all">
  7. <div class="nullD">请到钉钉考勤管理后台-<span class="blue"> 工作台 </span>-<span class="blue"> 考勤打卡 </span>-<span class="blue"> 考勤报表 </span>-<span class="blue">切换新版 </span>-开启新版考勤报表功能</div>
  8. <div class="text">如下图:</div>
  9. <div class="img1">
  10. <img src="@/assets/image/kq1.png">
  11. </div>
  12. <div class="img1">
  13. <img src="@/assets/image/kq2.png">
  14. </div>
  15. </div>
  16. </div>
  17. </template>
  18. <script>
  19. import workpoints from "@/components/publics/workpoints";
  20. export default {
  21. components: {workpoints},
  22. data() {
  23. return {
  24. loading: false,
  25. ding_enable:true,
  26. initia_head: {
  27. initial_suername: "考勤积分",
  28. initial_suertext: "以下考勤奖扣分,均为B分",
  29. initial_left: "167px",
  30. initial_width: "165px",
  31. },
  32. initia_arr: [
  33. {
  34. initialName: "是否启用考勤设置",
  35. initia_mark: false,
  36. type:'switch',
  37. initia_input: {
  38. age: "0",
  39. },
  40. },
  41. // {
  42. // initialName: "月度全勤,每月加分",
  43. // initia_mark: false,
  44. // initia_input: {
  45. // age: "0",
  46. // },
  47. // },
  48. {
  49. initialName: "正常打卡,每次加分",
  50. initia_mark: false,
  51. initia_input: {
  52. age: "0",
  53. },
  54. },
  55. {
  56. initialName: "上下班缺卡,每次扣分",
  57. initia_mark: false,
  58. initia_input: {
  59. age: "0",
  60. },
  61. },
  62. {
  63. initialName: "旷工缺席,每次扣分",
  64. initia_mark: false,
  65. initia_input: {
  66. age: "0",
  67. },
  68. },
  69. {
  70. initialName: "上班迟到,每次扣分",
  71. initia_mark: false,
  72. initia_input: {
  73. age: "0",
  74. },
  75. },
  76. {
  77. initialName: "下班早退,每次扣分",
  78. initia_mark: false,
  79. initia_input: {
  80. age: "0",
  81. },
  82. },
  83. // {
  84. // initialName: "加班,每小时加分",
  85. // initia_mark: false,
  86. // initia_input: {
  87. // age: "0",
  88. // },
  89. // },
  90. {
  91. initialName: "加班,每满一天加分",
  92. initia_mark: false,
  93. initia_input: {
  94. age: "0",
  95. },
  96. },
  97. // {
  98. // initialName: "请假,每小时扣分",
  99. // initia_mark: false,
  100. // initia_input: {
  101. // age: "0",
  102. // },
  103. // },
  104. ],
  105. obj: {
  106. // ding_enable:'',
  107. enable:'',
  108. // month_full_ad: "", //>=0
  109. normal: "", //>=0
  110. no_sign: "", //<=0
  111. absent: "", //<=0
  112. on_duty_late: "", //<=0
  113. off_duty_early: "", //<=0
  114. // ot_per_hour: "", //>=0
  115. ot_per_day:'',
  116. // leave_per_hour: "", //<=0
  117. },
  118. };
  119. },
  120. mounted() {
  121. this.cheak_ax();
  122. },
  123. methods: {
  124. initia(ok) {
  125. var objs = {};
  126. objs.enable = ok[0].sj;
  127. objs.normal = ok[1].sj; //>=0
  128. objs.no_sign = ok[2].sj>0? ok[2].sj:ok[2].sj; //<=0
  129. objs.absent = ok[3].sj>0? ok[3].sj:ok[3].sj; //<=0
  130. objs.on_duty_late = ok[4].sj>0? ok[4].sj:ok[4].sj; //<=0
  131. objs.off_duty_early = ok[5].sj>0? ok[5].sj:ok[5].sj; //<=0
  132. objs.ot_per_day =ok[6].sj; //>=0
  133. // objs.ot_per_hour = ok[7].sj; //>=0
  134. // objs.leave_per_hour = ok[8].sj>0? -ok[8].sj:ok[8].sj; //<=0
  135. // objs.month_full_ad = 0
  136. this.$axios('post',"/api/ad/update",objs).then((res) => {
  137. if (res.data.code == 1) {
  138. this.$message({
  139. message: res.data.msg,
  140. type: "success",
  141. });
  142. }
  143. }).finally(err=>{
  144. this.loading = false;
  145. });
  146. },
  147. cheak_ax() {
  148. this.loading = true;
  149. this.$axios('get',"/api/ad/info").then((res) => {
  150. var arr = [],config=res.data.data;
  151. this.ding_enable=config.ding_enable==0? false:true;
  152. if(!this.ding_enable){
  153. return false;
  154. }
  155. // config.no_sign=config.no_sign-(config.no_sign+config.no_sign);
  156. // config.absent=config.absent-(config.absent+config.absent);
  157. // config.on_duty_late=config.on_duty_late-(config.on_duty_late+config.on_duty_late);
  158. // config.off_duty_early=config.off_duty_early-(config.off_duty_early+config.off_duty_early);
  159. // config.leave_per_hour=config.leave_per_hour-(config.leave_per_hour+config.leave_per_hour);
  160. this.initia_arr[0].initia_input.age =config.enable
  161. // this.initia_arr[1].initia_input.age =config.month_full_ad? config.month_full_ad:0 //月度全勤加分
  162. this.initia_arr[1].initia_input.age =config.normal? config.normal:0 //正常打卡加分
  163. this.initia_arr[2].initia_input.age =config.no_sign? config.no_sign:0 //缺卡扣分
  164. this.initia_arr[3].initia_input.age =config.absent? config.absent:0 //旷工扣分
  165. this.initia_arr[4].initia_input.age =config.on_duty_late? config.on_duty_late:0 //迟到扣分
  166. this.initia_arr[5].initia_input.age =config.off_duty_early? config.off_duty_early:0 //早退扣分
  167. // this.initia_arr[7].initia_input.age =config.ot_per_hour? config.ot_per_hour:0 //每小时加班加分
  168. this.initia_arr[6].initia_input.age =config.ot_per_day? config.ot_per_day:0 //每加班满一天加分
  169. // this.initia_arr[8].initia_input.age =config.leave_per_hour? config.leave_per_hour:0 //每小时请假扣分
  170. }).finally(err=>{
  171. this.loading = false;
  172. });
  173. },
  174. },
  175. };
  176. </script>
  177. <style scoped lang="scss">
  178. .nullD{
  179. text-align: center;
  180. padding: 20px;
  181. font-size: 18px;
  182. }
  183. .text{
  184. padding: 30px;
  185. font-size: 18px;
  186. font-weight: 600;
  187. }
  188. .img1{
  189. text-align: center;
  190. margin-bottom: 20px;
  191. }
  192. </style>