Skip to content

Commit

Permalink
added inn and signature for the invoice
Browse files Browse the repository at this point in the history
  • Loading branch information
abarmina committed Nov 2, 2021
1 parent e844f61 commit e0386c3
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 6 deletions.
1 change: 1 addition & 0 deletions .env.template
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VUE_APP_API_HOST=
2 changes: 2 additions & 0 deletions src/components/CustomerForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
:placeholder="$t('enter.client')"
autocomplete="off"
></el-input>
<el-input
v-model="customer.inn" :placeholder="$t('enter.inn')" autocomplete="off"></el-input>
<el-input
v-model="customer.phone"
:placeholder="$t('enter.phone')"
Expand Down
2 changes: 2 additions & 0 deletions src/containers/OrderForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ const customerDefaultState = {
model: "",
carNumber: "",
client: "",
inn: "",
phone: "",
date: new Date().getTime()
};
Expand Down Expand Up @@ -378,6 +379,7 @@ export default {
model: data.model,
carNumber: data.carNumber,
client: data.client,
inn: data.inn,
phone: data.phone,
date: Date.parse(data.date)
});
Expand Down
14 changes: 11 additions & 3 deletions src/containers/OrderUpdate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export default {
},
computed: {
...mapState(["isLoading", "params"])
...mapState(["isLoading", "params", "user"])
},
methods: {
Expand Down Expand Up @@ -153,6 +153,7 @@ export default {
{
stack: [
this.order.client ? `${this.$t("client")}: ${this.order.client}\n` : "",
this.order.client ? `${this.$t("inn")}: ${this.order.inn}\n` : "",
this.order.phone ? `${this.$t("phone")}: ${this.order.phone}\n` : "",
this.order.make ? `${this.$t("make")}: ${this.order.make}\n` : "",
this.order.model ? `${this.$t("model")}: ${this.order.model}\n` : "",
Expand Down Expand Up @@ -183,10 +184,14 @@ export default {
style: "tableBody"
},
{
text: `${this.$t("totalCost")} ${this.order.price} ${this.$t(
text: `${this.$t("totalCost")}: ${this.order.price} ${this.$t(
"rub"
)}`,
style: "price"
},
{
text: `${this.user.sign}`,
style: "signature"
}
],
styles: {
Expand All @@ -212,7 +217,10 @@ export default {
},
price: {
fontSize: 15,
alignment: "center"
alignment: "center",
},
signature: {
marginTop: 60
}
}
};
Expand Down
28 changes: 25 additions & 3 deletions src/containers/Settings.vue
Original file line number Diff line number Diff line change
@@ -1,22 +1,44 @@
<template>
<div>
<h1>{{ $t('settings') }}</h1>

<el-form>
<el-form-item>
<el-input type="textarea" v-model="user.sign" :placeholder="$t('sign')"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-edit" @click="onSubmit">{{ $t('save') }}</el-button>
</el-form-item>
</el-form>
<el-button type="danger" icon="el-icon-switch-button" @click="logout">{{ $t('logout') }}</el-button>
</div>
</template>


<script>
import { mapActions } from "vuex";
import { mapState, mapActions } from "vuex";
import { updateMe } from "../services/api";
export default {
data: function() {
return { email: "", password: "" };
},
computed: {
...mapState([
"user",
]),
},
methods: {
...mapActions(["logout"])
...mapActions(["logout"]),
onSubmit: async function() {
try {
await updateMe({ sign: this.user.sign });
} catch (err) {
this.handleError(err);
}
}
}
};
</script>
2 changes: 2 additions & 0 deletions src/i18n/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"client": "Введите имя клиента",
"date": "Выберите дату",
"email": "Введите email",
"inn": "Введите ИНН клиента",
"login": "Введите логин",
"make": "Введите производителя",
"model": "Введите модель",
Expand All @@ -46,6 +47,7 @@
"hailstorm": "Град",
"home": "Главная",
"hood": "Капот",
"inn": "ИНН",
"invoice": "Счет на оплату",
"length": "Длина",
"light": "Простой ремонт",
Expand Down

0 comments on commit e0386c3

Please sign in to comment.