【update】-普通项目-新增复制功能
This commit is contained in:
@@ -74,4 +74,10 @@ export const MeetingTypeEnums = {
|
||||
council: { name: '理事会会议', value: '6' },
|
||||
draftGroup: { name: '起草会会议', value: '7' },
|
||||
overseas: { name: '海外会议', value: '8' }
|
||||
}
|
||||
|
||||
export const OpeTypeEnums = {
|
||||
add: { name: '新增', value: 1 },
|
||||
copy: { name: '复制', value: 2 },
|
||||
edit: { name: '编辑', value: 3 }
|
||||
}
|
||||
@@ -140,6 +140,7 @@
|
||||
<span slot="action" class="action-span-cell" slot-scope="text, record">
|
||||
<!--如果是打包不能编辑-->
|
||||
<a @click="handleEdit(record)" v-has="'generalProject:edit'" :disabled="record.pack === 1">编辑</a>
|
||||
<a @click="handleCopy(record)" v-has="'generalProject:copy'">复制</a>
|
||||
<a @click="handleDelete(record.id)" v-has="'generalProject:delete'">删除</a>
|
||||
</span>
|
||||
</a-table>
|
||||
@@ -314,7 +315,13 @@ export default {
|
||||
}
|
||||
this.$refs.basicInfo = basicInfo
|
||||
this.$refs.projectDetail.open(record)
|
||||
}
|
||||
},
|
||||
// 复制功能
|
||||
handleCopy: function (record) {
|
||||
this.$refs.modalForm.copy(record)
|
||||
this.$refs.modalForm.title = '复制'
|
||||
this.$refs.modalForm.disableSubmit = false
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -255,6 +255,7 @@ import { money } from '../../../utils/validate'
|
||||
import { checkAssociatedProject } from '../../../utils/projectCheck'
|
||||
import SelectRevenueContract from '../../../components/tools/SelectRevenueContract'
|
||||
import JMonthDate from '@/components/tools/JMonthDate'
|
||||
import { OpeTypeEnums } from '../../../enums/commonEnums'
|
||||
|
||||
export default {
|
||||
name: 'GeneralProjectModule',
|
||||
@@ -406,6 +407,7 @@ export default {
|
||||
selectedMailContact: null, // 编辑时的邮寄联系人
|
||||
disabledCompany: false, // 企业是否可以编辑
|
||||
isAssociatedContract: false, // 是否已关联合同
|
||||
opeType: OpeTypeEnums.add.value, // 操作类型
|
||||
url: {
|
||||
add: '/project/payCommonProject/add',
|
||||
edit: '/project/payCommonProject/edit'
|
||||
@@ -415,6 +417,7 @@ export default {
|
||||
methods: {
|
||||
addZero,
|
||||
add() {
|
||||
this.opeType = OpeTypeEnums.add.value
|
||||
this.edit({})
|
||||
if (this.defaultChargeWay === 2) {
|
||||
this.chargeWayType = 2
|
||||
@@ -426,6 +429,13 @@ export default {
|
||||
})
|
||||
}
|
||||
},
|
||||
copy(record) {
|
||||
this.opeType = OpeTypeEnums.copy.value
|
||||
let params = {...record}
|
||||
delete params.id
|
||||
console.log('------params-------', params)
|
||||
this.edit(params)
|
||||
},
|
||||
edit(record) {
|
||||
if (this.defaultChargeCompany.hasOwnProperty.call(this.defaultChargeCompany, 'id')) {
|
||||
record.chargeCompany = {
|
||||
@@ -456,7 +466,7 @@ export default {
|
||||
record.contractNum = record.contractNum || undefined
|
||||
this.form.resetFields()
|
||||
this.model = Object.assign({}, record)
|
||||
if (this.model.id) {
|
||||
if (this.model.id || this.opeType === OpeTypeEnums.copy.value) {
|
||||
this.selectedContact = {
|
||||
id: this.model.contactsTemporaryId,
|
||||
name: this.model.contactsTemporaryName
|
||||
|
||||
Reference in New Issue
Block a user