li.shaoyi vor 2 Jahren
Ursprung
Commit
2e5d4b4204

+ 1 - 0
src/components/base/qrcode/index.vue

@@ -29,6 +29,7 @@ const props = defineProps({
 const emit = defineEmits(['update:modelValue'])
 const canvasRef = shallowRef<HTMLCanvasElement>()
 
+// https://www.cnblogs.com/cococe/p/10557339.html 此方法无效
 // const getImageBlob = (url: string) => {
 //     return new Promise<string>((resolve, reject) => {
 //         const xhr = new XMLHttpRequest()

+ 36 - 2
src/mock/router.ts

@@ -18,7 +18,7 @@ const appmenu = {
             },
             {
                 authType: 1,
-                sort: 1,
+                sort: 2,
                 title: '收益查询',
                 code: 'Profit',
                 url: '/profit',
@@ -28,7 +28,7 @@ const appmenu = {
             },
             {
                 authType: 1,
-                sort: 1,
+                sort: 3,
                 title: '比例查询',
                 code: 'Ratio',
                 url: '/ratio',
@@ -44,6 +44,40 @@ const appmenu = {
                     },
                 ]
             },
+            {
+                authType: 1,
+                sort: 4,
+                title: '交易数据',
+                code: 'Tradedata',
+                url: '/tradedata',
+                urlType: 1,
+                component: 'views/tradedata/index.vue',
+                icon: 'TrendCharts',
+            },
+            {
+                authType: 1,
+                sort: 5,
+                title: '推广收益',
+                code: 'Promotion',
+                url: '/promotion',
+                urlType: 1,
+                component: 'views/promotion/index.vue',
+                icon: 'Histogram',
+                children: [
+                    {
+                        authType: 3,
+                        title: '明细',
+                        code: 'PromotionDetails',
+                        component: 'views/promotion/components/details/index.vue',
+                    },
+                    {
+                        authType: 3,
+                        title: '支付',
+                        code: 'PromotionPayment',
+                        component: 'views/promotion/components/payment/index.vue',
+                    },
+                ]
+            },
         ]
     }
 };

+ 1 - 1
src/packages/pc/components/base/pagination/index.vue

@@ -1,7 +1,7 @@
 <template>
     <div class="app-pagination">
         <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="page.index"
-            :pager-count="7" :page-sizes="[20, 30, 40]" :page-size="page.size"
+            :pager-count="7" :page-sizes="[10, 20, 30, 40]" :page-size="page.size"
             layout="total, sizes, prev, pager, next, jumper," :total="total" background>
         </el-pagination>
     </div>

+ 2 - 4
src/packages/pc/components/layouts/page/index.vue

@@ -14,15 +14,13 @@
         </app-header>
       </div>
       <div class="app-page__main">
-        <div class="app-page__navbar">
+        <div class="app-page__navbar" v-if="false">
           <app-navbar />
         </div>
         <div id="appPageTeleport" class="app-page__container app-page__teleport"></div>
         <div class="app-page__container">
           <router-view v-slot="{ Component, route }">
-            <transition name="view" mode="out-in">
-              <component :is="handleComponent(Component, route)" :key="route.fullPath" />
-            </transition>
+            <component :is="handleComponent(Component, route)" :key="route.fullPath" />
           </router-view>
         </div>
       </div>

+ 3 - 2
src/packages/pc/views/member/index.vue

@@ -1,3 +1,4 @@
+<!-- 好友查询 -->
 <template>
     <el-container class="member">
         <el-aside>
@@ -6,8 +7,8 @@
                     <template #header>
                         <el-input v-model="filterText" placeholder="请输入好友" />
                     </template>
-                    <el-tree ref="treeRef" :data="treeList" :filter-node-method="filterNode"
-                        :expand-on-click-node="false" highlight-current default-expand-all @node-click="onNodeClick" />
+                    <el-tree ref="treeRef" :data="treeList" :filter-node-method="filterNode" :expand-on-click-node="false"
+                        highlight-current default-expand-all @node-click="onNodeClick" />
                 </app-view>
             </el-scrollbar>
         </el-aside>

