Browse Source

2024-03-21 报价BOM修改

master
zelian_wu 2 years ago
parent
commit
88e98ebae4
  1. 1
      src/api/quotation/quoteOfBom.js
  2. 2
      src/api/quotation/quoteOfRouting.js
  3. 14
      src/views/modules/quotation/sellForQuotation.vue
  4. 157
      src/views/modules/quotation/sellForQuotation/quotationDetail/billOfMateriel.vue
  5. 144
      src/views/modules/quotation/sellForQuotation/quotationDetail/quoteRouting.vue
  6. 7
      src/views/modules/quotation/sellForQuotation/quoteDetail.vue

1
src/api/quotation/quoteOfBom.js

@ -6,3 +6,4 @@ export const updateQuoteBomList = (data)=>createAPI(`/quote/bom/update`,'post',d
export const searchQuoteBomList = (data)=>createAPI(`/quote/bom/list`,'post',data);
export const searchQuoteBomHeader = (data)=>createAPI(`/quote/bom/header`,'get',data);
export const searchQuoteBOMVersion = (data)=>createAPI(`/quote/bom/version/list`,'post',data);
export const searchQuoteBOMAlternativeNo = (data)=>createAPI(`/quote/bom/version/list`,'post',data);

2
src/api/quotation/quoteOfRouting.js

@ -4,3 +4,5 @@ export const getRoutingTreeStructure = (data)=>createAPI(`/quote/routing/tree/li
export const searchQuoteRoutingHeader = (data)=>createAPI(`/quote/routing/header`,'get',data);
export const updateQuoteRoutingList = (data)=>createAPI(`/quote/routing/update`,'post',data);
export const searchQuoteRoutingList = (data)=>createAPI(`/quote/routing/list`,'post',data);
export const searchQuoteRoutingAlternativeNo = (data)=>createAPI(`/quote/routing/version/list`,'post',data);

14
src/views/modules/quotation/sellForQuotation.vue

@ -62,8 +62,8 @@
<el-button type="primary" @click="insertDiaLogFlag = true"> </el-button>
</el-form-item>
</el-form>
<el-table :data="tableData" v-loading="initQuotationHeaderLoading" element-loading-text = "数据正在加载中"
element-loading-spinner = "el-icon-loading" @row-click="rowClickQuotation" stripe border style="width: 100%;margin-top: 12px" :height="height">
<el-table :data="tableData" v-loading="initQuotationHeaderLoading" :row-style="quotationHeaderRowStyle" element-loading-text = "数据正在加载中"
element-loading-spinner = "el-icon-loading" @row-click="rowClickQuotation" border style="width: 100%;margin-top: 12px" :height="height">
<el-table-column
label="操作"
align="center"
@ -1045,8 +1045,13 @@ export default {
clearCustomer(){
this.insertData.projectId = '';
this.insertData.projectName = '';
},
quotationHeaderRowStyle({row}){
if (row.quotationHeaderId === this.quotationHeader.quotationHeaderId){
return {'background-color': '#E8F7F6', cursor: 'pointer'}
}
},
},
computed:{
},
@ -1088,5 +1093,10 @@ export default {
/deep/ .el-input--mini .el-input__icon{
line-height: 20px;
}
/deep/ .el-table__body tr.current-row > td {
background-color: #E8F7F6 !important;
color: #fff;
}
</style>

157
src/views/modules/quotation/sellForQuotation/quotationDetail/billOfMateriel.vue

@ -1,11 +1,12 @@
<script>
import {
getBomTreeStructure,
getBomTreeStructure, searchQuoteBOMAlternativeNo,
searchQuoteBomList,
searchQuoteBOMVersion,
updateQuoteBomList
} from '../../../../../api/quotation/quoteOfBom'
import {Decimal} from "decimal.js";
import fi from "element-ui/src/locale/lang/fi";
export default {
name:'billOfMateriel',
props:{
@ -207,6 +208,8 @@ export default {
columnWidth: 90,
},
],
versionData:{},
BOMAlternativeList:[],
}
},
methods:{
@ -214,15 +217,17 @@ export default {
//
let params = {
site:this.detail.site,
testPartNo:this.detail.productNo
partId:0,
quoteDetailId:this.detail.quotationDetailId
}
this.treeLoading = true
getBomTreeStructure(params).then(({data})=>{
if (data && data.code === 0){
this.bomTreeStructure = data.rows;
this.$nextTick(()=>{
this.$refs.tree.setCurrentKey(`${this.selectBom[0]}-${this.selectBom[1]}`)
this.$refs.tree.setCurrentKey(`${this.selectBom[0]}-${this.selectBom[1]}-${this.selectBom[2]}-${this.selectBom[3]}-${this.selectBom[4]}-${this.selectBom[5]}`)
})
this.searchQuoteBomList();
}else {
this.$message.warning(data.msg)
}
@ -246,7 +251,7 @@ export default {
}).catch(() => {
this.selectBom = JSON.parse(JSON.stringify(this.copyBom))
this.$nextTick(()=>{
this.$refs.tree.setCurrentKey(`${this.selectBom[0]}-${this.selectBom[1]}`)
this.$refs.tree.setCurrentKey(`${this.selectBom[0]}-${this.selectBom[1]}-${this.selectBom[2]}-${this.selectBom[3]}-${this.selectBom[4]}-${this.selectBom[5]}`)
})
});
},
@ -255,8 +260,8 @@ export default {
site:this.$store.state.user.site,
testPartNo: this.detail.productNo,
version:this.selectBom[0],
bomType:this.selectBom[1],
alternativeNo:this.selectBom[2],
bomType:this.selectBom[2],
alternativeNo:this.selectBom[1],
quoteDetailId:this.detail.quotationDetailId
}
updateQuoteBomList(params).then(({data})=>{
@ -275,20 +280,21 @@ export default {
this.getInventoryPartBom();
return
}
this.selectBom = JSON.parse(JSON.stringify(val))
this.selectBom = val
this.getInventoryPartBom();
this.searchQuoteBomList();
},
searchQuoteBomList(){
let params = {
site:this.$store.state.user.site,
testPartNo: this.detail.productNo,
partNo: this.selectBom[3],
version:this.selectBom[0],
bomType:this.selectBom[1],
alternativeNo:this.selectBom[2],
bomType:this.selectBom[2],
alternativeNo:this.selectBom[1],
id:this.selectBom[4],
quoteDetailId:this.detail.quotationDetailId
}
this.dataListLoading = true;
this.bomDetailList=[];
searchQuoteBomList(params).then(({data})=>{
if (data && data.code === 0){
this.bomDetailList = data.rows
@ -326,37 +332,37 @@ export default {
}, 0)
},
nodeClick(val){
// if (val.list){
// this.$nextTick(()=>{
// this.$refs.tree.setCurrentKey(`${this.selectBom[0]}-${this.selectBom[1]}`)
// })
// return
// }
// let arr = val.value.split('-');
// arr[0] = parseInt(arr[0])
// this.copyBom = JSON.parse(JSON.stringify(this.selectBom))
// this.selectBom = JSON.parse(JSON.stringify(arr))
// if (this.copyBom[0] !== this.selectBom[0] || this.copyBom[1] !== this.selectBom[1]){
// this.changeSelect()
// }
console.log(val)
this.selectBom = val.value.split("-")
this.$nextTick(()=>{
this.$refs.tree.setCurrentKey(`${this.selectBom[0]}-${this.selectBom[1]}`)
this.$refs.tree.setCurrentKey(`${this.selectBom[0]}-${this.selectBom[1]}-${this.selectBom[2]}-${this.selectBom[3]}-${this.selectBom[4]}-${this.selectBom[5]}`)
})
this.searchQuoteBomList()
},
clickVersionCheck(){
this.handoffVersion = !this.handoffVersion;
this.handoffVersion = true;
this.BOMVersionList = [];
this.versionData = {
site:this.detail.site,
partNo:this.selectBom[3],
version:this.selectBom[0],
bomType:this.selectBom[2]
}
this.searchQuoteBOMVersion();
},
searchQuoteBOMVersion(){
let params = {
site:this.detail.site,
quoteDetailId:this.detail.quotationDetailId,
testPartNo:this.detail.productNo,
testPartNo:this.selectBom[3],
}
this.BOMVersionList = [];
searchQuoteBOMVersion(params).then(({data})=>{
if (data && data.code === 0){
this.BOMVersionList = data.rows;
this.selectionVersion();
//
this.searchBOMAlternative(this.versionData);
}else {
this.$message.warning(data.msg)
}
@ -368,7 +374,69 @@ export default {
this.BomVersion = JSON.parse(JSON.stringify(row));
},
searchBOMAlternative(row){
this.BOMAlternativeList = [];
searchQuoteBOMAlternativeNo(row).then(({data})=>{
if (data && data.code === 0){
this.BOMAlternativeList = data.rows;
}else {
this.$message.warning(data.msg)
}
}).catch((error)=>{
this.$message.error(error)
})
},
alternativeRowStyle({row}){
if (row.version === parseInt(this.selectBom[0]) && row.bomType === this.selectBom[2] && row.alternativeNo === this.selectBom[1]){
return {'background-color': '#E8F7F6', cursor: 'pointer'}
}
},
versionRowStyle({row}){
if (row.version === this.versionData.version && row.bomType === this.versionData.bomType){
return {'background-color': '#E8F7F6', cursor: 'pointer'}
}
},
selectionVersion(){
for (let i = 0; i < this.BOMVersionList.length; i++) {
let BOMVersion = this.BOMVersionList[i]
if (BOMVersion.version === this.versionData.version && BOMVersion.bomType === this.versionData.bomType){
this.versionData = BOMVersion;
return
}
}
},
clickVersionTable(row){
this.versionData = row;
this.searchBOMAlternative(row)
},
clickAlternative(row){
let params = {
site:this.detail.site,
quoteDetailId:this.detail.quotationDetailId,
partNo:row.partNo,
version:row.version,
bomType:row.bomType,
id:this.selectBom[4],
parentId:this.selectBom[5],
alternativeNo:row.alternativeNo,
quoteBomDetailList:this.bomDetailList
}
updateQuoteBomList(params).then(({data})=>{
if (data && data.code === 0){
this.selectBom[0] = row.version;
this.selectBom[2] = row.bomType;
this.selectBom[1] = row.alternativeNo;
this.selectBom[3] = row.partNo;
this.selectBom[4] = data.row.id;
this.selectBom[5] = data.row.parentId;
this.$message.success(data.msg)
this.getInventoryPartBom();
this.handoffVersion = false
}else {
this.$message.warning(data.msg)
}
}).catch((error)=>{
this.$message.error(error)
})
},
}
}
@ -376,7 +444,9 @@ export default {
<template>
<div>
<div style="margin-bottom: 5px" v-if="false"><el-button type="primary" @click="clickVersionCheck">切换版本</el-button></div>
<div style="margin-bottom: 5px">
<el-link style="cursor:pointer;" v-if="this.selectBom.length >= 5" @click="clickVersionCheck">切换版本</el-link>
</div>
<el-container>
<el-aside width="24%" style="padding: 0;" :style="{height: height}" v-loading="treeLoading">
<el-tree :data="bomTreeStructure"
@ -385,14 +455,14 @@ export default {
:expand-on-click-node="false"
node-key="value" style="height: 100%"
default-expand-all
:current-node-key="`${selectBom[0]}-${selectBom[1]}`"
:current-node-key="`${selectBom[0]}-${selectBom[1]}-${selectBom[2]}-${selectBom[3]}-${selectBom[4]}-${selectBom[5]}`"
highlight-current ref="tree"
></el-tree>
</el-aside>
<el-main style="padding: 0">
<el-table :data="bomDetailList" :height="height"
stripe border element-loading-text = "数据正在加载中"
v-loading="dataListLoading" style="margin-top: 10px">
v-loading="dataListLoading">
<el-table-column
v-for="(item,index) in columnDetailList" :key="index"
:sortable="item.columnSortable"
@ -411,6 +481,31 @@ export default {
</el-table>
</el-main>
</el-container>
<el-dialog :visible.sync="handoffVersion" v-drag title="BOM版本切换" @close="()=>{
this.BOMVersionList = []
this.BOMAlternativeList = []
}" append-to-body>
<el-table :data="BOMVersionList" :row-style="versionRowStyle" ref="BOMVersionTable" style="margin-top: 8px" border :height="240" @row-click="clickVersionTable">
<el-table-column label="物料编码" prop="partNo" header-align="center" align="center" show-overflow-tooltip min-width="140"/>
<el-table-column label="物料描述" prop="componentPartDesc" header-align="center" align="left" show-overflow-tooltip min-width="200"/>
<el-table-column label="版本" prop="version" header-align="center" align="center" show-overflow-tooltip min-width="60"/>
<el-table-column label="类型" prop="bomType" header-align="center" align="center" show-overflow-tooltip min-width="100"/>
</el-table>
<el-table :data="BOMAlternativeList" :row-style="alternativeRowStyle" border :height="240" style="margin-top: 8px">
<el-table-column label="物料编码" prop="partNo" header-align="center" align="center" show-overflow-tooltip min-width="140"/>
<el-table-column label="物料描述" prop="componentPartDesc" header-align="center" align="left" show-overflow-tooltip min-width="200"/>
<el-table-column label="版本" prop="version" header-align="center" align="center" show-overflow-tooltip min-width="60"/>
<el-table-column label="替代编码" prop="alternativeNo" header-align="center" align="left" show-overflow-tooltip min-width="60"/>
<el-table-column label="类型" prop="bomType" header-align="center" align="center" show-overflow-tooltip min-width="100"/>
<el-table-column label="操作" min-width="80" header-align="center" align="center">
<template slot-scope="{row,$index}">
<span style="color: #888;cursor:no-drop;" v-if="row.version === parseInt(selectBom[0]) && row.bomType === selectBom[2] && row.alternativeNo === selectBom[1]">选择</span>
<el-link style="cursor:pointer;" v-else @click="clickAlternative(row)">选择</el-link>
</template>
</el-table-column>
</el-table>
</el-dialog>
</div>
</template>

144
src/views/modules/quotation/sellForQuotation/quotationDetail/quoteRouting.vue

@ -1,10 +1,14 @@
<script>
import {
getRoutingTreeStructure,
getRoutingTreeStructure, searchQuoteRoutingAlternativeNo,
searchQuoteRoutingList,
updateQuoteRoutingList
} from "../../../../../api/quotation/quoteOfRouting";
import {searchQuoteBomList} from "../../../../../api/quotation/quoteOfBom";
import {
searchQuoteBOMAlternativeNo,
searchQuoteBomList,
searchQuoteBOMVersion
} from "../../../../../api/quotation/quoteOfBom";
export default {
name: "quoteRouting",
@ -20,6 +24,8 @@ export default {
},
data(){
return{
routingAlternativeList:[],
routingVersionList:[],
handoffVersion:false,
treeLoading:false,
routingTreeStructure:[],
@ -288,23 +294,11 @@ export default {
columnWidth: 100,
},
],
versionData:{},
}
},
methods:{
nodeClick(val){
// if (val.list){
// this.$nextTick(()=>{
// this.$refs.tree.setCurrentKey(`${this.selectRouting[0]}-${this.selectRouting[1]}`)
// })
// return
// }
// let arr = val.value.split('-');
// arr[0] = parseInt(arr[0])
// this.copyRouting = JSON.parse(JSON.stringify(this.selectRouting))
// this.selectRouting = JSON.parse(JSON.stringify(arr))
// if (this.copyRouting[0] !== this.selectRouting[0] || this.copyRouting[1] !== this.selectRouting[1]){
// this.changeSelect()
// }
this.$nextTick(()=>{
this.$refs.tree.setCurrentKey(`${this.selectRouting[0]}-${this.selectRouting[1]}`)
})
@ -418,6 +412,101 @@ export default {
default:
this.routingDetailList[i].runTimeDesc = this.routingDetailList[i].runTimeCode;
}
},
alternativeRowStyle({row}){
if (row.version === this.selectRouting[0] && row.routingType === this.selectRouting[1] && row.alternativeNo === this.selectRouting[2]){
return {'background-color': '#E8F7F6', cursor: 'pointer'}
}
},
versionRowStyle({row}){
if (row.version === this.versionData.version && row.routingType === this.versionData.routingType){
return {'background-color': '#E8F7F6', cursor: 'pointer'}
}
},
clickAlternative(row){
let params = {
site:this.$store.state.user.site,
testPartNo: this.detail.productNo,
partNo: this.detail.productNo,
version:row.version,
routingType:row.routingType,
alternativeNo:row.alternativeNo,
quoteDetailId:this.detail.quotationDetailId
}
updateQuoteRoutingList(params).then(({data})=>{
if (data && data.code === 0){
this.selectRouting[0] = row.version;
this.selectRouting[1] = row.routingType;
this.selectRouting[2] = row.alternativeNo;
this.$message.success(data.msg)
this.$nextTick(()=>{
this.$refs.tree.setCurrentKey(`${this.selectRouting[0]}-${this.selectRouting[1]}`)
})
this.searchQuoteRoutingList();
this.handoffVersion = false
}else {
this.$message.warning(data.msg)
}
}).catch((error)=>{
this.$message.error(error)
})
},
clickVersionCheck(){
this.handoffVersion = true;
this.routingVersionList = [];
this.versionData = {
version:this.selectRouting[0],
routingType:this.selectRouting[1]
}
this.searchQuoteRoutingVersion();
},
searchQuoteRoutingVersion(){
let params = {
site:this.detail.site,
quoteDetailId:this.detail.quotationDetailId,
partNo:this.detail.productNo,
}
this.routingVersionList = [];
searchQuoteRoutingAlternativeNo(params).then(({data})=>{
if (data && data.code === 0){
this.routingVersionList = data.rows;
this.selectionVersion();//
//
this.searchRoutingAlternative(this.versionData);
}else {
this.$message.warning(data.msg)
}
})
},
selectionVersion(){
for (let i = 0; i < this.routingVersionList.length; i++) {
let routingVersion = this.routingVersionList[i]
if (routingVersion.version === this.versionData.version && routingVersion.routingType === this.versionData.routingType){
this.versionData = routingVersion;
return
}
}
},
searchRoutingAlternative(row){
let params = {
site:this.detail.site,
quoteDetailId:this.detail.quotationDetailId,
partNo:row.partNo,
version:row.version,
routingType:row.routingType,
alternativeNo:row.alternativeNo,
}
searchQuoteRoutingAlternativeNo(params).then(({data})=>{
if (data && data.code === 0){
this.routingAlternativeList = data.rows;
}else {
this.$message.warning(data.msg)
}
})
},
clickVersionTable(row){
this.versionData = row;
this.searchRoutingAlternative(row)
}
}
}
@ -425,7 +514,7 @@ export default {
<template>
<div>
<div style="margin-bottom: 5px" v-if="false"><el-button type="primary" @click="handoffVersion = !handoffVersion">切换版本</el-button></div>
<div style="margin-bottom: 5px"><el-link @click="clickVersionCheck">切换版本</el-link></div>
<el-container>
<el-aside width="24%" style="padding: 0;" :style="{height: height}" v-loading="treeLoading">
<el-tree :data="routingTreeStructure"
@ -458,7 +547,28 @@ export default {
</el-table>
</el-main>
</el-container>
<el-dialog :visible.sync="handoffVersion" title="工艺版本切换" append-to-body></el-dialog>
<el-dialog :visible.sync="handoffVersion" title="工艺版本切换" append-to-body>
<el-table :data="routingVersionList" :row-style="versionRowStyle" ref="routingVersionTable" style="margin-top: 8px" border :height="240" @row-click="clickVersionTable">
<el-table-column label="物料编码" prop="partNo" header-align="center" align="center" show-overflow-tooltip min-width="140"/>
<el-table-column label="物料描述" prop="partDesc" header-align="center" align="left" show-overflow-tooltip min-width="200"/>
<el-table-column label="版本" prop="version" header-align="center" align="center" show-overflow-tooltip min-width="60"/>
<el-table-column label="类型" prop="routingType" header-align="center" align="center" show-overflow-tooltip min-width="100"/>
</el-table>
<el-table :data="routingAlternativeList" :row-style="alternativeRowStyle" border :height="240" style="margin-top: 8px">
<el-table-column label="物料编码" prop="partNo" header-align="center" align="center" show-overflow-tooltip min-width="140"/>
<el-table-column label="物料描述" prop="partDesc" header-align="center" align="left" show-overflow-tooltip min-width="200"/>
<el-table-column label="版本" prop="version" header-align="center" align="center" show-overflow-tooltip min-width="60"/>
<el-table-column label="替代编码" prop="alternativeNo" header-align="center" align="left" show-overflow-tooltip min-width="60"/>
<el-table-column label="类型" prop="routingType" header-align="center" align="center" show-overflow-tooltip min-width="100"/>
<el-table-column label="操作" min-width="80" header-align="center" align="center">
<template slot-scope="{row,$index}">
<span style="color: #888;cursor:no-drop;" v-if="row.version === selectRouting[0] && row.routingType === selectRouting[1] && row.alternativeNo === selectRouting[2]">选择</span>
<el-link style="cursor:pointer;" v-else @click="clickAlternative(row)">选择</el-link>
</template>
</el-table-column>
</el-table>
</el-dialog>
</div>
</template>

7
src/views/modules/quotation/sellForQuotation/quoteDetail.vue

@ -881,8 +881,11 @@ export default {
let arr = [];
if (row){
arr[0] = row.version;
arr[1] = row.bomType;
arr[2] = row.alternativeNo;
arr[1] = row.alternativeNo;
arr[2] = row.bomType;
arr[3] = row.partNo;
arr[4] = row.id;
arr[5] = row.parentId;
}
this.$refs.bom.setSelectBom(arr);
}else {

Loading…
Cancel
Save