Browse Source

提交代码

陈少旭 2 years ago
parent
commit
604b748aa7

+ 2 - 2
src/router/index_路由未分离前.js View File

@@ -638,7 +638,7 @@ export const xt_asyncRouterMap = [
638 638
         meta: { title: 'inspection', noCache: true }
639 639
       },
640 640
       {
641
-        path: '/patients/course',
641
+        path: '/',
642 642
         component: () => import('@/xt_pages/user/courseOfDisease'),
643 643
         hidden: true,
644 644
         is_menu: false,
@@ -977,5 +977,5 @@ export const xt_asyncRouterMap = [
977 977
       { path: '/role/perview', component: () => import('@/xt_pages/role/EditPerview'), name: 'setupPerview', meta: { title: 'setupPerview', noCache: true }, hidden: true, is_menu: false },
978 978
       { path: '/role/admin/specialpermission', component: () => import('@/xt_pages/role/special_permission'), name: 'special_permission_manage', meta: { title: 'special_permission_manage' }}
979 979
     ]
980
-  }
980
+  },
981 981
 ]

+ 8 - 1
src/router/modules/patient.js View File

@@ -181,7 +181,14 @@ export default {
181 181
       title: 'CourseOfDiseaseManage',
182 182
       noCache: true
183 183
     }
184
-  },
184
+  }, {
185
+      path: '/patients/sickhistory',
186
+      component: () => import('@/xt_pages/user/sickHistory'),
187
+      hidden: true,
188
+      is_menu: false,
189
+      name: 'sickHistory',
190
+      meta: { title: 'sickHistory', noCache: true }
191
+    },
185 192
   {
186 193
     path: '/patients/rescue',
187 194
     component: () => import('@/xt_pages/user/rescueRecord'),

+ 2 - 2
src/xt_pages/data/components/templateTable.vue View File

@@ -91,7 +91,7 @@
91 91
           ></el-input>
92 92
         </el-form-item>
93 93
 
94
-        <el-form-item label="内容" v-if="type == 'course_disease'">
94
+        <el-form-item label="内容" v-if="type == 'course_disease' || type == 'sick_history'">
95 95
           <keep-alive>
96 96
             <editor
97 97
               ref="editor"
@@ -350,7 +350,7 @@ export default {
350 350
     },
351 351
     createData() {
352 352
       this.$refs["dataForm"].validate(valid => {
353
-        if (this.type == "course_disease") {
353
+        if (this.type == "course_disease" || this.type == "sick_history") {
354 354
           this.temp.content = this.$refs.editor.content;
355 355
         }
356 356
 

+ 2 - 0
src/xt_pages/data/template.vue View File

@@ -62,6 +62,8 @@ export default {
62 62
         { label: this.$t("data_config.diagnostic_basis"), key:"diagnostic_basis"},
63 63
         { label: this.$t("data_config.differential_diagnosis"), key:"differential_diagnosis"},
64 64
         { label: this.$t("data_config.treatment_plan"), key:"treatment_plan"},
65
+        { label: this.$t("data_config.sick_history"), key:"sick_history"},
66
+
65 67
       ],
66 68
       activeName: "education",
67 69
       createdTimes: 0

+ 0 - 6
src/xt_pages/outpatientCharges/outpatientChargesManagement.vue View File

@@ -1691,15 +1691,9 @@ export default {
1691 1691
       }
1692 1692
     },
1693 1693
     confirm(forms) {
1694
-      var time = Math.round(new Date().getTime() / 1000).toString()
1695
-      var param = '_api_access_key=' + '1781ce9fb73a478289326c16ba8bf2c4' + '&_api_name=' + 'hssServives' + '&_api_timestamp=' + time + '&_api_version=' + '1.0.0'
1696
-      var signature = cryptoJs.enc.Base64.stringify(cryptoJs.HmacSHA1(param, '+b5DPOGjc08DAAMJ8FP31pwwNHKo='))
1697
-      console.log(Math.round(new Date().getTime() / 1000).toString())
1698 1694
       forms['record_time'] = this.record_date
1699 1695
       forms['admin_user_id'] = this.$store.getters.xt_user.user.id
1700 1696
       forms['org_id'] = this.$store.getters.xt_user.org_id
1701
-      forms['key'] = signature
1702
-      forms['time_stamp'] = time
1703 1697
       this.loadingone = true
1704 1698
       var that = this
1705 1699
       if (forms.settlement_value == 2) {

+ 11 - 11
src/xt_pages/outpatientCharges/statementTemplate/printTen.vue View File

@@ -119,7 +119,7 @@
119 119
             <tr>
120 120
               <td style="border: 1px solid gray;width: 150px;height: 30px;">项目名称</td>
121 121
               <td style="border: 1px solid gray;width: 150px;height: 30px;">总金额</td>
122
-              <td style="border: 1px solid gray;width: 150px;height: 30px;">符合政范围</td>
122
+              <td style="border: 1px solid gray;width: 150px;height: 30px;">符合政范围</td>
123 123
               <td style="border: 1px solid gray;width: 150px;height: 30px;">先行自付</td>
124 124
               <td style="border: 1px solid gray;width: 150px;height: 30px;">超限价</td>
125 125
               <td style="border: 1px solid gray;width: 150px;height: 30px;">自费</td>
@@ -256,33 +256,33 @@
256 256
             </tr>
257 257
             <tr>
258 258
               <td style="border: 1px solid gray;width: 150px;height: 30px;">费用总额</td>
259
-              <td style="border: 1px solid gray;width: 150px;height: 30px;">{{info.medfee_sumamt}}</td>
259
+              <td style="border: 1px solid gray;width: 150px;height: 30px;">{{info.new_order.medfee_sumamt}}</td>
260 260
               <td style="border: 1px solid gray;width: 150px;height: 30px;">统筹基金支付</td>
261
-              <td style="border: 1px solid gray;width: 150px;height: 30px;">{{info.hifp_pay}}</td>
261
+              <td style="border: 1px solid gray;width: 150px;height: 30px;">{{info.new_order.hifp_pay}}</td>
262 262
               <td style="border: 1px solid gray;width: 150px;height: 30px;">大病保险支付</td>
263
-              <td style="border: 1px solid gray;width: 150px;height: 30px;">{{info.hifmi_pay}}</td>
263
+              <td style="border: 1px solid gray;width: 150px;height: 30px;">{{info.new_order.hifmi_pay}}</td>
264 264
             </tr>
265 265
             <tr>
266 266
               <td style="border: 1px solid gray;width: 150px;height: 30px;">医疗救助支付</td>
267
-              <td style="border: 1px solid gray;width: 150px;height: 30px;">{{info.maf_pay}}</td>
267
+              <td style="border: 1px solid gray;width: 150px;height: 30px;">{{info.new_order.maf_pay}}</td>
268 268
               <td style="border: 1px solid gray;width: 150px;height: 30px;">公务员补充支付</td>
269
-              <td style="border: 1px solid gray;width: 150px;height: 30px;">{{info.cvlserv_pay}}</td>
269
+              <td style="border: 1px solid gray;width: 150px;height: 30px;">{{info.new_order.cvlserv_pay}}</td>
270 270
               <td style="border: 1px solid gray;width: 150px;height: 30px;">离休保健专项</td>
271 271
               <td style="border: 1px solid gray;width: 150px;height: 30px;"></td>
272 272
             </tr>
273 273
             <tr>
274 274
               <td style="border: 1px solid gray;width: 150px;height: 30px;">个人账户支付</td>
275
-              <td style="border: 1px solid gray;width: 150px;height: 30px;">{{info.acct_pay}}</td>
275
+              <td style="border: 1px solid gray;width: 150px;height: 30px;">{{info.new_order.acct_pay}}</td>
276 276
               <td style="border: 1px solid gray;width: 150px;height: 30px;">个人现金支付</td>
277
-              <td style="border: 1px solid gray;width: 150px;height: 30px;">{{info.psn_cash_pay}}</td>
277
+              <td style="border: 1px solid gray;width: 150px;height: 30px;">{{info.new_order.psn_cash_pay}}</td>
278 278
               <td style="border: 1px solid gray;width: 150px;height: 30px;">其他基金支付</td>
279
-              <td style="border: 1px solid gray;width: 150px;height: 30px;">{{info.oth_pay}}</td>
279
+              <td style="border: 1px solid gray;width: 150px;height: 30px;">{{info.new_order.oth_pay}}</td>
280 280
             </tr>
281 281
             <tr>
282 282
               <td style="border: 1px solid gray;width: 150px;height: 30px;">起付线</td>
283
-              <td colspan="2" style="border: 1px solid gray;width: 150px;height: 30px;">{{info.act_pay_dedc}}</td>
283
+              <td colspan="2" style="border: 1px solid gray;width: 150px;height: 30px;">{{info.new_order.act_pay_dedc}}</td>
284 284
               <td style="border: 1px solid gray;width: 150px;height: 30px;">医院垫付金额</td>
285
-              <td colspan="2" style="border: 1px solid gray;width: 150px;height: 30px;">{{info.hosp_part_amt}}</td>
285
+              <td colspan="2" style="border: 1px solid gray;width: 150px;height: 30px;">{{info.new_order.hosp_part_amt}}</td>
286 286
             </tr>
287 287
           </table>
288 288
           <div style="width: 51%; margin: 5px 100px; text-align: center;">

+ 4 - 3
src/xt_pages/outpatientCharges/summary.vue View File

@@ -124,7 +124,7 @@
124 124
           <!--          </el-button-->
125 125
           <!--          >-->
126 126
 
127
-<!--                              <el-button size="small" type="primary" @click="export_detail_three">报表下载2</el-button>-->
127
+                              <el-button size="small" type="primary" @click="export_detail_three">报表下载12</el-button>
128 128
           <!--          <el-button size="small" type="primary" @click="export_detail_four">报表下载3</el-button>-->
129 129
           <!--          <el-button size="small" type="primary" @click="export_detail_five">报表下载3</el-button>-->
130 130
 <!--                    <el-button size="small" type="primary" @click="export_detail_six">报表下载9</el-button>-->
@@ -1205,6 +1205,7 @@ export default {
1205 1205
           return false;
1206 1206
         } else {
1207 1207
           let list = [];
1208
+          console.log(response.data.data.order)
1208 1209
           for (let i = 0; i < response.data.data.order.length; i++) {
1209 1210
             let order = response.data.data.order[i];
1210 1211
             let data = this.setMonthPrescription(order.info)
@@ -1213,8 +1214,8 @@ export default {
1213 1214
               let obj = {
1214 1215
                 name: order.patient.name,
1215 1216
                 id_card_no: order.patient.id_card_no,
1216
-                year: "2023",
1217
-                month: "3",
1217
+                year: "2022",
1218
+                month: "10",
1218 1219
                 code: data[b].code,
1219 1220
                 pric: data[b].count * data[b].price,
1220 1221
                 item_name: data[b].name,

+ 38 - 0
src/xt_pages/user/components/PatientSidebar.vue View File

@@ -149,6 +149,36 @@ export default {
149 149
               label: '宣教信息'
150 150
             }
151 151
           ]
152
+        }, {
153
+          name: '3',
154
+          label: '病情记录',
155
+          children: [
156
+            {
157
+              name: '3-1',
158
+              label: '病史'
159
+            },
160
+            {
161
+              name: '3-2',
162
+              label: '体格检查'
163
+            },
164
+            {
165
+              name: '3-3',
166
+              label: '首次病程记录'
167
+            },
168
+            {
169
+              name: '3-4',
170
+              label: '病程记录'
171
+            }, {
172
+              name: '3-5',
173
+              label: '抢救记录'
174
+            }, {
175
+              name: '3-6',
176
+              label: '阶段小结'
177
+            }, {
178
+              name: '3-7',
179
+              label: '出院小结'
180
+            }
181
+          ]
152 182
         }
153 183
       ],
154 184
       name:""
@@ -201,6 +231,12 @@ export default {
201 231
         this.$router.push({path:'/patient/patient/'+this.id+'/hospitalSummary'})
202 232
       }else if(name == '1-11'){
203 233
         this.$router.push({path:'/patient/patient/'+this.id+'/firstDisease'})
234
+      }else if(name == '3-1'){
235
+        this.$router.push({ path: '/patients/sickhistory?id=' + this.id })
236
+
237
+      } else if(name == '3-2'){
238
+        this.$router.push({path:'/patient/patient/'+this.id+'/firstDisease'})
239
+
204 240
       }
205 241
     },
206 242
     changePatient(value) {
@@ -349,6 +385,8 @@ export default {
349 385
         this.$router.push({
350 386
           path: '/patients/patient/' + this.id + '/proeducation'
351 387
         })
388
+      }else if (patientKey == '3-1') {
389
+        this.$router.push({ path: '/patients/sickhistory?id=' + this.id })
352 390
       }
353 391
 
354 392
      }else{

+ 556 - 0
src/xt_pages/user/sickHistory.vue View File

@@ -0,0 +1,556 @@
1
+<template>
2
+  <!-- <div class="main-contain">
3
+      <div class="position">
4
+         <bread-crumb></bread-crumb>
5
+      </div> -->
6
+  <div class="patient-container">
7
+    <patient-sidebar :id="patient_id" defaultActive="3-1"></patient-sidebar>
8
+    <!-- <div class="app-container"> -->
9
+    <div v-loading="loading">
10
+      <div class="patient-app-container advice-container app-container">
11
+
12
+        <div>
13
+                    <span style="margin-left: 10px;float:right;">
14
+                        <el-button type="primary" icon="el-icon-circle-plus-outline" size="small"
15
+                                   @click="show_dialog = true">新增</el-button>
16
+
17
+                        <el-button type="primary" icon="el-icon-edit-outline" size="small"
18
+                                   @click="showEdit">修改</el-button>
19
+                      <el-button type="primary" icon="el-icon-printer" size="small"
20
+                                 @click="print">打印</el-button>
21
+                        <el-button size="small" v-show="selectingRows.length > 0" type="danger"
22
+                                   @click="deleteAction">删除</el-button>
23
+                    </span>
24
+          <!--<span class="filter_title">日期查询</span>-->
25
+          <!--<el-date-picker size="small" v-model="date" type="daterange" range-separator="至" start-placeholde="开始日期" end-placeholde="结束日期" value-format="timestamp" :clearable="false" @change="requestCourseRecords()"></el-date-picker>-->
26
+        </div>
27
+        <!--<div></div>-->
28
+        <div class="cell clearfix">
29
+          <label class="title"><span class="name">日期查询</span> : </label>
30
+          <el-date-picker v-model="start_time" prefix-icon="el-icon-date" :editable="false" style="width: 196px;"
31
+                          type="date" placeholder="选择日期时间" align="right" format="yyyy-MM-dd"
32
+                          value-format="yyyy-MM-dd" @change="startTimeChange"></el-date-picker>
33
+          <span class="">-</span>
34
+          <el-date-picker v-model="end_time" prefix-icon="el-icon-date" :editable="false" style="width: 196px;"
35
+                          type="date" placeholder="选择日期时间" align="right" format="yyyy-MM-dd"
36
+                          value-format="yyyy-MM-dd" @change="endTimeChange"></el-date-picker>
37
+        </div>
38
+        <div class="record">
39
+          <el-row :gutter="15">
40
+            <el-col :span="10">
41
+              <el-table :header-cell-style="{
42
+                  backgroundColor: 'rgb(245, 247, 250)',
43
+                  color: '#606266'
44
+                }"
45
+                        :row-style="{ color: '#303133' }" ref="record_table" :data="records"
46
+                        border highlight-current-row @current-change="didChangeCurrentRecord"
47
+                        @selection-change="didSelectionChange"
48
+                        :row-class-name="tableRow"
49
+                        @row-click="onRowClick"
50
+              >
51
+                <el-table-column type="selection" width="40" align="center"></el-table-column>
52
+                <el-table-column label="标题" align="center">
53
+                  <template slot-scope="scope">
54
+                    {{ scope.row.title}}
55
+                  </template>
56
+                </el-table-column>
57
+                <el-table-column label="记录日期" align="center">
58
+                  <template slot-scope="scope">
59
+                    {{ recordTime(scope.row.record_time) }}
60
+                  </template>
61
+                </el-table-column>
62
+                <el-table-column label="记录医生" align="center">
63
+                  <template slot-scope="scope">
64
+                    {{ doctorName(scope.row.recorder) }}
65
+                  </template>
66
+                </el-table-column>
67
+              </el-table>
68
+            </el-col>
69
+            <el-col :span="14">
70
+              <div class="record_content_panel">
71
+                <div style="background-color:rgb(245, 247, 250)" class="title">病史详情</div>
72
+                <div class="content">
73
+                  <span v-if="current_select_record" v-html="current_select_record.content">{{current_select_record.content }}</span>
74
+                  <span v-else></span>
75
+                </div>
76
+              </div>
77
+            </el-col>
78
+          </el-row>
79
+        </div>
80
+      </div>
81
+      <!-- </div> -->
82
+      <el-dialog title="新增病史记录" width="70%" top="5vh" :visible.sync="show_dialog">
83
+        <div>
84
+          <div class="new_record_form">
85
+            <div class="cell clearfix">
86
+              <label class="title"><span class="name">病程标题</span> : </label>
87
+              <el-input v-model="title" style="width: 150px"></el-input>
88
+
89
+              <label class="title"><span class="name">日期</span> : </label>
90
+              <el-date-picker v-model="sick_history_time" prefix-icon="el-icon-date" :editable="false"
91
+                              style="width: 150px;"
92
+                              type="datetime" placeholder="选择日期时间" align="right" format="yyyy-MM-dd HH:mm:ss"
93
+                              value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
94
+
95
+
96
+              <label class="title"><span class="name">肾移植史</span> : </label>
97
+              <el-select style="width: 150px;" v-model="is_shenyizhishi" placeholder="选择肾移植史" @change="didSelectTemplate">
98
+                <el-option label="无" value="0"></el-option>
99
+                <el-option label="有" value="1"></el-option>
100
+              </el-select>
101
+            </div>
102
+
103
+            <div class="cell clearfix">
104
+
105
+              <label class="title"><span class="name">腹膜透析史</span> : </label>
106
+              <el-select style="width: 150px;" v-model="is_fumotouxishi" placeholder="选择腹膜透析史" @change="didSelectTemplate">
107
+                <el-option label="无" value="0"></el-option>
108
+                <el-option label="有" value="1"></el-option>
109
+              </el-select>
110
+
111
+              <label class="title"><span class="name">医生</span> : </label>
112
+              <el-select style="width: 100px;" v-model="doctor_id" placeholder="请选择医生">
113
+                <el-option v-for="(item,index) in doctorOptions" :label="item.name" :value="item.id" :key="index"></el-option>
114
+              </el-select>
115
+
116
+              <label class="title"><span class="name">过敏药物</span> : </label>
117
+              <el-select style="width: 100px;" v-model="is_guominyaowu" placeholder="选择过敏药物" @change="didSelectTemplate">
118
+                <el-option label="无" value="0"></el-option>
119
+                <el-option label="有" value="1"></el-option>
120
+              </el-select>
121
+              <el-input v-if="is_guominyaowu == 1" v-model="guominyaowu_desc"></el-input>
122
+
123
+            </div>
124
+
125
+            <div class="cell clearfix">
126
+              <label class="title"><span class="name">病史模版</span> : </label>
127
+              <el-select v-model="select_template" placeholder="选择病史模板" @change="didSelectTemplate">
128
+                <el-option v-for="(option, index) in templates" :key="index" :label="option.title"
129
+                           :value="option.content"></el-option>
130
+              </el-select>
131
+            </div>
132
+
133
+            <div class="textarea_panel">
134
+              <keep-alive>
135
+                <editor ref="editor"
136
+                        id="editors"
137
+                        style="width: 600px"
138
+                        v-bind:r_content="new_content"
139
+                >
140
+                </editor>
141
+              </keep-alive>
142
+            </div>
143
+
144
+            <div style="text-align: right; padding-right: 0px; padding-top: 10px; padding-bottom: 10px;">
145
+              <el-button @click="show_dialog = false">取消</el-button>
146
+              <el-button :disabled="$store.getters.xt_user.subscibe.state==3?true:false" type="primary"
147
+                         @click="createAction" :loading="uploading_new_record">保存
148
+              </el-button>
149
+            </div>
150
+          </div>
151
+        </div>
152
+      </el-dialog>
153
+
154
+
155
+      <el-dialog title="修改病程记录" width="50%" top="5vh" :visible.sync="show_edit_dialog">
156
+        <div>
157
+          <div class="new_record_form">
158
+            <div class="cell clearfix">
159
+              <label class="title"><span class="name">病程日期</span> : </label>
160
+              <el-date-picker v-model="edit_course_of_disease_time" prefix-icon="el-icon-date" :editable="false"
161
+                              style="width: 200px;"
162
+                              type="datetime"
163
+                              placeholder="选择日期时间" align="right" format="yyyy-MM-dd HH:mm:ss"
164
+                              value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
165
+
166
+              <label class="title"><span class="name">日常病程</span> : </label>
167
+              <el-select v-model="select_template" placeholder="可选择病程模板" @change="didEditSelectTemplate">
168
+                <el-option v-for="(option, index) in templates" :key="index" :label="option.title"
169
+                           :value="option.content"></el-option>
170
+              </el-select>
171
+            </div>
172
+
173
+
174
+            <div class="cell clearfix" style="margin-top: 10px">
175
+              <label class="title"><span class="name">病程标题</span> : </label>
176
+              <el-input v-model="edit_title" style="width: 420px"></el-input>
177
+            </div>
178
+
179
+            <div class="textarea_panel">
180
+              <!--<el-input v-model="edit_new_content" type="textarea" rows="6" resize="none"></el-input>-->
181
+              <keep-alive>
182
+                <editor ref="edit_neditor"
183
+                        id="edit_editor"
184
+                        style="width: 600px"
185
+                        v-bind:r_content="edit_new_content">
186
+                </editor>
187
+              </keep-alive>
188
+            </div>
189
+
190
+            <div style="text-align: right; padding-right: 0px; padding-top: 10px; padding-bottom: 10px;">
191
+              <el-button @click="show_edit_dialog = false">取消</el-button>
192
+              <el-button :disabled="$store.getters.xt_user.subscibe.state==3?true:false" type="primary"
193
+                         @click="modifyAction" :loading="uploading_new_record">保存
194
+              </el-button>
195
+            </div>
196
+          </div>
197
+        </div>
198
+      </el-dialog>
199
+    </div>
200
+  </div>
201
+
202
+  <!-- </div> -->
203
+</template>
204
+
205
+<script>
206
+import PatientSidebar from './components/PatientSidebar'
207
+import Editor from '@/components/Editor'
208
+import { fetchAllDoctorAndNurse } from "@/api/doctor";
209
+
210
+import {
211
+  createCourseOfDiseaseRecord,
212
+  deleteCourseOfDiseaseRecords,
213
+  getCourseOfDiseaseRecords,
214
+  modifyCourseOfDiseaseRecord,
215
+  GetCoursePrintData
216
+} from '@/api/patient'
217
+import { parseTime } from '@/utils'
218
+import BreadCrumb from '@/xt_pages/components/bread-crumb'
219
+
220
+export default {
221
+  name: 'CourseOfDisease',
222
+  components: {
223
+    PatientSidebar,
224
+    BreadCrumb,
225
+    Editor
226
+  },
227
+  data() {
228
+    return {
229
+      loading: false,
230
+      title: '',
231
+      patient_id: 0,
232
+      date: [],
233
+      start_time: '',
234
+      end_time: '',
235
+      sick_history_time: '',
236
+      is_shenyizhishi:'',
237
+      is_fumotouxishi:'',
238
+      is_guominyaowu:'',
239
+      guominyaowu_desc:"",
240
+      doctor_id:"",
241
+      doctorOptions:null,
242
+      records: [],
243
+      doctors: [],
244
+      current_select_record: null,
245
+      show_dialog: false,
246
+      show_edit_dialog: false,
247
+      uploading_new_record: false,
248
+      templates: this.$store.getters.configlist.sick_history,
249
+      new_content: '',
250
+      edit_new_content: '',
251
+      edit_course_of_disease_time: '',
252
+      selectingRows: [],
253
+      table_current_index: -1,
254
+      edit_current_id: 0,
255
+      edit_title: '',
256
+      ids:"",
257
+      idArr:[],
258
+    }
259
+  },
260
+  created() {
261
+    this.patient_id = parseInt(this.$route.query.id)
262
+    if (isNaN(this.patient_id) || this.patient_id <= 0) {
263
+      this.$notify.error({
264
+        title: '错误',
265
+        message: '无效的id'
266
+      })
267
+      this.$router.push('/patients/patients')
268
+      return
269
+    }
270
+    var now = new Date()
271
+    this.date = [now.getTime() - (7 * 24 * 60 * 60 * 1000), now.getTime()]
272
+
273
+    var nowDate = new Date()
274
+    var nowYear = nowDate.getFullYear()
275
+    var nowMonth = nowDate.getMonth() + 1
276
+    var nowDay = nowDate.getDate()
277
+    this.end_time =
278
+      nowYear +
279
+      '-' +
280
+      (nowMonth < 10 ? '0' + nowMonth : nowMonth) +
281
+      '-' +
282
+      (nowDay < 10 ? '0' + nowDay : nowDay)
283
+    nowDate.setMonth(nowDate.getMonth() - 1)
284
+    nowYear = nowDate.getFullYear()
285
+    nowMonth = nowDate.getMonth() + 1
286
+    nowDay = nowDate.getDate()
287
+    this.start_time =
288
+      nowYear +
289
+      '-' +
290
+      (nowMonth < 10 ? '0' + nowMonth : nowMonth) +
291
+      '-' +
292
+      (nowDay < 10 ? '0' + nowDay : nowDay)
293
+
294
+    this.requestCourseRecords()
295
+    this.fetchAllDoctorAndNurse()
296
+
297
+  },
298
+  methods: {
299
+    fetchAllDoctorAndNurse() {
300
+      fetchAllDoctorAndNurse().then(response => {
301
+        if (response.data.state == 1) {
302
+          this.doctorOptions = response.data.data.doctors;
303
+        }
304
+      });
305
+    },
306
+    requestCourseRecords: function() {
307
+      this.loading = true
308
+      getCourseOfDiseaseRecords(this.patient_id, this.start_time, this.end_time).then(rs => {
309
+        this.loading = false
310
+        var resp = rs.data
311
+        if (resp.state == 1) {
312
+          this.current_select_record = null
313
+          this.records = resp.data.records
314
+          console.log("records232322332323232323223",this.records)
315
+          this.doctors = resp.data.doctors
316
+
317
+        } else {
318
+          this.$message.error(resp.msg)
319
+        }
320
+      }).catch(error => {
321
+        this.loading = false
322
+        this.$message.error(error)
323
+      })
324
+    },
325
+
326
+    didChangeCurrentRecord: function(record) {
327
+      this.current_select_record = record
328
+    },
329
+    recordTime: function(timestamp) {
330
+      var time = new Date(timestamp * 1000)
331
+      return parseTime(time, '{y}-{m}-{d} {h}:{i}:{s}')
332
+    },
333
+    doctorName: function(doctor_id) {
334
+      for (let index = 0; index < this.doctors.length; index++) {
335
+        const doctor = this.doctors[index]
336
+        if (doctor.id == doctor_id) {
337
+          return doctor.name
338
+        }
339
+      }
340
+      return ''
341
+    },
342
+    modifyAction: function() {
343
+
344
+      this.edit_new_content = this.$refs.edit_neditor.content
345
+      if (this.edit_new_content.length == 0) {
346
+        this.$message.error('请填写病程内容')
347
+        return
348
+      }
349
+      this.uploading_new_record = true
350
+      modifyCourseOfDiseaseRecord(this.patient_id, this.edit_new_content, this.edit_course_of_disease_time, this.edit_current_id, this.edit_title).then(rs => {
351
+        this.uploading_new_record = false
352
+        var resp = rs.data
353
+        if (resp.state == 1) {
354
+          this.records[this.table_current_index].content = resp.data.record.content
355
+          this.records[this.table_current_index].record_time = resp.data.record.record_time
356
+          this.records[this.table_current_index].recorder = resp.data.record.recorder
357
+          this.records[this.table_current_index].title = resp.data.record.title
358
+
359
+          this.show_edit_dialog = false
360
+          this.edit_new_content = ''
361
+          this.table_current_index = -1
362
+
363
+        } else {
364
+          this.table_current_index = -1
365
+          this.$message.error(resp.msg)
366
+        }
367
+
368
+      }).catch(error => {
369
+        this.table_current_index = -1
370
+        this.uploading_new_record = false
371
+        this.$message.error(error)
372
+      })
373
+
374
+    },
375
+
376
+    createAction: function() {
377
+      this.new_content = this.$refs.editor.content
378
+      console.log("hhhhh2h3h232323232",this.new_content)
379
+      if (this.new_content.length == 0) {
380
+        this.$message.error('请填写病程内容')
381
+        return
382
+      }
383
+      this.uploading_new_record = true
384
+
385
+      createCourseOfDiseaseRecord(this.patient_id, this.new_content, this.course_of_disease_time, this.title).then(rs => {
386
+        this.uploading_new_record = false
387
+        var resp = rs.data
388
+        if (resp.state == 1) {
389
+          this.records.unshift(resp.data.record)
390
+          // this.$refs.record_table.setCurrentRow()
391
+          // this.$refs.record_table.setCurrentRow(this.records[0])
392
+          // this.current_select_record = this.records[0]
393
+          this.show_dialog = false
394
+          this.new_content = ''
395
+          this.title = ''
396
+
397
+        } else {
398
+          this.$message.error(resp.msg)
399
+        }
400
+
401
+      }).catch(error => {
402
+        this.uploading_new_record = false
403
+        this.$message.error(error)
404
+      })
405
+    },
406
+    didSelectTemplate: function(templateContent) {
407
+      this.new_content = this.new_content.length > 0 ? (this.new_content + templateContent) : templateContent
408
+
409
+    }, didEditSelectTemplate: function(templateContent) {
410
+      this.edit_new_content = this.edit_new_content.length > 0 ? (this.edit_new_content + templateContent) : templateContent
411
+    },
412
+
413
+    didSelectionChange: function(selectRows) {
414
+
415
+      var arr = []
416
+      for(let i=0;i<selectRows.length;i++){
417
+        arr.push(selectRows[i].id)
418
+      }
419
+      var newArr = arr.join(',')
420
+      this.ids = newArr
421
+      console.log("select23322332",this.ids)
422
+      this.selectingRows = selectRows
423
+    },
424
+    deleteAction: function() {
425
+      if (this.selectingRows.length == 0) {
426
+        return
427
+      }
428
+      var ids = []
429
+      for (let index = 0; index < this.selectingRows.length; index++) {
430
+        const row = this.selectingRows[index]
431
+        ids.push(row.id)
432
+      }
433
+      var ids_str = ids.join(',')
434
+      this.loading = true
435
+      deleteCourseOfDiseaseRecords(this.patient_id, ids_str).then(rs => {
436
+        var resp = rs.data
437
+        if (resp.state == 1) {
438
+          for (let id_index = 0; id_index < ids.length; id_index++) {
439
+            for (let record_index = 0; record_index < this.records.length; record_index++) {
440
+              if (ids[id_index] == this.records[record_index].id) {
441
+                this.records.splice(record_index, 1)
442
+                break
443
+              }
444
+            }
445
+          }
446
+          this.selectingRows = []
447
+          this.$message.success('已删除')
448
+
449
+        } else {
450
+          this.$message.error(resp.msg)
451
+        }
452
+        this.loading = false
453
+      }).catch(err => {
454
+        this.loading = false
455
+        this.$message.error(err)
456
+      })
457
+    }, startTimeChange(val) {
458
+      this.requestCourseRecords()
459
+    }, endTimeChange(val) {
460
+      this.requestCourseRecords()
461
+    }, showEdit() {
462
+      if (this.table_current_index == -1) {
463
+        this.$message.error('请选择要修改的病程内容')
464
+        return
465
+      }
466
+      this.show_edit_dialog = true
467
+      this.edit_course_of_disease_time = this.recordTime(this.records[this.table_current_index].record_time)
468
+      this.edit_new_content = this.records[this.table_current_index].content
469
+      this.edit_current_id = this.records[this.table_current_index].id
470
+      this.edit_title = this.records[this.table_current_index].title
471
+      this.$refs.record_table.setCurrentRow(null)
472
+
473
+    }, tableRow({ row, rowIndex }) {
474
+      // 把每一行的索引放进row
475
+      row.index = rowIndex
476
+    }, onRowClick(row, event, column) {
477
+      this.table_current_index = row.index
478
+    },
479
+    print(){
480
+      // if (this.table_current_index == -1) {
481
+      //   this.$message.error('请选择要打印的病程')
482
+      //   return
483
+      // }
484
+      if(this.ids.length == 0){
485
+        this.$message.error('请选择要打印的病程')
486
+        return
487
+      }
488
+      this.$router.push({ path: "/course/print?ids="+this.ids+"&patient_id="+this.patient_id});
489
+    }
490
+  }
491
+}
492
+</script>
493
+
494
+<style rel="stylesheet/css" lang="scss" scoped>
495
+.container {
496
+  margin-left: 180px;
497
+  padding: 20px;
498
+  background: #fff;
499
+  min-height: calc(100vh - 173px);
500
+  margin-bottom: 15px;
501
+
502
+.record {
503
+  padding-top: 20px;
504
+}
505
+
506
+}
507
+.record_content_panel {
508
+  border-width: 1px;
509
+  border-style: solid;
510
+  border-color: #ebeef5;
511
+  min-height: 200px;
512
+
513
+.title {
514
+  font-size: 14px;
515
+  font-weight: 500;
516
+  color: #909399;
517
+  line-height: 44px;
518
+  height: 44px;
519
+  text-align: center;
520
+  border-bottom-width: 1px;
521
+  border-bottom-style: solid;
522
+  border-bottom-color: #ebeef5;
523
+}
524
+
525
+.content {
526
+  padding: 12px 15px;
527
+  font-size: 15px;
528
+  color: gray;
529
+  line-height: 22px;
530
+}
531
+
532
+}
533
+
534
+.new_record_form {
535
+
536
+/*/ / padding: 10 px, 25 px;*/
537
+
538
+.textarea_panel {
539
+  margin-top: 10px;
540
+}
541
+
542
+}
543
+</style>
544
+<style>
545
+.el-table td,
546
+.el-table th.is-leaf,
547
+.el-table--border,
548
+.el-table--group {
549
+  border-color: #d0d3da;
550
+}
551
+.el-table--border::after,
552
+.el-table--group::after,
553
+.el-table::before {
554
+  background-color: #d0d3da;
555
+}
556
+</style>