Browse Source

Merge branch 'master' of https://172.16.32.165/lighter/vue-intergration-platform

lighter 3 years ago
parent
commit
a70c04d161

+ 8 - 0
src/api/zhu-yuan-yi-sheng/yi-zhu-lu-ru.js

@@ -117,6 +117,14 @@ export function baoCunMuBan(data) {
     })
 }
 
+export function deleteADoctorSOrderTemplate(patternCode) {
+    return request({
+        url: url + '/deleteADoctorSOrderTemplate',
+        method: 'delete',
+        params: {patternCode}
+    })
+}
+
 export function muBanCaoZuo(patternCode, patternName, deptCode, sortNo, flag) {
     return request({
         url: url + '/muBanCaoZuo',

+ 2 - 5
src/components/xc/select-v2/VirtualizationSelect.vue

@@ -43,12 +43,9 @@ const props = defineProps({
 const emit = defineEmits(['change', 'update:modelValue'])
 
 const itemHeight = 34
-
 let emptyHeight = $ref(itemHeight * props.dataLength)
-let containerHeight = 300
-
-
-let itemCount = Math.ceil(containerHeight / itemHeight)
+let containerHeight = $ref(300)
+let itemCount = $ref(Math.ceil(containerHeight / itemHeight))
 
 const container = ref(null)
 const start = ref(0)

+ 3 - 0
src/components/xc/select-v2/XcSelectV2.vue

@@ -246,6 +246,9 @@ const valueChange = async (whetherToChangeTheValue) => {
 watch(
     () => props.modelValue[props.value],
     (newValue, oldValue) => {
+      if (!newValue) {
+        label = ''
+      }
       valueChange(true)
     },
     {immediate: true, deep: true}

+ 0 - 51
src/components/xc/xc-table-v2/XcTableV2.vue

@@ -1,51 +0,0 @@
-<template>
-  <el-auto-resizer>
-    <template #default="{ height, width }">
-      <el-table-v2 :data="props.data"
-                   :columns="columns"
-                   :width="width"
-                   :height="height - 200"
-                   fixed/>
-    </template>
-  </el-auto-resizer>
-</template>
-
-<script setup name='XcTableV2'>
-
-const props = defineProps({
-  data: {
-    type: Array,
-    default: []
-  }
-})
-
-// let width = $ref(123)
-// let height = $ref(400)
-
-let columns = $ref([])
-
-onBeforeMount(() => {
-  console.log(useSlots().default())
-  for (let i = 0; i < useSlots().default().length; i++) {
-    let item = useSlots().default()[i]
-    if (item.props.type === 'selection') {
-      columns.push({
-        dataKey: 'selection',
-        width: 50,
-
-      });
-    } else {
-      columns.push({
-        dataKey: item.props.prop,
-        title: item.props.label,
-        width: item.props.width ? 120 : parseInt(item.props.width)
-      });
-    }
-  }
-})
-
-</script>
-
-<style scoped>
-
-</style>

+ 42 - 10
src/components/xc/xc-table/XcTable.vue

@@ -4,13 +4,14 @@
       :data="!props.localPaging ? props.data.data :
        props.data.data.slice((props.data.currentPage - 1) * props.data.pageSize,props.data.currentPage * props.data.pageSize) "
       style="width: 100%"
-      :height="!props.height ? windowSize.h - 120 :props.height"
+      :height="!props.height ? windowSize.h - 100 :props.height"
       @selection-change="selectionChange"
       @row-click="rowClick"
       highlight-current-row
       :row-key="props.rowKey"
       border
       @select-all="selectAll"
+      default-expand-all
       stripe>
     <slot/>
   </el-table>
@@ -20,13 +21,14 @@
       :total="props.data.total"
       :layout="props.layout"
       :small="!!props.small"
-      :page-sizes="[10, 20, 30, 100]"
+      :page-sizes="props.pageSizes"
       @current-change="currentChange"
       @size-change="sizeChange"/>
 </template>
 
 <script setup name='XcTable'>
 import store from "@/store";
+import {ElMessage} from "element-plus";
 
 const props = defineProps({
   data: {
@@ -57,12 +59,20 @@ const props = defineProps({
   },
   small: {
     type: Boolean
-  }
+  },
+  pageSizes: {
+    type: Array,
+    default: [10, 20, 30, 100]
+  },
 })
-const emit = defineEmits(['currentChange', 'sizeChange', 'rowClick'])
+const emit = defineEmits([
+  'currentChange',
+  'sizeChange',
+  'rowClick',
+  'selectionChange'
+])
 
 let tableRef = $ref(null)
-let selectedData = $ref([])
 
 const windowSize = computed(() => {
   return store.state.app.windowSize
@@ -94,25 +104,47 @@ const toggleSelection = (row, selected) => {
 }
 
 const selectionChange = (selection) => {
-  selectedData = selection
+  emit('selectionChange', selection)
 }
 
 const rowClick = (row, column, event) => {
-  tableRef.toggleRowSelection(row, !selectedData.includes(row))
-  emit('rowClick', row, column, event)
+  let data = tableRef.getSelectionRows()
+  if (row.children) {
+    for (let i = 0, len = row.children.length; i < len; i++) {
+      tableRef.toggleRowSelection(row.children[i], !data.includes(row))
+    }
+  }
+  tableRef.toggleRowSelection(row, !data.includes(row))
+  emit('rowClick', row, column, event);
 }
 
 const currentChange = (val) => {
-  emit('currentChange', val)
   props.data.currentPage = val
+  emit('currentChange', props.data)
   tableRef.setScrollTop(0)
 }
 
 const sizeChange = (val) => {
-  emit('sizeChange', val)
   props.data.pageSize = val
+  props.data.currentPage = 1
+  emit('sizeChange', props.data)
   tableRef.setScrollTop(0)
 }
+
+const clearSelection = () => {
+  tableRef.clearSelection()
+  ElMessage.success('清空成功。')
+}
+
+/**
+ * 查询条件赋值
+ */
+const queryConditionAssignment = () => {
+
+}
+
+defineExpose({clearSelection})
+
 </script>
 
 <style scoped>

+ 53 - 25
src/components/zhu-yuan-yi-sheng/yi-zhu-lu-ru/HuoQuMuBan.vue

@@ -16,28 +16,42 @@
                     style="width: 300px">
             <el-table-column label="名称" prop="patternName" width="70"></el-table-column>
             <el-table-column label="排序" prop="sortNo"></el-table-column>
-            <el-table-column label="操作" width="120">
+            <el-table-column label="操作" width="180">
               <template #default="scope">
-                <el-dropdown size="small" split-button type="primary" @click="dianJiMuBanMing(scope.row)">
-                  选中
-                  <template #dropdown>
-                    <el-dropdown-menu>
-                      <el-dropdown-item icon="Edit" @click="xiuGaiMuBan(scope.row)">修改</el-dropdown-item>
-                      <br/>
-                      <el-dropdown-item icon="Delete" @click="shanChuMuBan(scope.row, scope.$index)">删除
-                      </el-dropdown-item>
-                      <br/>
-                      <el-dropdown-item v-if="scope.row.yiBeiShouCang" :disabled="scope.row.inputId === user.code"
-                                        icon="Collection" @click="dianJiShouCang(scope.row)"
-                      >取消收藏
-                      </el-dropdown-item>
-                      <el-dropdown-item v-else :disabled="scope.row.inputId === user.code" icon="Collection"
-                                        @click="dianJiShouCang(scope.row)">收藏
-                      </el-dropdown-item>
-                    </el-dropdown-menu>
-                  </template>
-                </el-dropdown>
+                <el-button icon="Delete" text type="danger"
+                           @click.stop="clickDeleteTemplate(scope.row.patternCode,scope.$index)">
+                  删除
+                </el-button>
+                <el-button v-if="scope.row.yiBeiShouCang && scope.row.inputId !== user.code" text
+                           icon="StarFilled"
+
+                           type="warning">取消
+                </el-button>
+                <el-button v-else-if="scope.row.inputId !== user.code" text
+                           icon="Star" :disabled="scope.row.inputId === user.code"
+                           type="warning">收藏
+                </el-button>
               </template>
+
+              <!--              <template #default="scope">-->
+              <!--                <el-dropdown size="small" split-button type="primary" @click="dianJiMuBanMing(scope.row)">-->
+              <!--                  选中-->
+              <!--                  <template #dropdown>-->
+              <!--                    <el-dropdown-menu>-->
+              <!--                      <el-dropdown-item icon="Delete" @click="shanChuMuBan(scope.row, scope.$index)">删除-->
+              <!--                      </el-dropdown-item>-->
+              <!--                      <br/>-->
+              <!--                      <el-dropdown-item v-if="scope.row.yiBeiShouCang" :disabled="scope.row.inputId === user.code"-->
+              <!--                                        icon="Collection" @click="dianJiShouCang(scope.row)"-->
+              <!--                      >取消收藏-->
+              <!--                      </el-dropdown-item>-->
+              <!--                      <el-dropdown-item v-else :disabled="scope.row.inputId === user.code" icon="Collection"-->
+              <!--                                        @click="dianJiShouCang(scope.row)">收藏-->
+              <!--                      </el-dropdown-item>-->
+              <!--                    </el-dropdown-menu>-->
+              <!--                  </template>-->
+              <!--                </el-dropdown>-->
+              <!--              </template>-->
             </el-table-column>
           </el-table>
           <el-pagination
@@ -120,7 +134,13 @@
 
 <script name="HuoQuMuBan" setup>
 import store from '../../../store'
-import {huoQuMuBanShuJu, huoQuYiZhuMuBan, huoQuZhuYuanPinLv, muBanCaoZuo} from '@/api/zhu-yuan-yi-sheng/yi-zhu-lu-ru'
+import {
+  deleteADoctorSOrderTemplate,
+  huoQuMuBanShuJu,
+  huoQuYiZhuMuBan,
+  huoQuZhuYuanPinLv,
+  muBanCaoZuo
+} from '@/api/zhu-yuan-yi-sheng/yi-zhu-lu-ru'
 import {muBanMing} from '@/views/hospitalization/zhu-yuan-yi-sheng/public-js/zhu-yuan-yi-sheng'
 import {computed, ref} from 'vue'
 import {listIsBlank, stringNotBlank} from '@/utils/blank-utils'
@@ -190,11 +210,19 @@ const handleCurrentChange = (val) => {
   })
 }
 
-// 修改模板
-const xiuGaiMuBan = (row) => {
-  baoCunMuBan.value.daKaiBianJiMuBan(row)
-}
+
 // 删除模板
+const clickDeleteTemplate = (row, index) => {
+  ElMessageBox.confirm('确定要删除该模板吗?', '提示', {
+    type: 'error',
+  }).then(() => {
+    deleteADoctorSOrderTemplate(row, index).then((res) => {
+
+    })
+  })
+  console.log(row, index)
+}
+
 const shanChuMuBan = (row, index) => {
   ElMessageBox.confirm('确定要删除该模板吗?', '提示', {
     type: 'error',

+ 9 - 5
src/views/hospitalization/zhu-yuan-yi-sheng/yi-zhu-lu-ru/TianJiaYiZhu.vue

@@ -297,6 +297,7 @@
   <!-- 这里是搜索医嘱的 -->
   <sou-suo-yi-zhu v-if="yiZhuMingDialog" @close="closeTheDoctorSOrderSearchBox()"
                   @xuanZhongFeiYong="xuanZhongFeiYong"></sou-suo-yi-zhu>
+  <!-- 这个是过敏源的 -->
   <AllergenEntry v-if="allergenDialog" :pat-no="huanZheXinXi.inpatientNo"
                  @close="allergenDialog = false"></AllergenEntry>
 </template>
@@ -571,10 +572,13 @@ const fuYiZhuData = ref([])
 const fuYiZhuClick = () => {
   fuYiZhuData.value = []
   for (let i = 0, len = yiZhuList.value.length; i < len; i++) {
-    fuYiZhuData.value.push({
-      code: yiZhuList.value[i].id,
-      name: yiZhuList.value[i].orderName
-    })
+    let data = yiZhuList.value[i]
+    if (data.drugFlag === 'i' && !data.parentNo) {
+      fuYiZhuData.value.push({
+        code: data.id,
+        name: data.orderName
+      })
+    }
   }
 }
 
@@ -738,7 +742,7 @@ const kangJunYaoYongYaoFangShiGaiBian = (val) => {
 }
 
 // 模板数据
-let muBanDuiHuaKuang = $ref(false)
+let muBanDuiHuaKuang = $ref(true)
 // 这里是返回的模板数据
 const muBanShuJu = (val) => {
   let tongZhiCiShu = 0

+ 40 - 73
src/views/hospitalization/zhu-yuan-yi-sheng/yi-zhu-lu-ru/YiZhuLuRu.vue

@@ -55,27 +55,30 @@
       </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"
-          @row-click="clickOnTheForm"
-      >
-        <el-table-column fixed="left" type="index"></el-table-column>
-        <el-table-column fixed="left" type="selection"></el-table-column>
+      <xc-table :data="yiZhuPage" row-key="actOrderNo"
+                @currentChange="handleCurrentChange"
+                @sizeChange="handleSizeChange"
+                :height="windowSize.h / 1.5"
+                @selectionChange="huoQuXuanZhongDeShuJu"
+                ref="tableRef">
+        <el-table-column fixed="left" reserve-selection 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" width="20">
+          <template #default="scope">
+            {{ scope.row.orderGroup }}
+          </template>
+        </el-table-column>
+        <el-table-column fixed="left" label="医嘱名称" show-overflow-tooltip width="135">
+          <template #default="scope">
+            {{ scope.row.orderName }}
           </template>
         </el-table-column>
-        <el-table-column fixed="left" label="医嘱名称" prop="orderName" show-overflow-tooltip width="135"></el-table-column>
         <el-table-column label="剂量" prop="doseUnitName">
           <template #default="scope">
             <span>{{ scope.row.dose }} {{ scope.row.doseUnitName }}</span>
@@ -115,35 +118,21 @@
         </el-table-column>
         <el-table-column label="药房" prop="groupNoName"></el-table-column>
         <el-table-column label="序号" prop="serialName"></el-table-column>
-        <el-table-column fixed="right" label="操作" width="150">
+        <el-table-column fixed="right" width="220">
+          <template #header>
+            <el-button size="small" @click="clearSelection" type="warning">清空选择</el-button>
+          </template>
           <template #default="scope">
-            <el-dropdown :hide-on-click="false" size="small" split-button type="primary">
-              操作
-              <template #dropdown>
-                <el-dropdown-menu>
-                  <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-menu>
-              </template>
-            </el-dropdown>
+            <el-button text :disabled="scope.row.statusFlag === '5'"
+                       @click.stop="dianJiYiZhuChaoZuo(scope.row, 1,'无')">
+              <span v-if="scope.row.emergencyFlag === '1'">取消</span>
+              <span v-else>紧急</span>
+            </el-button>
+            <el-button text @click.stop="dianJiYiZhuChaoZuo(scope.row, 2, '撤销医嘱')" type="warning"> 撤销</el-button>
+            <el-button text @click.stop="dianJiYiZhuChaoZuo(scope.row, 3, '停止医嘱')" type="danger"> 停止</el-button>
           </template>
         </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"
-      >
-      </el-pagination>
+      </xc-table>
     </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%">
@@ -180,7 +169,7 @@ import store from '@/store'
 import {stringIsBlank, stringNotBlank} from '@/utils/blank-utils'
 import {getServerDateApi, getTheTransferList} from '@/api/public-api'
 import router from '@/router'
-import XcSelectV2 from "@/components/xc/select-v2/XcSelectV2.vue";
+import XcTable from "@/components/xc/xc-table/XcTable.vue";
 import sleep from "@/utils/sleep";
 
 const windowSize = computed(() => {
@@ -197,6 +186,8 @@ let orderName = $ref('')
 const yiZhuMingZiData = ref([])
 // 获取频率
 const pinLv = ref('')
+// 表格
+let tableRef = $ref(null)
 // 状态
 const zhuangTai = ref(0)
 // 分页
@@ -206,7 +197,6 @@ const yiZhuPage = ref({
   total: 0,
   data: [],
 })
-const tableRef = ref(null)
 
 const remoteMethodChargeCode = (val) => {
   if (youWuXuanZheHuanZhe()) return
@@ -272,11 +262,9 @@ const handleCurrentChange = (val) => {
   yiZhuPage.value.currentPage = val
   chaXunYiZhuClick(yiZhuPage.value.total)
 }
-/* 添加子医嘱的背景颜色 */
-const differChildrenRows = ({row}) => {
-  if (row.isChildren) {
-    return 'children-row'
-  }
+
+const clearSelection = () => {
+  tableRef.clearSelection()
 }
 
 /**
@@ -365,26 +353,6 @@ const toggleSelection = (row, selected) => {
   }
 }
 
-/**
- * 切换全选和不全选
- * @type {boolean}
- */
-let quanXuanFlag = false // 默认 为全不选
-const quanXuanYiZhu = (selection) => {
-  quanXuanFlag = !quanXuanFlag
-  selection.forEach((item) => {
-    if (stringNotBlank(item.children)) {
-      toggleSelection(item.children, quanXuanFlag)
-    }
-  })
-  if (!quanXuanFlag) {
-    tableRef.value.clearSelection()
-  }
-}
-
-const clickOnTheForm = (row, column, event) => {
-  tableRef.value.toggleRowSelection(row, !xuanZhongDeShuJu.value.includes(row))
-}
 
 /**
  * 点击复制医嘱
@@ -394,9 +362,8 @@ const dianJiFuZhuXuanZhongYiZhu = () => {
 }
 
 onMounted(async () => {
-  // setTimeout(() => {
-  //   addYiZhuClick()
-  // }, 300)
+  await sleep(200)
+  addYiZhuClick()
   zkList.value = await getTheTransferList()
 })
 

+ 17 - 11
src/views/settings/Test.vue

@@ -6,7 +6,7 @@
   <el-button @click="test1">清空</el-button>
   <el-button @click="generateData">生成数据</el-button>
 
-  <xc-table :data="tableData" row-key="code" localPaging small>
+  <xc-table :data="tableData" row-key="code" localPaging small @currentChange="currentChange">
     <el-table-column type="selection" reserve-selection/>
     <el-table-column label="编码" prop="code"></el-table-column>
     <el-table-column label="名称" prop="name"></el-table-column>
@@ -18,6 +18,8 @@
 <script setup name='Test'>
 import sleep from "@/utils/sleep";
 import XcTable from "@/components/xc/xc-table/XcTable.vue";
+import {clone} from "@/utils/clone";
+import {uuid} from "@/utils/getUuid";
 
 let dataV2 = $ref([])
 
@@ -33,6 +35,10 @@ const vChange = (val) => {
   console.log(val)
 }
 
+const currentChange = (val) => {
+  console.log(tableData)
+  console.log(tableData.currentPage)
+}
 
 const obj = $ref({
   tcode: '',
@@ -86,22 +92,22 @@ const te = (val) => {
   console.log(val)
 }
 
+let children = []
+
 for (let i = 0; i < 1000; i++) {
-  let children = []
-  if (i % 3 === 0) {
-    for (let j = 0; j < 10; j++) {
-      children.push({
-        code: 'code' + i,
-        name: 'name' + i,
-        qita: 'qita' + 12,
-      });
-    }
+  children = []
+  for (let j = 0; j < 10; j++) {
+    children.push({
+      code: i + j + 'value' + uuid(5, 62),
+      name: 'name' + j,
+      qita: 'qita' + 12,
+    });
   }
   tableData.data.push({
     code: 'code' + i,
     name: 'name' + i,
     qita: 'qita' + 12,
-    children: children
+    children: i % 3 === 0 ? clone(children) : []
   })
 }