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