|
|
|
|
@ -0,0 +1,547 @@
|
|
|
|
|
<template>
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
<div style="padding: 10px 0;display: flex">
|
|
|
|
|
<el-button type="primary" style="margin-left: 0.5%;margin-top: 0px;" @click="addServiceArea">
|
|
|
|
|
<el-icon>
|
|
|
|
|
<plus />
|
|
|
|
|
</el-icon>
|
|
|
|
|
<span style="vertical-align: middle;"> 新增 </span>
|
|
|
|
|
</el-button>
|
|
|
|
|
|
|
|
|
|
<el-button type="primary" style="margin-top: 0px;" @click="updateServiceArea">
|
|
|
|
|
<el-icon>
|
|
|
|
|
<Edit />
|
|
|
|
|
</el-icon>
|
|
|
|
|
<span style="vertical-align: middle;"> 修改 </span>
|
|
|
|
|
</el-button>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-button type="primary" style="margin-left: 0.5%;margin-top: 0px;" @click="searchShow = true">
|
|
|
|
|
<el-icon style="vertical-align: middle;">
|
|
|
|
|
<search />
|
|
|
|
|
</el-icon>
|
|
|
|
|
<span style="vertical-align: middle;"> 查找 </span>
|
|
|
|
|
</el-button>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-upload
|
|
|
|
|
:limit="1"
|
|
|
|
|
:on-exceed="handleExceed"
|
|
|
|
|
:show-file-list="false"
|
|
|
|
|
:on-success="successFile"
|
|
|
|
|
:on-change="changeFile"
|
|
|
|
|
:on-error="errorFile"
|
|
|
|
|
style="margin-left: 0.5%;margin-top: 0px;"
|
|
|
|
|
ref="upload"
|
|
|
|
|
class="upload-demo"
|
|
|
|
|
action="http://localhost:9440/PetrolCafeteriaFee/User/uploadFileImportMMUser"
|
|
|
|
|
:auto-upload="true"
|
|
|
|
|
:headers="headers">
|
|
|
|
|
<template #trigger>
|
|
|
|
|
<el-button type="success">导入Excel文件</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
<!-- <el-button class="ml-3" type="success" @click="submitUpload">
|
|
|
|
|
选择导入的Excel文件
|
|
|
|
|
</el-button> -->
|
|
|
|
|
</el-upload>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-button text type="danger" style="margin-top: 0px;margin-left: auto;color: white;" @click="del">
|
|
|
|
|
<el-icon>
|
|
|
|
|
<delete />
|
|
|
|
|
</el-icon>
|
|
|
|
|
<span style="vertical-align: middle;"> 删除 </span>
|
|
|
|
|
</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<el-table :height=myHeight highlight-current-row="true" v-loading.fullscreen.lock="tableLoading"
|
|
|
|
|
:data="tableData" border style="width: 100%;" @current-change="tableHandleCurrentChange"
|
|
|
|
|
@selection-change="handleSelectionChange">
|
|
|
|
|
<el-table-column :resizable="false" fixed type="selection" width="50" align="center"></el-table-column>
|
|
|
|
|
<el-table-column :resizable="false" fixed align="center" type="index" width="80" label="序号" />
|
|
|
|
|
<el-table-column :resizable="false" align="center" prop="realName" width="120" label="真实姓名" />
|
|
|
|
|
<el-table-column :resizable="false" align="center" prop="idNumber" width="180" label="身份证号" />
|
|
|
|
|
<el-table-column :resizable="false" align="center" prop="phone" width="140" label="手机号" />
|
|
|
|
|
<el-table-column show-overflow-tooltip :resizable="false" align="center" width="120"
|
|
|
|
|
prop="operationUserName" label="录入人" />
|
|
|
|
|
|
|
|
|
|
<el-table-column show-overflow-tooltip :resizable="false" align="center" width="180"
|
|
|
|
|
prop="operationTime" label="录入时间" />
|
|
|
|
|
<el-table-column :resizable="false" align="center" prop="numberPic" label="身份证正面照">
|
|
|
|
|
<template #default="scope" style="padding-left: 0px; padding-right: 0px;">
|
|
|
|
|
<el-image style="width: 240px; height: 120px"
|
|
|
|
|
:src="(null != scope.row.numberPicName ? picUrl + scope.row.numberPicName + '?v=' + random : '')"
|
|
|
|
|
:preview-src-list="[picUrl + scope.row.numberPicName + '?v=' + random]"
|
|
|
|
|
preview-teleported="true" />
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
|
|
|
|
</el-table>
|
|
|
|
|
|
|
|
|
|
<el-config-provider :locale="locale">
|
|
|
|
|
<el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange"
|
|
|
|
|
:current-page="searchForm.pageNum" :page-sizes="[20, 30, 50]" :page-size="searchForm.pageSize"
|
|
|
|
|
layout="total, sizes, prev, pager, next, jumper" :total="searchForm.total">
|
|
|
|
|
</el-pagination>
|
|
|
|
|
</el-config-provider>
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :destroy-on-close="true"
|
|
|
|
|
title="蒙马用户信息录入" v-model="addMealShow" width="40%" top="0.5%" :modal="false">
|
|
|
|
|
|
|
|
|
|
<template #header="{ titleId, titleClass, warnMessgae }">
|
|
|
|
|
<div class="my-header">
|
|
|
|
|
<span :id="titleId" :class="titleClass">蒙马用户信息录入</span>
|
|
|
|
|
<span :id="warnMessgae" :class="titleClass" style="color: red;">
|
|
|
|
|
身份证号涉及与小程序账号同步,新增保存后不允许修改 </span>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<mmUserAddUpdate ref="mmUserAddUpdateDom" :rowData="addForm">
|
|
|
|
|
</mmUserAddUpdate>
|
|
|
|
|
|
|
|
|
|
<template #footer>
|
|
|
|
|
<span class="dialog-footer">
|
|
|
|
|
<el-button @click="addMealShow = false"> 取消</el-button>
|
|
|
|
|
<el-button type="primary" @click="saveData()">
|
|
|
|
|
<span style="vertical-align: middle;"> 保存 </span>
|
|
|
|
|
</el-button>
|
|
|
|
|
</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-dialog title="蒙马用户信息查找" v-model="searchShow" width="35%" top="0.5%" draggable :modal="false">
|
|
|
|
|
<el-form :model="searchForm" size="medium" ref="searchFormElement">
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="19" :offset="1">
|
|
|
|
|
<el-form-item label="用户真实姓名" :label-width="formLabelWidth">
|
|
|
|
|
<el-input placeholder="请输入" v-model="searchForm.realNameQuery" autocomplete="off"
|
|
|
|
|
clearable></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
|
|
<el-col :span="19" :offset="1">
|
|
|
|
|
<el-form-item label="身份证号" :label-width="formLabelWidth">
|
|
|
|
|
<el-input placeholder="请输入" v-model="searchForm.idNumberQuery" autocomplete="off"
|
|
|
|
|
clearable></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
|
|
<el-col :span="19" :offset="1">
|
|
|
|
|
<el-form-item label="录入时间(起始)" :label-width="formLabelWidth">
|
|
|
|
|
<el-date-picker v-model="searchForm.operationStartTime" type="date" format="YYYY-MM-DD"
|
|
|
|
|
value-format="YYYY-MM-DD 00:00:00" style="width: 100%;" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-col :span="19" :offset="1">
|
|
|
|
|
<el-form-item label="录入时间(终止)" :label-width="formLabelWidth">
|
|
|
|
|
<el-date-picker v-model="searchForm.operationEndTime" type="date" format="YYYY-MM-DD"
|
|
|
|
|
value-format="YYYY-MM-DD 23:59:59" style="width: 100%;" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
|
|
</el-row>
|
|
|
|
|
</el-form>
|
|
|
|
|
|
|
|
|
|
<template #footer>
|
|
|
|
|
<span class="dialog-footer">
|
|
|
|
|
<el-button @click="searchShow = false">取消</el-button>
|
|
|
|
|
|
|
|
|
|
<el-button type="primary" @click="resetSearchData">
|
|
|
|
|
<el-icon>
|
|
|
|
|
<Refresh />
|
|
|
|
|
</el-icon>
|
|
|
|
|
<span style="vertical-align: middle;"> 重置 </span>
|
|
|
|
|
</el-button>
|
|
|
|
|
|
|
|
|
|
<el-button type="primary" @click="searchData">
|
|
|
|
|
<el-icon style="vertical-align: middle;">
|
|
|
|
|
<search />
|
|
|
|
|
</el-icon>
|
|
|
|
|
<span style="vertical-align: middle;"> 搜索 </span>
|
|
|
|
|
</el-button>
|
|
|
|
|
</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
|
|
import { Upload } from '@element-plus/icons-vue';
|
|
|
|
|
import pro from '../../../util/tool.js';
|
|
|
|
|
import { onMounted, reactive, ref, toRefs, warn } from 'vue';
|
|
|
|
|
|
|
|
|
|
import { getMMUserInfo, deleteMMUser, saveMMUserInfo, getMealFiterDataList } from '@/util/api/api.js';
|
|
|
|
|
|
|
|
|
|
import { ElMessage, ElMessageBox, ElNotification } from "element-plus";
|
|
|
|
|
|
|
|
|
|
import mmUserAddUpdate from './mmUserAddUpdate.vue';
|
|
|
|
|
|
|
|
|
|
//定义新增form组件dom
|
|
|
|
|
const addFormElement = ref(null);
|
|
|
|
|
|
|
|
|
|
//表格加载状态
|
|
|
|
|
const tableLoading = ref(true);
|
|
|
|
|
|
|
|
|
|
//新增输入框 label宽度
|
|
|
|
|
const formLabelWidth = ref('130px');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//表格固定高度
|
|
|
|
|
const myHeight = ref(500);
|
|
|
|
|
|
|
|
|
|
//表格查询条件
|
|
|
|
|
const searchForm = reactive({
|
|
|
|
|
total: 0,
|
|
|
|
|
pageNum: 1,
|
|
|
|
|
pageSize: 20,
|
|
|
|
|
startTime: '', //统计数据,默认查询当天的数据
|
|
|
|
|
endTime: '', //统计数据,默认查询当天的数据
|
|
|
|
|
realNameQuery: "",
|
|
|
|
|
idNumberQuery: "",
|
|
|
|
|
operationStartTime: null,
|
|
|
|
|
operationEndTime: null,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
//定义新增修改数组名称
|
|
|
|
|
const addForm = ref({
|
|
|
|
|
serivceAreaName: ""
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//定义表格数据
|
|
|
|
|
const tableData = ref([]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//添加弹窗是否展示 false不展示 true展示
|
|
|
|
|
const addMealShow = ref(false);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//选择的数据
|
|
|
|
|
const currentRow = ref(null);
|
|
|
|
|
|
|
|
|
|
//多选数据
|
|
|
|
|
const multipleSelection = ref(null);
|
|
|
|
|
|
|
|
|
|
const mmUserAddUpdateDom = ref(null);
|
|
|
|
|
|
|
|
|
|
const searchShow = ref(false);
|
|
|
|
|
|
|
|
|
|
//定义搜索商户名称下拉
|
|
|
|
|
const operationList = ref([]);
|
|
|
|
|
|
|
|
|
|
//定义搜索服务区服下拉
|
|
|
|
|
const serviceAreaList = ref([]);
|
|
|
|
|
|
|
|
|
|
//定义图片访问路径
|
|
|
|
|
const picUrl = ref(localStorage.getItem('picUrl'));
|
|
|
|
|
|
|
|
|
|
const random = ref(Math.random());
|
|
|
|
|
|
|
|
|
|
const headers = ref({ loginId: localStorage.getItem('loginName') })
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
|
|
|
|
|
tableLoading.value = true;
|
|
|
|
|
//获取服务区数据
|
|
|
|
|
getTableData();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
function getTableData() {
|
|
|
|
|
getMMUserInfo(searchForm).then(res => {
|
|
|
|
|
if (res.records != null) {
|
|
|
|
|
//getOtherData();
|
|
|
|
|
tableData.value = res.records;
|
|
|
|
|
searchForm.total = res.total;
|
|
|
|
|
searchForm.pageNum = res.current;
|
|
|
|
|
searchForm.pageSize = res.size;
|
|
|
|
|
} else {
|
|
|
|
|
ElMessage.error('查询失败!')
|
|
|
|
|
}
|
|
|
|
|
tableLoading.value = false;
|
|
|
|
|
|
|
|
|
|
//计算表格固定高度
|
|
|
|
|
myHeight.value = (document.documentElement.clientHeight) * 0.77;
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
function getOtherData() {
|
|
|
|
|
getMealFiterDataList({ type: "search" }).then(res => {
|
|
|
|
|
if (res.operationList != null) {
|
|
|
|
|
operationList.value = res.operationList;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (res.serviceAreaList != null) {
|
|
|
|
|
serviceAreaList.value = res.serviceAreaList;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
tableLoading.value = false;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function reloadTableData() {
|
|
|
|
|
random.value = Math.random();
|
|
|
|
|
tableLoading.value = true;
|
|
|
|
|
getMMUserInfo(searchForm).then(res => {
|
|
|
|
|
if (res.records != null) {
|
|
|
|
|
tableData.value = res.records;
|
|
|
|
|
searchForm.total = res.total;
|
|
|
|
|
searchForm.pageNum = res.current;
|
|
|
|
|
searchForm.pageSize = res.size;
|
|
|
|
|
} else {
|
|
|
|
|
ElMessage.error('查询失败!')
|
|
|
|
|
}
|
|
|
|
|
tableLoading.value = false;
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//点击搜索,查询数据
|
|
|
|
|
function searchData() {
|
|
|
|
|
|
|
|
|
|
if (searchForm.jobnumberQury != null && typeof (searchForm.jobnumberQury) == 'string') {
|
|
|
|
|
searchForm.jobnumberQury = null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (searchForm.serviceIdQuery != null && typeof (searchForm.serviceIdQuery) == 'string') {
|
|
|
|
|
searchForm.serviceIdQuery = null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
searchForm.pageSize = 20;
|
|
|
|
|
searchForm.pageNum = 1;
|
|
|
|
|
searchForm.total = 0;
|
|
|
|
|
//调用查询数据接口
|
|
|
|
|
reloadTableData();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//搜索条件重置
|
|
|
|
|
function resetSearchData() {
|
|
|
|
|
//搜索条件 重置
|
|
|
|
|
searchForm.realNameQuery = "";
|
|
|
|
|
//如果是从统计页面打开的,当前日期清空
|
|
|
|
|
// searchForm.startTime = pro.dateFormatDay(new Date().setDate((new Date().getDate() - 7))) + " 00:00:00" //统计数据,默认查询当天的数据
|
|
|
|
|
// searchForm.endTime = pro.dateFormatDay(new Date()) + " 23:59:59"; //统计数据,默认查询当天的数据4
|
|
|
|
|
searchForm.startTime = ''; //统计数据,默认查询当天的数据
|
|
|
|
|
searchForm.endTime = ''; //统计数据,默认查询当天的数据4
|
|
|
|
|
searchForm.operationStartTime = null
|
|
|
|
|
searchForm.operationEndTime = null
|
|
|
|
|
searchForm.pageSize = 20;
|
|
|
|
|
searchForm.pageNum = 1;
|
|
|
|
|
searchForm.total = 0;
|
|
|
|
|
//调用查询数据接口
|
|
|
|
|
reloadTableData();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//新增按钮点击事件
|
|
|
|
|
function addServiceArea() {
|
|
|
|
|
//新增把addUpdateForm赋值为空,不然还展示修改的数据
|
|
|
|
|
addForm.value = {
|
|
|
|
|
realName: "",
|
|
|
|
|
openId: "",
|
|
|
|
|
id: "",
|
|
|
|
|
idNumber: "",
|
|
|
|
|
phone: "",
|
|
|
|
|
numberPicName: "",
|
|
|
|
|
picList: [],
|
|
|
|
|
};
|
|
|
|
|
addMealShow.value = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function updateServiceArea() {
|
|
|
|
|
//判断如果当前行为空,则提示让选择当前行
|
|
|
|
|
if (currentRow.value == null) {
|
|
|
|
|
ElMessage({
|
|
|
|
|
showClose: true,
|
|
|
|
|
message: '请选择要修改的数据!',
|
|
|
|
|
type: 'warning',
|
|
|
|
|
})
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
//浅拷贝给子组件传入值,避免修改值退出后,再次进入还是修改过的值
|
|
|
|
|
addForm.value = { ...currentRow.value };
|
|
|
|
|
|
|
|
|
|
let picListData = [];
|
|
|
|
|
picListData.push({ url: addForm.value.numberPicName, name: "身份证正面照片.png" });
|
|
|
|
|
addForm.value.picList = picListData;
|
|
|
|
|
|
|
|
|
|
addMealShow.value = true;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//保存数据
|
|
|
|
|
function saveData() {
|
|
|
|
|
mmUserAddUpdateDom.value.formDom.validate((valid) => {
|
|
|
|
|
if (valid) { // 注意:只有当所有的规则都满足后,此时的 valid 的值才为 true,才能执行下面的值;
|
|
|
|
|
//调用子组件保存方法
|
|
|
|
|
let datas = mmUserAddUpdateDom.value.saveData();
|
|
|
|
|
tableLoading.value = true;
|
|
|
|
|
saveMMUserInfo(datas).then(res => {
|
|
|
|
|
if (res.result == 1) {
|
|
|
|
|
addMealShow.value = false;
|
|
|
|
|
ElMessage.success(res.msg);
|
|
|
|
|
reloadTableData();
|
|
|
|
|
} else if (res.result == -2) {
|
|
|
|
|
ElMessage.error(res.msg);
|
|
|
|
|
} else if (res.result == -3) {
|
|
|
|
|
ElMessage.error(res.msg);
|
|
|
|
|
} else {
|
|
|
|
|
ElMessage.error(res.msg);
|
|
|
|
|
}
|
|
|
|
|
tableLoading.value = false;
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function del() {
|
|
|
|
|
if (null == currentRow.value && null == multipleSelection.value) {
|
|
|
|
|
ElMessage({
|
|
|
|
|
showClose: true,
|
|
|
|
|
message: '请选择要删除的数据!',
|
|
|
|
|
type: 'warning',
|
|
|
|
|
})
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
let serivceAreaList = [];
|
|
|
|
|
//如果多选有数据,则判断单选是否有数据,把单选数据添加到所选中,然后删除数据
|
|
|
|
|
if (null != multipleSelection.value && multipleSelection.value.length > 0) {
|
|
|
|
|
serivceAreaList = [...multipleSelection.value];
|
|
|
|
|
if (null != currentRow.value) {
|
|
|
|
|
let isCanAdd = true;
|
|
|
|
|
for (let item of serivceAreaList) {
|
|
|
|
|
if (item.openId == currentRow.value.openId) {
|
|
|
|
|
isCanAdd = false;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (isCanAdd) {
|
|
|
|
|
serivceAreaList.push({ ...currentRow.value });
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
serivceAreaList.push({ ...currentRow.value });
|
|
|
|
|
}
|
|
|
|
|
let msg = "";
|
|
|
|
|
if (serivceAreaList.length == 1) {
|
|
|
|
|
msg = '是否确定删除该数据?';
|
|
|
|
|
} else {
|
|
|
|
|
msg = '是否批量删除' + serivceAreaList.length + '条数据?';
|
|
|
|
|
}
|
|
|
|
|
ElMessageBox.confirm(
|
|
|
|
|
msg,
|
|
|
|
|
'提示',
|
|
|
|
|
{
|
|
|
|
|
confirmButtonText: '确定',
|
|
|
|
|
cancelButtonText: '取消',
|
|
|
|
|
type: 'warning',
|
|
|
|
|
}
|
|
|
|
|
).then(() => {
|
|
|
|
|
deleteMMUser(serivceAreaList).then((res) => {
|
|
|
|
|
if (res.result == 1) {
|
|
|
|
|
ElMessage.success(res.msg);
|
|
|
|
|
//获取岗位数据
|
|
|
|
|
reloadTableData();
|
|
|
|
|
currentRow.value = null;
|
|
|
|
|
} else {
|
|
|
|
|
ElMessage.error(res.msg);
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function tableHandleCurrentChange(row) {
|
|
|
|
|
currentRow.value = row;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//修改分页大小函数
|
|
|
|
|
function handleSizeChange(pageSize) {
|
|
|
|
|
|
|
|
|
|
searchForm.pageSize = pageSize;
|
|
|
|
|
reloadTableData();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//当前页改变
|
|
|
|
|
function handleCurrentChange(pageNum) {
|
|
|
|
|
searchForm.pageNum = pageNum;
|
|
|
|
|
reloadTableData();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//批量删除选择的数据
|
|
|
|
|
function handleSelectionChange(row) {
|
|
|
|
|
multipleSelection.value = row
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
import { genFileId } from 'element-plus'
|
|
|
|
|
import type { UploadInstance, UploadProps, UploadRawFile } from 'element-plus'
|
|
|
|
|
|
|
|
|
|
const upload = ref<UploadInstance>()
|
|
|
|
|
|
|
|
|
|
const handleExceed: UploadProps['onExceed'] = (files) => {
|
|
|
|
|
upload.value!.clearFiles()
|
|
|
|
|
const file = files[0] as UploadRawFile
|
|
|
|
|
file.uid = genFileId()
|
|
|
|
|
upload.value!.handleStart(file)
|
|
|
|
|
upload.value!.submit()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function changeFile(){
|
|
|
|
|
tableLoading.value = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//文件上传成功回调函数
|
|
|
|
|
function successFile(res, file, files) {
|
|
|
|
|
if (res.result == 1) {
|
|
|
|
|
ElMessage.success(res.msg);
|
|
|
|
|
} else if (res.result == -2) {
|
|
|
|
|
ElMessage.error(res.msg);
|
|
|
|
|
} else if (res.result == -3) {
|
|
|
|
|
ElMessage.warning(res.msg);
|
|
|
|
|
} else {
|
|
|
|
|
ElMessage.error(res.msg);
|
|
|
|
|
}
|
|
|
|
|
reloadTableData();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//文件上传失败回调
|
|
|
|
|
function errorFile(){
|
|
|
|
|
reloadTableData();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
::v-deep.el-upload-list__item.is-success {
|
|
|
|
|
float: right;
|
|
|
|
|
}
|
|
|
|
|
</style>
|