Browse Source

结算管理

chenjj 5 days ago
parent
commit
f786360dd9

+ 34 - 0
src/api/finance/settlement.js

@@ -25,6 +25,40 @@ export function exportEx(data) {
       data
     })
   }
+ //区域公司订单抽成结算
+ export function regionalsettlement(data) {
+  return request({
+    url: `/core/users/orders/area/settlement`,
+    method: 'post',
+    data
+  })
+}
+ //服务中心订单抽成结算
+ export function serviceSettlement(data) {
+  return request({
+    url: `/core/users/orders/serviceCentre/settlement`,
+    method: 'post',
+    data
+  })
+}
 
 
 
+  //结算申请
+export function applyOrderSettlement(data) {
+    return request({
+      url: `/core/orderSettlementApplication/web/applyOrderSettlement`,
+      method: 'post',
+      data
+    })
+  }
+
+
+//区域公司/服务中心订单结算审核
+export function auditorOrderSettlement(data) {
+  return request({
+    url: `/core/orderSettlementApplication/web/auditorOrderSettlement`,
+    method: 'post',
+    data
+  })
+}

+ 6 - 1
src/components/DictTag/index.vue

@@ -1,7 +1,7 @@
 <template>
   <div>
     <template v-for="(item, index) in options">
-      <template v-if="values.includes(item.value)">
+      <template v-if="item&&values.includes(item.value)">
         <span
           v-if="(item.elTagType == 'default' || item.elTagType == '') && (item.elTagClass == '' || item.elTagClass == null)"
           :key="item.value"
@@ -73,6 +73,11 @@ function handleArray(array) {
     return pre + " " + cur;
   });
 }
+
+function test(values,item){
+  console.log(values,item);
+  
+}
 </script>
 
 <style scoped>

+ 6 - 1
src/views/components/DialogForm/index.vue

@@ -1,6 +1,6 @@
 <template>
     <el-dialog :title="title" v-model="open" width="700px" append-to-body>
-        <el-form ref="dialogFormRef" :model="form" label-width="100px">
+        <el-form ref="dialogFormRef" :model="form" :label-width="labelWidth">
             <template v-for="item in column" :key="item.prop">
                 <!-- 输入框 -->
                 <el-form-item :label="item.label" v-if="item.type === 'input'" :prop="item.prop" :rules="item.rules">
@@ -88,6 +88,11 @@ const props = defineProps({
         default: [],
         required: true
     },
+    labelWidth: {
+        type: String,
+        default: '120px',
+    },
+
 })
 
 const open = ref(false);

+ 2 - 1
src/views/components/ListPage/Search.vue

@@ -36,7 +36,8 @@
         <el-row :gutter="10" class="mb8">
             <el-col :span="1.5" v-for="item in searchBtns" :key="item.key">
                 <el-button :type="item.type || 'primary'" plain :icon="item.icon" @click="()=>item.func(formInline)"
-                    v-hasPermi="item.hasPermi">{{ item.label }}</el-button>
+                    v-if="item.show?item.show() :true"
+                    >{{ item.label }}</el-button>
             </el-col>
         </el-row>
     </div>

+ 3 - 2
src/views/components/ListPage/Table.vue

@@ -16,7 +16,8 @@
                 <el-table-column v-else-if="item.type === 'dict'" :label="item.label" :prop="item.tableProp || item.prop"
                     :width="item.width">
                     <template #default="scope">
-                        <dict-tag :options="item.dict" :value="scope.row[item.tableProp || item.prop]" />
+                        <dict-tag v-if="item.dict" :options="item.dict" :value="String(scope.row[item.tableProp || item.prop])" />
+
                     </template>
                 </el-table-column>
                 <el-table-column v-else-if="item.type === 'render'" :label="item.label" :prop="item.prop"
@@ -35,7 +36,7 @@
                         <div v-for="item in scopeBtns" :key="item.key">
                            <template v-if="item.show?item.show(scope.row) :true">
                                 <el-button  link :type="item.type"
-                                @click="item.func(scope.row)" v-hasPermi="item.hasPermi"> {{ item.label }}</el-button>
+                                @click="item.func(scope.row)" > {{ item.label }}</el-button>
                            </template>
                         </div>
                        

+ 7 - 1
src/views/components/ListPage/index.vue

@@ -56,6 +56,10 @@ const props = defineProps({
     isSelect:{
         type: Boolean,
         default: true
+    },
+    defaultTab:{
+        type: String,
+        default: '2'
     }
 })
 const tabsValue = ref('2')
@@ -142,9 +146,11 @@ const ids = computed(() =>{
 })
 
 onMounted(() => {
-  const tabs =   sessionStorage.getItem('tabsValue');  
+  const tabs = sessionStorage.getItem('tabsValue');  
   if(tabs){
     tabsValue.value = tabs;
+  }else{
+    tabsValue.value = props.defaultTab;
   }
   getList();
 })

+ 19 - 300
src/views/finance/examine/index.vue

@@ -1,317 +1,36 @@
 <template>
     <div>
-        <ListPage :column="listPageData.tableColumn" :tableApi="listPageData.tableApi" :isSelect="listPageData.isSelect"
-            :scopeBtns="listPageData.scopeBtns" :searchBtns="listPageData.searchBtns" ref="userTableRef"
-             />
-        <DialogForm ref="dialogFormRef" :title="title" :column="dialogData.column" @submit="submitForm" />
+        <ListPage :column="tableColumn" :tableApi="list" :isSelect="true" :scopeBtns="scopeBtns"
+            :searchBtns="searchBtns" ref="userTableRef" tableKey="mainOrderId" :tabList="tabList"
+            tabsearchKey="orderStatus" defaultTab="10" />
+        <DialogForm ref="dialogFormRef" :title="dialogData.title" :column="dialogData.column" @submit="submitForm"
+            labelWidth="120px" />
     </div>
 </template>
 
 <script setup>
-import { ref } from 'vue';
+import { ref, computed } from 'vue';
 import ListPage from '@/views/components/ListPage/index.vue';
-import { list } from "@/api/finance/settlement.js";
 import DialogForm from '@/views/components/DialogForm/index.vue';
-
+import { list } from "@/api/finance/settlement.js";
+import useData from './useData';
 const { proxy } = getCurrentInstance();
-const { lrr_service_status } = proxy.useDict("lrr_service_status");
-const router = useRouter();
-const userTableRef = ref();
-const dialogFormRef = ref(null);
-const listPageData = reactive({
-    tableColumn: [
-        {
-            label: '订单ID',
-            prop: 'mainOrderId',
-             width: '180px'
-        },
-        {
-            label: '时间',
-            prop: 'createTime',
-            type: 'date',
-            isSearch: false,
-            width: '180px'
-        },
-        {
-            label: '志愿者姓名',
-            prop: 'name',
-            type: 'input',
-            isSearch: true,
-        },
-        {
-            label: '志愿者手机号',
-            prop: 'phonenumber',
-            type: 'input',
-            isSearch: true
-        },
-        {
-            label: '用户手机号',
-            prop: 'clientTelephone',
-            type: 'input',
-            isSearch: true
-        },
-        {
-            label: '项目类别',
-            prop: 'businessTierName',
-        },
-        {
-            label: '评分',
-            prop: 'address',
-        },
-        {
-            label: '订单状态',
-            prop: 'orderStatus',
-            type: 'dict',
-            dict: lrr_service_status
-        },
-        {
-            label: '订单单价',
-            prop: 'serviceOnePrice',
-        },
-        {
-            label: '订单金额',
-            prop: 'serviceTotalPrice',
-        },
-        {
-            label: '用户收货地址姓名',
-            prop: 'clientName',
-        },
-        {
-            label: '用户收货地址电话',
-            prop: 'clientTelephone',
-        },
-        {
-            label: '区域抽成比例',
-            prop: 'areaDistributionRatio',
-        },
-        {
-            label: '区域抽成金额',
-            prop: 'areaDistributionAmount',
-        },
-        {
-            label: '服务中心抽成比例',
-            prop: 'serviceCentreDistributionRatio',
-        },
-        {
-            label: '服务中心抽成金额',
-            prop: 'serviceCentreDistributionAmount',
-        },
-        
-    ],
-    searchBtns: [
-        // {
-        //     label: '批量结算',
-        //     func: () => {
-        //         const ids = userTableRef.value.ids;
-        //         console.log('批量删除', ids)
-        //         handleDelete(ids);
-        //     },
-        //     key: 'deletes',
-        //     hasPermi: ['system:role:query'],
-        //     type: 'danger'
-        // },
-        // {
-        //     label: '导出',
-        //     func: (parmas) => {
-        //         exportFile(parmas);
-        //     },
-        //     key: 'deletes',
-        //     hasPermi: ['system:role:query'],
-        //     type: 'danger'
-        // },
-    ],
-    tableApi: list,//接口地址
-    isSelect: true,//是否勾选
-    scopeBtns: [
-        // {
-        //     label: '结算',
-        //     type: 'primary',
-        //     hasPermi: ['manage:examine'],
-        //     key: 'examine',
-        //     func: (row) => {
-        //         console.log(row)
-        //         openDialog(row, 'examine')
-        //     },
-        //     show: (row) => {
-        //         return row.appStatus == 1
-        //     }
-        // },
-        // {
-        //     label: '查看',
-        //     type: 'primary',
-        //     hasPermi: ['manage:details'],
-        //     key: 'details',
-        //     func: (row) => {
-        //         console.log(row)
-        //         // router.push("/order/order-details/" + row.mainOrderId);
-        //         // openDialog(row)
-        //     }
-        // },
-        // {
-        //     label: '删除',
-        //     type: 'danger',
-        //     hasPermi: ['manage:delete'],
-        //     key: 'delete',
-        //     func: (row) => {
-        //         console.log(row)
-        //         handleDelete([row.id])
-        //     }
-        // }
-    ]
-})
-const dialogData = reactive({
-    title: '',
-    column: [
-        {
-            label: '姓名',
-            prop: 'name',
-            type: 'input',
-
-        },
-        {
-            label: '年龄',
-            prop: 'age',
-            type: 'input',
-
-        },
-        {
-            label: '电话',
-            prop: 'phonenumber',
-            type: 'input',
-
-        },
-        {
-            label: '家庭地址',
-            prop: 'address',
-            type: 'input',
-
-        },
-        // {
-        //     label: '服务项目/类别',
-        //     prop: 'businessManagementId',
-        //     type: 'cascader',
-        //     isSearch: true,
-        //     options: options,
-        //     props: { label: 'businessName', value: 'id', checkStrictly:true },
-
-        // },
-        {
-            label: '身份证件',
-            prop: 'idCardPicture',
-            type: 'img',
-
-        },
-        {
-            label: '职业证书',
-            prop: 'certificationPicture',
-            type: 'img',
-
-        },
-        {
-            label: '技能简介',
-            prop: 'skillDescribe',
-            type: 'textarea',
-        },
-        {
-            label: '审核状态',
-            prop: 'appStatus',
-            type: 'radio',
-            rules: [
-                { required: true, message: '请选择审核状态', trigger: 'blur' }
-            ],
-            options: [
-                {
-                    label: '通过',
-                    value: '2'
-                },
-                {
-                    label: '不通过',
-                    value: '3'
-                }
-            ]
-        },
-    ]
-})
-const { title } = toRefs(dialogData);
-const parentId = ref(0);
-
-const openDialog = (row, type) => {
-    console.log('row', row);
-    try {
-        const disabledData = {
-            name: true,
-            age: true,
-            phonenumber: true,
-            address: true,
-            skillDescribe: true,
-            businessManagementId: true,
-        }
-
-        if (type) {
-            //审核
-            title.value = '审核'
-
-        } else {
-            disabledData['appStatus'] = true;
-            //查看详情
-            title.value = '查看详情'
-        }
-
-        dialogFormRef.value.initForm(row, disabledData)
-
-    } catch (error) {
-        console.log('error', error);
-    } finally {
-        console.log('dialogFormRef.value', dialogFormRef.value);
-
-        dialogFormRef.value.handleDialog(true);
-    }
-}
-const handleDelete = (ids) => {
-    proxy.$modal.confirm('是否确认删除角色编号为"' + ids + '"的数据项?').then(function () {
-        return true
-    }).then(() => {
-        userTableRef.value.resetForm();
-        proxy.$modal.msgSuccess("删除成功");
-    }).catch(() => { });
-}
 
