feat(dashboard): 从专业财富观角度重构升级后台收益与分成统计仪表盘
这个提交包含在:
文件差异内容过多而无法显示
加载差异
@@ -7,6 +7,13 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
setup() {
|
||||
const state = reactive({ data: [], kpi: {} })
|
||||
const pagination = reactive({ page: 1, list_rows: 10, total: 0 })
|
||||
const previewDialog = reactive({
|
||||
visible: false,
|
||||
loading: false,
|
||||
date: '',
|
||||
result: null
|
||||
})
|
||||
|
||||
function getData() {
|
||||
Fast.api.ajax({
|
||||
url: 'shopro/partner/daily',
|
||||
@@ -36,8 +43,32 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
}, function () { getData() })
|
||||
}).catch(() => {})
|
||||
}
|
||||
function onOpenPreview() {
|
||||
const yesterday = new Date(Date.now() - 86400000).toISOString().slice(0, 10)
|
||||
previewDialog.date = yesterday
|
||||
previewDialog.visible = true
|
||||
runPreview()
|
||||
}
|
||||
function runPreview() {
|
||||
if (!previewDialog.date) {
|
||||
ElementPlus.ElMessage.warning('请选择试算日期')
|
||||
return
|
||||
}
|
||||
previewDialog.loading = true
|
||||
Fast.api.ajax({
|
||||
url: 'shopro/partner/daily/preview',
|
||||
type: 'GET',
|
||||
data: { settle_date: previewDialog.date },
|
||||
}, function (ret, res) {
|
||||
previewDialog.loading = false
|
||||
previewDialog.result = res.data || null
|
||||
return false
|
||||
}, function () {
|
||||
previewDialog.loading = false
|
||||
})
|
||||
}
|
||||
onMounted(() => { getData() })
|
||||
return { state, pagination, getData, onDetail, onRerun }
|
||||
return { state, pagination, getData, onDetail, onRerun, previewDialog, onOpenPreview, runPreview }
|
||||
}
|
||||
}
|
||||
createApp('index', index);
|
||||
|
||||
@@ -89,6 +89,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
})
|
||||
const ext = reactive({ visible: false, text: '' })
|
||||
const reissue = reactive({ visible: false, form: { user_id: '', reward_type: 'push3', amount: '', order_id: '', memo: '' } })
|
||||
const orderTreeDialog = reactive({ visible: false, loading: false, data: {} })
|
||||
|
||||
function getData() {
|
||||
let tempSearch = JSON.parse(JSON.stringify(state.filter.data));
|
||||
@@ -180,6 +181,26 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
getData()
|
||||
})
|
||||
}
|
||||
function onOrderTree(row) {
|
||||
const orderId = row.order_id || (row.order && row.order.id);
|
||||
if (!orderId || orderId <= 0) {
|
||||
ElementPlus.ElMessage.warning('非业务订单流水,无整单透视数据');
|
||||
return;
|
||||
}
|
||||
orderTreeDialog.loading = true;
|
||||
orderTreeDialog.visible = true;
|
||||
Fast.api.ajax({
|
||||
url: 'shopro/partner/reward/orderTree',
|
||||
type: 'GET',
|
||||
data: { order_id: orderId },
|
||||
}, function (ret, res) {
|
||||
orderTreeDialog.loading = false;
|
||||
orderTreeDialog.data = res.data || {};
|
||||
return false;
|
||||
}, function () {
|
||||
orderTreeDialog.loading = false;
|
||||
});
|
||||
}
|
||||
onMounted(() => {
|
||||
const params = new URLSearchParams(location.search)
|
||||
if (params.get('user_id')) {
|
||||
@@ -194,7 +215,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
}
|
||||
getData()
|
||||
})
|
||||
return { state, getData, onOpenFilter, onChangeFilter, pagination, exportLoading, onExport, ext, onViewExt, onBack, onBackOrder, reissue, onReissue }
|
||||
return { state, getData, onOpenFilter, onChangeFilter, pagination, exportLoading, onExport, ext, onViewExt, onBack, onBackOrder, reissue, onReissue, orderTreeDialog, onOrderTree }
|
||||
}
|
||||
}
|
||||
createApp('index', index);
|
||||
|
||||
在新工单中引用
屏蔽一个用户