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 594671ce
authored
Nov 07, 2025
by
张立顺
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'SAAS+V5.3.0-1117' of 192.168.3.233:saas_plus/sales-assistant into SAAS+V5.3.0-1117
2 parents
4ffd85f1
74d968f6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
32 deletions
packageCustomer/components/BusinessAnalysis/BusinessAnalysis.js
packageCustomer/components/BusinessAnalysis/BusinessAnalysis.js
View file @
594671c
...
...
@@ -119,6 +119,7 @@ Component({
async
getAnalysisData
()
{
try
{
let
params
=
this
.
getParams
()
wx
.
$api
.
showLoading
()
const
[
outputData
,
buyAndToStoreData
,
chartData
,
supervisionSale
]
=
await
Promise
.
all
([
CustomerApi
.
queryMerchantOutputAndAtv
(
params
),
CustomerApi
.
queryMerchantBuyAndTostore
(
params
),
...
...
@@ -136,6 +137,8 @@ Component({
})
}
catch
(
error
)
{
console
.
error
()
}
finally
{
wx
.
$api
.
hideLoading
()
}
},
getParams
()
{
...
...
@@ -166,7 +169,7 @@ Component({
obj
.
endDay
=
dayjs
(
date
).
endOf
(
'month'
).
format
(
'YYYY-MM-DD'
)
break
;
case
3
:
{
const
[
start
,
end
]
=
date
.
split
(
'
-
'
).
map
(
d
=>
dayjs
(
d
.
trim
()))
const
[
start
,
end
]
=
date
.
split
(
'
至
'
).
map
(
d
=>
dayjs
(
d
.
trim
()))
obj
.
startDay
=
start
.
format
(
'YYYY-MM-DD'
)
obj
.
endDay
=
end
.
format
(
'YYYY-MM-DD'
)
break
;
...
...
@@ -187,7 +190,7 @@ Component({
case
'date'
:
{
const
yesterday
=
now
.
subtract
(
1
,
'day'
);
setData
({
date
:
yesterday
.
format
(
'YYYY
/MM/
DD'
),
date
:
yesterday
.
format
(
'YYYY
-MM-
DD'
),
currentDate
:
yesterday
.
valueOf
(),
});
break
;
...
...
@@ -195,7 +198,7 @@ Component({
case
'year-month'
:
{
const
lastMonth
=
now
.
subtract
(
1
,
'month'
);
setData
({
date
:
lastMonth
.
format
(
'YYYY
/
MM'
),
date
:
lastMonth
.
format
(
'YYYY
-
MM'
),
currentDate
:
lastMonth
.
valueOf
(),
});
break
;
...
...
@@ -205,7 +208,7 @@ Component({
if
(
secondWeek
)
{
setData
({
currentWeek
:
secondWeek
,
date
:
`
${
secondWeek
.
startDate
}
-
${
secondWeek
.
endDate
}
`
,
date
:
`
${
secondWeek
.
startDate
}
至
${
secondWeek
.
endDate
}
`
,
});
}
break
;
...
...
@@ -213,7 +216,7 @@ Component({
case
'custom'
:
{
const
yesterday
=
now
.
subtract
(
1
,
'day'
);
setData
({
date
:
`
${
yesterday
.
format
(
'YYYY
/MM/DD'
)}
-
${
now
.
format
(
'YYYY/MM/
DD'
)}
`
,
date
:
`
${
yesterday
.
format
(
'YYYY
-MM-DD'
)}
至
${
now
.
format
(
'YYYY-MM-
DD'
)}
`
,
currentDate
:
yesterday
.
valueOf
(),
});
break
;
...
...
@@ -249,9 +252,9 @@ Component({
const
end
=
event
.
detail
[
1
]
this
.
setData
({
show
:
false
,
date
:
`
${
dayjs
(
start
).
format
(
'YYYY
/MM/DD'
)}
-
${
dayjs
(
end
).
format
(
'YYYY/MM/
DD'
)}
`
,
date
:
`
${
dayjs
(
start
).
format
(
'YYYY
-MM-DD'
)}
至
${
dayjs
(
end
).
format
(
'YYYY-MM-
DD'
)}
`
,
});
if
(
current
==
0
)
this
.
getAnalysisData
()
this
.
getAnalysisData
()
},
// 日选择
onDisplayDate
()
{
...
...
@@ -262,8 +265,8 @@ Component({
})
const
calendar
=
this
.
selectComponent
(
"#calendar"
)
if
(
calendar
&&
calendar
.
__data__
&&
calendar
.
__data__
.
currentDate
)
{
const
_calendar
=
calendar
.
__data__
.
currentDate
.
map
(
item
=>
dayjs
(
item
).
format
(
'YYYY
/MM/
DD'
))
const
_value
=
date
.
split
(
'
-
'
)
const
_calendar
=
calendar
.
__data__
.
currentDate
.
map
(
item
=>
dayjs
(
item
).
format
(
'YYYY
-MM-
DD'
))
const
_value
=
date
.
split
(
'
至
'
)
if
(
_value
[
0
]
!=
_calendar
[
0
]
||
_value
[
1
]
!=
_calendar
[
1
])
{
calendar
.
reset
()
}
...
...
@@ -274,7 +277,7 @@ Component({
})
if
(
timeType
==
'date'
&&
currentObj
)
{
const
c_value
=
currentObj
.
getValues
()
const
_date
=
date
.
split
(
'
/
'
)
const
_date
=
date
.
split
(
'
-
'
)
if
(
c_value
[
0
]
!=
_date
[
0
]
||
c_value
[
1
]
!=
_date
[
1
]
||
c_value
[
2
]
!=
_date
[
2
])
{
const
picker
=
this
.
selectComponent
(
"#datePicker"
)
this
.
setData
({
...
...
@@ -287,7 +290,7 @@ Component({
}
}
else
if
(
timeType
==
'year-month'
&&
currentObj
)
{
const
c_value
=
currentObj
.
getValues
()
const
_date
=
date
.
split
(
'
/
'
)
const
_date
=
date
.
split
(
'
-
'
)
if
(
c_value
[
0
]
!=
_date
[
0
]
||
c_value
[
1
]
!=
_date
[
1
])
{
const
picker
=
this
.
selectComponent
(
"#datePicker"
)
this
.
setData
({
...
...
@@ -301,7 +304,7 @@ Component({
}
else
if
(
timeType
==
'week'
)
{
const
{
date
,
weekColumns
}
=
this
.
data
const
picker
=
this
.
selectComponent
(
"#weekPicker"
)
const
label
=
date
.
replace
(
'-'
,
'至'
).
replace
(
/
\/
/g
,
'-'
);
const
label
=
date
const
index
=
weekColumns
.
findIndex
(
i
=>
i
.
label
==
label
)
setTimeout
(()
=>
{
picker
.
setColumnIndex
(
0
,
index
)
...
...
@@ -320,9 +323,9 @@ Component({
confirm
()
{
const
{
selectedDate
,
timeType
,
currentWeek
,
current
}
=
this
.
data
;
const
formatMap
=
{
date
:
()
=>
dayjs
(
selectedDate
).
format
(
'YYYY
/MM/
DD'
),
'year-month'
:
()
=>
dayjs
(
selectedDate
).
format
(
'YYYY
/
MM'
),
week
:
()
=>
`
${
currentWeek
.
startDate
}
-
${
currentWeek
.
endDate
}
`
date
:
()
=>
dayjs
(
selectedDate
).
format
(
'YYYY
-MM-
DD'
),
'year-month'
:
()
=>
dayjs
(
selectedDate
).
format
(
'YYYY
-
MM'
),
week
:
()
=>
`
${
currentWeek
.
startDate
}
至
${
currentWeek
.
endDate
}
`
};
// 边界状态统一计算
const
calcBoundary
=
()
=>
{
...
...
@@ -363,7 +366,7 @@ Component({
dateShow
:
false
,
date
:
(
formatMap
[
timeType
]
||
(()
=>
''
))()
});
if
(
current
==
0
)
this
.
getAnalysisData
(
this
.
data
.
merchantId
);
this
.
getAnalysisData
(
this
.
data
.
merchantId
);
},
onChange
(
e
)
{
...
...
@@ -393,7 +396,7 @@ Component({
const
prevMonth
=
currentDisplayDate
.
subtract
(
1
,
'month'
);
const
leftCurrent
=
prevMonth
.
isSame
(
dayjs
(
minDate
),
'month'
);
this
.
setData
({
date
:
prevMonth
.
format
(
'YYYY
/
MM'
),
date
:
prevMonth
.
format
(
'YYYY
-
MM'
),
currentDate
:
prevMonth
.
valueOf
(),
rightCurrent
:
false
,
leftCurrent
...
...
@@ -404,7 +407,7 @@ Component({
const
prevDate
=
currentDisplayDate
.
subtract
(
1
,
'day'
);
const
leftCurrent
=
prevDate
.
isSame
(
dayjs
(
minDate
),
'day'
);
this
.
setData
({
date
:
prevDate
.
format
(
'YYYY
/MM/
DD'
),
date
:
prevDate
.
format
(
'YYYY
-MM-
DD'
),
currentDate
:
prevDate
.
valueOf
(),
rightCurrent
:
false
,
leftCurrent
...
...
@@ -413,9 +416,9 @@ Component({
const
{
currentWeek
,
weekColumns
}
=
this
.
data
;
if
(
currentWeek
.
index
>
-
1
)
{
const
prevWeek
=
weekColumns
[
currentWeek
.
index
+
1
];
const
prevDate
=
dayjs
(
prevWeek
.
startDate
,
'YYYY
/MM/
DD'
);
const
prevDate
=
dayjs
(
prevWeek
.
startDate
,
'YYYY
-MM-
DD'
);
this
.
setData
({
date
:
`
${
prevWeek
.
startDate
}
-
${
prevWeek
.
endDate
}
`
,
date
:
`
${
prevWeek
.
startDate
}
至
${
prevWeek
.
endDate
}
`
,
currentDate
:
prevDate
.
valueOf
(),
defaultIndex
:
currentWeek
.
index
+
1
,
currentWeek
:
prevWeek
,
...
...
@@ -424,7 +427,7 @@ Component({
});
}
}
if
(
current
==
0
)
this
.
getAnalysisData
(
merchantId
)
this
.
getAnalysisData
(
merchantId
)
},
// 下一个月
next
()
{
...
...
@@ -436,7 +439,7 @@ Component({
const
nextMonth
=
currentDisplayDate
.
add
(
1
,
'month'
);
const
rightCurrent
=
nextMonth
.
isSame
(
dayjs
(),
'month'
);
this
.
setData
({
date
:
nextMonth
.
format
(
'YYYY
/
MM'
),
date
:
nextMonth
.
format
(
'YYYY
-
MM'
),
currentDate
:
nextMonth
.
valueOf
(),
leftCurrent
:
false
,
rightCurrent
...
...
@@ -444,11 +447,11 @@ Component({
}
else
if
(
timeType
==
'date'
)
{
// 日选择
// 获取当前显示的日期
const
currentDisplayDate
=
dayjs
(
date
,
'YYYY
/MM/
DD'
);
const
currentDisplayDate
=
dayjs
(
date
,
'YYYY
-MM-
DD'
);
// 设置为下一个月
const
nextDate
=
currentDisplayDate
.
add
(
1
,
'day'
);
const
_date
=
nextDate
.
format
(
'YYYY
/MM/
DD'
);
const
_currentDate
=
dayjs
().
format
(
'YYYY
/MM/
DD'
);
const
_date
=
nextDate
.
format
(
'YYYY
-MM-
DD'
);
const
_currentDate
=
dayjs
().
format
(
'YYYY
-MM-
DD'
);
const
rightCurrent
=
_date
==
_currentDate
this
.
setData
({
date
:
_date
,
...
...
@@ -460,9 +463,9 @@ Component({
const
{
currentWeek
,
weekColumns
}
=
this
.
data
if
(
currentWeek
.
index
<
weekColumns
.
length
)
{
const
nextWeek
=
weekColumns
[
currentWeek
.
index
-
1
]
const
nextDate
=
dayjs
(
nextWeek
.
startDate
,
'YYYY
/MM/
DD'
);
const
nextDate
=
dayjs
(
nextWeek
.
startDate
,
'YYYY
-MM-
DD'
);
this
.
setData
({
date
:
`
${
nextWeek
.
startDate
}
-
${
nextWeek
.
endDate
}
`
,
date
:
`
${
nextWeek
.
startDate
}
至
${
nextWeek
.
endDate
}
`
,
currentDate
:
nextDate
.
valueOf
(),
defaultIndex
:
currentWeek
.
index
-
1
,
currentWeek
:
nextWeek
,
...
...
@@ -471,7 +474,7 @@ Component({
})
}
}
if
(
current
==
0
)
this
.
getAnalysisData
(
merchantId
)
this
.
getAnalysisData
(
merchantId
)
},
handleShow
(
e
)
{
const
{
type
}
=
e
.
currentTarget
.
dataset
...
...
@@ -499,9 +502,5 @@ Component({
handleIsAnalyse
()
{
this
.
setData
({
helpShow
:
true
})
},
// 获取门店产值趋势数据
getTrend
()
{
}
}
})
\ No newline at end of file
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