Browse Source

Merge branch '20210923_pc_vue_new_branch' of http://git.shengws.com/csx/Vue_New into 20201109_pc_vue_new_branch

XMLWAN 3 years ago
parent
commit
c303a90510

+ 3 - 2
config/dev.env.js View File

7
   NODE_ENV: '"development"',
7
   NODE_ENV: '"development"',
8
   ENV_CONFIG: '"dev"',
8
   ENV_CONFIG: '"dev"',
9
   //BASE_API: '"http://new_mobile.xt.api.sgjyun.com"', // //http://api.xt.test.sgjyun.com http://112.74.16.180:9527,////'"http://localhost:9529"',
9
   //BASE_API: '"http://new_mobile.xt.api.sgjyun.com"', // //http://api.xt.test.sgjyun.com http://112.74.16.180:9527,////'"http://localhost:9529"',
10
-  BASE_API: '"http://api.xt.test.sgjyun.com"',
11
-  // BASE_API: '"http://localhost:9529"',
10
+  // BASE_API: '"http://api.xt.test.sgjyun.com"',
11
+  BASE_API: '"http://localhost:9531"',
12
   SSO_HOST: '"http://testsso.sgjyun.com"',
12
   SSO_HOST: '"http://testsso.sgjyun.com"',
13
   SRCM_HOST: '"http://test1.sgjyun.com"',
13
   SRCM_HOST: '"http://test1.sgjyun.com"',
14
   XT_HOST: '"http://xt.test.sgjyun.com"',
14
   XT_HOST: '"http://xt.test.sgjyun.com"',
15
   MIRCO_MALL_HOST: '"http://mall.test.sgjyun.com"',
15
   MIRCO_MALL_HOST: '"http://mall.test.sgjyun.com"',
16
   CDM_HOST: '"http://cdm.test.sgjyun.com"'
16
   CDM_HOST: '"http://cdm.test.sgjyun.com"'
17
 }
17
 }
18
+

+ 2 - 2
config/index.js View File

29
 
29
 
30
     // host: 'xt.test.sgjyun.com',
30
     // host: 'xt.test.sgjyun.com',
31
     //  host: 'xt.kuyicloud.com',
31
     //  host: 'xt.kuyicloud.com',
32
-    host: 'xt.test.sgjyun.com',
33
-    // host: 'localhost',
32
+    // host: 'xt.test.sgjyun.com',
33
+    host: 'localhost',
34
     port: 9528, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
34
     port: 9528, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
35
     autoOpenBrowser: true,
35
     autoOpenBrowser: true,
36
     errorOverlay: true,
36
     errorOverlay: true,

+ 2 - 0
src/xt_pages/hospitalStation/components/chargeDialog.vue View File

120
           {value: 2, label: '银行卡'},
120
           {value: 2, label: '银行卡'},
121
           {value: 3, label: '微信'},
121
           {value: 3, label: '微信'},
122
           {value: 4, label: '支付宝'},
122
           {value: 4, label: '支付宝'},
123
+          {value: 5, label: '医保卡'},
124
+
123
         ],
125
         ],
124
         total:"",
126
         total:"",
125
 
127
 

+ 20 - 21
src/xt_pages/hospitalStation/components/registerDialog.vue View File

122
                 </el-select>
122
                 </el-select>
123
             </el-form-item>
123
             </el-form-item>
124
 
124
 
125
+            <el-form-item label="医生:" prop="doctor">
126
+                <el-select v-model="form.doctor" placeholder="请选择">
127
+                    <el-option
128
+                            v-for="(item,index) in doctors"
129
+                            :key="index"
130
+                            :label="item.user_name"
131
+                            :value="item.admin_user_id">
132
+                    </el-option>
133
+                </el-select>
134
+            </el-form-item>
135
+            <el-form-item label="科室:" prop="department">
136
+                <el-select v-model="form.department" placeholder="请选择">
137
+                    <el-option
138
+                            v-for="(item,index) in departments"
139
+                            :key="index"
140
+                            :label="item.name"
141
+                            :value="item.id">
142
+                    </el-option>
143
+                </el-select>
144
+            </el-form-item>
125
 
145
 
126
             <el-form-item label="社保类型:">
146
             <el-form-item label="社保类型:">
127
                 <el-select v-model="form.social_type" placeholder="请选择" style="width:100%;">
147
                 <el-select v-model="form.social_type" placeholder="请选择" style="width:100%;">
172
                 <el-input v-model="form.medical_expenses"></el-input>
192
                 <el-input v-model="form.medical_expenses"></el-input>
173
             </el-form-item>
193
             </el-form-item>
174
 
194
 
175
-            <el-form-item label="医生:" prop="doctor">
176
-                <el-select v-model="form.doctor" placeholder="请选择">
177
-                    <el-option
178
-                            v-for="(item,index) in doctors"
179
-                            :key="index"
180
-                            :label="item.user_name"
181
-                            :value="item.admin_user_id">
182
-                    </el-option>
183
-                </el-select>
184
-            </el-form-item>
185
-
186
-            <el-form-item label="科室:" prop="department">
187
-                <el-select v-model="form.department" placeholder="请选择">
188
-                    <el-option
189
-                            v-for="(item,index) in departments"
190
-                            :key="index"
191
-                            :label="item.name"
192
-                            :value="item.id">
193
-                    </el-option>
194
-                </el-select>
195
-            </el-form-item>
196
         </el-form>
195
         </el-form>
197
 
196
 
198
 
197
 

+ 2 - 0
src/xt_pages/outpatientCharges/components/chargeDialog.vue View File

121
           {value: 2, label: '银行卡'},
121
           {value: 2, label: '银行卡'},
122
           {value: 3, label: '微信'},
122
           {value: 3, label: '微信'},
123
           {value: 4, label: '支付宝'},
123
           {value: 4, label: '支付宝'},
124
+          {value: 5, label: '医保卡'},
125
+
124
         ],
126
         ],
125
         total:"",
127
         total:"",
126
 
128
 

+ 257 - 122
src/xt_pages/outpatientDoctorStation/components/prescriptionTemplateTable.vue View File

1
 <template>
1
 <template>
2
+
2
     <div class="prescriptionTable">
3
     <div class="prescriptionTable">
3
-        <el-table v-if="prescription.advices && prescription.advices.length > 0" :data="prescription.advices" border style="width: 99%;" :row-style="{ color: '#303133' }"
4
+        <el-table v-if="prescription.advices && prescription.advices.length > 0" :data="prescription.advices" border
5
+                  style="width: 99%;" :row-style="{ color: '#303133' }"
4
                   :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}" highlight-current-row>
6
                   :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}" highlight-current-row>
5
-            <el-table-column align="center" type="index" width="40" label="序号"></el-table-column>
7
+            <el-table-column align="center" width="70" label="序号">
8
+                <template slot-scope="scope">
9
+                    <div style="display:flex;align-items:center;">
10
+                        <el-input v-model="scope.row.groupno" placeholder=""></el-input>
11
+                    </div>
12
+                </template>
13
+            </el-table-column>
6
             <el-table-column align="center" prop="drug_name" label="名称">
14
             <el-table-column align="center" prop="drug_name" label="名称">
7
-                <template slot-scope="scope"><span :title="scope.row.drug_name">{{ scope.row.drug_name }}</span></template>
15
+                <template slot-scope="scope"><span :title="scope.row.drug_name">{{ scope.row.drug_name }}</span>
16
+                </template>
8
             </el-table-column>
17
             </el-table-column>
9
 
18
 
10
             <el-table-column align="center" prop="single_dose" width="120" label="单次用量">
19
             <el-table-column align="center" prop="single_dose" width="120" label="单次用量">
11
                 <template slot-scope="scope">
20
                 <template slot-scope="scope">
12
                     <div style="display:flex;align-items:center;">
21
                     <div style="display:flex;align-items:center;">
13
-                        <el-input v-model="scope.row.single_dose" @input="getSingleDose(scope)" style="width:50%;"></el-input>
22
+                        <el-input v-model="scope.row.single_dose" @input="getSingleDose(scope)"
23
+                                  style="width:50%;"></el-input>
14
                         <!-- <div>{{scope.row.single_dose_unit}}</div> -->
24
                         <!-- <div>{{scope.row.single_dose_unit}}</div> -->
15
-                        <el-select v-model="scope.row.single_dose_unit" placeholder="请选择" style="width:50%;" @change="getAllChange(scope)">
16
-                          <el-option :label="scope.row.drug.min_unit" :value="scope.row.drug.min_unit"></el-option>
17
-                          <el-option :label="scope.row.drug.dose_unit" v-if="scope.row.drug.dose_unit != scope.row.drug.min_unit" :value="scope.row.drug.dose_unit"></el-option>
25
+                        <el-select v-model="scope.row.single_dose_unit" placeholder="请选择" style="width:50%;"
26
+                                   @change="getAllChange(scope)">
27
+                            <el-option :label="scope.row.drug.min_unit" :value="scope.row.drug.min_unit"></el-option>
28
+                            <el-option :label="scope.row.drug.dose_unit"
29
+                                       v-if="scope.row.drug.dose_unit != scope.row.drug.min_unit"
30
+                                       :value="scope.row.drug.dose_unit"></el-option>
18
                         </el-select>
31
                         </el-select>
19
                     </div>
32
                     </div>
20
                 </template>
33
                 </template>
48
             <el-table-column align="center" prop="day" width="70" label="天数">
61
             <el-table-column align="center" prop="day" width="70" label="天数">
49
                 <template slot-scope="scope">
62
                 <template slot-scope="scope">
50
                     <div style="display:flex;align-items:center;">
63
                     <div style="display:flex;align-items:center;">
51
-                        <el-input v-model="scope.row.day" @input="getAllChange(scope)" placeholder=""></el-input>{{'天'}}
64
+                        <el-input v-model="scope.row.day" @input="getAllChange(scope)" placeholder=""></el-input>
65
+                        {{'天'}}
52
                     </div>
66
                     </div>
53
                 </template>
67
                 </template>
54
             </el-table-column>
68
             </el-table-column>
56
             <el-table-column align="center" prop="prescribing_number" width="120" label="总量">
70
             <el-table-column align="center" prop="prescribing_number" width="120" label="总量">
57
                 <template slot-scope="scope">
71
                 <template slot-scope="scope">
58
                     <div style="display:flex;align-items:center;">
72
                     <div style="display:flex;align-items:center;">
59
-                        <el-input v-model="scope.row.prescribing_number" style="width:50%" @input="changePrescribingNumber(scope)" placeholder=""></el-input>
73
+                        <el-input v-model="scope.row.prescribing_number" style="width:50%"
74
+                                  @input="changePrescribingNumber(scope)" placeholder=""></el-input>
60
                         <!-- <div> {{scope.row.prescribing_number_unit}}</div> -->
75
                         <!-- <div> {{scope.row.prescribing_number_unit}}</div> -->
61
-                        <el-select v-model="scope.row.prescribing_number_unit" placeholder="请选择" style="width:50%;" @change="getAllChange(scope)">
62
-                          <el-option :label="scope.row.drug.min_unit" :value="scope.row.drug.min_unit"></el-option>
63
-                          <el-option :label="scope.row.drug.max_unit" v-if="scope.row.drug.min_unit != scope.row.drug.max_unit" :value="scope.row.drug.max_unit"></el-option>
76
+                        <el-select v-model="scope.row.prescribing_number_unit" placeholder="请选择" style="width:50%;"
77
+                                   @change="getAllChange(scope)">
78
+                            <el-option :label="scope.row.drug.min_unit" :value="scope.row.drug.min_unit"></el-option>
79
+                            <el-option :label="scope.row.drug.max_unit"
80
+                                       v-if="scope.row.drug.min_unit != scope.row.drug.max_unit"
81
+                                       :value="scope.row.drug.max_unit"></el-option>
64
                         </el-select>
82
                         </el-select>
65
                     </div>
83
                     </div>
66
                 </template>
84
                 </template>
79
                     <el-input v-model="scope.row.remark" :title="scope.row.remark" placeholder=""></el-input>
97
                     <el-input v-model="scope.row.remark" :title="scope.row.remark" placeholder=""></el-input>
80
                 </template>
98
                 </template>
81
             </el-table-column>
99
             </el-table-column>
100
+
101
+            <el-table-column align="center" prop="remark" width="50" label="推送频率">
102
+                <template slot-scope="scope">
103
+                    <div v-if="scope.row.frequency_type == 1">{{'每次必推'}}</div>
104
+                    <div v-if="scope.row.frequency_type == 2">{{scope.row.day_count}}天/次</div>
105
+                    <div v-if="scope.row.frequency_type == 3">{{scope.row.week_day}}</div>
106
+
107
+                </template>
108
+            </el-table-column>
109
+
110
+
82
             <el-table-column align="center" width="40" prop="name" label="操作">
111
             <el-table-column align="center" width="40" prop="name" label="操作">
83
                 <template slot-scope="scope">
112
                 <template slot-scope="scope">
84
-                    <i class="el-icon-delete" @click="deleteDrug(scope.$index, scope.row)"></i>
113
+                    <!--<i class="el-icon-delete" @click="deleteDrug(scope.$index, scope.row)"></i>-->
114
+                    <el-button size="mini" type="primary" @click="handleEdit(scope.row,scope.$index)">推送</el-button>
115
+                    <el-button size="mini" type="danger" @click="deleteDrug(scope.row.id,scope.$index)">删除</el-button>
85
                 </template>
116
                 </template>
86
             </el-table-column>
117
             </el-table-column>
87
         </el-table>
118
         </el-table>
88
 
119
 
89
-        <el-table v-if="prescription.project &&prescription.project.length > 0" :data="prescription.project" border style="width: 99%;" :row-style="{ color: '#303133' }"
120
+        <el-table v-if="prescription.project &&prescription.project.length > 0" :data="prescription.project" border
121
+                  style="width: 99%;" :row-style="{ color: '#303133' }"
90
                   :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}" highlight-current-row>
122
                   :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}" highlight-current-row>
91
             <el-table-column align="center" type="index" width="40" label="序号"></el-table-column>
123
             <el-table-column align="center" type="index" width="40" label="序号"></el-table-column>
92
             <el-table-column align="center" prop="project_name" label="名称">
124
             <el-table-column align="center" prop="project_name" label="名称">
93
-                <template slot-scope="scope"><span :title="scope.row.project_name">{{ scope.row.project_name }}</span></template>
125
+                <template slot-scope="scope"><span :title="scope.row.project_name">{{ scope.row.project_name }}</span>
126
+                </template>
94
             </el-table-column>
127
             </el-table-column>
95
             <el-table-column align="center" prop="statistical_classification" width="100" label="组">
128
             <el-table-column align="center" prop="statistical_classification" width="100" label="组">
96
-                <template slot-scope="scope">{{scope.row.type == 2?getGroup(scope.row.statistical_classification):"耗材"}}</template>
129
+                <template slot-scope="scope">{{scope.row.type ==
130
+                    2?getGroup(scope.row.statistical_classification):'耗材'}}
131
+                </template>
97
             </el-table-column>
132
             </el-table-column>
98
             <el-table-column align="center" prop="single_dose" width="80" label="单次用量">
133
             <el-table-column align="center" prop="single_dose" width="80" label="单次用量">
99
                 <template slot-scope="scope">
134
                 <template slot-scope="scope">
100
-                  <div style="display:flex;align-items:center;">
101
-                    <el-input v-model="scope.row.single_dose" @input="getProjectSingleDose(scope)" placeholder=""></el-input>
102
-                    <div>{{scope.row.unit}}</div>
103
-                  </div>
135
+                    <div style="display:flex;align-items:center;">
136
+                        <el-input v-model="scope.row.single_dose" @input="getProjectSingleDose(scope)"
137
+                                  placeholder=""></el-input>
138
+                        <div>{{scope.row.unit}}</div>
139
+                    </div>
104
 
140
 
105
                 </template>
141
                 </template>
106
             </el-table-column>
142
             </el-table-column>
123
             <el-table-column align="center" prop="number_days" width="70" label="天数">
159
             <el-table-column align="center" prop="number_days" width="70" label="天数">
124
                 <template slot-scope="scope">
160
                 <template slot-scope="scope">
125
                     <div style="display:flex;align-items:center;">
161
                     <div style="display:flex;align-items:center;">
126
-                        <el-input v-model="scope.row.number_days" @input="getProjectDay(scope)" placeholder=""></el-input>
162
+                        <el-input v-model="scope.row.number_days" @input="getProjectDay(scope)"
163
+                                  placeholder=""></el-input>
127
                         <div>{{'天'}}</div>
164
                         <div>{{'天'}}</div>
128
                     </div>
165
                     </div>
129
                 </template>
166
                 </template>
140
             <el-table-column align="center" prop="name" width="70" label="单价">
177
             <el-table-column align="center" prop="name" width="70" label="单价">
141
                 <template slot-scope="scope">
178
                 <template slot-scope="scope">
142
                     <div style="display:flex;align-items:center;">
179
                     <div style="display:flex;align-items:center;">
143
-                      <el-input v-model="scope.row.price" placeholder="" readonly></el-input>
144
-                      <div>{{'元'}}</div>
180
+                        <el-input v-model="scope.row.price" placeholder="" readonly></el-input>
181
+                        <div>{{'元'}}</div>
145
                     </div>
182
                     </div>
146
 
183
 
147
                 </template>
184
                 </template>
151
                     <el-input v-model="scope.row.remark" :title="scope.row.remark"></el-input>
188
                     <el-input v-model="scope.row.remark" :title="scope.row.remark"></el-input>
152
                 </template>
189
                 </template>
153
             </el-table-column>
190
             </el-table-column>
191
+            <el-table-column align="center" prop="remark" width="50" label="推送频率">
192
+                <template slot-scope="scope">
193
+                    <div v-if="scope.row.frequency_type == 1">{{'每次必推'}}</div>
194
+                    <div v-if="scope.row.frequency_type == 2">{{scope.row.day_count}}天/次</div>
195
+                    <div v-if="scope.row.frequency_type == 3">{{scope.row.week_day}}</div>
196
+
197
+                </template>
198
+            </el-table-column>
154
             <el-table-column align="center" width="40" prop="name" label="操作">
199
             <el-table-column align="center" width="40" prop="name" label="操作">
155
                 <template slot-scope="scope">
200
                 <template slot-scope="scope">
156
-                    <i class="el-icon-delete" @click="deleteProject(scope.row,scope.$index)"></i>
201
+                    <el-button size="mini" type="primary" @click="handleEdit(scope.row,scope.$index)">推送</el-button>
202
+                    <el-button size="mini" type="danger" @click="deleteProject(scope.row.id,scope.$index)">删除
203
+                    </el-button>
204
+                    <!--<i class="el-icon-delete" @click="deleteProject(scope.row,scope.$index)"></i>-->
205
+                    <!--<button class="el-icon-delete" @click="deleteProject(scope.row,scope.$index)">删除</>-->
206
+
157
                 </template>
207
                 </template>
158
             </el-table-column>
208
             </el-table-column>
159
         </el-table>
209
         </el-table>
170
         </div>
220
         </div>
171
 
221
 
172
 
222
 
223
+        <div>
224
+            <el-dialog title="推送频率设置" :visible.sync="templateFormVisible" width="854px">
225
+                <el-form
226
+                        ref="templateForm"
227
+                        label-width="90px"
228
+                >
229
+                    <el-row>
230
+                        <el-col :span="24" >
231
+                            <el-form-item label="周期提醒 :">
232
+                                <el-radio-group v-model="frequency_type">
233
+                                    <el-radio :label="1">每次必推</el-radio>
234
+                                    <el-radio :label="2">天数频率</el-radio>
235
+                                    <el-radio :label="3">星期频率</el-radio>
236
+                                </el-radio-group>
237
+                            </el-form-item>
238
+                        </el-col>
239
+
240
+
241
+                        <el-col :span="12" v-if="frequency_type == 2">
242
+                            <el-form-item prop="day_count">
243
+                                <el-input style="width: 50px" v-model="day_count"></el-input>&nbsp;
244
+                                天/一次
245
+                            </el-form-item>
246
+                        </el-col>
247
+
248
+                        <el-col :span="24" v-if="frequency_type == 3">
249
+                            <el-form-item prop="weekday">
250
+                                <el-checkbox-group v-model="week_days">
251
+                                    <el-checkbox label="周一" name="周一" key="1">周一</el-checkbox>
252
+                                    <el-checkbox label="周二" name="周二" key="2">周二</el-checkbox>
253
+                                    <el-checkbox label="周三" name="周三" key="3">周三</el-checkbox>
254
+                                    <el-checkbox label="周四" name="周四" key="4">周四</el-checkbox>
255
+                                    <el-checkbox label="周五" name="周五" key="5">周五</el-checkbox>
256
+                                    <el-checkbox label="周六" name="周六" key="6">周六</el-checkbox>
257
+                                    <el-checkbox label="周日" name="周日" key="7">周日</el-checkbox>
258
+                                </el-checkbox-group>
259
+                            </el-form-item>
260
+                        </el-col>
261
+
262
+                    </el-row>
263
+                </el-form>
264
+                <div slot="footer" class="dialog-footer">
265
+                    <el-button @click="templateFormVisible = false">取消</el-button>
266
+                    <el-button type="primary" @click="submitTemplate()">保 存</el-button>
267
+                </div>
268
+            </el-dialog>
269
+        </div>
270
+
173
 
271
 
174
     </div>
272
     </div>
175
 </template>
273
 </template>
176
 
274
 
177
 <script>
275
 <script>
178
-  import { getDictionaryDataConfig} from "@/utils/data";
179
-  import { getInitData,delHisAdvice,delHisProject,delHisAddition } from '@/api/his/his'
180
-  import { delHisPrescriptionAdviceTemplate,delHisPrescriptionProjectTemplate } from '@/api/his/his_config'
276
+  import { getDictionaryDataConfig } from '@/utils/data'
277
+  import { delHisAddition, delHisAdvice, delHisProject, getInitData } from '@/api/his/his'
278
+  import { delHisPrescriptionAdviceTemplate, delHisPrescriptionProjectTemplate } from '@/api/his/his_config'
181
 
279
 
