workpoints.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. <template>
  2. <div class="all">
  3. <div class="initialPoint">
  4. <div class="initia_title">{{initia_head.initial_suername}}</div>
  5. <div class="initia_title_1">{{initia_head.initial_suertext}}</div>
  6. <div v-for="(v,i) in initia_arr" :key="i">
  7. <el-form :model="v.initia_input" ref="v.initia_input" :label-width="initia_head.initial_width" class="demo-ruleForm">
  8. <el-form-item style="margin: 20px 0 0 0" v-if="v.type=='switch'">
  9. <template slot="label">
  10. <span :style="'width:'+initia_head.initial_left">{{v.initialName}}</span>
  11. <el-tooltip placement="top">
  12. <div slot="content" v-html="v.initial_text"></div>
  13. <span class="initia_mark" v-show="v.initia_mark">?</span>
  14. </el-tooltip>
  15. </template>
  16. <el-switch v-model="v.initia_input.age" :active-value="is" :inactive-value="no" @change="changeAge"></el-switch>
  17. </el-form-item>
  18. <div v-else-if="v.type=='object'" style="padding: 20px 0px;margin-left: 160px;">
  19. <div style="margin-bottom: 10px;">全勤加分需同时满足以下条件</div>
  20. <div style="padding-left: 23px;">1、当月无旷工</div>
  21. <div style="margin: 15px 0;">
  22. <div><el-checkbox v-model="v.absent_holiday.enable" :true-label="1" :false-label="0">2、当月未提交以下请假
  23. <el-tooltip placement="top" content="填写的请假名称必须与钉钉考勤打卡-假期管理-假期规则对应,否则此项不生效">
  24. <span class="initia_mark" style="background-color: #666;">?</span>
  25. </el-tooltip>
  26. </el-checkbox></div>
  27. <div class="flex-box" style="margin-top: 10px;padding-left: 20px;">
  28. <el-input :disabled="v.absent_holiday.enable==1?false:true" style="width: 150px;" :key="1" type="text" v-model="val1" placeholder="假期类型"></el-input>
  29. <el-input :disabled="v.absent_holiday.enable==1?false:true" style="width: 150px;margin: 0 10px;" :key="2" type="text" v-model="val2" placeholder="假期类型"></el-input>
  30. <el-input :disabled="v.absent_holiday.enable==1?false:true" style="width: 150px;" type="text" :key="3" v-model="val3" placeholder="假期类型"></el-input>
  31. </div>
  32. </div>
  33. <div>
  34. <div><el-checkbox v-model="v.absent_late.enable" :true-label="1" :false-label="0">
  35. 3、当月迟到少于
  36. <el-input @input="[v.absent_late.count=v.absent_late.count.replace(/[^\d]/g,'')]" :disabled="v.absent_late.enable==1?false:true" style="width: 150px;" v-model="v.absent_late.count" placeholder="次数"></el-input>
  37. 次</el-checkbox></div>
  38. <!-- <div class="flex-box">
  39. <el-input style="width: 150px;" placeholder="假期类型"></el-input>
  40. <el-input style="width: 150px;margin: 0 10px;" placeholder="假期类型"></el-input>
  41. <el-input style="width: 150px;" placeholder="假期类型"></el-input>
  42. </div> -->
  43. </div>
  44. </div>
  45. <el-form-item style="margin: 20px 0 0 0 " v-else>
  46. <template slot="label">
  47. <template v-if="v.message">
  48. <el-popover placement="bottom" width="400" trigger="hover">
  49. <div style="padding: 10px;">{{v.message}}</div>
  50. <span slot="reference" :style="'width:'+initia_head.initial_left">{{v.initialName}} <i class="el-icon-warning"></i></span>
  51. </el-popover>
  52. </template>
  53. <template v-else>
  54. <span slot="reference" :style="'width:'+initia_head.initial_left">{{v.initialName}}</span>
  55. </template>
  56. </template>
  57. <el-input type="age" v-model="v.initia_input.age" :disabled="disabled" autocomplete="off" class="nitia_list_input" placeholder="请输入分值" oninput="if(this.value=='00'){this.value='0';}else{this.value=this.value.replace(/[^0-9]/g,'')}"></el-input>
  58. </el-form-item>
  59. </el-form>
  60. </div>
  61. <el-button
  62. type="primary"
  63. class="initia_button"
  64. @click="save()"
  65. :style="'margin: 20px 0 20px '+initia_head.initial_left"
  66. >保存</el-button>
  67. </div>
  68. </div>
  69. </template>
  70. <script>
  71. export default {
  72. props: {
  73. initia_arr: Array,
  74. initia_head: Object,
  75. },
  76. data() {
  77. return {
  78. is: 1,
  79. no: 0,
  80. disabled:false,
  81. checked1:'',
  82. val1:'',
  83. val2:'',
  84. val3:'',
  85. };
  86. },
  87. created() {
  88. if(this.initia_arr.length==9){
  89. this.val1=this.initia_arr[8].absent_holiday.list[0]
  90. this.val2=this.initia_arr[8].absent_holiday.list[1]
  91. this.val3=this.initia_arr[8].absent_holiday.list[2]
  92. }
  93. },
  94. mounted() {;
  95. if(this.initia_arr[0].type=="switch"){
  96. this.disabled=this.initia_arr[0].initia_input.age==1? false:true;
  97. }
  98. },
  99. methods: {
  100. changeAge(e){
  101. this.disabled=e==1? false:true
  102. },
  103. save() {
  104. let arr = [];
  105. let checkAllData={};//全勤配置
  106. for (var i = 0; i < this.initia_arr.length; i++) {
  107. if(this.initia_arr[i].type!='object'){
  108. arr.push({sj: this.initia_arr[i].initia_input.age});
  109. }else{
  110. checkAllData=this.initia_arr[i]
  111. let list=[this.val1,this.val2,this.val3];
  112. checkAllData.absent_holiday.list=list.filter(x=>{
  113. if(x){
  114. return x
  115. }
  116. })
  117. }
  118. }
  119. this.$emit("initia", {arr,checkAllData});
  120. },
  121. },
  122. };
  123. </script>
  124. <style>
  125. .el-form-item__label {
  126. text-align: left;
  127. }
  128. .initialPoint {
  129. margin-left: 30px;
  130. }
  131. .initia_mark {
  132. background: #409eff;
  133. border-radius: 50%;
  134. width: 14px;
  135. height: 14px;
  136. color: #fff;
  137. display: inline-block;
  138. font-size: 12px;
  139. line-height: 14px;
  140. text-align: center;
  141. margin-left: 4px;
  142. cursor: default;
  143. }
  144. .initia_title {
  145. font-size: 20px;
  146. color: rgba(48, 49, 51, 1);
  147. padding-top: 30px;
  148. font-family: PingFangSC-Regular;
  149. }
  150. .initia_title_1 {
  151. color: #606266;
  152. font-size: 14px;
  153. margin-top: 10px;
  154. }
  155. .nitia_list_input {
  156. width: 160px;
  157. height: 40px;
  158. border-radius: 4px;
  159. background-color: rgba(255, 255, 255, 1);
  160. }
  161. </style>