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

@@ -340,6 +340,7 @@
<script>
import { getEntryNameValue, getToolNum, getNum, getTable, production, getTable1, revisionBatch, editList, dele, production2, edit } from '@/api/ManufacturingCenter/InitialProduction'
import { mapGetters } from 'vuex'
import Cookie from 'js-cookie'
export default {
data() {
@@ -436,8 +437,19 @@ export default {
'id'
])
},
watch: {
// 如果路由有变化,会再次执行该方法
'$route': {
handler(route) {
const _this = this
if (route.name === 'InitialProduction') {
_this.typeChange()
}
}
}
},
created() {
this.typeChange()
// this.typeChange()
this.getCurrentTime()
this.getNowTime()
},
@@ -508,17 +520,40 @@ export default {
})
},
typeChange() {
this.NumValue = ''
this.Num = []
getToolNum().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.toolNum.push({
label: response.data[i].机床图号,
value: response.data[i].机床流水号,
value2: response.data[i].项目名称
})
}
})
if (Cookie.get('machineValue') !== undefined) {
this.toolNumValue = ''
this.NumValue = ''
this.Num = []
getToolNum().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.toolNum.push({
label: response.data[i].机床图号,
value: response.data[i].机床流水号,
value2: response.data[i].项目名称
})
}
}).then(() => {
this.toolNumValue = parseInt(Cookie.get('machineValue'))
this.typeChange1()
this.NumValue = parseInt(Cookie.get('group'))
this.getTable()
Cookie.remove('machineValue')
Cookie.remove('group')
})
} else {
this.toolNumValue = ''
this.NumValue = ''
this.Num = []
getToolNum().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.toolNum.push({
label: response.data[i].机床图号,
value: response.data[i].机床流水号,
value2: response.data[i].项目名称
})
}
})
}
},
typeChange1() {
this.NumValue = ''