瀏覽代碼

feat: 用户、订单接口对接

chenjj 4 周之前
父節點
當前提交
bc8be3df47

+ 9 - 0
src/api/order/manage.js

@@ -0,0 +1,9 @@
+import request from '@/utils/request'
+
+export function list(query) {
+  return request({
+    url: '/core/users/orders/web/mainOrderList',
+    method: 'get',
+    params: query
+  })
+}

+ 136 - 0
src/api/staff/user.js

@@ -0,0 +1,136 @@
+import request from '@/utils/request'
+import { parseStrEmpty } from "@/utils/ruoyi";
+
+// 查询用户列表
+export function listUser(query) {
+  return request({
+    url: '/system/user/userList',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询用户详细
+export function getUser(userId) {
+  return request({
+    url: '/system/user/' + parseStrEmpty(userId),
+    method: 'get'
+  })
+}
+
+// 新增用户
+export function addUser(data) {
+  return request({
+    url: '/system/user',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改用户
+export function updateUser(data) {
+  return request({
+    url: '/system/user',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除用户
+export function delUser(userId) {
+  return request({
+    url: '/system/user/' + userId,
+    method: 'delete'
+  })
+}
+
+// 用户密码重置
+export function resetUserPwd(userId, password) {
+  const data = {
+    userId,
+    password
+  }
+  return request({
+    url: '/system/user/resetPwd',
+    method: 'put',
+    data: data
+  })
+}
+
+// 用户状态修改
+export function changeUserStatus(userId, status) {
+  const data = {
+    userId,
+    status
+  }
+  return request({
+    url: '/system/user/changeStatus',
+    method: 'put',
+    data: data
+  })
+}
+
+// 查询用户个人信息
+export function getUserProfile() {
+  return request({
+    url: '/system/user/profile',
+    method: 'get'
+  })
+}
+
+// 修改用户个人信息
+export function updateUserProfile(data) {
+  return request({
+    url: '/system/user/profile',
+    method: 'put',
+    data: data
+  })
+}
+
+// 用户密码重置
+export function updateUserPwd(oldPassword, newPassword) {
+  const data = {
+    oldPassword,
+    newPassword
+  }
+  return request({
+    url: '/system/user/profile/updatePwd',
+    method: 'put',
+    data: data
+  })
+}
+
+// 用户头像上传
+export function uploadAvatar(data) {
+  return request({
+    url: '/system/user/profile/avatar',
+    method: 'post',
+    headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
+    data: data
+  })
+}
+
+// 查询授权角色
+export function getAuthRole(userId) {
+  return request({
+    url: '/system/user/authRole/' + userId,
+    method: 'get'
+  })
+}
+
+// 保存授权角色
+export function updateAuthRole(data) {
+  return request({
+    url: '/system/user/authRole',
+    method: 'put',
+    params: data
+  })
+}
+
+// 查询部门下拉树结构
+export function deptTreeSelect() {
+  return request({
+    url: '/system/user/deptTree',
+    method: 'get'
+  })
+}

+ 12 - 3
src/views/components/ListPage/index.vue

@@ -17,7 +17,7 @@
 </template>
 
 <script setup>
-import { computed, reactive, watch } from 'vue';
+import { computed, onMounted, reactive, watch } from 'vue';
 import Search from './Search.vue';
 import Table from './Table.vue';
 import { ElMessage } from 'element-plus'
@@ -103,7 +103,9 @@ const changeTab = (tab) => {
     resetForm();
 }
 
-// watch(() => )
+watch(() =>tabsValue.value,()=>{
+    sessionStorage.setItem('tabsValue',tabsValue.value)
+} )
 
 const getList = async (parmas) => {
     try {
@@ -125,7 +127,7 @@ const getList = async (parmas) => {
     }
 }
 
-getList();
+
 
 const ids = computed(() =>{
     const _d = tableRef.value.ids;
@@ -139,6 +141,13 @@ const ids = computed(() =>{
     return tableRef.value.ids
 })
 
+onMounted(() => {
+  const tabs =   sessionStorage.getItem('tabsValue');  
+  if(tabs){
+    tabsValue.value = tabs;
+  }
+  getList();
+})
 
 
 defineExpose({

+ 76 - 0
src/views/order/details/index.vue

@@ -0,0 +1,76 @@
+<template>
+    <div class="details-main">
+        <div class="details-main-box">
+            <div class="details-dr">1</div>
+            <div class="details-list">
+                <div class="details-list-item">
+                    <el-image style="width: 100px; height: 100px"
+                        src="https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png" />
+                    <div>
+                        <div>姓名:xxx</div>
+                        <div>评分:xxx</div>
+                        <div> 类别:xxx</div>
+                        <div> 技能简介:xxx</div>
+                    </div>
+
+                </div>
+                <el-divider />
+            </div>
+        </div>
+        <div class="details-main-footer">
+            <el-descriptions title="订单信息" border>
+                <el-descriptions-item label="姓名">kooriookami</el-descriptions-item>
+                <el-descriptions-item label="项目类别">18100000000</el-descriptions-item>
+                <el-descriptions-item label="被服务人员">18100000000</el-descriptions-item>
+                <el-descriptions-item label="是否有疾病">18100000000</el-descriptions-item>
+                <el-descriptions-item label="手机号">18100000000</el-descriptions-item>
+                <el-descriptions-item label="科目">18100000000</el-descriptions-item>
+                <el-descriptions-item label="性别">18100000000</el-descriptions-item>
+                <el-descriptions-item label="服务项目">18100000000</el-descriptions-item>
+                <el-descriptions-item label="订单状态">18100000000</el-descriptions-item>
+                <el-descriptions-item label="电话">18100000000</el-descriptions-item>
+                <el-descriptions-item label="住址">18100000000</el-descriptions-item>
+            </el-descriptions>
+        </div>
+
+    </div>
+</template>
+
+<script setup>
+
+const list = [
+    {
+        lable: ''
+    }
+]
+</script>
+
+<style lang="scss" scoped>
+.details-main {
+    height: calc(100vh - 84px);
+    display: flex;
+    flex-direction: column;
+    padding: 24px;
+
+    .details-main-box {
+        display: flex;
+        flex: 1;
+
+        .details-dr {
+            flex: 1;
+        }
+
+        .details-list {
+            display: flex;
+            flex-direction: column;
+            overflow-y: auto;
+
+            .details-list-item {
+                display: flex;
+            }
+        }
+    }
+
+    .details-main-footer {}
+}
+</style>

+ 270 - 0
src/views/order/examine/index.vue

@@ -0,0 +1,270 @@
+<template>
+    <div>
+        <ListPage :column="listPageData.tableColumn" :tableApi="listPageData.tableApi" :isSelect="listPageData.isSelect"
+            :scopeBtns="listPageData.scopeBtns" :searchBtns="listPageData.searchBtns" ref="userTableRef"
+            v-if="options && options.length > 0" tabsearchKey="appStatus" />
+        <DialogForm ref="dialogFormRef" :title="title" :column="dialogData.column" @submit="submitForm" />
+    </div>
+</template>
+
+<script setup>
+import { ref } from 'vue';
+import ListPage from '@/views/components/ListPage/index.vue';
+import { list, approval } from "@/api/staff/volunteer.js";
+import { getTreeList } from "@/api/staff/price.js";
+
+import DialogForm from '@/views/components/DialogForm/index.vue';
+const { proxy } = getCurrentInstance();
+const { volunteer_app_status } = proxy.useDict("volunteer_app_status");
+
+const options = ref([]);
+const userTableRef = ref();
+const dialogFormRef = ref(null);
+const listPageData = reactive({
+    tableColumn: [
+        {
+            label: '时间',
+            prop: 'createTime',
+            type: 'date',
+            isSearch: false,
+            width: '180px'
+        },
+        {
+            label: '姓名',
+            prop: 'name',
+            type: 'input',
+            isSearch: true,
+        },
+        {
+            label: '服务项目',
+            prop: 'businessManagementId',
+            type: 'cascader',
+            isSearch: true,
+            tableProp: 'projectName',
+            options: options,
+            props: { label: 'businessName', value: 'id', checkStrictly:true },
+        },
+        {
+            label: '项目类别',
+            prop: 'projectTypeName',
+        },
+        {
+            label: '科目',
+            prop: 'projectTypeName',
+        },
+        {
+            label: '被服务人员',
+            prop: 'projectTypeName',
+        },
+        {
+            label: '已服务',
+            prop: 'address',
+        },
+        {
+            label: '为服务',
+            prop: 'address',
+        },
+        {
+            label: '退单状态',
+            prop: 'idCardPicture',
+            type: 'dict',
+            dict: volunteer_app_status
+        },
+        {
+            label: '退款金额',
+            prop: 'volunteerPicture',
+            type: 'img',
+        },
+        {
+            label: '备注',
+            prop: 'address',
+        },
+    ],
+    searchBtns: [],
+    tableApi: list,//接口地址
+    isSelect: false,//是否勾选
+    scopeBtns: [
+        {
+            label: '审核',
+            type: 'primary',
+            hasPermi: ['manage:examine'],
+            key: 'examine',
+            func: (row) => {
+                console.log(row)
+                openDialog(row, 'examine')
+            },
+            // show: (row) => {
+            //     return row.appStatus == 1
+            // }
+        },
+    ]
+})
+const dialogData = reactive({
+    title: '',
+    column: [
+        {
+            label: '时间',
+            prop: 'name',
+            type: 'input',
+
+        },
+        {
+            label: '姓名',
+            prop: 'name',
+            type: 'input',
+
+        },
+        {
+            label: '电话',
+            prop: 'phonenumber',
+            type: 'input',
+
+        },
+        {
+            label: '服务项目/类别',
+            prop: 'businessManagementId',
+            type: 'cascader',
+            isSearch: true,
+            options: options,
+            props: { label: 'businessName', value: 'id', checkStrictly:true },
+        },
+        {
+            label: '科目',
+            prop: 'age',
+            type: 'input',
+
+        },
+        {
+            label: '被服务人员',
+            prop: 'address',
+            type: 'input',
+        },
+       
+        {
+            label: '手机号',
+            prop: 'idCardPicture',
+            type: 'img',
+
+        },
+        {
+            label: '退款金额',
+            prop: 'certificationPicture',
+            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) => {
+
+    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 getTreeListData = async () => {
+    try {
+        const res = await getTreeList({ parentId: parentId.value });
+        console.log('res', res);
+        options.value = res.data;
+    } catch (error) {
+
+    }
+}
+
+getTreeListData();
+
+</script>
+
+<style lang='scss' scoped></style>

+ 286 - 0
src/views/order/manage/index.vue

@@ -0,0 +1,286 @@
+<template>
+    <div>
+        <ListPage :column="listPageData.tableColumn" :tableApi="listPageData.tableApi" :isSelect="listPageData.isSelect"
+            :scopeBtns="listPageData.scopeBtns" :searchBtns="listPageData.searchBtns" ref="userTableRef"
+            v-if="options && options.length > 0"  />
+        <DialogForm ref="dialogFormRef" :title="title" :column="dialogData.column" @submit="submitForm" />
+    </div>
+</template>
+
+<script setup>
+import { ref } from 'vue';
+import ListPage from '@/views/components/ListPage/index.vue';
+import { list } from "@/api/order/manage.js";
+import { getTreeList } from "@/api/staff/price.js";
+
+import DialogForm from '@/views/components/DialogForm/index.vue';
+const { proxy } = getCurrentInstance();
+const { volunteer_app_status } = proxy.useDict("volunteer_app_status");
+
+const options = ref([]);
+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: 'businessManagementId',
+            type: 'cascader',
+            isSearch: true,
+            tableProp: 'projectName',
+            options: options,
+            props: { label: 'businessName', value: 'id', checkStrictly:true },
+        },
+        {
+            label: '项目类别',
+            prop: 'projectTypeName',
+        },
+        {
+            label: '科目',
+            prop: 'projectTypeName',
+        },
+        {
+            label: '评分',
+            prop: 'address',
+        },
+        {
+            label: '订单状态',
+            prop: 'orderStatus',
+            type: 'dict',
+            dict: volunteer_app_status
+        },
+        {
+            label: '订单单价',
+            prop: 'serviceOnePrice',
+        },
+        {
+            label: '订单金额',
+            prop: 'serviceTotalPrice',
+        },
+        {
+            label: '平台提成',
+            prop: 'skillDescribe',
+        }
+    ],
+    searchBtns: [],
+    tableApi: list,//接口地址
+    isSelect: false,//是否勾选
+    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)
+        //         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) => {
+
+    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 getTreeListData = async () => {
+    try {
+        const res = await getTreeList({ parentId: parentId.value });
+        console.log('res', res);
+        options.value = res.data;
+    } catch (error) {
+
+    }
+}
+
+getTreeListData();
+
+</script>
+
+<style lang='scss' scoped></style>

+ 161 - 0
src/views/staff/demo.vue

@@ -0,0 +1,161 @@
+<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" />
+    </div>
+</template>
+
+<script setup>
+import { ref } from 'vue';
+import ListPage from '@/views/components/ListPage/index.vue';
+import { listUser } from "@/api/staff/user";
+
+import DialogForm from '@/views/components/DialogForm/index.vue';
+
+const userTableRef = ref();
+const listPageData = reactive({
+    tableColumn: [
+        {
+            label: '姓名',
+            prop: 'name',
+            type: 'input',
+            isSearch: true
+        },
+        {
+            label: '时间',
+            prop: 'date',
+            type: 'date',
+            isSearch: true,
+            keys: ['start', 'end']
+        },
+        {
+            label: '性别',
+            prop: 'sex',
+            type: 'select',
+            dictionary: 'sys_user_sex',
+            isSearch: true
+        },
+    ],
+    searchBtns: [
+        {
+            label: '新增',
+            func: () => {
+                console.log('新增')
+                openDialog();
+            },
+            key: 'add',
+            hasPermi: ['system:role:query'],
+            icon: 'Plus',
+            type: 'primary'
+        },
+        {
+            label: '批量删除',
+            func: () => {
+                const ids = userTableRef.value.ids;
+                console.log('批量删除', ids)
+                handleDelete(ids);
+            },
+            key: 'deletes',
+            hasPermi: ['system:role:query'],
+            type: 'danger'
+        },
+    ],
+    tableApi: listUser,//接口地址
+    isSelect: true,//是否勾选
+    scopeBtns: [
+        {
+            label: '编辑',
+            type: 'primary',
+            hasPermi: ['system:role:edit'],
+            key: 'edit',
+            func: (row) => {
+                console.log(row)
+                openDialog(row)
+            }
+        },
+        {
+            label: '删除',
+            type: 'danger',
+            hasPermi: ['price:edit'],
+            key: 'edit',
+            func: (row) => {
+                console.log(row)
+                handleDelete([row.id])
+            }
+        }
+    ]
+})
+const dialogFormRef = ref(null);
+const dialogData = reactive({
+    title: '',
+    column:[
+        {
+            label: '姓名',
+            prop: 'name',
+            type: 'input',
+            rules: [
+                { required: true, message: '请输入姓名', trigger: 'blur' }
+            ]
+        },
+        {
+            label: '时间',
+            prop: 'date',
+            type: 'date',
+            keys: ['start', 'end'],
+            rules: [
+                { required: true, message: '请选择时间', trigger: 'blur' }
+            ]
+        },
+        {
+            label: '性别',
+            prop: 'sex',
+            type: 'select',
+            dictionary: 'sys_user_sex',
+            rules: [
+                { required: true, message: '请选择性别', trigger: 'blur' }
+            ]
+        },
+    ]
+})
+const { title } = toRefs(dialogData);
+const openDialog = (row) => {
+    console.log('row', row);
+    try {
+        if (row) {
+            //修改
+            title.value = '价格修改'
+            form.value = row;
+        } else {
+            //新增
+            title.value = '价格新增'
+        }
+
+    } 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 = (parmas) => {
+
+    console.log('submit',parmas);
+    
+}
+
+
+</script>
+
+<style lang='scss' scoped></style>

+ 192 - 86
src/views/staff/user/index.vue

@@ -1,7 +1,8 @@
 <template>
     <div>
         <ListPage :column="listPageData.tableColumn" :tableApi="listPageData.tableApi" :isSelect="listPageData.isSelect"
-            :scopeBtns="listPageData.scopeBtns" :searchBtns="listPageData.searchBtns" ref="userTableRef" />
+            :scopeBtns="listPageData.scopeBtns" :searchBtns="listPageData.searchBtns" ref="userTableRef"
+            v-if="options && options.length > 0"  />
         <DialogForm ref="dialogFormRef" :title="title" :column="dialogData.column" @submit="submitForm" />
     </div>
 </template>
@@ -9,133 +10,207 @@
 <script setup>
 import { ref } from 'vue';
 import ListPage from '@/views/components/ListPage/index.vue';
-import { addRole, changeRoleStatus, dataScope, delRole, getRole, listRole, updateRole, deptTreeSelect } from "@/api/system/role";
+import { listUser } from "@/api/staff/user";
+import { getTreeList } from "@/api/staff/price.js";
 
 import DialogForm from '@/views/components/DialogForm/index.vue';
+const { proxy } = getCurrentInstance();
+const { volunteer_app_status } = proxy.useDict("volunteer_app_status");
 
+const options = ref([]);
 const userTableRef = ref();
+const dialogFormRef = ref(null);
 const listPageData = reactive({
     tableColumn: [
         {
-            label: '姓名',
-            prop: 'name',
-            type: 'input',
-            isSearch: true
+            label: '用户ID',
+            prop: 'roleId',
+             width: '180px'
         },
         {
-            label: '时间',
-            prop: 'date',
+            label: '注册时间',
+            prop: 'createTime',
             type: 'date',
+            isSearch: false,
+            width: '180px'
+        },
+        {
+            label: '姓名',
+            prop: 'nickName',
+            type: 'input',
             isSearch: true,
-            keys: ['start', 'end']
+        },
+        {
+            label: '用户名',
+            prop: 'userName',
         },
         {
             label: '性别',
             prop: 'sex',
-            type: 'select',
-            dictionary: 'sys_user_sex',
-            isSearch: true
+            type: 'render',
+            render:(row) => {
+                return row.sex === '0' ? '男' : '女'
+            }
         },
-    ],
-    searchBtns: [
-        {
-            label: '新增',
-            func: () => {
-                console.log('新增')
-                openDialog();
-            },
-            key: 'add',
-            hasPermi: ['system:role:query'],
-            icon: 'Plus',
-            type: 'primary'
-        },
-        {
-            label: '批量删除',
-            func: () => {
-                const ids = userTableRef.value.ids;
-                console.log('批量删除', ids)
-                handleDelete(ids);
-            },
-            key: 'deletes',
-            hasPermi: ['system:role:query'],
-            type: 'danger'
+        {
+            label: '电话',
+            prop: 'phonenumber',
+            type: 'input',
+            isSearch: true
         },
-    ],
-    tableApi: listRole,//接口地址
-    isSelect: true,//是否勾选
-    scopeBtns: [
         {
-            label: '编辑',
-            type: 'primary',
-            hasPermi: ['system:role:edit'],
-            key: 'edit',
-            func: (row) => {
-                console.log(row)
-                openDialog(row)
-            }
+            label: '是否有疾病',
+            prop: 'isContagion',
         },
         {
-            label: '删除',
-            type: 'danger',
-            hasPermi: ['price:edit'],
-            key: 'edit',
-            func: (row) => {
-                console.log(row)
-                handleDelete([row.id])
-            }
-        }
+            label: '住址',
+            prop: 'adress',
+        },
+    ],
+    searchBtns: [],
+    tableApi: listUser,//接口地址
+    isSelect: false,//是否勾选
+    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)
+        //         openDialog(row)
+        //     }
+        // },
+        // {
+        //     label: '删除',
+        //     type: 'danger',
+        //     hasPermi: ['manage:delete'],
+        //     key: 'delete',
+        //     func: (row) => {
+        //         console.log(row)
+        //         handleDelete([row.id])
+        //     }
+        // }
     ]
 })
-const dialogFormRef = ref(null);
 const dialogData = reactive({
     title: '',
-    column:[
+    column: [
         {
             label: '姓名',
             prop: 'name',
             type: 'input',
-            rules: [
-                { required: true, message: '请输入姓名', trigger: 'blur' }
-            ]
+
         },
         {
-            label: '时间',
-            prop: 'date',
-            type: 'date',
-            keys: ['start', 'end'],
-            rules: [
-                { required: true, message: '请选择时间', trigger: 'blur' }
-            ]
+            label: '年龄',
+            prop: 'age',
+            type: 'input',
+
         },
         {
-            label: '性别',
-            prop: 'sex',
-            type: 'select',
-            dictionary: 'sys_user_sex',
+            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' }
+                { required: true, message: '请选择审核状态', trigger: 'blur' }
+            ],
+            options: [
+                {
+                    label: '通过',
+                    value: '2'
+                },
+                {
+                    label: '不通过',
+                    value: '3'
+                }
             ]
         },
     ]
 })
 const { title } = toRefs(dialogData);
-const openDialog = (row) => {
+const parentId = ref(0);
+
+const openDialog = (row, type) => {
     console.log('row', row);
     try {
-        if (row) {
-            //修改
-            title.value = '价格修改'
-            form.value = row;
+        const disabledData = {
+            name: true,
+            age: true,
+            phonenumber: true,
+            address: true,
+            skillDescribe: true,
+            businessManagementId: true,
+        }
+
+        if (type) {
+            //审核
+            title.value = '审核'
+
         } else {
-            //新增
-            title.value = '价格新增'
+            disabledData['appStatus'] = true;
+            //查看详情
+            title.value = '查看详情'
         }
 
+        dialogFormRef.value.initForm(row, disabledData)
+
     } catch (error) {
         console.log('error', error);
     } finally {
-        console.log('dialogFormRef.value',dialogFormRef.value);
-        
+        console.log('dialogFormRef.value', dialogFormRef.value);
+
         dialogFormRef.value.handleDialog(true);
     }
 }
@@ -148,14 +223,45 @@ const handleDelete = (ids) => {
     }).catch(() => { });
 }
 
+const submitForm = async (parmas) => {
 
-const submitForm = (parmas) => {
+    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);
 
-    console.log('submit',parmas);
-    
+    } finally {
+        userTableRef.value.resetForm();
+        dialogFormRef.value.handleDialog(false);
+    }
+
+}
+
+
+const getTreeListData = async () => {
+    try {
+        const res = await getTreeList({ parentId: parentId.value });
+        console.log('res', res);
+        options.value = res.data;
+    } catch (error) {
+
+    }
 }
 
+getTreeListData();
 
 </script>
 
-<style lang='scss' scoped></style>
+<style lang='scss' scoped></style>