This commit is contained in:
zhangdingyu
2018-11-24 17:10:01 +08:00
13 changed files with 1724 additions and 231 deletions

View File

@@ -135,7 +135,7 @@ export default {
equipmentNameCheck: null,
equipmentName: [],
operator: '',
operatorNum: null,
operatorNum: '',
operatorCheck: null,
dialogFormVisible: false,
tablePeople: [],
@@ -200,10 +200,11 @@ export default {
}
},
getTableData() {
console.log(typeof (this.equipmentName))
this.equipmentNameValue ? this.equipmentNameCheck = 1 : this.equipmentNameCheck = 0
this.operator ? this.operatorCheck = 1 : this.operatorCheck = 0
this.loading = true
this.getTable(getTableData, [this.equipmentNameCheck, this.equipmentNameValue, this.operatorCheck, this.operator, this.pageCurrent, this.pageSize], ['tableData', 'total', 'loading'])
this.getTable(getTableData, [this.equipmentNameCheck, this.equipmentNameValue, this.operatorCheck, this.operatorNum, this.pageCurrent, this.pageSize], ['tableData', 'total', 'loading'])
},
handleAdd() {
this.addForm('form', [this.dialogFormVisible_form = true, this.title = '增加'])

View File

@@ -10,7 +10,6 @@
<el-table
v-loading="loading"
:data="tableData"
height="580"
highlight-current-row
border>
<el-table-column align="center" label="角色编号" width="100">

View File

@@ -4,7 +4,7 @@
<el-card>
<span>员工姓名:</span>
<el-input v-model="staffName" size="small" clearable style="width:200px"/>
<el-input v-model="staffName" placeholder="员工姓名" size="small" clearable style="width:200px"/>
<span style="margin-left: 15px">角色名称:</span>
<el-select v-model="roleName" placeholder="角色名称" clearable size="small" style="width:200px">
<el-option
@@ -18,7 +18,7 @@
</el-card>
<el-card>
<el-table :data="tableData" height="659" highlight-current-row>
<el-table :data="tableData" highlight-current-row>
<el-table-column label="员工姓名">
<template slot-scope="scope">
{{ scope.row.姓名 }}
@@ -116,7 +116,7 @@
<el-row>
<el-col :span="12">
<el-form-item label="员工姓名" prop="staffName">
<el-input v-model="form1.staffName" size="small" clearable style="width:200px" @dblclick.native="dialogTableVisible()"/>
<el-input v-model="form1.staffName" placeholder="请双击选择" size="small" clearable style="width:200px" @dblclick.native="dialogTableVisible()"/>
</el-form-item>
<el-form-item label="角色名称" prop="roleName">
<el-select v-model="form1.roleName" placeholder="角色名称" size="small" clearable style="width:200px">
@@ -207,7 +207,6 @@ export default {
roleName: [{ required: true, message: '请选择员工角色', trigger: 'change' }]
},
rules1: {
staffName: [{ required: true, message: '请选择员工姓名', trigger: 'change' }],
roleName: [{ required: true, message: '请选择员工角色', trigger: 'change' }]
},
staffName: '',
@@ -249,12 +248,15 @@ export default {
}
},
submitEdit(index, row) {
if (this.$refs['form2'] !== undefined) {
this.$refs['form2'].resetFields()
}
this.dialogFormVisible2 = true
this.personnelStream = row.人员角色流水号
this.form2.staffName = row.姓名
this.ssks = row.部门名称
this.personnelNumber = row.人员编号
this.form2.roleName = row.角色功能
this.form2.roleName = parseInt(row.角色编号)
this.cjscgy = row.考勤编号
},
callOFF() {
@@ -304,25 +306,39 @@ export default {
this.searchData()
},
submitAdd1() {
addData1(this.personnelNumber, this.form1.roleName).then(response => {
if (response.data[0].result === '1') {
this.$message.success('增加成功')
this.ssks = ''
this.form1.staffName = ''
this.form1.roleName = ''
this.searchData()
this.dialogFormVisible1 = false
} else { this.$message.error('增加失败') }
this.$refs['form1'].validate((valid) => {
if (valid) {
addData1(this.personnelNumber, this.form1.roleName).then(response => {
if (response.data[0].result === '1') {
this.$message.success('增加成功')
this.ssks = ''
this.form1.staffName = ''
this.form1.roleName = ''
this.searchData()
this.dialogFormVisible1 = false
} else { this.$message.error('增加失败') }
})
} else {
console.log('error submit!!')
return false
}
})
},
submitAdd2() {
addData2(this.personnelStream, this.personnelNumber, this.form2.roleName).then(response => {
if (response.data[0].result === '1') {
this.$message.success('修改成功')
this.ssks = ''
this.searchData()
this.dialogFormVisible2 = false
} else { this.$message.error('修改失败') }
this.$refs['form2'].validate((valid) => {
if (valid) {
addData2(this.personnelStream, this.personnelNumber, this.form2.roleName).then(response => {
if (response.data[0].result === '1') {
this.$message.success('修改成功')
this.ssks = ''
this.searchData()
this.dialogFormVisible2 = false
} else { this.$message.error('修改失败') }
})
} else {
console.log('error submit!!')
return false
}
})
},
handleCurrentChange3(val) {