终端培训更新

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() { 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
}) })
}, },

View File

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

View File

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