Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
sales-assistant
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 2111a3e7
authored
Nov 03, 2025
by
张立顺
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix 功能回显统一
1 parent
7231537c
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
97 additions
and
43 deletions
packageIndex/pages/salesSummary/salesSummary.js
packageIndex/pages/salesSummary/salesSummary.wxml
packageIndex/pages/warningStoreList/warningStoreList.js
packageIndex/pages/warningStoreList/warningStoreList.wxml
utils/format.js
packageIndex/pages/salesSummary/salesSummary.js
View file @
2111a3e
// packageIndex/pages/salesSummary/salesSummary.js
import
IndexApi
from
'~/api/index/index'
import
{
tsFormatTime
}
from
'~/utils/format'
function
formatYMDHM
(
val
)
{
if
(
!
val
)
return
'-'
const
d
=
new
Date
(
val
)
if
(
isNaN
(
d
.
getTime
()))
return
'-'
const
yyyy
=
d
.
getFullYear
()
const
MM
=
String
(
d
.
getMonth
()
+
1
).
padStart
(
2
,
'0'
)
const
DD
=
String
(
d
.
getDate
()).
padStart
(
2
,
'0'
)
const
HH
=
String
(
d
.
getHours
()).
padStart
(
2
,
'0'
)
const
mm
=
String
(
d
.
getMinutes
()).
padStart
(
2
,
'0'
)
return
`
${
yyyy
}
-
${
MM
}
-
${
DD
}
${
HH
}
:
${
mm
}
`
}
// dayjs(infoDetail.expectedOperationDate).format('YYYY-MM-DD')
const
app
=
getApp
()
Page
({
...
...
@@ -30,8 +41,13 @@ Page({
console
.
log
(
res
)
res
.
data
=
res
.
data
.
map
(
item
=>
({
...
item
,
// 保留原字段以兼容其它使用场景
lastFollowUpTime
:
item
.
lastFollowUpTime
?
tsFormatTime
(
item
.
lastFollowUpTime
)
?
formatYMDHM
(
item
.
lastFollowUpTime
)
:
'-'
,
// 新增格式化字段,供 WXML 使用
lastFollowUpTimeFormatted
:
item
.
lastFollowUpTime
?
formatYMDHM
(
item
.
lastFollowUpTime
)
:
'-'
}))
this
.
setData
({
...
...
@@ -82,7 +98,7 @@ Page({
// 跳转查看某个销售人员的潜客/门店数据
goCustomer
(
e
)
{
let
{
item
}
=
e
.
currentTarget
.
dataset
app
.
setTabParams
(
'customerObj'
,
{
itemParams
:
item
})
app
.
setTabParams
(
'customerObj'
,
{
itemParams
:
item
})
wx
.
switchTab
({
url
:
`/pages/tab/customer/customer`
})
...
...
@@ -95,7 +111,9 @@ Page({
// 兼容潜客详情页面参数
target
.
id
=
target
.
potentialCustomerId
wx
.
navigateTo
({
url
:
`/packageCustomer/pages/potentialDetail/potentialDetail?query=
${
encodeURIComponent
(
JSON
.
stringify
(
target
))}
`
url
:
`/packageCustomer/pages/potentialDetail/potentialDetail?query=
${
encodeURIComponent
(
JSON
.
stringify
(
target
)
)}
`
})
},
...
...
packageIndex/pages/salesSummary/salesSummary.wxml
View file @
2111a3e
...
...
@@ -52,7 +52,7 @@
</view>
<view class="item last">
<view class="label">最后跟进</view>
<view class="content">{{item.lastFollowUpTime||'-'}}</view>
<view class="content">{{item.lastFollowUpTime
Formatted
||'-'}}</view>
</view>
</view>
</view>
...
...
packageIndex/pages/warningStoreList/warningStoreList.js
View file @
2111a3e
// packageIndex/pages/salesSummary/salesSummary.js
import
IndexApi
from
'~/api/index/index'
import
{
tsFormatTime
}
from
'~/utils/format'
function
formatYMDHM
(
val
)
{
if
(
!
val
)
return
'-'
const
d
=
new
Date
(
val
)
if
(
isNaN
(
d
.
getTime
()))
return
'-'
const
yyyy
=
d
.
getFullYear
()
const
MM
=
String
(
d
.
getMonth
()
+
1
).
padStart
(
2
,
'0'
)
const
DD
=
String
(
d
.
getDate
()).
padStart
(
2
,
'0'
)
const
HH
=
String
(
d
.
getHours
()).
padStart
(
2
,
'0'
)
const
mm
=
String
(
d
.
getMinutes
()).
padStart
(
2
,
'0'
)
return
`
${
yyyy
}
-
${
MM
}
-
${
DD
}
${
HH
}
:
${
mm
}
`
}
Page
({
/**
* 页面的初始数据
...
...
@@ -34,18 +46,37 @@ Page({
}
IndexApi
.
getWarningStores
(
params
).
then
(
res
=>
{
console
.
log
(
res
,
'res'
)
let
{
backstopWarningCount
,
lostShopWarningCount
,
lossWarningCount
,
backstopWarningList
=
[],
lostShopWarningList
=
[],
lossWarningList
=
[]
}
=
res
.
data
let
{
backstopWarningCount
,
lostShopWarningCount
,
lossWarningCount
,
backstopWarningList
=
[],
lostShopWarningList
=
[],
lossWarningList
=
[]
}
=
res
.
data
tabList
[
0
].
count
=
backstopWarningCount
||
0
tabList
[
1
].
count
=
lostShopWarningCount
||
0
tabList
[
2
].
count
=
lossWarningCount
const
mapExpected
=
arr
=>
Array
.
isArray
(
arr
)
?
arr
.
map
(
item
=>
({
...
item
,
expectedOperationDateFormatted
:
formatYMDHM
(
item
.
expectedOperationDate
),
signedTimeFormatted
:
formatYMDHM
(
item
.
signedTime
)
}))
:
[]
const
_backstop
=
mapExpected
(
backstopWarningList
)
const
_lostShop
=
mapExpected
(
lostShopWarningList
)
const
_loss
=
mapExpected
(
lossWarningList
)
// list 根据
this
.
setData
({
tabList
,
backstopWarningList
,
lostShopWarningList
,
lossWarningList
,
list
:
backstopWarningList
||
[]
backstopWarningList
:
_backstop
,
lostShopWarningList
:
_lostShop
,
lossWarningList
:
_loss
,
list
:
_backstop
||
[]
})
})
},
...
...
@@ -91,8 +122,8 @@ Page({
e
.
detail
==
0
?
backstopWarningList
:
e
.
detail
==
1
?
lostShopWarningList
:
lossWarningList
?
lostShopWarningList
:
lossWarningList
this
.
setData
({
activeIndex
:
e
.
detail
,
list
:
list
||
[]
...
...
@@ -120,40 +151,40 @@ Page({
/**
* 生命周期函数--监听页面加载
*/
onLoad
(
options
)
{
},
onLoad
(
options
)
{},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady
()
{
},
onReady
()
{},
/**
* 生命周期函数--监听页面显示
*/
onShow
()
{
},
onShow
()
{},
/**
* 生命周期函数--监听页面隐藏
*/
onHide
()
{
},
onHide
()
{},
/**
* 生命周期函数--监听页面卸载
*/
onUnload
()
{
},
onUnload
()
{},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh
()
{
},
onPullDownRefresh
()
{},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom
()
{
},
onReachBottom
()
{},
/**
* 用户点击右上角分享
*/
onShareAppMessage
()
{
}
onShareAppMessage
()
{}
})
packageIndex/pages/warningStoreList/warningStoreList.wxml
View file @
2111a3e
...
...
@@ -28,7 +28,7 @@
</view>
<view class="item">
<view class="label person">签约时间</view>
<view class="content">{{item.signedTime||'-'}}</view>
<view class="content">{{item.signedTime
Formatted
||'-'}}</view>
</view>
<view class="item">
<view class="label person">展业时间</view>
...
...
utils/format.js
View file @
2111a3e
...
...
@@ -149,7 +149,9 @@ export function centsToyuan(price) {
export
function
setPrice
(
price
)
{
let
[
num
,
decimal
]
=
price
.
toString
().
split
(
'.'
)
if
(
!
decimal
)
decimal
=
'00'
return
(
num
||
0
).
toString
().
replace
(
/
(\d)(?=(?:\d{3})
+$
)
/g
,
'$1,'
)
+
`.
${
decimal
}
`
return
(
(
num
||
0
).
toString
().
replace
(
/
(\d)(?=(?:\d{3})
+$
)
/g
,
'$1,'
)
+
`.
${
decimal
}
`
)
}
export
function
deleteSecond
(
time
)
{
...
...
@@ -202,23 +204,26 @@ export function tsFormatTime(timestamp, format) {
* 返回值:arg1乘以 arg2的精确结果
**/
export
const
accMul
=
(
arg1
,
arg2
)
=>
{
if
(
isNaN
(
arg1
))
{
arg1
=
0
;
}
if
(
isNaN
(
arg2
))
{
arg2
=
0
;
}
arg1
=
Number
(
arg1
);
arg2
=
Number
(
arg2
);
var
m
=
0
,
s1
=
arg1
.
toString
(),
s2
=
arg2
.
toString
();
try
{
m
+=
s1
.
split
(
"."
)[
1
].
length
;
}
catch
(
e
)
{
}
try
{
m
+=
s2
.
split
(
"."
)[
1
].
length
;
}
catch
(
e
)
{
}
return
Number
(
s1
.
replace
(
"."
,
""
))
*
Number
(
s2
.
replace
(
"."
,
""
))
/
Math
.
pow
(
10
,
m
);
};
\ No newline at end of file
if
(
isNaN
(
arg1
))
{
arg1
=
0
}
if
(
isNaN
(
arg2
))
{
arg2
=
0
}
arg1
=
Number
(
arg1
)
arg2
=
Number
(
arg2
)
var
m
=
0
,
s1
=
arg1
.
toString
(),
s2
=
arg2
.
toString
()
try
{
m
+=
s1
.
split
(
'.'
)[
1
].
length
}
catch
(
e
)
{}
try
{
m
+=
s2
.
split
(
'.'
)[
1
].
length
}
catch
(
e
)
{}
return
(
(
Number
(
s1
.
replace
(
'.'
,
''
))
*
Number
(
s2
.
replace
(
'.'
,
''
)))
/
Math
.
pow
(
10
,
m
)
)
}
Write
Preview
Markdown
is supported
Attach a file
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 post a comment