创建采购合同和零件导入

This commit is contained in:
liushuai
2018-12-05 20:09:23 +08:00
16 changed files with 318 additions and 110 deletions

View File

@@ -205,7 +205,7 @@
@current-change="handleCurrentChange"/>
</div>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="dialogMaterial=false">提交</el-button>
<el-button type="primary" size="small" @click="selectMaterial2()">提交</el-button>
</div>
</el-dialog>
@@ -616,7 +616,9 @@ export default {
result: 0,
oldNum: '',
newNum: '',
tableRecord: []
tableRecord: [],
materialName2: '',
material2: ''
}
},
created() {
@@ -635,15 +637,6 @@ export default {
this.spec = ''
this.batchNum = ''
},
// tableRowClassName({ row }) {
// for (let i = 0; i < this.tableRecord.length; i++) {
// if (this.tableRecord[i].工序流水号 === row.工序流水号 && this.radio === 2 && this.tableRecord[i].工艺编号 !== null) { // && this.tableRecord[i].工艺难度等级 !== null && this.tableRecord[i].工艺要求 !== null
// if (this.tableRecord[i].工艺编号 !== row.工艺编号 || this.tableRecord[i].工艺要求 !== row.工艺要求 || this.tableRecord[i].工艺难度等级 !== row.工艺难度等级 || this.tableRecord[i].工序顺序 !== row.工序顺序) {
// return 'change'
// }
// }
// }
// },
returnEdit() { // 在制零件工艺修改
if (this.partNumValue === '' || this.partNumValue === null) {
this.$message.error('请选择零件')
@@ -688,10 +681,17 @@ export default {
}
},
selectMaterial(row) { // 选择材质
this.materialName2 = ''
this.material2 = ''
this.materialName2 = row.材料
this.material2 = row.材料流水号
},
selectMaterial2() {
this.materialName = ''
this.material = ''
this.materialName = row.材料
this.material = row.材料流水号
this.materialName = this.materialName2
this.material = this.material2
this.dialogMaterial = false
},
fetchData() {
this.materialClass = []
@@ -923,10 +923,8 @@ export default {
this.tableData[i].工艺难度等级 = this.tableData2[i].工艺难度等级
this.tableData[i].工艺要求 = this.tableData2[i].工艺要求
selectRequest(this.tableData[i].工序流水号, this.tableData[i].工艺计划流水号, this.tableData2[i].工艺编号, this.tableData2[i].工艺序号, this.tableData2[i].工艺要求).then(response => {
console.log('该工艺保存成功', 501)
})
hardEdit(this.tableData[i].工序流水号, this.tableData2[i].工艺难度等级).then(response => {
console.log(response.data, '难度等级修改成功', 502)
})
this.dialogFormVisible = false
}
@@ -970,7 +968,6 @@ export default {
this.$message.error('请在主界面选择一个零件作为被拷贝对象')
} else {
gongyiCopy(this.num, this.partNumValue).then(() => { // 工艺计划流水号_完成工艺, 工艺计划流水号_被拷工艺
console.log('已拷贝到主表', 503)
this.searchDetail()
})
}
@@ -985,18 +982,15 @@ export default {
}
}
gongyiYQ(this.num).then(response => {
console.log(response.data, 119)
this.tableData4 = response.data
})
},
hardEdit(row) { // 修改难度等级
hardEdit(row.工序流水号, row.工艺难度等级).then(response => {
console.log(response.data, '难度等级修改成功', 504)
})
},
requestEdit(row) { // 修改工艺要求
requestEdit(row.工序流水号, row.工艺要求).then(response => {
console.log(response.data, '工艺要求修改成功', 505)
})
},
tableSearch(index) { // 主界面工艺名称分类、工艺名称及工艺要求后续查询
@@ -1027,7 +1021,10 @@ export default {
}
},
cChange() { // 工艺名称分类改变
this.processNameValue = ''
this.processName = []
this.processRequestValue = ''
this.processRequest = []
for (let i = 0; i < this.processNameClass.length; i++) {
if (this.processNameClassValue === this.processNameClass[i].value) {
processNameSelect(this.processSelect[i].value).then(response => { // 查询工艺名称
@@ -1042,6 +1039,7 @@ export default {
}
},
nChange() { // 工艺名称改变
this.processRequestValue = ''
this.processRequest = []
for (let i = 0; i < this.processName.length; i++) {
if (this.processNameValue === this.processName[i].value) {
@@ -1063,7 +1061,6 @@ export default {
this.tableData[this.index].工艺要求 = this.str
this.dialogFormVisible2 = false
selectRequest(this.tableData[this.index].工序流水号, this.tableData[this.index].工艺计划流水号, this.tableData[this.index].工艺编号, this.tableData[this.index].工序顺序, this.tableData[this.index].工艺要求).then(response => {
console.log('该工艺保存成功', 506)
})
},
calTol() { // 计算公差
@@ -1114,7 +1111,6 @@ export default {
this.$message.error('请先选择一个零件')
} else {
insertOne(this.partNumValue, row.工序流水号).then(response => {
console.log(response.data, '插入成功', 507)
this.searchDetail()
})
}
@@ -1145,7 +1141,6 @@ export default {
this.$message.error('请先选择一个零件')
} else {
upOne(this.partNumValue, row.工序流水号).then(response => {
console.log(response.data, '上移成功', 508)
this.searchDetail()
})
}
@@ -1155,7 +1150,6 @@ export default {
this.$message.error('请先选择一个零件')
} else {
downOne(this.partNumValue, row.工序流水号).then(response => {
console.log(response.data, '下移成功', 509)
this.searchDetail()
})
}
@@ -1198,7 +1192,6 @@ export default {
}).then(() => {
for (let i = 0; i < 30; i++) {
hardEdit(this.tableData[i].工序流水号, '').then(response => {
console.log(response.data, '清空难度等级', 510)
})
}
deleteTable(this.newNum).then(response => {

View File

@@ -175,7 +175,7 @@ export default {
this.fetchData()
},
methods: {
fetchData() { // 初始化未编制零件号、材料、公差
fetchData() { // 初始化未编制零件号
getPerson().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.person.push({
@@ -255,49 +255,61 @@ export default {
this.num0 = ''
if (this.radio === 1) {
detailInfo(this.partNumValue).then(response => {
this.typeValue = response.data[0].零件类型名称
this.partName = response.data[0].零件名称
this.batchNum = response.data[0].批次数量
this.num0 = response.data[0].工艺计划流水号
console.log(response.data[0].工艺计划流水号, 520)
this.material = response.data[0].材料
if (response.data.length !== 0) {
this.typeValue = response.data[0].零件类型名称
this.partName = response.data[0].零件名称
this.batchNum = response.data[0].批次数量
this.num0 = response.data[0].工艺计划流水号
this.material = response.data[0].材料
}
}).then(() => {
mainTable(this.num0).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.tableData.push({
name: response.data[i].工艺名称,
request: response.data[i].工艺要求,
num1: response.data[i].工序流水号,
Settlement: response.data[i].准结定额工时,
singleton: response.data[i].单件定额工时,
lingjian: response.data[i].零件图,
numm: response.data[i].工艺计划流水号
})
if (response.data.length === 0) {
this.listLoading = false
} else {
for (let i = 0; i < response.data.length; i++) {
this.tableData.push({
name: response.data[i].工艺名称,
request: response.data[i].工艺要求,
num1: response.data[i].工序流水,
Settlement: response.data[i].准结定额工时,
singleton: response.data[i].单件定额工时,
lingjian: response.data[i].零件图号,
numm: response.data[i].工艺计划流水号
})
}
this.listLoading = false
}
this.listLoading = false
})
})
} else {
detailInfo(this.partNumValue).then(response => {
this.typeValue = response.data[0].零件类型名称
this.partName = response.data[0].零件名称
this.batchNum = response.data[0].批次数量
this.num0 = response.data[0].工艺计划流水号
this.material = response.data[0].材料
})
mainTable1(this.partNumValue).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.tableData.push({
name: response.data[i].工艺名称,
request: response.data[i].工艺要求,
num1: response.data[i].工序流水号,
Settlement: response.data[i].准结定额工时,
singleton: response.data[i].单件定额工时,
budget: response.data[i].外协预算价格1,
lingjian: response.data[i].零件图号,
numm: response.data[i].工艺计划流水号
})
if (response.data.length !== 0) {
this.typeValue = response.data[0].零件类型名称
this.partName = response.data[0].零件名称
this.batchNum = response.data[0].批次数量
this.num0 = response.data[0].工艺计划流水号
this.material = response.data[0].材料
}
this.listLoading = false
}).then(() => {
mainTable1(this.partNumValue).then(response => {
if (response.data.length === 0) {
this.listLoading = false
} else {
for (let i = 0; i < response.data.length; i++) {
this.tableData.push({
name: response.data[i].工艺名称,
request: response.data[i].工艺要求,
num1: response.data[i].工序流水号,
Settlement: response.data[i].准结定额工时,
singleton: response.data[i].单件定额工时,
budget: response.data[i].外协预算价格1,
lingjian: response.data[i].零件图号,
numm: response.data[i].工艺计划流水号
})
}
}
})
})
}
},

View File

@@ -8,7 +8,7 @@
</el-card>
<el-card>
<el-table :data="List" style="height: 550px" border size="small">
<el-table :data="List" border size="small">
<el-table-column label="设备名称" align="center" >
<template slot-scope="scope">
{{ scope.row.设备名称 }}
@@ -159,6 +159,7 @@
</div>
</el-dialog>
</div>
</template>
<script>
@@ -184,7 +185,8 @@ export default {
{ value: '3', label: 3 },
{ value: '4', label: 4 }],
form: {
设备名称: '', 设备编号: '',
设备名称: '',
设备编号: '',
设备型号: '',
设备性能指标: '',
设备加工能力: '',
@@ -209,9 +211,11 @@ export default {
},
created() {
this.initialization()
this.fetchData()
},
methods: {
fetchData() {
this.List = []
if (this.equipmentName !== '') {
this.check = 1
} else {
@@ -317,6 +321,9 @@ export default {
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
if (this.List && this.List.length === 1 && this.pageCurrent > 1) {
this.pageCurrent--
}
deleteTable(row.设备流水号).then(response => {
if (response.data[0].result === '1') {
this.$message.success('删除成功')