|
|
@ -1,5 +1,10 @@ |
|
|
<script> |
|
|
<script> |
|
|
import {queryQuoteDetailBomTree} from "@/api/quote/quoteDetailBomTree"; |
|
|
import {queryQuoteDetailBomTree} from "@/api/quote/quoteDetailBomTree"; |
|
|
|
|
|
import { |
|
|
|
|
|
queryQuoteDetailRouting, |
|
|
|
|
|
queryQuoteDetailRoutingAlternative, changeQuoteDetailRoutingChange, |
|
|
|
|
|
queryQuoteDetailRoutingVersion |
|
|
|
|
|
} from "@/api/quote/quoteDetailRouting"; |
|
|
|
|
|
|
|
|
export default { |
|
|
export default { |
|
|
name: "quoteDetailRouting", |
|
|
name: "quoteDetailRouting", |
|
|
@ -15,8 +20,9 @@ export default { |
|
|
}, |
|
|
}, |
|
|
data(){ |
|
|
data(){ |
|
|
return{ |
|
|
return{ |
|
|
isAllBom:false, |
|
|
|
|
|
|
|
|
isAllRouting:false, |
|
|
dataList:[], |
|
|
dataList:[], |
|
|
|
|
|
queryLoading:false, |
|
|
treeData:[], |
|
|
treeData:[], |
|
|
columns: [ |
|
|
columns: [ |
|
|
{ |
|
|
{ |
|
|
@ -93,7 +99,7 @@ export default { |
|
|
serialNumber: '5011Table5Version', |
|
|
serialNumber: '5011Table5Version', |
|
|
tableId: "5011Table5", |
|
|
tableId: "5011Table5", |
|
|
tableName: "报价工艺信息", |
|
|
tableName: "报价工艺信息", |
|
|
columnProp: 'version', |
|
|
|
|
|
|
|
|
columnProp: 'routingRevision', |
|
|
headerAlign: "center", |
|
|
headerAlign: "center", |
|
|
align: "center", |
|
|
align: "center", |
|
|
columnLabel: '版本', |
|
|
columnLabel: '版本', |
|
|
@ -121,23 +127,6 @@ export default { |
|
|
status: true, |
|
|
status: true, |
|
|
fixed: '', |
|
|
fixed: '', |
|
|
columnWidth: 100, |
|
|
columnWidth: 100, |
|
|
},{ |
|
|
|
|
|
userId: this.$store.state.user.name, |
|
|
|
|
|
functionId: 5011, |
|
|
|
|
|
serialNumber: '5011Table5AlternativeDesc', |
|
|
|
|
|
tableId: "5011Table5", |
|
|
|
|
|
tableName: "报价工艺信息", |
|
|
|
|
|
columnProp: 'alternativeDesc', |
|
|
|
|
|
headerAlign: "center", |
|
|
|
|
|
align: "left", |
|
|
|
|
|
columnLabel: '替代描述', |
|
|
|
|
|
columnHidden: false, |
|
|
|
|
|
columnImage: false, |
|
|
|
|
|
columnSortable: false, |
|
|
|
|
|
sortLv: 0, |
|
|
|
|
|
status: true, |
|
|
|
|
|
fixed: '', |
|
|
|
|
|
columnWidth: 120, |
|
|
|
|
|
},{ |
|
|
},{ |
|
|
userId: this.$store.state.user.name, |
|
|
userId: this.$store.state.user.name, |
|
|
functionId: 5011, |
|
|
functionId: 5011, |
|
|
@ -470,6 +459,12 @@ export default { |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
queryTreeLoading:false, |
|
|
queryTreeLoading:false, |
|
|
|
|
|
versionVisible:false, |
|
|
|
|
|
versionList:[], |
|
|
|
|
|
alternativeList:[], |
|
|
|
|
|
routing:{ |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
methods:{ |
|
|
methods:{ |
|
|
@ -484,7 +479,7 @@ export default { |
|
|
if (this.treeData.length > 0){ |
|
|
if (this.treeData.length > 0){ |
|
|
this.$nextTick(()=>{ |
|
|
this.$nextTick(()=>{ |
|
|
this.$refs.tree.setCurrentKey(this.treeData[0].id); |
|
|
this.$refs.tree.setCurrentKey(this.treeData[0].id); |
|
|
|
|
|
|
|
|
|
|
|
this.handleQueryDetailRouting(); |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
this.queryTreeLoading = false; |
|
|
this.queryTreeLoading = false; |
|
|
@ -497,8 +492,125 @@ export default { |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
nodeClick(data){ |
|
|
nodeClick(data){ |
|
|
|
|
|
|
|
|
|
|
|
this.handleQueryDetailRouting(); |
|
|
}, |
|
|
}, |
|
|
|
|
|
handleQueryDetailRouting(){ |
|
|
|
|
|
let node = this.$refs.tree.getCurrentNode(); |
|
|
|
|
|
let params = { |
|
|
|
|
|
treeId:node.id, |
|
|
|
|
|
quoteDetailId: this.quoteDetail.id, |
|
|
|
|
|
isAllRouting: this.isAllRouting, |
|
|
|
|
|
} |
|
|
|
|
|
this.queryLoading = true; |
|
|
|
|
|
queryQuoteDetailRouting(params).then(({data})=>{ |
|
|
|
|
|
if (data && data.code === 0){ |
|
|
|
|
|
this.dataList = data.rows; |
|
|
|
|
|
}else { |
|
|
|
|
|
this.$message.warning(data.msg); |
|
|
|
|
|
} |
|
|
|
|
|
this.queryLoading = false; |
|
|
|
|
|
}).catch((error)=>{ |
|
|
|
|
|
this.$message.error(error); |
|
|
|
|
|
this.queryLoading = false; |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
handleChangeVersion(){ |
|
|
|
|
|
let node = this.$refs.tree.getCurrentNode(); |
|
|
|
|
|
let row = { |
|
|
|
|
|
routingRevision:null, |
|
|
|
|
|
alternativeNo: '', |
|
|
|
|
|
routingType: null, |
|
|
|
|
|
} |
|
|
|
|
|
if (this.dataList.length > 0){ |
|
|
|
|
|
row = this.dataList[0]; |
|
|
|
|
|
} |
|
|
|
|
|
this.routing = { |
|
|
|
|
|
partNo: node.partNo, |
|
|
|
|
|
buNo: node.buNo, |
|
|
|
|
|
site: node.site, |
|
|
|
|
|
routingType: row.routingType, |
|
|
|
|
|
routingRevision: row.routingRevision, |
|
|
|
|
|
alternativeNo: row.alternativeNo, |
|
|
|
|
|
} |
|
|
|
|
|
this.handleQueryVersionList(); |
|
|
|
|
|
this.versionVisible = true; |
|
|
|
|
|
}, |
|
|
|
|
|
versionRowStyle({row}){ |
|
|
|
|
|
if (row.routingRevision === this.routing.routingRevision){ |
|
|
|
|
|
return { 'background-color': '#E8F7F6' }; |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
handleQueryVersionList(){ |
|
|
|
|
|
let node = this.$refs.tree.getCurrentNode(); |
|
|
|
|
|
let params = { |
|
|
|
|
|
treeId: node.id, |
|
|
|
|
|
routingType: this.routing.routingType, |
|
|
|
|
|
} |
|
|
|
|
|
queryQuoteDetailRoutingVersion(params).then(({data})=>{ |
|
|
|
|
|
if (data && data.code === 0){ |
|
|
|
|
|
this.versionList = data.rows; |
|
|
|
|
|
if (this.versionList.length > 0){ |
|
|
|
|
|
this.handleQueryAlternativeList(); |
|
|
|
|
|
} |
|
|
|
|
|
}else { |
|
|
|
|
|
this.$message.warning(data.msg); |
|
|
|
|
|
} |
|
|
|
|
|
}).catch((error)=>{ |
|
|
|
|
|
this.$message.error(error); |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
handleQueryAlternativeList(){ |
|
|
|
|
|
let params = { |
|
|
|
|
|
...this.routing, |
|
|
|
|
|
} |
|
|
|
|
|
queryQuoteDetailRoutingAlternative(params).then(({data})=>{ |
|
|
|
|
|
if (data && data.code === 0){ |
|
|
|
|
|
this.alternativeList = data.rows; |
|
|
|
|
|
}else { |
|
|
|
|
|
this.$message.warning(data.msg); |
|
|
|
|
|
} |
|
|
|
|
|
}).catch((error)=>{ |
|
|
|
|
|
this.$message.error(error); |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
versionRowClick(row){ |
|
|
|
|
|
this.routing.routingRevision = row.routingRevision; |
|
|
|
|
|
}, |
|
|
|
|
|
alternativeRowStyle({row}){ |
|
|
|
|
|
if (this.dataList.length > 0){ |
|
|
|
|
|
if (this.dataList[0].alternativeNo === row.alternativeNo && this.dataList[0].routingRevision === row.routingRevision){ |
|
|
|
|
|
return { 'background-color': '#E8F7F6' }; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
changeRouting(row){ |
|
|
|
|
|
let params = { |
|
|
|
|
|
quoteId: this.quoteDetail.quoteId, |
|
|
|
|
|
quoteDetailId: this.quoteDetail.id, |
|
|
|
|
|
quoteDetailItemNo:this.quoteDetail.itemNo, |
|
|
|
|
|
site: row.site, |
|
|
|
|
|
partNo: row.partNo, |
|
|
|
|
|
buNo: row.buNo, |
|
|
|
|
|
quoteNo: this.quoteDetail.quoteNo, |
|
|
|
|
|
routingType: row.routingType, |
|
|
|
|
|
routingRevision: row.routingRevision, |
|
|
|
|
|
alternativeNo: row.alternativeNo, |
|
|
|
|
|
treeId: this.$refs.tree.getCurrentNode().id, |
|
|
|
|
|
createBy: this.$store.state.user.name, |
|
|
|
|
|
} |
|
|
|
|
|
changeQuoteDetailRoutingChange(params).then(({data})=>{ |
|
|
|
|
|
if (data && data.code === 0){ |
|
|
|
|
|
this.$message.success(data.msg); |
|
|
|
|
|
this.versionVisible = false; |
|
|
|
|
|
this.handleQueryDetailRouting(); |
|
|
|
|
|
}else { |
|
|
|
|
|
this.$message.warning(data.msg); |
|
|
|
|
|
} |
|
|
|
|
|
}).catch((error)=>{ |
|
|
|
|
|
this.$message.error(error) |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
}, |
|
|
}, |
|
|
created() { |
|
|
created() { |
|
|
if (this.quoteDetail && this.quoteDetail.id){ |
|
|
if (this.quoteDetail && this.quoteDetail.id){ |
|
|
@ -509,6 +621,12 @@ export default { |
|
|
'quoteDetail.id'(newVal,oldVal){ |
|
|
'quoteDetail.id'(newVal,oldVal){ |
|
|
this.handleQueryQuoteDetailBomTree(); |
|
|
this.handleQueryQuoteDetailBomTree(); |
|
|
}, |
|
|
}, |
|
|
|
|
|
isAllRouting(newVal,oldVal){ |
|
|
|
|
|
this.handleQueryDetailRouting(); |
|
|
|
|
|
}, |
|
|
|
|
|
'routing.routingRevision'(newVal,oldVal){ |
|
|
|
|
|
this.handleQueryAlternativeList(); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
</script> |
|
|
</script> |
|
|
@ -516,8 +634,8 @@ export default { |
|
|
<template> |
|
|
<template> |
|
|
<div> |
|
|
<div> |
|
|
<div style="margin-bottom: 10px"> |
|
|
<div style="margin-bottom: 10px"> |
|
|
<el-link style="margin-right: 20px">切换版本</el-link> |
|
|
|
|
|
<el-checkbox v-model="isAllBom">全级Routing结构</el-checkbox> |
|
|
|
|
|
|
|
|
<el-link style="margin-right: 20px;cursor:pointer;" @click="handleChangeVersion">切换版本</el-link> |
|
|
|
|
|
<el-checkbox v-model="isAllRouting">全级Routing结构</el-checkbox> |
|
|
</div> |
|
|
</div> |
|
|
<el-container> |
|
|
<el-container> |
|
|
<el-aside width="300px" v-loading="queryTreeLoading"> |
|
|
<el-aside width="300px" v-loading="queryTreeLoading"> |
|
|
@ -533,7 +651,7 @@ export default { |
|
|
</el-tree> |
|
|
</el-tree> |
|
|
</el-aside> |
|
|
</el-aside> |
|
|
<el-main style="padding: 0"> |
|
|
<el-main style="padding: 0"> |
|
|
<el-table :data="dataList" border style="width: 100%" :height="420"> |
|
|
|
|
|
|
|
|
<el-table :data="dataList" v-loading="queryLoading" border style="width: 100%" :height="420"> |
|
|
<el-table-column |
|
|
<el-table-column |
|
|
v-for="(item,index) in columns" :key="index" |
|
|
v-for="(item,index) in columns" :key="index" |
|
|
:sortable="item.columnSortable" |
|
|
:sortable="item.columnSortable" |
|
|
@ -552,6 +670,28 @@ export default { |
|
|
</el-table> |
|
|
</el-table> |
|
|
</el-main> |
|
|
</el-main> |
|
|
</el-container> |
|
|
</el-container> |
|
|
|
|
|
|
|
|
|
|
|
<el-dialog title="切换版本" :visible.sync="versionVisible" width="1000px" v-drag :close-on-click-modal="false" append-to-body> |
|
|
|
|
|
<el-table :data="versionList" :row-style="versionRowStyle" ref="routingVersionTable" style="margin-top: 8px" border :height="240" @row-click="versionRowClick"> |
|
|
|
|
|
<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="routingRevision" 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="alternativeList" :row-style="alternativeRowStyle" ref="routingAlternativeTable" 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="routingRevision" 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="routingRevision" 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}"> |
|
|
|
|
|
<a @click="changeRouting(row)">选择</a> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
</el-table> |
|
|
|
|
|
</el-dialog> |
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
|