【update】-增加单点登录内网的限制
This commit is contained in:
@@ -0,0 +1,375 @@
|
|||||||
|
<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 :xxl="6" :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 :xxl="6" :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 :xxl="6" :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 :xxl="6" :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 :xxl="6" :xl="6" :lg="7" :md="8" :sm="24">
|
||||||
|
<a-form-item label="企业名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||||
|
<a-input placeholder="请输入企业名称" v-model="queryParam.companyName" :maxLength='50'></a-input>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :xxl="6" :xl="6" :lg="7" :md="8" :sm="24">
|
||||||
|
<a-form-item label="企业联系人" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||||
|
<a-input placeholder="请输入企业联系人" v-model="queryParam.companyContactName" :maxLength='50'></a-input>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :xl="4" :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>
|
||||||
|
|
||||||
|
</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">
|
||||||
|
<a-tooltip>
|
||||||
|
<template slot="title">{{ text }}</template>
|
||||||
|
<div class="primary-color text-over" @click="goMemberUnitMaintenance(record)">{{ text }}</div>
|
||||||
|
</a-tooltip>
|
||||||
|
</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'"
|
||||||
|
v-if="record.checkoutOperation === 1">在研项目</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表格区域-->
|
||||||
|
<drafting-group-module ref="modalForm" @ok="modalFormOk"></drafting-group-module>
|
||||||
|
</a-card>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { JeroListMixin } from '@/mixins/JeroListMixin'
|
||||||
|
import JYearDate from '@comp/jero/JYearDate'
|
||||||
|
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'
|
||||||
|
import DraftingGroupModule from "./modules/DraftingGroupModule";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'WorkingGroupProjectManagement',
|
||||||
|
components: { JYearDate, DraftingGroupModule, 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: '关联工作组',
|
||||||
|
align: 'center',
|
||||||
|
dataIndex: 'obj',
|
||||||
|
width: 300
|
||||||
|
}, {
|
||||||
|
title: '负责人A',
|
||||||
|
align: 'center',
|
||||||
|
width: 130,
|
||||||
|
dataIndex: 'principalNameA'
|
||||||
|
}, {
|
||||||
|
title: '操作',
|
||||||
|
dataIndex: 'action',
|
||||||
|
align: 'center',
|
||||||
|
fixed: 'right',
|
||||||
|
width: 500,
|
||||||
|
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: '/draftingGroup/DraftingGroupMemberUnitMaintenance',
|
||||||
|
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
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 重写编辑
|
||||||
|
* @param record
|
||||||
|
*/
|
||||||
|
handleEdit(record) {
|
||||||
|
this.$refs.modalForm.edit(record)
|
||||||
|
this.$refs.modalForm.title = '基本信息维护'
|
||||||
|
this.$refs.modalForm.disableSubmit = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-over {
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,572 @@
|
|||||||
|
<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">-->
|
||||||
|
<!-- <a-input placeholder="请输入标签名称" v-model="queryParam.label" :maxLength='50'></a-input>-->
|
||||||
|
<!-- </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="setLabel" v-has="'workingGroupMember:setLabel'">设置标签</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>
|
||||||
|
|
||||||
|
<work-group-set-label ref="workGroupSetLabel" @ok="modalFormOk"></work-group-set-label>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { JeroListMixin } from '@/mixins/JeroListMixin'
|
||||||
|
import JYearDate from '@comp/jero/JYearDate'
|
||||||
|
import PageHeaderTitle from '@comp/layouts/PageHeaderTitle'
|
||||||
|
import { getWorkingGroupById, 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 WorkGroupSetLabel from './modules/WorkGroupSetLabel'
|
||||||
|
import EmailErrorMsgModal from '../projectManagement/modules/EmailErrorMsgModal'
|
||||||
|
|
||||||
|
// eslint-disable-next-line no-undef,no-unused-vars
|
||||||
|
const Base64 = require('js-base64').Base64
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'DraftingGroupMemberUnitMaintenance',
|
||||||
|
components: {
|
||||||
|
JYearDate,
|
||||||
|
PageHeaderTitle,
|
||||||
|
StatusSlot,
|
||||||
|
ProjectDetailModal,
|
||||||
|
WorkingGroupMemberUnitModule,
|
||||||
|
WorkingGroupMemberSetChargeNotice,
|
||||||
|
PreviewFile,
|
||||||
|
EmailErrorMsgModal,
|
||||||
|
WorkGroupSetLabel
|
||||||
|
},
|
||||||
|
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: '关联工作组',
|
||||||
|
fieldName: 'workingGroupProject'
|
||||||
|
}, {
|
||||||
|
title: '负责人A',
|
||||||
|
fieldName: 'principalNameA'
|
||||||
|
}, {
|
||||||
|
title: '负责人B',
|
||||||
|
fieldName: 'principalNameB'
|
||||||
|
}, {
|
||||||
|
title: '每年召开次数',
|
||||||
|
fieldName: 'convokeNum'
|
||||||
|
}, {
|
||||||
|
title: '运行周期',
|
||||||
|
fieldName: 'operationCycle'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
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: 280,
|
||||||
|
dataIndex: 'contactsTemporaryNameOne',
|
||||||
|
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',
|
||||||
|
// dataIndex: 'label',
|
||||||
|
// width: 100,
|
||||||
|
// scopedSlots: { customRender: 'text' }
|
||||||
|
// }, {
|
||||||
|
// // 2021-10-22需求变更新加
|
||||||
|
// title: '收费通知号',
|
||||||
|
// align: 'center',
|
||||||
|
// width: 280,
|
||||||
|
// dataIndex: 'chargeNoticeNo',
|
||||||
|
// scopedSlots: { customRender: 'text' }
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// title: '打包',
|
||||||
|
// align: 'center',
|
||||||
|
// fixed: 'right',
|
||||||
|
// width: 100,
|
||||||
|
// dataIndex: 'pack',
|
||||||
|
// scopedSlots: { customRender: 'status-pack' }
|
||||||
|
// },
|
||||||
|
// }, {
|
||||||
|
// title: '需要发票',
|
||||||
|
// align: 'center',
|
||||||
|
// fixed: 'right',
|
||||||
|
// width: 80,
|
||||||
|
// dataIndex: 'needInvoice',
|
||||||
|
// scopedSlots: { customRender: 'status-pack' }
|
||||||
|
// }, {
|
||||||
|
// title: '到账',
|
||||||
|
// align: 'center',
|
||||||
|
// fixed: 'right',
|
||||||
|
// width: 80,
|
||||||
|
// dataIndex: 'inAccount',
|
||||||
|
// scopedSlots: { customRender: 'status' }
|
||||||
|
// }, {
|
||||||
|
// title: '开票',
|
||||||
|
// align: 'center',
|
||||||
|
// fixed: 'right',
|
||||||
|
// width: 80,
|
||||||
|
// dataIndex: 'makeInvoice',
|
||||||
|
// scopedSlots: { customRender: 'status-bill' }
|
||||||
|
// }, {
|
||||||
|
// title: '邮寄',
|
||||||
|
// align: 'center',
|
||||||
|
// fixed: 'right',
|
||||||
|
// 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(Base64.encode(fileFullUrl)) }`
|
||||||
|
window.open(url)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 设置标签
|
||||||
|
setLabel() {
|
||||||
|
if (this.selectedRowKeys.length <= 0) {
|
||||||
|
this.$message.warning('请选择一条记录!')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.$refs.workGroupSetLabel.show(this.selectedRowKeys)
|
||||||
|
}
|
||||||
|
// 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>
|
||||||
@@ -0,0 +1,235 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<page-header-title level-two-title="分发资料维护" :is-level-one="false"></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 :xxl="4" :xl="10" :lg="12" :md="12" :sm="24">
|
||||||
|
<a-form-item label="文件名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||||
|
<a-input placeholder="请输入文件名称" v-model="queryParam.fileName" :maxLength='50'></a-input>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<span class="table-page-search-submitButtons">
|
||||||
|
<a-button type="primary" icon="search" @click="searchQuery" v-has="'fileMaintenance:search'">查询</a-button>
|
||||||
|
<a-button icon="reload" @click="searchReset" class="reset-button">重置</a-button>
|
||||||
|
</span>
|
||||||
|
</a-row>
|
||||||
|
</a-form>
|
||||||
|
</div>
|
||||||
|
<!-- /查询区域-end-->
|
||||||
|
|
||||||
|
<!-- 操作按钮区域-->
|
||||||
|
<div class="table-operator" v-if="canOperate">
|
||||||
|
<a-button type="primary" icon="plus" @click="handleAdd" v-has="'fileMaintenance:add'">上传</a-button>
|
||||||
|
<a-button type="danger" icon="delete" @click="batchDel" v-has="'fileMaintenance:batchDel'">批量删除</a-button>
|
||||||
|
<a-button type="primary" @click="batchDistribute" v-has="'fileMaintenance:batchDistribute'">批量分发</a-button>
|
||||||
|
<a-button type="primary" icon="export" @click="handleExportXls('资料维护列表')" v-has="'fileMaintenance:export'">导出
|
||||||
|
</a-button>
|
||||||
|
</div>
|
||||||
|
<!-- 操作按钮区域-end-->
|
||||||
|
|
||||||
|
<!-- table表格区域-->
|
||||||
|
<div>
|
||||||
|
<a-table
|
||||||
|
size="middle"
|
||||||
|
ref="table"
|
||||||
|
bordered
|
||||||
|
rowKey="id"
|
||||||
|
:columns="columns"
|
||||||
|
:dataSource="dataSource"
|
||||||
|
:pagination="ipagination"
|
||||||
|
:loading="loading"
|
||||||
|
:scroll="{x: 1200}"
|
||||||
|
@change="handleTableChange"
|
||||||
|
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
|
||||||
|
class="j-table-force-nowrap main-table">
|
||||||
|
|
||||||
|
<!-- 项目名称-->
|
||||||
|
<template slot="projectName" slot-scope="text, record">
|
||||||
|
<j-ellipsis :value="text" :length="18" class="primary-color"
|
||||||
|
@click="openDetailModal(record)"></j-ellipsis>
|
||||||
|
</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" v-if="canOperate">
|
||||||
|
<a @click="handleDistribute(record.id)" v-has="'fileMaintenance:distribute'">分发</a>
|
||||||
|
<a @click="handleDownload(record)" v-has="'fileMaintenance:download'">下载</a>
|
||||||
|
<a @click="handleDelete(record.id)" v-has="'fileMaintenance:delete'">删除</a>
|
||||||
|
</span>
|
||||||
|
</a-table>
|
||||||
|
</div>
|
||||||
|
</a-card>
|
||||||
|
|
||||||
|
<!-- 上传-->
|
||||||
|
<work-group-file-upload-modal
|
||||||
|
ref="modalForm"
|
||||||
|
@ok="modalFormOk"
|
||||||
|
:project-id="projectId"
|
||||||
|
:project-type="projectType"></work-group-file-upload-modal>
|
||||||
|
<!-- 分发-->
|
||||||
|
<work-group-distribute-module
|
||||||
|
ref="distributeModal"
|
||||||
|
:visible.sync="distributeModalVisible"
|
||||||
|
:project-id="projectId"
|
||||||
|
:project-type="projectType"
|
||||||
|
:is-batch="isBatchDistribute"
|
||||||
|
:record-id="dataId"
|
||||||
|
@ok="modalFormOk"></work-group-distribute-module>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { JeroListMixin } from '../../mixins/JeroListMixin'
|
||||||
|
import PageHeaderTitle from '../../components/layouts/PageHeaderTitle'
|
||||||
|
import WorkGroupFileUploadModal from './modules/WorkGroupFileUploadModal'
|
||||||
|
import WorkGroupDistributeModule from './modules/WorkGroupDistributeModule'
|
||||||
|
import { downloadFile } from '../../api/manage'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'WorkingGroupProjectDataMaintenance',
|
||||||
|
components: { PageHeaderTitle, WorkGroupFileUploadModal, WorkGroupDistributeModule },
|
||||||
|
mixins: [JeroListMixin],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
labelCol: {
|
||||||
|
xs: { span: 24 },
|
||||||
|
sm: { span: 5 }
|
||||||
|
},
|
||||||
|
wrapperCol: {
|
||||||
|
xs: { span: 24 },
|
||||||
|
sm: { span: 10 }
|
||||||
|
},
|
||||||
|
url: {
|
||||||
|
list: '/project/payWorkingGroupDataFile/list',
|
||||||
|
exportXlsUrl: '/project/payWorkingGroupDataFile/exportXls',
|
||||||
|
delete: '/project/payWorkingGroupDataFile/delete',
|
||||||
|
deleteBatch: '/project/payWorkingGroupDataFile/deleteBatch'
|
||||||
|
},
|
||||||
|
columns: [
|
||||||
|
{
|
||||||
|
title: '序号',
|
||||||
|
dataIndex: '',
|
||||||
|
key: 'rowIndex',
|
||||||
|
width: 100,
|
||||||
|
align: 'center',
|
||||||
|
customRender: function (t, r, index) {
|
||||||
|
return parseInt(index) + 1
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
title: '文件名称',
|
||||||
|
align: 'center',
|
||||||
|
dataIndex: 'fileName',
|
||||||
|
scopedSlots: { customRender: 'text' }
|
||||||
|
}, {
|
||||||
|
title: '下载次数',
|
||||||
|
align: 'center',
|
||||||
|
width: 160,
|
||||||
|
dataIndex: 'downloadCount',
|
||||||
|
scopedSlots: { customRender: 'text' }
|
||||||
|
}, {
|
||||||
|
title: '上传时间',
|
||||||
|
align: 'center',
|
||||||
|
width: 220,
|
||||||
|
dataIndex: 'createTime',
|
||||||
|
scopedSlots: { customRender: 'text' }
|
||||||
|
}, {
|
||||||
|
title: '上传人',
|
||||||
|
align: 'center',
|
||||||
|
width: 160,
|
||||||
|
dataIndex: 'createBy',
|
||||||
|
scopedSlots: { customRender: 'text' }
|
||||||
|
}, {
|
||||||
|
title: '操作',
|
||||||
|
dataIndex: 'action',
|
||||||
|
align: 'center',
|
||||||
|
fixed: 'right',
|
||||||
|
width: 160,
|
||||||
|
scopedSlots: { customRender: 'action' }
|
||||||
|
}
|
||||||
|
],
|
||||||
|
disableMixinCreated: true,
|
||||||
|
projectId: null, // 项目id
|
||||||
|
projectType: null, // 1--工作组;2--分标委
|
||||||
|
distributeModalVisible: false,
|
||||||
|
isBatchDistribute: false,
|
||||||
|
dataId: '', // 资料id,传给分发
|
||||||
|
canOperate: true // 是否可操作(负责人B不可操作)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
// 工作组
|
||||||
|
if (this.$route.query.hasOwnProperty.call(this.$route.query, 'workingGroupId')) {
|
||||||
|
this.filters.projectId = this.$route.query.workingGroupId
|
||||||
|
this.canOperate = this.$route.query.canOperate === 'true'
|
||||||
|
this.projectType = 1
|
||||||
|
this.filters.projectType = 1
|
||||||
|
} else if (this.$route.query.hasOwnProperty.call(this.$route.query, 'id')) {
|
||||||
|
// 分标委
|
||||||
|
this.filters.projectId = this.$route.query.id
|
||||||
|
this.projectType = 2
|
||||||
|
this.filters.projectType = 2
|
||||||
|
} else if (this.$route.query.hasOwnProperty.call(this.$route.query, 'councilId')) {
|
||||||
|
// 理事会
|
||||||
|
this.filters.projectId = this.$route.query.councilId
|
||||||
|
this.projectType = 3
|
||||||
|
this.filters.projectType = 3
|
||||||
|
}
|
||||||
|
this.projectId = this.filters.projectId
|
||||||
|
this.loadData()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
/**
|
||||||
|
* 批量分发
|
||||||
|
*/
|
||||||
|
batchDistribute() {
|
||||||
|
if (this.selectedRowKeys.length === 0) {
|
||||||
|
this.$message.warn('请至少选中一个资料')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.dataId = this.selectedRowKeys.join(',')
|
||||||
|
this.distributeModalVisible = true
|
||||||
|
this.isBatchDistribute = true
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 分发
|
||||||
|
*/
|
||||||
|
handleDistribute(id) {
|
||||||
|
this.dataId = id
|
||||||
|
this.distributeModalVisible = true
|
||||||
|
this.isBatchDistribute = false
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 下载
|
||||||
|
* @param record
|
||||||
|
*/
|
||||||
|
handleDownload(record) {
|
||||||
|
downloadFile(`sys/common/download/${record.fileId}`, record.fileName)
|
||||||
|
},
|
||||||
|
handleExportXls(fileName) {
|
||||||
|
if (!fileName || typeof fileName != 'string') {
|
||||||
|
fileName = '导出文件'
|
||||||
|
}
|
||||||
|
let param = this.getQueryParams()
|
||||||
|
if (this.selectedRowKeys && this.selectedRowKeys.length > 0) {
|
||||||
|
param['selections'] = this.selectedRowKeys.join(',')
|
||||||
|
}
|
||||||
|
console.log('导出参数', param)
|
||||||
|
downloadFile(this.url.exportXlsUrl, fileName + '.zip', param)
|
||||||
|
},
|
||||||
|
handleAdd() {
|
||||||
|
this.$refs.modalForm.add()
|
||||||
|
this.$refs.modalForm.title = '上传文件'
|
||||||
|
this.$refs.modalForm.disableSubmit = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="less">
|
||||||
|
@import '~@assets/less/common.less';
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,177 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<page-header-title :is-level-one="false" :level-two-title="$route.query.title"></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.projectName" :maxLength='50'></a-input>
|
||||||
|
</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="'workingGroup:underStudy: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="'workingGroup:underStudy:add'">新增</a-button>
|
||||||
|
<a-button type="danger" icon="delete" @click="batchDel" v-has="'workingGroup:underStudy:batchDel'">批量删除</a-button>
|
||||||
|
</div>
|
||||||
|
<!-- 操作按钮区域-end-->
|
||||||
|
|
||||||
|
<!-- table表格区域-->
|
||||||
|
<div>
|
||||||
|
<a-table
|
||||||
|
ref="table"
|
||||||
|
size="middle"
|
||||||
|
bordered
|
||||||
|
rowKey="id"
|
||||||
|
:columns="columns"
|
||||||
|
:scroll="{x: 1000}"
|
||||||
|
:dataSource="dataSource"
|
||||||
|
:pagination="ipagination"
|
||||||
|
:loading="loading"
|
||||||
|
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
|
||||||
|
@change="handleTableChange"
|
||||||
|
class="j-table-force-nowrap">
|
||||||
|
|
||||||
|
<template slot="text" slot-scope="text">
|
||||||
|
<j-ellipsis :value="text" :length="18"></j-ellipsis>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<span slot="action" class="action-span-cell" slot-scope="text, record">
|
||||||
|
<a @click="handleEdit(record)" v-has="'workingGroup:underStudy:edit'">编辑</a>
|
||||||
|
<a @click="handleDelete(record.id)" v-has="'workingGroup:underStudy:delete'">删除</a>
|
||||||
|
</span>
|
||||||
|
</a-table>
|
||||||
|
</div>
|
||||||
|
</a-card>
|
||||||
|
|
||||||
|
<working-group-under-study-project-modal ref="modalForm" @ok="modalFormOk"></working-group-under-study-project-modal>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import PageHeaderTitle from '../../components/layouts/PageHeaderTitle'
|
||||||
|
import { JeroListMixin } from '../../mixins/JeroListMixin'
|
||||||
|
import WorkingGroupUnderStudyProjectModal from './modules/WorkingGroupUnderStudyProjectModal'
|
||||||
|
import { getAction } from '../../api/manage'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'WorkingGroupUnderStudyProject',
|
||||||
|
components: { PageHeaderTitle, WorkingGroupUnderStudyProjectModal },
|
||||||
|
mixins: [JeroListMixin],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
labelCol: {
|
||||||
|
xs: { span: 24 },
|
||||||
|
sm: { span: 5 }
|
||||||
|
},
|
||||||
|
wrapperCol: {
|
||||||
|
xs: { span: 24 },
|
||||||
|
sm: { span: 10 }
|
||||||
|
},
|
||||||
|
columns: [
|
||||||
|
{
|
||||||
|
title: '序号',
|
||||||
|
dataIndex: '',
|
||||||
|
key: 'rowIndex',
|
||||||
|
width: 60,
|
||||||
|
align: 'center',
|
||||||
|
customRender: function (t, r, index) {
|
||||||
|
return parseInt(index) + 1
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
title: '项目名称',
|
||||||
|
align: 'center',
|
||||||
|
dataIndex: 'projectName',
|
||||||
|
scopedSlots: { customRender: 'text' }
|
||||||
|
}, {
|
||||||
|
title: '主要起草单位',
|
||||||
|
align: 'center',
|
||||||
|
dataIndex: 'draftCompany',
|
||||||
|
scopedSlots: { customRender: 'text' }
|
||||||
|
}, {
|
||||||
|
title: '项目进度',
|
||||||
|
align: 'center',
|
||||||
|
dataIndex: 'projectSchedule',
|
||||||
|
scopedSlots: { customRender: 'text' }
|
||||||
|
}, {
|
||||||
|
title: '操作',
|
||||||
|
align: 'center',
|
||||||
|
width: 180,
|
||||||
|
fixed: 'right',
|
||||||
|
dataIndex: 'bankAccountName',
|
||||||
|
scopedSlots: { customRender: 'action' }
|
||||||
|
}
|
||||||
|
],
|
||||||
|
url: {
|
||||||
|
list: '/payResearchProject/payResearchProject/list',
|
||||||
|
delete: '/payResearchProject/payResearchProject/delete',
|
||||||
|
deleteBatch: '/payResearchProject/payResearchProject/deleteBatch'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
loadData(arg) {
|
||||||
|
if (!this.url.list) {
|
||||||
|
this.$message.error('请设置url.list属性!')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
//加载数据 若传入参数1则加载第一页的内容
|
||||||
|
if (arg === 1) {
|
||||||
|
this.ipagination.current = 1
|
||||||
|
}
|
||||||
|
let params = this.getQueryParams()//查询条件
|
||||||
|
params.workingGroupId = this.$route.query.id
|
||||||
|
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)
|
||||||
|
}
|
||||||
|
this.loading = false
|
||||||
|
}).finally(() => {
|
||||||
|
this.loading = false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleEdit: function (record) {
|
||||||
|
this.$refs.modalForm.workingGroupId = this.$route.query.id
|
||||||
|
this.$refs.modalForm.edit(record)
|
||||||
|
this.$refs.modalForm.title = '编辑'
|
||||||
|
this.$refs.modalForm.disableSubmit = false
|
||||||
|
},
|
||||||
|
handleAdd: function () {
|
||||||
|
this.$refs.modalForm.workingGroupId = this.$route.query.id
|
||||||
|
this.$refs.modalForm.add()
|
||||||
|
this.$refs.modalForm.title = '新增'
|
||||||
|
this.$refs.modalForm.disableSubmit = false
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="less">
|
||||||
|
@import '~@assets/less/common.less';
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,292 @@
|
|||||||
|
<template>
|
||||||
|
<j-modal
|
||||||
|
:title="title"
|
||||||
|
:width="width"
|
||||||
|
:visible="visible"
|
||||||
|
:confirmLoading="confirmLoading"
|
||||||
|
switchFullscreen
|
||||||
|
@ok="handleOk"
|
||||||
|
@cancel="handleCancel"
|
||||||
|
cancelText="关闭">
|
||||||
|
<a-spin :spinning="confirmLoading">
|
||||||
|
<span class="prompt-message">
|
||||||
|
说明:1.负责人A为该起草组的主负责人,负责人B为该起草组的辅助负责人。<br>
|
||||||
|
</span>
|
||||||
|
<a-form :form="form">
|
||||||
|
<a-row>
|
||||||
|
<a-col :span="24">
|
||||||
|
<a-form-item label="起草组项目" :labelCol="remarksLabelCol" :wrapperCol="remarksWrapperCol">
|
||||||
|
<a-input placeholder="请输入起草组项目"
|
||||||
|
v-decorator="['workingGroupProject',validatorRules.workingGroupProject]"
|
||||||
|
:maxLength='50'
|
||||||
|
@change="e => {e.target.value = (e.target.value + '').trim()}"></a-input>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
<a-row>
|
||||||
|
<a-col :span="24">
|
||||||
|
<a-form-item label="关联工作组" :labelCol="remarksLabelCol" :wrapperCol="remarksWrapperCol">
|
||||||
|
<a-input placeholder="请选择关联工作组"
|
||||||
|
v-decorator="['workingGroupProject',validatorRules.workingGroupProject]"
|
||||||
|
:maxLength='50'
|
||||||
|
@change="e => {e.target.value = (e.target.value + '').trim()}"></a-input>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
<a-row>
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item label="运行年份" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||||
|
<j-year-date style="width:100%" placeholder="请选择运行年份"
|
||||||
|
v-decorator="['year',validatorRules.year]"></j-year-date>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
<a-row>
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item label="负责人A" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||||
|
<select-principal placeholder="请选择负责人A"
|
||||||
|
v-decorator="['principalIdA',validatorRules.principalIdA]"
|
||||||
|
:maxLength='50'></select-principal>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item label="负责人B" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||||
|
<select-principal placeholder="请选择负责人B"
|
||||||
|
v-decorator="['principalIdB',validatorRules.principalIdB]"
|
||||||
|
:maxLength='50'></select-principal>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
<a-row>
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item label="每年召开次数" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||||
|
<a-input placeholder="请输入每年召开次数"
|
||||||
|
v-decorator="['convokeNum']"
|
||||||
|
:maxLength='50'
|
||||||
|
@change="e => {e.target.value = (e.target.value + '').trim()}"></a-input>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item label="运行周期" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||||
|
<a-input placeholder="请输入运行周期"
|
||||||
|
v-decorator="['operationCycle']"
|
||||||
|
:maxLength='50'
|
||||||
|
@change="e => {e.target.value = (e.target.value + '').trim()}"></a-input>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
<a-row>
|
||||||
|
<a-col>
|
||||||
|
<a-form-item label="任务及目标" :labelCol="remarksLabelCol" :wrapperCol="remarksWrapperCol">
|
||||||
|
<a-textarea
|
||||||
|
placeholder="请输入任务及目标"
|
||||||
|
:auto-size="{ minRows: 3, maxRows: 6 }"
|
||||||
|
v-decorator="['missionAndObjectives']"
|
||||||
|
:maxLength='200'
|
||||||
|
@change="e => {e.target.value = (e.target.value + '').trim()}"/>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
<a-row>
|
||||||
|
<a-col>
|
||||||
|
<a-form-item label="备注" :labelCol="remarksLabelCol" :wrapperCol="remarksWrapperCol">
|
||||||
|
<a-textarea
|
||||||
|
placeholder="请输入备注"
|
||||||
|
:auto-size="{ minRows: 3, maxRows: 6 }"
|
||||||
|
v-decorator="['remarks']"
|
||||||
|
:maxLength='200'
|
||||||
|
@change="e => {e.target.value = (e.target.value + '').trim()}"/>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
</a-form>
|
||||||
|
</a-spin>
|
||||||
|
</j-modal>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import pick from 'lodash.pick'
|
||||||
|
import { httpAction } from '@api/manage'
|
||||||
|
import JUpload from '@comp/jero/JUpload'
|
||||||
|
import JYearDate from '@comp/jero/JYearDate'
|
||||||
|
import SelectPrincipal from '@comp/company/SelectPrincipal'
|
||||||
|
import { isRepeat } from '../../../utils/util'
|
||||||
|
import { money } from '../../../utils/validate'
|
||||||
|
import { addZero } from '../../../utils/util'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'DraftingGroupModule',
|
||||||
|
components: { JUpload, JYearDate, SelectPrincipal },
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
title: '操作',
|
||||||
|
width: 800,
|
||||||
|
visible: false,
|
||||||
|
confirmLoading: false,
|
||||||
|
form: this.$form.createForm(this),
|
||||||
|
model: {},
|
||||||
|
labelCol: {
|
||||||
|
xs: { span: 24 },
|
||||||
|
sm: { span: 6 }
|
||||||
|
},
|
||||||
|
wrapperCol: {
|
||||||
|
xs: { span: 24 },
|
||||||
|
sm: { span: 18 }
|
||||||
|
},
|
||||||
|
remarksLabelCol: {
|
||||||
|
xs: { span: 24 },
|
||||||
|
sm: { span: 3 }
|
||||||
|
},
|
||||||
|
remarksWrapperCol: {
|
||||||
|
xs: { span: 24 },
|
||||||
|
sm: { span: 21 }
|
||||||
|
},
|
||||||
|
validatorRules: {
|
||||||
|
workingGroupProject: {
|
||||||
|
rules: [{ required: true, message: '请输入项目名称' }],
|
||||||
|
validateTrigger: 'blur'
|
||||||
|
},
|
||||||
|
year: {
|
||||||
|
rules: [{ required: true, message: '请选择运行年份' }],
|
||||||
|
validateTrigger: 'change'
|
||||||
|
},
|
||||||
|
principalIdA: {
|
||||||
|
rules: [{ required: true, validator: this.validatePrincipal }],
|
||||||
|
validateTrigger: 'change'
|
||||||
|
},
|
||||||
|
principalIdB: {
|
||||||
|
rules: [{ required: false, validator: this.validatePrincipal }],
|
||||||
|
validateTrigger: 'change'
|
||||||
|
},
|
||||||
|
checkMoney: {
|
||||||
|
rules: [{ required: false, validator: this.checkMoney }],
|
||||||
|
validateTrigger: 'blur'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
url: {
|
||||||
|
add: '/project/payWorkingGroup/add',
|
||||||
|
edit: '/project/payWorkingGroup/edit'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
addZero,
|
||||||
|
add() {
|
||||||
|
this.edit({})
|
||||||
|
},
|
||||||
|
edit(record) {
|
||||||
|
this.form.resetFields()
|
||||||
|
// 防止下拉选项出现问题
|
||||||
|
record.principalIdA = record.principalIdA || undefined
|
||||||
|
record.principalIdB = record.principalIdB || undefined
|
||||||
|
this.model = Object.assign({}, record)
|
||||||
|
this.visible = true
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.form.setFieldsValue(pick(this.model, 'workingGroupProject', 'year', 'principalIdA', 'principalIdB', 'convokeNum', 'operationCycle', 'yearChargeA', 'chargeNoticeNoA', 'chargeNoticeAId', 'yearChargeB', 'chargeNoticeNoB', 'chargeNoticeBId', 'missionAndObjectives', 'remarks'))
|
||||||
|
if (!this.model.id) {
|
||||||
|
this.form.setFieldsValue({'year': (new Date().getFullYear()).toString()})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
close() {
|
||||||
|
this.$emit('close')
|
||||||
|
this.visible = false
|
||||||
|
},
|
||||||
|
handleOk() {
|
||||||
|
if (this.confirmLoading) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.confirmLoading = true
|
||||||
|
const that = this
|
||||||
|
// 触发表单验证
|
||||||
|
this.form.validateFields((err, values) => {
|
||||||
|
if (!err) {
|
||||||
|
that.confirmLoading = true
|
||||||
|
let httpurl = ''
|
||||||
|
let method = 'post'
|
||||||
|
if (!this.model.id) {
|
||||||
|
httpurl += this.url.add
|
||||||
|
} else {
|
||||||
|
httpurl += this.url.edit
|
||||||
|
}
|
||||||
|
values.yearChargeA = values.yearChargeA ? Number(values.yearChargeA) : null
|
||||||
|
values.yearChargeB = values.yearChargeB ? Number(values.yearChargeB) : null
|
||||||
|
values.chargeA = values.chargeNoticeNoA ? 'a' : null
|
||||||
|
values.chargeB = values.chargeNoticeNoB ? 'b' : null
|
||||||
|
const formData = Object.assign(this.model, values)
|
||||||
|
console.log('表单提交数据', formData)
|
||||||
|
httpAction(httpurl, formData, method).then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
that.$message.success(res.message)
|
||||||
|
that.$emit('ok')
|
||||||
|
that.close()
|
||||||
|
} else {
|
||||||
|
that.$message.warning(res.message)
|
||||||
|
}
|
||||||
|
}).finally(() => {
|
||||||
|
setTimeout(() => {
|
||||||
|
this.confirmLoading = false
|
||||||
|
}, 1000)
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
this.confirmLoading = false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleCancel() {
|
||||||
|
this.close()
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 校验负责人是否重复
|
||||||
|
* @param rule
|
||||||
|
* @param value
|
||||||
|
* @param callback
|
||||||
|
*/
|
||||||
|
validatePrincipal(rule, value, callback) {
|
||||||
|
if (rule.field === 'principalIdA') {
|
||||||
|
if (!value) {
|
||||||
|
callback('请选择负责人A')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (value) {
|
||||||
|
const principalObj = this.form.getFieldsValue(['principalIdA', 'principalIdB'])
|
||||||
|
const principalArr = Object.values(principalObj)
|
||||||
|
principalArr.filter(tt => tt !== undefined)
|
||||||
|
if (isRepeat(principalArr)) {
|
||||||
|
callback('请选择不同的负责人')
|
||||||
|
} else {
|
||||||
|
callback()
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
callback()
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 校验金额格式
|
||||||
|
* @param rules
|
||||||
|
* @param value
|
||||||
|
* @param callback
|
||||||
|
*/
|
||||||
|
checkMoney(rules, value, callback) {
|
||||||
|
if (value) {
|
||||||
|
if (money(value)) {
|
||||||
|
callback()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
callback('请输入合法的金额数字,最多2位小数,10位整数')
|
||||||
|
}
|
||||||
|
callback()
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="less">
|
||||||
|
.prompt-message {
|
||||||
|
color: red;
|
||||||
|
|
||||||
|
&-line2 {
|
||||||
|
padding-left: 2.7rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,508 @@
|
|||||||
|
<template>
|
||||||
|
<j-modal
|
||||||
|
:title="title"
|
||||||
|
:width="width"
|
||||||
|
:visible="visible"
|
||||||
|
:confirmLoading="confirmLoading"
|
||||||
|
switchFullscreen
|
||||||
|
@ok="handleOk"
|
||||||
|
@cancel="handleCancel"
|
||||||
|
cancelText="关闭">
|
||||||
|
<a-spin :spinning="confirmLoading">
|
||||||
|
|
||||||
|
<template v-if="dataSourceInit.length > 0">
|
||||||
|
<!--查询条件 单个文件分发的时候才存在-->
|
||||||
|
<div class="table-page-search-wrapper" v-if="!isBatch">
|
||||||
|
<a-form layout="inline" @keyup.enter.native="searchQuery">
|
||||||
|
<a-row>
|
||||||
|
<a-col :xl="8" :lg="8" :md="8" :sm="24">
|
||||||
|
<a-form-item label="已提醒" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||||
|
<j-dict-select-tag style="width: 100%"
|
||||||
|
dict-code="yn"
|
||||||
|
v-model="queryParam.remind"
|
||||||
|
placeholder="请选择提醒类型"></j-dict-select-tag>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
|
||||||
|
<a-col :xl="4" :lg="8" :md="8" :sm="24" >
|
||||||
|
<span class="table-page-search-submitButtons">
|
||||||
|
<a-button type="primary" icon="search" @click="searchQuery">查询</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" @click="checkAll()">全选</a-button>
|
||||||
|
</div>
|
||||||
|
<a-table
|
||||||
|
size="middle"
|
||||||
|
ref="table"
|
||||||
|
bordered
|
||||||
|
rowKey="id"
|
||||||
|
:columns="columns"
|
||||||
|
:dataSource="dataSource"
|
||||||
|
:pagination="ipagination"
|
||||||
|
:loading="false"
|
||||||
|
:scroll="{x: 500}"
|
||||||
|
@change="handleTableChange"
|
||||||
|
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
|
||||||
|
class="j-table-force-nowrap main-table">
|
||||||
|
|
||||||
|
<template slot="text" slot-scope="text">
|
||||||
|
<a-tooltip>
|
||||||
|
<template slot="title">{{ text }}</template>
|
||||||
|
<div class="table-text">{{ text }}</div>
|
||||||
|
</a-tooltip>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
</a-table>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<a-empty v-else></a-empty>
|
||||||
|
</a-spin>
|
||||||
|
|
||||||
|
<email-error-msg-modal ref="emailError"/>
|
||||||
|
</j-modal>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { distribute, batchDistribute, distributeMemberList, judgeEmailStatus } from '../../../api/incomePaymentsApi'
|
||||||
|
import EmailErrorMsgModal from '@views/projectManagement/modules/EmailErrorMsgModal.vue'
|
||||||
|
|
||||||
|
// 工作组发布提醒 表头
|
||||||
|
const columns = [
|
||||||
|
{
|
||||||
|
title: '序号',
|
||||||
|
dataIndex: '',
|
||||||
|
key: 'rowIndex',
|
||||||
|
width: 60,
|
||||||
|
align: 'center',
|
||||||
|
customRender: function (t, r, index) {
|
||||||
|
return parseInt(index) + 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '联系人',
|
||||||
|
align: 'center',
|
||||||
|
width: 200,
|
||||||
|
dataIndex: 'name',
|
||||||
|
scopedSlots: {customRender: 'text'}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '成员单位',
|
||||||
|
align: 'center',
|
||||||
|
dataIndex: 'companyName',
|
||||||
|
width: 280,
|
||||||
|
scopedSlots: { customRender: 'text' }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '邮件通知',
|
||||||
|
align: 'center',
|
||||||
|
width: 200,
|
||||||
|
dataIndex: 'remind_dictText',
|
||||||
|
scopedSlots: {customRender: 'text'}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
// 分标委发布提醒 表头
|
||||||
|
const commitColumns = [
|
||||||
|
{
|
||||||
|
title: '序号',
|
||||||
|
dataIndex: '',
|
||||||
|
key: 'rowIndex',
|
||||||
|
width: 60,
|
||||||
|
align: 'center',
|
||||||
|
customRender: function (t, r, index) {
|
||||||
|
return parseInt(index) + 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '联系人',
|
||||||
|
align: 'center',
|
||||||
|
width: 200,
|
||||||
|
dataIndex: 'name',
|
||||||
|
scopedSlots: {customRender: 'text'}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '成员单位',
|
||||||
|
align: 'center',
|
||||||
|
dataIndex: 'companyName',
|
||||||
|
width: 280,
|
||||||
|
scopedSlots: { customRender: 'text' }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '邮件通知',
|
||||||
|
align: 'center',
|
||||||
|
width: 200,
|
||||||
|
dataIndex: 'remind_dictText',
|
||||||
|
scopedSlots: {customRender: 'text'}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
// 理事会成员的表头
|
||||||
|
const councilColumns = [
|
||||||
|
{
|
||||||
|
title: '序号',
|
||||||
|
dataIndex: '',
|
||||||
|
key: 'rowIndex',
|
||||||
|
width: 60,
|
||||||
|
align: 'center',
|
||||||
|
customRender: function (t, r, index) {
|
||||||
|
return parseInt(index) + 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '联系人',
|
||||||
|
align: 'center',
|
||||||
|
width: 200,
|
||||||
|
dataIndex: 'name',
|
||||||
|
scopedSlots: {customRender: 'text'}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '成员单位',
|
||||||
|
align: 'center',
|
||||||
|
dataIndex: 'companyName',
|
||||||
|
width: 280,
|
||||||
|
scopedSlots: { customRender: 'text' }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '邮件通知',
|
||||||
|
align: 'center',
|
||||||
|
width: 200,
|
||||||
|
dataIndex: 'remind_dictText',
|
||||||
|
scopedSlots: {customRender: 'text'}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'WorkGroupDistributeModule',
|
||||||
|
components: { EmailErrorMsgModal },
|
||||||
|
props: {
|
||||||
|
// 项目id
|
||||||
|
projectId: {
|
||||||
|
type: String,
|
||||||
|
required: false,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
// 项目类型:1--工作组;2--分标委;3--理事会
|
||||||
|
projectType: {
|
||||||
|
type: Number,
|
||||||
|
required: false,
|
||||||
|
default: null
|
||||||
|
},
|
||||||
|
// 分发资料id
|
||||||
|
recordId: {
|
||||||
|
type: String,
|
||||||
|
required: false,
|
||||||
|
default: null
|
||||||
|
},
|
||||||
|
// 是否批量分发
|
||||||
|
isBatch: {
|
||||||
|
type: Boolean,
|
||||||
|
required: false,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
visible: {
|
||||||
|
type: Boolean,
|
||||||
|
required: false,
|
||||||
|
default: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
visible(val) {
|
||||||
|
if (val) {
|
||||||
|
this.initData()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
title: '分发',
|
||||||
|
width: 1000,
|
||||||
|
confirmLoading: false,
|
||||||
|
columns: [],
|
||||||
|
dataSource: [], // 表格中显示的数据
|
||||||
|
dataSourceInit: [], // 所有分发单位的数据
|
||||||
|
dataSourceInitShow: [], // 拥有过滤条件后显示的所有数据
|
||||||
|
/* 分页参数 */
|
||||||
|
ipagination: {
|
||||||
|
current: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
pageSizeOptions: ['10', '20', '30', '50', '100'],
|
||||||
|
showTotal: (total, range) => {
|
||||||
|
return range[0] + '-' + range[1] + ' 共' + total + '条'
|
||||||
|
},
|
||||||
|
showQuickJumper: true,
|
||||||
|
showSizeChanger: true,
|
||||||
|
total: 0
|
||||||
|
},
|
||||||
|
/* table选中keys*/
|
||||||
|
selectedRowKeys: [],
|
||||||
|
// 查询条件
|
||||||
|
queryParam: {},
|
||||||
|
lastQueryParam: {},
|
||||||
|
labelCol: {
|
||||||
|
xs: {span: 24},
|
||||||
|
sm: {span: 6}
|
||||||
|
},
|
||||||
|
wrapperCol: {
|
||||||
|
xs: {span: 24},
|
||||||
|
sm: {span: 18}
|
||||||
|
},
|
||||||
|
needMail: false // 消息模板中是否设置了可以发邮件 重要
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
/**
|
||||||
|
* 获取成员列表
|
||||||
|
*/
|
||||||
|
getMemberList() {
|
||||||
|
this.confirmLoading = true
|
||||||
|
let param = {
|
||||||
|
projectId: this.projectId,
|
||||||
|
projectType: this.projectType
|
||||||
|
}
|
||||||
|
// 非批量上传的时候传当前选中的文件id
|
||||||
|
if(!this.isBatch) {
|
||||||
|
param.fileId = this.recordId
|
||||||
|
}
|
||||||
|
distributeMemberList(param).then(res => {
|
||||||
|
if (res.success) {
|
||||||
|
this.dataSourceInit = res.result || []
|
||||||
|
this.dataSourceInitShow = res.result || []
|
||||||
|
this.loadData(1)
|
||||||
|
} else {
|
||||||
|
this.$message.warn(res.message)
|
||||||
|
}
|
||||||
|
}).finally(() => {
|
||||||
|
this.confirmLoading = false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onCheck(checkedKeys) {
|
||||||
|
this.checkedKeys = checkedKeys
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 初始化数据
|
||||||
|
*/
|
||||||
|
initData() {
|
||||||
|
console.log("-----------------")
|
||||||
|
this.checkedKeys = []
|
||||||
|
this.selectedRowKeys = []
|
||||||
|
this.ipagination.current = 1
|
||||||
|
this.ipagination.pageSize = 10
|
||||||
|
// 通过不同的项目类型 展示不同的columns 目前里面的信息是一致的
|
||||||
|
// 项目类型:1--工作组;2--分标委;3--理事会
|
||||||
|
if(this.projectType === 1) {
|
||||||
|
this.columns = [...columns]
|
||||||
|
} else if(this.projectType === 2) {
|
||||||
|
this.columns = [...commitColumns]
|
||||||
|
} else {
|
||||||
|
this.columns = [...councilColumns]
|
||||||
|
}
|
||||||
|
// 选择多个资料的时候不需要提醒字段 这样写是因为无法精准定位每一个人对应的每一个资料 这个人是否被提醒
|
||||||
|
if (this.isBatch) {
|
||||||
|
// 去掉列表的提醒字段
|
||||||
|
this.columns = this.columns.filter(item => item.dataIndex !== 'remind_dictText')
|
||||||
|
}
|
||||||
|
this.getMemberList()
|
||||||
|
this.judgeEmailStatusFunc()
|
||||||
|
|
||||||
|
},
|
||||||
|
handleTableChange(pagination) {
|
||||||
|
//分页、排序、筛选变化时触发
|
||||||
|
this.ipagination = pagination
|
||||||
|
this.loadData()
|
||||||
|
},
|
||||||
|
onSelectChange(selectedRowKeys) {
|
||||||
|
this.selectedRowKeys = selectedRowKeys
|
||||||
|
},
|
||||||
|
getQueryParams() {
|
||||||
|
//获取查询条件
|
||||||
|
let sqp = {}
|
||||||
|
var param = Object.assign(sqp, this.lastQueryParam)
|
||||||
|
param.pageNo = this.ipagination.current
|
||||||
|
param.pageSize = this.ipagination.pageSize
|
||||||
|
return param
|
||||||
|
},
|
||||||
|
loadData(arg) {
|
||||||
|
//加载数据 若传入参数1则加载第一页的内容
|
||||||
|
if (arg === 1) {
|
||||||
|
this.ipagination.current = 1
|
||||||
|
if(this.lastQueryParam.remind === undefined) {
|
||||||
|
this.dataSourceInitShow = this.dataSourceInit
|
||||||
|
} else {
|
||||||
|
this.dataSourceInitShow = this.dataSourceInit.filter(tt => tt.remind + '' === this.lastQueryParam.remind + '')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var params = this.getQueryParams()//查询条件
|
||||||
|
this.ipagination.total = this.dataSourceInitShow.length
|
||||||
|
this.dataSource = this.dataSourceInitShow.slice((params.pageNo - 1) * params.pageSize, (params.pageNo * params.pageSize))
|
||||||
|
},
|
||||||
|
searchQuery() {
|
||||||
|
this.lastQueryParam = {...this.queryParam}
|
||||||
|
this.loadData(1)
|
||||||
|
},
|
||||||
|
searchReset() {
|
||||||
|
this.lastQueryParam = {}
|
||||||
|
this.queryParam = {}
|
||||||
|
this.loadData(1)
|
||||||
|
},
|
||||||
|
checkAll() {
|
||||||
|
this.selectedRowKeys = this.dataSourceInitShow.map(tt => tt.id)
|
||||||
|
},
|
||||||
|
close() {
|
||||||
|
this.$emit('update:visible', false)
|
||||||
|
this.$emit('close')
|
||||||
|
},
|
||||||
|
handleOk() {
|
||||||
|
if (this.confirmLoading) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.confirmLoading = true
|
||||||
|
if (this.dataSourceInit.length === 0) {
|
||||||
|
this.$message.warn('当前工作组暂无成员,无法分发文件')
|
||||||
|
this.confirmLoading = false
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (this.selectedRowKeys.length === 0) {
|
||||||
|
this.$message.warn('请选择成员单位')
|
||||||
|
this.confirmLoading = false
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// 定义请求成功的方法 sendEmailFlag: 0-不发送 1-发送
|
||||||
|
const callbackFunc = (sendEmailFlag) => {
|
||||||
|
if (this.isBatch) {
|
||||||
|
let str = this.selectedRowKeys.join(',')
|
||||||
|
// 批量分发
|
||||||
|
const formData = {
|
||||||
|
contactsIds: str,
|
||||||
|
dataIds: this.recordId,
|
||||||
|
projectId: this.projectId,
|
||||||
|
projectType: this.projectType,
|
||||||
|
sendEmailFlag
|
||||||
|
}
|
||||||
|
batchDistribute(formData).then(res => {
|
||||||
|
if (res.success) {
|
||||||
|
// 发送邮件的时候才提醒 是否有邮件发送失败 有就给出提示信息
|
||||||
|
if (sendEmailFlag && Array.isArray(res.result) && res.result.length > 0) {
|
||||||
|
// msgWarn(this,res.result,0)
|
||||||
|
this.$refs.emailError.open()
|
||||||
|
this.$refs.emailError.msgList = res.result
|
||||||
|
console.log(this.$refs.emailError.msgList, 'this.$refs.emailError.msgList ')
|
||||||
|
} else {
|
||||||
|
this.$message.success(res.message)
|
||||||
|
}
|
||||||
|
this.close()
|
||||||
|
this.$emit('ok')
|
||||||
|
} else {
|
||||||
|
this.$message.warn(res.message)
|
||||||
|
}
|
||||||
|
}).finally(() => {
|
||||||
|
setTimeout(() => {
|
||||||
|
this.confirmLoading = false
|
||||||
|
}, 1000)
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
// 单个分发
|
||||||
|
const formData = {
|
||||||
|
contactsIds: this.selectedRowKeys.join(','),
|
||||||
|
dataId: this.recordId,
|
||||||
|
projectId: this.projectId,
|
||||||
|
projectType: this.projectType,
|
||||||
|
sendEmailFlag
|
||||||
|
}
|
||||||
|
distribute(formData).then(res => {
|
||||||
|
if (res.success) {
|
||||||
|
if (sendEmailFlag && Array.isArray(res.result) && res.result.length > 0) {
|
||||||
|
// msgWarn(this,res.result,0)
|
||||||
|
this.$refs.emailError.open()
|
||||||
|
this.$refs.emailError.msgList = res.result
|
||||||
|
console.log(this.$refs.emailError.msgList, 'this.$refs.emailError.msgList ')
|
||||||
|
} else {
|
||||||
|
this.$message.success(res.message)
|
||||||
|
}
|
||||||
|
this.close()
|
||||||
|
this.$emit('ok')
|
||||||
|
} else {
|
||||||
|
this.$message.warn(res.message)
|
||||||
|
}
|
||||||
|
}).finally(() => {
|
||||||
|
setTimeout(() => {
|
||||||
|
this.confirmLoading = false
|
||||||
|
}, 1000)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(this.needMail) {
|
||||||
|
this.$confirm({
|
||||||
|
title: '消息确认',
|
||||||
|
content: '确认要向选择的成员发送邮件吗?',
|
||||||
|
cancelText: '不发送',
|
||||||
|
okText: '确认发送',
|
||||||
|
onOk: function () {
|
||||||
|
callbackFunc(1)
|
||||||
|
},
|
||||||
|
onCancel: function() {
|
||||||
|
callbackFunc(0)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
// 若全局没有配置则不发送邮件信息
|
||||||
|
callbackFunc(0)
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
handleCancel() {
|
||||||
|
this.close()
|
||||||
|
},
|
||||||
|
// 判断全局设置的是否需要发邮件
|
||||||
|
judgeEmailStatusFunc() {
|
||||||
|
this.needMail = false
|
||||||
|
// 非工作组项目的情况 不进行请求
|
||||||
|
// if(this.projectType !== 1) return
|
||||||
|
const params = {
|
||||||
|
code: 'QY_12_WJTZ_WORK_GROUP_SEND'
|
||||||
|
}
|
||||||
|
judgeEmailStatus(params).then(res => {
|
||||||
|
if(res.success) {
|
||||||
|
// 发送邮件的类型 1-短信 2-邮件 3-系统 数据字典codem sgType
|
||||||
|
this.needMail = (res.result || {}).templateType.indexOf(2) > -1
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="less">
|
||||||
|
@import '~@assets/less/common.less';
|
||||||
|
.no-upload {
|
||||||
|
/deep/ .ant-upload-select-text {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/deep/ .ant-form-explain {
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/deep/ .ant-checkbox-group {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.choose-member {
|
||||||
|
/deep/ #memberName {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/deep/ .ant-tree li .ant-tree-node-content-wrapper {
|
||||||
|
max-width: 100%;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
|
/deep/ .ant-table-body {
|
||||||
|
overflow-x: auto !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,138 @@
|
|||||||
|
<template>
|
||||||
|
<j-modal
|
||||||
|
:title="title"
|
||||||
|
:width="width"
|
||||||
|
:visible="visible"
|
||||||
|
:confirmLoading="confirmLoading"
|
||||||
|
switchFullscreen
|
||||||
|
@ok="handleOk"
|
||||||
|
@cancel="handleCancel"
|
||||||
|
cancelText="关闭">
|
||||||
|
<a-spin :spinning="confirmLoading">
|
||||||
|
<a-form :form="form">
|
||||||
|
<a-row>
|
||||||
|
<a-col>
|
||||||
|
<a-form-item label="文件" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||||
|
<j-upload file-type="all"
|
||||||
|
file-type-error-message="请上传文件"
|
||||||
|
:multiple="true"
|
||||||
|
:number="10"
|
||||||
|
:return-id="true"
|
||||||
|
v-decorator="['fileIds', validatorRules.fileIds]"
|
||||||
|
:trigger-change="true"></j-upload>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
</a-form>
|
||||||
|
</a-spin>
|
||||||
|
</j-modal>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import pick from 'lodash.pick'
|
||||||
|
import { postAction } from '../../../api/manage'
|
||||||
|
import JUpload from '@comp/jero/JUpload'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'WorkGroupFileUploadModal',
|
||||||
|
components: { JUpload },
|
||||||
|
props: {
|
||||||
|
// 项目id
|
||||||
|
projectId: {
|
||||||
|
type: String,
|
||||||
|
required: false,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
// 项目类型:1--工作组;2--分标委
|
||||||
|
projectType: {
|
||||||
|
type: Number,
|
||||||
|
require: false,
|
||||||
|
default: null
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
title: '编辑',
|
||||||
|
width: 800,
|
||||||
|
visible: false,
|
||||||
|
confirmLoading: false,
|
||||||
|
form: this.$form.createForm(this),
|
||||||
|
model: {},
|
||||||
|
fileList: [],
|
||||||
|
labelCol: {
|
||||||
|
xs: { span: 24 },
|
||||||
|
sm: { span: 5 }
|
||||||
|
},
|
||||||
|
wrapperCol: {
|
||||||
|
xs: { span: 24 },
|
||||||
|
sm: { span: 17 }
|
||||||
|
},
|
||||||
|
validatorRules: {
|
||||||
|
fileIds: {
|
||||||
|
rules: [{ required: true, message: '请上传文件' }],
|
||||||
|
validateTrigger: 'change'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
url: {
|
||||||
|
add: '/project/payWorkingGroupDataFile/add', // 资料上传
|
||||||
|
edit: '' // 资料和会议的编辑 post
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
add(data) {
|
||||||
|
this.edit({}, data)
|
||||||
|
},
|
||||||
|
edit(record, data) {
|
||||||
|
this.dataType = data // 接收数据类型
|
||||||
|
this.form.resetFields()
|
||||||
|
this.model = Object.assign({}, record)
|
||||||
|
this.visible = true
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.form.setFieldsValue(pick(this.model, 'dataId'))
|
||||||
|
})
|
||||||
|
},
|
||||||
|
close() {
|
||||||
|
this.$emit('close')
|
||||||
|
this.visible = false
|
||||||
|
},
|
||||||
|
handleOk() {
|
||||||
|
if (this.confirmLoading) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.confirmLoading = true
|
||||||
|
// 触发表单验证
|
||||||
|
this.form.validateFields((err, values) => {
|
||||||
|
if (!err) {
|
||||||
|
console.log(values)
|
||||||
|
let params = values
|
||||||
|
params.projectId = this.projectId
|
||||||
|
params.projectType = this.projectType
|
||||||
|
postAction(this.url.add, params).then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
this.$message.success(res.message)
|
||||||
|
this.$emit('ok')
|
||||||
|
this.close()
|
||||||
|
} else {
|
||||||
|
this.$message.warning(res.message)
|
||||||
|
}
|
||||||
|
}).finally(() => {
|
||||||
|
setTimeout(() => {
|
||||||
|
this.confirmLoading = false
|
||||||
|
}, 1000)
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
this.confirmLoading = false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleCancel() {
|
||||||
|
this.close()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,113 @@
|
|||||||
|
<!--工作组 设置标签-->
|
||||||
|
<template>
|
||||||
|
<j-modal
|
||||||
|
:title="title"
|
||||||
|
:width="width"
|
||||||
|
:visible="visible"
|
||||||
|
:confirmLoading="confirmLoading"
|
||||||
|
switchFullscreen
|
||||||
|
@ok="handleOk"
|
||||||
|
@cancel="handleCancel"
|
||||||
|
cancelText="关闭">
|
||||||
|
<a-spin :spinning="confirmLoading">
|
||||||
|
<a-form :form="form">
|
||||||
|
<a-row>
|
||||||
|
<a-col :span="24">
|
||||||
|
<a-form-item label="标签名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||||
|
<a-input placeholder="请输入标签名称"
|
||||||
|
v-decorator="['label',validatorRules.label]"
|
||||||
|
:maxLength='50'
|
||||||
|
@change="e => {e.target.value = (e.target.value + '').trim()}"></a-input>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
</a-form>
|
||||||
|
</a-spin>
|
||||||
|
</j-modal>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { httpAction } from '@api/manage'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'WorkGroupSetLabel',
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
title: '设置标签',
|
||||||
|
width: 800,
|
||||||
|
visible: false,
|
||||||
|
confirmLoading: false,
|
||||||
|
form: this.$form.createForm(this),
|
||||||
|
model: {},
|
||||||
|
labelCol: {
|
||||||
|
xs: { span: 24 },
|
||||||
|
sm: { span: 6 }
|
||||||
|
},
|
||||||
|
wrapperCol: {
|
||||||
|
xs: { span: 24 },
|
||||||
|
sm: { span: 14 }
|
||||||
|
},
|
||||||
|
validatorRules: {
|
||||||
|
label: {
|
||||||
|
rules: [{ required: true, message: '请输入标签名称' }],
|
||||||
|
validateTrigger: 'blur'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
url: {
|
||||||
|
setLabel: '/project/payWorkingGroupSubitem/setLabel'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
show(ids) {
|
||||||
|
this.form.resetFields()
|
||||||
|
this.selectedIds = ids
|
||||||
|
this.visible = true
|
||||||
|
},
|
||||||
|
close() {
|
||||||
|
this.$emit('close')
|
||||||
|
this.visible = false
|
||||||
|
},
|
||||||
|
handleOk() {
|
||||||
|
if (this.confirmLoading) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.confirmLoading = true
|
||||||
|
const that = this
|
||||||
|
// 触发表单验证
|
||||||
|
this.form.validateFields((err, values) => {
|
||||||
|
if (!err) {
|
||||||
|
that.confirmLoading = true
|
||||||
|
let httpUrl = this.url.setLabel
|
||||||
|
let method = 'post'
|
||||||
|
const formData = Object.assign(this.model, values)
|
||||||
|
formData.subIds = that.selectedIds.join(',')
|
||||||
|
console.log('表单提交数据', formData)
|
||||||
|
httpAction(httpUrl, formData, method).then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
that.$message.success(res.message)
|
||||||
|
that.$emit('ok')
|
||||||
|
that.close()
|
||||||
|
} else {
|
||||||
|
that.$message.warning(res.message)
|
||||||
|
}
|
||||||
|
}).finally(() => {
|
||||||
|
setTimeout(() => {
|
||||||
|
this.confirmLoading = false
|
||||||
|
}, 1000)
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
this.confirmLoading = false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleCancel() {
|
||||||
|
this.close()
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,202 @@
|
|||||||
|
<template>
|
||||||
|
<j-modal
|
||||||
|
:title="title"
|
||||||
|
:width="width"
|
||||||
|
:visible="visible"
|
||||||
|
:confirmLoading="confirmLoading"
|
||||||
|
switchFullscreen
|
||||||
|
@ok="handleOk"
|
||||||
|
@cancel="handleCancel"
|
||||||
|
cancelText="关闭">
|
||||||
|
<a-spin :spinning="confirmLoading">
|
||||||
|
<a-form :form="form">
|
||||||
|
<a-form-item label="收费通知号" :labelCol="remarksLabelCol" :wrapperCol="remarksWrapperCol">
|
||||||
|
<a-radio-group
|
||||||
|
class="charge-notice-no"
|
||||||
|
v-decorator="['charge']"
|
||||||
|
@change="handleChargeNoticeChange">
|
||||||
|
<a-radio v-for="item in chargeNoticeList" :key="item.key" :value="item.key">
|
||||||
|
<a-tooltip :title="item.label">
|
||||||
|
{{ item.label }}
|
||||||
|
</a-tooltip>
|
||||||
|
</a-radio>
|
||||||
|
</a-radio-group>
|
||||||
|
</a-form-item>
|
||||||
|
<a-row v-if="selectedChargeNotice === 'A'">
|
||||||
|
<a-col :xl="12" :sm="24">
|
||||||
|
<a-form-item label="本年应收款A" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||||
|
<a-input placeholder="请输入本年应收款A"
|
||||||
|
v-decorator="['receivableAmount']"
|
||||||
|
:maxLength='50'
|
||||||
|
@blur="addZero"
|
||||||
|
@change="e => {e.target.value = (e.target.value + '').trim()}"></a-input>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :xl="12" :sm="24">
|
||||||
|
<a-form-item label="收费通知A" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||||
|
<j-upload :multiple="false"
|
||||||
|
:return-id="true"
|
||||||
|
bizPath="payment"
|
||||||
|
:number="1"
|
||||||
|
v-decorator="['chargeNoticeId']"
|
||||||
|
:trigger-change="true"></j-upload>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
<a-row v-if="selectedChargeNotice === 'B'">
|
||||||
|
<a-col :xl="12" :sm="24">
|
||||||
|
<a-form-item label="本年应收款B" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||||
|
<a-input placeholder="请输入本年应收款B"
|
||||||
|
v-decorator="['receivableAmount']"
|
||||||
|
:maxLength='50'
|
||||||
|
@blur="addZero"
|
||||||
|
@change="e => {e.target.value = (e.target.value + '').trim()}"></a-input>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :xl="12" :sm="24">
|
||||||
|
<a-form-item label="收费通知B" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||||
|
<j-upload :multiple="false"
|
||||||
|
:return-id="true"
|
||||||
|
:number="1"
|
||||||
|
bizPath="payment"
|
||||||
|
v-decorator="['chargeNoticeId']"
|
||||||
|
:trigger-change="true"></j-upload>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
</a-form>
|
||||||
|
</a-spin>
|
||||||
|
<email-error-msg-modal ref="emailError"></email-error-msg-modal>
|
||||||
|
<template slot="footer">
|
||||||
|
<a-button @click="handleCancel">关闭</a-button>
|
||||||
|
<a-button @click="handleOk" type="primary" v-preventclick>确定</a-button>
|
||||||
|
</template>
|
||||||
|
</j-modal>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import pick from 'lodash.pick'
|
||||||
|
import JUpload from '@/components/jero/JUpload'
|
||||||
|
import { postAction } from '@/api/manage'
|
||||||
|
import { addZero } from '../../../utils/util'
|
||||||
|
// import {msgWarn} from '@comp/_util/MessageClose'
|
||||||
|
import EmailErrorMsgModal from '@views/projectManagement/modules/EmailErrorMsgModal'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'WorkingGroupMemberSetChargeNotice',
|
||||||
|
components: { JUpload, EmailErrorMsgModal },
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
title: '设置收费通知',
|
||||||
|
width: 800,
|
||||||
|
visible: false,
|
||||||
|
confirmLoading: false,
|
||||||
|
form: this.$form.createForm(this),
|
||||||
|
model: {},
|
||||||
|
labelCol: {
|
||||||
|
xs: { span: 24 },
|
||||||
|
sm: { span: 6 }
|
||||||
|
},
|
||||||
|
wrapperCol: {
|
||||||
|
xs: { span: 24 },
|
||||||
|
sm: { span: 18 }
|
||||||
|
},
|
||||||
|
remarksLabelCol: {
|
||||||
|
xs: { span: 24 },
|
||||||
|
sm: { span: 3 }
|
||||||
|
},
|
||||||
|
remarksWrapperCol: {
|
||||||
|
xs: { span: 24 },
|
||||||
|
sm: { span: 21 }
|
||||||
|
},
|
||||||
|
selectedRowKeys: null, // 选中项目的id
|
||||||
|
chargeNoticeList: null, // 收费通知列表
|
||||||
|
selectedChargeNotice: null, // 选中的收费通知类型
|
||||||
|
url: {
|
||||||
|
setCharge: '/project/payWorkingGroupSubitem/setCharge'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
addZero,
|
||||||
|
handleOpen() {
|
||||||
|
this.visible = true
|
||||||
|
},
|
||||||
|
handleOk() {
|
||||||
|
const that = this
|
||||||
|
// 触发表单验证
|
||||||
|
this.form.validateFields((err, values) => {
|
||||||
|
if (!err) {
|
||||||
|
this.confirmLoading = true
|
||||||
|
const formData = Object.assign(this.model, values)
|
||||||
|
console.log('表单提交数据', formData)
|
||||||
|
formData.ids = this.selectedRowKeys.join(',')
|
||||||
|
postAction(this.url.setCharge, formData).then(res => {
|
||||||
|
if (res.success) {
|
||||||
|
this.$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 ')
|
||||||
|
|
||||||
|
}
|
||||||
|
this.$emit('ok')
|
||||||
|
this.close()
|
||||||
|
} else {
|
||||||
|
this.$message.warning(res.message)
|
||||||
|
}
|
||||||
|
}).finally(() => {
|
||||||
|
this.confirmLoading = false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleCancel() {
|
||||||
|
this.close()
|
||||||
|
},
|
||||||
|
close() {
|
||||||
|
this.visible = false
|
||||||
|
this.model = {}
|
||||||
|
this.form.resetFields()
|
||||||
|
this.selectedRowKeys = null
|
||||||
|
this.chargeNoticeList = null
|
||||||
|
this.selectedChargeNotice = null
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 收费通知号变化, 回显本年应收款和文件
|
||||||
|
*/
|
||||||
|
handleChargeNoticeChange(e) {
|
||||||
|
let key = e.target.value
|
||||||
|
this.pickChargeNoticeType(key)
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 匹配显隐
|
||||||
|
* @param key
|
||||||
|
*/
|
||||||
|
pickChargeNoticeType(key) {
|
||||||
|
this.chargeNoticeList.forEach(item => {
|
||||||
|
if (item.type === 'chargeNoticeA' && key === 'a') {
|
||||||
|
this.selectedChargeNotice = 'A'
|
||||||
|
this.model.receivableAmount = item.yearCharge
|
||||||
|
this.model.chargeNoticeId = item.chargeNoticeId
|
||||||
|
this.model.chargeNoticeNo = item.value
|
||||||
|
} else if (item.type === 'chargeNoticeB' && key === 'b') {
|
||||||
|
this.selectedChargeNotice = 'B'
|
||||||
|
this.model.receivableAmount = item.yearCharge
|
||||||
|
this.model.chargeNoticeId = item.chargeNoticeId
|
||||||
|
this.model.chargeNoticeNo = item.value
|
||||||
|
}
|
||||||
|
})
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.form.setFieldsValue(pick(this.model, 'receivableAmount', 'chargeNoticeId'))
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,743 @@
|
|||||||
|
<template>
|
||||||
|
<j-modal
|
||||||
|
:title="title"
|
||||||
|
:width="width"
|
||||||
|
:visible="visible"
|
||||||
|
:confirmLoading="confirmLoading"
|
||||||
|
switchFullscreen
|
||||||
|
@ok="handleOk"
|
||||||
|
@cancel="handleCancel"
|
||||||
|
cancelText="关闭">
|
||||||
|
<a-spin :spinning="confirmLoading">
|
||||||
|
<a-form :form="form">
|
||||||
|
<a-row v-if="defaultChargeWay">
|
||||||
|
<a-col>
|
||||||
|
<a-form-item label="工作组项目" :labelCol="remarksLabelCol" :wrapperCol="remarksWrapperCol">
|
||||||
|
<a-select
|
||||||
|
placeholder="请选择工作组项目"
|
||||||
|
show-search
|
||||||
|
v-decorator="['workingGroupId',validatorRules.workingGroupId]"
|
||||||
|
:maxLength='50'
|
||||||
|
:filter-option="filterOption"
|
||||||
|
>
|
||||||
|
<a-select-option v-for="item in workingGroupList" :key="item.id" :value="item.id">
|
||||||
|
{{ item.workingGroupProject }}
|
||||||
|
</a-select-option>
|
||||||
|
</a-select>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
<a-row>
|
||||||
|
<a-col>
|
||||||
|
<a-form-item label="成员单位" :labelCol="remarksLabelCol" :wrapperCol="remarksWrapperCol">
|
||||||
|
<company-select placeholder="请选择成员单位"
|
||||||
|
v-decorator="['chargeCompany',validatorRules.chargeCompany]"
|
||||||
|
:disabled="disabledCompany"
|
||||||
|
@change="companyChange"
|
||||||
|
:maxLength='50'>
|
||||||
|
</company-select>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
<template
|
||||||
|
v-if="model.payWorkingGroupSubItemContactsList && model.payWorkingGroupSubItemContactsList.length > 0">
|
||||||
|
<a-row v-for="(item, index) in model.payWorkingGroupSubItemContactsList" :key="index + ''">
|
||||||
|
<a-col :xl="12" :sm="24">
|
||||||
|
<a-form-item :label="`企业联系人${index + 1}`" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||||
|
<select-contacts :selected-company="selectedCompany"
|
||||||
|
:init-contacts="model.payWorkingGroupSubItemContactsList[index]"
|
||||||
|
:placeholder="`请选择企业联系人${index + 1}`"
|
||||||
|
v-decorator="[`payWorkingGroupSubItemContactsList[${index}].contactsId`, {rules: [{ required: index === 0, validator: index === 0 ? validateContactRequired : validateContact }],validateTrigger: 'change'}]"
|
||||||
|
:maxLength='50'
|
||||||
|
:ref="`selectContacts${index}`"
|
||||||
|
@ok="addContactsOneOk"
|
||||||
|
@change="value => contactsChange(value, index)"></select-contacts>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :xl="9" :sm="20">
|
||||||
|
<!-- v-show="hasContactOne"-->
|
||||||
|
<a-form-item :label="`备注${index + 1}`" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||||
|
<a-input
|
||||||
|
:placeholder="`请输入备注${index + 1}`"
|
||||||
|
v-decorator="[`payWorkingGroupSubItemContactsList[${index}].remarks`]"
|
||||||
|
:maxLength='50'
|
||||||
|
@change="e => {e.target.value = (e.target.value + '').trim()}">
|
||||||
|
</a-input>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :xl="3" :sm="4">
|
||||||
|
<a-button type="link" class="contact-btn" @click="handleAddContact(index)">添加</a-button>
|
||||||
|
<a-button type="link" class="contact-btn del-btn" @click="handleDelContact(index)">删除</a-button>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
</template>
|
||||||
|
<!--<a-row>-->
|
||||||
|
<!-- <a-col :xl="12" :sm="24">-->
|
||||||
|
<!-- <a-form-item label="邮寄联系人" :labelCol="labelCol" :wrapperCol="wrapperCol">-->
|
||||||
|
<!-- <select-contacts :selected-company="selectedCompany"-->
|
||||||
|
<!-- :init-contacts="selectedMailContact"-->
|
||||||
|
<!-- placeholder="请选择邮寄联系人"-->
|
||||||
|
<!-- v-decorator="['mailContactsId',validatorRules.mailContactsId]"-->
|
||||||
|
<!-- :maxLength='50'-->
|
||||||
|
<!-- ref="selectMailContacts">-->
|
||||||
|
<!-- </select-contacts>-->
|
||||||
|
<!-- </a-form-item>-->
|
||||||
|
<!-- </a-col>-->
|
||||||
|
<!--</a-row>-->
|
||||||
|
<a-row>
|
||||||
|
<a-col>
|
||||||
|
<a-form-item label="备注" :labelCol="remarksLabelCol" :wrapperCol="remarksWrapperCol">
|
||||||
|
<a-textarea
|
||||||
|
placeholder="请输入备注"
|
||||||
|
:auto-size="{ minRows: 3, maxRows: 6 }"
|
||||||
|
v-decorator="['remarks']"
|
||||||
|
:maxLength='200'
|
||||||
|
@change="e => {e.target.value = (e.target.value + '').trim()}"/>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
</a-form>
|
||||||
|
</a-spin>
|
||||||
|
</j-modal>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import pick from 'lodash.pick'
|
||||||
|
import { httpAction } from '@api/manage'
|
||||||
|
import JUpload from '@comp/jero/JUpload'
|
||||||
|
import CompanySelect from '@comp/company/CompanySelect'
|
||||||
|
import SelectContacts from '@comp/company/SelectContacts'
|
||||||
|
import { getWorkingGroupListByNotCompany } from '../../../api/incomePaymentsApi'
|
||||||
|
// import { isRepeat } from '../../../utils/util'
|
||||||
|
import { addZero } from '../../../utils/util'
|
||||||
|
import { money } from '../../../utils/validate'
|
||||||
|
import { checkAssociatedProject } from '../../../utils/projectCheck'
|
||||||
|
import SelectRevenueContract from '../../../components/tools/SelectRevenueContract'
|
||||||
|
import JDictSelectTag from '@comp/dict/JDictSelectTag'
|
||||||
|
import { CalcAmountMixin } from '@/mixins/CalcAmountMixin'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'WorkingGroupMemberUnitModule',
|
||||||
|
components: { JUpload, CompanySelect, SelectContacts, SelectRevenueContract, JDictSelectTag },
|
||||||
|
mixins: [CalcAmountMixin],
|
||||||
|
props: {
|
||||||
|
// 默认来款方式(收入合同新增工作组项目,来款方式默认为2--合同)
|
||||||
|
defaultChargeWay: {
|
||||||
|
type: Number,
|
||||||
|
required: false,
|
||||||
|
default: null
|
||||||
|
},
|
||||||
|
// 收入合同关联时传入的企业信息,不可修改
|
||||||
|
defaultChargeCompany: {
|
||||||
|
type: Object,
|
||||||
|
required: false,
|
||||||
|
default: () => {
|
||||||
|
return {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 是否可以修改来款企业
|
||||||
|
disabledChargeCompany: {
|
||||||
|
type: Boolean,
|
||||||
|
required: false,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
// 收入合同新增项目时带入合同号且不可修改
|
||||||
|
defaultContractNum: {
|
||||||
|
type: String,
|
||||||
|
requirde: false,
|
||||||
|
default: null
|
||||||
|
},
|
||||||
|
// 合同号是否可编辑
|
||||||
|
isContractNumDisabled: {
|
||||||
|
type: Boolean,
|
||||||
|
required: false,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
// 企业的签订联系人id,收入合同新增企业联系人、邮寄联系人默认为签订联系人
|
||||||
|
signedContactId: {
|
||||||
|
type: String,
|
||||||
|
required: false,
|
||||||
|
default: undefined
|
||||||
|
},
|
||||||
|
// 收入合同新增时为1
|
||||||
|
flag: {
|
||||||
|
type: Number,
|
||||||
|
requirded: false,
|
||||||
|
default: null
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
title: '操作',
|
||||||
|
width: 800,
|
||||||
|
visible: false,
|
||||||
|
confirmLoading: false,
|
||||||
|
form: this.$form.createForm(this),
|
||||||
|
model: {},
|
||||||
|
labelCol: {
|
||||||
|
xs: { span: 24 },
|
||||||
|
sm: { span: 8 }
|
||||||
|
},
|
||||||
|
wrapperCol: {
|
||||||
|
xs: { span: 24 },
|
||||||
|
sm: { span: 16 }
|
||||||
|
},
|
||||||
|
remarksLabelCol: {
|
||||||
|
xs: { span: 24 },
|
||||||
|
sm: { span: 4 }
|
||||||
|
},
|
||||||
|
remarksWrapperCol: {
|
||||||
|
xs: { span: 24 },
|
||||||
|
sm: { span: 20 }
|
||||||
|
},
|
||||||
|
validatorRules: {
|
||||||
|
workingGroupId: {
|
||||||
|
rules: [{ required: true, message: '请选择工作组项目' }],
|
||||||
|
validateTrigger: 'change'
|
||||||
|
},
|
||||||
|
chargeCompany: {
|
||||||
|
rules: [{ required: true, validator: this.checkCompany }],
|
||||||
|
validateTrigger: 'change'
|
||||||
|
},
|
||||||
|
taxRate: {
|
||||||
|
rules: [{ required: true, message: '请选择税率' }],
|
||||||
|
validateTrigger: 'change', initialValue: '0.06'
|
||||||
|
},
|
||||||
|
contactsIdOne: {
|
||||||
|
rules: [{ required: true, message: '请选择企业联系人1' }],
|
||||||
|
validateTrigger: 'change'
|
||||||
|
},
|
||||||
|
contactsRepeat: {
|
||||||
|
rules: [{ required: false, validator: this.validateContact }],
|
||||||
|
validateTrigger: 'change'
|
||||||
|
},
|
||||||
|
mailContactsId: {
|
||||||
|
rules: [{ required: true, message: '请选择邮寄联系人' }],
|
||||||
|
validateTrigger: 'blur'
|
||||||
|
},
|
||||||
|
chargeWay: {
|
||||||
|
rules: [{ required: true, message: '请选择来款方式' }],
|
||||||
|
validateTrigger: 'change'
|
||||||
|
},
|
||||||
|
receivableAmount: {
|
||||||
|
rules: [{ required: true, validator: this.checkMoney }],
|
||||||
|
validateTrigger: 'blur'
|
||||||
|
},
|
||||||
|
contractNum: {
|
||||||
|
rules: [{ required: true, message: '请选择合同号' }],
|
||||||
|
validateTrigger: 'change'
|
||||||
|
},
|
||||||
|
charge: {
|
||||||
|
rules: [{ required: true, message: '请输入收费通知号' }],
|
||||||
|
validateTrigger: 'blur'
|
||||||
|
},
|
||||||
|
needInvoice: {
|
||||||
|
rules: [{ required: true, message: '请选择发票类型' }],
|
||||||
|
validateTrigger: 'change'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
chargeWayType: null,
|
||||||
|
selectedCompany: null, // 当前选中的企业
|
||||||
|
selectedContact1: null, // 编辑时的联系人
|
||||||
|
selectedContact2: null, // 编辑时的联系人
|
||||||
|
selectedContact3: null, // 编辑时的联系人
|
||||||
|
selectedMailContact: null, // 编辑时的邮寄联系人
|
||||||
|
chargeNoticeList: [], // 收费通知号list
|
||||||
|
selectedChargeNotice: null, // 选中的收费通知号
|
||||||
|
workingGroupId: null,
|
||||||
|
workingGroupList: [],
|
||||||
|
disabledCompany: false, // 企业是否禁用
|
||||||
|
isAssociatedContract: false, // 是否关联合同
|
||||||
|
// hasContactOne: false, // 是否选择联系人1
|
||||||
|
// hasContactTwo: false, // 是否选择联系人2
|
||||||
|
// hasContactThree: false, // 是否选择联系人3
|
||||||
|
url: {
|
||||||
|
add: '/project/payWorkingGroupSubitem/add',
|
||||||
|
edit: '/project/payWorkingGroupSubitem/edit'
|
||||||
|
},
|
||||||
|
// 默认的联系人数据
|
||||||
|
defaultPayWorkingGroupSubItemContact: {
|
||||||
|
contactsId: undefined,
|
||||||
|
remarks: null,
|
||||||
|
name: null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
addZero,
|
||||||
|
add() {
|
||||||
|
this.edit({})
|
||||||
|
// 判断默认来款用途是否为合同(收入合同新增)
|
||||||
|
if (this.defaultChargeWay) {
|
||||||
|
this.loadWorkingGroupList()
|
||||||
|
this.chargeWayType = 2
|
||||||
|
}
|
||||||
|
// 判断是否存在默认合同号(收入合同新增)
|
||||||
|
if (this.defaultContractNum && this.defaultContractNum !== '') {
|
||||||
|
this.model.contractNum = this.defaultContractNum
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.form.setFieldsValue(pick(this.model, 'contractNum'))
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 获取工作组列表
|
||||||
|
*/
|
||||||
|
loadWorkingGroupList() {
|
||||||
|
let param = {
|
||||||
|
companyId: this.defaultChargeCompany.id
|
||||||
|
}
|
||||||
|
getWorkingGroupListByNotCompany(param).then(res => {
|
||||||
|
if (res.success) {
|
||||||
|
this.workingGroupList = res.result
|
||||||
|
} else {
|
||||||
|
this.$message.warn(res.message)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
edit(record) {
|
||||||
|
// 存在默认选中企业时显示默认企业
|
||||||
|
if (this.defaultChargeCompany.hasOwnProperty.call(this.defaultChargeCompany, 'id')) {
|
||||||
|
record.chargeCompany = {
|
||||||
|
id: this.defaultChargeCompany.id,
|
||||||
|
companyName: this.defaultChargeCompany.companyName
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
record.chargeCompany = {
|
||||||
|
id: record.chargeCompanyId,
|
||||||
|
companyName: record.chargeCompanyTemporaryName
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 验证项目是否关联收入合同,项目来款、开票、邮寄、打包、关联合同后,企业不可更改
|
||||||
|
if (record.id) {
|
||||||
|
checkAssociatedProject(record.id).then(res => {
|
||||||
|
this.disabledCompany = this.disabledChargeCompany || res || (!!record.inAccount && record.inAccount !== 0) || (!!record.makeInvoice && record.makeInvoice !== 0) || (!!record.mail && record.mail !== 0)
|
||||||
|
this.isAssociatedContract = res
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
this.disabledCompany = this.disabledChargeCompany
|
||||||
|
}
|
||||||
|
// 回显选中的企业
|
||||||
|
this.selectedCompany = record.chargeCompany
|
||||||
|
this.companyChange(this.selectedCompany)
|
||||||
|
this.form.resetFields()
|
||||||
|
record.contractNum = record.contractNum || undefined
|
||||||
|
this.model = Object.assign({}, JSON.parse(JSON.stringify(record)))
|
||||||
|
// 是否存在从收入合同传入的签订联系人id
|
||||||
|
this.model.contactsIdOne = this.signedContactId || this.model.contactsTemporaryIdOne || undefined
|
||||||
|
this.model.contactsIdTwo = this.model.contactsTemporaryIdTwo || undefined
|
||||||
|
this.model.contactsIdThree = this.model.contactsTemporaryIdThree || undefined
|
||||||
|
// 是否存在从收入合同传入的签订联系人id
|
||||||
|
this.model.mailContactsId = this.signedContactId || this.model.mailContactsTemporaryId || undefined
|
||||||
|
if (this.model.id) {
|
||||||
|
// 传给组件的init-contact值,需要id和name两个属性
|
||||||
|
this.model.payWorkingGroupSubItemContactsList && this.model.payWorkingGroupSubItemContactsList.forEach(item => {
|
||||||
|
item.name = item.contactsTemporaryName
|
||||||
|
})
|
||||||
|
// this.selectedContact1 = {
|
||||||
|
// id: this.model.contactsTemporaryIdOne,
|
||||||
|
// name: this.model.contactsTemporaryNameOne
|
||||||
|
// }
|
||||||
|
// this.selectedContact2 = {
|
||||||
|
// id: this.model.contactsTemporaryIdTwo,
|
||||||
|
// name: this.model.contactsTemporaryNameTwo
|
||||||
|
// }
|
||||||
|
// this.selectedContact3 = {
|
||||||
|
// id: this.model.contactsTemporaryIdThree,
|
||||||
|
// name: this.model.contactsTemporaryNameThree
|
||||||
|
// }
|
||||||
|
this.selectedMailContact = {
|
||||||
|
id: this.model.mailContactsTemporaryId,
|
||||||
|
name: this.model.mailContactsTemporaryName
|
||||||
|
}
|
||||||
|
// // 是否需要显示联系人备注信息
|
||||||
|
// if (this.model.contactsTemporaryIdOne) {
|
||||||
|
// this.hasContactOne = true
|
||||||
|
// }
|
||||||
|
// if (this.model.contactsTemporaryIdTwo) {
|
||||||
|
// this.hasContactTwo = true
|
||||||
|
// }
|
||||||
|
// if (this.model.contactsTemporaryIdThree) {
|
||||||
|
// this.hasContactThree = true
|
||||||
|
// }
|
||||||
|
} else {
|
||||||
|
// 新增处理默认显示的三个企业联系人
|
||||||
|
this.model.payWorkingGroupSubItemContactsList = []
|
||||||
|
this.model.payWorkingGroupSubItemContactsList.push(this.defaultPayWorkingGroupSubItemContact)
|
||||||
|
this.model.payWorkingGroupSubItemContactsList.push(this.defaultPayWorkingGroupSubItemContact)
|
||||||
|
this.model.payWorkingGroupSubItemContactsList.push(this.defaultPayWorkingGroupSubItemContact)
|
||||||
|
}
|
||||||
|
this.chargeWayType = record.chargeWay
|
||||||
|
this.pickChargeNoticeType(record.charge, true)
|
||||||
|
this.visible = true
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.form.setFieldsValue(pick(this.model, 'chargeCompany', 'contactsIdOne', 'contactsIdTwo', 'contactsIdThree', 'mailContactsId', 'chargeWay', 'charge', 'receivableAmount', 'taxRate', 'tax', 'noTaxAmount', 'contractNum', 'receivableAmount', 'chargeNoticeId', 'needInvoice', 'remarks', 'remarksOne', 'remarksTwo', 'remarksThree', 'payWorkingGroupSubItemContactsList'))
|
||||||
|
})
|
||||||
|
},
|
||||||
|
close() {
|
||||||
|
this.$emit('close')
|
||||||
|
this.chargeWayType = null
|
||||||
|
this.selectedCompany = null
|
||||||
|
// 清除选中联系人信息
|
||||||
|
this.selectedContact1 = null
|
||||||
|
this.selectedContact2 = null
|
||||||
|
this.selectedContact3 = null
|
||||||
|
this.selectedMailContact = null
|
||||||
|
// 清除企业、来款方式、合同号的限制
|
||||||
|
this.isAssociatedContract = false
|
||||||
|
this.disabledCompany = false
|
||||||
|
// 清除联系人备注信息
|
||||||
|
// this.hasContactOne = false
|
||||||
|
// this.hasContactTwo = false
|
||||||
|
// this.hasContactThree = false
|
||||||
|
this.visible = false
|
||||||
|
this.model = Object.assign({}, {})
|
||||||
|
this.form.resetFields()
|
||||||
|
},
|
||||||
|
handleOk() {
|
||||||
|
if (this.confirmLoading) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.confirmLoading = true
|
||||||
|
const that = this
|
||||||
|
// 触发表单验证
|
||||||
|
this.form.validateFields((err, values) => {
|
||||||
|
if (!err) {
|
||||||
|
that.confirmLoading = true
|
||||||
|
// 收入合同新建项目手动赋值
|
||||||
|
if (this.defaultChargeWay === 2) {
|
||||||
|
values.chargeWay = 2
|
||||||
|
}
|
||||||
|
if (this.flag === 1) {
|
||||||
|
values.flag = this.flag
|
||||||
|
}
|
||||||
|
values.chargeCompanyTemporaryName = values.chargeCompany.companyName
|
||||||
|
values.chargeCompanyId = values.chargeCompany.id
|
||||||
|
let httpurl = ''
|
||||||
|
let method = 'post'
|
||||||
|
if (!this.model.id) {
|
||||||
|
httpurl += this.url.add
|
||||||
|
} else {
|
||||||
|
httpurl += this.url.edit
|
||||||
|
}
|
||||||
|
if (this.workingGroupId) {
|
||||||
|
values.workingGroupId = this.workingGroupId
|
||||||
|
}
|
||||||
|
// 企业联系人信息中将没有值的去掉
|
||||||
|
let haveValueContactArr = values.payWorkingGroupSubItemContactsList.filter(tt => tt.contactsId)
|
||||||
|
let obj = {
|
||||||
|
payWorkingGroupSubItemContactsList: haveValueContactArr
|
||||||
|
}
|
||||||
|
const formData = Object.assign(this.model, values, obj)
|
||||||
|
console.log('表单提交数据', formData)
|
||||||
|
httpAction(httpurl, formData, method).then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
that.$message.success(res.message)
|
||||||
|
that.$emit('ok')
|
||||||
|
that.close()
|
||||||
|
} else {
|
||||||
|
that.$message.warning(res.message)
|
||||||
|
}
|
||||||
|
}).finally(() => {
|
||||||
|
setTimeout(() => {
|
||||||
|
this.confirmLoading = false
|
||||||
|
}, 1000)
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
this.confirmLoading = false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleCancel() {
|
||||||
|
this.close()
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 来款方式变化
|
||||||
|
* @param e
|
||||||
|
*/
|
||||||
|
handlechargeWayChange(e) {
|
||||||
|
if (e.target.value === 3) {
|
||||||
|
if (this.chargeNoticeList.length === 0) {
|
||||||
|
this.chargeWayType = null
|
||||||
|
this.model.chargeWay = null
|
||||||
|
this.$message.warn('请先补充该工作组的收费通知信息')
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.form.setFieldsValue(pick(this.model, 'chargeWay'))
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 清空之前选中的收费通知号
|
||||||
|
this.selectedChargeNotice = null
|
||||||
|
// 清空未税金额 待确收金额 税额
|
||||||
|
this.form.resetFields(['tax', 'noTaxAmount', 'receivableAmount'])
|
||||||
|
}
|
||||||
|
this.chargeWayType = e.target.value
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 收费通知号变化, 回显本年应收款和文件
|
||||||
|
*/
|
||||||
|
handleChargeNoticeChange(e) {
|
||||||
|
let key = e.target.value
|
||||||
|
this.pickChargeNoticeType(key)
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 匹配收费通知显隐
|
||||||
|
* @param value
|
||||||
|
*/
|
||||||
|
pickChargeNoticeType(key, isFirst) {
|
||||||
|
this.chargeNoticeList.forEach(item => {
|
||||||
|
if (item.type === 'chargeNoticeA' && key === 'a') {
|
||||||
|
this.selectedChargeNotice = 'A'
|
||||||
|
if (!isFirst) {
|
||||||
|
this.model.receivableAmount = item.yearCharge
|
||||||
|
this.model.chargeNoticeId = item.chargeNoticeId
|
||||||
|
}
|
||||||
|
this.model.chargeNoticeNo = item.value
|
||||||
|
} else if (item.type === 'chargeNoticeB' && key === 'b') {
|
||||||
|
this.selectedChargeNotice = 'B'
|
||||||
|
if (!isFirst) {
|
||||||
|
this.model.receivableAmount = item.yearCharge
|
||||||
|
this.model.chargeNoticeId = item.chargeNoticeId
|
||||||
|
}
|
||||||
|
this.model.chargeNoticeNo = item.value
|
||||||
|
}
|
||||||
|
})
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.form.setFieldsValue(pick(this.model, 'receivableAmount', 'chargeNoticeId'))
|
||||||
|
this.calcAmount()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 选中企业变化,将联系人的值清空
|
||||||
|
* @param value
|
||||||
|
*/
|
||||||
|
companyChange(value) {
|
||||||
|
// 当前选中的企业和之前选中的企业一致,就不修改了
|
||||||
|
if (this.selectedCompany && value && this.selectedCompany.id === value.id) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.selectedCompany = value
|
||||||
|
// this.model.contactsIdOne = undefined
|
||||||
|
// this.model.contactsIdTwo = undefined
|
||||||
|
// this.model.contactsIdThree = undefined
|
||||||
|
// 处理默认显示的三个企业联系人
|
||||||
|
this.model.payWorkingGroupSubItemContactsList = []
|
||||||
|
this.model.payWorkingGroupSubItemContactsList.push(this.defaultPayWorkingGroupSubItemContact)
|
||||||
|
this.model.payWorkingGroupSubItemContactsList.push(this.defaultPayWorkingGroupSubItemContact)
|
||||||
|
this.model.payWorkingGroupSubItemContactsList.push(this.defaultPayWorkingGroupSubItemContact)
|
||||||
|
this.model.mailContactsId = undefined
|
||||||
|
this.selectedMailContact = null
|
||||||
|
this.model.contractNum = undefined
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.form.setFieldsValue(pick(this.model, 'mailContactsId', 'contractNum', 'payWorkingGroupSubItemContactsList'))
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 企业必填校验
|
||||||
|
* @param rules
|
||||||
|
* @param value
|
||||||
|
* @param callback
|
||||||
|
*/
|
||||||
|
checkCompany(rules, value, callback) {
|
||||||
|
if (value.id && value.companyName) {
|
||||||
|
callback()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
callback('请选择成员单位')
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 校验金额格式
|
||||||
|
* @param rules
|
||||||
|
* @param value
|
||||||
|
* @param callback
|
||||||
|
*/
|
||||||
|
checkMoney(rules, value, callback) {
|
||||||
|
if (value) {
|
||||||
|
if (money(value)) {
|
||||||
|
callback()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
callback('请输入合法的金额数字,最多2位小数,10位整数')
|
||||||
|
}
|
||||||
|
callback('请输入待确收金额')
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 在新增成功后重新获取联系人列表
|
||||||
|
*/
|
||||||
|
addContactsOneOk() {
|
||||||
|
this.$refs.selectMailContacts.getContactsList()
|
||||||
|
},
|
||||||
|
addMailContactsOk() {
|
||||||
|
this.$refs.selectContacts1.getContactsList()
|
||||||
|
this.$refs.selectContacts2.getContactsList()
|
||||||
|
this.$refs.selectContacts3.getContactsList()
|
||||||
|
},
|
||||||
|
validateContactRequired(rule, value, callback) {
|
||||||
|
if (value) {
|
||||||
|
callback()
|
||||||
|
}
|
||||||
|
callback('请选择企业联系人1')
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 校验企业联系人是否重复
|
||||||
|
* @param rule
|
||||||
|
* @param value
|
||||||
|
* @param callback
|
||||||
|
*/
|
||||||
|
validateContact(rule, value, callback) {
|
||||||
|
if (value) {
|
||||||
|
let contactsList = this.form.getFieldValue('payWorkingGroupSubItemContactsList')
|
||||||
|
let hasValueArr = contactsList.filter(tt => tt.contactsId === value)
|
||||||
|
if (hasValueArr.length <= 1) {
|
||||||
|
callback()
|
||||||
|
}
|
||||||
|
callback('请选择不同的联系人')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
callback()
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 企业联系人1、邮寄联系人联动
|
||||||
|
* @param value
|
||||||
|
* @param index
|
||||||
|
*/
|
||||||
|
contactsChange(value, index) {
|
||||||
|
let formData = this.form.getFieldValue('payWorkingGroupSubItemContactsList')
|
||||||
|
formData[index].contactsId = value
|
||||||
|
// 如果没有值,清空对应的备注
|
||||||
|
if (!value) {
|
||||||
|
formData[index].remarks = null
|
||||||
|
} else {
|
||||||
|
// 如果值和初始值不一致,则清除备注
|
||||||
|
if (this.model.payWorkingGroupSubItemContactsList[index].contactsId !== value) {
|
||||||
|
formData[index].remarks = null
|
||||||
|
}
|
||||||
|
let mailContact = Object.values(this.form.getFieldValue(['mailContactsId']))[0]
|
||||||
|
// 邮寄联系人非undefined时赋值
|
||||||
|
if (!mailContact && index === 0) {
|
||||||
|
this.model.mailContactsId = value
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.form.setFieldsValue(pick(this.model, 'mailContactsId'))
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.form.setFieldsValue({ payWorkingGroupSubItemContactsList: formData })
|
||||||
|
this.form.validateFields(['payWorkingGroupSubItemContactsList'])
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 企业联系人2变化
|
||||||
|
* @param value
|
||||||
|
*/
|
||||||
|
// contactsTwoChange(value) {
|
||||||
|
// if (!value) {
|
||||||
|
// this.hasContactTwo = false
|
||||||
|
// this.form.setFieldsValue({ remarksTwo: null })
|
||||||
|
// return
|
||||||
|
// }
|
||||||
|
// this.hasContactTwo = true
|
||||||
|
// // 判断联系人是否和原来的一致,不一致则清空备注内容
|
||||||
|
// if (value !== this.model.contactsTemporaryIdTwo) {
|
||||||
|
// this.form.setFieldsValue({ remarksTwo: null })
|
||||||
|
// }
|
||||||
|
// },
|
||||||
|
/**
|
||||||
|
* 企业联系人3变化
|
||||||
|
* @param value
|
||||||
|
*/
|
||||||
|
// contactsThreeChange(value) {
|
||||||
|
// if (!value) {
|
||||||
|
// this.hasContactThree = false
|
||||||
|
// this.form.setFieldsValue({ remarksThree: null })
|
||||||
|
// return
|
||||||
|
// }
|
||||||
|
// this.hasContactThree = true
|
||||||
|
// // 判断联系人是否和原来的一致,不一致则清空备注内容
|
||||||
|
// if (value !== this.model.contactsTemporaryIdThree) {
|
||||||
|
// this.form.setFieldsValue({ remarksThree: null })
|
||||||
|
// }
|
||||||
|
// },
|
||||||
|
/**
|
||||||
|
* 添加联系人
|
||||||
|
* @param index
|
||||||
|
*/
|
||||||
|
handleAddContact(index) {
|
||||||
|
if (this.model.payWorkingGroupSubItemContactsList.length >= 10) {
|
||||||
|
this.$message.warn('最多添加十个企业联系人')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
let obj = {
|
||||||
|
contactsId: undefined,
|
||||||
|
remarks: null
|
||||||
|
}
|
||||||
|
this.model.payWorkingGroupSubItemContactsList.splice(index + 1, 0, obj)
|
||||||
|
this.$forceUpdate()
|
||||||
|
let formData = this.form.getFieldValue('payWorkingGroupSubItemContactsList')
|
||||||
|
formData.splice(index + 1, 0, obj)
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.form.setFieldsValue({ payWorkingGroupSubItemContactsList: formData })
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 删除联系人
|
||||||
|
* @param index
|
||||||
|
*/
|
||||||
|
handleDelContact(index) {
|
||||||
|
if (this.model.payWorkingGroupSubItemContactsList.length === 1) {
|
||||||
|
this.$message.warn('最少需要一个企业联系人')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.model.payWorkingGroupSubItemContactsList.splice(index, 1)
|
||||||
|
let formData = this.form.getFieldValue('payWorkingGroupSubItemContactsList')
|
||||||
|
formData.splice(index, 1)
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.form.setFieldsValue({ payWorkingGroupSubItemContactsList: formData })
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 下拉框的搜索
|
||||||
|
filterOption(input, option) {
|
||||||
|
return (
|
||||||
|
option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
||||||
|
)
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="less">
|
||||||
|
.charge-notice-no {
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
/deep/ .ant-radio-wrapper {
|
||||||
|
display: inline-block;
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
span.ant-radio + * {
|
||||||
|
display: inline-block;
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
span {
|
||||||
|
vertical-align: bottom;
|
||||||
|
display: inline-block;
|
||||||
|
width: 100%;
|
||||||
|
overflow: hidden;
|
||||||
|
white-space: nowrap;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.contact-btn {
|
||||||
|
display: inline-block;
|
||||||
|
margin: 0 8px;
|
||||||
|
padding: 0;
|
||||||
|
height: 40px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.del-btn {
|
||||||
|
color: #ff4d4f
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,355 @@
|
|||||||
|
<template>
|
||||||
|
<j-modal
|
||||||
|
:title="title"
|
||||||
|
:width="width"
|
||||||
|
:visible="visible"
|
||||||
|
:confirmLoading="confirmLoading"
|
||||||
|
switchFullscreen
|
||||||
|
@ok="handleOk"
|
||||||
|
@cancel="handleCancel"
|
||||||
|
cancelText="关闭">
|
||||||
|
<a-spin :spinning="confirmLoading">
|
||||||
|
<span class="prompt-message">
|
||||||
|
说明:1.负责人A为该工作组的主负责人,负责人B为该工作组的辅助负责人。<br>
|
||||||
|
<span class="prompt-message-line2">2.设置本年应收款A和本年应收款B是为了区分工作组成员的价格。</span>
|
||||||
|
</span>
|
||||||
|
<a-form :form="form">
|
||||||
|
<a-row>
|
||||||
|
<a-col :span="24">
|
||||||
|
<a-form-item label="工作组项目" :labelCol="remarksLabelCol" :wrapperCol="remarksWrapperCol">
|
||||||
|
<a-input placeholder="请输入工作组项目"
|
||||||
|
v-decorator="['workingGroupProject',validatorRules.workingGroupProject]"
|
||||||
|
:maxLength='50'
|
||||||
|
@change="e => {e.target.value = (e.target.value + '').trim()}"></a-input>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
<a-row>
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item label="运行年份" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||||
|
<j-year-date style="width:100%" placeholder="请选择运行年份"
|
||||||
|
v-decorator="['year',validatorRules.year]"></j-year-date>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
<a-row>
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item label="负责人A" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||||
|
<select-principal placeholder="请选择负责人A"
|
||||||
|
v-decorator="['principalIdA',validatorRules.principalIdA]"
|
||||||
|
:maxLength='50'></select-principal>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item label="负责人B" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||||
|
<select-principal placeholder="请选择负责人B"
|
||||||
|
v-decorator="['principalIdB',validatorRules.principalIdB]"
|
||||||
|
:maxLength='50'></select-principal>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
<a-row>
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item label="每年召开次数" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||||
|
<a-input placeholder="请输入每年召开次数"
|
||||||
|
v-decorator="['convokeNum']"
|
||||||
|
:maxLength='50'
|
||||||
|
@change="e => {e.target.value = (e.target.value + '').trim()}"></a-input>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item label="运行周期" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||||
|
<a-input placeholder="请输入运行周期"
|
||||||
|
v-decorator="['operationCycle']"
|
||||||
|
:maxLength='50'
|
||||||
|
@change="e => {e.target.value = (e.target.value + '').trim()}"></a-input>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
<a-row>
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item label="本年应收款A" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||||
|
<a-row :gutter="10">
|
||||||
|
<a-col :span="20">
|
||||||
|
<a-input placeholder="请输入本年应收款A"
|
||||||
|
v-decorator="['yearChargeA',validatorRules.checkMoney]"
|
||||||
|
:maxLength='50'
|
||||||
|
@blur="addZero"
|
||||||
|
@change="(e) => {e.target.value = (e.target.value.replace(/[^0-9.]/g,'')).trim()}"></a-input>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="4">元/人</a-col>
|
||||||
|
</a-row>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
<a-row>
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item label="收费通知号A" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||||
|
<a-input placeholder="请输入收费通知号A"
|
||||||
|
v-decorator="['chargeNoticeNoA']"
|
||||||
|
:maxLength='50'
|
||||||
|
@change="e => {e.target.value = (e.target.value + '').trim()}"></a-input>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item label="收费通知A" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||||
|
<j-upload :multiple="false"
|
||||||
|
:return-id="true"
|
||||||
|
bizPath="payment"
|
||||||
|
:number="1"
|
||||||
|
v-decorator="['chargeNoticeAId']"
|
||||||
|
:trigger-change="true"></j-upload>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
<a-row>
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item label="本年应收款B" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||||
|
<a-row :gutter="10">
|
||||||
|
<a-col :span="20">
|
||||||
|
<a-input placeholder="请输入本年应收款B"
|
||||||
|
v-decorator="['yearChargeB',validatorRules.checkMoney]"
|
||||||
|
:maxLength='50'
|
||||||
|
@blur="addZero"
|
||||||
|
@change="(e) => {e.target.value = (e.target.value.replace(/[^0-9.]/g,'')).trim()}"></a-input>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="4">元/人</a-col>
|
||||||
|
</a-row>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
<a-row>
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item label="收费通知号B" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||||
|
<a-input placeholder="请输入收费通知号B"
|
||||||
|
v-decorator="['chargeNoticeNoB']"
|
||||||
|
:maxLength='50'
|
||||||
|
@change="e => {e.target.value = (e.target.value + '').trim()}"></a-input>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item label="收费通知B" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||||
|
<j-upload :multiple="false"
|
||||||
|
:return-id="true"
|
||||||
|
bizPath="payment"
|
||||||
|
:number="1"
|
||||||
|
v-decorator="['chargeNoticeBId']"
|
||||||
|
:trigger-change="true"></j-upload>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
<a-row>
|
||||||
|
<a-col>
|
||||||
|
<a-form-item label="任务及目标" :labelCol="remarksLabelCol" :wrapperCol="remarksWrapperCol">
|
||||||
|
<a-textarea
|
||||||
|
placeholder="请输入任务及目标"
|
||||||
|
:auto-size="{ minRows: 3, maxRows: 6 }"
|
||||||
|
v-decorator="['missionAndObjectives']"
|
||||||
|
:maxLength='200'
|
||||||
|
@change="e => {e.target.value = (e.target.value + '').trim()}"/>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
<a-row>
|
||||||
|
<a-col>
|
||||||
|
<a-form-item label="备注" :labelCol="remarksLabelCol" :wrapperCol="remarksWrapperCol">
|
||||||
|
<a-textarea
|
||||||
|
placeholder="请输入备注"
|
||||||
|
:auto-size="{ minRows: 3, maxRows: 6 }"
|
||||||
|
v-decorator="['remarks']"
|
||||||
|
:maxLength='200'
|
||||||
|
@change="e => {e.target.value = (e.target.value + '').trim()}"/>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
</a-form>
|
||||||
|
</a-spin>
|
||||||
|
</j-modal>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import pick from 'lodash.pick'
|
||||||
|
import { httpAction } from '@api/manage'
|
||||||
|
import JUpload from '@comp/jero/JUpload'
|
||||||
|
import JYearDate from '@comp/jero/JYearDate'
|
||||||
|
import SelectPrincipal from '@comp/company/SelectPrincipal'
|
||||||
|
import { isRepeat } from '../../../utils/util'
|
||||||
|
import { money } from '../../../utils/validate'
|
||||||
|
import { addZero } from '../../../utils/util'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'WorkingGroupProjectModule',
|
||||||
|
components: { JUpload, JYearDate, SelectPrincipal },
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
title: '操作',
|
||||||
|
width: 800,
|
||||||
|
visible: false,
|
||||||
|
confirmLoading: false,
|
||||||
|
form: this.$form.createForm(this),
|
||||||
|
model: {},
|
||||||
|
labelCol: {
|
||||||
|
xs: { span: 24 },
|
||||||
|
sm: { span: 6 }
|
||||||
|
},
|
||||||
|
wrapperCol: {
|
||||||
|
xs: { span: 24 },
|
||||||
|
sm: { span: 18 }
|
||||||
|
},
|
||||||
|
remarksLabelCol: {
|
||||||
|
xs: { span: 24 },
|
||||||
|
sm: { span: 3 }
|
||||||
|
},
|
||||||
|
remarksWrapperCol: {
|
||||||
|
xs: { span: 24 },
|
||||||
|
sm: { span: 21 }
|
||||||
|
},
|
||||||
|
validatorRules: {
|
||||||
|
workingGroupProject: {
|
||||||
|
rules: [{ required: true, message: '请输入项目名称' }],
|
||||||
|
validateTrigger: 'blur'
|
||||||
|
},
|
||||||
|
year: {
|
||||||
|
rules: [{ required: true, message: '请选择运行年份' }],
|
||||||
|
validateTrigger: 'change'
|
||||||
|
},
|
||||||
|
principalIdA: {
|
||||||
|
rules: [{ required: true, validator: this.validatePrincipal }],
|
||||||
|
validateTrigger: 'change'
|
||||||
|
},
|
||||||
|
principalIdB: {
|
||||||
|
rules: [{ required: false, validator: this.validatePrincipal }],
|
||||||
|
validateTrigger: 'change'
|
||||||
|
},
|
||||||
|
checkMoney: {
|
||||||
|
rules: [{ required: false, validator: this.checkMoney }],
|
||||||
|
validateTrigger: 'blur'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
url: {
|
||||||
|
add: '/project/payWorkingGroup/add',
|
||||||
|
edit: '/project/payWorkingGroup/edit'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
addZero,
|
||||||
|
add() {
|
||||||
|
this.edit({})
|
||||||
|
},
|
||||||
|
edit(record) {
|
||||||
|
this.form.resetFields()
|
||||||
|
// 防止下拉选项出现问题
|
||||||
|
record.principalIdA = record.principalIdA || undefined
|
||||||
|
record.principalIdB = record.principalIdB || undefined
|
||||||
|
this.model = Object.assign({}, record)
|
||||||
|
this.visible = true
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.form.setFieldsValue(pick(this.model, 'workingGroupProject', 'year', 'principalIdA', 'principalIdB', 'convokeNum', 'operationCycle', 'yearChargeA', 'chargeNoticeNoA', 'chargeNoticeAId', 'yearChargeB', 'chargeNoticeNoB', 'chargeNoticeBId', 'missionAndObjectives', 'remarks'))
|
||||||
|
if (!this.model.id) {
|
||||||
|
this.form.setFieldsValue({'year': (new Date().getFullYear()).toString()})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
close() {
|
||||||
|
this.$emit('close')
|
||||||
|
this.visible = false
|
||||||
|
},
|
||||||
|
handleOk() {
|
||||||
|
if (this.confirmLoading) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.confirmLoading = true
|
||||||
|
const that = this
|
||||||
|
// 触发表单验证
|
||||||
|
this.form.validateFields((err, values) => {
|
||||||
|
if (!err) {
|
||||||
|
that.confirmLoading = true
|
||||||
|
let httpurl = ''
|
||||||
|
let method = 'post'
|
||||||
|
if (!this.model.id) {
|
||||||
|
httpurl += this.url.add
|
||||||
|
} else {
|
||||||
|
httpurl += this.url.edit
|
||||||
|
}
|
||||||
|
values.yearChargeA = values.yearChargeA ? Number(values.yearChargeA) : null
|
||||||
|
values.yearChargeB = values.yearChargeB ? Number(values.yearChargeB) : null
|
||||||
|
values.chargeA = values.chargeNoticeNoA ? 'a' : null
|
||||||
|
values.chargeB = values.chargeNoticeNoB ? 'b' : null
|
||||||
|
const formData = Object.assign(this.model, values)
|
||||||
|
console.log('表单提交数据', formData)
|
||||||
|
httpAction(httpurl, formData, method).then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
that.$message.success(res.message)
|
||||||
|
that.$emit('ok')
|
||||||
|
that.close()
|
||||||
|
} else {
|
||||||
|
that.$message.warning(res.message)
|
||||||
|
}
|
||||||
|
}).finally(() => {
|
||||||
|
setTimeout(() => {
|
||||||
|
this.confirmLoading = false
|
||||||
|
}, 1000)
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
this.confirmLoading = false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleCancel() {
|
||||||
|
this.close()
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 校验负责人是否重复
|
||||||
|
* @param rule
|
||||||
|
* @param value
|
||||||
|
* @param callback
|
||||||
|
*/
|
||||||
|
validatePrincipal(rule, value, callback) {
|
||||||
|
if (rule.field === 'principalIdA') {
|
||||||
|
if (!value) {
|
||||||
|
callback('请选择负责人A')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (value) {
|
||||||
|
const principalObj = this.form.getFieldsValue(['principalIdA', 'principalIdB'])
|
||||||
|
const principalArr = Object.values(principalObj)
|
||||||
|
principalArr.filter(tt => tt !== undefined)
|
||||||
|
if (isRepeat(principalArr)) {
|
||||||
|
callback('请选择不同的负责人')
|
||||||
|
} else {
|
||||||
|
callback()
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
callback()
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 校验金额格式
|
||||||
|
* @param rules
|
||||||
|
* @param value
|
||||||
|
* @param callback
|
||||||
|
*/
|
||||||
|
checkMoney(rules, value, callback) {
|
||||||
|
if (value) {
|
||||||
|
if (money(value)) {
|
||||||
|
callback()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
callback('请输入合法的金额数字,最多2位小数,10位整数')
|
||||||
|
}
|
||||||
|
callback()
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="less">
|
||||||
|
.prompt-message {
|
||||||
|
color: red;
|
||||||
|
|
||||||
|
&-line2 {
|
||||||
|
padding-left: 2.7rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,183 @@
|
|||||||
|
<template>
|
||||||
|
<j-modal
|
||||||
|
:title="title"
|
||||||
|
:width="width"
|
||||||
|
:visible="visible"
|
||||||
|
:confirmLoading="confirmLoading"
|
||||||
|
switchFullscreen
|
||||||
|
@ok="handleOk"
|
||||||
|
@cancel="handleCancel"
|
||||||
|
cancelText="关闭">
|
||||||
|
<a-spin :spinning="confirmLoading">
|
||||||
|
<a-form :form="form">
|
||||||
|
<a-row>
|
||||||
|
<a-col>
|
||||||
|
<a-form-item label="项目名称" :labelCol="remarksLabelCol" :wrapperCol="remarksWrapperCol">
|
||||||
|
<a-input placeholder="请输入项目名称"
|
||||||
|
v-decorator="['projectName',validatorRules.projectName]"
|
||||||
|
:maxLength='50'
|
||||||
|
@change="e => {e.target.value = (e.target.value + '').trim()}"></a-input>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
<a-row>
|
||||||
|
<a-col :xl="12" :sm="24">
|
||||||
|
<a-form-item label="主要起草单位" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||||
|
<a-input placeholder="请输入主要起草单位"
|
||||||
|
v-decorator="['draftCompany', validatorRules.draftCompany]"
|
||||||
|
:maxLength='50'
|
||||||
|
@change="e => {e.target.value = (e.target.value + '').trim()}"></a-input>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :xl="12" :sm="24">
|
||||||
|
<a-form-item label="项目进度" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||||
|
<a-input placeholder="请输入项目进度"
|
||||||
|
v-decorator="['projectSchedule', validatorRules.projectSchedule]"
|
||||||
|
:maxLength='50'
|
||||||
|
@change="e => {e.target.value = (e.target.value + '').trim()}"></a-input>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
<a-row>
|
||||||
|
<a-col >
|
||||||
|
<!-- :xl="12" :sm="24"-->
|
||||||
|
<a-form-item label="过程文件" :labelCol="remarksLabelCol" :wrapperCol="remarksWrapperCol">
|
||||||
|
<j-upload file-type="all"
|
||||||
|
file-type-error-message="请上传过程文件"
|
||||||
|
:multiple="true"
|
||||||
|
:number="20"
|
||||||
|
:return-id="true"
|
||||||
|
v-decorator="['files', validatorRules.files]"
|
||||||
|
:trigger-change="true"></j-upload>
|
||||||
|
<div class="tip">最多只能添加20个文件,如果文件过多,请打包上传</div>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
</a-form>
|
||||||
|
</a-spin>
|
||||||
|
</j-modal>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import pick from 'lodash.pick'
|
||||||
|
import { postAction } from '../../../api/manage'
|
||||||
|
import JUpload from '../../../components/jero/JUpload'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'WorkingGroupUnderStudyProjectModal',
|
||||||
|
components: { JUpload },
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
title: '操作',
|
||||||
|
width: 800,
|
||||||
|
visible: false,
|
||||||
|
confirmLoading: false,
|
||||||
|
form: this.$form.createForm(this),
|
||||||
|
model: {},
|
||||||
|
// 工作组id
|
||||||
|
workingGroupId: '',
|
||||||
|
labelCol: {
|
||||||
|
xs: { span: 24 },
|
||||||
|
sm: { span: 8 }
|
||||||
|
},
|
||||||
|
wrapperCol: {
|
||||||
|
xs: { span: 24 },
|
||||||
|
sm: { span: 16 }
|
||||||
|
},
|
||||||
|
remarksLabelCol: {
|
||||||
|
xs: { span: 24 },
|
||||||
|
sm: { span: 4 }
|
||||||
|
},
|
||||||
|
remarksWrapperCol: {
|
||||||
|
xs: { span: 24 },
|
||||||
|
sm: { span: 20 }
|
||||||
|
},
|
||||||
|
validatorRules: {
|
||||||
|
projectName: {
|
||||||
|
rules: [{ required: true, message: '请输入项目名称' }],
|
||||||
|
validateTrigger: 'blur'
|
||||||
|
},
|
||||||
|
draftCompany: {
|
||||||
|
rules: [{ required: true, message: '请输入主要起草单位' }],
|
||||||
|
validateTrigger: 'blur'
|
||||||
|
},
|
||||||
|
projectSchedule: {
|
||||||
|
rules: [{ required: true, message: '请输入项目进度' }],
|
||||||
|
validateTrigger: 'blur'
|
||||||
|
},
|
||||||
|
files: {
|
||||||
|
rules: [{ required: true, message: '请上传过程文件' }],
|
||||||
|
validateTrigger: 'change'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
url: {
|
||||||
|
add: '/payResearchProject/payResearchProject/add',
|
||||||
|
edit: '/payResearchProject/payResearchProject/edit'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
add() {
|
||||||
|
this.edit({})
|
||||||
|
},
|
||||||
|
edit(record) {
|
||||||
|
this.form.resetFields()
|
||||||
|
this.model = Object.assign({}, record)
|
||||||
|
this.visible = true
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.form.setFieldsValue(pick(this.model, 'projectName', 'draftCompany', 'projectSchedule', 'files'))
|
||||||
|
})
|
||||||
|
},
|
||||||
|
close() {
|
||||||
|
this.$emit('close')
|
||||||
|
this.visible = false
|
||||||
|
},
|
||||||
|
handleOk() {
|
||||||
|
if (this.confirmLoading) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.confirmLoading = true
|
||||||
|
const that = this
|
||||||
|
// 触发表单验证
|
||||||
|
this.form.validateFields((err, values) => {
|
||||||
|
if (!err) {
|
||||||
|
let httpurl = ''
|
||||||
|
if (!this.model.id) {
|
||||||
|
httpurl += this.url.add
|
||||||
|
} else {
|
||||||
|
httpurl += this.url.edit
|
||||||
|
}
|
||||||
|
values.workingGroupId = this.workingGroupId
|
||||||
|
const formData = Object.assign(this.model, values)
|
||||||
|
console.log('表单提交数据', formData)
|
||||||
|
postAction(httpurl, formData).then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
that.$message.success(res.message)
|
||||||
|
that.$emit('ok')
|
||||||
|
that.close()
|
||||||
|
} else {
|
||||||
|
that.$message.warning(res.message)
|
||||||
|
}
|
||||||
|
}).finally(() => {
|
||||||
|
setTimeout(() => {
|
||||||
|
this.confirmLoading = false
|
||||||
|
}, 1000)
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
this.confirmLoading = false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleCancel() {
|
||||||
|
this.close()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.tip{
|
||||||
|
color: #f5222d;
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
Reference in New Issue
Block a user