Commit 5e8ddbf7 authored by daywrite's avatar daywrite

检查员工管理

parent 5c99357b
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
</el-form-item> </el-form-item>
<el-form-item label="性别:" prop="sex" class="ec-clear-left ec-form-item-lg is-required"> <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-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" :key="optKey"
:label="option.name" :label="option.name"
:value="option.key"></el-option> :value="option.key"></el-option>
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
v-model.trim="model.mobile"> v-model.trim="model.mobile">
</el-input> </el-input>
</el-form-item> </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 <el-input
class="ec-input-normal" class="ec-input-normal"
size="mini" size="mini"
...@@ -123,7 +123,7 @@ ...@@ -123,7 +123,7 @@
</el-form-item> </el-form-item>
<el-form-item label="用户角色:" prop="userRoles" class="ec-clear-left is-required"> <el-form-item label="用户角色:" prop="userRoles" class="ec-clear-left is-required">
<el-checkbox-group v-model="model.userRoles"> <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-checkbox-group>
</el-form-item> </el-form-item>
</el-form> </el-form>
...@@ -136,7 +136,7 @@ import settingMixin from '../common/settingMixin' ...@@ -136,7 +136,7 @@ import settingMixin from '../common/settingMixin'
// api // api
// } from '@/lib/commonMixin' // } from '@/lib/commonMixin'
export default { export default {
name: 'accountForim', name: 'accountForm',
mixins: [settingMixin], mixins: [settingMixin],
......
...@@ -32,21 +32,22 @@ export default { ...@@ -32,21 +32,22 @@ export default {
model: { model: {
id: '', id: '',
name: '', name: '',
main_products: '', email: '',
company_nature: '', sex: '',
supplierTags: '', birth_date: '',
website: '', entry_date: '',
established_at: '', department_id: '',
capital: '', department_position_id: '',
capital_currency: '', mobile: '',
corp_rep: '', telephone_area_code: '',
payment_cycle: '',
account_number: '',
address1: '',
zip: '',
telephone: '', telephone: '',
fax: '', telephone_extension_number: '',
description: '' id_number: '',
native_place: '',
graduate_school: '',
specialty: '',
education: '',
userRoles: []
} }
} }
}, },
...@@ -57,6 +58,7 @@ export default { ...@@ -57,6 +58,7 @@ export default {
this.$refs.form.getEdit(model.id) this.$refs.form.getEdit(model.id)
.then((_model) => { .then((_model) => {
UTIL.flatten(this.model, _model) UTIL.flatten(this.model, _model)
this.model.userRoles = _model.userRoles.map(item => item.name)
}) })
} else { } else {
this.$refs.form.getNew() this.$refs.form.getNew()
...@@ -75,15 +77,15 @@ export default { ...@@ -75,15 +77,15 @@ export default {
}, },
save () { 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 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(() => { this.$refs['form']._validate(() => {
requestAPI(Object.assign(_apiUrl, { method: 'POST' }), _params) requestAPI(Object.assign(_apiUrl, { method: 'POST' }), _params)
.then((res) => { .then((res) => {
this.$refs.sidePopup.close() this.$refs.sidePopup.close()
this.$message.success('操作成功') this.$message.success('操作成功')
this.$parent.reload() this.$parent._reload()
}) // save }) // save
}) // validate }) // validate
} }
......
...@@ -5,7 +5,10 @@ ...@@ -5,7 +5,10 @@
<el-row :gutter="10"> <el-row :gutter="10">
<el-col :span="24" style="padding-left: 3px;"> <el-col :span="24" style="padding-left: 3px;">
<span> <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> </span>
</el-col> </el-col>
<el-col :span="24"> <el-col :span="24">
......
...@@ -118,6 +118,11 @@ export default { ...@@ -118,6 +118,11 @@ export default {
servicesTypeIds () { servicesTypeIds () {
let ret = this.getArrayByKey('Services', 'type_id') let ret = this.getArrayByKey('Services', 'type_id')
return ret && [].concat(ret.value) return ret && [].concat(ret.value)
},
accountSexArray () {
let ret = this.getArrayByKey('Users', 'sex')
return ret && [].concat(ret.value)
} }
// company_nature // 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