소스 검색

Merge branch 'master' of http://192.168.100.32:3000/fanfan/xt-front

fan 2 년 전
부모
커밋
fac3fb2b34
3개의 변경된 파일101개의 추가작업 그리고 128개의 파일을 삭제
  1. 7 3
      src/api/biz/management/wardInfo.ts
  2. 12 12
      src/views/biz/management/ward/data.ts
  3. 82 113
      src/views/biz/management/ward/index.vue

+ 7 - 3
src/api/biz/management/wardInfo.ts

@@ -1,15 +1,15 @@
 import { defHttp } from '/@/utils/http/axios';
-import { setParams } from '/@/utils/index';
 enum Api {
-  getWardInfo = '/biz/sys/wardInfo/query/page',
+  getWardInfo = '/biz/sys/wardInfo/query/list',
   wardInfoAdd = '/biz/sys/wardInfo/add',
   wardInfoEdit = '/biz/sys/wardInfo/edit',
   changeStatus = '/biz/sys/wardInfo/modify/status/',
   WardInfoById = '/biz/sys/wardInfo/detail',
+  delWard = '/biz/sys/wardInfo/removeByIds',
 }
 
 export const getWardInfo = (params?: object) => {
-  return defHttp.post({ url: Api.getWardInfo, params: setParams(params) });
+  return defHttp.post({ url: Api.getWardInfo, params: params });
 };
 
 export const wardInfoAdd = (params?: object) => {
@@ -24,6 +24,10 @@ export const changeStatus = (id: string) => {
   return defHttp.post({ url: Api.changeStatus + id });
 };
 
+export const delWard = (params?: object) => {
+  return defHttp.post({ url: Api.delWard, params: params });
+};
+
 export const wardInfoById = (id?: string | number, params?: object) => {
   return defHttp.get({ url: Api.WardInfoById + '/' + id, params: params });
 };

+ 12 - 12
src/views/biz/management/ward/data.ts

@@ -1,5 +1,5 @@
 import { BasicColumn, FormSchema } from '/@/components/Table';
-import { getAttrList } from '/@/api/biz/management/wardType';
+import { listDictModel } from '@/api/common';
 
 export const wardInfoColumns: BasicColumn[] = [
   {
@@ -7,9 +7,9 @@ export const wardInfoColumns: BasicColumn[] = [
     dataIndex: 'name',
   },
   {
-    title: '病区属性',
-    dataIndex: 'propertiesName',
-    width: 260,
+    title: '传染病',
+    dataIndex: 'infectiousDiseases',
+    width: 560,
   },
   {
     title: '状态',
@@ -53,17 +53,17 @@ export const wardTypeDataFormSchema: FormSchema[] = [
 // 表单信息新增编辑
 export const wardInfoDataFormSchema: FormSchema[] = [
   {
-    label: '病区属性',
-    field: 'propertiesId',
+    label: '传染病',
+    field: 'infectiousDiseases',
     component: 'ApiSelect',
     required: true,
     componentProps: {
-      api: getAttrList,
-      mode: 'single',
-      labelField: 'name',
-      valueField: 'id',
-      resultField: 'data',
-      placeholder: '请输入存储配置',
+      api: listDictModel,
+      mode: 'multiple',
+      params: {
+        dictCode: 'pb_epidemic',
+      },
+      placeholder: '请选择病区属性',
     },
   },
   {

+ 82 - 113
src/views/biz/management/ward/index.vue

@@ -16,7 +16,7 @@
         >
           <p :key="0" v-if="activeKey == 0">
             <Row>
-              <Col :span="6">
+              <!-- <Col :span="6">
                 <Card title="病区属性" style="height: 690px">
                   <template #extra
                     ><Button
@@ -53,8 +53,8 @@
                   </Row>
                 </Card>
               </Col>
-              <Col :span="1" />
-              <Col :span="17">
+              <Col :span="1" /> -->
+              <Col :span="24">
                 <Card title="病区信息" style="height: 690px">
                   <template #extra
                     ><Button shape="circle" v-auth="['bizSys:wardInfo:add']" @click="handleAddInfo"
@@ -70,6 +70,14 @@
                           {{ formatDictValue(disableOptions, record.disable) }}
                         </Tag>
                       </template>
+                      <template v-if="column.key === 'infectiousDiseases'">
+                        <div
+                          style="display: inline-block"
+                          v-for="(item, index) in record.infectiousDiseases"
+                          :key="index"
+                          >{{ formatDictValue(pb_epidemic, item) }}&nbsp;
+                        </div>
+                      </template>
                       <template v-if="column.key === 'action'">
                         <TableAction
                           :actions="[
@@ -80,28 +88,27 @@
                               onClick: handleEdit.bind(null, record),
                             },
                             {
-                              auth: 'bizSys:wardInfo:status',
+                              auth: 'bizSys:wardInfo:remove',
                               icon: 'icon-xt-details_delete_default|iconfont',
-                              tooltip: '停用',
-                              ifShow: record.disable == 0,
+                              tooltip: '删除',
                               popConfirm: {
-                                title: '是否确认停用',
+                                title: '是否确认删除',
                                 placement: 'left',
-                                confirm: handleChangeState.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),
+                                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>
@@ -133,7 +140,7 @@
                 <Card title="班次配置" style="height: 690px">
                   <template #extra
                     ><Button
-                      v-auth="['bizSys:wardInfo:add']"
+                      v-auth="['bizSys:sailings:add']"
                       @click="handleAddSailing"
                       shape="circle"
                       ><Icon icon="icon-xt-details_edit_default|iconfont" :size="14" /></Button
@@ -145,45 +152,6 @@
                           {{ formatDictValue(disableOptions, record.disable) }}
                         </Tag>
                       </template>
-                      <template v-if="column.key === 'action'">
-                        <TableAction
-                          :actions="[
-                            {
-                              auth: 'bizSys:wardInfo:edit',
-                              icon: 'icon-xt-details_edit_default|iconfont',
-                              tooltip: '编辑',
-                              label: '',
-                              onClick: handleEdit.bind(null, record),
-                            },
-                            {
-                              auth: 'bizSys:wardInfo:status',
-                              icon: 'icon-minus-square|iconfont',
-                              tooltip: '停用',
-                              label: '',
-                              color: 'error',
-                              ifShow: record.disable == 0,
-                              popConfirm: {
-                                title: '是否确认停用',
-                                placement: 'left',
-                                confirm: handleChangeState.bind(null, record),
-                              },
-                            },
-                            {
-                              auth: 'bizSys:wardInfo:status',
-                              icon: 'icon-plus|iconfont',
-                              tooltip: '启用',
-                              label: '',
-                              ifShow: record.disable == 1,
-                              color: 'error',
-                              popConfirm: {
-                                title: '是否确认启用',
-                                placement: 'left',
-                                confirm: handleChangeState.bind(null, record),
-                              },
-                            },
-                          ]"
-                        />
-                      </template>
                     </template>
                   </BasicTable>
                 </Card>
@@ -193,7 +161,7 @@
         </Card>
       </PageWrapper>
     </div>
-    <WardTypeFormModal @register="registerWardTypeModal" @success="handleWardTypeSuccess" />
+    <!-- <WardTypeFormModal @register="registerWardTypeModal" @success="handleWardTypeSuccess" /> -->
     <WardInfoFormModal @register="registerWardInfoModal" @success="handleWardInfoSuccess" />
     <WorkDayFormModal @register="registerWorkDayModal" @success="handleWorkDaySuccess" />
     <SailingEdit @register="registerSailingEditModal" @success="handleSailingSuccess" />
@@ -208,30 +176,32 @@
   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 WardTypeFormModal from './wardTypeFormModal.vue';
   import WardInfoFormModal from './wardInfoFormModal.vue';
   import WorkDayFormModal from './workDayFormModal.vue';
   import SailingEdit from './sailingsEditFormModal.vue';
-  import { getWardInfo, changeStatus } from '/@/api/biz/management/wardInfo';
-  import { getAttrList, deleteWardType } from '/@/api/biz/management/wardType';
+  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';
   import { useMessage } from '/@/hooks/web/useMessage';
   import { formatDictColor, formatDictFontColor, formatDictValue } from '/@/utils';
-  const { createConfirm, createMessage } = useMessage();
+  const { createMessage } = useMessage(); // createConfirm,
   const tabList = ref([
     { key: 0, tab: '病区管理', type: 'WARD' },
     { key: 1, tab: '工作日班次', type: 'WORK' },
   ]);
   const activeKey = ref(0);
-  const attributePositiveList = ref([]); // 阳性列表
-  const attributeFeminineList = ref([]); // 阴性列表
+  // 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' });
-    await getWardType();
+    pb_epidemic.value = await listDictModel({ dictCode: 'pb_epidemic' });
+    // await getWardType();
     await getWordDay();
   });
   const [registerTable, { reload }] = useTable({
@@ -273,7 +243,7 @@
     useSearchForm: false,
   });
 
-  const [registerWardTypeModal, { openModal: openWardTypeModal }] = useModal();
+  // const [registerWardTypeModal, { openModal: openWardTypeModal }] = useModal();
   const [registerWardInfoModal, { openModal: openWardInfoModal }] = useModal();
   const [registerWorkDayModal, { openModal: openWorkDayModal }] = useModal();
   const [registerSailingEditModal, { openModal: openSailingModal }] = useModal();
@@ -291,28 +261,28 @@
     return { ...params, propertiesId: selectType.value, orders: tableSort.value };
   }
   // 打开新增属性方法
-  function handleAddAttr() {
-    openWardTypeModal(true, {
-      isUpdate: false,
-    });
-  }
+  // 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();
-      },
-    });
-  }
+  // 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, {
@@ -336,40 +306,39 @@
     });
   }
   // 停用启用病区方法
-  async function handleChangeState(record) {
-    const notes = record.disable == 0 ? '停用' : '启用';
-    await changeStatus(record.id);
-    createMessage.success('病区' + notes + '成功!');
+  async function handleDelWard(record) {
+    await delWard([record.id]);
+    createMessage.success('病区删除成功!');
     reload();
   }
 
   // 保存成功回调事件
-  async function handleWardTypeSuccess() {
-    await getWardType();
-  }
+  // 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 });
-      }
-    });
-  }
+  // 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();
-  }
+  // function handleSelectWard(e) {
+  //   selectType.value = e.key;
+  //   reload();
+  // }
 
   // 获取工作日
   async function getWordDay() {