Browse Source

2026-09-08

项目信息增加oa流程
master
fengyuan_yang 1 week ago
parent
commit
30d1100d6a
  1. 34
      src/views/modules/project/projectInfo/com_project_info_part.vue
  2. 41
      src/views/modules/quotation/requestForQuote.vue
  3. 26
      src/views/modules/quotation/toBeQuoted.vue
  4. 40
      src/views/modules/quote/index.vue

34
src/views/modules/project/projectInfo/com_project_info_part.vue

@ -1257,13 +1257,45 @@ import CodeGeneration from "../../code/generation.vue";
columnProp: "partDesc",
headerAlign: "center",
align: "left",
columnLabel: "物料名称",
columnLabel: "产品描述",
columnHidden: false,
columnImage: false,
status: true,
fixed: '',
columnWidth: 300
},
{
userId: this.$store.state.user.name,
functionId: 101002001,
serialNumber: '101002001Table4ApplicationDesc',
tableId: "101002001Table4",
tableName: "项目物料",
columnProp: "applicationDesc",
headerAlign: "center",
align: "left",
columnLabel: "应用描述",
columnHidden: false,
columnImage: false,
status: true,
fixed: '',
columnWidth: 160
},
{
userId: this.$store.state.user.name,
functionId: 101002001,
serialNumber: '101002001Table4ProductCategory',
tableId: "101002001Table4",
tableName: "项目物料",
columnProp: "productCategory",
headerAlign: "center",
align: "center",
columnLabel: "产品类别",
columnHidden: false,
columnImage: false,
status: true,
fixed: '',
columnWidth: 120
},
{
userId: this.$store.state.user.name,
functionId: 101002001,

41
src/views/modules/quotation/requestForQuote.vue

@ -1039,6 +1039,7 @@ export default {
projectId: undefined,
projectName: undefined,
customerId: undefined,
status: '已完成',
},
//
projectList: [],
@ -2666,6 +2667,7 @@ export default {
}
this.confirmProjectPart();
if (this.modalData.flag === '1') {
this.assertProjectCompleted(this.modalData.projectId, '新增询价').then(() => {
this.saveLoading = true
quotationInformationSave(this.modalData).then(({data}) => {
this.saveLoading = false
@ -2677,6 +2679,11 @@ export default {
} else {
this.$message(data.msg)
}
}).catch(() => {
this.saveLoading = false
})
}).catch((msg) => {
this.$message.warning(typeof msg === 'string' ? msg : '校验项目状态失败')
})
} else {
quotationInformationEdit(this.modalData).then(({data}) => {
@ -3438,6 +3445,7 @@ export default {
searchProjectInfoList() {
this.projectList = [];
this.searchProjectData.customerId = this.modalData.customerNo
this.searchProjectData.status = '已完成'
searchProjectInfoList(this.searchProjectData).then(({data}) => {
if (data && data.code === 0) {
this.projectList = data.rows
@ -3455,6 +3463,7 @@ export default {
projectId: undefined,
projectName: undefined,
customerId: undefined,
status: '已完成',
}
},
projectClickRow(row) {
@ -3631,6 +3640,30 @@ export default {
this.$message.error(error)
})
},
assertProjectCompleted(projectId, actionText) {
return new Promise((resolve, reject) => {
if (!projectId) {
reject('项目号不能为空')
return
}
queryProjectByCustomer({
site: this.$store.state.user.site,
projectId
}).then(({data}) => {
if (!(data && data.code === 0 && data.rows && data.rows.length === 1)) {
reject('未找到对应项目信息')
return
}
if (data.rows[0].status !== '已完成') {
reject('仅项目单据状态为已完成时允许' + actionText + ',当前状态:' + data.rows[0].status)
return
}
resolve(data.rows[0])
}).catch((error) => {
reject(error)
})
})
},
handleQueryProjectByCustomer(){
let params = {
site:this.$store.state.user.site,
@ -3640,6 +3673,14 @@ export default {
queryProjectByCustomer(params).then(({data})=>{
if (data && data.code === 0 ){
if (data.rows && data.rows.length === 1){
if (this.modalData.flag === '1' && data.rows[0].status !== '已完成') {
this.$message.warning('仅项目单据状态为已完成时允许新增询价,当前状态:' + data.rows[0].status)
this.modalData.projectId = ''
this.modalData.projectName = ''
this.modalData.finalCustomerId = ''
this.modalData.finalCustomerName = ''
return
}
this.modalData.projectName = data.rows[0].projectName
this.modalData.finalCustomerId = data.rows[0].finalCustomerId
this.modalData.finalCustomerName = data.rows[0].finalCustomerName

26
src/views/modules/quotation/toBeQuoted.vue

@ -188,6 +188,7 @@ import {
quotationInformationSearch2, //
} from '@/api/quotation/quotationInformation.js'
import {batchSaveQuote} from "../../../api/quote/quote";
import {queryProjectByCustomer} from "../../../api/project/project";
import DictDataSelect from "../sys/dict-data-select.vue";
import {quotationInformationSearchByAnyField} from "../../../api/quotation/quotationInformation";
import FilterSearch from "../../common/filterSearch.vue";
@ -623,7 +624,11 @@ export default {
},
//
batchQuotation(){
this.assertSelectedProjectsCompleted(this.quotationSelections).then(() => {
this.saveBatchQuotationHeader(this.quotationSelections);
}).catch((msg) => {
this.$message.warning(typeof msg === 'string' ? msg : '校验项目状态失败')
})
},
//
saveBatchQuotationHeader(list){
@ -652,6 +657,7 @@ export default {
this.$message.warning("请选择需报价的单号")
return
}
this.assertSelectedProjectsCompleted(this.quotationSelections).then(() => {
this.quotationSelections = this.quotationSelections.map(item=>({
...item,
qty: undefined,
@ -660,6 +666,26 @@ export default {
site: this.$store.state.user.site,
}))
this.quoteVisible = true;
}).catch((msg) => {
this.$message.warning(typeof msg === 'string' ? msg : '校验项目状态失败')
})
},
assertSelectedProjectsCompleted(list) {
const site = this.$store.state.user.site
const uniqueIds = [...new Set((list || []).map(item => item.projectId).filter(Boolean))]
if (!uniqueIds.length) {
return Promise.reject('项目号不能为空')
}
return Promise.all(uniqueIds.map(projectId =>
queryProjectByCustomer({ site, projectId }).then(({data}) => {
if (!(data && data.code === 0 && data.rows && data.rows.length === 1)) {
return Promise.reject('未找到项目:' + projectId)
}
if (data.rows[0].status !== '已完成') {
return Promise.reject('询价单项目 ' + projectId + ' 单据状态必须为已完成,当前状态:' + data.rows[0].status)
}
})
))
},
buildBatchQuotePayload(list){
return list.map(item=>({

40
src/views/modules/quote/index.vue

@ -1025,6 +1025,7 @@ export default {
})
},
handleSaveQuote(){
this.assertProjectCompleted(this.saveQuote.projectNo).then(() => {
let params = {
...this.saveQuote,
status: '草稿',
@ -1046,6 +1047,9 @@ export default {
this.$message.error(error)
this.saveLoading = false
})
}).catch((msg) => {
this.$message.warning(typeof msg === 'string' ? msg : '校验项目状态失败')
})
},
handleUpdateQuote(){
let params = {
@ -1153,6 +1157,14 @@ export default {
queryProjectByCustomer(params).then(({data})=>{
if (data && data.code === 0 ){
if (data.rows && data.rows.length === 1){
if (!this.saveQuote.id && data.rows[0].status !== '已完成') {
this.$message.warning('仅项目单据状态为已完成时允许报价,当前状态:' + data.rows[0].status)
this.saveQuote.projectNo = ''
this.saveQuote.projectDesc = ''
this.saveQuote.finalCustomerNo = ''
this.saveQuote.finalCustomerDesc = ''
return
}
this.saveQuote.projectDesc = data.rows[0].projectName
this.saveQuote.finalCustomerNo = data.rows[0].finalCustomerId
this.saveQuote.finalCustomerDesc = data.rows[0].finalCustomerName
@ -1349,6 +1361,7 @@ export default {
this.insideInquiryVisible = true
},
dblclickInsideInquiry(row){
this.assertProjectCompleted(row.projectId).then(() => {
this.saveQuote.insideInquiryNo = row.quotationNo
this.saveQuote.customerNo = row.customerNo
this.saveQuote.customerDesc = row.customerDesc
@ -1361,6 +1374,33 @@ export default {
this.saveQuote.purchase = row.tracker
this.saveQuote.purchaseName = row.trackerName
this.insideInquiryVisible = false
}).catch((msg) => {
this.$message.warning(typeof msg === 'string' ? msg : '校验项目状态失败')
})
},
assertProjectCompleted(projectId) {
return new Promise((resolve, reject) => {
if (!projectId) {
reject('项目号不能为空')
return
}
queryProjectByCustomer({
site: this.$store.state.user.site,
projectId
}).then(({data}) => {
if (!(data && data.code === 0 && data.rows && data.rows.length === 1)) {
reject('未找到对应项目信息')
return
}
if (data.rows[0].status !== '已完成') {
reject('仅项目单据状态为已完成时允许报价,当前状态:' + data.rows[0].status)
return
}
resolve(data.rows[0])
}).catch((error) => {
reject(error)
})
})
},
searchInsideInquiry(){
searchQuotationByQuotationNo(this.insideInquiry).then(({data}) => {

Loading…
Cancel
Save