|
|
@@ -24,7 +24,7 @@
|
|
|
:readonly="readonly"
|
|
|
:data="employee"
|
|
|
:form-type="formType"
|
|
|
- @input="(data) => (employee = data)"
|
|
|
+ @input="data => employee = data"
|
|
|
/>
|
|
|
</el-tab-pane>
|
|
|
<el-tab-pane v-if="isSuper" label="扩展属性" name="ext-attr">
|
|
|
@@ -32,7 +32,7 @@
|
|
|
ref="attrInfo"
|
|
|
:readonly="readonly"
|
|
|
:data="employee.attrItemList"
|
|
|
- @input="(data) => (employee.attrItemList = data)"
|
|
|
+ @input="data => employee.attrItemList = data"
|
|
|
/>
|
|
|
</el-tab-pane>
|
|
|
<!-- <el-tab-pane
|
|
|
@@ -58,7 +58,7 @@
|
|
|
:readonly="readonly"
|
|
|
:org-id="orgId"
|
|
|
:data="employee.posItemList"
|
|
|
- @input="(data) => (employee.posItemList = data)"
|
|
|
+ @input="data => employee.posItemList = data"
|
|
|
/>
|
|
|
</el-tab-pane>
|
|
|
<el-tab-pane
|
|
|
@@ -82,7 +82,7 @@
|
|
|
:span="span"
|
|
|
:readonly="readonly"
|
|
|
:data="employee.roleItemList"
|
|
|
- @input="(data) => (employee.roleItemList = data)"
|
|
|
+ @input="data => employee.roleItemList = data"
|
|
|
/>
|
|
|
</el-tab-pane>
|
|
|
<!-- <el-tab-pane label="用户组信息" name="group-info">
|
|
|
@@ -106,7 +106,7 @@
|
|
|
:visible.sync="qrcodeVisible"
|
|
|
:content="personalInfo"
|
|
|
:photo="employee.photo"
|
|
|
- @close="(visible) => (qrcodeVisible = visible)"
|
|
|
+ @close="visible => (qrcodeVisible = visible)"
|
|
|
/>
|
|
|
</el-dialog>
|
|
|
</template>
|
|
|
@@ -186,9 +186,7 @@ export default {
|
|
|
toolbars: [
|
|
|
{
|
|
|
key: 'save',
|
|
|
- hidden: () => {
|
|
|
- return this.readonly && this.formType === 'detail'
|
|
|
- }
|
|
|
+ hidden: () => { return this.readonly && this.formType === 'detail' }
|
|
|
},
|
|
|
{
|
|
|
key: 'qrcode',
|
|
|
@@ -264,22 +262,20 @@ export default {
|
|
|
mobile: this.employee.mobile,
|
|
|
email: this.employee.email,
|
|
|
gender: this.employee.gender,
|
|
|
- dept: this.employee.posItemList.map((i) => i.name).join(','),
|
|
|
- role: this.employee.roleItemList.map((i) => i.name).join(',')
|
|
|
+ dept: this.employee.posItemList.map(i => i.name).join(','),
|
|
|
+ role: this.employee.roleItemList.map(i => i.name).join(',')
|
|
|
})
|
|
|
this.qrcodeVisible = true
|
|
|
},
|
|
|
checkPhone (value) {
|
|
|
- const reg =
|
|
|
- /^((13[0-9])|(14[5,7])|(15[0-3,5-9])|(17[0,3,5-8])|(18[0-9])|166|198|199|(147))\d{8}$/
|
|
|
+ const reg = /^((13[0-9])|(14[5,7])|(15[0-3,5-9])|(17[0,3,5-8])|(18[0-9])|166|198|199|(147))\d{8}$/
|
|
|
if (!reg.test(value)) {
|
|
|
return false
|
|
|
}
|
|
|
return true
|
|
|
},
|
|
|
checkEmail (value) {
|
|
|
- const reg =
|
|
|
- /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
|
|
|
+ const reg = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
|
|
|
if (!reg.test(value)) {
|
|
|
return false
|
|
|
}
|
|
|
@@ -290,7 +286,7 @@ export default {
|
|
|
id: this.employee.id,
|
|
|
account: this.employee.account
|
|
|
}
|
|
|
- upEmployee(params).then((res) => {
|
|
|
+ upEmployee(params).then(res => {
|
|
|
if (res.state === 200) {
|
|
|
const data = res.variables.data
|
|
|
if (data === 'Y') {
|
|
|
@@ -302,44 +298,36 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
createTrain (id) {
|
|
|
- const { isTrain, trainType, teacher, jianDingZiGeZ } =
|
|
|
- this.employee || {}
|
|
|
+ const { isTrain, trainType, teacher, jianDingZiGeZ } = this.employee || {}
|
|
|
const { first, second } = this.$store.getters.level || {}
|
|
|
const { userList } = this.$store.getters || {}
|
|
|
if (isTrain !== 'Y') {
|
|
|
return
|
|
|
}
|
|
|
const time = this.$common.getDateNow(19)
|
|
|
- const userInfo = userList.find((item) => item.userId === teacher) || {}
|
|
|
+ const userInfo = userList.find(item => item.userId === teacher) || {}
|
|
|
const addTrainData = {
|
|
|
tableName: 't_lhgqpxjh',
|
|
|
- paramWhere: [
|
|
|
- {
|
|
|
- di_dian_: second || first,
|
|
|
- nian_du_: time.slice(0, 4),
|
|
|
- bian_zhi_bu_men_: userInfo
|
|
|
- ? userInfo.positionId.split(',').pop()
|
|
|
- : '',
|
|
|
- bian_zhi_ren_: teacher,
|
|
|
- bian_zhi_shi_jian: time,
|
|
|
- shi_fou_guo_shen_: '已编制',
|
|
|
- bu_men_: '',
|
|
|
- pei_xun_lei_xing_: trainType,
|
|
|
- ru_zhi_zhuan_gang: time,
|
|
|
- yuan_gong_xing_mi: id,
|
|
|
- gong_hao_: jianDingZiGeZ
|
|
|
- }
|
|
|
- ],
|
|
|
+ paramWhere: [{
|
|
|
+ di_dian_: second || first,
|
|
|
+ nian_du_: time.slice(0, 4),
|
|
|
+ bian_zhi_bu_men_: userInfo ? userInfo.positionId.split(',').pop() : '',
|
|
|
+ bian_zhi_ren_: teacher,
|
|
|
+ bian_zhi_shi_jian: time,
|
|
|
+ shi_fou_guo_shen_: '已编制',
|
|
|
+ bu_men_: '',
|
|
|
+ pei_xun_lei_xing_: trainType,
|
|
|
+ ru_zhi_zhuan_gang: time,
|
|
|
+ yuan_gong_xing_mi: id,
|
|
|
+ gong_hao_: jianDingZiGeZ
|
|
|
+ }],
|
|
|
formKey: 'lhgqpxypjb',
|
|
|
defKey: 'Process_1a66tzk'
|
|
|
}
|
|
|
this.$common.request('add', addTrainData)
|
|
|
},
|
|
|
saveData () {
|
|
|
- const attrValidator =
|
|
|
- this.$refs['attrInfo'] && this.isSuper
|
|
|
- ? this.$refs['attrInfo'].callback()
|
|
|
- : null
|
|
|
+ const attrValidator = this.$refs['attrInfo'] && this.isSuper ? this.$refs['attrInfo'].callback() : null
|
|
|
const vo = this.formatSubmitData()
|
|
|
if (!this.$utils.isEmpty(this.formId) && !this.ceroParams) {
|
|
|
delete vo.partyEmployeePo.password
|
|
|
@@ -377,13 +365,9 @@ export default {
|
|
|
return ActionUtils.warning('请选择带教老师')
|
|
|
}
|
|
|
// 部门信息
|
|
|
- vo.user.positions = vo.positionVoList.length
|
|
|
- ? vo.positionVoList.map((i) => i.id).join(',')
|
|
|
- : ''
|
|
|
+ vo.user.positions = vo.positionVoList.length ? vo.positionVoList.map(i => i.id).join(',') : ''
|
|
|
// 角色信息
|
|
|
- vo.user.job = vo.roleVoList.length
|
|
|
- ? vo.roleVoList.map((i) => i.id).join(',')
|
|
|
- : ''
|
|
|
+ vo.user.job = vo.roleVoList.length ? vo.roleVoList.map(i => i.id).join(',') : ''
|
|
|
// 更新该表的job_字段
|
|
|
const updateParams = {
|
|
|
tableName: 'ibps_party_employee',
|
|
|
@@ -401,58 +385,53 @@ export default {
|
|
|
}
|
|
|
|
|
|
if (this.formId) {
|
|
|
- update(vo)
|
|
|
- .then((response) => {
|
|
|
- this.dialogLoading = false
|
|
|
- if (this.wxyhId) {
|
|
|
- this.updateWxyh()
|
|
|
- }
|
|
|
- // 更新部门、岗位数据
|
|
|
- this.$common.request('update', updateParams)
|
|
|
- // 启动培训
|
|
|
- this.createTrain(response.variables.id)
|
|
|
- this.$emit('dialog-callback', this)
|
|
|
- if (this.formType === 'part') {
|
|
|
+ update(vo).then(response => {
|
|
|
+ this.dialogLoading = false
|
|
|
+ if (this.wxyhId) {
|
|
|
+ this.updateWxyh()
|
|
|
+ }
|
|
|
+ // 更新部门、岗位数据
|
|
|
+ this.$common.request('update', updateParams)
|
|
|
+ // 启动培训
|
|
|
+ this.createTrain(response.variables.id)
|
|
|
+ this.$emit('dialog-callback', this)
|
|
|
+ if (this.formType === 'part') {
|
|
|
+ this.closeDialog()
|
|
|
+ return this.$router.currentRoute.path === '/dashboard' ? location.reload() : this.$router.push('/')
|
|
|
+ }
|
|
|
+ ActionUtils.saveSuccessMessage(response.message, r => {
|
|
|
+ // if (this.$utils.isEmpty(this.formId)) {
|
|
|
+ // this.$refs[this.formName].resetFields()
|
|
|
+ // }
|
|
|
+ if (r) {
|
|
|
this.closeDialog()
|
|
|
- return this.$router.currentRoute.path === '/dashboard'
|
|
|
- ? location.reload()
|
|
|
- : this.$router.push('/')
|
|
|
}
|
|
|
- ActionUtils.saveSuccessMessage(response.message, (r) => {
|
|
|
- // if (this.$utils.isEmpty(this.formId)) {
|
|
|
- // this.$refs[this.formName].resetFields()
|
|
|
- // }
|
|
|
- if (r) {
|
|
|
- this.closeDialog()
|
|
|
- }
|
|
|
- })
|
|
|
- })
|
|
|
- .catch(() => {
|
|
|
- this.dialogLoading = false
|
|
|
- })
|
|
|
+ }
|
|
|
+ )
|
|
|
+ }).catch(() => {
|
|
|
+ this.dialogLoading = false
|
|
|
+ })
|
|
|
} else {
|
|
|
- create(vo)
|
|
|
- .then((response) => {
|
|
|
- this.dialogLoading = false
|
|
|
- // 更新部门、岗位数据
|
|
|
- this.$common.request('update', updateParams)
|
|
|
- // 启动培训
|
|
|
- this.createTrain(response.variables.id)
|
|
|
- this.$emit('dialog-callback', this)
|
|
|
- ActionUtils.saveSuccessMessage(response.message, (r) => {
|
|
|
- if (r) {
|
|
|
- this.closeDialog()
|
|
|
- } else {
|
|
|
- this.init()
|
|
|
- if (this.isSuper) {
|
|
|
- this.$refs.attrInfo.clearData()
|
|
|
- }
|
|
|
+ create(vo).then(response => {
|
|
|
+ this.dialogLoading = false
|
|
|
+ // 更新部门、岗位数据
|
|
|
+ this.$common.request('update', updateParams)
|
|
|
+ // 启动培训
|
|
|
+ this.createTrain(response.variables.id)
|
|
|
+ this.$emit('dialog-callback', this)
|
|
|
+ ActionUtils.saveSuccessMessage(response.message, r => {
|
|
|
+ if (r) {
|
|
|
+ this.closeDialog()
|
|
|
+ } else {
|
|
|
+ this.init()
|
|
|
+ if (this.isSuper) {
|
|
|
+ this.$refs.attrInfo.clearData()
|
|
|
}
|
|
|
- })
|
|
|
- })
|
|
|
- .catch(() => {
|
|
|
- this.dialogLoading = false
|
|
|
+ }
|
|
|
})
|
|
|
+ }).catch(() => {
|
|
|
+ this.dialogLoading = false
|
|
|
+ })
|
|
|
}
|
|
|
},
|
|
|
// 关闭当前窗口
|
|
|
@@ -491,54 +470,45 @@ export default {
|
|
|
}
|
|
|
this.dialogLoading = true
|
|
|
// 用户基本信息
|
|
|
- load({ employeeId: this.formId })
|
|
|
- .then((response) => {
|
|
|
- this.dialogLoading = false
|
|
|
- this.employee = response.data
|
|
|
- this.employee.orgItem = response.variables.partyOrg || {}
|
|
|
- this.employee.attrItemList = response.variables.partyAttrs || []
|
|
|
- this.employee.posItemList = response.variables.partyPositions || []
|
|
|
- this.employee.roleItemList = response.variables.partyRoles || []
|
|
|
- this.employee.userGroupItemList =
|
|
|
- response.variables.partyGroups || []
|
|
|
- if (this.isSuper) {
|
|
|
- this.$nextTick(() => {
|
|
|
- this.$refs.attrInfo.loadAttrData()
|
|
|
- })
|
|
|
- } else {
|
|
|
- const list = []
|
|
|
- response.variables.partyAttrs.forEach((item) => {
|
|
|
- if (item.values.length > 0) {
|
|
|
- const obj = {
|
|
|
- attrId: item.values[0].attrID,
|
|
|
- value: item.values[0].value
|
|
|
- }
|
|
|
- list.push(obj)
|
|
|
+ load({ employeeId: this.formId }).then((response) => {
|
|
|
+ this.dialogLoading = false
|
|
|
+ this.employee = response.data
|
|
|
+ this.employee.orgItem = response.variables.partyOrg || {}
|
|
|
+ this.employee.attrItemList = response.variables.partyAttrs || []
|
|
|
+ this.employee.posItemList = response.variables.partyPositions || []
|
|
|
+ this.employee.roleItemList = response.variables.partyRoles || []
|
|
|
+ this.employee.userGroupItemList = response.variables.partyGroups || []
|
|
|
+ if (this.isSuper) {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.attrInfo.loadAttrData()
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ const list = []
|
|
|
+ response.variables.partyAttrs.forEach(item => {
|
|
|
+ if (item.values.length > 0) {
|
|
|
+ const obj = {
|
|
|
+ attrId: item.values[0].attrID,
|
|
|
+ value: item.values[0].value
|
|
|
}
|
|
|
- })
|
|
|
- this.employee.attrItemList = list
|
|
|
- }
|
|
|
+ list.push(obj)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.employee.attrItemList = list
|
|
|
+ }
|
|
|
|
|
|
- // 添加更新 t_wxyh 用于扫码签到
|
|
|
- // if()
|
|
|
- this.getWxyh(this.employee)
|
|
|
- })
|
|
|
- .catch(() => {
|
|
|
- this.dialogLoading = false
|
|
|
- })
|
|
|
+ // 添加更新 t_wxyh 用于扫码签到
|
|
|
+ // if()
|
|
|
+ this.getWxyh(this.employee)
|
|
|
+ }).catch(() => {
|
|
|
+ this.dialogLoading = false
|
|
|
+ })
|
|
|
},
|
|
|
formatSubmitData () {
|
|
|
const vo = {}
|
|
|
vo.partyEmployeePo = this.employee
|
|
|
vo.user = this.employee
|
|
|
- vo.user.password =
|
|
|
- this.formId === '' || this.ceroParams
|
|
|
- ? this.employee.password
|
|
|
- : this.defaultEmployee.password
|
|
|
- vo.partyEmployeePo.groupID =
|
|
|
- this.ceroParams !== {} && this.ceroParams
|
|
|
- ? this.ceroParams.groundId
|
|
|
- : this.formatOrgData()
|
|
|
+ vo.user.password = this.formId === '' || this.ceroParams ? this.employee.password : this.defaultEmployee.password
|
|
|
+ vo.partyEmployeePo.groupID = this.ceroParams !== {} && this.ceroParams ? this.ceroParams.groundId : this.formatOrgData()
|
|
|
vo.positionVoList = this.formatPositionData()
|
|
|
vo.roleVoList = this.formatRoleData()
|
|
|
vo.attrValueVoList = this.employee.attrItemList
|
|
|
@@ -592,7 +562,7 @@ export default {
|
|
|
// 更新扫码签到表的数据
|
|
|
getWxyh (data) {
|
|
|
const sql = `select * from t_wxyh where xing_ming_ = '${data.name}' and shou_ji_ = '${data.mobile}'`
|
|
|
- this.$common.request('sql', sql).then((res) => {
|
|
|
+ this.$common.request('sql', sql).then(res => {
|
|
|
const { data = [] } = res.variables || {}
|
|
|
if (!data.length) {
|
|
|
return
|
|
|
@@ -621,9 +591,9 @@ export default {
|
|
|
}
|
|
|
</script>
|
|
|
<style lang="scss">
|
|
|
-.employee-dialog {
|
|
|
- .el-dialog__body {
|
|
|
- height: calc(100% - 110px) !important;
|
|
|
- }
|
|
|
-}
|
|
|
+ .employee-dialog {
|
|
|
+ .el-dialog__body {
|
|
|
+ height: calc(100% - 110px) !important;
|
|
|
+ }
|
|
|
+ }
|
|
|
</style>
|