48 行
2.2 KiB
JavaScript
48 行
2.2 KiB
JavaScript
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
|
|
|
var Controller = {
|
|
index: () => {
|
|
const { reactive, onMounted } = Vue
|
|
const index = {
|
|
setup() {
|
|
const state = reactive({ data: [], kpi: {} })
|
|
const pagination = reactive({ page: 1, list_rows: 10, total: 0 })
|
|
function getData() {
|
|
Fast.api.ajax({
|
|
url: 'shopro/partner/daily',
|
|
type: 'GET',
|
|
data: { page: pagination.page, list_rows: pagination.list_rows },
|
|
}, function (ret, res) {
|
|
state.data = res.data.data
|
|
state.kpi = res.data.kpi || {}
|
|
pagination.total = res.data.total
|
|
return false
|
|
}, function () { })
|
|
}
|
|
function onDetail(row) {
|
|
Fast.api.open(`shopro/partner/reward/index?settle_date=${row.settle_date}`, '当日流水')
|
|
}
|
|
function onRerun(row) {
|
|
const { ElMessageBox } = ElementPlus
|
|
ElMessageBox.confirm('将删除当天日结流水后重算,即时奖(推三返一等)不重跑。确定?', '重跑日结', {
|
|
confirmButtonText: '确定重跑',
|
|
cancelButtonText: '取消',
|
|
type: 'warning',
|
|
}).then(() => {
|
|
Fast.api.ajax({
|
|
url: 'shopro/partner/daily/rerun',
|
|
type: 'POST',
|
|
data: { settle_date: row.settle_date },
|
|
}, function () { getData() })
|
|
}).catch(() => {})
|
|
}
|
|
onMounted(() => { getData() })
|
|
return { state, pagination, getData, onDetail, onRerun }
|
|
}
|
|
}
|
|
createApp('index', index);
|
|
},
|
|
};
|
|
return Controller;
|
|
});
|