<template>
|
<a-card :bordered='false'>
|
<!-- 查询区域 -->
|
<div class='table-page-search-wrapper'>
|
<a-form layout='inline' @keyup.enter.native='searchQuery'>
|
<a-row :gutter='24'>
|
|
<a-col :md='6' :sm='12'>
|
<a-form-item label='项目编号'>
|
<j-input
|
placeholder='请输入项目编号模糊查询'
|
v-model='queryParam.xmbh'
|
>
|
</j-input>
|
</a-form-item>
|
</a-col>
|
|
<a-col :md='6' :sm='12'>
|
<a-form-item label='项目名称'>
|
<j-input
|
placeholder='请输入项目名称模糊查询'
|
v-model='queryParam.xmmc'
|
>
|
</j-input>
|
</a-form-item>
|
</a-col>
|
|
|
<template v-if='toggleSearchStatus'>
|
|
</template>
|
|
<a-col :md='6' :sm='8'>
|
<span style='float: left;overflow: hidden;' class='table-page-search-submitButtons'>
|
<a-button type='primary' @click='searchQuery' icon='search'>查询</a-button>
|
<a-button type='primary' @click='searchReset' icon='reload' style='margin-left: 8px'>重置</a-button>
|
<a @click='handleToggleSearch' style='margin-left: 8px'>
|
{{ toggleSearchStatus ? '收起' : '展开' }}
|
<a-icon :type="toggleSearchStatus ? 'up' : 'down'" />
|
</a>
|
</span>
|
</a-col>
|
|
</a-row>
|
</a-form>
|
</div>
|
|
<!-- 操作按钮区域 -->
|
<div class='table-operator' style='border-top: 5px'>
|
<a-button @click='openPaymentProjectModal' type='primary' icon='plus'>新增发放</a-button>
|
<a-button type='primary' icon='download' @click="handleExportXls('奖金发放信息')">导出</a-button>
|
<a-upload name='file' :showUploadList='false' :multiple='false' :headers='tokenHeader' :action='importExcelUrl'
|
@change='handleImportExcel'>
|
<a-button type='primary' icon='import'>导入</a-button>
|
</a-upload>
|
<a-dropdown v-if='selectedRowKeys.length > 0'>
|
<a-menu slot='overlay' @click='handleMenuClick'>
|
<a-menu-item key='1'>
|
<a-icon type='delete' @click='batchDel' />
|
删除
|
</a-menu-item>
|
</a-menu>
|
<a-button style='margin-left: 8px'>
|
批量操作
|
<a-icon type='down' />
|
</a-button>
|
</a-dropdown>
|
|
</div>
|
|
<!-- table区域-begin -->
|
<div>
|
<div class='ant-alert ant-alert-info' style='margin-bottom: 16px;'>
|
<i class='anticon anticon-info-circle ant-alert-icon'></i>已选择 <a
|
style='font-weight: 600'>{{ selectedRowKeys.length }}</a>项
|
<a style='margin-left: 24px' @click='onClearSelected'>清空</a>
|
</div>
|
|
<a-table
|
style='height: 500px'
|
:scroll='{ x: 1200 }'
|
ref='table'
|
bordered
|
size='middle'
|
rowKey='id'
|
:columns='columns'
|
:dataSource='dataSource'
|
:pagination='ipagination'
|
:loading='loading'
|
:expandedRowKeys="expandedRowKeys"
|
:rowSelection='{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}'
|
@change='handleTableChange'
|
@expand='handleExpand'>
|
|
<!-- 字符串超长截取省略号显示-->
|
<span slot='esContent10' slot-scope='text'>
|
<j-ellipsis :value='text' :length='10' />
|
</span>
|
<span slot='esContent15' slot-scope='text'>
|
<j-ellipsis :value='text' :length='15' />
|
</span>
|
<span slot='esContent20' slot-scope='text'>
|
<j-ellipsis :value='text' :length='20' />
|
</span>
|
|
<span slot='action' slot-scope='text, record'>
|
<a @click='openDe(record)'>定额</a>
|
<a-divider type='vertical' />
|
<a @click='openHs(record)'>核算</a>
|
<a-divider type='vertical' />
|
<a-dropdown>
|
<a class='ant-dropdown-link'>
|
更多 <a-icon type='down' />
|
</a>
|
<a-menu slot='overlay'>
|
<a-menu-item>
|
<a href='javascript:;' @click='handleDetail(record)'>详情</a>
|
</a-menu-item>
|
|
<a-menu-item>
|
<a-popconfirm title='确定删除吗?' @confirm='() => handleDelete(record.id)'>
|
<a>删除</a>
|
</a-popconfirm>
|
</a-menu-item>
|
|
</a-menu>
|
</a-dropdown>
|
</span>
|
|
|
<!-- 内部子table-->
|
<a-table
|
slot='expandedRowRender'
|
slot-scope='text'
|
:columns='innerColumns'
|
:dataSource='innerDataSource'
|
size='middle'
|
bordered
|
rowKey='id'
|
:pagination='false'
|
:rowSelection='{selectedRowKeys: selectedRowKeys2, onChange: onSelectChange2}'
|
:customRow='clickThenCheck2'>
|
<span slot='esContent' slot-scope='text'>
|
<j-ellipsis :value='text' :length='32' />
|
</span>
|
<span slot='action2' slot-scope='text, record'>
|
|
<a :disabled='record.paymentStatu==1' @click.stop='openAllocation(record)'>分配</a>
|
<a-divider type='vertical' />
|
<a-popconfirm title='确定发放奖金吗?发放完成后当前记录无法再操作' @confirm='() => handleGrant(record)'>
|
<a :disabled='record.paymentStatu==1'>发放</a>
|
</a-popconfirm>
|
<a-divider type='vertical' />
|
<a-dropdown>
|
<a class='ant-dropdown-link'>
|
更多 <a-icon type='down' />
|
</a>
|
<a-menu slot='overlay'>
|
<a-menu-item>
|
<a href='javascript:;' @click='handleSubDetail(record)'>详情</a>
|
</a-menu-item>
|
<a-menu-item>
|
<a-popconfirm title='确定删除吗?' @confirm='() => handleDeleteItem(record.id)'>
|
<a>删除</a>
|
</a-popconfirm>
|
</a-menu-item>
|
|
</a-menu>
|
</a-dropdown>
|
</span>
|
</a-table>
|
|
</a-table>
|
</div>
|
<!-- table区域-end -->
|
<!-- 选择奖金发放项目 -->
|
<payment-project-modal ref='paymentProjectModal' @ok='paymentProjectOk'></payment-project-modal>
|
<!-- 添加奖金发放记录 -->
|
<bonus-payment-modal ref='modalForm' @ok='modalFormOk'></bonus-payment-modal>
|
<!-- 定额 -->
|
<de-gx-modal ref='deGxModal' @ok='deGxModalOk'></de-gx-modal>
|
<!-- 新增核算(发放进度) -->
|
<hs-gx-modal ref='hsGxModal' @ok='hsGxModalOk'></hs-gx-modal>
|
<!-- 考评 -->
|
<kp-modal ref='kpModal' @ok='kpModalOk'></kp-modal>
|
<!-- 分配 -->
|
<fp-gx-modal ref='allocationModal' @ok='allocationModalOk'></fp-gx-modal>
|
|
|
</a-card>
|
</template>
|
|
<script>
|
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
import PaymentProjectModal from '@views/bonus/modules/PaymentProjectModal'
|
import BonusPaymentModal from '@views/bonus/modules/BonusPaymentModal'
|
import { deleteAction, getAction, putAction } from '@api/manage'
|
import KpModal from '@views/bonus/modules/KpModal'
|
import DeGxModal from '@views/bonus/modules/DeGxModal'
|
import HsGxModal from '@views/bonus/modules/HsGxModal'
|
import FpGxModal from '@views/bonus/modules/FpGxModal'
|
|
export default {
|
name: 'BonusPaymentGx',
|
mixins: [JeecgListMixin],
|
components: {
|
FpGxModal,
|
HsGxModal,
|
DeGxModal,
|
KpModal,
|
BonusPaymentModal,
|
PaymentProjectModal
|
},
|
data() {
|
return {
|
description: '这是用户管理页面',
|
queryParam: {
|
type: 4
|
},
|
disableMixinCreated: false,
|
innerDataSource: [],
|
selectedRowKeys2: [],
|
selectionRows2: [],
|
columns: [
|
{
|
title: '序号',
|
dataIndex: '',
|
key: 'rowIndex',
|
width: 60,
|
align: 'center',
|
customRender: function(t, r, index) {
|
return parseInt(index) + 1
|
}
|
},
|
{
|
title: '项目名称',
|
align: 'center',
|
dataIndex: 'xmmc',
|
width: 240,
|
sorter: true,
|
scopedSlots: { customRender: 'esContent15' }
|
},
|
{
|
title: '负责人',
|
align: 'center',
|
dataIndex: 'fzr_dictText'
|
},
|
|
{
|
title: '奖励类型',
|
align: 'center',
|
dataIndex: 'type_dictText'
|
},
|
{
|
title: '发放进度',
|
align: 'center',
|
dataIndex: 'ffjd_dictText',
|
scopedSlots: { customRender: 'esContent10' }
|
},
|
{
|
title: '创建时间',
|
align: 'center',
|
width: 120,
|
dataIndex: 'createTime',
|
customRender: (text) => {
|
return text.substring(0, 10)
|
}
|
},
|
|
|
{
|
title: '定额',
|
align: 'center',
|
dataIndex: 'de',
|
customRender: (text) => {
|
let re = ''
|
if (text == 0 || text == null) {
|
re = '否'
|
} else {
|
re = '是'
|
}
|
return re
|
}
|
},
|
{
|
title: '技术分类',
|
align: 'center',
|
dataIndex: 'jsfl_dictText'
|
},
|
{
|
title: '成本系数',
|
align: 'center',
|
dataIndex: 'tcxs',
|
customRender: (text) => {
|
if(text== null || text == 0 ){
|
return ''
|
}else {
|
return text +'%'
|
}
|
}
|
},
|
{
|
title: '核算奖金',
|
align: 'center',
|
dataIndex: 'sjjj'
|
},
|
{
|
title: '已发奖金',
|
align: 'center',
|
dataIndex: 'yfjj'
|
},
|
|
{
|
title: '操作',
|
dataIndex: 'action',
|
scopedSlots: { customRender: 'action' },
|
align: 'center',
|
width: 170
|
}
|
|
],
|
// 子表表头
|
innerColumns: [
|
{
|
title: '项目阶段',
|
align: 'center',
|
width: 140,
|
dataIndex: 'ffjd_dictText',
|
key: 'name'
|
},
|
{
|
title: '项目成员',
|
align: 'center',
|
width: 200,
|
dataIndex: 'yfcy_dictText',
|
scopedSlots: { customRender: 'esContent' }
|
},
|
{
|
title: '销售额',
|
width: 80,
|
dataIndex: 'xse',
|
align: 'center'
|
},
|
{
|
title: '提成系数',
|
width: 80,
|
dataIndex: 'tcxs',
|
align: 'center',
|
customRender: function(text) {
|
if (text) {
|
return text + '%'
|
}
|
return text
|
}
|
},
|
{
|
title: '核算奖金',
|
width: 80,
|
dataIndex: 'sfje',
|
align: 'center'
|
},
|
|
{
|
title: '已分比例',
|
width: 80,
|
dataIndex: 'fpzb',
|
align: 'center',
|
customRender: function(text) {
|
if (text) {
|
return text + '%'
|
}
|
return text
|
}
|
},
|
{
|
title: '已分奖金',
|
width: 80,
|
dataIndex: 'fpze',
|
align: 'center'
|
},
|
{
|
title: '发放状态',
|
width: 80,
|
dataIndex: 'paymentStatu_dictText',
|
align: 'center'
|
},
|
{
|
title: '操作',
|
dataIndex: 'action',
|
scopedSlots: { customRender: 'action2' },
|
align: 'center',
|
width: 170
|
}
|
|
],
|
|
url: {
|
list: '/bon/payment/list',
|
listitem: '/bon/item/list',
|
edititem: '/bon/item/edit',
|
delete: '/bon/payment/delete',
|
deleteItem: '/bon/item/delete',
|
deleteBatch: '/bon/payment/deleteBatch',
|
exportXlsUrl: '/bon/payment/exportXls',
|
importExcelUrl: 'bon/payment/importExcel'
|
},
|
dictOptions: [{
|
text: '选项一',
|
value: '1'
|
}, {
|
text: '选项二',
|
value: '2'
|
}, {
|
text: '选项三',
|
value: '3'
|
}]
|
}
|
},
|
methods: {
|
handleMenuClick(e) {
|
if (e.key == 1) {
|
this.batchDel()
|
}
|
},
|
onSyncFinally({ isToLocal }) {
|
// 同步到本地时刷新下数据
|
if (isToLocal) {
|
this.loadData()
|
}
|
},
|
clickThenCheck2(record) {
|
return {
|
on: {
|
click: () => {
|
this.onSelectChange2(record.id.split(','), [record])
|
}
|
}
|
}
|
},
|
onSelectChange2(selectedRowKeys, selectionRows) {
|
this.selectedRowKeys2 = selectedRowKeys
|
this.selectionRows2 = selectionRows
|
},
|
//初始化数据,根据传递项目编号查询项目
|
initData() {
|
const xmbh = this.$route.query.xmbh
|
if (xmbh) {
|
this.queryParam.xmbh = xmbh
|
}
|
this.loadData()
|
},
|
handleSubDetail: function(record) {
|
this.$refs.allocationModal.edit(record)
|
this.$refs.allocationModal.title = '详情'
|
this.$refs.allocationModal.disableSubmit = true
|
},
|
handleDeleteItem: function(id) {
|
if (!this.url.deleteItem) {
|
this.$message.error('请设置url.delete属性!')
|
return
|
}
|
var that = this
|
deleteAction(that.url.deleteItem, {
|
id: id
|
}).then((res) => {
|
if (res.success) {
|
//重新计算分页问题
|
that.$message.success(res.message)
|
that.loadData()
|
that.queryInnerData(this.expandedRowKeys[0])
|
} else {
|
that.$message.warning(res.message)
|
}
|
})
|
},
|
handleGrant(record){
|
const that = this
|
if(!record.fpze || record.fpze<=0){
|
that.$message.warning('请先分配金额')
|
return
|
}
|
//设置为已发放
|
record.paymentStatu = 1
|
putAction(this.url.edititem, record)
|
.then((res) => {
|
that.confirmLoading = false
|
if (res.success) {
|
that.$message.success(res.message)
|
this.loadData()
|
this.queryInnerData(this.expandedRowKeys[0])
|
} else {
|
that.$message.warning(res.message)
|
}
|
})
|
.finally(() => {
|
that.confirmLoading = false
|
})
|
},
|
//分配
|
openAllocation(record) {
|
if(record.paymentStatu == 1){
|
this.$message.warning('奖金已发放,不能分配!')
|
return
|
}
|
if (record.id) {
|
this.$refs.allocationModal.edit(record)
|
}
|
},
|
allocationModalOk() {
|
this.loadData()
|
this.queryInnerData(this.expandedRowKeys[0])
|
},
|
//考评
|
openKp(record) {
|
if (record.id) {
|
this.$refs.kpModal.show(record)
|
}
|
},
|
kpModalOk() {
|
this.loadData()
|
this.queryInnerData(this.expandedRowKeys[0])
|
},
|
//定额
|
openDe(record) {
|
if(!record.jsfl){
|
this.$message.error('请先定额项目型,确定技术类别')
|
return false
|
}
|
if (record.id) {
|
this.$refs.deGxModal.edit(record.id)
|
}
|
},
|
//核算
|
openHs(record) {
|
let item = {}
|
if(!record.jsfl){
|
this.$message.error('请先定额项目型,确定技术类别')
|
return false
|
}
|
if(record.de == 0){
|
this.$message.error('请先完成定额!')
|
return false
|
}
|
if (record.id) {
|
item.pid = record.id
|
item.pro = record.pro
|
item.ffjd = record.ffjd
|
item.tcxs = record.tcxs
|
item.fzr = record.fzr
|
item.yfcy = record.xmcy
|
item.type = record.type
|
item.jslb = record.jsfl
|
this.$refs.hsGxModal.edit(item)
|
}
|
|
},
|
//打开选择发放奖金项目列表窗口
|
openPaymentProjectModal() {
|
this.$refs.paymentProjectModal.show()
|
|
},
|
//完成选择发放奖金项目
|
paymentProjectOk(project) {
|
console.info(project)
|
let record = {}
|
record.pro = project.id
|
record.xmmc = project.xmmc
|
record.xmbh = project.xmbh
|
record.fzr = project.xmfzr
|
record.xmcy = project.xmcy
|
this.handleAdd(record)
|
},
|
//新增发放记录
|
handleAdd: function(record) {
|
this.$refs.modalForm.edit(record)
|
this.$refs.modalForm.title = '新增'
|
this.$refs.modalForm.disableSubmit = false
|
},
|
//外table展开关闭
|
handleExpand(expanded, record) {
|
this.expandedRowKeys = []
|
this.innerDataSource = []
|
if (expanded === true) {
|
if (!record.id) return false
|
this.expandedRowKeys.push(record.id)
|
//查询内table数据
|
this.queryInnerData(record.id)
|
}
|
},
|
//完成定额
|
deGxModalOk() {
|
this.loadData()
|
},
|
hsGxModalOk() {
|
this.loadData()
|
this.queryInnerData(this.expandedRowKeys[0])
|
},
|
queryInnerData(paymentId) {
|
getAction(this.url.listitem, { pid: paymentId }).then((res) => {
|
if (res.success) {
|
// this.loading = false
|
this.innerDataSource = res.result.records
|
}
|
}).finally(() => {
|
// this.loading = false
|
})
|
}
|
},
|
created() {
|
this.initData()
|
},
|
searchReset() {
|
this.initData()
|
},
|
computed: {
|
importExcelUrl: function() {
|
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
|
}
|
}
|
}
|
</script>
|
|
<style scoped>
|
@import '~@assets/less/common.less';
|
</style>
|