修改运行图接口

This commit is contained in:
ival 2019-08-29 13:52:34 +08:00
parent 30e590afc7
commit 1616639f6f
20 changed files with 1702 additions and 1515 deletions

View File

@ -277,20 +277,14 @@ export function deleteRunPlanTemplate(planId) {
} }
/** 生成通用每日运行图*/ /** 生成通用每日运行图*/
export function generateCommonRunPlanEveryDay(planId) { export function generateCommonRunPlanEveryDay(planId, params) {
return request({ return request({
url: `/api/runPlan/template/generate/${planId}`, url: `/api/runPlan/template/generate/${planId}`,
method: 'post' method: 'post',
params
}); });
} }
/** 生成用户每日运行图*/
export function generateUserRunPlanEveryDay(planId, group) {
return request({
url: `/api/runPlan/daily/privilege/${planId}?group=${group}`,
method: 'post'
});
}
/** 获取运行计划每日列表*/ /** 获取运行计划每日列表*/
export function runPlanEveryDayList(params) { export function runPlanEveryDayList(params) {
return request({ return request({
@ -309,20 +303,12 @@ export function deleteRunPlanEveryDay(planId) {
} }
/** 获取地图运行图的车次号*/ /** 获取地图运行图的车次号*/
export function getPublishMapTrainNos(skinCode) { // export function getPublishMapTrainNos(skinCode) {
return request({ // return request({
url: `/api/runPlan/daily/${skinCode}/trainNos`, // url: `/api/runPlan/daily/${skinCode}/trainNos`,
method: 'get' // method: 'get'
}); // });
} // }
/** 获取服务号、车组号*/
export function getPublishMapTrainServerNos(skinCode) {
return request({
url: `/api/runPlan/daily/${skinCode}/serverNos`,
method: 'get'
});
}
/** 分页查询加载计划*/ /** 分页查询加载计划*/
export function getRunPlanLoadList(params) { export function getRunPlanLoadList(params) {

View File

@ -239,7 +239,7 @@ export function selectScriptMembers(group, data) {
export function modifyScriptMemberSex(group, playerId, data) { export function modifyScriptMemberSex(group, playerId, data) {
return request({ return request({
url: `/api/simulation/${group}/scriptWrite/player/${playerId}?gender=${data.gender}`, url: `/api/simulation/${group}/scriptWrite/player/${playerId}?gender=${data.gender}`,
method: 'put', method: 'put'
}); });
} }
@ -486,3 +486,11 @@ export function executeScript(group) {
method: 'post' method: 'post'
}); });
} }
/** 生成用户自己的当日运行图*/
export function generateDayRunPlan(planId, group) {
return request({
url: `/api/simulation/${group}/loadRunPlan/${planId}`,
method: 'post'
});
}

View File

@ -1,9 +1,18 @@
<template> <template>
<el-dialog class="fuzhou_01 stand-stop-time" :title="title" :visible.sync="show" width="320px" <el-dialog
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag> v-dialogDrag
<el-form size="small" label-width="90px" :model="formModel" :rules="rules" ref="form"> class="fuzhou_01 stand-stop-time"
:title="title"
:visible.sync="show"
width="320px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-form ref="form" size="small" label-width="90px" :model="formModel" :rules="rules">
<el-form-item label="车 组 号:" prop="trainNumber"> <el-form-item label="车 组 号:" prop="trainNumber">
<el-input :id="domIdTrainNumber" v-model="formModel.trainNumber" @change="trainNumberChange"></el-input> <el-input :id="domIdTrainNumber" v-model="formModel.trainNumber" @change="trainNumberChange" />
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-row justify="center" class="button-group"> <el-row justify="center" class="button-group">
@ -14,17 +23,17 @@
<el-button :id="domIdCancel" @click="cancel"> </el-button> <el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col> </el-col>
</el-row> </el-row>
<confirm-control ref="confirmControl"></confirm-control> <confirm-control ref="confirmControl" />
<notice-info ref="noticeInfo"></notice-info> <notice-info ref="noticeInfo" />
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic'; import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { getPublishMapTrainNos } from '@/api/runplan'; // import { getPublishMapTrainNos } from '@/api/runplan';
import ConfirmControl from './childDialog/confirmControl'; import ConfirmControl from './childDialog/confirmControl';
import NoticeInfo from './childDialog/childDialog/noticeInfo' import NoticeInfo from './childDialog/childDialog/noticeInfo';
export default { export default {
name: 'TrainDelete', name: 'TrainDelete',
@ -36,18 +45,18 @@
return { return {
trainNoList: [], trainNoList: [],
formModel: { formModel: {
trainNumber: '', trainNumber: ''
}, },
rules: { rules: {
trainNumber: [ trainNumber: [
{ required: true, message: '请输入车组号', trigger: 'blur' } { required: true, message: '请输入车组号', trigger: 'blur' }
], ]
}, },
operation: null, operation: null,
dialogShow: false, dialogShow: false,
loading: false, loading: false
} };
}, },
computed: { computed: {
...mapGetters('map', [ ...mapGetters('map', [
@ -66,22 +75,22 @@
return this.dialogShow ? OperationEvent.Train.delTrainId.trainNumberChange.domId : ''; return this.dialogShow ? OperationEvent.Train.delTrainId.trainNumberChange.domId : '';
}, },
title() { title() {
return '删除列车识别号' return '删除列车识别号';
} }
}, },
mounted() { mounted() {
this.$nextTick(() => { this.$nextTick(() => {
this.$store.dispatch('training/tipReload'); this.$store.dispatch('training/tipReload');
}) });
}, },
methods: { methods: {
loadInitData(map) { loadInitData(map) {
if (map) { if (map) {
getPublishMapTrainNos(map.skinCode).then(response => { // getPublishMapTrainNos(map.skinCode).then(response => {
this.trainNoList = response.data; // this.trainNoList = response.data;
}).catch(error => { // }).catch(() => {
this.$messageBox(`获取列车车组号失败`); // this.$messageBox(``);
}); // });
} }
}, },
doShow(operate, selected) { doShow(operate, selected) {
@ -101,27 +110,27 @@
this.$store.dispatch('map/setTrainWindowShow', false); this.$store.dispatch('map/setTrainWindowShow', false);
}, },
trainNumberChange() { trainNumberChange() {
let operate = { const operate = {
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
val: `${trainNumber}`, val: `${this.formModel.trainNumber}`,
operation: OperationEvent.Train.delTrainId.trainNumberChange.operation operation: OperationEvent.Train.delTrainId.trainNumberChange.operation
} };
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} }
}) });
}, },
commit() { commit() {
this.$refs['form'].validate((valid) => { this.$refs['form'].validate((valid) => {
if (valid) { if (valid) {
let operate = { const operate = {
send: true, send: true,
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
operation: OperationEvent.Train.delTrainId.menu.operation, operation: OperationEvent.Train.delTrainId.menu.operation,
val: this.formModel.trainNumber val: this.formModel.trainNumber
} };
this.loading = true; this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
@ -129,28 +138,28 @@
if (valid) { if (valid) {
this.doClose(); this.doClose();
} }
}).catch(error => { }).catch(() => {
this.loading = false; this.loading = false;
this.doClose(); this.doClose();
this.$refs.noticeInfo.doShow(operate); this.$refs.noticeInfo.doShow(operate);
}) });
} else { } else {
return false; return false;
} }
}); });
}, },
cancel() { cancel() {
let operate = { const operate = {
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
operation: OperationEvent.Command.cancel.menu.operation, operation: OperationEvent.Command.cancel.menu.operation
} };
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.doClose(); this.doClose();
} }
}).catch(error => { this.doClose(); }); }).catch(() => { this.doClose(); });
}
} }
} }
};
</script> </script>

