systemLayout.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342
  1. <template>
  2. <div class="all padding-20" v-loading="loading">
  3. <el-tabs v-model="activeName" @tab-click="handleClick" class="tab-container">
  4. <el-tab-pane label="基本设置" name="first">
  5. <div class="integralApproval" style="margin-top: 30px;">
  6. <b>积分审批</b>
  7. <p>
  8. 当前系统审批流程
  9. <a @click="approvalProcess">查看图例</a>
  10. </p>
  11. <div style="margin-top:5px;" class="fontColorF"><span>指定规则的审批或奖扣分,均可直接通过</span></div>
  12. </div>
  13. <div class="integralApproval">
  14. <b>
  15. 提交积分时,必须选择积分规则
  16. <el-switch style="margin-left:30px;" v-model="ruleOnoff"></el-switch>
  17. </b>
  18. <div style="margin-top:5px;" class="fontColorF">
  19. <div>开启后,申请积分或奖扣积分时,必须选择积分规则提交;</div>
  20. <div>此配置不影响积分审批和任务发布</div>
  21. </div>
  22. </div>
  23. <div class="integralApproval">
  24. <b>
  25. 指定规则的审批或奖扣分免审
  26. <el-switch style="margin-left:30px;" v-model="examine"></el-switch>
  27. </b>
  28. <div style="margin-top:5px;" class="fontColorF">
  29. <div>开启后,按照系统已有的积分规则制度提交的审批或者奖扣可直接通过;</div>
  30. <div>即使审批人/录分人的权限分不足,也能审批通过</div>
  31. </div>
  32. </div>
  33. <div class="integralApproval">
  34. <b>
  35. A分转B分
  36. <el-switch style="margin-left:30px;" v-model="isApB"></el-switch>
  37. </b>
  38. <div class="flex-box flex-v-ce" style="margin-top:10px;" v-if="isApB">
  39. 1A分=<el-input v-model.number="pointNum" autofocus="0" size="mini" class="pointNum" oninput="value=value.replace(/[^\d]/g,'')"></el-input>B分
  40. </div>
  41. <div style="margin-top:10px;" class="fontColorF">
  42. <div>开启后,每奖/扣1条A分,额外产生一条分值按比例转换后的B分记录;</div>
  43. <div>例如:设置1A分=10B分时,因表现出色奖10A分的同时,额外奖100B分。</div>
  44. </div>
  45. </div>
  46. <div class="integralApproval">
  47. <b>
  48. 管理者审批计入奖扣分任务
  49. <el-switch style="margin-left:30px;" v-model="task_review"></el-switch>
  50. </b>
  51. <div style="margin-top:5px;" class="fontColorF">
  52. <div>系统默认的管理者奖扣任务只包含管理者主动给员工奖扣的积分;</div>
  53. <div>开启后,审批员工申请的积分和任务也会记入Ta的奖扣分任务内</div>
  54. </div>
  55. </div>
  56. <el-button type="primary" class="save" @click="saveFirst('first')">保存</el-button>
  57. </el-tab-pane>
  58. <el-tab-pane label="通知设置" name="second">
  59. <div class="integralApproval">
  60. <div v-for="(item, index) in informText" :key="index" style="margin-top:30px;">
  61. <p>
  62. <b style="font-size:16px;">{{ item.title }}</b>
  63. <el-switch
  64. v-if="item.switchs == 0"
  65. style="margin:-6px 0 0 30px;"
  66. v-model="individualPoints"
  67. ></el-switch>
  68. <el-switch
  69. v-if="item.switchs == 1"
  70. style="margin:-6px 0 0 30px;"
  71. v-model="pointManagement"
  72. ></el-switch>
  73. <el-switch
  74. v-if="item.switchs == 2"
  75. style="margin:-6px 0 0 30px;"
  76. v-model="taskToInform"
  77. ></el-switch>
  78. <el-switch
  79. v-if="item.switchs == 3"
  80. style="margin:-6px 0 0 30px;"
  81. v-model="approvalNotice"
  82. ></el-switch>
  83. </p>
  84. <p>{{ item.ram }}</p>
  85. <p v-if="item.checkboxs && individualPoints">
  86. <el-checkbox v-model="checked">{{ item.checkboxs }}</el-checkbox>
  87. </p>
  88. </div>
  89. </div>
  90. <el-button type="primary" class="save" @click="saveFirst('second')">保存</el-button>
  91. </el-tab-pane>
  92. <el-tab-pane label="操作历史" name="history">
  93. <el-form :inline="true">
  94. <el-form-item style="float: right;margin-bottom: 0;">
  95. <el-input size="medium" v-model="formData.keywords" placeholder="请输入内容" max="200" @keyup.enter.native="his_int()" class="persons_name">
  96. <el-button size="medium" slot="append" icon="el-icon-search" @click="his_int()"></el-button>
  97. </el-input>
  98. </el-form-item>
  99. </el-form>
  100. <el-table :data="list" style="width: 100%" v-loading="hisload">
  101. <!-- <el-table-column label="操作人" prop="name" width="250">
  102. <template slot-scope="scope">
  103. <div class="flex-box-ce">
  104. <userImage class="fl" :id="scope.row.id" :user_name="scope.row.name" :img_url="scope.row.img_url" width="50px" height="50px"></userImage>
  105. <span style="line-height: 50px; padding-left: 10px;">{{ scope.row.name }}</span>
  106. </div>
  107. </template>
  108. </el-table-column> -->
  109. <el-table-column label="内容" prop="content"></el-table-column>
  110. <el-table-column prop="create_time" label="时间" width="180px"></el-table-column>
  111. <template slot="empty">
  112. <noData></noData>
  113. </template>
  114. </el-table>
  115. <center style="padding: 20px 0;">
  116. <el-pagination
  117. background
  118. @size-change="handleSizeChange"
  119. @current-change="handleCurrentChange"
  120. :page-sizes="[10, 20, 50, 100]"
  121. layout="total, sizes, prev, pager, next"
  122. :page-size="formData.page_size"
  123. :current-page="formData.page"
  124. :total="total"
  125. ></el-pagination>
  126. </center>
  127. </el-tab-pane>
  128. </el-tabs>
  129. <el-dialog title="系统审批流程" :visible.sync="dialogVisible" width="770px" top="3vh" :before-close="handleClose">
  130. <svg-icon icon-class="approval_process" style="font-size:730px;" />
  131. </el-dialog>
  132. </div>
  133. </template>
  134. <script>
  135. import noData from '@/components/noData';
  136. export default {
  137. data() {
  138. return {
  139. loading: false,
  140. activeName: 'first',
  141. examine: false,
  142. ruleOnoff: false,
  143. checked: false, //积分日报展示A分数据
  144. individualPoints: false, //个人积分日报
  145. pointManagement: false, //积分管理周报
  146. taskToInform: false, //任务通知
  147. approvalNotice: false, //审批通知
  148. informText: [
  149. { title: '个人积分通知', switchs: 0, ram: '每天推送个人积分的排名和奖扣分情况(不参与积分排名的除外)', checkboxs: '积分日报展示A分数据' },
  150. { title: '管理者奖扣分执行情况通知', switchs: 1, ram: '每周给管理者推送当月的奖扣分执行情况' },
  151. { title: '任务通知', switchs: 2, ram: '每天定时推送收到任务的通知' },
  152. { title: '审批通知', switchs: 3, ram: '每天定时推送收到审批的通知' }
  153. ],
  154. dialogVisible: false,
  155. //A转B
  156. pointNum: 0,
  157. isApB: false,
  158. // 管理者奖扣记入
  159. task_review: false,
  160. // 操作历史
  161. hisload: false,
  162. list: null,
  163. total: null,
  164. formData: {
  165. keywords: '',
  166. page: 1,
  167. page_size: 10
  168. },
  169. };
  170. },
  171. components: {
  172. noData
  173. },
  174. mounted() {
  175. this.cheakAx('first');
  176. },
  177. methods: {
  178. hisList() {
  179. let params = this.formData
  180. console.log(params)
  181. this.hisload = true
  182. this.$axios('get', '/api/log/operation/list', params).then(res =>{
  183. if(res.data.code == 1){
  184. let list = res.data.data.list
  185. console.log(res)
  186. this.list = list.list
  187. this.total = list.total
  188. }
  189. }).finally(_=>{
  190. this.hisload = false
  191. })
  192. },
  193. approvalProcess() {
  194. this.dialogVisible = true;
  195. },
  196. handleClose(none) {
  197. none();
  198. },
  199. handleClick(tab, event) {
  200. if(this.activeName == 'history'){
  201. this.hisList()
  202. }else{
  203. this.cheakAx(this.activeName);
  204. }
  205. },
  206. saveFirst(name) {
  207. let data = {};
  208. if (name == 'first') {
  209. data.specified_rule_item = this.ruleOnoff ? 1 : 0;
  210. data.rule_limit_check = this.examine ? 0 : 1;
  211. data.task_review = this.task_review ? 1 : 0;
  212. if (this.isApB) {
  213. if (this.pointNum == 0 || !this.pointNum) {
  214. this.$message({
  215. message: 'A转B分,分值不能空或者零',
  216. type: 'error'
  217. });
  218. return;
  219. }
  220. }
  221. this.isApB ? (data.a2b = this.pointNum) : (data.a2b = 0);
  222. } else {
  223. data.report_integral_daily = this.individualPoints ? 1 : 0;
  224. this.individualPoints ? (data.report_integral_daily_a = this.checked ? 1 : 0) : '';
  225. data.report_integral_weekly = this.pointManagement ? 1 : 0;
  226. data.report_work_daily = this.taskToInform ? 1 : 0;
  227. data.report_review_daily = this.approvalNotice ? 1 : 0;
  228. }
  229. this.loading = true;
  230. this.$axios('post', '/api/integral/site/config', data)
  231. .then(res => {
  232. if (res.data.code == 1) {
  233. this.$message({
  234. message: res.data.msg,
  235. type: 'success'
  236. });
  237. }
  238. })
  239. .finally(() => {
  240. this.loading = false;
  241. });
  242. },
  243. cheakAx(name) {
  244. this.loading = true;
  245. this.$axios('get', '/api/integral/site/config')
  246. .then(res => {
  247. let data = res.data.data;
  248. if (name == 'first') {
  249. if(data.specified_rule_item){
  250. this.ruleOnoff = data.specified_rule_item == 1 ? true : false;
  251. }else{
  252. this.ruleOnoff = false
  253. }
  254. this.examine = data.rule_limit_check == 0 ? true : false;
  255. this.isApB = data.a2b == 0 ? false : true;
  256. this.task_review = data.task_review == 1 ? true : false;
  257. this.pointNum = data.a2b;
  258. } else {
  259. this.individualPoints = data.report_integral_daily == 1 ? true : false;
  260. this.checked = this.individualPoints ? (data.report_integral_daily_a == 1 ? true : false) : false;
  261. this.pointManagement = data.report_integral_weekly == 1 ? true : false;
  262. this.taskToInform = data.report_work_daily == 1 ? true : false;
  263. this.approvalNotice = data.report_review_daily == 1 ? true : false;
  264. }
  265. })
  266. .finally(err => {
  267. this.loading = false;
  268. });
  269. },
  270. // 页码变更
  271. handleCurrentChange(val) {
  272. this.formData.page = val;
  273. this.hisList()
  274. },
  275. handleSizeChange(val) {
  276. this.formData.page_size = val;
  277. this.hisList()
  278. },
  279. his_int(val) {
  280. this.formData.page = 1;
  281. this.hisList()
  282. },
  283. }
  284. };
  285. </script>
  286. <style scoped lang="scss">
  287. .el-input__inner {
  288. height: 35px;
  289. line-height: 35px;
  290. }
  291. .integralApproval {
  292. margin-bottom: 40px;
  293. .pointNum {
  294. width: 100px;
  295. margin: 0 10px;
  296. }
  297. b {
  298. font-size: 16px;
  299. }
  300. p {
  301. margin-top: 10px;
  302. a {
  303. color: #1795f9;
  304. padding-left: 15px;
  305. cursor: pointer;
  306. }
  307. }
  308. .initia_mark {
  309. background: #191919;
  310. border-radius: 50%;
  311. width: 14px;
  312. height: 14px;
  313. color: #fff;
  314. display: inline-block;
  315. font-size: 12px;
  316. line-height: 14px;
  317. text-align: center;
  318. margin-left: 4px;
  319. cursor: default;
  320. }
  321. }
  322. .toolCont {
  323. max-width: 280px;
  324. }
  325. .save {
  326. margin-top: 30px;
  327. width: 100px;
  328. font-size: 15px;
  329. }
  330. .tab-container ::v-deep .el-tabs__item {
  331. font-size: 16px;
  332. }
  333. .tab-container ::v-deep .el-tabs__nav-wrap::after {
  334. background: #fff;
  335. }
  336. </style>