调度命令调整

This commit is contained in:
强 董 2022-07-01 15:37:55 +08:00
parent 95c739c342
commit f8c51df3c9
2 changed files with 64 additions and 17 deletions

View File

@ -28,17 +28,29 @@
<el-table :data="cmdTableData" style="width: 100%" height="160" highlight-current-row @current-change="handleCurrentChange">
<el-table-column prop="title" label="标题" />
<el-table-column prop="number" label="号码" width="80" />
<el-table-column prop="typeName" label="命令类型" width="100">
<el-table-column label="命令类型" width="100">
<template slot-scope="scope">
<span style="margin-left: 10px">{{ typeObj[scope.row.type] || '' }}</span>
</template>
</el-table-column>
<el-table-column prop="signStatus" label="收令日期" />
<el-table-column prop="sendTime" label="收令日期" width="160" />
<el-table-column prop="companyOfSender" label="发令单位" />
<el-table-column prop="senderId" label="发令人" />
<el-table-column prop="allSigned" label="签否" />
<el-table-column prop="signedBy" label="签收人" />
<el-table-column prop="signTime" label="签收时间" />
<el-table-column prop="senderName" label="发令人" />
<el-table-column label="签否">
<template slot-scope="scope">
<span style="margin-left: 10px">{{ signedStatusObj[getSignInfo(scope.row.receiverInfos).signedStatus] || '' }}</span>
</template>
</el-table-column>
<el-table-column label="签收人">
<template slot-scope="scope">
<span style="margin-left: 10px">{{ getSignedBy(getSignInfo(scope.row.receiverInfos)) || '' }}</span>
</template>
</el-table-column>
<el-table-column label="签收时间" width="160">
<template slot-scope="scope">
<span style="margin-left: 10px">{{ getSignInfo(scope.row.receiverInfos).time || '' }}</span>
</template>
</el-table-column>
</el-table>
</div>
</div>
@ -51,7 +63,7 @@
<el-table :data="getTableData" style="width: 100%" height="190">
<el-table-column type="index" label="序" width="50" />
<el-table-column prop="deviceName" label="受令单位" />
<el-table-column prop="signedBy" label="抄知处所" />
<el-table-column prop="copyers" label="抄知处所" />
</el-table>
</div>
<div class="middle-right-middle">
@ -94,12 +106,17 @@ export default {
currentInfo: {},
typeObj: {
NORMAL: '正常调度命令'
},
signedStatusObj: {
UNSIGNED: '未签收',
SIGNED: '签收',
REFUSE: '拒签'
}
};
},
computed: {
...mapState('training', [
'memberList', 'simulationUserList'
'memberList', 'simulationUserList', 'initTime'
]),
...mapState('socket', [
'dispatchCommandMsg'
@ -116,6 +133,13 @@ export default {
commandId() {
return this.currentInfo.id || '';
},
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.currentInfo.receiverInfos || {});
const mList = [];
@ -135,6 +159,7 @@ export default {
mList.forEach(item => {
const device = this.$store.getters['map/getDeviceByCode'](item.deviceCode);
const obj = {
...this.currentInfo,
...item,
deviceName: device ? device.name : ''
};
@ -144,9 +169,10 @@ export default {
}
},
watch: {
dispatchCommandMsg(val) {
if (val.type == 'ADD') {
this.cmdTableData.push(val.body);
dispatchCommandMsg(Obj) {
if (Obj.type == 'ADD') {
const list = Obj.body;
this.cmdTableData.push(list);
}
}
},
@ -165,13 +191,26 @@ export default {
handleCurrentChange(obj) {
this.currentInfo = obj;
},
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 activeUser = this.$store.state.user.id;
const data = {
signInfo: {
commandId: this.commandId,
signedBy: activeUser,
signedBy: this.getActiveUser.memberId,
signedStatus: status ? 'SIGNED' : 'REFUSE'
}
};

View File

@ -141,8 +141,12 @@
<el-table-column type="selection" width="50" />
<el-table-column prop="deviceName" label="受令单位" width="180" />
<el-table-column prop="copyers" label="抄送" width="180" />
<el-table-column prop="signStatus" label="签收状态" />
<el-table-column prop="signedBy" label="签收人" />
<el-table-column label="签收状态">
<template slot-scope="scope">
<span style="margin-left: 10px">{{ scope.row.nickName ? signedStatusObj[scope.row.signedStatus] : '' }}</span>
</template>
</el-table-column>
<el-table-column prop="nickName" label="签收人" />
<el-table-column prop="signTime" label="签收时间" />
</el-table>
</div>
@ -176,6 +180,11 @@ export default {
typeOptions: [
{label: '正常调度命令', value: 'NORMAL'}
],
signedStatusObj: {
UNSIGNED: '未签收',
SIGNED: '签收',
REFUSE: '拒签'
},
command: {
title: '',
number: '',
@ -232,8 +241,7 @@ export default {
deviceName: device ? device.name : '',
nickName: useInfo ? useInfo.nickName : '',
copyers: '',
signStatus: false,
signer: '',
signedStatus: 'UNSIGNED',
signTime: ''
};
list.push(obj);