Commit 3fcd6391 authored by youjie's avatar youjie

no message

parent 151a5169
......@@ -133,11 +133,16 @@
</el-form-item>
</el-col> -->
<el-col :span="4">
<el-form-item label="公司" prop="TargetId">
<el-form-item v-if="titleType==1" label="公司" prop="TargetId">
<el-select filterable v-model='addMsg.TargetId' @change="getType">
<el-option v-for="item in CompanyList" :key="item.Id" :value="item.Id" :label="item.BName"></el-option>
</el-select>
</el-form-item>
<el-form-item v-else label="职员" prop="TargetId">
<el-select filterable v-model='addMsg.TargetId' @change="getType">
<el-option v-for="item in EmployeeList" :key="item.EmployeeId" :value="item.EmployeeId" :label="item.EmName"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="代码" prop="ItemCode">
......@@ -171,7 +176,7 @@
rules: { //表单必填验证
TargetId: [{
required: true,
message: '请选择公司名称',
message: '',
trigger: 'change'
}],
ItemCode: [{
......@@ -211,9 +216,17 @@
loading: false,
CompanyList:[],
getCompanyMsg:{ // 公司
RB_Group_Id:'0',
Status:'0',
},
RB_Group_Id:'0',
Status:'0',
},
employeeMsg:{ // 员工
GroupId:'',
BranchId:-1,
DepartmentId:0,
PostId:0,
IsLeave:0,
},
EmployeeList:[]
}
},
created() {
......@@ -221,6 +234,7 @@
this.getCompanyMsg.RB_Group_Id = userInfo.RB_Group_id; //集团ID
this.getList();
this.getCompanyList()
this.getEmployee()
},
mounted() {
......@@ -262,16 +276,37 @@
}else{}
},err=>{})
},
getEmployee() { //员工
this.apipost('admin_get_EmployeeGetList', this.employeeMsg, res => {
if(res.data.resultCode == 1) {
this.EmployeeList = res.data.data;
}
}, err => {})
},
// 获取金蝶项目名称
getType(ID){
this.CompanyList.forEach(item=>{
if(item.Id==ID){
this.addMsg.TargetName = item.BName
}
})
// 1公司 2职员
if(this.titleType==1){
this.CompanyList.forEach(item=>{
if(item.Id==ID){
this.addMsg.TargetName = item.BName
}
})
}else{
this.EmployeeList.forEach(item=>{
if(item.EmployeeId==ID){
this.addMsg.TargetName = item.EmName
}
})
}
},
submitForm(addMsg) { //提交创建、修改表单
let that = this;
if(this.titleType==1){
this.rules.TargetId[0].message = '请选择公司名称'
}else{
this.rules.TargetId[0].message = '请选择职员名称'
}
that.$refs[addMsg].validate((valid) => {
if (valid) {
that.addFlightmodule()
......
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