代码调整

This commit is contained in:
dong 2023-02-09 11:46:37 +08:00
parent 51b85082dd
commit 85bc2e7fd1
7 changed files with 69 additions and 29 deletions

View File

@ -276,6 +276,7 @@ export default {
if (valid) { if (valid) {
sendCommandNew(this.group, 'KEY_LINK_CONTROL_INFO_SAVE', obj).then((res) => { sendCommandNew(this.group, 'KEY_LINK_CONTROL_INFO_SAVE', obj).then((res) => {
console.log(res, '---res'); console.log(res, '---res');
this.$message.success('提交成功!');
this.initFormData(); this.initFormData();
}).catch(error => { }).catch(error => {
this.$messageBox('提交失败:' + error.message); this.$messageBox('提交失败:' + error.message);

View File

@ -45,7 +45,7 @@ export default {
}, },
boxHeight() { boxHeight() {
const allH = this.$store.state.app.height; const allH = this.$store.state.app.height;
let h = allH - 103 - 39 - 30 - 41 - 15; let h = allH - 63 - 39 - 30 - 41 - 15 - 20;
h = h > 0 ? h : 0; h = h > 0 ? h : 0;
return h; return h;
} }

View File

@ -6,6 +6,7 @@
<el-table <el-table
:data="tableData" :data="tableData"
style="width:100%" style="width:100%"
:height="tableHeight"
> >
<el-table-column label="请求施工(慢行及封锁)登记"> <el-table-column label="请求施工(慢行及封锁)登记">
<el-table-column prop="no" label="本月施工编号" width="120"> <el-table-column prop="no" label="本月施工编号" width="120">
@ -87,7 +88,7 @@
</template> </template>
<script> <script>
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate'; import { sendCommandNew } from '@/api/jmap/training';
export default { export default {
name:'EquipmentConstructionTable', name:'EquipmentConstructionTable',
data() { data() {
@ -99,11 +100,20 @@ export default {
}; };
}, },
computed: { computed: {
group() {
return this.$route.query.group;
},
constructionFill() { constructionFill() {
return OperationEvent.RailCommand.equipmentConstructionFill; return OperationEvent.RailCommand.equipmentConstructionFill;
}, },
constructionFillIn() { constructionFillIn() {
return OperationEvent.RailCommand.equipmentConstructionFill.menu; return OperationEvent.RailCommand.equipmentConstructionFill.menu;
},
tableHeight() {
const allH = this.$store.state.app.height;
let h = allH - 63 - 39 - 30 - 42;
h = h > 0 ? h : 0;
return h;
} }
}, },
mounted() { mounted() {
@ -111,12 +121,12 @@ export default {
}, },
methods:{ methods:{
add() { add() {
if (!this.isEditing) { const operate = {
const operate = { start: true,
start: true, operation: this.constructionFill.constructionInput.operation
operation: this.constructionFill.constructionInput.operation };
}; this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
this.$store.dispatch('trainingNew/next', operate).then(resp => { if (!this.isEditing) {
const data = { const data = {
no: '', // no: '', //
@ -134,16 +144,15 @@ export default {
this.tableData.push(data); this.tableData.push(data);
this.isEditing = true; this.isEditing = true;
this.isAdd = true; this.isAdd = true;
}); }
});
}
}, },
queryData() { queryData() {
const params = { stationCode: this.$store.state.training.roleDeviceCode}; const params = { stationCode: this.$store.state.training.roleDeviceCode};
commitOperate(menuOperate.Rail.equipmentConstructionQuery, params, 3).then(({valid, operate, response})=>{ sendCommandNew(this.group, 'EQUIPMENT_CONSTRUCTION_INFO_QUERY', params).then((res) => {
this.tableData = response.data; this.tableData = res.data;
this.dataIndex = null; this.dataIndex = null;
}).catch(()=>{ }).catch(() => {
this.$message.error('查询行车设备施工登记簿失败!'); this.$message.error('查询行车设备施工登记簿失败!');
}); });
}, },
@ -220,12 +229,21 @@ export default {
saveData(data, index) { saveData(data, index) {
// if (this.isAdd) { // if (this.isAdd) {
const params = Object.assign({stationCode:this.$store.state.training.roleDeviceCode}, data); const params = Object.assign({stationCode:this.$store.state.training.roleDeviceCode}, data);
commitOperate(menuOperate.Rail.equipmentConstructionFill, params, 3).then(({valid, operate})=>{ const operate = {
this.queryData(); operation: this.constructionFillIn.operation,
this.isEditing = false; param: params
this.isAdd = false; };
}).catch(()=>{ this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
this.$message.error('保存行车设备施工登记簿失败!'); if (valid) {
sendCommandNew(this.group, 'EQUIPMENT_CONSTRUCTION_INFO_SAVE', params).then((res) => {
this.$message.success('保存成功!');
this.queryData();
this.isEditing = false;
this.isAdd = false;
}).catch(() => {
this.$message.error('保存行车设备施工登记簿失败!');
});
}
}); });
// } // }
// }else{ // }else{

View File

@ -274,6 +274,7 @@ export default {
if (valid) { if (valid) {
sendCommandNew(this.group, 'CONTROL_FLOOD_SIGN_SAVE', obj).then((res) => { sendCommandNew(this.group, 'CONTROL_FLOOD_SIGN_SAVE', obj).then((res) => {
console.log(res, '---res'); console.log(res, '---res');
this.$message.success('提交成功!');
this.initFormData(); this.initFormData();
}).catch(error => { }).catch(error => {
this.$messageBox('提交失败:' + error.message); this.$messageBox('提交失败:' + error.message);
@ -291,6 +292,7 @@ export default {
if (valid) { if (valid) {
sendCommandNew(this.group, 'CONTROL_FLOOD_SIGN_UPDATE', obj).then((res) => { sendCommandNew(this.group, 'CONTROL_FLOOD_SIGN_UPDATE', obj).then((res) => {
console.log(res, '---res'); console.log(res, '---res');
this.$message.success('更新成功!');
this.isEdit = false; this.isEdit = false;
}).catch(error => { }).catch(error => {
this.$messageBox('更新失败:' + error.message); this.$messageBox('更新失败:' + error.message);

View File

@ -45,7 +45,7 @@ export default {
}, },
boxHeight() { boxHeight() {
const allH = this.$store.state.app.height; const allH = this.$store.state.app.height;
let h = allH - 103 - 39 - 30 - 41 - 15; let h = allH - 63 - 39 - 30 - 41 - 15 - 20;
h = h > 0 ? h : 0; h = h > 0 ? h : 0;
return h; return h;
} }

View File

@ -9,6 +9,7 @@
<el-table <el-table
:data="tableData" :data="tableData"
style="width: 100%" style="width: 100%"
:height="tableHeight"
> >
<el-table-column prop="date" label="月 日" width="95"> <el-table-column prop="date" label="月 日" width="95">
<template slot-scope="scope"> <template slot-scope="scope">
@ -109,13 +110,12 @@
</template> </template>
<script> <script>
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import FloodControlSafetyTable from './floodControlSafetyTable/index'; import FloodControlSafetyTable from './floodControlSafetyTable/index';
import EquipmentConstructionTable from './equipmentConstructionTable'; import EquipmentConstructionTable from './equipmentConstructionTable';
import AbnormalTrain from './abnormalTrain/index'; import AbnormalTrain from './abnormalTrain/index';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import { sendCommandNew } from '@/api/jmap/training'; import { sendCommandNew } from '@/api/jmap/training';
// key-link-control-table // key-link-control-table
export default { export default {
name: 'Index', name: 'Index',
@ -133,11 +133,20 @@ export default {
}; };
}, },
computed: { computed: {
group() {
return this.$route.query.group;
},
registerInput() { registerInput() {
return OperationEvent.TicketOrRegister.registerInput; return OperationEvent.TicketOrRegister.registerInput;
}, },
railFillInRegister() { railFillInRegister() {
return OperationEvent.RailCommand.railFillInRegister.menu; return OperationEvent.RailCommand.railFillInRegister.menu;
},
tableHeight() {
const allH = this.$store.state.app.height;
let h = allH - 63 - 39 - 30 - 42;
h = h > 0 ? h : 0;
return h;
} }
}, },
mounted() { mounted() {
@ -158,7 +167,8 @@ export default {
this.queryData(); this.queryData();
}, },
queryData() { queryData() {
sendCommandNew(this.$route.query.group, CMD.RAIL.CMD_RAIL_QUERY_REGISTER.value, { stationCode: this.$store.state.training.roleDeviceCode}).then(response => { const params = { stationCode: this.$store.state.training.roleDeviceCode};
sendCommandNew(this.group, 'RAIL_QUERY_REGISTER', params).then((response) => {
this.tableData = response.data ? response.data.lines : []; this.tableData = response.data ? response.data.lines : [];
this.dataIndex = null; this.dataIndex = null;
}).catch(() => { }).catch(() => {
@ -167,10 +177,19 @@ export default {
}, },
saveData(data) { saveData(data) {
const params = { stationCode: this.$store.state.training.roleDeviceCode, line: data }; const params = { stationCode: this.$store.state.training.roleDeviceCode, line: data };
commitOperate(menuOperate.Rail.railFillInRegister, params, 3).then(({valid, operate})=>{ const operate = {
this.queryData(); operation: this.railFillInRegister.operation,
}).catch(()=>{ param: params
this.$message.error('保存簿册失败!'); };
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
if (valid) {
sendCommandNew(this.group, 'RAIL_FILL_IN_REGISTER', params).then((res) => {
this.$message.success('保存成功!');
this.queryData();
}).catch(() => {
this.$message.error('保存簿册失败!');
});
}
}); });
}, },
add() { add() {

View File

@ -39,7 +39,7 @@ export default {
this.scoringRuleList = this.$store.state.trainingNew.scoringRules.find(rule => rule.memberId == MyMemberId ); this.scoringRuleList = this.$store.state.trainingNew.scoringRules.find(rule => rule.memberId == MyMemberId );
console.log(this.scoringRuleList, this.$store.state.trainingNew.scoringRules); console.log(this.scoringRuleList, this.$store.state.trainingNew.scoringRules);
this.stepList = this.$store.state.trainingNew.stepList; this.stepList = this.$store.state.trainingNew.stepList;
this.scoringRuleList.details.forEach(item => { this.scoringRuleList && this.scoringRuleList.details.forEach(item => {
const desc = this.handleStepInfo(item.elementId); const desc = this.handleStepInfo(item.elementId);
const score = this.handleScore(item.elementId); const score = this.handleScore(item.elementId);
this.tableData.push({ desc: desc, score: score, totalScore: item.score }); this.tableData.push({ desc: desc, score: score, totalScore: item.score });