+ 2 - 1
src/packages/pc/views/profit/index.vue

@@ -1,5 +1,6 @@
+<!-- 收益查询 -->
 <template>
-    <app-view class="bill">
+    <app-view>
         <template #header>
             <app-filter :options="filterOptons" :loading="loading" />
         </template>

+ 51 - 0
src/packages/pc/views/promotion/components/details/index.vue

@@ -0,0 +1,51 @@
+<!-- 推广收益-明细 -->
+<template>
+    <app-drawer title="收益明细" :width="960" v-model:show="show">
+        <app-table :data="dataList" :columns="tableColumns" :loading="loading" border>
+            <!-- 时间 -->
+            <template #tradetime="{ value }">
+                {{ formatDate(value) }}
+            </template>
+            <template #footer>
+                <app-pagination :total="total" v-model:page-size="pageSize" v-model:page-index="pageIndex"
+                    @change="onRefresh" />
+            </template>
+        </app-table>
+    </app-drawer>
+</template>
+
+<script lang="ts" setup>
+import { shallowRef, PropType } from 'vue'
+import { ElMessage } from 'element-plus'
+import { formatDate } from '@/filters'
+import { useQueryTHJPromotionIncomeDetail } from '@/business/order'
+import AppDrawer from '@pc/components/base/drawer/index.vue'
+import AppTable from '@pc/components/base/table/index.vue'
+import AppPagination from '@pc/components/base/pagination/index.vue'
+
+const props = defineProps({
+    selectedRow: {
+        type: Object as PropType<Model.THJPromotionIncomeRsp>,
+        required: true
+    },
+})
+
+const { loading, dataList, total, pageIndex, pageSize, getTHJPromotionIncomeDetail } = useQueryTHJPromotionIncomeDetail(props.selectedRow.profitmonth)
+const show = shallowRef(true)
+pageSize.value = 10
+
+const tableColumns = shallowRef<Model.TableColumn[]>([
+    { prop: 'tradetime', label: '时间', width: 180 },
+    { prop: 'wrstandardname', label: '商品' },
+    { prop: 'market', label: '市场' },
+    { prop: 'buyorsell', label: '方向' },
+    { prop: 'profitroletype', label: '级别' },
+    { prop: 'profitamount', label: '金额' },
+])
+
+const onRefresh = () => {
+    getTHJPromotionIncomeDetail().catch((err) => ElMessage.error(err))
+}
+
+onRefresh()
+</script>

+ 44 - 0
src/packages/pc/views/promotion/components/payment/index.vue

@@ -0,0 +1,44 @@
+<!-- 挂牌大厅-我的求购-撤销 -->
+<template>
+    <app-drawer title="提示" v-model:show="show" :loading="loading" :refresh="refresh">
+        <div style="font-size:16px;text-align:center">确定要申请支取吗?</div>
+        <template #footer>
+            <el-button @click="onCancel(false)" plain>取消</el-button>
+            <el-button type="primary" @click="formSubmit">确认</el-button>
+        </template>
+    </app-drawer>
+</template>
+
+<script lang="ts" setup>
+import { shallowRef, PropType } from 'vue'
+import { ElMessage } from 'element-plus'
+import { formatDate } from '@/filters'
+import { useTHJProfitDrawApplyReq } from '@/business/trade'
+import AppDrawer from '@pc/components/base/drawer/index.vue'
+
+const props = defineProps({
+    selectedRow: {
+        type: Object as PropType<Model.THJPromotionIncomeRsp>,
+        required: true
+    }
+})
+
+const { loading, onSubmit } = useTHJProfitDrawApplyReq()
+const show = shallowRef(true)
+const refresh = shallowRef(false)
+
+const onCancel = (isRefresh = false) => {
+    show.value = false
+    refresh.value = isRefresh
+}
+
+const formSubmit = () => {
+    const { profitmonth, sumamount } = props.selectedRow
+    onSubmit(formatDate(profitmonth, 'YYYYMM'), sumamount).then(() => {
+        ElMessage.success('提交成功')
+        onCancel(true)
+    }).catch((err) => {
+        ElMessage.error('提交失败:' + err)
+    })
+}
+</script>

