Browse Source

结算中心的优化

pansl 1 year ago
parent
commit
f93aaf4586

+ 10 - 1
src/api/settlement/index.ts

@@ -102,6 +102,15 @@ export function jiesuanManageFinanceCheckRemit(params: object) {
 export function jiesuanShenheList(params?: object) {
   return http.get('jiesuanManage/verify/list', params);
 }
+
 export function jiusanBankCardVerify(params?: object) {
   return http.post('jiesuanManage/verify/check', params);
-}
+}
+
+// 结算-提现列表-上传发票
+export function jiesuanManageJiesuanUpdateTicket(
+  id: string | number,
+  params?: object
+) {
+  return http.post(`/jiesuanManage/jiesuan/updateTicket/${id}`, params);
+}

+ 10 - 7
src/views/Permissions/permissions/index.vue

@@ -9,19 +9,22 @@
     </Search>
     <div class="table-default">
       <Operate :show="open" />
-      <el-table :data="tableData" class="mt-3" v-loading="loading" row-key="id" default-expand-all :tree-props="{ children: 'children' }">
+      <el-table :data="tableData" class="mt-3" v-loading="loading" row-key="id" default-expand-all
+        :tree-props="{ children: 'children' }">
         <el-table-column prop="permission_name" label="菜单名称" />
         <el-table-column prop="route" label="菜单路由" />
-        <el-table-column prop="permission_mark" label="权限标识" width="330">
+        <el-table-column prop="permission_mark" label="权限标识" width="360">
           <template #default="scope">
-            <div v-if="scope.row.actions.length" class="flex grid gap-1 grid-cols-4">
-              <el-tag v-for="action in scope.row.actions" class="cursor-pointer min-w-fit" @click="open(action.id)" closable @close="destroy(api, action.id)">{{ action.permission_name }}</el-tag>
+            <div v-if="scope.row.actions.length">
+              <el-tag v-for="action in scope.row.actions" class="mb-3 mr-3 cursor-pointer w-fit min-w-fit"
+                @click="open(action.id)" closable @close="destroy(api, action.id)">{{ action.permission_name }}</el-tag>
             </div>
             <div v-else>
-              <el-popconfirm confirm-button-text="确认" title="添加基础actions" @confirm="actionGenerate(scope.row.id)" placement="top">
+              <el-popconfirm confirm-button-text="确认" title="添加基础actions" @confirm="actionGenerate(scope.row.id)"
+                placement="top">
                 <template #reference>
-                  <el-tag class="cursor-pointer w-8" v-if="scope.row.type === MenuType.PAGE_TYPE">
-                    <Icon name="cog-6-tooth" class="animate-spin w-5 h-5" v-if="actionLoading" />
+                  <el-tag class="w-8 cursor-pointer" v-if="scope.row.type === MenuType.PAGE_TYPE">
+                    <Icon name="cog-6-tooth" class="w-5 h-5 animate-spin" v-if="actionLoading" />
                     <Icon name="plus" className="w-4 h-4" v-else />
                   </el-tag>
                 </template>

+ 46 - 48
src/views/settleManage/settlementCenter/tabs/rechargeSettle/index.vue

@@ -33,58 +33,59 @@
             <div v-if="applyBank.length <= 0" class="ml-3">未配置收款账户,<span
                 @click="router.push('/jiesuanManage/bankAccount')" class="text-blue-400 cursor-pointer">去配置</span></div>
           </div>
-          <div class="text-base">
-            <el-button v-action="'jiesuan.Jiesuan.listTixian'" size="default"
-              @click="openType('applyListVisible')">提现记录</el-button>
-          </div>
         </el-col>
       </el-row>
     </el-card>
     <div class="p-5">注:每日的结算数据需要在次日统计完成后才能展示</div>
