调度命令调整

This commit is contained in:
强 董 2022-07-01 18:52:17 +08:00
parent f8c51df3c9
commit 5c078cdfbc

View File

@ -83,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>
@ -93,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() {
@ -133,6 +134,16 @@ 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;
@ -173,6 +184,7 @@ export default {
if (Obj.type == 'ADD') {
const list = Obj.body;
this.cmdTableData.push(list);
this.show && this.$store.commit('socket/clearDispatchCommandMsg');
}
}
},
@ -211,13 +223,28 @@ export default {
signInfo: {
commandId: this.commandId,
signedBy: this.getActiveUser.memberId,
signedStatus: status ? 'SIGNED' : 'REFUSE'
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() {