修改同步更新云内容

This commit is contained in:
caoxinyu
2018-12-24 19:40:56 +08:00
parent b77cc3ad55
commit 795b86c36c
3 changed files with 33 additions and 9 deletions

View File

@@ -36,3 +36,14 @@ export function editPassword(num1, num2, num3, num4) {
} }
}) })
} }
export function cloudEditPassword(num1, num2) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '人事档案管理_人员名单_云上改密码',
param: 'id=' + num1 + '=int&新密码=' + num2 + '=string'
}
})
}

View File

@@ -228,6 +228,7 @@
<el-form-item label="出生日期" prop="Birthday"> <el-form-item label="出生日期" prop="Birthday">
<el-date-picker <el-date-picker
v-model="people_form.Birthday" v-model="people_form.Birthday"
style="width: 200px"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
size="small" size="small"
type="date" type="date"
@@ -243,6 +244,7 @@
<el-form-item label="入职时间" prop="TimeOfEntry"> <el-form-item label="入职时间" prop="TimeOfEntry">
<el-date-picker <el-date-picker
v-model="people_form.TimeOfEntry" v-model="people_form.TimeOfEntry"
style="width: 200px"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
size="small" size="small"
type="date" type="date"
@@ -289,9 +291,9 @@
</el-row> </el-row>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button @click="cancel">取消</el-button> <el-button :loading="btnLoading" @click="cancel">取消</el-button>
<el-button v-if="people_title === '新增人员'" type="primary" @click="submitAddPeople">确定</el-button> <el-button v-if="people_title === '新增人员'" :loading="btnLoading" type="primary" @click="submitAddPeople">确定</el-button>
<el-button v-else-if="people_title === '编辑人员'" type="primary" @click="submitEditPeople">确定</el-button> <el-button v-else-if="people_title === '编辑人员'" :loading="btnLoading" type="primary" @click="submitEditPeople">确定</el-button>
</div> </div>
</el-dialog> </el-dialog>
@@ -405,6 +407,7 @@ export default {
List: [], List: [],
total: null, total: null,
nodeName: '', nodeName: '',
btnLoading: false,
department_DFV: false, department_DFV: false,
department_Form: { department_Form: {
DepartmentName: '' DepartmentName: ''
@@ -645,9 +648,11 @@ export default {
} }
}, },
submitAddPeople() { submitAddPeople() {
this.people_DFV = false 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 => { 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
if (response.data[0].result === '1') { if (response.data[0].result === '1') {
this.people_DFV = false
this.i = 0 this.i = 0
this.handleNodeClick() this.handleNodeClick()
this.$message.success('添加成功') this.$message.success('添加成功')
@@ -675,8 +680,9 @@ export default {
this.people_form.ContactInformation = row.联系电话 this.people_form.ContactInformation = row.联系电话
}, },
submitEditPeople() { submitEditPeople() {
this.people_DFV = false 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 => { 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
if (response.data[0].result === '1') { if (response.data[0].result === '1') {
if (this.id !== '' && this.Name === '') { if (this.id !== '' && this.Name === '') {
this.handleNodeClick() this.handleNodeClick()
@@ -684,6 +690,7 @@ export default {
this.feathPeopleForName() this.feathPeopleForName()
} }
this.$message.success('编辑成功') this.$message.success('编辑成功')
this.people_DFV = false
} else { } else {
this.$message.error('编辑失败') this.$message.error('编辑失败')
} }

View File

@@ -108,7 +108,7 @@
</template> </template>
<script> <script>
import { isvalidUsername } from '@/utils/validate' import { isvalidUsername } from '@/utils/validate'
import { editPassword } from '@/api/login' import { editPassword, cloudEditPassword } from '@/api/login'
import Cookie from 'js-cookie' import Cookie from 'js-cookie'
export default { export default {
name: 'Login', name: 'Login',
@@ -230,14 +230,20 @@ export default {
editPassword(this.form.Account, this.form.beforPassword, this.form.newPassword, 5).then(response => { editPassword(this.form.Account, this.form.beforPassword, this.form.newPassword, 5).then(response => {
if (response.data.result[0].result === '1') { if (response.data.result[0].result === '1') {
if (response.data.output[0].返回 === '1') { if (response.data.output[0].返回 === '1') {
this.$message.success('修改成功') cloudEditPassword(this.form.Account, this.form.newPassword).then(response => {
this.dialogFormVisible = false console.log(response, 333)
if (response.data[0].result === '1') {
this.$message.success('修改成功')
this.dialogFormVisible = false
} else {
this.$message.error('编辑失败')
}
})
} else { } else {
this.$message.error('用户名或密码不正确') this.$message.error('用户名或密码不正确')
} }
} else { } else {
this.$message.error('编辑失败') this.$message.error('编辑失败')
this.dialogFormVisible = false
} }
}) })
} }