赫艾前端
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.
 
 
 
 
 

533 lines
17 KiB

<template>
<div class="mod-config pad" style="margin-top: 0px">
<h5 style="margin-left: 20px;font-size: 20px">产品属性</h5>
<el-form :inline="true" style="margin-left: 20px;margin-top: -20px" label-position="top">
<el-form-item :label="'工厂编号:'">
<el-input v-model="searchData.site" readonly style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'产品编码:'" style="margin-left: 20px">
<el-input v-model="searchData.partNo" readonly style="width: 200px"></el-input>
</el-form-item>
<el-form-item :label="'产品名称/规格型号:'" style="margin-left: 20px">
<el-input v-model="partDescription" readonly style="width: 300px"></el-input>
</el-form-item>
<el-form-item :label="''">
<el-button @click="jump()" style="margin-left: 24px;height: 35px;width: 80px" type="primary">关闭</el-button>
</el-form-item>
</el-form>
<el-tabs v-model="activeTable" style="margin-top: 10px; width: 100%;height: 22px;"
type="border-card" @tab-click="tabClick" class="customer-tab">
<el-tab-pane label="属性" name="tab1" >
<el-form :inline="true" style="margin-top: 10px;margin-left: 20px" label-position="top">
<el-form-item :label="'序号:'">
<el-input v-model="num" style="width: 120px" readonly></el-input>
</el-form-item>
<el-form-item :label="'描述:'" style="margin-left: 20px">
<el-input v-model="subCodeDesc" style="width: 200px" readonly></el-input>
</el-form-item>
<el-form-item :label="''">
<el-button @click="lastData()" style="margin-top: 10px;margin-left: 24px;height: 35px;width: 90px" type="primary">上一条</el-button>
</el-form-item>
<el-form-item :label="''">
<el-button @click="nextData()" style="margin-top: 10px;margin-left: 24px;height: 35px;width: 90px" type="primary">下一条</el-button>
</el-form-item>
</el-form>
<el-table
:height="height"
:data="tableData"
border
style="width: 100%;margin-top: 20px">
<el-table-column
prop="propertiesItemNo"
header-align="center"
align="left"
min-width="60"
label="属性编码">
</el-table-column>
<el-table-column
prop="itemDesc"
header-align="center"
align="left"
min-width="60"
label="属性描述">
</el-table-column>
<el-table-column
prop="textValue"
header-align="center"
align="left"
min-width="60"
label="文本值">
</el-table-column>
<el-table-column
prop="numValue"
header-align="center"
align="right"
min-width="60"
label="数字值">
</el-table-column>
<el-table-column
prop="valueType"
header-align="center"
align="left"
min-width="60"
label="属性类型">
</el-table-column>
</el-table>
</el-tab-pane>
<el-tab-pane label="产品结构" name="tab2" >
<el-form :inline="true" style="margin-top: 10px;margin-left: 20px" label-position="top">
<el-form-item :label="'版本号:'">
<el-input v-model="bomRevNo" style="width: 120px" readonly></el-input>
</el-form-item>
<el-form-item :label="''">
<el-button @click="lastBom()" style="margin-top: 10px;margin-left: 24px;height: 35px;width: 90px" type="primary">上一版本</el-button>
</el-form-item>
<el-form-item :label="''">
<el-button @click="nextBom()" style="margin-top: 10px;margin-left: 24px;height: 35px;width: 90px" type="primary">下一版本</el-button>
</el-form-item>
<el-form-item :label="''">
<el-button @click="jumpLastPart()" style="margin-top: 10px;margin-left: 24px;height: 35px;width: 90px" type="primary">回退</el-button>
</el-form-item>
</el-form>
<el-table
:height="height"
:data="bomTable"
border
style="width: 100%;margin-top: 20px">
<el-table-column
prop="componentPartNo"
header-align="center"
align="left"
min-width="40"
label="零部件编码">
<template slot-scope="scope">
<a @click="jumpPart(scope.row.componentPartNo)">{{scope.row.componentPartNo}}</a>
</template>
</el-table-column>
<el-table-column
prop="revNo"
header-align="center"
align="left"
min-width="30"
label="零部件版本">
</el-table-column>
<el-table-column
prop="partDesc"
header-align="center"
align="left"
min-width="100"
label="零部件规格/名称">
</el-table-column>
<el-table-column
prop="qtyAssembly"
header-align="center"
align="right"
min-width="30"
label="单位用量/比例">
</el-table-column>
<el-table-column
prop="qtyFixedScrapt"
header-align="center"
align="right"
min-width="30"
label="调机量">
</el-table-column>
<el-table-column
prop="scraptFactor"
header-align="center"
align="right"
min-width="30"
label="损耗率">
</el-table-column>
<el-table-column
prop="umid"
header-align="center"
align="left"
min-width="30"
label="计量单位">
</el-table-column>
<el-table-column
prop="qtyAssemblyPerRecipe"
header-align="center"
align="right"
min-width="30"
label="配方单位用量">
</el-table-column>
</el-table>
</el-tab-pane>
<el-tab-pane label="工艺路线" name="tab3" >
<el-form :inline="true" style="margin-top: 10px;margin-left: 20px" label-position="top">
<el-form-item :label="'版本号:'">
<el-input v-model="routingRevNo" style="width: 120px" readonly></el-input>
</el-form-item>
<el-form-item :label="''">
<el-button @click="lastRouting()" style="margin-top: 10px;margin-left: 24px;height: 35px;width: 90px" type="primary">上一版本</el-button>
</el-form-item>
<el-form-item :label="''">
<el-button @click="nextRouting()" style="margin-top: 10px;margin-left: 24px;height: 35px;width: 90px" type="primary">下一版本</el-button>
</el-form-item>
</el-form>
<el-table
:height="height"
:data="routingTable"
border
style="width: 100%;margin-top: 20px">
<el-table-column
prop="itemNo"
header-align="center"
align="left"
min-width="60"
label="工序">
</el-table-column>
<el-table-column
prop="operationDesc"
header-align="center"
align="left"
min-width="30"
label="工序名称">
</el-table-column>
<el-table-column
prop="workCenterNo"
header-align="center"
align="left"
min-width="100"
label="加工中心编码">
</el-table-column>
<el-table-column
prop="qtyAssembly"
header-align="center"
align="right"
min-width="30"
label="加工中心名称">
</el-table-column>
<el-table-column
prop="machSetupTime"
header-align="center"
align="right"
min-width="30"
label="准备时间">
</el-table-column>
<el-table-column
prop="machRunFactor"
header-align="center"
align="right"
min-width="30"
label="单位产出量">
</el-table-column>
<el-table-column
prop="factorUnit"
header-align="center"
align="left"
min-width="30"
label="产出单位">
</el-table-column>
</el-table>
</el-tab-pane>
</el-tabs>
</div>
</template>
<script>
import {
getPartSubPropertiesValueData,
getPartSubPropertiesValueHeaderData,
getBomDetailData,
getRoutingDetailData,
getPartData,
} from '@/api/pad.js'
export default {
name: 'padPartAttribute',
data () {
return {
activeTable: 'tab1',
height:200,
tableData:[],
currentData: {},
searchData:{
site:'',
partNo:'',
},
partDescription:'',
num:'',
bomNum:'',
routingNum:'',
subCodeDesc:'',
list:[],
bomList:[],
routingList:[],
bomRevNo:'',
routingRevNo:'',
bomTable:[],
routingTable:[],
lastPart:[],
}
},
mounted () {
this.$nextTick(() => {
this.height = window.innerHeight - 230
})
},
methods: {
getData(){
this.lastPart=[];
this.currentData = JSON.parse(localStorage.getItem("partData"))
this.searchData.partNo = this.currentData.partNo
this.num=1;
this.bomNum=1;
this.routingNum=1;
this.remark=this.currentData.remark;
this.searchData.site= this.currentData.site;
this.partDescription= this.currentData.partDescription+(this.currentData.spec ?'/'+this.currentData.spec:"");
getPartSubPropertiesValueHeaderData(this.searchData).then(({data}) => {
this.list = data.rows;
this.bomList = data.rows2;
this.routingList = data.rows3;
// if(data.rows.length==0){
// this.$alert('该物料没有设置属性!', '错误', {
// confirmButtonText: '确定'
// })
// return false;
// }
this.search();
this.searchBom();
this.searchRouting()
this.subCodeDesc=this.list[this.num-1].subCodeDesc;
})
},
jumpPart(partNo){
let lastPartNo=JSON.parse(JSON.stringify(this.searchData.partNo));
let inData={
site:this.currentData.site,
partNo:partNo,
}
getPartData(inData).then(({data}) => {
this.lastPart.push({site:this.searchData.site,partNo:lastPartNo})
this.searchData.partNo = data.rows[0].partNo
this.num=1;
this.bomNum=1;
this.routingNum=1;
this.remark=data.rows[0].remark;
this.searchData.site= data.rows[0].site;
this.partDescription= data.rows[0].partDescription+'/'+data.rows[0].spec;
getPartSubPropertiesValueHeaderData(this.searchData).then(({data}) => {
this.list = data.rows;
this.bomList = data.rows2;
this.routingList = data.rows3;
// if(data.rows.length==0){
// this.$alert('该物料没有设置属性!', '错误', {
// confirmButtonText: '确定'
// })
// return false;
// }
this.search();
this.searchBom();
this.searchRouting()
this.subCodeDesc=this.list[this.num-1].subCodeDesc;
})
})
},
jumpLastPart(){
if(this.lastPart.length==0){
return false;
}
getPartData(this.lastPart[this.lastPart.length-1]).then(({data}) => {
this.searchData.partNo = data.rows[0].partNo
this.num=1;
this.bomNum=1;
this.routingNum=1;
this.remark=data.rows[0].remark;
this.searchData.site= data.rows[0].site;
this.partDescription= data.rows[0].partDescription+'/'+data.rows[0].spec;
this.lastPart.pop();
getPartSubPropertiesValueHeaderData(this.searchData).then(({data}) => {
this.list = data.rows;
this.bomList = data.rows2;
this.routingList = data.rows3;
// if(data.rows.length==0){
// this.$alert('该物料没有设置属性!', '错误', {
// confirmButtonText: '确定'
// })
// return false;
// }
this.search();
this.searchBom();
this.searchRouting()
if(this.list.length>0) {
this.subCodeDesc = this.list[this.num - 1].subCodeDesc;
}else {
this.subCodeDesc ='';
}
})
})
},
search(){
if( this.list.length==0){
this.tableData =[];
return false;
}
let postData={
site:this.searchData.site,
partNo:this.searchData.partNo,
subCodeSeqNo:this.num,
}
getPartSubPropertiesValueData(postData).then(({data}) => {
this.tableData = data.rows
})
},
searchBom(){
if( this.bomList.length==0){
this.bomTable =[];
this.bomRevNo="";
return false;
}
this.bomRevNo=this.bomList[this.bomNum-1].revNo
let postData={
site:this.searchData.site,
partNo:this.searchData.partNo,
revNo:this.bomList[this.bomNum-1].revNo,
}
getBomDetailData(postData).then(({data}) => {
this.bomTable = data.rows
})
},
searchRouting(){
if( this.routingList.length==0){
this.routingTable =[];
this.routingRevNo='';
return false;
}
this.routingRevNo=this.routingList[this.routingNum-1].revNo
let postData={
site:this.searchData.site,
partNo:this.searchData.partNo,
revNo:this.routingList[this.routingNum-1].revNo,
}
getRoutingDetailData(postData).then(({data}) => {
this.routingTable = data.rows
})
},
jump(){
// this.$router.push('/padPart');
this.$router.back();
},
nextData(){
if(this.list.length==0){
this.$alert('该物料没有设置属性!', '错误', {
confirmButtonText: '确定'
})
return false;
}
if(this.num==this.list.length){
this.num=1;
}else{
this.num=this.num+1;
}
let i=this.num-1;
this.subCodeDesc=this.list[i].subCodeDesc;
this.search();
},
lastData(){
if(this.list.length==0){
this.$alert('该物料没有设置属性!', '错误', {
confirmButtonText: '确定'
})
return false;
}
if(this.num==1){
this.num=this.list.length;
}else{
this.num=this.num-1;
}
let i=this.num-1;
this.subCodeDesc=this.list[i].subCodeDesc;
this.search();
},
nextBom(){
if(this.bomList.length==0){
this.$alert('该物料没有维护bom!', '错误', {
confirmButtonText: '确定'
})
return false;
}
if(this.bomNum==this.bomList.length){
this.bomNum=1;
}else{
this.bomNum=this.bomNum+1;
}
let i=this.bomNum-1;
this.searchBom();
},
lastBom(){
if(this.bomList.length==0){
this.$alert('该物料没有维护bom!', '错误', {
confirmButtonText: '确定'
})
return false;
}
if(this.bomNum==1){
this.bomNum=this.bomList.length;
}else{
this.bomNum=this.bomNum-1;
}
// let i=this.num-1;
// this.subCodeDesc=this.list[i].subCodeDesc;
this.searchBom();
},
nextRouting(){
if(this.routingList.length==0){
this.$alert('该物料没有工艺路线!', '错误', {
confirmButtonText: '确定'
})
return false;
}
if(this.routingNum==this.routingList.length){
this.routingNum=1;
}else{
this.routingNum=this.routingNum+1;
}
let i=this.routingNum-1;
this.searchRouting();
},
lastRouting(){
if(this.routingList.length==0){
this.$alert('该物料没有工艺路线!', '错误', {
confirmButtonText: '确定'
})
return false;
}
if(this.routingNum==1){
this.routingNum=this.routingList.length;
}else{
this.routingNum=this.routingNum-1;
}
// let i=this.num-1;
// this.subCodeDesc=this.list[i].subCodeDesc;
this.searchRouting();
},
// 列表表格选择替换
tabClick (tab, event) {
},
},
created () {
this.getData();
}
}
</script>
<style scoped>
</style>