This commit is contained in:
Vergil
2020-04-08 11:21:34 +08:00
parent 307598eb96
commit 0d0e0dcb6f
7 changed files with 80 additions and 54 deletions

View File

@@ -219,8 +219,8 @@
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="cancel">取消</el-button>
<el-button v-if="department_Title==='新增部门'" type="primary" @click="submitAdd('department_Form')">确定</el-button>
<el-button v-else-if="department_Title==='编辑部门'" type="primary" @click="submitEdit('department_Form')">确定</el-button>
<el-button v-if="department_Title==='新增部门'" :disabled="handleAdd_disable" type="primary" @click="submitAdd('department_Form')">确定</el-button>
<el-button v-else-if="department_Title==='编辑部门'" :disabled="handleAdd_disable" type="primary" @click="submitEdit('department_Form')">确定</el-button>
</div>
</el-dialog>
@@ -321,8 +321,8 @@
</el-form>
<div slot="footer" class="dialog-footer">
<el-button :loading="btnLoading" @click="cancel">取消</el-button>
<el-button v-if="people_title === '新增人员'" :loading="btnLoading" type="primary" @click="submitAddPeople">确定</el-button>
<el-button v-else-if="people_title === '编辑人员'" :loading="btnLoading" type="primary" @click="submitEditPeople">确定</el-button>
<el-button v-if="people_title === '新增人员'" :disabled="addPeople_disable" :loading="btnLoading" type="primary" @click="submitAddPeople">确定</el-button>
<el-button v-else-if="people_title === '编辑人员'" :disabled="addPeople_disable" :loading="btnLoading" type="primary" @click="submitEditPeople">确定</el-button>
</div>
</el-dialog>
@@ -445,6 +445,8 @@ import request from '@/utils/request'
export default {
data() {
return {
handleAdd_disable: false,
addPeople_disable: false,
limit: 999,
readFile: readFile,
disabledMove: true,
@@ -636,20 +638,22 @@ export default {
this.$refs.upload.submit()
},
handleAdd(formName) {
this.department_Title = '新增部门'
this.department_DFV = true
this.department_Form.DepartmentName = ''
this.count1 = this.count1 + 1
if (this.count1 !== 1) {
this.$refs[formName].resetFields()
}
this.department_Title = '新增部门'
this.handleAdd_disable = false
this.department_DFV = true
},
handleEdit() {
this.addForm('department_Form')
if (this.id) {
this.department_Title = '编辑部门'
this.department_DFV = true
this.department_Form.DepartmentName = this.nodeName
this.handleAdd_disable = false
this.department_DFV = true
} else {
this.$message.warning(`请选择要修改的部门`)
}
@@ -657,6 +661,7 @@ export default {
submitAdd(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
this.handleAdd_disable = true
this.department_DFV = false
if (this.id) {
addDepartmentName(this.id, this.department_Form.DepartmentName, 0).then(response => {
@@ -687,6 +692,7 @@ export default {
submitEdit(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
this.handleAdd_disable = true
this.department_DFV = false
editList(this.id, this.department_Form.DepartmentName).then(response => {
if (response.data[0].result === '1') {
@@ -755,6 +761,7 @@ export default {
addPeople() {
if (this.id) {
this.people_title = '新增人员'
this.addPeople_disable = false
this.people_DFV = true
this.addForm('people_form')
} else {
@@ -762,6 +769,7 @@ export default {
}
},
submitAddPeople() {
this.addPeople_disable = true
this.btnLoading = true
addPeople(this.id, this.people_form.Sex, this.people_form.Education, this.people_form.Address, this.people_form.Nation, this.people_form.Post, this.people_form.AccountNumber, this.people_form.Password, this.people_form.Name, this.people_form.IDcard, this.people_form.TimeOfEntry, this.people_form.Birthday, this.people_form.ContactInformation).then(response => {
this.btnLoading = false
@@ -794,6 +802,7 @@ export default {
this.people_form.ContactInformation = row.联系电话
},
submitEditPeople() {
this.addPeople_disable = true
this.btnLoading = true
editPeople(this.people_form.PeopleID, this.people_form.Sex, this.people_form.Education, this.people_form.Address, this.people_form.Nation, this.people_form.Post, this.people_form.AccountNumber, this.people_form.Password, this.people_form.Name, this.people_form.IDcard, this.people_form.TimeOfEntry, this.people_form.Birthday, this.people_form.ContactInformation).then(response => {
this.btnLoading = false