浏览代码

优化父医嘱选择

xiaochan 1 年之前
父节点
当前提交
64504fda34

+ 28 - 19
src/components/zhu-yuan-yi-sheng/yi-zhu-lu-ru/yz-edit/YzEditor.vue

@@ -85,7 +85,7 @@
           给药方式:
           <select-v4
               key="supplyCode"
-              :disabled="supplyDisabled()"
+              :disabled="supplyDisabled"
               style="width: 120px"
               v-model="yiZhuData.supplyCode"
               :data="geiYaoFangShiData"
@@ -142,7 +142,7 @@
               style="width: 120px;"
               placeholder="父医嘱"
               clearable
-              :disabled="supplyDisabled()"
+              :disabled="supplyDisabled"
               @clear="clearDoctorSOrder"
               @focus="fuYiZhuClick"
               @rowClick="({row}) => modifyDosingMethod(row)"
@@ -184,7 +184,7 @@
         <div>
           费用标志:
           <el-select v-model="yiZhuData.selfBuy"
-                     :disabled="supplyDisabled()"
+                     :disabled="supplyDisabled"
                      clearable style="width: 120px"
                      @clear="yiZhuData.selfBuy = null">
             <el-option label="自备" value="1"/>
@@ -635,23 +635,34 @@ const disabledDate = (time) => {
 }
 
 /* 父医嘱 */
-const fuYiZhuData = ref([])
+const fuYiZhuData = ref<any[]>([])
 const fuYiZhuClick = () => {
   fuYiZhuData.value = [];
 
-  XEUtils.lastArrayEach(yzData.value, (item) => {
-    let {statusFlag, serial, parentNo, drugFlag, actOrderNo} = item
-    if (statusFlag === '1') {
-      if (serial !== '00' && stringIsBlank(parentNo) && drugFlag !== 'd') {
-        if (yiZhuData.value.actOrderNo !== actOrderNo) {
-          const tempData = XEUtils.clone(item, true)
-          tempData.value = actOrderNo
-          tempData.label = item.orderName
-          fuYiZhuData.value.push(item)
-        }
+  const eachName = queryParam.value.sort === 'asc' ? 'lastArrayEach' : 'arrayEach'
+  const eachFunction = XEUtils[eachName]
+
+  let hasParentNo = false
+
+  // @ts-ignore
+  eachFunction(yzData.value, (item) => {
+    const {statusFlag, serial, parentNo, drugFlag, actOrderNo} = item
+    if (statusFlag !== '1') {
+      return
+    }
+    if (parentNo === yiZhuData.value.actOrderNo) {
+      hasParentNo = true
+      return;
+    }
+    if (serial !== '00' && stringIsBlank(parentNo) && drugFlag !== 'd') {
+      if (yiZhuData.value.actOrderNo !== actOrderNo) {
+        fuYiZhuData.value.push(item)
       }
     }
   })
+  if (hasParentNo) {
+    fuYiZhuData.value = []
+  }
 }
 
 const modifyDosingMethod = (val) => {
@@ -910,15 +921,13 @@ let shortcutKeyRegistration = {
 }
 
 
-/**
- * 给药方式是否可以用
- */
-const supplyDisabled = () => {
+const supplyDisabled = computed(() => {
   if (yiZhuData.value.orderCode === '06054') {
     return false
   }
   return yiZhuData.value.serial === '00';
-}
+})
+
 
 onMounted(() => {
   yzMitt.on('toAddAnOrder', toAddAnOrder)

+ 4 - 1
src/views/hospitalization/zhu-yuan-yi-sheng/public-js/zhu-yuan-yi-sheng.ts

@@ -630,7 +630,10 @@ function setSerialName(item: any) {
 // 数据筛选
 export const tempYzData = computed<YzType[]>(() => {
     let temp = XEUtils.filter(yzData.value, (item) => {
-        let flag: boolean = queryParam.value.displayRange === 0
+        if (item.statusFlag === '6') {
+            return true
+        }
+        let flag: boolean = queryParam.value.displayRange === 0;
         let frequFlag: boolean = queryParam.value.frequCode === frequCodeEnum.all
         let zhuangTai: boolean = queryParam.value.zhuangTai === 0
 

+ 1 - 1
src/views/hospitalization/zhu-yuan-yi-sheng/yi-zhu-lu-ru/components/table/YzTableV3.vue

@@ -256,7 +256,7 @@ function getYiZhuFlag(val) {
     case '-1':
       return h('span', {style: {color: '#00ffe0'}}, 'D')
     case '6':
-      return h('span', {style: {color: '#ff0000'}}, 'E')
+      return h('span', {style: {color: '#ffffff'}}, 'E')
     default:
       return 'warning'
   }