This commit is contained in:
liushuai
2019-09-12 10:14:37 +08:00
parent afcda77786
commit 53a9f57fe1
11 changed files with 1571 additions and 240 deletions

View File

@@ -311,6 +311,7 @@
</template>
<script>
import { getNames, getMachines, getGroups, getTable, getTable2, getExport } from '@/api/ManufacturingCenter/ProcessingStatus'
import Cookie from 'js-cookie'
export default {
data() {
@@ -380,10 +381,20 @@ export default {
pageCurrent: 1
}
},
created() {
this.getMachine()
this.getTableData()
watch: {
// 如果路由有变化,会再次执行该方法
'$route': {
handler(route) {
const _this = this
if (route.name === 'ProcessingStatus') {
_this.getMachine()
}
}
}
},
// created() {
// this.getMachine()
// },
methods: {
formatJson(filterVal, jsonData) {
return jsonData.map(v => filterVal.map(j => {
@@ -412,7 +423,6 @@ export default {
})
})
},
// 查询供应商名称
fetchData() {
this.projects = []
getNames().then(response => {
@@ -426,19 +436,43 @@ export default {
this.part = 1
},
getMachine() {
this.Machine = ''
this.Machines = []
this.Group = ''
this.Groups = []
getMachines().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.Machines.push({
label: response.data[i].机床图号,
value: response.data[i].机床流水,
value2: response.data[i].项目名称
})
}
})
if (Cookie.get('machineValue') !== undefined) {
this.Machine = ''
this.Machines = []
this.Group = ''
this.Groups = []
getMachines().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.Machines.push({
label: response.data[i].机床,
value: response.data[i].机床流水号,
value2: response.data[i].项目名称
})
}
}).then(() => {
this.Machine = parseInt(Cookie.get('machineValue'))
this.getGroup()
this.Group = parseInt(Cookie.get('group'))
this.getTableData()
Cookie.remove('machineValue')
Cookie.remove('group')
})
} else {
this.Machine = ''
this.Machines = []
this.Group = ''
this.Groups = []
getMachines().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.Machines.push({
label: response.data[i].机床图号,
value: response.data[i].机床流水号,
value2: response.data[i].项目名称
})
}
})
this.getTableData()
}
},
getGroup() {
this.Group = ''