award_punish.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523
  1. <template>
  2. <div class="box">
  3. <el-tabs v-model="tabs" type="card">
  4. <el-tab-pane label="奖扣成功" name="success"></el-tab-pane>
  5. <el-tab-pane label="待审批" name="waiting"></el-tab-pane>
  6. <el-tab-pane label="被驳回" name="refuse"></el-tab-pane>
  7. </el-tabs>
  8. <el-row style="margin-bottom: 15px;">
  9. <el-col :span="12">
  10. <el-button type="primary" @click="point_b">奖扣B分</el-button>
  11. <el-button type="primary" @click="point_a" plain>奖扣A分</el-button>
  12. </el-col>
  13. <el-col :span="6" :offset="6">
  14. <el-input v-model="keyword" placeholder="输入同事姓名/内容" @keyup.enter.native="getData">
  15. <el-button slot="append" @click="getData" icon="el-icon-search"></el-button>
  16. </el-input>
  17. </el-col>
  18. </el-row>
  19. <el-table v-if="tabs == 'success'" :data="dataList" stripe fit v-loading="table_loading" @row-click="open_detail">
  20. <el-table-column label="姓名" prop="employee_id" align="left">
  21. <template slot-scope="scope">
  22. <div class="flex-box flex-contet-conter">
  23. <userImage :id="scope.row.employee_id" :user_name="scope.row.employee_name" width="50px" height="50px"></userImage>
  24. <span style="margin-left: 10px; line-height: 50px;">{{ scope.row.employee_name }}</span>
  25. </div>
  26. </template>
  27. </el-table-column>
  28. <el-table-column prop="remark" show-overflow-tooltip label="奖扣内容"></el-table-column>
  29. <el-table-column prop="point" label="积分" width="120">
  30. <template slot-scope="scope">
  31. <span :class="{ color_green: scope.row.point < 0, color_red: scope.row.point > 0 }">
  32. <span v-show="scope.row.point > 0">+</span>
  33. {{ scope.row.point }} {{ point_name(scope.row.pt_id) }}
  34. </span>
  35. </template>
  36. </el-table-column>
  37. <el-table-column prop="create_time" label="奖扣时间" width="150">
  38. <template slot-scope="scope">
  39. {{ cuttString(scope.row.create_time) }}
  40. </template>
  41. </el-table-column>
  42. <template slot="empty">
  43. <noData></noData>
  44. </template>
  45. </el-table>
  46. <el-table v-if="tabs !== 'success'" :data="dataList" stripe fit v-loading="table_loading" @row-click="open_detail1">
  47. <el-table-column label="姓名" prop="employee_id" align="left">
  48. <template slot-scope="scope">
  49. <div class="flex-box flex-contet-conter">
  50. <userImage :id="scope.row.employee_id" :user_name="scope.row.employee_name" width="50px" height="50px"></userImage>
  51. <span style="margin-left: 10px; line-height: 50px;">{{ scope.row.employee_name }}</span>
  52. </div>
  53. </template>
  54. </el-table-column>
  55. <el-table-column prop="remark" show-overflow-tooltip label="奖扣内容">
  56. <template slot-scope="scope">
  57. {{ scope.row.remark.customize }}
  58. </template>
  59. </el-table-column>
  60. <el-table-column prop="event_time" label="奖扣时间" width="150"></el-table-column>
  61. <template slot="empty">
  62. <noData></noData>
  63. </template>
  64. </el-table>
  65. <center style="margin-top: 15px;">
  66. <el-pagination
  67. background
  68. @size-change="handleSizeChange"
  69. @current-change="handleCurrentChange"
  70. :current-page="formData.page"
  71. :page-sizes="[10, 20, 30, 40, 50, 100]"
  72. layout="total, sizes, prev, pager, next"
  73. :page-size="pageLimit"
  74. :total="formData.total"
  75. ></el-pagination>
  76. </center>
  77. <el-drawer title="奖扣详情" :visible.sync="drawer" ref="drawer" :with-header="false" :size="'600px'" direction="rtl">
  78. <div class="drawer_title">奖扣详情</div>
  79. <div class="detail_popup" v-loading="detail_loading" v-if="detail_info !== null">
  80. <el-row :gutter="10" style="padding-bottom:10px;border-bottom:1px #f8f8f8 solid;">
  81. <el-col :span="24">
  82. <userImage
  83. :id="detail_info.employee_id"
  84. :user_name="detail_info.employee_name"
  85. :img_url="detail_info.img_url"
  86. class="fl"
  87. width="50px"
  88. height="50px"
  89. fontSize="15"
  90. ></userImage>
  91. <span style="line-height:50px; margin-left:10px;margin-right:4px;">{{ detail_info.employee_name }}</span>
  92. <span class="color_red point" v-show="detail_info.point >= 0 && detail_info.point">+{{ detail_info.point }}</span>
  93. <span class="color_green point" v-show="detail_info.point < 0 && detail_info.point">{{ detail_info.point }}</span>
  94. <span v-show="detail_info.point">{{ detail_info.pt_id == 1 ? '绩效分' : detail_info.pt_id == 2 ? 'A分' : detail_info.pt_id == 3 ? 'B分' : '' }}</span>
  95. </el-col>
  96. </el-row>
  97. <el-row :gutter="10">
  98. <el-col :span="4">任务描述</el-col>
  99. <el-col :span="20" v-if="detail_info.remark">{{ detail_info.remark && (detail_info.remark.customize || detail_info.remark.rule) }}</el-col>
  100. </el-row>
  101. <el-row :gutter="10">
  102. <el-col :span="4">规则分类</el-col>
  103. <el-col :span="20">{{ detail_info.rule_list }}</el-col>
  104. </el-row>
  105. <el-row :gutter="10" v-show="detail_info.rule_list">
  106. <el-col :span="4">事件时间</el-col>
  107. <el-col :span="20">{{ detail_info.date }}</el-col>
  108. </el-row>
  109. <el-row :gutter="10" v-show="detail_info.source_type_mark">
  110. <el-col :span="4">来源类型</el-col>
  111. <el-col :span="20">{{ detail_info.source_type_mark }}</el-col>
  112. </el-row>
  113. <el-row :gutter="10" v-show="!detail_info.rule_id">
  114. <el-col :span="4">记录人</el-col>
  115. <el-col :span="20">{{ detail_info.employee_name }}</el-col>
  116. </el-row>
  117. <el-row :gutter="10" :v-if="detail_info.files">
  118. <el-col v-for="(item, index) in detail_info.files" :key="index" :span="4">{{ index == 0 ? '图片' : '' }}</el-col>
  119. <el-col :span="20">
  120. <el-image
  121. v-for="(item, index) in detail_info.files"
  122. :key="index"
  123. style="width: 100px; height: 100px;margin-right:8px"
  124. :src="item"
  125. :preview-src-list="detail_info.files"
  126. ></el-image>
  127. </el-col>
  128. </el-row>
  129. <div v-show="detail_info.rule_item_id">
  130. <p class="row_title">规则依据</p>
  131. <el-row :gutter="10">
  132. <el-col :span="4">规则分类</el-col>
  133. <el-col :span="19">{{ detail_info.rule_list }}</el-col>
  134. </el-row>
  135. <el-row v-if="detail_info.remark && detail_info.remark.rule">
  136. <el-col :span="4">积分规则</el-col>
  137. <el-col :span="19">{{ detail_info.remark.rule }}</el-col>
  138. </el-row>
  139. <el-row v-if="detail_info.rule_item">
  140. <el-col :span="4">积分</el-col>
  141. <el-col :span="19" v-show="detail_info.rule_item.min_point == detail_info.rule_item.max_point">{{ detail_info.rule_item.min_point }}</el-col>
  142. <el-col :span="19" v-show="detail_info.rule_item.min_point != detail_info.rule_item.max_point">
  143. {{ detail_info.rule_item.min_point }} ~ {{ detail_info.rule_item.max_point }}
  144. </el-col>
  145. </el-row>
  146. </div>
  147. <div v-show="detail_info.process != false">
  148. <p class="row_title">
  149. 审批
  150. <span class="row_tips">多人审批时,以最后一人为准</span>
  151. </p>
  152. <div class="examine_steps">
  153. <el-steps direction="vertical" :space="50">
  154. <el-step v-for="(item, index) in detail_info.process" :key="index">
  155. <template slot="icon">
  156. <userImage width="36px" height="36px" :img_url="item.img_url" :user_name="item.name"></userImage>
  157. </template>
  158. <template slot="title">
  159. <div style="color: #303133;font-size:14px;margin-top:-2px;">
  160. {{ item.name }} {{ item.remark }}
  161. <!-- <span v-show="item.point !== 0">{{item.point}}</span> -->
  162. </div>
  163. </template>
  164. <template slot="description">
  165. <div style="color:rgb(130 130 130)">{{ item.time }}</div>
  166. </template>
  167. </el-step>
  168. </el-steps>
  169. </div>
  170. </div>
  171. </div>
  172. </el-drawer>
  173. <el-drawer title="奖扣详情" :visible.sync="detailShow" :with-header="false" :size="'600px'" direction="rtl">
  174. <div class="drawer_title">奖扣详情</div>
  175. <div class="detail_popup" v-loading="detail_loading" v-if="detail_info !== null">
  176. <el-row :gutter="10" style="padding-bottom:10px;border-bottom:1px #f8f8f8 solid;">
  177. <el-col :span="24">
  178. <userImage :id="detail_info.applyor_id" class="fl" width="50px" height="50px" fontSize="15"></userImage>
  179. <span style="line-height:50px; margin-left:10px;margin-right:4px;">{{ getEmployeeName(detail_info.applyor_id) }}</span>
  180. <span class="color_red point" v-show="detail_info.point >= 0 && detail_info.point">+{{ detail_info.point }}</span>
  181. <span class="color_green point" v-show="detail_info.point < 0 && detail_info.point">{{ detail_info.point }}</span>
  182. <span v-show="detail_info.point">{{ detail_info.pt_id == 1 ? '绩效分' : detail_info.pt_id == 2 ? 'A分' : detail_info.pt_id == 3 ? 'B分' : '' }}</span>
  183. </el-col>
  184. </el-row>
  185. <el-row :gutter="10" v-show="detail_info.source_type_mark">
  186. <el-col :span="4">来源类型</el-col>
  187. <el-col :span="20">{{ detail_info.source_type_mark }}</el-col>
  188. </el-row>
  189. <el-row :gutter="10" v-for="(item, index) in detail_info.detail" :key="index">
  190. <el-col :span="4">{{ item.key }}</el-col>
  191. <el-col :span="20" v-if="item.key == '附件'">
  192. <el-image style="width: 100px; height: 100px" :src="item.value[0]" :preview-src-list="item.value"></el-image>
  193. </el-col>
  194. <el-col :span="20" v-else>{{ item.value }}</el-col>
  195. </el-row>
  196. <el-row :gutter="10" :v-if="detail_info.files">
  197. <el-col v-for="(item, index) in detail_info.files" :key="index" :span="4">{{ index == 0 ? '图片' : '' }}</el-col>
  198. <el-col :span="20">
  199. <el-image
  200. v-for="(item, index) in detail_info.files"
  201. :key="index"
  202. style="width: 100px; height: 100px;margin-right:8px"
  203. :src="item"
  204. :preview-src-list="detail_info.files"
  205. ></el-image>
  206. </el-col>
  207. </el-row>
  208. <div v-show="detail_info.rule_id && detail_info.process !== null && detail_info.process.length > 0">
  209. <p class="row_title">
  210. 审批
  211. <span class="row_tips">多人审批时,以最后一人为准</span>
  212. </p>
  213. <div class="examine_steps">
  214. <el-steps direction="vertical" :space="50">
  215. <el-step v-for="(item, index) in detail_info.process" :key="index">
  216. <template slot="icon">
  217. <userImage width="36px" height="36px" :img_url="item.img_url" :user_name="item.name"></userImage>
  218. </template>
  219. <template slot="title">
  220. <div style="color: #303133;font-size:14px;margin-top:-2px;">
  221. {{ item.name }} {{ item.remark }}
  222. <!-- <span v-show="item.point !== 0">{{item.point}}</span> -->
  223. </div>
  224. </template>
  225. <template slot="description" style="">
  226. <div style="color:rgb(130 130 130)">{{ item.time }}</div>
  227. </template>
  228. </el-step>
  229. </el-steps>
  230. </div>
  231. </div>
  232. </div>
  233. </el-drawer>
  234. <bonusPointsPopup :title="popuTitle" :visible.sync="popupVisible" :refresh.sync="refreshData" :integralType.sync="integralType"></bonusPointsPopup>
  235. </div>
  236. </template>
  237. <script>
  238. import EmployeeSelector from '@/components/EmployeeSelector.vue';
  239. import moment from 'moment';
  240. import noData from '@/components/noData';
  241. import bonusPointsPopup from '@/components/bonusPointsPopup';
  242. export default {
  243. data() {
  244. return {
  245. refreshData: '',
  246. popuTitle: '奖扣A分',
  247. popupVisible: false,
  248. integralType: 0,
  249. table_loading: true,
  250. formData: {
  251. page: 1,
  252. page_size: 10,
  253. total: 0
  254. },
  255. tabs: 'success',
  256. dataList: [],
  257. pageLimit: 10,
  258. keyword: '',
  259. point_types: JSON.parse(localStorage.getItem('SET_POINT_TYPES')),
  260. showTitle: false,
  261. dialogVisible: false,
  262. dialogData: {
  263. members: [],
  264. items: [
  265. {
  266. rule_switch: false,
  267. rule_id: '',
  268. item_id: '',
  269. point: '0',
  270. remark: '',
  271. event_time: moment().format('YYYY-MM-DD'),
  272. approval: '',
  273. approval_not_select: [],
  274. approval_selected: { dept: [], employee: [] },
  275. plus: true,
  276. pt_id: '',
  277. reviewer_id: '',
  278. files: []
  279. }
  280. ]
  281. },
  282. itemData: {},
  283. rules: {
  284. manager: [{ required: true, message: '请选择录入对象', trigger: 'blur' }]
  285. },
  286. manager: '',
  287. employee_not_select: [],
  288. manager_selected: { dept: [], employee: [] },
  289. show_employee_selector: false,
  290. show_approval_selector: false,
  291. itemIndex: 0,
  292. rule_list: [],
  293. rule_item_list: {},
  294. rule_item_list_value: null,
  295. drawer: false,
  296. detail_loading: false,
  297. detail_info: {},
  298. detailShow: false,
  299. employee_name: JSON.parse(localStorage.getItem('SET_EMPLOYEE_MAP')),
  300. fileList: []
  301. };
  302. },
  303. components: {
  304. EmployeeSelector,
  305. bonusPointsPopup,
  306. noData
  307. },
  308. mounted() {
  309. // if(this.$route.query.type == 1){
  310. // this.point_a()
  311. // }else if(this.$route.query.type == 2){
  312. // this.point_b()
  313. // }
  314. // this.getData()
  315. },
  316. watch: {
  317. tabs(val) {
  318. this.dataList = [];
  319. this.formData.total = 0;
  320. this.keyword = '';
  321. this.formData.page = 1;
  322. this.formData.page_size = 10;
  323. // this.getData();
  324. },
  325. refreshData(val) {
  326. // this.getData();
  327. }
  328. },
  329. methods: {
  330. getEmployeeName(id) {
  331. for (const key in this.employee_name) {
  332. if (this.employee_name[key].id == id) {
  333. return this.employee_name[key].name;
  334. }
  335. }
  336. },
  337. open_detail1(item) {
  338. this.detailShow = true;
  339. let data = {
  340. review_id: item.id
  341. };
  342. this.detail_loading = true;
  343. this.$axios('get', '/api/integral/review', data)
  344. .then(res => {
  345. if (res.data.code == 1) {
  346. this.detail_info = res.data.data;
  347. } else {
  348. this.$message.error(res.data.data.msg);
  349. }
  350. })
  351. .finally(() => {
  352. this.detail_loading = false;
  353. });
  354. },
  355. open_detail(item) {
  356. this.drawer = true;
  357. let data = {
  358. event_id: item.id
  359. };
  360. this.detail_loading = true;
  361. this.$axios('get', '/api/integral/statistics/integral/info', data)
  362. .then(res => {
  363. if (res.data.code == 1) {
  364. this.detail_info = res.data.data;
  365. } else {
  366. this.$message.error(res.data.data.msg);
  367. }
  368. })
  369. .finally(() => {
  370. this.detail_loading = false;
  371. });
  372. },
  373. cuttString(data) {
  374. return data.substring(0, 10);
  375. },
  376. point_a() {
  377. this.integralType = 2;
  378. this.popuTitle = '奖扣A分';
  379. this.popupVisible = true;
  380. },
  381. point_b() {
  382. this.integralType = 3;
  383. this.popuTitle = '奖扣B分';
  384. this.popupVisible = true;
  385. },
  386. point_name(id) {
  387. return this.point_types.find(item => {
  388. if (item.id == id) {
  389. return item;
  390. }
  391. }).name;
  392. },
  393. handleCurrentChange(val) {
  394. this.formData.page = val;
  395. this.getData();
  396. },
  397. handleSizeChange(val) {
  398. this.pageLimit = val;
  399. this.formData.page_size = this.pageLimit;
  400. this.getData();
  401. },
  402. getData() {
  403. this.table_loading = true;
  404. let data = {};
  405. if (this.tabs == 'success') {
  406. data = {
  407. page: this.formData.page,
  408. page_size: this.formData.page_size,
  409. recorder_id: this.$store.getters.user_info.id,
  410. source_type: '1',
  411. keyword: this.keyword
  412. };
  413. } else if (this.tabs == 'waiting') {
  414. data = {
  415. page: this.formData.page,
  416. page_size: this.formData.page_size,
  417. keyword: this.keyword,
  418. pt_id: '0',
  419. type: 'waiting'
  420. };
  421. } else {
  422. data = {
  423. page: this.formData.page,
  424. page_size: this.formData.page_size,
  425. keyword: this.keyword,
  426. pt_id: '0',
  427. type: 'refuse'
  428. };
  429. }
  430. this.$axios('get', this.tabs == 'success' ? '/api/integral/statistics/integral' : '/api/integral/review/entry/list', data)
  431. .then(res => {
  432. if (res.data.code == 1) {
  433. this.dataList = res.data.data.list;
  434. this.formData.total = res.data.data.total;
  435. }
  436. })
  437. .catch(e => {
  438. this.$message.error(e.data.msg);
  439. })
  440. .finally(() => {
  441. this.table_loading = false;
  442. });
  443. }
  444. }
  445. };
  446. </script>
  447. <style scoped lang="scss">
  448. .box {
  449. background-color: #ffffff;
  450. padding: 20px;
  451. min-height: calc(100vh - 160px);
  452. }
  453. .color_green {
  454. color: #4bd964;
  455. }
  456. .color_red {
  457. color: #f56c6c;
  458. }
  459. .detail_popup {
  460. padding: 20px;
  461. height: calc(100vh - 60px);
  462. overflow: auto;
  463. .row_title {
  464. position: relative;
  465. margin: 0 0 20px 0;
  466. padding-top: 12px;
  467. font-size: 16px;
  468. color: #303133;
  469. line-height: 22px;
  470. }
  471. .row_title:before {
  472. position: absolute;
  473. top: 0;
  474. content: ' ';
  475. width: 100%;
  476. border-top: 1px #f8f8f8 solid;
  477. }
  478. .el-row {
  479. margin-bottom: 10px;
  480. font-size: 14px;
  481. .el-col-4 {
  482. color: #606266;
  483. }
  484. }
  485. }
  486. .drawer_title {
  487. font-size: 18px;
  488. padding: 20px;
  489. border-bottom: 1px #efefef solid;
  490. }
  491. ::v-deep .el-table tr:hover {
  492. cursor: pointer;
  493. }
  494. </style>