Commit 2fa5029d authored by Mac's avatar Mac

1

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