update 工作组、起草组批量新增成员单位完善
This commit is contained in:
@@ -157,6 +157,8 @@ const memberCopy = (params) => getAction('', params)
|
|||||||
|
|
||||||
// 工作组成员维护-调账
|
// 工作组成员维护-调账
|
||||||
const workingGroupEditAccount = (param) => getAction('/project/payWorkingGroupSubitem/editAccount', param)
|
const workingGroupEditAccount = (param) => getAction('/project/payWorkingGroupSubitem/editAccount', param)
|
||||||
|
// 获取所有起草组项目
|
||||||
|
const getAllDraftProjects = (params) => getAction('/drafting/payDraftingGroup/listAll', params)
|
||||||
|
|
||||||
export {
|
export {
|
||||||
getWorkingGroupById,
|
getWorkingGroupById,
|
||||||
@@ -239,5 +241,6 @@ export {
|
|||||||
memberDrawTicket,
|
memberDrawTicket,
|
||||||
memberCopy,
|
memberCopy,
|
||||||
|
|
||||||
workingGroupEditAccount
|
workingGroupEditAccount,
|
||||||
|
getAllDraftProjects
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,6 +63,7 @@
|
|||||||
<div class="table-operator">
|
<div class="table-operator">
|
||||||
<a-button type="primary" icon="plus" @click="handleAdd" v-has="'draftingGroup:add'">新增</a-button>
|
<a-button type="primary" icon="plus" @click="handleAdd" v-has="'draftingGroup:add'">新增</a-button>
|
||||||
<a-button type="danger" icon="delete" @click="batchDel" v-has="'draftingGroup:batchDel'">批量删除</a-button>
|
<a-button type="danger" icon="delete" @click="batchDel" v-has="'draftingGroup:batchDel'">批量删除</a-button>
|
||||||
|
<a-button type="primary" icon="plus" @click="handleBatchAddMemberUnit" v-has="'draftingGroupMember:batchAdd'">批量新增成员单位</a-button>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<!-- /操作按钮区域-end-->
|
<!-- /操作按钮区域-end-->
|
||||||
@@ -112,6 +113,8 @@
|
|||||||
<!-- /table表格区域-->
|
<!-- /table表格区域-->
|
||||||
<drafting-group-module ref="modalForm" @ok="modalFormOk"></drafting-group-module>
|
<drafting-group-module ref="modalForm" @ok="modalFormOk"></drafting-group-module>
|
||||||
</a-card>
|
</a-card>
|
||||||
|
<!-- 批量新增成员信息 -->
|
||||||
|
<drafting-group-member-unit-module ref="draftingGroupMemberUnitModule" @ok="modalFormOk" isBatchAdd/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -124,10 +127,11 @@ import IconDraftingGruop from '@/assets/imgs/icon/icon_drafting_group.png'
|
|||||||
import {copyDraftingGroup, getWorkingGroupList} from '../../api/incomePaymentsApi'
|
import {copyDraftingGroup, getWorkingGroupList} from '../../api/incomePaymentsApi'
|
||||||
import { getAction } from '../../api/manage'
|
import { getAction } from '../../api/manage'
|
||||||
import DraftingGroupModule from './modules/DraftingGroupModule'
|
import DraftingGroupModule from './modules/DraftingGroupModule'
|
||||||
|
import DraftingGroupMemberUnitModule from '@views/draftingGroup/modules/DraftingGroupMemberUnitModule'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'DraftingGroupManagement',
|
name: 'DraftingGroupManagement',
|
||||||
components: { JYearDate, DraftingGroupModule, SelectPrincipal, PageHeaderTitle },
|
components: {DraftingGroupMemberUnitModule, JYearDate, DraftingGroupModule, SelectPrincipal, PageHeaderTitle },
|
||||||
mixins: [JeroListMixin],
|
mixins: [JeroListMixin],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -194,6 +198,12 @@ export default {
|
|||||||
this.loadWorkingGroupList()
|
this.loadWorkingGroupList()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
// 批量新增成员信息
|
||||||
|
handleBatchAddMemberUnit () {
|
||||||
|
this.$refs.draftingGroupMemberUnitModule.add()
|
||||||
|
this.$refs.draftingGroupMemberUnitModule.title = '批量新增成员单位'
|
||||||
|
this.$refs.draftingGroupMemberUnitModule.disableSubmit = false
|
||||||
|
},
|
||||||
// 获取工作组下拉列表
|
// 获取工作组下拉列表
|
||||||
loadWorkingGroupList () {
|
loadWorkingGroupList () {
|
||||||
getWorkingGroupList().then(res => {
|
getWorkingGroupList().then(res => {
|
||||||
|
|||||||
@@ -10,23 +10,31 @@
|
|||||||
cancelText="关闭">
|
cancelText="关闭">
|
||||||
<a-spin :spinning="confirmLoading">
|
<a-spin :spinning="confirmLoading">
|
||||||
<a-form :form="form">
|
<a-form :form="form">
|
||||||
<a-row v-if="defaultChargeWay">
|
<!-- 批量添加时显示) -->
|
||||||
<a-col>
|
<template v-if="isBatchAdd && model.draftingGroupIdList && model.draftingGroupIdList.length > 0">
|
||||||
<a-form-item label="起草组项目" :labelCol="remarksLabelCol" :wrapperCol="remarksWrapperCol">
|
<a-row v-for="(_, index) in model.draftingGroupIdList" :key="index + ''">
|
||||||
<a-select
|
<a-col :xl="21" :sm="20">
|
||||||
placeholder="请选择起草组项目"
|
<a-form-item :label="`起草组${index + 1}`" :labelCol="remarksLabelCol" :wrapperCol="remarksWrapperCol">
|
||||||
show-search
|
<a-select
|
||||||
v-decorator="['draftingGroupId',validatorRules.draftingGroupId]"
|
:placeholder="`请选择起草组项目${index + 1}`"
|
||||||
:maxLength='50'
|
show-search
|
||||||
:filter-option="filterOption"
|
v-decorator="[`draftingGroupIdList[${index}]`, {rules: [{ required: index === 0, validator: index === 0 ? validateDraftingGroupRequired : validateDraftingGroup }],validateTrigger: 'change'}]"
|
||||||
>
|
:maxLength='50'
|
||||||
<a-select-option v-for="item in workingGroupList" :key="item.id" :value="item.id">
|
allowClear
|
||||||
{{ item.workingGroupProject }}
|
:filter-option="filterOption"
|
||||||
</a-select-option>
|
>
|
||||||
</a-select>
|
<a-select-option v-for="item in draftingGroupList" :key="item.id" :value="item.id">
|
||||||
</a-form-item>
|
{{ item.draftingGroupProject }}
|
||||||
</a-col>
|
</a-select-option>
|
||||||
</a-row>
|
</a-select>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :xl="3" :sm="4">
|
||||||
|
<a-button type="link" class="contact-btn" @click="handleAddDraftGroup(index)">添加</a-button>
|
||||||
|
<a-button type="link" class="contact-btn del-btn" @click="handleDelDraftGroup(index)">删除</a-button>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
</template>
|
||||||
<a-row>
|
<a-row>
|
||||||
<a-col>
|
<a-col>
|
||||||
<a-form-item label="成员单位" :labelCol="remarksLabelCol" :wrapperCol="remarksWrapperCol">
|
<a-form-item label="成员单位" :labelCol="remarksLabelCol" :wrapperCol="remarksWrapperCol">
|
||||||
@@ -104,7 +112,7 @@ import pick from 'lodash.pick'
|
|||||||
import { httpAction } from '@api/manage'
|
import { httpAction } from '@api/manage'
|
||||||
import CompanySelect from '@comp/company/CompanySelect'
|
import CompanySelect from '@comp/company/CompanySelect'
|
||||||
import SelectContacts from '@comp/company/SelectContacts'
|
import SelectContacts from '@comp/company/SelectContacts'
|
||||||
import { getWorkingGroupListByNotCompany } from '../../../api/incomePaymentsApi'
|
import {getAllDraftProjects, getWorkingGroupListByNotCompany} from '../../../api/incomePaymentsApi'
|
||||||
// import { isRepeat } from '../../../utils/util'
|
// import { isRepeat } from '../../../utils/util'
|
||||||
import { addZero } from '../../../utils/util'
|
import { addZero } from '../../../utils/util'
|
||||||
import { money } from '../../../utils/validate'
|
import { money } from '../../../utils/validate'
|
||||||
@@ -159,6 +167,12 @@ export default {
|
|||||||
type: Number,
|
type: Number,
|
||||||
requirded: false,
|
requirded: false,
|
||||||
default: null
|
default: null
|
||||||
|
},
|
||||||
|
// 是否批量添加
|
||||||
|
isBatchAdd: {
|
||||||
|
type: Boolean,
|
||||||
|
required: false,
|
||||||
|
default: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
@@ -239,7 +253,7 @@ export default {
|
|||||||
selectedMailContact: null, // 编辑时的邮寄联系人
|
selectedMailContact: null, // 编辑时的邮寄联系人
|
||||||
selectedChargeNotice: null, // 选中的收费通知号
|
selectedChargeNotice: null, // 选中的收费通知号
|
||||||
draftingGroupId: null,
|
draftingGroupId: null,
|
||||||
workingGroupList: [],
|
draftingGroupList: [],
|
||||||
disabledCompany: false, // 企业是否禁用
|
disabledCompany: false, // 企业是否禁用
|
||||||
isAssociatedContract: false, // 是否关联合同
|
isAssociatedContract: false, // 是否关联合同
|
||||||
// hasContactOne: false, // 是否选择联系人1
|
// hasContactOne: false, // 是否选择联系人1
|
||||||
@@ -247,7 +261,8 @@ export default {
|
|||||||
// hasContactThree: false, // 是否选择联系人3
|
// hasContactThree: false, // 是否选择联系人3
|
||||||
url: {
|
url: {
|
||||||
add: '/drafting/payDraftingGroupSubitem/add',
|
add: '/drafting/payDraftingGroupSubitem/add',
|
||||||
edit: '/drafting/payDraftingGroupSubitem/edit'
|
edit: '/drafting/payDraftingGroupSubitem/edit',
|
||||||
|
batchAdd: '/drafting/payDraftingGroupSubitem/batchAdd'
|
||||||
},
|
},
|
||||||
// 默认的联系人数据
|
// 默认的联系人数据
|
||||||
defaultPayWorkingGroupSubItemContact: {
|
defaultPayWorkingGroupSubItemContact: {
|
||||||
@@ -260,7 +275,15 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
addZero,
|
addZero,
|
||||||
add() {
|
add() {
|
||||||
this.edit({})
|
const obj = {}
|
||||||
|
// 判断是否批量添加(工作组管理-批量新增成员单位)
|
||||||
|
if (this.isBatchAdd) {
|
||||||
|
// 获取当前年的工作组列表
|
||||||
|
this.loadCurrentYearDraftingGroupList()
|
||||||
|
// 默认一个起草组
|
||||||
|
obj.draftingGroupIdList = [undefined]
|
||||||
|
}
|
||||||
|
this.edit(obj)
|
||||||
// 判断默认来款用途是否为合同(收入合同新增)
|
// 判断默认来款用途是否为合同(收入合同新增)
|
||||||
if (this.defaultChargeWay) {
|
if (this.defaultChargeWay) {
|
||||||
this.loadWorkingGroupList()
|
this.loadWorkingGroupList()
|
||||||
@@ -274,6 +297,20 @@ export default {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
* 获取当前年起草组列表
|
||||||
|
*/
|
||||||
|
loadCurrentYearDraftingGroupList() {
|
||||||
|
getAllDraftProjects({
|
||||||
|
year: new Date().getFullYear()
|
||||||
|
}).then(res => {
|
||||||
|
if (res.success) {
|
||||||
|
this.draftingGroupList = res.result
|
||||||
|
} else {
|
||||||
|
this.$message.warn(res.message)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
/**
|
/**
|
||||||
* 获取工作组列表
|
* 获取工作组列表
|
||||||
*/
|
*/
|
||||||
@@ -409,12 +446,19 @@ export default {
|
|||||||
let httpurl = ''
|
let httpurl = ''
|
||||||
let method = 'post'
|
let method = 'post'
|
||||||
if (!this.model.id) {
|
if (!this.model.id) {
|
||||||
httpurl += this.url.add
|
// 如果是批量添加,调用批量添加的接口
|
||||||
|
httpurl += this.isBatchAdd ? this.url.batchAdd : this.url.add
|
||||||
// 通过添加成员来的,默认状态为通过
|
// 通过添加成员来的,默认状态为通过
|
||||||
values.checkResult = 2
|
values.checkResult = 2
|
||||||
} else {
|
} else {
|
||||||
httpurl += this.url.edit
|
httpurl += this.url.edit
|
||||||
}
|
}
|
||||||
|
// 批量添加
|
||||||
|
if (Array.isArray(values.draftingGroupIdList)) {
|
||||||
|
// 过滤空
|
||||||
|
values.draftingGroupIdList = values.draftingGroupIdList.filter(item => !!item)
|
||||||
|
values.draftingGroupIds = values.draftingGroupIdList.join(',')
|
||||||
|
}
|
||||||
if (this.draftingGroupId) {
|
if (this.draftingGroupId) {
|
||||||
values.draftingGroupId = this.draftingGroupId
|
values.draftingGroupId = this.draftingGroupId
|
||||||
}
|
}
|
||||||
@@ -535,6 +579,59 @@ export default {
|
|||||||
}
|
}
|
||||||
callback()
|
callback()
|
||||||
},
|
},
|
||||||
|
validateDraftingGroupRequired(rule, value, callback) {
|
||||||
|
if (value) {
|
||||||
|
callback()
|
||||||
|
}
|
||||||
|
callback('请选择起草组1')
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 校验工作组是否重复
|
||||||
|
* @param rule
|
||||||
|
* @param value
|
||||||
|
* @param callback
|
||||||
|
*/
|
||||||
|
validateDraftingGroup(rule, value, callback) {
|
||||||
|
if (value) {
|
||||||
|
let draftingGroupIdList = this.form.getFieldValue('draftingGroupIdList')
|
||||||
|
let hasValueArr = draftingGroupIdList.filter(id => id === value)
|
||||||
|
if (hasValueArr.length <= 1) {
|
||||||
|
callback()
|
||||||
|
}
|
||||||
|
callback('请选择不同的起草组')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
callback()
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 添加起草组
|
||||||
|
* @param index
|
||||||
|
*/
|
||||||
|
handleAddDraftGroup (index) {
|
||||||
|
this.model.draftingGroupIdList.splice(index + 1, 0, undefined)
|
||||||
|
this.$forceUpdate()
|
||||||
|
let formData = this.form.getFieldValue('draftingGroupIdList')
|
||||||
|
formData.splice(index + 1, 0, undefined)
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.form.setFieldsValue({ draftingGroupIdList: formData })
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 删除起草组
|
||||||
|
* @param index
|
||||||
|
*/
|
||||||
|
handleDelDraftGroup (index) {
|
||||||
|
if (this.model.draftingGroupIdList.length === 1) {
|
||||||
|
this.$message.warn('最少需要一个起草组')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.model.draftingGroupIdList.splice(index, 1)
|
||||||
|
let formData = this.form.getFieldValue('draftingGroupIdList')
|
||||||
|
formData.splice(index, 1)
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.form.setFieldsValue({ draftingGroupIdList: formData })
|
||||||
|
})
|
||||||
|
},
|
||||||
/**
|
/**
|
||||||
* 添加联系人
|
* 添加联系人
|
||||||
* @param index
|
* @param index
|
||||||
|
|||||||
@@ -28,14 +28,14 @@
|
|||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
<!-- 批量添加时显示) -->
|
<!-- 批量添加时显示) -->
|
||||||
<template v-if="isBatchAdd && model.workingGroupIds && model.workingGroupIds.length > 0">
|
<template v-if="isBatchAdd && model.workingGroupIdList && model.workingGroupIdList.length > 0">
|
||||||
<a-row v-for="(_, index) in model.workingGroupIds" :key="index + ''">
|
<a-row v-for="(_, index) in model.workingGroupIdList" :key="index + ''">
|
||||||
<a-col :xl="21" :sm="20">
|
<a-col :xl="21" :sm="20">
|
||||||
<a-form-item :label="`工作组${index + 1}`" :labelCol="remarksLabelCol" :wrapperCol="remarksWrapperCol">
|
<a-form-item :label="`工作组${index + 1}`" :labelCol="remarksLabelCol" :wrapperCol="remarksWrapperCol">
|
||||||
<a-select
|
<a-select
|
||||||
:placeholder="`请选择工作组项目${index + 1}`"
|
:placeholder="`请选择工作组项目${index + 1}`"
|
||||||
show-search
|
show-search
|
||||||
v-decorator="[`workingGroupIds[${index}]`, {rules: [{ required: index === 0, validator: index === 0 ? validateWorkingGroupRequired : validateWorkingGroup }],validateTrigger: 'change'}]"
|
v-decorator="[`workingGroupIdList[${index}]`, {rules: [{ required: index === 0, validator: index === 0 ? validateWorkingGroupRequired : validateWorkingGroup }],validateTrigger: 'change'}]"
|
||||||
:maxLength='50'
|
:maxLength='50'
|
||||||
allowClear
|
allowClear
|
||||||
:filter-option="filterOption"
|
:filter-option="filterOption"
|
||||||
@@ -604,7 +604,7 @@ export default {
|
|||||||
// 获取当前年的工作组列表
|
// 获取当前年的工作组列表
|
||||||
this.loadCurrentYearWorkingGroupList()
|
this.loadCurrentYearWorkingGroupList()
|
||||||
// 默认一个工作组
|
// 默认一个工作组
|
||||||
obj.workingGroupIds = [{}]
|
obj.workingGroupIdList = [undefined]
|
||||||
}
|
}
|
||||||
this.edit(obj)
|
this.edit(obj)
|
||||||
// 判断默认来款用途是否为合同(收入合同新增)
|
// 判断默认来款用途是否为合同(收入合同新增)
|
||||||
@@ -779,8 +779,10 @@ export default {
|
|||||||
values.workingGroupId = this.workingGroupId
|
values.workingGroupId = this.workingGroupId
|
||||||
}
|
}
|
||||||
// 批量添加
|
// 批量添加
|
||||||
if (Array.isArray(values.workingGroupIds)) {
|
if (Array.isArray(values.workingGroupIdList)) {
|
||||||
values.workingGroupIds = values.workingGroupIds.join(',')
|
// 过滤空
|
||||||
|
values.workingGroupIdList = values.workingGroupIdList.filter(item => !!item)
|
||||||
|
values.workingGroupIds = values.workingGroupIdList.join(',')
|
||||||
}
|
}
|
||||||
// 企业联系人信息中将没有值的去掉
|
// 企业联系人信息中将没有值的去掉
|
||||||
let haveValueContactArr = values.payWorkingGroupSubItemContactsList.filter(tt => tt.contactsId)
|
let haveValueContactArr = values.payWorkingGroupSubItemContactsList.filter(tt => tt.contactsId)
|
||||||
@@ -970,8 +972,8 @@ export default {
|
|||||||
*/
|
*/
|
||||||
validateWorkingGroup(rule, value, callback) {
|
validateWorkingGroup(rule, value, callback) {
|
||||||
if (value) {
|
if (value) {
|
||||||
let workingGroupIds = this.form.getFieldValue('workingGroupIds')
|
let workingGroupIdList = this.form.getFieldValue('workingGroupIdList')
|
||||||
let hasValueArr = workingGroupIds.filter(id => id === value)
|
let hasValueArr = workingGroupIdList.filter(id => id === value)
|
||||||
if (hasValueArr.length <= 1) {
|
if (hasValueArr.length <= 1) {
|
||||||
callback()
|
callback()
|
||||||
}
|
}
|
||||||
@@ -1051,12 +1053,12 @@ export default {
|
|||||||
* @param index
|
* @param index
|
||||||
*/
|
*/
|
||||||
handleAddWorkGroup (index) {
|
handleAddWorkGroup (index) {
|
||||||
this.model.workingGroupIds.splice(index + 1, 0, '')
|
this.model.workingGroupIdList.splice(index + 1, 0, undefined)
|
||||||
this.$forceUpdate()
|
this.$forceUpdate()
|
||||||
let formData = this.form.getFieldValue('workingGroupIds')
|
let formData = this.form.getFieldValue('workingGroupIdList')
|
||||||
formData.splice(index + 1, 0, '')
|
formData.splice(index + 1, 0, undefined)
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.form.setFieldsValue({ workingGroupIds: formData })
|
this.form.setFieldsValue({ workingGroupIdList: formData })
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
@@ -1064,15 +1066,15 @@ export default {
|
|||||||
* @param index
|
* @param index
|
||||||
*/
|
*/
|
||||||
handleDelWorkGroup (index) {
|
handleDelWorkGroup (index) {
|
||||||
if (this.model.workingGroupIds.length === 1) {
|
if (this.model.workingGroupIdList.length === 1) {
|
||||||
this.$message.warn('最少需要一个工作组')
|
this.$message.warn('最少需要一个工作组')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.model.workingGroupIds.splice(index, 1)
|
this.model.workingGroupIdList.splice(index, 1)
|
||||||
let formData = this.form.getFieldValue('workingGroupIds')
|
let formData = this.form.getFieldValue('workingGroupIdList')
|
||||||
formData.splice(index, 1)
|
formData.splice(index, 1)
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.form.setFieldsValue({ workingGroupIds: formData })
|
this.form.setFieldsValue({ workingGroupIdList: formData })
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user