award_punish.vue 16 KB

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