Commit 779b38f8 by 李伟康

refactor(storeDailyReport): 调整接口调用时机

将获取月度待办数量的接口调用移到空值判断分支内,避免不必要的请求
1 parent 89aa9f62
...@@ -246,15 +246,15 @@ export default { ...@@ -246,15 +246,15 @@ export default {
async getMonthlyPendingCount() { async getMonthlyPendingCount() {
let { reportDate, userInfo, list, sceneType } = this, let { reportDate, userInfo, list, sceneType } = this,
{ shopMerchantId } = userInfo { shopMerchantId } = userInfo
const res = await uni.$api.dailyTemplateApi.getMonthlyPendingCount({
merchantId: shopMerchantId,
sceneType,
reportDate
})
let index = list.findIndex(i => i.key == 'F2-102') let index = list.findIndex(i => i.key == 'F2-102')
if (index == -1) return if (index == -1) return
let item = list[index] let item = list[index]
if (item.value == null || item.value == '' || item.value == undefined) { if (item.value == null || item.value == '' || item.value == undefined) {
const res = await uni.$api.dailyTemplateApi.getMonthlyPendingCount({
merchantId: shopMerchantId,
sceneType,
reportDate
})
if (res) this.$set(item, 'value', res.pendingCount) if (res) this.$set(item, 'value', res.pendingCount)
} }
}, },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!