Merge branch 'test' of git.code.tencent.com:lian-cbtc/jl-client into yly
This commit is contained in:
commit
ac9f9c7675
@ -57,7 +57,7 @@
|
||||
<menu-panel v-if="isCtc" ref="menuPanel" />
|
||||
<stage-runplan v-if="isCtc" ref="stageRunplan" @closeFlash="closeStageFlash" @noticeInfo="noticeInfo" />
|
||||
<notice-info v-if="isCtc" ref="noticeInfo" pop-class="chengdou-03__systerm" />
|
||||
<cmdManage ref="cmdManage" />
|
||||
<cmdManage v-if="isCtc" ref="cmdManage" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -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">
|
||||
@ -71,8 +83,8 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="bottom-btn">
|
||||
<el-button :disabled="!commandId" @click="signCmd(false)">拒签</el-button>
|
||||
<el-button :disabled="!commandId" @click="signCmd(true)">签收</el-button>
|
||||
<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>
|
||||
@ -81,6 +93,7 @@
|
||||
import { sendCommandNew } from '@/api/jmap/training';
|
||||
import shouxinxiang from '@/assets/dispatcherStation/shouxinxiang.png';
|
||||
import { mapState } from 'vuex';
|
||||
import { parseTime } from '@/utils/index';
|
||||
export default {
|
||||
name:'CmdManage',
|
||||
data() {
|
||||
@ -94,12 +107,17 @@ export default {
|
||||
currentInfo: {},
|
||||
typeObj: {
|
||||
NORMAL: '正常调度命令'
|
||||
},
|
||||
signedStatusObj: {
|
||||
UNSIGNED: '未签收',
|
||||
SIGNED: '签收',
|
||||
REFUSE: '拒签'
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapState('training', [
|
||||
'memberList', 'simulationUserList'
|
||||
'memberList', 'simulationUserList', 'initTime'
|
||||
]),
|
||||
...mapState('socket', [
|
||||
'dispatchCommandMsg'
|
||||
@ -116,6 +134,23 @@ export default {
|
||||
commandId() {
|
||||
return this.currentInfo.id || '';
|
||||
},
|
||||
currentHasSigned() {
|
||||
let hasSigned = false;
|
||||
if (this.currentInfo.receiverInfos) {
|
||||
const obj = this.getSignInfo(this.currentInfo.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.currentInfo.receiverInfos || {});
|
||||
const mList = [];
|
||||
@ -135,6 +170,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 +180,11 @@ 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);
|
||||
this.show && this.$store.commit('socket/clearDispatchCommandMsg');
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -165,20 +203,48 @@ 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,
|
||||
signedStatus: status ? 'SIGNED' : 'UNSIGNED'
|
||||
signedBy: this.getActiveUser.memberId,
|
||||
signedStatus: status
|
||||
}
|
||||
};
|
||||
sendCommandNew(this.group, 'CTC_SIGN_DISPATCH_COMMAND', data).then((res) => {
|
||||
console.log(res, '---res');
|
||||
if (res.code == 200) {
|
||||
const index = this.cmdTableData.findIndex(item => {
|
||||
return item.id == this.commandId;
|
||||
});
|
||||
if (index >= 0) {
|
||||
const obj = this.cmdTableData[index];
|
||||
const mId = this.getActiveUser.memberId;
|
||||
obj.receiverInfos[mId].signedBy = mId;
|
||||
obj.receiverInfos[mId].signedStatus = status;
|
||||
obj.receiverInfos[mId].time = parseTime(this.initTime);
|
||||
this.cmdTableData.splice(index, 1, obj);
|
||||
}
|
||||
} else {
|
||||
this.$messageBox(`${this.signedStatusObj[status]}调度命令失败:${res.message}`);
|
||||
}
|
||||
}).catch(error => {
|
||||
this.$messageBox('查询调度命令失败:' + error.message);
|
||||
this.$messageBox(`${this.signedStatusObj[status]}调度命令失败:${error.message}`);
|
||||
});
|
||||
},
|
||||
searchCmd() {
|
||||
|
@ -53,12 +53,12 @@
|
||||
</el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="发令人">
|
||||
<el-select v-model="command.senderId" disabled placeholder="请选择" style="width: 100%;" @change="senderChange">
|
||||
<el-select v-model="command.senderName" disabled placeholder="请选择" style="width: 100%;" @change="senderChange">
|
||||
<el-option
|
||||
v-for="item in simulationUserList"
|
||||
:key="item.memberId"
|
||||
:label="item.nickName"
|
||||
:value="item.memberId"
|
||||
v-for="item in memberDataList"
|
||||
:key="item.id"
|
||||
:label="item.labelName"
|
||||
:value="item.labelName"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
@ -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,11 +180,17 @@ export default {
|
||||
typeOptions: [
|
||||
{label: '正常调度命令', value: 'NORMAL'}
|
||||
],
|
||||
signedStatusObj: {
|
||||
UNSIGNED: '未签收',
|
||||
SIGNED: '签收',
|
||||
REFUSE: '拒签'
|
||||
},
|
||||
command: {
|
||||
title: '',
|
||||
number: '',
|
||||
sendTime: '',
|
||||
senderId: '',
|
||||
senderName: '',
|
||||
companyOfSender: '',
|
||||
authorizationTime: '',
|
||||
authorizationStatus: '',
|
||||
@ -193,12 +203,13 @@ export default {
|
||||
allSigned: ''
|
||||
},
|
||||
cmdTextarea: '',
|
||||
tableChecked: false
|
||||
tableChecked: false,
|
||||
memberDataList: []
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapState('training', [
|
||||
'memberList', 'simulationUserList'
|
||||
'memberList', 'memberData', 'simulationUserList'
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow;
|
||||
@ -230,8 +241,7 @@ export default {
|
||||
deviceName: device ? device.name : '',
|
||||
nickName: useInfo ? useInfo.nickName : '',
|
||||
copyers: '',
|
||||
signStatus: false,
|
||||
signer: '',
|
||||
signedStatus: 'UNSIGNED',
|
||||
signTime: ''
|
||||
};
|
||||
list.push(obj);
|
||||
@ -239,27 +249,17 @@ export default {
|
||||
return list;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
simulationUserList(list) {
|
||||
const activeUser = list.find(item => {
|
||||
return item.userId == this.$store.state.user.id;
|
||||
});
|
||||
if (activeUser) {
|
||||
this.command.senderId = activeUser.memberId;
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {},
|
||||
beforeDestroy() {},
|
||||
mounted() {
|
||||
this.searchCmd();
|
||||
},
|
||||
mounted() {},
|
||||
methods:{
|
||||
initData() {
|
||||
this.command = {
|
||||
title: '',
|
||||
number: '',
|
||||
sendTime: '',
|
||||
senderId: this.command.senderId,
|
||||
senderId: '',
|
||||
senderName: this.command.senderName,
|
||||
companyOfSender: '',
|
||||
authorizationTime: '',
|
||||
authorizationStatus: '',
|
||||
@ -283,7 +283,18 @@ export default {
|
||||
this.command.companyOfSender = device ? device.name : '';
|
||||
}
|
||||
},
|
||||
getSenderName() {
|
||||
const activeUser = this.memberDataList.find(item => {
|
||||
return item.userId == this.$store.state.user.id;
|
||||
});
|
||||
if (activeUser) {
|
||||
// this.command.senderId = activeUser.id;
|
||||
this.command.senderName = activeUser.labelName;
|
||||
}
|
||||
},
|
||||
doShow() {
|
||||
this.memberDataList = Object.values(this.memberData);
|
||||
this.getSenderName();
|
||||
this.dialogShow = true;
|
||||
},
|
||||
doClose() {
|
||||
@ -307,7 +318,7 @@ export default {
|
||||
};
|
||||
sendCommandNew(this.group, 'CTC_SEND_DISPATCH_COMMAND', data).then((res) => {
|
||||
console.log(res, '---res');
|
||||
this.$messageBox('发送调度命令成功!');
|
||||
this.$message.success('发送调度命令成功!');
|
||||
this.initData();
|
||||
}).catch(error => {
|
||||
this.$messageBox('发送调度命令失败:' + error.message);
|
||||
@ -315,9 +326,9 @@ export default {
|
||||
},
|
||||
searchCmd() {
|
||||
sendCommandNew(this.group, 'CTC_QUERY_DISPATCH_COMMAND').then((res) => {
|
||||
console.log(res, '---res');
|
||||
console.log(res, '---res----');
|
||||
}).catch(error => {
|
||||
this.$messageBox('查询调度命令失败:' + error.$message);
|
||||
this.$messageBox('查询调度命令失败:' + error.message);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user