@@ -67,7 +67,7 @@
< el-row >
< el-col :span = "4" >
< span > 物料类型 : < / span >
< el-select v-model = "materielValue" size="small" style="margin-top: 20px;width:10 0px" placeholder="物料类型" @change="clear()" >
< el-select v-model = "materielValue" size="small" style="margin-top: 20px;width:12 0px" placeholder="物料类型" @change="clear()" >
< el -option
v-for = "item in materiel"
:key = "item.value"
@@ -75,22 +75,54 @@
:value = "item.value" / >
< / el-select >
< / el-col >
< el-col v-show = "materielValue==='1'" :span="20" >
< el-col v-show = "materielValue==='1'||materielValue==='6'||materielValue==='7'||materielValue==='8'" :span="20" >
< span > 直径 : < / span >
< el-input-number v-model = "diameter" size="small" controls-position="right" style="width:100px;margin-top:20px;" />
< span > 长度 : < / span >
< el-input-number v-model = "height2" size="small" controls-position="right" style="width:100px;margin-top:20px;" />
< el -button style = "margin-top: 20px;margin-left: 10px;" type = "primary" size = "small" @click ="Calculation1()" > 计算重量 < / el -button >
∮ ° # □ ∥ ± × Ⅰ Ⅱ Ⅲ ⊥ % ■ ∠ mm ◎ ○ δ μm / ◇ ( )
< el-button style = "margin-top: 20px;margin-left: 10px;" type = "primary" size = "small" @click ="insertThestring()" > 计算重量 < / el -button >
< / el-col >
< el-col v-show = "materielValue==='2'||materielValue==='9'||materielValue==='10'||materielValue==='11'" :span="20" >
< span > 长 : < / span >
< el-input-number v-model = "Length" size="small" controls-position="right" style="width:100px;margin-top:20px;" />
< span > 宽 : < / span >
< el-input-number v-model = "Width" size="small" controls-position="right" style="width:100px;margin-top:20px;" />
< span > 高 : < / span >
< span > 厚 : < / span >
< el-input-number v-model = "height1" size="small" controls-position="right" style="width:100px;margin-top:20px;" />
< el -button style = "margin-top: 20px;margin-left: 10px;" type = "primary" size = "small" @click ="Calculation1()" > 计算重量 < / el -button >
< / el-col >
< el-col v-show = "materielValue==='2'" :span="20" >
< span > 直径 : < / span >
< el-input-number v-model = "diameter" size="small" controls-position="right" style="width:100px;margin-top:20px;" />
< span > 高 : < / span >
< el-input-number v-model = "height2" size="small" controls-position="right" style="width:100px;margin-top:20px;" />
< el -button style = "margin-top: 20px;margin-left: 10px;" type = "primary" size = "small" @click ="Calculation2()" > 计算重量 < / el -button >
< / el-col >
< el-col v-show = "materielValue==='3'" :span="20" >
< span > 对边宽 : < / span >
< el-input-number v-model = "OppositeSideWidth" size="small" controls-position="right" style="width:100px;margin-top:20px;" />
< span > 长度 : < / span >
< el-input-number v-model = "length2" size="small" controls-position="right" style="width:100px;margin-top:20px;" />
< el -button style = "margin-top: 20px;margin-left: 10px;" type = "primary" size = "small" @click ="Calculation3()" > 计算重量 < / el -button >
< / el-col >
< el-col v-show = "materielValue==='4'" :span="20" >
< span > 边宽 : < / span >
< el-input-number v-model = "biankuan" size="small" controls-position="right" style="width:100px;margin-top:20px;" />
< span > 边厚 : < / span >
< el-input-number v-model = "bianhou" size="small" controls-position="right" style="width:100px;margin-top:20px;" />
< span > 长度 : < / span >
< el-input-number v-model = "changdu" size="small" controls-position="right" style="width:100px;margin-top:20px;" />
< el -button style = "margin-top: 20px;margin-left: 10px;" type = "primary" size = "small" @click ="Calculation4()" > 计算重量 < / el -button >
< / el-col >
< el-col v-show = "materielValue==='5'" :span="20" >
< span > 壁厚 : < / span >
< el-input-number v-model = "bihou" size="small" controls-position="right" style="width:100px;margin-top:20px;" />
< span > 外径 : < / span >
< el-input-number v-model = "waijing" size="small" controls-position="right" style="width:100px;margin-top:20px;" />
< span > 长度 : < / span >
< el-input-number v-model = "changdu2" size="small" controls-position="right" style="width:100px;margin-top:20px;" />
< el -button style = "margin-top: 20px;margin-left: 10px;" type = "primary" size = "small" @click ="Calculation5()" > 计算重量 < / el -button >
< / el-col >
< / el-row >
< / div >
< / el-card >
@@ -112,7 +144,7 @@
< el -button style = "margin:10px" type = "primary" size = "small" @click ="calTol()" > 计算公差 < / el -button >
< el-button-group v-if = "isShow1" style="margin: 10px" >
< el -button v-if = "isShow1" type="info" size="small" icon="el-icon-document" @click="pasteTable" > 粘贴 < / el -button >
< el-button :disabled= "disabled" type= "warning" size= "small" icon= "el-icon-tickets" @click ="DYbtn" > 典艺
< el-button v-if = "false" :disabled= "disabled" type= "warning" size= "small" icon= "el-icon-tickets" @click="DYbtn"> 典艺
< / el -button >
< el-button :disabled = "disabled" type = "warning" size = "small" icon = "el-icon-tickets" @click ="WYbtn" > 完艺
< / el -button >
@@ -563,22 +595,60 @@ export default {
} ,
data ( ) {
return {
lastFocusText : '' ,
Result1 : '' ,
Result2 : '' ,
Result3 : '' ,
Result4 : '' ,
Result5 : '' ,
Length : '' ,
Width : '' ,
height1 : '' ,
diameter : '' ,
height2 : '' ,
OppositeSideWidth : '' ,
length2 : '' ,
biankuan : '' ,
bianhou : '' ,
changdu : '' ,
bihou : '' ,
waijing : '' ,
changdu2 : '' ,
materielValue : '1' ,
materiel : [ {
value : '1' ,
label : '方 '
label : '园钢 '
} , {
value : '2' ,
label : '柱 '
label : '钢板 '
} , {
value : '3' ,
label : '六角钢'
} , {
value : '4' ,
label : '角钢'
} , {
value : '5' ,
label : '钢管'
} , {
value : '6' ,
label : '园紫铜棒'
} , {
value : '7' ,
label : '园黄铜棒'
} , {
value : '8' ,
label : '园铝棒'
} , {
value : '9' ,
label : '紫铜板'
} , {
value : '10' ,
label : '黄铜板'
} , {
value : '11' ,
label : '6061铝板'
} ] ,
materielValue : '1' ,
total : 0 ,
pageCurrent : 1 ,
pageSize : 10 ,
@@ -688,31 +758,122 @@ export default {
this . height1 = ''
this . diameter = ''
this . height2 = ''
this . OppositeSideWidth = ''
this . biankuan = ''
this . bianhou = ''
this . changdu = ''
this . bihou = ''
this . waijing = ''
this . changdu2 = ''
} ,
// 长宽 高计算
// 直径 高计算
Calculation1 ( ) {
if ( this . partNumValue === '' || this . partNumValue === null ) {
this . $message . error ( '请先选择一个零件' )
} else {
this . Result1 = '长:' + this . Length + ' 宽:' + this . Width + ' 高:' + this . height1 + ' 重量:' + parseInt ( this . Length ) * parseInt ( this . Width ) * parseFloat ( this . height1 )
WeightCopy ( this . partNumValue , this . Result1 ) . then ( response => {
this . searchDetail ( )
} )
if ( this . materielValue === '1' ) {
this . Result2 = '物料:' + this . materiel [ 1 ] . label + ' 直径:' + this . diameter + 'mm 长度:' + this . height2 + 'mm 重量:' + 0.00617 * 0.001 * parseInt ( this . diameter ) * parseInt ( this . diameter ) * parseFloat ( this . height2 ) + 'kg'
WeightCopy ( this . partNumValue , this . Result2 ) . then ( response => {
this . searchDetail ( )
} )
}
if ( this . materielValue === '6' ) {
this . Result2 = '物料:' + this . materiel [ 6 ] . label + ' 直径:' + this . diameter + 'mm 长度:' + this . height2 + 'mm 重量:' + 0.00698 * 0.001 * parseInt ( this . diameter ) * parseInt ( this . diameter ) * parseFloat ( this . height2 ) + 'kg'
WeightCopy ( this . partNumValue , this . Result2 ) . then ( response => {
this . searchDetail ( )
} )
}
if ( this . materielValue === '7' ) {
this . Result2 = '物料:' + this . materiel [ 7 ] . label + ' 直径:' + this . diameter + 'mm 长度:' + this . height2 + 'mm 重量:' + 0.00668 * 0.001 * parseInt ( this . diameter ) * parseInt ( this . diameter ) * parseFloat ( this . height2 ) + 'kg'
WeightCopy ( this . partNumValue , this . Result2 ) . then ( response => {
this . searchDetail ( )
} )
}
if ( this . materielValue === '8' ) {
this . Result2 = '物料:' + this . materiel [ 8 ] . label + ' 直径:' + this . diameter + 'mm 长度:' + this . height2 + 'mm 重量:' + 0.0022 * 0.001 * parseInt ( this . diameter ) * parseInt ( this . diameter ) * parseFloat ( this . height2 ) + 'kg'
WeightCopy ( this . partNumValue , this . Result2 ) . then ( response => {
this . searchDetail ( )
} )
}
}
} ,
// 直径 高计算
// 长宽 高计算
Calculation2 ( ) {
if ( this . partNumValue === '' || this . partNumValue === null ) {
this . $message . error ( '请先选择一个零件' )
} else {
this . Result2 = Math . pow ( parseInt ( this . diameter ) / 2 , 2 ) * parseFloat ( this . height2 ) * Math . PI
this . Result2 = this . Result2 . toFixed ( 2 )
this . Result3 = '直径:' + this . diameter + ' 高:' + this . height2 + ' 重量:' + this . R esult2
WeightCopy ( this . partNumValue , this . Result3 ) . then ( response => {
this . searchDetail ( )
} )
if ( this . materielValue === '2' ) {
this . Result1 = '物料:' + this . materiel [ 2 ] . label + ' 长:' + this . Length + 'mm 宽:' + this . Width + 'mm 厚:' + this . height1 + 'mm 重量:' + 0.001 * 0.00785 * parseInt ( this . Length ) * parseInt ( this . Width ) * parseFloat ( this . height1 ) + 'kg'
WeightCopy ( this . partNumValue , this . Result1 ) . then ( r esponse => {
this . searchDetail ( )
} )
}
if ( this . materielValue === '9' ) {
this . Result1 = '物料:' + this . materiel [ 9 ] . label + ' 长:' + this . Length + 'mm 宽:' + this . Width + 'mm 厚:' + this . height1 + 'mm 重量:' + 0.001 * 0.0089 * parseInt ( this . Length ) * parseInt ( this . Width ) * parseFloat ( this . height1 ) + 'kg'
WeightCopy ( this . partNumValue , this . Result1 ) . then ( response => {
this . searchDetail ( )
} )
}
if ( this . materielValue === '10' ) {
this . Result1 = '物料:' + this . materiel [ 10 ] . label + ' 长:' + this . Length + 'mm 宽:' + this . Width + 'mm 厚:' + this . height1 + 'mm 重量:' + 0.001 * 0.0085 * parseInt ( this . Length ) * parseInt ( this . Width ) * parseFloat ( this . height1 ) + 'kg'
WeightCopy ( this . partNumValue , this . Result1 ) . then ( response => {
this . searchDetail ( )
} )
}
if ( this . materielValue === '11' ) {
this . Result1 = '物料:' + this . materiel [ 11 ] . label + ' 长:' + this . Length + 'mm 宽:' + this . Width + 'mm 厚:' + this . height1 + 'mm 重量:' + 0.001 * 0.0028 * parseInt ( this . Length ) * parseInt ( this . Width ) * parseFloat ( this . height1 ) + 'kg'
WeightCopy ( this . partNumValue , this . Result1 ) . then ( response => {
this . searchDetail ( )
} )
}
}
} ,
// 对边宽*对边宽*长度
Calculation3 ( ) {
if ( this . partNumValue === '' || this . partNumValue === null ) {
this . $message . error ( '请先选择一个零件' )
} else {
if ( this . materielValue === '3' ) {
this . Result3 = '物料:' + this . materiel [ 3 ] . label + ' 对边宽:' + this . OppositeSideWidth + 'mm 长度:' + this . length2 + 'mm 重量:' + 0.001 * 0.0068 * parseInt ( this . OppositeSideWidth ) * parseInt ( this . OppositeSideWidth ) * parseInt ( this . length2 ) + 'kg'
WeightCopy ( this . partNumValue , this . Result3 ) . then ( response => {
this . searchDetail ( )
} )
}
}
} ,
// (边宽+边宽-边厚) × 边厚× 长度÷1000
Calculation4 ( ) {
if ( this . partNumValue === '' || this . partNumValue === null ) {
this . $message . error ( '请先选择一个零件' )
} else {
if ( this . materielValue === '4' ) {
this . Result4 = '物料:' + this . materiel [ 4 ] . label + ' 边宽:' + this . biankuan + 'mm 边厚:' + this . bianhou + 'mm 长度:' + this . changdu + 'mm 重量:' + 0.001 * 0.00785 * ( parseInt ( this . biankuan ) + parseInt ( this . biankuan ) - parseInt ( this . bianhou ) ) * parseInt ( this . bianhou ) * parseInt ( this . changdu ) + 'kg'
WeightCopy ( this . partNumValue , this . Result4 ) . then ( response => {
this . searchDetail ( )
} )
}
}
} ,
Calculation5 ( ) {
if ( this . partNumValue === '' || this . partNumValue === null ) {
this . $message . error ( '请先选择一个零件' )
} else {
if ( this . materielValue === '5' ) {
this . Result5 = '物料:' + this . materiel [ 5 ] . label + ' 壁厚:' + this . bihou + 'mm 外径:' + this . waijing + 'mm 长度:' + this . changdu2 + 'mm 重量:' + 0.001 * 0.02466 * parseInt ( this . bihou ) * ( parseInt ( this . waijing ) - parseInt ( this . bihou ) ) * parseInt ( this . changdu2 ) + 'kg'
WeightCopy ( this . partNumValue , this . Result5 ) . then ( response => {
this . searchDetail ( )
} )
}
}
} ,
insertThestring ( NewCode ) {
this . lastFocusText = event . srcElement
this . lastFocusText . focus ( )
console . log ( this . lastFocusText )
var sel = document . selection . createRange ( )
sel . text = NewCode
return
} ,
clearDetail ( ) {
this . checked = false
this . partNumValue = ''