|
@@ -258,6 +258,8 @@
|
|
|
import ProjectRecordsChooseCom from '@/views/modules/cw/projectRecords/ProjectRecordsChooseCom'
|
|
|
import WorkClientChooseByProjectCom from '@/views/modules/cw/projectReportArchive/WorkClientChooseByProjectCom'
|
|
|
import ReportChooseByProjectCom from '@/views/modules/cw/projectReportArchive/ReportChooseByProjectCom'
|
|
|
+ import OfficeService from '@/api/sys/OfficeService'
|
|
|
+ import ProcessService from '@/api/flowable/ProcessService'
|
|
|
export default {
|
|
|
props: {
|
|
|
businessId: {
|
|
@@ -326,7 +328,11 @@
|
|
|
signatureAnnotator2Name: '',
|
|
|
reportCreateName: '',
|
|
|
reportId: '',
|
|
|
- reportRemarks: ''
|
|
|
+ reportRemarks: '',
|
|
|
+ procDefId: '',
|
|
|
+ procDefKey: '',
|
|
|
+ formTitle: '',
|
|
|
+ title: ''
|
|
|
},
|
|
|
keyWatch: '',
|
|
|
activeName: 'files',
|
|
@@ -335,9 +341,13 @@
|
|
|
},
|
|
|
projectRecordsService: null,
|
|
|
projectReportArchiveService: null,
|
|
|
+ officeService: null,
|
|
|
+ processService: null,
|
|
|
created () {
|
|
|
this.projectRecordsService = new ProjectRecordsService()
|
|
|
this.projectReportArchiveService = new ProjectReportArchiveService()
|
|
|
+ this.officeService = new OfficeService()
|
|
|
+ this.processService = new ProcessService()
|
|
|
},
|
|
|
computed: {
|
|
|
bus: {
|
|
@@ -436,7 +446,11 @@
|
|
|
signatureAnnotator2Name: '',
|
|
|
reportCreateName: '',
|
|
|
reportId: '',
|
|
|
- reportRemarks: ''
|
|
|
+ reportRemarks: '',
|
|
|
+ procDefId: '',
|
|
|
+ procDefKey: '',
|
|
|
+ formTitle: '',
|
|
|
+ title: ''
|
|
|
}
|
|
|
this.inputForm.id = id
|
|
|
this.loading = false
|
|
@@ -557,41 +571,67 @@
|
|
|
this.loading = false
|
|
|
throw new Error()
|
|
|
} else {
|
|
|
- let _this = this
|
|
|
- const wait = function () {
|
|
|
- return new Promise(async (resolve, reject) => {
|
|
|
- if (status === 'agree') {
|
|
|
- // 审核同意
|
|
|
- _this.inputForm.auditDate = _this.moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
|
|
|
- // this.inputForm.agreeUserId = this.$store.state.user.id
|
|
|
- _this.inputForm.status = '5'
|
|
|
- if (_this.inputForm.isNumber !== _this.inputForm.number) {
|
|
|
- _this.$message.error('“案卷号”与“确认案卷号”不一致,请重新填写')
|
|
|
- _this.loading = false
|
|
|
- throw new Error('“案卷号”与“确认案卷号”不一致,请重新填写')
|
|
|
- }
|
|
|
- }
|
|
|
- await _this.$refs.uploadComponent.getDataList().then((list) => {
|
|
|
- // list为返回数据
|
|
|
- _this.inputForm.workAttachmentDtoList = list
|
|
|
- list.forEach(item => {
|
|
|
- if (_this.commonJS.isEmpty(item.fileType)) {
|
|
|
- _this.$message.error('附件中的文件类型不可以为空')
|
|
|
- _this.loading = false
|
|
|
- throw new Error('附件中的文件类型不可以为空')
|
|
|
- }
|
|
|
- })
|
|
|
- })
|
|
|
- if (_this.commonJS.isEmpty(_this.inputForm.createDate)) {
|
|
|
- _this.inputForm.createDate = _this.moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
|
|
|
+ if (status === 'agree') {
|
|
|
+ // 审核同意
|
|
|
+ this.inputForm.auditDate = this.moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
|
|
|
+ // this.inputForm.agreeUserId = this.$store.state.user.id
|
|
|
+ this.inputForm.status = '5'
|
|
|
+ if (this.inputForm.isNumber !== this.inputForm.number) {
|
|
|
+ this.$message.error('“案卷号”与“确认案卷号”不一致,请重新填写')
|
|
|
+ this.loading = false
|
|
|
+ throw new Error('“案卷号”与“确认案卷号”不一致,请重新填写')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (this.commonJS.isEmpty(this.inputForm.createDate)) {
|
|
|
+ this.inputForm.createDate = this.moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
|
|
|
+ }
|
|
|
+ this.$refs.uploadComponent.getDataList().then((list) => {
|
|
|
+ // list为返回数据
|
|
|
+ this.inputForm.workAttachmentDtoList = list
|
|
|
+ list.forEach(item => {
|
|
|
+ if (this.commonJS.isEmpty(item.fileType)) {
|
|
|
+ this.$message.error('附件中的文件类型不可以为空')
|
|
|
+ this.loading = false
|
|
|
+ throw new Error('附件中的文件类型不可以为空')
|
|
|
}
|
|
|
- resolve()
|
|
|
})
|
|
|
- }
|
|
|
- wait().then(() => {
|
|
|
- this.projectReportArchiveService.saveForm(this.inputForm).then(({data}) => {
|
|
|
- callback(data.businessTable, data.businessId, this.inputForm)
|
|
|
- this.loading = false
|
|
|
+ this.projectReportArchiveService.saveForm(this.inputForm).then((saveDate) => {
|
|
|
+ this.officeService.queryById(this.$store.state.user.office.id).then((byId) => {
|
|
|
+ // 判断当前人的所属部门是否为苏州分部,根据部门的机构编码(szfb)来判断是不是苏州分部
|
|
|
+ if (byId.data.code === 'szfb') { // 当前人的所属部门为苏州分部
|
|
|
+ this.processService.getByName('会计-项目报告归档-苏州分部').then(({data}) => {
|
|
|
+ if (!this.commonJS.isEmpty(data.id)) {
|
|
|
+ if (status === 'start' || status === 'reapply') {
|
|
|
+ if (status === 'start') {
|
|
|
+ this.inputForm.procDefId = data.id
|
|
|
+ this.inputForm.procDefKey = data.key
|
|
|
+ }
|
|
|
+ let processTitle = `${this.$store.state.user.name} 发起了 ${this.inputForm.reportNo} - ${this.inputForm.cwProjectRecordsDTO.projectName} ` + `[会计-项目报告归档-苏州分部]`
|
|
|
+ this.inputForm.formTitle = processTitle
|
|
|
+ this.inputForm.title = `发起流程【会计-项目报告归档-苏州分部】`
|
|
|
+ }
|
|
|
+ callback(saveDate.data.businessTable, saveDate.data.businessId, this.inputForm)
|
|
|
+ this.loading = false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.processService.getByName('会计-项目报告归档').then(({data}) => {
|
|
|
+ if (!this.commonJS.isEmpty(data.id)) {
|
|
|
+ if (status === 'start' || status === 'reapply') {
|
|
|
+ if (status === 'start') {
|
|
|
+ this.inputForm.procDefId = data.id
|
|
|
+ this.inputForm.procDefKey = data.key
|
|
|
+ }
|
|
|
+ let processTitle = `${this.$store.state.user.name} 发起了 ${this.inputForm.reportNo} - ${this.inputForm.cwProjectRecordsDTO.projectName} ` + `[会计-项目报告归档]`
|
|
|
+ this.inputForm.formTitle = processTitle
|
|
|
+ this.inputForm.title = `发起流程【会计-项目报告归档】`
|
|
|
+ }
|
|
|
+ callback(saveDate.data.businessTable, saveDate.data.businessId, this.inputForm)
|
|
|
+ this.loading = false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
}).catch(() => {
|
|
|
this.loading = false
|
|
|
throw new Error()
|
|
@@ -726,7 +766,11 @@
|
|
|
signatureAnnotator2Name: '',
|
|
|
reportCreateName: '',
|
|
|
reportId: '',
|
|
|
- reportRemarks: ''
|
|
|
+ reportRemarks: '',
|
|
|
+ procDefId: '',
|
|
|
+ procDefKey: '',
|
|
|
+ formTitle: '',
|
|
|
+ title: ''
|
|
|
}
|
|
|
this.$refs.uploadComponent.clearUpload()
|
|
|
this.$refs.inputForm.resetFields()
|