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
2e13902c
Commit
2e13902c
authored
Jun 24, 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
242f1ebc
9117c30c
Changes
16
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
928 additions
and
369 deletions
+928
-369
index.js
src/common/api/index.js
+3
-0
parts.js
src/common/api/parts.js
+19
-0
iconfont.css
src/common/iconfont.css
+5
-1
adjust.md
src/components/select-parts/adjust.md
+1
-1
adjust.vue
src/components/select-parts/adjust.vue
+1
-2
index.md
src/components/select-parts/index.md
+48
-39
index.vue
src/components/select-parts/index.vue
+2
-8
index.vue
src/components/submit-bar/index.vue
+150
-0
readme.md
src/components/submit-bar/readme.md
+80
-0
w-navbar.vue
src/components/w-navbar/w-navbar.vue
+2
-2
pages.json
src/pages.json
+13
-9
applyParts.vue
src/pages/order/applyParts.vue
+0
-57
detail.vue
src/pages/order/detail.vue
+1
-1
parts.vue
src/pages/order/parts.vue
+25
-82
partsList.vue
src/pages/order/partsList.vue
+237
-167
application.vue
src/pages/parts/application.vue
+341
-0
No files found.
src/common/api/index.js
View file @
2e13902c
...
@@ -8,6 +8,7 @@ import {learnApiFun} from "@/common/api/learn.js";
...
@@ -8,6 +8,7 @@ import {learnApiFun} from "@/common/api/learn.js";
import
{
orderApiFun
}
from
"@/common/api/order.js"
;
import
{
orderApiFun
}
from
"@/common/api/order.js"
;
import
{
assessmentApiFun
}
from
"@/common/api/assessment.js"
import
{
assessmentApiFun
}
from
"@/common/api/assessment.js"
import
{
certApiFun
}
from
"@/common/api/cert.js"
import
{
certApiFun
}
from
"@/common/api/cert.js"
import
{
partsApiFun
}
from
"@/common/api/parts.js"
let
apiFun
=
function
(
vm
)
{
let
apiFun
=
function
(
vm
)
{
let
commonApi
=
commonApiFun
(
vm
);
let
commonApi
=
commonApiFun
(
vm
);
let
settledApi
=
settledApiFun
(
vm
)
let
settledApi
=
settledApiFun
(
vm
)
...
@@ -15,6 +16,7 @@ let apiFun = function(vm) {
...
@@ -15,6 +16,7 @@ let apiFun = function(vm) {
let
assessmentApi
=
assessmentApiFun
(
vm
)
let
assessmentApi
=
assessmentApiFun
(
vm
)
let
orderApi
=
orderApiFun
(
vm
)
let
orderApi
=
orderApiFun
(
vm
)
let
certApi
=
certApiFun
(
vm
)
let
certApi
=
certApiFun
(
vm
)
let
partsApi
=
partsApiFun
(
vm
)
let
apiUrl
=
{
let
apiUrl
=
{
...
commonApi
,
...
commonApi
,
...
settledApi
,
...
settledApi
,
...
@@ -22,6 +24,7 @@ let apiFun = function(vm) {
...
@@ -22,6 +24,7 @@ let apiFun = function(vm) {
...
orderApi
,
...
orderApi
,
...
assessmentApi
,
...
assessmentApi
,
...
certApi
,
...
certApi
,
...
partsApi
,
}
}
return
apiUrl
return
apiUrl
}
}
...
...
src/common/api/parts.js
0 → 100644
View file @
2e13902c
let
partsApiFun
=
function
(
vm
){
// 接口公共前缀
const
prefix
=
'/wxh-worker-rest/rest/'
let
coverage
=
'/wxh-worker-rest/rest/coverage/'
let
parts
=
'/wxh-worker-rest/rest/parts/'
/**
* 配件申请单-查询网点地址信息
*/
let
getSiteAddress
=
async
()
=>
await
vm
.
$u
.
get
(
coverage
+
vm
.
vuex_token
+
'/getSiteAddress'
);
const
partsApi
=
{
getSiteAddress
}
return
partsApi
}
module
.
exports
=
{
partsApiFun
}
\ No newline at end of file
src/common/iconfont.css
View file @
2e13902c
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
font-family
:
"wxh"
;
/* Project id 2600874 */
font-family
:
"wxh"
;
/* Project id 2600874 */
/* Color fonts */
/* Color fonts */
src
:
src
:
url('
data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAAAHYAAwAAAAAA3wAAAGNAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIhgjEgZgADwKYGwBNgIkAwwLCgAEIAWBVAcgG6sCyL5APLajkgSQKlA9xTEuxLtPw+avikE32OCp3+939u3+/1Gp7skkindRuVQ8k0iUaNNpRCLDdLF04f9/532v+ifKCgIKskACGvLAxrTW4SE+1iqP8/+6guhXXAM8hf9vEasvfKVwncDD1TkrNzR1E+lJXq2Jk7a1bQ3roijRNAvX4KcCSyxqd7YWLiJliUdasyQ5XAICJABpCMZgAkDSE0gAP2OGrgmRg5tgCnRTF5lSK4fYlCRE6qmni0ey3kWdd6AOt3OGAD8DWYQiKJCG+oE0jAWEMQIW696D9G/KUxg1AKI02plA7vAtAEFB+v7O7tkkdNLjvbjTF5h7OrYl920W6m8dFljELe5HnXjRVxjkRJ65+0r0u+pq6/XtP1pP8E4/1AFhLCAv7zVIoOnH2TR4MIAZYTWjM0p5KABhHoosGhHQgGmEmthvxABkBq2gMBm5GwxWbNsxY8CkaZsWjFpTTQVVKdtAj149uirJqit35ACW9XfEpDXrZi1bkqVWQeFDBQCPX3IBAA==
')
format
(
'woff2'
);
url('
//at.alicdn.com/t/font_2600874_5qa57hzmhg6.woff2?t=1624432377798
')
format
(
'woff2'
);
}
}
.wxh
{
.wxh
{
...
@@ -13,6 +13,10 @@
...
@@ -13,6 +13,10 @@
-moz-osx-font-smoothing
:
grayscale
;
-moz-osx-font-smoothing
:
grayscale
;
}
}
.wxh-pen
:before
{
content
:
"\e602"
;
}
.wxh-doc
:before
{
.wxh-doc
:before
{
content
:
"\e601"
;
content
:
"\e601"
;
}
}
src/components/select-parts/adjust.md
View file @
2e13902c
## 配件组件使用说明
## 配件
数量调整
组件使用说明
```
```
该组件用于仓库配件的数量调整
该组件用于仓库配件的数量调整
...
...
src/components/select-parts/adjust.vue
View file @
2e13902c
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
{{
info
.
name
}}
{{
info
.
name
}}
</view>
</view>
<view
class=
"num"
>
<view
class=
"num"
>
<u-number-box
v-if=
"!disabled"
v-model=
"info.num"
:min=
"info.min
"
:max=
"info.max
"
@
change=
"numChange"
></u-number-box>
<u-number-box
v-if=
"!disabled"
v-model=
"info.num"
:min=
"info.min
|| 0"
:max=
"info.max || info.num
"
@
change=
"numChange"
></u-number-box>
<text
class=
"nums"
v-else
>
x
{{
info
.
num
||
1
}}
</text>
<text
class=
"nums"
v-else
>
x
{{
info
.
num
||
1
}}
</text>
</view>
</view>
</view>
</view>
...
@@ -43,7 +43,6 @@
...
@@ -43,7 +43,6 @@
</
script
>
</
script
>
<
style
scoped
lang=
"scss"
>
<
style
scoped
lang=
"scss"
>
.parts
{
.parts
{
padding
:
0
20rpx
;
.lists
{
.lists
{
padding
:
10rpx
0
;
padding
:
10rpx
0
;
.name
{
.name
{
...
...
src/components/select-parts/index.md
View file @
2e13902c
## 配件组件使用说明
## 配件
选择
组件使用说明
```
```
该组件用于
仓库配件的选择与
数量调整
该组件用于
备件申请,
数量调整
```
```
## API
## API
...
@@ -11,20 +11,22 @@
...
@@ -11,20 +11,22 @@
| 属性名 | 类型 | 默认值 | 可选值 | 说明 |
| 属性名 | 类型 | 默认值 | 可选值 | 说明 |
| :---------: | :-----: | :----: | :--------: | :---------------------: |
| :---------: | :-----: | :----: | :--------: | :---------------------: |
| showChecked | Boolean | false | true/false | 是否需要复选框 |
| showChecked | Boolean | false | true/false | 是否需要复选框 |
| disabled | Boolean | true | true/false | 是否禁用 |
| info | Object | {} | - | 列表数据
**格式见下文**
|
| info | Object | {} | - | 列表数据
**格式见下文**
|
### lists 格式
### lists 格式
```
json
```
json
{
{
"name"
:
"正泰漏保"
,
//
配件名称
id
:
1
,
"num"
:
1
,
//
配件数量
name
:
"正泰漏保"
,
//
名称
"min"
:
1
,
//
数量最小值
no
:
'NO.
202006170015
'
,
//
编号
"max"
:
100
,
//
数量最大值
desc
:
'这个空开盒子和其他的空开有什么不一样,这里可以写一下'
,
//
描述
"desc"
:
"NO.202006170015"
,
//
描述
num
:
1
,
//
默认数量
"img"
:
"https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/460d46d0-4fcc-11eb-8ff1-d5dcf8779628.png"
,
//
图片地址
min
:
1
,
//
数量最小值
"checked"
:
false
//
勾选状态,如果需要回显勾选状态需传
max
:
100
,
//
数量最大值
img
:
"https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/460d46d0-4fcc-11eb-8ff1-d5dcf8779628.png"
,
//
图片
checked
:
false
,
//
是否勾选
disabled
:
true
//
是否禁用数量调整,如果禁用则会显示添加申请按钮
}
}
```
```
...
@@ -34,6 +36,7 @@
...
@@ -34,6 +36,7 @@
| :-----------: | :----------: | :--------: |
| :-----------: | :----------: | :--------: |
| @numChange | 数量发生改变 | 改变的数量 |
| @numChange | 数量发生改变 | 改变的数量 |
| @selectChange | 勾选发生改变 | 勾选的状态 |
| @selectChange | 勾选发生改变 | 勾选的状态 |
| @apply | 点击添加申请 | 无 |
## 组件用法
## 组件用法
...
@@ -44,9 +47,10 @@
...
@@ -44,9 +47,10 @@
v-for=
"(item, index) in lists"
v-for=
"(item, index) in lists"
:key=
"index"
:key=
"index"
:info=
"item"
:info=
"item"
:show-checked=
"true"
:show-checked=
"false"
@
numChange=
"numChange"
@
numChange=
"numChange($event, index)"
@
selectChange=
"selectChange"
@
selectChange=
"selectChange($event, index)"
@
apply=
"apply(index)"
></select-parts>
></select-parts>
```
```
...
@@ -62,34 +66,39 @@ export default {
...
@@ -62,34 +66,39 @@ export default {
{
{
id
:
1
,
id
:
1
,
name
:
"正泰漏保"
,
name
:
"正泰漏保"
,
desc
:
"NO.202006170015"
,
no
:
'NO.202006170015'
,
desc
:
'这个空开盒子和其他的空开有什么不一样,这里可以写一下'
,
num
:
1
,
num
:
1
,
min
:
1
,
min
:
1
,
max
:
100
,
max
:
100
,
img
:
img
:
"https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/460d46d0-4fcc-11eb-8ff1-d5dcf8779628.png"
,
"https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/460d46d0-4fcc-11eb-8ff1-d5dcf8779628.png"
,
checked
:
false
,
checked
:
false
,
disabled
:
true
},
},
{
{
id
:
2
,
id
:
1
,
name
:
"挚达广汽充电桩"
,
name
:
"挚达广汽充电桩"
,
desc
:
"NO.202006170014"
,
no
:
'NO.202006170014'
,
desc
:
'这个空开盒子和其他的空开有什么不一样,这里可以写一下'
,
num
:
3
,
num
:
3
,
min
:
1
,
min
:
1
,
max
:
5
,
max
:
5
,
img
:
img
:
"https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/460d46d0-4fcc-11eb-8ff1-d5dcf8779628.png"
,
"https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/460d46d0-4fcc-11eb-8ff1-d5dcf8779628.png"
,
checked
:
false
,
checked
:
false
,
disabled
:
true
},
},
],
],
}
}
},
},
methods
:
{
methods
:
{
numChange
(
val
)
{
apply
(
index
)
{
// 添加申请
console
.
log
(
"val"
,
val
)
this
.
$set
(
this
.
lists
[
index
],
'disabled'
,
false
)
},
numChange
(
val
,
index
)
{
// 设置数量
this
.
$set
(
this
.
lists
[
index
],
'num'
,
val
)
},
},
selectChange
(
val
)
{
selectChange
(
val
,
index
)
{
// 设置勾选状态
console
.
log
(
"val"
,
val
)
this
.
$set
(
this
.
lists
[
index
],
'checked'
,
val
)
},
},
},
},
}
}
...
...
src/components/select-parts/index.vue
View file @
2e13902c
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
{{
info
.
no
}}
{{
info
.
no
}}
</view>
</view>
<view
class=
"num"
>
<view
class=
"num"
>
<u-number-box
v-if=
"!info.disabled"
v-model=
"info.num"
:min=
"info.min
"
:max=
"info.max
"
@
change=
"numChange"
></u-number-box>
<u-number-box
v-if=
"!info.disabled"
v-model=
"info.num"
:min=
"info.min
|| 0"
:max=
"info.max || info.num
"
@
change=
"numChange"
></u-number-box>
<u-button
v-if=
"info.disabled"
type=
"primary"
size=
"mini"
shape=
"circle"
@
click=
"addApply"
>
加入申请
</u-button>
<u-button
v-if=
"info.disabled"
type=
"primary"
size=
"mini"
shape=
"circle"
@
click=
"addApply"
>
加入申请
</u-button>
</view>
</view>
</view>
</view>
...
@@ -25,12 +25,7 @@
...
@@ -25,12 +25,7 @@
</
template
>
</
template
>
<
script
>
<
script
>
import
uniListItem
from
"@/components/uni-list-item/uni-list-item.vue"
export
default
{
export
default
{
components
:
{
uniListItem
,
},
props
:
{
props
:
{
info
:
{
info
:
{
info
()
{
info
()
{
...
@@ -40,7 +35,7 @@
...
@@ -40,7 +35,7 @@
showChecked
:
{
// 是否需要勾选
showChecked
:
{
// 是否需要勾选
type
:
Boolean
,
type
:
Boolean
,
default
()
{
default
()
{
return
fals
e
return
tru
e
}
}
},
},
disabled
:
{
// 是否可编辑数量
disabled
:
{
// 是否可编辑数量
...
@@ -55,7 +50,6 @@
...
@@ -55,7 +50,6 @@
}
}
},
},
created
()
{
created
()
{
console
.
log
(
"this.info"
,
this
.
info
)
},
},
methods
:
{
methods
:
{
selectChange
(
event
)
{
selectChange
(
event
)
{
...
...
src/components/submit-bar/index.vue
0 → 100644
View file @
2e13902c
<
template
>
<view
class=
"u-flex bottom"
>
<view
class=
"u-flex bottom-left"
v-if=
"showChecked"
>
<view
class=
"left-list"
><u-checkbox
v-model=
"checked"
@
change=
"selectAll"
shape=
"circle"
width=
"30rpx"
/></view>
<view
class=
"left-list"
>
全选
</view>
</view>
<view
class=
"u-flex bottom-center"
>
<view
class=
"center-list"
>
已选择
{{
partNum
}}
种配件
</view>
<view
class=
"center-list"
>
合计
<text
class=
"num"
>
{{
num
}}
</text>
件
</view>
</view>
<view
class=
"u-flex bottom-right"
>
<button
:class=
"['btn', btnActive]"
@
click=
"submit"
>
{{
submitTxt
}}
</button>
</view>
</view>
</
template
>
<
script
>
export
default
{
props
:
{
showChecked
:
{
// 是否显示勾选
type
:
Boolean
,
default
()
{
return
true
}
},
allChecked
:
{
// 是否全选
type
:
Boolean
,
default
()
{
return
false
}
},
btnStatus
:
{
// 确定按钮是否可点击
type
:
Boolean
,
default
()
{
return
false
}
},
partNum
:
{
// 配件数量
type
:
Number
,
default
()
{
return
0
}
},
num
:
{
// 合计总件数
type
:
Number
,
default
()
{
return
0
}
},
submitTxt
:
{
// 提交按钮文字
type
:
String
,
default
()
{
return
'确定'
}
}
},
data
()
{
return
{
checked
:
false
}
},
computed
:
{
btnActive
()
{
return
this
.
btnStatus
?
'btn-active'
:
''
}
},
watch
:
{
'allChecked'
:
function
(
newValue
,
oldValue
)
{
if
(
this
.
showChecked
)
this
.
checked
=
newValue
}
},
created
()
{
if
(
this
.
showChecked
)
this
.
checked
=
this
.
allChecked
},
methods
:
{
selectAll
(
event
)
{
this
.
$emit
(
'select'
,
event
.
value
)
},
submit
()
{
if
(
this
.
btnStatus
)
this
.
$emit
(
'submit'
)
}
}
}
</
script
>
<
style
scoped
lang=
"scss"
>
.bottom
{
width
:
100%
;
height
:
180rpx
;
background
:
#fff
;
justify-content
:
space-between
;
.u-flex
{
flex-direction
:
column
;
align-items
:
center
;
}
.bottom-left
{
margin-left
:
30rpx
;
.left-list
{
width
:
100%
;
&
:nth-of-type
(
1
)
{
padding-left
:
10rpx
;
}
&
:nth-of-type
(
2
)
{
padding-top
:
20rpx
;
}
}
}
.bottom-center
{
flex
:
1
;
align-items
:
flex-start
;
margin
:
0
20rpx
;
.center-list
{
&
:nth-of-type
(
1
)
{
color
:
#666
;
font-size
:
26rpx
;
}
&
:nth-of-type
(
2
)
{
color
:
#333
;
font-size
:
28rpx
;
margin-top
:
20rpx
;
.num
{
color
:
#2272FF
;
padding
:
0
10rpx
;
}
}
}
}
.bottom-right
{
width
:
340rpx
;
margin-right
:
20rpx
;
.btn
{
width
:
100%
;
padding
:
30rpx
;
border-radius
:
52rpx
;
line-height
:
44rpx
;
font-size
:
32rpx
;
text-align
:
center
;
background
:
#D1D4D4
;
color
:
#fff
;
&
:
:
after
{
content
:
''
;
height
:
0
;
border
:
none
;
}
}
.btn-active
{
background
:
#2272ff
;
}
}
}
</
style
>
src/components/submit-bar/readme.md
0 → 100644
View file @
2e13902c
## 提交工具栏组件使用说明
```
该组件用于勾选配件,显示配件数量以及提交操作
```
## API
### Props
| 属性名 | 类型 | 默认值 | 可选值 | 说明 |
| :------: | :-----: | :----: | :--------: | :-----------------: |
| showChecked | Boolean | true | true/false | 是否显示勾选 |
| allChecked | Boolean | true | true/false | 是否全选 |
| btnStatus | Boolean | true | true/false | 确定按钮是否可点击 |
| btnStatus | Boolean | true | true/false | 确定按钮是否可点击 |
| partNum | Number | 0 | | 配件数量 |
| num | Number | 0 | | 合计总件数 |
| submitTxt | String | 确定 | | 确定按钮文字 |
### Events
| 事件称名 | 说明 | 返回值 |
| :------: | :----------------: | :------: |
| @select | 全选状态改变 | 新的状态 |
| @submit | 点击提交按钮 | |
## 组件用法
### 基础用法
```
html
<submit-bar
:partNum=
"partNum"
:num=
"num"
:btnStatus=
"btnStatus"
:allChecked=
"allChecked"
@
select=
"allSelect"
@
submit=
"submit"
/>
```
```
js
import
submitBar
from
"@/components/submit-bar/index"
export
default
{
components
:
{
submitBar
,
},
data
()
{
return
{
}
},
computed
:
{
// 配件数
partNum
()
{
return
0
},
// 总数
num
()
{
return
0
},
// 按钮状态
btnStatus
()
{
return
false
},
// 全选状态
allChecked
()
{
return
false
}
},
methods
:
{
allSelect
(
value
)
{
console
.
log
(
value
)
},
submit
()
{
console
.
log
(
'submit'
)
}
},
}
```
src/components/w-navbar/w-navbar.vue
View file @
2e13902c
<
template
>
<
template
>
<u-navbar
<u-navbar
:height=
"
40
"
:height=
"
height
"
:background=
"background"
:background=
"background"
:back-icon-color=
"navbarColor"
:back-icon-color=
"navbarColor"
:title=
"title"
:title=
"title"
...
@@ -31,7 +31,7 @@
...
@@ -31,7 +31,7 @@
props
:
{
props
:
{
height
:
{
height
:
{
type
:
String
,
type
:
String
,
default
:
"4
0
"
default
:
"4
4
"
},
},
background
:
{
background
:
{
type
:
Object
,
type
:
Object
,
...
...
src/pages.json
View file @
2e13902c
...
@@ -349,15 +349,6 @@
...
@@ -349,15 +349,6 @@
"disableScroll"
:
true
"disableScroll"
:
true
}
}
},
},
{
"path"
:
"applyParts"
,
"style"
:
{
"navigationBarTitleText"
:
"配件申请"
,
"navigationStyle"
:
"custom"
,
"enablePullDownRefresh"
:
false
,
"disableScroll"
:
true
}
},
{
{
"path"
:
"document-tag"
,
"path"
:
"document-tag"
,
"style"
:
{
"style"
:
{
...
@@ -497,6 +488,19 @@
...
@@ -497,6 +488,19 @@
}
}
}
}
]
]
},
{
"root"
:
"pages/parts"
,
"pages"
:[
{
"path"
:
"application"
,
"style"
:
{
"navigationBarTitleText"
:
"配件申请"
,
"navigationStyle"
:
"custom"
,
"disableScroll"
:
true
}
}
]
}
}
],
],
"preloadRule"
:
{
"preloadRule"
:
{
...
...
src/pages/order/applyParts.vue
deleted
100644 → 0
View file @
242f1ebc
<
template
>
<view
class=
"parts-view"
>
<u-navbar
back-icon-color=
"#333333"
background=
"#FFFFFF"
:title=
"title"
titleColor=
"#333333"
:border-bottom=
"false"
title-bold
></u-navbar>
</view>
</
template
>
<
script
>
export
default
{
data
()
{
return
{
type
:
'parts'
};
},
computed
:
{
title
()
{
return
this
.
titles
[
this
.
types
[
this
.
type
]]
},
titles
()
{
return
[
'配件申请'
,
'备件申请'
]
},
types
()
{
return
{
'parts'
:
0
,
// 配件
'spare'
:
1
// 备件
}
}
},
onLoad
(
e
)
{
if
(
e
&&
e
.
type
)
{
// parts 配件;spare 备件
this
.
type
=
e
.
type
}
},
onShow
()
{
// 从标签列表页面返回,获取选中的标签
let
pages
=
getCurrentPages
();
let
page
=
pages
[
pages
.
length
-
1
];
let
items
=
page
.
items
;
if
(
items
)
{
}
},
methods
:
{
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.parts-view
{
background-color
:
#F4F5F7
;
height
:
100vh
;
display
:
flex
;
flex-direction
:
column
;
}
</
style
>
src/pages/order/detail.vue
View file @
2e13902c
...
@@ -894,7 +894,7 @@
...
@@ -894,7 +894,7 @@
},
},
toApplyParts
()
{
toApplyParts
()
{
uni
.
navigateTo
({
uni
.
navigateTo
({
url
:
'pages/
order/applyParts
?orderId='
+
this
.
order
.
orderId
url
:
'pages/
parts/application
?orderId='
+
this
.
order
.
orderId
})
})
}
}
}
}
...
...
src/pages/order/parts.vue
View file @
2e13902c
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
v-for=
"(item, index) in lists"
v-for=
"(item, index) in lists"
:key=
"index"
:key=
"index"
:info=
"item"
:info=
"item"
:show-checked=
"
fals
e"
:show-checked=
"
tru
e"
@
numChange=
"numChange($event, index)"
@
numChange=
"numChange($event, index)"
@
selectChange=
"selectChange($event, index)"
@
selectChange=
"selectChange($event, index)"
@
apply=
"apply(index)"
@
apply=
"apply(index)"
...
@@ -15,31 +15,29 @@
...
@@ -15,31 +15,29 @@
<view
v-else
class=
"empty"
>
暂无可用备件
</view>
<view
v-else
class=
"empty"
>
暂无可用备件
</view>
</view>
</view>
<view
class=
"u-flex bottom"
>
<view
class=
"bar"
>
<view
class=
"u-flex bottom-left"
>
<submit-bar
<view
class=
"left-list"
><u-checkbox
v-model=
"allChecked"
@
change=
"allSelect"
shape=
"circle"
width=
"30rpx"
/></view>
:partNum=
"partNum"
<view
class=
"left-list"
>
全选
</view>
:num=
"num"
</view>
:btnStatus=
"btnStatus"
<view
class=
"u-flex bottom-center"
>
:allChecked=
"allChecked"
<view
class=
"center-list"
>
已选择
{{
partNum
}}
种配件
</view>
@
select=
"allSelect"
<view
class=
"center-list"
>
合计
<text
class=
"num"
>
{{
num
}}
</text>
件
</view>
@
submit=
"submit"
</view>
/>
<view
class=
"u-flex bottom-right"
>
<button
:class=
"['btn', btnStatus]"
@
click=
"submit"
>
确定
</button>
</view>
</view>
</view>
</view>
</view>
</
template
>
</
template
>
<
script
>
<
script
>
import
selectParts
from
"@/components/select-parts/index"
import
selectParts
from
"@/components/select-parts/index"
import
submitBar
from
"@/components/submit-bar/index"
export
default
{
export
default
{
components
:
{
components
:
{
selectParts
selectParts
,
submitBar
},
},
data
()
{
data
()
{
return
{
return
{
allChecked
:
false
,
lists
:
[
lists
:
[
{
{
id
:
1
,
id
:
1
,
...
@@ -82,15 +80,23 @@
...
@@ -82,15 +80,23 @@
}
}
},
},
computed
:
{
computed
:
{
// 配件数
partNum
()
{
partNum
()
{
return
this
.
lists
.
reduce
((
counter
,
{
checked
})
=>
checked
?
counter
+=
1
:
counter
,
0
)
return
this
.
lists
.
reduce
((
counter
,
{
checked
})
=>
checked
?
counter
+=
1
:
counter
,
0
)
},
},
// 总数
num
()
{
num
()
{
return
this
.
lists
.
reduce
((
counter
,
{
checked
,
num
})
=>
checked
?
counter
+=
num
:
counter
,
0
)
return
this
.
lists
.
reduce
((
counter
,
{
checked
,
num
})
=>
checked
?
counter
+=
num
:
counter
,
0
)
},
},
// 按钮状态
btnStatus
()
{
btnStatus
()
{
const
count
=
this
.
lists
.
reduce
((
counter
,
{
checked
})
=>
checked
?
counter
+=
1
:
counter
,
0
)
const
count
=
this
.
lists
.
reduce
((
counter
,
{
checked
})
=>
checked
?
counter
+=
1
:
counter
,
0
)
return
count
===
0
?
'btn-disabled'
:
''
return
count
>
0
||
false
},
// 全选状态
allChecked
()
{
const
count
=
this
.
lists
.
reduce
((
counter
,
{
checked
})
=>
!
checked
?
counter
+=
1
:
counter
,
0
)
return
count
===
0
||
false
}
}
},
},
methods
:
{
methods
:
{
...
@@ -102,17 +108,15 @@
...
@@ -102,17 +108,15 @@
},
},
selectChange
(
val
,
index
)
{
selectChange
(
val
,
index
)
{
this
.
$set
(
this
.
lists
[
index
],
'checked'
,
val
)
this
.
$set
(
this
.
lists
[
index
],
'checked'
,
val
)
const
count
=
this
.
lists
.
filter
(
v
=>
!
v
.
checked
).
length
this
.
allChecked
=
count
===
0
||
false
},
},
allSelect
()
{
allSelect
(
value
)
{
const
count
=
this
.
lists
.
filter
(
v
=>
!
v
.
checked
).
length
const
count
=
this
.
lists
.
filter
(
v
=>
!
v
.
checked
).
length
this
.
lists
.
forEach
(
v
=>
{
this
.
lists
.
forEach
(
v
=>
{
this
.
$set
(
v
,
'checked'
,
count
!==
0
||
false
)
this
.
$set
(
v
,
'checked'
,
count
!==
0
||
false
)
})
})
},
},
submit
()
{
submit
()
{
console
.
log
(
"this.val"
,
this
.
val
)
console
.
log
(
'submit'
)
}
}
}
}
}
}
...
@@ -135,69 +139,8 @@
...
@@ -135,69 +139,8 @@
flex
:
1
;
flex
:
1
;
overflow-y
:
auto
;
overflow-y
:
auto
;
}
}
.bar
{
.bottom
{
width
:
100%
;
width
:
100%
;
padding
:
0
40rpx
;
font-size
:
28rpx
;
height
:
180rpx
;
.u-flex
{
flex-direction
:
column
;
align-items
:
center
;
}
.bottom-left
{
margin-right
:
10rpx
;
.left-list
{
width
:
100%
;
&
:nth-of-type
(
1
)
{
padding-left
:
10rpx
;
}
&
:nth-of-type
(
2
)
{
padding-top
:
20rpx
;
}
}
}
.bottom-center
{
flex
:
1
;
margin-right
:
20rpx
;
.center-list
{
margin-right
:
auto
;
&
:nth-of-type
(
1
)
{
color
:
#666
;
font-size
:
26rpx
;
}
&
:nth-of-type
(
2
)
{
color
:
#333
;
font-size
:
28rpx
;
margin-top
:
20rpx
;
.num
{
color
:
#2272FF
;
padding
:
0
10rpx
;
}
}
}
}
.bottom-right
{
width
:
340rpx
;
.btn
{
width
:
100%
;
padding
:
30rpx
;
border-radius
:
52rpx
;
line-height
:
44rpx
;
font-size
:
32rpx
;
text-align
:
center
;
background-color
:
#2272ff
;
color
:
#fff
;
&
:
:
after
{
content
:
''
;
height
:
0
;
border
:
none
;
}
}
.btn-disabled
{
background
:
#D1D4D4
;
}
}
}
}
}
}
</
style
>
</
style
>
src/pages/order/partsList.vue
View file @
2e13902c
This diff is collapsed.
Click to expand it.
src/pages/parts/application.vue
0 → 100644
View file @
2e13902c
<
template
>
<view
class=
"app-wrap"
>
<w-navbar
title=
"配件申请"
navbar-color=
"#FFFFFF"
/>
<view
class=
"content"
>
<view
class=
"card parts"
>
<view
class=
"title"
v-if=
"isEmptyParts"
>
配件信息
</view>
<view
class=
"u-flex u-row-between title"
v-else
>
<view>
选择配件
</view>
<u-icon
name=
"arrow-right"
size=
"24"
color=
"#2272FF"
@
click=
"$u.throttle(addParts, 500)"
label=
"添加配件"
label-pos=
"left"
label-color=
"#2272FF"
label-size=
"26"
/>
</view>
<view
class=
"body"
>
<view
v-if=
"isEmptyParts"
class=
"u-flex-col u-col-center list"
>
<view
class=
"sold-out"
>
<u-image
:src=
"qnFile('SoldOut.png')"
width=
"374"
mode=
"widthFix"
>
<view
slot=
"error"
style=
"font-size: 24rpx;"
>
加载失败
</view>
</u-image>
</view>
<view
class=
"message"
>
当前还未选择配件,请点击添加
</view>
<button
class=
"add-button"
plain=
"true"
@
click=
"$u.throttle(addParts, 500)"
>
去添加
</button>
</view>
<view
v-else
class=
"list"
>
<view
v-for=
"(row, index) in parts"
:key=
"index"
>
<select-parts
:info=
"row"
></select-parts>
</view>
</view>
<u-gap
height=
"40"
></u-gap>
<u-input
type=
"textarea"
v-model=
"remark"
placeholder=
"请补充详细说明"
class=
"desc"
height=
"200"
:border=
"true"
/>
</view>
</view>
<view
class=
"card address"
>
<view
class=
"title"
>
收件信息
</view>
<view
class=
"subsection u-flex u-row-center"
>
<u-subsection
:list=
"siteTypes"
:current=
"curType"
:bold=
"false"
font-size=
"26"
height=
"76"
active-color=
"#FFFFFF"
inactive-color=
"#333333"
bg-color=
"#FFFFFF"
button-color=
"#2272FF"
@
change=
"typeChange"
></u-subsection>
</view>
<view
class=
"body"
>
<view
class=
"item"
@
click=
"$u.throttle(editSite, 500)"
>
<view
class=
"userinfo u-flex"
>
<view
class=
"name"
>
{{
formatName
}}
</view>
<view
class=
"mobile"
>
{{
formatMobile
}}
</view>
</view>
<view
class=
"rangeinfo u-flex u-row-between u-col-top"
>
<view
class=
"txt"
>
{{
formatAddress
}}
</view>
<u-icon
custom-prefix=
"wxh"
name=
"pen"
size=
"32"
></u-icon>
</view>
</view>
</view>
</view>
</view>
<view
class=
"bottom"
>
<u-button
shape=
"circle"
:disabled=
"disabled"
:hair-line=
"false"
:custom-style=
"customStyle"
hover-class=
"none"
>
提交
</u-button>
</view>
</view>
</
template
>
<
script
>
import
SelectParts
from
'@/components/select-parts/adjust.vue'
export
default
{
components
:
{
SelectParts
},
data
()
{
return
{
orderId
:
0
,
order
:
{},
parts
:
[],
disabled
:
false
,
remark
:
''
,
siteTypes
:
[{
name
:
'我的地址'
},
{
name
:
'客户地址'
}],
curType
:
0
,
mine
:
{},
customer
:
{},
};
},
computed
:
{
isEmptyParts
()
{
return
this
.
$u
.
test
.
isEmpty
(
this
.
parts
)
},
customStyle
()
{
return
{
height
:
"104rpx"
,
border
:
"none"
,
backgroundColor
:
"#2272FF"
,
color
:
"#FFFFFF"
,
fontSize
:
"32rpx"
,
fontWeight
:
600
,
}
},
formatName
()
{
let
name
=
''
if
(
this
.
curType
)
{
name
=
this
.
customer
&&
this
.
customer
.
name
}
else
{
name
=
this
.
mine
&&
this
.
mine
.
name
}
if
(
this
.
$u
.
test
.
isEmpty
(
name
))
{
return
'--'
}
return
name
},
formatMobile
()
{
let
mobile
=
''
if
(
this
.
curType
)
{
mobile
=
this
.
customer
&&
this
.
customer
.
mobile
}
else
{
mobile
=
this
.
mine
&&
this
.
mine
.
mobile
}
if
(
this
.
$u
.
test
.
isEmpty
(
mobile
))
{
return
'--'
}
if
(
mobile
.
length
==
11
)
{
let
tmps
=
[]
tmps
[
0
]
=
mobile
.
slice
(
0
,
3
)
tmps
[
1
]
=
mobile
.
slice
(
3
,
7
)
tmps
[
2
]
=
mobile
.
slice
(
7
)
return
tmps
.
join
(
" "
)
}
else
{
return
mobile
}
},
formatAddress
()
{
let
address
=
''
if
(
this
.
curType
)
{
address
=
this
.
customer
&&
this
.
customer
.
address
}
else
{
address
=
this
.
mine
&&
this
.
mine
.
address
}
if
(
this
.
$u
.
test
.
isEmpty
(
address
))
{
return
'--'
}
return
address
},
},
onLoad
(
e
)
{
this
.
orderId
=
e
&&
Number
(
e
.
orderId
)
||
0
this
.
initData
()
},
methods
:
{
initData
()
{
this
.
loadMineAddress
()
this
.
loadOrderInfo
()
},
loadMineAddress
()
{
this
.
mine
=
{
name
:
'王先生'
,
mobile
:
'13045861456'
,
address
:
'宝城67区留芳路6号庭威产业园3栋10C'
,
range
:
[
'广东省'
,
'深圳市'
,
'宝安区'
],
code
:
[
'44'
,
'4403'
,
'440306'
],
}
this
.
$u
.
api
.
getSiteAddress
().
then
((
res
)
=>
{
if
(
res
.
code
==
200
&&
res
.
data
)
{
let
name
=
this
.
vuex_settled
&&
this
.
vuex_settled
.
record
&&
(
this
.
vuex_settled
.
record
.
id_card_name
||
this
.
vuex_settled
.
record
.
nickname
)
let
mobile
=
this
.
vuex_settled
&&
this
.
vuex_settled
.
record
&&
this
.
vuex_settled
.
record
.
mobile
this
.
mine
=
{
name
:
name
,
mobile
:
mobile
,
address
:
res
.
data
.
address
,
range
:
[
res
.
data
.
provinceName
,
res
.
data
.
cityName
,
res
.
data
.
districtName
,
res
.
data
.
streetName
],
}
}
})
},
loadOrderInfo
()
{
this
.
$u
.
api
.
orderDetail
({},
this
.
orderId
).
then
((
res
)
=>
{
if
(
res
.
code
==
200
)
{
this
.
order
=
res
.
data
this
.
initCustomer
()
}
else
{
console
.
log
(
res
.
message
,
"获取订单详情失败!"
);
}
});
},
initCustomer
()
{
if
(
this
.
$u
.
test
.
isEmpty
(
this
.
order
))
{
this
.
customer
=
{}
}
else
{
console
.
log
(
"order"
,
this
.
order
)
const
range
=
[
this
.
order
.
contactProvinceText
,
this
.
order
.
contactCityText
,
this
.
order
.
contactCommunityText
,
this
.
order
.
contactStreetText
,
]
this
.
customer
=
{
name
:
this
.
order
.
contactName
,
mobile
:
this
.
order
.
contactPhone
,
address
:
range
.
join
(
""
)
+
this
.
order
.
contactAddress
,
range
:
range
,
code
:
[
this
.
order
.
contactProvince
,
this
.
order
.
contactCity
,
this
.
order
.
contactCommunity
,
this
.
order
.
contactStreet
,
]
}
}
},
loadParts
()
{
this
.
parts
=
[
{
name
:
'正泰漏保'
,
num
:
2
},
{
name
:
'电缆VJV3*10'
,
num
:
1
},
{
name
:
'挚达系统广汽充电桩'
,
num
:
0
},
{
name
:
'空开盒子'
,
num
:
100
}
]
},
qnFile
(
src
)
{
return
process
.
uniEnv
.
qn_base_url
+
src
},
typeChange
(
index
)
{
this
.
curType
=
index
},
editSite
()
{
this
.
$u
.
route
({
url
:
"pages/mine/address/addSite"
})
},
addParts
()
{
this
.
$u
.
route
({
url
:
"pages/parts/addParts"
})
},
}
};
</
script
>
<
style
lang=
"scss"
scoped
>
.app-wrap
{
width
:
750rpx
;
height
:
100vh
;
overflow
:
auto
;
background-color
:
#f4f5f7
;
background-image
:
linear-gradient
(
to
top
,
#f4f5f7
0%
,
#2272ff
50%
);
background-size
:
750rpx
600rpx
;
background-repeat
:
no-repeat
;
display
:
flex
;
flex-direction
:
column
;
.content
{
margin-bottom
:
240rpx
;
.card
{
margin
:
20rpx
30rpx
;
padding
:
30rpx
;
padding-top
:
0
;
border-radius
:
12rpx
;
background-color
:
#FFFFFF
;
.title
{
line-height
:
106rpx
;
font-size
:
32rpx
;
font-weight
:
bold
;
color
:
#333333
;
}
.body
{
.list
{
.sold-out
{
margin-top
:
20rpx
;
}
.message
{
font-size
:
26rpx
;
font-weight
:
400
;
color
:
#999999
;
line-height
:
26rpx
;
}
.add-button
{
margin
:
42rpx
0
20rpx
0
;
width
:
200rpx
;
height
:
80rpx
;
border-radius
:
52rpx
;
border
:
2rpx
solid
#2272FF
;
font-size
:
32rpx
;
font-weight
:
500
;
color
:
#2272FF
;
line-height
:
80rpx
;
}
}
.desc
{
height
:
200rpx
;
}
}
}
.parts
{
}
.address
{
.subsection
{
padding-top
:
-6rpx
;
padding-bottom
:
34rpx
;
border-bottom
:
2rpx
solid
#F4F5F7
;
/
deep
/
.u-subsection
{
width
:
372rpx
;
.u-item-bg
{
border-radius
:
32rpx
!
important
;
}
}
}
.body
{
.item
{
padding
:
10rpx
0
52rpx
0
;
.userinfo
{
.name
{
height
:
92rpx
;
font-size
:
32rpx
;
font-weight
:
bold
;
color
:
#333333
;
line-height
:
92rpx
;
}
.mobile
{
margin-left
:
20rpx
;
height
:
92rpx
;
font-size
:
28rpx
;
font-weight
:
400
;
color
:
#666666
;
line-height
:
92rpx
;
}
}
.rangeinfo
{
.txt
{
width
:
500rpx
;
font-size
:
28rpx
;
font-weight
:
400
;
color
:
#333333
;
line-height
:
34rpx
;
word-wrap
:
break-word
;
}
}
}
}
}
}
.bottom
{
position
:
absolute
;
left
:
76rpx
;
right
:
76rpx
;
bottom
:
68rpx
;
}
}
</
style
>
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