View File

@ -1,9 +1,18 @@
<template> <template>
<el-dialog class="beijing-01__systerm stand-stop-time" :title="title" :visible.sync="show" width="320px" <el-dialog
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag> v-dialogDrag
<el-form size="small" label-width="90px" :model="addModel" :rules="rules" ref="form"> class="beijing-01__systerm stand-stop-time"
:title="title"
:visible.sync="show"
width="320px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-form ref="form" size="small" label-width="90px" :model="addModel" :rules="rules">
<el-form-item label="车 组 号:" prop="groupNumber"> <el-form-item label="车 组 号:" prop="groupNumber">
<el-input v-model="addModel.groupNumber" @change="inputGroupNumber" :id="domIdInput"></el-input> <el-input :id="domIdInput" v-model="addModel.groupNumber" @change="inputGroupNumber" />
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-row justify="center" class="button-group"> <el-row justify="center" class="button-group">
@ -14,18 +23,18 @@
<el-button :id="domIdCancel" @click="cancel"> </el-button> <el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col> </el-col>
</el-row> </el-row>
<confirm-control ref="confirmControl"></confirm-control> <confirm-control ref="confirmControl" />
<notice-info ref="noticeInfo"></notice-info> <notice-info ref="noticeInfo" />
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic'; import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { getPublishMapTrainNos } from '@/api/runplan'; // import { getPublishMapTrainNos } from '@/api/runplan';
import { mouseCancelState } from '../utils/menuItemStatus'; import { mouseCancelState } from '../utils/menuItemStatus';
import ConfirmControl from './childDialog/confirmControl'; import ConfirmControl from './childDialog/confirmControl';
import NoticeInfo from './childDialog/childDialog/noticeInfo' import NoticeInfo from './childDialog/childDialog/noticeInfo';
export default { export default {
name: 'TrainDelete', name: 'TrainDelete',
@ -38,18 +47,18 @@
trainNoList: [], trainNoList: [],
selected: null, selected: null,
addModel: { addModel: {
groupNumber: '', groupNumber: ''
}, },
rules: { rules: {
groupNumber: [ groupNumber: [
{ required: true, message: '请输入车组号', trigger: 'blur' } { required: true, message: '请输入车组号', trigger: 'blur' }
], ]
}, },
operation: null, operation: null,
dialogShow: false, dialogShow: false,
loading: false, loading: false
} };
}, },
computed: { computed: {
...mapGetters('map', [ ...mapGetters('map', [
@ -68,22 +77,22 @@
return this.dialogShow ? OperationEvent.Train.delTrainId.menu.domId : ''; return this.dialogShow ? OperationEvent.Train.delTrainId.menu.domId : '';
}, },
title() { title() {
return '删除车组号' return '删除车组号';
} }
}, },
mounted() { mounted() {
this.$nextTick(() => { this.$nextTick(() => {
this.$store.dispatch('training/tipReload'); this.$store.dispatch('training/tipReload');
}) });
}, },
methods: { methods: {
loadInitData(map) { loadInitData(map) {
if (map) { if (map) {
getPublishMapTrainNos(map.skinCode).then(response => { // getPublishMapTrainNos(map.skinCode).then(response => {
this.trainNoList = response.data; // this.trainNoList = response.data;
}).catch(error => { // }).catch(() => {
this.$messageBox(`获取列车车组号失败`); // this.$messageBox(``);
}); // });
} }
}, },
doShow(operate, selected) { doShow(operate, selected) {
@ -105,27 +114,27 @@
mouseCancelState(this.selected); mouseCancelState(this.selected);
}, },
inputGroupNumber() { inputGroupNumber() {
let operate = { const operate = {
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
operation: OperationEvent.Train.delTrainId.input.operation, operation: OperationEvent.Train.delTrainId.input.operation,
val: this.addModel.groupNumber val: this.addModel.groupNumber
} };
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} }
}) });
}, },
commit() { commit() {
this.$refs['form'].validate((valid) => { this.$refs['form'].validate((valid) => {
if (valid) { if (valid) {
let operate = { const operate = {
send: true, send: true,
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
operation: OperationEvent.Train.delTrainId.menu.operation, operation: OperationEvent.Train.delTrainId.menu.operation,
val: this.addModel.groupNumber val: this.addModel.groupNumber
} };
this.loading = true; this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
@ -133,28 +142,28 @@
if (valid) { if (valid) {
this.doClose(); this.doClose();
} }
}).catch(error => { }).catch(() => {
this.loading = false; this.loading = false;
this.doClose(); this.doClose();
this.$refs.noticeInfo.doShow(operate); this.$refs.noticeInfo.doShow(operate);
}) });
} else { } else {
return false; return false;
} }
}); });
}, },
cancel() { cancel() {
let operate = { const operate = {
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
operation: OperationEvent.Command.cancel.menu.operation, operation: OperationEvent.Command.cancel.menu.operation
} };
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.doClose(); this.doClose();
} }
}).catch(error => { this.doClose(); }); }).catch(() => { this.doClose(); });
}
} }
} }
};
</script> </script>

View File

