mirror of
https://github.com/FatttSnake/Pinnacle-OA.git
synced 2026-04-05 23:11:24 +08:00
Add employee name suffixes to work item information. Add password modification function.
This commit is contained in:
@@ -16,6 +16,7 @@ import org.springframework.util.StringUtils;
|
|||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
@@ -44,15 +45,17 @@ public class UserController {
|
|||||||
|
|
||||||
@PutMapping("/passwd")
|
@PutMapping("/passwd")
|
||||||
@Operation(summary = "修改密码")
|
@Operation(summary = "修改密码")
|
||||||
public ResponseResult<?> modifyPasswd(String oldPasswd, String newPassword) {
|
public ResponseResult<?> modifyPasswd(@RequestBody Map<String, String> passwd) {
|
||||||
if (oldPasswd == null || newPassword == null) {
|
String oldPasswd = passwd.get("oldPasswd");
|
||||||
|
String newPasswd = passwd.get("newPasswd");
|
||||||
|
if (oldPasswd == null || newPasswd == null) {
|
||||||
throw new DataValidationFailedException();
|
throw new DataValidationFailedException();
|
||||||
}
|
}
|
||||||
newPassword = newPassword.trim();
|
newPasswd = newPasswd.trim();
|
||||||
if (oldPasswd.isBlank() || oldPasswd.length() < 8 || oldPasswd.length() > 64 || newPassword.isBlank() || newPassword.length() < 8 || newPassword.length() > 64) {
|
if (oldPasswd.isBlank() || newPasswd.isBlank() || newPasswd.length() < 8 || newPasswd.length() > 64) {
|
||||||
throw new DataValidationFailedException();
|
throw new DataValidationFailedException();
|
||||||
}
|
}
|
||||||
if (userService.modifyPasswd(oldPasswd, newPassword)) {
|
if (userService.modifyPasswd(oldPasswd, newPasswd)) {
|
||||||
return ResponseResult.databaseUpdateSuccess(null);
|
return ResponseResult.databaseUpdateSuccess(null);
|
||||||
} else {
|
} else {
|
||||||
return ResponseResult.build(ResponseCode.DATABASE_UPDATE_ERROR, "error", null);
|
return ResponseResult.build(ResponseCode.DATABASE_UPDATE_ERROR, "error", null);
|
||||||
@@ -70,14 +73,14 @@ public class UserController {
|
|||||||
@PreAuthorize("hasAnyAuthority('work:manage:add', 'work:admin:add', 'attendance:manage:modify')")
|
@PreAuthorize("hasAnyAuthority('work:manage:add', 'work:admin:add', 'attendance:manage:modify')")
|
||||||
@Operation(summary = "获取同部门下所有用户")
|
@Operation(summary = "获取同部门下所有用户")
|
||||||
public ResponseResult<List<User>> getDepartmentUser() {
|
public ResponseResult<List<User>> getDepartmentUser() {
|
||||||
return ResponseResult.databaseSaveSuccess(userService.getDepartmentUser());
|
return ResponseResult.databaseSelectSuccess(userService.getDepartmentUser());
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/notice")
|
@GetMapping("/notice")
|
||||||
@PreAuthorize("hasAuthority('notice:manage:get')")
|
@PreAuthorize("hasAuthority('notice:manage:get')")
|
||||||
@Operation(summary = "获取拥有发布公告权限的用户")
|
@Operation(summary = "获取拥有发布公告权限的用户")
|
||||||
public ResponseResult<List<User>> getNoticeUser() {
|
public ResponseResult<List<User>> getNoticeUser() {
|
||||||
return ResponseResult.databaseSaveSuccess(userService.getNoticeUser());
|
return ResponseResult.databaseSelectSuccess(userService.getNoticeUser());
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping
|
@GetMapping
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
server:
|
server:
|
||||||
port: 8621
|
port: 8621
|
||||||
|
|
||||||
spring:
|
spring:
|
||||||
datasource:
|
datasource:
|
||||||
type: com.alibaba.druid.pool.DruidDataSource
|
type: com.alibaba.druid.pool.DruidDataSource
|
||||||
@@ -17,3 +16,9 @@ mybatis-plus:
|
|||||||
logic-delete-value: id
|
logic-delete-value: id
|
||||||
id-type: assign_id
|
id-type: assign_id
|
||||||
type-aliases-package: com.cfive.pinnacle.entity
|
type-aliases-package: com.cfive.pinnacle.entity
|
||||||
|
configuration:
|
||||||
|
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
||||||
|
|
||||||
|
logging:
|
||||||
|
level:
|
||||||
|
root: debug
|
||||||
@@ -12,10 +12,15 @@
|
|||||||
<result property="status" column="status"/>
|
<result property="status" column="status"/>
|
||||||
<result property="completeTime" column="complete_time"/>
|
<result property="completeTime" column="complete_time"/>
|
||||||
</collection>
|
</collection>
|
||||||
<collection property="worker" ofType="user">
|
<collection property="worker" resultMap="workerMap"/>
|
||||||
<id property="id" column="worker_id"/>
|
</resultMap>
|
||||||
<result property="username" column="worker_name"/>
|
<resultMap id="workerMap" type="user">
|
||||||
</collection>
|
<id property="id" column="worker_id"/>
|
||||||
|
<result property="username" column="worker_name"/>
|
||||||
|
<association property="staff" javaType="staff">
|
||||||
|
<result property="firstName" column="first_name"/>
|
||||||
|
<result property="lastName" column="last_name"/>
|
||||||
|
</association>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
<select id="getAll" resultMap="workMap">
|
<select id="getAll" resultMap="workMap">
|
||||||
select w.id,
|
select w.id,
|
||||||
@@ -27,12 +32,16 @@
|
|||||||
tuw.user_id worker_id,
|
tuw.user_id worker_id,
|
||||||
tu.username worker_name,
|
tu.username worker_name,
|
||||||
tuw.status status,
|
tuw.status status,
|
||||||
tuw.complete_time complete_time
|
tuw.complete_time complete_time,
|
||||||
|
first_name,
|
||||||
|
last_name
|
||||||
from t_work w
|
from t_work w
|
||||||
left join (select * from t_user where deleted = 0) as u on w.publisher_id = u.id
|
left join (select * from t_user where deleted = 0) as u on w.publisher_id = u.id
|
||||||
left join (select * from t_user_work where deleted = 0) as tuw on w.id = tuw.work_id
|
left join (select * from t_user_work where deleted = 0) as tuw on w.id = tuw.work_id
|
||||||
left join (select * from t_user where deleted = 0) as tu on tuw.user_id = tu.id
|
left join (select * from t_user where deleted = 0) as tu on tuw.user_id = tu.id
|
||||||
|
left join (select * from t_staff where deleted = 0) as ts on tuw.user_id = ts.user_id
|
||||||
where w.deleted = 0
|
where w.deleted = 0
|
||||||
|
and w.old = 0
|
||||||
order by w.id desc;
|
order by w.id desc;
|
||||||
</select>
|
</select>
|
||||||
<select id="getWork" parameterType="long" resultMap="workMap">
|
<select id="getWork" parameterType="long" resultMap="workMap">
|
||||||
@@ -45,13 +54,17 @@
|
|||||||
tuw.user_id worker_id,
|
tuw.user_id worker_id,
|
||||||
tu.username worker_name,
|
tu.username worker_name,
|
||||||
tuw.status status,
|
tuw.status status,
|
||||||
tuw.complete_time completeTime
|
tuw.complete_time completeTime,
|
||||||
|
first_name,
|
||||||
|
last_name
|
||||||
from t_work w
|
from t_work w
|
||||||
left join (select * from t_user where deleted = 0) as u on w.publisher_id = u.id
|
left join (select * from t_user where deleted = 0) as u on w.publisher_id = u.id
|
||||||
left join (select * from t_user_work where deleted = 0) as tuw on w.id = tuw.work_id
|
left join (select * from t_user_work where deleted = 0) as tuw on w.id = tuw.work_id
|
||||||
left join (select * from t_user where deleted = 0) as tu on tuw.user_id = tu.id
|
left join (select * from t_user where deleted = 0) as tu on tuw.user_id = tu.id
|
||||||
|
left join (select * from t_staff where deleted = 0) as ts on tuw.user_id = ts.user_id
|
||||||
where w.id = #{id}
|
where w.id = #{id}
|
||||||
and w.deleted = 0;
|
and w.deleted = 0
|
||||||
|
and w.old = 0;
|
||||||
</select>
|
</select>
|
||||||
<select id="getWorkByContent" parameterType="String" resultMap="workMap">
|
<select id="getWorkByContent" parameterType="String" resultMap="workMap">
|
||||||
select w.id,
|
select w.id,
|
||||||
@@ -69,7 +82,8 @@
|
|||||||
left join (select * from t_user_work where deleted = 0) as tuw on w.id = tuw.work_id
|
left join (select * from t_user_work where deleted = 0) as tuw on w.id = tuw.work_id
|
||||||
left join (select * from t_user where deleted = 0) as tu on tuw.user_id = tu.id
|
left join (select * from t_user where deleted = 0) as tu on tuw.user_id = tu.id
|
||||||
where w.content like '%${content}%'
|
where w.content like '%${content}%'
|
||||||
and w.deleted = 0;
|
and w.deleted = 0
|
||||||
|
and w.old = 0;
|
||||||
</select>
|
</select>
|
||||||
<select id="getTodo" parameterType="long" resultMap="workMap">
|
<select id="getTodo" parameterType="long" resultMap="workMap">
|
||||||
select w.id,
|
select w.id,
|
||||||
@@ -89,6 +103,7 @@
|
|||||||
tuw.user_id = #{userId}
|
tuw.user_id = #{userId}
|
||||||
and status = false
|
and status = false
|
||||||
and w.deleted = 0
|
and w.deleted = 0
|
||||||
|
and w.old = 0
|
||||||
order by w.deadline asc, w.id desc;
|
order by w.deadline asc, w.id desc;
|
||||||
</select>
|
</select>
|
||||||
<select id="getCard" parameterType="long" resultMap="workMap">
|
<select id="getCard" parameterType="long" resultMap="workMap">
|
||||||
@@ -108,6 +123,7 @@
|
|||||||
where tuw.user_id = #{userId}
|
where tuw.user_id = #{userId}
|
||||||
and status = false
|
and status = false
|
||||||
and w.deleted = 0
|
and w.deleted = 0
|
||||||
|
and w.old = 0
|
||||||
order by w.deadline asc, w.id desc
|
order by w.deadline asc, w.id desc
|
||||||
limit 5;
|
limit 5;
|
||||||
|
|
||||||
@@ -130,6 +146,7 @@
|
|||||||
where tuw.user_id = #{userId}
|
where tuw.user_id = #{userId}
|
||||||
and tuw.status = true
|
and tuw.status = true
|
||||||
and w.deleted = 0
|
and w.deleted = 0
|
||||||
|
and w.old = 0
|
||||||
order by w.id desc;
|
order by w.id desc;
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|||||||
@@ -23,6 +23,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
export default {
|
export default {
|
||||||
|
emits: ['updatePasswd', 'cancelPasswd'],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
passwdForm: {
|
passwdForm: {
|
||||||
@@ -41,6 +42,10 @@ export default {
|
|||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: '新密码不能为空'
|
message: '新密码不能为空'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
validator: this.validateSurePasswordLength,
|
||||||
|
trigger: 'blur'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
selectPasswd: [
|
selectPasswd: [
|
||||||
@@ -52,6 +57,10 @@ export default {
|
|||||||
{
|
{
|
||||||
validator: this.validateSurePassword,
|
validator: this.validateSurePassword,
|
||||||
trigger: 'blur'
|
trigger: 'blur'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
validator: this.validateSurePasswordLength,
|
||||||
|
trigger: 'blur'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -82,6 +91,14 @@ export default {
|
|||||||
callback()
|
callback()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
validateSurePasswordLength(rule, value, callback) {
|
||||||
|
if (value.length < 8 || value.length > 64) {
|
||||||
|
callback(new Error('新密码长度应为8到64位'))
|
||||||
|
return false
|
||||||
|
} else {
|
||||||
|
callback()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,13 +22,13 @@
|
|||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="负责员工">
|
<el-descriptions-item label="负责员工">
|
||||||
<el-tag v-for="item in taskData.worker" style="margin-right: 10px">{{
|
<el-tag v-for="item in taskData.worker" style="margin-right: 10px">{{
|
||||||
item.username
|
item.staff.lastName + item.staff.firstName + '(' + item.username + ')'
|
||||||
}}</el-tag>
|
}}</el-tag>
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
</el-descriptions>
|
</el-descriptions>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang='ts'>
|
<script lang="ts">
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
taskData: {
|
taskData: {
|
||||||
|
|||||||
@@ -12,7 +12,11 @@
|
|||||||
<el-option
|
<el-option
|
||||||
v-for="item in workers"
|
v-for="item in workers"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
:label="item.username"
|
:label="
|
||||||
|
item.staff
|
||||||
|
? item.staff.lastName + item.staff.firstName + '(' + item.username + ')'
|
||||||
|
: item.username
|
||||||
|
"
|
||||||
:value="item"
|
:value="item"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
@@ -29,7 +33,7 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="工作内容" prop="content">
|
<el-form-item label="工作内容" prop="content">
|
||||||
<el-input v-model="form.content" type="textarea" />
|
<el-input v-model="form.content" type="textarea" maxlength="100" show-word-limit />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" @click="onSubmit(form)">
|
<el-button type="primary" @click="onSubmit(form)">
|
||||||
@@ -42,9 +46,9 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import request from '@/services'
|
|
||||||
import _ from 'lodash'
|
import _ from 'lodash'
|
||||||
export default {
|
export default {
|
||||||
|
emits: ['updateWork', 'addWork', 'setDialogVisible'],
|
||||||
props: {
|
props: {
|
||||||
editForm: {
|
editForm: {
|
||||||
publisherId: '',
|
publisherId: '',
|
||||||
@@ -52,7 +56,8 @@ export default {
|
|||||||
deadline: '',
|
deadline: '',
|
||||||
content: '',
|
content: '',
|
||||||
worker: []
|
worker: []
|
||||||
}
|
},
|
||||||
|
workers: null
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -64,12 +69,6 @@ export default {
|
|||||||
content: '',
|
content: '',
|
||||||
worker: []
|
worker: []
|
||||||
},
|
},
|
||||||
workers: [
|
|
||||||
{
|
|
||||||
id: '',
|
|
||||||
username: ''
|
|
||||||
}
|
|
||||||
],
|
|
||||||
rules: {
|
rules: {
|
||||||
worker: [
|
worker: [
|
||||||
{
|
{
|
||||||
@@ -93,16 +92,10 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getFormData() {
|
|
||||||
request.get('/user/department').then((response) => {
|
|
||||||
this.workers = response.data.data
|
|
||||||
})
|
|
||||||
},
|
|
||||||
onSubmit(form) {
|
onSubmit(form) {
|
||||||
// 表单校验
|
// 表单校验
|
||||||
this.$refs.ruleForm.validate((value) => {
|
this.$refs.ruleForm.validate((value) => {
|
||||||
if (value) {
|
if (value) {
|
||||||
form.publisherId = _.toString(1)
|
|
||||||
if (this.editForm) {
|
if (this.editForm) {
|
||||||
this.$emit('updateWork', form)
|
this.$emit('updateWork', form)
|
||||||
this.reset()
|
this.reset()
|
||||||
@@ -116,7 +109,11 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
reset() {
|
reset() {
|
||||||
this.$refs.ruleForm.resetFields()
|
if (this.editForm) {
|
||||||
|
this.form = _.cloneDeep(this.editForm)
|
||||||
|
} else {
|
||||||
|
this.$refs.ruleForm.resetFields()
|
||||||
|
}
|
||||||
},
|
},
|
||||||
cancel() {
|
cancel() {
|
||||||
this.reset()
|
this.reset()
|
||||||
@@ -125,17 +122,15 @@ export default {
|
|||||||
},
|
},
|
||||||
updated() {
|
updated() {
|
||||||
if (this.editForm) {
|
if (this.editForm) {
|
||||||
this.form = this.editForm
|
this.form = _.cloneDeep(this.editForm)
|
||||||
this.commitButton = '保存'
|
this.commitButton = '保存'
|
||||||
}
|
}
|
||||||
this.getFormData()
|
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
if (this.editForm) {
|
if (this.editForm) {
|
||||||
this.form = this.editForm
|
this.form = _.cloneDeep(this.editForm)
|
||||||
this.commitButton = '保存'
|
this.commitButton = '保存'
|
||||||
}
|
}
|
||||||
this.getFormData()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -7,12 +7,12 @@
|
|||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="名字" prop="firstName">
|
<el-form-item label="名字" prop="firstName">
|
||||||
<el-input v-model="form.firstName" />
|
<el-input v-model="form.firstName" maxlength="20" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="姓氏" prop="lastName">
|
<el-form-item label="姓氏" prop="lastName">
|
||||||
<el-input v-model="form.lastName" />
|
<el-input v-model="form.lastName" maxlength="20" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@@ -57,13 +57,13 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-form-item label="邮箱" prop="email">
|
<el-form-item label="邮箱" prop="email">
|
||||||
<el-input v-model="form.email" />
|
<el-input v-model="form.email" maxlength="50" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="手机号码" prop="tel">
|
<el-form-item label="手机号码" prop="tel">
|
||||||
<el-input v-model="form.tel" />
|
<el-input v-model="form.tel" maxlength="20" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="联系地址" prop="address">
|
<el-form-item label="联系地址" prop="address">
|
||||||
<el-input v-model="form.address" />
|
<el-input v-model="form.address" maxlength="100" show-word-limit />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item style="float: right">
|
<el-form-item style="float: right">
|
||||||
<el-button type="info" @click="resetForm">重置</el-button>
|
<el-button type="info" @click="resetForm">重置</el-button>
|
||||||
@@ -89,7 +89,11 @@ import _ from 'lodash'
|
|||||||
import request from '@/services'
|
import request from '@/services'
|
||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage } from 'element-plus'
|
||||||
import { requestUser } from '@/utils/auth'
|
import { requestUser } from '@/utils/auth'
|
||||||
import { DATABASE_SELECT_OK, DATABASE_UPDATE_OK } from '@/constants/Common.constants'
|
import {
|
||||||
|
DATABASE_SELECT_OK,
|
||||||
|
DATABASE_UPDATE_OK,
|
||||||
|
OLD_PASSWORD_NOT_MATCH
|
||||||
|
} from '@/constants/Common.constants'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
@@ -148,7 +152,9 @@ export default {
|
|||||||
required: true,
|
required: true,
|
||||||
message: '请选择性别'
|
message: '请选择性别'
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
email: [{ validator: this.checkEmail }],
|
||||||
|
tel: [{ validator: this.checkTel }]
|
||||||
},
|
},
|
||||||
visible: false
|
visible: false
|
||||||
}
|
}
|
||||||
@@ -203,10 +209,51 @@ export default {
|
|||||||
this.form = _.cloneDeep(this.staff)
|
this.form = _.cloneDeep(this.staff)
|
||||||
},
|
},
|
||||||
updatePasswd(passwdForm) {
|
updatePasswd(passwdForm) {
|
||||||
this.visible = false
|
request
|
||||||
|
.put('/user/passwd', {
|
||||||
|
oldPasswd: passwdForm.oldPasswd,
|
||||||
|
newPasswd: passwdForm.newPasswd
|
||||||
|
})
|
||||||
|
.then(async (res) => {
|
||||||
|
const response = res.data
|
||||||
|
if (response.code === DATABASE_UPDATE_OK) {
|
||||||
|
ElMessage({
|
||||||
|
message: '修改成功',
|
||||||
|
type: 'success'
|
||||||
|
})
|
||||||
|
this.visible = false
|
||||||
|
} else if (response.code === OLD_PASSWORD_NOT_MATCH) {
|
||||||
|
ElMessage({
|
||||||
|
message: '旧密码错误,修改失败,请重试',
|
||||||
|
type: 'error'
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
ElMessage({
|
||||||
|
message: '系统错误,修改失败',
|
||||||
|
type: 'error'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
},
|
},
|
||||||
cancelPasswd() {
|
cancelPasswd() {
|
||||||
this.visible = false
|
this.visible = false
|
||||||
|
},
|
||||||
|
checkEmail(rule, value, callback) {
|
||||||
|
const mailReg = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/
|
||||||
|
if (mailReg.test(value)) {
|
||||||
|
callback()
|
||||||
|
} else {
|
||||||
|
return callback(new Error('邮箱格式错误!'))
|
||||||
|
}
|
||||||
|
},
|
||||||
|
checkTel(rule, value, callback) {
|
||||||
|
const telReg =
|
||||||
|
/^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/
|
||||||
|
if (telReg.test(value)) {
|
||||||
|
callback()
|
||||||
|
} else {
|
||||||
|
return callback(new Error('手机号格式错误!'))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
|||||||
@@ -37,7 +37,13 @@
|
|||||||
round
|
round
|
||||||
style="margin-right: 10px"
|
style="margin-right: 10px"
|
||||||
>
|
>
|
||||||
{{ item.username }}
|
{{
|
||||||
|
item.staff.lastName +
|
||||||
|
item.staff.firstName +
|
||||||
|
'(' +
|
||||||
|
item.username +
|
||||||
|
')'
|
||||||
|
}}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@@ -77,12 +83,27 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
</div>
|
</div>
|
||||||
<el-dialog v-model="addVisible" width="60%">
|
<el-dialog
|
||||||
<edit-work @setDialogVisible="setDialogVisible" @addWork="addWork"></edit-work>
|
v-model="addVisible"
|
||||||
|
width="60%"
|
||||||
|
:show-close="false"
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
>
|
||||||
|
<edit-work
|
||||||
|
:workers="workers"
|
||||||
|
@setDialogVisible="setDialogVisible"
|
||||||
|
@addWork="addWork"
|
||||||
|
></edit-work>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
<el-dialog v-model="editVisible" width="60%">
|
<el-dialog
|
||||||
|
v-model="editVisible"
|
||||||
|
width="60%"
|
||||||
|
:show-close="false"
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
>
|
||||||
<edit-work
|
<edit-work
|
||||||
:editForm="rowData"
|
:editForm="rowData"
|
||||||
|
:workers="workers"
|
||||||
@setDialogVisible="setDialogVisible"
|
@setDialogVisible="setDialogVisible"
|
||||||
@updateWork="updateWork"
|
@updateWork="updateWork"
|
||||||
></edit-work>
|
></edit-work>
|
||||||
@@ -110,7 +131,8 @@ export default {
|
|||||||
addVisible: false,
|
addVisible: false,
|
||||||
editVisible: false,
|
editVisible: false,
|
||||||
loading: true,
|
loading: true,
|
||||||
searchContent: ''
|
searchContent: '',
|
||||||
|
workers: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -198,7 +220,7 @@ export default {
|
|||||||
return new Date(time).toLocaleString()
|
return new Date(time).toLocaleString()
|
||||||
},
|
},
|
||||||
searchByContent() {
|
searchByContent() {
|
||||||
request.get('/work', { content: this.searchContent }).then((res) => {
|
request.get('/work', { content: this.searchContent.trim() }).then((res) => {
|
||||||
const response = res.data
|
const response = res.data
|
||||||
if (response.code === DATABASE_SELECT_OK) {
|
if (response.code === DATABASE_SELECT_OK) {
|
||||||
this.tableData = response.data
|
this.tableData = response.data
|
||||||
@@ -212,10 +234,20 @@ export default {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
getWorkers() {
|
||||||
|
request.get('/user/department').then((res) => {
|
||||||
|
const response = res.data
|
||||||
|
if (response.code === DATABASE_SELECT_OK) {
|
||||||
|
this.workers = response.data
|
||||||
|
console.log(this.workers)
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
mounted() {
|
||||||
this.getTableData()
|
this.getTableData()
|
||||||
|
this.getWorkers()
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
EditWork
|
EditWork
|
||||||
|
|||||||
Reference in New Issue
Block a user