-const submitForm = async (parmas) => {
+const jlzj_area_type = ref('0');// 0: 平台 10:区域公司
+const {
+    tableColumn,
+    dialogData,
+    tabList,
+    dialogFormRef,
+    userTableRef,
+    searchBtns,
+    scopeBtns
+} = useData({ proxy, jlzj_area_type });
+console.log('tableColumn', tableColumn);
 
-    try {
-        console.log('submit', parmas);
-        // if (title.value === '审核') {
-        //     const res = await approval({
-        //         volunteerInfoId: parmas.volunteerInfoId,
-        //         appStatus: parmas.appStatus,
-        //         rejectReason: parmas.rejectReason
-        //     })
-        //     if (up_res.code === 200) {
-        //         proxy.$modal.msgSuccess("审核成功");
-        //         return;
-        //     }
-        //     proxy.$modal.msgSuccess(res.msg);
-        // }
-    } catch (error) {
-        console.log('error', error);
 
-    } finally {
-        userTableRef.value.resetForm();
-        dialogFormRef.value.handleDialog(false);
-    }
 
-}
 
-const exportFile = async(parmas) => { 
-	console.log("TCL: exportFile -> parmas", parmas)
-    try {
-        proxy.download("core/orderSettlementApplication/export",{
-            ...queryParams.value,
-        }, `订单费用结算_${new Date().getTime()}.xlsx`);
-    } catch (error) {
-        
-    }
-}
 
 </script>
 

+ 280 - 0
src/views/finance/examine/useData.js

