diff --git a/src/views/modules/tooling/searchToolApply.vue b/src/views/modules/tooling/searchToolApply.vue index 98791fd..7f0da8a 100644 --- a/src/views/modules/tooling/searchToolApply.vue +++ b/src/views/modules/tooling/searchToolApply.vue @@ -486,33 +486,37 @@ - 报价员 + 报价员 + 报价员 - TP + TP + TP - 采购员 + 采购员 + 采购员 - - CS + + CS + CS - + - + - + @@ -558,7 +562,7 @@
- +
@@ -583,12 +587,12 @@ - + - + @@ -599,38 +603,39 @@ - + - + - - + + - + - CS + CS + CS - + @@ -905,7 +910,7 @@
- +
@@ -1069,7 +1074,8 @@ export default { if (!this.plmChangeApplyDetailArr) { return 'N' } - let arr = this.plmChangeApplyDetailArr.filter(a => a.fieldId === value) + let arr = this.plmChangeApplyDetailArr.filter(a => + a.fieldId === value) if (arr.length > 0) { return arr[0].updateFlag } @@ -2323,28 +2329,28 @@ export default { this.$nextTick(() => { let strVal = '' if (val === 2002) { - if (this.changeApplyHeaderFlag('quoter') === 'N' && this.currentRow.status === '审批中') { - this.$alert('没有权限在审批过程中修改!', '错误', { - confirmButtonText: '确定' - }) - return false - } + // if (this.changeApplyHeaderFlag('quoter') === 'N' && this.currentRow.status === '审批中') { + // this.$alert('没有权限在审批过程中修改!', '错误', { + // confirmButtonText: '确定' + // }) + // return false + // } strVal = this.dataForm.quoter } else if (val === 2042) { - if (this.changeApplyHeaderFlag('tp') === 'N' && this.currentRow.status === '审批中') { - this.$alert('没有权限在审批过程中修改!', '错误', { - confirmButtonText: '确定' - }) - return false - } + // if (this.changeApplyHeaderFlag('tp') === 'N' && this.currentRow.status === '审批中') { + // this.$alert('没有权限在审批过程中修改!', '错误', { + // confirmButtonText: '确定' + // }) + // return false + // } strVal = this.dataForm.tp } else if (val === 2000) { - if (this.changeApplyHeaderFlag('purchaser') === 'N' && this.currentRow.status === '审批中') { - this.$alert('没有权限在审批过程中修改!', '错误', { - confirmButtonText: '确定' - }) - return false - } + // if (this.changeApplyHeaderFlag('purchaser') === 'N' && this.currentRow.status === '审批中') { + // this.$alert('没有权限在审批过程中修改!', '错误', { + // confirmButtonText: '确定' + // }) + // return false + // } strVal = this.dataForm.purchaser } this.$refs.baseList.init(val, strVal) @@ -2788,7 +2794,6 @@ export default { linkNode.download = fileName // a标签的download属性规定下载文件的名称 linkNode.style.display = 'none' linkNode.href = URL.createObjectURL(blob) // 生成一个Blob URL - console.log(linkNode) // if(val == 'Y'){ // this.pdfVisible = true // this.pdfUrl = linkNode.href @@ -2983,6 +2988,36 @@ export default { // 提交 submitData() { + if (this.plmChangeApplyHeaderArr) { + for (let i = 0; i < this.plmChangeApplyHeaderArr.length; i++) { + let fieldId = this.plmChangeApplyHeaderArr[i].fieldId; + let isRequired = this.plmChangeApplyHeaderArr[i].required === 'Y'; + + let val = this.dataForm[fieldId]; + if (val === undefined) { + val = this.modelData[fieldId]; + } + + if (isRequired && (val === undefined || val === null || val === '')) { + this.$message.warning(this.plmChangeApplyHeaderArr[i].fieldName + '不能为空!') + return + } + } + } + if (this.plmChangeApplyDetailArr) { + for (let i = 0; i < this.plmChangeApplyDetailArr.length; i++) { + // 判断集合中的该属性是否都有值 + let val = this.toolData.every(item => { + const value = item[this.plmChangeApplyDetailArr[i].fieldId] + return value !== null && value !== '' + }) + // 如果没有值 且该字段为必填 + if (!val && this.plmChangeApplyDetailArr[i].required === 'Y') { + this.$message.warning(this.plmChangeApplyDetailArr[i].fieldName + '不能为空!') + return + } + } + } this.dataForm.userName = this.$store.state.user.name this.dataForm.menuId = this.$route.meta.menuId this.dataForm.detailList = this.toolData