代码调整

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) {
sendCommandNew(this.group, 'KEY_LINK_CONTROL_INFO_SAVE', obj).then((res) => {
console.log(res, '---res');
this.$message.success('提交成功!');
this.initFormData();
}).catch(error => {
this.$messageBox('提交失败:' + error.message);

View File

@ -45,7 +45,7 @@ export default {
},
boxHeight() {
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;
return h;
}

View File

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

View File

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

View File

@ -45,7 +45,7 @@ export default {
},
boxHeight() {
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;
return h;
}

View File

@ -9,6 +9,7 @@
<el-table
:data="tableData"
style="width: 100%"
:height="tableHeight"
>
<el-table-column prop="date" label="月 日" width="95">
<template slot-scope="scope">
@ -109,13 +110,12 @@
</template>
<script>
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import FloodControlSafetyTable from './floodControlSafetyTable/index';
import EquipmentConstructionTable from './equipmentConstructionTable';
import AbnormalTrain from './abnormalTrain/index';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import { sendCommandNew } from '@/api/jmap/training';
// key-link-control-table
export default {
name: 'Index',
@ -133,11 +133,20 @@ export default {
};
},
computed: {
group() {
return this.$route.query.group;
},
registerInput() {
return OperationEvent.TicketOrRegister.registerInput;
},
railFillInRegister() {
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() {
@ -158,7 +167,8 @@ export default {
this.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.dataIndex = null;
}).catch(() => {
@ -167,10 +177,19 @@ export default {
},
saveData(data) {
const params = { stationCode: this.$store.state.training.roleDeviceCode, line: data };
commitOperate(menuOperate.Rail.railFillInRegister, params, 3).then(({valid, operate})=>{
this.queryData();
}).catch(()=>{
this.$message.error('保存簿册失败!');
const operate = {
operation: this.railFillInRegister.operation,
param: params
};
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() {

View File

@ -39,7 +39,7 @@ export default {
this.scoringRuleList = this.$store.state.trainingNew.scoringRules.find(rule => rule.memberId == MyMemberId );
console.log(this.scoringRuleList, this.$store.state.trainingNew.scoringRules);
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 score = this.handleScore(item.elementId);
this.tableData.push({ desc: desc, score: score, totalScore: item.score });