yanqiliang 3 дней назад
Родитель
Сommit
774242d07a

+ 1 - 1
pages/prescriptionExecute/common.css

@@ -56,7 +56,7 @@
   /* 横向排列,自动换行(避免标签过多溢出) */
   flex-wrap: wrap;
   /* 标签之间的间距(可选,根据需求调整) */
-  gap: 10px;
+  gap: 6px;
   /* 上下内边距,让布局更美观 */
   padding: 0;
   /* 可选:垂直居中 */

+ 38 - 7
pages/prescriptionExecute/components/DetailList.vue

@@ -17,10 +17,11 @@
 		   class="exe-item-detli-time"
 		    type="date"  
 			:model-value="exeDate"
+			@change="(e) => onConfirm(e)"  
 		  	:hide-second="true"
 		    :border="false"
 		  />
-          <view class="item-right-li priamry"> {{props.detailData.showNum}} </view>
+          <view class="item-right-li priamry"> {{showNum}} </view>
         </view>
         <van-row class="table-item header">
           <van-col span="8">要求执行时间</van-col>
@@ -29,7 +30,7 @@
           <van-col span="5">执行状态</van-col>
         </van-row>
 		<view
-		v-for="(item, index) in props.detailData.execInfos">
+		v-for="(item, index) in newExecInfos">
 			<van-row class="table-item">
 			  <van-col span="8">{{item?.execSttTime}}</van-col>
 			  <van-col span="7">{{item?.execTime}}</van-col>
@@ -44,8 +45,11 @@
 
 <script setup>
   import { ref, watch, onMounted, nextTick } from 'vue';
+  import { $http } from '../../../config/https';
   import Detailtem from './Detailtem.vue';
   const exeDate = ref(''); // 执行日期
+  const showNum = ref('');
+  const newExecInfos = ref([]);
   const props = defineProps({
     visibleDetail: {
       type: Boolean,
@@ -68,16 +72,43 @@
   
   //初始化
   const initData = () =>{
-  	  let exeDateNow = formatDateTime();
-  	  exeDate.value = exeDateNow;
-  	
+	$http.post('urlDeault',this, {
+	    code: '04220027',
+	    data: {
+	      params: [{
+			"ordID": props.detailData.ordID,
+			"exeDate": exeDate.value
+		  }]
+	    },
+	    success: function(res) {
+	      if (+res.errorCode === 0) {
+			newExecInfos.value = res.result;
+			
+			// 计算已执行数量和总数量,生成showNum
+			const totalExecCount = Array.isArray(res.result) ? res.result.length : 0;
+			const executedCount = Array.isArray(res.result) 
+			    ? res.result.filter(exec => exec.statusDesc === '已执行').length 
+			    : 0;
+			showNum.value = `${executedCount}/${totalExecCount}`;
+	      }
+	    },
+	});
   }
   
+  // 确定选择日期
+  const onConfirm = (value) => {
+  	exeDate.value = value;
+  	initData();
+  };
+  
   watch(
     () => props.detailData,
     (newVal) => {
-      // todo根据ID获取详情数据
-	  initData();
+		if(props.detailData && props.detailData?.ordID){
+			let exeDateNow = formatDateTime();
+			exeDate.value = exeDateNow;
+			initData();
+		}
     },
     { immediate: true, deep: true },
   );

+ 1 - 1
pages/prescriptionExecute/components/Detailtem.vue

@@ -11,7 +11,7 @@
     </view>
 	<view class="tag-container">
     <view class="top-btns" v-for="(type, index) in medical.useArr">
-	  <uni-tag :inverted="true" :text="type.label"  :type="type.type" />
+	  <uni-tag :inverted="index === 0 || index === 5 ? false : true" :text="type.label"  :type="type.type" />
       <slot :visible="index == props.data?.exeMedications?.length - 1"></slot>
     </view>
 	 </view>

+ 13 - 11
pages/prescriptionExecute/components/DocumentExe.vue

@@ -56,7 +56,7 @@
             </view>
 			<view class="tag-container">
             <view class="top-btns" v-for="(type, index) in medical.useArr">
-				<uni-tag :inverted="true" :text="type.label"  :type="type.type" />
+				<uni-tag :inverted="index === 0 || index === 5 ? false : true" :text="type.label"  :type="type.type" />
 			  </view>
             </view>
           </view>
@@ -157,7 +157,15 @@
   	$http.post('urlDeault',this, {
   	    code: '04220024',
   	    data: {
-  	      params: [{}]
+  	      params: [{
+	  		"hospID": userData.value.hospID,
+	  		"locID": userData.value.locID,
+	  		"stDate": exeDate.value,
+	  		"stTime": "00:00:00",
+	  		"endDate": exeDate.value,
+	  		"endTime": "23:59:59",
+	  		"patients": [props.patNo]
+	  	  }]
   	    },
   	    success: function(res) {
   	      if (+res.errorCode === 0) {
@@ -187,12 +195,6 @@
 	      },
 	      success: function(res) {
 	        if (+res.errorCode === 0) {
-				const exeTypesAry = exeTypes.value;
-				exeTypesAry.forEach((item,index) => {
-					//给分类标记红点
-					item.dot = res.result.badge.includes(item.code);
-				})
-				exeTypes.value = exeTypesAry;
 				// 执行转换
 				const transformedData = transformOrderData(res.result.order);
 				tableData.value = transformedData;
@@ -219,10 +221,10 @@
 			  name: item.medDesc || '', // 赋值medDesc
 			  useArr: (item.ordText || '')
 				  .split('^') // 按^拆分
-				  .filter(part => part.trim() !== '') // 过滤空值
-				  .map(part => ({
+				  // .filter(part => part.trim() !== '') // 过滤空值
+				  .map((part,index) => ({
 					  label: part.trim(),
-					  type: typeOptions[Math.floor(Math.random() * typeOptions.length)] // 随机type
+					  type: index === 5 ? 'warning' : 'primary'
 				  }))
 		  };
 	  };

+ 4 - 3
pages/prescriptionExecute/components/OrdersList.vue

@@ -90,10 +90,10 @@
 	  			  name: item.medDesc || '', // 赋值medDesc
 	  			  useArr: (item.ordText || '')
 	  				  .split('^') // 按^拆分
-	  				  .filter(part => part.trim() !== '') // 过滤空值
-	  				  .map(part => ({
+	  				  // .filter(part => part.trim() !== '') // 过滤空值
+	  				  .map((part,index) => ({
 	  					  label: part.trim(),
-	  					  type: typeOptions[Math.floor(Math.random() * typeOptions.length)] // 随机type
+	  					  type: index === 5 ? 'warning' : 'primary'
 	  				  }))
 	  		  };
 	   };
@@ -127,6 +127,7 @@
 			  execInfos: item.execInfos,
 			  startDeteTime: item.ordStartDateTime.slice(5, 16),
 			  endDeteTime: item.ordStopDateTime.slice(5, 16),
+			  ordID: item.ordID
           };
       });
   }