@ -18,9 +18,9 @@
</template> </template>
<script> <script>
import { runPlanTemplateList, generateUserRunPlanEveryDay } from '@/api/runplan'; import { runPlanTemplateList } from '@/api/runplan';
import { getStationListBySkinCode } from '@/api/runplan'; import { getStationListBySkinCode } from '@/api/runplan';
import { getEveryDayRunPlanData } from '@/api/simulation'; import { getEveryDayRunPlanData, generateDayRunPlan } from '@/api/simulation';
import { getSkinCodeList } from '@/api/management/mapskin'; import { getSkinCodeList } from '@/api/management/mapskin';
export default { export default {
@ -100,7 +100,7 @@ export default {
const choose = this.$refs.pageRules.currentChoose(); const choose = this.$refs.pageRules.currentChoose();
if (choose && choose.id) { if (choose && choose.id) {
this.loading = true; this.loading = true;
generateUserRunPlanEveryDay(choose.id, this.$route.query.group).then(response => { generateDayRunPlan(choose.id, this.$route.query.group).then(response => {
this.loading = false; this.loading = false;
this.reloadTable(); this.reloadTable();
this.loadRunData(); this.loadRunData();

View File

@ -1,12 +1,21 @@
<template> <template>
<el-dialog class="beijing-01__schedule create-week-plan" :title="title" :visible.sync="dialogShow" width="800px" <el-dialog
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag> v-dialogDrag
class="beijing-01__schedule create-week-plan"
:title="title"
:visible.sync="dialogShow"
width="800px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-row> <el-row>
<el-form ref="form" :model="model" :rules="rules" label-width="140px" size="small"> <el-form ref="form" :model="model" :rules="rules" label-width="140px" size="small">
<el-form-item label="运行图名称:" prop="planId"> <el-form-item label="运行图名称:" prop="planId">
<el-row> <el-row>
<el-col :span="19"> <el-col :span="19">
<el-input v-model="model.planName" :readonly="true"></el-input> <el-input v-model="model.planName" :readonly="true" />
</el-col> </el-col>
<el-col :span="4" :offset="1"> <el-col :span="4" :offset="1">
<el-button @click="handleChoose">选择 </el-button> <el-button @click="handleChoose">选择 </el-button>
@ -15,9 +24,13 @@
</el-form-item> </el-form-item>
<el-form-item label="计划日期范围:" prop="dateList"> <el-form-item label="计划日期范围:" prop="dateList">
<el-row> <el-row>
<el-date-picker type="dates" v-model="model.dateList" :clearable="false" placeholder="选择一个或多个日期" <el-date-picker
value-format="yyyy-MM-dd"> v-model="model.dateList"
</el-date-picker> type="dates"
:clearable="false"
placeholder="选择一个或多个日期"
value-format="yyyy-MM-dd"
/>
</el-row> </el-row>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -26,7 +39,7 @@
<el-button @click="create"> </el-button> <el-button @click="create"> </el-button>
<el-button @click="doClose"> </el-button> <el-button @click="doClose"> </el-button>
</el-row> </el-row>
<choose-template-plan ref="choose" @chooseConfirm="chooseConfirm"></choose-template-plan> <choose-template-plan ref="choose" @chooseConfirm="chooseConfirm" />
</el-dialog> </el-dialog>
</template> </template>
@ -46,23 +59,23 @@
model: { model: {
planId: '', planId: '',
planName: '', planName: '',
dateList: [], dateList: []
}
} }
};
}, },
computed: { computed: {
title() { title() {
return '创建一周计划' return '创建一周计划';
}, },
rules() { rules() {
let rules = { const rules = {
planId: [ planId: [
{ required: true, message: '请选择模板运行图', trigger: 'blur' } { required: true, message: '请选择模板运行图', trigger: 'blur' }
], ],
dateList: [ dateList: [
{ required: true, message: '请选择计划日期范围', trigger: 'change' } { required: true, message: '请选择计划日期范围', trigger: 'change' }
] ]
} };
return rules; return rules;
} }
@ -87,13 +100,11 @@
} }
}, },
buildModel() { buildModel() {
return this.model.dateList.map(date => {
return { return {
loadTime: date, planDateList: this.model.dateList,
mapId: this.$route.query.mapId, mapId: this.$route.query.mapId,
templatePlanId: this.model.planId templatePlanId: this.model.planId
} };
});
}, },
create() { create() {
this.$refs['form'].validate((valid) => { this.$refs['form'].validate((valid) => {
@ -102,15 +113,15 @@
this.$message.success('创建运行图计划成功'); this.$message.success('创建运行图计划成功');
this.$emit('reloadTable', { name: 'managePlanList' }); this.$emit('reloadTable', { name: 'managePlanList' });
this.doClose(); this.doClose();
}).catch(error => { }).catch(() => {
this.doClose(); this.doClose();
this.$messageBox('创建运行图计划失败'); this.$messageBox('创建运行图计划失败');
}) });
} }
}); });
} }
} }
} };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss"; @import "src/styles/mixin.scss";

View File

@ -1,8 +1,16 @@
<template> <template>
<el-dialog class="beijing-01__schedule manage-plan-list" :title="title" :visible.sync="dialogShow" width="80%" <el-dialog
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag> v-dialogDrag
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList"> class="beijing-01__schedule manage-plan-list"
</QueryListPage> :title="title"
:visible.sync="dialogShow"
width="80%"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
</el-dialog> </el-dialog>
</template> </template>
@ -40,7 +48,7 @@
}, },
{ {
title: '运行图名称', title: '运行图名称',
prop: 'runPlanName', prop: 'runPlanName'
}, },
{ {
title: '加载日期', title: '加载日期',
@ -60,16 +68,16 @@
} }
], ],
actions: [ actions: [
{ text: '创建', btnCode: 'employee_insert', handler: this.handleCreateRunPlan }, { text: '创建', btnCode: 'employee_insert', handler: this.handleCreateRunPlan }
] ]
}, },
currentModel: {} currentModel: {}
} };
}, },
computed: { computed: {
title() { title() {
return '运行图计划表' return '运行图计划表';
} }
}, },
created() { created() {
@ -93,13 +101,13 @@
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
deleteRunPlanLoad(row.id).then(response => { deleteRunPlanLoad(row.id).then(response => {
this.$message.success('删除成功') this.$message.success('删除成功');
this.reloadTable() this.reloadTable();
}).catch(error => { }).catch(() => {
this.reloadTable() this.reloadTable();
this.$messageBox('删除失败') this.$messageBox('删除失败');
}) });
}).catch(() => { }) }).catch(() => { });
}, },
handleCreateRunPlan() { handleCreateRunPlan() {
this.$emit('dispatchDialog', { name: 'createWeekPlan' }); this.$emit('dispatchDialog', { name: 'createWeekPlan' });
@ -112,10 +120,10 @@
this.dialogShow = false; this.dialogShow = false;
}, },
reloadTable() { reloadTable() {
this.queryList.reload() this.queryList.reload();
}
} }
} }
};
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss"; @import "src/styles/mixin.scss";

View File

