| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523 | <template>	<div class="box">		<el-tabs v-model="tabs" type="card">			<el-tab-pane label="奖扣成功" name="success"></el-tab-pane>			<el-tab-pane label="待审批" name="waiting"></el-tab-pane>			<el-tab-pane label="被驳回" name="refuse"></el-tab-pane>		</el-tabs>		<el-row style="margin-bottom: 15px;">			<el-col :span="12">				<el-button type="primary" @click="point_b">奖扣B分</el-button>				<el-button type="primary" @click="point_a" plain>奖扣A分</el-button>			</el-col>			<el-col :span="6" :offset="6">				<el-input v-model="keyword" placeholder="输入同事姓名/内容" @keyup.enter.native="getData">					<el-button slot="append" @click="getData" icon="el-icon-search"></el-button>				</el-input>			</el-col>		</el-row>		<el-table v-if="tabs == 'success'" :data="dataList" stripe fit v-loading="table_loading" @row-click="open_detail">			<el-table-column label="姓名" prop="employee_id" align="left">				<template slot-scope="scope">					<div class="flex-box flex-contet-conter">						<userImage :id="scope.row.employee_id" :user_name="scope.row.employee_name" width="50px" height="50px"></userImage>						<span style="margin-left: 10px; line-height: 50px;">{{ scope.row.employee_name }}</span>					</div>				</template>			</el-table-column>			<el-table-column prop="remark" show-overflow-tooltip label="奖扣内容"></el-table-column>			<el-table-column prop="point" label="积分" width="120">				<template slot-scope="scope">					<span :class="{ color_green: scope.row.point < 0, color_red: scope.row.point > 0 }">						<span v-show="scope.row.point > 0">+</span>						{{ scope.row.point }} {{ point_name(scope.row.pt_id) }}					</span>				</template>			</el-table-column>			<el-table-column prop="create_time" label="奖扣时间" width="150">				<template slot-scope="scope">					{{ cuttString(scope.row.create_time) }}				</template>			</el-table-column>			<template slot="empty">				<noData></noData>			</template>		</el-table>		<el-table v-if="tabs !== 'success'" :data="dataList" stripe fit v-loading="table_loading" @row-click="open_detail1">			<el-table-column label="姓名" prop="employee_id" align="left">				<template slot-scope="scope">					<div class="flex-box flex-contet-conter">						<userImage :id="scope.row.employee_id" :user_name="scope.row.employee_name" width="50px" height="50px"></userImage>						<span style="margin-left: 10px; line-height: 50px;">{{ scope.row.employee_name }}</span>					</div>				</template>			</el-table-column>			<el-table-column prop="remark" show-overflow-tooltip label="奖扣内容">				<template slot-scope="scope">					{{ scope.row.remark.customize }}				</template>			</el-table-column>			<el-table-column prop="event_time" label="奖扣时间" width="150"></el-table-column>			<template slot="empty">				<noData></noData>			</template>		</el-table>		<center style="margin-top: 15px;">			<el-pagination				background				@size-change="handleSizeChange"				@current-change="handleCurrentChange"				:current-page="formData.page"				:page-sizes="[10, 20, 30, 40, 50, 100]"				layout="total, sizes, prev, pager, next"				:page-size="pageLimit"				:total="formData.total"			></el-pagination>		</center>		<el-drawer title="奖扣详情" :visible.sync="drawer" ref="drawer" :with-header="false" :size="'600px'" direction="rtl">			<div class="drawer_title">奖扣详情</div>			<div class="detail_popup" v-loading="detail_loading" v-if="detail_info !== null">				<el-row :gutter="10" style="padding-bottom:10px;border-bottom:1px #f8f8f8 solid;">					<el-col :span="24">						<userImage							:id="detail_info.employee_id"							:user_name="detail_info.employee_name"							:img_url="detail_info.img_url"							class="fl"							width="50px"							height="50px"							fontSize="15"						></userImage>						<span style="line-height:50px; margin-left:10px;margin-right:4px;">{{ detail_info.employee_name }}</span>						<span class="color_red point" v-show="detail_info.point >= 0 && detail_info.point">+{{ detail_info.point }}</span>						<span class="color_green point" v-show="detail_info.point < 0 && detail_info.point">{{ detail_info.point }}</span>						<span v-show="detail_info.point">{{ detail_info.pt_id == 1 ? '绩效分' : detail_info.pt_id == 2 ? 'A分' : detail_info.pt_id == 3 ? 'B分' : '' }}</span>					</el-col>				</el-row>				<el-row :gutter="10">					<el-col :span="4">任务描述</el-col>					<el-col :span="20" v-if="detail_info.remark">{{ detail_info.remark && (detail_info.remark.customize || detail_info.remark.rule) }}</el-col>				</el-row>				<el-row :gutter="10">					<el-col :span="4">规则分类</el-col>					<el-col :span="20">{{ detail_info.rule_list }}</el-col>				</el-row>				<el-row :gutter="10" v-show="detail_info.rule_list">					<el-col :span="4">事件时间</el-col>					<el-col :span="20">{{ detail_info.date }}</el-col>				</el-row>				<el-row :gutter="10" v-show="detail_info.source_type_mark">					<el-col :span="4">来源类型</el-col>					<el-col :span="20">{{ detail_info.source_type_mark }}</el-col>				</el-row>				<el-row :gutter="10" v-show="!detail_info.rule_id">					<el-col :span="4">记录人</el-col>					<el-col :span="20">{{ detail_info.employee_name }}</el-col>				</el-row>				<el-row :gutter="10" :v-if="detail_info.files">					<el-col v-for="(item, index) in detail_info.files" :key="index" :span="4">{{ index == 0 ? '图片' : '' }}</el-col>					<el-col :span="20">						<el-image							v-for="(item, index) in detail_info.files"							:key="index"							style="width: 100px; height: 100px;margin-right:8px"							:src="item"							:preview-src-list="detail_info.files"						></el-image>					</el-col>				</el-row>				<div v-show="detail_info.rule_item_id">					<p class="row_title">规则依据</p>					<el-row :gutter="10">						<el-col :span="4">规则分类</el-col>						<el-col :span="19">{{ detail_info.rule_list }}</el-col>					</el-row>					<el-row v-if="detail_info.remark && detail_info.remark.rule">						<el-col :span="4">积分规则</el-col>						<el-col :span="19">{{ detail_info.remark.rule }}</el-col>					</el-row>					<el-row v-if="detail_info.rule_item">						<el-col :span="4">积分</el-col>						<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>						<el-col :span="19" v-show="detail_info.rule_item.min_point != detail_info.rule_item.max_point">							{{ detail_info.rule_item.min_point }} ~ {{ detail_info.rule_item.max_point }}						</el-col>					</el-row>				</div>				<div v-show="detail_info.process != false">					<p class="row_title">						审批						<span class="row_tips">多人审批时,以最后一人为准</span>					</p>					<div class="examine_steps">						<el-steps direction="vertical" :space="50">							<el-step v-for="(item, index) in detail_info.process" :key="index">								<template slot="icon">									<userImage width="36px" height="36px" :img_url="item.img_url" :user_name="item.name"></userImage>								</template>								<template slot="title">									<div style="color: #303133;font-size:14px;margin-top:-2px;">										{{ item.name }} {{ item.remark }}										<!-- <span v-show="item.point !== 0">{{item.point}}</span> -->									</div>								</template>								<template slot="description">									<div style="color:rgb(130 130 130)">{{ item.time }}</div>								</template>							</el-step>						</el-steps>					</div>				</div>			</div>		</el-drawer>		<el-drawer title="奖扣详情" :visible.sync="detailShow" :with-header="false" :size="'600px'" direction="rtl">			<div class="drawer_title">奖扣详情</div>			<div class="detail_popup" v-loading="detail_loading" v-if="detail_info !== null">				<el-row :gutter="10" style="padding-bottom:10px;border-bottom:1px #f8f8f8 solid;">					<el-col :span="24">						<userImage :id="detail_info.applyor_id" class="fl" width="50px" height="50px" fontSize="15"></userImage>						<span style="line-height:50px; margin-left:10px;margin-right:4px;">{{ getEmployeeName(detail_info.applyor_id) }}</span>						<span class="color_red point" v-show="detail_info.point >= 0 && detail_info.point">+{{ detail_info.point }}</span>						<span class="color_green point" v-show="detail_info.point < 0 && detail_info.point">{{ detail_info.point }}</span>						<span v-show="detail_info.point">{{ detail_info.pt_id == 1 ? '绩效分' : detail_info.pt_id == 2 ? 'A分' : detail_info.pt_id == 3 ? 'B分' : '' }}</span>					</el-col>				</el-row>				<el-row :gutter="10" v-show="detail_info.source_type_mark">					<el-col :span="4">来源类型</el-col>					<el-col :span="20">{{ detail_info.source_type_mark }}</el-col>				</el-row>				<el-row :gutter="10" v-for="(item, index) in detail_info.detail" :key="index">					<el-col :span="4">{{ item.key }}</el-col>					<el-col :span="20" v-if="item.key == '附件'">						<el-image style="width: 100px; height: 100px" :src="item.value[0]" :preview-src-list="item.value"></el-image>					</el-col>					<el-col :span="20" v-else>{{ item.value }}</el-col>				</el-row>				<el-row :gutter="10" :v-if="detail_info.files">					<el-col v-for="(item, index) in detail_info.files" :key="index" :span="4">{{ index == 0 ? '图片' : '' }}</el-col>					<el-col :span="20">						<el-image							v-for="(item, index) in detail_info.files"							:key="index"							style="width: 100px; height: 100px;margin-right:8px"							:src="item"							:preview-src-list="detail_info.files"						></el-image>					</el-col>				</el-row>				<div v-show="detail_info.rule_id && detail_info.process !== null && detail_info.process.length > 0">					<p class="row_title">						审批						<span class="row_tips">多人审批时,以最后一人为准</span>					</p>					<div class="examine_steps">						<el-steps direction="vertical" :space="50">							<el-step v-for="(item, index) in detail_info.process" :key="index">								<template slot="icon">									<userImage width="36px" height="36px" :img_url="item.img_url" :user_name="item.name"></userImage>								</template>								<template slot="title">									<div style="color: #303133;font-size:14px;margin-top:-2px;">										{{ item.name }} {{ item.remark }}										<!-- <span v-show="item.point !== 0">{{item.point}}</span> -->									</div>								</template>								<template slot="description" style="">									<div style="color:rgb(130 130 130)">{{ item.time }}</div>								</template>							</el-step>						</el-steps>					</div>				</div>			</div>		</el-drawer>		<bonusPointsPopup :title="popuTitle" :visible.sync="popupVisible" :refresh.sync="refreshData" :integralType.sync="integralType"></bonusPointsPopup>	</div></template><script>import EmployeeSelector from '@/components/EmployeeSelector.vue';import moment from 'moment';import noData from '@/components/noData';import bonusPointsPopup from '@/components/bonusPointsPopup';export default {	data() {		return {			refreshData: '',			popuTitle: '奖扣A分',			popupVisible: false,			integralType: 0,			table_loading: true,			formData: {				page: 1,				page_size: 10,				total: 0			},			tabs: 'success',			dataList: [],			pageLimit: 10,			keyword: '',			point_types: JSON.parse(localStorage.getItem('SET_POINT_TYPES')),			showTitle: false,			dialogVisible: false,			dialogData: {				members: [],				items: [					{						rule_switch: false,						rule_id: '',						item_id: '',						point: '0',						remark: '',						event_time: moment().format('YYYY-MM-DD'),						approval: '',						approval_not_select: [],						approval_selected: { dept: [], employee: [] },						plus: true,						pt_id: '',						reviewer_id: '',						files: []					}				]			},			itemData: {},			rules: {				manager: [{ required: true, message: '请选择录入对象', trigger: 'blur' }]			},			manager: '',			employee_not_select: [],			manager_selected: { dept: [], employee: [] },			show_employee_selector: false,			show_approval_selector: false,			itemIndex: 0,			rule_list: [],			rule_item_list: {},			rule_item_list_value: null,			drawer: false,			detail_loading: false,			detail_info: {},			detailShow: false,			employee_name: JSON.parse(localStorage.getItem('SET_EMPLOYEE_MAP')),			fileList: []		};	},	components: {		EmployeeSelector,		bonusPointsPopup,		noData	},	mounted() {		// if(this.$route.query.type == 1){		//   this.point_a()		// }else if(this.$route.query.type == 2){		//   this.point_b()		// }		// this.getData()	},	watch: {		tabs(val) {			this.dataList = [];			this.formData.total = 0;			this.keyword = '';			this.formData.page = 1;			this.formData.page_size = 10;			// this.getData();		},		refreshData(val) {			// this.getData();		}	},	methods: {		getEmployeeName(id) {			for (const key in this.employee_name) {				if (this.employee_name[key].id == id) {					return this.employee_name[key].name;				}			}		},		open_detail1(item) {			this.detailShow = true;			let data = {				review_id: item.id			};			this.detail_loading = true;			this.$axios('get', '/api/integral/review', data)				.then(res => {					if (res.data.code == 1) {						this.detail_info = res.data.data;					} else {						this.$message.error(res.data.data.msg);					}				})				.finally(() => {					this.detail_loading = false;				});		},		open_detail(item) {			this.drawer = true;			let data = {				event_id: item.id			};			this.detail_loading = true;			this.$axios('get', '/api/integral/statistics/integral/info', data)				.then(res => {					if (res.data.code == 1) {						this.detail_info = res.data.data;					} else {						this.$message.error(res.data.data.msg);					}				})				.finally(() => {					this.detail_loading = false;				});		},		cuttString(data) {			return data.substring(0, 10);		},		point_a() {			this.integralType = 2;			this.popuTitle = '奖扣A分';			this.popupVisible = true;		},		point_b() {			this.integralType = 3;			this.popuTitle = '奖扣B分';			this.popupVisible = true;		},		point_name(id) {			return this.point_types.find(item => {				if (item.id == id) {					return item;				}			}).name;		},		handleCurrentChange(val) {			this.formData.page = val;			this.getData();		},		handleSizeChange(val) {			this.pageLimit = val;			this.formData.page_size = this.pageLimit;			this.getData();		},		getData() {			this.table_loading = true;			let data = {};			if (this.tabs == 'success') {				data = {					page: this.formData.page,					page_size: this.formData.page_size,					recorder_id: this.$store.getters.user_info.id,					source_type: '1',					keyword: this.keyword				};			} else if (this.tabs == 'waiting') {				data = {					page: this.formData.page,					page_size: this.formData.page_size,					keyword: this.keyword,					pt_id: '0',					type: 'waiting'				};			} else {				data = {					page: this.formData.page,					page_size: this.formData.page_size,					keyword: this.keyword,					pt_id: '0',					type: 'refuse'				};			}			this.$axios('get', this.tabs == 'success' ? '/api/integral/statistics/integral' : '/api/integral/review/entry/list', data)				.then(res => {					if (res.data.code == 1) {						this.dataList = res.data.data.list;						this.formData.total = res.data.data.total;					}				})				.catch(e => {					this.$message.error(e.data.msg);				})				.finally(() => {					this.table_loading = false;				});		}	}};</script><style scoped lang="scss">.box {	background-color: #ffffff;	padding: 20px;	min-height: calc(100vh - 160px);}.color_green {	color: #4bd964;}.color_red {	color: #f56c6c;}.detail_popup {	padding: 20px;	height: calc(100vh - 60px);	overflow: auto;	.row_title {		position: relative;		margin: 0 0 20px 0;		padding-top: 12px;		font-size: 16px;		color: #303133;		line-height: 22px;	}	.row_title:before {		position: absolute;		top: 0;		content: ' ';		width: 100%;		border-top: 1px #f8f8f8 solid;	}	.el-row {		margin-bottom: 10px;		font-size: 14px;		.el-col-4 {			color: #606266;		}	}}.drawer_title {	font-size: 18px;	padding: 20px;	border-bottom: 1px #efefef solid;}::v-deep .el-table tr:hover {	cursor: pointer;}</style>
 |