-    <Search :search="search" :reset="resetQuery">
-      <template v-slot:body>
-        <el-form-item label="结算时间">
-          <el-date-picker unlink-panels clearable @change="applyTimeChange" format="YYYY/MM/DD" value-format="YYYY-MM-DD"
-            v-model="query.applyTime" type="daterange" :shortcuts="shortcuts" range-separator="To"
-            start-placeholder="开始时间" end-placeholder="结束时间" />
-        </el-form-item>
-      </template>
-      <template v-slot:extra_button>
-        <exportExcel api="jiesuanManage/jiesuan/list" sheet_name="结算中心" :title_obj="titleObj"
-          :extro_params="{ is_export: 1, ...query }">
-        </exportExcel>
-      </template>
-    </Search>
-    <div class="table-default">
-      <el-table :data="tableData" class="mt-3" v-loading="loading">
-        <el-table-column prop="jiesuan_date" label="时间" min-width="200px" />
-        <el-table-column prop="charge_money" label="日充值总额" show-overflow-tooltip min-width="200px">
-        </el-table-column>
-        <el-table-column prop="tuikuan_money" show-overflow-tooltip label="当日退款" min-width="200px">
-        </el-table-column>
-        <el-table-column prop="share_rate" label="分成比例" show-overflow-tooltip>
-        </el-table-column>
-        <el-table-column prop="jiesuan_money" label="日结算总额" show-overflow-tooltip min-width="200px">
-        </el-table-column>
-        <el-table-column label="操作" min-width="200px">
-          <template #default="scope">
-            <el-button link type="primary" size="small"
-              @click="openType('orderDetailVisible', scope.row)">查看订单详情</el-button>
-            <br />
+
+    <el-tabs v-model="activeName" class="demo-tabs" @tab-change="handChange">
+      <el-tab-pane label="提现记录" name="withdrawalRecord" v-action="'jiesuan.Jiesuan.listTixian'">
+        <withdrawalRecord></withdrawalRecord>
+      </el-tab-pane>
+      <el-tab-pane label="每日结算数据" name="recharge">
+        <Search :search="search" :reset="resetQuery">
+          <template v-slot:body>
+            <el-form-item label="结算时间">
+              <el-date-picker unlink-panels clearable @change="applyTimeChange" format="YYYY/MM/DD"
+                value-format="YYYY-MM-DD" v-model="query.applyTime" type="daterange" :shortcuts="shortcuts"
+                range-separator="To" start-placeholder="开始时间" end-placeholder="结束时间" />
+            </el-form-item>
+          </template>
+          <template v-slot:extra_button>
+            <exportExcel api="jiesuanManage/jiesuan/list" sheet_name="结算中心" :title_obj="titleObj"
+              :extro_params="{ is_export: 1, ...query }">
+            </exportExcel>
           </template>
-        </el-table-column>
-      </el-table>
-      <Paginate />
-    </div>
+        </Search>
+        <div class="table-default">
+          <el-table :data="tableData" class="mt-3" v-loading="loading">
+            <el-table-column prop="jiesuan_date" label="时间" min-width="200px" />
+            <el-table-column prop="charge_money" label="日充值总额" show-overflow-tooltip min-width="200px">
+            </el-table-column>
+            <el-table-column prop="tuikuan_money" show-overflow-tooltip label="当日退款" min-width="200px">
+            </el-table-column>
+            <el-table-column prop="share_rate" label="分成比例" show-overflow-tooltip>
+            </el-table-column>
+            <el-table-column prop="jiesuan_money" label="日结算总额" show-overflow-tooltip min-width="200px">
+            </el-table-column>
+            <el-table-column label="操作" min-width="200px">
+              <template #default="scope">
+                <el-button link type="primary" size="small"
+                  @click="openType('orderDetailVisible', scope.row)">查看订单详情</el-button>
+                <br />
+              </template>
+            </el-table-column>
+          </el-table>
+          <Paginate />
+        </div>
+      </el-tab-pane>
+    </el-tabs>
     <Dialog v-model="orderDetailVisible" width="80%" title="订单详情" destroy-on-close>
       <orderDetail @close="closeType('orderDetailVisible')" :primary="orderDetailData"></orderDetail>
     </Dialog>
     <Dialog v-model="applyVisible" width="50%" title="申请提现" destroy-on-close>
       <create @close="closeType('applyVisible')" :primary="applyData"></create>
     </Dialog>
-    <Dialog v-model="applyListVisible" width="80%" title="提现记录" destroy-on-close>
-      <withdrawalRecord @close="closeType('applyListVisible')"></withdrawalRecord>
-    </Dialog>
   </div>
 </template>
 
@@ -101,6 +102,7 @@ import withdrawalRecord from './withdrawalRecord/index.vue'
 import moment from 'moment';
 const start_date = moment().startOf('month').format('YYYY-MM-DD')
 const end_date = moment().endOf('month').format('YYYY-MM-DD')
+const activeName = ref('withdrawalRecord')
 
 const api = 'jiesuanManage/jiesuan/list';
 const router = useRouter()
@@ -110,7 +112,6 @@ const orderDetailVisible = ref(false)
 const orderDetailData = ref({})
 const applyData = ref({})
 const applyVisible = ref(false)
-const applyListVisible = ref(false)
 const rolesIdentify = inject('rolesIdentify')
 const applyBank = ref([])
 const closeType = (type: string) => {
@@ -122,12 +123,12 @@ const closeType = (type: string) => {
       applyVisible.value = false
       init()
       break;
-    case 'applyListVisible':
-      applyListVisible.value = false
-      break;
   }
   search()
 }
