Merge branch 'test_dispaly' of https://git.code.tencent.com/lian-cbtc/jl-client into test_dispaly1

This commit is contained in:
fan 2023-02-07 13:17:46 +08:00
commit ed1ca1287b

View File

@ -77,29 +77,24 @@
</el-table-column> </el-table-column>
<el-table-column label="" width="60"> <el-table-column label="" width="60">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button v-if="dataIndex === scope.$index" :id="constructionFillIn.domId" type="text" size="small" @click="saveData(scope.row, scope.$index)">保存</el-button>
<!-- :id="railFillInRegister.domId" --> <!-- :id="railFillInRegister.domId" -->
<el-button v-if="dataIndex === scope.$index" type="text" size="small" @click="saveData(scope.row, scope.$index)">保存</el-button> <!-- <el-button v-else type="text" size="small" @click="modifyData(scope.row, scope.$index)">修改</el-button> -->
<!-- :id="railFillInRegister.domId" -->
<el-button v-else type="text" size="small" @click="modifyData(scope.row, scope.$index)">修改</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
</template> </template>
<script> <script>
// equipmentConstructionFill
// equipmentConstructionQuery
// // a.EQUIPMENT_CONSTRUCTION_INFO_SAVE
// // ,
// // b.EQUIPMENT_CONSTRUCTION_INFO_QUERY
// // stationCode
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
export default { export default {
name:'EquipmentConstructionTable', name:'EquipmentConstructionTable',
data() { data() {
return { return {
tableData:[], tableData:[],
isEdit:false, isEditing:false, //
// isAdd:false, //
dataIndex: null dataIndex: null
}; };
}, },
@ -116,29 +111,41 @@ export default {
}, },
methods:{ methods:{
add() { add() {
const operate = { if (!this.isEditing) {
start: true, const operate = {
operation: this.constructionFill.constructionInput.operation start: true,
}; operation: this.constructionFill.constructionInput.operation
this.$store.dispatch('trainingNew/next', operate).then(resp => {
const data = {
no: '', //
projectName: '', //
requestDate: '', //
requestDetails: '', //
planSpendTime:'', //
acceptDetail:'', //
confirmReviewDate:'', //
confirmReviewDetail:'', //
constructionOpenDetail:'', //
remark:'' //
}; };
this.dataIndex = this.tableData.length || 0; this.$store.dispatch('trainingNew/next', operate).then(resp => {
this.tableData.push(data);
}); const data = {
no: '', //
projectName: '', //
requestDate: '', //
requestDetails: '', //
planSpendTime:'', //
acceptDetail:'', //
confirmReviewDate:'', //
confirmReviewDetail:'', //
constructionOpenDetail:'', //
remark:'' //
};
this.dataIndex = this.tableData.length || 0;
this.tableData.push(data);
this.isEditing = true;
this.isAdd = true;
});
}
}, },
queryData() { queryData() {
debugger; const params = { stationCode: this.$store.state.training.roleDeviceCode};
commitOperate(menuOperate.Rail.equipmentConstructionQuery, params, 3).then(({valid, operate, response})=>{
this.tableData = response.data;
this.dataIndex = null;
}).catch(()=>{
this.$message.error('查询行车设备施工登记簿失败!');
});
}, },
numChange(val) { numChange(val) {
const operate = { const operate = {
@ -211,11 +218,25 @@ export default {
this.$store.dispatch('trainingNew/next', operate); this.$store.dispatch('trainingNew/next', operate);
}, },
saveData(data, index) { 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('保存行车设备施工登记簿失败!');
});
// }
// }else{
// }
},
modifyData(data, index) {
this.dataIndex = index;
} }
// modifyData(data, index) {
// this.dataIndex = index;
// // this.isAdd = false;
// }
} }
}; };
</script> </script>