Selaa lähdekoodia

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

Tong 2 vuotta sitten
vanhempi
commit
f3f869b14e

+ 47 - 9
src/components/Form/src/components/ApiInputDict.vue

@@ -2,7 +2,7 @@
   <div class="flex items-center">
     <a-input-group compact>
       <template v-if="props.params?.dictSort">
-        <a-form-item class="select" :style="{ width: '24%' }">
+        <a-form-item class="select" :style="{ width: props.dictWidth + '%' }">
           <a-select
             v-model:value="dictValue"
             :options="dictData"
@@ -10,15 +10,43 @@
             style="width: 100%"
           />
         </a-form-item>
-        <a-form-item class="input" :style="{ width: '76%' }">
-          <a-input v-model:value="inputValue" @change="handleInputChange" style="width: 100%" />
+        <a-form-item class="input" :style="{ width: 100 - props.dictWidth + '%' }">
+          <a-input
+            v-if="!props.isInputNum"
+            v-model:value="inputValue"
+            @change="handleInputChange"
+            style="width: 100%"
+            :maxLength="props.inputLength"
+          />
+          <a-input-number
+            v-else
+            v-model:value="inputValue"
+            @change="handleInputChange"
+            style="width: 100%"
+            :min="props.numMin"
+            :max="props.numMax"
+          />
         </a-form-item>
       </template>
       <template v-else>
-        <a-form-item class="input" :style="{ width: '76%' }">
-          <a-input v-model:value="inputValue" @change="handleInputChange" style="width: 100%" />
+        <a-form-item class="input" :style="{ width: 100 - props.dictWidth + '%' }">
+          <a-input
+            v-if="!props.isInputNum"
+            v-model:value="inputValue"
+            @change="handleInputChange"
+            style="width: 100%"
+            :maxLength="props.inputLength"
+          />
+          <a-input-number
+            v-else
+            v-model:value="inputValue"
+            @change="handleInputChange"
+            style="width: 100%"
+            :min="props.numMin"
+            :max="props.numMax"
+          />
         </a-form-item>
-        <a-form-item class="select" :style="{ width: '24%' }">
+        <a-form-item class="select" :style="{ width: props.dictWidth + '%' }">
           <a-select
             v-model:value="dictValue"
             :options="dictData"
@@ -46,6 +74,11 @@
       immediate: { type: Boolean, default: true },
       resultField: propTypes.string.def(''),
       placeholder: { type: String },
+      dictWidth: { type: Number, default: 24 },
+      isInputNum: { type: Boolean, default: false },
+      numMax: { type: Number, default: 999 },
+      numMin: { type: Number, default: 0 },
+      inputLength: { type: Number, default: 100 },
     },
     emits: ['change'],
     setup(props, { attrs, emit }) {
@@ -104,12 +137,12 @@
           const res = await api(props.params);
           if (Array.isArray(res)) {
             dictData.value = res;
-            dictValue.value = dictData.value[0]['value'];
+            dictValue.value = dictValue.value || dictData.value[0]['value'];
             return;
           }
           if (props.resultField) {
             dictData.value = get(res, props.resultField) || [];
-            dictValue.value = dictData.value[0]['value'];
+            dictValue.value = dictValue.value || dictData.value[0]['value'];
           }
         } catch (error) {
           console.warn(error);
@@ -141,7 +174,12 @@
 
       // 输入改变
       function handleInputChange(e) {
-        inputValue.value = e.target.value || '';
+        console.log('🚀 ~ file: ApiInputDict.vue:161 ~ handleInputChange ~ e:', e);
+        if (props.isInputNum) {
+          inputValue.value = e;
+        } else {
+          inputValue.value = e.target.value || '';
+        }
         emitChange();
       }
 

+ 1 - 0
src/components/XTUpload/src/XTUpload.vue

@@ -355,6 +355,7 @@
       &--color {
         color: rgb(0 117 255 / 100%);
         margin-left: 16px;
+        min-width: 28px;
       }
 
       &--error {

+ 2 - 3
src/design/index.less

@@ -182,7 +182,6 @@ span {
     width: calc(100% - 182px);
   }
 }
-
-.ant-back-top-icon {
-  // line-height: 40px;
+.ant-back-top {
+  right: 30px !important;
 }

+ 1 - 1
src/views/biz/archives/index/data.ts

@@ -67,7 +67,7 @@ export const siftFormSchema: FormSchema[] = [
         return `${value}岁`;
       },
       marks: {
-        1: '1岁',
+        0: '0岁',
         99: '99岁',
       },
     },

+ 8 - 2
src/views/biz/archives/medicalDocuments/index.vue

@@ -46,7 +46,7 @@
 </template>
 
 <script setup lang="ts">
-  import { onMounted, reactive, ref } from 'vue';
+  import { nextTick, onMounted, reactive, ref } from 'vue';
   import List from '/@/components/XTList/src/List.vue';
   import { PlusOutlined } from '@ant-design/icons-vue';
   import { listDictModel, getPreviewUrl } from '/@/api/common';
@@ -101,7 +101,7 @@
       };
       return obj;
     });
