From c9e789aa3d8df7d54500442684f850181b8fea57 Mon Sep 17 00:00:00 2001 From: fengyuan_yang <1976974459@qq.com> Date: Fri, 18 Sep 2026 11:16:48 +0800 Subject: [PATCH] =?UTF-8?q?2026-09-18=20=E4=BC=98=E5=8C=96=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/project/project.js | 1 + .../com_projectInfo-add-or-update.vue | 107 +++++++++++-- .../project/projectInfo/projectInfo.vue | 144 ++++++++---------- src/views/modules/quote/index.vue | 49 +++++- 4 files changed, 200 insertions(+), 101 deletions(-) diff --git a/src/api/project/project.js b/src/api/project/project.js index 563378c..ca4780a 100644 --- a/src/api/project/project.js +++ b/src/api/project/project.js @@ -19,6 +19,7 @@ export const searchUserRoll = data => createAPI(`/project/searchUserRoll`,'Post' export const searchSelectionUserRole = data => createAPI(`/project/searchSelectionUserRole`,'post',data) export const saveProjectInfo = data => createAPI(`/project/saveProjectInfo`,'Post',data) +export const updateProjectAmount = data => createAPI(`/project/updateProjectAmount`,'Post',data) /*查询文件内容*/ export const getFileContentList = data => createAPI('sys/file/getSysFileByOrderRef2','post',data) diff --git a/src/views/modules/project/projectInfo/com_projectInfo-add-or-update.vue b/src/views/modules/project/projectInfo/com_projectInfo-add-or-update.vue index fab181c..b568688 100644 --- a/src/views/modules/project/projectInfo/com_projectInfo-add-or-update.vue +++ b/src/views/modules/project/projectInfo/com_projectInfo-add-or-update.vue @@ -32,19 +32,20 @@ 项目经理 项目经理 - + 项目审批人 项目审批人 - + - 客户 + 客户 + 客户 @@ -70,9 +71,16 @@ - + - 项目年销售额CNY(K) + @@ -92,7 +100,8 @@ - 项目权限 + 项目权限 + 项目权限 @@ -104,6 +113,22 @@ + + + + + + + + + 刷新 + 保存 + 取消 + + + @@ -266,6 +291,7 @@ searchSelectionUserRole, saveProjectInfo, submitProjectInfo, + updateProjectAmount, } from "@/api/project/project.js" import Chooselist from '@/views/modules/common/Chooselist' import DictDataSelect from "../../sys/dict-data-select.vue"; @@ -310,6 +336,12 @@ menuId: '101002001', authSubmit: false, authReject: false, + authProjectAmount: false, + projectAmountFlag: false, + projectAmountLoading: false, + projectAmountForm: { + projectAmount: '' + }, superAdmin: false, createBy2: this.$store.state.user.name, operatorList:[], @@ -413,6 +445,7 @@ this.menuId = (this.$route.meta && this.$route.meta.menuId) || this.menuId this.authSubmit = isAuth(this.menuId + ':submit') this.authReject = isAuth(this.menuId + ':reject') + this.authProjectAmount = isAuth(this.menuId + ':projectAmount') checkSuperAdmin().then(({data}) => { this.superAdmin = !!(data && data.superAdmin) }) @@ -955,6 +988,60 @@ this.$refs.saveForm.resetFields(); }, + openProjectAmountDialog () { + this.$set(this.projectAmountForm, 'projectAmount', this.dataForm.projectAmount == null ? '' : this.dataForm.projectAmount) + this.projectAmountFlag = true + }, + refreshProjectAmount () { + if (!this.dataForm.id) { + this.$set(this.projectAmountForm, 'projectAmount', this.dataForm.projectAmount == null ? '' : this.dataForm.projectAmount) + return + } + projectInfoSearch({ + page: 1, + limit: 10, + id: this.dataForm.id, + menuId: this.menuId, + userId: this.$store.state.user.name + }).then(({data}) => { + if (data && data.page && data.page.list && data.page.list.length > 0) { + this.$set(this.projectAmountForm, 'projectAmount', data.page.list[0].projectAmount == null ? '' : data.page.list[0].projectAmount) + } else { + this.$message.error((data && data.msg) || '刷新失败') + } + }).catch(() => { + this.$message.error('刷新失败') + }) + }, + saveProjectAmount () { + const amount = this.projectAmountForm.projectAmount + if (!this.dataForm.id) { + this.$set(this.dataForm, 'projectAmount', amount) + this.projectAmountFlag = false + this.$message.success('暂存成功,保存单据后写入数据库') + return + } + this.projectAmountLoading = true + updateProjectAmount({ + site: this.dataForm.site, + projectId: this.dataForm.projectId, + projectAmount: amount === '' ? null : amount + }).then(({data}) => { + if (data && data.code === 0) { + this.$set(this.dataForm, 'projectAmount', amount) + this.projectAmountFlag = false + this.$message.success('操作成功') + this.$emit('refreshDataList', this.dataForm.projectId) + } else { + this.$message.error((data && data.msg) || '保存失败') + } + }).catch(() => { + this.$message.error('保存失败') + }).finally(() => { + this.projectAmountLoading = false + }) + }, + isCurrentApprover () { return this.superAdmin || (this.dataForm.createBy2 && String(this.dataForm.createBy2).split(';').includes(this.createBy2)) }, @@ -1255,12 +1342,10 @@ .project-amount-form-item .el-form-item__label { overflow: visible; - } - - .project-amount-label { - display: inline-block; - width: 160px; + height: auto; + line-height: 22px; white-space: nowrap; + width: auto !important; } diff --git a/src/views/modules/project/projectInfo/projectInfo.vue b/src/views/modules/project/projectInfo/projectInfo.vue index 46c3669..5ad17b1 100644 --- a/src/views/modules/project/projectInfo/projectInfo.vue +++ b/src/views/modules/project/projectInfo/projectInfo.vue @@ -121,106 +121,82 @@ - -
- - + + + + -
-
- - + + + + -
-
- - + + + + -
-
- - + + + + -
-
- + + + -
-
- - - -
-
- - - -
-
- - - -
- - - -
-
- - + + + -
- - - - - -
- - + + + + -
-
- - - + + + + -
-
- - -
- - + + + + -
-
- - - + + + + + -
-
- - -
- - + + + + -
-
- - -
- - + + + + -
+
+ + + + + + + + + + + + - diff --git a/src/views/modules/quote/index.vue b/src/views/modules/quote/index.vue index cf3114a..b46c03a 100644 --- a/src/views/modules/quote/index.vue +++ b/src/views/modules/quote/index.vue @@ -576,6 +576,7 @@ export default { insideInquiryVisible:false, detailFlag:false, + skipAnnualSalesAssign: false, ossColumns:[ { @@ -797,11 +798,27 @@ export default { if (!this.currentQuote.approvalUsername) return false return this.currentQuote.approvalUsername.split(';').includes(this.$store.state.user.name) }, + isAnnualSalesDisabled() { + if (this.detailFlag) { + return true + } + if (this.saveQuote.status === '已完成') { + return true + } + if (!this.plmQuoteArr || this.plmQuoteArr.length === 0) { + return true + } + const field = this.plmQuoteArr.find(item => item.fieldId === 'annualSales') + if (!field) { + return true + } + return field.updateFlag !== 'Y' + }, // 获取流程的配置权限 async getNodeAuthority() { let tempData = { site: this.currentQuote.site, - stepId: this.currentQuote.stepId, + stepId: this.currentQuote.stepId || 10, menuId: this.$route.meta.menuId } await getNodeAuthority(tempData).then(({data}) => { @@ -956,20 +973,34 @@ export default { if (row){ // 先更新 currentQuote,确保 getNodeAuthority 能获取到正确的 stepId this.currentQuote = {...row} + this.skipAnnualSalesAssign = true this.saveQuote = { ...row } - // 如果是审批中状态,获取权限配置和默认报价行数据 - if (row.status === '审批中') { + this.skipAnnualSalesAssign = false + // 草稿(10节点)/审批中均按节点配置控制字段 + if (row.status !== '已完成') { await this.getNodeAuthority() - await this.getDefaultQuoteDetailRow() + if (row.status === '审批中') { + await this.getDefaultQuoteDetailRow() + } + } else { + this.plmQuoteArr = [] + this.plmQuoteDetailArr = [] } }else { + this.currentQuote = { + site: this.$store.state.user.site, + stepId: 10 + } this.saveQuote = { ...this.quote, buNo:'*', - site:this.$store.state.user.site + site:this.$store.state.user.site, + status: '草稿', + stepId: 10 } + await this.getNodeAuthority() this.$nextTick(()=>{ this.saveQuote.buId = this.userBuList.length > 0? this.userBuList[0].id:null; }) @@ -1402,6 +1433,12 @@ export default { return Number.isNaN(amount) ? undefined : amount }, assignAnnualSalesFromProject(project, projectId) { + if (this.skipAnnualSalesAssign) { + return + } + if (!this.isAnnualSalesDisabled() && this.saveQuote && this.saveQuote.annualSales != null && this.saveQuote.annualSales !== '') { + return + } const amount = this.pickProjectAmount(project) if (amount != null) { this.$set(this.saveQuote, 'annualSales', amount) @@ -1880,7 +1917,7 @@ export default { - +