工艺制定

This commit is contained in:
zhangdingyu
2019-03-20 16:19:05 +08:00
parent 7e830d562c
commit b059cf30ad
2 changed files with 132 additions and 65 deletions

View File

@@ -419,3 +419,15 @@ export function WeightCopy(num, num2) {
}
})
}
// 保存变更材质
export function saveWeight(num0, num1) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '车间生产管理工艺_零件工艺计划_修改零件重量',
param: '工艺计划流水号=' + num0 + '&重量=' + num1
}
})
}

View File

@@ -2,7 +2,7 @@
<div class="app-container">
<el-card>
<el-radio-group v-model="radio" size="small" style="margin: 10px;" @change="CraftmenValue = '';checked = false;partNumValue = '';typeValue = '';partName = '';material = '';prepareMateriel = '';spec = '';batchNum = '';searchParts()">
<el-radio-group v-model="radio" size="small" style="margin: 10px;" @change="CraftmenValue = '';checked = false;partNumValue = '';typeValue = '';partName = '';material = '';materialName = '';prepareMateriel = '';spec = '';batchNum = '';searchParts()">
<el-radio v-model="radio" :label="1">未编制</el-radio>
<el-radio v-model="radio" :label="2">已编制</el-radio>
</el-radio-group>
@@ -33,13 +33,13 @@
<el-input v-model="partName" placeholder="零件名称" size="small" readonly style="width:115px"/>
<span>投产总数量:</span>
<el-input v-model="batchNum" readonly size="small" style="width:80px;margin-top:10px;"/>
<span>材质:</span>
<el-input v-model="prepareMateriel" placeholder="物料" size="small" style="width:215px" readonly>
<el-button slot="prepend" icon="el-icon-search" @click="dialogMateria2=true"/>
<span>物料:</span>
<el-input v-model="materialName" placeholder="物料" size="small" style="width:215px" readonly>
<el-button slot="prepend" icon="el-icon-search" @click="dialogMaterial=true"/>
<el-button slot="append" icon="el-icon-cjn-09" @click="saveMaterial"/>
</el-input>
<span>规格:</span>
<el-input v-model="spec" :readonly="isShow2" style="width:100px" size="small" placeholder="规格"/>
<!--<span>规格:</span>-->
<!--<el-input v-model="spec" :readonly="isShow2" style="width:100px" size="small" placeholder="规格"/>-->
</div>
<div>
<el-row>
@@ -60,6 +60,10 @@
<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>
<span>重量:</span>
<el-input v-model="weight" style="width:150px" size="small" placeholder="重量">
<el-button slot="append" icon="el-icon-cjn-09" @click="saveWeight"/>
</el-input>
<!-- ° # ± × mm δ μm ()-->
<!--<el-button style="margin-top: 20px;margin-left: 10px;" type="primary" size="small" @click="insertThestring()">计算重量</el-button>-->
</el-col>
@@ -72,6 +76,10 @@
<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="Calculation2()">计算重量</el-button>
<span>重量:</span>
<el-input v-model="weight" style="width:150px" size="small" placeholder="重量">
<el-button slot="append" icon="el-icon-cjn-09" @click="saveWeight"/>
</el-input>
</el-col>
<el-col v-show="materielValue==='3'" :span="20">
@@ -80,6 +88,10 @@
<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>
<span>重量:</span>
<el-input v-model="weight" style="width:150px" size="small" placeholder="重量">
<el-button slot="append" icon="el-icon-cjn-09" @click="saveWeight"/>
</el-input>
</el-col>
<el-col v-show="materielValue==='4'" :span="20">
@@ -90,6 +102,10 @@
<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>
<span>重量:</span>
<el-input v-model="weight" style="width:150px" size="small" placeholder="重量">
<el-button slot="append" icon="el-icon-cjn-09" @click="saveWeight"/>
</el-input>
</el-col>
<el-col v-show="materielValue==='5'" :span="20">
@@ -100,6 +116,10 @@
<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>
<span>重量:</span>
<el-input v-model="weight" style="width:150px" size="small" placeholder="重量">
<el-button slot="append" icon="el-icon-cjn-09" @click="saveWeight"/>
</el-input>
</el-col>
</el-row>
@@ -233,34 +253,6 @@
<el-button type="primary" size="small" @click="selectMaterial2()">提交</el-button>
</div>
</el-dialog>
<el-dialog :visible.sync="dialogMateria2" title="物料选择" center width="400px">
<el-input v-model="input" placeholder="材质" size="small" style="width:200px"/>
<el-button type="success" size="small" icon="el-icon-search" style="margin: 0 0 10px 10px" @click="total=0;pageCurrent=1;pageSize=10;searchMaterial()">查询</el-button>
<el-table :data="tableMaterial" size="mini" highlight-current-row border @row-click="selectMaterial">
<el-table-column align="center" label="材质名称">
<template slot-scope="scope">
{{ scope.row.材料 }}
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="1"
:page-sizes="[10, 20]"
:page-size="10"
:pager-count="5"
:total="total"
small
layout="sizes, prev, pager, next"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"/>
</div>
<div slot="footer" class="dialog-footer">
<el-button type="primary" size="small" @click="selectMaterial2()">提交</el-button>
</div>
</el-dialog>
<el-dialog :visible.sync="dialogFormVisible2" title="工艺名称、工艺要求选择" center width="400px">
<el-form ref="form2" :model="form2" label-position="left" label-width="125px" class="demo-ruleForm">
<el-form-item label="工艺名称分类">
@@ -484,6 +476,7 @@
<script>
import '@/icon/iconfont.css'
import {
saveWeight,
numChange,
searchProcess11,
WeightCopy,
@@ -515,8 +508,7 @@ import {
selectRequest,
pasteTable,
deleteTable,
returnEdit,
searchRecord
returnEdit
} from '@/api/ManufacturingCenter/ProcessPlanning'
import elInput from 'element-ui/packages/input'
import { mapGetters } from 'vuex'
@@ -527,6 +519,7 @@ export default {
},
data() {
return {
weight: '',
dialogMateria2: false,
prepareMateriel: '',
lastFocusText: '',
@@ -667,7 +660,7 @@ export default {
result: 0,
oldNum: '',
newNum: '',
tableRecord: [],
// tableRecord: [],
materialName2: '',
material2: ''
}
@@ -686,7 +679,21 @@ export default {
this.getList()
},
methods: {
saveWeight() {
if (this.partNumValue === '' || this.material === '') {
this.$message.error('请选择一个零件')
} else {
saveWeight(this.partNumValue, this.weight).then(response => {
if (response.data[0].result === '1') {
this.$message.success('保存成功')
} else {
this.$message.error('保存失败')
}
})
}
},
clear() {
this.weight = ''
this.Length = ''
this.Width = ''
this.height1 = ''
@@ -706,27 +713,35 @@ export default {
this.$message.error('请先选择一个零件')
} else {
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'
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'
this.weight = 0.00617 * 0.001 * parseInt(this.diameter) * parseInt(this.diameter) * parseFloat(this.height2)
WeightCopy(this.partNumValue, this.Result2).then(response => {
this.searchDetail()
this.searchDetai2()
})
}
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'
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'
this.weight = 0.00698 * 0.001 * parseInt(this.diameter) * parseInt(this.diameter) * parseFloat(this.height2)
WeightCopy(this.partNumValue, this.Result2).then(response => {
this.searchDetail()
this.searchDetai2()
})
}
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'
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'
this.weight = 0.00668 * 0.001 * parseInt(this.diameter) * parseInt(this.diameter) * parseFloat(this.height2)
WeightCopy(this.partNumValue, this.Result2).then(response => {
this.searchDetail()
this.searchDetai2()
})
}
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'
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'
this.weight = 0.0022 * 0.001 * parseInt(this.diameter) * parseInt(this.diameter) * parseFloat(this.height2)
WeightCopy(this.partNumValue, this.Result2).then(response => {
this.searchDetail()
this.searchDetai2()
})
}
}
@@ -737,27 +752,35 @@ export default {
this.$message.error('请先选择一个零件')
} else {
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'
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'
this.weight = 0.001 * 0.00785 * parseInt(this.Length) * parseInt(this.Width) * parseFloat(this.height1)
WeightCopy(this.partNumValue, this.Result1).then(response => {
this.searchDetail()
this.searchDetai2()
})
}
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'
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'
this.weight = 0.001 * 0.0089 * parseInt(this.Length) * parseInt(this.Width) * parseFloat(this.height1)
WeightCopy(this.partNumValue, this.Result1).then(response => {
this.searchDetail()
this.searchDetai2()
})
}
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'
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'
this.weight = 0.001 * 0.0085 * parseInt(this.Length) * parseInt(this.Width) * parseFloat(this.height1)
WeightCopy(this.partNumValue, this.Result1).then(response => {
this.searchDetail()
this.searchDetai2()
})
}
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'
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'
this.weight = 0.001 * 0.0028 * parseInt(this.Length) * parseInt(this.Width) * parseFloat(this.height1)
WeightCopy(this.partNumValue, this.Result1).then(response => {
this.searchDetail()
this.searchDetai2()
})
}
}
@@ -768,9 +791,11 @@ export default {
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'
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'
this.weight = 0.001 * 0.0068 * parseInt(this.OppositeSideWidth) * parseInt(this.OppositeSideWidth) * parseInt(this.length2)
WeightCopy(this.partNumValue, this.Result3).then(response => {
this.searchDetail()
this.searchDetai2()
})
}
}
@@ -781,9 +806,11 @@ export default {
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'
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'
this.weight = 0.001 * 0.00785 * (parseInt(this.biankuan) + parseInt(this.biankuan) - parseInt(this.bianhou)) * parseInt(this.bianhou) * parseInt(this.changdu)
WeightCopy(this.partNumValue, this.Result4).then(response => {
this.searchDetail()
this.searchDetai2()
})
}
}
@@ -793,9 +820,11 @@ export default {
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'
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'
this.weight = 0.001 * 0.02466 * parseInt(this.bihou) * (parseInt(this.waijing) - parseInt(this.bihou)) * parseInt(this.changdu2)
WeightCopy(this.partNumValue, this.Result5).then(response => {
this.searchDetail()
this.searchDetai2()
})
}
}
@@ -809,6 +838,7 @@ export default {
},
clearDetail() {
this.checked = false
this.weight = ''
this.partNumValue = ''
this.typeValue = ''
this.partName = ''
@@ -978,12 +1008,37 @@ export default {
this.material = response.data[0].材料流水号
this.materialName = response.data[0].材料
this.spec = response.data[0].原材料规格
if (response.data[0].重量 === null) {
this.weight = ''
} else {
this.weight = response.data[0].重量
}
}
})
this.tableRecord = []
searchRecord(this.partNumValue).then(response => {
this.tableRecord = response.data
// this.tableRecord = []
// searchRecord(this.partNumValue).then(response => {
// this.tableRecord = response.data
// })
mainTable(this.partNumValue).then(response => {
this.tableData = []
for (let i = 0; i < response.data.length; i++) {
if (response.data[i].工艺编号 === null) {
response.data[i].工艺编号 = 0
}
if (response.data[i].工艺要求 === null) {
response.data[i].工艺要求 = ''
}
}
this.tableData = response.data
this.newNum = this.partNumValue
}).then(() => {
this.loading0 = false
})
}
},
searchDetai2() {
if (this.partNumValue !== '' && this.partNumValue !== null) {
this.loading0 = true
mainTable(this.partNumValue).then(response => {
this.tableData = []
for (let i = 0; i < response.data.length; i++) {
@@ -1131,9 +1186,9 @@ export default {
hardEdit(row.工序流水号, row.工艺难度等级).then(response => {
})
},
requestEdit(row) { // 修改工艺要求
requestEdit(row.工序流水号, row.工艺要求).then(response => {
})
// 修改工艺要求
requestEdit(row) {
requestEdit(row.工序流水号, row.工艺要求)
},
tableSearch(index) { // 主界面工艺名称分类、工艺名称及工艺要求后续查询
if (this.checked1 === false) {