Quellcode durchsuchen

fix: 库存管理模块修复

Tong vor 2 Jahren
Ursprung
Commit
e467f44645

+ 30 - 17
src/views/biz/engineer/dics/index.vue

@@ -1,24 +1,37 @@
 <template>
-  <PageWrapper dense contentFullHeight contentClass="flex">
-    <SysDictTable class="w-1/2" @dict-change="handleDictChange" />
-    <SysDictItemTable class="w-1/2" :dictId="dictId" />
+  <PageWrapper>
+    <a-card
+      :bordered="false"
+      :active-tab-key="activeKey"
+      :tab-list="tabList"
+      @tabChange="
+        key => {
+          activeKey = key;
+        }
+      "
+    >
+      <p v-for="item in tabList" :key="item.key">
+        <Category :type="item.type" v-if="activeKey == item.key" />
+      </p>
+    </a-card>
   </PageWrapper>
 </template>
 <script lang="ts" setup>
-  import { ref } from 'vue';
+  import { onMounted, ref } from 'vue';
   import { PageWrapper } from '/@/components/Page';
-  import SysDictTable from './sysDictTable/index.vue';
-  import SysDictItemTable from './sysDictItemTable/index.vue';
-  // import { filterSub, getSub } from '/@/utils/websocket';
-
-  defineOptions({
-    name: 'sysDict',
+  import Category from '/@/views/sys/sysDict/category/index.vue';
+  import { listDictModel } from '/@/api/common';
+  const activeKey = ref(null);
+  const tabList = ref([]);
+  onMounted(async () => {
+    const dictType = await listDictModel({ dictCode: 'sys_dict_type' });
+    tabList.value = [
+      {
+        key: dictType[0].id,
+        tab: dictType[0].label + '字典',
+        type: dictType[0].value,
+      },
+    ];
+    activeKey.value = dictType[0]['id'];
   });
-
-  const dictId = ref();
-  // 字典选中事件
-  function handleDictChange(value) {
-    if (!value) return;
-    dictId.value = value;
-  }
 </script>

+ 31 - 11
src/views/biz/inventory/estimate/index.vue

@@ -17,27 +17,30 @@
       <template #bodyCell="{ column, record }">
         <template v-if="column.key === 'dialyzer'">
           <div v-for="(item, index) in record.consumable.dialyzer" :key="index">
-            {{ item.name + ':' + item.count + item.unit }}</div
+            {{ item.name + ':' + item.count + (item.unit ? item.unit : '') }}</div
           >
         </template>
         <template v-if="column.key === 'punctureNeedle'">
           <div v-for="(item, index) in record.consumable.punctureNeedle" :key="index">
-            {{ item.name + ':' + item.count + item.unit }}</div
+            {{ item.name + ':' + item.count + (item.unit ? item.unit : '') }}</div
           >
         </template>
         <template v-if="column.key === 'conduit'">
           <div v-for="(item, index) in record.consumable.conduit" :key="index">
-            {{ item.name + ':' + item.count + item.unit }}</div
+            {{ item.name + ':' + item.count + (item.unit ? item.unit : '') }}</div
           >
         </template>
         <template v-if="column.key === 'drug'">
           <div v-for="(item, index) in record.drug" :key="index">
-            {{ item.name + ':' + item.count + item.unit }}</div
+            {{ item.name + ':' + item.count + (item.unit ? item.unit : '') }}</div
           >
         </template>
         <template v-if="column.key === 'vascularAccess'">
           <div v-for="(item, index) in record.vascularAccess" :key="index">{{
-            item.name + ':' + item.count + item.unit
+            formatDictValue(bizDictOptions.va, item.name) +
+            ':' +
+            item.count +
+            (item.unit ? item.unit : '')
           }}</div>
         </template>
       </template>
@@ -46,24 +49,30 @@
           <template #bodyCell="{ column, record }">
             <template v-if="column.key === 'dialyzer'">
               <div v-for="(item, index) in record.suppliesByType.dialyzer" :key="index">
-                {{ item.name + ':' + item.count + item.unit }}</div
+                {{ item.name + ':' + item.count + (item.unit ? item.unit : '') }}</div
               >
             </template>
             <template v-if="column.key === 'punctureNeedle'">
               <div v-for="(item, index) in record.suppliesByType.punctureNeedle" :key="index">
-                {{ item.name + ':' + item.count + item.unit }}</div
+                {{ item.name + ':' + item.count + (item.unit ? item.unit : '') }}</div
               >
             </template>
+            <template v-if="column.key === 'dialysisType'">
+              {{ formatDictValue(bizDictOptions.dt, record.dialysisType) }}
+            </template>
             <template v-if="column.key === 'conduit'">
               <div v-for="(item, index) in record.suppliesByType.conduit" :key="index">
-                {{ item.name + ':' + item.count + item.unit }}</div
+                {{ item.name + ':' + item.count + (item.unit ? item.unit : '') }}</div
               >
             </template>
             <template v-if="column.key === 'supplies'">
               <div v-for="(item, index) in record.supplies" :key="index">
-                {{ item.name + ':' + item.count + item.unit }}</div
+                {{ item.name + ':' + item.count + (item.unit ? item.unit : '') }}</div
               >
             </template>
+            <template v-if="column.key === 'vascularAccess'">
+              {{ formatDictValue(bizDictOptions.va, record.vascularAccess) }}
+            </template>
           </template>
         </BasicTable>
       </template>
@@ -75,7 +84,7 @@
   </div>
 </template>
 <script lang="ts" setup>
-  import { onBeforeMount, ref } from 'vue';
+  import { onBeforeMount, ref, reactive } from 'vue';
   import { BasicTable, useTable } from '/@/components/TableCard';
   import { columns, innerColumns } from './data';
   import {
@@ -84,14 +93,15 @@
     getestimateInWardList,
   } from '/@/api/biz/inventory/estimateApi';
 
+  import { listDictModelBatch } from '@/api/common';
   import Icon from '/@/components/Icon';
   import { XTTitle } from '/@/components/XTTitle/index';
   import { XTTab } from '/@/components/XTTab/index';
   import { useModal } from '/@/components/Modal';
   import PrintModal from './printModal.vue';
   import { XTForm } from '/@/components/XTForm/index';
+  import { formatDictValue } from '/@/utils';
   import dayjs from 'dayjs';
-
   // 标题数据
   const titleData = [
     {
@@ -128,7 +138,17 @@
   const innerTableOpen = ref(false);
 
   const [registerModal, { openModal }] = useModal();
+  const bizDictData = ref([
+    { key: 'dt', dictCode: 'dt' },
+    { key: 'va', dictCode: 'va' },
+  ]);
+  const bizDictOptions = reactive<any>({});
   onBeforeMount(async () => {
+    const res = await listDictModelBatch(bizDictData.value.map(ele => ele.dictCode));
+    for (const i in res) {
+      const filter = bizDictData.value.filter(ele => ele.dictCode == i)[0];
+      bizDictOptions[filter.key] = res[i];
+    }
     getTab();
   });
 

+ 1 - 1
src/views/biz/inventory/supplies/index.vue

@@ -122,7 +122,7 @@
       name: 'searchNames',
       componentType: 'Input',
       prefix: 'icon-xt-search',
-      placeholder: '请输入耗材名称',
+      placeholder: '请输入助记码',
       width: 240,
     },
   ];

+ 0 - 102
src/views/biz/management/ward/index.vue

@@ -16,44 +16,6 @@
         >
           <p :key="0" v-if="activeKey == 0">
             <Row>
-              <!-- <Col :span="6">
-                <Card title="病区属性" style="height: 690px">
-                  <template #extra
-                    ><Button
-                      shape="circle"
-                      v-auth="['bizSys:wardProperties:add']"
-                      @click="handleAddAttr"
-                      ><Icon icon="icon-plus|iconfont" :size="14" /></Button
-                  ></template>
-                  <Row>
-                    <div class="type-title">阴性</div>
-                  </Row>
-                  <Row v-for="item in attributeFeminineList" :key="item.key" style="margin: 4px 0">
-                    <Tag
-                      class="attrs"
-                      closable
-                      @close="handleDeleteAttr(item.key)"
-                      @click="handleSelectWard(item)"
-                      :value="item.key"
-                      >{{ item.label }}
-                    </Tag>
-                  </Row>
-                  <Row>
-                    <div class="type-title">阳性</div>
-                  </Row>
-                  <Row v-for="item in attributePositiveList" :key="item.key" style="margin: 4px 0">
-                    <Tag
-                      class="attrs"
-                      closable
-                      @close="handleDeleteAttr(item.key)"
-                      @click="handleSelectWard(item)"
-                      :value="item.key"
-                      >{{ item.label }}</Tag
-                    >
-                  </Row>
-                </Card>
-              </Col>
-              <Col :span="1" /> -->
               <Col :span="24">
                 <Card title="病区信息" style="height: 690px">
                   <template #extra
@@ -97,18 +59,6 @@
                                 confirm: handleDelWard.bind(null, record),
                               },
                             },