@ -1,9 +1,18 @@
<template> <template>
<el-dialog class="chengdou-03__systerm stand-stop-time" :title="title" :visible.sync="show" width="320px" <el-dialog
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag> v-dialogDrag
<el-form size="small" label-width="90px" :model="addModel" :rules="rules" ref="form"> class="chengdou-03__systerm stand-stop-time"
:title="title"
:visible.sync="show"
width="320px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-form ref="form" size="small" label-width="90px" :model="addModel" :rules="rules">
<el-form-item label="车 组 号:" prop="groupNumber"> <el-form-item label="车 组 号:" prop="groupNumber">
<el-input v-model="addModel.groupNumber"></el-input> <el-input v-model="addModel.groupNumber" />
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-row justify="center" class="button-group"> <el-row justify="center" class="button-group">
@ -14,18 +23,18 @@
<el-button :id="domIdCancel" @click="cancel"> </el-button> <el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col> </el-col>
</el-row> </el-row>
<confirm-control ref="confirmControl"></confirm-control> <confirm-control ref="confirmControl" />
<notice-info ref="noticeInfo"></notice-info> <notice-info ref="noticeInfo" />
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic'; import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { getPublishMapTrainNos } from '@/api/runplan'; // import { getPublishMapTrainNos } from '@/api/runplan';
import { mouseCancelState } from '../utils/menuItemStatus'; import { mouseCancelState } from '../utils/menuItemStatus';
import ConfirmControl from './childDialog/confirmControl'; import ConfirmControl from './childDialog/confirmControl';
import NoticeInfo from './childDialog/childDialog/noticeInfo' import NoticeInfo from './childDialog/childDialog/noticeInfo';
export default { export default {
name: 'TrainDelete', name: 'TrainDelete',
@ -38,18 +47,18 @@
trainNoList: [], trainNoList: [],
selected: null, selected: null,
addModel: { addModel: {
groupNumber: '', groupNumber: ''
}, },
rules: { rules: {
groupNumber: [ groupNumber: [
{ required: true, message: '请输入车组号', trigger: 'blur' } { required: true, message: '请输入车组号', trigger: 'blur' }
], ]
}, },
operation: null, operation: null,
dialogShow: false, dialogShow: false,
loading: false, loading: false
} };
}, },
computed: { computed: {
...mapGetters('map', [ ...mapGetters('map', [
@ -65,22 +74,22 @@
return this.dialogShow ? OperationEvent.Train.delTrainId.menu.domId : ''; return this.dialogShow ? OperationEvent.Train.delTrainId.menu.domId : '';
}, },
title() { title() {
return '删除列车识别号' return '删除列车识别号';
} }
}, },
mounted() { mounted() {
this.$nextTick(() => { this.$nextTick(() => {
this.$store.dispatch('training/tipReload'); this.$store.dispatch('training/tipReload');
}) });
}, },
methods: { methods: {
loadInitData(map) { loadInitData(map) {
if (map) { if (map) {
getPublishMapTrainNos(map.skinCode).then(response => { // getPublishMapTrainNos(map.skinCode).then(response => {
this.trainNoList = response.data; // this.trainNoList = response.data;
}).catch(error => { // }).catch(() => {
this.$messageBox(`获取列车车组号失败`); // this.$messageBox(``);
}); // });
} }
}, },
doShow(operate, selected) { doShow(operate, selected) {
@ -104,11 +113,11 @@
commit() { commit() {
this.$refs['form'].validate((valid) => { this.$refs['form'].validate((valid) => {
if (valid) { if (valid) {
let operate = { const operate = {
send: true, send: true,
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
operation: OperationEvent.Train.delTrainId.menu.operation, operation: OperationEvent.Train.delTrainId.menu.operation
} };
this.loading = true; this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
@ -116,28 +125,28 @@
if (valid) { if (valid) {
this.doClose(); this.doClose();
} }
}).catch(error => { }).catch(() => {
this.loading = false; this.loading = false;
this.doClose(); this.doClose();
this.$refs.noticeInfo.doShow(operate); this.$refs.noticeInfo.doShow(operate);
}) });
} else { } else {
return false; return false;
} }
}); });
}, },
cancel() { cancel() {
let operate = { const operate = {
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
operation: OperationEvent.Command.cancel.menu.operation, operation: OperationEvent.Command.cancel.menu.operation
} };
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.doClose(); this.doClose();
} }
}).catch(error => { this.doClose(); }); }).catch(() => { this.doClose(); });
}
} }
} }
};
</script> </script>

View File

@ -18,10 +18,9 @@
</template> </template>
<script> <script>
// import { listPublishMap } from '@/api/jmap/mapdraft'; import { runPlanTemplateList } from '@/api/runplan';
import { runPlanTemplateList, generateUserRunPlanEveryDay } from '@/api/runplan';
import { getStationListBySkinCode } from '@/api/runplan'; import { getStationListBySkinCode } from '@/api/runplan';
import { getEveryDayRunPlanData } from '@/api/simulation'; import { getEveryDayRunPlanData, generateDayRunPlan } from '@/api/simulation';
import { getSkinCodeList } from '@/api/management/mapskin'; import { getSkinCodeList } from '@/api/management/mapskin';
export default { export default {
@ -101,7 +100,7 @@ export default {
const choose = this.$refs.pageRules.currentChoose(); const choose = this.$refs.pageRules.currentChoose();
if (choose && choose.id) { if (choose && choose.id) {
this.loading = true; this.loading = true;
generateUserRunPlanEveryDay(choose.id, this.$route.query.group).then(response => { generateDayRunPlan(choose.id, this.$route.query.group).then(response => {
this.loading = false; this.loading = false;
this.reloadTable(); this.reloadTable();
this.loadRunData(); this.loadRunData();

View File

@ -1,12 +1,21 @@
<template> <template>
<el-dialog class="beijing-01__schedule create-week-plan" :title="title" :visible.sync="dialogShow" width="800px" <el-dialog
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag> v-dialogDrag
class="beijing-01__schedule create-week-plan"
:title="title"
:visible.sync="dialogShow"
width="800px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-row> <el-row>
<el-form ref="form" :model="model" :rules="rules" label-width="140px" size="small"> <el-form ref="form" :model="model" :rules="rules" label-width="140px" size="small">
<el-form-item label="运行图名称:" prop="planId"> <el-form-item label="运行图名称:" prop="planId">
<el-row> <el-row>
<el-col :span="19"> <el-col :span="19">
<el-input v-model="model.planName" :readonly="true"></el-input> <el-input v-model="model.planName" :readonly="true" />
</el-col> </el-col>
<el-col :span="4" :offset="1"> <el-col :span="4" :offset="1">
<el-button @click="handleChoose">选择 </el-button> <el-button @click="handleChoose">选择 </el-button>
@ -15,9 +24,13 @@
</el-form-item> </el-form-item>
<el-form-item label="计划日期范围:" prop="dateList"> <el-form-item label="计划日期范围:" prop="dateList">
<el-row> <el-row>
<el-date-picker type="dates" v-model="model.dateList" :clearable="false" placeholder="选择一个或多个日期" <el-date-picker
value-format="yyyy-MM-dd"> v-model="model.dateList"
</el-date-picker> type="dates"
:clearable="false"
placeholder="选择一个或多个日期"
value-format="yyyy-MM-dd"
/>
</el-row> </el-row>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -26,7 +39,7 @@
<el-button @click="create"> </el-button> <el-button @click="create"> </el-button>
<el-button @click="doClose"> </el-button> <el-button @click="doClose"> </el-button>
</el-row> </el-row>
<choose-template-plan ref="choose" @chooseConfirm="chooseConfirm"></choose-template-plan> <choose-template-plan ref="choose" @chooseConfirm="chooseConfirm" />
</el-dialog> </el-dialog>
</template> </template>
@ -46,23 +59,23 @@
model: { model: {
planId: '', planId: '',
planName: '', planName: '',
dateList: [], dateList: []
}
} }
};
}, },
computed: { computed: {
title() { title() {
return '创建一周计划' return '创建一周计划';
}, },
rules() { rules() {
let rules = { const rules = {
planId: [ planId: [
{ required: true, message: '请选择模板运行图', trigger: 'blur' } { required: true, message: '请选择模板运行图', trigger: 'blur' }
], ],
dateList: [ dateList: [
{ required: true, message: '请选择计划日期范围', trigger: 'change' } { required: true, message: '请选择计划日期范围', trigger: 'change' }
] ]
} };
return rules; return rules;
} }
@ -87,13 +100,11 @@
} }
}, },
buildModel() { buildModel() {
return this.model.dateList.map(date => {
return { return {
loadTime: date, planDateList: this.model.dateList,
mapId: this.$route.query.mapId, mapId: this.$route.query.mapId,
templatePlanId: this.model.planId templatePlanId: this.model.planId
} };
});
}, },
create() { create() {
this.$refs['form'].validate((valid) => { this.$refs['form'].validate((valid) => {
@ -102,15 +113,15 @@
this.$message.success('创建运行图计划成功'); this.$message.success('创建运行图计划成功');
this.$emit('reloadTable', { name: 'managePlanList' }); this.$emit('reloadTable', { name: 'managePlanList' });
this.doClose(); this.doClose();
}).catch(error => { }).catch(() => {
this.doClose(); this.doClose();
this.$messageBox('创建运行图计划失败'); this.$messageBox('创建运行图计划失败');
}) });
} }
}); });
} }
} }
} };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss"; @import "src/styles/mixin.scss";

