|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
<view class="main">
|
|
|
- <NavBar :userInfo="userInfo" @updateInfo="updateUser" />
|
|
|
+ <NavBar :user-info="userInfo" @update-user="updateUser" />
|
|
|
<view class="body">
|
|
|
<view class="tab-box">
|
|
|
<view class="tab-bar">
|
|
@@ -15,14 +15,14 @@
|
|
|
<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>
|
|
|
+ <button type="primary" :disabled="userInfo.workStatus==='1'?false:true" @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=" - " />
|
|
|
+ <uni-datetime-picker v-model="searchTime" type="datetimerange" :hide-second="true" rangeSeparator=" - " />
|
|
|
</view>
|
|
|
<view class="office">
|
|
|
<view class="uni-list-cell-left office_t">
|
|
@@ -43,7 +43,7 @@
|
|
|
<uni-easyinput prefixIcon="search" v-model="searchName" placeholder="请输入姓名" />
|
|
|
</view>
|
|
|
<view v-else class="search">
|
|
|
- <uni-easyinput prefixIcon="search" v-model="searchPres" placeholder="请输入处方号" />
|
|
|
+ <uni-easyinput prefixIcon="search" v-model="searchPreNo" placeholder="请输入处方号" />
|
|
|
</view>
|
|
|
<button type="primary" @click="handleSearch" class="search-button">搜索</button>
|
|
|
</view>
|
|
@@ -79,6 +79,9 @@
|
|
|
import NavBar from "@/components/nav-bar/nav-bar.vue"
|
|
|
import OrderCard from "@/components/order-card/order-card.vue"
|
|
|
import { onMounted,ref } from 'vue'
|
|
|
+import { onLoad } from "@dcloudio/uni-app"
|
|
|
+import {receiveOrderList } from "@/static/api.js"
|
|
|
+
|
|
|
|
|
|
const userInfo = ref({})
|
|
|
const searchVal = ref('')
|
|
@@ -87,57 +90,146 @@ const tabList = ref([
|
|
|
{title:"历史处方", status: 1},
|
|
|
])
|
|
|
|
|
|
-const currentStatus = ref(0)
|
|
|
+const currentStatus = ref('0')
|
|
|
|
|
|
-const tabActive = ref(1) // 当前tab Index
|
|
|
+const tabActive = ref(0) // 当前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'}
|
|
|
+ {id: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'},
|
|
|
+ {id: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'},
|
|
|
+ {id:3,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'},
|
|
|
+ {id:4,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'},
|
|
|
+ {id:5,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 searchTime =ref([])
|
|
|
+const searchDepartment = ref('')
|
|
|
const searchName = ref('')
|
|
|
-const searchPres = ref('')
|
|
|
-const searchTags = ref([])
|
|
|
+const searchPreNo = ref('')
|
|
|
+const searchSex = ref('')
|
|
|
+const searchPreMzZy = ref('')
|
|
|
+const searchStatus = ref('')
|
|
|
|
|
|
+const searchTags = ref([])
|
|
|
const tags = ref(['全部','门诊','住院','男','女','煎煮','发药'])
|
|
|
|
|
|
+
|
|
|
const page = ref(0)
|
|
|
+const total = ref(0)
|
|
|
+const pageSize = ref(10)
|
|
|
|
|
|
onMounted(() => {
|
|
|
+
|
|
|
+})
|
|
|
|
|
|
+onLoad(async () => {
|
|
|
+ const token = uni.getStorageSync('token')
|
|
|
+ userInfo.value.name = uni.getStorageSync('username')
|
|
|
+ userInfo.value.workStatus = '0'
|
|
|
+ const params = {
|
|
|
+ token: token,
|
|
|
+ data:{
|
|
|
+ status: '0',
|
|
|
+ page: page.value,
|
|
|
+ pageSize: pageSize.value,
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ const {data:res} = await receiveOrderList(params)
|
|
|
+ if (res.code === 200) {
|
|
|
+ total.value = res.total
|
|
|
+ orderList.value = res.rows
|
|
|
+ }
|
|
|
})
|
|
|
|
|
|
// 子传父,更新userInfo
|
|
|
const updateUser = (v)=>{
|
|
|
- console.log('updateUser', v)
|
|
|
+ console.log('updateUserStatus', v)
|
|
|
+ userInfo.value.workStatus = v
|
|
|
}
|
|
|
|
|
|
const updateList = (v)=>{
|
|
|
console.log('updateList', v)
|
|
|
}
|
|
|
|
|
|
-const handleSearch = ()=>{
|
|
|
+const handleSearch = async()=>{
|
|
|
+ const token = uni.getStorageSync('token')
|
|
|
console.log('handleSearch searchVal', searchVal.value)
|
|
|
+ searchVal.value = searchVal.value.trim()
|
|
|
+ if(currentStatus.value ==='0' && searchVal.value) {
|
|
|
+ const params = {
|
|
|
+ token: token,
|
|
|
+ data: {
|
|
|
+ status: currentStatus.value,
|
|
|
+ name: searchVal.value,
|
|
|
+ page: page.value,
|
|
|
+ pageSize: pageSize.value,
|
|
|
+ }
|
|
|
+ }
|
|
|
+ const {data:res} = await receiveOrderList(params)
|
|
|
+ if (res.code === 200) {
|
|
|
+ total.value = res.total
|
|
|
+ orderList.value = res.rows
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(currentStatus.value==='1'){
|
|
|
+ // searchTime.value = []
|
|
|
+ // searchDepartment.value = ''
|
|
|
+ // searchName.value = ''
|
|
|
+ // searchPreNo.value = ''
|
|
|
+ // searchSex.value = ''
|
|
|
+ // searchPreMzZy.value = ''
|
|
|
+ // searchStatus.value = ''
|
|
|
+ const params = {
|
|
|
+ token: token,
|
|
|
+ data: {
|
|
|
+ startTime: searchTime.value[0] || '',
|
|
|
+ endTime: searchTime.value[1] || '',
|
|
|
+ status: currentStatus.value || '',
|
|
|
+ name: searchVal.value || '',
|
|
|
+ preNo: searchPreNo.value || '',
|
|
|
+ prescriptionStatus: searchStatus.value || '',
|
|
|
+ sex: searchSex.value || '',
|
|
|
+ preMzZy: searchPreMzZy.value || '',
|
|
|
+
|
|
|
+ page: page.value,
|
|
|
+ pageSize: pageSize.value,
|
|
|
+ }
|
|
|
+ }
|
|
|
+ const {data:res} = await receiveOrderList(params)
|
|
|
+ if (res.code === 200) {
|
|
|
+ total.value = res.total
|
|
|
+ orderList.value = res.rows
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
-const handleRefresh = ()=>{
|
|
|
- console.log('handleSearch', v)
|
|
|
+const handleRefresh = async()=>{
|
|
|
+
|
|
|
+ let ids = orderList.value.map((v)=>{ return v.id }).join(',')
|
|
|
+
|
|
|
+ const params = {
|
|
|
+ token: token,
|
|
|
+ data:{
|
|
|
+ ids:ids
|
|
|
+ }
|
|
|
+ }
|
|
|
+ const {data:res} = await releaseOrder(params)
|
|
|
+ if (res.code === 200) {
|
|
|
+ total.value = res.total
|
|
|
+ orderList.value = []
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
const handleGetOffice = (e)=>{
|
|
@@ -152,6 +244,11 @@ const handleGetType = (e)=>{
|
|
|
console.log('typeIndex', typeIndex)
|
|
|
console.log('typeArr', typeIndex)
|
|
|
typeIndex.value = e.detail.value
|
|
|
+ if(typeIndex.value ===1 ){
|
|
|
+ searchName.value = ''
|
|
|
+ } else {
|
|
|
+ searchPreNo.value = ''
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
const handleGetTags = (v)=>{
|
|
@@ -161,6 +258,76 @@ const handleGetTags = (v)=>{
|
|
|
} else {
|
|
|
searchTags.value.splice(searchTags.value.indexOf(v), 1)
|
|
|
}
|
|
|
+ switch (v) {
|
|
|
+ case '全部':
|
|
|
+ if(searchTags.value.includes(v)){
|
|
|
+ searchTags.value = ['全部']
|
|
|
+ searchTime.value = []
|
|
|
+ searchDepartment.value = ''
|
|
|
+ searchName.value = ''
|
|
|
+ searchPreNo.value = ''
|
|
|
+ searchSex.value = ''
|
|
|
+ searchPreMzZy.value = ''
|
|
|
+ searchStatus.value = ''
|
|
|
+ }
|
|
|
+ break
|
|
|
+ case '门诊':
|
|
|
+ if(searchTags.value.includes(v) && searchTags.value.includes('住院')){
|
|
|
+ searchTags.value.splice(searchTags.value.indexOf('住院'), 1)
|
|
|
+ }
|
|
|
+ if(searchTags.value.includes('全部')){
|
|
|
+ searchTags.value.splice(searchTags.value.indexOf('全部'), 1)
|
|
|
+ }
|
|
|
+ searchPreMzZy.value = '1'
|
|
|
+ break
|
|
|
+ case '住院':
|
|
|
+ if(searchTags.value.includes(v) && searchTags.value.includes('门诊')){
|
|
|
+ searchTags.value.splice(searchTags.value.indexOf('门诊'), 1)
|
|
|
+ }
|
|
|
+ if(searchTags.value.includes('全部')){
|
|
|
+ searchTags.value.splice(searchTags.value.indexOf('全部'), 1)
|
|
|
+ }
|
|
|
+ searchPreMzZy.value = '2'
|
|
|
+ break
|
|
|
+ case '男':
|
|
|
+ if(searchTags.value.includes(v) && searchTags.value.includes('女')){
|
|
|
+ searchTags.value.splice(searchTags.value.indexOf('女'), 1)
|
|
|
+ }
|
|
|
+ if(searchTags.value.includes('全部')){
|
|
|
+ searchTags.value.splice(searchTags.value.indexOf('全部'), 1)
|
|
|
+ }
|
|
|
+ searchSex.value = '男'
|
|
|
+ break
|
|
|
+ case '女':
|
|
|
+ if(searchTags.value.includes(v) && searchTags.value.includes('男')){
|
|
|
+ searchTags.value.splice(searchTags.value.indexOf('男'), 1)
|
|
|
+ }
|
|
|
+ if(searchTags.value.includes('全部')){
|
|
|
+ searchTags.value.splice(searchTags.value.indexOf('全部'), 1)
|
|
|
+ }
|
|
|
+ searchSex.value = '女'
|
|
|
+ break
|
|
|
+ case '煎煮':
|
|
|
+ if(searchTags.value.includes(v) && searchTags.value.includes('发药')){
|
|
|
+ searchTags.value.splice(searchTags.value.indexOf('发药'), 1)
|
|
|
+ }
|
|
|
+ if(searchTags.value.includes('全部')){
|
|
|
+ searchTags.value.splice(searchTags.value.indexOf('全部'), 1)
|
|
|
+ }
|
|
|
+ searchStatus.value = '煎煮'
|
|
|
+ break
|
|
|
+ case '发药':
|
|
|
+ if(searchTags.value.includes(v) && searchTags.value.includes('煎煮')){
|
|
|
+ searchTags.value.splice(searchTags.value.indexOf('煎煮'), 1)
|
|
|
+ }
|
|
|
+ if(searchTags.value.includes('全部')){
|
|
|
+ searchTags.value.splice(searchTags.value.indexOf('全部'), 1)
|
|
|
+ }
|
|
|
+ searchStatus.value = '发药'
|
|
|
+ break
|
|
|
+ default:
|
|
|
+ searchTags.value = ['全部']
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
// 更新处方列表
|
|
@@ -168,25 +335,21 @@ const checkIndex = async(index) => {
|
|
|
tabActive.value = index
|
|
|
tabName.value = tabList.value[index].title
|
|
|
currentStatus.value = parseInt(tabList.value[index].status)
|
|
|
+ const token = uni.getStorageSync('token')
|
|
|
const params = {
|
|
|
- // token: userStore.token,
|
|
|
- // appId: userStore.userInfo.appId,
|
|
|
- // uId: userStore.userInfo.uId,
|
|
|
-
|
|
|
- page: page.value,
|
|
|
- pageSize: 10,
|
|
|
- status: currentStatus.value,
|
|
|
+ token: token,
|
|
|
+ data: {
|
|
|
+ status: currentStatus.value,
|
|
|
+ page: page.value,
|
|
|
+ pageSize: pageSize.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)
|
|
|
- // }
|
|
|
-
|
|
|
+ const {data:res} = await receiveOrderList(params)
|
|
|
+ if (res.code === 200) {
|
|
|
+ total.value = res.total
|
|
|
+ orderList.value = res.rows
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|
|
@@ -256,7 +419,7 @@ const checkIndex = async(index) => {
|
|
|
font-size: 18px;
|
|
|
}
|
|
|
.refresh {
|
|
|
- width:100px;
|
|
|
+ width:200px;
|
|
|
margin: 8px 12px;
|
|
|
font-size: 18px;
|
|
|
}
|