|
@@ -842,36 +842,105 @@
|
|
|
})
|
|
|
}, */
|
|
|
// 表单提交
|
|
|
- doSubmit (status, callback) {
|
|
|
- if (status === 'save') {
|
|
|
- console.log('save111111')
|
|
|
- // 暂存
|
|
|
- this.inputForm.status = '5'
|
|
|
- this.loading = true
|
|
|
+ async doSubmit (status, callback) {
|
|
|
+ if (this.$refs.enclosure.checkProgress()) {
|
|
|
+ this.loading = false
|
|
|
+ throw new Error()
|
|
|
+ } else {
|
|
|
+ if (status === 'save') {
|
|
|
+ console.log('save111111')
|
|
|
+ // 暂存
|
|
|
+ this.inputForm.status = '5'
|
|
|
+ this.loading = true
|
|
|
+ this.$refs['inputForm'].validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ this.loading = true
|
|
|
+ let _this = this
|
|
|
+ let _num = 0
|
|
|
+ const wait = function () {
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
+ if (_this.commonJS.isNotEmpty(_this.inputForm.signatureAnnotator1) &&
|
|
|
+ _this.commonJS.isEmpty(_this.inputForm.signatureAnnotator2) &&
|
|
|
+ _this.inputForm.signatureAnnotator1 !== _this.inputForm.projectMasterId1 &&
|
|
|
+ _this.inputForm.signatureAnnotator1 !== _this.inputForm.projectMasterId2) {
|
|
|
+ _this.$message.error('签字注师1和签字注师2至少有一个与项目经理相同')
|
|
|
+ _num = 1
|
|
|
+ _this.loading = false
|
|
|
+ }
|
|
|
+ if (_this.commonJS.isNotEmpty(_this.inputForm.signatureAnnotator2) &&
|
|
|
+ _this.commonJS.isEmpty(_this.inputForm.signatureAnnotator1) &&
|
|
|
+ _this.inputForm.signatureAnnotator2 !== _this.inputForm.projectMasterId1 &&
|
|
|
+ _this.inputForm.signatureAnnotator2 !== _this.inputForm.projectMasterId2) {
|
|
|
+ _this.$message.error('签字注师1和签字注师2至少有一个与项目经理相同')
|
|
|
+ _num = 1
|
|
|
+ _this.loading = false
|
|
|
+ }
|
|
|
+ _this.inputForm.cwFileInfoList2 = _this.$refs.enclosure.getDataList()
|
|
|
+ // _this.$refs.archiveFile.getDataList().then((data) => {
|
|
|
+ // _this.inputForm.cwFileInfoList = data
|
|
|
+ // if (_this.commonJS.isNotEmpty(_this.inputForm.cwFileInfoList)) {
|
|
|
+ // _this.inputForm.cwFileInfoList.forEach((item, index) => {
|
|
|
+ // if (_this.commonJS.isEmpty(item.fileType)) {
|
|
|
+ // _this.$message.error('签章文件中,第' + (index + 1) + '条数据的“文件类型”未填写')
|
|
|
+ // _num = 1
|
|
|
+ // _this.loading = false
|
|
|
+ // throw new Error('签章文件中,第' + (index + 1) + '条数据的“文件类型”未填写')
|
|
|
+ // } else if (_this.commonJS.isEmpty(item.sealType)) {
|
|
|
+ // _this.$message.error('签章文件中,第' + (index + 1) + '条数据的“盖章类型”未填写')
|
|
|
+ // _num = 1
|
|
|
+ // _this.loading = false
|
|
|
+ // throw new Error('签章文件中,第' + (index + 1) + '条数据的“盖章类型”未填写')
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // } else {
|
|
|
+ // _this.$message.error('最少有一条签章文件数据!')
|
|
|
+ // _num = 1
|
|
|
+ // _this.loading = false
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ resolve()
|
|
|
+ })
|
|
|
+ }
|
|
|
+ wait().then(() => {
|
|
|
+ if (_num !== 1) {
|
|
|
+ if (this.commonJS.isEmpty(this.inputForm.createDate)) {
|
|
|
+ this.inputForm.createDate = this.moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
|
|
|
+ }
|
|
|
+ this.projectReportService.saveForm(this.inputForm).then(({data}) => {
|
|
|
+ this.$emit('refreshList')
|
|
|
+ callback(data.businessTable, data.businessId, this.inputForm)
|
|
|
+ this.close()
|
|
|
+ this.loading = false
|
|
|
+ }).catch(() => {
|
|
|
+ this.close()
|
|
|
+ this.loading = false
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.loading = false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ return
|
|
|
+ } else if (status === 'start') {
|
|
|
+ // 送审 待审核
|
|
|
+ this.inputForm.status = '2'
|
|
|
+ } else if (status === 'agree') {
|
|
|
+ // 审核同意
|
|
|
+ this.inputForm.agreeDate = this.moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
|
|
|
+ this.inputForm.agreeUserId = this.$store.state.user.id
|
|
|
+ this.inputForm.status = '5'
|
|
|
+ } else if (status === 'reapply') {
|
|
|
+ this.inputForm.status = '2'
|
|
|
+ }
|
|
|
this.$refs['inputForm'].validate((valid) => {
|
|
|
if (valid) {
|
|
|
this.loading = true
|
|
|
+ // eslint-disable-next-line no-unused-vars
|
|
|
let _this = this
|
|
|
let _num = 0
|
|
|
const wait = function () {
|
|
|
return new Promise((resolve, reject) => {
|
|
|
- if (_this.commonJS.isNotEmpty(_this.inputForm.signatureAnnotator1) &&
|
|
|
- _this.commonJS.isEmpty(_this.inputForm.signatureAnnotator2) &&
|
|
|
- _this.inputForm.signatureAnnotator1 !== _this.inputForm.projectMasterId1 &&
|
|
|
- _this.inputForm.signatureAnnotator1 !== _this.inputForm.projectMasterId2) {
|
|
|
- _this.$message.error('签字注师1和签字注师2至少有一个与项目经理相同')
|
|
|
- _num = 1
|
|
|
- _this.loading = false
|
|
|
- }
|
|
|
- if (_this.commonJS.isNotEmpty(_this.inputForm.signatureAnnotator2) &&
|
|
|
- _this.commonJS.isEmpty(_this.inputForm.signatureAnnotator1) &&
|
|
|
- _this.inputForm.signatureAnnotator2 !== _this.inputForm.projectMasterId1 &&
|
|
|
- _this.inputForm.signatureAnnotator2 !== _this.inputForm.projectMasterId2) {
|
|
|
- _this.$message.error('签字注师1和签字注师2至少有一个与项目经理相同')
|
|
|
- _num = 1
|
|
|
- _this.loading = false
|
|
|
- }
|
|
|
- _this.inputForm.cwFileInfoList2 = _this.$refs.enclosure.getDataList()
|
|
|
// _this.$refs.archiveFile.getDataList().then((data) => {
|
|
|
// _this.inputForm.cwFileInfoList = data
|
|
|
// if (_this.commonJS.isNotEmpty(_this.inputForm.cwFileInfoList)) {
|
|
@@ -903,81 +972,17 @@
|
|
|
this.inputForm.createDate = this.moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
|
|
|
}
|
|
|
this.projectReportService.saveForm(this.inputForm).then(({data}) => {
|
|
|
- this.$emit('refreshList')
|
|
|
callback(data.businessTable, data.businessId, this.inputForm)
|
|
|
- this.close()
|
|
|
+ this.$emit('refreshList')
|
|
|
this.loading = false
|
|
|
}).catch(() => {
|
|
|
- this.close()
|
|
|
this.loading = false
|
|
|
})
|
|
|
}
|
|
|
})
|
|
|
- } else {
|
|
|
- this.loading = false
|
|
|
}
|
|
|
})
|
|
|
- return
|
|
|
- } else if (status === 'start') {
|
|
|
- // 送审 待审核
|
|
|
- this.inputForm.status = '2'
|
|
|
- } else if (status === 'agree') {
|
|
|
- // 审核同意
|
|
|
- this.inputForm.agreeDate = this.moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
|
|
|
- this.inputForm.agreeUserId = this.$store.state.user.id
|
|
|
- this.inputForm.status = '5'
|
|
|
- } else if (status === 'reapply') {
|
|
|
- this.inputForm.status = '2'
|
|
|
}
|
|
|
- this.$refs['inputForm'].validate((valid) => {
|
|
|
- if (valid) {
|
|
|
- this.loading = true
|
|
|
- // eslint-disable-next-line no-unused-vars
|
|
|
- let _this = this
|
|
|
- let _num = 0
|
|
|
- const wait = function () {
|
|
|
- return new Promise((resolve, reject) => {
|
|
|
- // _this.$refs.archiveFile.getDataList().then((data) => {
|
|
|
- // _this.inputForm.cwFileInfoList = data
|
|
|
- // if (_this.commonJS.isNotEmpty(_this.inputForm.cwFileInfoList)) {
|
|
|
- // _this.inputForm.cwFileInfoList.forEach((item, index) => {
|
|
|
- // if (_this.commonJS.isEmpty(item.fileType)) {
|
|
|
- // _this.$message.error('签章文件中,第' + (index + 1) + '条数据的“文件类型”未填写')
|
|
|
- // _num = 1
|
|
|
- // _this.loading = false
|
|
|
- // throw new Error('签章文件中,第' + (index + 1) + '条数据的“文件类型”未填写')
|
|
|
- // } else if (_this.commonJS.isEmpty(item.sealType)) {
|
|
|
- // _this.$message.error('签章文件中,第' + (index + 1) + '条数据的“盖章类型”未填写')
|
|
|
- // _num = 1
|
|
|
- // _this.loading = false
|
|
|
- // throw new Error('签章文件中,第' + (index + 1) + '条数据的“盖章类型”未填写')
|
|
|
- // }
|
|
|
- // })
|
|
|
- // } else {
|
|
|
- // _this.$message.error('最少有一条签章文件数据!')
|
|
|
- // _num = 1
|
|
|
- // _this.loading = false
|
|
|
- // }
|
|
|
- // })
|
|
|
- resolve()
|
|
|
- })
|
|
|
- }
|
|
|
- wait().then(() => {
|
|
|
- if (_num !== 1) {
|
|
|
- if (this.commonJS.isEmpty(this.inputForm.createDate)) {
|
|
|
- this.inputForm.createDate = this.moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
|
|
|
- }
|
|
|
- this.projectReportService.saveForm(this.inputForm).then(({data}) => {
|
|
|
- callback(data.businessTable, data.businessId, this.inputForm)
|
|
|
- this.$emit('refreshList')
|
|
|
- this.loading = false
|
|
|
- }).catch(() => {
|
|
|
- this.loading = false
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
},
|
|
|
/* async updateStatusById (type, callback) {
|
|
|
if (await this.$refs.archiveFile.checkProgress()) {
|