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