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
d3d0d469
Commit
d3d0d469
authored
Jun 25, 2021
by
Morson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(parts):补充申请配件校验规则
parent
19fcf432
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
11 deletions
+27
-11
parts.js
src/common/api/parts.js
+2
-1
application.vue
src/pages/parts/application.vue
+25
-10
No files found.
src/common/api/parts.js
View file @
d3d0d469
...
@@ -5,6 +5,7 @@ let partsApiFun = function (vm) {
...
@@ -5,6 +5,7 @@ let partsApiFun = function (vm) {
const
parts
=
'/wxh-worker-rest/rest/parts/'
const
parts
=
'/wxh-worker-rest/rest/parts/'
const
base
=
'/wxh-worker-rest/rest/base/'
const
base
=
'/wxh-worker-rest/rest/base/'
const
formType
=
{
'content-type'
:
'application/x-www-form-urlencoded'
}
const
formType
=
{
'content-type'
:
'application/x-www-form-urlencoded'
}
const
formData
=
{
'content-type'
:
'multipart/form-data'
}
/**
/**
* 配件申请单-查询网点地址信息
* 配件申请单-查询网点地址信息
...
@@ -29,7 +30,7 @@ let partsApiFun = function (vm) {
...
@@ -29,7 +30,7 @@ let partsApiFun = function (vm) {
/**
/**
* 配件申请单-创建申请单/使用备件
* 配件申请单-创建申请单/使用备件
*/
*/
let
applyParts
=
async
(
params
=
{})
=>
await
vm
.
$u
.
post
(
parts
+
vm
.
vuex_token
+
'/orders'
,
params
)
let
applyParts
=
async
(
params
=
{})
=>
await
vm
.
$u
.
post
(
parts
+
vm
.
vuex_token
+
'/orders'
,
params
,
formData
)
/**
/**
* 查询自己的备件仓
* 查询自己的备件仓
...
...
src/pages/parts/application.vue
View file @
d3d0d469
...
@@ -104,10 +104,10 @@ export default {
...
@@ -104,10 +104,10 @@ export default {
this
.
loadMineAddress
()
this
.
loadMineAddress
()
this
.
loadOrderInfo
()
this
.
loadOrderInfo
()
this
.
parts
=
[
this
.
parts
=
[
{
name
:
'正泰漏保'
,
num
:
2
},
{
part_id
:
15866
,
name
:
'挚达-沃尔沃-充电桩'
,
quantity
:
2
},
{
name
:
'电缆VJV3*10'
,
num
:
1
},
{
part_id
:
15867
,
name
:
'直达充电桩'
,
quantity
:
1
},
{
name
:
'挚达系统广汽充电桩'
,
num
:
0
},
{
part_id
:
15868
,
name
:
'郭小清-物料配件'
,
quantity
:
0
},
{
name
:
'空开盒子'
,
num
:
100
}
{
part_id
:
2010
,
name
:
'通用品牌配件测试'
,
quantity
:
100
}
]
]
},
},
loadMineAddress
()
{
loadMineAddress
()
{
...
@@ -138,6 +138,7 @@ export default {
...
@@ -138,6 +138,7 @@ export default {
}
else
{
}
else
{
this
.
mine
.
name
=
this
.
order
.
maintainWorkerName
this
.
mine
.
name
=
this
.
order
.
maintainWorkerName
this
.
mine
.
mobile
=
this
.
order
.
maintainWorkerPhone
this
.
mine
.
mobile
=
this
.
order
.
maintainWorkerPhone
// this.applyType = this.order.inGuaranteePeriod == 'Y' ||
this
.
customer
=
{
this
.
customer
=
{
name
:
this
.
order
.
contactName
,
name
:
this
.
order
.
contactName
,
mobile
:
this
.
order
.
contactPhone
,
mobile
:
this
.
order
.
contactPhone
,
...
@@ -187,6 +188,21 @@ export default {
...
@@ -187,6 +188,21 @@ export default {
this
.
parts
=
parts
this
.
parts
=
parts
}
}
},
},
validateForm
()
{
if
(
this
.
applyType
==
0
&&
this
.
$u
.
test
.
isEmpty
(
this
.
orderId
))
{
this
.
$u
.
toast
(
'保内申请时必须指定工单ID'
)
return
false
}
if
(
this
.
applyType
!=
0
&&
this
.
$u
.
test
.
isEmpty
(
this
.
applyType
))
{
this
.
$u
.
toast
(
'申请类型不能为空'
)
return
false
}
if
(
this
.
isEmptyParts
&&
this
.
$u
.
test
.
isEmpty
(
this
.
remark
))
{
this
.
$u
.
toast
(
'配件明细和备注不能同时为空'
)
return
false
}
return
true
},
/**
/**
* workOrderId 工单ID,保内申请时必须指定
* workOrderId 工单ID,保内申请时必须指定
* applyType 申请类型:0 保内,1 备件,2 购买,10 使用备件
* applyType 申请类型:0 保内,1 备件,2 购买,10 使用备件
...
@@ -206,14 +222,15 @@ export default {
...
@@ -206,14 +222,15 @@ export default {
* images 申请图片文件、可以传多张
* images 申请图片文件、可以传多张
*/
*/
submitParts
()
{
submitParts
()
{
if
(
!
this
.
validateForm
())
{
return
false
}
const
address
=
this
.
addressInfo
const
address
=
this
.
addressInfo
let
params
=
{
let
params
=
{
workOrderId
:
this
.
orderId
,
workOrderId
:
this
.
orderId
,
applyType
:
this
.
applyType
,
applyType
:
this
.
applyType
,
remark
:
this
.
remark
,
remark
:
this
.
remark
,
parts
:
JSON
.
stringty
(
parts
),
parts
:
JSON
.
stringify
(
this
.
parts
),
barcode
:
this
.
order
.
barcode
,
measures
:
this
.
order
.
measures
,
name
:
address
.
name
,
name
:
address
.
name
,
phoneNumber
:
address
.
mobile
,
phoneNumber
:
address
.
mobile
,
province
:
address
.
region
[
0
],
province
:
address
.
region
[
0
],
...
@@ -224,15 +241,13 @@ export default {
...
@@ -224,15 +241,13 @@ export default {
this
.
$u
.
api
.
applyParts
(
params
).
then
((
res
)
=>
{
this
.
$u
.
api
.
applyParts
(
params
).
then
((
res
)
=>
{
if
(
res
.
code
==
200
)
{
if
(
res
.
code
==
200
)
{
this
.
$u
.
route
({
this
.
$u
.
route
({
type
:
'redirect'
,
url
:
"pages/parts/nodes"
url
:
"pages/parts/nodes"
})
})
}
else
{
}
else
{
console
.
log
(
res
.
message
,
"配件申请失败!"
);
console
.
log
(
res
.
message
,
"配件申请失败!"
);
}
}
});
});
this
.
$u
.
route
({
url
:
"pages/parts/nodes"
})
}
}
}
}
};
};
...
...
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