View File

@ -1,8 +1,16 @@
<template> <template>
<el-dialog class="beijing-01__schedule manage-plan-list" :title="title" :visible.sync="dialogShow" width="80%" <el-dialog
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag> v-dialogDrag
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList"> class="beijing-01__schedule manage-plan-list"
</QueryListPage> :title="title"
:visible.sync="dialogShow"
width="80%"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
</el-dialog> </el-dialog>
</template> </template>
@ -40,7 +48,7 @@
}, },
{ {
title: '运行图名称', title: '运行图名称',
prop: 'runPlanName', prop: 'runPlanName'
}, },
{ {
title: '加载日期', title: '加载日期',
@ -60,16 +68,16 @@
} }
], ],
actions: [ actions: [
{ text: '创建', btnCode: 'employee_insert', handler: this.handleCreateRunPlan }, { text: '创建', btnCode: 'employee_insert', handler: this.handleCreateRunPlan }
] ]
}, },
currentModel: {} currentModel: {}
} };
}, },
computed: { computed: {
title() { title() {
return '运行图计划表' return '运行图计划表';
} }
}, },
created() { created() {
@ -93,13 +101,13 @@
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
deleteRunPlanLoad(row.id).then(response => { deleteRunPlanLoad(row.id).then(response => {
this.$message.success('删除成功') this.$message.success('删除成功');
this.reloadTable() this.reloadTable();
}).catch(error => { }).catch(() => {
this.reloadTable() this.reloadTable();
this.$messageBox('删除失败') this.$messageBox('删除失败');
}) });
}).catch(() => { }) }).catch(() => { });
}, },
handleCreateRunPlan() { handleCreateRunPlan() {
this.$emit('dispatchDialog', { name: 'createWeekPlan' }); this.$emit('dispatchDialog', { name: 'createWeekPlan' });
@ -112,10 +120,10 @@
this.dialogShow = false; this.dialogShow = false;
}, },
reloadTable() { reloadTable() {
this.queryList.reload() this.queryList.reload();
}
} }
} }
};
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss"; @import "src/styles/mixin.scss";

View File

@ -1,20 +1,27 @@
<template> <template>
<el-dialog :title="title" class="beijing-01__schedule reload-today-plan" :visible.sync="dialogShow" width="80%" <el-dialog
:before-close="doClose" :modal="false" :close-on-click-modal="false" v-dialogDrag> v-dialogDrag
<QueryListPage ref="pageRules" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList"> :title="title"
</QueryListPage> class="beijing-01__schedule reload-today-plan"
:visible.sync="dialogShow"
width="80%"
:before-close="doClose"
:modal="false"
:close-on-click-modal="false"
>
<QueryListPage ref="pageRules" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
<el-row type="flex" justify="center" class="button-group"> <el-row type="flex" justify="center" class="button-group">
<el-button type="primary" @click="handleConfirm" :loading="loading"> </el-button> <el-button type="primary" :loading="loading" @click="handleConfirm"> </el-button>
<el-button @click="dialogShow = false"> </el-button> <el-button @click="dialogShow = false"> </el-button>
</el-row> </el-row>
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
import { runPlanTemplateList, generateUserRunPlanEveryDay } from '@/api/runplan'; import { runPlanTemplateList } from '@/api/runplan';
import { getStationListBySkinCode } from '@/api/runplan'; import { getStationListBySkinCode } from '@/api/runplan';
import { getEveryDayRunPlanData } from '@/api/simulation'; import { getEveryDayRunPlanData, generateDayRunPlan } from '@/api/simulation';
import { getSkinCodeList } from '@/api/management/mapskin' import { getSkinCodeList } from '@/api/management/mapskin';
export default { export default {
name: 'ReloadTodayPlan', name: 'ReloadTodayPlan',
@ -51,19 +58,19 @@
prop: 'skinCode', prop: 'skinCode',
type: 'tag', type: 'tag',
columnValue: (row) => { columnValue: (row) => {
return this.$convertField(row.skinCode, this.skinCodeList, ['code', 'name']) return this.$convertField(row.skinCode, this.skinCodeList, ['code', 'name']);
}, },
tagType: (row) => { return 'success' } tagType: (row) => { return 'success'; }
} }
] ]
}, },
currentModel: {} currentModel: {}
} };
}, },
computed: { computed: {
title() { title() {
return '加载当天计划' return '加载当天计划';
} }
}, },
methods: { methods: {
@ -71,7 +78,7 @@
this.skinCodeList = []; this.skinCodeList = [];
getSkinCodeList().then(response => { getSkinCodeList().then(response => {
this.skinCodeList = response.data; this.skinCodeList = response.data;
}) });
}, },
doShow() { doShow() {
this.loading = false; this.loading = false;
@ -93,47 +100,47 @@
const choose = this.$refs.pageRules.currentChoose(); const choose = this.$refs.pageRules.currentChoose();
if (choose && choose.id) { if (choose && choose.id) {
this.loading = true; this.loading = true;
generateUserRunPlanEveryDay(choose.id, this.$route.query.group).then(response => { generateDayRunPlan(choose.id, this.$route.query.group).then(response => {
this.loading = false; this.loading = false;
this.reloadTable() this.reloadTable();
this.loadRunData(); this.loadRunData();
this.doClose(); this.doClose();
this.$message.success(`生成用户每日运行图成功`); this.$message.success(`生成用户每日运行图成功`);
}).catch(error => { }).catch(() => {
this.loading = false; this.loading = false;
this.reloadTable() this.reloadTable();
this.$messageBox(`生成用户每日运行图失败`); this.$messageBox(`生成用户每日运行图失败`);
}) });
} else { } else {
this.$messageBox(`请选择需要加载的运行图`); this.$messageBox(`请选择需要加载的运行图`);
} }
} }
}, },
loadRunData() { loadRunData() {
let skinCode = this.$route.query.skinCode; const skinCode = this.$route.query.skinCode;
this.$store.dispatch('runPlan/clear'); this.$store.dispatch('runPlan/clear');
if (skinCode) { if (skinCode) {
getStationListBySkinCode(skinCode).then(response => { getStationListBySkinCode(skinCode).then(response => {
let stations = response.data; const stations = response.data;
this.PlanConvert = this.$theme.loadPlanConvert(skinCode); this.PlanConvert = this.$theme.loadPlanConvert(skinCode);
this.$store.dispatch('runPlan/setStations', stations).then(() => { this.$store.dispatch('runPlan/setStations', stations).then(() => {
getEveryDayRunPlanData(this.$route.query.group).then(resp => { getEveryDayRunPlanData(this.$route.query.group).then(resp => {
this.$store.dispatch('runPlan/setPlanData', resp.data); this.$store.dispatch('runPlan/setPlanData', resp.data);
}).catch(error => { }).catch(() => {
this.$store.dispatch('runPlan/setPlanData', []); this.$store.dispatch('runPlan/setPlanData', []);
this.$messageBox(`获取运行图数据失败`); this.$messageBox(`获取运行图数据失败`);
}) });
}) });
}).catch(error => { }).catch(() => {
this.$messageBox(`获取车站列表失败`); this.$messageBox(`获取车站列表失败`);
}); });
} }
}, },
reloadTable() { reloadTable() {
this.queryList.reload() this.queryList.reload();
}
} }
} }
};
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss"; @import "src/styles/mixin.scss";

