366 lines
12 KiB
Vue
366 lines
12 KiB
Vue
<template>
|
|
<div>
|
|
<page-header-title :img-for-icon="IconWorkingGruop"></page-header-title>
|
|
<a-card :bordered="false">
|
|
<!-- 查询区域-start -->
|
|
<div class="table-page-search-wrapper">
|
|
<a-form layout="inline" @keyup.enter.native="searchQuery">
|
|
<a-row>
|
|
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
|
<a-form-item label="工作组项目" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
|
<a-input placeholder="请输入工作组项目" v-model="queryParam.workingGroupProject" :maxLength='50'></a-input>
|
|
</a-form-item>
|
|
</a-col>
|
|
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
|
<a-form-item label="负责人A" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
|
<select-principal placeholder="请选择负责人" v-model="queryParam.principalIdA"></select-principal>
|
|
</a-form-item>
|
|
</a-col>
|
|
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
|
<a-form-item label="运行年份" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
|
<j-year-date style="width:100%" placeholder="请选择运行年份" v-model="queryParam.year"></j-year-date>
|
|
</a-form-item>
|
|
</a-col>
|
|
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
|
<span class="table-page-search-submitButtons">
|
|
<a-button type="primary" icon="search" @click="searchQuery"
|
|
v-has="'workingGroupProject:search'">查询</a-button>
|
|
<a-button icon="reload" @click="searchReset" class="reset-button">重置</a-button>
|
|
</span>
|
|
</a-col>
|
|
</a-row>
|
|
</a-form>
|
|
</div>
|
|
<!-- /查询区域-end-->
|
|
|
|
<!-- 操作按钮区域-->
|
|
<div class="table-operator">
|
|
<a-button type="primary" icon="plus" @click="handleAdd" v-has="'workingGroupProject:add'">新增</a-button>
|
|
<a-button type="danger" icon="delete" @click="batchDel" v-has="'workingGroupProject:batchDel'">批量删除</a-button>
|
|
|
|
<!-- 进度条tooltip-->
|
|
<div class="tooltip">
|
|
<div class="tooltip-item">
|
|
<div class="tooltip-color tooltip-pay-in-full"></div>
|
|
<span>已付全款</span>
|
|
</div>
|
|
<div class="tooltip-item">
|
|
<div class="tooltip-color tooltip-partial-payment"></div>
|
|
<span>部分付款</span>
|
|
</div>
|
|
<div class="tooltip-item">
|
|
<div class="tooltip-color tooltip-non-payment"></div>
|
|
<span>未付款</span>
|
|
</div>
|
|
</div>
|
|
<!-- /进度条tooltip-->
|
|
</div>
|
|
<!-- /操作按钮区域-end-->
|
|
|
|
<!-- table表格区域-->
|
|
<div>
|
|
<a-table
|
|
ref="table"
|
|
size="middle"
|
|
bordered
|
|
rowKey="id"
|
|
:columns="columns"
|
|
:scroll="{x: 1300}"
|
|
:dataSource="dataSource"
|
|
:pagination="ipagination"
|
|
:loading="loading"
|
|
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
|
|
@change="handleTableChange"
|
|
class="j-table-force-nowrap">
|
|
|
|
<!-- 工作组名称-->
|
|
<template slot="projectName" slot-scope="text, record">
|
|
<j-ellipsis
|
|
class="primary-color"
|
|
@click="goMemberUnitMaintenance(record)"
|
|
:value="text"
|
|
:length="20"></j-ellipsis>
|
|
</template>
|
|
|
|
<!-- 进度-->
|
|
<template slot="rateOfProgress" slot-scope="text">
|
|
<progress-bar :data="text"></progress-bar>
|
|
</template>
|
|
|
|
<template slot="text" slot-scope="text">
|
|
<j-ellipsis :value="text" :length="20"></j-ellipsis>
|
|
</template>
|
|
|
|
<span slot="action" class="action-span-cell" slot-scope="text, record">
|
|
<a @click="goUnderStudyProject(record)" v-has="'workingGroupProject:underStudyProject'">在研项目</a>
|
|
<a @click="goFilesMaintenance(record)" v-has="'workingGroupProject:fileMaintenance'">其他分发资料</a>
|
|
<a @click="goConferenceMaintenance(record)" v-has="'workingGroupProject:meetingMaintenance'">工作组会议</a>
|
|
<a @click="copyWorkGroup(record.id)" v-has="'workingGroupProject:copy'"
|
|
v-if="record.checkoutOperation === 1">复制</a>
|
|
<a @click="handleEdit(record)" v-has="'workingGroupProject:edit'"
|
|
v-if="record.checkoutOperation === 1">基本信息维护</a>
|
|
<a @click="handleDelete(record.id)" v-has="'workingGroupProject:delete'"
|
|
v-if="record.checkoutOperation === 1">删除</a>
|
|
</span>
|
|
</a-table>
|
|
</div>
|
|
<!-- /table表格区域-->
|
|
<working-group-project-module ref="modalForm" @ok="modalFormOk"></working-group-project-module>
|
|
</a-card>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import { JeroListMixin } from '@/mixins/JeroListMixin'
|
|
import JYearDate from '@comp/jero/JYearDate'
|
|
import WorkingGroupProjectModule from '@views/projectManagement/modules/WorkingGroupProjectModule'
|
|
import SelectPrincipal from '@comp/company/SelectPrincipal'
|
|
import ProgressBar from '@comp/ProgressBar'
|
|
import PageHeaderTitle from '@comp/layouts/PageHeaderTitle'
|
|
import IconWorkingGruop from '@/assets/imgs/icon/icon_working_group.png'
|
|
import { copyWorkingGroup } from '../../api/incomePaymentsApi'
|
|
import { getAction } from '../../api/manage'
|
|
|
|
export default {
|
|
name: 'WorkingGroupProjectManagement',
|
|
components: { JYearDate, WorkingGroupProjectModule, SelectPrincipal, ProgressBar, PageHeaderTitle },
|
|
mixins: [JeroListMixin],
|
|
data() {
|
|
return {
|
|
IconWorkingGruop,
|
|
labelCol: {
|
|
xs: { span: 24 },
|
|
sm: { span: 5 }
|
|
},
|
|
wrapperCol: {
|
|
xs: { span: 24 },
|
|
sm: { span: 10 }
|
|
},
|
|
url: {
|
|
list: '/project/payWorkingGroup/list',
|
|
delete: '/project/payWorkingGroup/delete',
|
|
deleteBatch: '/project/payWorkingGroup/deleteBatch'
|
|
},
|
|
columns: [
|
|
{
|
|
title: '序号',
|
|
dataIndex: '',
|
|
key: 'rowIndex',
|
|
width: 60,
|
|
align: 'center',
|
|
customRender: function (t, r, index) {
|
|
return parseInt(index) + 1
|
|
}
|
|
}, {
|
|
title: '工作组项目',
|
|
align: 'center',
|
|
dataIndex: 'workingGroupProject',
|
|
scopedSlots: { customRender: 'projectName' }
|
|
}, {
|
|
title: '负责人A',
|
|
align: 'center',
|
|
dataIndex: 'principalNameA'
|
|
}, {
|
|
title: '收款进度',
|
|
align: 'center',
|
|
dataIndex: 'obj',
|
|
width: 250,
|
|
scopedSlots: { customRender: 'rateOfProgress' }
|
|
}, {
|
|
title: '操作',
|
|
dataIndex: 'action',
|
|
align: 'center',
|
|
fixed: 'right',
|
|
width: 280,
|
|
scopedSlots: { customRender: 'action' }
|
|
}
|
|
],
|
|
queryParam: {
|
|
year: new Date().getFullYear().toString()
|
|
},
|
|
lastQueryParam: {
|
|
year: new Date().getFullYear().toString()
|
|
},
|
|
operateData: [] // 进行操作权限校验时使用的数据
|
|
}
|
|
},
|
|
methods: {
|
|
loadData(arg) {
|
|
if (!this.url.list) {
|
|
this.$message.error('请设置url.list属性!')
|
|
return
|
|
}
|
|
//加载数据 若传入参数1则加载第一页的内容
|
|
if (arg === 1) {
|
|
this.ipagination.current = 1
|
|
}
|
|
var params = this.getQueryParams()//查询条件
|
|
this.loading = true
|
|
getAction(this.url.list, params).then((res) => {
|
|
if (res.success) {
|
|
//update-begin---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------
|
|
this.dataSource = res.result.records || res.result
|
|
if (res.result.total) {
|
|
this.ipagination.total = res.result.total
|
|
//清空列表选中
|
|
this.onClearSelected()
|
|
} else {
|
|
this.ipagination.total = 0
|
|
}
|
|
//update-end---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------
|
|
}
|
|
if (res.code === 510) {
|
|
this.$message.warning(res.message)
|
|
}
|
|
}).finally(() => {
|
|
this.loading = false
|
|
// 判断登录用户是否为负责人B 2021-10-13:修改为后端在列表字段返回checkoutOperation字段控制,1--可操作,2--不可操作
|
|
// if (this.dataSource.length > 0) {
|
|
// for (let index = 0; index < this.dataSource.length; index++) {
|
|
// this.checkWorkingGroupPrincipal(index).then((res) => {
|
|
// res.showOperate = true
|
|
// this.$set(this.dataSource, index, res)
|
|
// })
|
|
// }
|
|
// }
|
|
})
|
|
},
|
|
/**
|
|
* 判断登录用户是否为负责人B
|
|
*/
|
|
// checkWorkingGroupPrincipal(index) {
|
|
// let item = this.dataSource[index]
|
|
// // (负责人B不可操作)
|
|
// return new Promise(resolve => {
|
|
// checkoutWorkingGroupPrincipal({ id: item.id }).then(res => {
|
|
// // 不可操作则置否
|
|
// if (res.success) {
|
|
// item.canOperate = true
|
|
// } else {
|
|
// item.canOperate = false
|
|
// }
|
|
// }).finally(() => {
|
|
// resolve(item)
|
|
// })
|
|
// })
|
|
// },
|
|
/**
|
|
* 文件维护
|
|
* @param record
|
|
*/
|
|
goFilesMaintenance(record) {
|
|
console.log(record)
|
|
this.$router.push({
|
|
path: '/projectManagement/WorkingGroupProjectDataMaintenance',
|
|
query: {
|
|
workingGroupId: record.id,
|
|
canOperate: record.checkoutOperation === 1
|
|
}
|
|
})
|
|
},
|
|
/**
|
|
* 会议维护
|
|
* @param record
|
|
*/
|
|
goConferenceMaintenance(record) {
|
|
this.$router.push({
|
|
path: '/projectManagement/ConferenceMaintenance',
|
|
query: {
|
|
workingGroupProject: record.workingGroupProject,
|
|
workingGroupProjectId: record.id,
|
|
canOperate: record.checkoutOperation === 1
|
|
}
|
|
})
|
|
},
|
|
/**
|
|
* 复制
|
|
* @param id
|
|
*/
|
|
copyWorkGroup(id) {
|
|
copyWorkingGroup({ id: id }).then(res => {
|
|
if (res.success) {
|
|
this.$message.success(res.message)
|
|
} else {
|
|
this.$message.warn(res.message)
|
|
}
|
|
}).finally(() => {
|
|
this.loadData()
|
|
})
|
|
},
|
|
/**
|
|
* 成员维护
|
|
* @param record
|
|
*/
|
|
goMemberUnitMaintenance(record) {
|
|
this.$router.push({
|
|
path: '/projectManagement/WorkingGroupMemberUnitMaintenance',
|
|
query: {
|
|
workingGroupProject: record.workingGroupProject,
|
|
workingGroupProjectId: record.id,
|
|
canOperate: record.checkoutOperation === 1
|
|
}
|
|
})
|
|
},
|
|
searchReset() {
|
|
this.lastQueryParam = {
|
|
year: new Date().getFullYear().toString()
|
|
}
|
|
this.queryParam = {
|
|
year: new Date().getFullYear().toString()
|
|
}
|
|
this.loadData(1)
|
|
},
|
|
/**
|
|
* 在研项目
|
|
* @param record
|
|
*/
|
|
goUnderStudyProject(record) {
|
|
this.$router.push({
|
|
path: '/projectManagement/WorkingGroupProjectManagement/UnderStudyProject',
|
|
query: {
|
|
title: record.workingGroupProject,
|
|
id: record.id
|
|
}
|
|
})
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style scoped lang="less">
|
|
@import '~@assets/less/common.less';
|
|
|
|
.tooltip {
|
|
float: right;
|
|
width: auto;
|
|
display: flex;
|
|
justify-content: flex-end;
|
|
align-items: flex-end;
|
|
height: 40px;
|
|
|
|
&-item {
|
|
margin-right: 10px;
|
|
display: flex;
|
|
align-items: center;
|
|
}
|
|
|
|
&-color {
|
|
width: 13px;
|
|
height: 13px;
|
|
margin-right: 5px;
|
|
border-radius: 2px;
|
|
}
|
|
|
|
&-pay-in-full {
|
|
background: linear-gradient(0deg, #069f99 0%, #07b0a9 100%);
|
|
}
|
|
|
|
&-partial-payment {
|
|
background: linear-gradient(0deg, #0075a9 0%, #0096d8 100%);
|
|
}
|
|
|
|
&-non-payment {
|
|
background: #e8e8e8;
|
|
}
|
|
}
|
|
</style> |