+ 84 - 0
src/packages/pc/views/promotion/index.vue

@@ -0,0 +1,84 @@
+<!-- 推广收益 -->
+<template>
+    <app-view>
+        <template #header>
+            <app-filter :options="filterOptons" :loading="loading" />
+        </template>
+        <!-- 表格数据 -->
+        <app-table :data="dataList" v-model:columns="tableColumns" :loading="loading">
+            <!-- 日期 -->
+            <template #reckondate="{ value }">
+                {{ formatDate(value, 'YYYYMM') }}
+            </template>
+            <!-- 操作 -->
+            <template #operate="{ row }">
+                <app-auth-operation :menus="handleOperateButtons(row)" :options="{ selectedRow: row }" />
+            </template>
+            <template #footer>
+                <app-pagination :total="total" v-model:page-size="pageSize" v-model:page-index="pageIndex"
+                    @change="onRefresh" />
+            </template>
+        </app-table>
+    </app-view>
+</template>
+
+<script lang="ts" setup>
+import { shallowRef } from 'vue'
+import { ElMessage } from 'element-plus'
+import { formatDate } from '@/filters'
+import { useDataFilter } from '@/hooks/datatable'
+import { useQueryTHJPromotionIncome } from '@/business/order'
+import AppTable from '@pc/components/base/table/index.vue'
+import AppFilter from '@pc/components/base/table-filter/index.vue'
+import AppPagination from '@pc/components/base/pagination/index.vue'
+import AppAuthOperation from '@pc/components/modules/auth-operation/index.vue'
+
+const { loading, dataList, total, pageIndex, pageSize, getTHJPromotionIncome } = useQueryTHJPromotionIncome()
+const { filterOptons, getQueryParams } = useDataFilter<Model.THJPromotionIncomeReq>()
+
+const tableColumns = shallowRef<Model.TableColumn[]>([
+    { prop: 'profitmonth', label: '时间' },
+    { prop: 'sumamount', label: '金额' },
+    { prop: 'operate', label: '操作' },
+])
+
+filterOptons.selectList = [
+    {
+        label: '支付状态',
+        key: 'profitstatus',
+        options: [
+            { label: '未支付', value: 1 },
+            { label: '支取中', value: 3 },
+            { label: '已支付', value: 2 }
+        ],
+    },
+]
+
+filterOptons.buttonList = [
+    { lable: '重置', onClick: () => onSearch(true) },
+    { lable: '查询', className: 'el-button--primary', onClick: () => onSearch() }
+]
+
+// 3:委托成功 7:部成 -  状态有撤销
+const handleOperateButtons = (row: Model.THJPromotionIncomeRsp) => {
+    if (row.profitstatus === 1) {
+        return ['PromotionDetails', 'PromotionPayment']
+    }
+    return ['PromotionDetails']
+}
+
+const onSearch = (clear = false) => {
+    getQueryParams((qs) => {
+        pageIndex.value = 1
+        getTHJPromotionIncome(qs.profitstatus)
+    }, clear)
+}
+
+const onRefresh = () => {
+    getQueryParams((qs) => {
+        getTHJPromotionIncome(qs.profitstatus).catch((err) => ElMessage.error(err))
+    })
+}
+
+onRefresh()
+</script>

+ 1 - 0
src/packages/pc/views/ratio/index.vue

@@ -1,3 +1,4 @@
+<!-- 比例查询 -->
 <template>
     <app-view>
         <!-- 表格数据 -->

