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
605ed088
Commit
605ed088
authored
Jun 25, 2021
by
Damon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 备件API
parent
11cf6ca3
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
88 additions
and
36 deletions
+88
-36
parts.js
src/common/api/parts.js
+6
-1
XhParts.vue
src/components/createCom/XhParts.vue
+68
-28
adjust.vue
src/components/select-parts/adjust.vue
+1
-1
complete.vue
src/pages/order/complete.vue
+11
-6
parts.vue
src/pages/order/parts.vue
+2
-0
No files found.
src/common/api/parts.js
View file @
605ed088
...
...
@@ -34,6 +34,10 @@ let partsApiFun = function (vm) {
* 查询自己的备件仓
*/
let
getMyReserve
=
async
(
params
=
{})
=>
await
vm
.
$u
.
get
(
parts
+
vm
.
vuex_token
+
'/items/reserve'
,
params
);
/**
* 查询工单的配件明细
*/
let
getWorkOrderParts
=
async
(
params
=
{})
=>
await
vm
.
$u
.
get
(
parts
+
vm
.
vuex_token
+
'/items/workOrder/'
,
params
);
const
partsApi
=
{
getSiteAddress
,
...
...
@@ -42,7 +46,8 @@ let partsApiFun = function (vm) {
getBrandList
,
getPartsList
,
applyParts
,
getMyReserve
getMyReserve
,
getWorkOrderParts
}
return
partsApi
}
...
...
src/components/createCom/XhParts.vue
View file @
605ed088
<!-- ******************* 配件选择 ******************* -->
<
template
>
<view>
<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>
</view>
<view
class=
"complete-part"
>
<view
v-if=
"status === 1"
>
<adjust-parts
v-for=
"(item, index) in lists"
:key=
"index"
:info=
"item"
@
change=
"partsChange($event, index)"
:disabled=
"disabled"
></adjust-parts>
...
...
@@ -13,12 +21,13 @@
<text
class=
"desc"
>
可选择备件仓配件
</text>
</view>
<view
class=
"btn"
>
<u-button
shape=
"circle"
:custom-style=
"customStyle
"
>
<u-button
shape=
"circle"
:custom-style=
"customStyle"
@
click=
"toParts
"
>
去选择
</u-button>
</view>
</view>
</view>
</view>
</
template
>
<
script
>
...
...
@@ -31,9 +40,9 @@
},
mixins
:
[
arrMixin
],
props
:
{
status
:
{
type
:
Number
,
default
:
1
orderId
:
{
type
:
String
,
default
:
''
}
},
data
()
{
...
...
@@ -42,18 +51,19 @@
{
id
:
1
,
name
:
"正泰漏保"
,
num
:
1
,
quantity
:
1
,
min
:
1
,
max
:
100
,
},
{
id
:
1
,
name
:
"挚达广汽充电桩"
,
num
:
3
,
quantity
:
3
,
min
:
1
,
max
:
5
,
},
]
],
status
:
1
}
},
computed
:
{
...
...
@@ -64,31 +74,62 @@
'color'
:
'#2272FF'
,
'font-size'
:
'32rpx'
,
}
},
mixingImage
()
{
return
process
.
uniEnv
.
qn_base_url
+
'mixing.png'
}
},
created
()
{
this
.
getWorkOrderParts
()
},
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
||
[]
}
})
},
partsChange
(
val
,
index
)
{
console
.
log
(
"val"
,
val
,
index
)
this
.
$set
(
this
.
lists
[
index
],
'quantity'
,
val
)
},
toParts
()
{
//
uni.navigateTo({
// url: '/pages/
'
//
})
uni
.
navigateTo
({
url
:
'/pages/order/parts
'
})
},
toHandle
(
)
{
handle
(
val
)
{
console
.
log
(
"val"
,
val
)
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.required
{
padding-right
:
10rpx
;
font-size
:
28rpx
;
line-height
:
40rpx
;
color
:
#fa3534
;
}
.add-parts
{
color
:
#2272FF
;
text-align
:
right
;
}
.complete-part
{
.select-part
{
align-items
:
center
;
height
:
240rpx
;
.img
{
margin-right
:
20rpx
;
display
:
flex
;
align-items
:
center
;
margin-right
:
30rpx
;
.part-icon
{
width
:
110rpx
;
height
:
110rpx
;
...
...
@@ -113,7 +154,6 @@
text-align
:
left
;
color
:
#999
;
font-size
:
26rpx
;
margin-top
:
20rpx
;
margin-right
:
auto
;
}
}
...
...
src/components/select-parts/adjust.vue
View file @
605ed088
...
...
@@ -6,7 +6,7 @@
</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>
<text
class=
"nums"
v-else
>
x
{{
info
.
num
||
1
}}
</text>
<text
class=
"nums"
v-else
>
x
{{
info
.
quantity
||
1
}}
</text>
</view>
</view>
</view>
...
...
src/pages/order/complete.vue
View file @
605ed088
...
...
@@ -13,7 +13,7 @@
<view
class=
"class-bd"
>
<u-form-item
v-for=
"(item,itemIndex) in groupItem.items"
:key=
"itemIndex"
label-position=
"top"
:prop=
"item.fieldsName"
:border-bottom=
"false"
v-show=
"item.fieldsName != 'actualPaid' || show200"
:id=
"`item$
{item.fieldsId}`">
<view
class=
"label"
v-if=
"
item.formType!=='location'&&item.formType!=='form'&&item.formType!=='label'
"
>
<view
class=
"label"
v-if=
"
!hiddenTitle.includes(item.formType)
"
>
<image
class=
"item-image"
:src=
"mixingImage"
v-if=
"item.required"
></image>
{{
item
.
fieldsTitle
}}
</view>
...
...
@@ -49,10 +49,10 @@
</xh-files>
</view>
<xh-location
v-else-if=
"item.formType==='location'"
<
!-- <
xh-location v-else-if="item.formType==='location'"
:groupIndex="groupIndex" :itemIndex="itemIndex" :item="item" :value='form[item.fieldsName] || ""'
@value-change="fieldValueChange">
</xh-location>
</xh-location>
-->
<xh-scan
v-else-if=
"item.formType==='scan'"
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
:value=
'form[item.fieldsName] || ""'
@
value-change=
"fieldValueChange"
>
...
...
@@ -70,9 +70,10 @@
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
:order-id=
"orderId"
:value=
'form[item.fieldsName] || ""'
@
value-change=
"fieldValueChange"
>
</xh-service-more>
<xh-label
v-else-if=
"item.formType==='label'"
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
:value=
'form[item.fieldsName] || ""'
>
<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==='location'"
:order-id=
"orderId"
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
:value=
'form[item.fieldsName] || ""'
>
</xh-parts>
</template>
</u-form-item>
</view>
...
...
@@ -110,6 +111,7 @@
import
XhServiceMeasure
from
'@/components/createCom/XhServiceMeasure.vue'
import
XhServiceMore
from
"@/components/createCom/XhServiceMore"
import
XhLabel
from
"@/components/createCom/XhLabel"
import
XhParts
from
"@/components/createCom/XhParts"
import
takePhoto
from
'@/components/take/index.vue'
import
baseFile
from
'@/components/upload/index'
...
...
@@ -139,6 +141,7 @@
[
'date'
,
[
'time'
,
'text'
]],
[
'form'
,
[
'form'
,
'text'
]],
[
'label'
,
[
'label'
,
'text'
]],
[
'parts'
,
[
'parts'
,
'text'
]],
])
/**
...
...
@@ -209,6 +212,7 @@
export
default
{
data
()
{
return
{
hiddenTitle
:
[
'location'
,
'form'
,
'label'
,
'parts'
],
orderId
:
0
,
categoryId
:
0
,
orderServiceType
:
''
,
...
...
@@ -273,7 +277,8 @@
XhServiceMeasure
,
XhServiceMore
,
XhLabel
,
'take-photo'
:
takePhoto
XhParts
,
takePhoto
},
mixins
:
[
baseFile
],
created
()
{
...
...
src/pages/order/parts.vue
View file @
605ed088
...
...
@@ -103,6 +103,8 @@
quantity
:
v
.
quantity
}
})
prevPage
.
$vm
.
handle
(
lists
)
this
.
$u
.
route
({
type
:
'back'
})
console
.
log
(
lists
)
},
qnFile
(
src
)
{
...
...
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