更新
This commit is contained in:
@@ -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 = ''
|
||||
|
||||
Reference in New Issue
Block a user