浏览代码

Merge branch 'feat/v20241023-商家代金券提现'

GuYun-D 5 月之前
父节点
当前提交
abf3087e0b

+ 299 - 269
src/api/business.js

@@ -1,269 +1,299 @@
-import request from '@/utils/request'
-
-// ******商家列表******
-// 商家管理查询
-export function businessListGetAll(data) {
-  return request({
-    url: '/shop/getAll',
-    method: 'post',
-    data
-  })
-}
-
-// 新增商家
-export function businessListSave(data) {
-  return request({
-    url: '/shop/save',
-    method: 'post',
-    data
-  })
-}
-
-// 商家编辑查询
-export function businessListGetById(data) {
-  return request({
-    url: '/shop/getById',
-    method: 'post',
-    data
-  })
-}
-
-//   修改商家
-export function businessListUpdate(data) {
-  return request({
-    url: '/shop/update',
-    method: 'post',
-    data
-  })
-}
-
-// 启停用商家
-export function businessListStart(data) {
-  return request({
-    url: '/shop/start',
-    method: 'post',
-    data
-  })
-}
-
-export function delBusinessById(data) {
-  return request({
-    url: '/shop/cleanShop',
-    method: 'post',
-    data
-  })
-}
-
-// 入驻申请
-// 入驻申请管理查询
-export function settlementGetAll(data) {
-  return request({
-    url: '/check/getAll',
-    method: 'post',
-    data
-  })
-}
-
-// 入驻申请详情
-export function settlementGetById(data) {
-  return request({
-    url: '/check/getById',
-    method: 'post',
-    data
-  })
-}
-
-// 处理
-export function settlementHandle(data) {
-  return request({
-    url: '/check/handle',
-    method: 'post',
-    data
-  })
-}
-
-// 删除
-export function settlementDelete(data) {
-  return request({
-    url: '/check/delete',
-    method: 'post',
-    data
-  })
-}
-
-// **********************关键词**********************
-// 启停用
-export function wordStart(data) {
-  return request({
-    url: '/word/start',
-    method: 'post',
-    data
-  })
-}
-
-// 启停用
-export function wordGetAll(data) {
-  return request({
-    url: '/word/getAll',
-    method: 'post',
-    data
-  })
-}
-
-// 添加关键词
-export function wordAdd(data) {
-  return request({
-    url: '/word/save',
-    method: 'post',
-    data
-  })
-}
-
-// 修改关键词查询
-export function wordGetById(data) {
-  return request({
-    url: '/word/getById',
-    method: 'post',
-    data
-  })
-}
-
-// 修改关键词
-export function wordUpdate(data) {
-  return request({
-    url: '/word/update',
-    method: 'post',
-    data
-  })
-}
-
-// 删除关键词
-export function wordDelete(data) {
-  return request({
-    url: '/word/delete',
-    method: 'post',
-    data
-  })
-}
-
-
-// **********************商家分类**********************
-// 添加商家分类
-export function businessClassList(data) {
-  return request({
-    url: '/shopCategory/getAll',
-    method: "post",
-    data
-  })
-}
-
-// 根据一级获取
-export function businessClassListById(data) {
-  return request({
-    url: "/shopCategory/getById",
-    method: "post",
-    data
-  })
-}
-
-// 删除标签分类
-export function deleteBusinessClass(data) {
-  return request({
-    url: "/shopCategory/deleteCategory",
-    method: "post",
-    data
-  })
-}
-
-// 更新标签
-export function updateBusinessClass(data) {
-  return request({
-    url: "/shopCategory/updateCategory",
-    method: "post",
-    data
-  })
-}
-
-// 添加分类
-export function addBusinessClass(data) {
-  return request({
-    url: '/shopCategory/addCategory',
-    data,
-    method: "post"
-  })
-}
-
-
-// **********品牌工厂***********
-// 获取所有分类
-
-export function factoryClassList(data) {
-  return request({
-    url: '/shopCategoryMall/getAll',
-    method: "post",
-    data
-  })
-}
-
-export function factoryClassListById(data) {
-  return request({
-    url: "/shopCategoryMall/getById",
-    method: "post",
-    data
-  })
-}
-
-// 删除标签分类
-export function deleteFactoryClass(data) {
-  return request({
-    url: "/shopCategoryMall/deleteCategory",
-    method: "post",
-    data
-  })
-}
-
-// 更新标签
-export function updateFactoryClass(data) {
-  return request({
-    url: "/shopCategoryMall/updateCategory",
-    method: "post",
-    data
-  })
-}
-
-// 添加分类
-export function addFactoryClass(data) {
-  return request({
-    url: '/shopCategoryMall/addCategory',
-    data,
-    method: "post"
-  })
-}
-
-// 获取所有分类树
-export function getAllCategoryClassTree(data) {
-  return request({
-    url: "shopCategory/getAllTree",
-    data,
-    method: "get"
-  })
-}
-
-
-//  分页查询商家的收款码
-export function getAllPaymentCode(data) {
-  return request({
-    url: "/paymentCode/getAll",
-    data,
-    method: "post"
-  })
-}
-
-//  禁用该收款码
-export function disablePaymentCode(data) {
-  return request({
-    url: "/paymentCode/handle",
-    data,
-    method: "post"
-  })
-}
+import request from '@/utils/request'
+
+// ******商家列表******
+// 商家管理查询
+export function businessListGetAll(data) {
+  return request({
+    url: '/shop/getAll',
+    method: 'post',
+    data
+  })
+}
+
+// 新增商家
+export function businessListSave(data) {
+  return request({
+    url: '/shop/save',
+    method: 'post',
+    data
+  })
+}
+
+// 商家编辑查询
+export function businessListGetById(data) {
+  return request({
+    url: '/shop/getById',
+    method: 'post',
+    data
+  })
+}
+
+//   修改商家
+export function businessListUpdate(data) {
+  return request({
+    url: '/shop/update',
+    method: 'post',
+    data
+  })
+}
+
+// 启停用商家
+export function businessListStart(data) {
+  return request({
+    url: '/shop/start',
+    method: 'post',
+    data
+  })
+}
+
+export function delBusinessById(data) {
+  return request({
+    url: '/shop/cleanShop',
+    method: 'post',
+    data
+  })
+}
+
+// 入驻申请
+// 入驻申请管理查询
+export function settlementGetAll(data) {
+  return request({
+    url: '/check/getAll',
+    method: 'post',
+    data
+  })
+}
+
+// 入驻申请详情
+export function settlementGetById(data) {
+  return request({
+    url: '/check/getById',
+    method: 'post',
+    data
+  })
+}
+
+// 处理
+export function settlementHandle(data) {
+  return request({
+    url: '/check/handle',
+    method: 'post',
+    data
+  })
+}
+
+// 删除
+export function settlementDelete(data) {
+  return request({
+    url: '/check/delete',
+    method: 'post',
+    data
+  })
+}
+
+// **********************关键词**********************
+// 启停用
+export function wordStart(data) {
+  return request({
+    url: '/word/start',
+    method: 'post',
+    data
+  })
+}
+
+// 启停用
+export function wordGetAll(data) {
+  return request({
+    url: '/word/getAll',
+    method: 'post',
+    data
+  })
+}
+
+// 添加关键词
+export function wordAdd(data) {
+  return request({
+    url: '/word/save',
+    method: 'post',
+    data
+  })
+}
+
+// 修改关键词查询
+export function wordGetById(data) {
+  return request({
+    url: '/word/getById',
+    method: 'post',
+    data
+  })
+}
+
+// 修改关键词
+export function wordUpdate(data) {
+  return request({
+    url: '/word/update',
+    method: 'post',
+    data
+  })
+}
+
+// 删除关键词
+export function wordDelete(data) {
+  return request({
+    url: '/word/delete',
+    method: 'post',
+    data
+  })
+}
+
+
+// **********************商家分类**********************
+// 添加商家分类
+export function businessClassList(data) {
+  return request({
+    url: '/shopCategory/getAll',
+    method: "post",
+    data
+  })
+}
+
+// 根据一级获取
+export function businessClassListById(data) {
+  return request({
+    url: "/shopCategory/getById",
+    method: "post",
+    data
+  })
+}
+
+// 删除标签分类
+export function deleteBusinessClass(data) {
+  return request({
+    url: "/shopCategory/deleteCategory",
+    method: "post",
+    data
+  })
+}
+
+// 更新标签
+export function updateBusinessClass(data) {
+  return request({
+    url: "/shopCategory/updateCategory",
+    method: "post",
+    data
+  })
+}
+
+// 添加分类
+export function addBusinessClass(data) {
+  return request({
+    url: '/shopCategory/addCategory',
+    data,
+    method: "post"
+  })
+}
+
+
+// **********品牌工厂***********
+// 获取所有分类
+
+export function factoryClassList(data) {
+  return request({
+    url: '/shopCategoryMall/getAll',
+    method: "post",
+    data
+  })
+}
+
+export function factoryClassListById(data) {
+  return request({
+    url: "/shopCategoryMall/getById",
+    method: "post",
+    data
+  })
+}
+
+// 删除标签分类
+export function deleteFactoryClass(data) {
+  return request({
+    url: "/shopCategoryMall/deleteCategory",
+    method: "post",
+    data
+  })
+}
+
+// 更新标签
+export function updateFactoryClass(data) {
+  return request({
+    url: "/shopCategoryMall/updateCategory",
+    method: "post",
+    data
+  })
+}
+
+// 添加分类
+export function addFactoryClass(data) {
+  return request({
+    url: '/shopCategoryMall/addCategory',
+    data,
+    method: "post"
+  })
+}
+
+// 获取所有分类树
+export function getAllCategoryClassTree(data) {
+  return request({
+    url: "shopCategory/getAllTree",
+    data,
+    method: "get"
+  })
+}
+
+
+//  分页查询商家的收款码
+export function getAllPaymentCode(data) {
+  return request({
+    url: "/paymentCode/getAll",
+    data,
+    method: "post"
+  })
+}
+
+//  禁用该收款码
+export function disablePaymentCode(data) {
+  return request({
+    url: "/paymentCode/handle",
+    data,
+    method: "post"
+  })
+}
+
+// **********商家代金券提现申请***********
+
+//  查询申请列表
+export function getWithdrawalApplicationList(data) {
+  return request({
+    url: "/shop-vouchers-withdrawal-qualification/getWithdrawalQualificationAll",
+    data,
+    method: "post"
+  })
+}
+
+// 审核
+export function examineWithdrawalApplication(data) {
+  return request({
+    url: "/shop-vouchers-withdrawal-qualification/auditWithdrawalQualification",
+    data,
+    method: "post"
+  })
+}
+
+
+// 代金券提现记录
+export function getWithdrawalRecortAllApi(data) {
+  return request({
+    url: "/shop-vouchers-withdrawal-qualification/getWithdrawalRecortAll",
+    data,
+    method: "post"
+  })
+}

