Alex 9 сар өмнө
parent
commit
62069b5149

+ 2 - 2
src/views/customer/blacklist/index.vue

@@ -8,7 +8,7 @@
       :columns="columns"
       :tools="false"
     >
-      <!-- 
+      <!--
         <el-button
           type="success"
           plain
@@ -106,7 +106,7 @@
     { label: '用户OpenId', prop: 'openId', align: 'center' },
     { label: '手机号', prop: 'mobile', align: 'center' },
     { label: '用户类型', prop: 'platName', align: 'center' },
-    { label: '用户标签', prop: 'userTagNames', align: 'center' },
+    { label: '用户标签', prop: 'userTagStr', align: 'center' },
     { label: '状态', prop: 'statusName', align: 'center', slot: 'status' },
     { label: '创建时间', prop: 'createTime', align: 'center', width: 160 },
     {

+ 86 - 0
src/views/marketing/partner/components/partner-settlement-search.vue

@@ -0,0 +1,86 @@
+<!-- 结算搜索表单 -->
+<template>
+  <ele-card :body-style="{ padding: '0', paddingTop: '30px' }">
+    <ProSearch
+      :items="formItems"
+      ref="searchRef"
+      @search="search"
+      :initKeys="initKeys"
+    >
+    </ProSearch>
+  </ele-card>
+</template>
+
+<script setup>
+  import { reactive, ref, defineEmits } from 'vue';
+  import ProSearch from '@/components/CommonPage/ProSearch2.vue';
+
+  const emit = defineEmits(['search']);
+
+  const formItems = reactive([
+    {
+      type: 'input',
+      label: '合伙人',
+      prop: 'partnerName',
+      placeholder: '请输入姓名'
+    },
+    {
+      type: 'input',
+      label: '手机号',
+      prop: 'mobile',
+      placeholder: '请输入手机号'
+    },
+    {
+      type: 'input',
+      label: '订单编号',
+      prop: 'orderId',
+      placeholder: '请输入订单编号'
+    },
+    {
+      type: 'dictSelect',
+      label: '结算状态',
+      prop: 'status',
+      props: {
+        code: 'partner_settle_status'
+      }
+    },
+    {
+      type: 'daterange',
+      label: '创建时间',
+      prop: 'timeRange',
+      props: {
+        valueFormat: 'YYYY-MM-DD',
+        format: 'YYYY-MM-DD',
+        startPlaceholder: '开始日期',
+        endPlaceholder: '结束日期',
+        onChange: (value) => {
+          initKeys.createTimeStart = value ? value[0] : '';
+          initKeys.createTimeEnd = value ? value[1] : '';
+          searchRef.value?.setData(initKeys);
+        }
+      }
+    }
+  ]);
+
+  const initKeys = reactive({
+    partnerName: '',
+    mobile: '',
+    orderId: '',
+    status: '',
+    createTimeStart: '',
+    createTimeEnd: ''
+  });
+
+  const searchRef = ref(null);
+
+  /** 搜索 */
+  const search = (data) => {
+    let params = JSON.parse(JSON.stringify(data));
+    delete params.timeRange;
+    emit('search', params);
+  };
+
+  defineExpose({
+    search
+  });
+</script>

+ 134 - 8
src/views/marketing/partner/components/partner-settlement.vue

@@ -1,18 +1,144 @@
 <!-- 结算设置 -->
 <template>
-    <div class="partner-settlement">
-        <!-- TODO: 实现结算设置界面 -->
-        <h3>结算设置</h3>
-    </div>
+  <div class="partner-settlement">
+    <!-- 搜索表单 -->
+    <partner-settlement-search ref="searchRef" @search="handleSearch" />
+
+    <!-- 表格 -->
+    <CommonTable
+      ref="tableRef"
+      :pageConfig="pageConfig"
+      :columns="columns"
+      :bodyStyle="{ padding: 0 }"
+    >
+      <template #toolbar>
+        <el-button type="primary" plain @click="handleBatchSettlement">
+          批量结算
+        </el-button>
+      </template>
+
+      <template #status="{ row }">
+        <dict-data
+          code="partner_settle_status"
+          type="tag"
+          :model-value="row.status"
+        />
+      </template>
+
+      <template #type="{ row }">
+        <dict-data
+          code="partner_settle_order_type"
+          type="text"
+          :model-value="row.type"
+        />
+      </template>
+      <template #action="{ row }">
+        <div class="action-buttons">
+          <el-button
+            type="primary"
+            link
+            v-if="row.status === '1'"
+            @click="handleSettlement(row)"
+          >
+            手工结算
+          </el-button>
+        </div>
+      </template>
+    </CommonTable>
+  </div>
 </template>
 
 <script setup>
-import { ref } from 'vue';
+  import { ref, reactive } from 'vue';
+  import { ElMessage } from 'element-plus';
+  import CommonTable from '@/components/CommonPage/CommonTable.vue';
+  import PartnerSettlementSearch from './partner-settlement-search.vue';
+  import request from '@/utils/request';
+
+  // 表格实例
+  const tableRef = ref(null);
+  const searchRef = ref(null);
+
+  // 页面配置
+  const pageConfig = reactive({
+    pageUrl: '/user/userInviteLog/pageList',
+    cacheKey: 'partnerSettlementTable',
+    rowKey: 'beInviteOrderId'
+  });
+
+  // 表格列配置
+  const columns = ref([
+    {
+      type: 'selection',
+      columnKey: 'selection',
+      width: 50,
+      align: 'center',
+      fixed: 'left'
+    },
+    { label: '订单编号', prop: 'beInviteOrderId', minWidth: 120 },
+    { label: '订单类型', prop: 'type', slot: 'type', width: 100 },
+    { label: '下单人姓名', prop: 'orderName', width: 120 },
+    { label: '下单人手机号', prop: 'orderMobile', width: 120 },
+    { label: '合伙人姓名', prop: 'partnerName', width: 120 },
+    { label: '合伙人手机号', prop: 'partnerMobile', width: 120 },
+    { label: '订单金额', prop: 'orderExpectMoney', minWidth: 100 },
+    { label: '结算金额', prop: 'orderFinalMoney', minWidth: 100 },
+    { label: '预估收入', prop: 'expectSettlementMoney', minWidth: 100 },
+    { label: '结算收入', prop: 'settlementMoney', minWidth: 100 },
+    { label: '结算状态', prop: 'status', slot: 'status', minWidth: 100 },
+    { label: '创建时间', prop: 'createTime', minWidth: 160 },
+    { label: '结算时间', prop: 'settlementTime', minWidth: 160 },
+    {
+      columnKey: 'action',
+      label: '操作',
+      width: 120,
+      align: 'center',
+      slot: 'action',
+      fixed: 'right'
+    }
+  ]);
+
+  // 搜索
+  const handleSearch = (where) => {
+    tableRef.value?.reload(where);
+  };
+
+  // 手工结算相关
+  const handleSettlement = (row) => {
+    tableRef.value?.messageBoxConfirm({
+      message:
+        '请确认是否手工结算?\n为避免造成损失,请确保订单已完成且不会造成重复结算',
+      fetch: () =>
+        request.post('/user/userInviteLog/adminSettlement', {
+          orderIds: [row.beInviteOrderId]
+        })
+    });
+  };
+
+  // 批量结算
+  const handleBatchSettlement = () => {
+    const selections = tableRef.value?.getSelections();
+    if (!selections?.length) {
+      return ElMessage.warning('请至少选择一条数据');
+    }
 
+    const orderIds = selections.map((row) => row.beInviteOrderId);
+    tableRef.value?.messageBoxConfirm({
+      message:
+        '请确认是否手工结算?\n为避免造成损失,请确保订单已完成且不会造成重复结算',
+      fetch: () =>
+        request.post('/user/userInviteLog/adminSettlement', { orderIds })
+    });
+  };
 </script>
 
 <style lang="scss" scoped>
-.partner-settlement {
-    padding: 16px;
-}
+  .dialog-content {
+    text-align: center;
+    .warning {
+      color: #f56c6c;
+      font-size: 12px;
+      margin-top: 10px;
+    }
+  }
 </style>