Browse Source

2024.07.24
- 完成升级日志页和分佣日志页

zweiqin 8 months ago
parent
commit
68eaf8ffb5

+ 10 - 0
src/api/relationshipChainManagement/commissionLog.js

@@ -0,0 +1,10 @@
+import request from '@/utils/request'
+
+// 获取分佣日志列表
+export function getAllCommissionLog(data) {
+  return request({
+    url: '/commissionLog/getAll',
+    method: 'post',
+    data
+  })
+}

+ 10 - 0
src/api/relationshipChainManagement/upgradeLog.js

@@ -0,0 +1,10 @@
+import request from '@/utils/request'
+
+// 获取升级日志列表
+export function getAllRelationshipLog(data) {
+  return request({
+    url: '/relationshipLog/getAll',
+    method: 'post',
+    data
+  })
+}

+ 115 - 0
src/views/relationshipChainManagement/commissionLog/components/DetailModal.vue

@@ -0,0 +1,115 @@
+<template>
+  <el-dialog
+    :visible.sync="visible"
+    v-bind="modalOptions"
+    append-to-body
+  >
+    <el-form
+      ref="formData"
+      :model="formData"
+      size="mini"
+      label-position="left"
+      label-suffix=":"
+      label-width="200px"
+    >
+      <!-- 分佣日志信息 -->
+      <el-form-item label="ID" prop="commissionLogId">
+        {{ formData.commissionLogId || '--' }}
+      </el-form-item>
+      <el-form-item label="分佣类型" prop="commissionType">
+        <span v-if="formData.commissionType === 1">社区订单</span>
+        <span v-else-if="formData.commissionType === 2">商圈订单</span>
+        <span v-else-if="formData.commissionType === 3">商城订单</span>
+        <span v-else-if="formData.commissionType === 4">团长升级</span>
+        <span v-else-if="formData.commissionType === 5">充值赠送代金券</span>
+        <span v-else-if="formData.commissionType === 6">赠送佣金活动</span>
+        <span v-else>--</span>
+      </el-form-item>
+      <el-form-item label="交易时间" prop="tradeTime">
+        {{ formData.tradeTime || '--' }}
+      </el-form-item>
+      <el-form-item label="关联订单编号" prop="orderFormid">
+        {{ formData.orderFormid || '--' }}
+      </el-form-item>
+      <el-form-item label="购买用户ID" prop="buyerUserId">
+        {{ formData.buyerUserId || '--' }}
+      </el-form-item>
+      <el-form-item label="下单用户号码" prop="phone">
+        {{ formData.phone || '--' }}
+      </el-form-item>
+      <el-form-item label="支付金额" prop="orderPrice">
+        {{ formData.orderPrice || '--' }}
+      </el-form-item>
+      <el-form-item label="佣金比例/金额" prop="orderProportion">
+        {{ formData.orderProportion || '--' }}
+      </el-form-item>
+      <el-form-item label="团长ID" prop="tId">
+        {{ formData.tId || '--' }}
+      </el-form-item>
+      <el-form-item label="团长手机号" prop="tPhone">
+        {{ formData.tPhone || '--' }}
+      </el-form-item>
+      <el-form-item label="用于分佣的佣金总额" prop="commissionPrice">
+        {{ formData.commissionPrice || '--' }}
+      </el-form-item>
+      <el-form-item label="佣金分配详情" prop="commissionDetail">
+        {{ formData.commissionDetail || '--' }}
+      </el-form-item>
+    </el-form>
+  </el-dialog>
+</template>
+
+<script>
+
+export default {
+  name: 'DetailModal',
+  data() {
+    return {
+      modalOptions: {
+        closeOnClickModal: false,
+        width: '800px',
+        title: '查看升级日志详情'
+      },
+      visible: false,
+      formData: {
+        commissionLogId: '',
+        commissionType: '',
+        tradeTime: '',
+        orderFormid: '',
+        buyerUserId: '',
+        phone: '',
+        orderPrice: '',
+        orderProportion: '',
+        tId: '',
+        tPhone: '',
+        commissionPrice: '',
+        commissionDetail: ''
+      }
+    }
+  },
+  methods: {
+    handleClose() {
+      this.visible = false
+    },
+    handleOpen(params = {}) {
+      this.formData = Object.assign(this.$options.data().formData, params)
+      if (params.id) {
+        // this.getInfo(params.id)
+      }
+      this.visible = true
+    },
+    async getInfo(id) {
+      const loading = this.$loading({ text: '加载中' })
+      try {
+        const res = await xxx({ id })
+        this.formData = Object.assign(this.$options.data().formData, res.data, {
+          id: res.data.id || ''
+        })
+      } finally {
+        loading.close()
+      }
+    }
+  }
+}
+</script>
+

