Browse Source

提现管理模块

chenrui 6 months ago
parent
commit
b9386060f1

+ 26 - 1
src/config/router.config.js

@@ -752,7 +752,7 @@ export const asyncRouterMap = [
             meta: {
               title: '提现管理',
               icon: 'monitor',
-              permission: 'M_NGS_withdrawalManagement'
+              permission: 'M_NGS_withdrawalManagementNew'
             },
             hideChildrenInMenu: true,
             children: [
@@ -769,6 +769,31 @@ export const asyncRouterMap = [
               }
             ]
           },
+          {
+            path: '/numsGoodsShelves/withdrawalManagementNew',
+            redirect: '/numsGoodsShelves/withdrawalManagementNew/list',
+            name: 'withdrawalManagementNew',
+            component: BlankLayout,
+            meta: {
+              title: '提现管理',
+              icon: 'monitor'
+              // permission: 'M_withdrawalManagementNew'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'list',
+                name: 'withdrawalManagementNewList',
+                component: () => import(/* webpackChunkName: "numsGoodsShelves" */ '@/views/numsGoodsShelves/withdrawalManagementNew/list.vue'),
+                meta: {
+                  title: '提现管理列表',
+                  icon: 'monitor',
+                  hidden: true
+                  // permission: 'M_withdrawalManagementNewList'
+                }
+              }
+            ]
+          },
           // {
           //   path: '/numsGoodsShelves/recallStockManagement',
           //   redirect: '/numsGoodsShelves/recallStockManagement/list',

+ 8 - 13
src/views/numsGoodsShelves/withdrawalManagement/list.vue

@@ -6,7 +6,7 @@
         <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
           <a-row :gutter="15">
             <a-col :xl="6" :lg="6" :md="12" :sm="24">
-              <a-form-item label="提现时间">
+              <a-form-item label="交易时间">
                 <rangeDate id="withdrawa-time" ref="rangeDate" v-model="time" @change="dateChange" />
               </a-form-item>
             </a-col>
@@ -18,12 +18,13 @@
         </a-form>
       </div>
       <div style="margin:10px 0">
-        <div style="margin:10px 0">
-          账户总金额:¥100.00(包含可提现金额:<span>{{ pageInfo&&pageInfo.activeAmount?toThousands(pageInfo.activeAmount):'--' }}</span>,在途金额:¥12.00)
-          <p style="margin-top:10px;">(提示:①提现手续费为0.5元/笔;②资金到账周期为工作日+1天;③销售单需审核通过后才能提现;④销售单审核不通过或修理厂取消订单后将会在1-3个工作日原路返回到修理厂)</p>
+        <div style="display: flex;align-items: center;padding: 2px 0;">
+          <div style="display: flex;align-items: center;">
+            可提现金额:<span>{{ pageInfo&&pageInfo.activeAmount?toThousands(pageInfo.activeAmount):'--' }}</span>
+            <a-button id="withdrawa-tixian" size="small" type="primary" class="button-primary" @click="handleTX">申请提现</a-button>
+            <span>(提示:① 提现手续费为0.5元/笔;② 资金到账周期为工作日+1天)</span>
+          </div>
         </div>
-        <a-button id="withdrawa-tixian" type="primary" class="button-primary" @click="handleTX">申请提现</a-button>
-        <a-button id="withdrawa-tixian" class="button-info" @click="showBillFlowModal=true">账单流水</a-button>
       </div>
       <s-table
         class="sTable fixPagination"
@@ -40,8 +41,6 @@
     </a-spin>
     <!-- 申请提现 -->
     <applyWithdrawal :isOpenModal="showModal" :currentData="currentData" @close="showModal=false" @refresh="getPageInfo"></applyWithdrawal>
-    <!-- 交易流水 -->
-    <billFlowModal :openModal="showBillFlowModal" @close="showBillFlowModal=false" @ok="showBillFlowModal=false"></billFlowModal>
   </a-card>
 </template>
 
@@ -49,13 +48,11 @@
 import { commonMixin } from '@/utils/mixin'
 import { STable } from '@/components'
 import applyWithdrawal from './applyWithdrawal.vue'