@@ -0,0 +1,280 @@
+import { ref,computed } from "vue";
+import { auditorOrderSettlement } from "@/api/finance/settlement.js";
+//功能
+export default ({proxy,jlzj_area_type}) => {
+    const router = useRouter();
+     const dialogFormRef = ref(null);
+     const userTableRef = ref(null);
+     const { 
+        lrr_service_status,
+        settlement_application_auditor_status
+     } = proxy.useDict("lrr_service_status","settlement_application_auditor_status");
+
+     const tabList =computed(() => {
+        let data = []
+        data = settlement_application_auditor_status.value.map(item => {
+            return {
+                title: item.label,
+                name: item.value
+            }
+        })
+        return data || [];
+    })
+     //打开弹窗
+     const openDialog = (ids) => {
+        console.log('ids', ids);
+        try {
+            const disabledData = {
+                // payeeMethod: true,
+                // payeeAccount: true,
+                // payeeBankName: true,
+                // payeeName: true,
+                // payeeRemark: true
+            }
+            dialogFormRef.value.initForm({mainOrderIds:ids}, disabledData)
+        } catch (error) {
+            console.log('error', error);
+        } finally {
+            console.log('dialogFormRef.value', dialogFormRef.value);
+            dialogFormRef.value.handleDialog(true);
+        }
+    }
+    //导出
+    const exportFile = async(parmas) => { 
+        console.log("TCL: exportFile -> parmas", parmas)
+        // try {
+        //     proxy.download("core/orderSettlementApplication/export",{
+        //         ...queryParams.value,
+        //     }, `订单费用结算_${new Date().getTime()}.xlsx`);
+        // } catch (error) { 
+        // }
+    }
+
+    //申请提交
+    const submitForm = async (data) => {
+
+        try {
+            console.log('submit', data);
+            const parmas = {
+                ids: data.mainOrderIds,
+                auditorStatus:  data.auditorStatus,
+                auditorRemark: data.auditorRemark
+            }
+            const res = await auditorOrderSettlement(parmas);
+               if (up_res.code === 200) {
+                    proxy.$modal.msgSuccess("审核成功");
+                    return;
+                }
+                proxy.$modal.msgSuccess(res.msg);
+        } catch (error) {
+            console.log('error', error);
+        } finally {
+            userTableRef.value.resetForm();
+            dialogFormRef.value.handleDialog(false);
+        }
+    }
+
+
+    
+    return {
+        dialogFormRef,
+        userTableRef,
+        tabList,
+        openDialog,
+        exportFile,
+        submitForm,
+        tableColumn:ref([
+            {
+                label: jlzj_area_type === '0'?'区域中心':'服务中心',
+                prop: 'applicantType',
+                type: 'input',
+                isSearch: true
+            },
+            {
+                label: '申请人',
+                prop: 'createBy',
+            },
+            {
+                label: '申请时间',
+                prop: 'createTime',
+            },
+            {
+                label: '订单号',
+                prop: 'orderId',
+            },
+            {
+                label: '订单开始时间',
+                prop: 'createTime',
+            },
+            {
+                label: '订单完成时间',
+                prop: 'updateTime',
+            },
+            {
+                label: '用户名称',
+                prop: 'createBy',
+            },
+            {
+                label: '志愿者名称',
+                prop: 'updateBy',
+        
+            },
+            {
+                label: '服务项目',
+                prop: '',
+            },
+            {
+                label: '订单总金额(元)',
+                prop: 'amount',
+            },
+            {
+                label: '订单状态',
+                prop: 'orderStatus',
+                type: 'dict',
+                dict: lrr_service_status
+            },
+            {
+                label: '抽成金额',
+                prop: 'amount',
+            },
+            {
+                label: '结算状态',
+                prop: 'auditorStatus',
+            },
+            {
+                label: '审核状态',
+                prop: 'auditorStatus',
+            },
+        ]),
+        dialogData: {
+            title: '结算申请',
+            column: [
+                {
+                    label: '区域',
+                    prop: 'payeeMethod',
+                    type: 'select',
+                    dictionary: 'settlement_application_payee_method',
+                    rules: [
+                        { required: true, message: '请选择收款方式', trigger: 'change' }
+                    ],
+                },
+                {
+                    label: '提交人',
+                    prop: 'payeeAccount',
+                    type: 'input',
+                    rules: [
+                        { required: true, message: '请输入收款账号', trigger: 'change' }
+                    ],
+        
+                },
+                {
+                    label: '区域抽成',
+                    prop: 'payeeBankName',
+                    type: 'input',
+                    rules: [
+                        { required: true, message: '请输入收款银行名称', trigger: 'change' }
+                    ],
+        
+                },
+                {
+                    label: '订单编号',
+                    prop: 'payeeName',
+                    type: 'input',
+                    rules: [
+                        { required: true, message: '请输入收款人', trigger: 'change' }
+                    ],
+                },
+                {
+                    label: '服务项目',
+                    prop: 'payeeName',
+                    type: 'input',
+                    rules: [
+                        { required: true, message: '请输入收款人', trigger: 'change' }
+                    ],
+                },
+                {
+                    label: '订单状态',
+                    prop: 'payeeName',
+                    type: 'input',
+                    rules: [
+                        { required: true, message: '请输入收款人', trigger: 'change' }
+                    ],
+                },
+                {
+                    label: '审核状态',
+                    prop: 'auditorStatus',
+                    type: 'radio',
+                    rules: [
+                        { required: true, message: '请选择审核状态', trigger: 'blur' }
+                    ],
+                    options: [
+                        {
+                            label: '通过',
+                            value: '20'
+                        },
+                        {
+                            label: '不通过',
+                            value: '30'
+                        }
+                    ]
+                },
+                {
+                    label: '驳回原因',
+                    prop: 'auditorRemark',
+                    type: 'textarea',
+                    show:(form)=>{
+                        console.log('驳回原因',form);
+                        return form.auditorStatus === '30'
+                    }
+                },
+            ]
+        },
+        searchBtns:[
+            {
+                label: '批量审核',
+                func: () => {
+                    const ids = userTableRef.value.ids;
+                    console.log('批量删除', ids)
+                    ids.length > 0 && openDialog(ids)
+                },
+                key: 'applicant',
+                type: 'primary'
+            },
+            {
+                label: '导出',
+                func: (parmas) => {
+                    exportFile(parmas);
+                },
+                key: 'export',
+                type: 'primary'
+            },
+        ],
+        scopeBtns:[
+            {
+                label: '审核',
+                type: 'primary',
+                key: 'examine',
+                func: (row) => {
+                    console.log(row)
+                    openDialog([row.mainOrderId])
+                },
+                // show: (row) => {
+                //     return jlzj_area_type.value === '20'
+                // }
+            },
+            {
+                label: '查看详情',
+                type: 'primary',
+                key: 'details',
+                func: (row) => {
+                    console.log(row)
+                    router.push({
+                        path: "/order-details",
+                        query: { id: row.mainOrderId }
+                    });
+                }
+            },
+        ]
+       
+    }
+}

+ 28 - 278
src/views/finance/settlement/index.vue

@@ -1,297 +1,47 @@
 <template>
     <div>
-        <ListPage :column="listPageData.tableColumn" :tableApi="listPageData.tableApi" :isSelect="listPageData.isSelect"
-            :scopeBtns="listPageData.scopeBtns" :searchBtns="listPageData.searchBtns" ref="userTableRef"
-             />
-        <DialogForm ref="dialogFormRef" :title="title" :column="dialogData.column" @submit="submitForm" />
+        <ListPage :column="tableColumn" :tableApi="settlementOrderList" :isSelect="true" :scopeBtns="scopeBtns"
+            :searchBtns="searchBtns" ref="userTableRef" tableKey="mainOrderId" :tabList="tabList"
+            tabsearchKey="orderStatus" defaultTab="10" />
+        <DialogForm ref="dialogFormRef" :title="dialogData.title" :column="dialogData.column" @submit="submitForm"
+            labelWidth="120px" />
     </div>
 </template>
 
 <script setup>
-import { ref } from 'vue';
+import { ref, computed } from 'vue';
 import ListPage from '@/views/components/ListPage/index.vue';
-import { settlementOrderList } from "@/api/finance/settlement.js";
 import DialogForm from '@/views/components/DialogForm/index.vue';
+import { settlementOrderList } from "@/api/finance/settlement.js";
 
+import useData from './useData';
+import usePlatform from './usePlatform';
+import useRegional from './useRegional';
+import useService from './useService';
 const { proxy } = getCurrentInstance();
