2019-07-26 13:32:43 +08:00
|
|
|
<template>
|
|
|
|
<div>
|
|
|
|
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList">
|
|
|
|
</QueryListPage>
|
|
|
|
<create-task ref='CreateTask' @reloadTable="reloadTable"></create-task>
|
2019-09-30 16:20:31 +08:00
|
|
|
<div class="draft">
|
|
|
|
<el-button-group>
|
|
|
|
<el-button type="primary" @click="turnback">{{ $t('global.back') }}</el-button>
|
|
|
|
</el-button-group>
|
|
|
|
</div>
|
2019-07-26 13:32:43 +08:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import { listPublishMap, getProductList, putMapProductOnLine, putMapProductOffLine } from '@/api/jmap/mapdraft';
|
|
|
|
import { getTaskList, postTask, postTaskCancel } from '@/api/management/task';
|
|
|
|
import { launchFullscreen } from '@/utils/screen';
|
2019-08-29 17:16:33 +08:00
|
|
|
import { getSkinCodeList } from '@/api/management/mapskin'
|
2019-07-26 13:32:43 +08:00
|
|
|
import { UrlConfig } from '@/router/index';
|
|
|
|
import localStore from 'storejs';
|
|
|
|
import CreateTask from './createTask';
|
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'ManagementList',
|
|
|
|
components: {
|
|
|
|
CreateTask
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
2019-08-29 17:16:33 +08:00
|
|
|
skinCodeList: [],
|
2019-07-26 13:32:43 +08:00
|
|
|
taskList: [],
|
|
|
|
taskStatusList: [],
|
|
|
|
pagerConfig: {
|
|
|
|
pageSize: 'pageSize',
|
|
|
|
pageIndex: 'pageNum'
|
|
|
|
},
|
|
|
|
queryForm: {
|
|
|
|
labelWidth: '80px',
|
|
|
|
queryObject: {
|
|
|
|
status: {
|
|
|
|
type: 'select',
|
2019-08-29 17:16:33 +08:00
|
|
|
label: this.$t('global.status'),
|
2019-07-26 13:32:43 +08:00
|
|
|
config: {
|
|
|
|
data: []
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
queryList: {
|
|
|
|
query: getTaskList,
|
|
|
|
selectCheckShow: false,
|
|
|
|
indexShow: true,
|
|
|
|
columns: [
|
|
|
|
{
|
2019-08-29 17:16:33 +08:00
|
|
|
title: this.$t('lesson.skinType'),
|
2019-07-26 13:32:43 +08:00
|
|
|
prop: 'parameter',
|
|
|
|
type: 'tag',
|
2019-08-29 17:16:33 +08:00
|
|
|
columnValue: (row) => { return this.$convertField(row.parameter, this.skinCodeList, ['code', 'name']) },
|
2019-07-26 13:32:43 +08:00
|
|
|
tagType: (row) => { return '' }
|
|
|
|
},
|
|
|
|
{
|
2019-08-29 17:16:33 +08:00
|
|
|
title: this.$t('lesson.creationTime'),
|
2019-07-26 13:32:43 +08:00
|
|
|
prop: 'createTime'
|
|
|
|
},
|
|
|
|
{
|
2019-08-29 17:16:33 +08:00
|
|
|
title: this.$t('global.status'),
|
2019-07-26 13:32:43 +08:00
|
|
|
prop: 'status',
|
|
|
|
type: 'tag',
|
2019-08-08 15:57:36 +08:00
|
|
|
columnValue: (row) => { return this.$convertField(row.status, this.taskStatusList, ['code', 'name']) },
|
2019-07-26 13:32:43 +08:00
|
|
|
tagType: (row) => { if (row.status != '03') { return 'warning' } else { return 'success' } }
|
|
|
|
},
|
|
|
|
{
|
2019-08-29 17:16:33 +08:00
|
|
|
title: this.$t('global.startTime'),
|
2019-07-26 13:32:43 +08:00
|
|
|
prop: 'startTime'
|
|
|
|
},
|
|
|
|
{
|
2019-08-29 17:16:33 +08:00
|
|
|
title: this.$t('lesson.finishTime'),
|
2019-07-26 13:32:43 +08:00
|
|
|
prop: 'finishTime'
|
|
|
|
},
|
|
|
|
{
|
2019-08-29 17:16:33 +08:00
|
|
|
title: this.$t('lesson.createResults'),
|
2019-07-26 13:32:43 +08:00
|
|
|
prop: 'result',
|
|
|
|
width: '400px'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: 'button',
|
2019-08-29 17:16:33 +08:00
|
|
|
title: this.$t('global.operate'),
|
2019-07-26 13:32:43 +08:00
|
|
|
width: '250',
|
|
|
|
buttons: [
|
|
|
|
{
|
2019-08-29 17:16:33 +08:00
|
|
|
name: this.$t('lesson.start'),
|
2019-07-26 13:32:43 +08:00
|
|
|
handleClick: this.taskStart,
|
|
|
|
type: '',
|
|
|
|
showControl: (row) => { return row.status == '01' }
|
|
|
|
},
|
|
|
|
{
|
2019-08-29 17:16:33 +08:00
|
|
|
name: this.$t('global.cancel'),
|
2019-07-26 13:32:43 +08:00
|
|
|
handleClick: this.taskCancel,
|
|
|
|
type: '',
|
|
|
|
showControl: (row) => { return row.status == '04' }
|
|
|
|
},
|
|
|
|
{
|
2019-08-29 17:16:33 +08:00
|
|
|
name: this.$t('lesson.toPerform'),
|
2019-07-26 13:32:43 +08:00
|
|
|
handleClick: this.taskStart,
|
|
|
|
type: '',
|
|
|
|
showControl: (row) => { return row.status == '03' || row.status == '05' }
|
|
|
|
},
|
|
|
|
]
|
|
|
|
}
|
|
|
|
],
|
|
|
|
actions: [
|
2019-08-29 17:16:33 +08:00
|
|
|
{ text: this.$t('global.create'), btnCode: 'employee_insert', handler: this.createTask }
|
2019-07-26 13:32:43 +08:00
|
|
|
]
|
|
|
|
},
|
|
|
|
|
|
|
|
currentModel: {}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
created() {
|
|
|
|
this.loadInitData();
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
loadInitData() {
|
2019-08-29 17:16:33 +08:00
|
|
|
this.skinCodeList = [];
|
|
|
|
getSkinCodeList().then(response => {
|
|
|
|
this.skinCodeList = response.data;
|
2019-07-26 13:32:43 +08:00
|
|
|
})
|
|
|
|
|
|
|
|
this.taskStatusList = [];
|
|
|
|
this.$Dictionary.taskStatus().then(list => {
|
|
|
|
this.taskStatusList = list;
|
|
|
|
list.forEach(elem => {
|
|
|
|
this.queryForm.queryObject.status.config.data.push({ value: elem.code, label: elem.name });
|
|
|
|
});
|
|
|
|
})
|
|
|
|
},
|
|
|
|
taskStart(index, node) {
|
2019-08-29 17:16:33 +08:00
|
|
|
this.$confirm( this.$t('tip.startOperationHint'), this.$t('global.tips'), {
|
|
|
|
confirmButtonText: this.$t('global.confirm'),
|
|
|
|
cancelButtonText: this.$t('global.cancel'),
|
2019-07-26 13:32:43 +08:00
|
|
|
type: 'warning'
|
|
|
|
}).then(() => {
|
|
|
|
postTask({ id: node.id }).then(res => {
|
2019-08-29 17:16:33 +08:00
|
|
|
this.$message.success(this.$t('lesson.operateSuccess'));
|
2019-07-26 13:32:43 +08:00
|
|
|
this.reloadTable();
|
|
|
|
}).catch(error => {
|
|
|
|
this.reloadTable();
|
2019-08-29 17:16:33 +08:00
|
|
|
this.$messageBox(this.$t('error.operationFailure'));
|
2019-07-26 13:32:43 +08:00
|
|
|
})
|
|
|
|
})
|
|
|
|
},
|
|
|
|
taskCancel(index, node) {
|
2019-08-29 17:16:33 +08:00
|
|
|
this.$confirm( this.$t('tip.startOperationHint'), this.$t('global.tips'), {
|
|
|
|
confirmButtonText: this.$t('global.confirm'),
|
|
|
|
cancelButtonText: this.$t('global.cancel'),
|
2019-07-26 13:32:43 +08:00
|
|
|
type: 'warning'
|
|
|
|
}).then(() => {
|
|
|
|
postTaskCancel(node.id).then(res => {
|
2019-08-29 17:16:33 +08:00
|
|
|
this.$message.success(this.$t('lesson.operateSuccess'));
|
2019-07-26 13:32:43 +08:00
|
|
|
this.reloadTable();
|
|
|
|
}).catch(error => {
|
|
|
|
this.reloadTable();
|
2019-08-29 17:16:33 +08:00
|
|
|
this.$messageBox(this.$t('error.operationFailure'));
|
2019-07-26 13:32:43 +08:00
|
|
|
})
|
|
|
|
})
|
|
|
|
},
|
|
|
|
reloadTable() {
|
|
|
|
this.queryList.reload()
|
|
|
|
},
|
|
|
|
createTask() {
|
|
|
|
this.$refs.CreateTask.doShow();
|
|
|
|
},
|
2019-09-30 16:20:31 +08:00
|
|
|
turnback() {
|
|
|
|
this.$router.go(-1)
|
|
|
|
},
|
2019-07-26 13:32:43 +08:00
|
|
|
}
|
|
|
|
}
|
2019-08-29 17:16:33 +08:00
|
|
|
</script>
|
2019-09-30 16:20:31 +08:00
|
|
|
<style rel="stylesheet/scss" lang="scss" scoped>
|
|
|
|
.draft {
|
|
|
|
width: 400px;
|
|
|
|
text-align: center;
|
|
|
|
margin: 20px auto;
|
|
|
|
}
|
|
|
|
</style>
|