Przeglądaj źródła

feat: 志愿者管理

chenjj 1 miesiąc temu
rodzic
commit
224720aa89

+ 1 - 1
src/api/staff/volunteer.js

@@ -12,7 +12,7 @@ export function list(query) {
 //志愿者审批
 export function approval(data) {
   return request({
-    url: '/core/volunteer/info/approval',
+    url: '/core/volunteer/info/web/approval',
     method: 'post',
     data: data
   })

+ 3 - 3
src/views/components/DialogForm/index.vue

@@ -1,5 +1,5 @@
 <template>
-    <el-dialog :title="title" v-model="open" width="500px" append-to-body>
+    <el-dialog :title="title" v-model="open" width="700px" append-to-body>
         <el-form ref="dialogFormRef" :model="form" label-width="100px">
             <template v-for="item in column" :key="item.prop">
                 <!-- 输入框 -->
@@ -14,7 +14,7 @@
                 </el-form-item>
 
                 <el-form-item :label="item.label" v-if="item.type === 'radio'" :prop="item.prop" :rules="item.rules">
-                    <el-radio-group v-model="form[item.prop]">
+                    <el-radio-group v-model="form[item.prop]"  :disabled="disables[item.prop]">
                         <el-radio v-for="dict in item.options" :key="dict.value" :value="dict.value">{{ dict.label }}</el-radio>
                     </el-radio-group>
                 </el-form-item>
@@ -50,7 +50,7 @@
                  <el-form-item :label="item.label" v-if="item.type === 'img' " :prop="item.prop">
                     <el-space wrap>
                         <div v-for="(imgItem,imgIndex) in getImages(item.prop)" :key="imgIndex">
-                            <img  :src="imgItem" alt="" srcset="" />
+                            <img  :src="imgItem" alt="" srcset="" style="width: 180px;" />
                         </div>
                     </el-space>
                 </el-form-item>

+ 32 - 12
src/views/components/ListPage/Table.vue

@@ -8,30 +8,41 @@
                 <el-table-column v-if="item.type === 'img'" :label="item.label" :prop="item.tableProp || item.prop"
                     :width="item.width">
                     <template #default="scope">
-                        <el-button type="primary" link @click="onClick(scope.row)">
+                        <el-button type="primary" link @click="onClick(scope.row,item.tableProp || item.prop)">
                             查看
                         </el-button>
                     </template>
                 </el-table-column>
+                <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]" />
+                    </template>
+                </el-table-column>
 
                 <el-table-column v-else :label="item.label" :prop="item.tableProp || item.prop"
                     :width="item.width"></el-table-column>
             </template>
-            <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+            <el-table-column label="操作"  class-name="small-padding fixed-width">
                 <template #default="scope">
                     <el-space wrap>
-                        <el-button v-for="item in scopeBtns" :key="item.key" link :type="item.type"
-                            @click="item.func(scope.row)" v-hasPermi="item.hasPermi"> {{ item.label }}</el-button>
+                        <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>
+                           </template>
+                        </div>
+                       
                     </el-space>
                 </template>
             </el-table-column>
         </el-table>
 
-        <el-dialog v-model="dialogVisible" title="图片查看" width="500" :before-close="handleClose">
-            <div>
+        <el-dialog v-model="dialogVisible" title="图片查看"  :before-close="handleClose">
+            <div class="img-box">
                 <el-space wrap>
                     <div v-for="(imgItem, imgIndex) in images" :key="imgIndex">
-                        <el-image style="width: 100px; height: 100px" :src="imgItem" />
+                        <el-image  :src="imgItem"  />
                     </div>
                 </el-space>
             </div>
@@ -91,11 +102,11 @@ const resetIds = () => {
     ids.value = []
 }
 
-const onClick = (row) => {
-    console.log('row', row);
+const onClick = (row,pro) => {
+    console.log('row', row,pro);
     dialogVisible.value = true;
-    if (row.images) {
-        images.value = row.images.split(',');
+    if (row[pro]) {
+        images.value = row[pro].split(',');
 
     }
 }
@@ -107,4 +118,13 @@ defineExpose({
 })
 </script>
 
-<style lang='scss' scoped></style>
+<style lang='scss' scoped>
+.img-box {
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    min-height: 300px;
+    width: 100%;
+    height: 100%;
+}
+</style>

+ 50 - 38
src/views/staff/volunteer/manage/index.vue

@@ -14,6 +14,8 @@ 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();
@@ -24,7 +26,7 @@ const listPageData = reactive({
             label: '注册时间',
             prop: 'createTime',
             type: 'date',
-            isSearch: true,
+            isSearch: false,
             keys: ['start', 'end']
         },
         {
@@ -46,10 +48,10 @@ const listPageData = reactive({
             label: '项目类别',
             prop: 'projectTypeName',
         },
-        {
-            label: '科目',
-            prop: 'projectTypeName',
-        },
+        // {
+        //     label: '科目',
+        //     prop: 'projectTypeName',
+        // },
 
         {
             label: '手机号',
@@ -68,7 +70,7 @@ const listPageData = reactive({
         },
         {
             label: '职业证书',
-            prop: 'certificationPicture',
+            prop: 'volunteerPicture',
             type: 'img',
         },
         {
@@ -77,21 +79,23 @@ const listPageData = reactive({
         },
         {
             label: '审核状态',
-            prop: 'skillDescribe',
+            prop: 'appStatus',
+            type:'dict',
+            dict: volunteer_app_status
         },
     ],
     searchBtns: [
-        {
-            label: '批量删除',
-            func: () => {
-                const ids = userTableRef.value.ids;
-                console.log('批量删除', ids)
-                handleDelete(ids);
-            },
-            key: 'deletes',
-            hasPermi: ['examine:delete'],
-            type: 'danger'
-        },
+        // {
+        //     label: '批量删除',
+        //     func: () => {
+        //         const ids = userTableRef.value.ids;
+        //         console.log('批量删除', ids)
+        //         handleDelete(ids);
+        //     },
+        //     key: 'deletes',
+        //     hasPermi: ['manage:delete'],
+        //     type: 'danger'
+        // },
     ],
     tableApi: list,//接口地址
     isSelect: true,//是否勾选
@@ -99,33 +103,36 @@ const listPageData = reactive({
         {
             label: '审核',
             type: 'primary',
-            hasPermi: ['examine:edit'],
-            key: 'edit',
+            hasPermi: ['manage:examine'],
+            key: 'examine',
             func: (row) => {
                 console.log(row)
                 openDialog(row, 'examine')
+            },
+            show: (row) => {
+                return row.appStatus == 1
             }
         },
         {
             label: '查看详情',
             type: 'primary',
-            hasPermi: ['examine:edit'],
-            key: 'edit',
+            hasPermi: ['manage:details'],
+            key: 'details',
             func: (row) => {
                 console.log(row)
                 openDialog(row)
             }
         },
-        {
-            label: '删除',
-            type: 'danger',
-            hasPermi: ['examine:delete'],
-            key: 'edit',
-            func: (row) => {
-                console.log(row)
-                handleDelete([row.id])
-            }
-        }
+        // {
+        //     label: '删除',
+        //     type: 'danger',
+        //     hasPermi: ['manage:delete'],
+        //     key: 'delete',
+        //     func: (row) => {
+        //         console.log(row)
+        //         handleDelete([row.id])
+        //     }
+        // }
     ]
 })
 const dialogData = reactive({
@@ -191,11 +198,11 @@ const dialogData = reactive({
             options: [
                 {
                     label: '通过',
-                    value: 2
+                    value: '2'
                 },
                 {
                     label: '不通过',
-                    value: 3
+                    value: '3'
                 }
             ]
         },
@@ -259,7 +266,11 @@ const submitForm = async (parmas) => {
     try {
         console.log('submit', parmas);
         if (title.value === '审核') {
-            const res = await approval(parmas)
+            const res = await approval({
+                volunteerInfoId: parmas.volunteerId,
+                appStatus: parmas.appStatus,
+                rejectReason: parmas.rejectReason
+            })
             if (up_res.code === 200) {
                 proxy.$modal.msgSuccess("审核成功");
                 return;
@@ -267,9 +278,10 @@ const submitForm = async (parmas) => {
             proxy.$modal.msgSuccess(res.msg);
         }
     } catch (error) {
-        console.log('error',error);
-        
+        console.log('error', error);
+
     } finally {
+        userTableRef.value.resetForm();
         dialogFormRef.value.handleDialog(false);
     }
 
@@ -290,4 +302,4 @@ getTreeListData();
 
 </script>
 
-<style lang='scss' scoped></style>
+<style lang='scss' scoped></style>

+ 2 - 2
vite.config.js

@@ -31,8 +31,8 @@ export default defineConfig(({ mode, command }) => {
       proxy: {
         // https://cn.vitejs.dev/config/#server-proxy
         '/dev-api': {
-          // target: 'http://192.168.100.121:9527',
-          target: 'http://192.168.100.86:9527',
+          target: 'http://192.168.100.121:9527',
+          // target: 'http://192.168.100.86:9527',
           changeOrigin: true,
           rewrite: (p) => p.replace(/^\/dev-api/, '')
         }