-    if (isFirstLoad.value) {
+    if (isFirstLoad.value && listData.value.length) {
       selected.value = listData.value[0]['id'];
       page.total = listData.value[0]['attachment'] || 0;
       fileIds.value = listData.value[0]['fileIds'];
@@ -133,6 +133,7 @@
     try {
       const res = await getPreviewUrl(id);
       previewUrl.value = res || '';
+      await nextTick();
     } catch (error) {
       previewUrl.value = '';
     }
@@ -161,6 +162,11 @@
         await archivesMedicalDocumentsRemove([data.id]);
         createMessage.success('删除成功');
         await getData();
+        if (listData.value.length) {
+          await callItemClick(listData.value[0]);
+        } else {
+          await handlePreview(undefined);
+        }
       },
     });
   }

+ 7 - 0
src/views/biz/archives/patientBasic/FormModal.vue

@@ -63,6 +63,13 @@
       await setFieldsValue({
         ...resData,
       });
+    } else {
+      await setFieldsValue({
+        cardNo: {
+          input: '',
+          dictValue: 'pb_card_sfz',
+        },
+      });
     }
   });
 

+ 13 - 2
src/views/biz/archives/patientBasic/data.ts

@@ -1,5 +1,6 @@
 import { listDictModel } from '@/api/common';
 import { FormSchema } from '@/components/Form';
