diff --git a/src/views/modules/sampleTracking/projectProofTracking.vue b/src/views/modules/sampleTracking/projectProofTracking.vue index 95c45c0..f106b09 100644 --- a/src/views/modules/sampleTracking/projectProofTracking.vue +++ b/src/views/modules/sampleTracking/projectProofTracking.vue @@ -1048,7 +1048,7 @@ - + - + - + - + @@ -5972,9 +5972,6 @@ export default { createBy: this.$store.state.user.name, updateBy: this.$store.state.user.name }) - if (this.isBlankValue(projectCategory)) { - this.$message.warning('未获取到项目分类,请手动选择') - } this.proofDialogVisible = true this.loadProofDialogApplyOptions(this.proofDialogData.projectNo) }, @@ -6152,36 +6149,23 @@ export default { }).catch(() => {}) }, validateProofDialogData () { + // 新增打样挂在已选物料上,缺少项目或物料主键时无法落跟踪记录。 if (!this.proofDialogData.projectId || !this.proofDialogData.projectPartId) { this.$message.warning('项目或项目料号信息不完整') return false } - if (!this.proofDialogData.cProjectTypeDb) { - this.$message.warning('项目分类不能为空') - return false - } - if (!this.proofDialogData.projectPhase) { + if (this.isBlankValue(this.proofDialogData.projectPhase)) { this.$message.warning('项目阶段不能为空') return false } - if (!this.proofDialogData.proofingNo) { - this.$message.warning('打样单号不能为空') - return false - } - if (!this.proofDialogData.proofingNumber) { - this.$message.warning('数量不能为空') - return false - } - if (!/^[1-9]\d*$/.test(String(this.proofDialogData.proofingNumber))) { + // 数量允许留空;一旦填写仍必须是正整数,避免把 0、小数或文本写入打样数量。 + const proofingNumber = this.proofDialogData.proofingNumber + if (!this.isBlankValue(proofingNumber) && !/^[1-9]\d*$/.test(String(proofingNumber).trim())) { this.$alert('数量必需是大于等于0的正整数', '提示', { confirmButtonText: '确定' }) return false } - if (!this.proofDialogData.planStartDate) { - this.$message.warning('打样开始日期不能为空') - return false - } return true }, resolveProofDialogBaseline () { @@ -6202,17 +6186,17 @@ export default { testPartNo: this.proofDialogData.testPartNo, customerNo: this.proofDialogData.customerNo, buNo: this.proofDialogData.buNo, - projectCategory: this.proofDialogData.cProjectTypeDb, + projectCategory: this.isBlankValue(this.proofDialogData.cProjectTypeDb) ? null : this.proofDialogData.cProjectTypeDb, projectPhase: this.proofDialogData.projectPhase, - proofingNo: this.proofDialogData.proofingNo, - proofingNumber: Number(this.proofDialogData.proofingNumber), - planStartDate: this.proofDialogData.planStartDate, + proofingNo: this.isBlankValue(this.proofDialogData.proofingNo) ? null : String(this.proofDialogData.proofingNo).trim(), + proofingNumber: this.isBlankValue(this.proofDialogData.proofingNumber) ? null : Number(String(this.proofDialogData.proofingNumber).trim()), + planStartDate: this.isBlankValue(this.proofDialogData.planStartDate) ? null : this.proofDialogData.planStartDate, requiredDeliveryDate: this.isBlankValue(this.proofDialogData.requiredDeliveryDate) ? null : this.proofDialogData.requiredDeliveryDate, baseline: this.resolveProofDialogBaseline(), actualityDeliveryDate: this.proofDialogData.actualityDeliveryDate || null, pmInqueryTime: this.isBlankValue(this.proofDialogData.pmInqueryTime) ? null : this.proofDialogData.pmInqueryTime, importance: this.normalizeImportanceValue(this.proofDialogData.importance), - proofingStatus: this.proofDialogData.proofingStatus || '草稿', + proofingStatus: this.isBlankValue(this.proofDialogData.proofingStatus) ? null : this.proofDialogData.proofingStatus, remark: this.proofDialogData.remark, tracker: this.proofDialogData.projectOwner, engineer: this.proofDialogData.engineer,