Commit 737cf4df authored by Kittisak Maneewong's avatar Kittisak Maneewong

update

parent 74fad557
...@@ -24,7 +24,7 @@ class JobController extends Controller ...@@ -24,7 +24,7 @@ class JobController extends Controller
*/ */
public function create() public function create()
{ {
//
} }
/** /**
...@@ -67,8 +67,9 @@ class JobController extends Controller ...@@ -67,8 +67,9 @@ class JobController extends Controller
*/ */
public function show($id) public function show($id)
{ {
$jobs = Job::all();
$job = Job::where('user_id', $id)->get(); $job = Job::where('user_id', $id)->get();
return response()->json(['jobs' => $job]); return response()->json(['jobs' => $job, 'job_all' => $jobs]);
} }
/** /**
...@@ -78,10 +79,11 @@ class JobController extends Controller ...@@ -78,10 +79,11 @@ class JobController extends Controller
* @return \Illuminate\Http\Response * @return \Illuminate\Http\Response
*/ */
public function edit($id) public function edit($id)
{ {
$jobs = Job::all();
$job = Job::find($id); $job = Job::find($id);
$job->gender = explode(', ', $job->gender); $job->gender = explode(', ', $job->gender);
return response()->json(['job' => $job]); return response()->json(['job' => $job, 'job_all' => $jobs]);
} }
/** /**
......
This diff is collapsed.
...@@ -12,7 +12,6 @@ import Account from './views/Account.vue'; ...@@ -12,7 +12,6 @@ import Account from './views/Account.vue';
import Employer from './views/Employer.vue'; import Employer from './views/Employer.vue';
import LoginEmployer from './views/LoginEmployer.vue'; import LoginEmployer from './views/LoginEmployer.vue';
import PageNotFound from './views/PageNotFound.vue'; import PageNotFound from './views/PageNotFound.vue';
import EditCompany from './views/EditCompany.vue';
import RegisterEmployer from './views/RegisterEmployer'; import RegisterEmployer from './views/RegisterEmployer';
import ManagejobEmployer from './views/managejob.vue'; import ManagejobEmployer from './views/managejob.vue';
import ConfigCompany from './views/ConfigCompany.vue'; import ConfigCompany from './views/ConfigCompany.vue';
...@@ -20,6 +19,9 @@ import CreateJob from './views/CreateJob.vue'; ...@@ -20,6 +19,9 @@ import CreateJob from './views/CreateJob.vue';
import EditJob from './views/EditJob.vue'; import EditJob from './views/EditJob.vue';
import DetailJob from './views/DetailJob.vue'; import DetailJob from './views/DetailJob.vue';
import ShowJob from './views/ShowJob.vue'; import ShowJob from './views/ShowJob.vue';
import Page404 from './views/404.vue';
import Axios from 'axios';
import store from './store';
const router = new VueRouter({ const router = new VueRouter({
mode: 'history', mode: 'history',
...@@ -34,8 +36,7 @@ const router = new VueRouter({ ...@@ -34,8 +36,7 @@ const router = new VueRouter({
name: 'Employer', name: 'Employer',
component: Employer, component: Employer,
meta: { meta: {
loginEmployer: true, loginEmployer: true
configProfile: true
} }
}, },
{ {
...@@ -53,17 +54,7 @@ const router = new VueRouter({ ...@@ -53,17 +54,7 @@ const router = new VueRouter({
name: 'managejobEmployer', name: 'managejobEmployer',
component: ManagejobEmployer, component: ManagejobEmployer,
meta: { meta: {
loginEmployer: true, loginEmployer: true
configProfile: true
}
},
{
path: 'editcompany',
name: 'editcompany',
component: EditCompany,
meta: {
loginEmployer: true,
configProfile: true
} }
}, },
{ {
...@@ -71,14 +62,16 @@ const router = new VueRouter({ ...@@ -71,14 +62,16 @@ const router = new VueRouter({
name: 'createjob', name: 'createjob',
component: CreateJob, component: CreateJob,
meta: { meta: {
loginEmployer: true, loginEmployer: true
configProfile: true
} }
}, },
{ {
path: 'editjob/:id', path: 'editjob/:id',
name: 'editJob', name: 'editJob',
component: EditJob component: EditJob,
meta: {
loginEmployer: true
}
}, },
{ {
path: 'configcompany', path: 'configcompany',
...@@ -123,10 +116,7 @@ const router = new VueRouter({ ...@@ -123,10 +116,7 @@ const router = new VueRouter({
{ {
path: '*', path: '*',
name: 'pageNotFound', name: 'pageNotFound',
component: PageNotFound, component: Page404
meta: {
requiredUser: true
}
} }
] ]
} }
...@@ -137,10 +127,16 @@ router.beforeEach((to, from, next) => { ...@@ -137,10 +127,16 @@ router.beforeEach((to, from, next) => {
iView.LoadingBar.start(); iView.LoadingBar.start();
if(to.matched.some(record => record.meta.requiredUser)) { if(to.matched.some(record => record.meta.requiredUser)) {
if(!localStorage.getItem('access_token')) { if(!localStorage.getItem('access_token')) {
next('/employer/login') next('/')
} else { } else {
next() next()
} }
} else if(to.matched.some(record => record.meta.loginEmployer)) {
if(!localStorage.getItem('access_token_employer')) {
next('/employer/login')
} else {
next ()
}
} else { } else {
next() next()
} }
......
<template>
<div>
<v-layout align-center justify-center row fill-height>
<img width="800" src="../../../public/img/404.png" >
</v-layout>>
<v-layout align-end justify-center row fill-height>
<router-link to="/"><v-btn outline color="info">Back To Home</v-btn></router-link>
</v-layout>
</div>
</template>
...@@ -234,6 +234,11 @@ ...@@ -234,6 +234,11 @@
.then(res => { .then(res => {
console.log(res) console.log(res)
this.job_data.id = res.id this.job_data.id = res.id
axios.get(`/api/jobs/${res.id}`)
.then(res => {
this.jobs_data = res.data.job_all.map(x => x.job_type).filter((item, pos, self) => {return self.indexOf(item) == pos})
})
.catch(err => {console.log(err.response)})
}) })
.catch(err => { .catch(err => {
console.log(err) console.log(err)
......
...@@ -116,6 +116,11 @@ ...@@ -116,6 +116,11 @@
<v-flex xs12 sm12 class=" font-weight-bold subheading mt-2 my-1"> <v-flex xs12 sm12 class=" font-weight-bold subheading mt-2 my-1">
<v-icon small >fas fa-street-view</v-icon> แผนที่ตั้งบริษัท <v-icon small >fas fa-street-view</v-icon> แผนที่ตั้งบริษัท
<v-divider></v-divider> <v-divider></v-divider>
<GmapMap v-if="detail_data.lat" style="width: 100%; height: 200px;" :zoom="15" :center="{lat: detail_data.lat*1, lng: detail_data.long*1}">
<GmapMarker
:position="{lat: detail_data.lat*1, lng: detail_data.long*1}"
/>
</GmapMap>
</v-flex> </v-flex>
<v-flex xs12 sm12 class=" font-weight-bold subheading mt-2 my-1"> <v-flex xs12 sm12 class=" font-weight-bold subheading mt-2 my-1">
<v-icon small >fas fa-plane</v-icon> การเดินทาง <v-icon small >fas fa-plane</v-icon> การเดินทาง
......
This diff is collapsed.
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
></v-text-field> ></v-text-field>
<v-combobox <v-combobox
v-model="job_data.job_type" v-model="job_data.job_type"
:items="items" :items="jobs_data"
:rules="[v => !!v || 'จำเป็นต้องกรอก']" :rules="[v => !!v || 'จำเป็นต้องกรอก']"
label="ประเภทงาน" label="ประเภทงาน"
placeholder=" " placeholder=" "
...@@ -195,6 +195,7 @@ ...@@ -195,6 +195,7 @@
'ชาย', 'ชาย',
'หญิง' 'หญิง'
], ],
jobs_data: [],
job_data: { job_data: {
id: null, id: null,
job_title: '', job_title: '',
...@@ -247,6 +248,7 @@ ...@@ -247,6 +248,7 @@
this.job_data.feature = res.data.job.feature this.job_data.feature = res.data.job.feature
this.job_data.role = res.data.job.role this.job_data.role = res.data.job.role
this.job_data.welfare = res.data.job.welfare this.job_data.welfare = res.data.job.welfare
this.jobs_data = res.data.job_all.map(x => x.job_type).filter((item, pos, self) => {return self.indexOf(item) == pos})
console.log(res) console.log(res)
}) })
.catch(err => {console.log(err.response)}) .catch(err => {console.log(err.response)})
......
...@@ -25,7 +25,10 @@ ...@@ -25,7 +25,10 @@
<span class=" subheading font-weight-bold indigo--text"><v-icon color="indigo">person_pin</v-icon> ข้อมูลบัญชีผู้ใช้</span> <span class=" subheading font-weight-bold indigo--text"><v-icon color="indigo">person_pin</v-icon> ข้อมูลบัญชีผู้ใช้</span>
</v-flex> </v-flex>
<v-flex xs4 sm4 class="text-sm-right text-xs-right"> <v-flex xs4 sm4 class="text-sm-right text-xs-right">
<v-btn small depressed color="orange darken-2" dark @click="$router.push('/employer/createjob')"> <v-btn v-if="exists" small depressed color="orange darken-2" dark @click="$router.push('/employer/createjob')">
<v-icon dark small>fas fa-plus</v-icon>&nbsp;ประกาศงาน
</v-btn>
<v-btn v-if="!exists" small depressed color="orange darken-2" dark @click="$store.commit('setSnackbar', {show: true, color: 'error', text: 'จำเป็นต้องกรอกข้อมูลบริษัทก่อน!'})">
<v-icon dark small>fas fa-plus</v-icon>&nbsp;ประกาศงาน <v-icon dark small>fas fa-plus</v-icon>&nbsp;ประกาศงาน
</v-btn> </v-btn>
</v-flex> </v-flex>
...@@ -122,6 +125,7 @@ export default { ...@@ -122,6 +125,7 @@ export default {
data () { data () {
return { return {
user: null, user: null,
exists: false,
countJob: 0, countJob: 0,
companies: { companies: {
about: null, about: null,
...@@ -167,6 +171,7 @@ export default { ...@@ -167,6 +171,7 @@ export default {
axios.get(`/api/companys/${res.id}`) axios.get(`/api/companys/${res.id}`)
.then(res => { .then(res => {
console.log(res) console.log(res)
this.exists = res.data.exists
this.countJob = res.data.count this.countJob = res.data.count
if (res.data.exists) { if (res.data.exists) {
this.companies = res.data.company this.companies = res.data.company
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<h3 class="title font-weight-bold my-3">เข้าสู่ระบบสำหรับผู้ประกอบการ</h3> <h3 class="title font-weight-bold my-3">เข้าสู่ระบบสำหรับผู้ประกอบการ</h3>
<v-form @submit.prevent="login()" ref="loginEmployer"> <v-form @submit.prevent="login()" ref="loginEmployer">
<v-text-field <v-text-field
color="cyan darken-4" color="blue darken-3"
outline outline
label="ชื่อผู้ใช้" label="ชื่อผู้ใช้"
prepend-inner-icon="person" prepend-inner-icon="person"
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
required required
></v-text-field> ></v-text-field>
<v-text-field <v-text-field
color="cyan darken-4" color="blue darken-3"
outline outline
label="รหัสผ่าน" label="รหัสผ่าน"
v-model="loginData.password" v-model="loginData.password"
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
> >
{{ error }} {{ error }}
</v-alert></p> </v-alert></p>
<v-btn color="cyan darken-4" large dark block type="submit">เข้าสู่ระบบ</v-btn> <v-btn color="blue darken-3" large dark block type="submit">เข้าสู่ระบบ</v-btn>
</v-form> </v-form>
<v-layout row wrap justify-center class="my-2"> <v-layout row wrap justify-center class="my-2">
<span class="body-2 font-weight-medium">ยังไม่มีบัญชีผู้ใช้? <router-link to="/employer/register" href="#">สมัครสมาชิก</router-link></span> <span class="body-2 font-weight-medium">ยังไม่มีบัญชีผู้ใช้? <router-link to="/employer/register" href="#">สมัครสมาชิก</router-link></span>
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
width="300" width="300"
> >
<v-card <v-card
color="cyan darken-4" color="blue darken-3"
dark dark
> >
<v-card-text> <v-card-text>
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<v-flex xs12 sm6 class="px-3"> <v-flex xs12 sm6 class="px-3">
<label class="font-weight-bold ">ชื่อผู้ใช้ <span class="red--text">&nbsp;*</span></label> <label class="font-weight-bold ">ชื่อผู้ใช้ <span class="red--text">&nbsp;*</span></label>
<v-text-field <v-text-field
color="cyan darken-4" color="blue darken-3"
outline outline
label="ชื่อผู้ใช้" label="ชื่อผู้ใช้"
v-model="registerData.username" v-model="registerData.username"
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
<label class="font-weight-bold">รหัสผ่าน <span class="red--text">&nbsp;*</span></label> <label class="font-weight-bold">รหัสผ่าน <span class="red--text">&nbsp;*</span></label>
<v-text-field <v-text-field
color="cyan darken-4" color="blue darken-3"
outline outline
label="รหัสผ่าน" label="รหัสผ่าน"
:append-icon="showPassword ? 'visibility' : 'visibility_off'" :append-icon="showPassword ? 'visibility' : 'visibility_off'"
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
<label class="font-weight-bold">รหัสผ่านอีกครั้ง <span class="red--text">&nbsp;*</span></label> <label class="font-weight-bold">รหัสผ่านอีกครั้ง <span class="red--text">&nbsp;*</span></label>
<v-text-field <v-text-field
color="cyan darken-4" color="blue darken-3"
outline outline
label="รหัสผ่านอีกครั้ง" label="รหัสผ่านอีกครั้ง"
:append-icon="showPasswordConfirm ? 'visibility' : 'visibility_off'" :append-icon="showPasswordConfirm ? 'visibility' : 'visibility_off'"
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
<v-flex xs12 sm6 class="px-3"> <v-flex xs12 sm6 class="px-3">
<label class="font-weight-bold">ชื่อบริษัท <span class="red--text">&nbsp;*</span></label> <label class="font-weight-bold">ชื่อบริษัท <span class="red--text">&nbsp;*</span></label>
<v-text-field <v-text-field
color="cyan darken-4" color="blue darken-3"
outline outline
label="ชื่อบริษัท" label="ชื่อบริษัท"
v-model="registerData.company_name" v-model="registerData.company_name"
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
<label class="font-weight-bold">อีเมล <span class="red--text">&nbsp;*</span></label> <label class="font-weight-bold">อีเมล <span class="red--text">&nbsp;*</span></label>
<v-text-field <v-text-field
color="cyan darken-4" color="blue darken-3"
outline outline
label="อีเมล" label="อีเมล"
v-model="registerData.email" v-model="registerData.email"
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
<label class="font-weight-bold">เบอร์โทรศัพท์ <span class="red--text">&nbsp;*</span></label> <label class="font-weight-bold">เบอร์โทรศัพท์ <span class="red--text">&nbsp;*</span></label>
<v-text-field <v-text-field
color="cyan darken-4" color="blue darken-3"
outline outline
label="เบอร์โทรศัพท์" label="เบอร์โทรศัพท์"
v-model="registerData.tel" v-model="registerData.tel"
...@@ -91,7 +91,7 @@ ...@@ -91,7 +91,7 @@
</v-flex> </v-flex>
</v-layout> </v-layout>
<v-layout row wrap justify-center> <v-layout row wrap justify-center>
<v-btn color="cyan darken-4 my-3" dark type="submit">สมัครสมาชิก</v-btn> <v-btn color="blue darken-3 my-3" dark type="submit">สมัครสมาชิก</v-btn>
</v-layout> </v-layout>
<v-layout row wrap justify-center> <v-layout row wrap justify-center>
<span class="body-2 font-weight-medium">มีบัญชีผู้ใช้แล้ว? <router-link to="/employer/login">เข้าสู่ระบบ</router-link></span> <span class="body-2 font-weight-medium">มีบัญชีผู้ใช้แล้ว? <router-link to="/employer/login">เข้าสู่ระบบ</router-link></span>
...@@ -106,7 +106,7 @@ ...@@ -106,7 +106,7 @@
width="300" width="300"
> >
<v-card <v-card
color="cyan darken-4" color="blue darken-3"
dark dark
> >
<v-card-text> <v-card-text>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment