You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

159 lines
4.0 KiB

2 years ago
import {getparameter} from "@/api/system/dictionary.js"
export default {
data() {
return {
// 自定义表单的 固定字段
defaultFormList: [{
name: '姓名',
field: 'username',
rule: 'required',
edit_input: "text",
2 years ago
help: '请输入姓名'
2 years ago
}, {
name: '性别',
field: 'sex',
rule: 'required',
edit_input: "text",
2 years ago
help: '请选择性别'
},{
2 years ago
name: '联系方式',
field: 'mobile',
rule: 'required',
edit_input: "text",
2 years ago
help: '请输入联系方式'
2 years ago
}, {
name: '出生日期',
field: 'birthday',
rule: '',
edit_input: "text",
2 years ago
help: '请选择出生日期'
2 years ago
}, {
name: '邮箱',
field: 'email',
rule: '',
edit_input: "text",
2 years ago
help: '请输入邮箱'
2 years ago
}, {
name: '公司名称',
field: 'company_name',
rule: '',
edit_input: "text",
2 years ago
help: '请输入公司名称'
2 years ago
}, {
name: '职务',
field: 'company_position',
rule: '',
edit_input: "text",
2 years ago
help: '请选择职务'
2 years ago
}],
// 自定义表单的 扩展字段 可填可不填
2 years ago
selectFormList: [ {
name: '身份证号',
field: 'idcard',
rule: 'idcard',
edit_input: "text",
help: '请输入身份证号',
need_fill: 0,
belong_user: 1,
select_item: [],
is_open: false,
}, {
2 years ago
name: '企业性质',
field: 'company_type',
rule: '',
2 years ago
edit_input: "radio",
help: '请选择企业性质',
2 years ago
need_fill: 0,
belong_user: 1,
select_item: [],
is_open: false, // 控制开启关闭的 参数不做保存
}, {
name: '所在区域',
field: 'company_area',
rule: '',
2 years ago
edit_input: "radio",
help: '请选择所在区域',
2 years ago
need_fill: 0,
belong_user: 1,
select_item: [],
is_open: false
}, {
name: '所属行业',
field: 'company_industry',
rule: '',
2 years ago
edit_input: "radio",
help: '请选择所属行业',
2 years ago
need_fill: 0,
belong_user: 1,
select_item: [],
is_open: false
}, {
name: '人才类型',
field: 'type',
rule: '',
2 years ago
edit_input: "radio",
help: '请选择人才类型',
2 years ago
need_fill: 0,
belong_user: 1,
select_item: [],
is_open: false
}, {
name: '学历',
field: 'education',
rule: '',
2 years ago
edit_input: "radio",
help: '请选择学历',
2 years ago
need_fill: 0,
belong_user: 1,
select_item: [],
is_open: false
}],
formSelect:{
company_position:[],
company_type:[],
company_area:[],
company_industry:[],
type:[],
education:[]
},
}
},
computed: {},
created() {
this.getAllPara()
},
mounted() {},
methods: {
getAllPara(){
2 years ago
let number = ['company_position','company_type','company_area','company_industry','type','education']
2 years ago
getparameter({
number:number
}).then(res=>{
2 years ago
// 获取数据字典插入到 select中
2 years ago
res.map(item=>{
for(var k in this.formSelect){
if(item.number===k){
this.formSelect[k] = item.detail
}
}
})
2 years ago
// 数据插入到 selectFormList 的select_item中{key:'',value:''}
this.selectFormList.map(sform=>{
for(var k in this.formSelect){
if(sform.field===k){
this.formSelect[k].map(kf=>{
sform.select_item.push({
key:kf.value,
value:kf.value
})
})
}
}
})
console.log("this.selectFormList123",this.selectFormList)
2 years ago
})
}
},
};