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

update

parent 74fad557
......@@ -24,7 +24,7 @@ class JobController extends Controller
*/
public function create()
{
//
}
/**
......@@ -67,8 +67,9 @@ class JobController extends Controller
*/
public function show($id)
{
$jobs = Job::all();
$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
* @return \Illuminate\Http\Response
*/
public function edit($id)
{
{
$jobs = Job::all();
$job = Job::find($id);
$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';
import Employer from './views/Employer.vue';
import LoginEmployer from './views/LoginEmployer.vue';
import PageNotFound from './views/PageNotFound.vue';
import EditCompany from './views/EditCompany.vue';
import RegisterEmployer from './views/RegisterEmployer';
import ManagejobEmployer from './views/managejob.vue';
import ConfigCompany from './views/ConfigCompany.vue';
......@@ -20,6 +19,9 @@ import CreateJob from './views/CreateJob.vue';
import EditJob from './views/EditJob.vue';
import DetailJob from './views/DetailJob.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({
mode: 'history',
......@@ -34,8 +36,7 @@ const router = new VueRouter({
name: 'Employer',
component: Employer,
meta: {
loginEmployer: true,
configProfile: true
loginEmployer: true
}
},
{
......@@ -53,17 +54,7 @@ const router = new VueRouter({
name: 'managejobEmployer',
component: ManagejobEmployer,
meta: {
loginEmployer: true,
configProfile: true
}
},
{
path: 'editcompany',
name: 'editcompany',
component: EditCompany,
meta: {
loginEmployer: true,
configProfile: true
loginEmployer: true
}
},
{
......@@ -71,14 +62,16 @@ const router = new VueRouter({
name: 'createjob',
component: CreateJob,
meta: {
loginEmployer: true,
configProfile: true
loginEmployer: true
}
},
{
path: 'editjob/:id',
name: 'editJob',
component: EditJob
component: EditJob,
meta: {
loginEmployer: true
}
},
{
path: 'configcompany',
......@@ -123,10 +116,7 @@ const router = new VueRouter({
{
path: '*',
name: 'pageNotFound',
component: PageNotFound,
meta: {
requiredUser: true
}
component: Page404
}
]
}
......@@ -137,10 +127,16 @@ router.beforeEach((to, from, next) => {
iView.LoadingBar.start();
if(to.matched.some(record => record.meta.requiredUser)) {
if(!localStorage.getItem('access_token')) {
next('/employer/login')
next('/')
} else {
next()
}
} else if(to.matched.some(record => record.meta.loginEmployer)) {
if(!localStorage.getItem('access_token_employer')) {
next('/employer/login')
} else {
next ()
}
} else {
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 @@
.then(res => {
console.log(res)
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 => {
console.log(err)
......
......@@ -116,6 +116,11 @@
<v-flex xs12 sm12 class=" font-weight-bold subheading mt-2 my-1">
<v-icon small >fas fa-street-view</v-icon> แผนที่ตั้งบริษัท
<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 xs12 sm12 class=" font-weight-bold subheading mt-2 my-1">
<v-icon small >fas fa-plane</v-icon> การเดินทาง
......
This diff is collapsed.
......@@ -29,7 +29,7 @@
></v-text-field>
<v-combobox
v-model="job_data.job_type"
:items="items"
:items="jobs_data"
:rules="[v => !!v || 'จำเป็นต้องกรอก']"
label="ประเภทงาน"
placeholder=" "
......@@ -195,6 +195,7 @@
'ชาย',
'หญิง'
],
jobs_data: [],
job_data: {
id: null,
job_title: '',
......@@ -247,6 +248,7 @@
this.job_data.feature = res.data.job.feature
this.job_data.role = res.data.job.role
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)
})
.catch(err => {console.log(err.response)})
......
......@@ -25,7 +25,10 @@
<span class=" subheading font-weight-bold indigo--text"><v-icon color="indigo">person_pin</v-icon> ข้อมูลบัญชีผู้ใช้</span>
</v-flex>
<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-btn>
</v-flex>
......@@ -122,6 +125,7 @@ export default {
data () {
return {
user: null,
exists: false,
countJob: 0,
companies: {
about: null,
......@@ -167,6 +171,7 @@ export default {
axios.get(`/api/companys/${res.id}`)
.then(res => {
console.log(res)
this.exists = res.data.exists
this.countJob = res.data.count
if (res.data.exists) {
this.companies = res.data.company
......
......@@ -5,7 +5,7 @@
<h3 class="title font-weight-bold my-3">เข้าสู่ระบบสำหรับผู้ประกอบการ</h3>
<v-form @submit.prevent="login()" ref="loginEmployer">
<v-text-field
color="cyan darken-4"
color="blue darken-3"
outline
label="ชื่อผู้ใช้"
prepend-inner-icon="person"
......@@ -15,7 +15,7 @@
required
></v-text-field>
<v-text-field
color="cyan darken-4"
color="blue darken-3"
outline
label="รหัสผ่าน"
v-model="loginData.password"
......@@ -35,7 +35,7 @@
>
{{ error }}
</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-layout row wrap justify-center class="my-2">
<span class="body-2 font-weight-medium">ยังไม่มีบัญชีผู้ใช้? <router-link to="/employer/register" href="#">สมัครสมาชิก</router-link></span>
......@@ -49,7 +49,7 @@
width="300"
>
<v-card
color="cyan darken-4"
color="blue darken-3"
dark
>
<v-card-text>
......
......@@ -8,7 +8,7 @@
<v-flex xs12 sm6 class="px-3">
<label class="font-weight-bold ">ชื่อผู้ใช้ <span class="red--text">&nbsp;*</span></label>
<v-text-field
color="cyan darken-4"
color="blue darken-3"
outline
label="ชื่อผู้ใช้"
v-model="registerData.username"
......@@ -19,7 +19,7 @@
<label class="font-weight-bold">รหัสผ่าน <span class="red--text">&nbsp;*</span></label>
<v-text-field
color="cyan darken-4"
color="blue darken-3"
outline
label="รหัสผ่าน"
:append-icon="showPassword ? 'visibility' : 'visibility_off'"
......@@ -33,7 +33,7 @@
<label class="font-weight-bold">รหัสผ่านอีกครั้ง <span class="red--text">&nbsp;*</span></label>
<v-text-field
color="cyan darken-4"
color="blue darken-3"
outline
label="รหัสผ่านอีกครั้ง"
:append-icon="showPasswordConfirm ? 'visibility' : 'visibility_off'"
......@@ -49,7 +49,7 @@
<v-flex xs12 sm6 class="px-3">
<label class="font-weight-bold">ชื่อบริษัท <span class="red--text">&nbsp;*</span></label>
<v-text-field
color="cyan darken-4"
color="blue darken-3"
outline
label="ชื่อบริษัท"
v-model="registerData.company_name"
......@@ -60,7 +60,7 @@
<label class="font-weight-bold">อีเมล <span class="red--text">&nbsp;*</span></label>
<v-text-field
color="cyan darken-4"
color="blue darken-3"
outline
label="อีเมล"
v-model="registerData.email"
......@@ -71,7 +71,7 @@
<label class="font-weight-bold">เบอร์โทรศัพท์ <span class="red--text">&nbsp;*</span></label>
<v-text-field
color="cyan darken-4"
color="blue darken-3"
outline
label="เบอร์โทรศัพท์"
v-model="registerData.tel"
......@@ -91,7 +91,7 @@
</v-flex>
</v-layout>
<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 row wrap justify-center>
<span class="body-2 font-weight-medium">มีบัญชีผู้ใช้แล้ว? <router-link to="/employer/login">เข้าสู่ระบบ</router-link></span>
......@@ -106,7 +106,7 @@
width="300"
>
<v-card
color="cyan darken-4"
color="blue darken-3"
dark
>
<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