-import billFlowModal from './billFlowModal.vue'
-
 import rangeDate from '@/views/common/rangeDate.vue'
 import { queryMerchantCashOutPage, merchantCashOutDetail } from '@/api/merchant'
 export default {
   mixins: [commonMixin],
-  components: { STable, applyWithdrawal, billFlowModal, rangeDate },
+  components: { STable, applyWithdrawal, rangeDate },
   data () {
     const _this = this
     return {
@@ -64,7 +61,6 @@ export default {
       tableHeight: 0, // 表格高度
       showModal: false, // 是否显示申请提现弹窗
       currentData: null, // 当前行数据
-      showBillFlowModal: false,
       time: [], // 提现时间
       pageInfo: null, // 详情信息
       queryParam: {
@@ -77,7 +73,6 @@ export default {
         { title: '提现时间', dataIndex: 'cashOutDate', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '申请提现金额', dataIndex: 'amount', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } },
         { title: '开户名', dataIndex: 'bankAccount', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '开户银行', dataIndex: 'bankAccount', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '银行卡号', dataIndex: 'bankCard', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '提现人', dataIndex: 'operName', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '状态', dataIndex: 'stateDictValue', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },

+ 150 - 0
src/views/numsGoodsShelves/withdrawalManagementNew/applyWithdrawal.vue

@@ -0,0 +1,150 @@
+<template>
+  <a-modal
+    v-model="opened"
+    :title="title"
+    centered
+    :maskClosable="false"
+    :confirmLoading="confirmLoading"
+    :width="560"
+    :footer="null"
+    @cancel="cancel"
+  >
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-form-model
+        id="applyWithdrawal-form"
+        ref="ruleForm"
+        :model="form"
+        :rules="rules"
+        :label-col="formItemLayout.labelCol"
+        :wrapper-col="formItemLayout.wrapperCol"
+      >
+        <a-form-model-item label="申请提现金额" prop="amount">
+          <a-input-number
+            v-model="form.amount"
+            :min="0.1"
+            style="width: 100%;"
+            :precision="2"
+            id="applyWithdrawal-amount"
+            placeholder="请输入正数(最多两位小数)"
+            allowClear />
+        </a-form-model-item>
+        <a-form-model-item label="实际扣除金额">
+          <span>{{ (serviceCharge||serviceCharge==0)?toThousands(serviceCharge,2):'--' }}元 </span><span style="color: #999;">(申请提现金额+提现手续费)</span>
+        </a-form-model-item>
+        <a-form-model-item label="提现账户">
+          <span style="display: block;" v-if="pageInfo">{{ pageInfo.merchantBankAccountEntity?pageInfo.merchantBankAccountEntity.bankAccount:'' }}{{ ' ( '+ pageInfo.dealerName +' ) ' }}</span>
+          <span v-if="pageInfo">{{ pageInfo.merchantBankAccountEntity?pageInfo.merchantBankAccountEntity.bankCard:"" }}</span>
+        </a-form-model-item>
+        <a-form-model-item :wrapper-col="{ span: 12, offset: 6 }" style="text-align: center;">
+          <a-button type="primary" :loading="confirmLoading" @click="handleSubmit" id="applyWithdrawal-btn-submit">确定</a-button>
+          <a-button @click="cancel" style="margin-left: 15px" id="applyWithdrawal-btn-back">取消</a-button>
+        </a-form-model-item>
+      </a-form-model>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { saveMerchantCashOut, merchantCashOutDetail } from '@/api/merchant'
+export default {
+  mixins: [commonMixin],
+  props: {
+    isOpenModal: {
+      type: Boolean,
+      default: false
+    },
+    currentData: {
+      type: Object,
+      default: function () {
+        return {}
+      }
+    }
+  },
+  computed: {
+    serviceCharge () {
+      return this.form.amount ? this.form.amount + 0.5 : 0
+    }
+  },
+  data () {
+    return {
+      formItemLayout: {
+        labelCol: { span: 6 },
+        wrapperCol: { span: 15 }
+      },
+      form: {
+        amount: '' // 金额
+      },
+      pageInfo: null,
+      opened: this.isOpenModal, // 提现弹框
+      title: '申请提现',
+      confirmLoading: false, // 确认按钮loading
+      spinning: false,
+      rules: { amount: [{ required: true, message: '请输入提现金额', trigger: 'blur' }] }
+    }
+  },
+  methods: {
+    // 获取详情信息
+    getPageInfo () {
+      this.spinning = true
+      merchantCashOutDetail({}).then(res => {
+        if (res.status == 200) {
+          this.pageInfo = res.data
+        } else {
+          this.pageInfo = null
+        }
+        this.spinning = false
+      })
+    },
+    // 保存
+    handleSubmit () {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const form = JSON.parse(JSON.stringify(_this.form))
+          form.serviceCharge = this.serviceCharge
+          form.merchantType = 'DEALER'
+          form.merchantSn = _this.pageInfo ? _this.pageInfo.merchantSn : ''
+          _this.spinning = true
+          saveMerchantCashOut(form).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              setTimeout(() => {
+                _this.cancel()
+                _this.$emit('refresh')
+                _this.spinning = false
+              }, 1000)
+            } else {
+              _this.spinning = false
+            }
+          })
+        } else {
+          return false
+        }
+      })
+    },
+    // 取消
+    cancel () {
+      this.form.amount = ''
+      this.$refs.ruleForm.resetFields()
+      this.$emit('close')
+    }
+  },
+  watch: {
+    isOpenModal (nVal, oVal) {
+      this.opened = nVal
+    },
+    opened (nVal, oVal) {
+      if (nVal) {
+        this.getPageInfo()
+      } else {
+        this.form.amount = ''
+        this.$emit('close')
+      }
+    }
+  }
+}
+</script>
+
+<style>
+</style>

+ 0 - 0
src/views/numsGoodsShelves/withdrawalManagement/billFlowModal.vue → src/views/numsGoodsShelves/withdrawalManagementNew/billFlowModal.vue


+ 189 - 0
src/views/numsGoodsShelves/withdrawalManagementNew/list.vue

@@ -0,0 +1,189 @@
+<template>
+  <a-card size="small" :bordered="false" class="accountManagementList-wrap jg-page-wrap">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 搜索条件 -->
+      <div ref="tableSearch" class="table-page-search-wrapper">
+        <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+          <a-row :gutter="15">
+            <a-col :xl="6" :lg="6" :md="12" :sm="24">
+              <a-form-item label="提现时间">
+                <rangeDate id="withdrawa-time" ref="rangeDate" v-model="time" @change="dateChange" />
+              </a-form-item>
+            </a-col>
+            <a-col :xl="6" :lg="6" :md="6" :sm="6">
+              <a-button type="primary" @click="getRefresh" :disabled="disabled" id="withdrawa-refresh" >查询</a-button>
+              <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="withdrawa-reset">重置</a-button>
+            </a-col>
+          </a-row>
+        </a-form>
+      </div>
+      <div style="margin:10px 0">
+        <div style="margin:10px 0">
+          账户总金额:¥100.00(包含可提现金额:<span>{{ pageInfo&&pageInfo.activeAmount?toThousands(pageInfo.activeAmount):'--' }}</span>,在途金额:¥12.00)
+          <p style="margin-top:10px;">(提示:①提现手续费为0.5元/笔;②资金到账周期为工作日+1天;③销售单需审核通过后才能提现;④销售单审核不通过或修理厂取消订单后将会在1-3个工作日原路返回到修理厂)</p>
+        </div>
+        <a-button id="withdrawa-tixian" type="primary" class="button-primary" @click="handleTX">申请提现</a-button>
+        <a-button id="withdrawa-tixian" class="button-info" @click="showBillFlowModal=true">账单流水</a-button>
+      </div>
+      <s-table
+        class="sTable fixPagination"
+        ref="table"
+        :style="{ height: tableHeight+77+'px' }"
+        size="small"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ y:tableHeight }"
+        :defaultLoadData="false"
+        bordered>
+      </s-table>
+    </a-spin>
+    <!-- 申请提现 -->
+    <applyWithdrawal :isOpenModal="showModal" :currentData="currentData" @close="showModal=false" @refresh="getPageInfo"></applyWithdrawal>
+    <!-- 交易流水 -->
+    <billFlowModal :openModal="showBillFlowModal" @close="showBillFlowModal=false" @ok="showBillFlowModal=false"></billFlowModal>
+  </a-card>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { STable } from '@/components'
+import applyWithdrawal from './applyWithdrawal.vue'
+import billFlowModal from './billFlowModal.vue'
+
+import rangeDate from '@/views/common/rangeDate.vue'
+import { queryMerchantCashOutPage, merchantCashOutDetail } from '@/api/merchant'
+export default {
+  mixins: [commonMixin],
+  components: { STable, applyWithdrawal, billFlowModal, rangeDate },
+  data () {
+    const _this = this
+    return {
+      spinning: false,
+      disabled: false,
+      tableHeight: 0, // 表格高度
+      showModal: false, // 是否显示申请提现弹窗
+      currentData: null, // 当前行数据
+      showBillFlowModal: false,
+      time: [], // 提现时间
+      pageInfo: null, // 详情信息
+      queryParam: {
+        beginDate: '', // 开始时间
+        endDate: '' // 结束时间
+      },
+      columns: [
+        { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
+        { title: '提现单号', dataIndex: 'cashOutNo', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '提现时间', dataIndex: 'cashOutDate', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '申请提现金额', dataIndex: 'amount', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } },
+        { title: '开户名', dataIndex: 'bankAccount', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '开户银行', dataIndex: 'bankAccount', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '银行卡号', dataIndex: 'bankCard', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '提现人', dataIndex: 'operName', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '状态', dataIndex: 'stateDictValue', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '备注', dataIndex: 'remarks', width: '10%', align: 'center', customRender: function (text) { return text || '--' } }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        const _this = this
+        _this.disabled = true
+        _this.spinning = true
+        const paramsPage = Object.assign(parameter, this.queryParam) //  有分页
+        paramsPage.merchantSn = this.pageInfo ? this.pageInfo.merchantSn : ''
+        paramsPage.merchantType = 'DEALER'
+        return queryMerchantCashOutPage(paramsPage).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+            }
+            this.disabled = false
+          }
+          this.spinning = false
+          return data
+        })
+      }
+    }
+  },
+  methods: {
+    // 时间改变
+    dateChange (date) {
+      this.queryParam.beginDate = date[0]
+      this.queryParam.endDate = date[1]
+    },
+    // 获取详情信息
+    getPageInfo () {
+      merchantCashOutDetail({}).then(res => {
+        if (res.status == 200) {
+          this.pageInfo = res.data
+          this.$refs.table.refresh(true)
+        } else {
+          this.pageInfo = null
+        }
+      })
+    },
+    // 刷新页面
+    getRefresh () {
+      this.getPageInfo()
+      this.$refs.table.refresh(true)
+    },
+    // 重置
+    resetSearchForm () {
+      this.time = []
+      this.$refs.rangeDate.resetDate(this.time)
+      this.$refs.table.refresh(true)
+    },
+    // 申请提现
+    handleTX () {
+      this.showModal = true
+    },
+    // 计算表格高度
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 265
+    },
+    // 页面初始化
+    pageInit () {
+      const _this = this
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+      _this.getPageInfo()
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.pageInit()
+      this.resetSearchForm()
+    }
+  },
+  watch: {
+    advanced (newValue, oldValue) {
+      const _this = this
+      setTimeout(() => {
+        _this.setTableH()
+      }, 400)
+    },
+    '$store.state.app.winHeight' (newValue, oldValue) { //  窗口变更时,需同时更改表格高度
+      this.setTableH()
+    }
+  },
+  activated () {
+    // 如果是新页签打开,则重置当前页面
+    if (this.$store.state.app.isNewTab) {
+      this.pageInit()
+      this.resetSearchForm()
+    }
+    // 仅刷新列表,不重置页面
+    if (this.$store.state.app.updateList) {
+      this.pageInit()
+      this.$refs.table.refresh()
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {})
+  }
+}
+</script>

+ 2 - 1
src/views/salesManagement/salesQuery/list.vue

@@ -328,7 +328,8 @@ export default {
         financialStatus: undefined, //  财务状态
         sourceType: undefined, // 单据来源
         distributionFlag: undefined, // 是否铺货出库
-        buyerRelationType: undefined// 客户关系
+        buyerRelationType: undefined, // 客户关系
+        payOnlineFlag: 0
       },
       totalData: {
         totalAmount: 0, // 总金额

+ 2 - 1
src/views/salesManagement/salesQueryNew/list.vue

@@ -332,7 +332,8 @@ export default {
         financialStatus: undefined, //  财务状态
         sourceType: undefined, // 单据来源
         distributionFlag: undefined, // 铺货出库
-        buyerRelationType: undefined // 客户关系
+        buyerRelationType: undefined, // 客户关系
+        payOnlineFlag: 0
       },
       totalData: { // 统计数据
         totalAmount: 0, // 总销价