Commit f38ab0df authored by 罗超's avatar 罗超

1

parent 95400b17
......@@ -13,8 +13,17 @@
公告审批人:
</div>
<div class="col-3">
<q-select v-model="msg.Content" :options="EmployeeListOption" color="primary" filled clearable
option-label="EmployeeName" option-value="Id" ref="Admin" emit-value map-options :rules="[val => !!val|| '请选择公告审批人']"/>
<q-select option-value="Id" option-label="EmployeeName" color="primary" filled
:rules="[val => !!val|| '请选择公告审批人']" v-model="msg.Content" use-input clearable @filter="filterFn"
:options="EmployeeListOption" emit-value map-options ref="Admin">
<template v-slot:no-option>
<q-item>
<q-item-section class="text-grey">
未找到相关数据
</q-item-section>
</q-item>
</template>
</q-select>
</div>
<div class="col-3" style="padding:18px 0 0 10px;color:gray">
</div>
......@@ -50,6 +59,7 @@
Content: 0
},
EmployeeListOption: [],
allEmployeeListOption: [],
}
},
created() {},
......@@ -67,9 +77,22 @@
queryEmployee(qMsg).then(res => {
if (res.Code == 1) {
this.EmployeeListOption = res.Data;
this.allEmployeeListOption = res.Data;
}
}).catch(() => {})
},
//筛选员工
filterFn(val, update) {
update(() => {
if (val === '') {
this.EmployeeListOption = JSON.parse(JSON.stringify(this.allEmployeeListOption))
} else {
const needle = val.toLowerCase();
this.EmployeeListOption = this.allEmployeeListOption.filter(v => v.EmployeeName.toLowerCase().indexOf(
needle) > -1);
}
})
},
getData() {
getConten({}).then(res => {
if (res.Code === 1) {
......@@ -81,12 +104,12 @@
this.$refs.Admin.validate();
if (!this.$refs.Admin.hasError) {
setConten(this.msg).then(res => {
if(res.Code===1){
this.$message.success('操作成功')
this.getConten();
}else{
this.$message.error(res.Message)
}
if (res.Code === 1) {
this.$message.success('操作成功')
this.getConten();
} else {
this.$message.error(res.Message)
}
})
}
}
......
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