文件夹整理
This commit is contained in:
@@ -1,44 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询员工列表
|
||||
export function listEmployee(query) {
|
||||
export function listBaseStaff(query) {
|
||||
return request({
|
||||
url: '/ccdi/employee/list',
|
||||
url: '/ccdi/baseStaff/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询员工详细
|
||||
export function getEmployee(employeeId) {
|
||||
export function getBaseStaff(staffId) {
|
||||
return request({
|
||||
url: '/ccdi/employee/' + employeeId,
|
||||
url: '/ccdi/baseStaff/' + staffId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增员工
|
||||
export function addEmployee(data) {
|
||||
export function addBaseStaff(data) {
|
||||
return request({
|
||||
url: '/ccdi/employee',
|
||||
url: '/ccdi/baseStaff',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改员工
|
||||
export function updateEmployee(data) {
|
||||
export function updateBaseStaff(data) {
|
||||
return request({
|
||||
url: '/ccdi/employee',
|
||||
url: '/ccdi/baseStaff',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除员工
|
||||
export function delEmployee(employeeIds) {
|
||||
export function delBaseStaff(staffIds) {
|
||||
return request({
|
||||
url: '/ccdi/employee/' + employeeIds,
|
||||
url: '/ccdi/baseStaff/' + staffIds,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
@@ -46,7 +46,7 @@ export function delEmployee(employeeIds) {
|
||||
// 下载导入模板
|
||||
export function importTemplate() {
|
||||
return request({
|
||||
url: '/ccdi/employee/importTemplate',
|
||||
url: '/ccdi/baseStaff/importTemplate',
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
@@ -54,7 +54,7 @@ export function importTemplate() {
|
||||
// 导入员工
|
||||
export function importData(data, updateSupport) {
|
||||
return request({
|
||||
url: '/ccdi/employee/importData?updateSupport=' + updateSupport,
|
||||
url: '/ccdi/baseStaff/importData?updateSupport=' + updateSupport,
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
@@ -63,7 +63,7 @@ export function importData(data, updateSupport) {
|
||||
// 查询导入状态
|
||||
export function getImportStatus(taskId) {
|
||||
return request({
|
||||
url: '/ccdi/employee/importStatus/' + taskId,
|
||||
url: '/ccdi/baseStaff/importStatus/' + taskId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
@@ -71,7 +71,7 @@ export function getImportStatus(taskId) {
|
||||
// 查询导入失败记录
|
||||
export function getImportFailures(taskId, pageNum, pageSize) {
|
||||
return request({
|
||||
url: '/ccdi/employee/importFailures/' + taskId,
|
||||
url: '/ccdi/baseStaff/importFailures/' + taskId,
|
||||
method: 'get',
|
||||
params: { pageNum, pageSize }
|
||||
})
|
||||
@@ -10,13 +10,13 @@
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="柜员号" prop="employeeId">
|
||||
<el-form-item label="柜员号" prop="staffId">
|
||||
<el-input
|
||||
v-model="queryParams.employeeId"
|
||||
v-model="queryParams.staffId"
|
||||
placeholder="请输入7位柜员号"
|
||||
clearable
|
||||
maxlength="7"
|
||||
@input="queryParams.employeeId = queryParams.employeeId.replace(/[^\d]/g, '')"
|
||||
@input="queryParams.staffId = queryParams.staffId.replace(/[^\d]/g, '')"
|
||||
style="width: 240px"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
@@ -84,10 +84,10 @@
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="employeeList" @selection-change="handleSelectionChange">
|
||||
<el-table v-loading="loading" :data="baseStaffList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="姓名" align="center" prop="name" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="柜员号" align="center" prop="employeeId" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="柜员号" align="center" prop="staffId" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="身份证号" align="center" prop="idCard" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="所属部门" align="center" prop="deptName" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="电话" align="center" prop="phone" width="120"/>
|
||||
@@ -149,16 +149,16 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="柜员号" prop="employeeId" v-if="!form.employeeId || isAdd">
|
||||
<el-form-item label="柜员号" prop="staffId" v-if="!form.staffId || isAdd">
|
||||
<el-input
|
||||
v-model="form.employeeId"
|
||||
v-model="form.staffId"
|
||||
placeholder="请输入7位柜员号"
|
||||
maxlength="7"
|
||||
@input="form.employeeId = form.employeeId.replace(/[^\d]/g, '')"
|
||||
@input="form.staffId = form.staffId.replace(/[^\d]/g, '')"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="柜员号" prop="employeeId" v-else>
|
||||
<el-input v-model="form.employeeId" disabled />
|
||||
<el-form-item label="柜员号" prop="staffId" v-else>
|
||||
<el-input v-model="form.staffId" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -210,7 +210,7 @@
|
||||
</div>
|
||||
<el-descriptions :column="2" border>
|
||||
<el-descriptions-item label="姓名">{{ employeeDetail.name || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="柜员号">{{ employeeDetail.employeeId || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="柜员号">{{ employeeDetail.staffId || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="所属部门">{{ employeeDetail.deptName || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="身份证号">{{ employeeDetail.idCard || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="电话">{{ employeeDetail.phone || '-' }}</el-descriptions-item>
|
||||
@@ -287,7 +287,7 @@
|
||||
|
||||
<el-table :data="failureList" v-loading="failureLoading">
|
||||
<el-table-column label="姓名" prop="name" align="center" />
|
||||
<el-table-column label="柜员号" prop="employeeId" align="center" />
|
||||
<el-table-column label="柜员号" prop="staffId" align="center" />
|
||||
<el-table-column label="身份证号" prop="idCard" align="center" />
|
||||
<el-table-column label="电话" prop="phone" align="center" />
|
||||
<el-table-column label="失败原因" prop="errorMessage" align="center" min-width="200" :show-overflow-tooltip="true" />
|
||||
@@ -310,7 +310,15 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {addEmployee, delEmployee, getEmployee, listEmployee, updateEmployee, getImportStatus, getImportFailures} from "@/api/ccdiEmployee";
|
||||
import {
|
||||
addBaseStaff,
|
||||
delBaseStaff,
|
||||
getBaseStaff,
|
||||
getImportFailures,
|
||||
getImportStatus,
|
||||
listBaseStaff,
|
||||
updateBaseStaff
|
||||
} from "@/api/ccdiBaseStaff";
|
||||
import {deptTreeSelect} from "@/api/system/user";
|
||||
import {getToken} from "@/utils/auth";
|
||||
import Treeselect from "@riophae/vue-treeselect";
|
||||
@@ -340,7 +348,7 @@ export default {
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 员工表格数据
|
||||
employeeList: [],
|
||||
baseStaffList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
@@ -360,7 +368,7 @@ export default {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
name: null,
|
||||
employeeId: null,
|
||||
staffId: null,
|
||||
deptId: null,
|
||||
idCard: null,
|
||||
status: null
|
||||
@@ -373,7 +381,7 @@ export default {
|
||||
{ required: true, message: "姓名不能为空", trigger: "blur" },
|
||||
{ max: 100, message: "姓名长度不能超过100个字符", trigger: "blur" }
|
||||
],
|
||||
employeeId: [
|
||||
staffId: [
|
||||
{ required: true, message: "柜员号不能为空", trigger: "blur" },
|
||||
{ pattern: /^\d{7}$/, message: "柜员号必须为7位数字", trigger: "blur" }
|
||||
],
|
||||
@@ -405,7 +413,7 @@ export default {
|
||||
// 设置上传的请求头部
|
||||
headers: { Authorization: "Bearer " + getToken() },
|
||||
// 上传的地址
|
||||
url: process.env.VUE_APP_BASE_API + "/ccdi/employee/importData"
|
||||
url: process.env.VUE_APP_BASE_API + "/ccdi/baseStaff/importData"
|
||||
},
|
||||
// 导入结果弹窗
|
||||
importResultVisible: false,
|
||||
@@ -566,8 +574,8 @@ export default {
|
||||
/** 查询员工列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listEmployee(this.queryParams).then(response => {
|
||||
this.employeeList = response.rows;
|
||||
listBaseStaff(this.queryParams).then(response => {
|
||||
this.baseStaffList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
@@ -600,7 +608,7 @@ export default {
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
employeeId: null,
|
||||
staffId: null,
|
||||
name: null,
|
||||
deptId: null,
|
||||
idCard: null,
|
||||
@@ -623,7 +631,7 @@ export default {
|
||||
},
|
||||
/** 多选框选中数据 */
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.employeeId);
|
||||
this.ids = selection.map(item => item.staffId);
|
||||
this.single = selection.length !== 1;
|
||||
this.multiple = !selection.length;
|
||||
},
|
||||
@@ -636,8 +644,8 @@ export default {
|
||||
},
|
||||
/** 详情按钮操作 */
|
||||
handleDetail(row) {
|
||||
const employeeId = row.employeeId;
|
||||
getEmployee(employeeId).then(response => {
|
||||
const staffId = row.staffId;
|
||||
getBaseStaff(staffId).then(response => {
|
||||
this.employeeDetail = response.data;
|
||||
this.detailOpen = true;
|
||||
});
|
||||
@@ -646,8 +654,8 @@ export default {
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
this.isAdd = false;
|
||||
const employeeId = row.employeeId || this.ids[0];
|
||||
getEmployee(employeeId).then(response => {
|
||||
const staffId = row.staffId || this.ids[0];
|
||||
getBaseStaff(staffId).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "编辑员工";
|
||||
@@ -658,14 +666,14 @@ export default {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.isAdd) {
|
||||
addEmployee(this.form).then(response => {
|
||||
addBaseStaff(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.isAdd = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
updateEmployee(this.form).then(response => {
|
||||
updateBaseStaff(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
@@ -676,9 +684,9 @@ export default {
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const employeeIds = row.employeeId || this.ids;
|
||||
this.$modal.confirm('是否确认删除员工编号为"' + employeeIds + '"的数据项?').then(function() {
|
||||
return delEmployee(employeeIds);
|
||||
const staffIds = row.staffId || this.ids;
|
||||
this.$modal.confirm('是否确认删除员工编号为"' + staffIds + '"的数据项?').then(function() {
|
||||
return delBaseStaff(staffIds);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
@@ -699,7 +707,7 @@ export default {
|
||||
},
|
||||
/** 下载模板操作 */
|
||||
importTemplate() {
|
||||
this.download('ccdi/employee/importTemplate', {}, `员工信息模板_${new Date().getTime()}.xlsx`)
|
||||
this.download('ccdi/baseStaff/importTemplate', {}, `员工信息模板_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
// 文件上传中处理
|
||||
handleFileUploadProgress(event, file, fileList) {
|
||||
Reference in New Issue
Block a user