Browse Source

2023-09-28 plm报价提交

master
杨奉源 2 years ago
parent
commit
45a679c82c
  1. 6
      src/api/quotation/quotationInformation.js
  2. 48
      src/views/modules/quotation/quotation_upload_file.vue
  3. 154
      src/views/modules/quotation/requestForQuote.vue

6
src/api/quotation/quotationInformation.js

@ -78,3 +78,9 @@ export const saveCustomerResponse = data => createAPI(`/plm/quotationInformation
* @returns {*}
*/
export const getProjectPartList = data => createAPI(`/plm/quotationInformation/getProjectPartList`,'post',data)
/**
* 检查报价进度
* @param data
* @returns {*}
*/
export const checkQuotationStatus = data => createAPI(`/plm/quotationInformation/checkQuotationStatus`,'post',data)

48
src/views/modules/quotation/quotation_upload_file.vue

@ -5,7 +5,14 @@
<el-row>
<el-col :span="12">
<el-form-item class="customer-item" label="申请单号:" >
<el-input v-model="pageData.quotationNo" style="width: 120px;" disabled ></el-input>
<el-select v-model="pageData.quotationNo" placeholder="请选择" style="width: 120px;">
<el-option
v-for = "item in options"
:key = "item.key"
:label = "item.value"
:value = "item.value">
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
@ -56,7 +63,9 @@ export default {
quotationNo: '',
fileRemark: '',
folder: '',
options: []
},
options: [],
dataListLoading: false,
}
},
@ -65,6 +74,7 @@ export default {
init(currentRow) {
//
this.pageData = JSON.parse(JSON.stringify(currentRow))
this.options = this.pageData.options
this.folder = this.pageData.folder
//
this.visible = true
@ -73,38 +83,42 @@ export default {
beforeUploadHandle(file) {},
/*选择上传文件时*/
onChange(file){
this.fileList.push(file);
this.fileList.push(file)
},
/*关闭modal*/
closeDialog(){
this.fileList = [];
this.fileList = []
//
this.$emit('refreshPageTables');
this.$emit('refreshPageTables')
//
this.visible = false;
this.visible = false
},
/*保修当前的数据*/
saveUploadFile(){
let remark = this.pageData.fileRemark;
if(null == remark || remark == undefined){
let remark = this.pageData.fileRemark
if(remark == null || remark == undefined){
remark = ''
}
/*判断文件是否上传*/
if(null == this.fileList || 0 === this.fileList.length){
this.$message.error("请先上传文件!");
return false;
if(this.fileList == null || this.fileList.length === 0){
this.$message.error("请先上传文件!")
return false
}
const formData = new FormData();
if(this.pageData.quotationNo === '' || this.pageData.quotationNo == null){
this.$message.error("请选择申请单号!")
return false
}
const formData = new FormData()
//
formData.append("file", this.fileList[0].raw);
formData.append("folder", this.folder);
formData.append("orderRef1", this.pageData.site);
formData.append("orderRef2", this.pageData.quotationNo);
formData.append("fileRemark", remark);
formData.append("file", this.fileList[0].raw)
formData.append("folder", this.folder)
formData.append("orderRef1", this.pageData.site)
formData.append("orderRef2", this.pageData.quotationNo)
formData.append("fileRemark", remark)
uploadFile(formData).then(({data}) => {
if (data.code === 0) {
this.$message.success(data.msg)
//
//
this.$refs.uploadFile.clearFiles()
this.pageData.fileRemark = ''
this.fileList = []

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

@ -231,7 +231,7 @@
</el-form>
<el-table
:height="200"
:data="fileContentList"
:data="enterResultData.fileContentList"
border
v-loading="dataListLoading"
style="width: 100%">
@ -405,7 +405,7 @@
<!-- 报价结果页签 -->
<el-tab-pane label="报价结果" name="quotation_result" style="height: 454px">
<el-form :inline="true" label-position="top" :model="quotationResultData" style="margin-left: 10px;margin-top: 5px;">
<el-button v-if="quotationResultData.quotationResultStatus === '' || quotationResultData.quotationResultStatus == null" type="primary" @click="quotationResultModal()">录入报价结果</el-button>
<el-button v-if="quotationResultData.quotationResultStatus === 'C'" type="primary" @click="quotationResultModal()">录入报价结果</el-button>
<el-button v-if="quotationResultData.quotationResultStatus === 'E'" type="primary" @click="submitQuotationModal()">提交客户报价</el-button>
<el-button v-if="quotationResultData.quotationResultStatus === 'S'" type="primary" @click="customerResponseModal()">客户回复</el-button>
</el-form>
@ -513,6 +513,7 @@
saveSubmitResult, //
saveCustomerResponse, //
getProjectPartList, //
checkQuotationStatus //
} from '@/api/quotation/quotationInformation.js'
import Chooselist from '@/views/modules/common/Chooselist'
import quotationUploadFile from "./quotation_upload_file"
@ -637,7 +638,8 @@
actualityQuotationDate: '',
quotationResultInformation: '',
updateBy: this.$store.state.user.name,
quotationResultStatus: ''
quotationResultStatus: '',
fileContentList: []
},
submitResultData: {
site: this.$store.state.user.site,
@ -1662,7 +1664,7 @@
* @param row
*/
quotationClickRow (row) {
this.$refs.quotationTable.toggleRowSelection(row);
// this.$refs.quotationTable.toggleRowSelection(row)
this.quotationCurrentRow = JSON.parse(JSON.stringify(row))
this.quotationDetailData = row
},
@ -1677,24 +1679,72 @@
// ======== ========
/**
* 录入报价结果
* 封装录入方法
*/
quotationResultModal () {
packQuotationResultModal () {
//
this.enterResultData = {
site: this.$store.state.user.site,
// quotationNo: this.quotationCurrentRow.quotationNo,
quotationNo: '',
actualityQuotationDate: '',
quotationResultInformation: '',
quotationResultStatus: 'E',
fileContentList: [],
updateBy: this.$store.state.user.name
}
this.quotationSelections.forEach(val => {
this.enterResultData.quotationNo += ';' + val.quotationNo
//
if (this.quotationSelections.length > 0) {
this.quotationSelections.forEach(val => {
this.enterResultData.quotationNo += ';' + val.quotationNo
})
this.enterResultData.quotationNo = this.enterResultData.quotationNo.substring(1)
} else {
this.enterResultData.quotationNo = this.quotationCurrentRow.quotationNo
}
//
let currentData = {
orderRef1: this.$store.state.user.site,
orderRef2: this.enterResultData.quotationNo
}
getFileContentList(currentData).then(({data}) => {
if (data && data.code === 0) {
this.enterResultData.fileContentList = data.rows
} else {
this.enterResultData.fileContentList = []
}
})
this.enterResultData.quotationNo = this.enterResultData.quotationNo.substring(1)
this.enterResultModalFlag = true
},
/**
* 录入报价结果
*/
quotationResultModal () {
//
if (this.quotationSelections != null && this.quotationSelections.length > 0) {
let tempData = {
currentStatus: 'C',
informationList: this.quotationSelections,
}
//
checkQuotationStatus(tempData).then(({data}) => {
if (data && data.code === 0) {
if (data.flag === 1) { //
this.packQuotationResultModal()
} else if (data.flag === 2) { //
this.$message.warning('进度有误,请再次点击选中行!')
} else {
this.$message.warning('请选择进度一致的报价单进行操作!')
}
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
} else { //
this.packQuotationResultModal()
}
},
/**
* 保存报价结果
*/
@ -1752,10 +1802,11 @@
})
}
},
/**
* 提交客户报价
* 封装提交方法
*/
submitQuotationModal () {
packSubmitQuotationModal () {
this.submitResultData = {
site: this.$store.state.user.site,
quotationNo: this.quotationCurrentRow.quotationNo,
@ -1766,6 +1817,36 @@
}
this.submitResultModalFlag = true
},
/**
* 提交客户报价
*/
submitQuotationModal () {
//
if (this.quotationSelections != null && this.quotationSelections.length > 0) {
let tempData = {
currentStatus: 'E',
informationList: this.quotationSelections,
}
//
checkQuotationStatus(tempData).then(({data}) => {
if (data && data.code === 0) {
if (data.flag === 1) { //
this.packSubmitQuotationModal()
} else if (data.flag === 2) { //
this.$message.warning('进度有误,请再次点击选中行!')
} else {
this.$message.warning('请选择进度一致的报价单进行操作!')
}
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
} else { //
this.packSubmitQuotationModal()
}
},
/**
* 保存提交结果
*/
@ -1796,10 +1877,11 @@
}
})
},
/**
* 客户回复
* 封装回复方法
*/
customerResponseModal () {
packCustomerResponseModal () {
this.customerResponseData = {
site: this.$store.state.user.site,
quotationNo: this.quotationCurrentRow.quotationNo,
@ -1812,6 +1894,36 @@
}
this.customerResponseModalFlag = true
},
/**
* 客户回复
*/
customerResponseModal () {
//
if (this.quotationSelections != null && this.quotationSelections.length > 0) {
let tempData = {
currentStatus: 'S',
informationList: this.quotationSelections,
}
//
checkQuotationStatus(tempData).then(({data}) => {
if (data && data.code === 0) {
if (data.flag === 1) { //
this.packCustomerResponseModal()
} else if (data.flag === 2) { //
this.$message.warning('进度有误,请再次点击选中行!')
} else {
this.$message.warning('请选择进度一致的报价单进行操作!')
}
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
} else { //
this.packCustomerResponseModal()
}
},
/**
* 保存客户回复
*/
@ -1858,9 +1970,9 @@
}
getFileContentList(currentData).then(({data}) => {
if (data && data.code === 0) {
this.fileContentList = data.rows;
this.fileContentList = data.rows
} else {
this.fileContentList = [];
this.fileContentList = []
}
})
},
@ -1872,10 +1984,16 @@
titleCon: '报价附件上传',
site: this.$store.state.user.site,
createBy: this.$store.state.user.name,
quotationNo: this.enterResultData.quotationNo,
quotationNo: '',
fileRemark: '',
folder: 'quotationFile',
};
options: []
}
let num = 0
let arr = this.enterResultData.quotationNo.split(';')
arr.forEach(val => {
currentData.options.push({key: num++, value: val})
})
//
this.$nextTick(() => {
this.$refs.quotationUploadFile.init(currentData);

Loading…
Cancel
Save