transfer project in github

This commit is contained in:
hamid.zarghami1@gmail.com
2024-05-12 15:29:27 +03:30
commit e644edbd65
348 changed files with 164991 additions and 0 deletions
+58
View File
@@ -0,0 +1,58 @@
<template>
<CRow>
<CCol sm="12" class="err">
<el-select v-model="branch" filterable style="width: 100%">
<el-option v-for="item in branches" :key="item._id" :value="item._id" :label="item.title || 'شعبه اراک'"/>
</el-select>
</CCol>
</CRow>
</template>
<script>
export default {
name: "Branches",
data () {
return {
branches: [],
branch: null
}
},
mounted() {
// this.branch = this.branches[0]._id
},
async fetch() {
try {
this.branches = await this.$axios.$get(`/api/admin/store/getAll`)
this.branch = this.branches[0]._id
this.$store.commit('admin/set' , ['branchId' , this.branch])
} catch (e) {
if (e?.response?.status === 401) {
this.$nuxt.error({
status: 401,
message: "لطفا دوباره وارد سیستم شوید.",
});
}
if (e?.response?.status === 403) {
this.$nuxt.error({
status: 403,
message: e?.response?.data?.message,
});
}
if (e?.response?.status === 500) {
this.$nuxt.error({
status: 500,
message: "مشکلی در گرفتن اطلاعات پیش آمده",
});
} else
this.$nuxt.error({
status: 404,
message: "اطلاعات مورد نظر پیدا نشد",
});
}
}
}
</script>
<style scoped lang="scss">
</style>