+ 10 - 0
src/api/withdrawal.js

@@ -19,6 +19,16 @@ export function withdrawalGetById(data) {
   })
 }
 
+// 代金券提现查看
+export function withdrawalGetById2(data) {
+  return request({
+    url: '/withdrawal/getById2',
+    method: 'post',
+    data
+  })
+}
+
+
 // 查询惠市宝订单的分账信息
 export function getWithdrawalHsbOrderDistribution(params) {
   return request({

+ 100 - 0
src/views/business/voucherApply/Examine.vue

@@ -0,0 +1,100 @@
+<template>
+  <el-dialog title="商家代金券提现审核" :visible.sync="examineVisible" width="30%" :close-on-click-modal="false">
+    <el-form ref="examineFormRef" :model="form" label-width="auto" :rules="rules">
+      <el-form-item label="审核状态" prop="auditStatus">
+        <el-radio-group v-model="form.auditStatus">
+          <el-radio :label="2">通过</el-radio>
+          <el-radio :label="3">不通过</el-radio>
+        </el-radio-group>
+      </el-form-item>
+
+      <el-form-item v-if="form.auditStatus === 2" label="提现比例, 范围:0 ~ 40" prop="ratio" :rules="[{ validator: validateRatio, trigger: 'blur' }]">
+        <el-input placeholder="请输入提现比例" v-model="form.ratio">
+          <template slot="append">%</template>
+        </el-input>
+      </el-form-item>
+    </el-form>
+    <span slot="footer" class="dialog-footer">
+      <el-button size="mini" @click="examineVisible = false">取 消</el-button>
+      <el-button size="mini" type="primary" @click="handleSubmit" :loading="isLoading">确 定</el-button>
+    </span>
+  </el-dialog>
+</template>
+
+<script>
+// api docs: https://www.showdoc.com.cn/2068420669770919/11538603024917661
+import { examineWithdrawalApplication } from '@/api/business'
+
+export default {
+  data() {
+    return {
+      examineVisible: false,
+      form: {
+        id: '',
+        auditStatus: 2, // 1=已申请、2=审核通过、3=审核不通过
+        ratio: '' // 提现比例,最高不能超过0.4, [0, 40]
+      },
+      rules: {
+        auditStatus: [{ required: true, message: '请选择审核状态', type: 'number' }]
+      },
+      isLoading: false
+    }
+  },
+
+  watch: {
+    examineVisible(val) {
+      if (!val) {
+        this.reset()
+      }
+    }
+  },
+
+  methods: {
+    open(row) {
+      if (!row.id) {
+        return this.$message.error('数据错误')
+      }
+      this.form.id = row.id
+      this.examineVisible = true
+    },
+
+    validateRatio(rule, value, callback) {
+      const number = Number(value)
+      if (isNaN(number)) {
+        callback(new Error('提现比例必须是数字'))
+      } else if (!Number.isInteger(number)) {
+        callback(new Error('必须是整数'))
+      } else if (number <= 0 || number > 40) {
+        callback(new Error('提现比例必须大于0且小于等于40'))
+      } else {
+        callback()
+      }
+    },
+
+    async handleSubmit() {
+      this.isLoading = true
+      try {
+        await this.$refs.examineFormRef.validate()
+        const data = JSON.parse(JSON.stringify(this.form))
+        data.ratio = (data.ratio / 100).toFixed(2)
+        const res = await examineWithdrawalApplication(data)
+        if (res.code == '200') {
+          this.$message.success('审核成功')
+          this.$emit('refresh')
+          this.examineVisible = false
+        }
+      } finally {
+        this.isLoading = false
+      }
+    },
+
+    reset() {
+      this.$refs.examineFormRef.resetFields()
+      this.form.auditStatus = 2
+      this.form.ratio = ''
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped></style>

+ 130 - 0
src/views/business/voucherApply/index.vue

@@ -0,0 +1,130 @@
+<template>
+  <div class="app-container">
+    <!-- 查询和其他操作 -->
+    <!-- <div class="filter-container">
+      <el-input v-model="listQuery.shopName" 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>
+      <br />
+      <el-button size="mini" type="primary" icon="el-icon-plus" @click="$refs.EditModal && $refs.EditModal.handleOpen({ shopId: '' })">添加</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" label="商家ID" prop="shopId" fixed="left" />
+        <el-table-column align="center" label="商家名称 " prop="shopName"></el-table-column>
+
+        <el-table-column align="center" label="审核状态" prop="auditStatus">
+          <template slot-scope="{ row }">
+            <el-tag v-if="row.auditStatus === 2" :style="{ marginRight: '6px' }" type="success">已通过</el-tag>
+            <el-tag v-if="row.auditStatus === 1" :style="{ marginRight: '6px' }" type="warning">已申请</el-tag>
+            <el-tag v-if="row.auditStatus === 3" :style="{ marginRight: '6px' }" type="danger">不通过</el-tag>
+          </template>
+        </el-table-column>
+
+        <el-table-column align="center" label="提现比例" prop="ratio">
+          <template slot-scope="{ row }">
+            <el-tag v-if="row.ratio" :style="{ marginRight: '6px' }" type="success">{{ row.ratio * 100 + '%' }}</el-tag>
+            <span v-else>--</span>
+          </template>
+        </el-table-column>
+
+        <el-table-column align="center" label="操作" width="220" fixed="right" class-name="small-padding fixed-width">
+          <template slot-scope="{ row }">
+            <el-button :disabled="[2, 3].includes(row.auditStatus)" type="warning" size="mini" @click="handleDetail(row)">资格审核</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+    </div>
+
+    <div style="padding-top: 10px;">
+      <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>
+
+    <Examine @refresh="refresh" ref="examineRef"></Examine>
+  </div>
+</template>
+
+<script>
+import { getWithdrawalApplicationList } from '@/api/business'
+import Examine from './Examine.vue'
+
+export default {
+  name: 'voucherApply',
+  components: { Examine },
+  data() {
+    return {
+      list: [],
+      total: 0,
+      listLoading: true,
+      listQuery: {
+        page: 1,
+        pageSize: 20
+      }
+    }
+  },
+  created() {
+    this.getList()
+  },
+  methods: {
+    async getList() {
+      this.listLoading = true
+      try {
+        const res = await getWithdrawalApplicationList(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.examineRef && this.$refs.examineRef.open(row)
+    },
+    refresh() {
+      this.listQuery.page = 1
+      this.getList()
+    }
+  }
+}
+</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>

+ 100 - 94
src/views/commissionAllocation/gradeCommission/components/EditModal.vue

@@ -18,99 +18,103 @@
           <el-option label="组合活动" :value="6" />
         </el-select>
       </el-form-item>
-      <el-form-item label="团长规则" prop="leadersRule">
-        <el-select v-model="formData.leadersRule" size="mini" placeholder="请选择团长规则">
-          <el-option label="比例" :value="1" />
-          <el-option label="金额" :value="2" />
-        </el-select>
-      </el-form-item>
-      <el-form-item v-if="formData.leadersRule" label="直接团长规则" prop="leadersMoney">
-        <el-input v-model="formData.leadersMoney" placeholder="请输入直接团长规则" style="width: 250px">
-          <template #append>
-            <div v-if="formData.leadersRule === 1">%</div>
-            <div v-else-if="formData.leadersRule === 2">元</div>
-          </template>
-        </el-input>
-      </el-form-item>
-      <el-form-item v-if="formData.leadersRule" label="间接团长规则" prop="leadersInMoney">
-        <el-input v-model="formData.leadersInMoney" placeholder="请输入间接团长规则" style="width: 250px">
-          <template #append>
-            <div v-if="formData.leadersRule === 1">%</div>
-            <div v-else-if="formData.leadersRule === 2">元</div>
-          </template>
-        </el-input>
-      </el-form-item>
-      <el-form-item label="合伙人规则" prop="partnerRule">
-        <el-select v-model="formData.partnerRule" size="mini" placeholder="请选择合伙人规则">
-          <el-option label="比例" :value="1" />
-          <el-option label="金额" :value="2" />
-        </el-select>
-      </el-form-item>
-      <el-form-item v-if="formData.partnerRule" label="直接合伙人规则" prop="partnerMoney">
-        <el-input v-model="formData.partnerMoney" placeholder="请输入直接合伙人规则" style="width: 250px">
-          <template #append>
-            <div v-if="formData.partnerRule === 1">%</div>
-            <div v-else-if="formData.partnerRule === 2">元</div>
-          </template>
-        </el-input>
-      </el-form-item>
-      <el-form-item v-if="formData.partnerRule" label="间接合伙人规则" prop="partnerInMoney">
-        <el-input v-model="formData.partnerInMoney" placeholder="请输入间接合伙人规则" style="width: 250px">
-          <template #append>
-            <div v-if="formData.partnerRule === 1">%</div>
-            <div v-else-if="formData.partnerRule === 2">元</div>
-          </template>
-        </el-input>
-      </el-form-item>
-      <el-form-item label="加盟商规则" prop="franchiseeRule">
-        <el-select v-model="formData.franchiseeRule" size="mini" placeholder="请选择加盟商规则">
-          <el-option label="比例" :value="1" />
-          <el-option label="金额" :value="2" />
-        </el-select>
-      </el-form-item>
-      <el-form-item v-if="formData.franchiseeRule" label="加盟商佣金规则" prop="franchiseeMoney">
-        <el-input v-model="formData.franchiseeMoney" placeholder="请输入加盟商佣金规则" style="width: 250px">
-          <template #append>
-            <div v-if="formData.franchiseeRule === 1">%</div>
-            <div v-else-if="formData.franchiseeRule === 2">元</div>
-          </template>
-        </el-input>
-      </el-form-item>
-      <el-form-item label="代理商规则" prop="agentRule">
-        <el-select v-model="formData.agentRule" size="mini" placeholder="请选择代理商规则">
-          <el-option label="比例" :value="1" />
-          <el-option label="金额" :value="2" />
-        </el-select>
-      </el-form-item>
-      <el-form-item v-if="formData.agentRule" label="代理商佣金规则" prop="agentMoney">
-        <el-input v-model="formData.agentMoney" placeholder="请输入代理商佣金规则" style="width: 250px">
-          <template #append>
-            <div v-if="formData.agentRule === 1">%</div>
-            <div v-else-if="formData.agentRule === 2">元</div>
-          </template>
-        </el-input>
-      </el-form-item>
-      <el-form-item label="社区店规则" prop="communityRule">
-        <el-select v-model="formData.communityRule" size="mini" placeholder="请选择社区店规则">
-          <el-option label="比例" :value="1" />
-          <el-option label="金额" :value="2" />
-        </el-select>
-      </el-form-item>
-      <el-form-item v-if="formData.communityRule" label="社区店佣金规则" prop="communityMoney">
-        <el-input v-model="formData.communityMoney" placeholder="请输入社区店佣金规则" style="width: 250px">
-          <template #append>
-            <div v-if="formData.communityRule === 1">%</div>
-            <div v-else-if="formData.communityRule === 2">元</div>
-          </template>
-        </el-input>
-      </el-form-item>
-      <el-form-item label="分佣来源" prop="sourceType">
-        <el-select v-model="formData.sourceType" size="mini" placeholder="请选择分佣来源">
-          <el-option label="订单金额" :value="1" />
-          <el-option label="赠送代金券" :value="2" />
-          <el-option label="消费金" :value="3" />
-        </el-select>
-      </el-form-item>
+      <div v-show="[0, 1].includes(type)">
+        <el-form-item label="团长规则" prop="leadersRule">
+          <el-select v-model="formData.leadersRule" size="mini" placeholder="请选择团长规则">
+            <el-option label="比例" :value="1" />
+            <el-option label="金额" :value="2" />
+          </el-select>
+        </el-form-item>
+        <el-form-item v-if="formData.leadersRule" label="直接团长规则" prop="leadersMoney">
+          <el-input v-model="formData.leadersMoney" placeholder="请输入直接团长规则" style="width: 250px">
+            <template #append>
+              <div v-if="formData.leadersRule === 1">%</div>
+              <div v-else-if="formData.leadersRule === 2">元</div>
+            </template>
+          </el-input>
+        </el-form-item>
+        <el-form-item v-if="formData.leadersRule" label="间接团长规则" prop="leadersInMoney">
+          <el-input v-model="formData.leadersInMoney" placeholder="请输入间接团长规则" style="width: 250px">
+            <template #append>
+              <div v-if="formData.leadersRule === 1">%</div>
+              <div v-else-if="formData.leadersRule === 2">元</div>
+            </template>
+          </el-input>
+        </el-form-item>
+        <el-form-item label="合伙人规则" prop="partnerRule">
+          <el-select v-model="formData.partnerRule" size="mini" placeholder="请选择合伙人规则">
+            <el-option label="比例" :value="1" />
+            <el-option label="金额" :value="2" />
+          </el-select>
+        </el-form-item>
+        <el-form-item v-if="formData.partnerRule" label="直接合伙人规则" prop="partnerMoney">
+          <el-input v-model="formData.partnerMoney" placeholder="请输入直接合伙人规则" style="width: 250px">
+            <template #append>
+              <div v-if="formData.partnerRule === 1">%</div>
+              <div v-else-if="formData.partnerRule === 2">元</div>
+            </template>
+          </el-input>
+        </el-form-item>
+        <el-form-item v-if="formData.partnerRule" label="间接合伙人规则" prop="partnerInMoney">
+          <el-input v-model="formData.partnerInMoney" placeholder="请输入间接合伙人规则" style="width: 250px">
+            <template #append>
+              <div v-if="formData.partnerRule === 1">%</div>
+              <div v-else-if="formData.partnerRule === 2">元</div>
+            </template>
+          </el-input>
+        </el-form-item>
+      </div>
+      <div v-show="[0, 2].includes(type)">
+        <el-form-item label="加盟商规则" prop="franchiseeRule">
+          <el-select v-model="formData.franchiseeRule" size="mini" placeholder="请选择加盟商规则">
+            <el-option label="比例" :value="1" />
+            <el-option label="金额" :value="2" />
+          </el-select>
+        </el-form-item>
+        <el-form-item v-if="formData.franchiseeRule" label="加盟商佣金规则" prop="franchiseeMoney">
+          <el-input v-model="formData.franchiseeMoney" placeholder="请输入加盟商佣金规则" style="width: 250px">
+            <template #append>
+              <div v-if="formData.franchiseeRule === 1">%</div>
+              <div v-else-if="formData.franchiseeRule === 2">元</div>
+            </template>
+          </el-input>
+        </el-form-item>
+        <el-form-item label="代理商规则" prop="agentRule">
+          <el-select v-model="formData.agentRule" size="mini" placeholder="请选择代理商规则">
+            <el-option label="比例" :value="1" />
+            <el-option label="金额" :value="2" />
+          </el-select>
+        </el-form-item>
+        <el-form-item v-if="formData.agentRule" label="代理商佣金规则" prop="agentMoney">
+          <el-input v-model="formData.agentMoney" placeholder="请输入代理商佣金规则" style="width: 250px">
+            <template #append>
+              <div v-if="formData.agentRule === 1">%</div>
+              <div v-else-if="formData.agentRule === 2">元</div>
+            </template>
+          </el-input>
+        </el-form-item>
+        <el-form-item label="社区店规则" prop="communityRule">
+          <el-select v-model="formData.communityRule" size="mini" placeholder="请选择社区店规则">
+            <el-option label="比例" :value="1" />
+            <el-option label="金额" :value="2" />
+          </el-select>
+        </el-form-item>
+        <el-form-item v-if="formData.communityRule" label="社区店佣金规则" prop="communityMoney">
+          <el-input v-model="formData.communityMoney" placeholder="请输入社区店佣金规则" style="width: 250px">
+            <template #append>
+              <div v-if="formData.communityRule === 1">%</div>
+              <div v-else-if="formData.communityRule === 2">元</div>
+            </template>
+          </el-input>
+        </el-form-item>
+        <el-form-item label="分佣来源" prop="sourceType">
+          <el-select v-model="formData.sourceType" size="mini" placeholder="请选择分佣来源">
+            <el-option label="订单金额" :value="1" />
+            <el-option label="赠送代金券" :value="2" />
+            <el-option label="消费金" :value="3" />
+          </el-select>
+        </el-form-item>
+      </div>
     </el-form>
     <template #footer>
       <span class="dialog-footer">
@@ -134,6 +138,7 @@ export default {
         width: '820px',
         title: ''
       },
+      type: 0,
       visible: false,
       activityList: [],
       formData: {
@@ -199,7 +204,8 @@ export default {
       const res = await getAllPlatformBeeCurrency({})
       this.activityList = res.data
     },
-    handleOpen(params = {}) {
+    handleOpen(params = {}, type) {
+      this.type = type
       this.modalOptions.title = params.ruleId ? '编辑平台消费金活动分佣规则' : '添加平台消费金活动分佣规则'
       this.formData = Object.assign(this.$options.data().formData, params, {
         ruleId: params.ruleId || '',

+ 39 - 58
src/views/commissionAllocation/gradeCommission/index.vue

@@ -2,37 +2,20 @@
   <div class="app-container">
     <!-- 查询和其他操作 -->
     <div class="filter-container">
-      <el-select
-        v-model="listQuery.activityType" clearable size="mini" class="filter-item"
-        style="width: 200px;" placeholder="请选择活动类型"
-      >
+      <el-select v-model="listQuery.activityType" clearable size="mini" class="filter-item" style="width: 200px" placeholder="请选择活动类型">
         <el-option label="499" :value="1" />
         <el-option label="商圈" :value="2" />
         <el-option label="爆品" :value="3" />
         <el-option label="消费金" :value="4" />
       </el-select>
-      <el-button
-        size="mini" class="filter-item" type="primary" icon="el-icon-search"
-        style="margin-left:10px;"
-        @click="handleSearch"
-      >
-        查找
-      </el-button>
+      <el-button size="mini" class="filter-item" type="primary" icon="el-icon-search" style="margin-left: 10px" @click="handleSearch">查找</el-button>
       <br />
-      <el-button
-        size="mini" type="primary" icon="el-icon-plus"
-        @click="$refs.EditModal && $refs.EditModal.handleOpen({ ruleId: '' })"
-      >
-        添加
-      </el-button>
+      <el-button size="mini" type="primary" icon="el-icon-plus" @click="$refs.EditModal && $refs.EditModal.handleOpen({ ruleId: '' }, 0)">添加</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 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="ruleId" fixed="left" />
         <el-table-column align="center" width="80" label="活动ID" prop="activityId" fixed="left" show-overflow-tooltip />
         <el-table-column align="center" width="100" label="关联活动" prop="activityName" fixed="left" show-overflow-tooltip />
@@ -94,17 +77,12 @@
           </template>
         </el-table-column>
         <el-table-column align="center" width="150" label="创建时间" prop="createTime" />
-        <el-table-column align="center" label="操作" width="220" fixed="right" class-name="small-padding fixed-width">
+        <el-table-column align="center" label="操作" width="280" fixed="right" class-name="small-padding fixed-width">
           <template slot-scope="{ row }">
-            <el-button type="warning" size="mini" @click="handleDetail(row)">
-              详情
-            </el-button>
-            <el-button size="mini" @click="handleEdit(row)">
-              编辑
-            </el-button>
-            <el-button type="danger" size="mini" @click="handleDelete(row)">
-              删除
-            </el-button>
+            <el-button type="warning" size="mini" @click="handleDetail(row)">详情</el-button>
+            <el-button type="primary" size="mini" @click="handleEdit(row, 1)">编辑业务</el-button>
+            <el-button type="primary" size="mini" @click="handleEdit(row, 2)">编辑行政</el-button>
+            <el-button type="danger" size="mini" @click="handleDelete(row)">删除</el-button>
           </template>
         </el-table-column>
       </el-table>
@@ -112,10 +90,13 @@
 
     <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())"
+        :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>
 
@@ -170,8 +151,8 @@ export default {
     handleDetail(row) {
       this.$refs.DetailModal && this.$refs.DetailModal.handleOpen(row)
     },
-    handleEdit(row) {
-      this.$refs.EditModal && this.$refs.EditModal.handleOpen(row)
+    handleEdit(row, type) {
+      this.$refs.EditModal && this.$refs.EditModal.handleOpen(row, type)
     },
     handleDelete(row) {
       this.$confirm('确定删除此项?')
@@ -188,29 +169,29 @@ export default {
 
 <style lang="scss" scoped>
 .app-container {
-	padding: 20px;
-	display: flex;
-	flex-direction: column;
+  padding: 20px;
+  display: flex;
+  flex-direction: column;
 
-	.filter-container {
-		.filter-item {
-			display: inline-block;
-			vertical-align: middle;
-			margin-bottom: 10px;
-		}
-	}
+  .filter-container {
+    .filter-item {
+      display: inline-block;
+      vertical-align: middle;
+      margin-bottom: 10px;
+    }
+  }
 
-	.small-padding {
-		.cell {
-			padding-left: 5px;
-			padding-right: 5px;
-		}
-	}
+  .small-padding {
+    .cell {
+      padding-left: 5px;
+      padding-right: 5px;
+    }
+  }
 
-	.fixed-width {
-		.el-button--mini {
-			padding: 7px 10px;
-		}
-	}
+  .fixed-width {
+    .el-button--mini {
+      padding: 7px 10px;
+    }
+  }
 }
 </style>

+ 49 - 27
src/views/finance/withdrawal/components/DetailModal.vue

@@ -63,11 +63,14 @@
       </el-descriptions>
     </div>
 
-    <el-tabs value="relatedSettlement">
-      <el-tab-pane label="结算列表" name="relatedSettlement">
-        <div v-if="formData.relatedSettlement && formData.relatedSettlement.length" style="margin-top: 32px;">
+    <el-tabs v-model="tabsValue">
+      <el-tab-pane label="结算列表" name="relatedSettlement" v-if="![3, 4].includes(formData.withdrawalType)">
+        <div v-if="formData.relatedSettlement && formData.relatedSettlement.length" style="margin-top: 32px">
           <el-table
-            v-loading="!formData.relatedSettlement.length" height="60vh" element-loading-text="暂无结算数据" :data="formData.relatedSettlement"
+            v-loading="!formData.relatedSettlement.length"
+            height="60vh"
+            element-loading-text="暂无结算数据"
+            :data="formData.relatedSettlement"
             v-bind="{ stripe: true, size: 'small', border: true, fit: true, highlightCurrentRow: true }"
           >
             <el-table-column align="center" min-width="80" prop="id" label="ID" show-overflow-tooltip />
@@ -86,17 +89,13 @@
             </el-table-column>
             <el-table-column align="center" min-width="140" label="是否惠市宝订单结算" prop="isHsb">
               <template slot-scope="{ row }">
-                <div style="display: flex;justify-content: center;align-items: center;">
+                <div style="display: flex; justify-content: center; align-items: center">
                   <div>
                     <el-tag v-if="row.isHsb === '0'" effect="plain" type="info">否</el-tag>
                     <el-tag v-else-if="row.isHsb === '1'" effect="plain" type="success">是</el-tag>
                     <span v-else>--</span>
                   </div>
-                  <el-button
-                    v-if="row.isHsb === '1'"
-                    style="margin-left: 6px;" type="warning" size="mini"
-                    @click="$refs.LedgerInformation && $refs.LedgerInformation.handleOpen(formData, row.sn)"
-                  >
+                  <el-button v-if="row.isHsb === '1'" style="margin-left: 6px" type="warning" size="mini" @click="$refs.LedgerInformation && $refs.LedgerInformation.handleOpen(formData, row.sn)">
                     分账状态
                   </el-button>
                 </div>
@@ -107,12 +106,7 @@
             <el-table-column align="center" width="100" prop="withdrawalingAmount" label="提现中的金额" show-overflow-tooltip />
             <el-table-column align="center" label="操作" width="120" fixed="right" class-name="small-padding fixed-width">
               <template slot-scope="{ row }">
-                <el-button
-                  v-if="formData.relatedOrders[row.sn]" type="success" size="mini"
-                  @click="$refs.RelatedOrders && $refs.RelatedOrders.handleOpen(formData, row.sn)"
-                >
-                  关联订单
-                </el-button>
+                <el-button v-if="formData.relatedOrders[row.sn]" type="success" size="mini" @click="$refs.RelatedOrders && $refs.RelatedOrders.handleOpen(formData, row.sn)">关联订单</el-button>
               </template>
             </el-table-column>
           </el-table>
@@ -121,7 +115,24 @@
           <!-- 订单的分账状态信息 -->
           <LedgerInformation ref="LedgerInformation" @success="getInfo(formData.withdrawalId)" />
         </div>
-        <div v-else style="font-size: 16px;font-weight: bold;">无结算数据</div>
+        <div v-else style="font-size: 16px; font-weight: bold">无结算数据</div>
+      </el-tab-pane>
+
+      <el-tab-pane v-if="[3, 4].includes(formData.withdrawalType)" label="入账列表" name="entry">
+        <el-table :data="formData.withdrawalType === 3 ? formData.shopVoucherEntryRecordList : formData.shopVoucherExchangeEntryRecordList" border stripe>
+          <el-table-column type="index" width="50"></el-table-column>
+          <el-table-column align="center" prop="orderFormId" label="来源订单号"></el-table-column>
+          <el-table-column align="center" prop="number" label="代金券数量"></el-table-column>
+          <el-table-column align="center" prop="createTime" label="入账时间"></el-table-column>
+        </el-table>
+      </el-tab-pane>
+      <el-tab-pane v-if="[3, 4].includes(formData.withdrawalType)" label="出账列表" name="disbursement">
+        <el-table :data="formData.withdrawalType === 3 ? formData.shopVoucherOutgoinRecordList : formData.shopVoucherExchangeOutgoinRecordList" border stripe>
+          <el-table-column type="index" width="50"></el-table-column>
+          <el-table-column align="center" prop="orderFormId" label="来源订单号"></el-table-column>
+          <el-table-column align="center" prop="number" label="代金券数量"></el-table-column>
+          <el-table-column align="center" prop="createTime" label="出账时间"></el-table-column>
+        </el-table>
       </el-tab-pane>
     </el-tabs>
   </el-dialog>
@@ -130,7 +141,7 @@
 <script>
 import RelatedOrders from './RelatedOrders'
 import LedgerInformation from './LedgerInformation'
-import { withdrawalGetById } from '@/api/withdrawal'
+import { withdrawalGetById, withdrawalGetById2 } from '@/api/withdrawal'
 
 export default {
   name: 'DetailModal',
@@ -146,6 +157,7 @@ export default {
         title: '查看提现详情'
       },
       visible: false,
+      tabsValue: 'relatedSettlement',
       formData: {
         withdrawalId: '',
         shopName: '',
@@ -185,7 +197,16 @@ export default {
     async getInfo(id) {
       const loading = this.$loading({ text: '加载中' })
       try {
-        const res = await withdrawalGetById({ withdrawalId: id })
+        let api = null
+        if (![3, 4].includes(this.formData.withdrawalType)) {
+          api = withdrawalGetById
+          this.tabsValue = 'relatedSettlement'
+        } else {
+          api = withdrawalGetById2
+          this.tabsValue = 'entry'
+        }
+
+        const res = await api({ withdrawalId: id })
         this.formData = Object.assign(this.$options.data().formData, res.data, {
           withdrawalId: res.data.withdrawalId || '',
           shopName: res.data.shopName || '',
@@ -207,7 +228,8 @@ export default {
           summaryHsbSplitState: res.data.summaryHsbSplitState,
           summaryHsbSplitedAmount: res.data.summaryHsbSplitedAmount,
           summaryHsbSplitRemainAmount: res.data.summaryHsbSplitRemainAmount,
-          summaryNotHsbAmount: res.data.summaryNotHsbAmount
+          summaryNotHsbAmount: res.data.summaryNotHsbAmount,
+          withdrawalType: this.formData.withdrawalType
         })
       } finally {
         loading.close()
@@ -229,15 +251,15 @@ export default {
 // 	}
 // }
 .small-padding {
-	.cell {
-		padding-left: 5px;
-		padding-right: 5px;
-	}
+  .cell {
+    padding-left: 5px;
+    padding-right: 5px;
+  }
 }
 
 .fixed-width {
-	.el-button--mini {
-		padding: 7px 10px;
-	}
+  .el-button--mini {
+    padding: 7px 10px;
+  }
 }
 </style>

+ 167 - 187
src/views/finance/withdrawal/index.vue

@@ -1,187 +1,167 @@
-<!--  -->
-<template>
-  <div class="app-container">
-    <!-- 查询和其他操作 -->
-    <div class="filter-container">
-      <el-input
-        v-model="listQuery.shopName" clearable size="mini" class="filter-item"
-        style="width: 200px;"
-        placeholder="请输入店铺名称"
-      />
-      <el-input
-        v-model="listQuery.shopCode" clearable size="mini" class="filter-item"
-        style="width: 200px;margin-left: 10px;" placeholder="请输入店铺编码"
-      />
-      <el-date-picker
-        v-model="listQuery.startTime" type="date" value-format="yyyy-MM-dd" placeholder="选择日期"
-        size="mini" class="filter-item" style="width: 200px;margin-left: 10px;"
-      />
-      <el-select
-        v-model="listQuery.state" clearable size="mini" class="filter-item"
-        style="width: 200px;margin-left: 10px;" placeholder="请选择处理状态"
-      >
-        <el-option label="待处理" value="0" />
-        <el-option label="已处理" value="1" />
-        <el-option label="通过" value="2" />
-        <el-option label="拒绝" value="3" />
-        <el-option label="待确认" value="4" />
-      </el-select>
-      <el-button
-        size="mini" class="filter-item" type="primary" icon="el-icon-search"
-        style="margin-left: 10px;"
-        @click="handleSearch"
-      >
-        查找
-      </el-button>
-      <el-button size="mini" type="info" class="filter-item" @click="handleReset">
-        重置
-      </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="150" label="店铺名称" prop="shopName" show-overflow-tooltip />
-        <el-table-column align="center" min-width="150" label="店铺编码" prop="shopCode" show-overflow-tooltip />
-        <el-table-column align="center" width="120" label="提现金额" prop="withdrawalMoney" show-overflow-tooltip />
-        <el-table-column align="center" label="处理状态" prop="state">
-          <template slot-scope="{ row }">
-            <el-tag v-if="row.state === 0" effect="plain" type="info">待处理</el-tag>
-            <el-tag v-else-if="row.state === 1" effect="plain" type="success">已处理</el-tag>
-            <el-tag v-else-if="row.state === 2" effect="plain">通过</el-tag>
-            <el-tag v-else-if="row.state === 3" effect="plain" type="warning">拒绝</el-tag>
-            <el-tag v-else-if="row.state === 4" effect="plain" type="danger">待确认</el-tag>
-            <span v-else>--</span>
-          </template>
-        </el-table-column>
-        <el-table-column align="center" width="150" label="备注" prop="cause" show-overflow-tooltip />
-        <el-table-column label="操作" width="180" fixed="right" class-name="small-padding fixed-width">
-          <template slot-scope="{ row }">
-            <el-button type="warning" size="mini" @click="handleDetail(row)">
-              详情
-            </el-button>
-            <el-button v-if="(row.state == 0) || (row.state == 2)" size="mini" @click="handleResolve(row)">
-              处理
-            </el-button>
-            <el-button v-if="row.state == 4" type="text" @click="handleConfirmTong(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>
-
-    <!-- 提现处理 -->
-    <WithdrawalProcessing ref="WithdrawalProcessing" @success="getList" />
-    <!-- 查看详情 -->
-    <DetailModal ref="DetailModal" />
-  </div>
-</template>
-
-<script>
-
-import WithdrawalProcessing from './components/WithdrawalProcessing'
-import DetailModal from './components/DetailModal'
-import { withdrawalGetAll, updateWithdrawalByAllinpay } from '@/api/withdrawal'
-export default {
-  name: 'Withdrawal',
-  components: {
-    WithdrawalProcessing,
-    DetailModal
-  },
-  data() {
-    return {
-      listQuery: {
-        shopName: '', // 店铺名称
-        shopCode: '', // 店铺编号
-        startTime: '', // 申请时间数组
-        state: '', // 处理状态 1-已处理 0-未处理
-        page: 1,
-        pageSize: 10
-      },
-      list: [],
-      total: 0,
-      listLoading: true
-    }
-  },
-  mounted() {
-    this.getList()
-  },
-  methods: {
-    async getList() {
-      this.listLoading = true
-      try {
-        const res = await withdrawalGetAll(this.listQuery)
-        this.list = res.data.list
-        this.total = res.data.total
-      } finally {
-        this.listLoading = false
-      }
-    },
-    handleSearch() {
-      this.listQuery.page = 1
-      this.getList()
-    },
-    handleReset() {
-      this.listQuery = { shopName: '', shopCode: '', dates: [], state: '', page: 1, pageSize: 10 }
-      this.getList()
-    },
-    handleDetail(row) {
-      this.$refs.DetailModal && this.$refs.DetailModal.handleOpen(row)
-    },
-    handleResolve(row) {
-      this.$refs.WithdrawalProcessing && this.$refs.WithdrawalProcessing.handleOpen(row)
-    },
-    handleConfirmTong(row) {
-      this.$confirm('确定此项通联确认?')
-        .then(async () => {
-          await updateWithdrawalByAllinpay({ handleSn: row.handleSn, withdrawalId: row.withdrawalId })
-          this.$message({ message: '操作成功!', type: 'success' })
-          this.handleSearch()
-        })
-        .catch(() => {})
-    }
-  }
-}
-</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>
+<!--  -->
+<template>
+  <div class="app-container">
+    <!-- 查询和其他操作 -->
+    <div class="filter-container">
+      <el-input v-model="listQuery.shopName" clearable size="mini" class="filter-item" style="width: 200px" placeholder="请输入店铺名称" />
+      <el-input v-model="listQuery.shopCode" clearable size="mini" class="filter-item" style="width: 200px; margin-left: 10px" placeholder="请输入店铺编码" />
+      <el-date-picker v-model="listQuery.startTime" type="date" value-format="yyyy-MM-dd" placeholder="选择日期" size="mini" class="filter-item" style="width: 200px; margin-left: 10px" />
+      <el-select v-model="listQuery.state" clearable size="mini" class="filter-item" style="width: 200px; margin-left: 10px" placeholder="请选择处理状态">
+        <el-option label="待处理" value="0" />
+        <el-option label="已处理" value="1" />
+        <el-option label="通过" value="2" />
+        <el-option label="拒绝" value="3" />
+        <el-option label="待确认" value="4" />
+      </el-select>
+      <el-button size="mini" class="filter-item" type="primary" icon="el-icon-search" style="margin-left: 10px" @click="handleSearch">查找</el-button>
+      <el-button size="mini" type="info" class="filter-item" @click="handleReset">重置</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="150" label="店铺名称" prop="shopName" show-overflow-tooltip />
+        <el-table-column align="center" min-width="150" label="店铺编码" prop="shopCode" show-overflow-tooltip />
+        <el-table-column align="center" min-width="150" label="提现类型" prop="withdrawalType">
+          <template slot-scope="{ row }">
+            <el-tag v-if="row.withdrawalType === 1" effect="plain" type="info">普通订单</el-tag>
+            <el-tag v-else-if="row.withdrawalType === 2" effect="plain" type="success">交易金</el-tag>
+            <el-tag v-else-if="row.withdrawalType === 3" effect="plain" type="warning">充值代金券</el-tag>
+            <el-tag v-else-if="row.withdrawalType === 4" effect="plain" type="danger">兑换代金券</el-tag>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" width="120" label="提现金额" prop="withdrawalMoney" show-overflow-tooltip />
+        <el-table-column align="center" label="处理状态" prop="state">
+          <template slot-scope="{ row }">
+            <el-tag v-if="row.state === 0" effect="plain" type="info">待处理</el-tag>
+            <el-tag v-else-if="row.state === 1" effect="plain" type="success">已处理</el-tag>
+            <el-tag v-else-if="row.state === 2" effect="plain">通过</el-tag>
+            <el-tag v-else-if="row.state === 3" effect="plain" type="warning">拒绝</el-tag>
+            <el-tag v-else-if="row.state === 4" effect="plain" type="danger">待确认</el-tag>
+            <span v-else>--</span>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" width="150" label="备注" prop="cause" show-overflow-tooltip />
+        <el-table-column label="操作" width="180" fixed="right" class-name="small-padding fixed-width">
+          <template slot-scope="{ row }">
+            <el-button type="warning" size="mini" @click="handleDetail(row)">详情</el-button>
+            <el-button v-if="row.state == 0 || row.state == 2" size="mini" @click="handleResolve(row)">处理</el-button>
+            <el-button v-if="row.state == 4" type="text" @click="handleConfirmTong(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>
+
+    <!-- 提现处理 -->
+    <WithdrawalProcessing ref="WithdrawalProcessing" @success="getList" />
+    <!-- 查看详情 -->
+    <DetailModal ref="DetailModal" />
+  </div>
+</template>
+
+<script>
+import WithdrawalProcessing from './components/WithdrawalProcessing'
+import DetailModal from './components/DetailModal'
+import { withdrawalGetAll, updateWithdrawalByAllinpay } from '@/api/withdrawal'
+export default {
+  name: 'Withdrawal',
+  components: {
+    WithdrawalProcessing,
+    DetailModal
+  },
+  data() {
+    return {
+      listQuery: {
+        shopName: '', // 店铺名称
+        shopCode: '', // 店铺编号
+        startTime: '', // 申请时间数组
+        state: '', // 处理状态 1-已处理 0-未处理
+        page: 1,
+        pageSize: 10
+      },
+      list: [],
+      total: 0,
+      listLoading: true
+    }
+  },
+  mounted() {
+    this.getList()
+  },
+  methods: {
+    async getList() {
+      this.listLoading = true
+      try {
+        const res = await withdrawalGetAll(this.listQuery)
+        this.list = res.data.list
+        this.total = res.data.total
+      } finally {
+        this.listLoading = false
+      }
+    },
+    handleSearch() {
+      this.listQuery.page = 1
+      this.getList()
+    },
+    handleReset() {
+      this.listQuery = { shopName: '', shopCode: '', dates: [], state: '', page: 1, pageSize: 10 }
+      this.getList()
+    },
+    handleDetail(row) {
+      this.$refs.DetailModal && this.$refs.DetailModal.handleOpen(row)
+    },
+    handleResolve(row) {
+      this.$refs.WithdrawalProcessing && this.$refs.WithdrawalProcessing.handleOpen(row)
+    },
+    handleConfirmTong(row) {
+      this.$confirm('确定此项通联确认?')
+        .then(async () => {
+          await updateWithdrawalByAllinpay({ handleSn: row.handleSn, withdrawalId: row.withdrawalId })
+          this.$message({ message: '操作成功!', type: 'success' })
+          this.handleSearch()
+        })
+        .catch(() => {})
+    }
+  }
+}
+</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>

+ 149 - 0
src/views/finance/withdrawalRecord/index.vue

@@ -0,0 +1,149 @@
+<template>
+  <div class="app-container">
+    <!-- 查询和其他操作 -->
+    <!-- <div class="filter-container">
+      <el-input v-model="listQuery.shopName" 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>
+      <br />
+      <el-button size="mini" type="primary" icon="el-icon-plus" @click="$refs.EditModal && $refs.EditModal.handleOpen({ shopId: '' })">添加</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" label="#" type="index" width="50"></el-table-column>
+        <el-table-column align="center" prop="shopId" label="商家ID" width="70" />
+        <el-table-column align="center" prop="vouchersNumber" label="代金券提现数量" width="120" />
+        <el-table-column align="center" prop="amount" label="实际提现金额" width="120" />
+        <el-table-column align="center" prop="type" label="代金券提现类型" width="120">
+          <template slot-scope="{ row }">
+            <el-tag v-if="row.type === 1">充值</el-tag>
+            <el-tag v-if="row.type === 2">兑换</el-tag>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" prop="ratio" label="代金券提现比例" width="120">
+          <template slot-scope="{ row }">
+            <el-tag type="success">{{ parseInt(row.ratio * 100) + '%' }}</el-tag>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" prop="handleSn" label="对应提现单号" width="200" />
+        <el-table-column align="center" prop="entryAccountSn" label="入账单号集合">
+          <template slot-scope="{ row }">
+            <el-popover placement="right" width="400" trigger="click">
+              <ul class="popover-list">
+                <li class="popover-list-li" v-for="(item, index) in row.entryAccountSn.split(',')" :key="item + index">{{ item }}</li>
+              </ul>
+              <el-button slot="reference" type="primary" size="mini">查看</el-button>
+            </el-popover>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" prop="outgoingAccountSn" label="出账单号集合">
+          <template slot-scope="{ row }">
+            <el-popover placement="right" width="400" trigger="click">
+              <ul class="popover-list">
+                <li class="popover-list-li" v-for="(item, index) in row.outgoingAccountSn.split(',')" :key="item + index">{{ item }}</li>
+              </ul>
+              <el-button slot="reference" type="primary" size="mini">查看</el-button>
+            </el-popover>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" prop="createTime" label="创建时间"></el-table-column>
+      </el-table>
+    </div>
+
+    <div style="padding-top: 10px">
+      <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>
+  </div>
+</template>
+
+<script>
+import { getWithdrawalRecortAllApi } from '@/api/business'
+
+export default {
+  name: 'withdrawalRecord',
+  data() {
+    return {
+      list: [],
+      total: 0,
+      listLoading: true,
+      listQuery: {
+        page: 1,
+        pageSize: 20
+      }
+    }
+  },
+  created() {
+    this.getList()
+  },
+  methods: {
+    async getList() {
+      this.listLoading = true
+      try {
+        const res = await getWithdrawalRecortAllApi(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.examineRef && this.$refs.examineRef.open(row)
+    },
+    refresh() {
+      this.listQuery.page = 1
+      this.getList()
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.popover-list {
+  height: 300px;
+  overflow-y: auto;
+
+  &::-webkit-scrollbar {
+    background-color: transparent;
+    width: 10px;
+  }
+
+  &::-webkit-scrollbar-thumb {
+    background-color: #e9e9e9;
+    border-radius: 5px;
+    width: 10px;
+  }
+
+  .popover-list-li {
+    height: 30px;
+    line-height: 30px;
+    padding-left: 20px;
+    position: relative;
+
+    &::after {
+      content: '';
+      position: absolute;
+      display: block;
+      width: 10px;
+      height: 10px;
+      border-radius: 50%;
+      background-color: #409eff;
+      top: 50%;
+      left: 0;
+      transform: translateY(-50%);
+    }
+  }
+}
+</style>