|
|
@@ -16,11 +16,11 @@
|
|
|
<span>组织分类 :</span>
|
|
|
<el-select
|
|
|
clearable
|
|
|
- v-model="searchInput.name"
|
|
|
+ v-model="searchInput.categoryId"
|
|
|
placeholder="请选择组织分类"
|
|
|
>
|
|
|
<el-option
|
|
|
- v-for="i in collegeData"
|
|
|
+ v-for="i in categoryData"
|
|
|
:key="i.id"
|
|
|
:label="i.name"
|
|
|
:value="i.id"
|
|
|
@@ -31,7 +31,7 @@
|
|
|
<span>联系人 :</span>
|
|
|
<el-input
|
|
|
clearable
|
|
|
- v-model.trim="searchInput.name"
|
|
|
+ v-model.trim="searchInput.contractPerson"
|
|
|
class="w-50 m-2"
|
|
|
placeholder="请输入联系人"
|
|
|
style="width: 180px"
|
|
|
@@ -74,33 +74,44 @@
|
|
|
>
|
|
|
<!-- <el-table-column type="selection" align="center" width="55" /> -->
|
|
|
<el-table-column type="index" align="center" label="序号" width="60" />
|
|
|
- <el-table-column align="center" prop="school" label="组织名称" />
|
|
|
- <el-table-column width="100" align="center" label="组织分类">
|
|
|
+ <el-table-column align="center" prop="name" label="组织名称" />
|
|
|
+ <el-table-column
|
|
|
+ width="100"
|
|
|
+ align="center"
|
|
|
+ prop="categoryName"
|
|
|
+ label="组织分类"
|
|
|
+ >
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column align="center" prop="dormitory" label="组织城市">
|
|
|
<template #default="{ row }">
|
|
|
- <span v-if="row.retentionState == 2">是</span>
|
|
|
- <span v-if="row.retentionState == 1">否</span>
|
|
|
+ {{ row.province }}-{{ row.city }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
show-overflow-tooltip
|
|
|
align="center"
|
|
|
- prop="dormitory"
|
|
|
- label="组织城市"
|
|
|
- />
|
|
|
- <el-table-column
|
|
|
- show-overflow-tooltip
|
|
|
- align="center"
|
|
|
- prop="dormitory"
|
|
|
+ prop="description"
|
|
|
label="组织介绍"
|
|
|
/>
|
|
|
- <el-table-column align="center" prop="sex" label="分会标识" />
|
|
|
- <el-table-column align="center" prop="college" label="成员人数" />
|
|
|
- <el-table-column align="center" prop="major" label="联系人" />
|
|
|
- <el-table-column align="center" prop="major" label="联系方式" />
|
|
|
- <el-table-column align="center" prop="major" label="创建时间" />
|
|
|
+ <el-table-column align="center" label="分会标识">
|
|
|
+ <template #default="{ row }">
|
|
|
+ <img
|
|
|
+ v-viewer
|
|
|
+ v-if="row.branchIde"
|
|
|
+ :src="row.branchIde"
|
|
|
+ alt="图片预览"
|
|
|
+ class="preview-img"
|
|
|
+ style="width: 60px; height: 60px; margin: 10px 0"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column align="center" prop="clubNum" label="成员人数" />
|
|
|
+ <el-table-column align="center" prop="contractPerson" label="联系人" />
|
|
|
+ <el-table-column align="center" prop="contractInfo" label="联系方式" />
|
|
|
+ <el-table-column align="center" prop="createTime" label="创建时间" />
|
|
|
<el-table-column align="center" label="操作" fixed="right" width="200">
|
|
|
<template #default="{ row }">
|
|
|
- <el-button type="primary" @click="updateS(row)" link
|
|
|
+ <el-button type="primary" @click="clubTopupClick(row)" link
|
|
|
>置顶</el-button
|
|
|
>
|
|
|
<el-button type="primary" @click="updateS(row)" link
|
|
|
@@ -149,92 +160,114 @@
|
|
|
label-position="right"
|
|
|
status-icon
|
|
|
>
|
|
|
- <el-form-item label="组织名称 :" prop="dormitory">
|
|
|
+ <el-form-item label="组织名称 :" prop="name">
|
|
|
<el-input
|
|
|
clearable
|
|
|
- v-model.trim="ruleForm.dormitory"
|
|
|
+ v-model.trim="ruleForm.name"
|
|
|
class="w-50 m-2"
|
|
|
placeholder="请输入组织名称"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="组织分类 :" prop="school">
|
|
|
+ <el-form-item label="组织分类 :" prop="categoryId">
|
|
|
<el-select
|
|
|
- @change="schoolFormChange"
|
|
|
- v-model="ruleForm.school"
|
|
|
+ v-model="ruleForm.categoryId"
|
|
|
clearable
|
|
|
placeholder="请选择组织分类"
|
|
|
>
|
|
|
<el-option
|
|
|
- v-for="i in schoolData"
|
|
|
+ v-for="i in categoryData"
|
|
|
:key="i.id"
|
|
|
- :label="i.school"
|
|
|
- :value="`${i.school},${i.id}`"
|
|
|
+ :label="i.name"
|
|
|
+ :value="`${i.id}-${i.name}`"
|
|
|
/>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="组织城市 :" prop="bedNumber">
|
|
|
- <el-cascader v-model="ruleForm.bedNumber" :options="options" />
|
|
|
+ <el-form-item label="组织城市 :" prop="cityId">
|
|
|
+ <div>
|
|
|
+ <el-select
|
|
|
+ v-model="ruleForm.provinceId"
|
|
|
+ placeholder="请选择省"
|
|
|
+ style="width: 140px"
|
|
|
+ @change="provincesChange"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in provinceList"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.name"
|
|
|
+ :value="`${item.id}-${item.name}`"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ <span> - </span>
|
|
|
+ <el-select
|
|
|
+ v-model="ruleForm.cityId"
|
|
|
+ placeholder="请选择市"
|
|
|
+ style="width: 140px"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in cityList"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.name"
|
|
|
+ :value="`${item.id}-${item.name}`"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="组织介绍 :" prop="bedNumber">
|
|
|
+ <el-form-item label="组织介绍 :" prop="description">
|
|
|
<el-input
|
|
|
- v-model.trim="ruleForm.bedNumber"
|
|
|
+ v-model.trim="ruleForm.description"
|
|
|
placeholder="请输入组织介绍"
|
|
|
clearable
|
|
|
:autosize="{ minRows: 4 }"
|
|
|
type="textarea"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="联系人 :" prop="dormitory">
|
|
|
+ <el-form-item label="联系人 :" prop="contractPerson">
|
|
|
<el-input
|
|
|
clearable
|
|
|
- v-model.trim="ruleForm.dormitory"
|
|
|
+ v-model.trim="ruleForm.contractPerson"
|
|
|
class="w-50 m-2"
|
|
|
placeholder="请输入联系人"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="手机号码 :" prop="dormitory">
|
|
|
+ <el-form-item label="手机号码 :" prop="contractInfo">
|
|
|
<el-input
|
|
|
clearable
|
|
|
- v-model.trim="ruleForm.dormitory"
|
|
|
+ v-model.trim="ruleForm.contractInfo"
|
|
|
class="w-50 m-2"
|
|
|
placeholder="请输入手机号码"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="分会标识 :" prop="dormitory">
|
|
|
- <el-upload
|
|
|
- action="#"
|
|
|
- list-type="picture-card"
|
|
|
- :auto-upload="false"
|
|
|
- :file-list="fileList"
|
|
|
- :on-change="handleFileChange"
|
|
|
- :before-upload="handleBeforeUpload"
|
|
|
- >
|
|
|
- <el-icon><Plus /></el-icon>
|
|
|
-
|
|
|
- <template #file="{ file }">
|
|
|
- <div>
|
|
|
- <img
|
|
|
- class="el-upload-list__item-thumbnail"
|
|
|
- :src="file.url"
|
|
|
- alt=""
|
|
|
- />
|
|
|
- <span class="el-upload-list__item-actions">
|
|
|
- <span
|
|
|
- class="el-upload-list__item-preview"
|
|
|
- @click="handlePictureCardPreview(file)"
|
|
|
- >
|
|
|
- <el-icon><ZoomIn /></el-icon>
|
|
|
- </span>
|
|
|
- <span
|
|
|
- class="el-upload-list__item-delete"
|
|
|
- @click="handleRemove(file)"
|
|
|
- >
|
|
|
- <el-icon><Delete /></el-icon>
|
|
|
- </span>
|
|
|
- </span>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </el-upload>
|
|
|
+ <el-form-item label="分会标识 :" prop="branchIde">
|
|
|
+ <div class="img-preview-list">
|
|
|
+ <div class="img-item" v-if="ruleForm.branchIde">
|
|
|
+ <img
|
|
|
+ :src="ruleForm.branchIde"
|
|
|
+ alt="图片预览"
|
|
|
+ class="preview-img"
|
|
|
+ v-viewer
|
|
|
+ />
|
|
|
+ <span class="delete-btn" @click="handleDelete">
|
|
|
+ <el-icon><Delete /></el-icon>
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ <el-upload
|
|
|
+ action="#"
|
|
|
+ :auto-upload="false"
|
|
|
+ :on-change="handleFileChange"
|
|
|
+ :before-upload="beforeUpload"
|
|
|
+ class="upload-btn"
|
|
|
+ accept="image/*"
|
|
|
+ >
|
|
|
+ <el-icon><Plus /></el-icon>
|
|
|
+ <span class="upload-txt">点击上传图片</span>
|
|
|
+ </el-upload>
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="置顶 :" prop="isTop">
|
|
|
+ <el-radio-group v-model="ruleForm.isTop">
|
|
|
+ <el-radio :value="1">是</el-radio>
|
|
|
+ <el-radio :value="2">否</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
</el-form-item>
|
|
|
<el-form-item class="options">
|
|
|
<el-button @click="cancelAdd">取消</el-button>
|
|
|
@@ -317,37 +350,72 @@ import { storeToRefs } from "pinia";
|
|
|
import { useCounterStore } from "@/stores/index";
|
|
|
import { api as viewerApi } from "v-viewer";
|
|
|
|
|
|
+import {
|
|
|
+ getQueryClubPage,
|
|
|
+ getQueryOrgTree,
|
|
|
+ getAlumniClubExcel,
|
|
|
+ getQueryCategoryDatas,
|
|
|
+ insertClubData,
|
|
|
+ updateClubData,
|
|
|
+ deleteClubById,
|
|
|
+ clubTopup,
|
|
|
+ getProvinceLevel,
|
|
|
+ getCityLevel,
|
|
|
+} from "@/api/alumni-organization.js";
|
|
|
+import { uploadFile } from "@/api/uploadFile";
|
|
|
+
|
|
|
const router = useRouter();
|
|
|
const store = useCounterStore();
|
|
|
|
|
|
// 为避免解构时失去响应性
|
|
|
const { name, age, isCollapse, realAge, collegeRole } = storeToRefs(store);
|
|
|
|
|
|
-// 维护当前的文件列表
|
|
|
-const fileList = ref([]);
|
|
|
+const handleDelete = () => {
|
|
|
+ ruleForm.branchIde = "";
|
|
|
+};
|
|
|
|
|
|
-// 核心:文件变化时直接覆盖
|
|
|
-const handleFileChange = (newFile) => {
|
|
|
- // 直接用新文件替换整个列表,实现覆盖
|
|
|
- fileList.value = [newFile];
|
|
|
+const handlePreview = (images) => {
|
|
|
+ // 传给预览器,此时插件显示的第一张就是点击的图片
|
|
|
+ viewerApi({
|
|
|
+ images: images,
|
|
|
+ zIndex: 3000,
|
|
|
+ });
|
|
|
};
|
|
|
|
|
|
-// 上传前检查:如果已有文件,给出提示
|
|
|
-const handleBeforeUpload = () => {
|
|
|
- if (fileList.value.length > 0) {
|
|
|
- ElMessage.info("新图片将覆盖原有图片");
|
|
|
+// 上传前的校验
|
|
|
+const beforeUpload = (file) => {
|
|
|
+ // 校验文件类型
|
|
|
+ const isImage = file.type.startsWith("image/");
|
|
|
+ if (!isImage) {
|
|
|
+ ElMessage.error("只能上传图片格式文件");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ // 校验文件大小(2MB)
|
|
|
+ const isLt2M = file.size / 1024 / 1024 < 2;
|
|
|
+ if (!isLt2M) {
|
|
|
+ ElMessage.error("图片大小不能超过2MB");
|
|
|
+ return false;
|
|
|
}
|
|
|
return true;
|
|
|
};
|
|
|
|
|
|
-const handleRemove = () => {
|
|
|
- fileList.value = [];
|
|
|
- console.log("删除图片");
|
|
|
-};
|
|
|
-
|
|
|
-// 图片预览
|
|
|
-const handlePictureCardPreview = (file) => {
|
|
|
- viewerApi({ images: fileList.value,zIndex: 2020 });
|
|
|
+// 文件选择变化时触发
|
|
|
+const handleFileChange = async (file, newFileList) => {
|
|
|
+ console.log(file);
|
|
|
+ let formData = new FormData();
|
|
|
+ formData.append("file", file.raw);
|
|
|
+ let res = await uploadFile(formData);
|
|
|
+ // console.log(res.data.fileUrl);
|
|
|
+ if (res.code == 200) {
|
|
|
+ ruleForm.branchIde = res.data.fileUrl; // 赋值给响应式fileList,页面自动刷新
|
|
|
+ } else {
|
|
|
+ ElMessage({
|
|
|
+ type: "error",
|
|
|
+ showClose: true,
|
|
|
+ message: res.message,
|
|
|
+ center: true,
|
|
|
+ });
|
|
|
+ }
|
|
|
};
|
|
|
|
|
|
// 表格数据
|
|
|
@@ -360,10 +428,8 @@ const dialongTitle = ref("新增账号"); // 弹窗标题
|
|
|
|
|
|
const searchInput = reactive({
|
|
|
name: "",
|
|
|
- year: null,
|
|
|
- college: null,
|
|
|
- major: null,
|
|
|
- class: null,
|
|
|
+ categoryId: null,
|
|
|
+ contractPerson: null,
|
|
|
}); // 搜索按钮数据
|
|
|
|
|
|
const currentPage = ref(1); // 当前页
|
|
|
@@ -371,76 +437,45 @@ const pageSize = ref(10);
|
|
|
const total = ref(0); // 当前总数
|
|
|
const selectIds = ref([]); // 勾选的全部数据
|
|
|
|
|
|
+const categoryData = ref();
|
|
|
+const provinceList = ref([]);
|
|
|
+const cityList = ref([]);
|
|
|
+
|
|
|
const addDialogVisible = ref(false); // 控制添加账号弹窗
|
|
|
-const options = ref([
|
|
|
- {
|
|
|
- value: "guide",
|
|
|
- label: "Guide",
|
|
|
- children: [
|
|
|
- {
|
|
|
- value: "disciplines",
|
|
|
- label: "Disciplines",
|
|
|
- children: [
|
|
|
- {
|
|
|
- value: "consistency",
|
|
|
- label: "Consistency",
|
|
|
- },
|
|
|
- {
|
|
|
- value: "feedback",
|
|
|
- label: "Feedback",
|
|
|
- },
|
|
|
- {
|
|
|
- value: "efficiency",
|
|
|
- label: "Efficiency",
|
|
|
- },
|
|
|
- {
|
|
|
- value: "controllability",
|
|
|
- label: "Controllability",
|
|
|
- },
|
|
|
- ],
|
|
|
- },
|
|
|
- {
|
|
|
- value: "navigation",
|
|
|
- label: "Navigation",
|
|
|
- children: [
|
|
|
- {
|
|
|
- value: "side nav",
|
|
|
- label: "Side Navigation",
|
|
|
- },
|
|
|
- {
|
|
|
- value: "top nav",
|
|
|
- label: "Top Navigation",
|
|
|
- },
|
|
|
- ],
|
|
|
- },
|
|
|
- ],
|
|
|
- },
|
|
|
-]);
|
|
|
|
|
|
// 表单数据
|
|
|
const formSize = ref("default");
|
|
|
const ruleFormRef = ref();
|
|
|
const ruleForm = reactive({
|
|
|
- school: "靖安校区", //校区名称
|
|
|
- build: "", //楼栋名称
|
|
|
- dormitory: "", //寝室号
|
|
|
- sex: "男", //寝室性别
|
|
|
- college: "", //所属学院
|
|
|
- major: "", //所属专业
|
|
|
- bedNumber: "", //床位数
|
|
|
- // "gradestr": "", //所属年级
|
|
|
- remark: "", //备注
|
|
|
+ name: "",
|
|
|
+ categoryId: "",
|
|
|
+ provinceId: "",
|
|
|
+ cityId: "",
|
|
|
+ description: "",
|
|
|
+ contractPerson: "",
|
|
|
+ contractInfo: "",
|
|
|
+ branchIde: "",
|
|
|
+ isTop: 2, // 是:1 否:2
|
|
|
id: "",
|
|
|
});
|
|
|
// 表单验证
|
|
|
const rules = reactive({
|
|
|
- school: [{ required: true, message: "校区名称不能为空", trigger: "blur" }],
|
|
|
- build: [{ required: true, message: "楼栋名称不能为空", trigger: "blur" }],
|
|
|
- dormitory: [{ required: true, message: "寝室号不能为空", trigger: "blur" }],
|
|
|
- sex: [{ required: true, message: "寝室性别不能为空", trigger: "blur" }],
|
|
|
- college: [{ required: true, message: "所属学院不能为空", trigger: "blur" }],
|
|
|
- major: [{ required: true, message: "专业不能为空", trigger: "blur" }],
|
|
|
- bedNumber: [{ required: true, message: "床位数不能为空", trigger: "blur" }],
|
|
|
+ name: [{ required: true, message: "组织名称不能为空", trigger: "blur" }],
|
|
|
+ categoryId: [
|
|
|
+ { required: true, message: "所属分类不能为空", trigger: "blur" },
|
|
|
+ ],
|
|
|
+ provinceId: [{ required: true, message: "省名称不能为空", trigger: "blur" }],
|
|
|
+ cityId: [{ required: true, message: "市名称不能为空", trigger: "blur" }],
|
|
|
+ description: [
|
|
|
+ { required: true, message: "组织介绍不能为空", trigger: "blur" },
|
|
|
+ ],
|
|
|
+ contractPerson: [
|
|
|
+ { required: true, message: "联系人不能为空", trigger: "blur" },
|
|
|
+ ],
|
|
|
+ contractInfo: [
|
|
|
+ { required: true, message: "联系方式不能为空", trigger: "blur" },
|
|
|
+ ],
|
|
|
+ branchIde: [{ required: true, message: "分会标识不能为空", trigger: "blur" }],
|
|
|
});
|
|
|
|
|
|
// 获取账户列表
|
|
|
@@ -449,29 +484,35 @@ const getList = async () => {
|
|
|
let params = {
|
|
|
currentPage: currentPage.value, // 当前页
|
|
|
pageCount: pageSize.value, // 一页数据条数
|
|
|
- schoolId: searchInput.schoolId,
|
|
|
- buildId: searchInput.buildId,
|
|
|
+ categoryId: searchInput.categoryId,
|
|
|
+ name: searchInput.name,
|
|
|
+ contractPerson: searchInput.contractPerson,
|
|
|
};
|
|
|
+ getQueryClubPage(params).then((res) => {
|
|
|
+ console.log(res, "校友组织分页数据");
|
|
|
+ if (res.code == 200) {
|
|
|
+ tableData.list = res.data.list;
|
|
|
+ total.value = res.data.totalCount;
|
|
|
+ loading.value = false;
|
|
|
+ } else {
|
|
|
+ loading.value = false;
|
|
|
+ }
|
|
|
+ });
|
|
|
};
|
|
|
|
|
|
// 搜索功能
|
|
|
-const searchBtn = lodash.debounce(async () => {}, 300);
|
|
|
-const resetBtn = lodash.debounce(async () => {}, 300);
|
|
|
+const searchBtn = lodash.debounce(async () => {
|
|
|
+ currentPage.value = 1;
|
|
|
+ getList();
|
|
|
+}, 300);
|
|
|
+const resetBtn = lodash.debounce(async () => {
|
|
|
+ searchInput.categoryId = "";
|
|
|
+ searchInput.name = "";
|
|
|
+ searchInput.contractPerson = null;
|
|
|
+ currentPage.value = 1;
|
|
|
+ getList();
|
|
|
+}, 300);
|
|
|
|
|
|
-const top = () => {};
|
|
|
-
|
|
|
-// 添加账号
|
|
|
-const addlist = () => {
|
|
|
- dialongTitle.value = "创建组织";
|
|
|
- addDialogVisible.value = true;
|
|
|
- ruleForm.school = null;
|
|
|
-};
|
|
|
-// 添加账号
|
|
|
-const updateS = (row) => {
|
|
|
- console.log(row);
|
|
|
- dialongTitle.value = "编辑组织";
|
|
|
- addDialogVisible.value = true;
|
|
|
-};
|
|
|
const deleteS = async (row) => {
|
|
|
ElMessageBox.confirm("是否删除此数据?", "提示!!!", {
|
|
|
confirmButtonText: "确认",
|
|
|
@@ -479,21 +520,84 @@ const deleteS = async (row) => {
|
|
|
type: "warning",
|
|
|
})
|
|
|
.then(async () => {
|
|
|
- loading.value = true;
|
|
|
- let data = {
|
|
|
- dormitoryId: row.id, // 当前页
|
|
|
+ let params = {
|
|
|
+ id: row.id,
|
|
|
};
|
|
|
+ let res = await deleteClubById(params);
|
|
|
+ if (res.code == 200) {
|
|
|
+ getList();
|
|
|
+ ElMessage({
|
|
|
+ type: "success",
|
|
|
+ showClose: true,
|
|
|
+ message: res.message,
|
|
|
+ center: true,
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ ElMessage({
|
|
|
+ type: "error",
|
|
|
+ showClose: true,
|
|
|
+ message: res.message,
|
|
|
+ center: true,
|
|
|
+ });
|
|
|
+ }
|
|
|
})
|
|
|
.catch(() => {
|
|
|
loading.value = false;
|
|
|
});
|
|
|
};
|
|
|
-// 保留
|
|
|
-const retainS = async (row, flag) => {
|
|
|
- let data = {
|
|
|
- dormitoryIds: [row.id], // 当前页
|
|
|
- retentionState: flag, //保留状态 1:开放,2:保留
|
|
|
+// 添加账号
|
|
|
+const addlist = () => {
|
|
|
+ dialongTitle.value = "创建组织";
|
|
|
+ addDialogVisible.value = true;
|
|
|
+ ruleForm.name = "";
|
|
|
+ ruleForm.categoryId = null;
|
|
|
+ ruleForm.provinceId = null;
|
|
|
+ ruleForm.cityId = null;
|
|
|
+ cityList.value = [];
|
|
|
+ ruleForm.description = null;
|
|
|
+ ruleForm.contractPerson = null;
|
|
|
+ ruleForm.contractInfo = null;
|
|
|
+ ruleForm.branchIde = null;
|
|
|
+ ruleForm.isTop = 2;
|
|
|
+ ruleForm.id = null;
|
|
|
+};
|
|
|
+// 添加账号
|
|
|
+const updateS = async (row) => {
|
|
|
+ console.log(row);
|
|
|
+ dialongTitle.value = "编辑组织";
|
|
|
+ addDialogVisible.value = true;
|
|
|
+ ruleForm.name = row.name;
|
|
|
+ ruleForm.categoryId = `${row.categoryId}-${row.categoryName}`;
|
|
|
+ if (row.provinceId) {
|
|
|
+ ruleForm.provinceId = `${row.provinceId}-${row.province}`;
|
|
|
+ getCityLevel({ provinceId: row.provinceId }).then((res) => {
|
|
|
+ cityList.value = res.data;
|
|
|
+ });
|
|
|
+ ruleForm.cityId = `${row.cityId}-${row.city}`;
|
|
|
+ } else {
|
|
|
+ ruleForm.provinceId = [];
|
|
|
+ ruleForm.cityId = [];
|
|
|
+ }
|
|
|
+ ruleForm.description = row.description;
|
|
|
+ ruleForm.contractPerson = row.contractPerson;
|
|
|
+ ruleForm.contractInfo = row.contractInfo;
|
|
|
+ ruleForm.branchIde = row.branchIde;
|
|
|
+ ruleForm.isTop = row.isTop;
|
|
|
+ ruleForm.id = row.id;
|
|
|
+ let params = {
|
|
|
+ provinceId: row.cityId,
|
|
|
+ };
|
|
|
+ getCityLevel(params).then((res) => {});
|
|
|
+};
|
|
|
+const provincesChange = async (val) => {
|
|
|
+ console.log(val);
|
|
|
+ ruleForm.cityId = null;
|
|
|
+ let params = {
|
|
|
+ provinceId: val.split("-")[0],
|
|
|
};
|
|
|
+ let res = await getCityLevel(params);
|
|
|
+ console.log(res, "市数据");
|
|
|
+ cityList.value = res.data;
|
|
|
};
|
|
|
|
|
|
// 确认添加员工
|
|
|
@@ -501,7 +605,44 @@ const submitAdd = lodash.debounce(async (formEl) => {
|
|
|
if (!formEl) return;
|
|
|
await formEl.validate(async (valid, fields) => {
|
|
|
if (valid) {
|
|
|
- console.log(data);
|
|
|
+ let data = {
|
|
|
+ name: ruleForm.name,
|
|
|
+ categoryId: ruleForm.categoryId.split("-")[0],
|
|
|
+ categoryName: ruleForm.categoryId.split("-")[1],
|
|
|
+ province: ruleForm.provinceId.split("-")[1],
|
|
|
+ provinceId: ruleForm.provinceId.split("-")[0],
|
|
|
+ city: ruleForm.cityId.split("-")[1],
|
|
|
+ cityId: ruleForm.cityId.split("-")[0],
|
|
|
+ description: ruleForm.description,
|
|
|
+ contractPerson: ruleForm.contractPerson,
|
|
|
+ contractInfo: ruleForm.contractInfo,
|
|
|
+ branchIde: ruleForm.branchIde,
|
|
|
+ isTop: ruleForm.isTop,
|
|
|
+ };
|
|
|
+ let res = "";
|
|
|
+ if (dialongTitle.value == "创建组织") {
|
|
|
+ res = await insertClubData(data);
|
|
|
+ } else {
|
|
|
+ data.id = ruleForm.id;
|
|
|
+ res = await updateClubData(data);
|
|
|
+ }
|
|
|
+ if (res.code == 200) {
|
|
|
+ addDialogVisible.value = false;
|
|
|
+ ElMessage({
|
|
|
+ type: "success",
|
|
|
+ showClose: true,
|
|
|
+ message: res.message,
|
|
|
+ center: true,
|
|
|
+ });
|
|
|
+ getList();
|
|
|
+ } else {
|
|
|
+ ElMessage({
|
|
|
+ type: "error",
|
|
|
+ showClose: true,
|
|
|
+ message: res.message,
|
|
|
+ center: true,
|
|
|
+ });
|
|
|
+ }
|
|
|
} else {
|
|
|
console.log("error submit!", fields);
|
|
|
}
|
|
|
@@ -512,6 +653,30 @@ const cancelAdd = () => {
|
|
|
addDialogVisible.value = false;
|
|
|
};
|
|
|
|
|
|
+const clubTopupClick = async (row) => {
|
|
|
+ let params = {
|
|
|
+ id: row.id,
|
|
|
+ isTop: 1,
|
|
|
+ };
|
|
|
+ let res = await clubTopup(params);
|
|
|
+ if (res.code == 200) {
|
|
|
+ getList();
|
|
|
+ ElMessage({
|
|
|
+ type: "success",
|
|
|
+ showClose: true,
|
|
|
+ message: res.message,
|
|
|
+ center: true,
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ ElMessage({
|
|
|
+ type: "error",
|
|
|
+ showClose: true,
|
|
|
+ message: res.message,
|
|
|
+ center: true,
|
|
|
+ });
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
// 多选框功能
|
|
|
const handleSelectionChange = (val) => {
|
|
|
// console.log(val);
|
|
|
@@ -547,7 +712,58 @@ const cancelProjectImport = () => {
|
|
|
}
|
|
|
};
|
|
|
|
|
|
-onBeforeMount(() => {});
|
|
|
+const categoryList = async () => {
|
|
|
+ let res = await getQueryCategoryDatas();
|
|
|
+ // console.log(res, "相册分类下拉列表数据");
|
|
|
+ if (res.code == 200) {
|
|
|
+ categoryData.value = res.data;
|
|
|
+ } else {
|
|
|
+ ElMessage({
|
|
|
+ type: "error",
|
|
|
+ showClose: true,
|
|
|
+ message: res.message,
|
|
|
+ center: true,
|
|
|
+ });
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+const provinceData = async () => {
|
|
|
+ let res = await getProvinceLevel();
|
|
|
+ console.log(res, "省数据");
|
|
|
+ if (res.code == 200) {
|
|
|
+ provinceList.value = res.data;
|
|
|
+ } else {
|
|
|
+ ElMessage({
|
|
|
+ type: "error",
|
|
|
+ showClose: true,
|
|
|
+ message: res.message,
|
|
|
+ center: true,
|
|
|
+ });
|
|
|
+ }
|
|
|
+};
|
|
|
+const cityData = async (provinceId) => {
|
|
|
+ let params = {
|
|
|
+ provinceId,
|
|
|
+ };
|
|
|
+ let res = await getCity(params);
|
|
|
+ console.log(res, "市数据");
|
|
|
+ if (res.code == 200) {
|
|
|
+ return res.data;
|
|
|
+ } else {
|
|
|
+ ElMessage({
|
|
|
+ type: "error",
|
|
|
+ showClose: true,
|
|
|
+ message: res.message,
|
|
|
+ center: true,
|
|
|
+ });
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+onBeforeMount(() => {
|
|
|
+ getList();
|
|
|
+ categoryList();
|
|
|
+ provinceData();
|
|
|
+});
|
|
|
onUnmounted(() => {
|
|
|
// document.removeEventListener("keyup", Enters);
|
|
|
});
|