182
   export default {
280
   export default {
183
     props: {
281
     props: {
184
       preDrugs: Array,
282
       preDrugs: Array,
185
       activeType: Number,
283
       activeType: Number,
186
-      addtions_charge:Array,
187
-      prescription:{
188
-        type:Object,
189
-        default: function () {
284
+      addtions_charge: Array,
285
+      prescription: {
286
+        type: Object,
287
+        default: function() {
190
           return {
288
           return {
191
-            name:"",
192
-            advices:[],
193
-            project:[],
194
-            drugways:[],
195
-            efs:[],
196
-          };
289
+            name: '',
290
+            advices: [],
291
+            project: [],
292
+            drugways: [],
293
+            efs: []
294
+          }
197
         }
295
         }
198
-      },
296
+      }
199
     },
297
     },
200
     data() {
298
     data() {
201
       return {
299
       return {
202
-        advices:[],
300
+        week_days: [],
301
+
302
+        current_row: null,
303
+        current_index: 0,
304
+        templateFormVisible: false,
305
+        frequency_type: 1,
306
+        day_count: 0,
307
+        advices: [],
203
         tableData: [],
308
         tableData: [],
204
         newoptions: [{
309
         newoptions: [{
205
           value: '1',
310
           value: '1',
218
           label: '5'
323
           label: '5'
219
         }],
324
         }],
220
         value: '1',
325
         value: '1',
221
-        input: 1,
326
+        input: 1
222
       }
327
       }
223
     },
328
     },
224
 
329
 
225
-    methods:{
330
+    methods: {
331
+      submitTemplate() {
332
+        console.log(this.current_index)
333
+
334
+        console.log( this.prescription.project[this.current_index])
335
+        if (this.prescription.advices && this.prescription.advices.length > 0 && this.prescription.project && this.prescription.project.length == 0) {
336
+          this.prescription.advices[this.current_index].frequency_type = this.frequency_type
337
+          this.prescription.advices[this.current_index].day_count = this.day_count
338
+          this.prescription.advices[this.current_index].week_day = this.week_days.join(",")
339
+
340
+        }
341
+
342
+        if (this.prescription.advices && this.prescription.advices.length == 0 && this.prescription.project && this.prescription.project.length > 0) {
343
+          this.prescription.project[this.current_index].frequency_type = this.frequency_type
344
+          this.prescription.project[this.current_index].day_count = this.day_count
345
+          this.prescription.project[this.current_index].week_day =this.week_days.join(",")
346
+        }
347
+        this.templateFormVisible = false
348
+      },
349
+      handleEdit(row, index) {
350
+        this.current_row = row
351
+        this.current_index = index
352
+        this.frequency_type = this.current_row.frequency_type
353
+        this.day_count = this.current_row.day_count
354
+        this.week_days = this.current_row.week_day.split(",")
355
+        this.templateFormVisible = true
356
+
357
+
358
+      },
226
       createFilter(queryString) {
359
       createFilter(queryString) {
227
         return (restaurant) => {
360
         return (restaurant) => {
228
           return (restaurant.name.toLowerCase().indexOf(queryString.toLowerCase()) === 0)
361
           return (restaurant.name.toLowerCase().indexOf(queryString.toLowerCase()) === 0)
229
         }
362
         }
230
       },
363
       },
231
       querySearch2(queryString, cb) {
364
       querySearch2(queryString, cb) {
232
-        var restaurants = this.getDictionaryDataConfig("system","project_use")
365
+        var restaurants = this.getDictionaryDataConfig('system', 'project_use')
233
         restaurants.map(item => {
366
         restaurants.map(item => {
234
           item.value = item.name
367
           item.value = item.name
235
         })
368
         })
237
         // 调用 callback 返回建议列表的数据
370
         // 调用 callback 返回建议列表的数据
238
         cb(results)
371
         cb(results)
239
       },
372
       },
240
-      delAddition(index, addition){
241
-        this.$confirm("附加费删除后不可恢复,是否确认删除", "删除", {
242
-          confirmButtonText: "确 定",
243
-          cancelButtonText: "取 消",
244
-          type: "warning"
373
+      delAddition(index, addition) {
374
+        this.$confirm('附加费删除后不可恢复,是否确认删除', '删除', {
375
+          confirmButtonText: '确 定',
376
+          cancelButtonText: '取 消',
377
+          type: 'warning'
245
         }).then(() => {
378
         }).then(() => {
246
-          this.$nextTick(function(){
247
-            if(addition.id == 0){
379
+          this.$nextTick(function() {
380
+            if (addition.id == 0) {
248
               this.prescription.addition.splice(index, 1)
381
               this.prescription.addition.splice(index, 1)
249
-            }else{
382
+            } else {
250
               let params = {
383
               let params = {
251
-                'id': addition.id,
384
+                'id': addition.id
252
               }
385
               }
253
               delHisAddition(params).then(response => {
386
               delHisAddition(params).then(response => {
254
                 if (response.data.state == 0) {
387
                 if (response.data.state == 0) {
262
                 }
395
                 }
263
               })
396
               })
264
             }
397
             }
265
-          });
398
+          })
266
 
399
 
267
         })
400
         })
268
-          .catch(() => {});
401
+          .catch(() => {
402
+          })
269
 
403
 
270
       },
404
       },
271
-      getInitData(){
405
+      getInitData() {
272
         getInitData().then(response => {
406
         getInitData().then(response => {
273
           if (response.data.state == 0) {
407
           if (response.data.state == 0) {
274
             this.$message.error(response.data.msg)
408
             this.$message.error(response.data.msg)
279
           }
413
           }
280
         })
414
         })
281
 
415
 
282
-      },deleteDrug:function(index, row){
416
+      }, deleteDrug: function(index, row) {
283
 
417
 
284
-        this.$confirm("药品删除后不可恢复,是否确认删除", "删除", {
285
-          confirmButtonText: "确 定",
286
-          cancelButtonText: "取 消",
287
-          type: "warning"
418
+        this.$confirm('药品删除后不可恢复,是否确认删除', '删除', {
419
+          confirmButtonText: '确 定',
420
+          cancelButtonText: '取 消',
421
+          type: 'warning'
288
         }).then(() => {
422
         }).then(() => {
289
-          this.$nextTick(function(){
290
-            if(row.advice_id == 0){
423
+          this.$nextTick(function() {
424
+            if (row.advice_id == 0) {
291
               this.prescription.advices.splice(index, 1)
425
               this.prescription.advices.splice(index, 1)
292
-            }else{
426
+            } else {
293
               let params = {
427
               let params = {
294
-                'id': row.advice_id,
428
+                'id': row.advice_id
295
               }
429
               }
296
               delHisPrescriptionAdviceTemplate(params).then(response => {
430
               delHisPrescriptionAdviceTemplate(params).then(response => {
297
                 if (response.data.state == 0) {
431
                 if (response.data.state == 0) {
305
                 }
439
                 }
306
               })
440
               })
307
 
441
 
308
-
309
             }
442
             }
310
 
443
 
311
-          });
312
-
444
+          })
313
 
445
 
314
         })
446
         })
315
-          .catch(() => {});
316
-
317
-
447
+          .catch(() => {
448
+          })
318
 
449
 
319
-
320
-
321
-      },deepClone(source) {
450
+      }, deepClone(source) {
322
         if (!source && typeof source !== 'object') {
451
         if (!source && typeof source !== 'object') {
323
           throw new Error('error arguments', 'shallowClone')
452
           throw new Error('error arguments', 'shallowClone')
324
         }
453
         }
333
         return targetObj
462
         return targetObj
334
       },
463
       },
335
 
464
 
336
-      setNewData:function(data){
465
+      setNewData: function(data) {
337
         this.prescription = data
466
         this.prescription = data
338
 
467
 
339
         // this.prescription.advices = data.advices
468
         // this.prescription.advices = data.advices
341
       getDictionaryDataConfig(module, filed_name) {
470
       getDictionaryDataConfig(module, filed_name) {
342
         return getDictionaryDataConfig(module, filed_name)
471
         return getDictionaryDataConfig(module, filed_name)
343
       },
472
       },
344
-      getGroup(id){
345
-        var name = ""
346
-        var statistics_category =  getDictionaryDataConfig('system','statistics_category')
347
-        console.log("2235",statistics_category)
348
-        for(let i=0;i<statistics_category.length;i++){
349
-          if(id == statistics_category[i].id){
473
+      getGroup(id) {
474
+        var name = ''
475
+        var statistics_category = getDictionaryDataConfig('system', 'statistics_category')
476
+        console.log('2235', statistics_category)
477
+        for (let i = 0; i < statistics_category.length; i++) {
478
+          if (id == statistics_category[i].id) {
350
             name = statistics_category[i].name
479
             name = statistics_category[i].name
351
           }
480
           }
352
         }
481
         }
353
         return name
482
         return name
354
       },
483
       },
355
-      deleteProject(row,i){
356
-        if(this.prescription.order_status == 2){
484
+      deleteProject(row, i) {
485
+        if (this.prescription.order_status == 2) {
357
           this.$message.error('该处方已经结算,无法删除')
486
           this.$message.error('该处方已经结算,无法删除')
358
           return
487
           return
359
         }
488
         }
360
-        this.$confirm("项目删除后不可恢复,是否确认删除", "删除", {
361
-          confirmButtonText: "确 定",
362
-          cancelButtonText: "取 消",
363
-          type: "warning"
489
+        this.$confirm('项目删除后不可恢复,是否确认删除', '删除', {
490
+          confirmButtonText: '确 定',
491
+          cancelButtonText: '取 消',
492
+          type: 'warning'
364
         }).then(() => {
493
         }).then(() => {
365
-          if(row.id == 0){
494
+          if (row.id == 0) {
366
             this.prescription.project.splice(i, 1)
495
             this.prescription.project.splice(i, 1)
367
 
496
 
368
-          }else{
497
+          } else {
369
             let params = {
498
             let params = {
370
-              'id': row.id,
499
+              'id': row.id
371
             }
500
             }
372
             delHisPrescriptionProjectTemplate(params).then(response => {
501
             delHisPrescriptionProjectTemplate(params).then(response => {
373
               if (response.data.state == 0) {
502
               if (response.data.state == 0) {
374
                 this.$message.error(response.data.msg)
503
                 this.$message.error(response.data.msg)
375
                 return false
504
                 return false
376
               } else {
505
               } else {
377
-                for (let i = 0; i < this.prescription.project.length; i++){
378
-                  if(this.prescription.project[i].id == row.id){
506
+                for (let i = 0; i < this.prescription.project.length; i++) {
507
+                  if (this.prescription.project[i].id == row.id) {
379
                     this.prescription.project.splice(i, 1)
508
                     this.prescription.project.splice(i, 1)
380
                   }
509
                   }
381
                 }
510
                 }
384
             })
513
             })
385
           }
514
           }
386
         })
515
         })
387
-          .catch(() => {});
516
+          .catch(() => {
517
+          })
388
 
518
 
389
       },
519
       },
390
-      getAllChange(scope){
391
-        if(scope.row.drug.min_unit == scope.row.single_dose_unit){
392
-          if(scope.row.prescribing_number_unit == scope.row.drug.min_unit){
520
+      getAllChange(scope) {
521
+        if (scope.row.drug.min_unit == scope.row.single_dose_unit) {
522
+          if (scope.row.prescribing_number_unit == scope.row.drug.min_unit) {
393
             console.log(1)
523
             console.log(1)
394
             scope.row.prescribing_number = scope.row.single_dose * this.getNum(scope.row.execution_frequency) * scope.row.day
524
             scope.row.prescribing_number = scope.row.single_dose * this.getNum(scope.row.execution_frequency) * scope.row.day
395
-          }else{
525
+          } else {
396
             console.log(12)
526
             console.log(12)
397
-            scope.row.prescribing_number = Math.ceil((scope.row.single_dose * this.getNum(scope.row.execution_frequency)) * scope.row.day / scope.row.drug.min_number) 
527
+            scope.row.prescribing_number = Math.ceil((scope.row.single_dose * this.getNum(scope.row.execution_frequency)) * scope.row.day / scope.row.drug.min_number)
398
           }
528
           }
399
-        }else{
400
-          if(scope.row.prescribing_number_unit == scope.row.drug.min_unit){
529
+        } else {
530
+          if (scope.row.prescribing_number_unit == scope.row.drug.min_unit) {
401
             console.log(123)
531
             console.log(123)
402
-            scope.row.prescribing_number = Math.ceil((scope.row.single_dose * this.getNum(scope.row.execution_frequency) * scope.row.day) / scope.row.drug.dose) 
403
-          }else{
532
+            scope.row.prescribing_number = Math.ceil((scope.row.single_dose * this.getNum(scope.row.execution_frequency) * scope.row.day) / scope.row.drug.dose)
533
+          } else {
404
             console.log(1234)
534
             console.log(1234)
405
             scope.row.prescribing_number = Math.ceil((scope.row.single_dose * this.getNum(scope.row.execution_frequency) * scope.row.day) / scope.row.drug.dose / scope.row.drug.min_number)
535
             scope.row.prescribing_number = Math.ceil((scope.row.single_dose * this.getNum(scope.row.execution_frequency) * scope.row.day) / scope.row.drug.dose / scope.row.drug.min_number)
406
           }
536
           }
407
         }
537
         }
408
-        if(scope.row.prescribing_number == 0){
538
+        if (scope.row.prescribing_number == 0) {
409
           scope.row.prescribing_number = 1
539
           scope.row.prescribing_number = 1
410
         }
540
         }
411
         // if(scope.row.prescribing_number_unit == scope.row.drug.min_unit){
541
         // if(scope.row.prescribing_number_unit == scope.row.drug.min_unit){
419
         //   }
549
         //   }
420
         //   // scope.row.retail_price = scope.row.drug.retail_price * scope.row.prescribing_number
550
         //   // scope.row.retail_price = scope.row.drug.retail_price * scope.row.prescribing_number
421
         // }
551
         // }
422
-        
552
+
423
       },
553
       },
424
-      changePrescribingNumber(scope){
554
+      changePrescribingNumber(scope) {
425
         // if(scope.row.prescribing_number_unit == scope.row.drug.min_unit){
555
         // if(scope.row.prescribing_number_unit == scope.row.drug.min_unit){
426
         //   if(parseInt(scope.row.prescribing_number) > scope.row.drug.total){
556
         //   if(parseInt(scope.row.prescribing_number) > scope.row.drug.total){
427
         //     this.$message.error(scope.row.drug_name + '库存不足')
557
         //     this.$message.error(scope.row.drug_name + '库存不足')
432
         //   }
562
         //   }
433
         // }
563
         // }
434
       },
564
       },
435
-      getSingleDose(scope){
565
+      getSingleDose(scope) {
436
         this.prescription.advices[scope.$index].prescribing_number = scope.row.single_dose * scope.row.day
566
         this.prescription.advices[scope.$index].prescribing_number = scope.row.single_dose * scope.row.day
437
       },
567
       },
438
-      getDay(scope){
568
+      getDay(scope) {
439
         this.prescription.advices[scope.$index].prescribing_number = scope.row.single_dose * scope.row.day
569
         this.prescription.advices[scope.$index].prescribing_number = scope.row.single_dose * scope.row.day
440
       },
570
       },
441
-      getProjectSingleDose(scope){
571
+      getProjectSingleDose(scope) {
442
         this.prescription.project[scope.$index].total = scope.row.single_dose * scope.row.number_days
572
         this.prescription.project[scope.$index].total = scope.row.single_dose * scope.row.number_days
443
-        if(this.prescription.project[scope.$index].total == 0){
573
+        if (this.prescription.project[scope.$index].total == 0) {
444
           this.prescription.project[scope.$index].total = 1
574
           this.prescription.project[scope.$index].total = 1
445
         }
575
         }
446
       },
576
       },
447
-      getProjectDay(scope){
577
+      getProjectDay(scope) {
448
         this.prescription.project[scope.$index].total = scope.row.single_dose * scope.row.number_days
578
         this.prescription.project[scope.$index].total = scope.row.single_dose * scope.row.number_days
449
-        if(this.prescription.project[scope.$index].total == 0){
579
+        if (this.prescription.project[scope.$index].total == 0) {
450
           this.prescription.project[scope.$index].total = 1
580
           this.prescription.project[scope.$index].total = 1
451
         }
581
         }
452
       }
582
       }
453
-    },mounted(){
583
+    }, mounted() {
454
       this.getInitData()
584
       this.getInitData()
455
 
585
 
456
     },
586
     },
457
-    watch:{
587
+    watch: {
458
       // "prescription.advices":{
588
       // "prescription.advices":{
459
       //   handler(newVal,oldVal){
589
       //   handler(newVal,oldVal){
460
       //     newVal.map(item => {
590
       //     newVal.map(item => {
463
       //         item.total = item.single_dose * item.number_days
593
       //         item.total = item.single_dose * item.number_days
464
       //       }
594
       //       }
465
 
595
 
466
-
467
       //     })
596
       //     })
468
       //   },
597
       //   },
469
       //   deep:true
598
       //   deep:true
486
 
615
 
487
 <style lang="scss">
616
 <style lang="scss">
488
     .prescriptionTable {
617
     .prescriptionTable {
489
-    .el-input__inner{
618
+
619
+    .el-input__inner {
490
         padding: 0 5px;
620
         padding: 0 5px;
491
     }
621
     }
492
-    .additionalBox{
622
+
623
+    .additionalBox {
493
         margin-top: 20px;
624
         margin-top: 20px;
494
         display: flex;
625
         display: flex;
495
         flex-wrap: wrap;
626
         flex-wrap: wrap;
496
-    .additionalOne{
497
-        margin-right:20px;
498
-        margin-bottom:10px;
627
+
628
+    .additionalOne {
629
+        margin-right: 20px;
630
+        margin-bottom: 10px;
499
         display: flex;
631
         display: flex;
500
         align-items: center;
632
         align-items: center;
501
-    >span{
633
+
634
+    > span {
502
         white-space: nowrap;
635
         white-space: nowrap;
503
         overflow: hidden;
636
         overflow: hidden;
504
         text-overflow: ellipsis;
637
         text-overflow: ellipsis;
505
-        width:80px;
638
+        width: 80px;
506
         display: inline-block;
639
         display: inline-block;
507
         font-size: 14px;
640
         font-size: 14px;
508
     }
641
     }
642
+
509
     }
643
     }
510
-    .deleteIcon{
511
-        color:red;
512
-        margin-left:5px;
644
+    .deleteIcon {
645
+        color: red;
646
+        margin-left: 5px;
513
     }
647
     }
648
+
514
     }
649
     }
515
     .el-table th .cell, .el-table td .cell {
650
     .el-table th .cell, .el-table td .cell {
516
         padding: 0 2px;
651
         padding: 0 2px;

+ 83 - 9
src/xt_pages/outpatientDoctorStation/doctorDesk.vue View File

862
               let obj = {
862
               let obj = {
863
                 id: month_prescriptions[i].advices[a].drug_id,
863
                 id: month_prescriptions[i].advices[a].drug_id,
864
                 price: month_prescriptions[i].advices[a].price
864
                 price: month_prescriptions[i].advices[a].price
865
-
866
               }
865
               }
867
               drug_ids.push(obj)
866
               drug_ids.push(obj)
868
               drug_month_prescriptions.advices.push(month_prescriptions[i].advices[a])
867
               drug_month_prescriptions.advices.push(month_prescriptions[i].advices[a])
869
             }
868
             }
870
-
871
           } else if (month_prescriptions[i].type == 2) { //项目
869
           } else if (month_prescriptions[i].type == 2) { //项目
872
             for (let a = 0; a < month_prescriptions[i].project.length; a++) {
870
             for (let a = 0; a < month_prescriptions[i].project.length; a++) {
873
               let obj = {
871
               let obj = {
888
             }
886
             }
889
             additions_ids.push(obj)
887
             additions_ids.push(obj)
890
             addition_month_prescriptions.addition.push(month_prescriptions[i].addition[a])
888
             addition_month_prescriptions.addition.push(month_prescriptions[i].addition[a])
891
-
892
           }
889
           }
893
-
894
         }
890
         }
895
 
891
 
896
         const obj = {}
892
         const obj = {}
946
           let count = 0
942
           let count = 0
947
           for (let a = 0; a < project_month_prescriptions.project.length; a++) {
943
           for (let a = 0; a < project_month_prescriptions.project.length; a++) {
948
             if (project_ids[i].price == project_month_prescriptions.project[a].price) {
944
             if (project_ids[i].price == project_month_prescriptions.project[a].price) {
949
-
950
               if (project_month_prescriptions.project[a].type == 2) {
945
               if (project_month_prescriptions.project[a].type == 2) {
951
                 obj['statistical_classification'] = project_month_prescriptions.project[a].project.statistical_classification
946
                 obj['statistical_classification'] = project_month_prescriptions.project[a].project.statistical_classification
952
                 obj['medical_code'] = project_month_prescriptions.project[a].project.medical_code
947
                 obj['medical_code'] = project_month_prescriptions.project[a].project.medical_code
953
                 obj['project_name'] = project_month_prescriptions.project[a].project.project_name
948
                 obj['project_name'] = project_month_prescriptions.project[a].project.project_name
954
                 obj['project'] =  project_month_prescriptions.project[a].project
949
                 obj['project'] =  project_month_prescriptions.project[a].project
955
 
950
 
956
-
957
               } else if (project_month_prescriptions.project[a].type == 3) {
951
               } else if (project_month_prescriptions.project[a].type == 3) {
958
                 obj['statistical_classification'] = ''
952
                 obj['statistical_classification'] = ''
959
                 obj['medical_code'] = project_month_prescriptions.project[a].good_info.medical_insurance_number
953
                 obj['medical_code'] = project_month_prescriptions.project[a].good_info.medical_insurance_number
960
                 obj['project_name'] = project_month_prescriptions.project[a].good_info.good_name
954
                 obj['project_name'] = project_month_prescriptions.project[a].good_info.good_name
961
                 obj['good_info'] =  project_month_prescriptions.project[a].good_info
955
                 obj['good_info'] =  project_month_prescriptions.project[a].good_info
962
-
963
-
964
               }
956
               }
965
 
957
 
966
               // obj['project_name'] = project_month_prescriptions.project[a].project.project_name
958
               // obj['project_name'] = project_month_prescriptions.project[a].project.project_name
967
               // obj['statistical_classification'] = project_month_prescriptions.project[a].project.statistical_classification
959
               // obj['statistical_classification'] = project_month_prescriptions.project[a].project.statistical_classification
968
               obj['single_dose'] = project_month_prescriptions.project[a].single_dose
960
               obj['single_dose'] = project_month_prescriptions.project[a].single_dose
969
               obj['type'] = project_month_prescriptions.project[a].type
961
               obj['type'] = project_month_prescriptions.project[a].type
970
-
971
               obj['delivery_way'] = project_month_prescriptions.project[a].delivery_way
962
               obj['delivery_way'] = project_month_prescriptions.project[a].delivery_way
972
               obj['execution_frequency'] = project_month_prescriptions.project[a].execution_frequency
963
               obj['execution_frequency'] = project_month_prescriptions.project[a].execution_frequency
973
               obj['number_days'] = project_month_prescriptions.project[a].day
964
               obj['number_days'] = project_month_prescriptions.project[a].day
1317
 
1308
 
1318
             return false
1309
             return false
1319
           } else {
1310
           } else {
1311
+            if(response.data.data.sch_prescriptions== null){
1312
+
1313
+              response.data.data.sch_prescriptions = []
1314
+            }
1315
+            for(let i = 0;i < response.data.data.sch_prescriptions.length; i++){
1316
+              if(response.data.data.sch_prescriptions[i].advices == null){
1317
+                response.data.data.sch_prescriptions[i].advices = []
1318
+              }
1319
+              if(response.data.data.sch_prescriptions[i].project == null){
1320
+                response.data.data.sch_prescriptions[i].project = []
1321
+              }
1322
+            }
1323
+
1320
             this.patientid = val.id
1324
             this.patientid = val.id
1321
             this.isloading = false
1325
             this.isloading = false
1322
 
1326
 
1705
                   this.$message.error(response.data.msg)
1709
                   this.$message.error(response.data.msg)
1706
                   return false
1710
                   return false
1707
                 } else {
1711
                 } else {
1712
+                  if(response.data.data.sch_prescriptions== null){
1713
+
1714
+                    response.data.data.sch_prescriptions = []
1715
+                  }
1716
+                  for(let i = 0;i < response.data.data.sch_prescriptions.length; i++){
1717
+                    if(response.data.data.sch_prescriptions[i].advices == null){
1718
+                      response.data.data.sch_prescriptions[i].advices = []
1719
+                    }
1720
+
1721
+                    if(response.data.data.sch_prescriptions[i].project == null){
1722
+                      response.data.data.sch_prescriptions[i].project = []
1723
+                    }
1724
+
1725
+                  }
1708
                   this.prescriptions = []
1726
                   this.prescriptions = []
1709
 
1727
 
1710
                   this.month_prescriptions = []
1728
                   this.month_prescriptions = []
2189
                   this.$message.error(response.data.msg)
2207
                   this.$message.error(response.data.msg)
2190
                   return false
2208
                   return false
2191
                 } else {
2209
                 } else {
2210
+                  if(response.data.data.sch_prescriptions== null){
2211
+
2212
+                    response.data.data.sch_prescriptions = []
2213
+                  }
2214
+                  for(let i = 0;i < response.data.data.sch_prescriptions.length; i++){
2215
+                    if(response.data.data.sch_prescriptions[i].advices == null){
2216
+                      response.data.data.sch_prescriptions[i].advices = []
2217
+                    }
2218
+
2219
+                    if(response.data.data.sch_prescriptions[i].project == null){
2220
+                      response.data.data.sch_prescriptions[i].project = []
2221
+                    }
2222
+
2223
+                  }
2192
                   this.prescriptions = []
2224
                   this.prescriptions = []
2193
 
2225
 
2194
                   this.month_prescriptions = []
2226
                   this.month_prescriptions = []
2652
                 this.$message.error(response.data.msg)
2684
                 this.$message.error(response.data.msg)
2653
                 return false
2685
                 return false
2654
               } else {
2686
               } else {
2687
+                if(response.data.data.sch_prescriptions== null){
2688
+
2689
+                  response.data.data.sch_prescriptions = []
2690
+                }
2691
+                for(let i = 0;i < response.data.data.sch_prescriptions.length; i++){
2692
+                  if(response.data.data.sch_prescriptions[i].advices == null){
2693
+                    response.data.data.sch_prescriptions[i].advices = []
2694
+                  }
2695
+
2696
+                  if(response.data.data.sch_prescriptions[i].project == null){
2697
+                    response.data.data.sch_prescriptions[i].project = []
2698
+                  }
2699
+
2700
+                }
2655
                 this.prescriptions = []
2701
                 this.prescriptions = []
2656
 
2702
 
2657
                 this.month_prescriptions = []
2703
                 this.month_prescriptions = []
3173
                   this.$message.error(response.data.msg)
3219
                   this.$message.error(response.data.msg)
3174
                   return false
3220
                   return false
3175
                 } else {
3221
                 } else {
3222
+                  if(response.data.data.sch_prescriptions== null){
3223
+
3224
+                    response.data.data.sch_prescriptions = []
3225
+                  }
3226
+                  for(let i = 0;i < response.data.data.sch_prescriptions.length; i++){
3227
+                    if(response.data.data.sch_prescriptions[i].advices == null){
3228
+                      response.data.data.sch_prescriptions[i].advices = []
3229
+                    }
3230
+
3231
+                    if(response.data.data.sch_prescriptions[i].project == null){
3232
+                      response.data.data.sch_prescriptions[i].project = []
3233
+                    }
3234
+
3235
+                  }
3176
                   for (let i = 0; i < this.all_data.length; i++) {
3236
                   for (let i = 0; i < this.all_data.length; i++) {
3177
                     if (this.all_data[i].id == val.id) {
3237
                     if (this.all_data[i].id == val.id) {
3178
                       this.oldCurrentRow = this.all_data[i]
3238
                       this.oldCurrentRow = this.all_data[i]
3731
                   this.$message.error(response.data.msg)
3791
                   this.$message.error(response.data.msg)
3732
                   return false
3792
                   return false
3733
                 } else {
3793
                 } else {
3794
+                  if(response.data.data.sch_prescriptions== null){
3795
+
3796
+                    response.data.data.sch_prescriptions = []
3797
+                  }
3798
+                  for(let i = 0;i < response.data.data.sch_prescriptions.length; i++){
3799
+                    if(response.data.data.sch_prescriptions[i].advices == null){
3800
+                      response.data.data.sch_prescriptions[i].advices = []
3801
+                    }
3802
+
3803
+                    if(response.data.data.sch_prescriptions[i].project == null){
3804
+                      response.data.data.sch_prescriptions[i].project = []
3805
+                    }
3806
+
3807
+                  }
3734
                   this.prescriptions = []
3808
                   this.prescriptions = []
3735
 
3809
 
3736
                   this.month_prescriptions = []
3810
                   this.month_prescriptions = []

+ 17 - 4
src/xt_pages/outpatientDoctorStation/prescriptionTemplate.vue View File

92
         data: [],
92
         data: [],
93
         all_data:[],
93
         all_data:[],
94
         page: 1,
94
         page: 1,
95
-        limit: 10,
95
+        limit: 20,
96
         patient_id: 0,
96
         patient_id: 0,
97
         total:0,
97
         total:0,
98
-        patient_name:''
98
+        patient_name:'',
99
+        mode_str:"",
99
       }
100
       }
100
     },
101
     },
101
     methods: {
102
     methods: {
133
         })
134
         })
134
       },
135
       },
135
       jumpDetail(row) {
136
       jumpDetail(row) {
136
-        this.$router.push('/outpatientDoctorStation/prescriptionTemplatedetail?id=' + row.id + '&patient_id=' + this.patient_id + '&patient_name=' + this.patient_name)
137
+        this.$router.push('/outpatientDoctorStation/prescriptionTemplatedetail?id=' + row.id + '&patient_id=' + this.patient_id + '&patient_name=' + this.patient_name +"&modes="+this.mode_str)
137
       },
138
       },
138
       getMode(id) {
139
       getMode(id) {
139
         let name = ''
140
         let name = ''
162
         getPrescriptionTemplateList(params).then(response => {
163
         getPrescriptionTemplateList(params).then(response => {
163
           if (response.data.state == 1) {
164
           if (response.data.state == 1) {
164
             this.templates = response.data.data.list
165
             this.templates = response.data.data.list
166
+            let modes = []
167
+            for(let i =0; i< this.templates.length; i++){
168
+              modes.push(this.templates[i].mode)
169
+            }
170
+            this.mode_str = modes.join(",")
171
+
165
             this.total = response.data.data.total
172
             this.total = response.data.data.total
166
           }
173
           }
167
         })
174
         })
180
         getPrescriptionTemplateList(params).then(response => {
187
         getPrescriptionTemplateList(params).then(response => {
181
           if (response.data.state == 1) {
188
           if (response.data.state == 1) {
182
             this.templates = response.data.data.list
189
             this.templates = response.data.data.list
190
+            let modes = []
191
+            for(let i =0; i< this.templates.length; i++){
192
+              modes.push(this.templates[i].mode)
193
+            }
194
+            this.mode_str = modes.join(",")
195
+
183
             this.total = response.data.data.total
196
             this.total = response.data.data.total
184
           }
197
           }
185
         })
198
         })
210
           this.$message.error('请选择病人')
223
           this.$message.error('请选择病人')
211
           return
224
           return
212
         }
225
         }
213
-        this.$router.push('/outpatientDoctorStation/prescriptionTemplatedetail?id=' + 0 + '&patient_id=' + this.patient_id+ '&patient_name=' + this.patient_name)
226
+        this.$router.push('/outpatientDoctorStation/prescriptionTemplatedetail?id=' + 0 + '&patient_id=' + this.patient_id+ '&patient_name=' + this.patient_name+"&modes="+this.mode_str)
214
 
227
 
215
       }
228
       }
216
     },
229
     },

+ 125 - 77
src/xt_pages/outpatientDoctorStation/prescriptionTemplatedetail.vue View File

16
                         </el-form-item>
16
                         </el-form-item>
17
 
17
 
18
                         <el-form-item label="透析模式: " prop="mode_id" label-position="right">
18
                         <el-form-item label="透析模式: " prop="mode_id" label-position="right">
19
-                            <el-select v-model="tempForm.mode_id" style="width:100%;" placeholder="请选择">
19
+                            <el-select v-model="tempForm.mode_id" style="width:100%;" placeholder="请选择"
20
+                                       :disabled="this.$route.query.id > 0 ?true:false" v-if="this.$route.query.id == 0">
20
                                 <el-option
21
                                 <el-option
21
                                         v-for="item in modeOptions"
22
                                         v-for="item in modeOptions"
22
                                         :key="item.id"
23
                                         :key="item.id"
24
                                         :value="item.id"
25
                                         :value="item.id"
25
                                 ></el-option>
26
                                 ></el-option>
26
                             </el-select>
27
                             </el-select>
28
+                            <el-select v-model="tempForm.mode_id" style="width:100%;" placeholder="请选择"
29
+                                       :disabled="this.$route.query.id > 0 ?true:false" v-if="this.$route.query.id > 0">
30
+                                <el-option
31
+                                        v-for="item in modeOptionsTwo"
32
+                                        :key="item.id"
33
+                                        :label="item.name"
34
+                                        :value="item.id"
35
+                                ></el-option>
36
+                            </el-select>
27
                         </el-form-item>
37
                         </el-form-item>
28
                     </el-form>
38
                     </el-form>
29
                     <div class="tabsBox">
39
                     <div class="tabsBox">
239
   import { uParseTime } from '@/utils/tools'
249
   import { uParseTime } from '@/utils/tools'
240
   import PrescriptionTemplateTable from './components/prescriptionTemplateTable'
250
   import PrescriptionTemplateTable from './components/prescriptionTemplateTable'
241
   import BreadCrumb from '@/xt_pages/components/bread-crumb'
251
   import BreadCrumb from '@/xt_pages/components/bread-crumb'
252
+
242
   const moment = require('moment')
253
   const moment = require('moment')
243
   export default {
254
   export default {
244
     props: {
255
     props: {
281
           { value: 11, label: '普通门诊' },
292
           { value: 11, label: '普通门诊' },
282
           // { value: 12, label: '门诊挂号' },
293
           // { value: 12, label: '门诊挂号' },
283
           // { value: 13, label: '急诊' },
294
           // { value: 13, label: '急诊' },
284
-          { value: 14, label: '门诊特殊病' },
295
+          { value: 14, label: '门诊特殊病' }
285
           // { value: 15, label: '门诊统筹' },
296
           // { value: 15, label: '门诊统筹' },
286
           // { value: 16, label: '门诊慢性病' },
297
           // { value: 16, label: '门诊慢性病' },
287
           // { value: 21, label: '普通住院' }
298
           // { value: 21, label: '普通住院' }
296
           name: '',
307
           name: '',
297
           mode_id: ''
308
           mode_id: ''
298
         },
309
         },
299
-        modeOptions: this.$store.getters.treatment_mode,
310
+        modeOptions:{},
311
+        modeOptionsTwo: {},
312
+
300
         start_time: moment(new Date()).subtract(30, 'days').format('YYYY-MM-DD'),
313
         start_time: moment(new Date()).subtract(30, 'days').format('YYYY-MM-DD'),
301
         end_time: moment(new Date()).add('year', 0).format('YYYY-MM-DD'),
314
         end_time: moment(new Date()).add('year', 0).format('YYYY-MM-DD'),
302
         isLastOrNextVisible: false,
315
         isLastOrNextVisible: false,
400
           }
413
           }
401
         }
414
         }
402
 
415
 
403
-
404
         for (let i = 0; i < this.prescriptions.length; i++) {
416
         for (let i = 0; i < this.prescriptions.length; i++) {
405
-          for(let b = 0; b < this.prescriptions[i].advices.length; b++){
417
+          for (let b = 0; b < this.prescriptions[i].advices.length; b++) {
406
             if (this.prescriptions[i].med_type == 14 && this.prescriptions[i].advices[b].drug.is_special_diseases != 1) {
418
             if (this.prescriptions[i].med_type == 14 && this.prescriptions[i].advices[b].drug.is_special_diseases != 1) {
407
-              this.$message.error("处方" + (i+1).toString() +"属于特病类型处方,开非特病类型的药")
419
+              this.$message.error('处方' + (i + 1).toString() + '属于特病类型处方,开非特病类型的药')
408
               return
420
               return
409
             }
421
             }
410
 
422
 
411
           }
423
           }
412
 
424
 
413
-          for(let c = 0; c < this.prescriptions[i].project.length; c++){
414
-            if (this.prescriptions[i].med_type == 14 && this.prescriptions[i].project[c].type == 2  && this.prescriptions[i].project[c].project.disease_directory != 1) {
415
-              this.$message.error("处方" + (i+1).toString() +"属于特病类型处方,请开特病类型的项目")
425
+          for (let c = 0; c < this.prescriptions[i].project.length; c++) {
426
+            if (this.prescriptions[i].med_type == 14 && this.prescriptions[i].project[c].type == 2 && this.prescriptions[i].project[c].project.disease_directory != 1) {
427
+              this.$message.error('处方' + (i + 1).toString() + '属于特病类型处方,请开特病类型的项目')
416
               return
428
               return
417
             }
429
             }
418
 
430
 
419
-            if (this.prescriptions[i].med_type == 14 && this.prescriptions[i].project[c].type == 3  && this.prescriptions[i].project[c].good_info.is_special_diseases != 1) {
420
-              this.$message.error("处方" + (i+1).toString() +"属于特病类型处方,请开特病类型的耗材")
421
-              return 
431
+            if (this.prescriptions[i].med_type == 14 && this.prescriptions[i].project[c].type == 3 && this.prescriptions[i].project[c].good_info.is_special_diseases != 1) {
432
+              this.$message.error('处方' + (i + 1).toString() + '属于特病类型处方,请开特病类型的耗材')
433
+              return
422
             }
434
             }
423
           }
435
           }
424
         }
436
         }
425
 
437
 
426
-
427
-
428
-
429
-
430
-
431
         let params = {
438
         let params = {
432
           name: this.tempForm.name,
439
           name: this.tempForm.name,
433
           mode_id: this.tempForm.mode_id,
440
           mode_id: this.tempForm.mode_id,
452
             this.prescriptions[i].advices[b].prescribing_number = this.prescriptions[i].advices[b].prescribing_number.toString()
459
             this.prescriptions[i].advices[b].prescribing_number = this.prescriptions[i].advices[b].prescribing_number.toString()
453
             this.prescriptions[i].advices[b].retail_price = this.prescriptions[i].advices[b].retail_price.toString()
460
             this.prescriptions[i].advices[b].retail_price = this.prescriptions[i].advices[b].retail_price.toString()
454
             this.prescriptions[i].advices[b].day = parseInt(this.prescriptions[i].advices[b].day)
461
             this.prescriptions[i].advices[b].day = parseInt(this.prescriptions[i].advices[b].day)
462
+            this.prescriptions[i].advices[b].groupno = parseInt(this.prescriptions[i].advices[b].groupno)
463
+
464
+            this.prescriptions[i].advices[b].day_count = parseInt(this.prescriptions[i].advices[b].day_count)
465
+            this.prescriptions[i].advices[b].frequency_type = parseInt(this.prescriptions[i].advices[b].frequency_type)
466
+            this.prescriptions[i].advices[b].week_day = this.prescriptions[i].advices[b].week_day.toString()
455
 
467
 
456
           }
468
           }
457
 
469
 
459
             this.prescriptions[i].project[b].price = this.prescriptions[i].project[b].price.toString()
471
             this.prescriptions[i].project[b].price = this.prescriptions[i].project[b].price.toString()
460
             this.prescriptions[i].project[b].total = this.prescriptions[i].project[b].total.toString()
472
             this.prescriptions[i].project[b].total = this.prescriptions[i].project[b].total.toString()
461
             this.prescriptions[i].project[b].delivery_way = this.prescriptions[i].project[b].delivery_way.toString()
473
             this.prescriptions[i].project[b].delivery_way = this.prescriptions[i].project[b].delivery_way.toString()
474
+
475
+            this.prescriptions[i].project[b].day_count = parseInt(this.prescriptions[i].project[b].day_count)
476
+            this.prescriptions[i].project[b].frequency_type = parseInt(this.prescriptions[i].project[b].frequency_type)
477
+            this.prescriptions[i].project[b].week_day = this.prescriptions[i].project[b].week_day.toString()
478
+
462
           }
479
           }
463
         }
480
         }
464
         let data = {
481
         let data = {
467
         createdTemplate(params, data).then(response => {
484
         createdTemplate(params, data).then(response => {
468
           if (response.data.state == 1) {
485
           if (response.data.state == 1) {
469
             this.$message.success('保存成功')
486
             this.$message.success('保存成功')
487
+            for (const mkey in this.modeOptions) {
488
+              if (mkey == this.tempForm.mode_id) {
489
+                delete this.modeOptions[mkey]
490
+              }
491
+            }
470
           } else {
492
           } else {
471
             this.$message.error(response.data.msg)
493
             this.$message.error(response.data.msg)
472
           }
494
           }
931
                 this.prescriptions[i].advices[b].retail_price = this.prescriptions[i].advices[b].retail_price.toString()
953
                 this.prescriptions[i].advices[b].retail_price = this.prescriptions[i].advices[b].retail_price.toString()
932
                 this.prescriptions[i].advices[b].day = parseInt(this.prescriptions[i].advices[b].day)
954
                 this.prescriptions[i].advices[b].day = parseInt(this.prescriptions[i].advices[b].day)
933
 
955
 
956
+                this.prescriptions[i].advices[b].day_count = parseInt(this.prescriptions[i].advices[b].day_count)
957
+                this.prescriptions[i].advices[b].frequency_type = parseInt(this.prescriptions[i].advices[b].frequency_type)
958
+                this.prescriptions[i].advices[b].week_day = this.prescriptions[i].advices[b].week_day.toString()
959
+
934
               }
960
               }
935
 
961
 
936
               for (let b = 0; b < this.prescriptions[i].project.length; b++) {
962
               for (let b = 0; b < this.prescriptions[i].project.length; b++) {
938
                 this.prescriptions[i].project[b].total = this.prescriptions[i].project[b].total.toString()
964
                 this.prescriptions[i].project[b].total = this.prescriptions[i].project[b].total.toString()
939
                 this.prescriptions[i].project[b].delivery_way = this.prescriptions[i].project[b].delivery_way.toString()
965
                 this.prescriptions[i].project[b].delivery_way = this.prescriptions[i].project[b].delivery_way.toString()
940
 
966
 
967
+                this.prescriptions[i].project[b].day_count = parseInt(this.prescriptions[i].project[b].day_count)
968
+                this.prescriptions[i].project[b].frequency_type = parseInt(this.prescriptions[i].project[b].frequency_type)
969
+                this.prescriptions[i].project[b].week_day = this.prescriptions[i].project[b].week_day.toString()
970
+
941
               }
971
               }
942
 
972
 
943
               for (let b = 0; b < this.prescriptions[i].addition.length; b++) {
973
               for (let b = 0; b < this.prescriptions[i].addition.length; b++) {
1087
 
1117
 
1088
         }
1118
         }
1089
 
1119
 
1090
-
1091
-
1092
-          obj.med_type = 14
1093
-
1094
-
1120
+        obj.med_type = 14
1095
 
1121
 
1096
         this.prescriptions.push(obj)
1122
         this.prescriptions.push(obj)
1097
 
1123
 
1305
         //   this.$refs.multipleTable.clearSelection()
1331
         //   this.$refs.multipleTable.clearSelection()
1306
         //   return
1332
         //   return
1307
         // }
1333
         // }
1308
-      //  if (this.curPrescriptions.advices.length > 0 && this.curPrescriptions.project.length == 0) {
1309
-      //     if (this.$store.getters.xt_user.org_id == 10138) {
1310
-      //       for (let i = 0; i < this.curDrugs.length; i++) {
1311
-      //         if (this.curPrescriptions.med_type == 14 && this.curDrugs[i].is_special_diseases != 1) {
1312
-      //           this.$message.error('该处方属于特病类型处方,开非特病类型的药')
1313
-      //           return
1314
-      //         }
1315
-
1316
-      //       }
1317
-      //     }
1318
-      //   }
1319
-
1320
-      //   if (this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length == 0) {
1321
-      //     if (this.$store.getters.xt_user.org_id == 10138) {
1322
-      //       for (let i = 0; i < this.curDrugs.length; i++) {
1323
-      //         if (this.curPrescriptions.med_type == 14 && this.curDrugs[i].is_special_diseases != 1) {
1324
-      //           this.$message.error('该处方属于特病类型处方,开非特病类型的药')
1325
-      //           return
1326
-      //         }
1327
-
1328
-      //       }
1329
-      //     }
1330
-      //   }
1331
-      if (this.curDrugs.length > 0) {
1334
+        //  if (this.curPrescriptions.advices.length > 0 && this.curPrescriptions.project.length == 0) {
1335
+        //     if (this.$store.getters.xt_user.org_id == 10138) {
1336
+        //       for (let i = 0; i < this.curDrugs.length; i++) {
1337
+        //         if (this.curPrescriptions.med_type == 14 && this.curDrugs[i].is_special_diseases != 1) {
1338
+        //           this.$message.error('该处方属于特病类型处方,开非特病类型的药')
1339
+        //           return
1340
+        //         }
1341
+
1342
+        //       }
1343
+        //     }
1344
+        //   }
1345
+
1346
+        //   if (this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length == 0) {
1347
+        //     if (this.$store.getters.xt_user.org_id == 10138) {
1348
+        //       for (let i = 0; i < this.curDrugs.length; i++) {
1349
+        //         if (this.curPrescriptions.med_type == 14 && this.curDrugs[i].is_special_diseases != 1) {
1350
+        //           this.$message.error('该处方属于特病类型处方,开非特病类型的药')
1351
+        //           return
1352
+        //         }
1353
+
1354
+        //       }
1355
+        //     }
1356
+        //   }
1357
+        if (this.curDrugs.length > 0) {
1332
           for (let i = 0; i < this.curDrugs.length; i++) {
1358
           for (let i = 0; i < this.curDrugs.length; i++) {
1333
             if (this.curPrescriptions.med_type == 14 && this.curDrugs[i].is_special_diseases != 1) {
1359
             if (this.curPrescriptions.med_type == 14 && this.curDrugs[i].is_special_diseases != 1) {
1334
               this.$message.error('该处方属于特病类型处方,开非特病类型的药')
1360
               this.$message.error('该处方属于特病类型处方,开非特病类型的药')
1351
           let arr = this.teamList
1377
           let arr = this.teamList
1352
           let newArr = []
1378
           let newArr = []
1353
           arr.map(item => {
1379
           arr.map(item => {
1354
-            if(this.curPrescriptions.med_type != 14){
1380
+            if (this.curPrescriptions.med_type != 14) {
1355
               newArr.push(item)
1381
               newArr.push(item)
1356
             }
1382
             }
1357
-            if(this.curPrescriptions.med_type == 14 && item.is_special_diseases == 1){
1383
+            if (this.curPrescriptions.med_type == 14 && item.is_special_diseases == 1) {
1358
               newArr.push(item)
1384
               newArr.push(item)
1359
             }
1385
             }
1360
           })
1386
           })
1361
           this.teamList = newArr
1387
           this.teamList = newArr
1362
         }
1388
         }
1363
 
1389
 
1364
-
1365
-
1366
         if (this.curDrugs.length == 0) {
1390
         if (this.curDrugs.length == 0) {
1367
           for (let i = 0; i < this.curDrugs.length; i++) {
1391
           for (let i = 0; i < this.curDrugs.length; i++) {
1368
             if (this.curPrescriptions.med_type == 14 && this.curDrugs[i].is_special_diseases != 1) {
1392
             if (this.curPrescriptions.med_type == 14 && this.curDrugs[i].is_special_diseases != 1) {
1399
           }
1423
           }
1400
         }
1424
         }
1401
 
1425
 
1402
-
1403
         for (let i = 0; i < this.curDrugs.length; i++) {
1426
         for (let i = 0; i < this.curDrugs.length; i++) {
1404
           for (let a = 0; a < this.curPrescriptions.advices.length; a++) {
1427
           for (let a = 0; a < this.curPrescriptions.advices.length; a++) {
1405
             if (this.curDrugs[i].id == this.curPrescriptions.advices[a].id) {
1428
             if (this.curDrugs[i].id == this.curPrescriptions.advices[a].id) {
1461
               this.curStatus = 1
1484
               this.curStatus = 1
1462
             }
1485
             }
1463
 
1486
 
1487
+            let index = 0
1488
+
1489
+            if (this.prescriptions[i].advices.length > 0) {
1490
+              index = this.prescriptions[i].advices.length
1491
+            }
1492
+
1464
             if (temp.length > 0) {
1493
             if (temp.length > 0) {
1465
               for (let b = 0; b < temp.length; b++) {
1494
               for (let b = 0; b < temp.length; b++) {
1495
+                let temp_index = b + 1
1466
                 let obj = {
1496
                 let obj = {
1467
                   advice_id: 0,
1497
                   advice_id: 0,
1468
                   id: temp[b].id,
1498
                   id: temp[b].id,
1477
                   single_dose_unit: temp[b].dose_unit,
1507
                   single_dose_unit: temp[b].dose_unit,
1478
                   prescribing_number_unit: temp[b].prescribing_number_unit,
1508
                   prescribing_number_unit: temp[b].prescribing_number_unit,
1479
                   medical_insurance_number: temp[b].medical_insurance_number,
1509
                   medical_insurance_number: temp[b].medical_insurance_number,
1480
-                  drug: temp[b]
1510
+                  drug: temp[b],
1511
+                  groupno: index + temp_index,
1512
+                  frequency_type: 1,
1513
+                  day_count: 0,
1514
+                  week_day: ''
1481
                 }
1515
                 }
1482
 
1516
 
1483
                 if (obj.prescribing_number == 0 || obj.prescribing_number.length == 0) {
1517
                 if (obj.prescribing_number == 0 || obj.prescribing_number.length == 0) {
1488
               this.curStatus = 1
1522
               this.curStatus = 1
1489
             }
1523
             }
1490
 
1524
 
1491
-            // if(this.activeName == 2){
1492
-            //
1493
-            //    for(let i = 0; i<temp2.length;i++){
1494
-            //     for(let j=0;j<this.hisList.length;j++){
1495
-            //         if(temp2[i].id == this.hisList[j].project_id){
1496
-            //            temp2[i].total =  this.hisList[j].number
1497
-            //         }
1498
-            //     }
1499
-            //    }
1500
-            //  }
1501
-
1502
             if (temp2.length > 0) {
1525
             if (temp2.length > 0) {
1503
               for (let b = 0; b < temp2.length; b++) {
1526
               for (let b = 0; b < temp2.length; b++) {
1504
                 let obj = {
1527
                 let obj = {
1516
                   medical_code: temp2[b].medical_code,
1539
                   medical_code: temp2[b].medical_code,
1517
                   unit: temp2[b].unit,
1540
                   unit: temp2[b].unit,
1518
                   type: temp2[b].type,
1541
                   type: temp2[b].type,
1542
+                  frequency_type: 1,
1543
+                  day_count: 0,
1544
+                  week_day: ''
1519
                 }
1545
                 }
1520
-                if (temp2[b].type == 2){
1546
+                if (temp2[b].type == 2) {
1521
                   obj['project'] = temp2[b].project
1547
                   obj['project'] = temp2[b].project
1522
 
1548
 
1523
-                }else if(temp2[b].type == 3){
1549
+                } else if (temp2[b].type == 3) {
1524
 
1550
 
1525
                   obj['good_info'] = temp2[b].good_info
1551
                   obj['good_info'] = temp2[b].good_info
1526
 
1552
 
1591
                     prescribing_number_unit: prescription.advices[b].prescribing_number_unit,
1617
                     prescribing_number_unit: prescription.advices[b].prescribing_number_unit,
1592
                     medical_insurance_number: prescription.advices[b].med_list_codg,
1618
                     medical_insurance_number: prescription.advices[b].med_list_codg,
1593
                     id: prescription.advices[b].drug_id,
1619
                     id: prescription.advices[b].drug_id,
1594
-                    drug: prescription.advices[b].drug
1620
+                    drug: prescription.advices[b].drug,
1621
+                    groupno: prescription.advices[b].groupno,
1622
+                    frequency_type: prescription.advices[b].frequency_type,
1623
+                    day_count: prescription.advices[b].day_count,
1624
+                    week_day: prescription.advices[b].week_day
1625
+
1595
                   }
1626
                   }
1596
                   tempAdvice.push(obj)
1627
                   tempAdvice.push(obj)
1597
                 }
1628
                 }
1613
                     medical_code: prescription.project[b].project.medical_code,
1644
                     medical_code: prescription.project[b].project.medical_code,
1614
                     unit: prescription.project[b].project.unit,
1645
                     unit: prescription.project[b].project.unit,
1615
                     type: prescription.project[b].type,
1646
                     type: prescription.project[b].type,
1647
+                    frequency_type: prescription.project[b].frequency_type,
1648
+                    day_count: prescription.project[b].day_count,
1649
+                    week_day: prescription.project[b].week_day
1650
+
1616
                   }
1651
                   }
1617
 
1652
 
1618
                   if (prescription.project[b].type == 2) {
1653
                   if (prescription.project[b].type == 2) {
1621
                     obj['project_name'] = prescription.project[b].project.project_name
1656
                     obj['project_name'] = prescription.project[b].project.project_name
1622
                     obj['project'] = prescription.project[b].project
1657
                     obj['project'] = prescription.project[b].project
1623
 
1658
 
1624
-
1625
-
1626
-
1627
                   } else if (prescription.project[b].type == 3) {
1659
                   } else if (prescription.project[b].type == 3) {
1628
                     obj['statistical_classification'] = ''
1660
                     obj['statistical_classification'] = ''
1629
                     obj['medical_code'] = prescription.project[b].good_info.medical_insurance_number
1661
                     obj['medical_code'] = prescription.project[b].good_info.medical_insurance_number
1671
                 med_type: ''
1703
                 med_type: ''
1672
               }
1704
               }
1673
 
1705
 
1674
-
1675
-                obj.med_type = 14
1676
-
1677
-
1706
+              obj.med_type = 14
1678
 
1707
 
1679
               this.prescriptions.push(obj)
1708
               this.prescriptions.push(obj)
1680
               this.curPrescriptions = this.prescriptions[0]
1709
               this.curPrescriptions = this.prescriptions[0]
1704
                 unit: project[i].unit,
1733
                 unit: project[i].unit,
1705
                 type: 2,
1734
                 type: 2,
1706
                 is_special_diseases: project[i].disease_directory,
1735
                 is_special_diseases: project[i].disease_directory,
1707
-                project: project[i],
1736
+                project: project[i]
1708
               }
1737
               }
1709
 
1738
 
1710
               this.tabProject.push(obj)
1739
               this.tabProject.push(obj)
1726
                 unit: this.getGoodUnit(good_info[i].good_unit),
1755
                 unit: this.getGoodUnit(good_info[i].good_unit),
1727
                 type: 3,
1756
                 type: 3,
1728
                 is_special_diseases: good_info[i].is_special_diseases,
1757
                 is_special_diseases: good_info[i].is_special_diseases,
1729
-                good_info: good_info[i],
1758
+                good_info: good_info[i]
1730
               }
1759
               }
1731
               this.tabProject.push(obj)
1760
               this.tabProject.push(obj)
1732
             }
1761
             }
1820
                   unit: project[i].project.unit,
1849
                   unit: project[i].project.unit,
1821
                   type: project[i].type,
1850
                   type: project[i].type,
1822
                   is_special_diseases: project[i].project.disease_directory,
1851
                   is_special_diseases: project[i].project.disease_directory,
1823
-                  project:project[i].project,
1852
+                  project: project[i].project
1824
                 }
1853
                 }
1825
                 if (obj.total == 0 || obj.total == undefined) {
1854
                 if (obj.total == 0 || obj.total == undefined) {
1826
                   obj.total = 1
1855
                   obj.total = 1
1843
                   unit: project[i].good_info.unit,
1872
                   unit: project[i].good_info.unit,
1844
                   type: project[i].type,
1873
                   type: project[i].type,
1845
                   is_special_diseases: project[i].good_info.is_special_diseases,
1874
                   is_special_diseases: project[i].good_info.is_special_diseases,
1846
-                  good_info:project[i].good_info,
1875
+                  good_info: project[i].good_info
1847
                 }
1876
                 }
1848
                 if (obj.total == 0 || obj.total == undefined) {
1877
                 if (obj.total == 0 || obj.total == undefined) {
1849
                   obj.total = 1
1878
                   obj.total = 1
1889
         this.$refs.tabProjectTeam.clearSelection()
1918
         this.$refs.tabProjectTeam.clearSelection()
1890
       }
1919
       }
1891
     }, created() {
1920
     }, created() {
1921
+      for(let key in this.$store.getters.treatment_mode){
1922
+        this.modeOptions[key] = this.$store.getters.treatment_mode[key]
1923
+        this.modeOptionsTwo[key]=  this.$store.getters.treatment_mode[key]
1924
+
1925
+      }
1926
+      var modes = this.$route.query.modes.split(',')
1927
+      console.log('~~~~~~~~~~')
1928
+
1929
+      console.log(modes)
1930
+
1931
+      for (const mkey in this.modeOptions) {
1932
+        console.log(mkey)
1933
+        for (let b = 0; b < modes.length; b++) {
1934
+          if (mkey == parseInt(modes[b])) {
1935
+            delete this.modeOptions[mkey]
1936
+          }
1937
+        }
1938
+      }
1939
+
1892
       this.getPrescriptionTemplateInfo()
1940
       this.getPrescriptionTemplateInfo()
1893
       this.getInitData()
1941
       this.getInitData()
1894
       //获取所有项目
1942
       //获取所有项目

+ 25 - 7
src/xt_pages/outpatientDoctorStation/recordTemplate/printOne.vue View File

8
                 <span v-if="patient.gender == 1">男</span>
8
                 <span v-if="patient.gender == 1">男</span>
9
                 <span v-if="patient.gender == 2">女</span>
9
                 <span v-if="patient.gender == 2">女</span>
10
             </div>
10
             </div>
11
-            <div>年龄:{{patient.age?patient.age:''}}岁</div>
11
+            <div>年龄:{{getAge(patient)?getAge(patient):""}}岁</div>
12
         </div>
12
         </div>
13
         <div class="infoTitle">
13
         <div class="infoTitle">
14
             <div>婚姻状况:
14
             <div>婚姻状况:
105
 </div>
105
 </div>
106
 </template>
106
 </template>
107
 <script>
107
 <script>
108
+  import { jsGetAge, uParseTime } from '@/utils/tools'
108
 
109
 
109
 import { getDataConfig } from "@/utils/data";
110
 import { getDataConfig } from "@/utils/data";
110
 import { getAllDoctorList,getPatientCaseHistory } from "@/api/project/project"
111
 import { getAllDoctorList,getPatientCaseHistory } from "@/api/project/project"
122
             orgname:'',
123
             orgname:'',
123
             history:{},
124
             history:{},
124
             printDate:''
125
             printDate:''
125
-        }                   
126
+        }
126
     },
127
     },
127
     methods:{
128
     methods:{
129
+      getAge(patient){
130
+        var thisLen = patient.id_card_no.length
131
+        var birth = ''
132
+        if (thisLen == 15) {
133
+          birth = '19' + patient.id_card_no.substr(6, 6)
134
+        } else {
135
+          birth = patient.id_card_no.substr(6, 8)
136
+        }
137
+        var births =
138
+          birth.substr(0, 4) +
139
+          '-' +
140
+          birth.substr(4, 2) +
141
+          '-' +
142
+          birth.substr(6, 2)
143
+        return jsGetAge(births, '-')
144
+
145
+      },
128
       show(val){
146
       show(val){
129
-       
147
+
130
         this.patientid = val
148
         this.patientid = val
131
         this.getAllDoctorList()
149
         this.getAllDoctorList()
132
         this.getPatientCaseHistory()
150
         this.getPatientCaseHistory()
150
                console.log("department",department)
168
                console.log("department",department)
151
                this.departmentList = department
169
                this.departmentList = department
152
              }
170
              }
153
-           })   
171
+           })
154
        },
172
        },
155
       getDoctor(id){
173
       getDoctor(id){
156
         var name = ""
174
         var name = ""
182
       })
200
       })
