systemLayout.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. <template>
  2. <div class="all" v-loading="loading">
  3. <el-tabs v-model="activeName" @tab-click="handleClick" class="tab-container" style="padding:20px 0 0 30px;">
  4. <el-tab-pane label="基本设置" name="first">
  5. <div class="integralApproval">
  6. <b>积分审批</b>
  7. <p>当前系统审批流程<a>查看图例</a></p>
  8. <div style="margin-top:10px;"><span>指定规则的审批或奖扣分,均可直接通过</span>
  9. <el-tooltip placement="top">
  10. <div class="toolCont" slot="content">开启后,按照系统已有的积分规则制度提交的审批或者奖扣可即使审批人/录分人的权限分不足,也能审批通过</div>
  11. <span class="initia_mark">?</span>
  12. </el-tooltip>
  13. <el-switch style="margin-left:30px;" v-model="examine" active-color="#13ce66" inactive-color="rgb(202 202 202)"></el-switch></div>
  14. </div>
  15. <el-button type="primary" class="save" @click="saveFirst('first')">保存</el-button>
  16. </el-tab-pane>
  17. <el-tab-pane label="通知设置" name="second">
  18. <div class="integralApproval">
  19. <div v-for="(item,index) in informText" :key="index" style="margin-top:30px;">
  20. <p><b style="font-size:16px;">{{item.title}}</b>
  21. <el-switch v-if="item.switchs == 0" style="margin:-6px 0 0 30px;" v-model="individualPoints" active-color="#13ce66" inactive-color="rgb(202 202 202)"></el-switch>
  22. <el-switch v-if="item.switchs == 1" style="margin:-6px 0 0 30px;" v-model="pointManagement" active-color="#13ce66" inactive-color="rgb(202 202 202)"></el-switch>
  23. <el-switch v-if="item.switchs == 2" style="margin:-6px 0 0 30px;" v-model="taskToInform" active-color="#13ce66" inactive-color="rgb(202 202 202)"></el-switch>
  24. <el-switch v-if="item.switchs == 3" style="margin:-6px 0 0 30px;" v-model="approvalNotice" active-color="#13ce66" inactive-color="rgb(202 202 202)"></el-switch>
  25. </p>
  26. <p>{{item.ram}}</p>
  27. <p v-if="item.checkboxs && individualPoints"><el-checkbox v-model="checked">{{item.checkboxs}}</el-checkbox></p>
  28. </div>
  29. </div>
  30. <el-button type="primary" class="save" @click="saveFirst('second')">保存</el-button>
  31. </el-tab-pane>
  32. </el-tabs>
  33. </div>
  34. </template>
  35. <script>
  36. export default {
  37. data() {
  38. return {
  39. loading: false,
  40. activeName: 'first',
  41. examine:false,
  42. checked:false,//积分日报展示A分数据
  43. individualPoints:false,//个人积分日报
  44. pointManagement:false,//积分管理周报
  45. taskToInform:false,//任务通知
  46. approvalNotice:false,//审批通知
  47. informText:[
  48. {title:'个人积分通知',switchs:0,ram:'每天推送个人积分的排名和奖扣分情况(不参与积分排名的除外)',checkboxs:'积分日报展示A分数据'},
  49. {title:'管理者奖扣分执行情况通知',switchs:1,ram:'每周给管理者推送当月的奖扣分执行情况'},
  50. {title:'任务通知',switchs:2,ram:'每天定时推送收到任务的通知'},
  51. {title:'审批通知',switchs:3,ram:'每天定时推送收到审批的通知'},
  52. ]
  53. };
  54. },
  55. components: {
  56. },
  57. watch:{
  58. },
  59. created() {},
  60. mounted() {
  61. this.cheakAx('first')
  62. },
  63. methods: {
  64. handleClick(tab, event) {
  65. this.cheakAx(this.activeName)
  66. },
  67. saveFirst(name){
  68. this.loading = true
  69. let data = {}
  70. if(name == 'first'){
  71. data.rule_limit_check = this.examine?0:1
  72. }else{
  73. console.log(this.individualPoints)
  74. console.log(this.pointManagement)
  75. console.log(this.taskToInform)
  76. console.log(this.approvalNotice)
  77. data.report_integral_daily = this.individualPoints?1:0
  78. this.individualPoints?data.report_integral_daily_a = this.checked?1:0:''
  79. data.report_integral_weekly = this.pointManagement?1:0
  80. data.report_work_daily = this.taskToInform?1:0
  81. data.report_review_daily = this.approvalNotice?1:0
  82. }
  83. this.$axios('post',"/api/integral/site/config",data).then((res) => {
  84. if(res.data.code == 1){
  85. this.$message({
  86. message: res.data.msg,
  87. type: 'success'
  88. });
  89. }
  90. }).finally(()=>{
  91. this.loading = false
  92. })
  93. },
  94. cheakAx(name){
  95. this.loading = true;
  96. this.$axios('get',"/api/integral/site/config").then((res) => {
  97. let data = res.data.data
  98. if(name == 'first'){
  99. this.examine = data.rule_limit_check == 0?true : false
  100. }else{
  101. this.individualPoints = data.report_integral_daily == 1?true : false
  102. this.checked = this.individualPoints?data.report_integral_daily_a == 1? true : false : false
  103. this.pointManagement = data.report_integral_weekly == 1?true : false
  104. this.taskToInform = data.report_work_daily == 1?true : false
  105. this.approvalNotice = data.report_review_daily == 1?true : false
  106. }
  107. }).finally(err=>{
  108. this.loading = false;
  109. });
  110. }
  111. },
  112. };
  113. </script>
  114. <style scoped lang="scss">
  115. .integralApproval{
  116. margin-top: 20px;
  117. b{font-size:16px;}
  118. p{margin-top: 10px;
  119. a{color:#1795f9;padding-left:15px;cursor:pointer;}}
  120. .initia_mark {
  121. background: #191919;
  122. border-radius: 50%;
  123. width: 14px;
  124. height: 14px;
  125. color: #fff;
  126. display: inline-block;
  127. font-size: 12px;
  128. line-height: 14px;
  129. text-align: center;
  130. margin-left: 4px;
  131. cursor: default;
  132. }
  133. }
  134. .toolCont{
  135. max-width:280px;
  136. }
  137. .save{
  138. margin-top: 30px;
  139. width:100px;
  140. font-size:15px;
  141. }
  142. .tab-container ::v-deep .el-tabs__item{
  143. font-size: 16px;
  144. }
  145. .tab-container ::v-deep .el-tabs__nav-wrap::after {
  146. background: #fff
  147. }
  148. </style>