|
@@ -22,7 +22,7 @@
|
|
|
<el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="form_search">搜索</el-button>
|
|
|
<el-button v-if="isEmpAdd" class="filter-item" style="margin-left: 10px;" type="primary" icon="el-icon-edit" @click="form_add">新增</el-button>
|
|
|
<el-button class="filter-item" type="success" icon="el-icon-download" style="" @click="handleDownload">导出</el-button>
|
|
|
-
|
|
|
+
|
|
|
</div>
|
|
|
<el-table
|
|
|
v-loading="listLoading"
|
|
@@ -81,6 +81,11 @@
|
|
|
<span>{{ scope.row.tel }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
+ <el-table-column label="状态" min-width="130px" header-align="center" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{scope.row.workstr}}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column label="账号数" sortable prop="isuser" min-width="90px" header-align="center" align="center">
|
|
|
<template slot-scope="scope">
|
|
|
<span>{{ scope.row.isuser }}</span>
|
|
@@ -136,6 +141,11 @@
|
|
|
<el-form-item label="工号" prop="empCode">
|
|
|
<el-input ref="empCode" v-model="dataform.empCode" />
|
|
|
</el-form-item>
|
|
|
+ <el-form-item label="状态" prop="work">
|
|
|
+ <el-select v-model="dataform.work">
|
|
|
+ <el-option v-for="item in workList" :key="item.id" :label="item.name" :value="item.id" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="联系方式" prop="tel">
|
|
|
<el-input ref="tel" v-model="dataform.tel" />
|
|
|
</el-form-item>
|
|
@@ -176,7 +186,7 @@ import waves from '@/directive/waves' // waves directive
|
|
|
import { isIntegerZero } from '@/utils/validate'
|
|
|
import { validatePhoneTwo } from '@/utils/validate'
|
|
|
import enterToNext from '@/directive/enterToNext' // enterToNext directive
|
|
|
-import { PostDataByName, GetDataByName, getRecuData, GetDataByNames, checkButtons, failproccess,GetAccount } from '@/api/common'
|
|
|
+import { PostDataByName, GetDataByName, getRecuData,ExecDataByConfig, GetDataByNames, checkButtons, failproccess,GetAccount } from '@/api/common'
|
|
|
import Pagination from '@/components/Pagination' // secondary package based on el-pagination
|
|
|
import { MessageBox } from 'element-ui'
|
|
|
import Cookies from 'js-cookie'
|
|
@@ -194,6 +204,7 @@ export default {
|
|
|
disabled: false,
|
|
|
tableKey: 0,
|
|
|
list: [{ sqlname: '', id: 0, sqlstr: '' }],
|
|
|
+ workList:[{id:1,name:'在职'},{id:0,name:'离职'}],
|
|
|
parentDept: [],
|
|
|
total: 0,
|
|
|
listLoading: true,
|
|
@@ -372,6 +383,7 @@ export default {
|
|
|
this.dataform.id = ''
|
|
|
this.dataform.sort = '0'
|
|
|
this.dataform.enable = '1'
|
|
|
+ this.dataform.work = 1
|
|
|
this.defaultCheckedKeys = []
|
|
|
},
|
|
|
form_add() {
|
|
@@ -403,6 +415,7 @@ export default {
|
|
|
this.requestParam.parammaps.enable = this.dataform.enable
|
|
|
this.requestParam.parammaps.pastureId = this.dataform.pastureId
|
|
|
this.requestParam.parammaps.empCode = this.dataform.empCode
|
|
|
+ this.requestParam.parammaps.work = this.dataform.work
|
|
|
|
|
|
PostDataByName(this.requestParam).then(response => {
|
|
|
if (response.msg !== 'fail') {
|
|
@@ -441,7 +454,7 @@ export default {
|
|
|
this.requestParam.parammaps.enable = this.dataform.enable
|
|
|
this.requestParam.parammaps.pastureId = this.dataform.pastureId
|
|
|
this.requestParam.parammaps.empCode = this.dataform.empCode
|
|
|
-
|
|
|
+ this.requestParam.parammaps.work = this.dataform.work
|
|
|
PostDataByName(this.requestParam).then(response => {
|
|
|
if (response.msg !== 'fail') {
|
|
|
this.get_table_data()
|
|
@@ -472,21 +485,48 @@ export default {
|
|
|
edit_dialog_save() {
|
|
|
this.$refs['dataForm'].validate(valid => {
|
|
|
if (valid) {
|
|
|
- this.requestParam.name = 'updateEmp'
|
|
|
+ // this.requestParam.name = 'updateEmp'
|
|
|
this.requestParam.parammaps = {}
|
|
|
if (this.dataform.easName == '' || this.dataform.easName == undefined) { this.dataform.easName = this.dataform.empname }
|
|
|
- this.requestParam.parammaps.easName = this.dataform.easName
|
|
|
- this.requestParam.parammaps.empname = this.dataform.empname
|
|
|
- this.requestParam.parammaps.deptid = this.dataform.deptid
|
|
|
- this.requestParam.parammaps.tel = this.dataform.tel
|
|
|
- this.requestParam.parammaps.position = this.dataform.position
|
|
|
- this.requestParam.parammaps.remark = this.dataform.remark
|
|
|
- this.requestParam.parammaps.sort = this.dataform.sort
|
|
|
- this.requestParam.parammaps.enable = this.dataform.enable
|
|
|
- this.requestParam.parammaps.pastureId = this.dataform.pastureId
|
|
|
- this.requestParam.parammaps.empCode = this.dataform.empCode
|
|
|
- this.requestParam.parammaps.id = this.dataform.id
|
|
|
- PostDataByName(this.requestParam).then(() => {
|
|
|
+ // this.requestParam.parammaps.easName = this.dataform.easName
|
|
|
+ // this.requestParam.parammaps.empname = this.dataform.empname
|
|
|
+ // this.requestParam.parammaps.deptid = this.dataform.deptid
|
|
|
+ // this.requestParam.parammaps.tel = this.dataform.tel
|
|
|
+ // this.requestParam.parammaps.position = this.dataform.position
|
|
|
+ // this.requestParam.parammaps.remark = this.dataform.remark
|
|
|
+ // this.requestParam.parammaps.sort = this.dataform.sort
|
|
|
+ // this.requestParam.parammaps.enable = this.dataform.enable
|
|
|
+ // this.requestParam.parammaps.pastureId = this.dataform.pastureId
|
|
|
+ // this.requestParam.parammaps.empCode = this.dataform.empCode
|
|
|
+ // this.requestParam.parammaps.id = this.dataform.id
|
|
|
+ // this.requestParam.parammaps.work = this.dataform.work
|
|
|
+ this.requestParam.common = { 'returnmap': '0' }
|
|
|
+ this.requestParam.data = []
|
|
|
+ this.requestParam.data[0] = { 'name': 'updateEmp', 'type': 'e', 'parammaps': {
|
|
|
+ easName:this.dataform.easName,
|
|
|
+ empname:this.dataform.empname,
|
|
|
+ deptid:this.dataform.deptid,
|
|
|
+ tel:this.dataform.tel,
|
|
|
+ position:this.dataform.position,
|
|
|
+ remark:this.dataform.remark,
|
|
|
+ sort:this.dataform.sort,
|
|
|
+ enable:this.dataform.enable,
|
|
|
+ pastureId:this.dataform.pastureId,
|
|
|
+ empCode:this.dataform.empCode,
|
|
|
+ id:this.dataform.id,
|
|
|
+ work:this.dataform.work,
|
|
|
+ }}
|
|
|
+ var enable = 0
|
|
|
+ if(this.dataform.work == 0){
|
|
|
+ enable = 0
|
|
|
+ }else{
|
|
|
+ enable = this.dataform.enable
|
|
|
+ }
|
|
|
+ this.requestParam.data[1] = { 'name': 'editUserEnable', 'type': 'e', 'parammaps': {
|
|
|
+ enable:enable,
|
|
|
+ empid:this.dataform.id
|
|
|
+ }}
|
|
|
+ ExecDataByConfig(this.requestParam).then(() => {
|
|
|
this.get_table_data()
|
|
|
this.resetRequestParam()
|
|
|
this.dialogFormVisible = false
|
|
@@ -520,8 +560,8 @@ export default {
|
|
|
console.log(this.downLoadList)
|
|
|
const elecExcelDatas = [
|
|
|
{
|
|
|
- tHeader: ['牧场', '姓名', '部门', '职位', '电话', '工号'],
|
|
|
- filterVal: ['pastureName', 'empname', 'deptname', 'position', 'tel', 'empCode'],
|
|
|
+ tHeader: ['牧场', '姓名', '部门', '职位', '电话','状态', '工号'],
|
|
|
+ filterVal: ['pastureName', 'empname', 'deptname', 'position', 'tel','workstr', 'empCode'],
|
|
|
tableDatas: this.downLoadList,
|
|
|
sheetName: '员工信息'
|
|
|
}
|