|
@ -1,19 +1,31 @@
|
|
|
<template>
|
|
|
<div class='order-list'>
|
|
|
<van-sticky :offset-top="offsetTop">
|
|
|
<div class="top-banner kitbox fs-14 ptb10 pl15">
|
|
|
<div @click="pickDate(1)" class="date-item">{{$moment(startDate).format('YYYY-MM-DD')}}</div>
|
|
|
<div class="ptb5 plr10">至</div>
|
|
|
<div @click="pickDate(2)" class="date-item">{{$moment(endDate).format('YYYY-MM-DD')}}</div>
|
|
|
<div class="pl15 pt2 box-flex-1 tr pr15">
|
|
|
<van-button @click="onSearch" type="info" size="mini">搜索</van-button>
|
|
|
<div class="top-banner fs-14 ">
|
|
|
<div @click="drowMenuShow=false" class="kitbox pl15 search-date ptb10">
|
|
|
<div @click="pickDate(1)" class="date-item">{{$moment(startDate).format('YYYY-MM-DD')}}</div>
|
|
|
<div class="ptb5 plr10">至</div>
|
|
|
<div @click="pickDate(2)" class="date-item">{{$moment(endDate).format('YYYY-MM-DD')}}</div>
|
|
|
<div class="pl15 box-flex-1 tr pr15">
|
|
|
<van-button @click="onSearch" type="info" size="mini">搜索</van-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="drop-menu" :class="{active: drowMenuShow}">
|
|
|
<div class="drop-menu-title tc fs-14" @click="drowMenuShow=!drowMenuShow">
|
|
|
<span class="v-middle">{{selcommunity? selcommunity.hospitalName : '全部社区'}}</span>
|
|
|
<van-icon class="v-middle ml5" name="play" />
|
|
|
</div>
|
|
|
<div class="drop-menu-area kitbox">
|
|
|
<div class="drop-menu-area-left" v-if="townList&&townList.length">
|
|
|
<van-sidebar v-model="activeKey">
|
|
|
<van-sidebar-item v-for="(item, i) in townList" :key="i" :title="item.townName" />
|
|
|
</van-sidebar>
|
|
|
</div>
|
|
|
<div class="drop-menu-area-right">
|
|
|
<div v-for="(item, i) in communityList" :key="i" @click="selcommunity=item;drowMenuShow=false;onSearch()">{{item.hospitalName}}</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<!-- <div class="fs-25 pr15 tr box-flex-1 pt3 c-pr">
|
|
|
<van-dropdown-menu>
|
|
|
<van-dropdown-item ref="dropdown" v-model="value1" :options="option1" />
|
|
|
</van-dropdown-menu>
|
|
|
<van-icon class="block" @click.stop="$refs.dropdown.toggle()" name="filter-o" />
|
|
|
</div> -->
|
|
|
</div>
|
|
|
</van-sticky>
|
|
|
<CustomList
|
|
@ -48,13 +60,21 @@
|
|
|
/>
|
|
|
</van-popup>
|
|
|
|
|
|
<div class="filter-panel">
|
|
|
|
|
|
<div class="bot-banner ptb10 bgc-fff">
|
|
|
<div class="kitbox fs-14">
|
|
|
<div class="pr40 box-v-middle pl15">
|
|
|
共 {{totalCount}} 笔订单
|
|
|
</div>
|
|
|
<!-- <div class="box-flex-1 plr15 tr">
|
|
|
商品总金额 ¥{{totalMoney}}
|
|
|
</div> -->
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
import medicineAbinetApi from '@/api/api-medicineAbinet'
|
|
|
import { findOneUser} from "@/api/login";
|
|
|
export default{
|
|
|
name: 'orderList',
|
|
|
data(){
|
|
@ -66,15 +86,29 @@ export default{
|
|
|
startDate: this.$moment().subtract(30, 'days'),
|
|
|
endDate: new Date(),
|
|
|
pickType: 1,
|
|
|
totalCount: 0,
|
|
|
totalMoney: 0,
|
|
|
activeKey: 0,
|
|
|
|
|
|
value1: '',
|
|
|
option1: [
|
|
|
{ text: '全部', value: 0 },
|
|
|
defaultOption: [
|
|
|
{ townName: '全部', townCode: "", children: [{hospitalCode: '', hospitalName: '全部'}] },
|
|
|
],
|
|
|
drowMenuShow: false,
|
|
|
|
|
|
townList: [],
|
|
|
communityList: [],
|
|
|
selcommunity: '',
|
|
|
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
|
activeKey(n){
|
|
|
this.loadChildren()
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
|
|
|
this.getOrgList()
|
|
|
},
|
|
|
methods:{
|
|
|
onLoad({page, pageSize, searchText}){
|
|
@ -83,8 +117,8 @@ export default{
|
|
|
startTime: startDate? this.$moment(startDate).format('YYYY-MM-DD 00:00:00') : '',
|
|
|
endTime: endDate? this.$moment(endDate).format('YYYY-MM-DD 23:59:59') : '',
|
|
|
userId: this.user.id,
|
|
|
community: this.selcommunity? this.selcommunity.hospitalCode : '',
|
|
|
// content: searchForm.content,
|
|
|
// community: len? this.community[len-1] : '',
|
|
|
// sellState: searchForm.sellStatus,
|
|
|
page: page,
|
|
|
size: pageSize
|
|
@ -95,17 +129,23 @@ export default{
|
|
|
.then(res=>{
|
|
|
console.log('orderList', res)
|
|
|
if(res.status == 200){
|
|
|
this.totalCount = res.totalCount
|
|
|
var list = res.detailModelList
|
|
|
this.list = page==1? list : this.list.concat(list)
|
|
|
this.$refs.customList.endLoad(!res.detailModelList || res.detailModelList.length==0, this.list.length)
|
|
|
} else {
|
|
|
this.$refs.customList.endLoad(false, true)
|
|
|
this.onLoadError()
|
|
|
}
|
|
|
}).catch(err=>{
|
|
|
console.error(err)
|
|
|
this.$refs.customList.endLoad(false, true)
|
|
|
this.onLoadError()
|
|
|
})
|
|
|
},
|
|
|
onLoadError(){
|
|
|
this.list = []
|
|
|
this.totalCount = 0
|
|
|
this.$refs.customList.endLoad(false, true)
|
|
|
},
|
|
|
pickDate(pickType){
|
|
|
this.pickType = pickType
|
|
|
this.currentDate = pickType ==1? this.startDate : this.endDate
|
|
@ -123,6 +163,70 @@ export default{
|
|
|
onSearch(){
|
|
|
this.list = []
|
|
|
this.$refs.customList.refresh(true)
|
|
|
},
|
|
|
getOrgList(){
|
|
|
findOneUser({
|
|
|
id: this.user.id
|
|
|
}).then(async res => {
|
|
|
// "saasAdmin": "管理员"; regionAdmin" "区域管理员" ; communityAdmin "社区管理员" ; "replenisher": "补货员"
|
|
|
var role = this.user.curRoleCode
|
|
|
var userArea = res.obj.userArea
|
|
|
var townList = [].concat(this.defaultOption)
|
|
|
if(role=='communityAdmin' || role=="replenisher"){
|
|
|
var g = _.groupBy(userArea, 'town')
|
|
|
for(var k in g){
|
|
|
var tmp = g[k][0].concat([])
|
|
|
tmp.children = g[k]
|
|
|
townList.push(tmp)
|
|
|
}
|
|
|
this.townList = townList
|
|
|
} else {
|
|
|
if(role == 'regionAdmin'){
|
|
|
userArea.forEach(v => {
|
|
|
v.children = []
|
|
|
});
|
|
|
this.townList = townList.concat(userArea)
|
|
|
} else if(role=='saasAdmin'){
|
|
|
await medicineAbinetApi
|
|
|
.baseTownList({ filters: "city=350200"})//写死厦门市
|
|
|
.then(res => {
|
|
|
console.log('baseTownList', res)
|
|
|
if (res.status == 200) {
|
|
|
var detailModelList = res.detailModelList;
|
|
|
detailModelList.forEach((item) => {
|
|
|
item.town = item.code
|
|
|
item.townName = item.name
|
|
|
item.children = [];
|
|
|
});
|
|
|
this.townList = townList.concat(detailModelList)
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
this.loadChildren()
|
|
|
});
|
|
|
},
|
|
|
async loadChildren(){
|
|
|
var item = this.townList[this.activeKey]
|
|
|
if(!item.children || !item.children.length){
|
|
|
await medicineAbinetApi
|
|
|
.findOrgList({ code: item.town, paeg: 1, pageSize: 999 })
|
|
|
.then(res => {
|
|
|
console.log('findOrgList', res)
|
|
|
if (res.status == 200) {
|
|
|
res.detailModelList.forEach(v=>{
|
|
|
v.hospitalName = v.name
|
|
|
v.hospitalCode = v.code
|
|
|
})
|
|
|
item.children = res.detailModelList
|
|
|
}
|
|
|
})
|
|
|
.catch(err=>{
|
|
|
item.children = []
|
|
|
})
|
|
|
}
|
|
|
|
|
|
this.communityList = item.children
|
|
|
}
|
|
|
},
|
|
|
}
|
|
@ -133,34 +237,117 @@ export default{
|
|
|
height: calc(100vh - 50px);
|
|
|
}
|
|
|
.top-banner{
|
|
|
background: #f2f3f5;
|
|
|
.search-date{
|
|
|
background: #f2f3f5;
|
|
|
}
|
|
|
.date-item{
|
|
|
padding: 5px 10px;
|
|
|
width: 110px;
|
|
|
text-align: center;
|
|
|
padding: 5px 0;
|
|
|
border: 1px solid #ccc;
|
|
|
background: #fff;
|
|
|
color: #333;
|
|
|
border-radius: 30px;
|
|
|
// line-height: 21px;
|
|
|
}
|
|
|
.van-button--mini{
|
|
|
height: 28px;
|
|
|
width: 60px;
|
|
|
}
|
|
|
::v-deep .van-dropdown-menu__bar{
|
|
|
position: absolute;
|
|
|
bottom: -10px;
|
|
|
.van-dropdown-menu__item{
|
|
|
.drop-menu{
|
|
|
position: relative;
|
|
|
.van-sidebar-item--select::before{
|
|
|
background-color: #17b3ec;
|
|
|
}
|
|
|
.drop-menu-title{
|
|
|
padding: 10px 0;
|
|
|
background: #fff;
|
|
|
.van-icon{
|
|
|
transform: rotate(90deg);
|
|
|
}
|
|
|
}
|
|
|
.drop-menu-area{
|
|
|
position: absolute;
|
|
|
width: 100%;
|
|
|
left: 0;
|
|
|
display: none;
|
|
|
border-top: 1px solid #e1e1e1;
|
|
|
height: calc(100% - 39px);
|
|
|
.drop-menu-area-right{
|
|
|
height: 100%;
|
|
|
overflow-y: auto;
|
|
|
background: #fff;
|
|
|
-webkit-box-flex: 1;
|
|
|
>div{
|
|
|
padding: 10px 15px;
|
|
|
border-bottom: 1px solid #e1e1e1;
|
|
|
&:last-child{
|
|
|
border-bottom: 0;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
&.active{
|
|
|
background: rgba($color: #000000, $alpha: .4);
|
|
|
height: calc(100vh - 49px);
|
|
|
.drop-menu-area{
|
|
|
display: -webkit-box;
|
|
|
}
|
|
|
.drop-menu-title{
|
|
|
color: #17b3ec;
|
|
|
.van-icon{
|
|
|
transform: rotate(-90deg);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
// ::v-deep .van-dropdown-menu__bar{
|
|
|
// position: absolute;
|
|
|
// bottom: -10px;
|
|
|
// .van-dropdown-menu__item{
|
|
|
// display: none;
|
|
|
// }
|
|
|
// }
|
|
|
}
|
|
|
.list{
|
|
|
.item{
|
|
|
border: 1px solid #e1e1e1;
|
|
|
background: #fff;
|
|
|
margin-bottom: 10px;
|
|
|
&:last-child{
|
|
|
margin-bottom: 0;
|
|
|
margin-top: 10px;
|
|
|
// margin-bottom: 10px;
|
|
|
// &:last-child{
|
|
|
// margin-bottom: 0;
|
|
|
// }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
.bot-banner{
|
|
|
position: fixed;
|
|
|
bottom: 0;
|
|
|
left: 0;
|
|
|
width: 100%;
|
|
|
box-shadow: 0 0 5px #ccc;
|
|
|
}
|
|
|
::v-deep .van-list__placeholder{
|
|
|
height: 40px;
|
|
|
}
|
|
|
}
|
|
|
</style>
|
|
|
|
|
|
<style lang="scss">
|
|
|
.mainNobotHasTop{
|
|
|
.order-list{
|
|
|
.custom-list {
|
|
|
height: calc(100vh - 176px);
|
|
|
.search{
|
|
|
top: 96px;
|
|
|
}
|
|
|
}
|
|
|
.top-banner{
|
|
|
.drop-menu{
|
|
|
&.active{
|
|
|
height: calc(100vh - 95px);
|
|
|
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|