Quellcode durchsuchen

报销bug修复

徐滕 vor 1 Woche
Ursprung
Commit
a29c009527

+ 3 - 3
src/views/ccpm/reimbursement/info/NewInfoUpdateForm.vue

@@ -1782,16 +1782,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() {

+ 51 - 3
src/views/ccpm/reimbursement/info/NewReimbursementForm.vue

@@ -175,6 +175,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 { xmInfo } from "@/utils/businessInfo";
@@ -471,6 +472,53 @@ 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.detailInfoProcured)) {
+            this.inputForm.detailInfoProcured.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 {
@@ -2018,16 +2066,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() {

+ 3 - 3
src/views/common/reimbursement/ReimbursementComponent.vue

@@ -3189,16 +3189,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() {

+ 5 - 5
src/views/common/reimbursement/ReimbursementComponentTest.vue

@@ -590,7 +590,7 @@
         </div>
         <div v-if="inputForm.sourceType === '3' && tenantFlag === 'cw'">
             <el-divider content-position="left"><i class="el-icon-document"></i>
-                报告报销详情
+                报告报销详情1
                 <el-button v-if="insertBtn" size="default" style="margin-left: 20px" type="primary"
                     :disabled="method === 'view' || status === 'audit' || status === 'taskFormDetail'"
                     @click="insertEvent('report_detail')" plain>
@@ -736,7 +736,7 @@
         </div>
         <div v-else-if="inputForm.sourceType === '3' && tenantFlag !== 'cw'">
             <el-divider content-position="left"><i class="el-icon-document"></i>
-                报告报销详情
+                报告报销详情2
                 <el-button v-if="insertBtn" size="default" style="margin-left: 20px" type="primary"
                     :disabled="method === 'view' || status === 'audit' || status === 'taskFormDetail'"
                     @click="insertEvent('report_detail')" plain>
@@ -3211,16 +3211,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() {

+ 3 - 3
src/views/consultancy/reimbursement/info/NewInfoUpdateForm.vue

@@ -1788,16 +1788,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() {

+ 51 - 3
src/views/consultancy/reimbursement/info/NewReimbursementForm.vue

@@ -146,6 +146,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 { zxInfo } from "@/utils/businessInfo";
@@ -437,6 +438,53 @@ 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.detailInfoProcured)) {
+            this.inputForm.detailInfoProcured.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 {
@@ -1925,16 +1973,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() {

+ 3 - 3
src/views/cw/reimbursementApproval/info/NewInfoUpdateForm.vue

@@ -2033,16 +2033,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() {

+ 51 - 3
src/views/cw/reimbursementApproval/info/NewReimbursementForm.vue

@@ -141,6 +141,7 @@ import processService from '@/api/flowable/processService'
 import ProjectListForm from './ProgramForm'
 import CwProgramPageForm2 from './CwProgramPageForm2'
 import userService from '@/api/sys/UserService'
+import ProjectRecordsService from '@/api/cw/projectRecords/ProjectRecordsService'
 import taskService from "@/api/flowable/taskService.js";
 import ReimbursementComponent from '@/views/common/reimbursement/ReimbursementComponentTest.vue'
 import ReimbursementImage from '@/views/common/reimbursement/ReimbursementImage.vue'
@@ -444,6 +445,53 @@ 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.detailInfoProcured)) {
+						this.inputForm.detailInfoProcured.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 {
@@ -2294,16 +2342,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() {

+ 3 - 3
src/views/reimbursement/info/NewInfoUpdateForm.vue

@@ -1890,16 +1890,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() {

+ 40 - 3
src/views/reimbursement/info/NewReimbursementForm.vue

@@ -443,6 +443,43 @@ 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))
+						})
+					}
+					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.detailInfoProcured)) {
+						this.inputForm.detailInfoProcured.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 {
@@ -1968,16 +2005,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() {

+ 3 - 3
src/views/zs/reimbursement/info/NewInfoUpdateForm.vue

@@ -1801,16 +1801,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() {

+ 75 - 3
src/views/zs/reimbursement/info/NewReimbursementForm.vue

@@ -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() {