登录、home、工单管理
This commit is contained in:
@@ -31,6 +31,7 @@
|
||||
|
||||
<script>
|
||||
import Back from '@components/Back.vue'
|
||||
import {getDevice} from './../../config/getData2.js'
|
||||
export default {
|
||||
name: 'Home',
|
||||
components: {
|
||||
@@ -40,97 +41,6 @@ export default {
|
||||
return {
|
||||
timer: null,
|
||||
list: []
|
||||
// list: [
|
||||
// {
|
||||
// device_status: '0',
|
||||
// is_setstatus: '0',
|
||||
// device_code: 'A0001',
|
||||
// device_name: '设备名称设备名称设备名称设备名称哈哈哈你好吗好哦',
|
||||
// job_count: '6',
|
||||
// produceorder_code: 'gd0002',
|
||||
// imgurl: '//img14.360buyimg.com/babel/s190x210_jfs/t1/54510/8/1271/6158/5cef5bfbEede24168/4aa624bd9ada781f.png!q90!cc_190x210'
|
||||
// },
|
||||
// {
|
||||
// device_status: '1',
|
||||
// is_setstatus: '1',
|
||||
// device_code: 'A0002',
|
||||
// job_count: '6',
|
||||
// produceorder_code: 'gd0002',
|
||||
// imgurl: '//img1.360buyimg.com/da/s590x470_jfs/t1/36626/1/11773/101331/5cf9fd07E20a31b94/57ae8abe34bebdd3.jpg!q90!cc_590x470.webp'
|
||||
// },
|
||||
// {
|
||||
// device_status: '2',
|
||||
// is_setstatus: '0',
|
||||
// device_code: 'A0003',
|
||||
// job_count: '6',
|
||||
// produceorder_code: 'gd0002',
|
||||
// imgurl: '//img14.360buyimg.com/mobilecms/s580x176_jfs/t1/45895/4/2239/49551/5d009864Ea34300cd/5a5e78699233f6dd.jpg!cr_1190x360_4_0'
|
||||
// },
|
||||
// {
|
||||
// device_status: '0',
|
||||
// is_setstatus: '0',
|
||||
// device_code: 'A0004',
|
||||
// job_count: '6',
|
||||
// produceorder_code: 'gd0002',
|
||||
// imgurl: ''
|
||||
// },
|
||||
// {
|
||||
// device_status: '1',
|
||||
// is_setstatus: '0',
|
||||
// device_code: 'A0005',
|
||||
// job_count: '6',
|
||||
// produceorder_code: 'gd0002',
|
||||
// imgurl: ''
|
||||
// },
|
||||
// {
|
||||
// device_status: '2',
|
||||
// is_setstatus: '1',
|
||||
// device_code: 'A0006',
|
||||
// job_count: '6',
|
||||
// produceorder_code: 'gd0002',
|
||||
// imgurl: ''
|
||||
// },
|
||||
// {
|
||||
// device_status: '0',
|
||||
// is_setstatus: '0',
|
||||
// device_code: 'A0007',
|
||||
// job_count: '6',
|
||||
// produceorder_code: 'gd0002',
|
||||
// imgurl: ''
|
||||
// },
|
||||
// {
|
||||
// device_status: '0',
|
||||
// is_setstatus: '0',
|
||||
// device_code: 'A0008',
|
||||
// job_count: '6',
|
||||
// produceorder_code: 'gd0002',
|
||||
// imgurl: ''
|
||||
// },
|
||||
// {
|
||||
// device_status: '1',
|
||||
// is_setstatus: '0',
|
||||
// device_code: 'A0009',
|
||||
// job_count: '6',
|
||||
// produceorder_code: 'gd0002',
|
||||
// imgurl: ''
|
||||
// },
|
||||
// {
|
||||
// device_status: '2',
|
||||
// is_setstatus: '1',
|
||||
// device_code: 'A00010',
|
||||
// job_count: '6',
|
||||
// produceorder_code: 'gd0002',
|
||||
// imgurl: ''
|
||||
// },
|
||||
// {
|
||||
// device_status: '0',
|
||||
// is_setstatus: '0',
|
||||
// device_code: 'A00011',
|
||||
// job_count: '6',
|
||||
// produceorder_code: 'gd0002',
|
||||
// imgurl: ''
|
||||
// }
|
||||
// ]
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
@@ -143,40 +53,28 @@ export default {
|
||||
this.getList()
|
||||
}, 30000)
|
||||
},
|
||||
getList () {
|
||||
let data = {
|
||||
'_SRVNAME': 'service.mps.AIOProduceReport20',
|
||||
'_SRVMETHOD': 'queryEquip',
|
||||
'_DATA': JSON.stringify({
|
||||
accountId: this.$store.getters.accountId
|
||||
})
|
||||
}
|
||||
this
|
||||
.$post(data)
|
||||
.then(res => {
|
||||
if (res.code === '1') {
|
||||
let newArr = []
|
||||
res.allrows.map(el => {
|
||||
newArr.push(Object.assign({}, el, {imgurl: this.$store.getters.imgBaseUrl + el.device_icon}))
|
||||
})
|
||||
this.list = newArr
|
||||
this.$store.dispatch('getIsProplan', res.result.is_productonplan)
|
||||
} else {
|
||||
this.Dialog(res.desc)
|
||||
}
|
||||
})
|
||||
async getList () {
|
||||
let res = await getDevice()
|
||||
let newArr = []
|
||||
res.map(el => {
|
||||
newArr.push(Object.assign({}, el, {imgurl: this.$store.getters.imgBaseUrl + el.device_icon}))
|
||||
})
|
||||
this.list = [...newArr]
|
||||
// this.$store.dispatch('getIsProplan', res.result.is_productonplan)
|
||||
},
|
||||
toIfWork () {
|
||||
this.$router.push('/ifwork')
|
||||
// this.$router.push('/ifwork')
|
||||
},
|
||||
toOperation (item) {
|
||||
if (item.is_run === '1') {
|
||||
let obj = {
|
||||
deviceUuid: item.device_uuid,
|
||||
deviceCode: item.device_name
|
||||
}
|
||||
this.$store.dispatch('setDevice', obj)
|
||||
this.$router.push('/operation')
|
||||
// let obj = {
|
||||
// code: item.device_code
|
||||
// }
|
||||
// this.$store.dispatch('setDevice', obj)
|
||||
this.$router.push({
|
||||
path: '/workordermanage',
|
||||
query: {code: item.device_code}
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user