|
@@ -0,0 +1,355 @@
|
|
|
+<template>
|
|
|
+ <div class="app-container">
|
|
|
+ <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
|
|
|
+ <el-form-item label="志愿者id" prop="volunteerId">
|
|
|
+ <el-input
|
|
|
+ v-model="queryParams.volunteerId"
|
|
|
+ placeholder="请输入志愿者id"
|
|
|
+ clearable
|
|
|
+ @keyup.enter="handleQuery"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="服务名称" prop="name">
|
|
|
+ <el-input
|
|
|
+ v-model="queryParams.name"
|
|
|
+ placeholder="请输入服务名称"
|
|
|
+ clearable
|
|
|
+ @keyup.enter="handleQuery"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="申请时间" prop="applyTime">
|
|
|
+ <el-date-picker clearable
|
|
|
+ v-model="queryParams.applyTime"
|
|
|
+ type="date"
|
|
|
+ value-format="YYYY-MM-DD"
|
|
|
+ placeholder="请选择申请时间">
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="审核人员id" prop="auditUserId">
|
|
|
+ <el-input
|
|
|
+ v-model="queryParams.auditUserId"
|
|
|
+ placeholder="请输入审核人员id"
|
|
|
+ clearable
|
|
|
+ @keyup.enter="handleQuery"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="最新审核时间" prop="auditTime">
|
|
|
+ <el-date-picker clearable
|
|
|
+ v-model="queryParams.auditTime"
|
|
|
+ type="date"
|
|
|
+ value-format="YYYY-MM-DD"
|
|
|
+ placeholder="请选择最新审核时间">
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
|
|
+ <el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+
|
|
|
+ <el-row :gutter="10" class="mb8">
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ plain
|
|
|
+ icon="Plus"
|
|
|
+ @click="handleAdd"
|
|
|
+ v-hasPermi="['core:volunteerService:add']"
|
|
|
+ >新增</el-button>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button
|
|
|
+ type="success"
|
|
|
+ plain
|
|
|
+ icon="Edit"
|
|
|
+ :disabled="single"
|
|
|
+ @click="handleUpdate"
|
|
|
+ v-hasPermi="['core:volunteerService:edit']"
|
|
|
+ >修改</el-button>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button
|
|
|
+ type="danger"
|
|
|
+ plain
|
|
|
+ icon="Delete"
|
|
|
+ :disabled="multiple"
|
|
|
+ @click="handleDelete"
|
|
|
+ v-hasPermi="['core:volunteerService:remove']"
|
|
|
+ >删除</el-button>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button
|
|
|
+ type="warning"
|
|
|
+ plain
|
|
|
+ icon="Download"
|
|
|
+ @click="handleExport"
|
|
|
+ v-hasPermi="['core:volunteerService:export']"
|
|
|
+ >导出</el-button>
|
|
|
+ </el-col>
|
|
|
+ <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-table v-loading="loading" :data="volunteerServiceList" @selection-change="handleSelectionChange">
|
|
|
+ <el-table-column type="selection" width="55" align="center" />
|
|
|
+ <el-table-column label="主键id" align="center" prop="volunteerServiceId" />
|
|
|
+ <el-table-column label="志愿者id" align="center" prop="volunteerId" />
|
|
|
+ <el-table-column label="服务名称" align="center" prop="name" />
|
|
|
+ <el-table-column label="服务封面图片地址" align="center" prop="coverUrl" />
|
|
|
+ <el-table-column label="服务展示图片地址,多张照片使用逗号隔开" align="center" prop="url" />
|
|
|
+ <el-table-column label="服务描述" align="center" prop="describe" />
|
|
|
+ <el-table-column label="申请时间" align="center" prop="applyTime" width="180">
|
|
|
+ <template #default="scope">
|
|
|
+ <span>{{ parseTime(scope.row.applyTime, '{y}-{m}-{d}') }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="审核状态: 10审核中 20审核通过 30审核未通过 40审核已取消" align="center" prop="auditStatus" />
|
|
|
+ <el-table-column label="审核人员id" align="center" prop="auditUserId" />
|
|
|
+ <el-table-column label="最新审核时间" align="center" prop="auditTime" width="180">
|
|
|
+ <template #default="scope">
|
|
|
+ <span>{{ parseTime(scope.row.auditTime, '{y}-{m}-{d}') }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="审核结果反馈" align="center" prop="auditRemark" />
|
|
|
+ <el-table-column label="服务状态: 10上架中 20已下架" align="center" prop="serviceStatus" />
|
|
|
+ <el-table-column label="数据备注字段" align="center" prop="remark" />
|
|
|
+ <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
+ <template #default="scope">
|
|
|
+ <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['core:volunteerService:edit']">修改</el-button>
|
|
|
+ <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['core:volunteerService:remove']">删除</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+
|
|
|
+ <pagination
|
|
|
+ v-show="total>0"
|
|
|
+ :total="total"
|
|
|
+ v-model:page="queryParams.pageNum"
|
|
|
+ v-model:limit="queryParams.pageSize"
|
|
|
+ @pagination="getList"
|
|
|
+ />
|
|
|
+
|
|
|
+ <!-- 添加或修改志愿者服务信息记录对话框 -->
|
|
|
+ <el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
|
|
+ <el-form ref="volunteerServiceRef" :model="form" :rules="rules" label-width="80px">
|
|
|
+ <el-form-item label="志愿者id" prop="volunteerId">
|
|
|
+ <el-input v-model="form.volunteerId" placeholder="请输入志愿者id" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="服务名称" prop="name">
|
|
|
+ <el-input v-model="form.name" placeholder="请输入服务名称" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="服务封面图片地址" prop="coverUrl">
|
|
|
+ <el-input v-model="form.coverUrl" type="textarea" placeholder="请输入内容" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="服务展示图片地址,多张照片使用逗号隔开" prop="url">
|
|
|
+ <el-input v-model="form.url" type="textarea" placeholder="请输入内容" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="服务描述" prop="describe">
|
|
|
+ <el-input v-model="form.describe" type="textarea" placeholder="请输入内容" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="申请时间" prop="applyTime">
|
|
|
+ <el-date-picker clearable
|
|
|
+ v-model="form.applyTime"
|
|
|
+ type="date"
|
|
|
+ value-format="YYYY-MM-DD"
|
|
|
+ placeholder="请选择申请时间">
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="审核人员id" prop="auditUserId">
|
|
|
+ <el-input v-model="form.auditUserId" placeholder="请输入审核人员id" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="最新审核时间" prop="auditTime">
|
|
|
+ <el-date-picker clearable
|
|
|
+ v-model="form.auditTime"
|
|
|
+ type="date"
|
|
|
+ value-format="YYYY-MM-DD"
|
|
|
+ placeholder="请选择最新审核时间">
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="审核结果反馈" prop="auditRemark">
|
|
|
+ <el-input v-model="form.auditRemark" type="textarea" placeholder="请输入内容" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="数据备注字段" prop="remark">
|
|
|
+ <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <template #footer>
|
|
|
+ <div class="dialog-footer">
|
|
|
+ <el-button type="primary" @click="submitForm">确 定</el-button>
|
|
|
+ <el-button @click="cancel">取 消</el-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup name="VolunteerService">
|
|
|
+import { listVolunteerService, getVolunteerService, delVolunteerService, addVolunteerService, updateVolunteerService } from "@/api/core/volunteerService";
|
|
|
+
|
|
|
+const { proxy } = getCurrentInstance();
|
|
|
+
|
|
|
+const volunteerServiceList = ref([]);
|
|
|
+const open = ref(false);
|
|
|
+const loading = ref(true);
|
|
|
+const showSearch = ref(true);
|
|
|
+const ids = ref([]);
|
|
|
+const single = ref(true);
|
|
|
+const multiple = ref(true);
|
|
|
+const total = ref(0);
|
|
|
+const title = ref("");
|
|
|
+
|
|
|
+const data = reactive({
|
|
|
+ form: {},
|
|
|
+ queryParams: {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ volunteerId: null,
|
|
|
+ name: null,
|
|
|
+ coverUrl: null,
|
|
|
+ url: null,
|
|
|
+ describe: null,
|
|
|
+ applyTime: null,
|
|
|
+ auditStatus: null,
|
|
|
+ auditUserId: null,
|
|
|
+ auditTime: null,
|
|
|
+ auditRemark: null,
|
|
|
+ serviceStatus: null,
|
|
|
+ },
|
|
|
+ rules: {
|
|
|
+ volunteerId: [
|
|
|
+ { required: true, message: "志愿者id不能为空", trigger: "blur" }
|
|
|
+ ],
|
|
|
+ name: [
|
|
|
+ { required: true, message: "服务名称不能为空", trigger: "blur" }
|
|
|
+ ],
|
|
|
+ applyTime: [
|
|
|
+ { required: true, message: "申请时间不能为空", trigger: "blur" }
|
|
|
+ ],
|
|
|
+ auditStatus: [
|
|
|
+ { required: true, message: "审核状态: 10审核中 20审核通过 30审核未通过 40审核已取消不能为空", trigger: "change" }
|
|
|
+ ],
|
|
|
+ serviceStatus: [
|
|
|
+ { required: true, message: "服务状态: 10上架中 20已下架不能为空", trigger: "change" }
|
|
|
+ ],
|
|
|
+ }
|
|
|
+});
|
|
|
+
|
|
|
+const { queryParams, form, rules } = toRefs(data);
|
|
|
+
|
|
|
+/** 查询志愿者服务信息记录列表 */
|
|
|
+function getList() {
|
|
|
+ loading.value = true;
|
|
|
+ listVolunteerService(queryParams.value).then(response => {
|
|
|
+ volunteerServiceList.value = response.rows;
|
|
|
+ total.value = response.total;
|
|
|
+ loading.value = false;
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+// 取消按钮
|
|
|
+function cancel() {
|
|
|
+ open.value = false;
|
|
|
+ reset();
|
|
|
+}
|
|
|
+
|
|
|
+// 表单重置
|
|
|
+ // function reset() {
|
|
|
+ // form.value = {
|
|
|
+ // volunteerServiceId: null,
|
|
|
+ // volunteerId: null,
|
|
|
+ // name: null,
|
|
|
+ // coverUrl: null,
|
|
|
+ // url: null,
|
|
|
+ // describe: null,
|
|
|
+ // applyTime: null,
|
|
|
+ // auditStatus: null,
|
|
|
+ // auditUserId: null,
|
|
|
+ // auditTime: null,
|
|
|
+ // auditRemark: null,
|
|
|
+ // serviceStatus: null,
|
|
|
+ // remark: null,
|
|
|
+ // createBy: null,
|
|
|
+ // createTime: null,
|
|
|
+ // updateBy: null,
|
|
|
+ // updateTime: null
|
|
|
+ // };
|
|
|
+ // proxy.resetForm("volunteerServiceRef");
|
|
|
+ // }
|
|
|
+
|
|
|
+/** 搜索按钮操作 */
|
|
|
+// function handleQuery() {
|
|
|
+// queryParams.value.pageNum = 1;
|
|
|
+// getList();
|
|
|
+// }
|
|
|
+
|
|
|
+/** 重置按钮操作 */
|
|
|
+// function resetQuery() {
|
|
|
+// proxy.resetForm("queryRef");
|
|
|
+// handleQuery();
|
|
|
+// }
|
|
|
+
|
|
|
+// 多选框选中数据
|
|
|
+// function handleSelectionChange(selection) {
|
|
|
+// ids.value = selection.map(item => item.volunteerServiceId);
|
|
|
+// single.value = selection.length != 1;
|
|
|
+// multiple.value = !selection.length;
|
|
|
+// }
|
|
|
+
|
|
|
+/** 新增按钮操作 */
|
|
|
+// function handleAdd() {
|
|
|
+// reset();
|
|
|
+// open.value = true;
|
|
|
+// title.value = "添加志愿者服务信息记录";
|
|
|
+// }
|
|
|
+
|
|
|
+/** 修改按钮操作 */
|
|
|
+// function handleUpdate(row) {
|
|
|
+// reset();
|
|
|
+// const _volunteerServiceId = row.volunteerServiceId || ids.value
|
|
|
+// getVolunteerService(_volunteerServiceId).then(response => {
|
|
|
+// form.value = response.data;
|
|
|
+// open.value = true;
|
|
|
+// title.value = "修改志愿者服务信息记录";
|
|
|
+// });
|
|
|
+// }
|
|
|
+
|
|
|
+/** 提交按钮 */
|
|
|
+// function submitForm() {
|
|
|
+// proxy.$refs["volunteerServiceRef"].validate(valid => {
|
|
|
+// if (valid) {
|
|
|
+// if (form.value.volunteerServiceId != null) {
|
|
|
+// updateVolunteerService(form.value).then(response => {
|
|
|
+// proxy.$modal.msgSuccess("修改成功");
|
|
|
+// open.value = false;
|
|
|
+// getList();
|
|
|
+// });
|
|
|
+// } else {
|
|
|
+// addVolunteerService(form.value).then(response => {
|
|
|
+// proxy.$modal.msgSuccess("新增成功");
|
|
|
+// open.value = false;
|
|
|
+// getList();
|
|
|
+// });
|
|
|
+// }
|
|
|
+// }
|
|
|
+// });
|
|
|
+// }
|
|
|
+
|
|
|
+/** 删除按钮操作 */
|
|
|
+// function handleDelete(row) {
|
|
|
+// const _volunteerServiceIds = row.volunteerServiceId || ids.value;
|
|
|
+// proxy.$modal.confirm('是否确认删除志愿者服务信息记录编号为"' + _volunteerServiceIds + '"的数据项?').then(function() {
|
|
|
+// return delVolunteerService(_volunteerServiceIds);
|
|
|
+// }).then(() => {
|
|
|
+// getList();
|
|
|
+// proxy.$modal.msgSuccess("删除成功");
|
|
|
+// }).catch(() => {});
|
|
|
+// }
|
|
|
+
|
|
|
+/** 导出按钮操作 */
|
|
|
+// function handleExport() {
|
|
|
+// proxy.download('core/volunteerService/export', {
|
|
|
+// ...queryParams.value
|
|
|
+// }, `volunteerService_${new Date().getTime()}.xlsx`)
|
|
|
+// }
|
|
|
+
|
|
|
+getList();
|
|
|
+</script>
|