123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380 |
- <template>
- <view class="main">
- <NavBar :userInfo="userInfo" @updateInfo="updateUser" />
- <view class="body">
- <view class="tab-box">
- <view class="tab-bar">
- <view class="tab_item" v-for="(tab, index) in tabList" :key="index"
- :class="{'active':tabActive==index}" @click="checkIndex(index)">
- <text class="text">{{tab.title}}{{index===0?"("+orderList.length+")":""}}</text>
- </view>
- </view>
- <view class="search-bar">
- <view v-if="tabActive === 0" class="today">
- <view class="search">
- <uni-easyinput prefixIcon="search" v-model="searchVal" placeholder="请输入姓名" />
- </view>
- <button type="primary" @click="handleSearch" class="search-button">搜索</button>
- <button type="primary" @click="handleRefresh" class="refresh">刷新</button>
- </view>
- <view v-else class="history">
- <view class="searchchoice">
- <view class="row1">
- <view class="timequan">
- <text class="time_t">时间区间:</text>
- <uni-datetime-picker v-model="datetimerange" type="datetimerange" :hide-second="true" rangeSeparator=" - " />
- </view>
- <view class="office">
- <view class="uni-list-cell-left office_t">
- 科室:
- </view>
- <picker @change="handleGetOffice" :value="officeIndex" :range="officeArr">
- <view class="uni-input">{{officeArr[officeIndex]}}</view>
- </picker>
- </view>
- </view>
- <view class="row2">
- <view class="presid">
- <picker @change="handleGetType" :value="typeIndex" :range="typeArr">
- <view class="uni-input">{{typeArr[typeIndex]}}</view>
- </picker>
- </view>
- <view v-if="typeIndex === 0" class="search">
- <uni-easyinput prefixIcon="search" v-model="searchName" placeholder="请输入姓名" />
- </view>
- <view v-else class="search">
- <uni-easyinput prefixIcon="search" v-model="searchPres" placeholder="请输入处方号" />
- </view>
- <button type="primary" @click="handleSearch" class="search-button">搜索</button>
- </view>
- <view class="row3">
- <view class="tag-view" v-for="(v, i) in tags" :key="i">
- <uni-tag :circle="true" :inverted="!searchTags.includes(v)" :text=v type="primary" @click="handleGetTags(v)" />
- </view>
- </view>
- </view>
- </view>
- </view>
- </view>
- <view class="tab-content">
- <view class="order-list">
- <scroll-view v-if="orderList.length > 0" class="order-list-wrap" scroll-y="true" :scroll-top="50">
- <template v-for="(v,i) in orderList" :key="i">
- <orderCard v-if="v" :v="v" :index="i" :c=tabActive class="order-card"
- @update-list="updateList"
- />
- </template>
- </scroll-view>
- <view v-else class="text">-- 没有更多数据 --</view>
- </view>
- <view v-if="isBottom" class="order-bottom">
- <view class="text">-- 没有更多数据 --</view>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script setup>
- import NavBar from "@/components/nav-bar/nav-bar.vue"
- import OrderCard from "@/components/order-card/order-card.vue"
- import { onMounted,ref } from 'vue'
- const userInfo = ref({})
- const searchVal = ref('')
- const tabList = ref([
- {title:"今日待完成", status: 0},
- {title:"历史处方", status: 1},
- ])
- const currentStatus = ref(0)
- const tabActive = ref(1) // 当前tab Index
- const tabName = ref('今日待完成') // 当前tab Name
- // const tags = ref([])
- const orderList = ref([
- {prescriptionTime:'2023-07-06 14:54', faceurl:'/static/hz.png',name:'张三三',sex: '女',age: 23,disName:'胃脘痛病',symName:'脾胃虚寒证',deployState:'调配',preNo:10230516091026,department:'中医内科',dosageForm:'汤剂',number:3,prescriptionSum:135.62,preMzZy:'1'},
- {prescriptionTime:'2023-07-06 14:54', faceurl:'/static/hz.png',name:'张三三',sex: '女',age: 23,disName:'胃脘痛病',symName:'脾胃虚寒证',deployState:'调配',preNo:10230516091026,department:'中医内科',dosageForm:'汤剂',number:3,prescriptionSum:135.62,preMzZy:'1'},
- {prescriptionTime:'2023-07-06 14:54', faceurl:'/static/hz.png',name:'张三三',sex: '女',age: 23,disName:'胃脘痛病',symName:'脾胃虚寒证',deployState:'调配',preNo:10230516091026,department:'中医内科',dosageForm:'汤剂',number:3,prescriptionSum:135.62,preMzZy:'2'},
- {prescriptionTime:'2023-07-06 14:54', faceurl:'/static/hz.png',name:'张三三',sex: '女',age: 23,disName:'胃脘痛病',symName:'脾胃虚寒证',deployState:'调配',preNo:10230516091026,department:'中医内科',dosageForm:'汤剂',number:3,prescriptionSum:135.62,preMzZy:'1'},
- {prescriptionTime:'2023-07-06 14:54', faceurl:'/static/hz.png',name:'张三三',sex: '女',age: 23,disName:'胃脘痛病',symName:'脾胃虚寒证',deployState:'调配',preNo:10230516091026,department:'中医内科',dosageForm:'汤剂',number:3,prescriptionSum:135.62,preMzZy:'2'}
- ])
- const isBottom = ref(false) // 是否触底
- const datetimerange = ref([])
- const officeArr = ref(['全部','中医骨伤科门诊一','中医内科门诊一','中医儿科门诊'])
- const officeIndex = ref(0)
- const typeArr = ref(['姓名:','处方号:'])
- const typeIndex = ref(0)
- const searchName = ref('')
- const searchPres = ref('')
- const searchTags = ref([])
- const tags = ref(['全部','门诊','住院','男','女','煎煮','发药'])
- const page = ref(0)
- onMounted(() => {
- })
- // 子传父,更新userInfo
- const updateUser = (v)=>{
- console.log('updateUser', v)
- }
- const updateList = (v)=>{
- console.log('updateList', v)
- }
- const handleSearch = ()=>{
- console.log('handleSearch searchVal', searchVal.value)
- }
- const handleRefresh = ()=>{
- console.log('handleSearch', v)
- }
- const handleGetOffice = (e)=>{
- console.log('handleGetOffice', e.detail.value)
- console.log('officeIndex', officeIndex)
- console.log('officeIndex', officeIndex)
- officeIndex.value = e.detail.value
- }
- const handleGetType = (e)=>{
- console.log('handleGetType', e.detail.value)
- console.log('typeIndex', typeIndex)
- console.log('typeArr', typeIndex)
- typeIndex.value = e.detail.value
- }
- const handleGetTags = (v)=>{
- console.log('handleGetTags', v)
- if(!searchTags.value.includes(v)) {
- searchTags.value.push(v)
- } else {
- searchTags.value.splice(searchTags.value.indexOf(v), 1)
- }
- }
- // 更新处方列表
- const checkIndex = async(index) => {
- tabActive.value = index
- tabName.value = tabList.value[index].title
- currentStatus.value = parseInt(tabList.value[index].status)
- const params = {
- // token: userStore.token,
- // appId: userStore.userInfo.appId,
- // uId: userStore.userInfo.uId,
- page: page.value,
- pageSize: 10,
- status: currentStatus.value,
- }
- console.log('checkIndex params',params)
- // const { data: res } = await getOrderList(params)
- // if(res.code===0) {
- // orderList.value = res.data.list
- // total.value = res.data.total
- // page.value = res.data.page
- // pageSize.value = res.data.pageSize
- // console.log('checkIndex orderList>>>', orderList.value)
- // }
-
- }
- </script>
- <style lang="scss">
- .main {
- display: flex;
- flex-direction:column;
- justify-content:flex-start;
- height: 2000px;
- width: 1200px;
- .nav{
- display: flex;
- height:140px;
- width: 1200px;
- // position: sticky;
- // top: 0;
- }
- .body{
- display: flex;
- height:calc(100% - 100px);
- flex-direction:column;
- justify-content:flex-start;
- .tab-box {
- display: flex;
- position: sticky;
- flex-direction:column;
- .tab-bar{
- height: 78px;
- display: flex;
- justify-content:center;
- width: 100%;
- // border: 1px solid #000;
- .tab_item{
- display: flex;
- flex:1;
- justify-content:center;
- align-items: center;
- font-size: 30px;
- background-color: #999;
- color: #000;
- }
- .active{
- background-color: #fff!important;
- color:#000!important;
- }
- }
- .search-bar{
- display: flex;
- background-color: #fff;
- margin: 8px 10px;
- border-radius: 4px;
- width: calc(100% - 20px);
- .today{
- width: 100%;
- display: flex;
- flex-direction:row;
- justify-content: flex-start;
- .search{
- width: 100%;
- margin: 8px 12px;
- }
- .search-button{
- width:100px;
- margin: 8px 12px;
- font-size: 18px;
- }
- .refresh {
- width:100px;
- margin: 8px 12px;
- font-size: 18px;
- }
- }
- .history{
- display: flex;
- width: 100%;
- .searchchoice{
- padding: 0 20px;
- display: flex;
- width: 100%;
- flex-direction:column;
- font-size: 24px;
- .row1{
- display: flex;
- width: 100%;
- justify-content:flex-start;
- align-items: center;
- margin: 10px 0 10px;
- // height: 80px;
- .timequan{
-
- display: flex;
- justify-content:center;
- align-items: center;
- width:70%;
- .time_t{}
- }
- .office{
- display: flex;
- margin-left: 60px;
- justify-content:center;
- align-items: center;
- .uni-input{
- display: flex;
- justify-content:center;
- align-items: center;
- border:1px solid #e1e5f1;
- font-size: 18px;
- width:190px;
- height: 40px;
- border-radius: 5px;
- background-color: #e1e5f1;
- margin-right: 10px;
- }
- }
- }
- .row2{
- display: flex;
- width: 100%;
- justify-content:flex-start;
- align-items: center;
- margin: 0 0 10px;
- .uni-input{
- display: flex;
- justify-content:center;
- align-items: center;
- border:1px solid #e1e5f1;
- font-size: 18px;
- width:100px;
- height: 40px;
- border-radius: 5px;
- background-color: #e1e5f1;
- margin-right: 10px;
- }
- .search{
- width: 77%;
- }
- .search-button{
- width:120px;
- margin: 8px 12px;
- font-size: 16px;
- }
- }
- .row3{
- display: flex;
- width: 100%;
- justify-content:flex-start;
- align-items: center;
- margin: 0 0 18px;
- .tag-view:deep(.uni-tag){
- display: inline;
- font-size: 20px;
- margin-right: 40px;
- // height: 40px;
- width: 120px;
- padding: 6px 20px;
- }
- }
-
- }
-
- }
- }
- }
- .tab-content{
- display: flex;
- margin: 8px 10px;
- border-radius: 4px;
- background-color: #fff;
- width: calc(100% - 20px);
- height: 100%;
- .order-list{
- padding: 8px;
- display: flex;
- width: 100%;
- // height: 100%;
- .order-list-wrap{
- display: flex;
- .order-card{
- display: flex;
- width: 100%;
- border-bottom: 1px solid #e6e8ee;;
- }
- }
- }
- }
- }
-
- }
- </style>
|