-const { lrr_service_status } = proxy.useDict("lrr_service_status");
-const router = useRouter();
-const userTableRef = ref();
-const dialogFormRef = ref(null);
-const listPageData = reactive({
-    tableColumn: [
-        {
-            label: '订单ID',
-            prop: 'mainOrderId',
-            type: 'input',
-            isSearch: true,
-        },
-        {
-            label: '申请方类型',
-            prop: 'applicantType',
-        },
-        {
-            label: '结算金额',
-            prop: 'serviceTotalPrice',
-        },
-        {
-            label: '申请时间',
-            prop: 'createTime',
-        },
-        {
-            label: '收款方式',
-            prop: 'payeeMethod',
-        },
-        {
-            label: '收款账号',
-            prop: 'payeeAccount',
-        },
-        {
-            label: '收款银行名称',
-            prop: 'payeeBankName',
-        },
-
-        {
-            label: '收款人姓名',
-            prop: 'clientName',
-        },
-        {
-            label: '收款人手机号',
-            prop: 'clientTelephone',
-        },
-        {
-            label: '收款申请备注',
-            prop: 'payeeRemark',
-        },
-        {
-            label: '审核时间',
-            prop: 'auditorTime',
-        },
-        {
-            label: '审核状态',
-            prop: 'auditorStatus',
-            type: 'dict',
-            dict: lrr_service_status
-        },
-        {
-            label: '审核结果说明',
-            prop: 'auditorRemark',
-        },
-    ],
-    searchBtns: [
-        // {
-        //     label: '批量结算',
-        //     func: () => {
-        //         const ids = userTableRef.value.ids;
-        //         console.log('批量删除', ids)
-        //         handleDelete(ids);
-        //     },
-        //     key: 'deletes',
-        //     hasPermi: ['system:role:query'],
-        //     type: 'danger'
-        // },
-        // {
-        //     label: '导出',
-        //     func: (parmas) => {
-        //         exportFile(parmas);
-        //     },
-        //     key: 'deletes',
-        //     hasPermi: ['system:role:query'],
-        //     type: 'danger'
-        // },
-    ],
-    tableApi: settlementOrderList,//接口地址
-    isSelect: true,//是否勾选
-    scopeBtns: [
-        // {
-        //     label: '结算',
-        //     type: 'primary',
-        //     hasPermi: ['manage:examine'],
-        //     key: 'examine',
-        //     func: (row) => {
-        //         console.log(row)
-        //         openDialog(row, 'examine')
-        //     },
-        //     show: (row) => {
-        //         return row.appStatus == 1
-        //     }
-        // },
-        // {
-        //     label: '查看',
-        //     type: 'primary',
-        //     hasPermi: ['manage:details'],
-        //     key: 'details',
-        //     func: (row) => {
-        //         console.log(row)
-        //         // router.push("/order/order-details/" + row.mainOrderId);
-        //         // openDialog(row)
-        //     }
-        // },
-        // {
-        //     label: '删除',
-        //     type: 'danger',
-        //     hasPermi: ['manage:delete'],
-        //     key: 'delete',
-        //     func: (row) => {
-        //         console.log(row)
-        //         handleDelete([row.id])
-        //     }
-        // }
-    ]
-})
-const dialogData = reactive({
-    title: '',
-    column: [
-        {
-            label: '姓名',
-            prop: 'name',
-            type: 'input',
-
-        },
-        {
-            label: '年龄',
-            prop: 'age',
-            type: 'input',
-
-        },
-        {
-            label: '电话',
-            prop: 'phonenumber',
-            type: 'input',
-
-        },
-        {
-            label: '家庭地址',
-            prop: 'address',
-            type: 'input',
-
-        },
-        // {
-        //     label: '服务项目/类别',
-        //     prop: 'businessManagementId',
-        //     type: 'cascader',
-        //     isSearch: true,
-        //     options: options,
-        //     props: { label: 'businessName', value: 'id', checkStrictly:true },
-
-        // },
-        {
-            label: '身份证件',
-            prop: 'idCardPicture',
-            type: 'img',
-
-        },
-        {
-            label: '职业证书',
-            prop: 'certificationPicture',
-            type: 'img',
-
-        },
-        {
-            label: '技能简介',
-            prop: 'skillDescribe',
-            type: 'textarea',
-        },
-        {
-            label: '审核状态',
-            prop: 'appStatus',
-            type: 'radio',
-            rules: [
-                { required: true, message: '请选择审核状态', trigger: 'blur' }
-            ],
-            options: [
-                {
-                    label: '通过',
-                    value: '2'
-                },
-                {
-                    label: '不通过',
-                    value: '3'
-                }
-            ]
-        },
-    ]
-})
-const { title } = toRefs(dialogData);
-const parentId = ref(0);
 
