This commit is contained in:
liushuai
2020-01-06 18:44:24 +08:00
parent 4f7803d196
commit 5fc6f2424c
10 changed files with 2504 additions and 136 deletions

View File

@@ -1,14 +1,6 @@
<template>
<div class="app-container">
<el-card>
<span>项目名称</span>
<el-select v-model="projectValue" placeholder="请选择项目名称" style="margin: 0px 20px 0px 0px" filterable size="small">
<el-option
v-for="item in project"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span>机床图号</span>
<el-select v-model="machineValue" placeholder="请选择机床图号" style="margin: 0px 20px 0px 0px" filterable size="small">
<el-option
@@ -646,13 +638,12 @@
</template>
<script>
import { alldeleteWB, alldelete, projectSelect, machineSelect, groupSelect, basicPartsData, deleteBasicParts, deleteBasicParts5, deleteBasicParts6, alldeleteBasicParts5, alldeleteBasicParts6, purchasePartsData, deletePurchaseData, editPurchaseData, editBasicParts, getTable, editProductNum, getTable1, editProduceNum, searchTable1, searchTable2, searchTable5, searchTable6, searchTable7, editGroupBasicPartNum, editGroupPartNum } from '@/api/BasicData/PartsNumberMaintenance'
import { alldeleteWB, alldelete, machineSelect, groupSelect, basicPartsData, deleteBasicParts, deleteBasicParts5, deleteBasicParts6, alldeleteBasicParts5, alldeleteBasicParts6, purchasePartsData, deletePurchaseData, editPurchaseData, editBasicParts, getTable, editProductNum, getTable1, editProduceNum, searchTable1, searchTable2, searchTable5, searchTable6, editGroupBasicPartNum, editGroupPartNum } from '@/api/BasicData/PartsNumberMaintenance'
export default {
name: 'Index',
data() {
return {
activeName: '1',
projectValue: '',
projectName: '',
BasicParts: '',
PurchaseData: '',
@@ -662,7 +653,6 @@ export default {
groupPartNum: '',
groupBasicPartNum: '',
type: '',
project: [],
machineValue: '',
machineName: '',
machine: [],
@@ -685,7 +675,6 @@ export default {
tableData4: [],
tableData5: [],
tableData6: [],
tableData7: [],
tableDataWB: [],
// pageCurrent: 1,
// pageSize: 10,
@@ -725,25 +714,6 @@ export default {
}
},
watch: {
project(val) {
if (val.length > 0) {
this.projectValue = val[0].value
}
},
projectValue(val) {
for (let i = 0; i < this.project.length; i++) {
if (this.project[i].value === this.projectValue) {
this.projectName = this.project[i].label
}
}
this.machineValue = ''
this.machine = []
this.groupValue = ''
this.group = []
if (val) {
this.getMachineSelect(val)
}
},
machine(val) {
if (val.length > 0) {
this.machineValue = val[0].value
@@ -755,6 +725,12 @@ export default {
}
},
machineValue(val) {
for (let i = 0; i < this.machine.length; i++) {
if (val === this.machine[i].value) {
this.machineName = this.machine[i].label
}
}
console.log(val, 11, this.machineName)
this.groupValue = ''
this.group = []
if (val) {
@@ -788,10 +764,8 @@ export default {
},
methods: {
fetchData() {
this.getSelect(projectSelect, ['项目名称', '项目流水号'], 'project')
},
getMachineSelect(val) {
this.getSelect(machineSelect, ['机床图号', '机床流水号'], 'machine', val)
this.getSelect(machineSelect, ['机床图号', '机床流水号'], 'machine')
console.log(this.machine)
},
getGroupSelect(val) {
this.getSelect(groupSelect, ['组号', '组件流水号'], 'group', val)
@@ -867,11 +841,10 @@ export default {
})
},
getTableData() {
const project_check = this.projectValue ? 1 : 0
const machine_check = this.machineValue ? 1 : 0
const group_check = this.groupValue ? 1 : 0
this.loading = true
basicPartsData(project_check, this.projectValue, machine_check, this.machineValue, group_check, this.groupValue).then(response => {
basicPartsData(machine_check, this.machineValue, group_check, this.groupValue).then(response => {
this.loading = false
const res = response.data
this.total = res.total
@@ -959,59 +932,44 @@ export default {
})
},
searchTable1() { // 查询标准件和外购件
let check0, check1, check2
this.projectValue ? check2 = 1 : check2 = 0
let check0, check1
this.machineValue ? check0 = 1 : check0 = 0
this.groupValue ? check1 = 1 : check1 = 0
searchTable1(check2, this.projectValue, check0, this.machineValue, check1, this.groupValue).then(response => {
searchTable1(check0, this.machineValue, check1, this.groupValue).then(response => {
this.tableData3 = response.data
this.total3 = response.data.total
})
},
searchTable2() { // 查询基本件
let check0, check1, check2
this.projectValue ? check2 = 1 : check2 = 0
let check0, check1
this.machineValue ? check0 = 1 : check0 = 0
this.groupValue ? check1 = 1 : check1 = 0
searchTable2(check2, this.projectValue, check0, this.machineValue, check1, this.groupValue).then(response => {
searchTable2(check0, this.machineValue, check1, this.groupValue).then(response => {
this.tableData4 = response.data
this.total4 = response.data.total
})
},
searchTable5() { // 查询标准件
let check0, check1, check2
this.projectName ? check2 = 1 : check2 = 0
let check0, check1
this.machineName ? check0 = 1 : check0 = 0
this.groupName ? check1 = 1 : check1 = 0
searchTable5(check2, this.projectName, check0, this.machineName, check1, this.groupName).then(response => {
searchTable5(check0, this.machineName, check1, this.groupName).then(response => {
console.log(response, 5, this.activeName)
this.tableData5 = response.data
this.total5 = response.data.total
})
},
searchTable6() { // 查询基本件
let check0, check1, check2
this.projectName ? check2 = 1 : check2 = 0
let check0, check1
this.machineName ? check0 = 1 : check0 = 0
this.groupName ? check1 = 1 : check1 = 0
// console.log(this.projectName, this.machineName, this.groupName, 44)
searchTable6(check2, this.projectName, check0, this.machineName, check1, this.groupName).then(response => {
searchTable6(check0, this.machineName, check1, this.groupName).then(response => {
console.log(response, 6)
this.tableData6 = response.data
this.total6 = response.data.total
})
},
searchTable7() { // 查询外购件
let check0, check1, check2
this.projectName ? check2 = 1 : check2 = 0
this.machineName ? check0 = 1 : check0 = 0
this.groupName ? check1 = 1 : check1 = 0
searchTable7(this.pageCurrent7, this.pageSize7, check2, this.projectName, check0, this.machineName, check1, this.groupName).then(response => {
console.log(response, 7)
this.tableData7 = response.data.rows
this.total7 = response.data.total
})
},
handleEdit(row) {
this.BasicParts = ''
this.PurchaseData = ''
@@ -1125,7 +1083,7 @@ export default {
this.searchTable6()
})
}
},
}
// handleSizeChanges(val) {
// this.pageCurrent = 1
// this.pageSize = val
@@ -1198,15 +1156,6 @@ export default {
// this.pageCurrent6 = val
// this.searchTable6()
// },
handleSizeChange7(val) {
this.pageSize7 = val
this.pageCurrent7 = 1
this.searchTable7()
},
handleCurrentChange7(val) {
this.pageCurrent7 = val
this.searchTable7()
}
}
}
</script>