终端培训更新
This commit is contained in:
parent
99873f6799
commit
ab0ff8a248
|
@ -31,13 +31,13 @@ export default {
|
|||
},
|
||||
data() {
|
||||
return {
|
||||
queryParam: { id: this.$route.query.terminalTrainId },
|
||||
queryParam: this.$route.query.terminalTrainId,
|
||||
detailData: {},
|
||||
}
|
||||
},
|
||||
created: function () {
|
||||
let parameter = {}
|
||||
terminalTrainGet(Object.assign(parameter, this.queryParam)).then((res) => {
|
||||
terminalTrainGet(this.queryParam).then((res) => {
|
||||
this.detailData = res.data
|
||||
})
|
||||
},
|
||||
|
|
|
@ -77,25 +77,38 @@ export default {
|
|||
console.log('提交的数据', this.form)
|
||||
terminalTrainEdit(this.form).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.$message.success('新增成功')
|
||||
this.handleCancel()
|
||||
this.$message.success('保存成功!')
|
||||
this.$router.push({
|
||||
//跳转list页面
|
||||
path: '/project/project/terminalTrain/list',
|
||||
query: {
|
||||
terminalTrainName: this.$route.query.terminalTrainName,
|
||||
terminalTrainStatus: this.$route.query.terminalTrainStatus,
|
||||
terminalTrainStartDate: this.$route.query.terminalTrainStartDate,
|
||||
terminalTrainEndDate: this.$route.query.terminalTrainEndDate,
|
||||
terminalTrainPageNum: this.$route.query.terminalTrainPageNum,
|
||||
},
|
||||
})
|
||||
} else {
|
||||
this.$message.error('新增失败:' + res.msg)
|
||||
this.handleCancel()
|
||||
this.$message.error('保存失败:' + res.msg)
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
close() {
|
||||
console.log('Form跳转页面', this.form)
|
||||
},
|
||||
},
|
||||
created() {
|
||||
console.log('1---', this.$store.state.user)
|
||||
if (this.$route.query.id) {
|
||||
this.form = terminalTrainGet(this.$route.query.id).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.form = res.data;
|
||||
this.form = res.data
|
||||
} else {
|
||||
this.$message.error('获取数据失败:' + res.msg)
|
||||
}
|
||||
}
|
||||
)
|
||||
})
|
||||
}
|
||||
}, //生命周期 - 创建完成(可以访问当前this实例)
|
||||
mounted() {}, //生命周期 - 挂载完成(可以访问DOM元素)
|
||||
|
|
|
@ -148,8 +148,8 @@ export default {
|
|||
{ id: '5', name: '已终止' },
|
||||
],
|
||||
},
|
||||
{ type: 'date', placeholder: '开始时间', key: 'startDate' },
|
||||
{ type: 'date', placeholder: '结束时间', key: 'endDate' },
|
||||
{ type: 'date', placeholder: '开始时间', key: 'startDate', format:'yyyy-MM-dd' },
|
||||
{ type: 'date', placeholder: '结束时间', key: 'endDate', format:'yyyy-MM-dd' },
|
||||
]
|
||||
},
|
||||
},
|
||||
|
@ -206,11 +206,10 @@ export default {
|
|||
})
|
||||
console.log('编辑 id:', record)
|
||||
},
|
||||
handledCreate() {
|
||||
handledCreate() { //新增
|
||||
this.$router.push({
|
||||
path: '/project/terminalTrain/form',
|
||||
query: {
|
||||
type: 1, //新增
|
||||
terminalTrainName: this.$route.query.terminalTrainName,
|
||||
terminalTrainStatus: this.$route.query.terminalTrainStatus,
|
||||
terminalTrainStartDate: this.$route.query.terminalTrainStartDate,
|
||||
|
|
Loading…
Reference in New Issue