Merge branch 'test_dispaly' of https://git.code.tencent.com/lian-cbtc/jl-client into test_dispaly1
This commit is contained in:
commit
ed1ca1287b
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user