Commit 5e8ddbf7 authored by daywrite's avatar daywrite

检查员工管理

parent 5c99357b
......@@ -17,7 +17,7 @@
</el-form-item>
<el-form-item label="性别:" prop="sex" class="ec-clear-left ec-form-item-lg is-required">
<el-select v-model="model.sex" size="small" placeholder="请选择">
<el-option v-for="(option, optKey) in caseSpentTimeArray"
<el-option v-for="(option, optKey) in accountSexArray"
:key="optKey"
:label="option.name"
:value="option.key"></el-option>
......@@ -66,7 +66,7 @@
v-model.trim="model.mobile">
</el-input>
</el-form-item>
<el-form-item label="座机:" prop="name" class="ec-clear-left is-required">
<el-form-item label="座机:" prop="telephone_area_code" class="ec-clear-left is-required">
<el-input
class="ec-input-normal"
size="mini"
......@@ -123,7 +123,7 @@
</el-form-item>
<el-form-item label="用户角色:" prop="userRoles" class="ec-clear-left is-required">
<el-checkbox-group v-model="model.userRoles">
<el-checkbox v-for="sItem in accountUserRoles" :key="sItem.key" :label="sItem.name"> {{ sItem.name }} </el-checkbox>
<el-checkbox v-for="sItem in accountUserRoles" :key="sItem.name" :label="sItem.key"> {{ sItem.name }} </el-checkbox>
</el-checkbox-group>
</el-form-item>
</el-form>
......@@ -136,7 +136,7 @@ import settingMixin from '../common/settingMixin'
// api
// } from '@/lib/commonMixin'
export default {
name: 'accountForim',
name: 'accountForm',
mixins: [settingMixin],
......
......@@ -32,21 +32,22 @@ export default {
model: {
id: '',
name: '',
main_products: '',
company_nature: '',
supplierTags: '',
website: '',
established_at: '',
capital: '',
capital_currency: '',
corp_rep: '',
payment_cycle: '',
account_number: '',
address1: '',
zip: '',
email: '',
sex: '',
birth_date: '',
entry_date: '',
department_id: '',
department_position_id: '',
mobile: '',
telephone_area_code: '',
telephone: '',
fax: '',
description: ''
telephone_extension_number: '',
id_number: '',
native_place: '',
graduate_school: '',
specialty: '',
education: '',
userRoles: []
}
}
},
......@@ -57,6 +58,7 @@ export default {
this.$refs.form.getEdit(model.id)
.then((_model) => {
UTIL.flatten(this.model, _model)
this.model.userRoles = _model.userRoles.map(item => item.name)
})
} else {
this.$refs.form.getNew()
......@@ -75,15 +77,15 @@ export default {
},
save () {
let _params = Object.assign({}, setModule(this.model, 'Suppliers'))
let _params = Object.assign({}, setModule(this.model, 'Users'))
let _apiUrl = !this.model.id ? api.saveaccountNew : api.saveaccountEdit
!this.model.id && delete _params['Suppliers[id]']
!this.model.id && delete _params['Users[id]']
this.$refs['form']._validate(() => {
requestAPI(Object.assign(_apiUrl, { method: 'POST' }), _params)
.then((res) => {
this.$refs.sidePopup.close()
this.$message.success('操作成功')
this.$parent.reload()
this.$parent._reload()
}) // save
}) // validate
}
......
......@@ -5,7 +5,10 @@
<el-row :gutter="10">
<el-col :span="24" style="padding-left: 3px;">
<span>
<img class="user-avatar rounded-circle" :src="item.avatar.avatar">{{ item.name }}
<img class="user-avatar rounded-circle" :src="item.avatar.avatar">
<router-link :to="{ path: '/app-v/profile/profile' }">
{{ item.name }}
</router-link>
</span>
</el-col>
<el-col :span="24">
......
......@@ -118,6 +118,11 @@ export default {
servicesTypeIds () {
let ret = this.getArrayByKey('Services', 'type_id')
return ret && [].concat(ret.value)
},
accountSexArray () {
let ret = this.getArrayByKey('Users', 'sex')
return ret && [].concat(ret.value)
}
// company_nature
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment