You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1739 lines
58 KiB
1739 lines
58 KiB
<script>
|
|
import QuoteSearch from "./primary/quoteSearch.vue";
|
|
import QuoteTable from "./primary/quoteTable.vue";
|
|
import {
|
|
againQuote,
|
|
queryQuotePage, queryQuotePageByAnyField,
|
|
queryQuoteRoleUser,
|
|
removeQuote,
|
|
saveQuote,
|
|
updateQuote,
|
|
updateQuoteStatus,
|
|
quoteEditStatus
|
|
} from "../../../api/quote/quote";
|
|
import QuoteDetail from "./detail/quoteDetail.vue";
|
|
import ChooseList from '@/views/modules/common/Chooselist';
|
|
import {queryCustomer} from "../../../api/customer/customerInformation";
|
|
import DictDataSelect from "../sys/dict-data-select.vue";
|
|
import {queryProjectByCustomer} from "../../../api/project/project";
|
|
import quotationCustomerContact from "../quotation/sellForQuotation/quotationCustomerContact.vue";
|
|
import CustomerInfo from "../quotation/sellForQuotation/customerInfo.vue";
|
|
import OssComponents from "../oss/ossComponents.vue";
|
|
import quotationProjectInformation from "../quotation/sellForQuotation/quotationProjectInformation.vue";
|
|
import {
|
|
quotationInformationSearchByAnyField,
|
|
searchQuotationByQuotationNo
|
|
} from "../../../api/quotation/quotationInformation";
|
|
import PriceCheckProperties from "../quotation/priceCheckProperties.vue";
|
|
import ApprovalInformation from "../changeManagement/approvalInformation.vue";
|
|
import {getPriceCheckPropertiesList} from "../../../api/quotation/priceCheckProperties";
|
|
import {getApprovalList, getNodeAuthority, checkSuperAdmin} from "../../../api/changeManagement/changeManagement";
|
|
import QuoteGroupDetail from "./detail/quoteGroupDetail.vue";
|
|
import {submitChange} from "../../../api/quote/quote";
|
|
import {queryQuoteDetail} from "../../../api/quote/quoteDetail";
|
|
import FilterSearch from "../../common/filterSearch.vue";
|
|
import {queryQuoteGroupDetail} from "../../../api/quote/quoteGroupDetail";
|
|
|
|
export default {
|
|
name: "quote",
|
|
components: {
|
|
FilterSearch,
|
|
QuoteGroupDetail,
|
|
ApprovalInformation, PriceCheckProperties,
|
|
quotationProjectInformation, OssComponents, CustomerInfo, quotationCustomerContact,
|
|
DictDataSelect,
|
|
QuoteDetail,
|
|
ChooseList,
|
|
QuoteTable, QuoteSearch
|
|
},
|
|
props:{
|
|
isMenu:{
|
|
type:Boolean,
|
|
default:true,
|
|
},
|
|
projectNo:{
|
|
type:String,
|
|
},
|
|
height:{
|
|
type:[Number,String],
|
|
default:'35vh'
|
|
}
|
|
},
|
|
menuId:5011,
|
|
data(){
|
|
return{
|
|
total: 0,
|
|
no:1,
|
|
size: 20,
|
|
quote:{
|
|
id: null,
|
|
site:"",
|
|
quoteNo: "",
|
|
customerInquiryNo: "",
|
|
insideInquiryNo: "",
|
|
buNo: "",
|
|
buId: null,
|
|
versionNo: "",
|
|
status:'',
|
|
quoteVersionNo: "",
|
|
customerNo: "",
|
|
customerDesc: "",
|
|
projectNo: "",
|
|
projectDesc: "",
|
|
finalCustomerNo: "",
|
|
finalCustomerDesc:"",
|
|
currency: "",
|
|
quoteDate: "",
|
|
quoter: "",
|
|
quoterName: "",
|
|
purchase: "",
|
|
purchaseName: "",
|
|
remark: "",
|
|
createBy: "",
|
|
createDate: "",
|
|
updateBy: "",
|
|
updateDate: "",
|
|
application: "",
|
|
annualDemand: "",
|
|
costModel: "UFIDA",
|
|
markup:0,
|
|
chipPrice:'',
|
|
},
|
|
quoteForm:{
|
|
},
|
|
saveQuote:{
|
|
},
|
|
dataList:[],
|
|
columns: [
|
|
{
|
|
userId: this.$store.state.user.name,
|
|
functionId: 5011,
|
|
serialNumber: '5011Table1QuoteVersionNo',
|
|
tableId: '5011Table1',
|
|
tableName: '报价信息表',
|
|
columnProp: 'quoteVersionNo',
|
|
headerAlign: 'center',
|
|
align: 'center',
|
|
columnLabel: '报价单号',
|
|
columnHidden: false,
|
|
columnImage: false,
|
|
columnSortable: false,
|
|
sortLv: 0,
|
|
status: true,
|
|
fixed: '',
|
|
columnWidth: 180
|
|
},
|
|
{
|
|
userId: this.$store.state.user.name,
|
|
functionId: 5011,
|
|
serialNumber: '5011Table1PlmPartNo',
|
|
tableId: '5011Table1',
|
|
tableName: '报价信息表',
|
|
columnProp: 'plmPartNo',
|
|
headerAlign: 'center',
|
|
align: 'left',
|
|
columnLabel: 'PLM物料编码',
|
|
columnHidden: false,
|
|
columnImage: false,
|
|
columnSortable: false,
|
|
sortLv: 0,
|
|
status: true,
|
|
fixed: '',
|
|
columnWidth: 120
|
|
},
|
|
{
|
|
userId: this.$store.state.user.name,
|
|
functionId: 5011,
|
|
serialNumber: '5011Table1IfsPartNo',
|
|
tableId: '5011Table1',
|
|
tableName: '报价信息表',
|
|
columnProp: 'ifsPartNo',
|
|
headerAlign: 'center',
|
|
align: 'left',
|
|
columnLabel: 'IFS物料编码',
|
|
columnHidden: false,
|
|
columnImage: false,
|
|
columnSortable: false,
|
|
sortLv: 0,
|
|
status: true,
|
|
fixed: '',
|
|
columnWidth: 120
|
|
},
|
|
{
|
|
userId: this.$store.state.user.name,
|
|
functionId: 5011,
|
|
serialNumber: '5011Table1PartDesc',
|
|
tableId: '5011Table1',
|
|
tableName: '报价信息表',
|
|
columnProp: 'partDesc',
|
|
headerAlign: 'center',
|
|
align: 'left',
|
|
columnLabel: '物料名称',
|
|
columnHidden: false,
|
|
columnImage: false,
|
|
columnSortable: false,
|
|
sortLv: 0,
|
|
status: true,
|
|
fixed: '',
|
|
columnWidth: 200
|
|
},
|
|
{
|
|
userId: this.$store.state.user.name,
|
|
functionId: 5011,
|
|
serialNumber: '5011Table1CustomerNo',
|
|
tableId: '5011Table1',
|
|
tableName: '报价信息表',
|
|
columnProp: 'customerNo',
|
|
headerAlign: 'center',
|
|
align: 'center',
|
|
columnLabel: '客户编码',
|
|
columnHidden: false,
|
|
columnImage: false,
|
|
columnSortable: false,
|
|
sortLv: 0,
|
|
status: true,
|
|
fixed: '',
|
|
columnWidth: 120
|
|
},
|
|
{
|
|
userId: this.$store.state.user.name,
|
|
functionId: 5011,
|
|
serialNumber: '5011Table1CustomerDesc',
|
|
tableId: '5011Table1',
|
|
tableName: '报价信息表',
|
|
columnProp: 'customerDesc',
|
|
headerAlign: 'center',
|
|
align: 'left',
|
|
columnLabel: '客户名称',
|
|
columnHidden: false,
|
|
columnImage: false,
|
|
columnSortable: false,
|
|
sortLv: 0,
|
|
status: true,
|
|
fixed: '',
|
|
columnWidth: 120
|
|
},
|
|
{
|
|
userId: this.$store.state.user.name,
|
|
functionId: 5011,
|
|
serialNumber: '5011Table1ProjectNo',
|
|
tableId: '5011Table1',
|
|
tableName: '报价信息表',
|
|
columnProp: 'projectNo',
|
|
headerAlign: 'center',
|
|
align: 'left',
|
|
columnLabel: '项目号',
|
|
columnHidden: false,
|
|
columnImage: false,
|
|
columnSortable: false,
|
|
sortLv: 0,
|
|
status: true,
|
|
fixed: '',
|
|
columnWidth: 120
|
|
},
|
|
{
|
|
userId: this.$store.state.user.name,
|
|
functionId: 5011,
|
|
serialNumber: '5011Table1ProjectDesc',
|
|
tableId: '5011Table1',
|
|
tableName: '报价信息表',
|
|
columnProp: 'projectDesc',
|
|
headerAlign: 'center',
|
|
align: 'left',
|
|
columnLabel: '项目名称',
|
|
columnHidden: false,
|
|
columnImage: false,
|
|
columnSortable: false,
|
|
sortLv: 0,
|
|
status: true,
|
|
fixed: '',
|
|
columnWidth: 120
|
|
},
|
|
{
|
|
userId: this.$store.state.user.name,
|
|
functionId: 5011,
|
|
serialNumber: '5011Table1QuoterName',
|
|
tableId: '5011Table1',
|
|
tableName: '报价信息表',
|
|
columnProp: 'quoterName',
|
|
headerAlign: 'center',
|
|
align: 'left',
|
|
columnLabel: '报价专员',
|
|
columnHidden: false,
|
|
columnImage: false,
|
|
columnSortable: false,
|
|
sortLv: 0,
|
|
status: true,
|
|
fixed: '',
|
|
columnWidth: 120
|
|
},
|
|
{
|
|
userId: this.$store.state.user.name,
|
|
functionId: 5011,
|
|
serialNumber: '5011Table1PurchaseName',
|
|
tableId: '5011Table1',
|
|
tableName: '报价信息表',
|
|
columnProp: 'purchaseName',
|
|
headerAlign: 'center',
|
|
align: 'left',
|
|
columnLabel: '采购专员',
|
|
columnHidden: false,
|
|
columnImage: false,
|
|
columnSortable: false,
|
|
sortLv: 0,
|
|
status: true,
|
|
fixed: '',
|
|
columnWidth: 120
|
|
},
|
|
{
|
|
userId: this.$store.state.user.name,
|
|
functionId: 5011,
|
|
serialNumber: '5011Table1Status',
|
|
tableId: '5011Table1',
|
|
tableName: '报价信息表',
|
|
columnProp: 'status',
|
|
headerAlign: 'center',
|
|
align: 'center',
|
|
columnLabel: '状态',
|
|
columnHidden: false,
|
|
columnImage: false,
|
|
columnSortable: false,
|
|
sortLv: 0,
|
|
status: true,
|
|
fixed: '',
|
|
columnWidth: 120
|
|
},
|
|
{
|
|
userId: this.$store.state.user.name,
|
|
functionId: 5011,
|
|
serialNumber: '5011Table1NodeName',
|
|
tableId: '5011Table1',
|
|
tableName: '报价信息表',
|
|
columnProp: 'nodeName',
|
|
headerAlign: 'center',
|
|
align: 'center',
|
|
columnLabel: '当前审批节点',
|
|
columnHidden: false,
|
|
columnImage: false,
|
|
columnSortable: false,
|
|
sortLv: 0,
|
|
status: true,
|
|
fixed: '',
|
|
columnWidth: 120
|
|
},
|
|
{
|
|
userId: this.$store.state.user.name,
|
|
functionId: 5011,
|
|
serialNumber: '5011Table1ApprovalUsername',
|
|
tableId: '5011Table1',
|
|
tableName: '报价信息表',
|
|
columnProp: 'approvalUsername',
|
|
headerAlign: 'center',
|
|
align: 'center',
|
|
columnLabel: '当前审批人',
|
|
columnHidden: false,
|
|
columnImage: false,
|
|
columnSortable: false,
|
|
sortLv: 0,
|
|
status: true,
|
|
fixed: '',
|
|
columnWidth: 120
|
|
},
|
|
{
|
|
userId: this.$store.state.user.name,
|
|
functionId: 5011,
|
|
serialNumber: '5011Table1QuoteDate',
|
|
tableId: '5011Table1',
|
|
tableName: '报价信息表',
|
|
columnProp: 'quoteDate',
|
|
headerAlign: 'center',
|
|
align: 'center',
|
|
columnLabel: '报价日期',
|
|
columnHidden: false,
|
|
columnImage: false,
|
|
columnSortable: false,
|
|
sortLv: 0,
|
|
status: true,
|
|
fixed: '',
|
|
columnWidth: 100
|
|
},
|
|
{
|
|
userId: this.$store.state.user.name,
|
|
functionId: 5011,
|
|
serialNumber: '5011Table1CustomerInquiryNo',
|
|
tableId: '5011Table1',
|
|
tableName: '报价信息表',
|
|
columnProp: 'customerInquiryNo',
|
|
headerAlign: 'center',
|
|
align: 'center',
|
|
columnLabel: '客户询价单号',
|
|
columnHidden: false,
|
|
columnImage: false,
|
|
columnSortable: false,
|
|
sortLv: 0,
|
|
status: true,
|
|
fixed: '',
|
|
columnWidth: 120
|
|
},
|
|
{
|
|
userId: this.$store.state.user.name,
|
|
functionId: 5011,
|
|
serialNumber: '5011Table1InsideInquiryNo',
|
|
tableId: '5011Table1',
|
|
tableName: '报价信息表',
|
|
columnProp: 'insideInquiryNo',
|
|
headerAlign: 'center',
|
|
align: 'center',
|
|
columnLabel: '内部询价单号',
|
|
columnHidden: false,
|
|
columnImage: false,
|
|
columnSortable: false,
|
|
sortLv: 0,
|
|
status: true,
|
|
fixed: '',
|
|
columnWidth: 120
|
|
},
|
|
{
|
|
userId: this.$store.state.user.name,
|
|
functionId: 5011,
|
|
serialNumber: '5011Table1CreateBy',
|
|
tableId: '5011Table1',
|
|
tableName: '报价信息表',
|
|
columnProp: 'createBy',
|
|
headerAlign: 'center',
|
|
align: 'center',
|
|
columnLabel: '创建人',
|
|
columnHidden: false,
|
|
columnImage: false,
|
|
columnSortable: false,
|
|
sortLv: 0,
|
|
status: true,
|
|
fixed: '',
|
|
columnWidth: 120
|
|
},
|
|
{
|
|
userId: this.$store.state.user.name,
|
|
functionId: 5011,
|
|
serialNumber: '5011Table1CreateDate',
|
|
tableId: '5011Table1',
|
|
tableName: '报价信息表',
|
|
columnProp: 'createDate',
|
|
headerAlign: 'center',
|
|
align: 'center',
|
|
columnLabel: '创建时间',
|
|
columnHidden: false,
|
|
columnImage: false,
|
|
columnSortable: false,
|
|
sortLv: 0,
|
|
status: true,
|
|
fixed: '',
|
|
columnWidth: 130
|
|
},
|
|
{
|
|
userId: this.$store.state.user.name,
|
|
functionId: 5011,
|
|
serialNumber: '5011Table1UpdateBy',
|
|
tableId: '5011Table1',
|
|
tableName: '报价信息表',
|
|
columnProp: 'updateBy',
|
|
headerAlign: 'center',
|
|
align: 'center',
|
|
columnLabel: '更新人',
|
|
columnHidden: false,
|
|
columnImage: false,
|
|
columnSortable: false,
|
|
sortLv: 0,
|
|
status: true,
|
|
fixed: '',
|
|
columnWidth: 120
|
|
},
|
|
{
|
|
userId: this.$store.state.user.name,
|
|
functionId: 5011,
|
|
serialNumber: '5011Table1UpdateDate',
|
|
tableId: '5011Table1',
|
|
tableName: '报价信息表',
|
|
columnProp: 'updateDate',
|
|
headerAlign: 'center',
|
|
align: 'center',
|
|
columnLabel: '更新时间',
|
|
columnHidden: false,
|
|
columnImage: false,
|
|
columnSortable: false,
|
|
sortLv: 0,
|
|
status: true,
|
|
fixed: '',
|
|
columnWidth: 130
|
|
},
|
|
],
|
|
searchLoading: false,
|
|
saveVisible: false,
|
|
saveLoading: false,
|
|
activeName:'detail2',
|
|
// OA审批相关
|
|
superAdmin: false,
|
|
rejectVisible: false,
|
|
rejectOpinion: '',
|
|
plmQuoteDetailArr: [],
|
|
defaultQuoteDetailRow: null, // 默认报价行数据
|
|
userBuList: [],
|
|
saveRules: {
|
|
buId:[{required: true, message: '请选择BU', trigger: ['blur','change']}],
|
|
customerNo:[{required: true, message: '请输入客户编码', trigger: ['blur','change']}],
|
|
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']}],
|
|
quoteDate:[{required: true, message: '请选择报价日期', trigger: ['blur','change']}],
|
|
quoter:[{required: true, message: '请输入报价专员', trigger: ['blur','change']}],
|
|
},
|
|
customerVisible:false,
|
|
projectVisible:false,
|
|
quoterVisible:false,
|
|
purchaseVisible:false,
|
|
filterVisible:false,
|
|
isFilterSearch: false,
|
|
filterSearchData: {},
|
|
currentQuote:{
|
|
|
|
},
|
|
userVisible:false,
|
|
userTitle:'人员信息',
|
|
user:{
|
|
username:'',
|
|
userDisplay:'',
|
|
active:'',
|
|
buId:null,
|
|
roleNo:'',
|
|
},
|
|
userDataList:[],
|
|
tagNo:undefined,
|
|
insideInquiryVisible:false,
|
|
|
|
detailFlag:false,
|
|
|
|
ossColumns:[
|
|
{
|
|
userId: this.$store.state.user.name,
|
|
functionId: 5011,
|
|
serialNumber: '5011Table2FileName',
|
|
tableId: '5011Table2',
|
|
tableName: '文件信息表',
|
|
columnProp: 'fileName',
|
|
headerAlign: 'center',
|
|
align: 'left',
|
|
columnLabel: '文件名称',
|
|
columnHidden: false,
|
|
columnImage: false,
|
|
columnSortable: false,
|
|
sortLv: 0,
|
|
status: true,
|
|
fixed: '',
|
|
columnWidth: 140
|
|
},
|
|
{
|
|
userId: this.$store.state.user.name,
|
|
functionId: 5011,
|
|
serialNumber: '5011Table2FileRemark',
|
|
tableId: '5011Table2',
|
|
tableName: '文件信息表',
|
|
columnProp: 'fileRemark',
|
|
headerAlign: 'center',
|
|
align: 'left',
|
|
columnLabel: '备注',
|
|
columnHidden: false,
|
|
columnImage: false,
|
|
columnSortable: false,
|
|
sortLv: 0,
|
|
status: true,
|
|
fixed: '',
|
|
columnWidth: 240
|
|
},
|
|
{
|
|
userId: this.$store.state.user.name,
|
|
functionId: 5011,
|
|
serialNumber: '5011Table2CreateDate',
|
|
tableId: '5011Table2',
|
|
tableName: '文件信息表',
|
|
columnProp: 'createDate',
|
|
headerAlign: 'center',
|
|
align: 'center',
|
|
columnLabel: '上传时间',
|
|
columnHidden: false,
|
|
columnImage: false,
|
|
columnSortable: false,
|
|
sortLv: 0,
|
|
status: true,
|
|
fixed: '',
|
|
columnWidth: 140
|
|
},
|
|
{
|
|
userId: this.$store.state.user.name,
|
|
functionId: 5011,
|
|
serialNumber: '5011Table2CreatedBy',
|
|
tableId: '5011Table2',
|
|
tableName: '文件信息表',
|
|
columnProp: 'createBy',
|
|
headerAlign: 'center',
|
|
align: 'center',
|
|
columnLabel: '上传人',
|
|
columnHidden: false,
|
|
columnImage: false,
|
|
columnSortable: false,
|
|
sortLv: 0,
|
|
status: true,
|
|
fixed: '',
|
|
columnWidth: 140
|
|
}
|
|
],
|
|
|
|
insideInquiry:{
|
|
|
|
},
|
|
|
|
insideInquiryList:[],
|
|
priceCheckPropertiesList:[],
|
|
approvalList:[],
|
|
|
|
exportData: [],
|
|
exportName: '项目报价'+this.dayjs().format('YYYYMMDDHHmmss'),
|
|
exportHeader: ["项目报价"],
|
|
exportFooter: [],
|
|
|
|
searchIndex:0,
|
|
// OA审批相关
|
|
submitLoading: false,
|
|
}
|
|
},
|
|
methods:{
|
|
handleSearch(index){
|
|
let params = {
|
|
...this.quoteForm,
|
|
no: this.no,
|
|
size: this.size,
|
|
}
|
|
this.searchLoading = true
|
|
queryQuotePage(params).then(({data})=>{
|
|
if (data && data.code === 0){
|
|
this.dataList = data.rows
|
|
this.total = data.total
|
|
// 加载每个报价的明细首条数据
|
|
this.loadQuoteDetailInfo()
|
|
if (this.dataList[0] !== undefined) {
|
|
this.handleSelect(this.dataList[0])
|
|
} else {
|
|
this.currentQuote = {}
|
|
}
|
|
// if (index !== undefined){
|
|
// this.handleSelect(this.dataList[index])
|
|
// }
|
|
}else {
|
|
this.$message.error(data.msg)
|
|
}
|
|
this.searchLoading = false
|
|
}).catch(error=>{
|
|
this.$message.error(error)
|
|
this.searchLoading = false
|
|
})
|
|
this.isFilterSearch = false
|
|
},
|
|
|
|
loadQuoteDetailInfo(){
|
|
// 批量加载每个报价的首条明细数据
|
|
this.dataList.forEach(quote => {
|
|
queryQuoteGroupDetail({quoteId: quote.id}).then(({data}) => {
|
|
if (data && data.code === 0 && data.rows && data.rows.length > 0) {
|
|
const firstDetail = data.rows[0]
|
|
// 使用$set确保响应式更新
|
|
this.$set(quote, 'plmPartNo', firstDetail.plmPartNo)
|
|
this.$set(quote, 'ifsPartNo', firstDetail.ifsPartNo)
|
|
this.$set(quote, 'partDesc', firstDetail.partDesc)
|
|
} else {
|
|
// 如果没有明细数据,清空这三个字段
|
|
this.$set(quote, 'plmPartNo', '')
|
|
this.$set(quote, 'ifsPartNo', '')
|
|
this.$set(quote, 'partDesc', '')
|
|
}
|
|
}).catch(() => {
|
|
// 忽略错误,只是显示为空
|
|
})
|
|
})
|
|
},
|
|
|
|
// 刷新指定报价的首条明细信息
|
|
handleRefreshQuoteInfo(quoteId){
|
|
console.log('刷新报价明细信息, quoteId:', quoteId)
|
|
// 直接重新查询当前页数据,这样可以确保数据同步
|
|
this.handleSearch()
|
|
},
|
|
|
|
// ========== OA审批相关方法 ==========
|
|
// 校验是否为超级管理员
|
|
checkSuperAdmin() {
|
|
checkSuperAdmin().then(({data}) => {
|
|
this.superAdmin = data.superAdmin
|
|
})
|
|
},
|
|
// 判断当前用户是否是审批人
|
|
isApprovalUser() {
|
|
if (this.superAdmin) return true
|
|
if (!this.currentQuote.approvalUsername) return false
|
|
return this.currentQuote.approvalUsername.split(';').includes(this.$store.state.user.name)
|
|
},
|
|
// 获取流程的配置权限
|
|
async getNodeAuthority() {
|
|
let tempData = {
|
|
site: this.currentQuote.site,
|
|
stepId: this.currentQuote.stepId,
|
|
menuId: this.$route.meta.menuId
|
|
}
|
|
await getNodeAuthority(tempData).then(({data}) => {
|
|
if (data && data.code === 0) {
|
|
this.plmQuoteDetailArr = data.rows.plm_quote_detail || []
|
|
}
|
|
})
|
|
},
|
|
// 获取默认报价行的条目明细数据
|
|
async getDefaultQuoteDetailRow() {
|
|
// 1. 先获取第一个报价明细行(QuoteGroupDetail)
|
|
let groupParams = {
|
|
quoteId: this.currentQuote.id,
|
|
site: this.currentQuote.site,
|
|
}
|
|
const groupRes = await queryQuoteGroupDetail(groupParams)
|
|
if (!groupRes.data || groupRes.data.code !== 0 || !groupRes.data.rows || groupRes.data.rows.length === 0) {
|
|
this.defaultQuoteDetailRow = null
|
|
return
|
|
}
|
|
const firstGroupDetail = groupRes.data.rows[0]
|
|
|
|
// 2. 根据 quoteGroupDetailId 和 currentQuoteDetailItemNo 获取对应的条目明细
|
|
let detailParams = {
|
|
quoteGroupDetailId: firstGroupDetail.id,
|
|
site: this.currentQuote.site,
|
|
}
|
|
const detailRes = await queryQuoteDetail(detailParams)
|
|
if (!detailRes.data || detailRes.data.code !== 0 || !detailRes.data.rows || detailRes.data.rows.length === 0) {
|
|
this.defaultQuoteDetailRow = null
|
|
return
|
|
}
|
|
|
|
// 3. 如果设置了 currentQuoteDetailItemNo,则按 itemNo 匹配,否则取第一条
|
|
const currentItemNo = firstGroupDetail.currentQuoteDetailItemNo
|
|
if (currentItemNo) {
|
|
this.defaultQuoteDetailRow = detailRes.data.rows.find(row => row.itemNo === currentItemNo) || detailRes.data.rows[0]
|
|
} else {
|
|
this.defaultQuoteDetailRow = detailRes.data.rows[0]
|
|
}
|
|
},
|
|
// 同意提交
|
|
agreeSubmit() {
|
|
// 校验默认报价行的必填字段
|
|
if (this.plmQuoteDetailArr && this.plmQuoteDetailArr.length > 0 && this.defaultQuoteDetailRow) {
|
|
for (let i = 0; i < this.plmQuoteDetailArr.length; i++) {
|
|
const field = this.plmQuoteDetailArr[i]
|
|
if (field.required === 'Y' && !this.defaultQuoteDetailRow[field.fieldId] && this.defaultQuoteDetailRow[field.fieldId] !== 0) {
|
|
this.$message.warning(field.fieldName + '不能为空!')
|
|
return
|
|
}
|
|
}
|
|
}
|
|
this.$confirm('是否确认提交?', '提示', {
|
|
confirmButtonText: '确定',
|
|
cancelButtonText: '取消',
|
|
type: 'warning'
|
|
}).then(() => {
|
|
this.submitLoading = true
|
|
let params = {
|
|
...this.currentQuote,
|
|
userName: this.$store.state.user.name,
|
|
nodeConclusion: 'Y',
|
|
menuId: this.$route.meta.menuId
|
|
}
|
|
submitChange(params).then(({data}) => {
|
|
if (data && data.code === 0) {
|
|
this.$message({message: '操作成功', type: 'success'})
|
|
this.saveVisible = false
|
|
this.handleSearch()
|
|
} else {
|
|
this.$alert(data.msg, '错误', {
|
|
confirmButtonText: '确定'
|
|
})
|
|
}
|
|
this.submitLoading = false
|
|
}).catch((error) => {
|
|
this.$message.error(error)
|
|
this.submitLoading = false
|
|
})
|
|
})
|
|
},
|
|
// 驳回提交
|
|
rejectSubmit() {
|
|
// 校验默认报价行的必填字段
|
|
if (this.plmQuoteDetailArr && this.plmQuoteDetailArr.length > 0 && this.defaultQuoteDetailRow) {
|
|
for (let i = 0; i < this.plmQuoteDetailArr.length; i++) {
|
|
const field = this.plmQuoteDetailArr[i]
|
|
if (field.required === 'Y' && !this.defaultQuoteDetailRow[field.fieldId] && this.defaultQuoteDetailRow[field.fieldId] !== 0) {
|
|
this.$message.warning('默认报价行的' + field.fieldName + '不能为空!')
|
|
return
|
|
}
|
|
}
|
|
}
|
|
this.$confirm('是否确认驳回?', '提示', {
|
|
confirmButtonText: '确定',
|
|
cancelButtonText: '取消',
|
|
type: 'warning'
|
|
}).then(() => {
|
|
this.submitLoading = true
|
|
let params = {
|
|
...this.currentQuote,
|
|
userName: this.$store.state.user.name,
|
|
nodeConclusion: 'N',
|
|
rejectOpinion: this.rejectOpinion,
|
|
menuId: this.$route.meta.menuId
|
|
}
|
|
submitChange(params).then(({data}) => {
|
|
if (data && data.code === 0) {
|
|
this.$message({message: '操作成功', type: 'success'})
|
|
this.rejectVisible = false
|
|
this.saveVisible = false
|
|
this.handleSearch()
|
|
} else {
|
|
this.$alert(data.msg, '错误', {
|
|
confirmButtonText: '确定'
|
|
})
|
|
}
|
|
this.submitLoading = false
|
|
}).catch((error) => {
|
|
this.$message.error(error)
|
|
this.submitLoading = false
|
|
})
|
|
})
|
|
},
|
|
// 关闭驳回表单
|
|
closeRejectForm() {
|
|
this.rejectOpinion = ''
|
|
this.rejectVisible = false
|
|
},
|
|
// ========== OA审批相关方法结束 ==========
|
|
|
|
handleSelect(row){
|
|
if (row){
|
|
this.currentQuote = {...row}
|
|
} else {
|
|
this.currentQuote = {}
|
|
}
|
|
},
|
|
|
|
async handleSave(row){
|
|
this.$nextTick(()=>{
|
|
if (this.$refs.saveForm){
|
|
this.$refs.saveForm.clearValidate();
|
|
}
|
|
})
|
|
if (row){
|
|
this.saveQuote = {
|
|
...row
|
|
}
|
|
// 如果是审批中状态,获取权限配置和默认报价行数据
|
|
if (row.status === '审批中') {
|
|
await this.getNodeAuthority()
|
|
await this.getDefaultQuoteDetailRow()
|
|
}
|
|
}else {
|
|
this.saveQuote = {
|
|
...this.quote,
|
|
buNo:'*',
|
|
site:this.$store.state.user.site
|
|
}
|
|
this.$nextTick(()=>{
|
|
this.saveQuote.buId = this.userBuList.length > 0? this.userBuList[0].id:null;
|
|
})
|
|
}
|
|
this.saveVisible = true
|
|
},
|
|
|
|
handleSizeChange(size){
|
|
this.size = size
|
|
if ( this.isFilterSearch === false){
|
|
this.handleSearch()
|
|
} else {
|
|
this.searchByAnyField(this.filterSearchData)
|
|
}
|
|
},
|
|
|
|
handlePageChange(no) {
|
|
this.no = no
|
|
if ( this.isFilterSearch === false){
|
|
this.handleSearch()
|
|
} else {
|
|
this.searchByAnyField(this.filterSearchData)
|
|
}
|
|
},
|
|
handleQueryBu(){
|
|
let params = {
|
|
username: this.$store.state.user.name,
|
|
}
|
|
// getSiteAndBuByUserName(params).then(({data}) => {
|
|
// if (data && data.code === 0) {
|
|
// this.userBuList = data.rows
|
|
// }else {
|
|
// this.$message.warning(data.msg)
|
|
// }
|
|
// }).catch((error)=>{
|
|
// this.$message.error(error)
|
|
// })
|
|
},
|
|
handleSaveOrUpdateQuote(){
|
|
this.$refs.saveForm.validate((valid,obj) => {
|
|
if (valid){
|
|
if (this.saveQuote.id){
|
|
this.handleUpdateQuote();
|
|
}else {
|
|
this.handleSaveQuote();
|
|
}
|
|
}else {
|
|
let i = 1;
|
|
for (let key in obj){
|
|
this.$message.warning(obj[key][0].message)
|
|
if (i === 1){
|
|
return
|
|
}
|
|
i++;
|
|
}
|
|
}
|
|
})
|
|
},
|
|
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.handleSearch(0);
|
|
this.saveLoading = false
|
|
}).catch((error)=>{
|
|
this.$message.error(error)
|
|
this.saveLoading = false
|
|
})
|
|
},
|
|
handleUpdateQuote(){
|
|
let params = {
|
|
...this.saveQuote,
|
|
updateBy: this.$store.state.user.name,
|
|
}
|
|
this.saveLoading = true
|
|
updateQuote(params).then(({data})=>{
|
|
if (data && data.code === 0){
|
|
this.saveVisible = false
|
|
this.currentQuote = {
|
|
...this.currentQuote
|
|
}
|
|
this.$message.success(data.msg)
|
|
}else {
|
|
this.$message.warning(data.msg)
|
|
}
|
|
this.handleSearch();
|
|
this.saveLoading = false
|
|
}).catch((error)=>{
|
|
this.$message.error(error)
|
|
this.saveLoading = false
|
|
})
|
|
},
|
|
handleRemove(row){
|
|
this.$confirm('确认删除该报价信息吗?', '提示', {
|
|
confirmButtonText: '确定',
|
|
cancelButtonText: '取消',
|
|
type: 'warning'
|
|
}).then(() => {
|
|
this.handleRemoveQuote(row)
|
|
}).catch(() => {
|
|
|
|
})
|
|
},
|
|
handleUpdateStatus(row){
|
|
let params = {
|
|
...row
|
|
}
|
|
updateQuoteStatus(params).then(({data})=>{
|
|
if (data && data.code === 0){
|
|
this.$message.success(data.msg)
|
|
this.handleSearch();
|
|
this.currentQuote = {
|
|
...row
|
|
}
|
|
}else {
|
|
this.$message.warning(data.msg)
|
|
}
|
|
}).catch((error)=>{
|
|
this.$message.error(error)
|
|
})
|
|
},
|
|
handleQueryById(row){
|
|
this.saveQuote = {
|
|
...row
|
|
}
|
|
this.detailFlag = true;
|
|
this.saveVisible = true;
|
|
},
|
|
handleRemoveQuote(row){
|
|
let params = {
|
|
id: row.id,
|
|
}
|
|
removeQuote(params).then(({data})=>{
|
|
if (data && data.code === 0){
|
|
this.$message.success(data.msg)
|
|
if (row.id === this.currentQuote.id){
|
|
this.handleSearch(0);
|
|
}else {
|
|
this.handleSearch();
|
|
}
|
|
}else {
|
|
this.$message.warning(data.msg)
|
|
}
|
|
}).catch((error)=>{
|
|
this.$message.error(error)
|
|
})
|
|
},
|
|
customerNoBlur(){
|
|
let params = {
|
|
site:this.$store.state.user.site,
|
|
customerNo:this.saveQuote.customerNo
|
|
}
|
|
queryCustomer(params).then(({data})=>{
|
|
if (data && data.code === 0 ) {
|
|
if (data.rows && data.rows.length === 1){
|
|
this.saveQuote.customerDesc = data.rows[0].customerDesc
|
|
}else {
|
|
this.saveQuote.customerDesc = ''
|
|
}
|
|
}else {
|
|
this.$message.warning(data.msg)
|
|
}
|
|
}).catch((error)=>{
|
|
this.$message.error(error)
|
|
})
|
|
},
|
|
projectNoBlur(){
|
|
let params = {
|
|
site:this.$store.state.user.site,
|
|
customerId:this.saveQuote.customerNo,
|
|
projectId:this.saveQuote.projectNo
|
|
}
|
|
queryProjectByCustomer(params).then(({data})=>{
|
|
if (data && data.code === 0 ){
|
|
if (data.rows && data.rows.length === 1){
|
|
this.saveQuote.projectDesc = data.rows[0].projectName
|
|
this.saveQuote.finalCustomerNo = data.rows[0].finalCustomerId
|
|
this.saveQuote.finalCustomerDesc = data.rows[0].finalCustomerName
|
|
}else {
|
|
this.saveQuote.projectDesc = ''
|
|
this.saveQuote.finalCustomerNo = ''
|
|
this.saveQuote.finalCustomerDesc = ''
|
|
}
|
|
}else {
|
|
this.$message.warning(data.msg)
|
|
}
|
|
}).catch((error)=>{
|
|
this.$message.error(error)
|
|
})
|
|
},
|
|
handleRowClick(row){
|
|
this.currentQuote = {...row}
|
|
},
|
|
userDblClick(row){
|
|
if (this.quoterVisible){
|
|
this.saveQuote.quoter = row.username
|
|
this.quoterVisible = false
|
|
}else if (this.purchaseVisible){
|
|
this.saveQuote.purchase = row.username
|
|
this.purchaseVisible = false
|
|
}
|
|
this.userVisible = false
|
|
},
|
|
handleQuoterClick(){
|
|
this.userTitle = '报价专员'
|
|
this.user.username = this.saveQuote.quoter
|
|
this.user.userDisplay = ''
|
|
this.user.active = ''
|
|
this.user.buId = this.saveQuote.buId
|
|
this.user.roleNo = 'QUOTER'
|
|
this.quoterVisible = true
|
|
this.handleQueryQuoteRoleUser();
|
|
this.userVisible = true
|
|
},
|
|
handlePurchaseClick(){
|
|
this.userTitle = '采购专员'
|
|
this.user.username = this.saveQuote.purchase
|
|
this.user.userDisplay = ''
|
|
this.user.active = ''
|
|
this.user.buId = this.saveQuote.buId
|
|
this.user.roleNo = 'PURCHASE'
|
|
this.purchaseVisible = true
|
|
this.handleQueryQuoteRoleUser();
|
|
this.userVisible = true
|
|
},
|
|
handleQueryQuoteRoleUser(){
|
|
let params = {
|
|
...this.user,
|
|
}
|
|
this.userDataList = []
|
|
queryQuoteRoleUser(params).then(({data})=>{
|
|
if (data && data.code === 0){
|
|
this.userDataList = data.rows
|
|
}else {
|
|
this.$message.warning(data.msg)
|
|
}
|
|
}).catch((error)=>{
|
|
this.$message.error(error)
|
|
})
|
|
},
|
|
getBaseList(val){
|
|
this.tagNo = val
|
|
this.$nextTick(() => {
|
|
let strVal = ''
|
|
let conSql = ''
|
|
if (val === 102) {
|
|
strVal = this.saveQuote.customerNo
|
|
}
|
|
if (val === 104) {
|
|
strVal = this.saveQuote.projectNo
|
|
conSql = " and customer_id = '" + this.saveQuote.customerNo + "'"
|
|
}
|
|
if (val === 2000) {
|
|
strVal = this.saveQuote.purchase
|
|
conSql = " and b.site = '" + this.$store.state.user.site + "'"
|
|
}
|
|
if (val === 2002) {
|
|
strVal = this.saveQuote.quoter
|
|
conSql = " and b.site = '" + this.$store.state.user.site + "'"
|
|
}
|
|
this.$refs.baseList.init(val, strVal, conSql)
|
|
})
|
|
},
|
|
getBaseData(val){
|
|
switch (this.tagNo){
|
|
case 102:
|
|
if (this.saveQuote.customerNo !== val.Customer_no) {
|
|
this.saveQuote.projectNo = '';
|
|
this.saveQuote.projectDesc = '';
|
|
}
|
|
this.saveQuote.customerNo = val.Customer_no
|
|
this.saveQuote.customerDesc = val.Customer_desc
|
|
break;
|
|
case 104:
|
|
this.saveQuote.projectNo = val.project_id
|
|
this.saveQuote.projectDesc = val.project_name
|
|
break;
|
|
case 2000:
|
|
this.saveQuote.purchase = val.username
|
|
this.saveQuote.purchaseName = val.user_display
|
|
break
|
|
case 2002:
|
|
this.saveQuote.quoter = val.username
|
|
this.saveQuote.quoterName = val.user_display
|
|
break;
|
|
}
|
|
},
|
|
handleQueryByIds(){
|
|
let params = {
|
|
ids:this.$route.params.ids,
|
|
no:this.no,
|
|
size:this.size,
|
|
createBy:this.$store.state.user.name,
|
|
}
|
|
queryQuotePage(params).then(({data})=>{
|
|
if (data && data.code === 0){
|
|
this.dataList = data.rows
|
|
this.total = data.total
|
|
if (this.total > 0){
|
|
this.currentQuote = {...this.dataList[0]}
|
|
}else {
|
|
this.currentQuote = {}
|
|
}
|
|
}else {
|
|
this.$message.error(data.msg)
|
|
}
|
|
this.searchLoading = false
|
|
}).catch(error=>{
|
|
this.$message.error(error)
|
|
this.searchLoading = false
|
|
})
|
|
},
|
|
handleInquiryBlur(){
|
|
let params = {
|
|
site:this.$store.state.user.site,
|
|
quotationNo:this.saveQuote.insideInquiryNo,
|
|
}
|
|
searchQuotationByQuotationNo(params).then(({data}) => {
|
|
if (data && data.code === 0){
|
|
if (data.data.length === 1){
|
|
this.dblclickInsideInquiry(data.data[0])
|
|
}
|
|
}
|
|
})
|
|
},
|
|
handleAgainQuote(row){
|
|
let params = {
|
|
id: row.id,
|
|
createBy: this.$store.state.user.name,
|
|
}
|
|
this.queryLoading = true
|
|
againQuote(params).then(({data}) => {
|
|
if (data && data.code === 0) {
|
|
this.$message.success(data.msg)
|
|
this.handleSearch();
|
|
} else {
|
|
this.$message.warning(data.msg)
|
|
this.queryLoading = false
|
|
}
|
|
}).catch((error) => {
|
|
this.$message.error(error)
|
|
this.queryLoading = false
|
|
})
|
|
},
|
|
clearModalData(field){
|
|
this.$set(this.saveQuote,field,'')
|
|
},
|
|
handleQueryInquiry(){
|
|
this.insideInquiry = {
|
|
site:this.$store.state.user.site,
|
|
quotationNo:this.saveQuote.insideInquiryNo,
|
|
quotationBatchNo:'',
|
|
quotationItemNo:'',
|
|
testPartNo:'',
|
|
projectName:'',
|
|
finalCustomerName:'',
|
|
quoterName:'',
|
|
partName:'',
|
|
quotationStatus:'审批中',
|
|
}
|
|
this.searchInsideInquiry();
|
|
this.insideInquiryVisible = true
|
|
},
|
|
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
|
|
},
|
|
searchInsideInquiry(){
|
|
searchQuotationByQuotationNo(this.insideInquiry).then(({data}) => {
|
|
if (data && data.code === 0){
|
|
this.insideInquiryList = data.data;
|
|
}
|
|
})
|
|
},
|
|
getPriceCheckProperties() {
|
|
if (!this.currentQuote && !this.currentQuote.insideInquiryNo){
|
|
this.priceCheckPropertiesList = []
|
|
return
|
|
}
|
|
let params = {
|
|
site: this.saveQuote.site,
|
|
quotationNo: this.currentQuote.insideInquiryNo
|
|
}
|
|
getPriceCheckPropertiesList(params).then(({data}) => {
|
|
if (data && data.code === 0) {
|
|
this.priceCheckPropertiesList = data.rows
|
|
} else {
|
|
this.$message.warning(data.msg)
|
|
}
|
|
}).catch((error) => {
|
|
this.$message.error(error)
|
|
})
|
|
},
|
|
// 查询审批信息
|
|
getApprovalList () {
|
|
let tempData = {
|
|
site: this.$store.state.user.site,
|
|
menuId: this.$route.meta.menuId,
|
|
documentNo: this.currentQuote.quoteVersionNo
|
|
}
|
|
getApprovalList(tempData).then(({data}) => {
|
|
if (data && data.code === 0) {
|
|
this.approvalList = data.rows
|
|
} else {
|
|
this.approvalList = []
|
|
}
|
|
})
|
|
},
|
|
fields() {
|
|
let json = "{"
|
|
this.columns.forEach((item, index) => {
|
|
if (index === this.columns.length - 1) {
|
|
json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
|
|
} else {
|
|
json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
|
|
}
|
|
})
|
|
json += "}"
|
|
return eval("(" + json + ")")
|
|
},
|
|
createExportData() {
|
|
return this.dataList;
|
|
},
|
|
searchByAnyField(params){
|
|
params.site = this.$store.state.user.site
|
|
params.no = this.no
|
|
params.size = this.size
|
|
params.userId = this.$store.state.user.id.toString()
|
|
queryQuotePageByAnyField(params).then(({data})=>{
|
|
if (data && data.code === 0){
|
|
this.dataList = data.page.list
|
|
this.total = data.page.totalCount
|
|
// 加载每个报价的明细首条数据
|
|
this.loadQuoteDetailInfo()
|
|
}else {
|
|
this.$message.warning(data.msg)
|
|
}
|
|
}).catch((error)=>{
|
|
this.$message.error(error)
|
|
})
|
|
this.filterSearchData = params
|
|
this.isFilterSearch = true
|
|
this.filterVisible = false
|
|
},
|
|
// 下达(首次提交到OA)
|
|
handleEditStatus(row) {
|
|
this.$confirm('是否确认下达?', '提示', {
|
|
confirmButtonText: '确定',
|
|
cancelButtonText: '取消',
|
|
type: 'warning'
|
|
}).then(() => {
|
|
this.submitLoading = true
|
|
let params = {
|
|
...row,
|
|
userName: this.$store.state.user.name,
|
|
menuId: this.$route.meta.menuId
|
|
}
|
|
quoteEditStatus(params).then(({data}) => {
|
|
if (data && data.code === 0) {
|
|
this.$message({message: '操作成功', type: 'success'})
|
|
this.handleSearch()
|
|
} else {
|
|
this.$alert(data.msg, '错误', {
|
|
confirmButtonText: '确定'
|
|
})
|
|
}
|
|
this.submitLoading = false
|
|
}).catch((error) => {
|
|
this.$message.error(error)
|
|
this.submitLoading = false
|
|
})
|
|
})
|
|
},
|
|
},
|
|
created() {
|
|
this.checkSuperAdmin() // 校验超级管理员
|
|
// 如果是从OA系统跳转来的(tokenLogin),不在created中查询,由activated处理
|
|
if (this.isMenu && this.searchIndex === 0 && this.$route.params.type !== 'tokenLogin'){
|
|
this.quoteForm = {
|
|
...this.quote,
|
|
site: this.$store.state.user.site,
|
|
createBy: this.$store.state.user.name,
|
|
}
|
|
this.handleQueryBu();// 查询 BU
|
|
this.handleSearch(0);// 查询报价信息
|
|
}
|
|
this.searchIndex++;
|
|
},
|
|
watch:{
|
|
'quoteForm.customerNo'(newVal, oldVal){
|
|
this.quoteForm.customerNo = newVal.toUpperCase()
|
|
},
|
|
'quoteForm.projectNo'(newVal, oldVal){
|
|
this.quoteForm.projectNo = newVal.toUpperCase()
|
|
},
|
|
'quoteForm.quoteNo'(newVal, oldVal){
|
|
this.quoteForm.quoteNo = newVal.toUpperCase()
|
|
},
|
|
'saveQuote.customerNo'(newVal, oldVal){
|
|
if (newVal){
|
|
this.saveQuote.customerNo = newVal.toUpperCase()
|
|
}else {
|
|
this.saveQuote.customerDesc = ''
|
|
this.saveQuote.projectNo = ''
|
|
this.saveQuote.projectDesc = ''
|
|
}
|
|
},
|
|
'saveQuote.projectNo'(newVal, oldVal){
|
|
if (newVal){
|
|
this.saveQuote.projectNo = newVal.toUpperCase()
|
|
this.projectNoBlur();
|
|
}else {
|
|
this.saveQuote.projectDesc = ''
|
|
this.saveQuote.finalCustomerNo = ''
|
|
this.saveQuote.finalCustomerDesc = ''
|
|
}
|
|
},
|
|
'saveQuote.quoter'(newVal, oldVal){
|
|
if (!newVal){
|
|
this.saveQuote.quoterName = ''
|
|
}
|
|
},
|
|
'saveQuote.purchase'(newVal, oldVal){
|
|
if (!newVal){
|
|
this.saveQuote.purchaseName = ''
|
|
}
|
|
},
|
|
saveVisible(newVal, oldVal){
|
|
if (newVal === false){
|
|
this.detailFlag = false;
|
|
}
|
|
},
|
|
'saveQuote.currency'(newVal, oldVal){
|
|
this.saveQuote.currency = newVal.toUpperCase()
|
|
},
|
|
'currentQuote'(newVal, oldVal){
|
|
if (newVal && this.isMenu){
|
|
this.getPriceCheckProperties();
|
|
this.getApprovalList();
|
|
}
|
|
},
|
|
projectNo(newVal, oldVal){
|
|
if (newVal && !this.isMenu){
|
|
this.quoteForm.projectNo = newVal.toUpperCase()
|
|
this.quoteForm.site = this.$store.state.user.site
|
|
this.handleSearch(0);
|
|
}else {
|
|
this.dataList = []
|
|
this.total = 0
|
|
this.no = 1
|
|
}
|
|
},
|
|
},
|
|
activated() {
|
|
if (!this.isMenu){
|
|
return
|
|
}
|
|
if (this.$route.params.ids){
|
|
this.handleQueryByIds();
|
|
} else if (this.$route.params.type === 'tokenLogin') {
|
|
// 从OA系统跳转过来
|
|
if (this.$route.params.docNo) {
|
|
this.quoteForm = {
|
|
...this.quote,
|
|
site: this.$store.state.user.site,
|
|
quoteVersionNo: this.$route.params.docNo,
|
|
}
|
|
}
|
|
this.handleSearch(0);
|
|
} else if (this.$route.params.type === 'project'){
|
|
this.quoteForm = {
|
|
...this.quote,
|
|
site: this.$store.state.user.site,
|
|
quoteVersionNo: this.$route.params.quoteVersionNo,
|
|
}
|
|
this.handleSearch(0);
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<template>
|
|
<div>
|
|
<download-excel v-if="!isMenu"
|
|
:fields="fields()"
|
|
:data="exportData"
|
|
type="xls"
|
|
:name="exportName"
|
|
:header="exportHeader"
|
|
:footer="exportFooter"
|
|
:fetch="createExportData"
|
|
worksheet="导出信息"
|
|
class="el-button el-button--primary el-button--medium">
|
|
{{ '导出' }}
|
|
</download-excel>
|
|
<quote-search v-if="isMenu" v-model:quote="quoteForm" @filterSearch="filterVisible = true" @search="handleSearch" @save="handleSave"></quote-search>
|
|
<quote-table v-loading="searchLoading"
|
|
:current-row="currentQuote"
|
|
:columns="columns"
|
|
style="margin-top: 5px"
|
|
:is-menu="isMenu"
|
|
@save="handleSave"
|
|
@remove="handleRemove"
|
|
@rowClick="handleRowClick"
|
|
@updateStatus="handleUpdateStatus"
|
|
@queryById="handleQueryById"
|
|
@againQuote="handleAgainQuote"
|
|
@editStatus="handleEditStatus"
|
|
:data-list="dataList"
|
|
:height="height">
|
|
|
|
</quote-table>
|
|
<el-pagination @size-change="handleSizeChange"
|
|
@current-change="handlePageChange"
|
|
:current-page="no"
|
|
:page-sizes="[20, 50, 100, 200, 500]"
|
|
:page-size="size"
|
|
:total="total"
|
|
layout="total,sizes, prev, pager, next, jumper">
|
|
</el-pagination>
|
|
<el-tabs v-if="isMenu" v-model="activeName" type="border-card" style="margin-top: 0;" class="customer-tab">
|
|
<el-tab-pane v-if="isAuth('5011:pane:quoteGroupDetail')" label="报价明细" name="detail">
|
|
<quote-group-detail :quote="currentQuote" :auth-flag="false" :height="'28vh'" @refresh-quote-info="handleRefreshQuoteInfo"></quote-group-detail>
|
|
</el-tab-pane>
|
|
<el-tab-pane v-if="isAuth('5011:pane:quoteDetail')" label="条目明细" name="detail2">
|
|
<quote-detail v-if="activeName === 'detail2'" :save-auth="false" :is-export="true" :quote="currentQuote" :auth-flag="false" :height="'30vh'" @refresh-quote-info="handleRefreshQuoteInfo"></quote-detail>
|
|
</el-tab-pane>
|
|
<el-tab-pane v-if="isAuth('5011:pane:quotationProjectInformation')" label="项目信息" name="quotation_project_information">
|
|
<quotation-project-information height="31vh" :quotation-header="currentQuote"></quotation-project-information>
|
|
</el-tab-pane>
|
|
<el-tab-pane v-if="isAuth('5011:pane:customerInfo')" label="客户信息" name="quotation_customer_information">
|
|
<customer-info height="31vh" :project="currentQuote"></customer-info>
|
|
</el-tab-pane>
|
|
<el-tab-pane v-if="isAuth('5011:pane:quotationCustomerContact')" label="客户联系人" name="quotation_customer_contact">
|
|
<quotation-customer-contact height="28vh" :quotation-header="currentQuote"></quotation-customer-contact>
|
|
</el-tab-pane>
|
|
<el-tab-pane v-if="isAuth('5011:pane:ossComponents1')" label="报价-附件信息" name="quote_oss">
|
|
<oss-components
|
|
:save-visible="isAuth('5011:tab6:save')"
|
|
:download-visible="isAuth('5011:tab6:download')"
|
|
:remove-visible="isAuth('5011:tab6:remove')"
|
|
:preview-visible="isAuth('5011:tab6:preview')"
|
|
label="报价单号"
|
|
height="28vh"
|
|
:columns="ossColumns"
|
|
:order-ref1="currentQuote.site?currentQuote.site:''"
|
|
:order-ref2="currentQuote.quoteVersionNo?currentQuote.quoteVersionNo:''">
|
|
</oss-components>
|
|
</el-tab-pane>
|
|
<el-tab-pane v-if="isAuth('5011:pane:priceCheckProperties')" label="询价-基本信息" name="request">
|
|
<price-check-properties ref="tabProperties"
|
|
v-model:data-list="priceCheckPropertiesList"
|
|
height="31vh"></price-check-properties>
|
|
</el-tab-pane>
|
|
<el-tab-pane v-if="isAuth('5011:pane:ossComponents2')" label="询价-附件信息" name="oss">
|
|
<oss-components
|
|
:save-visible="isAuth('102001001:tab6:save')"
|
|
:download-visible="isAuth('102001001:tab6:download')"
|
|
:remove-visible="isAuth('102001001:tab6:remove')"
|
|
:preview-visible="isAuth('102001001:tab6:preview')"
|
|
label="询价单号"
|
|
height="28vh"
|
|
:columns="ossColumns"
|
|
:order-ref1="currentQuote.site"
|
|
:order-ref2="currentQuote.insideInquiryNo?currentQuote.insideInquiryNo.split('-')[0]:''">
|
|
</oss-components>
|
|
</el-tab-pane>
|
|
<!-- 审批信息 -->
|
|
<el-tab-pane v-if="isAuth('5011:pane:approvalInformation')" label="审批信息" name="approvalInformation">
|
|
<approval-information ref="approvalTable" v-model:data-list="approvalList" :height="300"></approval-information>
|
|
</el-tab-pane>
|
|
</el-tabs>
|
|
|
|
<el-dialog :title="saveQuote.id? '报价信息:'+ saveQuote.quoteVersionNo : '报价信息'" v-drag :close-on-click-modal="false" :visible.sync="saveVisible" width="500px" >
|
|
<el-form ref="saveForm" :model="saveQuote" :rules="saveRules" label-position="top" label-width="100px">
|
|
<el-row :gutter="10">
|
|
<el-col :span="8">
|
|
<el-form-item label="内部询价单号" prop="insideInquiryNo" :show-message="false">
|
|
<span slot="label" v-if="!detailFlag">
|
|
<a @click="handleQueryInquiry">内部询价单号</a>
|
|
</span>
|
|
<el-input v-model="saveQuote.insideInquiryNo" readonly @change="handleInquiryBlur" :disabled="detailFlag"></el-input>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="8">
|
|
<el-form-item label="报价日期" prop="quoteDate" :show-message="false">
|
|
<el-date-picker style="width: 100%" :disabled="detailFlag" v-model="saveQuote.quoteDate" type="date" value-format='yyyy-MM-dd' format='yyyy-MM-dd'></el-date-picker>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="8">
|
|
<el-form-item label="客户询价单号" prop="customerInquiryNo" :show-message="false">
|
|
<el-input v-model="saveQuote.customerInquiryNo" :disabled="detailFlag"></el-input>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
<el-row :gutter="10">
|
|
<el-col :span="8">
|
|
<el-form-item label="客户编码" prop="customerNo" :show-message="false">
|
|
<span slot="label" v-if="!detailFlag">
|
|
<a @click="getBaseList(102)">客户编码</a>
|
|
</span>
|
|
<el-input v-model="saveQuote.customerNo" :disabled="detailFlag" @change="customerNoBlur"></el-input>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="16">
|
|
<el-form-item label="客户描述" prop="customerDesc" :show-message="false">
|
|
<el-input v-model="saveQuote.customerDesc" disabled></el-input>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
<el-row :gutter="10">
|
|
<el-col :span="8">
|
|
<el-form-item label="项目号" prop="projectNo" :show-message="false">
|
|
<span slot="label" v-if="saveQuote.customerNo && !detailFlag">
|
|
<a @click="getBaseList(104)">项目号</a>
|
|
</span>
|
|
<el-input v-model="saveQuote.projectNo" :disabled="!saveQuote.customerNo || detailFlag"></el-input>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="16">
|
|
<el-form-item label="项目描述" prop="projectDesc" :show-message="false">
|
|
<el-input v-model="saveQuote.projectDesc" disabled></el-input>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
<el-row :gutter="10">
|
|
<el-col :span="8">
|
|
<el-form-item label="终端客户编码" prop="finalCustomerNo" :show-message="false">
|
|
<el-input v-model="saveQuote.finalCustomerNo" disabled></el-input>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="16">
|
|
<el-form-item label="终端客户描述" prop="finalCustomerDesc" :show-message="false">
|
|
<el-input v-model="saveQuote.finalCustomerDesc" disabled></el-input>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
<el-row :gutter="10">
|
|
<el-col :span="8">
|
|
<el-form-item label="报价专员" prop="quoter" :show-message="false">
|
|
<a slot="label" v-if="!detailFlag" @click="getBaseList(2002)">报价专员</a>
|
|
<el-input v-model="saveQuote.quoterName" readonly :disabled="detailFlag">
|
|
<span slot="suffix" v-show="saveQuote.quoter && !detailFlag" @click="clearModalData('quoter')"><i class="el-icon-circle-close" style="margin-left: 5px;cursor: pointer;"></i></span>
|
|
</el-input>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="8">
|
|
<el-form-item label="采购专员" prop="purchase" :show-message="false">
|
|
<a slot="label" v-if="!detailFlag" @click="getBaseList(2000)">采购专员</a>
|
|
<el-input v-model="saveQuote.purchaseName" readonly :disabled="detailFlag">
|
|
<span slot="suffix" v-show="saveQuote.purchase && !detailFlag" @click="clearModalData('purchase')"><i class="el-icon-circle-close" style="margin-left: 5px;cursor: pointer;"></i></span>
|
|
</el-input>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="8">
|
|
<el-form-item label=" " prop="purchase" :show-message="false">
|
|
<el-checkbox v-model="saveQuote.annualSales" :disabled="detailFlag" true-label="Y" false-label="N">项目年销售额>100M</el-checkbox>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="24">
|
|
<el-form-item label="备注" prop="remark" class="auto" :show-message="false">
|
|
<el-input v-model="saveQuote.remark" :disabled="detailFlag" :rows="3" type="textarea"></el-input>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
</el-form>
|
|
<div slot="footer" class="dialog-footer">
|
|
<el-button type="primary" v-if="!detailFlag" @click="handleSaveOrUpdateQuote">确 定</el-button>
|
|
<el-button @click="saveVisible = false">取 消</el-button>
|
|
<template v-if="saveQuote.status === '审批中' && isApprovalUser()">
|
|
<el-button v-if="isAuth('5011:submit')" type="primary" :loading="submitLoading" @click="agreeSubmit">同意</el-button>
|
|
<el-button v-if="isAuth('5011:reject') && currentQuote.isReject === 'Y'" type="primary" @click="rejectVisible = true">驳回</el-button>
|
|
</template>
|
|
</div>
|
|
</el-dialog>
|
|
|
|
<!-- 驳回意见弹窗 -->
|
|
<el-dialog title="驳回" top="30vh" :close-on-click-modal="false" v-drag :visible.sync="rejectVisible" width="500px" append-to-body>
|
|
<el-form label-position="top">
|
|
<el-form-item label="驳回意见" class="auto">
|
|
<el-input type="textarea" v-model="rejectOpinion" :rows="3"></el-input>
|
|
</el-form-item>
|
|
</el-form>
|
|
<el-footer style="text-align:center;height: 30px;line-height: 30px;">
|
|
<el-button type="primary" :loading="submitLoading" @click="rejectSubmit">确定</el-button>
|
|
<el-button type="primary" @click="closeRejectForm">取消</el-button>
|
|
</el-footer>
|
|
</el-dialog>
|
|
|
|
<el-dialog title="询价申请" v-drag :visible.sync="insideInquiryVisible" width="1000px" modal-append-to-body :close-on-click-modal="false">
|
|
<el-form label-position="top"
|
|
:model="insideInquiry"
|
|
size="mini">
|
|
<el-row :gutter="10">
|
|
<el-col :span="3">
|
|
<el-form-item label="询价单号">
|
|
<el-input v-model="insideInquiry.quotationNo" clearable/>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="3">
|
|
<el-form-item label="申请批次号">
|
|
<el-input v-model="insideInquiry.quotationBatchNo" clearable></el-input>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="3">
|
|
<el-form-item label="序号">
|
|
<el-input v-model="insideInquiry.quotationItemNo" clearable></el-input>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="3">
|
|
<el-form-item label="项目名称">
|
|
<el-input v-model="insideInquiry.projectName" clearable></el-input>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="3">
|
|
<el-form-item label="直接客户名称">
|
|
<el-input v-model="insideInquiry.finalCustomerName" clearable></el-input>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="3">
|
|
<el-form-item label="报价专员">
|
|
<el-input v-model="insideInquiry.quoterName" clearable></el-input>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="3">
|
|
<el-form-item label="状态">
|
|
<el-select v-model="insideInquiry.quotationStatus" style="width:100%">
|
|
<el-option label="全部" value=""></el-option>
|
|
<el-option label="草稿" value="草稿"></el-option>
|
|
<el-option label="审批中" value="审批中"></el-option>
|
|
<el-option label="已完成" value="已完成"></el-option>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="2">
|
|
<el-form-item label=" ">
|
|
<el-button type="primary" style="padding: 3px 12px" @click="searchInsideInquiry">查询</el-button>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
</el-form>
|
|
<el-table :data="insideInquiryList" height="300" stripe border @row-dblclick="dblclickInsideInquiry">
|
|
<el-table-column prop="quotationNo" header-align="center" min-width="120" label="询价单号"/>
|
|
<el-table-column prop="quotationBatchNo" header-align="center" label="询价批次号"/>
|
|
<el-table-column width="60" align="center" header-align="center" prop="quotationItemNo" label="询价序号"/>
|
|
<el-table-column prop="projectName" header-align="center" label="项目名称"/>
|
|
<el-table-column prop="quotationStatus" header-align="center" label="状态"/>
|
|
<el-table-column label="报价专员" header-align="center" prop="quoterName"/>
|
|
<el-table-column label="直接客户编码" header-align="center" prop="finalCustomerId"/>
|
|
<el-table-column label="直接客户名称" header-align="center" prop="finalCustomerName"/>
|
|
</el-table>
|
|
<el-footer style="height:30px;margin-top: 20px;text-align:center">
|
|
<el-button type="primary" @click="insideInquiryVisible = false">关闭</el-button>
|
|
</el-footer>
|
|
</el-dialog>
|
|
|
|
<choose-list ref="baseList" @getBaseData="getBaseData"></choose-list>
|
|
|
|
<filter-search :visible.sync="filterVisible" ref="filter-search" @search="searchByAnyField"></filter-search>
|
|
</div>
|
|
</template>
|
|
|
|
<style scoped>
|
|
.auto /deep/ .el-form-item__content{
|
|
height: auto;
|
|
line-height: 1.5;
|
|
}
|
|
|
|
</style>
|