-                            // {
-                            //   auth: 'bizSys:wardInfo:status',
-                            //   icon: 'icon-plus|iconfont',
-                            //   tooltip: '启用',
-                            //   label: '',
-                            //   ifShow: record.disable == 1,
-                            //   popConfirm: {
-                            //     title: '是否确认启用',
-                            //     placement: 'left',
-                            //     confirm: handleChangeState.bind(null, record),
-                            //   },
-                            // },
                           ]"
                         />
                       </template>
@@ -161,7 +111,6 @@
         </Card>
       </PageWrapper>
     </div>
-    <!-- <WardTypeFormModal @register="registerWardTypeModal" @success="handleWardTypeSuccess" /> -->
     <WardInfoFormModal @register="registerWardInfoModal" @success="handleWardInfoSuccess" />
     <WorkDayFormModal @register="registerWorkDayModal" @success="handleWorkDaySuccess" />
     <SailingEdit @register="registerSailingEditModal" @success="handleSailingSuccess" />
@@ -176,12 +125,10 @@
   import Icon from '/@/components/Icon/src/Icon.vue';
   import { BasicTable, useTable, TableAction } from '/@/components/Table';
   import { wardInfoColumns, sailingsColumns } from './data';
-  // import WardTypeFormModal from './wardTypeFormModal.vue';
   import WardInfoFormModal from './wardInfoFormModal.vue';
   import WorkDayFormModal from './workDayFormModal.vue';
   import SailingEdit from './sailingsEditFormModal.vue';
   import { getWardInfo, delWard } from '/@/api/biz/management/wardInfo';
