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. 63
      src/views/modules/quotation/requestForQuote.vue
  3. 44
      src/views/modules/quotation/toBeQuoted.vue
  4. 102
      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", columnProp: "partDesc",
headerAlign: "center", headerAlign: "center",
align: "left", align: "left",
columnLabel: "物料名称",
columnLabel: "产品描述",
columnHidden: false, columnHidden: false,
columnImage: false, columnImage: false,
status: true, status: true,
fixed: '', fixed: '',
columnWidth: 300 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, userId: this.$store.state.user.name,
functionId: 101002001, functionId: 101002001,

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

@ -1039,6 +1039,7 @@ export default {
projectId: undefined, projectId: undefined,
projectName: undefined, projectName: undefined,
customerId: undefined, customerId: undefined,
status: '已完成',
}, },
// //
projectList: [], projectList: [],
@ -2666,17 +2667,23 @@ export default {
} }
this.confirmProjectPart(); this.confirmProjectPart();
if (this.modalData.flag === '1') { if (this.modalData.flag === '1') {
this.saveLoading = true
quotationInformationSave(this.modalData).then(({data}) => {
this.saveLoading = false
if (data && data.code === 0) {
this.modalFlag = false;
this.searchData.quotationBatchNo = data.quotationBatchNo
this.$message.success('操作成功')
this.getDataList()
} else {
this.$message(data.msg)
}
this.assertProjectCompleted(this.modalData.projectId, '新增询价').then(() => {
this.saveLoading = true
quotationInformationSave(this.modalData).then(({data}) => {
this.saveLoading = false
if (data && data.code === 0) {
this.modalFlag = false;
this.searchData.quotationBatchNo = data.quotationBatchNo
this.$message.success('操作成功')
this.getDataList()
} else {
this.$message(data.msg)
}
}).catch(() => {
this.saveLoading = false
})
}).catch((msg) => {
this.$message.warning(typeof msg === 'string' ? msg : '校验项目状态失败')
}) })
} else { } else {
quotationInformationEdit(this.modalData).then(({data}) => { quotationInformationEdit(this.modalData).then(({data}) => {
@ -3438,6 +3445,7 @@ export default {
searchProjectInfoList() { searchProjectInfoList() {
this.projectList = []; this.projectList = [];
this.searchProjectData.customerId = this.modalData.customerNo this.searchProjectData.customerId = this.modalData.customerNo
this.searchProjectData.status = '已完成'
searchProjectInfoList(this.searchProjectData).then(({data}) => { searchProjectInfoList(this.searchProjectData).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.projectList = data.rows this.projectList = data.rows
@ -3455,6 +3463,7 @@ export default {
projectId: undefined, projectId: undefined,
projectName: undefined, projectName: undefined,
customerId: undefined, customerId: undefined,
status: '已完成',
} }
}, },
projectClickRow(row) { projectClickRow(row) {
@ -3631,6 +3640,30 @@ export default {
this.$message.error(error) 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(){ handleQueryProjectByCustomer(){
let params = { let params = {
site:this.$store.state.user.site, site:this.$store.state.user.site,
@ -3640,6 +3673,14 @@ export default {
queryProjectByCustomer(params).then(({data})=>{ queryProjectByCustomer(params).then(({data})=>{
if (data && data.code === 0 ){ if (data && data.code === 0 ){
if (data.rows && data.rows.length === 1){ 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.projectName = data.rows[0].projectName
this.modalData.finalCustomerId = data.rows[0].finalCustomerId this.modalData.finalCustomerId = data.rows[0].finalCustomerId
this.modalData.finalCustomerName = data.rows[0].finalCustomerName this.modalData.finalCustomerName = data.rows[0].finalCustomerName

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

@ -188,6 +188,7 @@ import {
quotationInformationSearch2, // quotationInformationSearch2, //
} from '@/api/quotation/quotationInformation.js' } from '@/api/quotation/quotationInformation.js'
import {batchSaveQuote} from "../../../api/quote/quote"; import {batchSaveQuote} from "../../../api/quote/quote";
import {queryProjectByCustomer} from "../../../api/project/project";
import DictDataSelect from "../sys/dict-data-select.vue"; import DictDataSelect from "../sys/dict-data-select.vue";
import {quotationInformationSearchByAnyField} from "../../../api/quotation/quotationInformation"; import {quotationInformationSearchByAnyField} from "../../../api/quotation/quotationInformation";
import FilterSearch from "../../common/filterSearch.vue"; import FilterSearch from "../../common/filterSearch.vue";
@ -623,7 +624,11 @@ export default {
}, },
// //
batchQuotation(){ batchQuotation(){
this.saveBatchQuotationHeader(this.quotationSelections);
this.assertSelectedProjectsCompleted(this.quotationSelections).then(() => {
this.saveBatchQuotationHeader(this.quotationSelections);
}).catch((msg) => {
this.$message.warning(typeof msg === 'string' ? msg : '校验项目状态失败')
})
}, },
// //
saveBatchQuotationHeader(list){ saveBatchQuotationHeader(list){
@ -652,14 +657,35 @@ export default {
this.$message.warning("请选择需报价的单号") this.$message.warning("请选择需报价的单号")
return return
} }
this.quotationSelections = this.quotationSelections.map(item=>({
...item,
qty: undefined,
currency: undefined,
createBy: this.$store.state.user.name,
site: this.$store.state.user.site,
}))
this.quoteVisible = true;
this.assertSelectedProjectsCompleted(this.quotationSelections).then(() => {
this.quotationSelections = this.quotationSelections.map(item=>({
...item,
qty: undefined,
currency: undefined,
createBy: this.$store.state.user.name,
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){ buildBatchQuotePayload(list){
return list.map(item=>({ return list.map(item=>({

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

@ -1025,26 +1025,30 @@ export default {
}) })
}, },
handleSaveQuote(){ handleSaveQuote(){
let params = {
...this.saveQuote,
status: '草稿',
action: 'Y',
createBy: this.$store.state.user.name,
}
this.saveLoading = true
saveQuote(params).then(({data})=>{
if (data && data.code === 0){
this.saveVisible = false
this.quoteForm.quoteVersionNo = data.quoteVersionNo
this.$message.success(data.msg)
}else {
this.$message.warning(data.msg)
this.assertProjectCompleted(this.saveQuote.projectNo).then(() => {
let params = {
...this.saveQuote,
status: '草稿',
action: 'Y',
createBy: this.$store.state.user.name,
} }
this.handleSearch(0);
this.saveLoading = false
}).catch((error)=>{
this.$message.error(error)
this.saveLoading = false
this.saveLoading = true
saveQuote(params).then(({data})=>{
if (data && data.code === 0){
this.saveVisible = false
this.quoteForm.quoteVersionNo = data.quoteVersionNo
this.$message.success(data.msg)
}else {
this.$message.warning(data.msg)
}
this.handleSearch(0);
this.saveLoading = false
}).catch((error)=>{
this.$message.error(error)
this.saveLoading = false
})
}).catch((msg) => {
this.$message.warning(typeof msg === 'string' ? msg : '校验项目状态失败')
}) })
}, },
handleUpdateQuote(){ handleUpdateQuote(){
@ -1153,6 +1157,14 @@ export default {
queryProjectByCustomer(params).then(({data})=>{ queryProjectByCustomer(params).then(({data})=>{
if (data && data.code === 0 ){ if (data && data.code === 0 ){
if (data.rows && data.rows.length === 1){ 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.projectDesc = data.rows[0].projectName
this.saveQuote.finalCustomerNo = data.rows[0].finalCustomerId this.saveQuote.finalCustomerNo = data.rows[0].finalCustomerId
this.saveQuote.finalCustomerDesc = data.rows[0].finalCustomerName this.saveQuote.finalCustomerDesc = data.rows[0].finalCustomerName
@ -1349,18 +1361,46 @@ export default {
this.insideInquiryVisible = true this.insideInquiryVisible = true
}, },
dblclickInsideInquiry(row){ dblclickInsideInquiry(row){
this.saveQuote.insideInquiryNo = row.quotationNo
this.saveQuote.customerNo = row.customerNo
this.saveQuote.customerDesc = row.customerDesc
this.saveQuote.projectNo = row.projectId
this.saveQuote.projectDesc = row.projectName
this.saveQuote.quoter = row.quoter
this.saveQuote.quoterName = row.quoterName
this.saveQuote.finalCustomerNo = row.finalCustomerId
this.saveQuote.finalCustomerDesc = row.finalCustomerName
this.saveQuote.purchase = row.tracker
this.saveQuote.purchaseName = row.trackerName
this.insideInquiryVisible = false
this.assertProjectCompleted(row.projectId).then(() => {
this.saveQuote.insideInquiryNo = row.quotationNo
this.saveQuote.customerNo = row.customerNo
this.saveQuote.customerDesc = row.customerDesc
this.saveQuote.projectNo = row.projectId
this.saveQuote.projectDesc = row.projectName
this.saveQuote.quoter = row.quoter
this.saveQuote.quoterName = row.quoterName
this.saveQuote.finalCustomerNo = row.finalCustomerId
this.saveQuote.finalCustomerDesc = row.finalCustomerName
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(){ searchInsideInquiry(){
searchQuotationByQuotationNo(this.insideInquiry).then(({data}) => { searchQuotationByQuotationNo(this.insideInquiry).then(({data}) => {

Loading…
Cancel
Save