re labeled all instances of account to terminal, clear create terminal

after save
This commit is contained in:
Chad Derya 2019-09-11 09:52:04 +01:00
parent a9d8cce29e
commit dd467e8ef8
1 changed files with 8 additions and 7 deletions

View File

@ -31,7 +31,7 @@
<el-row>
<el-col :span="8">
<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-col>
</el-row>
@ -109,7 +109,7 @@ const defaultForm = {
}
export default {
name: 'AccountDetail',
name: 'TerminalDetail',
components: { Sticky },
props: {
isEdit: {
@ -162,6 +162,7 @@ export default {
this.fetchData(id)
} else {
this.postForm = Object.assign({}, defaultForm)
this.postForm.address = Object.assign({}, defaultForm.address)
}
// Why need to make a copy of this.$route here?
@ -184,12 +185,12 @@ export default {
})
},
setTagsViewTitle() {
const title = 'Edit Account'
const title = 'Edit Terminal'
const route = Object.assign({}, this.tempRoute, { title: `${title} - ${this.postForm.name}` })
this.$store.dispatch('tagsView/updateVisitedView', route)
},
setPageTitle() {
const title = 'Edit Account'
const title = 'Edit Terminal'
document.title = `${title} - ${this.postForm.id}`
},
submitForm() {
@ -197,18 +198,18 @@ export default {
if (valid) {
this.loading = true
// Save the account
// Save the terminal
const methodToCall = this.isEdit ? updateTerminal : createTerminal
methodToCall(this.postForm).then((r) => {
this.$notify({
title: 'Success',
message: 'Account Saved',
message: 'Terminal Saved',
type: 'success',
duration: 2000
})
// 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
}).catch((e) => {