re labeled all instances of account to terminal, clear create terminal
after save
This commit is contained in:
parent
a9d8cce29e
commit
dd467e8ef8
|
@ -31,7 +31,7 @@
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label-width="120px" label="Name" class="postInfo-container-item">
|
<el-form-item label-width="120px" label="Name" class="postInfo-container-item">
|
||||||
<el-input v-model="postForm.name" placeholder="Account Name" />
|
<el-input v-model="postForm.name" placeholder="Terminal Name" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
@ -109,7 +109,7 @@ const defaultForm = {
|
||||||
}
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'AccountDetail',
|
name: 'TerminalDetail',
|
||||||
components: { Sticky },
|
components: { Sticky },
|
||||||
props: {
|
props: {
|
||||||
isEdit: {
|
isEdit: {
|
||||||
|
@ -162,6 +162,7 @@ export default {
|
||||||
this.fetchData(id)
|
this.fetchData(id)
|
||||||
} else {
|
} else {
|
||||||
this.postForm = Object.assign({}, defaultForm)
|
this.postForm = Object.assign({}, defaultForm)
|
||||||
|
this.postForm.address = Object.assign({}, defaultForm.address)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Why need to make a copy of this.$route here?
|
// Why need to make a copy of this.$route here?
|
||||||
|
@ -184,12 +185,12 @@ export default {
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
setTagsViewTitle() {
|
setTagsViewTitle() {
|
||||||
const title = 'Edit Account'
|
const title = 'Edit Terminal'
|
||||||
const route = Object.assign({}, this.tempRoute, { title: `${title} - ${this.postForm.name}` })
|
const route = Object.assign({}, this.tempRoute, { title: `${title} - ${this.postForm.name}` })
|
||||||
this.$store.dispatch('tagsView/updateVisitedView', route)
|
this.$store.dispatch('tagsView/updateVisitedView', route)
|
||||||
},
|
},
|
||||||
setPageTitle() {
|
setPageTitle() {
|
||||||
const title = 'Edit Account'
|
const title = 'Edit Terminal'
|
||||||
document.title = `${title} - ${this.postForm.id}`
|
document.title = `${title} - ${this.postForm.id}`
|
||||||
},
|
},
|
||||||
submitForm() {
|
submitForm() {
|
||||||
|
@ -197,18 +198,18 @@ export default {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
|
|
||||||
// Save the account
|
// Save the terminal
|
||||||
const methodToCall = this.isEdit ? updateTerminal : createTerminal
|
const methodToCall = this.isEdit ? updateTerminal : createTerminal
|
||||||
methodToCall(this.postForm).then((r) => {
|
methodToCall(this.postForm).then((r) => {
|
||||||
this.$notify({
|
this.$notify({
|
||||||
title: 'Success',
|
title: 'Success',
|
||||||
message: 'Account Saved',
|
message: 'Terminal Saved',
|
||||||
type: 'success',
|
type: 'success',
|
||||||
duration: 2000
|
duration: 2000
|
||||||
})
|
})
|
||||||
|
|
||||||
// Redirect to the edit page when we create a new one
|
// Redirect to the edit page when we create a new one
|
||||||
if (!this.isEdit) { this.$router.push(`/accounts/edit/${r.data.id}`) }
|
if (!this.isEdit) { this.$router.push(`/terminals/edit/${r.data.id}`) }
|
||||||
|
|
||||||
this.loading = false
|
this.loading = false
|
||||||
}).catch((e) => {
|
}).catch((e) => {
|
||||||
|
|
Loading…
Reference in New Issue