|
@@ -10,7 +10,13 @@ export default {
|
|
|
name: 'roster-edit',
|
|
|
data () {
|
|
|
return {
|
|
|
- items: [
|
|
|
+ query: {},
|
|
|
+ isEdit: false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ items () {
|
|
|
+ return [
|
|
|
{ label: '上级机构', prop: 'parentOrganizationName', type: 'input', options: { placeholder: '请输入上级机构' }, rules: { required: true, message: '请输入上级机构', trigger: 'blur' } },
|
|
|
{ label: '部门名称', prop: 'deptName', type: 'input', options: { placeholder: '请输入部门名称' }, rules: { required: true, message: '请输入部门名称', trigger: 'blur' } },
|
|
|
{ label: '员工名称', prop: 'employeeName', type: 'input', options: { placeholder: '请输入员工名称' }, rules: { required: true, message: '请输入员工名称', trigger: 'blur' } },
|
|
@@ -19,7 +25,13 @@ export default {
|
|
|
{ label: '岗位序列', prop: 'positionSequence', type: 'input', options: { placeholder: '请输入岗位序列' }, rules: [{ required: true, message: '请输入岗位序列', trigger: 'blur' }] },
|
|
|
{ label: '岗位类别', prop: 'positionCategory', type: 'input', options: { placeholder: '请输入岗位类别' }, rules: [{ required: true, message: '请输入岗位类别', trigger: 'blur' }] },
|
|
|
{ label: '职务层级', prop: 'jobLevel', type: 'input', options: { placeholder: '请输入职务层级' }, rules: [{ required: true, message: '请输入职务层级', trigger: 'blur' }] },
|
|
|
- { label: '通行证号', prop: 'passes', type: 'input', options: { placeholder: '请输入通行证号' }, rules: [{ required: true, message: '请输入通行证号', trigger: 'blur' }] },
|
|
|
+ {
|
|
|
+ label: '通行证号',
|
|
|
+ prop: 'passes',
|
|
|
+ type: 'input',
|
|
|
+ options: { disabled: this.isEdit, placeholder: '请输入通行证号' },
|
|
|
+ rules: [{ required: true, message: '请输入通行证号', trigger: 'blur' }]
|
|
|
+ },
|
|
|
{
|
|
|
label: '工行时间',
|
|
|
prop: 'tradeUnionsTime',
|
|
@@ -29,30 +41,25 @@ export default {
|
|
|
},
|
|
|
{ label: '薪酬档次', prop: 'salaryCategory', type: 'number', options: { placeholder: '薪酬档次' }, rules: [{ required: true, message: '请输入薪酬档次', trigger: 'blur' }] },
|
|
|
{ label: '薪酬级别', prop: 'salaryLevel', type: 'number', options: { placeholder: '薪酬级别' }, rules: [{ required: true, message: '请输入薪酬级别', trigger: 'blur' }] }
|
|
|
- ],
|
|
|
- query: {}
|
|
|
+ ]
|
|
|
}
|
|
|
},
|
|
|
- created () {
|
|
|
- this.init()
|
|
|
- },
|
|
|
methods: {
|
|
|
- init () {
|
|
|
+ open (item) {
|
|
|
+ console.log(item)
|
|
|
+
|
|
|
this.query = this.items.reduce((res, item) => {
|
|
|
res[item.prop] = null
|
|
|
return res
|
|
|
}, {})
|
|
|
- },
|
|
|
- open (item) {
|
|
|
+ this.$refs.editDialog.open()
|
|
|
+ this.isEdit = Boolean(item)
|
|
|
if (item) {
|
|
|
Object.keys(this.query).forEach(key => {
|
|
|
this.query[key] = item[key]
|
|
|
})
|
|
|
this.query.personnelCode = item.personnelCode
|
|
|
- } else {
|
|
|
- this.init()
|
|
|
}
|
|
|
- this.$refs.editDialog.open()
|
|
|
},
|
|
|
handleSaveEdit () {
|
|
|
this.$refs.formRef.validate(async valid => {
|