weieryang преди 1 година
родител
ревизия
716d0d3407

+ 5 - 1
CMS1.0/src/api/patient/patient.js

@@ -30,7 +30,11 @@ export const getPatientLogs = (params) => {
30 30
  */
31 31
 export const setLabel = (ids, label) => {
32 32
     return request({
33
-      url: `/patient/patientlabel/batchadd/${ids}/${label}`,
33
+      url: `/patient/patientlabel/batchadd`,
34
+      data: {
35
+        labelName: label,
36
+        patientids: ids,
37
+      },
34 38
       method: 'post',
35 39
     })
36 40
 }

+ 1 - 0
CMS1.0/src/components/page-content/src/page-content.vue

@@ -181,6 +181,7 @@
181 181
               </el-dropdown-menu>
182 182
             </template>
183 183
           </el-dropdown>
184
+
184 185
         </div>
185 186
       </template>
186 187
       <template #handlerImportExport="scope">

+ 18 - 0
CMS1.0/src/components/page-modal/src/page-modal.vue

@@ -115,6 +115,11 @@
115 115
                 return Number(o);
116 116
               });
117 117
             }
118
+
119
+            // 时间选择器为数组,把数据转换为数组
120
+            if (item.type === 'datepicker' && item.fieldArray) {
121
+              formData.value[`${item.field}`] = [newValue[`${item.fieldArray[0]}`], newValue[`${item.fieldArray[1]}`]];
122
+            }
118 123
           }
119 124
         },
120 125
       );
@@ -138,6 +143,17 @@
138 143
               if (!mainField)
139 144
                 mainField = props.pageName.split('/')[props.pageName.split('/').length - 1] + 'Id';
140 145
 
146
+              
147
+              // 时间日期转换
148
+              for (const item of props.modalConfig.formItems) {
149
+
150
+                // 时间选择器为数组,把数据转换为数组
151
+                if (item.type === 'datepicker' && item.fieldArray) {
152
+                  form[`${item.fieldArray[0]}`] = form[`${item.field}`][0]
153
+                  form[`${item.fieldArray[1]}`] = form[`${item.field}`][1]
154
+                }
155
+              }
156
+
141 157
               let query = {
142 158
                 pageName: props.pageName,
143 159
                 editData: form,
@@ -152,6 +168,8 @@
152 168
                 query.pageSize = pageInfo.value.pageSize;
153 169
               }
154 170
 
171
+              console.log(query, 'query');
172
+
155 173
               useSystemStore()
156 174
                 .editPageDataAction(query)