183
     },
201
     },
184
     getDeparment(id){
202
     getDeparment(id){
185
-  
203
+
186
      var name = ''
204
      var name = ''
187
      for(let i=0;i<this.departmentList.length;i++){
205
      for(let i=0;i<this.departmentList.length;i++){
188
          if(id == this.departmentList[i].id){
206
          if(id == this.departmentList[i].id){
191
       }
209
       }
192
       return name
210
       return name
193
     },
211
     },
194
-  
212
+
195
 
213
 
196
     },
214
     },
197
     created(){
215
     created(){
218
 <style lang="scss" scoped>
236
 <style lang="scss" scoped>
219
 .prescription-print{
237
 .prescription-print{
220
     -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 60px rgba(0, 0, 0, 0.06) inset;
238
     -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 60px rgba(0, 0, 0, 0.06) inset;
221
-    -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 40px rgba(0, 0, 0, 0.06) inset; 
239
+    -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 40px rgba(0, 0, 0, 0.06) inset;
222
     box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 40px rgba(0, 0, 0, 0.06) inset;
240
     box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 40px rgba(0, 0, 0, 0.06) inset;
223
     margin-bottom: 20px;
241
     margin-bottom: 20px;
224
     padding:20px 10px;
242
     padding:20px 10px;

+ 31 - 14
src/xt_pages/outpatientDoctorStation/template/printFour.vue View File

9
                 <span v-if="item.patient.gender == 1">男</span>
9
                 <span v-if="item.patient.gender == 1">男</span>
10
                 <span v-if="item.patient.gender == 2">女</span>
10
                 <span v-if="item.patient.gender == 2">女</span>
11
               </p>
11
               </p>
12
-              <p>年龄:{{item.patient.age?item.patient.age:""}}岁</p>
12
+              <p>年龄:{{getAge(item.patient)?getAge(item.patient):""}}岁</p>
13
           </div>
13
           </div>
14
           <div class="infoMain">
14
           <div class="infoMain">
15
               <div style="margin-bottom: 10px;">门诊号:{{hisPatient.number?hisPatient.number:""}}</div>
15
               <div style="margin-bottom: 10px;">门诊号:{{hisPatient.number?hisPatient.number:""}}</div>
29
               <div class="drugsBox" v-for="(it,i) in item.additionalcharge" :key="i">
29
               <div class="drugsBox" v-for="(it,i) in item.additionalcharge" :key="i">
30
                 <div class="drugsOne">{{it.item_name?it.item_name:""}}:&nbsp;{{it.price}}元/{{it.count}}次</div>
30
                 <div class="drugsOne">{{it.item_name?it.item_name:""}}:&nbsp;{{it.price}}元/{{it.count}}次</div>
31
                </div>
31
                </div>
32
-               
32
+
33
               <div class="drugsBox" v-for="(it,index) in item.project" :key="index">
33
               <div class="drugsBox" v-for="(it,index) in item.project" :key="index">
34
                   <div class="drugsOne"><span style="font-weight:bold;">{{ index+1 + '.' }}</span>{{getProjectName(it.project_id)?getProjectName(it.project_id):""}}&nbsp;&nbsp;<span>用法:{{it.single_dose}}{{it.single_dose_unit}}</span>&nbsp;&nbsp;<span>{{it.delivery_way}}</span>&nbsp;&nbsp;<span>{{it.advice_desc}}</span></div>
34
                   <div class="drugsOne"><span style="font-weight:bold;">{{ index+1 + '.' }}</span>{{getProjectName(it.project_id)?getProjectName(it.project_id):""}}&nbsp;&nbsp;<span>用法:{{it.single_dose}}{{it.single_dose_unit}}</span>&nbsp;&nbsp;<span>{{it.delivery_way}}</span>&nbsp;&nbsp;<span>{{it.advice_desc}}</span></div>
35
                   <div style="margin-left:100px;"><span>{{it.single_dose}}{{it.single_dose_unit}}&nbsp;×&nbsp; {{it.count}}{{unit}}</span></div>
35
                   <div style="margin-left:100px;"><span>{{it.single_dose}}{{it.single_dose_unit}}&nbsp;×&nbsp; {{it.count}}{{unit}}</span></div>
60
           <div style="page-break-after:always"></div>
60
           <div style="page-break-after:always"></div>
61
       </div>
61
       </div>
62
     </div>
62
     </div>
63
-    
63
+
64
   </div>
64
   </div>
65
 
65
 
66
-    
66
+
67
 </template>
67
 </template>
68
 <script>
68
 <script>
69
 import { jsGetAge, uParseTime } from '@/utils/tools'
69
 import { jsGetAge, uParseTime } from '@/utils/tools'
75
       record_date:String,
75
       record_date:String,
76
       prescription_id:Number,
76
       prescription_id:Number,
77
       ids:String
77
       ids:String
78
-    }, 
78
+    },
79
     data(){
79
     data(){
80
       return {
80
       return {
81
         doctorList:[],
81
         doctorList:[],
92
       }
92
       }
93
     },
93
     },
94
    methods:{
94
    methods:{
95
-     
95
+     getAge(patient){
96
+       var thisLen = patient.id_card_no.length
97
+       var birth = ''
98
+       if (thisLen == 15) {
99
+         birth = '19' + patient.id_card_no.substr(6, 6)
100
+       } else {
101
+         birth = patient.id_card_no.substr(6, 8)
102
+       }
103
+       var births =
104
+         birth.substr(0, 4) +
105
+         '-' +
106
+         birth.substr(4, 2) +
107
+         '-' +
108
+         birth.substr(6, 2)
109
+        return jsGetAge(births, '-')
110
+
111
+     },
112
+
96
      getAllDoctorList(){
113
      getAllDoctorList(){
97
       getAllDoctorList().then(response=>{
114
       getAllDoctorList().then(response=>{
98
         if(response.data.state == 1){
115
         if(response.data.state == 1){
99
                var doctor =  response.data.data.doctor
116
                var doctor =  response.data.data.doctor
100
-               
117
+
101
                this.doctorList = doctor
118
                this.doctorList = doctor
102
              }
119
              }
103
-         })   
120
+         })
104
      },
121
      },
105
 
122
 
106
       getDoctor(id){
123
       getDoctor(id){
194
             }
211
             }
195
               addtotal =  Math.floor(addtotal * 100) / 100
212
               addtotal =  Math.floor(addtotal * 100) / 100
196
         }
213
         }
197
-       
214
+
198
        }
215
        }
