|
|
@@ -243,6 +243,7 @@ import processService from '@/api/flowable/processService'
|
|
|
// import MaterialManagementService from '@/api/materialManagement/MaterialManagementService'
|
|
|
//import MaterialManagementDialog from '../../../'
|
|
|
import userService from '@/api/sys/UserService'
|
|
|
+import ProjectRecordsService from '@/api/cw/projectRecords/ProjectRecordsService'
|
|
|
import ReimbursementComponent from '@/views/common/reimbursement/ReimbursementComponentTest.vue'
|
|
|
import ReimbursementImage from '@/views/common/reimbursement/ReimbursementImage.vue'
|
|
|
import { zsInfo } from "@/utils/businessInfo";
|
|
|
@@ -545,6 +546,77 @@ export default {
|
|
|
if (this.commonJS.isEmpty(this.inputForm.reimbursementType)) {
|
|
|
this.inputForm.reimbursementType = '1'
|
|
|
}
|
|
|
+ // 确保所有详情行的 reimbursementType 和 uniqueId 字段已填充,避免展开行无法显示文件
|
|
|
+ if (this.commonJS.isNotEmpty(this.inputForm.detailInfoReports)) {
|
|
|
+ this.inputForm.detailInfoReports.forEach(item => {
|
|
|
+ if (this.commonJS.isEmpty(item.reimbursementType)) {
|
|
|
+ item.reimbursementType = this.inputForm.reimbursementType
|
|
|
+ }
|
|
|
+ if (this.commonJS.isEmpty(item.uniqueId)) {
|
|
|
+ item.uniqueId = item.id || ('gen_' + Math.random().toString(36).substr(2, 9))
|
|
|
+ }
|
|
|
+ })
|
|
|
+ // 兜底:如果 projectName 为空但 projectId 存在,通过接口查询补充
|
|
|
+ this.inputForm.detailInfoReports.forEach(item => {
|
|
|
+ if (this.commonJS.isEmpty(item.projectName) && this.commonJS.isNotEmpty(item.projectId)) {
|
|
|
+ ProjectRecordsService.queryById(item.projectId).then(data => {
|
|
|
+ if (data && data.projectName) {
|
|
|
+ item.projectName = data.projectName
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if (this.commonJS.isNotEmpty(this.inputForm.detailInfoOthers)) {
|
|
|
+ this.inputForm.detailInfoOthers.forEach(item => {
|
|
|
+ if (this.commonJS.isEmpty(item.reimbursementType)) {
|
|
|
+ item.reimbursementType = this.inputForm.reimbursementType
|
|
|
+ }
|
|
|
+ if (this.commonJS.isEmpty(item.uniqueId)) {
|
|
|
+ item.uniqueId = item.id || ('gen_' + Math.random().toString(36).substr(2, 9))
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if (this.commonJS.isNotEmpty(this.inputForm.detailInfoContracts)) {
|
|
|
+ this.inputForm.detailInfoContracts.forEach(item => {
|
|
|
+ if (this.commonJS.isEmpty(item.reimbursementType)) {
|
|
|
+ item.reimbursementType = this.inputForm.reimbursementType
|
|
|
+ }
|
|
|
+ if (this.commonJS.isEmpty(item.uniqueId)) {
|
|
|
+ item.uniqueId = item.id || ('gen_' + Math.random().toString(36).substr(2, 9))
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if (this.commonJS.isNotEmpty(this.inputForm.detailInfoProjects)) {
|
|
|
+ this.inputForm.detailInfoProjects.forEach(item => {
|
|
|
+ if (this.commonJS.isEmpty(item.reimbursementType)) {
|
|
|
+ item.reimbursementType = this.inputForm.reimbursementType
|
|
|
+ }
|
|
|
+ if (this.commonJS.isEmpty(item.uniqueId)) {
|
|
|
+ item.uniqueId = item.id || ('gen_' + Math.random().toString(36).substr(2, 9))
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if (this.commonJS.isNotEmpty(this.inputForm.amountInfos)) {
|
|
|
+ this.inputForm.amountInfos.forEach(item => {
|
|
|
+ if (this.commonJS.isEmpty(item.reimbursementType)) {
|
|
|
+ item.reimbursementType = this.inputForm.reimbursementType
|
|
|
+ }
|
|
|
+ if (this.commonJS.isEmpty(item.uniqueId)) {
|
|
|
+ item.uniqueId = item.id || ('gen_' + Math.random().toString(36).substr(2, 9))
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if (this.commonJS.isNotEmpty(this.inputForm.invoiceReimbursements)) {
|
|
|
+ this.inputForm.invoiceReimbursements.forEach(item => {
|
|
|
+ if (this.commonJS.isEmpty(item.reimbursementType)) {
|
|
|
+ item.reimbursementType = this.inputForm.reimbursementType
|
|
|
+ }
|
|
|
+ if (this.commonJS.isEmpty(item.uniqueId)) {
|
|
|
+ item.uniqueId = item.id || ('gen_' + Math.random().toString(36).substr(2, 9))
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
if (this.commonJS.isNotEmpty(this.inputForm.paymentStatus) && this.inputForm.paymentStatus === '1') {
|
|
|
this.payment = '已付款'
|
|
|
} else {
|
|
|
@@ -2152,16 +2224,16 @@ export default {
|
|
|
count += Number(item.count)
|
|
|
}
|
|
|
});
|
|
|
- if (count != element.number) {
|
|
|
+ if (Number(element.number) > Math.round(count * 100) / 100) {
|
|
|
countFlag = true
|
|
|
countIndex = index
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
if (countFlag) {
|
|
|
- this.$message.warning(`第${countIndex + 1}行报销费用与发票金额不一致`);
|
|
|
+ this.$message.warning(`第${countIndex + 1}行报销费用不能超过数电发票金额总和`);
|
|
|
this.loading = false
|
|
|
- throw new Error(`第${countIndex + 1}行报销费用与发票金额不一致`);
|
|
|
+ throw new Error(`第${countIndex + 1}行报销费用不能超过数电发票金额总和`);
|
|
|
}
|
|
|
},
|
|
|
handleDefaultExpand() {
|