update 工作组-增加是否收费相关功能

This commit is contained in:
danshihao
2024-03-05 17:47:14 +08:00
parent 9785b08a13
commit 3bc7a8b081
4 changed files with 283 additions and 251 deletions
+5
View File
@@ -50,3 +50,8 @@ export const IncomeMethod = {
noticeOfCharge: { name: '收费通知', value: '3'}, noticeOfCharge: { name: '收费通知', value: '3'},
} }
// 是否
export const YesOrNoEnums = {
yes: { name: '是', value: '1'},
no: { name: '否', value: '0'},
}
@@ -213,6 +213,7 @@ import PreviewFile from '../../components/jero/PreviewFile'
import EmailErrorMsgModal from './modules/EmailErrorMsgModal' import EmailErrorMsgModal from './modules/EmailErrorMsgModal'
import WorkGroupSetLabel from './modules/WorkGroupSetLabel' import WorkGroupSetLabel from './modules/WorkGroupSetLabel'
import { formatMoney } from '../../utils/formatMoney' import { formatMoney } from '../../utils/formatMoney'
import {YesOrNoEnums} from '@/enums/commonEnums'
// eslint-disable-next-line no-undef,no-unused-vars // eslint-disable-next-line no-undef,no-unused-vars
const Base64 = require('js-base64').Base64 const Base64 = require('js-base64').Base64
@@ -451,6 +452,8 @@ export default {
this.getChargeNoticeList() this.getChargeNoticeList()
this.$refs.modalForm.workingGroupId = this.workingGroupProjectId this.$refs.modalForm.workingGroupId = this.workingGroupProjectId
this.$refs.modalForm.chargeNoticeList = this.chargeNoticeList this.$refs.modalForm.chargeNoticeList = this.chargeNoticeList
// 是否显示金额字段
this.$refs.modalForm.showPayField = (this.workingGroupDetail.payFlag + '') !== YesOrNoEnums.no.value
this.$refs.modalForm.add() this.$refs.modalForm.add()
this.$refs.modalForm.title = '添加成员' this.$refs.modalForm.title = '添加成员'
this.$refs.modalForm.disableSubmit = false this.$refs.modalForm.disableSubmit = false
@@ -459,6 +462,8 @@ export default {
this.getChargeNoticeList() this.getChargeNoticeList()
this.$refs.modalForm.workingGroupId = this.workingGroupProjectId this.$refs.modalForm.workingGroupId = this.workingGroupProjectId
this.$refs.modalForm.chargeNoticeList = this.chargeNoticeList this.$refs.modalForm.chargeNoticeList = this.chargeNoticeList
// 是否显示金额字段
this.$refs.modalForm.showPayField = (this.workingGroupDetail.payFlag + '') !== YesOrNoEnums.no.value
this.$refs.modalForm.edit(record) this.$refs.modalForm.edit(record)
this.$refs.modalForm.title = '编辑' this.$refs.modalForm.title = '编辑'
this.$refs.modalForm.disableSubmit = false this.$refs.modalForm.disableSubmit = false
@@ -128,6 +128,7 @@
<!-- <a-button type="link" class="contact-btn del-btn">删除</a-button>--> <!-- <a-button type="link" class="contact-btn del-btn">删除</a-button>-->
<!-- </a-col>--> <!-- </a-col>-->
<!-- </a-row>--> <!-- </a-row>-->
<template v-if="showPayField">
<a-row> <a-row>
<a-col :xl="12" :sm="24"> <a-col :xl="12" :sm="24">
<a-form-item label="邮寄联系人" :labelCol="labelCol" :wrapperCol="wrapperCol"> <a-form-item label="邮寄联系人" :labelCol="labelCol" :wrapperCol="wrapperCol">
@@ -373,6 +374,7 @@
</a-form-item> </a-form-item>
</a-col> </a-col>
</a-row> </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">
@@ -545,6 +547,7 @@ export default {
// hasContactOne: false, // 是否选择联系人1 // hasContactOne: false, // 是否选择联系人1
// hasContactTwo: false, // 是否选择联系人2 // hasContactTwo: false, // 是否选择联系人2
// hasContactThree: false, // 是否选择联系人3 // hasContactThree: false, // 是否选择联系人3
showPayField: '', // 是否收费,控制收费字段是否显示
url: { url: {
add: '/project/payWorkingGroupSubitem/add', add: '/project/payWorkingGroupSubitem/add',
edit: '/project/payWorkingGroupSubitem/edit' edit: '/project/payWorkingGroupSubitem/edit'
@@ -907,7 +910,10 @@ export default {
if (this.model.payWorkingGroupSubItemContactsList[index].contactsId !== value) { if (this.model.payWorkingGroupSubItemContactsList[index].contactsId !== value) {
formData[index].remarks = null formData[index].remarks = null
} }
let mailContact = Object.values(this.form.getFieldValue(['mailContactsId']))[0] // 是否收费为否不显示邮寄联系人
let mailContactsId = this.form.getFieldValue(['mailContactsId'])
if (mailContactsId) {
let mailContact = Object.values(mailContactsId)[0]
// 邮寄联系人非undefined时赋值 // 邮寄联系人非undefined时赋值
if (!mailContact && index === 0) { if (!mailContact && index === 0) {
this.model.mailContactsId = value this.model.mailContactsId = value
@@ -916,6 +922,7 @@ export default {
}) })
} }
} }
}
this.$nextTick(() => { this.$nextTick(() => {
this.form.setFieldsValue({ payWorkingGroupSubItemContactsList: formData }) this.form.setFieldsValue({ payWorkingGroupSubItemContactsList: formData })
this.form.validateFields(['payWorkingGroupSubItemContactsList']) this.form.validateFields(['payWorkingGroupSubItemContactsList'])
@@ -31,6 +31,12 @@
v-decorator="['year',validatorRules.year]"></j-year-date> v-decorator="['year',validatorRules.year]"></j-year-date>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="12">
<a-form-item label="是否收费" :labelCol="labelCol" :wrapperCol="wrapperCol">
<j-dict-select-tag placeholder="请选择是否收费" dict-code="yn" :trigger-change="true" type="radio"
v-decorator="['payFlag',validatorRules.payFlag]"></j-dict-select-tag>
</a-form-item>
</a-col>
</a-row> </a-row>
<a-row> <a-row>
<a-col :span="12"> <a-col :span="12">
@@ -176,6 +182,7 @@ import SelectPrincipal from '@comp/company/SelectPrincipal'
import { isRepeat } from '../../../utils/util' import { isRepeat } from '../../../utils/util'
import { money } from '../../../utils/validate' import { money } from '../../../utils/validate'
import { addZero } from '../../../utils/util' import { addZero } from '../../../utils/util'
import {YesOrNoEnums} from '@/enums/commonEnums'
export default { export default {
name: 'WorkingGroupProjectModule', name: 'WorkingGroupProjectModule',
@@ -213,6 +220,10 @@ export default {
rules: [{ required: true, message: '请选择运行年份' }], rules: [{ required: true, message: '请选择运行年份' }],
validateTrigger: 'change' validateTrigger: 'change'
}, },
payFlag: {
rules: [{ required: true, message: '请选择是否收费' }],
validateTrigger: 'change'
},
principalIdA: { principalIdA: {
rules: [{ required: true, validator: this.validatePrincipal }], rules: [{ required: true, validator: this.validatePrincipal }],
validateTrigger: 'change' validateTrigger: 'change'
@@ -245,9 +256,13 @@ export default {
this.model = Object.assign({}, record) this.model = Object.assign({}, record)
this.visible = true this.visible = true
this.$nextTick(() => { this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model, 'workingGroupProject', 'year', 'principalIdA', 'principalIdB', 'convokeNum', 'operationCycle', 'yearChargeA', 'chargeNoticeNoA', 'chargeNoticeAId', 'yearChargeB', 'chargeNoticeNoB', 'chargeNoticeBId', 'missionAndObjectives', 'remarks')) this.form.setFieldsValue(pick(this.model, 'workingGroupProject', 'year', 'payFlag', 'principalIdA', 'principalIdB', 'convokeNum', 'operationCycle', 'yearChargeA', 'chargeNoticeNoA', 'chargeNoticeAId', 'yearChargeB', 'chargeNoticeNoB', 'chargeNoticeBId', 'missionAndObjectives', 'remarks'))
if (!this.model.id) { if (!this.model.id) {
this.form.setFieldsValue({'year': (new Date().getFullYear()).toString()}) this.form.setFieldsValue({
'year': (new Date().getFullYear()).toString(),
// 是否收费默认是
payFlag: YesOrNoEnums.yes.value
})
} }
}) })
}, },