JfDetail.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575
  1. <template>
  2. <div>
  3. <div class="all padding-20">
  4. <header class="flex-box-ce" style="padding-bottom: 20px;">
  5. <div style="padding-right: 20px;" class="fh" @click="$router.go(-1)">返回</div>
  6. <div>{{ userInfo.name }}的积分明细</div>
  7. </header>
  8. <div class="flex-box-ce" style="padding: 20px;">
  9. <userImage :user_name="userInfo.name" :img_url="userInfo.img_url" width="50px" height="50px"></userImage>
  10. <div style="padding-left: 10px;" class="flex-1">
  11. <div style="font-weight: 700;font-size: 18px;margin-bottom: 5px;">{{ userInfo.name }}</div>
  12. <div class="flex-box-ce fontColorC">
  13. <div v-for="(item, index) in userInfo.dept_list" :key="index">{{ item.dept_name }}<span v-if="userInfo.dept_list.length-index>1"> , </span></div>
  14. </div>
  15. </div>
  16. <!-- <el-select class="date-picker-width" size="medium" v-model="formData.source_type2" placeholder="全部">
  17. <el-option v-for="item in source_type" :key="item.id" :label="item.name" :value="item.id"></el-option>
  18. </el-select> -->
  19. </div>
  20. <div class="diy-tip1" style="margin-bottom: 10px;">
  21. <div v-if="type==1||type==3">分值:<span class="blue">{{point}} {{formData.pt_id==3? 'B分':'A分'}}</span> (当前明细不包含基础分和工龄分)</div>
  22. <div v-if="type==2">总分:<span class="blue">{{point}} B分</span> (包含基础分<span class="blue">{{base_point}}</span>,工龄分<span class="blue">{{service_point}}</span>)</div>
  23. </div>
  24. <!-- 表格 -->
  25. <div>
  26. <el-table :data="list" style="width: 100%;cursor: pointer;" v-loading="loading" @row-click="open_detail">
  27. <el-table-column prop="employee_name" label="姓名" align="left" min-width="125px">
  28. <template slot-scope="scope">
  29. <div class="flex-box">
  30. <userImage :user_name="scope.row.employee_name" :img_url="scope.row.employee_img_url" width="50px" height="50px"></userImage>
  31. <span style="line-height: 50px; padding-left: 10px;">{{ scope.row.employee_name }}</span>
  32. </div>
  33. </template>
  34. </el-table-column>
  35. <el-table-column prop="dept" show-overflow-tooltip label="部门" align="left" min-width="120px"></el-table-column>
  36. <el-table-column prop="point" label="积分" align="left" min-width="120px">
  37. <template slot-scope="scope">
  38. <span :class="scope.row.point < 0 ? 'green' : 'red'">{{ scope.row.point }} {{ point_name(scope.row.pt_id) }}</span>
  39. </template>
  40. </el-table-column>
  41. <el-table-column prop="remark" label="事件内容" align="left" min-width="280px">
  42. <template slot-scope="scope">
  43. <el-tooltip class="item" effect="dark" placement="top">
  44. <div slot="content" style="width: 400px;">{{ scope.row.remark }}</div>
  45. <div class="remark">{{ scope.row.remark }}</div>
  46. </el-tooltip>
  47. </template>
  48. </el-table-column>
  49. <el-table-column prop="rule_name" show-overflow-tooltip label="规则分类" align="left" min-width="140px"></el-table-column>
  50. <el-table-column prop="create_time" label="事件发生时间" align="left" min-width="140px">
  51. <template slot-scope="scope">
  52. {{ scope.row.event_time }}
  53. </template>
  54. </el-table-column>
  55. <el-table-column prop="source_type" label="来源" align="left" min-width="140px">
  56. <template slot-scope="scope">
  57. <span v-show="scope.row.source_type == 1">
  58. 积分奖扣
  59. <span v-if="scope.row.recorder_name">({{ scope.row.recorder_name }})</span>
  60. </span>
  61. <span v-show="scope.row.source_type == 2">任务</span>
  62. <span v-show="scope.row.source_type == 3">积分系统分配</span>
  63. <span v-show="scope.row.source_type == 4">考勤系统分配</span>
  64. <span v-show="scope.row.source_type == 5">
  65. 积分申请
  66. <span v-if="scope.row.applyor_name">({{ scope.row.applyor_name }})</span>
  67. </span>
  68. <span v-show="scope.row.source_type == 6">绩效任务包</span>
  69. <span v-show="scope.row.source_type == 8">积分导入</span>
  70. <span v-show="scope.row.source_type == 9">A分转B分</span>
  71. <span v-show="scope.row.source_type == 10">钉钉汇报(日志)奖扣分</span>
  72. <span v-show="scope.row.source_type > 10">其他</span>
  73. </template>
  74. </el-table-column>
  75. <el-table-column prop="update_time" label="录入时间" align="left" width="140px">
  76. <template slot-scope="scope">
  77. <!-- {{ cuttString(scope.row.create_time) }} -->
  78. {{ scope.row.update_time }}
  79. </template>
  80. </el-table-column>
  81. <template slot="empty">
  82. <noData></noData>
  83. </template>
  84. </el-table>
  85. <center class="pagination">
  86. <el-pagination
  87. background
  88. @size-change="handleSizeChange"
  89. @current-change="handleCurrentChange"
  90. :current-page="formData.page"
  91. :page-sizes="[10, 20, 50, 100]"
  92. layout="total, sizes, prev, pager, next"
  93. :page-size="pageLimit"
  94. :total="total"
  95. ></el-pagination>
  96. </center>
  97. </div>
  98. </div>
  99. <el-drawer title="事件详情" :visible.sync="detail_popup" ref="drawer" :with-header="false" :width="'500px'" direction="rtl">
  100. <div class="drawer_title flex-box-ce">
  101. <span class="flex-1">事件详情</span>
  102. <i @click="detail_popup=false" style="cursor: pointer;" class="el-icon-close"></i>
  103. </div>
  104. <div class="detail_popup" v-loading="detail_loading" v-if="detail_info !== null">
  105. <el-row style="padding-bottom:10px;border-bottom:1px #f8f8f8 solid;">
  106. <div class="flex-box flex-v-ce">
  107. <userImage :user_name="detail_info.employee_name" width="50px" height="50px" fontSize="1"></userImage>
  108. <span style="font-size: 18px;line-height:50px; margin-left:10px;margin-right:4px;">{{ detail_info.employee_name }}</span>
  109. <span class="red point" v-show="detail_info.point >= 0">+{{ detail_info.point }} {{ point_name(detail_info.pt_id) }}</span>
  110. <span class="green point" v-show="detail_info.point < 0">{{ detail_info.point }} {{ point_name(detail_info.pt_id) }}</span>
  111. </div>
  112. </el-row>
  113. <el-row v-show="detail_info.rule_list">
  114. <el-col :span="6">事件内容</el-col>
  115. <el-col :span="18" v-if="detail_info.remark">{{ detail_info.remark && (detail_info.remark.customize || detail_info.remark.rule) }}</el-col>
  116. </el-row>
  117. <el-row v-show="detail_info.files && detail_info.files.length > 0">
  118. <el-col :span="18" :offset="6">
  119. <el-image
  120. v-for="(itme, index) in detail_info.files"
  121. :key="index"
  122. style="width: 80px; height: 80px;margin: 0 5px;"
  123. :src="itme"
  124. :preview-src-list="detail_info.files"
  125. ></el-image>
  126. </el-col>
  127. </el-row>
  128. <el-row v-show="detail_info.rule_list">
  129. <el-col :span="6">规则分类</el-col>
  130. <el-col :span="18">{{ detail_info.rule_list }}</el-col>
  131. </el-row>
  132. <el-row v-show="detail_info.source_type_mark">
  133. <el-col :span="6">来源类型</el-col>
  134. <el-col :span="18">{{ detail_info.source_type_mark }}</el-col>
  135. </el-row>
  136. <el-row v-show="detail_info.recorder_name">
  137. <el-col :span="6">记录人</el-col>
  138. <el-col :span="18">{{ detail_info.recorder_name }}</el-col>
  139. </el-row>
  140. <el-row v-show="detail_info.date">
  141. <el-col :span="6">事件时间</el-col>
  142. <el-col :span="18">{{ detail_info.date }}</el-col>
  143. </el-row>
  144. <el-row v-show="detail_info.complete_task.time">
  145. <el-col :span="6">完成时间</el-col>
  146. <el-col :span="18">{{ detail_info.complete_task.time }}</el-col>
  147. </el-row>
  148. <el-row v-show="detail_info.complete_task.remark">
  149. <el-col :span="6">完成备注</el-col>
  150. <el-col :span="18">{{ detail_info.complete_task.remark }}</el-col>
  151. </el-row>
  152. <el-row v-show="detail_info.complete_task && detail_info.complete_task.files && detail_info.complete_task.files.length > 0">
  153. <el-col :span="18" :offset="6">
  154. <el-image
  155. v-for="(itme, index) in detail_info.complete_task.files"
  156. :key="index"
  157. style="width: 80px; height: 80px;margin: 0 5px;"
  158. :src="itme"
  159. :preview-src-list="detail_info.complete_task.files"
  160. ></el-image>
  161. </el-col>
  162. </el-row>
  163. <div v-show="detail_info.rule_id">
  164. <p class="row_title">规则依据</p>
  165. <el-row>
  166. <el-col :span="6">规则分类</el-col>
  167. <el-col :span="18">{{ detail_info.rule_list }}</el-col>
  168. </el-row>
  169. <el-row v-show="detail_info.remark.rule">
  170. <el-col :span="6">积分规则</el-col>
  171. <el-col :span="18">{{ detail_info.remark.rule }}</el-col>
  172. </el-row>
  173. <el-row>
  174. <el-col :span="6">积分</el-col>
  175. <el-col :span="18" v-show="detail_info.rule_item.min_point == detail_info.rule_item.max_point">{{ detail_info.rule_item.min_point }}</el-col>
  176. <el-col :span="18" v-show="detail_info.rule_item.min_point != detail_info.rule_item.max_point">
  177. {{ detail_info.rule_item.min_point }} ~ {{ detail_info.rule_item.max_point }}
  178. </el-col>
  179. </el-row>
  180. </div>
  181. <div v-show="detail_info.process"><Steps :process="detail_info.process"></Steps></div>
  182. <div v-show="detail_info.dc_remark.flow"><Review :process="detail_info.dc_remark.flow" :status="detail_info.dc_status"></Review></div>
  183. <div style="text-align: center;margin-top: 30px;" v-if="detail_info.source_type == 10">
  184. <el-button type="primary" size="medium" @click="showLog = true">
  185. 查看日志详情内容
  186. <span style=";padding-left:5px;">»</span>
  187. </el-button>
  188. </div>
  189. </div>
  190. <div v-if="!this.$authoritys('employee') && !this.$authoritys('dept_manager')" style="position: absolute; bottom: 20px; display: block; right: 20px;">
  191. <el-button @click="detail_popup=false">取消</el-button>
  192. <!-- <el-button type="danger" @click="del_integral_event(detail_info)">删除</el-button> -->
  193. </div>
  194. </el-drawer>
  195. <el-dialog title="查看日志详情" width="600px" :visible.sync="showLog">
  196. <div class="title">{{ ding_report.creator_name }}的{{ ding_report.template_name }}</div>
  197. <div v-if="ding_report.contents.length > 0">
  198. <div class="contents" v-for="(item, index) in ding_report.contents" :key="index">
  199. <div class="key">{{ item.key }}</div>
  200. <div class="value fontColorC">
  201. <span v-if="item.value">{{ item.value }}</span>
  202. <span v-else>未填写</span>
  203. </div>
  204. </div>
  205. </div>
  206. <div v-if="ding_report.images.length > 0">
  207. <div class="key" style="margin-bottom: 20px;">图片</div>
  208. <div class="flex-box flex-d-wrap">
  209. <el-image
  210. v-for="(item, index) in ding_report.images"
  211. :key="index"
  212. style="width: 100px; height: 100px;margin-right:8px"
  213. :src="item"
  214. :preview-src-list="ding_report.images"
  215. ></el-image>
  216. </div>
  217. </div>
  218. </el-dialog>
  219. </div>
  220. </template>
  221. <script>
  222. import Steps from '@/components/Steps';
  223. import Review from '@/components/Review';
  224. import toLead from '@/components/toLead';
  225. export default {
  226. name: 'JfDetail',
  227. data() {
  228. return {
  229. userInfo: this.$getUserData(),
  230. loading: false,
  231. point_types: this.$getTyps(),
  232. formData: {
  233. page: 1,
  234. page_size: 10,
  235. dc_status:JSON.stringify([1]),
  236. order_key:'create_time',
  237. source_type2:0,
  238. pt_id:3,
  239. },
  240. list: [],
  241. total: null,
  242. detail_info: null,
  243. detail_popup: false,
  244. detail_loading: false,
  245. pageLimit: 10,
  246. // 查看日志
  247. showLog: false,
  248. ding_report: {
  249. contents: [],
  250. images: []
  251. },
  252. source_type: [
  253. { id: 0, name: '按最新事件时间排序' },
  254. { id: 1, name: '按积分由高到低排序' },
  255. { id: 2, name: '按积分由低到高排序' },
  256. ],
  257. type:1,//判断那个列表进入 1阶段排名,2累计排名,3自定义排名
  258. point:0,
  259. base_point:0,//基础分
  260. service_point:0 //工龄发
  261. };
  262. },
  263. components: { Steps, toLead,Review },
  264. created() {
  265. this.type=this.$route.query.type;
  266. if(this.$route.query.type==1){
  267. let userInfo=JSON.parse(this.$route.query.userInfo);
  268. this.point=userInfo.point;
  269. this.userInfo={
  270. name:userInfo.employee_name,
  271. img_url:userInfo.employee_img_url,
  272. dept_list:userInfo.dept_list
  273. }
  274. // console.log(this.$route.query)
  275. let parameter=JSON.parse(this.$route.query.parameter);
  276. // this.formData.dept_ids=parameter.dept_id||0;//部门
  277. this.formData.employee_ids=userInfo.employee_id//人员
  278. this.formData.rule_id=parameter.rule||0//分类ID
  279. this.formData.pt_id=parameter.pt_id//事件类型ID
  280. this.formData.start_day = parameter.start_date
  281. this.formData.end_day = parameter.end_date
  282. }else if(this.$route.query.type==2){
  283. let userInfo=JSON.parse(this.$route.query.userInfo);
  284. this.point=userInfo.point;
  285. this.userInfo={
  286. name:userInfo.employee_name,
  287. img_url:userInfo.employee_img_url,
  288. dept_list:userInfo.dept_list
  289. }
  290. this.formData.employee_ids=userInfo.employee_id//人员
  291. this.getUserInfo(userInfo.employee_id);
  292. }else{
  293. let userInfo=JSON.parse(this.$route.query.userInfo);
  294. console.log(this.$route.query)
  295. this.point=userInfo.point;
  296. this.userInfo=userInfo
  297. this.formData.employee_ids=userInfo.employee_id//人员
  298. this.formData.item_id=this.$route.query.items.length>0?this.$route.query.items.toString():0//人员
  299. if(this.$route.query.dateType=='1'){
  300. this.formData.month=this.$route.query.date//月
  301. }else if(this.$route.query.dateType=='2'){//季度
  302. this.formData.start_day = this.$route.query.start_date
  303. this.formData.end_day = this.$route.query.end_date
  304. }else{
  305. this.formData.year=this.$route.query.date//年
  306. }
  307. }
  308. },
  309. mounted() {
  310. this.get_integral_list();
  311. this.point_types = this.getTypes();
  312. document.getElementById('main').scrollTop = 0;
  313. },
  314. watch: {
  315. 'formData.source_type2'(val) {
  316. this.formData.page = 1;
  317. if(val==0){
  318. this.formData.order_key='create_time'
  319. this.formData.order_type='desc'
  320. }
  321. if(val==1){
  322. this.formData.order_key='point'
  323. this.formData.order_type='desc'
  324. }
  325. if(val==2){
  326. this.formData.order_key='point'
  327. this.formData.order_type='asc'
  328. }
  329. this.get_integral_list();
  330. },
  331. 'formData.page'(val, old_val) {
  332. this.get_integral_list();
  333. },
  334. },
  335. methods: {
  336. getUserInfo(id){
  337. this.$axios('get', '/api/employee/detail',{target:id}).then(res => {
  338. this.base_point=res.data.data.user.site_config.base_point;//基础分
  339. this.service_point=res.data.data.user.point_config.service_point //工龄发
  340. })
  341. },
  342. getTypes() {
  343. var arr = this.$getTyps();
  344. return arr.filter(function(item) {
  345. return item.code != 'JX';
  346. });
  347. },
  348. // end 文件上传
  349. handleSizeChange(val) {
  350. this.pageLimit = val;
  351. this.formData.page_size = this.pageLimit;
  352. this.get_integral_list(this.formData);
  353. },
  354. open_detail(item) {
  355. this.detail_popup = true;
  356. let data = {
  357. event_id: item.id
  358. };
  359. this.detail_loading = true;
  360. this.$axios('get', '/api/integral/statistics/integral/info', data)
  361. .then(res => {
  362. if (res.data.code == 1) {
  363. this.detail_info = res.data.data;
  364. var ding_report = res.data.data.remark.ding_report;
  365. if (Object.keys(ding_report).length != 0) {
  366. this.ding_report = res.data.data.remark.ding_report;
  367. }
  368. } else {
  369. this.$message.error(res.data.data.msg);
  370. }
  371. })
  372. .finally(() => {
  373. this.detail_loading = false;
  374. });
  375. },
  376. get_integral_list(data) {
  377. this.loading = true;
  378. this.$axios('get', '/api/integral/statistics/integral', this.formData)
  379. .then(res => {
  380. if (res.data.code == 1) {
  381. this.list = res.data.data.list;
  382. if(this.formData.page==1){
  383. this.total = res.data.data.total;
  384. }
  385. } else {
  386. this.$message.error(res.data.data.msg);
  387. }
  388. })
  389. .finally(() => {
  390. this.loading = false;
  391. });
  392. },
  393. handleCurrentChange(val) {
  394. this.formData.page = val;
  395. },
  396. del_integral_event(item) {
  397. this.$confirm('删除事件的同时也会撤销积分,确定删除吗?', '提示', {
  398. confirmButtonText: '确定',
  399. cancelButtonText: '取消',
  400. type: 'warning'
  401. }).then(() => {
  402. this.$axios('post', '/api/integral/statistics/integral/destroy', { event_id: item.event_id }).then(res => {
  403. if (res.data.code == 1) {
  404. this.$message.success(res.data.msg);
  405. this.detail_popup = false;
  406. this.get_integral_list(this.formData);
  407. } else {
  408. this.$message.error(res.data.msg);
  409. }
  410. });
  411. });
  412. },
  413. point_name(id) {
  414. return this.point_types.find(item => {
  415. if (item.id == id) {
  416. return item.name;
  417. }
  418. }).name;
  419. },
  420. }
  421. };
  422. </script>
  423. <style scoped lang="scss">
  424. .diy-tip1 {
  425. margin-bottom: 10px !important;
  426. background: #f0f9eb !important;
  427. color: #333 !important;
  428. border: 1px solid #67c23a !important;
  429. padding: 9px !important;
  430. min-width: 800px;
  431. border-radius: 4px;
  432. }
  433. .fh {
  434. position: relative;
  435. cursor: pointer;
  436. padding-right: 40px !important;
  437. }
  438. .fh:hover {
  439. color: #26a2ff;
  440. }
  441. .fh::after {
  442. width: 2px;
  443. background-color: #ccc;
  444. height: 30px;
  445. content: ' ';
  446. position: absolute;
  447. right: 20px;
  448. top: -5px;
  449. }
  450. .remark {
  451. display: -webkit-box;
  452. -webkit-box-orient: vertical;
  453. -webkit-line-clamp: 2;
  454. overflow: hidden;
  455. }
  456. .title {
  457. text-align: center;
  458. font-weight: 700;
  459. max-width: 70%;
  460. margin: 20px auto;
  461. margin-top: 0;
  462. font-size: 18px;
  463. }
  464. .key {
  465. font-weight: 700;
  466. font-size: 16px;
  467. }
  468. .value {
  469. font-size: 14px;
  470. margin: 10px 0;
  471. margin-bottom: 20px;
  472. }
  473. .imgs {
  474. width: 80px;
  475. height: 80px;
  476. margin-right: 5px;
  477. margin-bottom: 5px;
  478. }
  479. header.el-drawer__header {
  480. font-size: 18px;
  481. font-family: MicrosoftYaHei;
  482. color: #303133;
  483. width: 500px;
  484. span {
  485. :focus {
  486. outline: 0;
  487. }
  488. }
  489. }
  490. .display_flex {
  491. display: flex;
  492. }
  493. .label {
  494. line-height: 36px;
  495. padding-right: 10px;
  496. }
  497. .time_section {
  498. .el-range-editor {
  499. width: 330px;
  500. }
  501. }
  502. .pagination {
  503. padding: 20px 0;
  504. }
  505. .detail_popup {
  506. padding: 20px;
  507. height: calc(100vh - 140px);
  508. overflow: auto;
  509. padding-bottom: 100px;
  510. .row_title {
  511. position: relative;
  512. margin: 0 0 20px 0;
  513. padding-top: 12px;
  514. font-size: 16px;
  515. color: #303133;
  516. line-height: 22px;
  517. }
  518. .row_title:before {
  519. position: absolute;
  520. top: 0;
  521. content: ' ';
  522. width: 100%;
  523. border-top: 1px #f8f8f8 solid;
  524. }
  525. .el-row {
  526. margin-bottom: 10px;
  527. font-size: 14px;
  528. .el-col-4 {
  529. color: #606266;
  530. }
  531. }
  532. }
  533. span.point {
  534. font-size: 16px;
  535. }
  536. .drawer_title {
  537. font-size: 18px;
  538. padding: 20px;
  539. border-bottom: 1px #efefef solid;
  540. }
  541. .row_tips {
  542. display: block;
  543. color: #909399;
  544. font-size: 12px;
  545. margin-top: 0px;
  546. }
  547. .el-range-editor--medium .el-range-separator {
  548. width: 25px;
  549. }
  550. .integral_event_box {
  551. background-color: #ffffff;
  552. padding: 20px;
  553. min-height: calc(100vh - 160px);
  554. }
  555. .examine_steps ::v-deep .el-step.is-vertical .el-step__title {
  556. padding-bottom: 0;
  557. }
  558. </style>