View File

@ -1,12 +1,21 @@
<template> <template>
<el-dialog class="beijing-01__schedule create-week-plan" :title="title" :visible.sync="dialogShow" width="800px" <el-dialog
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag> v-dialogDrag
class="beijing-01__schedule create-week-plan"
:title="title"
:visible.sync="dialogShow"
width="800px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-row> <el-row>
<el-form ref="form" :model="model" :rules="rules" label-width="140px" size="small"> <el-form ref="form" :model="model" :rules="rules" label-width="140px" size="small">
<el-form-item label="运行图名称:" prop="planId"> <el-form-item label="运行图名称:" prop="planId">
<el-row> <el-row>
<el-col :span="19"> <el-col :span="19">
<el-input v-model="model.planName" :readonly="true"></el-input> <el-input v-model="model.planName" :readonly="true" />
</el-col> </el-col>
<el-col :span="4" :offset="1"> <el-col :span="4" :offset="1">
<el-button @click="handleChoose">选择 </el-button> <el-button @click="handleChoose">选择 </el-button>
@ -15,9 +24,13 @@
</el-form-item> </el-form-item>
<el-form-item label="计划日期范围:" prop="dateList"> <el-form-item label="计划日期范围:" prop="dateList">
<el-row> <el-row>
<el-date-picker type="dates" v-model="model.dateList" :clearable="false" placeholder="选择一个或多个日期" <el-date-picker
value-format="yyyy-MM-dd"> v-model="model.dateList"
</el-date-picker> type="dates"
:clearable="false"
placeholder="选择一个或多个日期"
value-format="yyyy-MM-dd"
/>
</el-row> </el-row>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -26,7 +39,7 @@
<el-button @click="create"> </el-button> <el-button @click="create"> </el-button>
<el-button @click="doClose"> </el-button> <el-button @click="doClose"> </el-button>
</el-row> </el-row>
<choose-template-plan ref="choose" @chooseConfirm="chooseConfirm"></choose-template-plan> <choose-template-plan ref="choose" @chooseConfirm="chooseConfirm" />
</el-dialog> </el-dialog>
</template> </template>
@ -46,23 +59,23 @@
model: { model: {
planId: '', planId: '',
planName: '', planName: '',
dateList: [], dateList: []
}
} }
};
}, },
computed: { computed: {
title() { title() {
return '创建一周计划' return '创建一周计划';
}, },
rules() { rules() {
let rules = { const rules = {
planId: [ planId: [
{ required: true, message: '请选择模板运行图', trigger: 'blur' } { required: true, message: '请选择模板运行图', trigger: 'blur' }
], ],
dateList: [ dateList: [
{ required: true, message: '请选择计划日期范围', trigger: 'change' } { required: true, message: '请选择计划日期范围', trigger: 'change' }
] ]
} };
return rules; return rules;
} }
@ -87,13 +100,11 @@
} }
}, },
buildModel() { buildModel() {
return this.model.dateList.map(date => {
return { return {
loadTime: date, planDateList: this.model.dateList,
mapId: this.$route.query.mapId, mapId: this.$route.query.mapId,
templatePlanId: this.model.planId templatePlanId: this.model.planId
} };
});
}, },
create() { create() {
this.$refs['form'].validate((valid) => { this.$refs['form'].validate((valid) => {
@ -102,15 +113,15 @@
this.$message.success('创建运行图计划成功'); this.$message.success('创建运行图计划成功');
this.$emit('reloadTable', { name: 'managePlanList' }); this.$emit('reloadTable', { name: 'managePlanList' });
this.doClose(); this.doClose();
}).catch(error => { }).catch(() => {
this.doClose(); this.doClose();
this.$messageBox('创建运行图计划失败'); this.$messageBox('创建运行图计划失败');
}) });
} }
}); });
} }
} }
} };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss"; @import "src/styles/mixin.scss";

View File

@ -1,9 +1,18 @@
<template> <template>
<el-dialog class="fuzhou-01__systerm stand-stop-time" :title="title" :visible.sync="show" width="320px" <el-dialog
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag> v-dialogDrag
<el-form size="small" label-width="90px" :model="formModel" :rules="rules" ref="form"> class="fuzhou-01__systerm stand-stop-time"
:title="title"
:visible.sync="show"
width="320px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-form ref="form" size="small" label-width="90px" :model="formModel" :rules="rules">
<el-form-item label="车 组 号:" prop="groupNumber"> <el-form-item label="车 组 号:" prop="groupNumber">
<el-input :id="domIdTrainNumber" v-model="formModel.groupNumber" @change="trainNumberChange"></el-input> <el-input :id="domIdTrainNumber" v-model="formModel.groupNumber" @change="trainNumberChange" />
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-row justify="center" class="button-group"> <el-row justify="center" class="button-group">
@ -14,17 +23,17 @@
<el-button :id="domIdCancel" @click="cancel"> </el-button> <el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col> </el-col>
</el-row> </el-row>
<confirm-control ref="confirmControl"></confirm-control> <confirm-control ref="confirmControl" />
<notice-info ref="noticeInfo"></notice-info> <notice-info ref="noticeInfo" />
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic'; import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { getPublishMapTrainNos } from '@/api/runplan'; // import { getPublishMapTrainNos } from '@/api/runplan';
import ConfirmControl from './childDialog/confirmControl'; import ConfirmControl from './childDialog/confirmControl';
import NoticeInfo from './childDialog/childDialog/noticeInfo' import NoticeInfo from './childDialog/childDialog/noticeInfo';
export default { export default {
name: 'TrainDelete', name: 'TrainDelete',
@ -36,18 +45,18 @@
return { return {
trainNoList: [], trainNoList: [],
formModel: { formModel: {
groupNumber: '', groupNumber: ''
}, },
rules: { rules: {
groupNumber: [ groupNumber: [
{ required: true, message: '请输入车组号', trigger: 'blur' } { required: true, message: '请输入车组号', trigger: 'blur' }
], ]
}, },
operation: null, operation: null,
dialogShow: false, dialogShow: false,
loading: false, loading: false
} };
}, },
computed: { computed: {
...mapGetters('map', [ ...mapGetters('map', [
@ -66,22 +75,22 @@
return this.dialogShow ? OperationEvent.Train.delTrainId.trainNumberChange.domId : ''; return this.dialogShow ? OperationEvent.Train.delTrainId.trainNumberChange.domId : '';
}, },
title() { title() {
return '删除列车识别号' return '删除列车识别号';
} }
}, },
mounted() { mounted() {
this.$nextTick(() => { this.$nextTick(() => {
this.$store.dispatch('training/tipReload'); this.$store.dispatch('training/tipReload');
}) });
}, },
methods: { methods: {
loadInitData(map) { loadInitData(map) {
if (map) { if (map) {
getPublishMapTrainNos(map.skinCode).then(response => { // getPublishMapTrainNos(map.skinCode).then(response => {
this.trainNoList = response.data; // this.trainNoList = response.data;
}).catch(error => { // }).catch(() => {
this.$messageBox(`获取列车车组号失败`); // this.$messageBox(``);
}); // });
} }
}, },
doShow(operate, selected) { doShow(operate, selected) {
@ -101,27 +110,27 @@
this.$store.dispatch('map/setTrainWindowShow', false); this.$store.dispatch('map/setTrainWindowShow', false);
}, },
trainNumberChange() { trainNumberChange() {
let operate = { const operate = {
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
val: `${groupNumber}`, val: `${this.formModel.groupNumber}`,
operation: OperationEvent.Train.delTrainId.trainNumberChange.operation operation: OperationEvent.Train.delTrainId.trainNumberChange.operation
} };
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
} }
}) });
}, },
commit() { commit() {
this.$refs['form'].validate((valid) => { this.$refs['form'].validate((valid) => {
if (valid) { if (valid) {
let operate = { const operate = {
send: true, send: true,
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
operation: OperationEvent.Train.delTrainId.menu.operation, operation: OperationEvent.Train.delTrainId.menu.operation,
val: this.formModel.groupNumber val: this.formModel.groupNumber
} };
this.loading = true; this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
@ -129,28 +138,28 @@
if (valid) { if (valid) {
this.doClose(); this.doClose();
} }
}).catch(error => { }).catch(() => {
this.loading = false; this.loading = false;
this.doClose(); this.doClose();
this.$refs.noticeInfo.doShow(operate); this.$refs.noticeInfo.doShow(operate);
}) });
} else { } else {
return false; return false;
} }
}); });
}, },
cancel() { cancel() {
let operate = { const operate = {
type: MapDeviceType.Train.type, type: MapDeviceType.Train.type,
operation: OperationEvent.Command.cancel.menu.operation, operation: OperationEvent.Command.cancel.menu.operation
} };
this.$store.dispatch('training/next', operate).then(({ valid }) => { this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) { if (valid) {
this.doClose(); this.doClose();
} }
}).catch(error => { this.doClose(); }); }).catch(() => { this.doClose(); });
}
} }
} }
};
</script> </script>

