apply_list.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399
  1. <template>
  2. <div class="all" style="padding: 20px;">
  3. <el-tabs v-model="tabs" type="card">
  4. <el-tab-pane label="申请通过" name="complete"></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"><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. {{ scope.row.remark.customize || scope.row.remark.rule }}
  20. </template>
  21. </el-table-column>
  22. <el-table-column label="积分" prop="review_point" width="120">
  23. <template slot-scope="scope">
  24. <span :class="{ color_green: scope.row.point < 0, color_red: scope.row.point > 0 }">
  25. <span v-show="scope.row.point > 0">+</span>
  26. {{ scope.row.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-if="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="review_point" width="120">
  52. <template slot-scope="scope">
  53. <span>
  54. <span v-show="scope.row.point > 0">+</span>
  55. {{ scope.row.point }} B分
  56. </span>
  57. </template>
  58. </el-table-column>
  59. <el-table-column label="时间" prop="event_time" width="150"></el-table-column>
  60. <template slot="empty">
  61. <div class="nopoint_box" v-if="!formData.keyword">
  62. <div class="noimg"></div>
  63. <span class="title">
  64. 你还没有申请积分 现在
  65. <el-button type="text" @click="dialogVisible = true">申请积分</el-button>
  66. </span>
  67. </div>
  68. <div class="nopoint_box" v-else>
  69. <div class="noimg"></div>
  70. <span class="title">暂无数据</span>
  71. </div>
  72. </template>
  73. </el-table>
  74. <el-table :data="dataList" stripe fit v-loading="table_loading" v-if="tabs == 'refuse'" @row-click="openDetail">
  75. <el-table-column label="申请内容" prop="remark">
  76. <template slot-scope="scope">
  77. {{ scope.row.remark.customize || scope.row.remark.rule }}
  78. </template>
  79. </el-table-column>
  80. <el-table-column label="时间" prop="event_time" width="150"></el-table-column>
  81. <template slot="empty">
  82. <div class="nopoint_box" v-if="!formData.keyword">
  83. <div class="noimg"></div>
  84. <span class="title">
  85. 你还没有申请积分 现在
  86. <el-button type="text" @click="dialogVisible = true">申请积分</el-button>
  87. </span>
  88. </div>
  89. <div class="nopoint_box" v-else>
  90. <div class="noimg"></div>
  91. <span class="title">暂无数据</span>
  92. </div>
  93. </template>
  94. </el-table>
  95. <center style="margin-top: 15px;">
  96. <el-pagination
  97. background
  98. @size-change="handleSizeChange"
  99. @current-change="handleCurrentChange"
  100. :current-page="formData.page"
  101. :page-sizes="[10, 20, 30, 40, 50, 100]"
  102. layout="total, sizes, prev, pager, next"
  103. :page-size="pageLimit"
  104. :total="total"
  105. ></el-pagination>
  106. </center>
  107. <el-drawer :visible.sync="detailShow" :with-header="false" :size="'600px'">
  108. <div class="drawer_title">申请详情</div>
  109. <div class="detail_popup" v-loading="detail_loading" v-if="detail_info !== null">
  110. <el-row :gutter="10" style="padding-bottom:10px;border-bottom:1px #f8f8f8 solid;">
  111. <el-col :span="24">
  112. <userImage :id="detail_info.applyor_id" class="fl" width="50px" height="50px" fontSize="15" style="display: inline-block; margin-right: 10px;"></userImage>
  113. <div class="user_text">
  114. <p>{{ getEmployeeName(detail_info.applyor_id) }}</p>
  115. <!-- 优化 -->
  116. <div v-for="(item, index) in detail_info.process" :key="index" v-show="item.review_point != 0">
  117. <p v-if="detail_info.status == 1">
  118. <span
  119. v-show="
  120. (item.point !== 0 && item.review_point >= 0 && detail_info.item_prize_type == 1) ||
  121. (item.point !== 0 && item.review_point >= 0 && detail_info.item_prize_type == -1) ||
  122. (item.point !== 0 && item.review_point >= 0 && detail_info.item_prize_type == 0)
  123. "
  124. style="color:#f56c6c;font-size:16px;padding-left:8px"
  125. >
  126. +{{ item.review_point }}
  127. </span>
  128. <span
  129. v-show="
  130. (item.point !== 0 && item.review_point <= 0 && detail_info.item_prize_type == 2) ||
  131. (item.point !== 0 && item.review_point <= 0 && detail_info.item_prize_type == -1) ||
  132. (item.point !== 0 && item.review_point <= 0 && detail_info.item_prize_type == 0)
  133. "
  134. style="color:#67C23A;font-size:16px;padding-left:8px"
  135. >
  136. {{ item.review_point }}
  137. </span>
  138. <span v-show="detail_info.point">
  139. {{ detail_info.pt_id == 1 ? '绩效分' : detail_info.pt_id == 2 ? 'A分' : detail_info.pt_id == 3 ? 'B分' : '' }}
  140. </span>
  141. </p>
  142. </div>
  143. </div>
  144. <p class="user_text text_ccc">{{ detail_info.review_status_mark }}</p>
  145. </el-col>
  146. </el-row>
  147. <el-row :gutter="10" v-for="(item, index) in detail_info.detail" :key="index">
  148. <el-col :span="4">{{ item.key }}</el-col>
  149. <el-col :span="20" v-if="item.key == '附件'">
  150. <el-image
  151. v-for="(items, indexs) in item.value"
  152. :key="indexs"
  153. style="width: 100px; height: 100px;margin:2px;"
  154. :src="items"
  155. :preview-src-list="item.value"
  156. ></el-image>
  157. </el-col>
  158. <el-col :span="20" v-else>{{ item.value }}</el-col>
  159. </el-row>
  160. <el-row :gutter="10" v-if="detail_info.files != null && detail_info.files > 0">
  161. <el-col :span="4">图片</el-col>
  162. <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>
  163. </el-row>
  164. <div v-show="detail_info.process != false">
  165. <p class="row_title">
  166. 审批
  167. <span class="row_tips">多人审批时,以最后一人为准</span>
  168. </p>
  169. <div class="examine_steps">
  170. <el-steps direction="vertical" :space="50">
  171. <el-step v-for="(item, index) in detail_info.process" :key="index">
  172. <template slot="icon">
  173. <userImage width="36px" height="36px" :img_url="item.img_url" :user_name="item.name"></userImage>
  174. </template>
  175. <template slot="title">
  176. <div style="color: #303133;font-size:14px;margin-top:-2px;">
  177. {{ item.name }} {{ item.remark }}
  178. <!-- <span v-show="item.point !== 0">{{item.point}}</span> -->
  179. </div>
  180. </template>
  181. <template slot="description">
  182. <div>{{ item.time }}</div>
  183. <div style="color: #333; margin-bottom: 15px;">{{ item.review_remark }}</div>
  184. </template>
  185. </el-step>
  186. </el-steps>
  187. </div>
  188. </div>
  189. </div>
  190. </el-drawer>
  191. <applicationIntegrationPopup title="申请积分" :visible.sync="dialogVisible"></applicationIntegrationPopup>
  192. </div>
  193. </template>
  194. <script>
  195. import moment from 'moment';
  196. import EmployeeSelector from '@/components/EmployeeSelector.vue';
  197. import applicationIntegrationPopup from '@/components/applicationIntegrationPopup';
  198. export default {
  199. data() {
  200. return {
  201. tabs: 'complete',
  202. dataList: [],
  203. table_loading: false,
  204. detailShow: false,
  205. detail_loading: false,
  206. formData: {
  207. type: 'complete',
  208. pt_id: 0,
  209. page: 1,
  210. page_size: 10,
  211. keyword: ''
  212. },
  213. total: 0,
  214. pageLimit: 10,
  215. point_types: JSON.parse(localStorage.getItem('SET_POINT_TYPES')),
  216. employee_name: JSON.parse(localStorage.getItem('SET_EMPLOYEE_MAP')),
  217. detail_info: {},
  218. dialogVisible: false,
  219. itemIndex: 0
  220. };
  221. },
  222. components: {
  223. EmployeeSelector,
  224. applicationIntegrationPopup
  225. },
  226. watch: {
  227. tabs(val) {
  228. this.dataList = [];
  229. this.total = 0;
  230. this.formData.page = 1;
  231. this.formData.keyword = '';
  232. this.formData.type = val;
  233. // this.get_list();
  234. }
  235. },
  236. mounted() {
  237. // this.get_list();
  238. },
  239. methods: {
  240. getEmployeeName(id) {
  241. for (const key in this.employee_name) {
  242. if (this.employee_name[key].id == id) {
  243. return this.employee_name[key].name || '未知';
  244. }
  245. }
  246. },
  247. point_name(id) {
  248. let point = this.point_types.find(item => {
  249. if (item.id == id) {
  250. return item;
  251. }
  252. });
  253. return point.name;
  254. },
  255. handleCurrentChange(val) {
  256. this.formData.page = val;
  257. this.get_list();
  258. },
  259. handleSizeChange(val) {
  260. this.pageLimit = val;
  261. this.formData.page_size = this.pageLimit;
  262. this.get_list();
  263. },
  264. searchFun() {
  265. this.dataList = [];
  266. this.total = 0;
  267. this.formData.page = 1;
  268. this.get_list();
  269. },
  270. get_list() {
  271. this.table_loading = true;
  272. this.$axios('get', '/api/integral/review/apply/list', this.formData)
  273. .then(res => {
  274. if (res.data.code == 1) {
  275. this.dataList = res.data.data.list;
  276. this.total = res.data.data.total;
  277. }
  278. })
  279. .catch(e => {
  280. this.$message.error(e.data.msg);
  281. })
  282. .finally(() => {
  283. this.table_loading = false;
  284. });
  285. },
  286. openDetail(item) {
  287. let data = {
  288. review_id: item.id
  289. };
  290. this.detailShow = true;
  291. this.detail_loading = true;
  292. this.$axios('get', '/api/integral/review', data)
  293. .then(res => {
  294. if (res.data.code == 1) {
  295. this.detail_info = res.data.data;
  296. } else {
  297. this.$message.error(res.data.data.msg);
  298. }
  299. })
  300. .finally(() => {
  301. this.detail_loading = false;
  302. });
  303. }
  304. }
  305. };
  306. </script>
  307. <style scoped lang="scss">
  308. .box {
  309. background-color: #ffffff;
  310. padding: 20px;
  311. min-height: calc(100vh - 160px);
  312. }
  313. .color_green {
  314. color: #4bd964;
  315. }
  316. .color_red {
  317. color: #f56c6c;
  318. }
  319. .detail_popup {
  320. padding: 20px;
  321. height: 90vh;
  322. overflow-y: auto;
  323. .row_title {
  324. position: relative;
  325. margin: 0 0 20px 0;
  326. padding-top: 12px;
  327. font-size: 16px;
  328. color: #303133;
  329. line-height: 22px;
  330. }
  331. .row_title:before {
  332. position: absolute;
  333. top: 0;
  334. content: ' ';
  335. width: 100%;
  336. border-top: 1px #f8f8f8 solid;
  337. }
  338. .el-row {
  339. margin-bottom: 10px;
  340. font-size: 14px;
  341. .el-col-4 {
  342. color: #606266;
  343. }
  344. }
  345. .examine_steps {
  346. .el-step {
  347. flex-basis: auto !important;
  348. }
  349. }
  350. }
  351. // 滚动条样式
  352. .detail_popup::-webkit-scrollbar-track {
  353. -webkit-box-shadow: inset 0 0 5px rgba(255, 255, 255, 0.3);
  354. border-radius: 5px;
  355. background-color: rgba(216, 216, 216, 0.8);
  356. }
  357. .detail_popup::-webkit-scrollbar {
  358. width: 5px;
  359. background-color: rgba(201, 201, 201, 0);
  360. }
  361. .detail_popup::-webkit-scrollbar-thumb {
  362. border-radius: 5px;
  363. -webkit-box-shadow: inset 0 0 5px rgb(153, 145, 145) (160, 154, 154);
  364. background-color: rgb(168, 167, 167);
  365. }
  366. .drawer_title {
  367. font-size: 18px;
  368. padding: 20px;
  369. border-bottom: 1px #efefef solid;
  370. }
  371. .user_text {
  372. margin: 0;
  373. line-height: 25px;
  374. display: flex;
  375. }
  376. .text_ccc {
  377. font-size: 12px;
  378. color: #606266;
  379. }
  380. ::v-deep .el-table tr:hover {
  381. cursor: pointer;
  382. }
  383. </style>