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 source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -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> การเดินทาง
......
<template>
<div>
<v-layout row wrap class=" pa-0 my-3">
<v-flex xs12 sm12 class="pa-3 font-weight-bold title">
<v-icon color="black">business</v-icon> ข้อมูลบริษัท
<v-divider></v-divider>
</v-flex>
<v-form enctype="multipart/form-data" @submit.prevent="editCompany()" ref="create">
<v-flex sm12 xs12>
<v-layout row wrap class="ป pa-3">
<v-flex sm4 xs12 class="px-3">
<v-layout align-center justify-center fill-height>
<input type="file" accept="image/*" class="input-file" ref="inputFile" @change="selectFile">
<v-tooltip right>
<template v-slot:activator="{ on }">
<v-layout column align-center>
<img v-on="on" class="img" @click="$refs.inputFile.click()" :src="company.imageCompany" alt="" width="200">
<v-btn color="error" v-if="company_data.imageCompany !== 'https://asianinteriorservices.com/wp-content/uploads/2018/04/noImg.png'" @click="company_data.imageCompany = 'https://asianinteriorservices.com/wp-content/uploads/2018/04/noImg.png';status = 'ยังไม่ได้เลือกไฟล์'">ลบรูปภาพ</v-btn>
</v-layout>
</template>
<span>{{ status }}</span>
</v-tooltip>
</v-layout>
</v-flex>
<v-flex sm4 xs12 class="px-3">
<label class="font-weight-bold">ชื่อบริษัท <span class="red--text">&nbsp;*</span></label>
<v-text-field
readonly
outline
label="ชื่อบริษัท"
:rules="[rules.required]"
v-model="company.company_name"
class="my-ip"
></v-text-field>
<label class="font-weight-bold">ชื่อผู้ติดต่อ <span class="red--text">&nbsp;*</span></label>
<v-text-field
outline
label="ชื่อผู้ติดต่อ"
v-model="company.company_owner"
:rules="[rules.required]"
class="my-ip"
></v-text-field>
<label class="font-weight-bold">เบอร์ผู้ติดต่อ <span class="red--text">&nbsp;*</span></label>
<v-text-field
outline
label="เบอร์ผู้ติดต่อ"
v-model="company.phone_no"
:rules="[rules.required]"
class="my-ip"
></v-text-field>
</v-flex>
<v-flex sm4 xs12 class="px-3">
<label class="font-weight-bold">อีเมล <span class="red--text">&nbsp;*</span></label>
<v-text-field
readonly
outline
label="อีเมล"
v-model="company.email"
:rules="[rules.required, rules.email]"
class="my-ip"
></v-text-field>
<label class="font-weight-bold">Fax <span class="red--text"></span></label>
<v-text-field
outline
label="Fax"
class="my-ip"
v-model="company.fax"
></v-text-field>
<label class="font-weight-bold">เว็บไซต์ <span class="red--text"></span></label>
<v-text-field
outline
label="เว็บไซต์"
class="my-ip"
v-model="company.website"
></v-text-field>
</v-flex>
</v-layout>
</v-flex>
<v-flex sm12>
<v-flex sm12 xs12 class="pa-3">
<h2 class="font-weight-bold subheading"><span class="red--text">&nbsp;ข้อมูลสำหรับติดต่อ</span></h2>
</v-flex>
<v-layout row wrap class="pa-3">
<v-flex sm6 xs12 class="px-3">
<label class="font-weight-bold">ที่อยู่ <span class="red--text">&nbsp;*</span></label>
<v-textarea
outline
label="ที่อยู่"
:rules="[rules.required]"
v-model="company.addr"
class="my-1"
></v-textarea>
<label class="font-weight-bold">จังหวัด <span class="red--text">&nbsp;*</span></label>
<v-select
:items="provinces"
item-text="province"
v-model="province"
label="เลือกจังหวัด"
:rules="[rules.required]"
return-object
@change="showAmphoes()"
></v-select>
<label class="font-weight-bold">เขต/อำเภอ <span class="red--text">&nbsp;*</span></label>
<v-select
:items="amphoes"
item-text="amphoe"
label="เลือกเขต/อำเภอ"
return-object
v-model="amphoe"
no-data-text="กรุณาเลือกจังหวัด"
:disabled="!openAmphoe"
:rules="[rules.required]"
@change="showTumbons()"
></v-select>
<label class="font-weight-bold">เกี่ยวกับบริษัท</label>
<v-textarea
outline
label="เกี่ยวกับบริษัท"
class="my-1"
v-model="company.about"
></v-textarea>
</v-flex>
<v-flex sm6 xs12 class="px-3">
<label class="font-weight-bold">แขวง/ตำบล<span class="red--text">&nbsp;*</span></label>
<v-select
:items="tumbons"
item-text="tumbon"
return-object
v-model="tumbon"
no-data-text="กรุณาเลือกอำเภอ"
:rules="[rules.required]"
:disabled="!openTumbon"
label="เลือกแขวง/ตำบล"
@change = "showDetail()"
></v-select>
<label class="font-weight-bold">รหัสไปรษณีย์<span class="red--text">&nbsp;*</span></label>
<v-text-field
:disabled="!openZipCode"
label="รหัสไปรษณีย์"
v-model="company.zipcode"
:rules="[rules.required]"
class="my-ip"
></v-text-field>
<label class="font-weight-bold">แผนที่บริษัท</label>
<v-layout row wrap class="pa-2">
<v-flex sm12 xs12>
<label>รูปภาพแผนที่</label>
</v-flex>
<v-flex sm12 xs12>
<input type="file" accept="image/*" class="input-file" ref="inputFileMap" @change="selectFileMap">
<v-btn color="deep-orange darken-4" class="px-2" small outline @click="$refs.inputFileMap.click()"><v-icon>file_copy</v-icon>&nbsp;เลือกไฟล์</v-btn>
{{ nameImage }}
<v-btn v-if="nameImage" flat icon color="error" @click="nameImage = null; company_data.imageMap = null">
<v-icon>close</v-icon>
</v-btn>
</v-flex>
<v-flex sm12 xs12>
<GmapAutocomplete class="form-control form-control-sm my-1" placeholder="ป้อนตำแหน่งใกล้เคียง" @place_changed="setPlace">
</GmapAutocomplete>
</v-flex>
<v-flex sm12 xs12>
<GmapMap v-if="this.place" style="width: 100%; height: 200px;" :zoom="15" :center="{lat: company.lat, lng: company.long}">
<GmapMarker
:position="{lat: company.lat, lng: company.long}"
:draggable="true"
@dragend="dragMarker"
/>
</GmapMap>
</v-flex>
<v-flex sm12 xs12>
<p class="text-xs-center" v-if="this.place"><v-btn color="error" @click="place = null;company_data.lat = null;company_data.lng = null">
ลบเเผนที่
</v-btn></p>
</v-flex>
</v-layout>
</v-flex>
</v-layout>
<v-layout row wrap class="borderbottom pa-3">
<v-flex sm12>
<h2 class="font-weight-bold subheading"><span class="red--text">&nbsp;การเดินทาง</span></h2>
</v-flex>
<v-flex sm3 xs12 class="px-3">
<label class="font-weight-bold my-2">ใกล้ BTS</label>
<v-select
label="เลือก"
:items="bts"
v-model="company.bts"
></v-select>
</v-flex>
<v-flex sm3 xs12 class="px-3">
<label class="font-weight-bold">ใกล้ MRT</label>
<v-select
label="เลือก"
:items="mrt"
v-model="company.mrt"
></v-select>
</v-flex>
<v-flex sm3 xs12 class="px-3">
<label class="font-weight-bold">ใกล้ ARL</label>
<v-select
label="เลือก"
:items="arl"
v-model="company.arl"
></v-select>
</v-flex>
<v-flex sm3 xs12 class="px-3">
<label class="font-weight-bold">สายรถเมล์</label>
<VTextField
label="สายรถเมล์"
v-model="company.bus"
></VTextField>
</v-flex>
<v-flex sm12 class="px-3">
<label class="font-weight-bold">การเดินทางเพิ่มเติม</label>
</v-flex>
<v-flex sm6 xs12 class="px-3">
<v-textarea
outline
label=""
class="my-2"
v-model="company.another"
></v-textarea>
</v-flex>
<v-flex sm6 xs12 class="px-3 py-3 detail">
<span class="red--text">หมายเหตุ : </span>
<span >เพื่อความสะดวกในการเดินทางของผู้สมัครงาน กรุณาระบุสถานีรถไฟฟ้าที่ใกล้กับสถานที่ปฏิบัติงาน (ถ้ามี) หรือระบุสายรถเมล์ที่ผ่านสถานที่ประกอบการ และระบุการเดินทางเพิ่มเติม เพื่อให้เข้าใจในการเดินทางมากยิ่งขึ้น</span>
</v-flex>
<v-layout row wrap justify-center class="my-2">
<v-btn color="red" dark="" type="submit" :loading="loading">บันทึกข้อมูล</v-btn>
</v-layout>
</v-layout>
</v-flex>
</v-form>
</v-layout>
</div>
</template>
<script>
export default {
data () {
return {
loading: false,
status: 'ยังไม่ได้เลือกไฟล์',
nameImage: null,
company: {
about: null,
addr: null,
amphoe: null,
another: null,
arl: null,
bts: null,
bus: null,
company_name: null,
company_owner: null,
created_at: null,
email: null,
fax: null,
id: null,
imageCompany: null,
imageMap: null,
lat: null,
long: null,
mrt: null,
phone_no: null,
province: null,
tambon: null,
updated_at: null,
user_id: null,
website: null,
zipcode: null
},
company_data: {
user_id: null,
imageCompany: 'https://asianinteriorservices.com/wp-content/uploads/2018/04/noImg.png',
company_name: '',
company_owner: '',
phone_no: '',
email: '',
fax: '',
website: '',
addr: '',
province: '',
amphoe: '',
tumbon: '',
zip_code: '',
about: '',
imageMap: null,
lat: null,
lng: null,
bts: '',
mrt: '',
arl: '',
bus: '',
another: '',
check: false
},
rules: {
required: v => !!v || 'จำเป็นต้องกรอก',
email: v => /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(v) || 'รูปแบบอีเมลล์ไม่ถูกต้อง'
},
timeFrom: null,
timeTo: null,
showTimeFrom: false,
showTimeTo: false,
provinces: [],
amphoes: [],
tumbons: [],
province: '',
amphoe: '',
tumbon: '',
openAmphoe: false,
openTumbon: false,
openZipCode: false,
bts: [
'หมอชิต',
'สะพานควาย',
'อารีย์',
'สนามเป้า',
'อนุสาวรีย์ชัยสมรภูมิ',
'พญาไท',
'ราชเทวี',
'สยาม',
'ชิดลม',
'เพลินจิต',
'นานา',
'อโศก',
'พร้อมพงษ์',
'ทองหล่อ',
'เอกมัย',
'พระโขนง',
'อ่อนนุช',
'บางจาก',
'ปุณณวิถี',
'อุดมสุข',
'บางนา',
'สนามกีฬาแห่งชาติ',
'ราชดำริ',
'ศาลาแดง',
'ช่องนนทรี',
'สุรศักดิ์',
'สะพานตากสิน',
'กรุงธนบุรี',
'วงเวียนใหญ่',
'โพธิ์นิมิตร',
'ตลาดพลู',
'วุฒากาศ',
'บางหว้า',
'แบริ่ง'
],
mrt: [
'หัวลำโพง',
'สามย่าน',
'สีลม',
'ลุมพินี',
'คลองเตย',
'ศูนย์การประชุมแห่งชาติสิริกิติ์',
'สุขุมวิท',
'เพชรบุรี',
'พระราม 9',
'ศูนย์วัฒนธรรมแห่งประเทศไทย',
'ห้วยขวาง',
'สุทธิสาร',
'รัชดาภิเษก',
'ลาดพร้าว',
'พหลโยธิน',
'สวนจตุจักร',
'กำแพงเพชร',
'บางซื่อ',
'เตาปูน',
'บางซ่อน',
'วงศสว่าง',
'แยกติวานนท์',
'กระทรวงสาธารณะสุข',
'ศูนย์ราชการนนทบุรี',
'บางกระสอ',
'แยกนนทบุรี 1',
'สะพานพระนั่งเกล้า',
'ไทรม้า',
'บางรักน้อยท่าอิฐ',
'บางรักใหญ่',
'บางพลู',
'สามแยกบางใหญ่',
'ตลาดบางใหญ่',
'คลองบางไผ่'
],
arl: [
'สุวรรณภูมิ',
'ลาดกระบัง',
'บ้านทับช้าง',
'หัวหมาก',
'รามคำแหง',
'มักกะสัน',
'ราชปรารภ',
'พญาไท'
],
place: null
}
},
methods: {
dragMarker (e) {
this.company_data.lat = e.latLng.lat()
this.company_data.lng = e.latLng.lng()
},
setPlace(place) {
this.place = place
this.company_data.lat = this.place.geometry.location.lat()
this.company_data.lng = this.place.geometry.location.lng()
},
selectFile (e) {
const file = e.target.files
this.status = file[0].name
if (!file.length) {
return
}
const fileReader = new FileReader()
fileReader.readAsDataURL(file[0])
fileReader.onload = e => {
this.company_data.imageCompany = e.target.result
}
},
selectFileMap (e) {
const file = e.target.files
this.nameImage = file[0].name
if (!file.length) {
return
}
const fileReader = new FileReader()
fileReader.readAsDataURL(file[0])
fileReader.onload = e => {
this.company_data.imageMap = e.target.result
}
},
editCompany () {
axios.put(`/api/companys/${this.company.id}`, this.company)
.then(res => {
console.log(res)
})
.catch(err => {
console.log(err.response)
})
// this.loading = true
// if (this.amphoes.findIndex(x => x.amphoe_code === this.amphoe.amphoe_code) === -1) {this.amphoe = ''}
// if (this.tumbons.findIndex(x => x.tumbon_code === this.tumbon.tumbon_code) === -1) {this.tumbon = ''}
// if (this.company_data.zip_code === ' ') {this.company_data.zip_code = ''}
// if (this.$refs.create.validate()) {
// this.company_data.province = this.province.province
// this.company_data.amphoe = this.amphoe.amphoe
// this.company_data.tumbon = this.tumbon.tumbon
// axios.post('/api/companys', this.company_data)
// .then(res => {
// this.loading = false
// this.$router.push('/employer')
// })
// .catch(err => {
// console.log(err.response)
// this.loading = false
// })
// } else {
// this.loading = false
// this.$Loading.error()
// }
},
showProvinces () {
axios.get('/api/province')
.then(res => {
res.data.forEach(data => {
this.provinces.push({
province: data.province,
province_code: data.province_code
})
});
})
.catch(err => {
console.log(err.response)
})
},
showAmphoes () {
this.amphoes = []
this.company_data.zip_code = ''
this.openAmphoe = true
this.openTumbon = false
this.openZipCode = false
axios.get(`/api/province/${this.province.province_code}/amphoe`)
.then(res => {
res.data.forEach(data => {
this.amphoes.push({
amphoe: data.amphoe,
amphoe_code: data.amphoe_code
})
})
})
.catch(err => {
console.log(err.response)
})
},
showTumbons () {
this.tumbons = []
this.company_data.zip_code = ' '
this.openTumbon = true
this.openZipCode = false
axios.get(`/api/province/${this.province.province_code}/amphoe/${this.amphoe.amphoe_code}/district`)
.then(res => {
res.data.forEach(data => {
this.tumbons.push({
tumbon: data.district,
tumbon_code: data.district_code
})
})
})
.catch(err => {
console.log(err.response)
})
},
showDetail () {
this.openZipCode = true
axios.get(`/api/province/${this.province.province_code}/amphoe/${this.amphoe.amphoe_code}/district/${this.tumbon.tumbon_code}`)
.then(res => {
this.company_data.zip_code = res.data[0].zipcode
})
.catch(err => {
console.log(err.resonse)
})
}
},
beforeMount() {
this.showProvinces()
this.$store.dispatch('checkEmployer')
.then(res => {
axios.get(`/api/companys/${res.id}/edit`)
.then(res => {
this.company = res.data.company
if(this.company.lat) {
this.company.lat = this.company.lat*1
this.company.long = this.company.long*1
this.place = 'have'
}
axios.get(`/api/${this.company.province}/${this.company.amphoe}/${this.company.tambon}/${this.company.zipcode}`)
.then(res => {
this.province = {
province: res.data.addr.province,
province_code: res.data.addr.province_code
}
this.amphoe = {
amphoe: res.data.addr.amphoe,
amphoe_code: res.data.addr.amphoe_code
}
this.tumbon = {
tumbon: res.data.addr.district,
tumbon_code: res.data.addr.district_code
}
this.showAmphoes()
this.showTumbons()
})
.catch(err => {console.log(err.response)})
// axios.get(`/api/province`)
// .then(res => {
// const i = res.data.findIndex(x => x.province === this.company.province)
// this.province = {
// province: res.data[i].province,
// province_code: res.data[i].province_code
// }
// axios.get(`/api/province/${this.province.province_code}/amphoe`)
// .then(res => {
// console.log(res)
// const j = res.data.findIndex(x => x.amphoe === this.company.amphoe)
// this.amphoe = {
// amphoe: res.data[j].amphoe,
// amphoe_code: res.data[j].amphoe_code
// }
// axios.get(`/api/province/${this.province.province_code}/amphoe/${this.amphoe.amphoe_code}/district`)
// .then(res => {
// const k = res.data.findIndex(x => x.district === this.company.tambon)
// this.tumbon = {
// tumbon: res.data[k].district,
// tumbon_code: res.data[k].district_code
// }
// this.showAmphoes()
// this.showTumbons()
// })
// .catch(err => {console.log(err.response)})
// })
// .catch(err => {console.log(err.response)})
// })
// .catch(err => {console.log(err.response)})
})
.catch(err => {
console.log(err.response)
})
})
}
}
</script>
<style lang="scss" scoped>
// .my-job{
// height: 70px;
// }
// .my-ip{
// height: 65px;
// }
.detail {
color: #276f86;
background-color: #f8ffff;
border:1px solid #a9d5de;
border-radius: 5px;
display: inline-block;
line-height: 26px;
}
.borderbottom{
border-bottom: 1px dotted #dcdcdc ;
}
.border-div{
border:1px solid #dcdcdc;
border-radius: 5px;
}
input {
overflow: visible;
}
.bd-example>.form-control+.form-control {
margin-top: .5rem;
}
.form-control-plaintext.form-control-sm, .form-control-plaintext.form-control-lg {
padding-right: 0;
padding-left: 0;
}
.form-control-sm {
height: calc(1.0em + 0.5rem + 1px);
padding: 0.15rem 0.5rem;
font-size: 0.7rem;
line-height: 1.5;
border-radius: 0.3rem;
}
.form-control {
display: block;
width: 100%;
height: calc(1.5em + 0.75rem + 2px);
padding: 0.375rem 0.75rem;
font-size: 1rem;
font-weight: 400;
line-height: 1.5;
color: #495057;
background-color: #fff;
background-clip: padding-box;
border: 1px solid #ced4da;
border-radius: 0.25rem;
transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}
@media (prefers-reduced-motion: reduce) {
.form-control {
transition: none;
}
}
.form-control::-ms-expand {
background-color: transparent;
border: 0;
}
.form-control:focus {
color: #495057;
background-color: #fff;
border-color: #80bdff;
outline: 0;
box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}
.form-control::-webkit-input-placeholder {
color: #6c757d;
opacity: 1;
}
.form-control::-moz-placeholder {
color: #6c757d;
opacity: 1;
}
.form-control:-ms-input-placeholder {
color: #6c757d;
opacity: 1;
}
.form-control::-ms-input-placeholder {
color: #6c757d;
opacity: 1;
}
.form-control::placeholder {
color: #6c757d;
opacity: 1;
}
.form-control:disabled, .form-control[readonly] {
background-color: #e9ecef;
opacity: 1;
}
select.form-control:focus::-ms-value {
color: #495057;
background-color: #fff;
}
.form-control-file,
.form-control-range {
display: block;
width: 100%;
}
.img {
cursor: pointer;
border: 1px solid;
}
.input-file {
display: none;
}
</style>
...@@ -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