apply_list.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411
  1. <template>
  2. <div class="all padding-20">
  3. <el-tabs v-model="tabs">
  4. <el-tab-pane label="待审批" name="waiting"></el-tab-pane>
  5. <el-tab-pane label="申请通过" name="complete"></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"><el-button type="primary" @click="dialogVisible = true">申请积分</el-button></el-col>
  10. <el-col :span="6" :offset="6">
  11. <el-input v-model="formData.keyword" placeholder="输入申请内容" @keyup.enter.native="searchFun">
  12. <el-button slot="append" @click="searchFun" size="medium" icon="el-icon-search"></el-button>
  13. </el-input>
  14. </el-col>
  15. </el-row>
  16. <el-table :data="dataList" stripe fit v-loading="table_loading" v-if="tabs == 'complete'" @row-click="openDetail">
  17. <el-table-column label="申请内容" prop="remark">
  18. <template slot-scope="scope">
  19. <span class="font-flex-word" style="max-width: 200px;">{{ scope.row.remark.customize || scope.row.remark.rule }}</span>
  20. </template>
  21. </el-table-column>
  22. <el-table-column label="积分" prop="review_point" width="120">
  23. <template slot-scope="scope">
  24. <span :class="{ green: scope.row.review_point < 0, red: scope.row.review_point > 0 }">
  25. <span v-show="scope.row.review_point > 0">+</span>
  26. {{ scope.row.review_point }} {{ scope.row.pt_id == 3 ? 'B分' : scope.row.pt_id == 2 ? 'A分' : scope.row.pt_id == 1 ? '绩效分' : '' }}
  27. </span>
  28. </template>
  29. </el-table-column>
  30. <el-table-column label="时间" prop="event_time" width="150"></el-table-column>
  31. <template slot="empty">
  32. <div class="nopoint_box" v-if="!formData.keyword">
  33. <div class="noimg"></div>
  34. <span class="title">
  35. 你还没有申请积分 现在
  36. <el-button type="text" @click="dialogVisible = true">申请积分</el-button>
  37. </span>
  38. </div>
  39. <div class="nopoint_box" v-else>
  40. <div class="noimg"></div>
  41. <span class="title">暂无数据</span>
  42. </div>
  43. </template>
  44. </el-table>
  45. <el-table :data="dataList" stripe fit v-loading="table_loading" v-show="tabs == 'waiting'" @row-click="openDetail">
  46. <el-table-column label="申请内容" prop="remark">
  47. <template slot-scope="scope">
  48. {{ scope.row.remark.customize || scope.row.remark.rule }}
  49. </template>
  50. </el-table-column>
  51. <el-table-column label="时间" prop="event_time" width="150"></el-table-column>
  52. <template slot="empty">
  53. <div class="nopoint_box" v-if="!formData.keyword">
  54. <div class="noimg"></div>
  55. <span class="title">
  56. 你还没有申请积分 现在
  57. <el-button type="text" @click="dialogVisible = true">申请积分</el-button>
  58. </span>
  59. </div>
  60. <div class="nopoint_box" v-else>
  61. <div class="noimg"></div>
  62. <span class="title">暂无数据</span>
  63. </div>
  64. </template>
  65. </el-table>
  66. <el-table :data="dataList" stripe fit v-loading="table_loading" v-show="tabs == 'refuse'" @row-click="openDetail">
  67. <el-table-column label="申请内容" prop="remark">
  68. <template slot-scope="scope">
  69. {{ scope.row.remark.customize || scope.row.remark.rule }}
  70. </template>
  71. </el-table-column>
  72. <el-table-column label="时间" prop="event_time" width="150"></el-table-column>
  73. <template slot="empty">
  74. <div class="nopoint_box" v-if="!formData.keyword">
  75. <div class="noimg"></div>
  76. <span class="title">
  77. 你还没有申请积分 现在
  78. <el-button type="text" @click="dialogVisible = true">申请积分</el-button>
  79. </span>
  80. </div>
  81. <div class="nopoint_box" v-else>
  82. <div class="noimg"></div>
  83. <span class="title">暂无数据</span>
  84. </div>
  85. </template>
  86. </el-table>
  87. <center style="margin-top: 15px;">
  88. <el-pagination
  89. background
  90. @size-change="handleSizeChange"
  91. @current-change="handleCurrentChange"
  92. :current-page="formData.page"
  93. :page-sizes="[10, 20, 50, 100]"
  94. layout="total, sizes, prev, pager, next"
  95. :page-size="pageLimit"
  96. :total="total"
  97. ></el-pagination>
  98. </center>
  99. <el-drawer :visible.sync="detailShow" :with-header="false" :size="'600px'">
  100. <div class="drawer_title">申请详情</div>
  101. <div class="detail_popup" v-loading="detail_loading" v-if="detail_info !== null">
  102. <el-row :gutter="10" style="padding-bottom:10px;border-bottom:1px #f8f8f8 solid;">
  103. <el-col :span="24" class="flex-box flex-v-ce">
  104. <userImage
  105. :user_name="detail_info.employee_name"
  106. :img_url="detail_info.img_url"
  107. width="50px"
  108. height="50px"
  109. fontSize="1">
  110. </userImage>
  111. <div class="user_text">
  112. <p style="margin-left: 10px;">{{ detail_info.employee_name }}</p>
  113. <div v-show="detail_info.review_point != 0">
  114. <p v-if="detail_info.status == 1">
  115. <span
  116. v-show="
  117. (detail_info.review_point >= 0 && detail_info.item_prize_type == 1) ||
  118. (detail_info.review_point >= 0 && detail_info.item_prize_type == -1) ||
  119. (detail_info.review_point >= 0 && detail_info.item_prize_type == 0)
  120. "
  121. style="color:#f56c6c;padding-left:8px"
  122. >
  123. +{{ detail_info.review_point }}
  124. </span>
  125. <span
  126. v-show="
  127. (detail_info.review_point <= 0 && detail_info.item_prize_type == 2) ||
  128. (detail_info.review_point <= 0 && detail_info.item_prize_type == -1) ||
  129. (detail_info.review_point <= 0 && detail_info.item_prize_type == 0)
  130. "
  131. style="color:#67C23A;padding-left:8px"
  132. >
  133. {{ detail_info.review_point }}
  134. </span>
  135. <span>{{ detail_info.pt_id == 1 ? '绩效分' : detail_info.pt_id == 2 ? 'A分' : detail_info.pt_id == 3 ? 'B分' : '' }}</span>
  136. </p>
  137. </div>
  138. </div>
  139. <p class="user_text text_ccc">{{ detail_info.review_status_mark }}</p>
  140. </el-col>
  141. </el-row>
  142. <el-row :gutter="10" v-for="(item, index) in detail_info.detail" :key="index">
  143. <el-col :span="4">{{ item.key }}</el-col>
  144. <el-col :span="20" v-if="item.key == '附件'">
  145. <el-image
  146. v-for="(items, indexs) in item.value"
  147. :key="indexs"
  148. style="width: 100px; height: 100px;margin:2px;"
  149. :src="items"
  150. :preview-src-list="item.value"
  151. ></el-image>
  152. </el-col>
  153. <el-col :span="20" v-else>{{ item.value }}</el-col>
  154. </el-row>
  155. <el-row :gutter="10" v-if="detail_info.files != null && detail_info.files > 0">
  156. <el-col :span="4">图片</el-col>
  157. <el-col :span="20"><el-image v-for="(item, index) in detail_info.files" :key="index" style="width: 100px; height: 100px" :src="item"></el-image></el-col>
  158. </el-row>
  159. <div v-show="detail_info.process">
  160. <Steps :process="detail_info.process"></Steps>
  161. </div>
  162. <div class="btn_danger flex-box flex-center-center" v-if="detail_info.applyor_id == userId && detail_info.can_refuse == '1' && detail_info.source_type == 2">
  163. <el-button type="danger" class="danger" @click="revocation" :loading="cx_loading">撤销</el-button>
  164. </div>
  165. </div>
  166. </el-drawer>
  167. <applicationIntegrationPopup title="申请积分" :isBreak="isBreak" :ruleOnoff="ruleOnoff" :visible.sync="dialogVisible" v-if="dialogVisible"></applicationIntegrationPopup>
  168. </div>
  169. </template>
  170. <script>
  171. import moment from 'moment';
  172. import EmployeeSelector from '@/components/EmployeeSelector.vue';
  173. import applicationIntegrationPopup from '@/components/applicationIntegrationPopup';
  174. import Steps from '@/components/Steps';
  175. import {getToken } from '@/api/auth';
  176. export default {
  177. data() {
  178. return {
  179. ruleOnoff: false,
  180. tabs: 'waiting',
  181. dataList: [],
  182. table_loading: false,
  183. detailShow: false,
  184. detail_loading: false,
  185. formData: {
  186. type: 'waiting',
  187. pt_id: 0,
  188. page: 1,
  189. page_size: 10,
  190. keyword: ''
  191. },
  192. total: 0,
  193. pageLimit: 10,
  194. point_types: this.$getTyps(),
  195. detail_info: {},
  196. dialogVisible: false,
  197. itemIndex: 0,
  198. selectId: '',
  199. userId: '',
  200. cx_loading: false,
  201. isBreak:false,//是否打开缓存的未完成奖扣
  202. };
  203. },
  204. components: {
  205. EmployeeSelector,
  206. applicationIntegrationPopup,
  207. Steps
  208. },
  209. watch: {
  210. tabs(val) {
  211. this.dataList = [];
  212. this.total = 0;
  213. this.formData.page = 1;
  214. this.formData.keyword = '';
  215. this.formData.type = val;
  216. this.get_list();
  217. }
  218. },
  219. mounted() {
  220. this.cheakAx()
  221. this.userId = this.$getUserData().id;
  222. this.get_list();
  223. setTimeout(() => {
  224. let apply_list=this.$getCache('apply_list')
  225. if(apply_list&&apply_list.length>0){
  226. this.isBreak=true;
  227. this.dialogVisible=true;
  228. }else{
  229. this.isBreak=false;
  230. }
  231. }, 1000)
  232. },
  233. methods: {
  234. cheakAx() {
  235. this.$axios('get', '/api/integral/site/config')
  236. .then(res => {
  237. let data = res.data.data;
  238. if(data.specified_rule_item){
  239. this.ruleOnoff = data.specified_rule_item == 1 ? true : false;
  240. }else{
  241. this.ruleOnoff = false
  242. }
  243. })
  244. },
  245. // 撤销奖扣
  246. revocation() {
  247. var that = this;
  248. this.$confirm('撤销此项数据将不可恢复,是否撤销?', '提示', {
  249. confirmButtonText: '确定',
  250. cancelButtonText: '取消',
  251. type: 'warning'
  252. }).then(() => {
  253. let data = { review_id: that.selectId };
  254. that.cx_loading = true;
  255. that.$axios('post', '/api/integral/review/destroy', data)
  256. .then(res => {
  257. if (res.data.code == 1) {
  258. that.get_list();
  259. } else {
  260. that.$message.error(res.data.data.msg);
  261. }
  262. })
  263. .finally(() => {
  264. that.cx_loading = false;
  265. that.detailShow = false;
  266. });
  267. });
  268. },
  269. handleCurrentChange(val) {
  270. this.formData.page = val;
  271. this.get_list();
  272. },
  273. handleSizeChange(val) {
  274. this.pageLimit = val;
  275. this.formData.page_size = this.pageLimit;
  276. this.get_list();
  277. },
  278. searchFun() {
  279. this.dataList = [];
  280. this.total = 0;
  281. this.formData.page = 1;
  282. this.get_list();
  283. },
  284. get_list() {
  285. this.table_loading = true;
  286. this.$axios('get', '/api/integral/review/apply/list', this.formData)
  287. .then(res => {
  288. if (res.data.code == 1) {
  289. this.dataList = res.data.data.list;
  290. this.total = res.data.data.total;
  291. }
  292. })
  293. .finally(() => {
  294. this.table_loading = false;
  295. });
  296. },
  297. openDetail(item) {
  298. this.selectId = item.id;
  299. let data = {
  300. review_id: item.id
  301. };
  302. this.detailShow = true;
  303. this.detail_loading = true;
  304. this.$axios('get', '/api/integral/review', data)
  305. .then(res => {
  306. if (res.data.code == 1) {
  307. this.detail_info = res.data.data;
  308. } else {
  309. this.$message.error(res.data.data.msg);
  310. }
  311. })
  312. .finally(() => {
  313. this.detail_loading = false;
  314. });
  315. }
  316. }
  317. };
  318. </script>
  319. <style scoped lang="scss">
  320. .btn_danger {
  321. margin-top: 20px;
  322. }
  323. .btn_danger .danger {
  324. width: 120px;
  325. }
  326. .box {
  327. background-color: #ffffff;
  328. padding: 20px;
  329. min-height: calc(100vh - 160px);
  330. }
  331. .detail_popup {
  332. padding: 20px;
  333. height: 90vh;
  334. overflow-y: auto;
  335. .row_title {
  336. position: relative;
  337. margin: 0 0 20px 0;
  338. padding-top: 12px;
  339. font-size: 16px;
  340. color: #303133;
  341. line-height: 22px;
  342. }
  343. .row_title:before {
  344. position: absolute;
  345. top: 0;
  346. content: ' ';
  347. width: 100%;
  348. border-top: 1px #f8f8f8 solid;
  349. }
  350. .el-row {
  351. margin-bottom: 10px;
  352. font-size: 14px;
  353. .el-col-4 {
  354. color: #606266;
  355. }
  356. }
  357. .examine_steps {
  358. .el-step {
  359. flex-basis: auto !important;
  360. }
  361. }
  362. }
  363. // 滚动条样式
  364. .detail_popup::-webkit-scrollbar-track {
  365. -webkit-box-shadow: inset 0 0 5px rgba(255, 255, 255, 0.3);
  366. border-radius: 5px;
  367. background-color: rgba(216, 216, 216, 0.8);
  368. }
  369. .detail_popup::-webkit-scrollbar {
  370. width: 5px;
  371. background-color: rgba(201, 201, 201, 0);
  372. }
  373. .detail_popup::-webkit-scrollbar-thumb {
  374. border-radius: 5px;
  375. -webkit-box-shadow: inset 0 0 5px rgb(153, 145, 145) (160, 154, 154);
  376. background-color: rgb(168, 167, 167);
  377. }
  378. .drawer_title {
  379. font-size: 18px;
  380. padding: 20px;
  381. border-bottom: 1px #efefef solid;
  382. }
  383. .user_text {
  384. margin: 0;
  385. line-height: 25px;
  386. display: flex;
  387. }
  388. .text_ccc {
  389. font-size: 16px;
  390. color: #26a2ff;
  391. margin-left: 10px;
  392. }
  393. ::v-deep .el-table tr:hover {
  394. cursor: pointer;
  395. }
  396. </style>