浏览代码

[dev]
1、为网络操作相关的按键增加防抖功能
2、上拉下拉都增加了搜索条件
3、增加打印机判断字段,进打印相关页面需要判断
4、复核页面重量需要统计汇总并赋值

Neo 1 年之前
父节点
当前提交
50fc695711
共有 6 个文件被更改,包括 92 次插入53 次删除
  1. 3 6
      components/nav-bar/nav-bar.vue
  2. 1 1
      pages/detail/detail.vue
  3. 12 11
      pages/edit/edit.vue
  4. 31 15
      pages/index/index.vue
  5. 1 1
      pages/login/login.vue
  6. 44 19
      pages/review/review.vue

+ 3 - 6
components/nav-bar/nav-bar.vue

@@ -43,6 +43,7 @@
 <script setup>
 <script setup>
 import { onMounted,ref, getCurrentInstance } from 'vue'
 import { onMounted,ref, getCurrentInstance } from 'vue'
 import {updateWorkStatus, updateOnlineStatus, saveReview } from "@/static/js/api.js"
 import {updateWorkStatus, updateOnlineStatus, saveReview } from "@/static/js/api.js"
+import debounce from 'lodash.debounce'
 
 
 const props = defineProps({
 const props = defineProps({
 	userInfo: {
 	userInfo: {
@@ -84,7 +85,7 @@ const emitclose =()=>{
 	proxy.$refs.alertPrint.close()
 	proxy.$refs.alertPrint.close()
 }
 }
 
 
-const handleChange =async()=>{
+const handleChange = debounce(async()=>{
 	
 	
 	const params = {
 	const params = {
 		token: uni.getStorageSync('token'),
 		token: uni.getStorageSync('token'),
@@ -104,7 +105,7 @@ const handleChange =async()=>{
 		emit('updateUser', props.workStatus)
 		emit('updateUser', props.workStatus)
 	}
 	}
 	
 	
-}
+},500)
 
 
 const handleScanbara = ()=>{
 const handleScanbara = ()=>{
 	
 	
@@ -136,10 +137,6 @@ const handleScanbara = ()=>{
 				}
 				}
 			}
 			}
 			
 			
-			
-			if(res.result) {
-				
-			}
 		}
 		}
 	});
 	});
 }
 }

+ 1 - 1
pages/detail/detail.vue

@@ -106,7 +106,7 @@
 
 
 <script setup>
 <script setup>
 import { onMounted, ref, getCurrentInstance } from 'vue'
 import { onMounted, ref, getCurrentInstance } from 'vue'
-import { selectOrderDetail, upload } from "@/static/js/request.js"
+import { selectOrderDetail } from "@/static/js/request.js"
 
 
 
 
 import { onLoad } from '@dcloudio/uni-app'
 import { onLoad } from '@dcloudio/uni-app'

+ 12 - 11
pages/edit/edit.vue

@@ -155,6 +155,7 @@
 import { onMounted, ref, getCurrentInstance } from 'vue'
 import { onMounted, ref, getCurrentInstance } from 'vue'
 import { selectOrderDetail, upload, sendToUser, updateOrderStatus } from "@/static/js/request.js"
 import { selectOrderDetail, upload, sendToUser, updateOrderStatus } from "@/static/js/request.js"
 import { saveDepoly } from '@/static/js/api.js'
 import { saveDepoly } from '@/static/js/api.js'
+import debounce from 'lodash.debounce'
 
 
 import { onLoad } from '@dcloudio/uni-app'
 import { onLoad } from '@dcloudio/uni-app'
 
 
@@ -307,8 +308,8 @@ const editForm =ref({
 	urls:[],
 	urls:[],
 	userId:uni.getStorageSync('userId'),
 	userId:uni.getStorageSync('userId'),
 	comments:'',
 	comments:'',
-	weight:v.value.weight,
-	coreId: v.value.id
+	weight:'',
+	coreId: ''
 })
 })
 onMounted(() => {
 onMounted(() => {
 
 
@@ -353,7 +354,7 @@ onLoad(async(options) => {
 		v.value.concentration = res.data.concentration
 		v.value.concentration = res.data.concentration
 		v.value.frequency = res.data.frequency
 		v.value.frequency = res.data.frequency
 		v.value.medicationTime = res.data.medicationTime
 		v.value.medicationTime = res.data.medicationTime
-		v.value.id = res.data.id
+		editForm.value.coreId = v.value.id = res.data.id
 		console.log('onLoad v.value.v.value.id', v.value.id)
 		console.log('onLoad v.value.v.value.id', v.value.id)
 		v.value.disName = res.data.disName,
 		v.value.disName = res.data.disName,
 		v.value.symName = res.data.symName,
 		v.value.symName = res.data.symName,
@@ -450,7 +451,7 @@ const handleBack =()=>{
 	})
 	})
 }
 }
 
 
-const handleSubmit = async()=>{
+const handleSubmit = debounce(async()=>{
 	console.log('handleSubmit>>>',editForm.value)
 	console.log('handleSubmit>>>',editForm.value)
 	
 	
 	const {data:res} = await saveDepoly({
 	const {data:res} = await saveDepoly({
@@ -499,9 +500,9 @@ const handleSubmit = async()=>{
 		proxy.$refs.alertDialog.open('center')
 		proxy.$refs.alertDialog.open('center')
 	}
 	}
 	
 	
-}
+},500)
 
 
-const dialogConfirm = async()=>{
+const dialogConfirm = debounce(async()=>{
 	console.log('dialogConfirm直接调用接口,然后打印')
 	console.log('dialogConfirm直接调用接口,然后打印')
 	// if(uni.getStorageSync('initPrint')==true){
 	// if(uni.getStorageSync('initPrint')==true){
 	// 	// #ifdef APP-PLUS
 	// 	// #ifdef APP-PLUS
@@ -522,8 +523,8 @@ const dialogConfirm = async()=>{
 	uni.redirectTo({
 	uni.redirectTo({
 		url:"/pages/index/index"
 		url:"/pages/index/index"
 	})
 	})
-}
-const dialogClose = async()=>{
+},500)
+const dialogClose = debounce(async()=>{
 	console.log('dialogClose直接调用接口,不打印')
 	console.log('dialogClose直接调用接口,不打印')
 	const ret = await updateOrderStatus({
 	const ret = await updateOrderStatus({
 		token: uni.getStorageSync('token'),
 		token: uni.getStorageSync('token'),
@@ -535,9 +536,9 @@ const dialogClose = async()=>{
 	uni.redirectTo({
 	uni.redirectTo({
 		url:"/pages/index/index"
 		url:"/pages/index/index"
 	})
 	})
-}
+},500)
 
 
-const selectUpload = (e)=>{
+const selectUpload = debounce((e)=>{
 	uni.showLoading({
 	uni.showLoading({
 			title: "上传中"
 			title: "上传中"
 		});
 		});
@@ -573,7 +574,7 @@ const selectUpload = (e)=>{
 			}
 			}
 		});
 		});
 	}
 	}
-}
+},500)
 
 
 const printerTsc = ()=>{
 const printerTsc = ()=>{
 	
 	

+ 31 - 15
pages/index/index.vue

@@ -108,9 +108,11 @@ import { onMounted,ref, getCurrentInstance } from 'vue'
 import { onLoad } from "@dcloudio/uni-app"
 import { onLoad } from "@dcloudio/uni-app"
 import {receiveOrderList, selectDepartment } from "@/static/js/api.js"
 import {receiveOrderList, selectDepartment } from "@/static/js/api.js"
 import {releaseOrder} from "@/static/js/request.js"
 import {releaseOrder} from "@/static/js/request.js"
+import debounce from 'lodash.debounce'
 
 
 // import { ID_INJECTION_KEY } from 'element-plus'
 // import { ID_INJECTION_KEY } from 'element-plus'
 
 
+
 const userInfo = ref({})
 const userInfo = ref({})
 const workStatus = ref('0')
 const workStatus = ref('0')
 const tabList = ref([
 const tabList = ref([
@@ -244,7 +246,7 @@ const emitSelect = (v)=>{
 	}
 	}
 }
 }
 
 
-const handleSearch = async()=>{
+const handleSearch = debounce(async()=>{
 	
 	
 	console.log('handleSearch searchPreMzZy',searchPreMzZy.value)
 	console.log('handleSearch searchPreMzZy',searchPreMzZy.value)
 	console.log('handleSearch searchStatus',searchStatus.value)
 	console.log('handleSearch searchStatus',searchStatus.value)
@@ -301,9 +303,9 @@ const handleSearch = async()=>{
 			}
 			}
 		}
 		}
 	}
 	}
-}
+},500)
 
 
-const handleRefresh = ()=>{
+const handleRefresh = debounce(()=>{
 	
 	
 	console.log('yijianshifang >orderList>>', orderList.value)
 	console.log('yijianshifang >orderList>>', orderList.value)
 	// let ids = ''
 	// let ids = ''
@@ -339,12 +341,12 @@ const handleRefresh = ()=>{
 	// 		ids.value = []
 	// 		ids.value = []
 	// 	}
 	// 	}
 	// }
 	// }
-}
+},500)
 
 
 
 
 			
 			
 
 
-const handleRelease = async()=>{
+const handleRelease  = debounce(async()=>{
 	const params = {
 	const params = {
 		token: uni.getStorageSync('token'),
 		token: uni.getStorageSync('token'),
 		data:{ids:ids.value.toString()}
 		data:{ids:ids.value.toString()}
@@ -370,7 +372,7 @@ const handleRelease = async()=>{
 	}
 	}
 	s.value = '1'
 	s.value = '1'
 	console.log('after handleRelease ids.value', ids.value)
 	console.log('after handleRelease ids.value', ids.value)
-}
+},500)
 
 
 const handleGetOffice = (e)=>{
 const handleGetOffice = (e)=>{
 	console.log('handleGetOffice', e.detail.value)
 	console.log('handleGetOffice', e.detail.value)
@@ -498,7 +500,7 @@ const handleGetTags = (v)=>{
 }
 }
 
 
 // 更新处方列表
 // 更新处方列表
-const checkIndex = async(index) => {
+const checkIndex = debounce(async(index) => {
 	tabActive.value = index
 	tabActive.value = index
 	page.value= 1
 	page.value= 1
 	console.log('index',index)
 	console.log('index',index)
@@ -545,13 +547,13 @@ const checkIndex = async(index) => {
 			console.log('selectDepartment officeArr.value', officeArr.value)
 			console.log('selectDepartment officeArr.value', officeArr.value)
 		}
 		}
 	}
 	}
-}
+},500)
 
 
 const openTime = ()=>{
 const openTime = ()=>{
     proxy.$refs.timeslot.open()
     proxy.$refs.timeslot.open()
 }
 }
 
 
-const loadMoreList =async()=>{
+const loadMoreList = debounce(async()=>{
 	console.log('loadMoreList>>>')
 	console.log('loadMoreList>>>')
 	if(isBottom){
 	if(isBottom){
 		return
 		return
@@ -561,10 +563,17 @@ const loadMoreList =async()=>{
 		token: uni.getStorageSync('token'),
 		token: uni.getStorageSync('token'),
 		data: JSON.stringify({
 		data: JSON.stringify({
 			currentUserId: parseInt(uni.getStorageSync('userId')) || 0,
 			currentUserId: parseInt(uni.getStorageSync('userId')) || 0,
-			name: searchVal.value,
+			startTime: searchTime.value[0] || '',
+			endTime:  searchTime.value[1] || '',
+			name: searchName.value.trim() || '',
+			preNo: searchPreNo.value || '',
+			department: searchDepartment.value || '',
+			prescriptionStatus: searchStatus.value || '',//煎煮发药
+			sex: searchSex.value || '',
+			preMzZy: searchPreMzZy.value || '',//门诊住院
 			pageNum: page.value,
 			pageNum: page.value,
 			pageSize: pageSize.value,
 			pageSize: pageSize.value,
-			status: tabActive.value + ''
+			status: tabList.value[tabActive.value].status
 		})
 		})
 	}
 	}
 	const {data:res} = await receiveOrderList(params)
 	const {data:res} = await receiveOrderList(params)
@@ -585,16 +594,23 @@ const loadMoreList =async()=>{
 			tabList.value[0].leng = orderList.value.length
 			tabList.value[0].leng = orderList.value.length
 		}
 		}
 	}
 	}
-}
+},500)
 
 
-const loadPreList = async()=>{
+const loadPreList = debounce(async()=>{
 	console.log('loadPreList>>>')
 	console.log('loadPreList>>>')
 	page.value = 1
 	page.value = 1
 	const params = {
 	const params = {
 		token: uni.getStorageSync('token'),
 		token: uni.getStorageSync('token'),
 		data: JSON.stringify({
 		data: JSON.stringify({
 			currentUserId: parseInt(uni.getStorageSync('userId')) || 0,
 			currentUserId: parseInt(uni.getStorageSync('userId')) || 0,
-			name: searchVal.value,
+			startTime: searchTime.value[0] || '',
+			endTime:  searchTime.value[1] || '',
+			name: searchName.value.trim() || '',
+			preNo: searchPreNo.value || '',
+			department: searchDepartment.value || '',
+			prescriptionStatus: searchStatus.value || '',//煎煮发药
+			sex: searchSex.value || '',
+			preMzZy: searchPreMzZy.value || '',//门诊住院
 			pageNum: page.value,
 			pageNum: page.value,
 			pageSize: pageSize.value,
 			pageSize: pageSize.value,
 			status: tabList.value[tabActive.value].status
 			status: tabList.value[tabActive.value].status
@@ -611,7 +627,7 @@ const loadPreList = async()=>{
 			tabList.value[0].leng = orderList.value.length
 			tabList.value[0].leng = orderList.value.length
 		}
 		}
 	}
 	}
-}
+},500)
 
 
 
 
 </script>
 </script>

+ 1 - 1
pages/login/login.vue

@@ -107,7 +107,7 @@ const submit = async ()=> {
 		}
 		}
 		console.log('res.param',param)
 		console.log('res.param',param)
 		await updateOnlineStatus(param)
 		await updateOnlineStatus(param)
-		
+		uni.setStorageSync('hasPrinter', '0')
 		uni.redirectTo({
 		uni.redirectTo({
 			url:"/pages/index/index"
 			url:"/pages/index/index"
 		})
 		})

+ 44 - 19
pages/review/review.vue

@@ -142,6 +142,7 @@ import { selectOrderDetail, upload, sendToUser } from "@/static/js/request.js"
 import { saveReview } from '@/static/js/api.js'
 import { saveReview } from '@/static/js/api.js'
 
 
 import { onLoad } from '@dcloudio/uni-app'
 import { onLoad } from '@dcloudio/uni-app'
+import debounce from 'lodash.debounce'
 
 
 const urlConfig = ref('http://zhongyao.fscuc.cn')
 const urlConfig = ref('http://zhongyao.fscuc.cn')
 // const preseId = ref(11220822134401)
 // const preseId = ref(11220822134401)
@@ -233,7 +234,7 @@ const v=ref({
 		{matName:'车前子',matDose:'6',matUnitName:'g',tips:'先煎',sign:''}
 		{matName:'车前子',matDose:'6',matUnitName:'g',tips:'先煎',sign:''}
 	],
 	],
 	number:3,
 	number:3,
-	weight: '0',
+	weight: 0,
 	pies_tips:'待见',
 	pies_tips:'待见',
 	dosageForm:'汤剂',
 	dosageForm:'汤剂',
 	prescriptionUsage:'煎服',
 	prescriptionUsage:'煎服',
@@ -335,6 +336,18 @@ onLoad(async(options) => {
 		v.value.rp = res.data.detailList
 		v.value.rp = res.data.detailList
 		v.value.yljgName = res.data.yljgName || ''
 		v.value.yljgName = res.data.yljgName || ''
 	 
 	 
+		
+		console.log('rprprpprprpr',res.data.detailList.length)
+		const leng = res.data.detailList.length
+		let weight1 = 0
+		if(leng > 0 ){
+			for(let i = 0; i <leng; i++){
+				weight1 = weight1+parseInt(v.value.rp[i].matDose)
+			}
+		}
+		v.value.weight = weight1
+		console.log('weigiht>>>', v.value.weight)
+		
 		v.value.state = res.data.state,
 		v.value.state = res.data.state,
 		console.log('res.data.state',res.data.state)
 		console.log('res.data.state',res.data.state)
 		switch (res.data.state) {
 		switch (res.data.state) {
@@ -387,16 +400,7 @@ onLoad(async(options) => {
 				}
 				}
 			})
 			})
 		}
 		}