View File

@ -18,9 +18,9 @@
</template> </template>
<script> <script>
import { runPlanTemplateList, generateUserRunPlanEveryDay } from '@/api/runplan'; import { runPlanTemplateList } from '@/api/runplan';
import { getStationListBySkinCode } from '@/api/runplan'; import { getStationListBySkinCode } from '@/api/runplan';
import { getEveryDayRunPlanData } from '@/api/simulation'; import { getEveryDayRunPlanData, generateDayRunPlan } from '@/api/simulation';
import { getSkinCodeList } from '@/api/management/mapskin'; import { getSkinCodeList } from '@/api/management/mapskin';
export default { export default {
@ -100,7 +100,7 @@ export default {
const choose = this.$refs.pageRules.currentChoose(); const choose = this.$refs.pageRules.currentChoose();
if (choose && choose.id) { if (choose && choose.id) {
this.loading = true; this.loading = true;
generateUserRunPlanEveryDay(choose.id, this.$route.query.group).then(response => { generateDayRunPlan(choose.id, this.$route.query.group).then(response => {
this.loading = false; this.loading = false;
this.reloadTable(); this.reloadTable();
this.loadRunData(); this.loadRunData();

View File

@ -1,12 +1,21 @@
<template> <template>
<el-dialog class="fuzhou-01__schedule create-week-plan" :title="title" :visible.sync="dialogShow" width="800px" <el-dialog
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag> v-dialogDrag
class="fuzhou-01__schedule create-week-plan"
:title="title"
:visible.sync="dialogShow"
width="800px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-row> <el-row>
<el-form ref="form" :model="model" :rules="rules" label-width="140px" size="small"> <el-form ref="form" :model="model" :rules="rules" label-width="140px" size="small">
<el-form-item label="运行图名称:" prop="planId"> <el-form-item label="运行图名称:" prop="planId">
<el-row> <el-row>
<el-col :span="19"> <el-col :span="19">
<el-input v-model="model.planName" :readonly="true"></el-input> <el-input v-model="model.planName" :readonly="true" />
</el-col> </el-col>
<el-col :span="4" :offset="1"> <el-col :span="4" :offset="1">
<el-button @click="handleChoose">选择 </el-button> <el-button @click="handleChoose">选择 </el-button>
@ -15,9 +24,13 @@
</el-form-item> </el-form-item>
<el-form-item label="计划日期范围:" prop="dateList"> <el-form-item label="计划日期范围:" prop="dateList">
<el-row> <el-row>
<el-date-picker type="dates" v-model="model.dateList" :clearable="false" placeholder="选择一个或多个日期" <el-date-picker
value-format="yyyy-MM-dd"> v-model="model.dateList"
</el-date-picker> type="dates"
:clearable="false"
placeholder="选择一个或多个日期"
value-format="yyyy-MM-dd"
/>
</el-row> </el-row>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -26,7 +39,7 @@
<el-button @click="create"> </el-button> <el-button @click="create"> </el-button>
<el-button @click="doClose"> </el-button> <el-button @click="doClose"> </el-button>
</el-row> </el-row>
<choose-template-plan ref="choose" @chooseConfirm="chooseConfirm"></choose-template-plan> <choose-template-plan ref="choose" @chooseConfirm="chooseConfirm" />
</el-dialog> </el-dialog>
</template> </template>
@ -46,23 +59,23 @@
model: { model: {
planId: '', planId: '',
planName: '', planName: '',
dateList: [], dateList: []
}
} }
};
}, },
computed: { computed: {
title() { title() {
return '创建一周计划' return '创建一周计划';
}, },
rules() { rules() {
let rules = { const rules = {
planId: [ planId: [
{ required: true, message: '请选择模板运行图', trigger: 'blur' } { required: true, message: '请选择模板运行图', trigger: 'blur' }
], ],
dateList: [ dateList: [
{ required: true, message: '请选择计划日期范围', trigger: 'change' } { required: true, message: '请选择计划日期范围', trigger: 'change' }
] ]
} };
return rules; return rules;
} }
@ -87,13 +100,11 @@
} }
}, },
buildModel() { buildModel() {
return this.model.dateList.map(date => {
return { return {
loadTime: date, planDateList: this.model.dateList,
mapId: this.$route.query.mapId, mapId: this.$route.query.mapId,
templatePlanId: this.model.planId templatePlanId: this.model.planId
} };
});
}, },
create() { create() {
this.$refs['form'].validate((valid) => { this.$refs['form'].validate((valid) => {
@ -102,15 +113,15 @@
this.$message.success('创建运行图计划成功'); this.$message.success('创建运行图计划成功');
this.$emit('reloadTable', { name: 'managePlanList' }); this.$emit('reloadTable', { name: 'managePlanList' });
this.doClose(); this.doClose();
}).catch(error => { }).catch(() => {
this.doClose(); this.doClose();
this.$messageBox('创建运行图计划失败'); this.$messageBox('创建运行图计划失败');
}) });
} }
}); });
} }
} }
} };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss"; @import "src/styles/mixin.scss";

