Merge branch 'master' of http://122.51.230.86:3000/dianliang/lanan-system-vue
This commit is contained in:
commit
781b5fb7f0
10
src/api/company/promotion/index.js
Normal file
10
src/api/company/promotion/index.js
Normal file
@ -0,0 +1,10 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 获取推广记录分页
|
||||
export function getBasePromotionPage(params) {
|
||||
return request({
|
||||
url: '/base/promotion/page',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
@ -67,3 +67,20 @@ export function getStaffList(){
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 验证工号是否重复
|
||||
export function checkWorkNo(workNo){
|
||||
return request({
|
||||
url: '/company/staff/checkWorkNo?workNo=' + workNo,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 重置密码
|
||||
export function resetPassword(data){
|
||||
return request({
|
||||
url: '/company/staff/resetPassword',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
@ -9,10 +9,11 @@ export function createStaffChange(data) {
|
||||
})
|
||||
}
|
||||
|
||||
// 获取企业管理-员工交接信息及交接双方信息
|
||||
export function getChangeStaff(id) {
|
||||
// 获取企业管理-员工交接信息分页
|
||||
export function getStaffChangePage(params) {
|
||||
return request({
|
||||
url: '/company/staffChange/changeItem?id=' + id,
|
||||
url: '/company/staffChange/page',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
@ -96,6 +96,10 @@ export const DICT_TYPE = {
|
||||
DICT_SYS_USER_SEX : 'system_user_sex',
|
||||
//客户状态
|
||||
DICT_CUS_INFO_STATUS : 'cus_info_status',
|
||||
//推广渠道
|
||||
PROMOTION_CHANNEL : 'promotion_channel',
|
||||
//用户类型
|
||||
SYSTEM_USER_TYPE : 'system_user_type',
|
||||
|
||||
// ------- carMain模块 -------
|
||||
//车辆性质
|
||||
@ -118,6 +122,10 @@ export const DICT_TYPE = {
|
||||
// ------- 企业管理模块 -------
|
||||
// 员工学历
|
||||
COMPANY_STAFF_EDU: 'company_staff_edu',
|
||||
// 员工工作交接状态
|
||||
STAFF_CHANGE_STATUS: 'staff_change_status',
|
||||
// 员工工作交接类型
|
||||
STAFF_CHANGE_TYPE: 'staff_change_type',
|
||||
|
||||
// ------- 资产管理模块 -------
|
||||
//资产处置方式
|
||||
|
@ -58,12 +58,12 @@
|
||||
<el-row :gutter="2">
|
||||
<el-col :span="12">
|
||||
<el-form-item v-if="formData.id === undefined" label="管理员登录账号" prop="loginAccount">
|
||||
<el-input v-model="formData.loginAccount" placeholder="请输入管理员登录账号" />
|
||||
<el-input v-model="formData.loginAccount" placeholder="请输入管理员登录账号" maxlength="16" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item v-if="formData.id === undefined" label="管理员登录密码" prop="password">
|
||||
<el-input v-model="formData.password" placeholder="请输入管理员登录密码" type="password" show-password />
|
||||
<el-input v-model="formData.password" placeholder="请输入管理员登录密码" type="password" maxlength="16" show-password />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -148,8 +148,18 @@ export default {
|
||||
{ required: true, message: '联系方式不能为空', trigger: 'blur' },
|
||||
{ pattern: /^(?:(?:\+|00)86)?1(?:3[\d]|4[5-79]|5[0-35-9]|6[5-7]|7[0-8]|8[\d]|9[189])\d{8}$/,message: '请输入正确的联系方式', trigger: ["blur", "change"] },
|
||||
],
|
||||
loginAccount: [{ required: true, message: '管理员登录账号不能为空', trigger: 'blur' }],
|
||||
password: [{ required: true, message: '管理员登录密码不能为空', trigger: 'blur' }]
|
||||
loginAccount: [{ required: true, message: '管理员登录账号不能为空', trigger: 'blur' }, {
|
||||
min: 4,
|
||||
max: 16,
|
||||
message: '管理员登录账号长度在4到16个字符',
|
||||
trigger: 'blur'
|
||||
}],
|
||||
password: [{ required: true, message: '管理员登录密码不能为空', trigger: 'blur' }, {
|
||||
min: 4,
|
||||
max: 16,
|
||||
message: '管理员登录密码长度在4到16个字符',
|
||||
trigger: 'blur'
|
||||
}]
|
||||
}
|
||||
}
|
||||
},
|
||||
|
128
src/views/company/promotion/form/PromotionData.vue
Normal file
128
src/views/company/promotion/form/PromotionData.vue
Normal file
@ -0,0 +1,128 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="60%" v-dialogDrag append-to-body>
|
||||
<el-descriptions class="margin-top" title="推广人信息" :column="3" border>
|
||||
<el-descriptions-item>
|
||||
<template slot="label">
|
||||
<i class="el-icon-user"></i>
|
||||
推广人姓名
|
||||
</template>
|
||||
{{ formData.oldUserName }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template slot="label">
|
||||
<i class="el-icon-mobile-phone"></i>
|
||||
推广人电话
|
||||
</template>
|
||||
{{ formData.oldUser.mobile }}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
|
||||
<el-descriptions class="margin-top" title="被推广人信息" :column="3" border>
|
||||
<el-descriptions-item>
|
||||
<template slot="label">
|
||||
<i class="el-icon-user"></i>
|
||||
推广人姓名
|
||||
</template>
|
||||
{{ formData.newUserName }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template slot="label">
|
||||
<i class="el-icon-mobile-phone"></i>
|
||||
推广人电话
|
||||
</template>
|
||||
{{ formData.newUser.mobile }}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
|
||||
<el-descriptions class="margin-top" title="推广记录" :column="2" border>
|
||||
<el-descriptions-item>
|
||||
<template slot="label">
|
||||
<i class="el-icon-star-off"></i>
|
||||
推广渠道
|
||||
</template>
|
||||
<dict-tag :type="DICT_TYPE.PROMOTION_CHANNEL" :value="formData.promotionChannel"/>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template slot="label">
|
||||
<i class="el-icon-collection"></i>
|
||||
推广人推广码
|
||||
</template>
|
||||
{{ formData.uniqueCode }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template slot="label">
|
||||
<i class="el-icon-timer"></i>
|
||||
被推广人注册时间
|
||||
</template>
|
||||
{{ formData.registerTime }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template slot="label">
|
||||
<i class="el-icon-place"></i>
|
||||
推广人角色
|
||||
</template>
|
||||
<dict-tag :type="DICT_TYPE.SYSTEM_USER_TYPE" :value="formData.oldUser.userType"/>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'PromotionData',
|
||||
data(){
|
||||
return{
|
||||
// 弹出层标题
|
||||
dialogTitle: '推广记录查看',
|
||||
// 是否显示弹出层
|
||||
dialogVisible: false,
|
||||
formData:{
|
||||
oldUser: {
|
||||
mobile: null,
|
||||
},
|
||||
newUser: {
|
||||
mobile: null,
|
||||
},
|
||||
oldUserName: null,
|
||||
newUserName: null,
|
||||
promotionChannel: null,
|
||||
uniqueCode: null,
|
||||
registerTime: null,
|
||||
userType: null
|
||||
},
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
/** 打开弹窗 */
|
||||
async open(row) {
|
||||
this.reset()
|
||||
this.formData = row
|
||||
this.dialogVisible = true
|
||||
},
|
||||
/** 表单重置 */
|
||||
reset() {
|
||||
this.formData = {
|
||||
oldUser: {
|
||||
mobile: null,
|
||||
},
|
||||
newUser: {
|
||||
mobile: null,
|
||||
},
|
||||
oldUserName: null,
|
||||
newUserName: null,
|
||||
promotionChannel: null,
|
||||
uniqueCode: null,
|
||||
registerTime: null,
|
||||
userType: null
|
||||
}
|
||||
this.resetForm('formRef')
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
155
src/views/company/promotion/index.vue
Normal file
155
src/views/company/promotion/index.vue
Normal file
@ -0,0 +1,155 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- 搜索工作栏 -->
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="140px">
|
||||
<el-form-item label="推广人姓名" prop="oldUserName">
|
||||
<el-input v-model="queryParams.oldUserName" placeholder="请输入推广人姓名" clearable @keyup.enter.native="handleQuery"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="推广人角色" prop="userType">
|
||||
<el-select v-model="queryParams.userType" placeholder="请选择推广人角色" clearable size="small">
|
||||
<el-option
|
||||
v-for="dict in this.getDictDatas(DICT_TYPE.SYSTEM_USER_TYPE)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="推广人推广码" prop="uniqueCode">
|
||||
<el-input v-model="queryParams.uniqueCode" placeholder="请输入推广人推广码" clearable @keyup.enter.native="handleQuery"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="被推广人姓名" prop="newUserName">
|
||||
<el-input v-model="queryParams.newUserName" placeholder="请输入被推广人姓名" clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="推广渠道" prop="promotionChannel">
|
||||
<el-select v-model="queryParams.promotionChannel" placeholder="请选择推广渠道" clearable size="small">
|
||||
<el-option
|
||||
v-for="dict in this.getDictDatas(DICT_TYPE.PROMOTION_CHANNEL)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="被推广人注册时间" prop="registerTimeArray">
|
||||
<el-date-picker v-model="queryParams.registerTimeArray" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss"
|
||||
type="daterange"
|
||||
range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"
|
||||
:default-time="['00:00:00', '23:59:59']"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
||||
<el-table-column label="序号" align="center">
|
||||
<template scope="scope">
|
||||
<span>{{ scope.$index + 1 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="推广人姓名" align="center" prop="oldUserName" width="180" />
|
||||
<el-table-column label="推广人电话" align="center" prop="oldUser.mobile" width="180" />
|
||||
<el-table-column label="推广人角色" align="center" prop="oldUser.userType" width="180">
|
||||
<template v-slot="scope">
|
||||
<dict-tag :type="DICT_TYPE.SYSTEM_USER_TYPE" :value="scope.row.oldUser.userType"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="推广人推广码" align="center" prop="uniqueCode" width="180" />
|
||||
<el-table-column label="推广渠道" align="center" prop="promotionChannel" width="180">
|
||||
<template v-slot="scope">
|
||||
<dict-tag :type="DICT_TYPE.PROMOTION_CHANNEL" :value="scope.row.promotionChannel"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="被推广人姓名" align="center" prop="newUserName" width="180" />
|
||||
<el-table-column label="被推广人电话" align="center" prop="newUser.mobile" width="180" />
|
||||
<el-table-column label="被推广人注册时间" align="center" prop="registerTime" width="180" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="180">
|
||||
<template v-slot="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-search" @click="openForm(scope.row)"
|
||||
>列表查看
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<!-- 分页组件 -->
|
||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<PromotionData ref="promotionData" @success="getList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import * as PromotionApi from '@/api/company/promotion'
|
||||
import PromotionData from '@/views/company/promotion/form/PromotionData'
|
||||
|
||||
export default {
|
||||
name: 'Promotion',
|
||||
components: {
|
||||
PromotionData
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
oldUserName: null,
|
||||
promotionChannel: null,
|
||||
newUserName: null,
|
||||
registerTimeArray: null,
|
||||
uniqueCode: null,
|
||||
userType: null
|
||||
},
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
total: 0,
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
list:[],
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
/** 查询列表 */
|
||||
async getList() {
|
||||
try {
|
||||
this.loading = true
|
||||
const res = await PromotionApi.getBasePromotionPage(this.queryParams)
|
||||
this.list = res.data.records
|
||||
this.total = res.data.total
|
||||
} finally {
|
||||
this.loading = false
|
||||
}
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNo = 1
|
||||
this.getList()
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm('queryForm')
|
||||
this.handleQuery()
|
||||
},
|
||||
/** 列表查看操作 */
|
||||
openForm(row) {
|
||||
this.$refs['promotionData'].open(row)
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
@ -3,27 +3,34 @@
|
||||
<!-- 对话框(添加 / 修改) -->
|
||||
<el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="45%" v-dialogDrag append-to-body>
|
||||
<el-form ref="formRef" :model="formData" :rules="formRules" v-loading="formLoading" label-width="100px">
|
||||
<el-form-item label="企业id(base_company表中的id)" prop="corpId">
|
||||
<el-input v-model="formData.corpId" placeholder="请输入企业id(base_company表中的id)" />
|
||||
</el-form-item>
|
||||
<el-form-item label="部门id(system_dept表中的id,用来做数据权限控制)" prop="deptId">
|
||||
<el-input v-model="formData.deptId" placeholder="请输入部门id(system_dept表中的id,用来做数据权限控制)" />
|
||||
</el-form-item>
|
||||
<el-form-item label="存放地名称" prop="posName">
|
||||
<el-input v-model="formData.posName" placeholder="请输入存放地名称" />
|
||||
</el-form-item>
|
||||
<el-row :gutter="2">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="存放地名称" prop="posName">
|
||||
<el-input v-model="formData.posName" placeholder="请输入存放地名称"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="存放类型" prop="depositType">
|
||||
<el-select v-model="formData.depositType" placeholder="请选择存放类型">
|
||||
<el-option v-for="dict in this.getDictDatas(DICT_TYPE.COMPANY_DEPOSIT_TYPE)" :key="dict.value"
|
||||
:label="dict.label" :value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="2">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="面积" prop="area">
|
||||
<el-input type="number" v-model="formData.area" placeholder="请输入面积">
|
||||
<template slot="append">㎡</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item label="存放地地址" prop="address">
|
||||
<el-input v-model="formData.address" placeholder="请输入存放地地址" />
|
||||
</el-form-item>
|
||||
<el-form-item label="面积" prop="area">
|
||||
<el-input v-model="formData.area" placeholder="请输入面积" />
|
||||
</el-form-item>
|
||||
<el-form-item label="存放类型" prop="depositType">
|
||||
<el-select v-model="formData.depositType" placeholder="请选择存放类型">
|
||||
<el-option v-for="dict in this.getDictDatas(DICT_TYPE.COMPANY_DEPOSIT_TYPE)" :key="dict.value"
|
||||
:label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm" :disabled="formLoading">确 定</el-button>
|
||||
@ -60,6 +67,10 @@ export default {
|
||||
},
|
||||
// 表单校验
|
||||
formRules: {
|
||||
posName: [{ required: true, message: '存放地名称不能为空', trigger: 'blur' }],
|
||||
depositType: [{ required: true, message: '存放类型不能为空', trigger: 'blur' }],
|
||||
area: [{ required: true, message: '面积不能为空', trigger: 'blur' }],
|
||||
address: [{ required: true, message: '存放地地址不能为空', trigger: 'blur' }],
|
||||
},
|
||||
};
|
||||
},
|
||||
@ -74,12 +85,12 @@ export default {
|
||||
try {
|
||||
const res = await PropertyPosApi.getPropertyPos(id);
|
||||
this.formData = res.data;
|
||||
this.title = "修改企业管理-资产存放位置";
|
||||
this.dialogTitle = "修改资产存放位置";
|
||||
} finally {
|
||||
this.formLoading = false;
|
||||
}
|
||||
}
|
||||
this.title = "新增企业管理-资产存放位置";
|
||||
this.dialogTitle = "新增资产存放位置";
|
||||
},
|
||||
/** 提交按钮 */
|
||||
async submitForm() {
|
||||
|
@ -2,34 +2,18 @@
|
||||
<div class="app-container">
|
||||
<!-- 搜索工作栏 -->
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<!-- <el-form-item label="企业id" prop="corpId">
|
||||
<el-input v-model="queryParams.corpId" placeholder="请输入企业id(base_company表中的id)" clearable
|
||||
@keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="部门id" prop="deptId">
|
||||
<el-input v-model="queryParams.deptId" placeholder="请输入部门id" clearable
|
||||
@keyup.enter.native="handleQuery" />
|
||||
</el-form-item> -->
|
||||
<el-form-item label="存放地名称" prop="posName" label-width="100">
|
||||
<el-input v-model="queryParams.posName" placeholder="请输入存放地名称" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="存放地地址" prop="address" label-width="100">
|
||||
<el-input v-model="queryParams.address" placeholder="请输入存放地地址" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="面积" prop="area">
|
||||
<el-input v-model="queryParams.area" placeholder="请输入面积" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="存放类型" prop="depositType" label-width="60">
|
||||
<el-select v-model="queryParams.depositType" placeholder="请选择存放类型" clearable size="small">
|
||||
<el-option v-for="dict in this.getDictDatas(DICT_TYPE.COMPANY_DEPOSIT_TYPE)" :key="dict.value"
|
||||
:label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" prop="createTime" label-width="60">
|
||||
<el-date-picker v-model="queryParams.createTime" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss"
|
||||
type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"
|
||||
:default-time="['00:00:00', '23:59:59']" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
||||
@ -42,10 +26,6 @@
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="openForm(undefined)"
|
||||
v-hasPermi="['company:property-pos:create']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
|
||||
:loading="exportLoading" v-hasPermi="['company:property-pos:export']">导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
@ -56,8 +36,7 @@
|
||||
}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="企业id(base_company表中的id)" align="center" prop="corpId" />
|
||||
<el-table-column label="部门id(system_dept表中的id,用来做数据权限控制)" align="center" prop="deptId" /> -->
|
||||
<el-table-column label="所属企业" align="center" prop="corpName" />
|
||||
<el-table-column label="存放地名称" align="center" prop="posName" />
|
||||
<el-table-column label="存放地地址" align="center" prop="address" />
|
||||
<el-table-column label="面积" align="center" prop="area" />
|
||||
@ -66,11 +45,6 @@
|
||||
<dict-tag :type="DICT_TYPE.COMPANY_DEPOSIT_TYPE" :value="scope.row.depositType" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
|
||||
<template v-slot="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column fixed="right" label="操作" align="center" class-name="small-padding fixed-width" width="200">
|
||||
<template v-slot="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="openForm(scope.row.id)"
|
||||
@ -118,13 +92,9 @@ export default {
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
corpId: null,
|
||||
deptId: null,
|
||||
posName: null,
|
||||
address: null,
|
||||
area: null,
|
||||
depositType: null,
|
||||
createTime: [],
|
||||
},
|
||||
};
|
||||
},
|
||||
|
@ -10,27 +10,36 @@
|
||||
<el-select
|
||||
v-model="formData.newUserId"
|
||||
placeholder="请选择接收方"
|
||||
filterable
|
||||
style="width: 100%"
|
||||
clearable
|
||||
:filter-method="searchOption"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in newStaff"
|
||||
:key="index"
|
||||
v-for="item in options"
|
||||
:key="item.userId"
|
||||
:label="item.name"
|
||||
:value="item.userId"
|
||||
>
|
||||
<div class="options">
|
||||
<span>姓名:{{ item.name }}</span>
|
||||
<span>工号:{{ item.workNo }}</span>
|
||||
<span>手机:{{ item.tel }}</span>
|
||||
</div>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="附件" prop="fileUrls">
|
||||
<file-upload v-model="formData.fileUrls"></file-upload>
|
||||
</el-form-item>
|
||||
<el-form-item label="交接时间" prop="changeTime">
|
||||
<el-date-picker clearable v-model="formData.changeTime" type="datetime" value-format="timestamp"
|
||||
<el-date-picker clearable v-model="formData.changeTime" type="date" value-format="timestamp"
|
||||
placeholder="选择交接时间"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="formData.remark"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="附件" prop="fileUrls">
|
||||
<file-upload v-model="formData.fileUrls"></file-upload>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm" :disabled="formLoading">确 定</el-button>
|
||||
@ -69,17 +78,15 @@ export default {
|
||||
// 表单校验
|
||||
formRules: {
|
||||
newUserId: [{ required: true, message: '接收方不能为空', trigger: 'blur' }],
|
||||
changeDate: [{ required: true, message: '接收方不能为空', trigger: 'blur' }]
|
||||
changeTime: [{ required: true, message: '交接时间不能为空', trigger: 'blur' }]
|
||||
},
|
||||
oldStaff: {
|
||||
name: '',
|
||||
userId: ''
|
||||
},
|
||||
newStaff: {
|
||||
name: '',
|
||||
userId: ''
|
||||
},
|
||||
staffChangList: []
|
||||
newStaff: [],
|
||||
staffChangList: [],
|
||||
options: [],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@ -87,19 +94,21 @@ export default {
|
||||
async listStaff() {
|
||||
const res = await StaffApi.getStaffList()
|
||||
this.newStaff = res.data.filter(item => item.userId !== this.oldStaff.userId)
|
||||
this.options = this.newStaff
|
||||
},
|
||||
/** 打开弹窗 */
|
||||
async open(id) {
|
||||
this.dialogVisible = true
|
||||
this.reset()
|
||||
const res = await StaffApi.getStaff(id)
|
||||
this.oldStaff = res.data
|
||||
this.formData.oldUserId = this.oldStaff.userId
|
||||
this.formData.changeTime = new Date()
|
||||
await this.listStaff()
|
||||
this.dialogVisible = true
|
||||
},
|
||||
/** 提交按钮 */
|
||||
async submitForm() {
|
||||
// 校验主表
|
||||
// // 校验主表
|
||||
await this.$refs['formRef'].validate()
|
||||
this.formLoading = true
|
||||
try {
|
||||
@ -117,10 +126,25 @@ export default {
|
||||
fileUrls: undefined,
|
||||
remark: undefined,
|
||||
oldUserId: undefined,
|
||||
newUserId: undefined
|
||||
newUserId: undefined,
|
||||
changeTime: undefined
|
||||
}
|
||||
this.resetForm('formRef')
|
||||
},
|
||||
searchOption(val) {
|
||||
this.options = this.newStaff.filter(item => (
|
||||
item.name.toLowerCase().includes(val.toLowerCase()) ||
|
||||
item.workNo.includes(val) ||
|
||||
item.tel.includes(val)
|
||||
))
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.options {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
</style>
|
||||
|
@ -6,7 +6,7 @@
|
||||
<el-row :gutter="2">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="工号" prop="workNo">
|
||||
<el-input v-model="formData.workNo" placeholder="请输入工号"/>
|
||||
<el-input :disabled="!!formData.id" v-model="formData.workNo" placeholder="请输入工号"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
@ -25,82 +25,93 @@
|
||||
<el-form-item label="性别" prop="sex">
|
||||
<el-radio-group v-model="formData.sex">
|
||||
<el-radio v-for="dict in this.getDictDatas(DICT_TYPE.SYSTEM_USER_SEX)"
|
||||
:key="dict.value" :label="dict.value">{{dict.label}}</el-radio>
|
||||
:key="dict.value" :label="dict.value"
|
||||
>{{ dict.label }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="2">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="家庭住址" prop="address">
|
||||
<el-input v-model="formData.address" placeholder="请输入家庭住址"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="工龄" prop="workYear">
|
||||
<el-input v-model="formData.workYear" placeholder="请输入工龄"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="2">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="司龄" prop="joinedYear">
|
||||
<el-input v-model="formData.joinedYear" placeholder="请输入司龄"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="学历" prop="education">
|
||||
<el-select v-model="formData.education" placeholder="请选择学历">
|
||||
<el-option v-for="dict in this.getDictDatas(DICT_TYPE.COMPANY_STAFF_EDU)"
|
||||
:key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="2">
|
||||
<el-col :span="12">
|
||||
<el-form-item v-if="formData.id === undefined" label="登录账号" prop="loginAccount">
|
||||
<el-input v-model="formData.loginAccount" placeholder="请输入登录账号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item v-if="formData.id === undefined" label="登录密码" prop="password">
|
||||
<el-input v-model="formData.password" placeholder="请输入登录密码" type="password" show-password />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="2">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="工作日期" prop="workDate">
|
||||
<el-date-picker clearable v-model="formData.workDate" type="date" value-format="timestamp"
|
||||
placeholder="选择工作日期"
|
||||
@blur="getWorkYear"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="入职日期" prop="joinedDate">
|
||||
<el-date-picker clearable v-model="formData.joinedDate" type="date" value-format="timestamp"
|
||||
placeholder="选择入职日期"
|
||||
/>
|
||||
<el-form-item label="工龄(年)" prop="workYear">
|
||||
<el-input disabled v-model="formData.workYear" placeholder="工龄"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="2">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="入职日期" prop="joinedDate">
|
||||
<el-date-picker clearable v-model="formData.joinedDate" type="date" value-format="timestamp"
|
||||
placeholder="选择入职日期"
|
||||
@blur="getJoinedYear"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="司龄(年)" prop="joinedYear">
|
||||
<el-input disabled v-model="formData.joinedYear" placeholder="司龄"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="2">
|
||||
<el-col :span="12">
|
||||
<el-form-item v-if="formData.id === undefined" label="登录账号" prop="loginAccount">
|
||||
<el-input v-model="formData.loginAccount" placeholder="请输入登录账号" maxlength="16" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item v-if="formData.id === undefined" label="登录密码" prop="password">
|
||||
<el-input v-model="formData.password" placeholder="请输入登录密码" type="password" maxlength="16" show-password />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="2">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="学历" prop="education">
|
||||
<el-select v-model="formData.education" placeholder="请选择学历">
|
||||
<el-option v-for="dict in this.getDictDatas(DICT_TYPE.COMPANY_STAFF_EDU)"
|
||||
:key="dict.value" :label="dict.label" :value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item label="家庭住址" prop="address">
|
||||
<el-input v-model="formData.address" placeholder="请输入家庭住址"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="技能标签" prop="labelsArray">
|
||||
<el-select
|
||||
style="width: 310px"
|
||||
style="width: 100%"
|
||||
filterable
|
||||
allow-create
|
||||
v-model="formData.labelsArray" multiple placeholder="请选择技能标签">
|
||||
v-model="formData.labelsArray" multiple placeholder="请选择技能标签"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in labelOptions"
|
||||
:key="index"
|
||||
:label="item.labelName"
|
||||
:value="item.labelName">
|
||||
:value="item.labelName"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="个人简介">
|
||||
<Editor v-model="formData.content" :min-height="192"/>
|
||||
<el-form-item label="个人简介" prop="content">
|
||||
<el-input
|
||||
type="textarea"
|
||||
:autosize="{ minRows: 2, maxRows: 5}"
|
||||
placeholder="请输入内容"
|
||||
v-model="formData.content"
|
||||
>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="附件" prop="fileUrls">
|
||||
<file-upload v-model="formData.fileUrls"></file-upload>
|
||||
@ -126,6 +137,10 @@ export default {
|
||||
FileUpload
|
||||
},
|
||||
data() {
|
||||
const validateWorkNo = async(rule, value, callback) => {
|
||||
const res = await StaffApi.checkWorkNo(value)
|
||||
return res.data ? callback() : !this.formData.id ? callback(new Error()) : callback
|
||||
}
|
||||
return {
|
||||
// 弹出层标题
|
||||
dialogTitle: '',
|
||||
@ -142,7 +157,7 @@ export default {
|
||||
workNo: undefined,
|
||||
name: undefined,
|
||||
tel: undefined,
|
||||
sex: undefined,
|
||||
sex: "1",
|
||||
address: undefined,
|
||||
workDate: undefined,
|
||||
workYear: undefined,
|
||||
@ -154,47 +169,68 @@ export default {
|
||||
fileUrls: undefined,
|
||||
loginAccount: undefined,
|
||||
password: undefined,
|
||||
labelsArray: undefined,
|
||||
labelsArray: undefined
|
||||
},
|
||||
// 表单校验
|
||||
formRules: {
|
||||
workNo: [{required: true, message: "工号不能为空", trigger: 'blur'}],
|
||||
name: [{required: true, message: "姓名不能为空", trigger: 'blur'}],
|
||||
tel: [
|
||||
{required: true, message: "手机号不能为空", trigger: 'blur'},
|
||||
{ pattern: /^(?:(?:\+|00)86)?1(?:3[\d]|4[5-79]|5[0-35-9]|6[5-7]|7[0-8]|8[\d]|9[189])\d{8}$/,message: '请输入正确的手机号', trigger: ["blur", "change"] },
|
||||
workNo: [
|
||||
{ required: true, message: '工号不能为空', trigger: 'blur' },
|
||||
{ validator: validateWorkNo, message: '工号已存在', trigger: 'blur' }
|
||||
],
|
||||
name: [{ required: true, message: '姓名不能为空', trigger: 'blur' }],
|
||||
tel: [
|
||||
{ required: true, message: '手机号不能为空', trigger: 'blur' },
|
||||
{
|
||||
pattern: /^(?:(?:\+|00)86)?1(?:3[\d]|4[5-79]|5[0-35-9]|6[5-7]|7[0-8]|8[\d]|9[189])\d{8}$/,
|
||||
message: '请输入正确的手机号',
|
||||
trigger: ['blur', 'change']
|
||||
}
|
||||
],
|
||||
sex: [{ required: true, message: '性别不能为空', trigger: 'blur' }],
|
||||
address: [{ required: true, message: '家庭住址不能为空', trigger: 'blur' }],
|
||||
workYear: [{ required: true, message: '工龄不能为空', trigger: 'blur' }],
|
||||
joinedYear: [{ required: true, message: '司龄不能为空', trigger: 'blur' }],
|
||||
education: [{ required: true, message: '学历不能为空', trigger: 'blur' }],
|
||||
loginAccount: [
|
||||
{ required: true, message: '登录账号不能为空', trigger: 'blur' },
|
||||
{ min: 6, max: 20, message: '登录账号长度在6~20个字符', trigger: 'blur'}
|
||||
],
|
||||
password: [
|
||||
{ required: true, message: '登录密码不能为空', trigger: 'blur' },
|
||||
{ min: 6, max: 20, message: "登录密码长度在6~20个字符", trigger: 'blur'},
|
||||
{
|
||||
pattern: /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[!@#$%^&*()_+{}\[\]:;<>,.?~\\-])\S{6,}$/,
|
||||
message: '登录密码必须由大小写字母、数字、特殊字符组成',
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
sex: [{required: true, message: "性别不能为空", trigger: 'blur'}],
|
||||
address: [{required: true, message: "家庭住址不能为空", trigger: 'blur'}],
|
||||
workYear: [{required: true, message: "工龄不能为空", trigger: 'blur'}],
|
||||
joinedYear: [{required: true, message: "司龄不能为空", trigger: 'blur'}],
|
||||
education: [{required: true, message: "学历不能为空", trigger: 'blur'}],
|
||||
loginAccount: [{ required: true, message: '登录账号不能为空', trigger: 'blur' }],
|
||||
password: [{ required: true, message: '登录密码不能为空', trigger: 'blur' }],
|
||||
workDate: [{ required: true, message: '工作日期不能为空', trigger: 'blur' }],
|
||||
joinedDate: [{ required: true, message: '入职日期不能为空', trigger: 'blur' }],
|
||||
joinedDate: [{ required: true, message: '入职日期不能为空', trigger: 'blur' }]
|
||||
},
|
||||
labelOptions:[],
|
||||
labelOptions: [],
|
||||
nowDate: new Date()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/** 获取标签 */
|
||||
async listLabels(){
|
||||
async listLabels() {
|
||||
try {
|
||||
const res = await StaffApi.getLabels();
|
||||
const res = await StaffApi.getLabels()
|
||||
this.labelOptions = res.data.map(item => ({
|
||||
labelName: item.labelName,
|
||||
labelName: item.labelName
|
||||
}))
|
||||
}finally {}
|
||||
} finally {
|
||||
}
|
||||
},
|
||||
/** 打开弹窗 */
|
||||
async open(id) {
|
||||
this.dialogVisible = true
|
||||
this.dialogTitle = id ? "修改员工信息" : "新增员工信息"
|
||||
await this.listLabels();
|
||||
this.dialogTitle = id ? '修改员工信息' : '新增员工信息'
|
||||
await this.listLabels()
|
||||
this.reset()
|
||||
// 修改时,设置数据
|
||||
if (id) {
|
||||
this.formData.id = id;
|
||||
this.formLoading = true
|
||||
try {
|
||||
const res = await StaffApi.getStaff(id)
|
||||
@ -242,7 +278,7 @@ export default {
|
||||
workNo: undefined,
|
||||
name: undefined,
|
||||
tel: undefined,
|
||||
sex: undefined,
|
||||
sex: "1",
|
||||
address: undefined,
|
||||
workDate: undefined,
|
||||
workYear: undefined,
|
||||
@ -256,7 +292,30 @@ export default {
|
||||
password: undefined
|
||||
}
|
||||
this.resetForm('formRef')
|
||||
}
|
||||
},
|
||||
// 获取工龄
|
||||
getWorkYear(){
|
||||
this.formData.workYear = this.getYearsByDate(this.formData.workDate);
|
||||
},
|
||||
// 获取司龄
|
||||
getJoinedYear(){
|
||||
this.formData.joinedYear = this.getYearsByDate(this.formData.joinedDate);
|
||||
},
|
||||
// 计算输入日期至今隔了多少年
|
||||
getYearsByDate(date) {
|
||||
if (!date) {
|
||||
return '0'
|
||||
}
|
||||
const inputDate = new Date(date)
|
||||
let years = this.nowDate.getFullYear() - inputDate.getFullYear()
|
||||
if (
|
||||
this.nowDate.getMonth() < inputDate.getMonth() ||
|
||||
(this.nowDate.getMonth() === inputDate.getMonth() && this.nowDate.getDate() < inputDate.getDate())
|
||||
) {
|
||||
years--
|
||||
}
|
||||
return years >= 0 ? years : '0'
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
107
src/views/company/staff/form/StaffResetPassword.vue
Normal file
107
src/views/company/staff/form/StaffResetPassword.vue
Normal file
@ -0,0 +1,107 @@
|
||||
<template>
|
||||
<el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="40%" v-dialogDrag append-to-body>
|
||||
<el-form ref="formRef" :model="formData" :rules="formRules" v-loading="formLoading" label-width="100px">
|
||||
<el-form-item label="姓名" prop="name">
|
||||
<el-input v-model="formData.name" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="工号" prop="workNo">
|
||||
<el-input v-model="formData.workNo" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="电话" prop="tel">
|
||||
<el-input v-model="formData.tel" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="新密码" prop="password">
|
||||
<el-input type="password" v-model="formData.password" show-password placeholder="请输入新密码"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="确认新密码" prop="newPassword">
|
||||
<el-input type="password" v-model="formData.newPassword" show-password placeholder="确认新密码"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm" :disabled="formLoading">确 定</el-button>
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import * as StaffApi from '@/api/company/staff'
|
||||
|
||||
export default {
|
||||
name: 'StaffResetPassword',
|
||||
data() {
|
||||
const validatePassword= async(rule, value, callback) => {
|
||||
return this.formData.password === value ? callback() : callback(new Error());
|
||||
}
|
||||
return {
|
||||
// 弹出层标题
|
||||
dialogTitle: '重置员工密码',
|
||||
// 是否显示弹出层
|
||||
dialogVisible: false,
|
||||
// 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
formLoading: false,
|
||||
formData: {
|
||||
name: undefined,
|
||||
workNo: undefined,
|
||||
tel: undefined,
|
||||
password: undefined,
|
||||
newPassword: undefined,
|
||||
userId: undefined
|
||||
},
|
||||
formRules:{
|
||||
password: [
|
||||
{ required: true, message: '登录密码不能为空', trigger: 'blur' },
|
||||
{ min: 6, max: 20, message: "登录密码长度在6~20个字符", trigger: 'blur'},
|
||||
{
|
||||
pattern: /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[!@#$%^&*()_+{}\[\]:;<>,.?~\\-])\S{6,}$/,
|
||||
message: '登录密码必须由大小写字母、数字、特殊字符组成',
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
newPassword: [
|
||||
{required: true, message: "登录密码不能为空", trigger: "blur"},
|
||||
{validator: validatePassword, message: '再次输入的密码不一致', trigger: 'blur'}
|
||||
]
|
||||
},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/** 表单重置 */
|
||||
reset() {
|
||||
this.formData = {
|
||||
name: undefined,
|
||||
workNo: undefined,
|
||||
tel: undefined,
|
||||
password: undefined,
|
||||
newPassword: undefined,
|
||||
userId: undefined,
|
||||
}
|
||||
this.resetForm('formRef')
|
||||
},
|
||||
/** 打开弹窗 */
|
||||
async open(row) {
|
||||
this.dialogVisible = true
|
||||
this.reset();
|
||||
this.formData = row
|
||||
},
|
||||
/** 提交表单 */
|
||||
async submitForm() {
|
||||
// 校验主表
|
||||
await this.$refs['formRef'].validate()
|
||||
this.formLoading = true
|
||||
try{
|
||||
await StaffApi.resetPassword(this.formData)
|
||||
this.$modal.msgSuccess('密码已重置')
|
||||
this.dialogVisible = false
|
||||
this.$emit('success')
|
||||
} finally {
|
||||
this.formLoading = false
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
@ -90,18 +90,18 @@
|
||||
<dict-tag :type="DICT_TYPE.SYSTEM_USER_SEX" :value="scope.row.sex"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="家庭住址" align="center" prop="address" width="180"/>
|
||||
<el-table-column label="工龄" align="center" prop="workYear" width="180"/>
|
||||
<el-table-column label="司龄" align="center" prop="joinedYear" width="180"/>
|
||||
<el-table-column :show-overflow-tooltip="true" label="家庭住址" align="center" prop="address" width="180"/>
|
||||
<el-table-column label="工作日期" align="center" prop="workDate" width="180"/>
|
||||
<el-table-column label="工龄(年)" align="center" prop="workYear" width="180"/>
|
||||
<el-table-column label="入职日期" align="center" prop="joinedDate" width="180"/>
|
||||
<el-table-column label="司龄(年)" align="center" prop="joinedYear" width="180"/>
|
||||
<el-table-column label="学历" align="center" prop="education" width="180">
|
||||
<template v-slot="scope">
|
||||
<dict-tag :type="DICT_TYPE.COMPANY_STAFF_EDU" :value="scope.row.education"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="个人简介" align="center" prop="content" width="180"/>
|
||||
<el-table-column :show-overflow-tooltip="true" label="个人简介" align="center" prop="content" width="180"/>
|
||||
<el-table-column label="唯一推广码" align="center" prop="uniqueCode" width="180"/>
|
||||
<el-table-column label="工作日期" align="center" prop="workDate" width="180"/>
|
||||
<el-table-column label="入职日期" align="center" prop="joinedDate" width="180"/>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="180">
|
||||
<template v-slot="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="openForm(scope.row.id)"
|
||||
@ -125,6 +125,10 @@
|
||||
v-hasPermi="['company:staff:query']"
|
||||
>查看交接记录
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item command="handleResetPassword" size="mini" type="text" icon="el-icon-refresh"
|
||||
v-hasPermi="['company:staff:resetPassword']"
|
||||
>重置密码
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</template>
|
||||
@ -137,7 +141,7 @@
|
||||
<!-- 对话框(添加 / 修改) -->
|
||||
<StaffForm ref="formRef" @success="getList"/>
|
||||
<StaffChangeForm ref="staffChangeRef" @success="getList"/>
|
||||
<StaffChangeFormData ref="staffChangeDataRef" @success="getList" />
|
||||
<StaffResetPassword ref="staffResetPassword" @success="getList"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -145,14 +149,14 @@
|
||||
import * as StaffApi from '@/api/company/staff'
|
||||
import StaffForm from './form/StaffForm.vue'
|
||||
import StaffChangeForm from './form/StaffChangeForm'
|
||||
import StaffChangeFormData from './form/StaffChangeFormData'
|
||||
import StaffResetPassword from './form/StaffResetPassword'
|
||||
|
||||
export default {
|
||||
name: 'Staff',
|
||||
components: {
|
||||
StaffForm,
|
||||
StaffChangeForm,
|
||||
StaffChangeFormData
|
||||
StaffResetPassword
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@ -209,6 +213,9 @@ export default {
|
||||
case 'handleStaffChangeData':
|
||||
this.handleStaffChangeData(row)
|
||||
break
|
||||
case 'handleResetPassword':
|
||||
this.handleResetPassword(row)
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
@ -219,7 +226,16 @@ export default {
|
||||
},
|
||||
/** 查看交接记录 */
|
||||
handleStaffChangeData(row) {
|
||||
this.$refs['staffChangeDataRef'].open(row.id)
|
||||
this.$router.push({
|
||||
path: '/company/staffChange',
|
||||
query: {
|
||||
data: JSON.stringify(row)
|
||||
}
|
||||
})
|
||||
},
|
||||
/** 重置密码 */
|
||||
handleResetPassword(row) {
|
||||
this.$refs['staffResetPassword'].open(row)
|
||||
},
|
||||
/** 查询列表 */
|
||||
async getList() {
|
||||
|
@ -1,8 +1,6 @@
|
||||
<template>
|
||||
<div id="app-container">
|
||||
<el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="60%" v-dialogDrag append-to-body>
|
||||
<el-empty v-if="!formData" description="暂无数据"/>
|
||||
<div v-else>
|
||||
<el-descriptions class="margin-top" title="交出方员工信息" :column="3" border>
|
||||
<el-descriptions-item>
|
||||
<template slot="label">
|
||||
@ -27,7 +25,7 @@
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template slot="label">
|
||||
<i :class="formData.oldStaff.sex == '0' ? 'el-icon-female' : 'el-icon-male'"></i>
|
||||
<i :class="formData.oldStaff.sex == '1' ? 'el-icon-female' : 'el-icon-male'"></i>
|
||||
性别
|
||||
</template>
|
||||
<dict-tag :type="DICT_TYPE.SYSTEM_USER_SEX" :value="formData.oldStaff.sex"/>
|
||||
@ -65,7 +63,7 @@
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template slot="label">
|
||||
<i :class="formData.newStaff.sex == '0' ? 'el-icon-female' : 'el-icon-male'"></i>
|
||||
<i :class="formData.newStaff.sex == '1' ? 'el-icon-female' : 'el-icon-male'"></i>
|
||||
性别
|
||||
</template>
|
||||
<dict-tag :type="DICT_TYPE.SYSTEM_USER_SEX" :value="formData.newStaff.sex"/>
|
||||
@ -114,13 +112,11 @@
|
||||
</el-card>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import * as StaffChangeApi from '@/api/company/staffChange'
|
||||
|
||||
export default {
|
||||
name: 'StaffChangeFormData',
|
||||
@ -153,17 +149,15 @@ export default {
|
||||
fileUrl: ''
|
||||
}],
|
||||
remark: ''
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/** 打开弹窗 */
|
||||
async open(id) {
|
||||
this.dialogVisible = true
|
||||
async open(row) {
|
||||
this.reset()
|
||||
const res = await StaffChangeApi.getChangeStaff(id)
|
||||
this.formData = res.data
|
||||
if (!!this.formData) {
|
||||
this.formData = row
|
||||
if (this.formData && this.formData.fileUrls) {
|
||||
this.formData.fileUrls = this.formData.fileUrls.split(',').map(item => {
|
||||
return {
|
||||
fileName: item.split('/').pop(),
|
||||
@ -171,6 +165,7 @@ export default {
|
||||
}
|
||||
})
|
||||
}
|
||||
this.dialogVisible = true
|
||||
},
|
||||
/** 表单重置 */
|
||||
reset() {
|
174
src/views/company/staffChange/index.vue
Normal file
174
src/views/company/staffChange/index.vue
Normal file
@ -0,0 +1,174 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
|
||||
<!-- 搜索工作栏 -->
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="90px">
|
||||
<el-form-item label="姓名" prop="name">
|
||||
<el-input v-model="queryParams.name" placeholder="请输入姓名" clearable @keyup.enter.native="handleQuery"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="工号" prop="workNo">
|
||||
<el-input v-model="queryParams.workNo" placeholder="请输入工号" clearable @keyup.enter.native="handleQuery"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="手机号" prop="tel">
|
||||
<el-input v-model="queryParams.tel" placeholder="请输入手机号" clearable @keyup.enter.native="handleQuery"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="交接时间" prop="changeTimeArray">
|
||||
<el-date-picker v-model="queryParams.changeTimeArray" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss"
|
||||
type="daterange"
|
||||
range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"
|
||||
:default-time="['00:00:00', '23:59:59']"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="交接状态" prop="changeType">
|
||||
<el-select v-model="queryParams.changeType" placeholder="请选择交接状态" clearable size="small">
|
||||
<el-option
|
||||
v-for="dict in this.getDictDatas(DICT_TYPE.STAFF_CHANGE_TYPE)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
||||
<el-table-column label="序号" align="center">
|
||||
<template scope="scope">
|
||||
<span>{{ scope.$index + 1 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="交出方姓名" align="center" prop="oldStaff.name" width="180" />
|
||||
<el-table-column label="交出方工号" align="center" prop="oldStaff.workNo" width="180" />
|
||||
<el-table-column label="交出方电话" align="center" prop="oldStaff.tel" width="180" />
|
||||
<el-table-column label="交出方性别" align="center" prop="oldStaff.sex" width="180">
|
||||
<template v-slot="scope">
|
||||
<dict-tag :type="DICT_TYPE.SYSTEM_USER_SEX" :value="scope.row.oldStaff.sex"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="交出方地址" :show-overflow-tooltip="true" align="center" prop="oldStaff.address" width="180"/>
|
||||
|
||||
<el-table-column label="接收方姓名" align="center" prop="newStaff.name" width="180" />
|
||||
<el-table-column label="接收方工号" align="center" prop="newStaff.workNo" width="180" />
|
||||
<el-table-column label="接收方电话" align="center" prop="newStaff.tel" width="180" />
|
||||
<el-table-column label="接收方性别" align="center" prop="newStaff.sex" width="180">
|
||||
<template v-slot="scope">
|
||||
<dict-tag :type="DICT_TYPE.SYSTEM_USER_SEX" :value="scope.row.newStaff.sex"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="接收方地址" :show-overflow-tooltip="true" align="center" prop="newStaff.address" width="180" />
|
||||
<el-table-column label="交接时间" align="center" prop="changeTime" width="180" />
|
||||
<el-table-column label="交接备注" :show-overflow-tooltip="true" align="center" prop="remark" width="180" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="180">
|
||||
<template v-slot="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-search" @click="openForm(scope.row)"
|
||||
>列表查看
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<!-- 分页组件 -->
|
||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<StaffChangeFormData ref="staffChangeFormData" :success="getList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import * as StaffChangeApi from '@/api/company/staffChange'
|
||||
import StaffChangeFormData from './form/StaffChangeFormData'
|
||||
|
||||
export default {
|
||||
name: 'StaffChange',
|
||||
components: {
|
||||
StaffChangeFormData
|
||||
},
|
||||
data() {
|
||||
return{
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 导出遮罩层
|
||||
exportLoading: false,
|
||||
queryParams:{
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
workNo: null,
|
||||
name: null,
|
||||
changeType: null,
|
||||
changeTimeArray:null,
|
||||
tel: null
|
||||
},
|
||||
list: [],
|
||||
total: 0,
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'$route.query.data':{
|
||||
immediate: true,
|
||||
handler(newVal){
|
||||
if (newVal){
|
||||
this.getQueryData(JSON.parse(newVal))
|
||||
this.getList()
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
},
|
||||
methods:{
|
||||
/** 处理点击过来的数据 */
|
||||
async getQueryData(row){
|
||||
this.queryParams.name = row.name;
|
||||
this.queryParams.workNo = row.workNo;
|
||||
this.queryParams.tel = row.tel;
|
||||
},
|
||||
/** 查询列表 */
|
||||
async getList() {
|
||||
try {
|
||||
this.loading = true
|
||||
const res = await StaffChangeApi.getStaffChangePage(this.queryParams)
|
||||
this.list = res.data.records
|
||||
this.total = res.data.total
|
||||
} finally {
|
||||
this.loading = false
|
||||
}
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNo = 1
|
||||
this.getList()
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.queryParams = {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
workNo: null,
|
||||
name: null,
|
||||
changeType: null,
|
||||
changeTimeArray:null,
|
||||
tel: null
|
||||
}
|
||||
// this.resetForm('queryForm')
|
||||
this.handleQuery()
|
||||
},
|
||||
/** 列表查看操作 */
|
||||
openForm(row) {
|
||||
this.$refs['staffChangeFormData'].open(row)
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
@ -88,8 +88,8 @@
|
||||
@pagination="getList"/>
|
||||
|
||||
<!-- 对话框(添加 / 修改) -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="140px">
|
||||
<el-form-item label="租户名" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入租户名" />
|
||||
</el-form-item>
|
||||
@ -104,11 +104,11 @@
|
||||
<el-form-item label="联系手机" prop="contactMobile">
|
||||
<el-input v-model="form.contactMobile" placeholder="请输入联系手机" />
|
||||
</el-form-item>
|
||||
<el-form-item v-if="form.id === undefined" label="用户名称" prop="username">
|
||||
<el-input v-model="form.username" placeholder="请输入用户名称" />
|
||||
<el-form-item v-if="form.id === undefined" label="管理员登录账号" prop="username">
|
||||
<el-input v-model="form.username" placeholder="请输入管理员登录账号" maxlength="16" />
|
||||
</el-form-item>
|
||||
<el-form-item v-if="form.id === undefined" label="用户密码" prop="password">
|
||||
<el-input v-model="form.password" placeholder="请输入用户密码" type="password" show-password />
|
||||
<el-form-item v-if="form.id === undefined" label="管理员登录密码" prop="password">
|
||||
<el-input v-model="form.password" placeholder="请输入管理员登录密码" type="password" maxlength="16" show-password />
|
||||
</el-form-item>
|
||||
<el-form-item label="账号额度" prop="accountCount">
|
||||
<el-input-number v-model="form.accountCount" placeholder="请输入账号额度" controls-position="right" :min="0" />
|
||||
@ -183,8 +183,18 @@ export default {
|
||||
accountCount: [{ required: true, message: "账号额度不能为空", trigger: "blur" }],
|
||||
expireTime: [{ required: true, message: "过期时间不能为空", trigger: "blur" }],
|
||||
website: [{ required: true, message: "绑定域名不能为空", trigger: "blur" }],
|
||||
username: [{ required: true, message: "用户名称不能为空", trigger: "blur" }],
|
||||
password: [{ required: true, message: "用户密码不能为空", trigger: "blur" }],
|
||||
username: [{ required: true, message: '管理员登录账号不能为空', trigger: 'blur' }, {
|
||||
min: 4,
|
||||
max: 16,
|
||||
message: '管理员登录账号长度在4到16个字符',
|
||||
trigger: 'blur'
|
||||
}],
|
||||
password: [{ required: true, message: '管理员登录密码不能为空', trigger: 'blur' }, {
|
||||
min: 4,
|
||||
max: 16,
|
||||
message: '管理员登录密码长度在4到16个字符',
|
||||
trigger: 'blur'
|
||||
}]
|
||||
}
|
||||
};
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user