+ 148 - 0
src/views/relationshipChainManagement/commissionLog/index.vue

@@ -0,0 +1,148 @@
+<template>
+  <div class="app-container">
+    <!-- 查询和其他操作 -->
+    <div class="filter-container">
+      <el-input
+        v-model="listQuery.phone" clearable size="mini" class="filter-item"
+        style="width: 200px;" placeholder="请输入下单用户号码"
+      />
+      <el-input
+        v-model="listQuery.superiorPhone" clearable size="mini" class="filter-item"
+        style="width: 200px;margin-left: 10px;" placeholder="请输入绑定上级手机号码"
+      />
+      <el-button
+        size="mini" class="filter-item" type="primary" icon="el-icon-search"
+        style="margin-left:10px;"
+        @click="handleSearch"
+      >
+        查找
+      </el-button>
+    </div>
+
+    <!-- 查询结果 -->
+    <div v-tableHeight>
+      <el-table
+        v-loading="listLoading" height="100%" element-loading-text="正在查询中。。。" :data="list"
+        v-bind="{ stripe: true, size: 'small', border: true, fit: true, highlightCurrentRow: true }"
+      >
+        <el-table-column align="center" width="100" label="ID" prop="commissionLogId" fixed="left" />
+        <el-table-column align="center" label="分佣类型" prop="commissionType">
+          <template slot-scope="{ row }">
+            <el-tag v-if="row.commissionType === 1" effect="plain">社区订单</el-tag>
+            <el-tag v-else-if="row.commissionType === 2" effect="plain">商圈订单</el-tag>
+            <el-tag v-else-if="row.commissionType === 3" effect="plain">商城订单</el-tag>
+            <el-tag v-else-if="row.commissionType === 4" effect="plain">团长升级</el-tag>
+            <el-tag v-else-if="row.commissionType === 5" effect="plain">充值赠送代金券</el-tag>
+            <el-tag v-else-if="row.commissionType === 6" effect="plain">赠送佣金活动</el-tag>
+            <span v-else>--</span>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" width="150" label="交易时间" prop="tradeTime" show-overflow-tooltip />
+        <el-table-column align="center" width="150" label="关联订单编号" prop="orderFormid" show-overflow-tooltip />
+        <el-table-column align="center" width="100" label="购买用户ID" prop="buyerUserId" show-overflow-tooltip />
+        <el-table-column align="center" width="150" label="下单用户号码" prop="phone" show-overflow-tooltip />
+        <el-table-column align="center" width="100" label="支付金额" prop="orderPrice" show-overflow-tooltip />
+        <el-table-column align="center" width="100" label="佣金比例/金额" prop="orderProportion" show-overflow-tooltip />
+        <el-table-column align="center" width="100" label="团长ID" prop="tId" show-overflow-tooltip />
+        <el-table-column align="center" width="120" label="团长手机号" prop="tPhone" show-overflow-tooltip />
+        <el-table-column align="center" width="100" label="用于分佣的佣金总额" prop="commissionPrice" show-overflow-tooltip />
+        <!-- <el-table-column align="center" width="100" label="佣金分配详情" prop="commissionDetail" show-overflow-tooltip /> -->
+        <el-table-column align="center" label="操作" width="220" fixed="right" class-name="small-padding fixed-width">
+          <template slot-scope="{ row }">
+            <el-button type="warning" size="mini" @click="handleDetail(row)">
+              详情
+            </el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+    </div>
+
+    <div>
+      <el-pagination
+        :current-page="listQuery.page" :page-sizes="[10, 20, 50, 100]" :page-size="listQuery.pageSize"
+        layout="total, sizes, prev, pager, next, jumper" :total="total"
+        @size-change="(val) => ((listQuery.pageSize = val) && getList())"
+        @current-change="(val) => ((listQuery.page = val) && getList())"
+      />
+    </div>
+
+    <!-- 查看详情 -->
+    <DetailModal ref="DetailModal" />
+  </div>
+</template>
+
+<script>
+import DetailModal from './components/DetailModal'
+import { getAllCommissionLog } from '@/api/relationshipChainManagement/commissionLog'
+
+export default {
+  name: 'CommissionLog',
+  components: {
+    DetailModal
+  },
+  data() {
+    return {
+      list: [],
+      total: 0,
+      listLoading: true,
+      listQuery: {
+        page: 1,
+        pageSize: 20,
+        phone: '',
+        superiorPhone: ''
+      }
+    }
+  },
+  created() {
+    this.getList()
+  },
+  methods: {
+    async getList() {
+      this.listLoading = true
+      try {
+        const res = await getAllCommissionLog(this.listQuery)
+        this.list = res.data.list
+        this.total = res.data.total
+      } finally {
+        this.listLoading = false
+      }
+    },
+    handleSearch() {
+      this.listQuery.page = 1
+      this.getList()
+    },
+    handleDetail(row) {
+      this.$refs.DetailModal && this.$refs.DetailModal.handleOpen(row)
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.app-container {
+	padding: 20px;
+	display: flex;
+	flex-direction: column;
+
+	.filter-container {
+		.filter-item {
+			display: inline-block;
+			vertical-align: middle;
+			margin-bottom: 10px;
+		}
+	}
+
+	.small-padding {
+		.cell {
+			padding-left: 5px;
+			padding-right: 5px;
+		}
+	}
+
+	.fixed-width {
+		.el-button--mini {
+			padding: 7px 10px;
+		}
+	}
+}
+</style>

+ 110 - 0
src/views/relationshipChainManagement/upgradeLog/components/DetailModal.vue

@@ -0,0 +1,110 @@
+<template>
+  <el-dialog
+    :visible.sync="visible"
+    v-bind="modalOptions"
+    append-to-body
+  >
+    <el-form
+      ref="formData"
+      :model="formData"
+      size="mini"
+      label-position="left"
+      label-suffix=":"
+      label-width="200px"
+    >
+      <!-- 升级日志信息 -->
+      <el-form-item label="ID" prop="relationshipLogId">
+        {{ formData.relationshipLogId || '--' }}
+      </el-form-item>
+      <el-form-item label="用户ID" prop="buyerUserId">
+        {{ formData.buyerUserId || '--' }}
+      </el-form-item>
+      <el-form-item label="会员手机号码" prop="phone">
+        {{ formData.phone || '--' }}
+      </el-form-item>
+      <el-form-item label="会员身份" prop="identity">
+        <span v-if="formData.identity === 1">会员</span>
+        <span v-else-if="formData.identity === 2">团长</span>
+        <span v-else-if="formData.identity === 3">合伙人</span>
+        <span v-else>--</span>
+      </el-form-item>
+      <el-form-item label="操作类型" prop="operateType">
+        <span v-if="formData.operateType === 1">扫码绑定</span>
+        <span v-else-if="formData.operateType === 2">升级团长</span>
+        <span v-else-if="formData.operateType === 3">升级合伙人</span>
+        <span v-else>--</span>
+      </el-form-item>
+      <el-form-item label="绑定上级ID" prop="superiorUserId">
+        {{ formData.superiorUserId || '--' }}
+      </el-form-item>
+      <el-form-item label="绑定上级手机号码" prop="superiorPhone">
+        {{ formData.superiorPhone || '--' }}
+      </el-form-item>
+      <el-form-item label="绑定上级身份" prop="superiorIdentity">
+        <span v-if="formData.superiorIdentity === 1">会员</span>
+        <span v-else-if="formData.superiorIdentity === 2">团长</span>
+        <span v-else-if="formData.superiorIdentity === 3">合伙人</span>
+        <span v-else>--</span>
+      </el-form-item>
+      <el-form-item label="操作详情" prop="operateDetail">
+        {{ formData.operateDetail || '--' }}
+      </el-form-item>
+      <el-form-item label="操作时间" prop="operateTime">
+        {{ formData.operateTime || '--' }}
+      </el-form-item>
+    </el-form>
+  </el-dialog>
+</template>
+
+<script>
+
+export default {
+  name: 'DetailModal',
+  data() {
+    return {
+      modalOptions: {
+        closeOnClickModal: false,
+        width: '800px',
+        title: '查看升级日志详情'
+      },
+      visible: false,
+      formData: {
+        relationshipLogId: '',
+        buyerUserId: '',
+        phone: '',
+        identity: '',
+        operateType: '',
+        superiorUserId: '',
+        superiorPhone: '',
+        superiorIdentity: '',
+        operateDetail: '',
+        operateTime: ''
+      }
+    }
+  },
+  methods: {
+    handleClose() {
+      this.visible = false
+    },
+    handleOpen(params = {}) {
+      this.formData = Object.assign(this.$options.data().formData, params)
+      if (params.id) {
+        // this.getInfo(params.id)
+      }
+      this.visible = true
+    },
+    async getInfo(id) {
+      const loading = this.$loading({ text: '加载中' })
+      try {
+        const res = await xxx({ id })
+        this.formData = Object.assign(this.$options.data().formData, res.data, {
+          id: res.data.id || ''
+        })
+      } finally {
+        loading.close()
+      }
+    }
+  }
+}
+</script>
+

+ 157 - 0
src/views/relationshipChainManagement/upgradeLog/index.vue

@@ -0,0 +1,157 @@
+<template>
+  <div class="app-container">
+    <!-- 查询和其他操作 -->
+    <div class="filter-container">
+      <el-input
+        v-model="listQuery.phone" clearable size="mini" class="filter-item"
+        style="width: 200px;" placeholder="请输入会员手机号码"
+      />
+      <el-input
+        v-model="listQuery.superiorPhone" clearable size="mini" class="filter-item"
+        style="width: 200px;margin-left: 10px;" placeholder="请输入绑定上级手机号码"
+      />
+      <el-button
+        size="mini" class="filter-item" type="primary" icon="el-icon-search"
+        style="margin-left:10px;"
+        @click="handleSearch"
+      >
+        查找
+      </el-button>
+    </div>
+
+    <!-- 查询结果 -->
+    <div v-tableHeight>
+      <el-table
+        v-loading="listLoading" height="100%" element-loading-text="正在查询中。。。" :data="list"
+        v-bind="{ stripe: true, size: 'small', border: true, fit: true, highlightCurrentRow: true }"
+      >
+        <el-table-column align="center" width="100" label="ID" prop="relationshipLogId" fixed="left" />
+        <el-table-column align="center" width="100" label="用户ID" prop="buyerUserId" fixed="left" show-overflow-tooltip />
+        <el-table-column align="center" width="150" label="会员手机号码" prop="phone" show-overflow-tooltip />
+        <el-table-column align="center" label="会员身份" prop="identity">
+          <template slot-scope="{ row }">
+            <el-tag v-if="row.identity === 1" effect="plain">会员</el-tag>
+            <el-tag v-else-if="row.identity === 2" effect="plain">团长</el-tag>
+            <el-tag v-else-if="row.identity === 3" effect="plain">合伙人</el-tag>
+            <span v-else>--</span>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="操作类型" prop="operateType">
+          <template slot-scope="{ row }">
+            <el-tag v-if="row.operateType === 1" effect="plain">扫码绑定</el-tag>
+            <el-tag v-else-if="row.operateType === 2" effect="plain">升级团长</el-tag>
+            <el-tag v-else-if="row.operateType === 3" effect="plain">升级合伙人</el-tag>
+            <span v-else>--</span>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" width="100" label="绑定上级ID" prop="superiorUserId" show-overflow-tooltip />
+        <el-table-column align="center" width="150" label="绑定上级手机号码" prop="superiorPhone" show-overflow-tooltip />
+        <el-table-column align="center" label="绑定上级身份" prop="superiorIdentity">
+          <template slot-scope="{ row }">
+            <el-tag v-if="row.superiorIdentity === 1" effect="plain">会员</el-tag>
+            <el-tag v-else-if="row.superiorIdentity === 2" effect="plain">团长</el-tag>
+            <el-tag v-else-if="row.superiorIdentity === 3" effect="plain">合伙人</el-tag>
+            <span v-else>--</span>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" min-width="150" label="操作详情" prop="operateDetail" show-overflow-tooltip />
+        <el-table-column align="center" width="150" label="操作时间" prop="operateTime" />
+        <el-table-column align="center" label="操作" width="220" fixed="right" class-name="small-padding fixed-width">
+          <template slot-scope="{ row }">
+            <el-button type="warning" size="mini" @click="handleDetail(row)">
+              详情
+            </el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+    </div>
+
+    <div>
+      <el-pagination
+        :current-page="listQuery.page" :page-sizes="[10, 20, 50, 100]" :page-size="listQuery.pageSize"
+        layout="total, sizes, prev, pager, next, jumper" :total="total"
+        @size-change="(val) => ((listQuery.pageSize = val) && getList())"
+        @current-change="(val) => ((listQuery.page = val) && getList())"
+      />
+    </div>
+
+    <!-- 查看详情 -->
+    <DetailModal ref="DetailModal" />
+  </div>
+</template>
+
+<script>
+import DetailModal from './components/DetailModal'
+import { getAllRelationshipLog } from '@/api/relationshipChainManagement/upgradeLog'
+
+export default {
+  name: 'UpgradeLog',
+  components: {
+    DetailModal
+  },
+  data() {
+    return {
+      list: [],
+      total: 0,
+      listLoading: true,
+      listQuery: {
+        page: 1,
+        pageSize: 20,
+        phone: '',
+        superiorPhone: ''
+      }
+    }
+  },
+  created() {
+    this.getList()
+  },
+  methods: {
+    async getList() {
+      this.listLoading = true
+      try {
+        const res = await getAllRelationshipLog(this.listQuery)
+        this.list = res.data.list
+        this.total = res.data.total
+      } finally {
+        this.listLoading = false
+      }
+    },
+    handleSearch() {
+      this.listQuery.page = 1
+      this.getList()
+    },
+    handleDetail(row) {
+      this.$refs.DetailModal && this.$refs.DetailModal.handleOpen(row)
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.app-container {
+	padding: 20px;
+	display: flex;
+	flex-direction: column;
+
+	.filter-container {
+		.filter-item {
+			display: inline-block;
+			vertical-align: middle;
+			margin-bottom: 10px;
+		}
+	}
+
+	.small-padding {
+		.cell {
+			padding-left: 5px;
+			padding-right: 5px;
+		}
+	}
+
+	.fixed-width {
+		.el-button--mini {
+			padding: 7px 10px;
+		}
+	}
+}
+</style>

+ 2 - 2
vue.config.js

@@ -42,7 +42,7 @@ module.exports = {
     // before: require('./mock/mock-server.js'),
     // before: require('./mock/mock-server.js'),
     proxy: {
     proxy: {
       '/api': {
       '/api': {
-        target: 'https://nsadminapi.tuanfengkeji.cn', // 测试
+        target: 'https://nsadminapitest.tuanfengkeji.cn', // 测试
         // target: 'http://192.168.0.91:9103', // 平台端
         // target: 'http://192.168.0.91:9103', // 平台端
         changeOrigin: true,
         changeOrigin: true,
         pathRewrite: {
         pathRewrite: {
@@ -50,7 +50,7 @@ module.exports = {
         }
         }
       },
       },
       '/tuan': {
       '/tuan': {
-        target: 'https://www.tuanfengkeji.cn:9527/dts-app-api', // 测试
+        target: 'https://test.tuanfengkeji.cn:9527/dts-app-api', // 测试
         changeOrigin: true,
         changeOrigin: true,
         pathRewrite: {
         pathRewrite: {
           '^/tuan': ''
           '^/tuan': ''