199
 
216
 
200
       for (let i = 0; i < this.prescriptions.length; i++) {
217
       for (let i = 0; i < this.prescriptions.length; i++) {
204
                 total = total + this.prescriptions[i].advices[a].price * this.prescriptions[i].advices[a].prescribing_number
221
                 total = total + this.prescriptions[i].advices[a].price * this.prescriptions[i].advices[a].prescribing_number
205
               }
222
               }
206
             }
223
             }
207
-          
224
+
208
             if (this.prescriptions[i].additionalcharge != null) {
225
             if (this.prescriptions[i].additionalcharge != null) {
209
               for (let a = 0; a < this.prescriptions[i].additionalcharge.length; a++) {
226
               for (let a = 0; a < this.prescriptions[i].additionalcharge.length; a++) {
210
                 addtotal = addtotal + this.prescriptions[i].additionalcharge[a].price * this.prescriptions[i].additionalcharge[a].count
227
                 addtotal = addtotal + this.prescriptions[i].additionalcharge[a].price * this.prescriptions[i].additionalcharge[a].count
216
 
233
 
217
         return total + addtotal
234
         return total + addtotal
218
       },
235
       },
219
-      
236
+
220
      getProjectName(id){
237
      getProjectName(id){
221
         var project_name = ""
238
         var project_name = ""
222
         for(let i=0;i<this.projectList.length;i++){
239
         for(let i=0;i<this.projectList.length;i++){
245
       this.getHisPatientDetail()
262
       this.getHisPatientDetail()
246
       var xtuser = this.$store.getters.xt_user;
263
       var xtuser = this.$store.getters.xt_user;
247
       this.orgname = xtuser.org.org_name;
264
       this.orgname = xtuser.org.org_name;
248
-     
265
+
249
    },
266
    },
250
    watch:{
267
    watch:{
251
      ids:function(val){
268
      ids:function(val){
260
 <style lang="scss" scoped>
277
 <style lang="scss" scoped>
261
 .prescription-print{
278
 .prescription-print{
262
   -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 60px rgba(0, 0, 0, 0.06) inset;
279
   -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 60px rgba(0, 0, 0, 0.06) inset;
263
-    -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 40px rgba(0, 0, 0, 0.06) inset; 
280
+    -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 40px rgba(0, 0, 0, 0.06) inset;
264
     box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 40px rgba(0, 0, 0, 0.06) inset;
281
     box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 40px rgba(0, 0, 0, 0.06) inset;
265
     margin-bottom: 20px;
282
     margin-bottom: 20px;
266
     padding:20px 10px;
283
     padding:20px 10px;
320
 }
337
 }
321
 .actionBar{
338
 .actionBar{
322
     display: flex;
339
     display: flex;
323
-    justify-content: space-between; 
340
+    justify-content: space-between;
324
     line-height: 24px;
341
     line-height: 24px;
325
     padding:0 10px;
342
     padding:0 10px;
326
 }
343
 }

+ 18 - 1
src/xt_pages/outpatientDoctorStation/template/printOne.vue View File

9
                 <span v-if="item.patient.gender == 1">男</span>
9
                 <span v-if="item.patient.gender == 1">男</span>
10
                 <span v-if="item.patient.gender == 2">女</span>
10
                 <span v-if="item.patient.gender == 2">女</span>
11
               </p>
11
               </p>
12
-              <p>年龄:{{item.patient.age?item.patient.age:""}}岁</p>
12
+              <p>年龄:{{getAge(item.patient)?getAge(item.patient):""}}岁</p>
13
           </div>
13
           </div>
14
           <div class="infoMain">
14
           <div class="infoMain">
15
               <div style="margin-bottom: 10px;">门诊号:{{hisPatient.number?hisPatient.number:""}}</div>
15
               <div style="margin-bottom: 10px;">门诊号:{{hisPatient.number?hisPatient.number:""}}</div>
92
       }
92
       }
93
     },
93
     },
94
    methods:{
94
    methods:{
95
+     getAge(patient){
96
+       var thisLen = patient.id_card_no.length
97
+       var birth = ''
98
+       if (thisLen == 15) {
99
+         birth = '19' + patient.id_card_no.substr(6, 6)
100
+       } else {
101
+         birth = patient.id_card_no.substr(6, 8)
102
+       }
103
+       var births =
104
+         birth.substr(0, 4) +
105
+         '-' +
106
+         birth.substr(4, 2) +
107
+         '-' +
108
+         birth.substr(6, 2)
109
+       return jsGetAge(births, '-')
110
+
111
+     },
95
 
112
 
96
      getAllDoctorList(){
113
      getAllDoctorList(){
97
       getAllDoctorList().then(response=>{
114
       getAllDoctorList().then(response=>{

+ 37 - 20
src/xt_pages/outpatientDoctorStation/template/printThree.vue View File

22
                 <span v-if="item.patient.gender == 1">男</span>
22
                 <span v-if="item.patient.gender == 1">男</span>
23
                 <span v-if="item.patient.gender == 2">女</span>
23
                 <span v-if="item.patient.gender == 2">女</span>
24
               </div>
24
               </div>
25
-              <div>年龄:{{item.patient.age?item.patient.age:""}}岁</div>
25
+              <div>年龄:{{getAge(item.patient)?getAge(item.patient):""}}岁</div>
26
           </div>
26
           </div>
27
           <div class="infoMain">
27
           <div class="infoMain">
28
               <div style="margin-bottom: 10px;display:flex;">门诊号码:<span class="under_line" v-if="hisPatient.number">{{hisPatient.number?hisPatient.number:""}}</span></div>
28
               <div style="margin-bottom: 10px;display:flex;">门诊号码:<span class="under_line" v-if="hisPatient.number">{{hisPatient.number?hisPatient.number:""}}</span></div>
45
               <div class="drugsBox" v-for="(it,i) in item.additionalcharge" :key="i">
45
               <div class="drugsBox" v-for="(it,i) in item.additionalcharge" :key="i">
46
                 <div class="drugsOne">{{it.item_name?it.item_name:""}}:&nbsp;{{it.price}}元/{{it.count}}次</div>
46
                 <div class="drugsOne">{{it.item_name?it.item_name:""}}:&nbsp;{{it.price}}元/{{it.count}}次</div>
47
               </div>
47
               </div>
48
-              
48
+
49
               <!-- <div class="drugsBox" v-for="(it,index) in item.project" :key="index">
49
               <!-- <div class="drugsBox" v-for="(it,index) in item.project" :key="index">
50
                   <div class="drugsOne"><span style="font-weight:bold;">{{ index+1 + '.' }}</span>{{ it.type == 2 ? it.project.project_name : it.good_info.good_name }}&nbsp;&nbsp;{{it.single_dose}}{{it.single_dose_unit}}&nbsp;×&nbsp; {{it.count}}{{unit}}</div>
50
                   <div class="drugsOne"><span style="font-weight:bold;">{{ index+1 + '.' }}</span>{{ it.type == 2 ? it.project.project_name : it.good_info.good_name }}&nbsp;&nbsp;{{it.single_dose}}{{it.single_dose_unit}}&nbsp;×&nbsp; {{it.count}}{{unit}}</div>
51
                   <div style="margin-left:100px;"><span>用法:{{it.single_dose}}{{it.single_dose_unit}}</span>&nbsp;&nbsp;<span>{{it.delivery_way}}</span>&nbsp;&nbsp;<span>{{it.advice_desc}}</span></div>
51
                   <div style="margin-left:100px;"><span>用法:{{it.single_dose}}{{it.single_dose_unit}}</span>&nbsp;&nbsp;<span>{{it.delivery_way}}</span>&nbsp;&nbsp;<span>{{it.advice_desc}}</span></div>
86
           <div style="page-break-after:always"></div>
86
           <div style="page-break-after:always"></div>
87
       </div>
87
       </div>
88
     </div>
88
     </div>
89
-    
89
+
90
   </div>
90
   </div>
91
 </div>
91
 </div>
92
-    
92
+
93
 </template>
93
 </template>
94
 <script>
94
 <script>
95
 import { jsGetAge, uParseTime } from '@/utils/tools'
95
 import { jsGetAge, uParseTime } from '@/utils/tools'
101
       record_date:String,
101
       record_date:String,
102
       prescription_id:Number,
102
       prescription_id:Number,
103
       ids:String
103
       ids:String
104
-    }, 
104
+    },
105
     data(){
105
     data(){
106
       return {
106
       return {
107
         doctorList:[],
107
         doctorList:[],
120
       }
120
       }
121
     },
121
     },
122
    methods:{
122
    methods:{
123
-     
123
+     getAge(patient){
124
+       var thisLen = patient.id_card_no.length
125
+       var birth = ''
126
+       if (thisLen == 15) {
127
+         birth = '19' + patient.id_card_no.substr(6, 6)
128
+       } else {
129
+         birth = patient.id_card_no.substr(6, 8)
130
+       }
131
+       var births =
132
+         birth.substr(0, 4) +
133
+         '-' +
134
+         birth.substr(4, 2) +
135
+         '-' +
136
+         birth.substr(6, 2)
137
+       return jsGetAge(births, '-')
138
+
139
+     },
140
+
124
      getAllDoctorList(){
141
      getAllDoctorList(){
125
       getAllDoctorList().then(response=>{
142
       getAllDoctorList().then(response=>{
126
         if(response.data.state == 1){
143
         if(response.data.state == 1){
127
                var doctor =  response.data.data.doctor
144
                var doctor =  response.data.data.doctor
128
-               
145
+
129
                this.doctorList = doctor
146
                this.doctorList = doctor
130
              }
147
              }
131
-         })   
148
+         })
132
      },
149
      },
133
 
150
 
134
       getDoctor(id){
151
       getDoctor(id){
171
             var projectlist =  response.data.data.projectlist
188
             var projectlist =  response.data.data.projectlist
172
             console.log("所有项目列表",projectlist)
189
             console.log("所有项目列表",projectlist)
173
             this.projectList = projectlist
190
             this.projectList = projectlist
174
-            
191
+
175
             let outputlist1Name = response.data.data.his.patient_info ? JSON.parse(response.data.data.his.patient_info) : {};
192
             let outputlist1Name = response.data.data.his.patient_info ? JSON.parse(response.data.data.his.patient_info) : {};
176
             this.faber = outputlist1Name
193
             this.faber = outputlist1Name
177
 
194
 
178
-            
195
+
179
           }
196
           }
180
        })
197
        })
181
      },
198
      },
228
             }
245
             }
229
               addtotal =  Math.floor(addtotal * 100) / 100
246
               addtotal =  Math.floor(addtotal * 100) / 100
230
         }
247
         }
231
-       
248
+
232
        }
249
        }
