Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
梁建民
/
scm_app
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
f6aeb97e
authored
May 29, 2026
by
liangjianmin
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
feat(logistics): 优化订单号输入事件以获取客户名称
根据输入的订单号请求客户名称,添加防抖处理,避免频繁请求。 如果订单号为空,则清空客户名称。请求失败时显示提示信息。
parent
e3b7f6c3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
9 deletions
pages/logistics/index.vue
pages/logistics/index.vue
View file @
f6aeb97e
...
@@ -66,6 +66,9 @@
...
@@ -66,6 +66,9 @@
</
template
>
</
template
>
<
script
>
<
script
>
import
{
API
}
from
'@/util/api.js'
;
import
debounce
from
'lodash/debounce'
;
export
default
{
export
default
{
data
()
{
data
()
{
return
{
return
{
...
@@ -90,11 +93,7 @@
...
@@ -90,11 +93,7 @@
{
name
:
'货拉拉'
,
value
:
'huolala'
},
{
name
:
'货拉拉'
,
value
:
'huolala'
},
{
name
:
'公司车辆'
,
value
:
'company'
},
{
name
:
'公司车辆'
,
value
:
'company'
},
{
name
:
'其它'
,
value
:
'other'
}
{
name
:
'其它'
,
value
:
'other'
}
],
]
orderCustomerMap
:
{
SO20260529001
:
'广州宜春供应链有限公司'
,
SO20260529002
:
'深圳华南电子商务有限公司'
}
};
};
},
},
methods
:
{
methods
:
{
...
@@ -139,13 +138,29 @@
...
@@ -139,13 +138,29 @@
},
},
/**
/**
*
根据写死订单号展示
客户名称
*
订单号输入事件,防抖获取
客户名称
* @return {void}
* @return {void}
*/
*/
handleOrderNoInput
()
{
handleOrderNoInput
:
debounce
(
function
()
{
var
orderSn
=
this
.
form
.
order_sn
.
trim
();
var
orderSn
=
this
.
form
.
order_sn
.
trim
();
this
.
form
.
customer_name
=
this
.
orderCustomerMap
[
orderSn
]
||
''
;
},
if
(
!
orderSn
)
{
this
.
form
.
customer_name
=
''
;
return
;
}
this
.
request
(
API
.
getCustomerName
,
'GET'
,
{
order_sn
:
orderSn
},
true
).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
this
.
form
.
customer_name
=
res
.
data
;
}
else
{
this
.
form
.
customer_name
=
''
;
uni
.
showToast
({
title
:
res
.
msg
||
'获取客户名称失败'
,
icon
:
'none'
});
}
});
},
500
),
/**
/**
* 展示省市暂未接入提示
* 展示省市暂未接入提示
...
...
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