award_punish.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529
  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;">
  25. <WWOpenData type="userName" :openid="scope.row.employee_name"></WWOpenData>
  26. </span>
  27. </div>
  28. </template>
  29. </el-table-column>
  30. <el-table-column prop="remark" show-overflow-tooltip label="奖扣内容"></el-table-column>
  31. <el-table-column prop="point" label="积分" width="120">
  32. <template slot-scope="scope">
  33. <span :class="{ color_green: scope.row.point > 0, color_red: scope.row.point < 0 }">
  34. <span v-show="scope.row.point > 0">+</span>
  35. {{ scope.row.point }} {{ $getTypsName(scope.row.pt_id) }}
  36. </span>
  37. </template>
  38. </el-table-column>
  39. <el-table-column prop="create_time" label="奖扣时间" width="150">
  40. <template slot-scope="scope">
  41. {{ cuttString(scope.row.create_time) }}
  42. </template>
  43. </el-table-column>
  44. <template slot="empty">
  45. <noData></noData>
  46. </template>
  47. </el-table>
  48. <el-table v-if="tabs !== 'success'" :data="dataList" stripe fit v-loading="table_loading" @row-click="open_detail1">
  49. <el-table-column label="姓名" prop="employee_id" align="left">
  50. <template slot-scope="scope">
  51. <div class="flex-box flex-contet-conter">
  52. <userImage :id="scope.row.employee_id" :user_name="scope.row.employee_name" width="50px" height="50px"></userImage>
  53. <span style="margin-left: 10px; line-height: 50px;">
  54. <WWOpenData type="userName" :openid="scope.row.employee_name"></WWOpenData>
  55. </span>
  56. </div>
  57. </template>
  58. </el-table-column>
  59. <el-table-column prop="remark" show-overflow-tooltip label="奖扣内容">
  60. <template slot-scope="scope">
  61. {{ scope.row.remark.customize }}
  62. </template>
  63. </el-table-column>
  64. <el-table-column prop="event_time" label="奖扣时间" width="150"></el-table-column>
  65. <template slot="empty">
  66. <noData></noData>
  67. </template>
  68. </el-table>
  69. <center style="margin-top: 15px;">
  70. <el-pagination
  71. background
  72. @size-change="handleSizeChange"
  73. @current-change="handleCurrentChange"
  74. :current-page="formData.page"
  75. :page-sizes="[10, 20, 50, 100]"
  76. layout="total, sizes, prev, pager, next"
  77. :page-size="pageLimit"
  78. :total="formData.total"
  79. ></el-pagination>
  80. </center>
  81. <el-drawer title="奖扣详情" :visible.sync="drawer" ref="drawer" :with-header="false" :size="'600px'" direction="rtl">
  82. <div class="drawer_title">奖扣详情</div>
  83. <div class="detail_popup" v-loading="detail_loading" v-if="detail_info !== null">
  84. <el-row :gutter="10" style="padding-bottom:10px;border-bottom:1px #f8f8f8 solid;">
  85. <el-col :span="24">
  86. <!-- <userImage :img_url="detail_info.employee_info.img_url" :user_name="detail_info.employee_info.name" class="fl" width="50px" height="50px" fontSize="15"></userImage> -->
  87. <userImage
  88. :id="detail_info.employee_id"
  89. :user_name="detail_info.employee_name"
  90. :img_url="detail_info.img_url"
  91. class="fl"
  92. width="50px"
  93. height="50px"
  94. fontSize="15"
  95. ></userImage>
  96. <span style="line-height:50px; margin-left:10px;margin-right:4px;">
  97. <WWOpenData type="userName" :openid="detail_info.employee_name"></WWOpenData>
  98. </span>
  99. <span class="color_green point" v-show="detail_info.point >= 0 && detail_info.point">+{{ detail_info.point }} {{$getTypsName(detail_info.pt_id)}}</span>
  100. <span class="color_red point" v-show="detail_info.point < 0 && detail_info.point">{{ detail_info.point }} {{$getTypsName(detail_info.pt_id)}}</span>
  101. <!-- <span v-show="detail_info.point">{{detailPt_id(detail_info.pt_id)}}</span> -->
  102. </el-col>
  103. </el-row>
  104. <el-row :gutter="10">
  105. <el-col :span="4" style="margin-bottom:5px;">任务描述</el-col>
  106. <el-col :span="20" v-if="detail_info.remark">{{ detail_info.remark && (detail_info.remark.customize || detail_info.remark.rule) }}</el-col>
  107. </el-row>
  108. <el-row :gutter="10">
  109. <el-col :span="4" style="margin-bottom:5px;">规则分类</el-col>
  110. <el-col :span="20">{{ detail_info.rule_list }}</el-col>
  111. </el-row>
  112. <el-row :gutter="10" v-show="detail_info.rule_list">
  113. <el-col :span="4" style="margin-bottom:5px;">发生时间</el-col>
  114. <el-col :span="20">{{ detail_info.date }}</el-col>
  115. </el-row>
  116. <el-row :gutter="10" v-show="detail_info.source_type_mark">
  117. <el-col :span="4" style="margin-bottom:5px;">来源类型</el-col>
  118. <el-col :span="20">{{ detail_info.source_type_mark }}</el-col>
  119. </el-row>
  120. <el-row :gutter="10" v-show="!detail_info.rule_id">
  121. <el-col :span="4" style="margin-bottom:5px;">记录人</el-col>
  122. <el-col :span="20">{{ detail_info.employee_name }}</el-col>
  123. </el-row>
  124. <el-row :gutter="10" :v-if="detail_info.files">
  125. <el-col v-for="(item, index) in detail_info.files" :key="index" :span="4">{{ index == 0 ? '图片' : '' }}</el-col>
  126. <el-col :span="20">
  127. <el-image
  128. v-for="(item, index) in detail_info.files"
  129. :key="index"
  130. style="width: 100px; height: 100px;margin-right:8px"
  131. :src="item"
  132. :preview-src-list="detail_info.files"
  133. ></el-image>
  134. </el-col>
  135. </el-row>
  136. <div v-show="detail_info.rule_item_id">
  137. <p class="row_title">规则依据</p>
  138. <el-row :gutter="10">
  139. <el-col :span="4" style="margin-bottom:5px;">规则分类</el-col>
  140. <el-col :span="19">{{ detail_info.rule_list }}</el-col>
  141. </el-row>
  142. <el-row v-if="detail_info.remark && detail_info.remark.rule">
  143. <el-col :span="4" style="margin-bottom:5px;">积分规则</el-col>
  144. <el-col :span="19">{{ detail_info.remark.rule }}</el-col>
  145. </el-row>
  146. <el-row v-if="detail_info.rule_item">
  147. <el-col :span="4" style="margin-bottom:5px;">积分</el-col>
  148. <el-col :span="19" v-show="detail_info.rule_item.min_point == detail_info.rule_item.max_point">{{ detail_info.rule_item.min_point }} {{$getTypsName(detail_info.pt_id)}}</el-col>
  149. <el-col :span="19" v-show="detail_info.rule_item.min_point != detail_info.rule_item.max_point">
  150. {{ detail_info.rule_item.min_point }} ~ {{ detail_info.rule_item.max_point }} {{$getTypsName(detail_info.pt_id)}}
  151. </el-col>
  152. </el-row>
  153. </div>
  154. <div v-show="detail_info.rule_id && detail_info.process !== null && detail_info.process.length > 0">
  155. <Steps :process="detail_info.process"></Steps>
  156. </div>
  157. <div class="btn_danger flex-box flex-center-center" v-if="detail_info.process.length==1&&(detail_info.event_type==3||detail_info.event_type==4)">
  158. <el-button type="danger" class="danger" @click="revocation" :loading="cx_loading">撤销</el-button>
  159. </div>
  160. </div>
  161. </el-drawer>
  162. <el-drawer title="奖扣详情" :visible.sync="detailShow" :with-header="false" :size="'600px'" direction="rtl">
  163. <div class="drawer_title">奖扣详情</div>
  164. <div class="detail_popup" v-loading="detail_loading" v-if="detail_info !== null">
  165. <el-row :gutter="10" style="padding-bottom:10px;border-bottom:1px #f8f8f8 solid;">
  166. <el-col :span="24">
  167. <userImage
  168. :user_name="detail_info.employee_info.name"
  169. :img_url="detail_info.employee_info.img_url"
  170. class="fl"
  171. width="50px"
  172. height="50px"
  173. fontSize="15"
  174. ></userImage>
  175. <span style="line-height:50px; margin-left:10px;margin-right:4px;"><WWOpenData type="userName" :openid="detail_info.employee_info.name"></WWOpenData></span>
  176. <span class="color_green point" v-show="detail_info.point >= 0 && detail_info.point">+{{ detail_info.point }} {{$getTypsName(detail_info.pt_id)}}</span>
  177. <span class="color_red point" v-show="detail_info.point < 0 && detail_info.point">{{ detail_info.point }} {{$getTypsName(detail_info.pt_id)}}</span>
  178. <!-- <span v-show="detail_info.point">{{ detail_info.pt_id == 1 ? '绩效分' : detail_info.pt_id == 2 ? 'A分' : detail_info.pt_id == 3 ? 'B分' : '' }}</span> -->
  179. </el-col>
  180. </el-row>
  181. <el-row :gutter="10" v-show="detail_info.source_type_mark">
  182. <el-col :span="4" style="margin-bottom:5px;">来源类型</el-col>
  183. <el-col :span="20">{{ detail_info.source_type_mark }}</el-col>
  184. </el-row>
  185. <el-row :gutter="10" v-for="(item, index) in detail_info.detail" :key="index">
  186. <el-col :span="4" style="margin-bottom:5px;">{{ item.key }}</el-col>
  187. <el-col :span="20" v-if="item.key == '附件'">
  188. <el-image v-for="(val, indexs) in item.value" :key="indexs" style="width: 100px; height: 100px;margin-right:8px;" :src="val" :preview-src-list="item.value"></el-image>
  189. </el-col>
  190. <el-col :span="20" v-else-if="item.key == '收益人'">
  191. <WWOpenData type="userName" :openid="item.value"></WWOpenData>
  192. </el-col>
  193. <el-col :span="20" v-else-if="item.key == '奖扣目标'">
  194. <WWOpenData type="userName" :openid="item.value"></WWOpenData>
  195. </el-col>
  196. <el-col :span="20" v-else-if="item.key == '申请人'">
  197. <WWOpenData type="userName" :openid="item.value"></WWOpenData>
  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.process !== null && detail_info.process.length > 0">
  214. <Steps :process="detail_info.process"></Steps>
  215. </div>
  216. <!-- <div class="btn_danger flex-box flex-center-center" v-if="detail_info.applyor_id==$userInfo().id&&detail_info.status==0&&detail_info.source_type==3"> -->
  217. <div class="btn_danger flex-box flex-center-center" v-if="detail_info.applyor_id==$userInfo().id&&detail_info.can_refuse == '1'&&(detail_info.source_type==2||detail_info.source_type==3)">
  218. <el-button type="danger" class="danger" @click="revocation2" :loading="cx_loading">撤销</el-button>
  219. </div>
  220. </div>
  221. </el-drawer>
  222. <bonusPointsPopup :title="popuTitle" :visible.sync="popupVisible" :refresh.sync="refreshData" :integralType.sync="integralType"></bonusPointsPopup>
  223. </div>
  224. </template>
  225. <script>
  226. import { getToken } from '@/utils/auth';
  227. import moment from 'moment';
  228. import noData from '@/components/noData';
  229. import Steps from '@/components/Steps.vue';
  230. import bonusPointsPopup from '@/views/common/bonusPointsPopup';
  231. export default {
  232. data() {
  233. return {
  234. refreshData: '',
  235. popuTitle: '奖扣A分',
  236. popupVisible: false,
  237. integralType: 0,
  238. table_loading: true,
  239. formData: {
  240. page: 1,
  241. page_size: 10,
  242. total: 0
  243. },
  244. tabs: 'success',
  245. dataList: [],
  246. pageLimit: 10,
  247. keyword: '',
  248. rule_list: [],
  249. drawer: false,
  250. detail_loading: false,
  251. detail_info: {
  252. employee_info:{
  253. img_url:'',
  254. name:''
  255. },
  256. process:[]
  257. },
  258. detailShow: false,
  259. employee_name: this.$getEmployeeMap(),
  260. userId:'',
  261. cx_loading:false,
  262. selectId:'',//打开详情ID
  263. };
  264. },
  265. components: {
  266. bonusPointsPopup,
  267. noData,
  268. Steps
  269. },
  270. mounted() {
  271. if (this.$route.query.type == 1) {
  272. this.point_a();
  273. } else if (this.$route.query.type == 2) {
  274. this.point_b();
  275. }
  276. this.getData();
  277. },
  278. watch: {
  279. tabs(val) {
  280. this.dataList = [];
  281. this.formData.total = 0;
  282. this.keyword = '';
  283. this.formData.page = 1;
  284. this.formData.page_size = 10;
  285. this.getData();
  286. },
  287. refreshData(val) {
  288. this.getData();
  289. }
  290. },
  291. methods: {
  292. // 撤销待审批
  293. revocation2(){
  294. var that=this;
  295. this.$confirm('撤销此项数据将不可恢复,是否撤销?', '提示', {
  296. confirmButtonText: '确定',
  297. cancelButtonText: '取消',
  298. type: 'warning'
  299. }).then(() => {
  300. let data = {
  301. review_id: that.selectId,
  302. };
  303. that.cx_loading = true;
  304. that.$http('DELETE', '/api/integral/review', data).then(res => {
  305. if (res.data.code == 1) {
  306. that.getData()
  307. } else {
  308. that.$message.error(res.data.data.msg);
  309. }
  310. }).finally(() => {
  311. that.detailShow = false;
  312. that.cx_loading = false;
  313. });
  314. })
  315. },
  316. // 撤销奖扣
  317. revocation(){
  318. var that=this;
  319. this.$confirm('撤销此项数据将不可恢复,是否撤销?', '提示', {
  320. confirmButtonText: '确定',
  321. cancelButtonText: '取消',
  322. type: 'warning'
  323. }).then(() => {
  324. let data = {
  325. target_id: that.selectId,
  326. type:1
  327. };
  328. that.cx_loading = true;
  329. that.$http('post', '/api/integral/review/prize/destroy', data).then(res => {
  330. if (res.data.code == 1) {
  331. that.getData()
  332. } else {
  333. that.$message.error(res.data.data.msg);
  334. }
  335. }).finally(() => {
  336. that.cx_loading = false;
  337. that.drawer = false;
  338. });
  339. })
  340. },
  341. getEmployeeName(id) {
  342. for (const key in this.employee_name) {
  343. if (this.employee_name[key].id == id) {
  344. return this.employee_name[key].name;
  345. }
  346. }
  347. },
  348. open_detail1(item) {
  349. let self = this;
  350. self.detailShow = true;
  351. let data = {
  352. review_id: item.id
  353. };
  354. this.selectId=item.id
  355. self.detail_loading = true;
  356. this.$http('get', '/api/integral/review', data)
  357. .then(res => {
  358. if (res.data.code == 1) {
  359. self.detail_info = res.data.data;
  360. } else {
  361. self.$message.error(res.data.data.msg);
  362. }
  363. })
  364. .finally(() => {
  365. self.detail_loading = false;
  366. });
  367. },
  368. open_detail(item) {
  369. let self = this;
  370. self.drawer = true;
  371. let data = {
  372. event_id: item.id
  373. };
  374. this.selectId=item.id
  375. self.detail_loading = true;
  376. this.$http('get', '/api/integral/statistics/integral/info', data)
  377. .then(res => {
  378. if (res.data.code == 1) {
  379. self.detail_info = res.data.data;
  380. self.detail_info.employee_info={}
  381. } else {
  382. self.$message.error(res.data.data.msg);
  383. }
  384. })
  385. .finally(() => {
  386. self.detail_loading = false;
  387. });
  388. },
  389. cuttString(data) {
  390. if(data){
  391. return data.substring(0, 10);
  392. }
  393. },
  394. point_a() {
  395. this.integralType = 2;
  396. this.popuTitle = '奖扣A分';
  397. this.popupVisible = true;
  398. },
  399. point_b() {
  400. this.integralType = 3;
  401. this.popuTitle = '奖扣B分';
  402. this.popupVisible = true;
  403. },
  404. handleCurrentChange(val) {
  405. this.formData.page = val;
  406. this.getData();
  407. },
  408. handleSizeChange(val) {
  409. this.pageLimit = val;
  410. this.formData.page_size = this.pageLimit;
  411. this.getData();
  412. },
  413. getData() {
  414. let self = this;
  415. self.table_loading = true;
  416. let data = {};
  417. if (self.tabs == 'success') {
  418. data = {
  419. page: self.formData.page,
  420. page_size: self.formData.page_size,
  421. recorder_id: self.$store.getters.user_info.id,
  422. source_type: '1',
  423. keyword: self.keyword
  424. };
  425. } else if (self.tabs == 'waiting') {
  426. data = {
  427. page: self.formData.page,
  428. page_size: self.formData.page_size,
  429. keyword: self.keyword,
  430. pt_id: '0',
  431. type: 'waiting'
  432. };
  433. } else {
  434. data = {
  435. page: self.formData.page,
  436. page_size: self.formData.page_size,
  437. keyword: self.keyword,
  438. pt_id: '0',
  439. type: 'refuse'
  440. };
  441. }
  442. this.$http('get', self.tabs == 'success' ? '/api/integral/statistics/integral' : '/api/integral/review/entry/list', data)
  443. .then(res => {
  444. if (res.data.code == 1) {
  445. self.dataList = res.data.data.list;
  446. self.formData.total = res.data.data.total;
  447. }
  448. })
  449. .finally(() => {
  450. this.table_loading = false;
  451. });
  452. }
  453. }
  454. };
  455. </script>
  456. <style scoped lang="scss">
  457. .box {
  458. background-color: #ffffff;
  459. padding: 20px;
  460. min-height: calc(100vh - 160px);
  461. }
  462. .color_green {
  463. color: #4bd964;
  464. }
  465. .color_red {
  466. color: #f56c6c;
  467. }
  468. .detail_popup {
  469. padding: 20px;
  470. height: calc(100vh - 60px);
  471. overflow: auto;
  472. .row_title {
  473. position: relative;
  474. margin: 0 0 20px 0;
  475. padding-top: 12px;
  476. font-size: 16px;
  477. color: #303133;
  478. line-height: 22px;
  479. }
  480. .row_title:before {
  481. position: absolute;
  482. top: 0;
  483. content: ' ';
  484. width: 100%;
  485. border-top: 1px #f8f8f8 solid;
  486. }
  487. .el-row {
  488. margin-bottom: 10px;
  489. font-size: 14px;
  490. .el-col-4 {
  491. color: #606266;
  492. }
  493. }
  494. }
  495. .drawer_title {
  496. font-size: 18px;
  497. padding: 20px;
  498. border-bottom: 1px #efefef solid;
  499. }
  500. /deep/ .el-table tr:hover {
  501. cursor: pointer;
  502. }
  503. </style>