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 label="" width="60">
<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" -->
<el-button v-if="dataIndex === scope.$index" type="text" size="small" @click="saveData(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>
<!-- <el-button v-else type="text" size="small" @click="modifyData(scope.row, scope.$index)">修改</el-button> -->
</template>
</el-table-column>
</el-table>
</div>
</template>
<script>
// equipmentConstructionFill
// equipmentConstructionQuery
// // a.EQUIPMENT_CONSTRUCTION_INFO_SAVE
// // ,
// // b.EQUIPMENT_CONSTRUCTION_INFO_QUERY
// // stationCode
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
export default {
name:'EquipmentConstructionTable',
data() {
return {
tableData:[],
isEdit:false,
isEditing:false, //
// isAdd:false, //
dataIndex: null
};
},
@ -116,29 +111,41 @@ export default {
},
methods:{
add() {
const operate = {
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:'' //
if (!this.isEditing) {
const operate = {
start: true,
operation: this.constructionFill.constructionInput.operation
};
this.dataIndex = this.tableData.length || 0;
this.tableData.push(data);
});
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.tableData.push(data);
this.isEditing = true;
this.isAdd = true;
});
}
},
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) {
const operate = {
@ -211,11 +218,25 @@ export default {
this.$store.dispatch('trainingNew/next', operate);
},
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>