-		const leng = v.rp.length
-		console.log('rprprpprprpr',leng)
-		let weight = 0
-		if(leng > 0 ){
-			for(let i = 0; i <len; i++){
-				weight = weight+parseInt(v.rp[i].matDose)
-			}
-		}
-		v.value.weight = weight +''
-		console.log('weigiht>>>', v.value.weight)
+		
 	}
 	}
 })
 })
 
 
@@ -420,7 +424,8 @@ const handleBack =()=>{
 	})
 	})
 }
 }
 
 
-const handleSubmit = async()=>{
+const handleSubmit = debounce(async()=>{
+	editForm.value.preNo = v.value.preNo
 	console.log('handleSubmit>>>',editForm.value)
 	console.log('handleSubmit>>>',editForm.value)
 	
 	
 	const {data:res} = await saveReview({
 	const {data:res} = await saveReview({
@@ -432,10 +437,10 @@ const handleSubmit = async()=>{
 		proxy.$refs.alertDialog.open()
 		proxy.$refs.alertDialog.open()
 		
 		
 	}
 	}
-}
+},500)
 
 
 
 
-const selectUpload = (e)=>{
+const selectUpload = debounce((e)=>{
 	uni.showLoading({
 	uni.showLoading({
 			title: "上传中"
 			title: "上传中"
 		});
 		});
@@ -471,7 +476,7 @@ const selectUpload = (e)=>{
 			}
 			}
 		});
 		});
 	}
 	}
-}
+},500)
 
 
 
 
 const handleOnblur = (e)=>{
 const handleOnblur = (e)=>{
@@ -483,13 +488,33 @@ const handleOnblur = (e)=>{
 const dialogConfirm = ()=>{
 const dialogConfirm = ()=>{
 	uni.scanCode({
 	uni.scanCode({
 		scanType: ['barCode'],
 		scanType: ['barCode'],
-		success: function (res) {
+		success: async(res) => {
 			console.log('条码类型:' + res.scanType);
 			console.log('条码类型:' + res.scanType);
 			console.log('条码内容:' + res.result);
 			console.log('条码内容:' + res.result);
-			if(res.result) {
-				uni.navigateTo({
-					url:`/pages/review/review?preNo=${res.result}&depolyStatus=2`
+			const data = JSON.stringify({
+					userId:uni.getStorageSync('userId'),
+					preNo: parseInt(res.result)
 				})
 				})
+			// neo
+			// 调用接口查询这个preNo是否已经被复核,如果已经复核了就不跳
+			const {data:res1} = await saveReview({
+				token: uni.getStorageSync('token'),
+				data: data
+			})
+			if(res1.code===500){
+				console.log('depoly success>>>')
+				// proxy.$refs.alertDialog.open()
+				console.log('res1',res1)
+				if(res1.msg=='处方已复核,无需重复操作!'){
+					uni.$showMsg(res1.msg, 2000)
+					uni.navigateTo({
+						url:`/pages/index/index`
+					})
+				} else {
+					uni.navigateTo({
+						url:`/pages/review/review?preNo=${res.result}&depolyStatus=2`
+					})
+				}
 			}
 			}
 		}
 		}
 	});
 	});