Commit eed7fd8e authored by Kittisak Maneewong's avatar Kittisak Maneewong

Add Job

parents d14deb36 d018635d
<template>
<div class="">
<v-layout row wrap justify-center >
<v-flex xs12 sm10 offset-sm-1 class=" body-2 font-weight-bold"><span>หน้าหลัก / ประกาศงาน</span></v-flex>
<v-flex xs12 sm10 offset-sm-1 class="ma-2">
<v-flex class="bg-title pa-2">
<v-layout row wrap align-center>
<div class="mx-3">
<v-icon x-large dark>fas fa-briefcase</v-icon>
</div>
<div class="pa-0">
<v-flex xs12 sm12>
<span class="font-title font-weight-bold">ข้อมูลรายละเอียดของงาน</span>
</v-flex>
<v-flex xs12 sm12>
<span class="font-subtitle ">(Job description information)</span>
</v-flex>
</div>
</v-layout>
</v-flex>
<v-flex class="bg-body pa-4">
<v-layout row wrap>
<v-flex xs12 sm6 class="px-3">
<v-text-field
label="หัวข้องาน"
placeholder=" "
></v-text-field>
<v-select
label="ประเภทงาน"
placeholder=" "
item-value="text"
></v-select>
<v-text-field
label="ตำแหน่งงาน "
placeholder=" "
></v-text-field>
<v-text-field
label="ค่าตอบแทน/เงินเดือน "
placeholder=" "
></v-text-field>
</v-flex>
<v-flex xs12 sm6 class="px-3">
<v-text-field
label="สาขาวิชาที่เปิดรับ "
placeholder=" "
></v-text-field>
<v-text-field
label="วันทำงาน "
placeholder=" "
></v-text-field>
<v-text-field
label="เวลาทำงาน "
placeholder=" "
></v-text-field>
<v-text-field
label="จำนวนที่รับ "
placeholder=" "
type="number"
></v-text-field>
</v-flex>
</v-layout>
</v-flex>
</v-flex>
<v-flex xs12 sm10 offset-sm-1 class="ma-2">
<v-flex class="bg-title-1 pa-2">
<v-layout row wrap align-center>
<div class="mx-3">
<v-icon x-large dark>fas fa-user-circle</v-icon>
</div>
<div class="pa-0">
<v-flex xs12 sm12>
<span class="font-title font-weight-bold">คุณสมบัติของผู้สมัครงาน</span>
</v-flex>
<v-flex xs12 sm12>
<span class="font-subtitle ">(Job applicant qualifications)</span>
</v-flex>
</div>
</v-layout>
</v-flex>
<v-flex class="bg-body pa-4">
<v-layout row wrap>
<v-flex xs12 sm6 class="px-3">
<v-combobox
v-model="gender"
:items="items"
label="เพศ"
placeholder=" "
multiple
>
<template v-slot:selection="data">
<v-chip
:key="JSON.stringify(data.item)"
:selected="data.selected"
:disabled="data.disabled"
class="v-chip--select-multi"
@input="data.parent.selectItem(data.item)"
>
<v-avatar
class="accent white--text"
v-text="data.item.slice(0, 1).toUpperCase()"
></v-avatar>
{{ data.item }}
</v-chip>
</template>
</v-combobox>
<v-select
label="ระดับการศึกษา"
placeholder=" "
item-value="text"
></v-select>
<v-text-field
label="เกรดเฉลี่ย "
placeholder=" "
></v-text-field>
<v-text-field
label="ระยะเวลาในการทำงาน "
placeholder=" "
></v-text-field>
<v-textarea
label="คุณสมบัติเพิ่มเติม"
rows="3"
outline
placeholder=" "
></v-textarea>
</v-flex>
<v-flex xs12 sm6 class="px-3">
<v-textarea
outline
label="หน้าที่รับผิดชอบ"
placeholder=" "
rows="7"
></v-textarea>
<v-textarea
outline
label="สวัสดิการ"
placeholder=" "
rows="7"
></v-textarea>
</v-flex>
</v-layout>
</v-flex>
</v-flex>
<v-flex xs12 sm10 offset-sm-1 class="my-1 text-xs-center text-sm-center."><v-btn round dark color="blue accent-3" class="px-3 white--text">เพิ่มข้อมูลงาน</v-btn></v-flex>
</v-layout>
</div>
</template>
<script>
export default {
data () {
return {
gender: [],
items: [
'ชาย',
'หญิง'
]
}
}
}
</script>
<style lang="scss" scoped>
.bg-title{
background-color: #00AAFF;
border-radius: 8px 8px 0 0;
display: block;
}
.bg-body{
background-color: #fff;
border-radius:0 0 8px 8px;
border-bottom:1px solid #dcdcdc ;
border-left:1px solid #dcdcdc ;
border-right:1px solid #dcdcdc ;
}
.bg-title-1{
background-color: #89969f;
border-radius: 8px 8px 0 0;
}
.font-title {
font-size: 20px;
color: #fff;
display: block;
font-family: "Prompt", sans-serif;
}
.font-subtitle {
font-size: 16px;
color: #2d3f4b;
display: block;
font-family: "Prompt", sans-serif;
}
</style>
...@@ -20,12 +20,6 @@ class CompanyController extends Controller ...@@ -20,12 +20,6 @@ class CompanyController extends Controller
return response()->json(['exists' => $exists]); return response()->json(['exists' => $exists]);
} }
public function config($id)
{
$company = User::where('id', $id)->get();
return response()->json(['company' => $company]);
}
public function index() public function index()
{ {
} }
...@@ -53,14 +47,14 @@ class CompanyController extends Controller ...@@ -53,14 +47,14 @@ class CompanyController extends Controller
if ($request->get('imageCompany') !== 'https://asianinteriorservices.com/wp-content/uploads/2018/04/noImg.png') { if ($request->get('imageCompany') !== 'https://asianinteriorservices.com/wp-content/uploads/2018/04/noImg.png') {
$image = $request->get('imageCompany'); $image = $request->get('imageCompany');
$name = 'Company'.time().'.'.explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1]; $name = 'Company'.time().'.'.explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];
\Image::make($request->get('imageCompany'))->save(storage_path('uploads/').$name); \Image::make($request->get('imageCompany'))->save(public_path('uploads/').$name);
$imageCompany = $name; $imageCompany = '/uploads/'.$name;
} }
if ($request->get('imageMap')) { if ($request->get('imageMap')) {
$image = $request->get('imageMap'); $image = $request->get('imageMap');
$name = 'Map'.time().'.'.explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1]; $name = 'Map'.time().'.'.explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];
\Image::make($request->get('imageMap'))->save(storage_path('uploads/').$name); \Image::make($request->get('imageMap'))->save(public_path('uploads/').$name);
$imageMap = $name; $imageMap = '/uploads/'.$name;
} }
$company = new Company(); $company = new Company();
$company->imageCompany = $imageCompany; $company->imageCompany = $imageCompany;
...@@ -96,6 +90,8 @@ class CompanyController extends Controller ...@@ -96,6 +90,8 @@ class CompanyController extends Controller
*/ */
public function show($id) public function show($id)
{ {
$company = Company::where('user_id', $id)->first();
return response()->json(['company' => $company]);
} }
/** /**
...@@ -106,13 +102,8 @@ class CompanyController extends Controller ...@@ -106,13 +102,8 @@ class CompanyController extends Controller
*/ */
public function edit($id) public function edit($id)
{ {
$exists = Company::where('user_id', $id)->exists(); $company = Company::where('user_id', $id)->first();
if ($exists) { return response()->json(['company' => $company]);
$data = Company::where('user_id', $id)->get();
} else {
$data = User::where('id', $id)->get();
}
return response()->json(['check' => $exists, 'data' => $data]);
} }
/** /**
...@@ -124,7 +115,7 @@ class CompanyController extends Controller ...@@ -124,7 +115,7 @@ class CompanyController extends Controller
*/ */
public function update(Request $request, $id) public function update(Request $request, $id)
{ {
// return response()->json(['data' => $request->all()]);
} }
/** /**
......
...@@ -39,4 +39,14 @@ class DistrictController extends Controller ...@@ -39,4 +39,14 @@ class DistrictController extends Controller
->get(); ->get();
return response()->json($districts); return response()->json($districts);
} }
public function detailCheck($province, $amphoe, $district, $zipcode)
{
$addr = District::where('province', $province)
->where('amphoe', $amphoe)
->where('district', $district)
->where('zipcode', $zipcode)
->first();
return response()->json(['addr' => $addr]);
}
} }
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -76,7 +76,10 @@ const router = new VueRouter({ ...@@ -76,7 +76,10 @@ const router = new VueRouter({
{ {
path: 'configcompany', path: 'configcompany',
name: 'configcompany', name: 'configcompany',
component: ConfigCompany component: ConfigCompany,
meta: {
loginEmployer: true
}
}, },
{ {
path: '*', path: '*',
......
...@@ -220,7 +220,6 @@ export default new Vuex.Store({ ...@@ -220,7 +220,6 @@ export default new Vuex.Store({
date: date, date: date,
time: time time: time
}) })
console.log(res)
}) })
.catch(err => { .catch(err => {
console.log(err.response) console.log(err.response)
......
...@@ -142,7 +142,7 @@ ...@@ -142,7 +142,7 @@
</v-layout> </v-layout>
</v-flex> </v-flex>
</v-flex> </v-flex>
<v-flex xs12 sm10 offset-sm-1 class="my-1 text-xs-center text-sm-center"><v-btn round dark color="blue accent-3" class="px-3 white--text">เพิ่มข้อมูลงาน</v-btn></v-flex> <v-flex xs12 sm10 offset-sm-1 class="my-1 text-xs-center text-sm-center."><v-btn round dark color="blue accent-3" class="px-3 white--text">เพิ่มข้อมูลงาน</v-btn></v-flex>
</v-layout> </v-layout>
</div> </div>
</template> </template>
...@@ -162,8 +162,6 @@ ...@@ -162,8 +162,6 @@
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.border {
}
.bg-title{ .bg-title{
background-color: #00AAFF; background-color: #00AAFF;
border-radius: 8px 8px 0 0; border-radius: 8px 8px 0 0;
......
...@@ -416,8 +416,8 @@ export default { ...@@ -416,8 +416,8 @@ export default {
this.company_data.tumbon = this.tumbon.tumbon this.company_data.tumbon = this.tumbon.tumbon
axios.post('/api/companys', this.company_data) axios.post('/api/companys', this.company_data)
.then(res => { .then(res => {
this.loading = false
this.$router.push('/employer') this.$router.push('/employer')
this.loading = false
console.log(res) console.log(res)
}) })
.catch(err => { .catch(err => {
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<v-icon color="black">business</v-icon> ข้อมูลบริษัท <v-icon color="black">business</v-icon> ข้อมูลบริษัท
<v-divider></v-divider> <v-divider></v-divider>
</v-flex> </v-flex>
<v-form enctype="multipart/form-data" @submit.prevent="createJob()" ref="create"> <v-form enctype="multipart/form-data" @submit.prevent="editCompany()" ref="create">
<v-flex sm12 xs12> <v-flex sm12 xs12>
<v-layout row wrap class="ป pa-3"> <v-layout row wrap class="ป pa-3">
<v-flex sm4 xs12 class="px-3"> <v-flex sm4 xs12 class="px-3">
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
<v-tooltip right> <v-tooltip right>
<template v-slot:activator="{ on }"> <template v-slot:activator="{ on }">
<v-layout column align-center> <v-layout column align-center>
<img v-on="on" class="img" @click="$refs.inputFile.click()" :src="company_data.imageCompany" alt="" width="200"> <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-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> </v-layout>
</template> </template>
...@@ -29,14 +29,14 @@ ...@@ -29,14 +29,14 @@
outline outline
label="ชื่อบริษัท" label="ชื่อบริษัท"
:rules="[rules.required]" :rules="[rules.required]"
v-model="company_data.company_name" v-model="company.company_name"
class="my-ip" class="my-ip"
></v-text-field> ></v-text-field>
<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
outline outline
label="ชื่อผู้ติดต่อ" label="ชื่อผู้ติดต่อ"
v-model="company_data.company_owner" v-model="company.company_owner"
:rules="[rules.required]" :rules="[rules.required]"
class="my-ip" class="my-ip"
></v-text-field> ></v-text-field>
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
<v-text-field <v-text-field
outline outline
label="เบอร์ผู้ติดต่อ" label="เบอร์ผู้ติดต่อ"
v-model="company_data.phone_no" v-model="company.phone_no"
:rules="[rules.required]" :rules="[rules.required]"
class="my-ip" class="my-ip"
></v-text-field> ></v-text-field>
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
readonly readonly
outline outline
label="อีเมล" label="อีเมล"
v-model="company_data.email" v-model="company.email"
:rules="[rules.required, rules.email]" :rules="[rules.required, rules.email]"
class="my-ip" class="my-ip"
></v-text-field> ></v-text-field>
...@@ -64,14 +64,14 @@ ...@@ -64,14 +64,14 @@
outline outline
label="Fax" label="Fax"
class="my-ip" class="my-ip"
v-model="company_data.fax" v-model="company.fax"
></v-text-field> ></v-text-field>
<label class="font-weight-bold">เว็บไซต์ <span class="red--text"></span></label> <label class="font-weight-bold">เว็บไซต์ <span class="red--text"></span></label>
<v-text-field <v-text-field
outline outline
label="เว็บไซต์" label="เว็บไซต์"
class="my-ip" class="my-ip"
v-model="company_data.website" v-model="company.website"
></v-text-field> ></v-text-field>
</v-flex> </v-flex>
</v-layout> </v-layout>
...@@ -87,7 +87,7 @@ ...@@ -87,7 +87,7 @@
outline outline
label="ที่อยู่" label="ที่อยู่"
:rules="[rules.required]" :rules="[rules.required]"
v-model="company_data.addr" v-model="company.addr"
class="my-1" class="my-1"
></v-textarea> ></v-textarea>
<label class="font-weight-bold">จังหวัด <span class="red--text">&nbsp;*</span></label> <label class="font-weight-bold">จังหวัด <span class="red--text">&nbsp;*</span></label>
...@@ -118,7 +118,7 @@ ...@@ -118,7 +118,7 @@
outline outline
label="เกี่ยวกับบริษัท" label="เกี่ยวกับบริษัท"
class="my-1" class="my-1"
v-model="company_data.about" v-model="company.about"
></v-textarea> ></v-textarea>
</v-flex> </v-flex>
<v-flex sm6 xs12 class="px-3"> <v-flex sm6 xs12 class="px-3">
...@@ -138,7 +138,7 @@ ...@@ -138,7 +138,7 @@
<v-text-field <v-text-field
:disabled="!openZipCode" :disabled="!openZipCode"
label="รหัสไปรษณีย์" label="รหัสไปรษณีย์"
v-model="company_data.zip_code" v-model="company.zipcode"
:rules="[rules.required]" :rules="[rules.required]"
class="my-ip" class="my-ip"
></v-text-field> ></v-text-field>
...@@ -160,9 +160,9 @@ ...@@ -160,9 +160,9 @@
</GmapAutocomplete> </GmapAutocomplete>
</v-flex> </v-flex>
<v-flex sm12 xs12> <v-flex sm12 xs12>
<GmapMap v-if="this.place" style="width: 100%; height: 200px;" :zoom="15" :center="{lat: company_data.lat, lng: company_data.lng}"> <GmapMap v-if="this.place" style="width: 100%; height: 200px;" :zoom="15" :center="{lat: company.lat, lng: company.long}">
<GmapMarker <GmapMarker
:position="{lat: company_data.lat, lng: company_data.lng}" :position="{lat: company.lat, lng: company.long}"
:draggable="true" :draggable="true"
@dragend="dragMarker" @dragend="dragMarker"
/> />
...@@ -187,7 +187,7 @@ ...@@ -187,7 +187,7 @@
<v-select <v-select
label="เลือก" label="เลือก"
:items="bts" :items="bts"
v-model="company_data.bts" v-model="company.bts"
></v-select> ></v-select>
</v-flex> </v-flex>
<v-flex sm3 xs12 class="px-3"> <v-flex sm3 xs12 class="px-3">
...@@ -195,7 +195,7 @@ ...@@ -195,7 +195,7 @@
<v-select <v-select
label="เลือก" label="เลือก"
:items="mrt" :items="mrt"
v-model="company_data.mrt" v-model="company.mrt"
></v-select> ></v-select>
</v-flex> </v-flex>
<v-flex sm3 xs12 class="px-3"> <v-flex sm3 xs12 class="px-3">
...@@ -203,14 +203,14 @@ ...@@ -203,14 +203,14 @@
<v-select <v-select
label="เลือก" label="เลือก"
:items="arl" :items="arl"
v-model="company_data.arl" v-model="company.arl"
></v-select> ></v-select>
</v-flex> </v-flex>
<v-flex sm3 xs12 class="px-3"> <v-flex sm3 xs12 class="px-3">
<label class="font-weight-bold">สายรถเมล์</label> <label class="font-weight-bold">สายรถเมล์</label>
<VTextField <VTextField
label="สายรถเมล์" label="สายรถเมล์"
v-model="company_data.bus" v-model="company.bus"
></VTextField> ></VTextField>
</v-flex> </v-flex>
<v-flex sm12 class="px-3"> <v-flex sm12 class="px-3">
...@@ -221,7 +221,7 @@ ...@@ -221,7 +221,7 @@
outline outline
label="" label=""
class="my-2" class="my-2"
v-model="company_data.another" v-model="company.another"
></v-textarea> ></v-textarea>
</v-flex> </v-flex>
<v-flex sm6 xs12 class="px-3 py-3 detail"> <v-flex sm6 xs12 class="px-3 py-3 detail">
...@@ -245,6 +245,33 @@ export default { ...@@ -245,6 +245,33 @@ export default {
loading: false, loading: false,
status: 'ยังไม่ได้เลือกไฟล์', status: 'ยังไม่ได้เลือกไฟล์',
nameImage: null, 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: { company_data: {
user_id: null, user_id: null,
imageCompany: 'https://asianinteriorservices.com/wp-content/uploads/2018/04/noImg.png', imageCompany: 'https://asianinteriorservices.com/wp-content/uploads/2018/04/noImg.png',
...@@ -406,28 +433,35 @@ export default { ...@@ -406,28 +433,35 @@ export default {
this.company_data.imageMap = e.target.result this.company_data.imageMap = e.target.result
} }
}, },
createJob () { editCompany () {
this.loading = true axios.put(`/api/companys/${this.company.id}`, this.company)
if (this.amphoes.findIndex(x => x.amphoe_code === this.amphoe.amphoe_code) === -1) {this.amphoe = ''} .then(res => {
if (this.tumbons.findIndex(x => x.tumbon_code === this.tumbon.tumbon_code) === -1) {this.tumbon = ''} console.log(res)
if (this.company_data.zip_code === ' ') {this.company_data.zip_code = ''} })
if (this.$refs.create.validate()) { .catch(err => {
this.company_data.province = this.province.province console.log(err.response)
this.company_data.amphoe = this.amphoe.amphoe })
this.company_data.tumbon = this.tumbon.tumbon // this.loading = true
axios.post('/api/companys', this.company_data) // if (this.amphoes.findIndex(x => x.amphoe_code === this.amphoe.amphoe_code) === -1) {this.amphoe = ''}
.then(res => { // if (this.tumbons.findIndex(x => x.tumbon_code === this.tumbon.tumbon_code) === -1) {this.tumbon = ''}
this.loading = false // if (this.company_data.zip_code === ' ') {this.company_data.zip_code = ''}
this.$router.push('/employer') // if (this.$refs.create.validate()) {
}) // this.company_data.province = this.province.province
.catch(err => { // this.company_data.amphoe = this.amphoe.amphoe
console.log(err.response) // this.company_data.tumbon = this.tumbon.tumbon
this.loading = false // axios.post('/api/companys', this.company_data)
}) // .then(res => {
} else { // this.loading = false
this.loading = false // this.$router.push('/employer')
this.$Loading.error() // })
} // .catch(err => {
// console.log(err.response)
// this.loading = false
// })
// } else {
// this.loading = false
// this.$Loading.error()
// }
}, },
showProvinces () { showProvinces () {
axios.get('/api/province') axios.get('/api/province')
...@@ -497,40 +531,60 @@ export default { ...@@ -497,40 +531,60 @@ export default {
.then(res => { .then(res => {
axios.get(`/api/companys/${res.id}/edit`) axios.get(`/api/companys/${res.id}/edit`)
.then(res => { .then(res => {
if(res.data.check) { this.company = res.data.company
console.log(res.data) if(this.company.lat) {
this.company_data = { this.company.lat = this.company.lat*1
user_id: res.data.data[0].user_id, this.company.long = this.company.long*1
imageCompany: res.data.data[0].imageCompany, this.place = 'have'
company_name: res.data.data[0].company_name, }
company_owner: res.data.data[0].company_owner, axios.get(`/api/${this.company.province}/${this.company.amphoe}/${this.company.tambon}/${this.company.zipcode}`)
phone_no: res.data.data[0].phone_no, .then(res => {
email: res.data.data[0].email, this.province = {
fax: res.data.data[0].fax, province: res.data.addr.province,
website: res.data.data[0].website, province_code: res.data.addr.province_code
addr: res.data.data[0].addr, }
province: res.data.data[0].province, this.amphoe = {
amphoe: res.data.data[0].amphoe, amphoe: res.data.addr.amphoe,
tumbon: res.data.data[0].tambon, amphoe_code: res.data.addr.amphoe_code
zip_code: res.data.data[0].zipcode, }
about: res.data.data[0].about, this.tumbon = {
imageMap: res.data.data[0].imageMap, tumbon: res.data.addr.district,
lat: res.data.data[0].lat, tumbon_code: res.data.addr.district_code
lng: res.data.data[0].lng, }
bts: res.data.data[0].bts, this.showAmphoes()
mrt: res.data.data[0].mrt, this.showTumbons()
arl: res.data.data[0].arl, })
bus: res.data.data[0].bus, .catch(err => {console.log(err.response)})
another: res.data.data[0].another, // axios.get(`/api/province`)
check: true // .then(res => {
} // const i = res.data.findIndex(x => x.province === this.company.province)
} else { // this.province = {
this.company_data.user_id = res.data.data[0].id // province: res.data[i].province,
this.company_data.company_name = res.data.data[0].company_name // province_code: res.data[i].province_code
this.company_data.email = res.data.data[0].email_employers // }
this.company_data.phone_no = res.data.data[0].tel // axios.get(`/api/province/${this.province.province_code}/amphoe`)
this.company_data.check = false // .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 => { .catch(err => {
console.log(err.response) console.log(err.response)
......
...@@ -83,27 +83,27 @@ ...@@ -83,27 +83,27 @@
<v-divider ></v-divider> <v-divider ></v-divider>
</v-flex> </v-flex>
<v-layout row wrap class="pa-3"> <v-layout row wrap class="pa-3">
<v-flex sm2 xs12 class="text-sm-center text-xs-center"> <v-flex sm3 xs12 class="text-sm-center text-xs-center">
<img src="https://www.jobbkk.com/upload/employer/0A/86A/00786A/images/308262.png" alt="" height="160"> <img :src="companies.imageCompany" alt="" height="160">
</v-flex> </v-flex>
<v-flex xs12 sm10 class="px-3"> <v-flex xs12 sm9 class="px-3">
<v-flex xs12 sm12> <v-flex xs12 sm12>
<label class="font-weight-bold subheading green--text">บริษัท พีพี ออนไทม์ จำกัด</label> <label class="font-weight-bold subheading green--text">{{ companies.company_name }}</label>
</v-flex> </v-flex>
<v-flex xs12 sm12> <v-flex xs12 sm12>
<label class="body-2">1011 อาคารศุภาลัย แกรนด์ ทาวเวอร์ ชั้น 16 ถนนพระราม 3 แขวงช่องนนทรี เขตยานนาวา จังหวัดกรุงเทพมหานคร 10120</label> <label class="body-2">{{ companies.addr }} {{ companies.tambon }} {{ companies.amphoe }} {{ companies.province }} {{ companies.zipcode }}</label>
</v-flex> </v-flex>
<v-flex xs12 sm12 class="mt-1"> <v-flex xs12 sm12 class="mt-1">
<label class="caption"><v-icon small>email</v-icon> kittipong.ma.59@ubu.ac.th</label> <label class="caption"><v-icon small>email</v-icon> {{ companies.email }}</label>
</v-flex> </v-flex>
<v-flex xs12 sm12> <v-flex xs12 sm12>
<label class="caption"><v-icon small>desktop_mac</v-icon> http://www.pp-ontime.co.th/</label> <label class="caption"><v-icon small>desktop_mac</v-icon> {{ companies.website ? companies.website : ' - ' }}</label>
</v-flex> </v-flex>
<v-flex xs12 sm12> <v-flex xs12 sm12>
<label class="caption"><v-icon small>phone</v-icon> โทร. 02-056-2099</label> <label class="caption"><v-icon small>phone</v-icon> โทร. {{ companies.phone_no ? companies.phone_no : ' - ' }}</label>
</v-flex> </v-flex>
<v-flex xs12 sm12> <v-flex xs12 sm12>
<label class="caption"><v-icon small>print</v-icon> แฟกซ์. : 02-056-2088</label> <label class="caption"><v-icon small>print</v-icon> แฟกซ์. : {{ companies.fax ? companies.fax : ' - ' }}</label>
</v-flex> </v-flex>
<v-flex xs12 sm12> <v-flex xs12 sm12>
<v-btn small depressed dark color="red" @click="$router.push('/employer/editcompany')"> <v-btn small depressed dark color="red" @click="$router.push('/employer/editcompany')">
...@@ -119,6 +119,37 @@ ...@@ -119,6 +119,37 @@
<script> <script>
export default { export default {
data () {
return {
companies: {
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
}
}
},
computed: { computed: {
date () { date () {
return this.$store.getters.getTime.date return this.$store.getters.getTime.date
...@@ -126,6 +157,21 @@ export default { ...@@ -126,6 +157,21 @@ export default {
time () { time () {
return this.$store.getters.getTime.time return this.$store.getters.getTime.time
} }
},
beforeMount() {
this.$store.dispatch('checkEmployer')
.then(res => {
axios.get(`/api/companys/${res.id}`)
.then(res => {
this.companies = res.data.company
if (!this.companies.imageCompany) {
this.companies.imageCompany = 'https://asianinteriorservices.com/wp-content/uploads/2018/04/noImg.png'
}
})
.catch(err => {
console.log(err.response)
})
})
} }
} }
</script> </script>
......
...@@ -21,9 +21,9 @@ Route::group(['prefix' => 'auth'], function ($router) { ...@@ -21,9 +21,9 @@ Route::group(['prefix' => 'auth'], function ($router) {
Route::resource('/companys', 'CompanyController'); Route::resource('/companys', 'CompanyController');
Route::get('/companys/{company}/check', 'CompanyController@check')->name('companys.check'); Route::get('/companys/{company}/check', 'CompanyController@check')->name('companys.check');
Route::get('/companys/{company}/config', 'CompanyController@config')->name('companys.config');
Route::get('/province','DistrictController@provinces'); Route::get('/province','DistrictController@provinces');
Route::get('/province/{province_code}/amphoe','DistrictController@amphoes'); Route::get('/province/{province_code}/amphoe','DistrictController@amphoes');
Route::get('/province/{province_code}/amphoe/{amphoe_code}/district','DistrictController@districts'); Route::get('/province/{province_code}/amphoe/{amphoe_code}/district','DistrictController@districts');
Route::get('/province/{province_code}/amphoe/{amphoe_code}/district/{district_code}','DistrictController@detail'); Route::get('/province/{province_code}/amphoe/{amphoe_code}/district/{district_code}','DistrictController@detail');
Route::get('/{province}/{amphoe}/{district}/{zipcode}','DistrictController@detailCheck');
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