零件工艺制定

This commit is contained in:
zhangdingyu
2019-01-11 15:51:02 +08:00
parent 67bf516af5
commit 94d17148d2
3 changed files with 96 additions and 9 deletions

View File

@@ -382,3 +382,15 @@ export function searchRecord(num) {
}
})
}
// 重量拷贝
export function WeightCopy(num, num2) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '车间生产管理工艺_零件工序_重量拷贝_工艺计划流水号',
param: '工艺计划流水号=' + num + '&重量信息=' + num2
}
})
}

View File

@@ -34,7 +34,7 @@
placeholder="零件号"
size="small"
@clear="clearDetail"
@change="searchParts">
@change="searchParts();searchDetail()">
<el-option
v-for="item in partNum"
:key="item.value"
@@ -59,10 +59,40 @@
<el-button slot="append" icon="el-icon-cjn-09" @click="saveMaterial"/>
</el-input>
<span>规格:</span>
<el-input v-show="false" v-model="spec" :readonly="isShow2" style="width:100px" size="small" placeholder="规格"/>
<el-input v-model="spec" :readonly="isShow2" style="width:100px" size="small" placeholder="规格"/>
<span>投产总数量:</span>
<el-input v-model="batchNum" readonly size="small" style="width:80px;margin-top:10px;"/>
</div>
<div>
<el-row>
<el-col :span="4">
<span>物料类型:</span>
<el-select v-model="materielValue" size="small" style="margin-top: 20px;width:100px" placeholder="物料类型" @change="clear()">
<el-option
v-for="item in materiel"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-col>
<el-col v-show="materielValue==='1'" :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>
<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-row>
</div>
</el-card>
<el-card>
@@ -490,6 +520,7 @@
<script>
import '@/icon/iconfont.css'
import {
WeightCopy,
initCraftmen,
getPartnames1,
getPartnames2,
@@ -531,6 +562,21 @@ export default {
},
data() {
return {
Result1: '',
Result2: '',
Length: '',
Width: '',
height1: '',
diameter: '',
height2: '',
materiel: [{
value: '1',
label: '方'
}, {
value: '2',
label: '柱'
}],
materielValue: '1',
total: 0,
pageCurrent: 1,
pageSize: 10,
@@ -626,6 +672,37 @@ export default {
this.getList()
},
methods: {
clear() {
this.Length = ''
this.Width = ''
this.height1 = ''
this.diameter = ''
this.height2 = ''
},
// 长宽高计算
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 => {
console.log(response.data)
}).then(() => {
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)
console.log(this.Result2)
console.log(Math.PI)
}
},
clearDetail() {
this.checked = false
this.partNumValue = ''
@@ -785,10 +862,9 @@ export default {
this.isShow = true
}
},
searchDetail() { // 查主表和上面显示的信息
if (this.partNumValue === '' || this.partNumValue === null) {
this.$message.error('请选择零件作为查询对象')
} else {
// 查主表和上面显示的信息
searchDetail() {
if (this.partNumValue !== '' && this.partNumValue !== null) {
this.loading0 = true
detailInfo(this.partNumValue).then(response => {
if (response.data.length !== 0) {
@@ -963,7 +1039,8 @@ export default {
}
})
},
processCopy1() { // 完艺工艺拷贝
// 完艺工艺拷贝
processCopy1() {
this.dialogFormVisible1 = false
if (this.partNumValue === '') {
this.$message.error('请在主界面选择一个零件作为被拷贝对象')

View File

@@ -128,8 +128,6 @@
</el-dialog>
<dialog :visible="true"/>
</div>
</template>