5 changed files with 393 additions and 406 deletions
@ -1,381 +1,380 @@ |
|||||
<template> |
<template> |
||||
<div v-if="visible" class="van-overlay"></div> |
<div v-if="visible" class="van-overlay"></div> |
||||
<div v-if="visible" class="popup"> |
<div v-if="visible" class="popup"> |
||||
<div class="popup-title">部门查询</div> |
<div class="popup-title">单位查询</div> |
||||
<!-- 返回按钮 --> |
<!-- 返回按钮 --> |
||||
<label class="btn-goback"><van-icon name="arrow-left" @click="next"/></label> |
<label class="btn-goback"><van-icon name="arrow-left" @click="next"/></label> |
||||
<!-- 关闭按钮 --> |
<!-- 关闭按钮 --> |
||||
<label class="close-button" @click="closePopup"></label> |
<label class="close-button" @click="closePopup"></label> |
||||
|
|
||||
<!-- 弹窗的内容 --> |
<!-- 弹窗的内容 --> |
||||
<div class="popup-content"> |
<div class="popup-content"> |
||||
<div class="subsearch"> |
<div class="subsearch"> |
||||
<input class="searchbox" v-model="searchParam.complaintItemName" placeholder="请输入部门名称"/> |
<input class="searchbox" v-model="searchParam.complaintItemName" placeholder="请输入单位名称"/> |
||||
<van-icon class="ibtn-reset" name="clear" @click="cancel()" title="重置"/> |
<van-icon class="ibtn-reset" name="clear" @click="cancel()" title="重置"/> |
||||
<button class='btn-search' @click="queryList()">搜索</button> |
<button class='btn-search' @click="queryList()">搜索</button> |
||||
<button class='btn-search' @click="selectData()">确定</button> |
<button class='btn-search' @click="selectData()">确定</button> |
||||
</div> |
</div> |
||||
<div class="search-result"> |
<div class="search-result"> |
||||
<van-checkbox-group v-model="checked"> |
<van-checkbox-group v-model="checked"> |
||||
<van-cell-group inset> |
<van-cell-group inset> |
||||
<!-- <van-cell v-for="(item, index) in dataList" :key="item" @click="toDrill(item.deptId, item.parentId)" clickable> |
<!-- <van-cell v-for="(item, index) in dataList" :key="item" @click="toDrill(item.deptId, item.parentId)" clickable> |
||||
<div style="display: flex; justify-content: space-between;"> |
<div style="display: flex; justify-content: space-between;"> |
||||
<div style="width: 70%; text-align: left;"> |
<div style="width: 70%; text-align: left;"> |
||||
{{item.deptName}} |
{{item.deptName}} |
||||
</div> |
</div> |
||||
<div style="width: 30%;"><van-icon name="arrow" size="0.35rem" /></div> |
<div style="width: 30%;"><van-icon name="arrow" size="0.35rem" /></div> |
||||
</div> |
</div> |
||||
</van-cell> --> |
</van-cell> --> |
||||
<van-cell v-for="(item, index) in dataList" :key="item"> |
<van-cell v-for="(item, index) in dataList" :key="item"> |
||||
<div style="display: flex; justify-content: space-between;"> |
<div style="display: flex; justify-content: space-between;"> |
||||
<div @click="toggle(item.complaintItemCode)"> |
<div @click="toggle(item.complaintItemCode)"> |
||||
<van-checkbox :name="item.complaintItemCode+';-;'+item.complaintItemName" :ref="el => checkboxRefs[item.complaintItemCode] = el" @click.stop> |
<van-checkbox :name="item.complaintItemCode+';-;'+item.complaintItemName" :ref="el => checkboxRefs[item.complaintItemCode] = el" @click.stop> |
||||
{{item.complaintItemName}} |
{{item.complaintItemName}} |
||||
</van-checkbox> |
</van-checkbox> |
||||
</div> |
</div> |
||||
<div> |
<div> |
||||
<!-- <van-button |
<!-- <van-button |
||||
type="primary" |
type="primary" |
||||
size="mini" |
size="mini" |
||||
icon="add-o" |
icon="add-o" |
||||
@click="toDrill(item.deptId, item.parentId)" |
@click="toDrill(item.deptId, item.parentId)" |
||||
>展开</van-button> --> |
>展开</van-button> --> |
||||
</div> |
</div> |
||||
</div> |
</div> |
||||
|
|
||||
</van-cell> |
|
||||
</van-cell-group> |
|
||||
|
|
||||
<!-- <van-cell-group inset> |
</van-cell> |
||||
<van-cell v-for="(item, index) in userList" :key="item" clickable> |
</van-cell-group> |
||||
<div style="display: flex; justify-content: space-between;"> |
|
||||
<div style="width: 70%;" @click="toggle(item.deptId)"> |
<!-- <van-cell-group inset> |
||||
<van-checkbox :name="item.userId+';-;'+item.userName+';-;'+item.deptId+';-;'+item.dept.deptName" :ref="el => checkboxRefs[item.userId] = el" @click.stop> |
<van-cell v-for="(item, index) in userList" :key="item" clickable> |
||||
{{item.userName}} |
<div style="display: flex; justify-content: space-between;"> |
||||
</van-checkbox> |
<div style="width: 70%;" @click="toggle(item.deptId)"> |
||||
</div> |
<van-checkbox :name="item.userId+';-;'+item.userName+';-;'+item.deptId+';-;'+item.dept.deptName" :ref="el => checkboxRefs[item.userId] = el" @click.stop> |
||||
</div> |
{{item.userName}} |
||||
</van-cell> |
</van-checkbox> |
||||
</van-cell-group> --> |
</div> |
||||
</van-checkbox-group> |
</div> |
||||
</div> |
</van-cell> |
||||
</div> |
</van-cell-group> --> |
||||
</div> |
</van-checkbox-group> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
</template> |
</template> |
||||
|
|
||||
<script> |
<script> |
||||
import {ref} from 'vue' |
import {ref} from 'vue' |
||||
import { queryComplaintItemList } from '@/api/enterprise' |
import { queryComplaintItemList } from '@/api/enterprise' |
||||
import {Icon, showSuccessToast,showToast } from 'vant'; |
import {Icon, showSuccessToast,showToast } from 'vant'; |
||||
|
|
||||
const {useCommon} = $globalStore |
const {useCommon} = $globalStore |
||||
const router = useRouter(); |
const router = useRouter(); |
||||
export default { |
export default { |
||||
props: { |
props: { |
||||
visible: { |
visible: { |
||||
type: Boolean, |
type: Boolean, |
||||
default: false |
default: false |
||||
}, |
}, |
||||
content: { |
content: { |
||||
type: String, |
type: String, |
||||
default: '' |
default: '' |
||||
}, |
}, |
||||
}, |
}, |
||||
data() { |
data() { |
||||
return { |
return { |
||||
searchParam: { |
searchParam: { |
||||
//搜索框 |
//搜索框 |
||||
dataScopeId: useCommon.userId, |
dataScopeId: useCommon.userId, |
||||
deptName: '', |
deptName: '', |
||||
parentId: '0', |
parentId: '0', |
||||
complaintItemName:"", |
complaintItemName:"", |
||||
}, |
}, |
||||
searchKey: "", |
searchKey: "", |
||||
dataList: [], |
dataList: [], |
||||
checked: ref([]), |
checked: ref([]), |
||||
checkboxRefs: ref([]), |
checkboxRefs: ref([]), |
||||
nextParentId: '0', |
nextParentId: '0', |
||||
userList: [], |
userList: [], |
||||
} |
} |
||||
}, |
}, |
||||
created() { |
created() { |
||||
this.queryList() |
this.queryList() |
||||
}, |
}, |
||||
methods: { |
methods: { |
||||
toggle(index) { |
toggle(index) { |
||||
this.checkboxRefs[index].toggle(); |
this.checkboxRefs[index].toggle(); |
||||
}, |
}, |
||||
toDrill(deptId, parentId) { |
toDrill(deptId, parentId) { |
||||
this.nextParentId = parentId; |
this.nextParentId = parentId; |
||||
this.searchParam.parentId = deptId; |
this.searchParam.parentId = deptId; |
||||
this.queryList(); |
this.queryList(); |
||||
}, |
}, |
||||
next() { |
next() { |
||||
if (null != this.nextParentId) { |
if (null != this.nextParentId) { |
||||
this.searchParam.parentId = this.nextParentId; |
this.searchParam.parentId = this.nextParentId; |
||||
this.searchParam.deptName = ""; |
this.searchParam.deptName = ""; |
||||
nextDeptByparentId(this.searchParam, success => { |
nextDeptByparentId(this.searchParam, success => { |
||||
this.nextParentId = success.data.parentId; |
this.nextParentId = success.data.parentId; |
||||
this.queryList(); |
this.queryList(); |
||||
}, error => { |
}, error => { |
||||
}) |
}) |
||||
} |
} |
||||
}, |
}, |
||||
closePopup() { |
closePopup() { |
||||
this.$emit('close'); |
this.$emit('close'); |
||||
}, |
}, |
||||
queryList() { |
queryList() { |
||||
queryComplaintItemList(this.searchParam, success => { |
queryComplaintItemList(this.searchParam, success => { |
||||
if (null != success.rows && success.rows.length > 0) { |
if (null != success.rows && success.rows.length > 0) { |
||||
this.userList = []; |
this.userList = []; |
||||
this.dataList = success.rows |
this.dataList = success.rows |
||||
this.$emit('item-list', success.rows); |
} else { |
||||
} else { |
showToast ("暂无数据!") |
||||
showToast ("暂无数据!") |
} |
||||
} |
}, error => { |
||||
}, error => { |
}) |
||||
}) |
}, |
||||
}, |
queryUserList() { |
||||
queryUserList() { |
if (null == this.searchKey || "" == this.searchKey) { |
||||
if (null == this.searchKey || "" == this.searchKey) { |
showSuccessToast('人员过多, 请输入关键字!'); |
||||
showSuccessToast('人员过多, 请输入关键字!'); |
return; |
||||
return; |
} |
||||
} |
queryUsersNoPermission({"userName": this.searchKey}, success => { |
||||
queryUsersNoPermission({"userName": this.searchKey}, success => { |
this.dataList = []; |
||||
this.dataList = []; |
this.userList = success.data; |
||||
this.userList = success.data; |
}, error => { |
||||
}, error => { |
}); |
||||
}); |
}, |
||||
}, |
cancel() { |
||||
cancel() { |
this.searchParam.complaintItemName = ''; |
||||
this.searchParam.complaintItemName = ''; |
this.queryList() |
||||
this.queryList() |
}, |
||||
}, |
selectData() { |
||||
selectData() { |
let res = []; |
||||
let res = []; |
let checkeds = JSON.parse(JSON.stringify(this.checked)); |
||||
let checkeds = JSON.parse(JSON.stringify(this.checked)); |
for (var i=0; i<checkeds.length; i++) { |
||||
for (var i=0; i<checkeds.length; i++) { |
var item = checkeds[i].split(";-;"); |
||||
var item = checkeds[i].split(";-;"); |
res.push({"deptId":item[0], "deptName":item[1]}); |
||||
res.push({"deptId":item[0], "deptName":item[1]}); |
} |
||||
} |
// this.$emit("reciveData", JSON.parse(JSON.stringify(this.checked))); |
||||
// this.$emit("reciveData", JSON.parse(JSON.stringify(this.checked))); |
this.$emit("reciveData", res); |
||||
this.$emit("reciveData", res); |
this.$emit('close'); |
||||
this.$emit('close'); |
}, |
||||
}, |
}, |
||||
}, |
} |
||||
} |
|
||||
</script> |
</script> |
||||
|
|
||||
<style scoped> |
<style scoped> |
||||
.popup { |
.popup { |
||||
position: fixed; |
position: fixed; |
||||
z-index: 999; |
z-index: 999; |
||||
top: 3rem; |
top: 3rem; |
||||
left: 0; |
left: 0; |
||||
width: 100%; |
width: 100%; |
||||
height: calc(100% - 3rem); |
height: calc(100% - 3rem); |
||||
background: #fff; |
background: #fff; |
||||
overflow: hidden; |
overflow: hidden; |
||||
} |
} |
||||
|
|
||||
.popup-title { |
.popup-title { |
||||
margin: 0.3rem 0 0; |
margin: 0.3rem 0 0; |
||||
width: 100%; |
width: 100%; |
||||
height: 1rem; |
height: 1rem; |
||||
border-bottom: 1px solid #f3f4f5; |
border-bottom: 1px solid #f3f4f5; |
||||
text-align: center; |
text-align: center; |
||||
font-size: 0.42rem; |
font-size: 0.42rem; |
||||
font-weight: 600; |
font-weight: 600; |
||||
} |
} |
||||
|
|
||||
.btn-goback { |
.btn-goback { |
||||
position: absolute; |
position: absolute; |
||||
top: 0.267rem; |
top: 0.267rem; |
||||
left: 0.3rem; |
left: 0.3rem; |
||||
width: 0.8rem; |
width: 0.8rem; |
||||
height: 0.8rem; |
height: 0.8rem; |
||||
font-size: 0.5rem; |
font-size: 0.5rem; |
||||
font-weight: bold; |
font-weight: bold; |
||||
color: #333; |
color: #333; |
||||
line-height: 1.5; |
line-height: 1.5; |
||||
} |
} |
||||
|
|
||||
.close-button { |
.close-button { |
||||
position: absolute; |
position: absolute; |
||||
top: 0.15rem; |
top: 0.15rem; |
||||
right: 0.1rem; |
right: 0.1rem; |
||||
width: 0.8rem; |
width: 0.8rem; |
||||
height: 0.8rem; |
height: 0.8rem; |
||||
background-color: rgba(255, 255, 255, .5); |
background-color: rgba(255, 255, 255, .5); |
||||
border: 0.05rem solid rgba(255, 255, 255, .7); |
border: 0.05rem solid rgba(255, 255, 255, .7); |
||||
border-radius: 50%; |
border-radius: 50%; |
||||
transform: rotate(45deg); |
transform: rotate(45deg); |
||||
} |
} |
||||
|
|
||||
.close-button:before, |
.close-button:before, |
||||
.close-button:after { |
.close-button:after { |
||||
content: ''; |
content: ''; |
||||
position: absolute; |
position: absolute; |
||||
top: 50%; |
top: 50%; |
||||
left: 50%; |
left: 50%; |
||||
background: #333; |
background: #333; |
||||
border-radius: 50%; |
border-radius: 50%; |
||||
transform: translate(-50%, -50%); |
transform: translate(-50%, -50%); |
||||
height: 0.4rem; |
height: 0.4rem; |
||||
width: 0.02rem; |
width: 0.02rem; |
||||
} |
} |
||||
|
|
||||
.close-button:after { |
.close-button:after { |
||||
height: 0.02rem; |
height: 0.02rem; |
||||
width: 0.4rem; |
width: 0.4rem; |
||||
} |
} |
||||
|
|
||||
.popup-content { |
.popup-content { |
||||
margin: 0.25rem 0 0; |
margin: 0.25rem 0 0; |
||||
padding-bottom: 3rem; |
padding-bottom: 3rem; |
||||
width: 100%; |
width: 100%; |
||||
height: calc(100% - 1.6rem); |
height: calc(100% - 1.6rem); |
||||
overflow-y: auto; |
overflow-y: auto; |
||||
font-size: 0.37rem; |
font-size: 0.37rem; |
||||
} |
} |
||||
|
|
||||
.subsearch { |
.subsearch { |
||||
display: flex; |
display: flex; |
||||
align-items: center; |
align-items: center; |
||||
justify-content: space-between; |
justify-content: space-between; |
||||
padding: 1% 0.43rem 3%; |
padding: 1% 0.43rem 3%; |
||||
width: calc(100% - 0.86rem); |
width: calc(100% - 0.86rem); |
||||
height: 1.25rem; |
height: 1.25rem; |
||||
font-size: 0.37rem; |
font-size: 0.37rem; |
||||
} |
} |
||||
|
|
||||
.subsearch .ibtn-reset { |
.subsearch .ibtn-reset { |
||||
margin: 0 0.5rem 0 -1rem; |
margin: 0 0.5rem 0 -1rem; |
||||
width: 1rem; |
width: 1rem; |
||||
color: #cfcbcb; |
color: #cfcbcb; |
||||
font-size: 0.5rem; |
font-size: 0.5rem; |
||||
} |
} |
||||
|
|
||||
.subsearch .btn-search { |
.subsearch .btn-search { |
||||
margin: 0 0.8rem 0 -0.2rem; |
margin: 0 0.8rem 0 -0.2rem; |
||||
width: 20%; |
width: 20%; |
||||
height: 1rem; |
height: 1rem; |
||||
background: #eeeff1 url(/src/assets/images/icon_sou.png) no-repeat; |
background: #eeeff1 url(/src/assets/images/icon_sou.png) no-repeat; |
||||
background-position: left 0.3rem center; |
background-position: left 0.3rem center; |
||||
background-size: auto 50%; |
background-size: auto 50%; |
||||
border-radius: 0 0.15rem 0.15rem 0; |
border-radius: 0 0.15rem 0.15rem 0; |
||||
border: 1px solid rgba(0, 0, 0, .1); |
border: 1px solid rgba(0, 0, 0, .1); |
||||
border-left: 1px solid #eee; |
border-left: 1px solid #eee; |
||||
line-height: 10rem; |
line-height: 10rem; |
||||
overflow: hidden; |
overflow: hidden; |
||||
} |
} |
||||
|
|
||||
.subsearch .btn-search:last-child { |
.subsearch .btn-search:last-child { |
||||
margin-right: 0; |
margin-right: 0; |
||||
border-radius: 0.15rem; |
border-radius: 0.15rem; |
||||
background: #1367fe; |
background: #1367fe; |
||||
border-color: #1367fe; |
border-color: #1367fe; |
||||
color: #fff; |
color: #fff; |
||||
line-height: 1; |
line-height: 1; |
||||
} |
} |
||||
|
|
||||
|
|
||||
.searchbox { |
.searchbox { |
||||
margin: 2% 0; |
margin: 2% 0; |
||||
padding: 0.1rem 1.2rem 0.1rem 0.3rem; |
padding: 0.1rem 1.2rem 0.1rem 0.3rem; |
||||
width: 100%; |
width: 100%; |
||||
height: 1rem; |
height: 1rem; |
||||
/*background: #f6f7fe url(../../assets/images/icon_sou.png) no-repeat; |
/*background: #f6f7fe url(../../assets/images/icon_sou.png) no-repeat; |
||||
background-position: left 0.25rem center; |
background-position: left 0.25rem center; |
||||
background-size: auto 50%;*/ |
background-size: auto 50%;*/ |
||||
box-sizing: border-box; |
box-sizing: border-box; |
||||
border: 1px solid rgba(0, 0, 0, .1); |
border: 1px solid rgba(0, 0, 0, .1); |
||||
border-radius: 0.15rem 0 0 0.15rem; |
border-radius: 0.15rem 0 0 0.15rem; |
||||
color: #999999; |
color: #999999; |
||||
outline: none; |
outline: none; |
||||
} |
} |
||||
|
|
||||
.subtitle { |
.subtitle { |
||||
margin: 0.5rem 0 0.25rem; |
margin: 0.5rem 0 0.25rem; |
||||
font-size: 0.4rem; |
font-size: 0.38rem; |
||||
font-weight: 600; |
font-weight: 600; |
||||
} |
} |
||||
|
|
||||
.quick-item { |
.quick-item { |
||||
display: flex; |
display: flex; |
||||
} |
} |
||||
|
|
||||
.quick-item span { |
.quick-item span { |
||||
display: inline-block; |
display: inline-block; |
||||
margin: 1% 0 2% 3.5%; |
margin: 1% 0 2% 3.5%; |
||||
padding: 2% 3.75%; |
padding: 2% 3.75%; |
||||
background: #f2f3f4; |
background: #f2f3f4; |
||||
border: 0; |
border: 0; |
||||
border-radius: 8px; |
border-radius: 8px; |
||||
color: #4c4c4c; |
color: #4c4c4c; |
||||
} |
} |
||||
|
|
||||
.quick-item span.seled { |
.quick-item span.seled { |
||||
background: #e9f2fb; |
background: #e9f2fb; |
||||
color: #1367fe; |
color: #1367fe; |
||||
} |
} |
||||
|
|
||||
.btnbox { |
.btnbox { |
||||
display: flex; |
display: flex; |
||||
justify-content: center; |
justify-content: center; |
||||
margin: 5% 2%; |
margin: 5% 2%; |
||||
width: 96%; |
width: 96%; |
||||
height: 1.0rem; |
height: 1.0rem; |
||||
} |
} |
||||
|
|
||||
.btn-reset, |
.btn-reset, |
||||
.btn-search { |
.btn-search { |
||||
display: inline-block; |
display: inline-block; |
||||
margin: 0 2%; |
margin: 0 2%; |
||||
padding: 0; |
padding: 0; |
||||
width: 60%; |
width: 60%; |
||||
color: #fff; |
color: #fff; |
||||
font-size: 0.37rem; |
font-size: 0.37rem; |
||||
border-radius: 1rem; |
border-radius: 1rem; |
||||
background: #1367fe; |
background: #1367fe; |
||||
border: 1px solid #1367fe; |
border: 1px solid #1367fe; |
||||
text-align: center; |
text-align: center; |
||||
} |
} |
||||
|
|
||||
.btn-reset { |
.btn-reset { |
||||
width: 35%; |
width: 35%; |
||||
background-color: #fff; |
background-color: #fff; |
||||
border-color: rgba(19, 103, 254, .7); |
border-color: rgba(19, 103, 254, .7); |
||||
color: #1367fe; |
color: #1367fe; |
||||
} |
} |
||||
|
|
||||
.search-result { |
.search-result { |
||||
width: 100%; |
width: 100%; |
||||
height: calc(100% - 3rem); |
height: calc(100% - 3rem); |
||||
padding-bottom: 1rem; |
padding-bottom: 1rem; |
||||
overflow-y: auto; |
overflow-y: auto; |
||||
} |
} |
||||
|
|
||||
.search-result .van-cell-group { |
.search-result .van-cell-group { |
||||
margin: 0; |
margin: 0; |
||||
} |
} |
||||
|
|
||||
.case-item { |
.case-item { |
||||
margin: 3% 2%; |
margin: 3% 2%; |
||||
padding: 2% 0; |
padding: 2% 0; |
||||
width: 96%; |
width: 96%; |
||||
font-size: 0.35rem; |
font-size: 0.35rem; |
||||
border-bottom: 1px solid #f4f4f4; |
border-bottom: 1px solid #f4f4f4; |
||||
color: #999; |
color: #999; |
||||
line-height: 2; |
line-height: 2; |
||||
} |
} |
||||
|
|
||||
.case-title { |
.case-title { |
||||
margin: 2% 0; |
margin: 2% 0; |
||||
font-size: 0.42rem; |
font-size: 0.42rem; |
||||
color: #333; |
color: #333; |
||||
line-height: 1.25; |
line-height: 1.25; |
||||
} |
} |
||||
|
|
||||
|
|
||||
</style> |
</style> |
||||
Loading…
Reference in new issue