|
|
|
@ -474,6 +474,7 @@ export default { |
|
|
|
superAdmin: false, |
|
|
|
rejectVisible: false, |
|
|
|
rejectOpinion: '', |
|
|
|
plmQuoteArr: [], // plm_quote表字段配置(如annual_sales) |
|
|
|
plmQuoteDetailArr: [], |
|
|
|
defaultQuoteDetailRow: null, // 默认报价行数据 |
|
|
|
userBuList: [], |
|
|
|
@ -483,7 +484,7 @@ export default { |
|
|
|
customerDesc:[{required: true, message: '请输入客户名称', trigger: ['blur','change']}], |
|
|
|
projectNo:[{required: true, message: '请输入项目编码', trigger: ['blur','change']}], |
|
|
|
projectDesc:[{required: true, message: '请输入项目名称', trigger: ['blur','change']}], |
|
|
|
currency:[{required: true, message: '请输入币种', trigger: ['blur','change']}], |
|
|
|
// currency:[{required: true, message: '请输入币种', trigger: ['blur','change']}], |
|
|
|
quoteDate:[{required: true, message: '请选择报价日期', trigger: ['blur','change']}], |
|
|
|
quoter:[{required: true, message: '请输入报价专员', trigger: ['blur','change']}], |
|
|
|
}, |
|
|
|
@ -689,6 +690,7 @@ export default { |
|
|
|
} |
|
|
|
await getNodeAuthority(tempData).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.plmQuoteArr = data.rows.plm_quote || [] |
|
|
|
this.plmQuoteDetailArr = data.rows.plm_quote_detail || [] |
|
|
|
} |
|
|
|
}) |
|
|
|
@ -728,6 +730,20 @@ export default { |
|
|
|
}, |
|
|
|
// 同意提交 |
|
|
|
agreeSubmit() { |
|
|
|
// 校验报价主表的必填字段 |
|
|
|
if (this.plmQuoteArr && this.plmQuoteArr.length > 0) { |
|
|
|
for (let i = 0; i < this.plmQuoteArr.length; i++) { |
|
|
|
const field = this.plmQuoteArr[i] |
|
|
|
if (field.required === 'Y') { |
|
|
|
const fieldValue = this.saveQuote[field.fieldId] |
|
|
|
// 统一判断是否有值(包括勾选字段) |
|
|
|
if (!fieldValue && fieldValue !== 0) { |
|
|
|
this.$message.warning(field.fieldName + '不能为空!') |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
// 校验默认报价行的必填字段 |
|
|
|
if (this.plmQuoteDetailArr && this.plmQuoteDetailArr.length > 0 && this.defaultQuoteDetailRow) { |
|
|
|
for (let i = 0; i < this.plmQuoteDetailArr.length; i++) { |
|
|
|
@ -744,8 +760,10 @@ export default { |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
this.submitLoading = true |
|
|
|
// 提交审批流程(后端会在事务中先更新主表,再提交OA) |
|
|
|
let params = { |
|
|
|
...this.currentQuote, |
|
|
|
annualSales: this.saveQuote.annualSales, // 传递annualSales |
|
|
|
userName: this.$store.state.user.name, |
|
|
|
nodeConclusion: 'Y', |
|
|
|
menuId: this.$route.meta.menuId |
|
|
|
@ -756,9 +774,7 @@ export default { |
|
|
|
this.saveVisible = false |
|
|
|
this.handleSearch() |
|
|
|
} else { |
|
|
|
this.$alert(data.msg, '错误', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
}) |
|
|
|
this.$alert(data.msg, '错误', { confirmButtonText: '确定' }) |
|
|
|
} |
|
|
|
this.submitLoading = false |
|
|
|
}).catch((error) => { |
|
|
|
@ -769,6 +785,20 @@ export default { |
|
|
|
}, |
|
|
|
// 驳回提交 |
|
|
|
rejectSubmit() { |
|
|
|
// 校验报价主表的必填字段 |
|
|
|
if (this.plmQuoteArr && this.plmQuoteArr.length > 0) { |
|
|
|
for (let i = 0; i < this.plmQuoteArr.length; i++) { |
|
|
|
const field = this.plmQuoteArr[i] |
|
|
|
if (field.required === 'Y') { |
|
|
|
const fieldValue = this.saveQuote[field.fieldId] |
|
|
|
// 统一判断是否有值(包括勾选字段) |
|
|
|
if (!fieldValue && fieldValue !== 0) { |
|
|
|
this.$message.warning(field.fieldName + '不能为空!') |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
// 校验默认报价行的必填字段 |
|
|
|
if (this.plmQuoteDetailArr && this.plmQuoteDetailArr.length > 0 && this.defaultQuoteDetailRow) { |
|
|
|
for (let i = 0; i < this.plmQuoteDetailArr.length; i++) { |
|
|
|
@ -785,8 +815,10 @@ export default { |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
this.submitLoading = true |
|
|
|
// 提交驳回流程(后端会在事务中先更新主表,再提交OA) |
|
|
|
let params = { |
|
|
|
...this.currentQuote, |
|
|
|
annualSales: this.saveQuote.annualSales, // 传递annualSales |
|
|
|
userName: this.$store.state.user.name, |
|
|
|
nodeConclusion: 'N', |
|
|
|
rejectOpinion: this.rejectOpinion, |
|
|
|
@ -799,9 +831,7 @@ export default { |
|
|
|
this.saveVisible = false |
|
|
|
this.handleSearch() |
|
|
|
} else { |
|
|
|
this.$alert(data.msg, '错误', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
}) |
|
|
|
this.$alert(data.msg, '错误', { confirmButtonText: '确定' }) |
|
|
|
} |
|
|
|
this.submitLoading = false |
|
|
|
}).catch((error) => { |
|
|
|
@ -832,6 +862,8 @@ export default { |
|
|
|
} |
|
|
|
}) |
|
|
|
if (row){ |
|
|
|
// 先更新 currentQuote,确保 getNodeAuthority 能获取到正确的 stepId |
|
|
|
this.currentQuote = {...row} |
|
|
|
this.saveQuote = { |
|
|
|
...row |
|
|
|
} |
|
|
|
@ -1400,9 +1432,9 @@ export default { |
|
|
|
this.detailFlag = false; |
|
|
|
} |
|
|
|
}, |
|
|
|
'saveQuote.currency'(newVal, oldVal){ |
|
|
|
this.saveQuote.currency = newVal.toUpperCase() |
|
|
|
}, |
|
|
|
// 'saveQuote.currency'(newVal, oldVal){ |
|
|
|
// this.saveQuote.currency = newVal.toUpperCase() |
|
|
|
// }, |
|
|
|
'currentQuote'(newVal, oldVal){ |
|
|
|
if (newVal && this.isMenu){ |
|
|
|
this.getPriceCheckProperties(); |
|
|
|
|