233
 
250
 
234
       for (let i = 0; i < this.prescriptions.length; i++) {
251
       for (let i = 0; i < this.prescriptions.length; i++) {
238
                 total = total + this.prescriptions[i].advices[a].price * this.prescriptions[i].advices[a].prescribing_number
255
                 total = total + this.prescriptions[i].advices[a].price * this.prescriptions[i].advices[a].prescribing_number
239
               }
256
               }
240
             }
257
             }
241
-          
258
+
242
             if (this.prescriptions[i].additionalcharge != null) {
259
             if (this.prescriptions[i].additionalcharge != null) {
243
               for (let a = 0; a < this.prescriptions[i].additionalcharge.length; a++) {
260
               for (let a = 0; a < this.prescriptions[i].additionalcharge.length; a++) {
244
                 addtotal = addtotal + this.prescriptions[i].additionalcharge[a].price * this.prescriptions[i].additionalcharge[a].count
261
                 addtotal = addtotal + this.prescriptions[i].additionalcharge[a].price * this.prescriptions[i].additionalcharge[a].count
250
 
267
 
251
         return total + addtotal
268
         return total + addtotal
252
       },
269
       },
253
-      
270
+
254
      getProjectName(id){
271
      getProjectName(id){
255
         var project_name = ""
272
         var project_name = ""
256
         for(let i=0;i<this.projectList.length;i++){
273
         for(let i=0;i<this.projectList.length;i++){
271
           // if(id == this.diagnoses[i].id){
288
           // if(id == this.diagnoses[i].id){
272
           //    name = this.diagnoses[i].class_name
289
           //    name = this.diagnoses[i].class_name
273
           // }
290
           // }
274
-          
291
+
275
           if(newIds.indexOf(this.diagnoses[i].id.toString()) > -1){
292
           if(newIds.indexOf(this.diagnoses[i].id.toString()) > -1){
276
             // name += diagnoses[i].class_name + ' '
293
             // name += diagnoses[i].class_name + ' '
277
             nameArr.push(this.diagnoses[i].class_name)
294
             nameArr.push(this.diagnoses[i].class_name)
281
         nameArr.map((item,index) => {
298
         nameArr.map((item,index) => {
282
           if(item == '尿毒症'){
299
           if(item == '尿毒症'){
283
             newNameArr.push(item)
300
             newNameArr.push(item)
284
-            nameArr.splice(index,1,'') 
301
+            nameArr.splice(index,1,'')
285
           }
302
           }
286
         })
303
         })
287
         newNameArr.push(...nameArr)
304
         newNameArr.push(...nameArr)
305
             this.page = 1
322
             this.page = 1
306
             arr.push(item.advices.length)
323
             arr.push(item.advices.length)
307
             item.pageArr.push(arr)
324
             item.pageArr.push(arr)
308
-            
325
+
309
           }else if(item.advices.length > 5){
326
           }else if(item.advices.length > 5){
310
             this.page = parseInt(item.advices.length / 5)
327
             this.page = parseInt(item.advices.length / 5)
311
             let num = item.advices.length % 5
328
             let num = item.advices.length % 5
398
       this.getPrescriptionPrint()
415
       this.getPrescriptionPrint()
399
       this.getAllDoctorList()
416
       this.getAllDoctorList()
400
       this.getInitData()
417
       this.getInitData()
401
-      
418
+
402
       this.getHisPatientDetail()
419
       this.getHisPatientDetail()
403
       var xtuser = this.$store.getters.xt_user;
420
       var xtuser = this.$store.getters.xt_user;
404
       this.orgname = xtuser.org.org_name;
421
       this.orgname = xtuser.org.org_name;
405
-     
422
+
406
    },
423
    },
407
    watch:{
424
    watch:{
408
      ids:function(val){
425
      ids:function(val){
418
 <style lang="scss" scoped>
435
 <style lang="scss" scoped>
419
 .prescription-print{
436
 .prescription-print{
420
   -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 60px rgba(0, 0, 0, 0.06) inset;
437
   -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 60px rgba(0, 0, 0, 0.06) inset;
421
-    -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 40px rgba(0, 0, 0, 0.06) inset; 
438
+    -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 40px rgba(0, 0, 0, 0.06) inset;
422
     box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 40px rgba(0, 0, 0, 0.06) inset;
439
     box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 40px rgba(0, 0, 0, 0.06) inset;
423
     margin-bottom: 20px;
440
     margin-bottom: 20px;
424
     padding:20px 10px;
441
     padding:20px 10px;
476
 }
493
 }
477
 .actionBar{
494
 .actionBar{
478
     display: flex;
495
     display: flex;
479
-    justify-content: space-between; 
496
+    justify-content: space-between;
480
     line-height: 24px;
497
     line-height: 24px;
481
     padding:0 10px;
498
     padding:0 10px;
482
 }
499
 }

+ 26 - 9
src/xt_pages/outpatientDoctorStation/template/printTwo.vue View File

7
                <span v-if="patient.gender == 1">男</span>
7
                <span v-if="patient.gender == 1">男</span>
8
                <span v-if="patient.gender == 2">女</span>
8
                <span v-if="patient.gender == 2">女</span>
9
             </p>
9
             </p>
10
-            <p>年龄:{{patient.age}}岁</p>
10
+            <p>年龄:{{getAge(item.patient)?getAge(item.patient):""}}岁</p>
11
         </div>
11
         </div>
12
         <div class="infoMain">
12
         <div class="infoMain">
13
             <div style="margin-bottom: 10px;">门诊号:{{this.hisPatient.number?this.hisPatient.number:""}}</div>
13
             <div style="margin-bottom: 10px;">门诊号:{{this.hisPatient.number?this.hisPatient.number:""}}</div>
24
                 <div style="margin-left:100px;"><span>用法:{{item.single_dose}}{{item.single_dose_unit}}</span>&nbsp;&nbsp;<span>{{item.execution_frequency}}</span>&nbsp;&nbsp;<span>{{item.advice_desc}}</span></div>
24
                 <div style="margin-left:100px;"><span>用法:{{item.single_dose}}{{item.single_dose_unit}}</span>&nbsp;&nbsp;<span>{{item.execution_frequency}}</span>&nbsp;&nbsp;<span>{{item.advice_desc}}</span></div>
25
             </div>
25
             </div>
26
 
26
 
27
-            
27
+
28
         </div>
28
         </div>
29
         <div class="doctorBox">
29
         <div class="doctorBox">
30
             <p>医师:{{getDoctor(advicePrint[0].advice_doctor)?getDoctor(advicePrint[0].advice_doctor):""}}</p>
30
             <p>医师:{{getDoctor(advicePrint[0].advice_doctor)?getDoctor(advicePrint[0].advice_doctor):""}}</p>
48
       patient_id:Number,
48
       patient_id:Number,
49
       record_date:String,
49
       record_date:String,
50
       prescription_id:Number
50
       prescription_id:Number
51
-    }, 
51
+    },
52
     data(){
52
     data(){
53
       return {
53
       return {
54
         doctorList:[],
54
         doctorList:[],
62
       }
62
       }
63
     },
63
     },
64
    methods:{
64
    methods:{
65
-     
65
+     getAge(patient){
66
+       var thisLen = patient.id_card_no.length
67
+       var birth = ''
68
+       if (thisLen == 15) {
69
+         birth = '19' + patient.id_card_no.substr(6, 6)
70
+       } else {
71
+         birth = patient.id_card_no.substr(6, 8)
72
+       }
73
+       var births =
74
+         birth.substr(0, 4) +
75
+         '-' +
76
+         birth.substr(4, 2) +
77
+         '-' +
78
+         birth.substr(6, 2)
79
+       return jsGetAge(births, '-')
80
+
81
+     },
82
+
66
      getAllDoctorList(){
83
      getAllDoctorList(){
67
       getAllDoctorList().then(response=>{
84
       getAllDoctorList().then(response=>{
68
         if(response.data.state == 1){
85
         if(response.data.state == 1){
69
                var doctor =  response.data.data.doctor
86
                var doctor =  response.data.data.doctor
70
-               
87
+
71
                this.doctorList = doctor
88
                this.doctorList = doctor
72
              }
89
              }
73
-         })   
90
+         })
74
      },
91
      },
75
 
92
 
76
       getDoctor(id){
93
       getDoctor(id){
104
             console.log("patient",patient)
121
             console.log("patient",patient)
105
             this.patient = patient
122
             this.patient = patient
106
             var doctorPorject = response.data.data.doctorPorject
123
             var doctorPorject = response.data.data.doctorPorject
107
-          
124
+
108
             var arr = doctorPorject.project
125
             var arr = doctorPorject.project
109
               console.log("我的中谷歌",arr)
126
               console.log("我的中谷歌",arr)
110
             for(let i=0;i<arr.length;i++){
127
             for(let i=0;i<arr.length;i++){
134
        getInitData().then(response=>{
151
        getInitData().then(response=>{
135
           if(response.data.state == 1){
152
           if(response.data.state == 1){
136
             this.department = response.data.data.department
153
             this.department = response.data.data.department
137
-           
154
+
138
           }
155
           }
139
        })
156
        })
140
      },
157
      },
221
 }
238
 }
222
 .actionBar{
239
 .actionBar{
223
     display: flex;
240
     display: flex;
224
-    justify-content: space-between; 
241
+    justify-content: space-between;
225
     line-height: 24px;
242
     line-height: 24px;
226
     padding:0 10px;
243
     padding:0 10px;
227
 }
244
 }

+ 18 - 1
src/xt_pages/outpatientDoctorStation/treatTemplate/printOne.vue View File

28
                     <span v-if="item.patient.gender == 2">女</span>
28
                     <span v-if="item.patient.gender == 2">女</span>
29
                 </div>
29
                 </div>
30
                 <div style="margin-bottom: 10px;width:25%">年龄:
30
                 <div style="margin-bottom: 10px;width:25%">年龄:
31
-                    <span>{{item.patient.age}}</span>
31
+                    <span>{{getAge(item.patient)?getAge(item.patient):""}}</span>
32
                 </div>
32
                 </div>
33
                 <div style="margin-bottom: 10px;width:25%">参保类型:{{hisPatient.social_type?hisPatient.social_type:''}}
33
                 <div style="margin-bottom: 10px;width:25%">参保类型:{{hisPatient.social_type?hisPatient.social_type:''}}
34
                 </div>
34
                 </div>
257
       }
257
       }
258
     },
258
     },
259
     methods: {
259
     methods: {
260
+      getAge(patient){
261
+        var thisLen = patient.id_card_no.length
262
+        var birth = ''
263
+        if (thisLen == 15) {
264
+          birth = '19' + patient.id_card_no.substr(6, 6)
265
+        } else {
266
+          birth = patient.id_card_no.substr(6, 8)
267
+        }
268
+        var births =
269
+          birth.substr(0, 4) +
270
+          '-' +
271
+          birth.substr(4, 2) +
272
+          '-' +
273
+          birth.substr(6, 2)
274
+        return jsGetAge(births, '-')
275
+
276
+      },
260
       printThisPage() {
277
       printThisPage() {
261
         var ptime = Math.round(new Date().getTime() / 1000)
278
         var ptime = Math.round(new Date().getTime() / 1000)
262
         this.print_time = uParseTime(ptime, '{y}-{m}-{d} {h}:{i}')
279
         this.print_time = uParseTime(ptime, '{y}-{m}-{d} {h}:{i}')

+ 23 - 6
src/xt_pages/outpatientDoctorStation/treatTemplate/printTwo.vue View File

20
             <span v-if="item.patient.gender == 1">男</span>
20
             <span v-if="item.patient.gender == 1">男</span>
21
             <span v-if="item.patient.gender == 2">女</span>
21
             <span v-if="item.patient.gender == 2">女</span>
22
             </div>
22
             </div>
23
-            <div>年龄:{{item.patient.age?item.patient.age:""}}岁</div>
23
+            <div>年龄:{{getAge(item.patient)?getAge(item.patient):""}}岁</div>
24
         </div>
24
         </div>
25
         <div class="infoMain">
25
         <div class="infoMain">
26
             <div style="margin-bottom: 10px;display:flex;">门诊号码:<span class="under_line">{{hisPatient.number?hisPatient.number:""}}</span></div>
26
             <div style="margin-bottom: 10px;display:flex;">门诊号码:<span class="under_line">{{hisPatient.number?hisPatient.number:""}}</span></div>
238
       }
238
       }
239
     },
239
     },
240
    methods:{
240
    methods:{
241
+     getAge(patient){
242
+       var thisLen = patient.id_card_no.length
243
+       var birth = ''
244
+       if (thisLen == 15) {
245
+         birth = '19' + patient.id_card_no.substr(6, 6)
246
+       } else {
247
+         birth = patient.id_card_no.substr(6, 8)
248
+       }
249
+       var births =
250
+         birth.substr(0, 4) +
251
+         '-' +
252
+         birth.substr(4, 2) +
253
+         '-' +
254
+         birth.substr(6, 2)
255
+       return jsGetAge(births, '-')
256
+
257
+     },
241
      printThisPage() {
258
      printThisPage() {
242
       var ptime = Math.round(new Date().getTime() / 1000);
259
       var ptime = Math.round(new Date().getTime() / 1000);
243
       this.print_time = uParseTime(ptime, "{y}-{m}-{d} {h}:{i}");
260
       this.print_time = uParseTime(ptime, "{y}-{m}-{d} {h}:{i}");
398
         let newIds = ids.split(',').sort(function(a,b){
415
         let newIds = ids.split(',').sort(function(a,b){
399
           return a-b;
416
           return a-b;
400
         })
417
         })
401
-        
418
+
402
         var name = ""
419
         var name = ""
403
         let nameArr = []
420
         let nameArr = []
404
         for(let i=0;i<this.diagnoses.length;i++){
421
         for(let i=0;i<this.diagnoses.length;i++){
405
           // if(id == this.diagnoses[i].id){
422
           // if(id == this.diagnoses[i].id){
406
           //    name = this.diagnoses[i].class_name
423
           //    name = this.diagnoses[i].class_name
407
           // }
424
           // }
408
-          
425
+
409
           if(newIds.indexOf(this.diagnoses[i].id.toString()) > -1){
426
           if(newIds.indexOf(this.diagnoses[i].id.toString()) > -1){
410
             // name += diagnoses[i].class_name + ' '
427
             // name += diagnoses[i].class_name + ' '
411
             nameArr.push(this.diagnoses[i].class_name)
428
             nameArr.push(this.diagnoses[i].class_name)
415
         nameArr.map((item,index) => {
432
         nameArr.map((item,index) => {
416
           if(item == '尿毒症'){
433
           if(item == '尿毒症'){
417
             newNameArr.push(item)
434
             newNameArr.push(item)
418
-            nameArr.splice(index,1,'') 
435
+            nameArr.splice(index,1,'')
419
           }
436
           }
420
         })
437
         })
421
         newNameArr.push(...nameArr)
438
         newNameArr.push(...nameArr)
528
 <style lang="scss" scoped>
545
 <style lang="scss" scoped>
529
 .prescription-print{
546
 .prescription-print{
530
   -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 60px rgba(0, 0, 0, 0.06) inset;
547
   -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 60px rgba(0, 0, 0, 0.06) inset;
531
-    -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 40px rgba(0, 0, 0, 0.06) inset; 
548
+    -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 40px rgba(0, 0, 0, 0.06) inset;
532
     box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 40px rgba(0, 0, 0, 0.06) inset;
549
     box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 40px rgba(0, 0, 0, 0.06) inset;
533
     margin-bottom: 20px;
550
     margin-bottom: 20px;
534
     padding:20px 10px;
551
     padding:20px 10px;
586
 }
603
 }
587
 .actionBar{
604
 .actionBar{
588
     display: flex;
605
     display: flex;
589
-    justify-content: space-between; 
606
+    justify-content: space-between;
590
     line-height: 24px;
607
     line-height: 24px;
591
     padding:0 10px;
608
     padding:0 10px;
592
 }
609
 }