修改新模块的bug

This commit is contained in:
liushuai
2018-11-24 10:23:12 +08:00
parent dc0100bb9b
commit bbca4d7afc
4 changed files with 42 additions and 31 deletions

View File

@@ -79,9 +79,6 @@ export default {
})
}
}
if (this[carrier].length !== 0) {
this[carrier] = response.data[0][select[0]]
}
})
} else {
requestData(param).then(response => { // 这个方法没什么难度,不注释了
@@ -139,7 +136,7 @@ export default {
// 3接受值数组一般是['table','total','loading']顺序不能变
Vue.prototype.getTable = function(requestData, param, e) {
requestData(...param).then(response => {
const data = response.data.rows ? response.data.rows : response.data
const data = response.data.rows
this[e[0]] = []
this[e[1]] = 0
if (data && data.length > 0) {
@@ -159,9 +156,7 @@ export default {
// console.log('暂无数据')
}
}).then(() => {
if (this[e[2]]) {
this[e[2]] = false
}
this[e[2]] = false
})
}
// 添加表格数据

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) {