diff --git a/ruoyi-ui/src/views/ccdiEmployee/index.vue b/ruoyi-ui/src/views/ccdiEmployee/index.vue index f1ff7cc..5a622e0 100644 --- a/ruoyi-ui/src/views/ccdiEmployee/index.vue +++ b/ruoyi-ui/src/views/ccdiEmployee/index.vue @@ -16,7 +16,7 @@ placeholder="请输入7位柜员号" clearable maxlength="7" - oninput="value=value.replace(/[^\d]/g,'')" + @input="queryParams.employeeId = queryParams.employeeId.replace(/[^\d]/g, '')" style="width: 240px" @keyup.enter.native="handleQuery" /> @@ -140,7 +140,7 @@ v-model="form.employeeId" placeholder="请输入7位柜员号" maxlength="7" - oninput="value=value.replace(/[^\d]/g,'')" + @input="form.employeeId = form.employeeId.replace(/[^\d]/g, '')" /> @@ -289,6 +289,8 @@ export default { detailOpen: false, // 员工详情 employeeDetail: {}, + // 是否为新增操作 + isAdd: false, // 所有部门树选项 deptOptions: undefined, // 过滤掉已禁用部门树选项 @@ -383,6 +385,7 @@ export default { // 取消按钮 cancel() { this.open = false; + this.isAdd = false; this.reset(); }, // 表单重置 @@ -418,6 +421,7 @@ export default { /** 新增按钮操作 */ handleAdd() { this.reset(); + this.isAdd = true; this.open = true; this.title = "新增员工"; }, @@ -432,6 +436,7 @@ export default { /** 修改按钮操作 */ handleUpdate(row) { this.reset(); + this.isAdd = false; const employeeId = row.employeeId || this.ids[0]; getEmployee(employeeId).then(response => { this.form = response.data; @@ -443,15 +448,16 @@ export default { submitForm() { this.$refs["form"].validate(valid => { if (valid) { - if (this.form.employeeId != null) { - updateEmployee(this.form).then(response => { - this.$modal.msgSuccess("修改成功"); + if (this.isAdd) { + addEmployee(this.form).then(response => { + this.$modal.msgSuccess("新增成功"); this.open = false; + this.isAdd = false; this.getList(); }); } else { - addEmployee(this.form).then(response => { - this.$modal.msgSuccess("新增成功"); + updateEmployee(this.form).then(response => { + this.$modal.msgSuccess("修改成功"); this.open = false; this.getList(); }); @@ -484,7 +490,7 @@ export default { }, /** 下载模板操作 */ importTemplate() { - this.download('dpc/employee/importTemplate', {}, `员工信息模板_${new Date().getTime()}.xlsx`) + this.download('ccdi/employee/importTemplate', {}, `员工信息模板_${new Date().getTime()}.xlsx`) }, // 文件上传中处理 handleFileUploadProgress(event, file, fileList) { @@ -626,16 +632,96 @@ export default { font-size: 13px; margin-right: 8px; } + -/* 导入结果弹窗样式 */ -.import-result-dialog { - max-height: 70vh; - overflow: auto; +