终端培训更新

This commit is contained in:
Yuanjianghong 2021-11-02 21:02:22 +08:00
parent 99873f6799
commit ab0ff8a248
3 changed files with 27 additions and 15 deletions

View File

@ -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
})
},

View File

@ -1,6 +1,6 @@
<template>
<a-card :bordered="false" :title="titleName">
<a-form-model @submit="handleSubmit" :model="form" >
<a-form-model @submit="handleSubmit" :model="form">
<a-form-model-item label="培训名称">
<a-input v-model="form.trainName" />
</a-form-model-item>
@ -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() {
if(this.$route.query.id){
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

View File

@ -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,