Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
self-support
Project
Project
Details
Activity
Releases
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李俊赕
self-support
Commits
607b5dbf
Commit
607b5dbf
authored
Jun 28, 2021
by
Facius
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of
https://git.banshouhui.com/lijundan/self-support
into dev
parents
36734335
f41179cb
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
98 additions
and
73 deletions
+98
-73
parts.js
src/common/api/parts.js
+1
-1
XhParts.vue
src/components/createCom/XhParts.vue
+25
-37
adjust.vue
src/components/select-parts/adjust.vue
+1
-1
index.vue
src/components/select-parts/index.vue
+2
-2
complete.vue
src/pages/order/complete.vue
+24
-5
detail.vue
src/pages/order/detail.vue
+1
-0
parts.vue
src/pages/order/parts.vue
+11
-8
addParts.vue
src/pages/parts/addParts.vue
+32
-18
index.js
src/store/index.js
+1
-1
No files found.
src/common/api/parts.js
View file @
607b5dbf
...
...
@@ -39,7 +39,7 @@ let partsApiFun = function (vm) {
/**
* 查询工单的配件明细
*/
let
getWorkOrderParts
=
async
(
params
=
{})
=>
await
vm
.
$u
.
get
(
parts
+
vm
.
vuex_token
+
'/items/workOrder/'
,
params
);
let
getWorkOrderParts
=
async
(
params
=
{})
=>
await
vm
.
$u
.
get
(
parts
+
vm
.
vuex_token
+
'/items/workOrder/'
+
params
.
workOrderId
);
/**
* 返件-备件/新件
*/
...
...
src/components/createCom/XhParts.vue
View file @
607b5dbf
...
...
@@ -4,20 +4,20 @@
<view
class=
"list u-flex u-row-between"
>
<image
class=
"item-image"
:src=
"mixingImage"
v-if=
"item.required"
></image>
<view
class=
"u-m-r-20"
>
{{
item
.
fieldsTitle
}}
</view>
<view
class=
"u-flex-1 add-parts"
@
click=
"toParts"
>
添加
配
件
<u-icon
name=
"arrow-right"
color=
"#2979ff"
size=
"30"
></u-icon>
<view
class=
"u-flex-1 add-parts"
@
click=
"toParts"
v-if=
"!disabled"
>
添加
备
件
<u-icon
name=
"arrow-right"
color=
"#2979ff"
size=
"30"
></u-icon>
</view>
</view>
<view
class=
"complete-part"
>
<view
v-if=
"
status === 1
"
>
<view
v-if=
"
lists.length > 0
"
>
<adjust-parts
v-for=
"(item, index) in lists"
:key=
"index"
:info=
"item"
@
change=
"partsChange($event, index)"
:disabled=
"disabled"
></adjust-parts>
</view>
<view
class=
"u-flex select-part"
v-else
-if=
"status === 2"
>
<view
class=
"u-flex select-part"
v-else
>
<view
class=
"img"
>
<image
:src=
"noPartsImage"
class=
"part-icon"
/>
</view>
<view
class=
"u-flex content"
>
<text
class=
"title"
>
暂无
配
件信息
</text>
<text
class=
"title"
>
暂无
备
件信息
</text>
<text
class=
"desc"
>
可选择备件仓配件
</text>
</view>
<view
class=
"btn"
>
...
...
@@ -47,23 +47,7 @@
},
data
()
{
return
{
lists
:
[
{
id
:
1
,
name
:
"正泰漏保"
,
quantity
:
1
,
min
:
1
,
max
:
100
,
},
{
id
:
1
,
name
:
"挚达广汽充电桩"
,
quantity
:
3
,
min
:
1
,
max
:
5
,
},
],
status
:
2
lists
:
[]
}
},
computed
:
{
...
...
@@ -87,34 +71,38 @@
},
methods
:
{
getWorkOrderParts
()
{
const
params
=
{
workOrderId
:
this
.
orderId
}
this
.
$u
.
getWorkOrderParts
(
params
).
then
(
res
=>
{
if
(
res
.
code
===
200
)
{
const
data
=
res
.
data
this
.
status
=
data
.
receivedItems
.
length
>
0
?
1
:
2
this
.
lists
=
data
.
receivedItems
||
[]
}
})
this
.
lists
=
this
.
dataValue
||
[]
},
partsChange
(
val
,
index
)
{
console
.
log
(
"val"
,
val
,
index
)
this
.
$set
(
this
.
lists
[
index
],
'quantity'
,
val
)
this
.
valueChange
(
this
.
lists
)
},
valChange
(
val
)
{
val
.
forEach
(
v
=>
{
const
index
=
this
.
lists
.
findIndex
(
k
=>
k
.
part_id
===
v
.
part_id
)
if
(
index
<
0
)
{
this
.
lists
.
push
(
v
)
}
else
{
this
.
$set
(
this
.
lists
,
index
,
v
)
}
})
this
.
valueChange
(
this
.
lists
)
},
toParts
()
{
uni
.
navigateTo
({
url
:
'/pages/order/parts'
url
:
`/pages/order/parts?workOrderId=
${
this
.
orderId
}
`
})
},
handle
(
val
)
{
console
.
log
(
"val"
,
val
)
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.item-image
{
width
:
24rpx
;
height
:
24rpx
;
margin-right
:
10rpx
;
}
.required
{
padding-right
:
10rpx
;
font-size
:
28rpx
;
...
...
src/components/select-parts/adjust.vue
View file @
607b5dbf
...
...
@@ -5,7 +5,7 @@
{{
info
.
name
}}
</view>
<view
class=
"num"
>
<u-number-box
v-if=
"!disabled"
v-model=
"info.quantity"
:min=
"info.min || 0"
:max=
"info.max ||
info.quantity
"
@
change=
"numChange"
></u-number-box>
<u-number-box
v-if=
"!disabled"
v-model=
"info.quantity"
:min=
"info.min || 0"
:max=
"info.max ||
999
"
@
change=
"numChange"
></u-number-box>
<text
class=
"nums"
v-else
>
x
{{
info
.
quantity
||
1
}}
</text>
</view>
</view>
...
...
src/components/select-parts/index.vue
View file @
607b5dbf
...
...
@@ -11,8 +11,8 @@
<view
class=
"right-content-name"
>
{{
info
.
name
}}
</view>
<view
class=
"right-content-desc"
>
{{
info
.
remark
}}
</view>
<view
class=
"u-flex right-content-opera"
>
<view
class=
"no"
>
{{
info
.
code
}}
<view
class=
"no"
v-if=
"info.stock"
>
可用
{{
info
.
stock
}}
件
</view>
<view
class=
"num"
>
<u-number-box
v-if=
"!info.disabled"
v-model=
"info.quantity"
:min=
"info.min || 0"
:max=
"info.max || info.quantity"
@
change=
"numChange"
></u-number-box>
...
...
src/pages/order/complete.vue
View file @
607b5dbf
...
...
@@ -72,7 +72,7 @@
</xh-service-more>
<xh-label
v-else-if=
"item.formType==='label'"
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
:value=
'form[item.fieldsName] || ""'
>
</xh-label>
<xh-parts
v-else-if=
"item.formType==='parts'"
:order-id=
"orderId"
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
:value=
'form[item.fieldsName] || ""'
>
<xh-parts
ref=
"fileChildParts"
v-else-if=
"item.formType==='parts'"
:order-id=
"orderId"
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
:value=
'form[item.fieldsName] || ""'
:disabled=
"orderStatus === '88' || orderStatus === '86'"
@
value-change=
"fieldValueChange"
>
</xh-parts>
</template>
</u-form-item>
...
...
@@ -261,6 +261,7 @@
currentItemDate
:{},
photoItem
:
{},
maintainStep
:
'partnerInspectItem'
,
orderStatus
:
''
// showTab: true,
}
},
...
...
@@ -294,7 +295,7 @@
this
.
inGuaranteePeriod
=
option
.
inGuaranteePeriod
this
.
partnerCompanyId
=
option
.
partnerCompanyId
this
.
auditResultsId
=
option
.
auditResultsId
this
.
orderStatus
=
option
.
orderStatus
// this.showTab =item.partnerCompanyName == '挚达充电桩'
}
else
{
this
.
orderId
=
11880091
...
...
@@ -427,9 +428,8 @@
return
param
},
saveComplete
(){
// 保存完工信息
let
self
=
this
let
param
=
self
.
handleSaveData
()
self
.
$u
.
api
.
saveCompleteData
(
param
,
self
.
orderId
).
then
((
res
)
=>
{
const
param
=
this
.
handleSaveData
()
this
.
$u
.
api
.
saveCompleteData
(
param
,
this
.
orderId
).
then
((
res
)
=>
{
if
(
res
.
code
==
200
)
{
this
.
$refs
.
uToast
.
show
({
title
:
'保存成功'
,
...
...
@@ -564,8 +564,26 @@
if
(
this
.
oldItemId
)
this
.
itemId
=
this
.
oldItemId
})
},
// 提交配件信息
submitParts
()
{
const
lists
=
this
.
form
.
orderAccessorys
.
filter
(
v
=>
v
.
quantity
>
0
)
const
params
=
{
workOrderId
:
this
.
orderId
,
applyType
:
'10'
,
parts
:
lists
}
this
.
$u
.
api
.
applyParts
(
params
).
then
(
res
=>
{
if
(
res
.
code
!==
200
)
{
this
.
$refs
.
uToast
.
show
({
title
:
res
.
data
,
type
:
'error'
,
})
}
})
},
// 提交订单
orderFinish
(){
this
.
submitParts
()
const
param
=
this
.
handleSaveData
()
// 完工事件埋点
getApp
().
track
(
'order_finish'
,
{
id
:
this
.
vuex_user
.
id
,
mobile
:
this
.
vuex_user
.
mobile
,
orderId
:
Number
(
this
.
orderId
)})
...
...
@@ -666,6 +684,7 @@
if
(
innerItem
.
fieldsName
===
'pipe'
||
innerItem
.
fieldsName
===
'pipeUseLength'
)
{
// 申请费用计算
this
.
calcMoney
()
}
console
.
log
(
"this.form"
,
this
.
form
)
},
// 申请费用计算
...
...
src/pages/order/detail.vue
View file @
607b5dbf
...
...
@@ -798,6 +798,7 @@
+
"&partnerCompanyId="
+
this
.
order
.
partnerCompanyId
+
'&partnerCompanyName='
+
this
.
order
.
partnerCompanyName
+
'&maintainStep='
+
this
.
order
.
maintainStep
+
'&orderStatus='
+
this
.
order
.
orderStatus
})
},
rejectOrder
()
{
// 拒单
...
...
src/pages/order/parts.vue
View file @
607b5dbf
...
...
@@ -45,7 +45,8 @@
},
data
()
{
return
{
lists
:
[]
lists
:
[],
workOrderId
:
null
,
}
},
computed
:
{
...
...
@@ -63,7 +64,8 @@
return
count
===
0
||
false
}
},
created
()
{
onLoad
(
e
)
{
this
.
workOrderId
=
parseInt
(
e
.
workOrderId
)
this
.
getReserve
()
},
methods
:
{
...
...
@@ -94,18 +96,19 @@
})
},
submit
()
{
let
pages
=
getCurrentPages
()
let
prevPage
=
pages
[
pages
.
length
-
2
]
const
lists
=
this
.
lists
.
filter
(
v
=>
v
.
checked
).
map
(
v
=>
{
return
{
name
:
v
.
name
,
part_id
:
v
.
skuId
,
quantity
:
v
.
quantity
quantity
:
v
.
quantity
,
max
:
v
.
max
}
})
prevPage
.
$vm
.
handle
(
lists
)
let
pages
=
getCurrentPages
();
let
prevPage
=
pages
[
pages
.
length
-
2
];
//上一个页面
prevPage
.
$vm
.
$refs
[
'fileChildParts'
][
0
].
valChange
(
lists
)
this
.
$u
.
route
({
type
:
'back'
})
console
.
log
(
lists
)
},
qnFile
(
src
)
{
return
process
.
uniEnv
.
qn_base_url
+
src
...
...
src/pages/parts/addParts.vue
View file @
607b5dbf
...
...
@@ -11,7 +11,7 @@
></u-search>
</view>
<view
class=
"categary"
>
<view
class=
"categary"
v-if=
"type === '2'"
>
<view
class=
"u-flex u-col-center"
>
<picker
mode=
"selector"
:value=
"categaryIndex"
range-key=
"label"
:range=
"categary"
@
click=
"show = true"
@
change=
"changeCategary"
>
<view
class=
"txt"
>
{{
categary
[
categaryIndex
].
label
||
'请选择'
}}
</view>
...
...
@@ -22,7 +22,7 @@
<view
class=
"warp u-flex"
>
<view
class=
"brand u-flex"
>
<view
class=
"label-content u-flex"
>
<view
class=
"label-content u-flex"
v-if=
"brand.length > 0"
>
<scroll-view
style=
"width:100%;white-space: nowrap;"
scroll-x=
"true"
...
...
@@ -100,7 +100,8 @@ export default {
lists
:
[],
submitList
:
[],
pageSize
:
20
,
pageNumber
:
1
pageNumber
:
1
,
type
:
'1'
};
},
computed
:
{
...
...
@@ -118,8 +119,13 @@ export default {
return
this
.
submitList
.
reduce
((
counter
,
{
disabled
,
quantity
})
=>
!
disabled
?
counter
+=
quantity
:
counter
,
0
)
}
},
created
()
{
this
.
getCategaryList
()
onLoad
(
e
)
{
if
(
e
.
categaryId
)
{
this
.
categoryId
=
e
.
categaryId
this
.
getBrandList
()
}
else
{
this
.
getCategaryList
()
}
},
methods
:
{
// 获取品类
...
...
@@ -127,12 +133,16 @@ export default {
this
.
$u
.
api
.
getCategoryList
().
then
(
res
=>
{
if
(
res
.
code
===
200
)
{
const
data
=
res
.
data
this
.
categary
=
data
.
list
?
data
.
list
.
map
(
v
=>
{
v
.
label
=
v
.
categoryName
return
v
})
:
[]
this
.
categaryId
=
this
.
categary
[
0
].
categoryId
this
.
getBrandList
()
if
(
data
.
length
>
0
)
{
this
.
categary
=
data
.
map
(
v
=>
{
v
.
label
=
v
.
categoryName
return
v
})
this
.
categaryId
=
this
.
categary
[
0
].
categoryId
this
.
getBrandList
()
}
else
{
this
.
getPartsList
()
}
}
})
},
...
...
@@ -141,11 +151,14 @@ export default {
this
.
$u
.
api
.
getBrandList
({
categoryId
:
this
.
categaryId
}).
then
(
res
=>
{
if
(
res
.
code
===
200
)
{
const
data
=
res
.
data
this
.
brand
=
data
.
list
?
data
.
list
.
map
(
v
=>
{
v
.
label
=
v
.
brandName
return
v
})
:
[]
this
.
brandId
=
this
.
brand
[
0
].
brandId
console
.
log
(
"data"
,
data
)
if
(
data
.
length
>
0
)
{
this
.
brand
=
data
.
map
(
v
=>
{
v
.
label
=
v
.
brandName
return
v
})
this
.
brandId
=
this
.
brand
[
0
].
brandId
}
this
.
lists
=
[]
this
.
getPartsList
()
}
...
...
@@ -158,8 +171,8 @@ export default {
const
params
=
{
pageNumber
:
this
.
pageNumber
,
pageSize
:
this
.
pageSize
,
categoryId
:
this
.
categaryId
,
brandId
:
this
.
brandId
,
categoryId
:
this
.
categaryId
||
''
,
brandId
:
this
.
brandId
||
''
,
keyword
:
this
.
keyword
}
this
.
$u
.
api
.
getPartsList
(
params
).
then
(
res
=>
{
...
...
@@ -186,6 +199,7 @@ export default {
searchParts
(
val
)
{
this
.
keyword
=
val
this
.
lists
=
[]
this
.
pageNumber
=
1
this
.
getPartsList
()
},
// 选择品类
...
...
src/store/index.js
View file @
607b5dbf
...
...
@@ -31,7 +31,7 @@ const store = new Vuex.Store({
state
:
{
// 如果上面从本地获取的lifeData对象下有对应的属性,就赋值给state中对应的变量
vuex_user
:
lifeData
.
vuex_user
?
lifeData
.
vuex_user
:
{},
vuex_token
:
lifeData
.
vuex_token
?
lifeData
.
vuex_token
:
''
,
vuex_token
:
'RTOKENe4a0c2fb1f93d97d58147a0d41004b00007b2e1e'
,
//
lifeData.vuex_token ? lifeData.vuex_token : '',
vuex_cache
:
lifeData
.
vuex_cache
?
lifeData
.
vuex_cache
:
{},
vuex_version
:
'1.0.1'
,
vuex_config
:
{},
...
...
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