添加调度命令直接签收界面

This commit is contained in:
强 董 2022-07-04 09:57:24 +08:00
parent 5c078cdfbc
commit 4d5cf7b92c
3 changed files with 286 additions and 3 deletions

View File

@ -58,6 +58,7 @@
<stage-runplan v-if="isCtc" ref="stageRunplan" @closeFlash="closeStageFlash" @noticeInfo="noticeInfo" />
<notice-info v-if="isCtc" ref="noticeInfo" pop-class="chengdou-03__systerm" />
<cmdManage v-if="isCtc" ref="cmdManage" />
<signedCmd v-if="isCtc" ref="signedCmd" @signedCmdClose="signedCmdClose" />
</div>
</template>
@ -102,6 +103,7 @@ import CtcBarIcon16 from '@/assets/ctc_icon/pic16.png';
import CtcBarIcon17 from '@/assets/ctc_icon/pic17.png';
import CtcBarIcon18 from '@/assets/ctc_icon/pic18.png';
import cmdManage from '@/views/dispatcherStationManage/cmdManage.vue';
import signedCmd from '@/views/dispatcherStationManage/signedCmd.vue';
export default {
name: 'Menus',
@ -124,7 +126,8 @@ export default {
// DispatcherLoger,
BottomTable,
MenuPanel,
cmdManage
cmdManage,
signedCmd
},
props: {
selected: {
@ -243,9 +246,16 @@ export default {
window.onclick = function (e) {};
},
methods: {
showCmdManage() {
signedCmdClose() {
this.$refs.cmdManage.doShow();
},
showCmdManage() {
if (this.hasCommandMsg) {
this.$refs.signedCmd.doShow();
} else {
this.$refs.cmdManage.doShow();
}
},
getRailwaySimulationRunplanSend() {
const stationCode = this.$store.state.training.roleDeviceCode;
const railwaySimulationRunplanSendMap = this.$store.state.socket.railwaySimulationRunplanSendMap;

View File

@ -284,6 +284,8 @@ export default {
}
},
getSenderName() {
debugger;
this.memberDataList = Object.values(this.memberData);
const activeUser = this.memberDataList.find(item => {
return item.userId == this.$store.state.user.id;
});
@ -293,7 +295,6 @@ export default {
}
},
doShow() {
this.memberDataList = Object.values(this.memberData);
this.getSenderName();
this.dialogShow = true;
},

View File

@ -0,0 +1,272 @@
<template>
<el-dialog
v-dialogDrag
class="cmd-manage chengdou-03__systerm"
:title="title"
:visible.sync="show"
width="1000px"
:before-close="doClose"
:z-index="2010"
:modal="false"
:close-on-click-modal="false"
append-to-body
>
<div class="main">
<div class="top">
<el-row>
<el-col :span="24">
<div>
<span>命令类型名称</span>
<span>{{ typeObj[signedData.type] }}</span>
</div>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<div>
<span>命令号码</span>
<span>{{ signedData.number }}</span>
</div>
</el-col>
<el-col :span="8">
<div>
<span>日期</span>
<span>{{ getParseTime(signedData.sendTime, '{y}-{m}-{d}') }}</span>
</div>
</el-col>
<el-col :span="8">
<div>
<span>发令时刻</span>
<span>{{ getParseTime(signedData.sendTime, '{h}:{i}:{s}') }}</span>
</div>
</el-col>
</el-row>
<el-row>
<el-col :span="9">
<div>
<span>发令单位</span>
<span>{{ signedData.companyOfSender }}</span>
</div>
</el-col>
<el-col :span="15">
<div>
<span>调度员姓名</span>
<span>{{ signedData.senderName }}</span>
</div>
</el-col>
</el-row>
</div>
<div class="content-box">
<div class="box-title">命令内容</div>
<div class="box-top">
<el-input v-model="signedData.content" readonly type="textarea" rows="9" resize="none" placeholder="请输入内容" />
</div>
<div class="box-table">
<el-table :data="getTableData" style="width: 100%" height="200">
<el-table-column type="index" label="序" width="50" />
<el-table-column prop="deviceName" label="受令单位" />
<el-table-column prop="copyers" label="抄知处所" />
</el-table>
</div>
<div class="box-bottom">
<div>
<el-checkbox v-model="needprint">签收后打印</el-checkbox>
<el-checkbox v-model="needRead">需他人阅读</el-checkbox>
</div>
<div class="bottom-signed">
<span>签收人姓名</span>
<el-input v-model="signedBy" readonly style="width: 150px" />
</div>
</div>
</div>
</div>
<div class="bottom-btn">
<el-button :disabled="!commandId || currentHasSigned" @click="signCmd('REFUSE')">拒签</el-button>
<el-button :disabled="!commandId || currentHasSigned" @click="signCmd('SIGNED')">签收</el-button>
<el-button @click="doClose">关闭</el-button>
</div>
</el-dialog>
</template>
<script>
import { sendCommandNew } from '@/api/jmap/training';
import { mapState } from 'vuex';
import { parseTime } from '@/utils/index';
export default {
name:'CmdManage',
data() {
return {
signedData: {},
needRead: false,
needprint: false,
dialogShow: false,
signedBy: '',
typeObj: {
NORMAL: '正常调度命令'
},
signedStatusObj: {
UNSIGNED: '未签收',
SIGNED: '签收',
REFUSE: '拒签'
}
};
},
computed: {
...mapState('training', [
'memberList', 'simulationUserList', 'initTime'
]),
...mapState('socket', [
'dispatchCommandMsg'
]),
show() {
return this.dialogShow;
},
group() {
return this.$route.query.group;
},
title() {
return '调度命令管理';
},
commandId() {
return this.signedData.id || '';
},
currentHasSigned() {
let hasSigned = false;
if (this.signedData.receiverInfos) {
const obj = this.getSignInfo(this.signedData.receiverInfos);
if (obj && obj.signedStatus != 'UNSIGNED') {
hasSigned = true;
}
}
return hasSigned;
},
getActiveUser() {
const userInfo = this.simulationUserList.find(item => {
return item.userId == this.$store.state.user.id;
});
const activeUser = userInfo || {};
return activeUser;
},
getTableData() {
const receiverList = Object.values(this.signedData.receiverInfos || {});
const mList = [];
receiverList.forEach(ii => {
const obj = this.memberList.find(item => {
return item.id == ii.receiverId;
});
if (obj) {
mList.push({
commandId: this.commandId,
...ii,
...obj
});
}
});
const list = [];
mList.forEach(item => {
const device = this.$store.getters['map/getDeviceByCode'](item.deviceCode);
const obj = {
...this.signedData,
...item,
deviceName: device ? device.name : ''
};
list.push(obj);
});
return list;
}
},
watch: {},
beforeDestroy() {},
mounted() {},
methods:{
getParseTime(val, f) {
return val ? parseTime(val, f) : '';
},
getSenderName() {
const activeUser = this.simulationUserList.find(item => {
return item.userId == this.$store.state.user.id;
});
if (activeUser) {
this.signedBy = activeUser.nickName;
}
},
doShow() {
this.getSenderName();
this.getSignedData();
this.dialogShow = true;
},
doClose() {
this.dialogShow = false;
this.$emit('signedCmdClose');
},
getSignedData() {
if (this.dispatchCommandMsg.type == 'ADD') {
this.signedData = this.dispatchCommandMsg.body;
}
},
getSignInfo(info) {
const obj = info[this.getActiveUser.memberId] || {};
return obj;
},
getSignedBy(info) {
const signedInfo = this.simulationUserList.find(item => {
return item.memberId == info.signedBy;
});
let name = '';
if (signedInfo) {
name = signedInfo.nickName;
}
return name;
},
signCmd(status) {
if (!this.commandId) { return; }
const data = {
signInfo: {
commandId: this.commandId,
signedBy: this.signedBy,
signedStatus: status
}
};
sendCommandNew(this.group, 'CTC_SIGN_DISPATCH_COMMAND', data).then((res) => {
console.log(res, '---res');
this.doClose();
}).catch(error => {
this.$messageBox('查询调度命令失败:' + error.message);
});
}
}
};
</script>
<style lang="scss" scoped>
.main {
height: 100%;
.top {
padding: 5px 10px;
border: 1px solid #ccc;
span {
font-size: 16px;
}
}
.content-box {
.box-title {
height: 40px;
line-height: 40px;
}
.box-bottom {
height: 50px;
display: flex;
justify-content: space-between;
align-items: center;
.bottom-signed {
display: flex;
}
}
}
}
.bottom-btn {
height: 40px;
display: flex;
justify-content: flex-end;
align-items: flex-end;
}
</style>