-  //   import { getAttrList } from '/@/api/biz/management/wardType'; // , deleteWardType
   import { getWorkingDay, getSailings } from '/@/api/biz/management/working';
   import { useModal } from '/@/components/Modal';
   import { listDictModel } from '/@/api/common';
@@ -193,15 +140,12 @@
     { key: 1, tab: '工作日班次', type: 'WORK' },
   ]);
   const activeKey = ref(0);
-  // const attributePositiveList = ref([]); // 阳性列表
-  // const attributeFeminineList = ref([]); // 阴性列表
   const workDays = ref([]);
   const disableOptions = ref();
   const pb_epidemic = ref();
   onBeforeMount(async () => {
     disableOptions.value = await listDictModel({ dictCode: 'sys_disable_type' });
     pb_epidemic.value = await listDictModel({ dictCode: 'pb_epidemic' });
-    // await getWardType();
     await getWordDay();
   });
   const [registerTable, { reload }] = useTable({
@@ -243,7 +187,6 @@
     useSearchForm: false,
   });
 
-  // const [registerWardTypeModal, { openModal: openWardTypeModal }] = useModal();
   const [registerWardInfoModal, { openModal: openWardInfoModal }] = useModal();
   const [registerWorkDayModal, { openModal: openWorkDayModal }] = useModal();
   const [registerSailingEditModal, { openModal: openSailingModal }] = useModal();
@@ -260,29 +203,6 @@
   function handleBeforeFetch(params) {
     return { ...params, propertiesId: selectType.value, orders: tableSort.value };
   }
-  // 打开新增属性方法
-  // function handleAddAttr() {
-  //   openWardTypeModal(true, {
-  //     isUpdate: false,
-  //   });
-  // }
-  // 打开删除属性方法
-  // async function handleDeleteAttr(id) {
-  //   createConfirm({
-  //     content: '你确定要删除?',
-  //     iconType: 'warning',
-  //     onOk: async () => {
-  //       await deleteWardType([id]);
-  //       createMessage.success('属性删除成功!');
-  //       await getWardType();
-  //     },
-  //     onCancel: async () => {
-  //       attributePositiveList.value = [];
-  //       attributeFeminineList.value = [];
-  //       await getWardType();
-  //     },
-  //   });
-  // }
   //打开新增病区信息方法
   function handleAddInfo() {
     openWardInfoModal(true, {
@@ -313,33 +233,11 @@
   }
 
   // 保存成功回调事件
-  // async function handleWardTypeSuccess() {
-  //   await getWardType();
-  // }
-
   function handleWardInfoSuccess() {
     reload();
     SailingsReload();
   }
 
-  // async function getWardType() {
-  //   const attrList = await getAttrList();
-  //   attributePositiveList.value = []; // 阳性列表
-  //   attributeFeminineList.value = [];
-  //   attrList.forEach(item => {
-  //     if (item.positive) {
-  //       attributePositiveList.value.push({ label: item.name, key: item.id });
-  //     } else {
-  //       attributeFeminineList.value.push({ label: item.name, key: item.id });
-  //     }
-  //   });
-  // }
-  // 通过病区属性搜索病区信息
-  // function handleSelectWard(e) {
-  //   selectType.value = e.key;
-  //   reload();
-  // }
-
   // 获取工作日
   async function getWordDay() {
     const res = await getWorkingDay();