Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
repair_workers_h5
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
石盼盼
repair_workers_h5
Commits
9627116c
Commit
9627116c
authored
Oct 11, 2021
by
石盼盼
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'spp' into 'master'
Spp See merge request
!29
parents
04cc1ade
7b5152b9
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
140 additions
and
23 deletions
+140
-23
apiList.js
src/api/apiList.js
+2
-2
axios.js
src/api/axios.js
+1
-1
admin_index.scss
src/assets/styles/tabbar/admin_index.scss
+52
-0
Home.vue
src/views/tabbar/Home.vue
+2
-1
admin_home.vue
src/views/tabbar/admin_home.vue
+83
-19
No files found.
src/api/apiList.js
View file @
9627116c
...
...
@@ -10,8 +10,8 @@ const baseUrl = '/api'
// todo: url
// const httpUrl = 'https://repairtest.zeruiedu.com' // 测试接口
const
httpUrl
=
'
https://repair.zeruiedu.com
'
// 正式接口
const
h5Url
=
'
http://localhost:8080
'
// 测试h5线上地址
//
const h5Url = 'http://repair.h5.zeruiedu.com' // 测试h5线上地址
//
const h5Url = 'http://localhost:8080' // 测试h5线上地址
const
h5Url
=
'
http://repair.h5.zeruiedu.com
'
// 测试h5线上地址
window
.
localStorage
.
setItem
(
'
httpUrl
'
,
httpUrl
)
window
.
localStorage
.
setItem
(
'
h5Url
'
,
h5Url
)
// const httpUrl = 'https://fenghexm.xueyoubangedu.com' // 正式接口
...
...
src/api/axios.js
View file @
9627116c
...
...
@@ -34,7 +34,7 @@ service.interceptors.request.use(
service
.
interceptors
.
response
.
use
(
response
=>
{
const
{
data
,
config
}
=
response
console
.
log
(
'
添加响应拦截器
'
,
response
)
//
console.log('添加响应拦截器', response)
if
(
data
.
meta
.
code
===
400
)
{
console
.
log
(
'
===== token过期 =====
'
)
const
promisefresh
=
new
Promise
(
function
(
resolve
,
reject
)
{
...
...
src/assets/styles/tabbar/admin_index.scss
View file @
9627116c
...
...
@@ -155,6 +155,9 @@
// height: 0.3rem;
margin-bottom
:
0
.2rem
;
}
.wo
{
width
:
80%
;
}
.item-title
{
// min-width: 1.5rem;
...
...
@@ -347,4 +350,53 @@
text-align
:
center
;
line-height
:
0
.78rem
;
margin
:
1
.2rem
auto
;
}
// 选择工人弹窗样式
.tc-box
{
width
:
6
.9rem
;
background
:
#fff
;
padding-top
:
0
.3rem
;
padding-left
:
0
.3rem
;
padding-right
:
0
.3rem
;
padding-bottom
:
0
.3rem
;
}
.tc-box
.tc-title
{
color
:
#000000
;
font-size
:
0
.26rem
;
margin-bottom
:
0
.3rem
;
font-weight
:
bold
;
text-align
:
center
;
}
.tc-box
.workers
.worker-item
{
width
:
2rem
;
height
:
0
.6rem
;
background
:
#f2f2f2
;
text-align
:
center
;
line-height
:
0
.6rem
;
border-radius
:
0
.35rem
;
}
.tc-box
.workers
.activeItem
{
width
:
2rem
;
height
:
0
.6rem
;
background
:
#0054FF
;
color
:
#fff
;
text-align
:
center
;
line-height
:
0
.6rem
;
border-radius
:
0
.35rem
;
}
.btn-box
{
margin-top
:
0
.6rem
;
}
.btn-box
.btn
{
width
:
1
.80rem
;
height
:
0
.70rem
;
background
:
#FFFFFF
;
border
:
0
.01rem
solid
#C8C8C8
;
border-radius
:
0
.35rem
;
text-align
:
center
;
line-height
:
0
.7rem
;
color
:
#000000
;
font-size
:
0
.24rem
;
margin-right
:
0
.2rem
;
}
\ No newline at end of file
src/views/tabbar/Home.vue
View file @
9627116c
...
...
@@ -34,7 +34,8 @@
v-if=
"list.length"
>
<div
class=
"order-item"
v-for=
"(item, index) in list"
:key=
"item.id"
>
<div
class=
"title"
>
{{
item
.
order_status_display
}}
</div>
<div
class=
"title"
v-if=
"item.pid==0&&item.son_count>0"
>
{{
item
.
order_status_display
}}
(负责人)
</div>
<div
class=
"title"
v-else
>
{{
item
.
order_status_display
}}
</div>
<div
class=
"item flex-h flex-vc"
>
<div
class=
"item-title"
>
预约时间:
</div>
<div
...
...
src/views/tabbar/admin_home.vue
View file @
9627116c
...
...
@@ -43,17 +43,32 @@
@
load=
"onmore"
v-if=
"list.length"
>
<div
class=
"order-item"
v-for=
"(item, index) in list"
:key=
"index"
>
<!-- 选择工人弹窗 -->
<van-popup
v-model=
"item.showWorker"
round
position=
"bottom"
>
<van-picker
<div
class=
"order-item"
v-for=
"(item, index) in list"
:key=
"index"
>
<!-- 选择工人弹窗 -->
<van-popup
v-model=
"item.showWorker"
round
>
<!--
<van-picker
show-toolbar
:columns=
"columns"
value-key=
"name"
@
cancel=
"Cancel(index)"
@
confirm=
"(value)=>onConfirm(value,index)"
/>
</van-popup>
/>
-->
<div
class=
"tc-box"
>
<div
class=
"tc-title"
>
选择工人
</div>
<div
class=
"workers flex-h flex-hw flex-hb"
>
<div
:class=
"item.worker_id && item.worker_id.includes(child_item.id) ? 'activeItem' : 'worker-item'"
@
click=
"selectWorker(child_index,child_item,index)"
v-for=
"(child_item,child_index) in columns"
:key=
"child_index"
>
{{
child_item
.
name
}}
</div>
</div>
<div
class=
"allBtn btn-box flex-h flex-hc"
>
<div
class=
"button"
@
click=
"Cancel(index)"
>
取消
</div>
<div
class=
"button sureBtn"
@
click=
"keyConfirm(index)"
>
确定
</div>
</div>
</div>
</van-popup>
<div
class=
"title"
>
{{
item
.
order_status_display
}}
</div>
<div
class=
"item flex-h flex-vc"
>
<div
class=
"item-title"
>
预约时间:
</div>
...
...
@@ -101,7 +116,7 @@
<div
class=
"item-title"
>
退回备注:
</div>
<div
class=
"item-desc"
>
{{
item
.
orderlog_cancel
.
remark
}}
</div>
</div>
<div
v-if=
"item.worker"
>
<
!--
<
div
v-if=
"item.worker"
>
<div
class=
"line"
></div>
<div
class=
"item flex-h flex-vc"
>
<div
class=
"item-title"
>
派工对象:
</div>
...
...
@@ -111,6 +126,13 @@
<div
class=
"item-title"
>
联系电话:
</div>
<div
class=
"item-desc"
>
{{
item
.
worker
.
phone
}}
</div>
</div>
</div>
-->
<div
v-if=
"item.work_name"
>
<div
class=
"line"
></div>
<div
class=
"item flex-h flex-vc"
>
<div
class=
"item-title"
>
派工对象:
</div>
<div
class=
"item-desc"
>
{{
item
.
work_name
}}
</div>
</div>
</div>
<div
v-if=
"item.is_can_assign_worker==1"
>
...
...
@@ -120,10 +142,10 @@
class=
"item flex-h flex-vc flex-hb"
@
click=
"workers(index)"
>
<div
class=
"flex-h flex-vc"
>
<div
class=
"
wo
flex-h flex-vc"
>
<div
class=
"item-title"
v-if=
"item.order_status_display == '已派工'"
>
重新派工:
</div>
<div
class=
"item-title"
v-else
>
派工对象:
</div>
<div
class=
"item-desc
"
>
{{
item
.
workerName
}}
</div>
<div
class=
"item-desc
worker-name"
>
{{
item
.
workerName
.
length
?
item
.
workerName
.
join
(
'
,
'
)
:
''
}}
</div>
</div>
<div
class=
"flex-h flex-vc"
>
<div
class=
"select flex-h flex-vc"
>
...
...
@@ -192,7 +214,7 @@
<
script
>
import
myTabbar
from
'
@components/common/tabbar.vue
'
import
{
trimStrSpace
}
from
'
@assets/js/format.js
'
import
{
ImagePreview
}
from
'
vant
'
;
import
{
ImagePreview
,
CellGroup
}
from
'
vant
'
;
export
default
{
name
:
'
home
'
,
components
:
{
...
...
@@ -257,6 +279,7 @@ export default {
// 转单
curItem
:
''
,
// 当前选中要操作的数据
reason
:
''
,
// 原因
currentId
:
''
,
}
},
created
()
{
...
...
@@ -264,6 +287,33 @@ export default {
this
.
getWorkers
()
},
methods
:
{
// 选择完工人点击确定按钮
keyConfirm
(
i
){
if
(
!
this
.
list
[
i
].
worker_id
.
length
){
this
.
$toast
(
'
请选择工人!
'
)
return
}
let
temp_name
=
[]
this
.
columns
.
map
(
item
=>
{
if
(
this
.
list
[
i
].
worker_id
.
includes
(
item
.
id
)){
temp_name
.
push
(
item
.
name
)
}
})
this
.
list
[
i
].
workerName
=
temp_name
this
.
list
[
i
].
showWorker
=
false
},
// 选择工人
selectWorker
(
child_index
,
item
,
index
){
if
(
this
.
list
[
index
].
worker_id
.
includes
(
item
.
id
)){
// 删除
let
name_i
=
this
.
list
[
index
].
worker_id
.
indexOf
(
item
.
id
)
this
.
list
[
index
].
worker_id
.
splice
(
name_i
,
1
)
// this.list[index].workerName.splice(name_i,1)
}
else
{
// 加入
this
.
list
[
index
].
worker_id
.
push
(
item
.
id
)
// this.list[index].workerName.push(item.name)
}
},
onmore
(){
this
.
getList
()
},
...
...
@@ -289,13 +339,13 @@ export default {
// console.log('1111',item);
this
.
curItem
=
item
this
.
repair_order_id
=
item
.
id
if
(
!
item
.
worker_id
)
{
if
(
!
item
.
worker_id
.
length
)
{
this
.
$toast
(
'
请选择工人
'
)
return
}
const
curParams
=
{
repair_order_id
:
this
.
repair_order_id
,
worker_id
:
item
.
worker_id
worker_id
:
item
.
worker_id
.
join
(
'
,
'
)
}
this
.
$http
.
post
(
this
.
$myApi
.
REPAIR_ASSIGN
,
curParams
)
...
...
@@ -310,7 +360,6 @@ export default {
changeList
(
data
,
index
){
if
(
this
.
curSelectStatus
.
statustype
==
0
||
this
.
curSelectStatus
.
statustype
==
3
){
this
.
$set
(
this
.
list
,
index
,
data
)
this
.
count
=
this
.
count
-
1
}
else
{
this
.
list
.
splice
(
index
,
1
)
this
.
count
=
this
.
count
-
1
...
...
@@ -326,12 +375,14 @@ export default {
workers
(
index
){
this
.
$set
(
this
.
list
,
index
,{...
this
.
list
[
index
],
...{
showWorker
:
true
}})
},
onConfirm
(
value
,
i
)
{
console
.
log
(
'
id啊
'
,
value
.
id
);
this
.
$set
(
this
.
list
,
i
,{...
this
.
list
[
i
],...{
worker_id
:
value
.
id
,
workerName
:
value
.
name
}})
this
.
list
[
i
].
showWorker
=
false
},
// onConfirm(value,i) {
// console.log('id啊',value.id);
// this.$set(this.list,i,{...this.list[i],...{worker_id: value.id, workerName: value.name}})
// this.list[i].showWorker = false
// },
Cancel
(
i
){
console
.
log
(
'
111
'
);
this
.
list
[
i
].
showWorker
=
false
},
endShow
(){
...
...
@@ -398,7 +449,18 @@ export default {
this
.
$http
.
get
(
this
.
$myApi
.
GET_WORKER
,
curParams
)
.
then
((
data
)
=>
{
this
.
columns
=
data
// this.columns = data
var
arr
=
[]
for
(
let
i
in
data
)
{
let
options
=
{
name
:
data
[
i
].
name
,
id
:
data
[
i
].
id
,
isCheck
:
false
}
arr
.
push
(
options
);
//属性
}
this
.
columns
=
arr
console
.
log
(
'
工人啊
'
,
this
.
columns
);
})
.
catch
(()
=>
{
...
...
@@ -444,6 +506,8 @@ export default {
this
.
list
=
this
.
page
===
1
?
data
.
list
:
this
.
list
.
concat
(
data
.
list
)
this
.
list
=
this
.
list
.
map
(
item
=>
{
item
.
showWorker
=
false
item
.
workerName
=
[]
item
.
worker_id
=
[]
return
item
})
this
.
page
=
data
.
page
...
...
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