Files
income_payments_client/src/views/projectManagement/WorkingGroupMemberUnitMaintenance.vue
T

581 lines
20 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<template>
<div>
<page-header-title :is-level-one="false" :level-two-title="workingGroupProject"></page-header-title>
<a-card :bordered="false">
<div class="part-title">
<div class="part-title-text">工作组信息</div>
</div>
<!-- 工作组信息区域-->
<a-spin :spinning="spinning">
<div class="work-group-detail">
<div class="work-group-detail-item work-group-detail-item-small"
v-for="(item, index) in detailTitleList"
:key="index">
<div class="work-group-detail-item-title">{{ item.title }}</div>
<div class="work-group-detail-item-content work-group-detail-item-filename"
v-if="(item.fieldName === 'chargeNoticeAId' || item.fieldName === 'chargeNoticeBId') && workingGroupDetail[item.fieldName]">
<preview-file :file-id="workingGroupDetail[item.fieldName]"></preview-file>
</div>
<div class="work-group-detail-item-content" v-else>{{ workingGroupDetail[item.fieldName] }}</div>
</div>
<div class="work-group-detail-item">
<div class="work-group-detail-item-title">任务及目标</div>
<div class="work-group-detail-item-content">{{ workingGroupDetail.missionAndObjectives }}</div>
</div>
<div class="work-group-detail-item">
<div class="work-group-detail-item-title">备注</div>
<div class="work-group-detail-item-content">{{ workingGroupDetail.remarks }}</div>
</div>
</div>
</a-spin>
<!-- /工作组信息区域-->
<a-divider></a-divider>
<!-- 查询区域-->
<div class="part-title">
<div class="part-title-text">成员信息</div>
</div>
<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.chargeCompanyTemporaryName"
:maxLength='50'></a-input>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="来款状态" :labelCol="labelCol" :wrapperCol="wrapperCol">
<j-dict-select-tag v-model="queryParam.chargeStatus " placeholder="请选择来款状态"
dictCode="work_group_charge_status"/>
</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.paymentDate"></j-year-date>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="是否打包" :labelCol="labelCol" :wrapperCol="wrapperCol">
<j-dict-select-tag v-model="queryParam.pack"
placeholder="请选择是否打包"
dictCode="yn"
/>
</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="'workingGroupMember:search'">查询</a-button>
<a-button icon="reload" @click="searchReset" class="reset-button">重置</a-button>
</span>
</a-col>
</a-row>
</a-form>
</div>
<!-- /查询区域-->
<!-- 操作按钮区域-->
<div class="table-operator">
<a-button type="primary" icon="plus" @click="handleAdd" v-has="'workingGroupMember:add'" v-if="canOperate">
添加成员
</a-button>
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :data="importParam"
:action="importExcelUrl" @change="handleImportExcel" v-has="'workingGroupMember:import'"
v-if="canOperate">
<a-button type="primary" icon="import">导入</a-button>
</a-upload>
<a-button type="primary" icon="export" @click="handleExportXls('工作组成员')" v-has="'workingGroupMember:export'">
导出
</a-button>
<a-button type="primary" icon="download" @click="downTemplate('工作组成员导入模板')"
v-has="'workingGroupMember:downTemplate'" v-if="canOperate">下载模板
</a-button>
<a-button type="danger" icon="delete" @click="batchDel" v-has="'workingGroupMember:batchDel'" v-if="canOperate">
批量删除
</a-button>
<a-button type="primary" @click="setChargeNotic" v-has="'workingGroupMember:setChargeNotic'" v-if="canOperate">
设置收费通知
</a-button>
<a-button type="primary" @click="setDunningReminder" v-has="'workingGroupMember:setDunningReminder'"
v-if="canOperate">催款提醒
</a-button>
</div>
<!-- /操作按钮区域-end-->
<!-- table表格区域-->
<div>
<a-table
ref="table"
size="middle"
bordered
rowKey="id"
:columns="columns"
:scroll="{x: 1500}"
: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 :value="text"
:length="18"
class="primary-color"
@click="openDetailModal(record)"></j-ellipsis>
</template>
<!-- 打包需要发票到账开票邮寄状态-->
<template slot="status" slot-scope="text,record">
<status-slot :statu-obj="record" :status-no="text" :status-type="true"></status-slot>
</template>
<!-- 开票-->
<template slot="status-bill" slot-scope="text,record">
<status-slot :statu-obj="record" :status-no="text" :status-type="true" status-key="bill"></status-slot>
</template>
<!-- 邮寄-->
<template slot="status-mail" slot-scope="text,record">
<status-slot :statu-obj="record" :status-no="text" :status-type="true" status-key="mail"></status-slot>
</template>
<template slot="status-pack" slot-scope="text,record">
<status-slot :statu-obj="record" :status-no="text"></status-slot>
</template>
<template slot="text" slot-scope="text">
<a-tooltip>
<template slot="title">{{ text }}</template>
<div class="table-text">{{ text }}</div>
</a-tooltip>
</template>
<span slot="action" class="action-span-cell" slot-scope="text, record" v-if="canOperate">
<a @click="handleEdit(record)" v-has="'workingGroupMember:edit'">编辑</a>
<a @click="handleDelete(record.id)" v-has="'workingGroupMember:delete'">删除</a>
</span>
</a-table>
</div>
</a-card>
<project-detail-modal ref="projectDetail"></project-detail-modal>
<working-group-member-unit-module ref="modalForm" @ok="modalFormOk"></working-group-member-unit-module>
<working-group-member-set-charge-notice ref="setChargeNotic"
@ok="modalFormOk"></working-group-member-set-charge-notice>
<email-error-msg-modal ref="emailError"></email-error-msg-modal>
</div>
</template>
<script>
import { JeroListMixin } from '@/mixins/JeroListMixin'
import JYearDate from '@comp/jero/JYearDate'
import PageHeaderTitle from '@comp/layouts/PageHeaderTitle'
import { getWorkingGroupById, getChargeNotice, dunningReminder } from '@api/incomePaymentsApi'
import StatusSlot from '../../components/tools/StatusSlot'
import ProjectDetailModal from '../../components/ProjectDetailModal'
import WorkingGroupMemberUnitModule from './modules/WorkingGroupMemberUnitModule'
import WorkingGroupMemberSetChargeNotice from './modules/WorkingGroupMemberSetChargeNotice'
import Vue from 'vue'
import { ACCESS_TOKEN } from '../../store/mutation-types'
import PreviewFile from '../../components/jero/PreviewFile'
import EmailErrorMsgModal from './modules/EmailErrorMsgModal'
// eslint-disable-next-line no-undef,no-unused-vars
const Base64 = require('js-base64').Base64
export default {
name: 'WorkingGroupMemberUnitMaintenance',
components: {
JYearDate,
PageHeaderTitle,
StatusSlot,
ProjectDetailModal,
WorkingGroupMemberUnitModule,
WorkingGroupMemberSetChargeNotice,
PreviewFile,
EmailErrorMsgModal
},
mixins: [JeroListMixin],
computed: {
importExcelUrl: function () {
return `${ window._CONFIG['domianURL'] }/${ this.url.importExcelUrl }`
}
},
data() {
return {
disableMixinCreated: true,
workingGroupProject: '',
workingGroupProjectId: '',
spinning: false,
detailTitleList: [
{
title: '工作组项目名称',
fieldName: 'workingGroupProject'
}, {
title: '负责人A',
fieldName: 'principalNameA'
}, {
title: '负责人B',
fieldName: 'principalNameB'
}, {
title: '每年召开次数',
fieldName: 'convokeNum'
}, {
title: '运行周期',
fieldName: 'operationCycle'
}, {
title: '本年应收款A',
fieldName: 'yearChargeA'
}, {
title: '收费通知号A',
fieldName: 'chargeNoticeNoA'
}, {
title: '收费通知A',
fieldName: 'chargeNoticeAId'
}, {
title: '本年应收款B',
fieldName: 'yearChargeB'
}, {
title: '收费通知号B',
fieldName: 'chargeNoticeNoB'
}, {
title: '收费通知B',
fieldName: 'chargeNoticeBId'
}
],
labelCol: {
xs: { span: 24 },
sm: { span: 5 }
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 10 }
},
url: {
list: '/project/payWorkingGroupSubitem/list',
delete: '/project/payWorkingGroupSubitem/delete',
deleteBatch: '/project/payWorkingGroupSubitem/deleteBatch',
exportXlsUrl: '/project/payWorkingGroupSubitem/exportXls',
importExcelUrl: '/project/payWorkingGroupSubitem/importExcel',
downTemplateUrl: '/project/payWorkingGroupSubitem/downloadExcelModel'
},
columns: [
{
title: '序号',
dataIndex: '',
key: 'rowIndex',
width: 60,
align: 'center',
customRender: function (t, r, index) {
return parseInt(index) + 1
}
}, {
title: '成员单位',
align: 'center',
width: 280,
dataIndex: 'chargeCompanyTemporaryName',
scopedSlots: { customRender: 'projectName' }
}, {
title: '企业联系人',
align: 'center',
width: 120,
dataIndex: 'contactsTemporaryNameOne',
scopedSlots: { customRender: 'text' }
}, {
// 2021-10-22需求变更新加
title: '收费通知号',
align: 'center',
width: 280,
dataIndex: 'chargeNoticeNo',
scopedSlots: { customRender: 'text' }
}, {
title: '应收金额',
align: 'center',
dataIndex: 'receivableAmount',
width: 180,
customRender: (text, record) => (
<j-ellipsis value={ record.receivableAmount + '元' } length={ 15 }></j-ellipsis>
)
}, {
title: '实收金额',
align: 'center',
dataIndex: 'paidAmount',
width: 180,
customRender: (text, record) => (
<j-ellipsis value={ record.paidAmount + '元' } length={ 15 }></j-ellipsis>
)
}, {
title: '打包',
align: 'center',
width: 80,
dataIndex: 'pack',
scopedSlots: { customRender: 'status-pack' }
}, {
title: '需要发票',
align: 'center',
width: 80,
dataIndex: 'needInvoice',
scopedSlots: { customRender: 'status-pack' }
}, {
title: '到账',
align: 'center',
width: 80,
dataIndex: 'inAccount',
scopedSlots: { customRender: 'status' }
}, {
title: '开票',
align: 'center',
width: 80,
dataIndex: 'makeInvoice',
scopedSlots: { customRender: 'status-bill' }
}, {
title: '邮寄',
align: 'center',
width: 80,
dataIndex: 'mail',
scopedSlots: { customRender: 'status-mail' }
}, {
title: '操作',
dataIndex: 'action',
align: 'center',
fixed: 'right',
width: 180,
scopedSlots: { customRender: 'action' }
}
],
workingGroupDetail: {},
chargeNoticeList: [], // 收费通知号选项
importParam: {},
// 给定当年作为来款年份默认查询条件
// queryParam: {
// paymentDate: new Date().getFullYear().toString()
// },
// lastQueryParam: {
// paymentDate: new Date().getFullYear().toString()
// },
canOperate: true // 是否可操作(负责人B不可操作)
}
},
created() {
// 初始化工作组信息
this.initWorkGroupData()
},
methods: {
/**
* 初始化工作组信息
*/
initWorkGroupData() {
this.spinning = true
this.workingGroupProject = this.$route.query.workingGroupProject || ''
this.workingGroupProjectId = this.$route.query.workingGroupProjectId || ''
this.canOperate = this.$route.query.canOperate === 'true' ? true : false
this.filters.workingGroupId = this.workingGroupProjectId
this.importParam.workGroupId = this.workingGroupProjectId
this.loadData()
let param = {
id: this.workingGroupProjectId
}
getWorkingGroupById(param).then(res => {
if (res.success) {
this.workingGroupDetail = res.result || {}
}
}).finally(() => {
this.spinning = false
})
},
handleAdd: function () {
this.getChargeNoticeList()
this.$refs.modalForm.workingGroupId = this.workingGroupProjectId
this.$refs.modalForm.chargeNoticeList = this.chargeNoticeList
this.$refs.modalForm.add()
this.$refs.modalForm.title = '添加成员'
this.$refs.modalForm.disableSubmit = false
},
handleEdit: function (record) {
this.getChargeNoticeList()
this.$refs.modalForm.workingGroupId = this.workingGroupProjectId
this.$refs.modalForm.chargeNoticeList = this.chargeNoticeList
this.$refs.modalForm.edit(record)
this.$refs.modalForm.title = '编辑'
this.$refs.modalForm.disableSubmit = false
},
/**
* 获取收费通知列表
*/
getChargeNoticeList() {
this.chargeNoticeList = []
let chargeNoticeA, chargeNoticeB
// 是否存在收费通知A
if (this.workingGroupDetail.chargeNoticeNoA && this.workingGroupDetail.chargeNoticeNoA !== '') {
chargeNoticeA = {
type: 'chargeNoticeA',
label: `A${ this.workingGroupDetail.chargeNoticeNoA }`,
value: this.workingGroupDetail.chargeNoticeNoA,
key: this.workingGroupDetail.chargeA,
yearCharge: this.workingGroupDetail.yearChargeA,
chargeNoticeId: this.workingGroupDetail.chargeNoticeAId
}
this.chargeNoticeList.push(chargeNoticeA)
}
// 是否存在收费通知B
if (this.workingGroupDetail.chargeNoticeNoB && this.workingGroupDetail.chargeNoticeNoB !== '') {
chargeNoticeB = {
type: 'chargeNoticeB',
label: `B${ this.workingGroupDetail.chargeNoticeNoB }`,
value: this.workingGroupDetail.chargeNoticeNoB,
key: this.workingGroupDetail.chargeB,
yearCharge: this.workingGroupDetail.yearChargeB,
chargeNoticeId: this.workingGroupDetail.chargeNoticeBId
}
this.chargeNoticeList.push(chargeNoticeB)
}
},
/**
* 设置收费通知
*/
setChargeNotic() {
if (!this.workingGroupDetail.chargeNoticeNoA && !this.workingGroupDetail.chargeNoticeNoB) {
this.$message.warn('请先补充该工作组的收费通知信息')
return
}
if (this.selectedRowKeys.length === 0) {
this.$message.warn('请先选择成员')
return
}
// 2022-04-26 变更:不校验来款是否是收费通知
// let param = {
// ids: this.selectedRowKeys.join(','),
// workingGroupId: this.workingGroupProjectId
// }
// 判断选中的成员是否存在来款方式非收费通知的
// getChargeNotice(param).then(res => {
// if (res.success) {
this.getChargeNoticeList()
this.$refs.setChargeNotic.chargeNoticeList = this.chargeNoticeList
this.$refs.setChargeNotic.selectedRowKeys = this.selectedRowKeys
this.$refs.setChargeNotic.handleOpen()
// } else {
// this.$message.warn(res.message)
// }
// })
},
/**
* 催款提醒
*/
setDunningReminder() {
if (this.selectedRowKeys.length === 0) {
this.$message.warn('请先选择成员')
return
}
let param = {
projectIds: this.selectedRowKeys.join(',').toString()
}
const that = this
this.$confirm({
title: '确认催款',
content: '是否向选中的成员发送催款提醒?',
onOk: function () {
that.loading = true
dunningReminder(param).then((res) => {
if (res.success) {
that.$message.success(res.message)
// 是否有邮件发送失败 有就给出提示信息
if (Array.isArray(res.result) && res.result.length > 0) {
// msgWarn(this,res.result,0)
that.$refs.emailError.open()
that.$refs.emailError.msgList = res.result
console.log(that.$refs.emailError.msgList, 'that.$refs.emailError.msgList ')
}
that.loadData()
that.onClearSelected()
} else {
that.$message.warning(res.message)
}
}).finally(() => {
that.loading = false
})
}
})
},
/**
* 文件预览
* @param file
*/
previewFile(file) {
console.log(file)
if (file && file.url) {
const fileFullUrl = `${ window._CONFIG['domianWebSocketURL'] }/sys/common/download/${ file.id }?token=${ Vue.ls.get(ACCESS_TOKEN) }&fullfilename=${ file.fileName }`
// let url = `${ window._CONFIG['onlinePreviewDomainURL'] }?url=${ encodeURIComponent(Base64.encode(fileFullUrl)) }`
let url = `${ window._CONFIG['onlinePreviewDomainURL'] }?url=${ encodeURIComponent(fileFullUrl) }`
window.open(url)
}
}
// 2021 10 11 沟通后去掉了这个功能
// searchReset() {
// this.lastQueryParam = {
// paymentDate: new Date().getFullYear().toString()
// }
// this.queryParam = {
// paymentDate: new Date().getFullYear().toString()
// }
// this.loadData(1)
// },
}
}
</script>
<style scoped lang="less">
@import '~@assets/less/common.less';
.ant-divider-horizontal {
height: 1px;
background-color: #F2F2F2;
margin: 15px 0px;
}
.work-group-detail {
display: flex;
flex-wrap: wrap;
padding-bottom: 20px;
&-item-small {
width: 33.3% !important;
}
&-item {
display: flex;
padding: 5px 5px;
width: 100%;
font-size: 14px;
&-title {
flex-shrink: 0;
color: #999999;
}
&-content {
word-break: break-all;
color: #2F3133;
}
&-filename {
//cursor: pointer;
}
}
}
.table-text {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
</style>