Commit f38ab0df authored by 罗超's avatar 罗超

1

parent 95400b17
...@@ -13,8 +13,17 @@ ...@@ -13,8 +13,17 @@
公告审批人: 公告审批人:
</div> </div>
<div class="col-3"> <div class="col-3">
<q-select v-model="msg.Content" :options="EmployeeListOption" color="primary" filled clearable <q-select option-value="Id" option-label="EmployeeName" color="primary" filled
option-label="EmployeeName" option-value="Id" ref="Admin" emit-value map-options :rules="[val => !!val|| '请选择公告审批人']"/> :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>
<div class="col-3" style="padding:18px 0 0 10px;color:gray"> <div class="col-3" style="padding:18px 0 0 10px;color:gray">
</div> </div>
...@@ -50,6 +59,7 @@ ...@@ -50,6 +59,7 @@
Content: 0 Content: 0
}, },
EmployeeListOption: [], EmployeeListOption: [],
allEmployeeListOption: [],
} }
}, },
created() {}, created() {},
...@@ -67,9 +77,22 @@ ...@@ -67,9 +77,22 @@
queryEmployee(qMsg).then(res => { queryEmployee(qMsg).then(res => {
if (res.Code == 1) { if (res.Code == 1) {
this.EmployeeListOption = res.Data; this.EmployeeListOption = res.Data;
this.allEmployeeListOption = res.Data;
} }
}).catch(() => {}) }).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() { getData() {
getConten({}).then(res => { getConten({}).then(res => {
if (res.Code === 1) { if (res.Code === 1) {
...@@ -81,12 +104,12 @@ ...@@ -81,12 +104,12 @@
this.$refs.Admin.validate(); this.$refs.Admin.validate();
if (!this.$refs.Admin.hasError) { if (!this.$refs.Admin.hasError) {
setConten(this.msg).then(res => { setConten(this.msg).then(res => {
if(res.Code===1){ if (res.Code === 1) {
this.$message.success('操作成功') this.$message.success('操作成功')
this.getConten(); this.getConten();
}else{ } else {
this.$message.error(res.Message) 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