+import dayjs from 'dayjs';
 
 export const BasicData = [
   {
@@ -91,6 +92,7 @@ export const dataFormSchema: FormSchema[] = [
     component: 'Input',
     componentProps: {
       placeholder: '请输入患者姓名',
+      maxLength: 60,
     },
   },
   {
@@ -118,6 +120,8 @@ export const dataFormSchema: FormSchema[] = [
           dictCode: 'pb_card',
           dictSort: true,
         },
+        inputLength: 18,
+        dictWidth: 40,
         onChange: e => {
           return (formModel['cardNo'] = e);
         },
@@ -134,6 +138,9 @@ export const dataFormSchema: FormSchema[] = [
       placeholder: '请输入出生日期',
       getPopupContainer: () => document.body,
       valueFormat: 'YYYY-MM-DD',
+      disabledDate: current => {
+        return current > dayjs().endOf('day');
+      },
     },
   },
   {
@@ -143,8 +150,8 @@ export const dataFormSchema: FormSchema[] = [
     component: 'InputNumber',
     componentProps: {
       placeholder: '请输入身高',
-      min: 0,
-      max: 999,
+      min: 10,
+      max: 300,
     },
   },
   {
@@ -154,6 +161,7 @@ export const dataFormSchema: FormSchema[] = [
     component: 'Input',
     componentProps: {
       placeholder: '请输入详细地址',
+      maxLength: 120,
     },
   },
   {
@@ -163,6 +171,7 @@ export const dataFormSchema: FormSchema[] = [
     component: 'Input',
     componentProps: {
       placeholder: '请输入联系电话',
+      maxLength: 11,
     },
   },
   {
@@ -209,6 +218,7 @@ export const dataFormSchema: FormSchema[] = [
     component: 'Input',
     componentProps: {
       placeholder: '请输入家属姓名',
+      maxLength: 60,
     },
   },
   {
@@ -218,6 +228,7 @@ export const dataFormSchema: FormSchema[] = [
     component: 'Input',
     componentProps: {
       placeholder: '请输入家属电话',
+      maxLength: 11,
     },
   },
 ];

+ 7 - 3
src/views/biz/archives/patientBasic/index.vue

@@ -116,14 +116,18 @@
         }
       }
 
-      if (ele.field == 'age') {
-        ele.value = dayjs().diff(res['birthday'], 'year');
-      }
+      // if (ele.field == 'age') {
+      //   ele.value = dayjs().diff(res['birthday'], 'year') || 1;
+      // }
       if (ele.field == 'birthday') {
         ele.value = dayjs(res['birthday']).format('YYYY-MM-DD');
       }
       return ele;
     });
+    console.log(
+      '🚀 ~ file: index.vue:127 ~ getData ~ basicData.value[0].data:',
+      basicData.value[0].data,
+    );
 
     const vascularAccessRes = await archivesVascularAccessQueryCurrent(props.info?.id);
     basicData.value[1].data =

+ 8 - 5
src/views/biz/bed/person/FormModal.vue

@@ -53,14 +53,15 @@
     } | ${data.record.age}岁 )`;
 
     if (unref(isUpdate)) {
-      const resData = await bedScheduledPersonDetail(data.record.id);
+      const resData = await bedScheduledPersonDetail(data.record.patientBasicId);
       console.log('🚀 ~ file: FormModal.vue:54 ~ resData:', resData);
       rowId.value = resData.patientBasicId;
       const workingDay = await getWorkingDay();
       let specialNeedWeek = [];
+      specialNeedWeekOption.value = [];
       // const specialNeedWeekOption = [];
       for (const i in workingDay) {
-        if (workingDay[i]) {
+        if (resData.specialNeed && resData.specialNeed[i]) {
           specialNeedWeek = specialNeedWeek.concat(i);
         }
         specialNeedWeekOption.value.push({
@@ -70,12 +71,14 @@
       }
       const fieldsData = Object.assign(resData, {
         frequency: {
-          input: 1,
+          input: resData.frequency?.times || 2,
           dictValue: resData.frequency?.week == 1 ? 'week_1' : 'week_2',
+          // dictValue: 'week_2',
         },
+        sailingSorts: resData.specialNeed?.sailingSorts || [],
         specialNeedWeek,
       });
-      console.log('🚀 ~ file: FormModal.vue:62 ~ fieldsData:', fieldsData);
+      console.log('🚀 ~ file: FormModal.vue:80 ~ fieldsData:', fieldsData);
       await updateSchema({
         field: 'specialNeedWeek',
         componentProps: {
@@ -97,7 +100,7 @@
     try {
       const values = await validate();
       values.frequency = {
-        week: values.frequency.dictValue,
+        week: values.frequency.dictValue == 'week_2' ? 2 : 1,
         times: values.frequency.input,
       };
       values.specialNeed = {};

+ 1 - 1
src/views/biz/bed/person/FormModalDetail.vue

@@ -26,7 +26,7 @@
   const [registerModal, { setModalProps }] = useModalInner(async data => {
     setModalProps({ confirmLoading: false });
     getTitle.value = `排班详情 ( ${data.record.patientName} | ${data.record.gender} | ${data.record.age}岁 )`;
-    const resData = await bedScheduledPersonDetail(data.record.id);
+    const resData = await bedScheduledPersonDetail(data.record.patientBasicId);
     console.log('🚀 ~ file: FormModalDetail.vue:29 ~ resData:', resData);
     tableData.value = resData;
   });

+ 10 - 1
src/views/biz/bed/person/data.ts

@@ -150,7 +150,15 @@ export const dataFormSchema: FormSchema[] = [
   {
     label: '类型',
     field: 'patientType',
-    component: 'ApiSelect',
+    // component: 'ApiSelect',
+    // componentProps: {
+    //   api: listDictModel,
+    //   params: {
+    //     dictCode: 'pb_type',
+    //   },
+    //   disabled: true,
+    // },
+    component: 'ApiRadioGroup',
     componentProps: {
       api: listDictModel,
       params: {
@@ -181,6 +189,7 @@ export const dataFormSchema: FormSchema[] = [
           dictCode: 'sp_week',
           dictSort: true,
         },
+        isInputNum: true,
         onChange: e => {
           console.log('🚀 ~ file: data.ts:81 ~ e:', e);
           return (formModel['frequency'] = e);

+ 19 - 4
src/views/biz/bed/person/index.vue

@@ -75,7 +75,7 @@
                 {{ record.specialNeedWeek }}
               </div>
               <div class="divider" v-if="record.specialNeedSailingSorts?.length" />
-              <div class="inline-flex"> 第二班、第三班 </div>
+              <div class="inline-flex"> {{ record.specialNeedSailingSorts }} </div>
             </div>
           </template>
           <template v-if="column.key === 'action'">
@@ -133,6 +133,8 @@
   import { useModal } from '/@/components/Modal';
   import FormModal from './FormModal.vue';
   import FormModalDetail from './FormModalDetail.vue';
+  import { getSailings } from '/@/api/biz/management/working';
+
   // import { useMessage } from '@/hooks/web/useMessage';
   const bizDictOptions = reactive<any>({});
   const bizDictData = ref([
@@ -142,6 +144,7 @@
   ]);
   const activeKey = ref(BasicTabActive);
   const tabData = ref(BasicTab);
+  const allSailings = ref([]);
   const [registerModal, { openModal }] = useModal();
   const [registerModalDetail, { openModal: openModalDetail }] = useModal();
   // const { createMessage } = useMessage();
@@ -165,6 +168,8 @@
       }
       return ele;
     });
+
+    // console.log('🚀 ~ file: index.vue:173 ~ onMounted ~ allSailings.value:', allSailings.value);
   });
   const [registerTable, { reload }] = useTable({
     api: bedScheduledPersonQueryPage,
@@ -218,8 +223,11 @@
     };
   }
 
-  function handleAfterFetch(data) {
+  async function handleAfterFetch(data) {
     console.log('🚀 ~ file: index.vue:238 ~ handleAfterFetch ~ data:', data);
+    if (!allSailings.value.length) {
+      allSailings.value = await getSailings();
+    }
     const res = data.map(ele => {
       ele.specialNeedWeek = '';
       for (const i in ele.specialNeed) {
@@ -228,9 +236,16 @@
         }
       }
       ele.specialNeedWeek = ele.specialNeedWeek.substring(1);
+      // ele.specialNeedSailingSorts = ele.specialNeed?.sailingSorts;
       // 班次需要请求
-      ele.specialNeedSailingSorts = ele.specialNeed?.sailingSorts;
-      // console.log('ele', ele);
+      ele.specialNeedSailingSorts = allSailings.value
+        .filter(eleA => {
+          return ele.specialNeed?.sailingSorts.includes(eleA.sort);
+        })
+        .map(sEle => {
+          return sEle.name;
+        })
+        .join('、');
       return ele;
     });
     return res;

+ 1 - 1
src/views/biz/visit/ready/index.vue

@@ -266,7 +266,7 @@
       configValue: [100, 150],
       idCard: {
         input: '测试',
-        dictValue: 'DIC_BIZ',
+        dictValue: 'DICT_SYS',
       },
       apiCheck: ['pump_single'],
     });