-const openDialog = (row, type) => {
-    console.log('row', row);
-    try {
-        const disabledData = {
-            name: true,
-            age: true,
-            phonenumber: true,
-            address: true,
-            skillDescribe: true,
-            businessManagementId: true,
-        }
-
-        if (type) {
-            //审核
-            title.value = '审核'
-
-        } else {
-            disabledData['appStatus'] = true;
-            //查看详情
-            title.value = '查看详情'
-        }
-
-        dialogFormRef.value.initForm(row, disabledData)
-
-    } catch (error) {
-        console.log('error', error);
-    } finally {
-        console.log('dialogFormRef.value', dialogFormRef.value);
-
-        dialogFormRef.value.handleDialog(true);
-    }
+const jlzj_area_type = ref('0');// 0: 平台 10:区域公司 20:服务中心
+const useFun ={
+    "0":usePlatform,
+    "10":useRegional,
+    "20":useService,
 }
-const handleDelete = (ids) => {
-    proxy.$modal.confirm('是否确认删除角色编号为"' + ids + '"的数据项?').then(function () {
-        return true
-    }).then(() => {
-        userTableRef.value.resetForm();
-        proxy.$modal.msgSuccess("删除成功");
-    }).catch(() => { });
-}
-
-const submitForm = async (parmas) => {
+const {
+    tableColumn,
+    dialogData,
+    tabList,
+} = useFun[jlzj_area_type.value](proxy);
+const {
+    dialogFormRef,
+    userTableRef,
+    searchBtns,
+    scopeBtns
+} = useData({ proxy, jlzj_area_type });
+console.log('tableColumn', tableColumn);
 
-    try {
-        console.log('submit', parmas);
-        // if (title.value === '审核') {
-        //     const res = await approval({
-        //         volunteerInfoId: parmas.volunteerInfoId,
-        //         appStatus: parmas.appStatus,
-        //         rejectReason: parmas.rejectReason
-        //     })
-        //     if (up_res.code === 200) {
-        //         proxy.$modal.msgSuccess("审核成功");
-        //         return;
-        //     }
-        //     proxy.$modal.msgSuccess(res.msg);
-        // }
-    } catch (error) {
-        console.log('error', error);
 
-    } finally {
-        userTableRef.value.resetForm();
-        dialogFormRef.value.handleDialog(false);
-    }
 
-}
 
-const exportFile = async(parmas) => { 
-	console.log("TCL: exportFile -> parmas", parmas)
-    try {
-        proxy.download("core/orderSettlementApplication/export",{
-            ...queryParams.value,
-        }, `订单费用结算_${new Date().getTime()}.xlsx`);
-    } catch (error) {
-        
-    }
-}
 
 </script>
 

+ 200 - 0
src/views/finance/settlement/useData.js

@@ -0,0 +1,200 @@
+import { ref, computed } from "vue";
+import { regionalsettlement, serviceSettlement } from "@/api/finance/settlement.js";
+
+//功能
+export default ({ proxy, jlzj_area_type }) => {
+    const router = useRouter();
+    const dialogFormRef = ref(null);
+    const userTableRef = ref(null);
+
+    const dialogType = ref('applyfor');
+    //打开弹窗 applyfor:申请  settlement:结算
+    const openDialog = (params, type) => {
+        console.log('ids', ids);
+        try {
+            dialogType.value = type;
+
+            let params = {};
+            let disabledData = {};
+
+            if (type === 'applyfor') {
+                params = { mainOrderIds: params }
+            }
+            if (type === 'settlement') {
+                params = { ...params }
+                disabledData = {
+                    payeeMethod: true,
+                    payeeAccount: true,
+                    payeeBankName: true,
+                    payeeName: true,
+                    payeeRemark: true
+                }
+            }
+
+            dialogFormRef.value.initForm(params, disabledData)
+        } catch (error) {
+            console.log('error', error);
+        } finally {
+            console.log('dialogFormRef.value', dialogFormRef.value);
+            dialogFormRef.value.handleDialog(true);
+        }
+    }
+    //导出
+    const exportFile = async (parmas) => {
+        console.log("TCL: exportFile -> parmas", parmas)
+        // try {
+        //     proxy.download("core/orderSettlementApplication/export",{
+        //         ...queryParams.value,
+        //     }, `订单费用结算_${new Date().getTime()}.xlsx`);
+        // } catch (error) { 
+        // }
+    }
+
+    const applyforSubmit = (data) => {
+        return new Promise(async (resolve, reject) => {
+            const parmas = {
+                mainOrderIds: data.mainOrderIds,
+                payeeMethod: data.payeeMethod,
+                payeeAccount: data.payeeAccount,
+                payeeBankName: data.payeeBankName,
+                payeeName: data.payeeName,
+                payeeRemark: data.payeeRemark
+            }
+            const res = await applyOrderSettlement(parmas);
+            if (up_res.code === 200) {
+                proxy.$modal.msgSuccess("审核成功");
+                resolve()
+            }
+            proxy.$modal.msgSuccess(res.msg);
+            reject()
+        })
+    }
+
+    const settlementSubmit = async (data) => {
+        return new Promise(async (resolve, reject) => {
+            const parmas = {
+                orderId: data.orderId,
+                payeeId: data.payeeId,
+                payeeName: data.payeeName,
+                payeeBank: data.payeeBank,
+                payeeBankAccount: data.payeeBankAccount,
+                payeeRemark: data.payeeRemark
+            }
+            let res = null;
+            //平台结算区域的申请
+            if (jlzj_area_type.value === '0') {
+                res = await applyOrderSettlement(parmas)
+            }
+            //区域结算平台的申请
+
+            if (jlzj_area_type.value === '10') {
+                res = await serviceSettlement(parmas)
+            }
+
+            if (up_res.code === 200) {
+                proxy.$modal.msgSuccess("审核成功");
+                resolve()
+            }
+            proxy.$modal.msgSuccess(res.msg);
+            reject()
+        })
+    }
+
+    //申请提交
+    const submitForm = async (data) => {
+
+        try {
+            console.log('submit', data);
+            //申请
+            if (dialogType.value === 'applyfor') {
+                await applyforSubmit(data);
+            }
+            if (dialogType.value === 'settlement') {
+                await settlementSubmit(data);
+            }
+        } catch (error) {
+            console.log('error', error);
+        } finally {
+            userTableRef.value.resetForm();
+            dialogFormRef.value.handleDialog(false);
+        }
+    }
+
+
+
+    return {
+        dialogFormRef,
+        userTableRef,
+        openDialog,
+        exportFile,
+        submitForm,
+        searchBtns: [
+            {
+                label: '批量申请',
+                func: () => {
+                    const ids = userTableRef.value.ids;
+                    console.log('批量删除', ids)
+                    ids.length > 0 && openDialog(ids, 'applyfor')
+                },
+                key: 'applicant',
+                type: 'primary'
+            },
+            {
+                label: '批量结算',
+                func: () => {
+                    const ids = userTableRef.value.ids;
+                    console.log('批量删除', ids)
+                    ids.length > 0 && openDialog(ids, 'settlement')
+                },
+                key: 'settlement',
+                type: 'primary',
+                show: () => jlzj_area_type.value === '10',//区域公司才可以结算
+            },
+            {
+                label: '导出',
+                func: (parmas) => {
+                    exportFile(parmas);
+                },
+                key: 'export',
+                type: 'primary'
+            },
+        ],
+        scopeBtns: [
+            {
+                label: '结算申请',
+                type: 'primary',
+                key: 'examine',
+                func: (row) => {
+                    console.log(row)
+                    openDialog([row.mainOrderId], 'applyfor')
+                },
+                // show: (row) => {
+                //     return jlzj_area_type.value === '20'
+                // }
+            },
+            {
+                label: '费用结算',
+                type: 'primary',
+                key: 'examine',
+                func: (row) => {
+                    console.log(row)
+                    openDialog([row.mainOrderId], 'settlement')
+                },
+                show: () => jlzj_area_type.value === '10',//区域公司才可以结算
+            },
+            {
+                label: '查看详情',
+                type: 'primary',
+                key: 'details',
+                func: (row) => {
+                    console.log(row)
+                    router.push({
+                        path: "/order-details",
+                        query: { id: row.mainOrderId }
+                    });
+                }
+            },
+        ]
+
+    }
+}

+ 126 - 0
src/views/finance/settlement/usePlatform.js

@@ -0,0 +1,126 @@
+import { ref,computed } from "vue";
+// 平台
+export default (proxy) => {
+
+    const { 
+        lrr_service_status,
+        area_settlement_status
+     } = proxy.useDict("lrr_service_status","area_settlement_status");
+
+     const tabList =computed(() => {
+        let data = []
+        data = area_settlement_status.value.map(item => {
+            return {
+                title: item.label,
+                name: item.value
+            }
+        })
+        return data || [];
+    })
+
+    return {
+        tableColumn:ref(
+            [
+                {
+                    label: '订单号',
+                    prop: 'mainOrderId',
+                    type: 'input',
+                    isSearch: true
+                },
+                {
+                    label: '订单开始时间',
+                    prop: 'createTime',
+                },
+                {
+                    label: '订单完成时间',
+                    prop: '',
+                },
+                {
+                    label: '用户名称',
+                    prop: 'clientName',
+                },
+                {
+                    label: '志愿者名称',
+                    prop: 'name',
+                },
+                {
+                    label: '服务项目',
+                    prop: 'projectName',
+                },
+                {
+                    label: '订单总金额(元)',
+                    prop: 'serviceTotalPrice',
+                },
+                {
+                    label: '订单状态',
+                    prop: 'orderStatus',
+                    type: 'dict',
+                    dict: lrr_service_status
+                },
+                {
+                    label: '区域公司',
+                    prop: '',
+                },
+                {
+                    label: '区域公司抽成金额',
+                    prop: 'areaDistributionAmount',
+                },
+                {
+                    label: '区域公司结算状态',
+                    prop: '',
+                },
+                {
+                    label: '区域公司结算时间',
+                    prop: '',
+                }
+            ]
+            ),
+        dialogData: {
+            title: '结算申请',
+            column: [
+                {
+                    label: '收款方式',
+                    prop: 'payeeMethod',
+                    type: 'select',
+                    dictionary: 'settlement_application_payee_method',
+                    rules: [
+                        { required: true, message: '请选择收款方式', trigger: 'change' }
+                    ],
+                },
+                {
+                    label: '收款账号',
+                    prop: 'payeeAccount',
+                    type: 'input',
+                    rules: [
+                        { required: true, message: '请输入收款账号', trigger: 'change' }
+                    ],
+        
+                },
+                {
+                    label: '收款银行名称',
+                    prop: 'payeeBankName',
+                    type: 'input',
+                    rules: [
+                        { required: true, message: '请输入收款银行名称', trigger: 'change' }
+                    ],
+        
+                },
+                {
+                    label: '收款人',
+                    prop: 'payeeName',
+                    type: 'input',
+                    rules: [
+                        { required: true, message: '请输入收款人', trigger: 'change' }
+                    ],
+                },
+                {
+                    label: '收款人备注',
+                    prop: 'payeeRemark',
+                    type: 'textarea',
+                },
+            ]
+        },
+        tabList,
+      
+    }
+}

+ 133 - 0
src/views/finance/settlement/useRegional.js

@@ -0,0 +1,133 @@
+import { ref,computed } from "vue";
+// 区域
+export default (proxy) => {
+
+    const { 
+        lrr_service_status,
+        area_settlement_status
+     } = proxy.useDict("lrr_service_status","area_settlement_status");
+
+     const tabList =computed(() => {
+        let data = []
+        data = area_settlement_status.value.map(item => {
+            return {
+                title: item.label,
+                name: item.value
+            }
+        })
+        return data || [];
+    })
+
+    return {
+        tableColumn:ref([
+            {
+                label: '订单号',
+                prop: 'mainOrderId',
+                type: 'input',
+                isSearch: true
+            },
+            {
+                label: '订单开始时间',
+                prop: 'createTime',
+            },
+            {
+                label: '订单完成时间',
+                prop: '',
+            },
+            {
+                label: '用户名称',
+                prop: 'clientName',
+            },
+            {
+                label: '志愿者名称',
+                prop: 'name',
+            },
+            {
+                label: '服务项目',
+                prop: 'projectName',
+            },
+            {
+                label: '订单总金额(元)',
+                prop: 'serviceTotalPrice',
+            },
+            {
+                label: '订单状态',
+                prop: 'orderStatus',
+                type: 'dict',
+                dict: lrr_service_status
+        
+            },
+            {
+                label: '服务中心',
+                prop: '',
+            },
+            {
+                label: '抽成金额',
+                prop: 'serviceCentreDistributionAmount',
+            },
+            {
+                label: '结算状态',
+                prop: '',
+            },
+            {
+                label: '结算时间',
+                prop: '',
+            },
+            {
+                label: '服务中心抽成金额',
+                prop: 'serviceCentreDistributionAmount',
+            },
+            {
+                label: '服务中心结算状态',
+                prop: '',
+            },
+        ]),
+        dialogData: {
+            title: '结算申请',
+            column: [
+                {
+                    label: '收款方式',
+                    prop: 'payeeMethod',
+                    type: 'select',
+                    dictionary: 'settlement_application_payee_method',
+                    rules: [
+                        { required: true, message: '请选择收款方式', trigger: 'change' }
+                    ],
+                },
+                {
+                    label: '收款账号',
+                    prop: 'payeeAccount',
+                    type: 'input',
+                    rules: [
+                        { required: true, message: '请输入收款账号', trigger: 'change' }
+                    ],
+        
+                },
+                {
+                    label: '收款银行名称',
+                    prop: 'payeeBankName',
+                    type: 'input',
+                    rules: [
+                        { required: true, message: '请输入收款银行名称', trigger: 'change' }
+                    ],
+        
+                },
+                {
+                    label: '收款人',
+                    prop: 'payeeName',
+                    type: 'input',
+                    rules: [
+                        { required: true, message: '请输入收款人', trigger: 'change' }
+                    ],
+                },
+                {
+                    label: '收款人备注',
+                    prop: 'payeeRemark',
+                    type: 'textarea',
+                },
+            ]
+        },
+        tabList,
+      
+    }
+}

+ 120 - 0
src/views/finance/settlement/useService.js

@@ -0,0 +1,120 @@
+// 服务中心
+import { ref,computed } from "vue";
+export default (proxy) => {
+
+    const { 
+        lrr_service_status,
+        service_centre_settlement_stauts
+     } = proxy.useDict("lrr_service_status","service_centre_settlement_stauts");
+
+     const tabList =computed(() => {
+        let data = []
+        data = service_centre_settlement_stauts.value.map(item => {
+            return {
+                title: item.label,
+                name: item.value
+            }
+        })
+        return data || [];
+    })
+
+    return {
+        tableColumn:ref([
+            {
+                label: '订单号',
+                prop: 'mainOrderId',
+                type: 'input',
+                isSearch: true
+            },
+            {
+                label: '订单开始时间',
+                prop: 'createTime',
+            },
+            {
+                label: '订单完成时间',
+                prop: '',
+            },
+            {
+                label: '用户名称',
+                prop: 'clientName',
+            },
+            {
+                label: '志愿者名称',
+                prop: 'name',
+            },
+            {
+                label: '服务项目',
+                prop: 'projectName',
+            },
+            {
+                label: '订单总金额(元)',
+                prop: 'serviceTotalPrice',
+            },
+            {
+                label: '订单状态',
+                prop: 'orderStatus',
+                type: 'dict',
+                dict: lrr_service_status
+            },
+            {
+                label: '抽成金额',
+                prop: '',
+            },
+            {
+                label: '结算状态',
+                prop: '',
+            },
+            {
+                label: '结算时间',
+                prop: '',
+            },
+        ]),
+        dialogData: {
+            title: '结算申请',
+            column: [
+                {
+                    label: '收款方式',
+                    prop: 'payeeMethod',
+                    type: 'select',
+                    dictionary: 'settlement_application_payee_method',
+                    rules: [
+                        { required: true, message: '请选择收款方式', trigger: 'change' }
+                    ],
+                },
+                {
+                    label: '收款账号',
+                    prop: 'payeeAccount',
+                    type: 'input',
+                    rules: [
+                        { required: true, message: '请输入收款账号', trigger: 'change' }
+                    ],
+        
+                },
+                {
+                    label: '收款银行名称',
+                    prop: 'payeeBankName',
+                    type: 'input',
+                    rules: [
+                        { required: true, message: '请输入收款银行名称', trigger: 'change' }
+                    ],
+        
+                },
+                {
+                    label: '收款人',
+                    prop: 'payeeName',
+                    type: 'input',
+                    rules: [
+                        { required: true, message: '请输入收款人', trigger: 'change' }
+                    ],
+                },
+                {
+                    label: '收款人备注',
+                    prop: 'payeeRemark',
+                    type: 'textarea',
+                },
+            ]
+        },
+        tabList,
+      
+    }
+}

+ 2 - 2
vite.config.js

@@ -38,9 +38,9 @@ export default defineConfig(({ mode, command }) => {
         // https://cn.vitejs.dev/config/#server-proxy
         '/dev-api': {
           // target: 'http://localhost:9527',
-          // target: 'http://192.168.100.95:9527',
+          target: 'http://192.168.100.95:9527',
           // target: 'https://zybooks.tech/prod-api',
-          target: 'http://192.168.100.122:9527',
+          // target: 'http://192.168.100.122:9527',
           changeOrigin: true,
           rewrite: (p) => p.replace(/^\/dev-api/, '')
         },