Commit 2fa5029d authored by Mac's avatar Mac

1

parent 9547daf7
......@@ -9,13 +9,22 @@
:label="label"
:class="classStr"
:dense ='densetype'
:reactive-rules = 'reactiveRules'
emit-value
map-options
clearable
:use-input="useInput"
@input="resetSearch"
@filter="filterFn"
>
<template v-slot:no-option>
<q-item>
<q-item-section class="text-grey">
未找到相关数据
</q-item-section>
</q-item>
</template>
</q-select>
</template>
......@@ -38,7 +47,7 @@
type: Array,
default: []
},
//是否紧凑
densetype:{
type: Boolean,
default: false
......@@ -48,6 +57,11 @@
type: Boolean,
default: false
},
//是否验证
reactiveRules:{
type: Boolean,
default: false
},
//选项的值
optionValue: {
type: String,
......@@ -76,24 +90,25 @@
}
},
created(){
this.vdata_model = this.vModel;//赋值
this.vdata_model = this.vModel.toString();//赋值
this.newData = this.Data
},
methods:{
resetSearch(){
let data= this.vdata_model.toString()
let data= this.vdata_model!=null ? this.vdata_model.toString():'';
this.$emit('returnData',data ,this.type);
},
filterFn(val, update) {
update(() => {
let Name = this.optionLabel
if (val === '') {
this.newData = JSON.parse(JSON.stringify(this.Data))
} else {
const needle = val.toLowerCase()
let that = this
that.newData=[]
that.newData = that.Data.filter(v => v.SName.indexOf(needle) > -1)
that.newData = that.Data.filter(v => v[Name].indexOf(needle) > -1)
}
})
......
......@@ -7,9 +7,25 @@
<q-card-section class="q-pt-none scroll" style="max-height: 70vh">
<div class="text-caption q-mb-lg q-px-md text-grey-6">部门信息</div>
<div class="row wrap">
<q-select filled stack-label option-value="SId" option-label="SName" v-model="objOption.School_Id"
ref="School_Id" :options="schoolList" label="所属校区" :dense="false" class="col-6 q-pr-lg q-pb-lg" emit-value
map-options />
<!-- <q-select filled stack-label option-value="SId" option-label="SName" v-model="objOption.School_Id"-->
<!-- ref="School_Id" :options="schoolList" label="所属校区" :dense="false" class="col-6 q-pr-lg q-pb-lg" emit-value-->
<!-- map-options />-->
<div class="col-6">
<selectSearch
classStr="col-12 q-pr-lg q-pb-lg"
:Data='schoolList'
optionValue="SId"
optionLabel="SName"
:densetype="false"
:vModel="objOption.School_Id"
label="所属校区"
@returnData="returnData"
:useInput="true"
:reactiveRules="false"
type="1"
>
</selectSearch>
</div>
<q-input filled stack-label maxlength="20" :dense="false" v-model="objOption.DeptName" ref="DeptName"
class="col-6 q-pr-lg q-pb-lg" label="部门名称" :rules="[val => !!val || '请填写部门名称']" />
<q-select filled stack-label option-value="value" option-label="label" v-model="objOption.DeptTier"
......@@ -52,6 +68,8 @@
<script>
import selectTree from '../common/select-tree'
import selectSearch from '../../components/common/select-search'
import {
getDeptTree,
saveDeptInfo,
......@@ -74,7 +92,8 @@
}
},
components: {
selectTree
selectTree,
selectSearch
},
data() {
return {
......@@ -86,7 +105,7 @@
DeptTel: "", //部门联系电话
ManagerIds: "", //部门负责人编号
Status: 0, //状态(0-正常,1-禁用),
School_Id: 0, //校区编号
School_Id: '', //校区编号
DeptTier: 0, //部门层级
DeptSort: 0, //部门排序
},
......@@ -193,7 +212,7 @@
this.objOption.Status = 0;
this.objOption.DeptSort = 0;
this.objOption.DeptTier = 0;
this.objOption.School_Id = 0;
this.objOption.School_Id = '';
this.tempManager = [];
}
},
......@@ -232,6 +251,12 @@
}).catch(() => {
this.saveLoading = false
})
},
returnData(data,type){
if(type==1){
this.objOption.School_Id = data;
}
}
},
}
......
......@@ -18,6 +18,7 @@
label="校区"
@returnData="returnData"
:useInput="true"
:reactiveRules="false"
type="1"
>
......
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