- - [ ]
| 标题 | |
|---|---|
yiasa
```dewqeqweqweqwwqeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeasdasd
wew
qweqwq
<template>
<div class="app-container">
<div class="table-container">
<div class="space"></div>
<div class="page">
<div class="page-header">
<span class="title">账号审核 — 供应商</span>
</div>
<div class="page-container">
<div class="page-table">
<el-form ref="searchPageParamFrom" :model="searchPageParamFrom">
<el-table
stripe
v-loading="listLoading"
element-loading-text="加载中..."
:data="list"
:row-style="{ height: '55px' }"
:cell-style="{ padding: '5px' }"
empty-text="没有数据"
fit
highlight-current-row
@selection-change="handleSelectionChange"
border
show-header
>
<el-table-column align="center" type="selection" width="50">
</el-table-column>
<el-table-column align="center" label="序号" width="50">
<template slot-scope="scope">
<div v-if="scope.$index == 0"></div>
<div v-else>{{ scope.$index + 0 }}</div>
</template>
</el-table-column>
<el-table-column align="center" label="名称" show-overflow-tooltip>
<template slot-scope="scope">
<div v-if="scope.$index == 0">
<el-form-item prop="name">
<el-input
v-model="searchPageParamFrom.name"
size="small"
placeholder="名称"
/>
</el-form-item>
</div>
<div v-else>{{ scope.row.name }}</div>
</template>
</el-table-column>
<el-table-column
align="center"
label="地址"
show-overflow-tooltip
>
<template slot-scope="scope">
<el-form-item v-if="scope.$index == 0" class="address" prop="addr">
<el-input
v-model="searchPageParamFrom.addr"
size="small"
placeholder="地址"
/>
</el-form-item>
<el-form-item v-else>{{ scope.row.addr }}</el-form-item>
</template>
</el-table-column>
<el-table-column align="center" label="姓名" show-overflow-tooltip>
<template slot-scope="scope">
<div v-if="scope.$index == 0">
<el-form-item prop="peopleName">
<el-input
v-model="searchPageParamFrom.peopleName"
size="small"
placeholder="姓名"
/>
</el-form-item>
</div>
<div v-else>{{ scope.row.peopleName }}</div>
</template>
</el-table-column>
<el-table-column align="center" label="编号" show-overflow-tooltip>
<template slot-scope="scope">
<div v-if="scope.$index == 0">
<el-form-item prop="jobNo">
<el-input
v-model="searchPageParamFrom.jobNo"
size="small"
placeholder="编号"
/>
</el-form-item>
</div>
<div v-else>{{ scope.row.jobNo }}</div>
</template>
</el-table-column>
<el-table-column align="center" label="账号" show-overflow-tooltip>
<template slot-scope="scope">
<div v-if="scope.$index == 0">
<el-form-item prop="account">
<el-input
v-model="searchPageParamFrom.account"
size="small"
placeholder="账号"
/>
</el-form-item>
</div>
<div v-else>{{ scope.row.account }}</div>
</template>
</el-table-column>
<el-table-column align="center" label="状态" show-overflow-tooltip>
<template slot-scope="scope">
<div v-if="scope.$index == 0">
<el-form-item prop="status">
<el-select
v-model="searchPageParamFrom.status"
size="small"
class="Please_select"
placeholder="请选择"
>
<el-option
class="Please_select"
v-for="item in statusSelectOption"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
</div>
<el-link
v-else
:type="scope.row.status | statusStatusFilter"
herf="#"
>{{ scope.row.status | statusFilter }}</el-link
>
</template>
</el-table-column>
<el-table-column align="center" label="审核" width="168">
<template slot-scope="scope">
<div v-if="scope.$index == 0">
<el-col>
<el-button
size="small"
@click="resetSearchPageParamFrom"
class="resetButton"
type="info"
>重置</el-button
>
<el-button
size="small"
@click="fetchData"
class="queryButton"
type="warning"
>查询</el-button
>
</el-col>
</div>
<div v-else>
<el-button
size="small"
@click="adopt(scope.$index, scope.row)"
class="adoptButton"
type="primary"
>通过</el-button
><el-button
size="small"
@click="reject(scope.$index, scope.row)"
type="danger"
>驳回</el-button
>
</div>
</template>
</el-table-column>
<el-table-column align="center" label="操作" width="148">
<template slot-scope="scope">
<div v-if="scope.$index == 0">
<el-button
v-permission="['superAdmin', 'admin']"
icon="el-icon-minus"
type="danger"
size="small"
@click="handleBatchDelete"
>删除</el-button
>
</div>
<div v-else>
<span>
<i
@click="handleEdit(scope.$index, scope.row)"
class="el-icon-edit"
></i
></span>
<span class="for"></span>
<el-popconfirm
title="确认删除该用户吗?"
@onConfirm="handleDelete(scope.$index, scope.row)"
>
<i slot="reference" class="el-icon-delete"></i>
</el-popconfirm>
</div>
</template>
</el-table-column>
</el-table>
</el-form>
</div>
<div class="page-foot">
<el-pagination
background
layout="total,prev, pager, next ,sizes"
:current-page.sync="page.no"
:page-sizes="[10, 15, 20]"
:page-size="page.size"
:total="page.total"
@size-change="handleSizeChange"
@current-change="fetchData"
>
</el-pagination>
</div>
</div>
</div>
</div>
<employeeDefine
ref="employeeDefine"
@doRefreshEmployee="fetchData"
></employeeDefine>
<employeeExcelUpload
ref="employeeExcelUpload"
@doRefreshEmployee="fetchData"
></employeeExcelUpload>
</div>
</template>
<script>
import employeeDefine from "@/views/employee-manager/components/employeeDefine";
import employeeExcelUpload from "./components/employeeExcelUpload";
import {
pageQuerySupplierApply,
deleteSupplierApply,
batchDeleteSupplierApply,
passSupplierApply,
rejectSupplierApply,
} from "@/api/supplierApply";
export default {
components: { employeeDefine, employeeExcelUpload },
filters: {
statusStatusFilter(status) {
const statusMap = {
1: "warning",
2: "primary",
3: "info",
4: "info",
};
return statusMap[status];
},
statusFilter(status) {
const statusMap = {
1: "待审核",
2: "通过",
3: "驳回",
4: "删除",
};
return statusMap[status];
},
},
data() {
return {
isShow: false,
searchPageParamFrom: {
name: "",
addr: "",
peopleName: "",
jobNo: "",
account: "",
status: 0,
},
multipleSelection: [],
page: {
size: 10,
no: 1,
total: 0,
},
list: null,
listLoading: true,
dialogVisible: false,
tableData: null,
multiple: [],
statusSelectOption: [
{ value: 0, label: "全部" },
{ value: 1, label: "待审核" },
{ value: 2, label: "通过" },
{ value: 3, label: "驳回" },
{ value: 4, label: "删除" },
],
};
},
created() {
this.fetchData();
},
methods: {
//通过
adopt(index, row) {
this.$confirm("此操作是否通过, 通过请按确认", "审核", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(() => {
var id = [];
this.multiple.forEach((item) => {
id.push(item.id);
});
passSupplierApply(row.id)
.then((response) => {
this.$message({
type: "success",
message: "通过成功!",
});
this.fetchData();
})
.catch(() => {
this.$message({
type: "info",
message: "该账号已存在,不能重复通过!",
});
});
});
},
//批量删除
handleBatchDelete() {
this.$confirm("此操作将批量删除勾选的员工信息, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(() => {
var ids = [];
this.multipleSelection.forEach((item) => {
ids.push(item.id);
});
batchDeleteSupplierApply({ ids: ids })
.then((response) => {
this.$message({
type: "success",
message: "批量删除员工信息成功!",
});
this.fetchData();
})
.catch(() => {
this.$message({ type: "info", message: "批量删除员工信息失败!" });
});
});
},
//驳回
reject(index, row) {
rejectSupplierApply(row.id).then((response) => {
this.$confirm("此操作是否驳回, 通过请按驳回", "审核", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.$message({
type: "success",
message: "驳回成功!",
});
this.fetchData();
})
.catch(() => {
this.$message({
type: "info",
message: "已取消驳回",
});
});
});
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
//删除
handleDelete(index, row) {
deleteSupplierApply(row.id)
.then((response) => {
this.$message({ type: "success", message: "删除员工信息成功!" });
this.fetchData();
})
.catch(() => {
this.$message({ type: "info", message: "删除员工信息失败!" });
});
},
//重置
resetSearchPageParamFrom() {
this.$refs.searchPageParamFrom.resetFields();
// alert()
},
//编辑
handleEdit(index, row) {
this.$refs.employeeDefine.showForm("edit", row);
},
//条数
handleSizeChange(val) {
this.page.size = val;
this.page.no = 1;
this.fetchData();
},
//获取数据和分页
fetchData() {
this.listLoading = true;
const pageQuerySupplierApplyParam = {
pageParam: {
pageNo: this.page.no,
pageSize: this.page.size,
},
name: this.searchPageParamFrom.name,
addr: this.searchPageParamFrom.addr,
peopleName: this.searchPageParamFrom.peopleName,
jobNo: this.searchPageParamFrom.jobNo,
account: this.searchPageParamFrom.account,
status: this.searchPageParamFrom.status,
};
pageQuerySupplierApply(pageQuerySupplierApplyParam)
.then((response) => {
this.list = response.data.result.list;
this.list.unshift({});
this.page.total = response.data.result.total;
this.listLoading = false;
})
.catch(() => {
this.listLoading = false;
});
},
//隐藏table第一行
doQuery() {
getExpertList(this.form).then((data) => {
let checkmsg = this.$checkResult(data);
if (checkmsg === "OK") {
//成功返回
data.rows.unshift({});
this.list = data.rows;
} else {
this.$message.error(checkmsg);
}
});
},
handleClose(done) {
this.$confirm("确认关闭?")
.then((_) => {
done();
})
.catch((_) => {});
},
},
};
</script>
<style lang="scss" scoped>
.el-table .el-tag {
cursor: pointer;
}
</style>