157 175
                 .then(() => {

+ 10 - 0
CMS1.0/src/utils/tools.js

@@ -7,4 +7,14 @@ export const ArrayToMap = (arr, key) => {
7 7
     }
8 8
 
9 9
     return result;
10
+}
11
+
12
+export const getTimeFrame = (starttime, endtime) => {
13
+    if (!starttime || !endtime) return '永久';
14
+
15
+    if (starttime && !endtime) return `${starttime}以后`;
16
+
17
+    if (!starttime && endtime) return `截止到${endtime}`;
18
+
19
+    if (starttime && endtime) return `${starttime}至${endtime}`;
10 20
 }

+ 22 - 12
CMS1.0/src/views/main/patientFile/patientFileList/cpns/logs/log.vue

@@ -1,15 +1,15 @@
1 1
 <template>
2
-  <el-timeline style="max-width: 600px;margin-top: 10px">
3
-    <el-timeline-item
4
-      v-for="(item, index) in logs"
5
-      :key="index"
6
-      :timestamp="item.createTime"
7
-    >
8
-    <!-- <span> {{ item.createUserName }} </span> -->
9
-        <span style="color: blue;"> {{ item.type }} </span>
10
-      {{ item.content }}
11
-    </el-timeline-item>
12
-  </el-timeline>
2
+    <div class="center-flex">
3
+        <el-timeline style="max-width: 90vh;margin-top: 10px">
4
+            <el-timeline-item v-for="(item, index) in logs" :key="index" :timestamp="item.createTime">
5
+                <span style="font-weight: bold;margin-right: 10px;"> {{ item.createUserName }} </span>
6
+                
7
+                <span style="color: blue;margin-right: 10px;"> {{ item.type }} </span>
8
+                {{ item.content }}
9
+            </el-timeline-item>
10
+        </el-timeline>
11
+    </div>
12
+
13 13
 </template>
14 14
 
15 15
 <script setup>
@@ -40,4 +40,14 @@ onMounted(() => {
40 40
     getLogs().then(() => {});
41 41
 })
42 42
     
43
-</script>
43
+</script>
44
+
45
+<style lang="scss" scoped>
46
+    /* .center-flex {
47
+        display: flex;
48
+        justify-content: center;
49
+        align-items: center;
50
+        width: 90vh;
51
+        height: 100vh;
52
+    }*/
53
+</style>

+ 0 - 13
CMS1.0/src/views/main/patientFile/patientFileList/patientFileList.vue

@@ -162,19 +162,6 @@ export default defineComponent({
162 162
     }
163 163
 
164 164
 
165
-    // objectDic();
166
-
167
-    // const getStatus = (status) => {
168
-    //   console.log(patientStatus, 'patientStatus')
169
-    //   const statusInfo = patientStatus.find((o) => {
170
-    //     return o.value === status;
171
-    //   });
172
-
173
-    //   console.log(statusInfo, 'statusInfo')
174
-
175
-    //   return statusInfo || { color: '', label: '' };
176
-    // }
177
-
178 165
     // 1.处理逻辑
179 166
     const newCallback = () => { }
180 167
     const editCallback = () => {

+ 8 - 8
CMS1.0/src/views/main/patientFile/patientblack/config/content.config.js

@@ -2,14 +2,14 @@ export const contentTableConfig = {
2 2
   title: '黑名单',
3 3
   contentTableHeader: true,
4 4
   propList: [
5
-    { prop: 'postCode', label: '患者姓名' },
6
-    { prop: 'postName', label: '患者手机号' },
7
-    { prop: 'postSort', label: '拉黑原因' },
8
-    { prop: 'createTime', label: '备注说明' },
9
-    { prop: 'status', label: '有效期',},
10
-    { prop: 'status', label: '创建时间',},
11
-    { label: '操作', minWidth: '120', slotName: 'handler' }
5
+    { prop: 'patientName', label: '患者姓名', slotName: 'patientId', minWidth: '100', customSlot: true, fixed : 'left'  },
6
+    { prop: 'phoneNumber', label: '患者手机号', minWidth: '100' },
7
+    { prop: 'reason', label: '拉黑原因', minWidth: '200' },
8
+    { prop: 'note', label: '备注说明', minWidth: '200' },
9
+    { prop: 'starttime', label: '有效期', minWidth: '200', slotName: 'timeFrame', customSlot: true,},
10
+    { prop: 'createTime', label: '创建时间', minWidth: '180',},
11
+    { label: '操作', minWidth: '120', slotName: 'handler', fixed : 'right' }
12 12
   ],
13
-  showIndexColumn: true,
13
+  showIndexColumn: false,
14 14
   showSelectColumn: false,
15 15
 }

+ 15 - 34
CMS1.0/src/views/main/patientFile/patientblack/config/modal.config.js

@@ -1,53 +1,34 @@
1 1
 export const modalConfig = {
2 2
   formItems: [
3 3
     {
4
-      field: 'postName',
5
-      type: 'input',
6
-      label: '患者姓名',
7 4
       required: true,
8
-      placeholder: '请输入患者姓名'
9
-    },
10
-    {
11
-      field: 'postCode',
12
-      type: 'input',
13
-      label: '患者手机号',
14
-      required: true,
15
-      placeholder: '请输入患者手机号'
16
-    },
17
-    {
18
-      required: true,
19
-      field: 'postSort',
5
+      field: 'reason',
20 6
       type: 'input',
21 7
       label: '拉黑原因',
22 8
       placeholder: '请输入拉黑原因'
23 9
     },
24 10
     {
25
-      field: 'status',
26
-      type: 'switch',
11
+      field: 'timeRange',
12
+      type: 'datepicker',
27 13
       label: '有效期',
28
-      required: true,
29
-      placeholder: '请选择有效期'
14
+      required: false,
15
+      placeholder: '请选择有效期',
16
+      otherOptions: {
17
+        'range-separator': '至',
18
+        type: 'datetimerange',
19
+        'value-format': 'YYYY-MM-DD HH:mm:ss',
20
+      },
21
+      fieldArray: ['starttime', 'endtime'],
22
+      resFormat: (time) => {
23
+        return moment(time).format('YYYY-MM-DD HH:mm:ss');
24
+      }
30 25
     },
31 26
     {
32
-      field: 'remark',
27
+      field: 'note',
33 28
       type: 'textarea',
34 29
       label: '备注',
35 30
       placeholder: '请输入备注'
36 31
     }
37
-    // {
38
-    //   field: "departmentId",
39
-    //   type: "select",
40
-    //   label: "选择部门",
41
-    //   placeholder: "请选择部门",
42
-    //   options: [],
43
-    // },
44
-    // {
45
-    //   field: "roleId",
46
-    //   type: "select",
47
-    //   label: "选择角色",
48
-    //   placeholder: "请选择角色",
49
-    //   options: [],
50
-    // },
51 32
   ],
52 33
   colLayout: { span: 24 },
53 34
   itemStyle: {}

+ 2 - 2
CMS1.0/src/views/main/patientFile/patientblack/config/search.config.js

@@ -8,13 +8,13 @@ export const searchFormConfig = {
8 8
   },
9 9
   formItems: [
10 10
     {
11
-      field: 'postCode',
11
+      field: 'patientName',
12 12
       type: 'input',
13 13
       label: '患者姓名',
14 14
       placeholder: '请输入患者姓名'
15 15
     },
16 16
     {
17
-      field: 'postName',
17
+      field: 'phoneNumber',
18 18
       type: 'input',
19 19
       label: '患者手机号',
20 20
       placeholder: '请输入患者手机号'

+ 26 - 2
CMS1.0/src/views/main/patientFile/patientblack/patientblack.vue

@@ -8,19 +8,27 @@
8 8
     <page-content
9 9
       ref="pageContentRef"
10 10
       :contentTableConfig="contentTableConfig"
11
-      pageName="/system/post"
11
+      pageName="/patient/blacklist"
12 12
       :isExport="false"
13
+      :isCreate="false"
13 14
       @newBtnClick="handleNewData"
14 15
       @editBtnClick="handleEditData"
15 16
     >
16 17
       <template #postStatus="{ row }">
17 18
         <el-tag :type="row.status === '0' ? 'error' : 'success'">{{ row.status === '0' ? '禁用' : '启用' }}</el-tag>
18 19
       </template>
20
+      <template #timeFrame="{ row }">
21
+        {{ getTimeFrame(row.starttime, row.endtime) }}
22
+      </template>
23
+      <template #patientId="{ row }">
24
+        <el-button type="primary" link @click="buttonHandle(row.patientId)">{{ row.patientName }}</el-button>
25
+      </template>
19 26
     </page-content>
20 27
     <page-modal
21 28
       :defaultInfo="defaultInfo"
22 29
       ref="pageModalRef"
23
-      pageName="/system/post"
30
+      :mainKey="'blackId'"
31
+      pageName="/patient/blacklist"
24 32
       :modalConfig="modalConfigRef"
25 33
     ></page-modal>
26 34
   </div>
@@ -39,6 +47,8 @@ import { modalConfig } from './config/modal.config'
39 47
 
40 48
 import { usePageSearch } from '@/hooks/use-page-search'
41 49
 import { usePageModal } from '@/hooks/use-page-modal'
50
+import { getTimeFrame } from '@/utils/tools'
51
+import { useRouter } from 'vue-router'
42 52
 
43 53
 export default defineComponent({
44 54
   name: 'Patientblack',
@@ -48,6 +58,9 @@ export default defineComponent({
48 58
     PageModal
49 59
   },
50 60
   setup() {
61
+
62
+    const router = useRouter();
63
+
51 64
     const [pageContentRef, handleResetClick, handleQueryClick] = usePageSearch()
52 65
 
53 66
     // 1.处理逻辑
@@ -64,7 +77,18 @@ export default defineComponent({
64 77
     // 3.调用hook获取公共变量和函数
65 78
     const [pageModalRef, defaultInfo, handleNewData, handleEditData] =
66 79
       usePageModal(newCallback, editCallback)
80
+
81
+    function buttonHandle(id) {
82
+      router.push({
83
+        path: '/patientFile/patientDetail',
84
+        query: {
85
+          id,
86
+        }
87
+      });
88
+    }
67 89
     return {
90
+      buttonHandle,
91
+      getTimeFrame,
68 92
       searchFormConfig,
69 93
       contentTableConfig,
70 94
       pageContentRef,