+ 72 - 0
src/packages/pc/views/tradedata/index.vue

@@ -0,0 +1,72 @@
+<!-- 交易数据 -->
+<template>
+    <app-view>
+        <template #header>
+            <app-filter :options="filterOptons" :loading="loading" />
+        </template>
+        <!-- 表格数据 -->
+        <app-table :data="dataList" v-model:columns="tableColumns" :loading="loading">
+            <!-- 日期 -->
+            <template #reckondate="{ value }">
+                {{ formatDate(value, 'YYYY-MM-DD') }}
+            </template>
+            <template #footer>
+                <app-pagination :total="total" v-model:page-size="pageSize" v-model:page-index="pageIndex"
+                    @change="onRefresh" />
+            </template>
+        </app-table>
+    </app-view>
+</template>
+
+<script lang="ts" setup>
+import { shallowRef } from 'vue'
+import { ElMessage } from 'element-plus'
+import { formatDate } from '@/filters'
+import { Market, getTHJMarketList } from '@/constants/market'
+import { useDataFilter } from '@/hooks/datatable'
+import { useQueryTHJTradeDataList } from '@/business/goods'
+import AppTable from '@pc/components/base/table/index.vue'
+import AppFilter from '@pc/components/base/table-filter/index.vue'
+import AppPagination from '@pc/components/base/pagination/index.vue'
+
+const { loading, dataList, total, pageIndex, pageSize, getQueryTHJTradeDataList } = useQueryTHJTradeDataList()
+const { filterOptons, getQueryParams } = useDataFilter<Model.THJTradeDataReq>()
+
+const tableColumns = shallowRef<Model.TableColumn[]>([
+    { prop: 'reckondate', label: '日期' },
+    { prop: 'marketid', label: '市场' },
+    { prop: 'wrstandardname', label: '商品' },
+    { prop: 'accountname', label: '下单好友' },
+    { prop: 'tradeqty', label: '吨数' },
+    { prop: 'tradelot', label: '笔数' },
+])
+
+filterOptons.selectList = [
+    {
+        label: '市场',
+        key: 'marketid',
+        locked: true,
+        selectedValue: Market.THJ,
+        options: getTHJMarketList(),
+    },
+]
+
+filterOptons.buttonList = [
+    { lable: '查询', className: 'el-button--primary', onClick: () => onSearch() }
+]
+
+const onSearch = (clear = false) => {
+    getQueryParams((qs) => {
+        pageIndex.value = 1
+        getQueryTHJTradeDataList(qs.marketid)
+    }, clear)
+}
+
+const onRefresh = () => {
+    getQueryParams((qs) => {
+        getQueryTHJTradeDataList(qs.marketid).catch((err) => ElMessage.error(err))
+    })
+}
+
+onRefresh()
+</script>

+ 3 - 3
src/services/http/pending/index.ts

@@ -6,7 +6,7 @@ import qs from 'qs'
  */
 const pending = new Map()
 
-const getUrl = (config: AxiosRequestConfig) => {
+const getRequestKey = (config: AxiosRequestConfig) => {
     return [
         config.method,
         config.url,
@@ -19,7 +19,7 @@ const getUrl = (config: AxiosRequestConfig) => {
  * 添加请求
  */
 export function addPending(config: AxiosRequestConfig) {
-    const url = getUrl(config)
+    const url = getRequestKey(config)
     config.cancelToken =
         config.cancelToken ||
         new axios.CancelToken((cancel) => {
@@ -34,7 +34,7 @@ export function addPending(config: AxiosRequestConfig) {
  * 移除请求
  */
 export function removePending(config: AxiosRequestConfig) {
-    const url = getUrl(config)
+    const url = getRequestKey(config)
     if (pending.has(url)) {
         //如果在列表中存在当前请求,需要取消当前请求,并且移除
         const cancel = pending.get(url)