Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
CO-OP Search
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kittisak Maneewong
CO-OP Search
Commits
eebd9060
Commit
eebd9060
authored
Apr 21, 2019
by
Kittisak Maneewong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make edit employer
parent
1b75b354
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
177 additions
and
77 deletions
+177
-77
CompanyController.php
app/Http/Controllers/CompanyController.php
+4
-13
DistrictController.php
app/Http/Controllers/DistrictController.php
+10
-0
app.js
public/js/app.js
+0
-0
route.js
resources/js/route.js
+4
-1
store.js
resources/js/store.js
+0
-1
ConfigCompany.vue
resources/js/views/ConfigCompany.vue
+1
-1
EditCompany.vue
resources/js/views/EditCompany.vue
+98
-51
Employer.vue
resources/js/views/Employer.vue
+59
-9
api.php
routes/api.php
+1
-1
Company1555816598.png
storage/uploads/Company1555816598.png
+0
-0
Company1555824383.png
storage/uploads/Company1555824383.png
+0
-0
No files found.
app/Http/Controllers/CompanyController.php
View file @
eebd9060
...
...
@@ -20,12 +20,6 @@ class CompanyController extends Controller
return
response
()
->
json
([
'exists'
=>
$exists
]);
}
public
function
config
(
$id
)
{
$company
=
User
::
where
(
'id'
,
$id
)
->
get
();
return
response
()
->
json
([
'company'
=>
$company
]);
}
public
function
index
()
{
}
...
...
@@ -96,6 +90,8 @@ class CompanyController extends Controller
*/
public
function
show
(
$id
)
{
$company
=
Company
::
where
(
'user_id'
,
$id
)
->
first
();
return
response
()
->
json
([
'company'
=>
$company
]);
}
/**
...
...
@@ -106,13 +102,8 @@ class CompanyController extends Controller
*/
public
function
edit
(
$id
)
{
$exists
=
Company
::
where
(
'user_id'
,
$id
)
->
exists
();
if
(
$exists
)
{
$data
=
Company
::
where
(
'user_id'
,
$id
)
->
get
();
}
else
{
$data
=
User
::
where
(
'id'
,
$id
)
->
get
();
}
return
response
()
->
json
([
'check'
=>
$exists
,
'data'
=>
$data
]);
$company
=
Company
::
where
(
'user_id'
,
$id
)
->
first
();
return
response
()
->
json
([
'company'
=>
$company
]);
}
/**
...
...
app/Http/Controllers/DistrictController.php
View file @
eebd9060
...
...
@@ -39,4 +39,14 @@ class DistrictController extends Controller
->
get
();
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
]);
}
}
public/js/app.js
View file @
eebd9060
This source diff could not be displayed because it is too large. You can
view the blob
instead.
resources/js/route.js
View file @
eebd9060
...
...
@@ -76,7 +76,10 @@ const router = new VueRouter({
{
path
:
'configcompany'
,
name
:
'configcompany'
,
component
:
ConfigCompany
component
:
ConfigCompany
,
meta
:
{
loginEmployer
:
true
}
},
{
path
:
'*'
,
...
...
resources/js/store.js
View file @
eebd9060
...
...
@@ -220,7 +220,6 @@ export default new Vuex.Store({
date
:
date
,
time
:
time
})
console
.
log
(
res
)
})
.
catch
(
err
=>
{
console
.
log
(
err
.
response
)
...
...
resources/js/views/ConfigCompany.vue
View file @
eebd9060
...
...
@@ -416,8 +416,8 @@ export default {
this
.
company_data
.
tumbon
=
this
.
tumbon
.
tumbon
axios
.
post
(
'/api/companys'
,
this
.
company_data
)
.
then
(
res
=>
{
this
.
loading
=
false
this
.
$router
.
push
(
'/employer'
)
this
.
loading
=
false
console
.
log
(
res
)
})
.
catch
(
err
=>
{
...
...
resources/js/views/EditCompany.vue
View file @
eebd9060
...
...
@@ -14,7 +14,7 @@
<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
_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-layout>
</
template
>
...
...
@@ -29,14 +29,14 @@
outline
label=
"ชื่อบริษัท"
:rules=
"[rules.required]"
v-model=
"company
_data
.company_name"
v-model=
"company.company_name"
class=
"my-ip"
></v-text-field>
<label
class=
"font-weight-bold"
>
ชื่อผู้ติดต่อ
<span
class=
"red--text"
>
*
</span></label>
<v-text-field
outline
label=
"ชื่อผู้ติดต่อ"
v-model=
"company
_data
.company_owner"
v-model=
"company.company_owner"
:rules=
"[rules.required]"
class=
"my-ip"
></v-text-field>
...
...
@@ -44,7 +44,7 @@
<v-text-field
outline
label=
"เบอร์ผู้ติดต่อ"
v-model=
"company
_data
.phone_no"
v-model=
"company.phone_no"
:rules=
"[rules.required]"
class=
"my-ip"
></v-text-field>
...
...
@@ -55,7 +55,7 @@
readonly
outline
label=
"อีเมล"
v-model=
"company
_data
.email"
v-model=
"company.email"
:rules=
"[rules.required, rules.email]"
class=
"my-ip"
></v-text-field>
...
...
@@ -64,14 +64,14 @@
outline
label=
"Fax"
class=
"my-ip"
v-model=
"company
_data
.fax"
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
_data
.website"
v-model=
"company.website"
></v-text-field>
</v-flex>
</v-layout>
...
...
@@ -87,7 +87,7 @@
outline
label=
"ที่อยู่"
:rules=
"[rules.required]"
v-model=
"company
_data
.addr"
v-model=
"company.addr"
class=
"my-1"
></v-textarea>
<label
class=
"font-weight-bold"
>
จังหวัด
<span
class=
"red--text"
>
*
</span></label>
...
...
@@ -118,7 +118,7 @@
outline
label=
"เกี่ยวกับบริษัท"
class=
"my-1"
v-model=
"company
_data
.about"
v-model=
"company.about"
></v-textarea>
</v-flex>
<v-flex
sm6
xs12
class=
"px-3"
>
...
...
@@ -138,7 +138,7 @@
<v-text-field
:disabled=
"!openZipCode"
label=
"รหัสไปรษณีย์"
v-model=
"company
_data.zip_
code"
v-model=
"company
.zip
code"
:rules=
"[rules.required]"
class=
"my-ip"
></v-text-field>
...
...
@@ -160,9 +160,9 @@
</GmapAutocomplete>
</v-flex>
<v-flex
sm12
xs12
>
<GmapMap
v-if=
"this.place"
style=
"width: 100%; height: 200px;"
:zoom=
"15"
:center=
"{lat: company
_data.lat, lng: company_data.l
ng}"
>
<GmapMap
v-if=
"this.place"
style=
"width: 100%; height: 200px;"
:zoom=
"15"
:center=
"{lat: company
.lat, lng: company.lo
ng}"
>
<GmapMarker
:position=
"{lat: company
_data.lat, lng: company_data.l
ng}"
:position=
"{lat: company
.lat, lng: company.lo
ng}"
:draggable=
"true"
@
dragend=
"dragMarker"
/>
...
...
@@ -187,7 +187,7 @@
<v-select
label=
"เลือก"
:items=
"bts"
v-model=
"company
_data
.bts"
v-model=
"company.bts"
></v-select>
</v-flex>
<v-flex
sm3
xs12
class=
"px-3"
>
...
...
@@ -195,7 +195,7 @@
<v-select
label=
"เลือก"
:items=
"mrt"
v-model=
"company
_data
.mrt"
v-model=
"company.mrt"
></v-select>
</v-flex>
<v-flex
sm3
xs12
class=
"px-3"
>
...
...
@@ -203,14 +203,14 @@
<v-select
label=
"เลือก"
:items=
"arl"
v-model=
"company
_data
.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
_data
.bus"
v-model=
"company.bus"
></VTextField>
</v-flex>
<v-flex
sm12
class=
"px-3"
>
...
...
@@ -221,7 +221,7 @@
outline
label=
""
class=
"my-2"
v-model=
"company
_data
.another"
v-model=
"company.another"
></v-textarea>
</v-flex>
<v-flex
sm6
xs12
class=
"px-3 py-3 detail"
>
...
...
@@ -245,6 +245,33 @@ export default {
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'
,
...
...
@@ -497,40 +524,60 @@ export default {
.
then
(
res
=>
{
axios
.
get
(
`/api/companys/
${
res
.
id
}
/edit`
)
.
then
(
res
=>
{
if
(
res
.
data
.
check
)
{
console
.
log
(
res
.
data
)
this
.
company_data
=
{
user_id
:
res
.
data
.
data
[
0
].
user_id
,
imageCompany
:
res
.
data
.
data
[
0
].
imageCompany
,
company_name
:
res
.
data
.
data
[
0
].
company_name
,
company_owner
:
res
.
data
.
data
[
0
].
company_owner
,
phone_no
:
res
.
data
.
data
[
0
].
phone_no
,
email
:
res
.
data
.
data
[
0
].
email
,
fax
:
res
.
data
.
data
[
0
].
fax
,
website
:
res
.
data
.
data
[
0
].
website
,
addr
:
res
.
data
.
data
[
0
].
addr
,
province
:
res
.
data
.
data
[
0
].
province
,
amphoe
:
res
.
data
.
data
[
0
].
amphoe
,
tumbon
:
res
.
data
.
data
[
0
].
tambon
,
zip_code
:
res
.
data
.
data
[
0
].
zipcode
,
about
:
res
.
data
.
data
[
0
].
about
,
imageMap
:
res
.
data
.
data
[
0
].
imageMap
,
lat
:
res
.
data
.
data
[
0
].
lat
,
lng
:
res
.
data
.
data
[
0
].
lng
,
bts
:
res
.
data
.
data
[
0
].
bts
,
mrt
:
res
.
data
.
data
[
0
].
mrt
,
arl
:
res
.
data
.
data
[
0
].
arl
,
bus
:
res
.
data
.
data
[
0
].
bus
,
another
:
res
.
data
.
data
[
0
].
another
,
check
:
true
}
}
else
{
this
.
company_data
.
user_id
=
res
.
data
.
data
[
0
].
id
this
.
company_data
.
company_name
=
res
.
data
.
data
[
0
].
company_name
this
.
company_data
.
email
=
res
.
data
.
data
[
0
].
email_employers
this
.
company_data
.
phone_no
=
res
.
data
.
data
[
0
].
tel
this
.
company_data
.
check
=
false
}
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
)
...
...
resources/js/views/Employer.vue
View file @
eebd9060
...
...
@@ -83,27 +83,27 @@
<v-divider
></v-divider>
</v-flex>
<v-layout
row
wrap
class=
"pa-3"
>
<v-flex
sm
2
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"
>
<v-flex
sm
3
xs12
class=
"text-sm-center text-xs-center"
>
<img
:src=
"companies.imageCompany
"
alt=
""
height=
"160"
>
</v-flex>
<v-flex
xs12
sm
10
class=
"px-3"
>
<v-flex
xs12
sm
9
class=
"px-3"
>
<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
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
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
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
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
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
xs12
sm12
>
<v-btn
small
depressed
dark
color=
"red"
@
click=
"$router.push('/employer/editcompany')"
>
...
...
@@ -119,6 +119,37 @@
<
script
>
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
:
{
date
()
{
return
this
.
$store
.
getters
.
getTime
.
date
...
...
@@ -126,6 +157,25 @@ export default {
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'
}
else
{
// this.companies.imageCompany = '../../../storage/uploads/'+this.companies.imageCompany
this
.
companies
.
imageCompany
=
'../../../public/img/logologin.png'
console
.
log
(
this
.
companies
.
imageCompany
)
}
})
.
catch
(
err
=>
{
console
.
log
(
err
.
response
)
})
})
}
}
</
script
>
...
...
routes/api.php
View file @
eebd9060
...
...
@@ -21,9 +21,9 @@ Route::group(['prefix' => 'auth'], function ($router) {
Route
::
resource
(
'/companys'
,
'CompanyController'
);
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/{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/{district_code}'
,
'DistrictController@detail'
);
Route
::
get
(
'/{province}/{amphoe}/{district}/{zipcode}'
,
'DistrictController@detailCheck'
);
storage/uploads/Company1555816598.png
0 → 100644
View file @
eebd9060
22.8 KB
storage/uploads/Company1555824383.png
0 → 100644
View file @
eebd9060
23.4 KB
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment