xiaochan 3 éve
szülő
commit
ef88a76e30

+ 1 - 1
.prettierrc.js

@@ -1,5 +1,5 @@
 module.exports = {
-  semi: false, // 行位是否使用分号,默认为true
+  semi: true, // 行位是否使用分号,默认为true
   trailingComma: 'es5', // 是否使用尾逗号,有三个可选值"<none|es5|all>"
   singleQuote: true, // 字符串是否使用单引号,默认为false,使用双引号
   printWidth: 180, // 一行的字符数,如果超过会进行换行,默认为80

+ 0 - 0
at.alicdn.com/t/font_2570680_2fgczr3435f.woff2


+ 13 - 0
jsconfig.json

@@ -0,0 +1,13 @@
+{
+    "compilerOptions": {
+      "baseUrl": ".",
+      "paths": {
+        "@/*": ["src/*"]
+      },
+      "target": "ES6",
+      "allowSyntheticDefaultImports": true
+    },
+    "include": ["src/**/*"],
+    "exclude": ["node_modules"]
+  }
+  

+ 200 - 197
src/views/hospitalization/zhu-yuan-yi-sheng/yi-zhu-lu-ru/YiZhuLuRu.vue

@@ -2,26 +2,25 @@
   <el-container>
     <el-header>
       <el-date-picker
-          v-model="dateRange"
-          :shortcuts="shortcuts"
-          end-placeholder="结束日期"
-          placeholder="选择日期"
-          range-separator="至"
-          size="mini"
-          start-placeholder="开始日期"
-          style="width: 220px"
-          type="daterange">
+        v-model="dateRange"
+        :shortcuts="shortcuts"
+        end-placeholder="结束日期"
+        placeholder="选择日期"
+        range-separator="至"
+        size="mini"
+        start-placeholder="开始日期"
+        style="width: 220px"
+        type="daterange"
+      >
       </el-date-picker>
       医嘱名称:
-      <el-select v-model="orderName" :remote-method="remoteMethodChargeCode" clearable filterable
-                 remote style="width: 120px">
+      <el-select v-model="orderName" :remote-method="remoteMethodChargeCode" clearable filterable remote style="width: 120px">
         <el-option v-for="item in yiZhuMingZiData" :key="item.code" :label="item.name" :value="item.code">
           <span>{{ item.name }}</span>
         </el-option>
       </el-select>
       频率:
-      <el-select v-model="pinLv" :disabled="zhuangTai === 8 || zhuangTai === 9 " clearable filterable size="mini"
-                 style="width: 120px">
+      <el-select v-model="pinLv" :disabled="zhuangTai === 8 || zhuangTai === 9" clearable filterable size="mini" style="width: 120px">
         <el-option v-for="item in huanZhePinLvData" :key="item.code" :label="item.name" :value="item.code">
           <span>{{ item.name }}</span>
         </el-option>
@@ -42,27 +41,38 @@
       <el-tag effect="dark">执行</el-tag>
       <el-tag effect="dark" type="danger">停止</el-tag>
       <el-divider direction="vertical"></el-divider>
-      <el-button :disabled="huanZheXinXi.timesBilled === 1" icon="el-icon-plus" type="primary" @click="addYiZhuClick">
-        添加
-      </el-button>
-      <el-button :disabled="xuanZhongDeShuJu.length === 0 " type="warning"
-                 @click="chaoZuoBiaoZhi = 90;yiZhuChaoZuoDialog = true;yiZhuChaoZuoBiaoTi = '批量停止'">批量停止
+      <el-button :disabled="huanZheXinXi.timesBilled === 1" icon="el-icon-plus" type="primary" @click="addYiZhuClick"> 添加 </el-button>
+      <el-button
+        :disabled="xuanZhongDeShuJu.length === 0"
+        type="warning"
+        @click="
+          chaoZuoBiaoZhi = 90;
+          yiZhuChaoZuoDialog = true;
+          yiZhuChaoZuoBiaoTi = '批量停止';
+        "
+        >批量停止
       </el-button>
       <el-divider direction="vertical"></el-divider>
-      <el-button :disabled="xuanZhongDeShuJu.length === 0" type="success" @click="dianJiFuZhuXuanZhongYiZhu">复制选中医嘱
-      </el-button>
+      <el-button :disabled="xuanZhongDeShuJu.length === 0" type="success" @click="dianJiFuZhuXuanZhongYiZhu">复制选中医嘱 </el-button>
     </el-header>
     <el-main>
-      <el-table ref="tableRef" :data="yiZhuPage.data" :height="(windowSize.h / 1.5) "
-                :row-class-name="differChildrenRows"
-                border class="eltable" highlight-current-row row-key="actOrderNo"
-                @selection-change="huoQuXuanZhongDeShuJu" @select-all="quanXuanYiZhu">
+      <el-table
+        ref="tableRef"
+        :data="yiZhuPage.data"
+        :height="windowSize.h / 1.5"
+        :row-class-name="differChildrenRows"
+        border
+        class="eltable"
+        highlight-current-row
+        row-key="actOrderNo"
+        @selection-change="huoQuXuanZhongDeShuJu"
+        @select-all="quanXuanYiZhu"
+      >
         <el-table-column fixed="left" type="index"></el-table-column>
         <el-table-column fixed="left" type="selection"></el-table-column>
         <el-table-column fixed="left" label="医嘱号" prop="actOrderNo" width="120">
           <template #default="scope">
-            <el-tag :type="getYiZhuFlag(scope.row.statusFlag)" effect="dark">{{ scope.row.actOrderNo }}
-            </el-tag>
+            <el-tag :type="getYiZhuFlag(scope.row.statusFlag)" effect="dark">{{ scope.row.actOrderNo }} </el-tag>
           </template>
         </el-table-column>
         <el-table-column fixed="left" label="医嘱名称" prop="orderName" show-overflow-tooltip width="135"></el-table-column>
@@ -111,16 +121,12 @@
               操作
               <template #dropdown>
                 <el-dropdown-menu>
-                  <el-dropdown-item :disabled="scope.row.statusFlag === '5'" @click="dianJiYiZhuChaoZuo(scope.row,1)">
+                  <el-dropdown-item :disabled="scope.row.statusFlag === '5'" @click="dianJiYiZhuChaoZuo(scope.row, 1)">
                     <span v-if="scope.row.emergencyFlag === '1'">取消紧急</span>
                     <span v-else>设为紧急</span>
                   </el-dropdown-item>
-                  <el-dropdown-item @click="dianJiYiZhuChaoZuo(scope.row,2,'撤销医嘱')">
-                    撤销医嘱
-                  </el-dropdown-item>
-                  <el-dropdown-item @click="dianJiYiZhuChaoZuo(scope.row,3,'停止医嘱')">
-                    停止医嘱
-                  </el-dropdown-item>
+                  <el-dropdown-item @click="dianJiYiZhuChaoZuo(scope.row, 2, '撤销医嘱')"> 撤销医嘱 </el-dropdown-item>
+                  <el-dropdown-item @click="dianJiYiZhuChaoZuo(scope.row, 3, '停止医嘱')"> 停止医嘱 </el-dropdown-item>
                 </el-dropdown-menu>
               </template>
             </el-dropdown>
@@ -128,112 +134,108 @@
         </el-table-column>
       </el-table>
       <el-pagination
-          :current-page="yiZhuPage.currentPage"
-          :page-size="yiZhuPage.pageSize"
-          :page-sizes="[10, 20, 30, 40, 50]"
-          :total="yiZhuPage.total"
-          layout="total, sizes, prev, pager, next, jumper"
-          @size-change="handleSizeChange"
-          @current-change="handleCurrentChange">
+        :current-page="yiZhuPage.currentPage"
+        :page-size="yiZhuPage.pageSize"
+        :page-sizes="[10, 20, 30, 40, 50]"
+        :total="yiZhuPage.total"
+        layout="total, sizes, prev, pager, next, jumper"
+        @size-change="handleSizeChange"
+        @current-change="handleCurrentChange"
+      >
       </el-pagination>
     </el-main>
-    <el-dialog v-model="yiZhuChaoZuoDialog"
-               :close-on-click-modal="false"
-               :close-on-press-escape="false"
-               :show-close="false"
-               :title="yiZhuChaoZuoBiaoTi" top="25%" width="30%">
+    <el-dialog v-model="yiZhuChaoZuoDialog" :close-on-click-modal="false" :close-on-press-escape="false" :show-close="false" :title="yiZhuChaoZuoBiaoTi" top="25%" width="30%">
       <div v-if="chaoZuoBiaoZhi === 2">
         撤销原因:
         <el-input v-model="content" maxlength="100" rows="2" show-word-limit type="textarea"></el-input>
       </div>
       <div v-else-if="chaoZuoBiaoZhi === 3 || chaoZuoBiaoZhi === 90">
         停止时间点:
-        <el-date-picker v-model="tingZhiRiQi" format="YYYY-MM-DD HH:mm:ss"
-                        type="datetime" value-format="YYYY-MM-DD HH:mm:ss">
-        </el-date-picker>
+        <el-date-picker v-model="tingZhiRiQi" format="YYYY-MM-DD HH:mm:ss" type="datetime" value-format="YYYY-MM-DD HH:mm:ss"> </el-date-picker>
       </div>
       <template #footer>
-      <span class="dialog-footer">
-        <el-button @click="yiZhuChaoZuoDialog = false;content = ''">关闭</el-button>
-        <el-button type="primary" @click="zhiXingChaoZuo">确认</el-button>
-      </span>
+        <span class="dialog-footer">
+          <el-button
+            @click="
+              yiZhuChaoZuoDialog = false;
+              content = '';
+            "
+            >关闭</el-button
+          >
+          <el-button type="primary" @click="zhiXingChaoZuo">确认</el-button>
+        </span>
       </template>
     </el-dialog>
   </el-container>
 </template>
 
 <script name="YiZhuLuRuZhuJian" setup>
-import {shortcuts} from '@/data/shortcuts'
-import {
-  huoQuYiZhuMingCheng,
-  huoQuYiZhuShuJu,
-  piLiangXiuGaiTingZhiShiJian,
-  yiZhuChaoZuo,
-} from "@/api/zhu-yuan-yi-sheng/yi-zhu-lu-ru";
-import {fuZhiYiZhu, huanZhePinLvData, huanZheXinXi, youWuXuanZheHuanZhe,} from '../public-js/zhu-yuan-yi-sheng'
-import {getDateRangeFormatDate, getFormatDatetime} from "@/utils/date";
-import store from '@/store'
-import {stringIsBlank, stringNotBlank} from '@/utils/blank-utils';
-import {getServerDateApi} from "@/api/public-api";
-import router from "@/router";
+import { shortcuts } from '@/data/shortcuts';
+import { huoQuYiZhuMingCheng, huoQuYiZhuShuJu, piLiangXiuGaiTingZhiShiJian, yiZhuChaoZuo } from '@/api/zhu-yuan-yi-sheng/yi-zhu-lu-ru';
+import { fuZhiYiZhu, huanZhePinLvData, huanZheXinXi, youWuXuanZheHuanZhe } from '../public-js/zhu-yuan-yi-sheng';
+import { getDateRangeFormatDate, getFormatDatetime } from '@/utils/date';
+import store from '@/store';
+import { stringIsBlank, stringNotBlank } from '@/utils/blank-utils';
+import { getServerDateApi } from '@/api/public-api';
+import router from '@/router';
 
 const windowSize = computed(() => {
-  return store.state.app.windowSize
-})
+  return store.state.app.windowSize;
+});
 
 const user = computed(() => {
-  return store.state.user.info
-})
+  return store.state.user.info;
+});
 
-const dateRange = ref([])
+const dateRange = ref([]);
 // 根据医嘱的名字来进行搜索
-let orderName = $ref('')
-const yiZhuMingZiData = ref([])
+let orderName = $ref('');
+const yiZhuMingZiData = ref([]);
 // 获取频率
-const pinLv = ref('')
+const pinLv = ref('');
 // 状态
-const zhuangTai = ref(0)
+const zhuangTai = ref(0);
 // 分页
 const yiZhuPage = ref({
   currentPage: 1,
   pageSize: 30,
   total: 0,
-  data: []
-})
-const tableRef = ref(null)
+  data: [],
+});
+const tableRef = ref(null);
 
 const remoteMethodChargeCode = (val) => {
-  if (youWuXuanZheHuanZhe()) return
+  if (youWuXuanZheHuanZhe()) return;
   if (val.length > 1) {
     huoQuYiZhuMingCheng(huanZheXinXi.value.inpatientNo, huanZheXinXi.value.admissTimes, val).then((res) => {
-      yiZhuMingZiData.value = res
-    })
+      yiZhuMingZiData.value = res;
+    });
   }
-}
+};
 
 // 根据医嘱的名字来进行搜索 结束
 const zhuangTaiList = ref([
-  {code: 0, name: '全部'},
-  {code: 1, name: '录入'},
-  {code: 2, name: '确认'},
-  {code: 3, name: '执行'},
-  {code: 5, name: '停止'},
-  {code: 6, name: '可停止'},
-  {code: 7, name: '可撤销'},
-  {code: 8, name: '临时医嘱'},
-  {code: 9, name: '长期医嘱'},
-])
+  { code: 0, name: '全部' },
+  { code: 1, name: '录入' },
+  { code: 2, name: '确认' },
+  { code: 3, name: '执行' },
+  { code: 5, name: '停止' },
+  { code: 6, name: '可停止' },
+  { code: 7, name: '可撤销' },
+  { code: 8, name: '临时医嘱' },
+  { code: 9, name: '长期医嘱' },
+]);
 
 const zhuangTaiXuanZhe = (val) => {
   if (val >= 6) {
-    orderName = ''
-    pinLv.value = ''
+    orderName = '';
+    pinLv.value = '';
   }
-}
+};
 
 const chaXunYiZhuClick = (total) => {
-  if (youWuXuanZheHuanZhe()) return
-  const dateS = getDateRangeFormatDate(dateRange.value)
+  if (youWuXuanZheHuanZhe()) return;
+  const dateS = getDateRangeFormatDate(dateRange.value);
   let data = {
     currentPage: yiZhuPage.value.currentPage,
     pageSize: yiZhuPage.value.pageSize,
@@ -244,32 +246,34 @@ const chaXunYiZhuClick = (total) => {
     endTime: dateS.endTime,
     frequCode: pinLv.value,
     orderName: orderName,
-    zhuangTai: zhuangTai.value
-  }
-  huoQuYiZhuShuJu(data).then((res) => {
-    yiZhuPage.value.total = res.total
-    yiZhuPage.value.data = res.records
-  }).catch(e => {
-    yiZhuPage.value.total = 0
-    yiZhuPage.value.data = []
-  })
-}
+    zhuangTai: zhuangTai.value,
+  };
+  huoQuYiZhuShuJu(data)
+    .then((res) => {
+      yiZhuPage.value.total = res.total;
+      yiZhuPage.value.data = res.records;
+    })
+    .catch((e) => {
+      yiZhuPage.value.total = 0;
+      yiZhuPage.value.data = [];
+    });
+};
 
 const handleSizeChange = (val) => {
-  yiZhuPage.value.pageSize = val
-  chaXunYiZhuClick(yiZhuPage.value.total)
-}
+  yiZhuPage.value.pageSize = val;
+  chaXunYiZhuClick(yiZhuPage.value.total);
+};
 
 const handleCurrentChange = (val) => {
-  yiZhuPage.value.currentPage = val
-  chaXunYiZhuClick(yiZhuPage.value.total)
-}
+  yiZhuPage.value.currentPage = val;
+  chaXunYiZhuClick(yiZhuPage.value.total);
+};
 /* 添加子医嘱的背景颜色 */
-const differChildrenRows = ({row}) => {
+const differChildrenRows = ({ row }) => {
   if (row.isChildren) {
-    return 'children-row'
+    return 'children-row';
   }
-}
+};
 
 /**
  * 下面这里是添加医嘱了
@@ -282,75 +286,75 @@ const addYiZhuClick = () => {
       name: '添加医嘱',
     },
     query: {
-      path: '/inpatient/zhuYuanYiSheng/yiZhuLuRu'
-    }
-  })
-}
+      path: '/inpatient/zhuYuanYiSheng/yiZhuLuRu',
+    },
+  });
+};
 
-const dianJiYiZhuChaoZuo = ({actOrderNo, orderName}, flag, name) => {
-  chaoZuoBiaoZhi.value = flag
-  yiZhuHao.value = actOrderNo
+const dianJiYiZhuChaoZuo = ({ actOrderNo, orderName }, flag, name) => {
+  chaoZuoBiaoZhi.value = flag;
+  yiZhuHao.value = actOrderNo;
   if (flag === 1) {
-    zhiXingChaoZuo()
+    zhiXingChaoZuo();
   } else {
-    yiZhuChaoZuoDialog = true
+    yiZhuChaoZuoDialog = true;
     if (flag === 2) {
-      yiZhuChaoZuoBiaoTi = '撤销医嘱'
+      yiZhuChaoZuoBiaoTi = '撤销医嘱';
     } else if (flag === 3) {
-      yiZhuChaoZuoBiaoTi = '停止医嘱'
+      yiZhuChaoZuoBiaoTi = '停止医嘱';
     }
   }
-}
+};
 
 const zhiXingChaoZuo = () => {
   if (chaoZuoBiaoZhi.value === 90) {
     let data = {
       actOrderNoList: [],
-      endTime: tingZhiRiQi.value
-    }
+      endTime: tingZhiRiQi.value,
+    };
     xuanZhongDeShuJu.value.forEach((item) => {
-      data.actOrderNoList.push(item.actOrderNo)
-    })
+      data.actOrderNoList.push(item.actOrderNo);
+    });
     piLiangXiuGaiTingZhiShiJian(data).then((res) => {
-      handleCurrentChange(yiZhuPage.value.currentPage)
-      yiZhuChaoZuoDialog = false
-    })
+      handleCurrentChange(yiZhuPage.value.currentPage);
+      yiZhuChaoZuoDialog = false;
+    });
   } else {
-    let data = ''
+    let data = '';
     if (chaoZuoBiaoZhi.value === 2) {
-      data = content.value
+      data = content.value;
     } else if (chaoZuoBiaoZhi.value === 3) {
-      data = tingZhiRiQi.value
+      data = tingZhiRiQi.value;
     }
     yiZhuChaoZuo(yiZhuHao.value, chaoZuoBiaoZhi.value, data).then((res) => {
-      handleCurrentChange(yiZhuPage.value.currentPage)
-      yiZhuChaoZuoDialog = false
-      content.value = ''
-    })
+      handleCurrentChange(yiZhuPage.value.currentPage);
+      yiZhuChaoZuoDialog = false;
+      content.value = '';
+    });
   }
-}
+};
 
-let yiZhuChaoZuoDialog = $ref(false)
-const content = ref('')
-const tingZhiRiQi = ref('')
-const chaoZuoBiaoZhi = ref(0)
-const yiZhuHao = ref(0)
-let yiZhuChaoZuoBiaoTi = $ref('')
+let yiZhuChaoZuoDialog = $ref(false);
+const content = ref('');
+const tingZhiRiQi = ref('');
+const chaoZuoBiaoZhi = ref(0);
+const yiZhuHao = ref(0);
+let yiZhuChaoZuoBiaoTi = $ref('');
 
-const xuanZhongDeShuJu = ref([])
+const xuanZhongDeShuJu = ref([]);
 
 const huoQuXuanZhongDeShuJu = (val) => {
-  xuanZhongDeShuJu.value = val
-}
+  xuanZhongDeShuJu.value = val;
+};
 
 // 用户切换全选和全不选 时 el-table中的全选不会选中子节点
 const toggleSelection = (row, selected) => {
   if (row) {
-    row.forEach(item => {
-      tableRef.value.toggleRowSelection(item, selected)
-    })
+    row.forEach((item) => {
+      tableRef.value.toggleRowSelection(item, selected);
+    });
   }
-}
+};
 
 /**
  * 切换全选和不全选
@@ -358,68 +362,68 @@ const toggleSelection = (row, selected) => {
  */
 let quanXuanFlag = false; // 默认 为全不选
 const quanXuanYiZhu = (selection) => {
-  quanXuanFlag = !quanXuanFlag
-  selection.forEach(item => {
+  quanXuanFlag = !quanXuanFlag;
+  selection.forEach((item) => {
     if (stringNotBlank(item.children)) {
-      toggleSelection(item.children, quanXuanFlag)
+      toggleSelection(item.children, quanXuanFlag);
     }
-  })
+  });
   if (!quanXuanFlag) {
-    tableRef.value.clearSelection()
+    tableRef.value.clearSelection();
   }
-}
+};
 
 /**
  * 点击复制医嘱
  */
 const dianJiFuZhuXuanZhongYiZhu = () => {
-  fuZhiYiZhu.value = xuanZhongDeShuJu.value
-}
-
+  fuZhiYiZhu.value = xuanZhongDeShuJu.value;
+};
 
 onActivated(() => {
   getServerDateApi().then((res) => {
-    dateRange.value[0] = getFormatDatetime(res, 'YYYY-MM-DD')
-    dateRange.value[1] = getFormatDatetime(res, 'YYYY-MM-DD')
-    chaXunYiZhuClick(0)
-  })
-})
+    dateRange.value[0] = getFormatDatetime(res, 'YYYY-MM-DD');
+    dateRange.value[1] = getFormatDatetime(res, 'YYYY-MM-DD');
+    chaXunYiZhuClick(0);
+  });
+});
 
-
-watch(() => huanZheXinXi.value, () => {
-  getServerDateApi().then((res) => {
-    if (dateRange.value === null) {
-      dateRange.value = []
-      dateRange.value.push(getFormatDatetime(res, 'YYYY-MM-DD'))
-      dateRange.value.push(getFormatDatetime(res, 'YYYY-MM-DD'))
-    } else {
-      dateRange.value[0] = getFormatDatetime(res, 'YYYY-MM-DD')
-      dateRange.value[1] = getFormatDatetime(res, 'YYYY-MM-DD')
-    }
-    chaXunYiZhuClick(0)
-  })
-})
+watch(
+  () => huanZheXinXi.value,
+  () => {
+    getServerDateApi().then((res) => {
+      if (dateRange.value === null) {
+        dateRange.value = [];
+        dateRange.value.push(getFormatDatetime(res, 'YYYY-MM-DD'));
+        dateRange.value.push(getFormatDatetime(res, 'YYYY-MM-DD'));
+      } else {
+        dateRange.value[0] = getFormatDatetime(res, 'YYYY-MM-DD');
+        dateRange.value[1] = getFormatDatetime(res, 'YYYY-MM-DD');
+      }
+      chaXunYiZhuClick(0);
+    });
+  }
+);
 
 function getYiZhuFlag(val) {
   if (stringIsBlank(val)) {
-    return 'warning'
+    return 'warning';
   }
   switch (val) {
-    case "1":
-      return 'info'
-    case "2":
-      return 'success'
-    case "3":
-      return ''
-    case "4":
-      return ''
-    case "5":
-      return 'danger'
+    case '1':
+      return 'info';
+    case '2':
+      return 'success';
+    case '3':
+      return '';
+    case '4':
+      return '';
+    case '5':
+      return 'danger';
     default:
-      return 'warning'
+      return 'warning';
   }
 }
-
 </script>
 
 <style scoped>
@@ -437,5 +441,4 @@ function getYiZhuFlag(val) {
   line-height: 26px;
   font-weight: bold;
 }
-
 </style>