View File

@ -1,8 +1,16 @@
<template> <template>
<el-dialog class="fuzhou-01__schedule manage-plan-list" :title="title" :visible.sync="dialogShow" width="80%" <el-dialog
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag> v-dialogDrag
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList"> class="fuzhou-01__schedule manage-plan-list"
</QueryListPage> :title="title"
:visible.sync="dialogShow"
width="80%"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
</el-dialog> </el-dialog>
</template> </template>
@ -40,7 +48,7 @@
}, },
{ {
title: '运行图名称', title: '运行图名称',
prop: 'runPlanName', prop: 'runPlanName'
}, },
{ {
title: '加载日期', title: '加载日期',
@ -60,16 +68,16 @@
} }
], ],
actions: [ actions: [
{ text: '创建', btnCode: 'employee_insert', handler: this.handleCreateRunPlan }, { text: '创建', btnCode: 'employee_insert', handler: this.handleCreateRunPlan }
] ]
}, },
currentModel: {} currentModel: {}
} };
}, },
computed: { computed: {
title() { title() {
return '运行图计划表' return '运行图计划表';
} }
}, },
created() { created() {
@ -93,13 +101,13 @@
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
deleteRunPlanLoad(row.id).then(response => { deleteRunPlanLoad(row.id).then(response => {
this.$message.success('删除成功') this.$message.success('删除成功');
this.reloadTable() this.reloadTable();
}).catch(error => { }).catch(() => {
this.reloadTable() this.reloadTable();
this.$messageBox('删除失败') this.$messageBox('删除失败');
}) });
}).catch(() => { }) }).catch(() => { });
}, },
handleCreateRunPlan() { handleCreateRunPlan() {
this.$emit('dispatchDialog', { name: 'createWeekPlan' }); this.$emit('dispatchDialog', { name: 'createWeekPlan' });
@ -112,10 +120,10 @@
this.dialogShow = false; this.dialogShow = false;
}, },
reloadTable() { reloadTable() {
this.queryList.reload() this.queryList.reload();
}
} }
} }
};
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss"; @import "src/styles/mixin.scss";

View File

@ -3,9 +3,9 @@ export function getBaseUrl() {
let BASE_API; let BASE_API;
if (process.env.NODE_ENV === 'development') { if (process.env.NODE_ENV === 'development') {
// BASE_API = 'https://joylink.club/jlcloud'; // BASE_API = 'https://joylink.club/jlcloud';
BASE_API = 'https://test.joylink.club/jlcloud'; // BASE_API = 'https://test.joylink.club/jlcloud';
// BASE_API = 'http://192.168.3.5:9000'; // 袁琪 // BASE_API = 'http://192.168.3.5:9000'; // 袁琪
// BASE_API = 'http://192.168.3.6:9000'; // 旭强 BASE_API = 'http://192.168.3.6:9000'; // 旭强
// BASE_API = 'http://192.168.3.4:9000' // 琰培 // BASE_API = 'http://192.168.3.4:9000' // 琰培
} else { } else {
BASE_API = process.env.VUE_APP_BASE_API; BASE_API = process.env.VUE_APP_BASE_API;

View File

@ -1,6 +1,7 @@
<template> <template>
<div> <div>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" /> <QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
<map-select ref="map" @confirm="handleGenerateEveryDay" />
</div> </div>
</template> </template>
@ -9,9 +10,13 @@ import { superAdmin } from '@/router';
import { getSkinCodeList } from '@/api/management/mapskin'; import { getSkinCodeList } from '@/api/management/mapskin';
import { runPlanTemplateList, deleteRunPlanTemplate, generateCommonRunPlanEveryDay } from '@/api/runplan'; import { runPlanTemplateList, deleteRunPlanTemplate, generateCommonRunPlanEveryDay } from '@/api/runplan';
import { UrlConfig } from '@/router/index'; import { UrlConfig } from '@/router/index';
import MapSelect from './mapSelect';
export default { export default {
name: 'RunPlanTemplate', name: 'RunPlanTemplate',
components: {
MapSelect
},
data() { data() {
return { return {
skinCodeList: [], skinCodeList: [],
@ -71,7 +76,7 @@ export default {
}, },
{ {
name: this.$t('publish.generateRunPlan'), name: this.$t('publish.generateRunPlan'),
handleClick: this.handleGenerateEveryDay, handleClick: this.handleMapSelect,
type: '' type: ''
}, },
{ {
@ -120,15 +125,20 @@ export default {
}); });
}).catch(() => { }); }).catch(() => { });
}, },
//
handleMapSelect(index, row) {
this.$refs.map.doShow(row);
},
// //
handleGenerateEveryDay(index, row) { handleGenerateEveryDay({planId, mapId}) {
this.$confirm(this.$t('publish.wellGenerateEveryRunPlan'), this.$t('global.tips'), { this.$confirm(this.$t('publish.wellGenerateEveryRunPlan'), this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'), confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'), cancelButtonText: this.$t('global.cancel'),
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
generateCommonRunPlanEveryDay(row.id).then(response => { generateCommonRunPlanEveryDay(planId, {mapId}).then(response => {
this.reloadTable(); this.reloadTable();
this.$refs.map.doClose();
this.$message.success(this.$t('publish.createCommonSuccess')); this.$message.success(this.$t('publish.createCommonSuccess'));
}).catch(() => { }).catch(() => {
this.reloadTable(); this.reloadTable();

View File

@ -0,0 +1,73 @@
<template>
<el-dialog
:title="title"
:visible.sync="show"
width="30%"
:before-close="doClose"
>
<el-form ref="form" :model="formMdoel" :rules="rules" label-width="80px">
<el-form-item :label="$t('publish.selectMap')" prop="mapId">
<el-select v-model="formMdoel.mapId" :placeholder="$t('rules.mapInput')">
<el-option
v-for="item in mapList"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="doClose">{{ $t('global.cancel') }}</el-button>
<el-button type="primary" @click="handleCofirm">{{ $t('global.confirm') }}</el-button>
</span>
</el-dialog>
</template>
<script>
import { getPublishMapListBySkinCode } from '@/api/jmap/map';
export default {
data() {
return {
show: false,
mapList: [],
formMdoel: {
planId: 0,
mapId: ''
}
};
},
computed: {
title() {
return this.$t('publish.selectMap');
},
rules() {
return {
mapId: [
{ required: true, message: this.$t('rules.mapInput'), trigger: 'blur' }
]
};
}
},
methods: {
doShow(row) {
this.formMdoel.planId = row.id;
this.show = true;
getPublishMapListBySkinCode(row.skinCode).then(resp => {
this.mapList = resp.data;
});
},
doClose(done) {
this.show = false;
},
handleCofirm() {
this.$refs['form'].validate((valid) => {
if (valid) {
this.$emit('confirm', this.formMdoel);
}
});
}
}
};
</script>