人员强制拉人相关功能
parent
64e8c9a674
commit
c22e4f1723
|
@ -0,0 +1,257 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="ruleForm" :rules="rules" label-width="130px">
|
||||
<el-row>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="人员名称" prop="name" class="input-width">
|
||||
<el-input v-model="ruleForm.name" placeholder="请输入人员名称"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="身份证号" prop="cardId">
|
||||
<el-input v-model="ruleForm.cardId" placeholder="请输入身份证号"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label-width="10px">
|
||||
<el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="getQuery">
|
||||
搜索
|
||||
</el-button>
|
||||
<el-button v-waves class="filter-item" type="success" icon="el-icon-refresh" @click="goKeyReset">
|
||||
重置
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
</el-form>
|
||||
<el-table
|
||||
ref="multipleTable"
|
||||
:data="varList"
|
||||
:header-cell-style="{'font-weight': 'bold','color': '#000'}"
|
||||
tooltip-effect="dark"
|
||||
border
|
||||
fit
|
||||
highlight-current-row>
|
||||
<el-table-column :selectable="handleSelectWithDifferentStatus" type="selection" width="55" align="center"/>
|
||||
<el-table-column type="index" label="序号" width="50" align="center"/>
|
||||
<el-table-column prop="username" label="用户名" align="center"/>
|
||||
<el-table-column prop="cardId" label="身份证号" align="center"/>
|
||||
<el-table-column prop="name" label="人员名称" align="center"/>
|
||||
<el-table-column prop="corpName" label="企业名称" align="center"/>
|
||||
<el-table-column label="操作" align="center" width="250">
|
||||
<template slot-scope="{row}">
|
||||
<el-button type="primary" icon="el-icon-s-claim" size="mini" @click="dosubmit([row])">入住</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<el-dialog
|
||||
:visible.sync="dialogVisible"
|
||||
title="请选择入住企业"
|
||||
width="30%">
|
||||
<el-select
|
||||
v-model="corpinfoId"
|
||||
:remote-method="remoteMethod"
|
||||
:loading="loading"
|
||||
filterable
|
||||
remote
|
||||
reserve-keyword
|
||||
placeholder="请选择入住企业">
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="doCheckIn">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
<div class="page-btn-group">
|
||||
<div/>
|
||||
<pagination :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="getList"/>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Pagination from '@/components/Pagination' // 通过 el-pagination二次打包
|
||||
import { requestFN } from '@/utils/request'
|
||||
import waves from '@/directive/waves' // waves directive
|
||||
|
||||
export default {
|
||||
components: { Pagination },
|
||||
directives: { waves },
|
||||
data() {
|
||||
return {
|
||||
rules: {
|
||||
name: [{ required: true, message: '姓名不能为空', trigger: 'blur' }],
|
||||
cardId: [{ required: true, message: '身份证号不能为空', trigger: 'blur' }]
|
||||
},
|
||||
ruleForm: { name: '', cardId: '' },
|
||||
config: config,
|
||||
listQuery: {
|
||||
page: 1,
|
||||
limit: 10
|
||||
},
|
||||
total: 0,
|
||||
varList: [],
|
||||
dialogVisible: false,
|
||||
rowuser: {},
|
||||
corpinfoId: '',
|
||||
loading: false,
|
||||
options: []
|
||||
|
||||
}
|
||||
},
|
||||
created() {
|
||||
// this.getDict()
|
||||
// this.getList()
|
||||
this.remoteMethod('河北')
|
||||
},
|
||||
methods: {
|
||||
handleSelectWithDifferentStatus(row, rowIndex) {
|
||||
return true
|
||||
},
|
||||
getQuery() {
|
||||
if (this.ruleForm.name === '') {
|
||||
this.$message.error('请填写人员名称')
|
||||
return false
|
||||
}
|
||||
if (this.ruleForm.cardId === '') {
|
||||
this.$message.error('请填写身份证号')
|
||||
return false
|
||||
}
|
||||
if (this.$refs.multipleTable) {
|
||||
this.$refs.multipleTable.clearSelection()
|
||||
}
|
||||
this.listQuery = {
|
||||
page: 1,
|
||||
limit: 10
|
||||
}
|
||||
this.getList()
|
||||
},
|
||||
goKeyReset() {
|
||||
this.ruleForm.cardId = ''
|
||||
this.ruleForm.name = ''
|
||||
this.varList = []
|
||||
},
|
||||
getList() {
|
||||
this.listLoading = true
|
||||
requestFN(
|
||||
'/xgf/coerce/getUserListByIdCardAndName?showCount=' + this.listQuery.limit + '¤tPage=' + this.listQuery.page,
|
||||
{
|
||||
cardId: this.ruleForm.cardId,
|
||||
name: this.ruleForm.name,
|
||||
UN_EMPLOY_FLAG: '0'
|
||||
}
|
||||
).then((data) => {
|
||||
this.listLoading = false
|
||||
this.varList = data.varList
|
||||
if (this.varList.length === 0) {
|
||||
this.$message.error('没有相关人员信息')
|
||||
}
|
||||
this.total = data.page.totalResult
|
||||
})
|
||||
.catch((e) => {
|
||||
this.listLoading = false
|
||||
})
|
||||
},
|
||||
remoteMethod(query) {
|
||||
if (query !== '') {
|
||||
// this.loading = true
|
||||
/* setTimeout(() => {
|
||||
this.loading = false
|
||||
this.options = this.list.filter(item => {
|
||||
return item.label.toLowerCase()
|
||||
.indexOf(query.toLowerCase()) > -1
|
||||
})
|
||||
}, 200) */
|
||||
|
||||
requestFN(
|
||||
'/xgf/coerce/findModuleList',
|
||||
{
|
||||
keyword: query
|
||||
}
|
||||
).then((data) => {
|
||||
// this.loading = false
|
||||
this.options = []
|
||||
data.varList.forEach(v => {
|
||||
const obj = {
|
||||
value: v.CORPINFO_ID,
|
||||
label: v.RELEVANT_UNIT_NAME
|
||||
}
|
||||
this.options.push(obj)
|
||||
})
|
||||
})
|
||||
.catch((e) => {
|
||||
// this.loading = false
|
||||
})
|
||||
} else {
|
||||
this.options = []
|
||||
this.remoteMethod('河北')
|
||||
}
|
||||
},
|
||||
dosubmit(row) {
|
||||
this.rowuser = {
|
||||
name: row[0].name,
|
||||
userId: row[0].userId
|
||||
}
|
||||
/* if (this.corpinfoId === '') {
|
||||
this.dialogVisible = true
|
||||
} else {
|
||||
this.doCheckIn()
|
||||
} */
|
||||
this.dialogVisible = true
|
||||
},
|
||||
|
||||
doCheckIn() {
|
||||
if (this.corpinfoId === '') {
|
||||
this.$message({
|
||||
message: '请选择入住企业',
|
||||
type: 'warning'
|
||||
})
|
||||
return
|
||||
}
|
||||
this.dialogVisible = false
|
||||
this.$confirm('确定要将 ' + this.rowuser.name + ' 拉入企业吗?', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.listLoading = true
|
||||
requestFN(
|
||||
'/xgf/coerce/doCoerceCheckIn',
|
||||
{
|
||||
userId: this.rowuser.userId,
|
||||
corpinfoId: this.corpinfoId
|
||||
}
|
||||
).then((e) => {
|
||||
console.log(e)
|
||||
if (e.msg === '1') {
|
||||
this.$message({
|
||||
message: '当前人员已经在企业中',
|
||||
type: 'warning'
|
||||
})
|
||||
} else {
|
||||
this.$message({
|
||||
message: '拉入成功',
|
||||
type: 'success'
|
||||
})
|
||||
this.getQuery()
|
||||
}
|
||||
this.listLoading = false
|
||||
}).catch((e) => {
|
||||
this.listLoading = false
|
||||
})
|
||||
}).catch(() => {})
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
<template>
|
||||
<component :is="activeName" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import List from './components/list'
|
||||
export default {
|
||||
components: {
|
||||
List: List
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
activeName: 'List',
|
||||
SUPERVISE_CORPINFO_ID: ''
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
|
@ -31,6 +31,8 @@
|
|||
<el-table-column prop="NAME" label="姓名" align="center"/>
|
||||
<el-table-column prop="RELEVANT_UNIT_NAME_HIS" label="原企业" align="center"/>
|
||||
<el-table-column prop="RELEVANT_UNIT_NAME_NOW" label="入住企业" align="center"/>
|
||||
<el-table-column prop="OPERNAME" label="操作人" align="center"/>
|
||||
|
||||
<el-table-column prop="CREATETIME" label="入住时间" align="center"/>
|
||||
</el-table>
|
||||
<div class="page-btn-group">
|
||||
|
|
Loading…
Reference in New Issue