+const handChange = (tab: any, event: Event) => {
+  activeName.value = tab
+}
 
 const openType = (type: string, data?: object) => {
   switch (type) {
@@ -138,9 +139,6 @@ const openType = (type: string, data?: object) => {
     case 'applyVisible':
       applyVisible.value = true
       break;
-    case 'applyListVisible':
-      applyListVisible.value = true
-      break;
   }
 }
 const applyTimeChange = (e: object) => {

+ 73 - 0
src/views/settleManage/settlementCenter/tabs/rechargeSettle/withdrawalRecord/form/create.vue

@@ -0,0 +1,73 @@
+<template>
+  <el-form :model="formData" label-width="120px" ref="ruleForm" :rules="rules" v-loading="loading" class="pr-4">
+    <div class="flex flex-row justify-between">
+      <div class="w-full">
+        <el-form-item label="电子发票" prop="ticket">
+          <my-upload acceptType=".png,.jpg,.jpeg" :isMultiple="true" :maxFileSize="2" @fileRemove="fileRemove"
+            @fileSuccess="fileSuccess" :fileList="fileList" action="/qiniu/upload/image"></my-upload>
+        </el-form-item>
+      </div>
+    </div>
+    <div class="flex justify-end">
+      <el-button type="primary" @click="submitForm(ruleForm)">{{ $t('system.confirm') }}</el-button>
+    </div>
+  </el-form>
+</template>
+
+<script lang="ts" setup>
+import { InfoFilled } from '@element-plus/icons-vue';
+import type { FormInstance, FormRules } from 'element-plus'
+import { jiesuanManageJiesuanUpdateTicket } from '@/api/settlement/index'
+const ruleForm = ref<FormInstance>()
+import { onMounted, ref } from 'vue';
+const props = defineProps({
+  primary: Object,
+});
+const formData = ref({})
+const fileList = ref([])
+const rules = reactive({
+  ticket: [
+    {
+      required: true,
+      message: '请上传电子发票',
+    }
+  ],
+});
+const loading = ref(false)
+const fileSuccess = (e) => {
+  console.log(e);
+  formData.value.ticket = e;
+}
+const fileRemove = (e) => {
+  console.log(e);
+  formData.value.ticket = '';
+}
+
+const submitForm = (formEl: FormInstance | undefined) => {
+  console.log(formData.value, 'formData.valueformData.value');
+  if (!formEl) return;
+  formEl
+    .validate(valid => {
+      if (valid) {
+        jiesuanManageJiesuanUpdateTicket(formData.value.id, formData.value).then(res => {
+          console.log(res);
+          ElMessage.success(res.message)
+          emit('close')
+        })
+      } else {
+        loading.value = false;
+      }
+    })
+    .then(() => { });
+}
+
+if (props.primary) {
+  formData.value.id = props.primary.id
+  if (props.primary.ticket_link) {
+    fileList.value = [{ uid: props.primary.id, url: props.primary.ticket_link }]
+  }
+}
+const emit = defineEmits(['close']);
+onMounted(() => {
+});
+</script>

+ 34 - 0
src/views/settleManage/settlementCenter/tabs/rechargeSettle/withdrawalRecord/index.vue

@@ -44,9 +44,24 @@
         </el-table-column>
         <el-table-column prop="remark" label="备注" show-overflow-tooltip min-width="150px">
         </el-table-column>
+        <el-table-column label="操作" min-width="200px">
+          <template #default="scope">
+            <div v-action="'jiesuan.Jiesuan.updateTicket'">
+              <el-button link type="primary" size="small" @click="lookInvoice(scope.row)"
+                v-if="scope.row.ticket_link">查看电子发票</el-button>
+              <el-button link type="primary" size="small" @click="uploadInvoice(scope.row)">{{ scope.row.ticket_link ?
+                '重新上传' : '上传电子发票' }} </el-button>
+              <div class="text-xs font-bold">注:如果是纸质发票请邮寄</div>
+            </div>
+            <br />
+          </template>
+        </el-table-column>
       </el-table>
       <Paginate />
     </div>
+    <Dialog v-model="uploadVisible" width="500px" title="上传电子发票" destroy-on-close>
+      <create @close="closeUpload" :primary="uploadData"></create>
+    </Dialog>
   </div>
 </template>
 
@@ -54,10 +69,13 @@
 import { shortcuts } from '@/utils/shortcuts'
 import { InfoFilled } from '@element-plus/icons-vue';
 import { useGetList } from '@/hook/curd/useGetList';
+import create from './form/create.vue'
 const api = 'jiesuanManage/jiesuan/listTixian';
 import { titleObj } from "./excelTitle"
 const { data, query, search, reset, loading } = useGetList(api);
 const rolesIdentify = inject('rolesIdentify')
+const uploadVisible = ref(false)
+const uploadData = ref({})
 const statusList = ref([
   { name: '全部', value: '' },
   { name: '待审核', value: 1 },
@@ -96,6 +114,22 @@ const resetQuery = () => {
   reset()
 }
 
+const closeUpload = () => {
+  uploadVisible.value = false
+  search()
+}
+// 上传发票
+const uploadInvoice = (row: object) => {
+  uploadVisible.value = true
+  uploadData.value = row
+  console.log(row, 'uploadInvoiceuploadInvoice');
+}
+// 查看电子发票
+const lookInvoice = (row: object) => {
+  window.open(row.ticket_link)
+  console.log(row, 'uploadInvoiceuploadInvoice');
+}
+
 const tableData = computed(() => data.value?.data);
 
 onMounted(() => {