Browse Source

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

csx 3 years ago
parent
commit
a7dfe4f847

+ 9 - 6
src/xt_pages/outpatientDoctorStation/components/prescriptionTemplateTable.vue View File

198
             </el-table-column>
198
             </el-table-column>
199
             <el-table-column align="center" width="40" prop="name" label="操作">
199
             <el-table-column align="center" width="40" prop="name" label="操作">
200
                 <template slot-scope="scope">
200
                 <template slot-scope="scope">
201
-                    <el-button size="mini" type="primary" @click="handleEdit(scope.row)">推送</el-button>
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)">删除
202
                     <el-button size="mini" type="danger" @click="deleteProject(scope.row.id,scope.$index)">删除
203
                     </el-button>
203
                     </el-button>
204
                     <!--<i class="el-icon-delete" @click="deleteProject(scope.row,scope.$index)"></i>-->
204
                     <!--<i class="el-icon-delete" @click="deleteProject(scope.row,scope.$index)"></i>-->
227
                         label-width="90px"
227
                         label-width="90px"
228
                 >
228
                 >
229
                     <el-row>
229
                     <el-row>
230
-                        <el-col :span="24" v-if="frequency_type">
230
+                        <el-col :span="24" >
231
                             <el-form-item label="周期提醒 :">
231
                             <el-form-item label="周期提醒 :">
232
                                 <el-radio-group v-model="frequency_type">
232
                                 <el-radio-group v-model="frequency_type">
233
                                     <el-radio :label="1">每次必推</el-radio>
233
                                     <el-radio :label="1">每次必推</el-radio>
297
     },
297
     },
298
     data() {
298
     data() {
299
       return {
299
       return {
300
-        week_days: ['周一'],
300
+        week_days: [],
301
 
301
 
302
         current_row: null,
302
         current_row: null,
303
         current_index: 0,
303
         current_index: 0,
329
 
329
 
330
     methods: {
330
     methods: {
331
       submitTemplate() {
331
       submitTemplate() {
332
+        console.log(this.current_index)
333
+
334
+        console.log( this.prescription.project[this.current_index])
332
         if (this.prescription.advices && this.prescription.advices.length > 0 && this.prescription.project && this.prescription.project.length == 0) {
335
         if (this.prescription.advices && this.prescription.advices.length > 0 && this.prescription.project && this.prescription.project.length == 0) {
333
           this.prescription.advices[this.current_index].frequency_type = this.frequency_type
336
           this.prescription.advices[this.current_index].frequency_type = this.frequency_type
334
           this.prescription.advices[this.current_index].day_count = this.day_count
337
           this.prescription.advices[this.current_index].day_count = this.day_count
335
-          this.prescription.advices[this.current_index].week_day = this.week_day
338
+          this.prescription.advices[this.current_index].week_day = this.week_days.join(",")
336
 
339
 
337
         }
340
         }
338
 
341
 
339
         if (this.prescription.advices && this.prescription.advices.length == 0 && this.prescription.project && this.prescription.project.length > 0) {
342
         if (this.prescription.advices && this.prescription.advices.length == 0 && this.prescription.project && this.prescription.project.length > 0) {
340
           this.prescription.project[this.current_index].frequency_type = this.frequency_type
343
           this.prescription.project[this.current_index].frequency_type = this.frequency_type
341
           this.prescription.project[this.current_index].day_count = this.day_count
344
           this.prescription.project[this.current_index].day_count = this.day_count
342
-          this.prescription.project[this.current_index].week_day = this.week_day
345
+          this.prescription.project[this.current_index].week_day =this.week_days.join(",")
343
         }
346
         }
344
         this.templateFormVisible = false
347
         this.templateFormVisible = false
345
       },
348
       },
348
         this.current_index = index
351
         this.current_index = index
349
         this.frequency_type = this.current_row.frequency_type
352
         this.frequency_type = this.current_row.frequency_type
350
         this.day_count = this.current_row.day_count
353
         this.day_count = this.current_row.day_count
351
-        this.week_day = this.current_row.week_day
354
+        this.week_days = this.current_row.week_day.split(",")
352
         this.templateFormVisible = true
355
         this.templateFormVisible = true
353
 
356
 
354
 
357
 

+ 25 - 11
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
+            }
1320
             for(let i = 0;i < response.data.data.sch_prescriptions.length; i++){
1315
             for(let i = 0;i < response.data.data.sch_prescriptions.length; i++){
1321
               if(response.data.data.sch_prescriptions[i].advices == null){
1316
               if(response.data.data.sch_prescriptions[i].advices == null){
1322
                 response.data.data.sch_prescriptions[i].advices = []
1317
                 response.data.data.sch_prescriptions[i].advices = []
1323
               }
1318
               }
1324
-
1325
               if(response.data.data.sch_prescriptions[i].project == null){
1319
               if(response.data.data.sch_prescriptions[i].project == null){
1326
                 response.data.data.sch_prescriptions[i].project = []
1320
                 response.data.data.sch_prescriptions[i].project = []
1327
               }
1321
               }
1328
-
1329
             }
1322
             }
1323
+
1330
             this.patientid = val.id
1324
             this.patientid = val.id
1331
             this.isloading = false
1325
             this.isloading = false
1332
 
1326
 
1715
                   this.$message.error(response.data.msg)
1709
                   this.$message.error(response.data.msg)
1716
                   return false
1710
                   return false
1717
                 } else {
1711
                 } else {
1712
+                  if(response.data.data.sch_prescriptions== null){
1713
+
1714
+                    response.data.data.sch_prescriptions = []
1715
+                  }
1718
                   for(let i = 0;i < response.data.data.sch_prescriptions.length; i++){
1716
                   for(let i = 0;i < response.data.data.sch_prescriptions.length; i++){
1719
                     if(response.data.data.sch_prescriptions[i].advices == null){
1717
                     if(response.data.data.sch_prescriptions[i].advices == null){
1720
                       response.data.data.sch_prescriptions[i].advices = []
1718
                       response.data.data.sch_prescriptions[i].advices = []
2209
                   this.$message.error(response.data.msg)
2207
                   this.$message.error(response.data.msg)
2210
                   return false
2208
                   return false
2211
                 } else {
2209
                 } else {
2210
+                  if(response.data.data.sch_prescriptions== null){
2211
+
2212
+                    response.data.data.sch_prescriptions = []
2213
+                  }
2212
                   for(let i = 0;i < response.data.data.sch_prescriptions.length; i++){
2214
                   for(let i = 0;i < response.data.data.sch_prescriptions.length; i++){
2213
                     if(response.data.data.sch_prescriptions[i].advices == null){
2215
                     if(response.data.data.sch_prescriptions[i].advices == null){
2214
                       response.data.data.sch_prescriptions[i].advices = []
2216
                       response.data.data.sch_prescriptions[i].advices = []
2682
                 this.$message.error(response.data.msg)
2684
                 this.$message.error(response.data.msg)
2683
                 return false
2685
                 return false
2684
               } else {
2686
               } else {
2687
+                if(response.data.data.sch_prescriptions== null){
2688
+
2689
+                  response.data.data.sch_prescriptions = []
2690
+                }
2685
                 for(let i = 0;i < response.data.data.sch_prescriptions.length; i++){
2691
                 for(let i = 0;i < response.data.data.sch_prescriptions.length; i++){
2686
                   if(response.data.data.sch_prescriptions[i].advices == null){
2692
                   if(response.data.data.sch_prescriptions[i].advices == null){
2687
                     response.data.data.sch_prescriptions[i].advices = []
2693
                     response.data.data.sch_prescriptions[i].advices = []
3213
                   this.$message.error(response.data.msg)
3219
                   this.$message.error(response.data.msg)
3214
                   return false
3220
                   return false
3215
                 } else {
3221
                 } else {
3222
+                  if(response.data.data.sch_prescriptions== null){
3223
+
3224
+                    response.data.data.sch_prescriptions = []
3225
+                  }
3216
                   for(let i = 0;i < response.data.data.sch_prescriptions.length; i++){
3226
                   for(let i = 0;i < response.data.data.sch_prescriptions.length; i++){
3217
                     if(response.data.data.sch_prescriptions[i].advices == null){
3227
                     if(response.data.data.sch_prescriptions[i].advices == null){
3218
                       response.data.data.sch_prescriptions[i].advices = []
3228
                       response.data.data.sch_prescriptions[i].advices = []
3781
                   this.$message.error(response.data.msg)
3791
                   this.$message.error(response.data.msg)
3782
                   return false
3792
                   return false
3783
                 } else {
3793
                 } else {
3794
+                  if(response.data.data.sch_prescriptions== null){
3795
+
3796
+                    response.data.data.sch_prescriptions = []
3797
+                  }
3784
                   for(let i = 0;i < response.data.data.sch_prescriptions.length; i++){
3798
                   for(let i = 0;i < response.data.data.sch_prescriptions.length; i++){
3785
                     if(response.data.data.sch_prescriptions[i].advices == null){
3799
                     if(response.data.data.sch_prescriptions[i].advices == null){
3786
                       response.data.data.sch_prescriptions[i].advices = []
3800
                       response.data.data.sch_prescriptions[i].advices = []

+ 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
     },

+ 111 - 79
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,
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)
455
             this.prescriptions[i].advices[b].groupno = parseInt(this.prescriptions[i].advices[b].groupno)
462
             this.prescriptions[i].advices[b].groupno = parseInt(this.prescriptions[i].advices[b].groupno)
456
 
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()
457
 
467
 
458
           }
468
           }
459
 
469
 
461
             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()
462
             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()
463
             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
+
464
           }
479
           }
465
         }
480
         }
466
         let data = {
481
         let data = {
469
         createdTemplate(params, data).then(response => {
484
         createdTemplate(params, data).then(response => {
470
           if (response.data.state == 1) {
485
           if (response.data.state == 1) {
471
             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
+            }
472
           } else {
492
           } else {
473
             this.$message.error(response.data.msg)
493
             this.$message.error(response.data.msg)
474
           }
494
           }
933
                 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()
934
                 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)
935
 
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
+
936
               }
960
               }
937
 
961
 
938
               for (let b = 0; b < this.prescriptions[i].project.length; b++) {
962
               for (let b = 0; b < this.prescriptions[i].project.length; b++) {
940
                 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()
941
                 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()
942
 
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
+
943
               }
971
               }
944
 
972
 
945
               for (let b = 0; b < this.prescriptions[i].addition.length; b++) {
973
               for (let b = 0; b < this.prescriptions[i].addition.length; b++) {
1089
 
1117
 
1090
         }
1118
         }
1091
 
1119
 
1092
-
1093
-
1094
-          obj.med_type = 14
1095
-
1096
-
1120
+        obj.med_type = 14
1097
 
1121
 
1098
         this.prescriptions.push(obj)
1122
         this.prescriptions.push(obj)
1099
 
1123
 
1307
         //   this.$refs.multipleTable.clearSelection()
1331
         //   this.$refs.multipleTable.clearSelection()
1308
         //   return
1332
         //   return
1309
         // }
1333
         // }
1310
-      //  if (this.curPrescriptions.advices.length > 0 && this.curPrescriptions.project.length == 0) {
1311
-      //     if (this.$store.getters.xt_user.org_id == 10138) {
1312
-      //       for (let i = 0; i < this.curDrugs.length; i++) {
1313
-      //         if (this.curPrescriptions.med_type == 14 && this.curDrugs[i].is_special_diseases != 1) {
1314
-      //           this.$message.error('该处方属于特病类型处方,开非特病类型的药')
1315
-      //           return
1316
-      //         }
1317
-
1318
-      //       }
1319
-      //     }
1320
-      //   }
1321
-
1322
-      //   if (this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length == 0) {
1323
-      //     if (this.$store.getters.xt_user.org_id == 10138) {
1324
-      //       for (let i = 0; i < this.curDrugs.length; i++) {
1325
-      //         if (this.curPrescriptions.med_type == 14 && this.curDrugs[i].is_special_diseases != 1) {
1326
-      //           this.$message.error('该处方属于特病类型处方,开非特病类型的药')
1327
-      //           return
1328
-      //         }
1329
-
1330
-      //       }
1331
-      //     }
1332
-      //   }
1333
-      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) {
1334
           for (let i = 0; i < this.curDrugs.length; i++) {
1358
           for (let i = 0; i < this.curDrugs.length; i++) {
1335
             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) {
1336
               this.$message.error('该处方属于特病类型处方,开非特病类型的药')
1360
               this.$message.error('该处方属于特病类型处方,开非特病类型的药')
1353
           let arr = this.teamList
1377
           let arr = this.teamList
1354
           let newArr = []
1378
           let newArr = []
1355
           arr.map(item => {
1379
           arr.map(item => {
1356
-            if(this.curPrescriptions.med_type != 14){
1380
+            if (this.curPrescriptions.med_type != 14) {
1357
               newArr.push(item)
1381
               newArr.push(item)
1358
             }
1382
             }
1359
-            if(this.curPrescriptions.med_type == 14 && item.is_special_diseases == 1){
1383
+            if (this.curPrescriptions.med_type == 14 && item.is_special_diseases == 1) {
1360
               newArr.push(item)
1384
               newArr.push(item)
1361
             }
1385
             }
1362
           })
1386
           })
1363
           this.teamList = newArr
1387
           this.teamList = newArr
1364
         }
1388
         }
1365
 
1389
 
1366
-
1367
-
1368
         if (this.curDrugs.length == 0) {
1390
         if (this.curDrugs.length == 0) {
1369
           for (let i = 0; i < this.curDrugs.length; i++) {
1391
           for (let i = 0; i < this.curDrugs.length; i++) {
1370
             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) {
1401
           }
1423
           }
1402
         }
1424
         }
1403
 
1425
 
1404
-
1405
         for (let i = 0; i < this.curDrugs.length; i++) {
1426
         for (let i = 0; i < this.curDrugs.length; i++) {
1406
           for (let a = 0; a < this.curPrescriptions.advices.length; a++) {
1427
           for (let a = 0; a < this.curPrescriptions.advices.length; a++) {
1407
             if (this.curDrugs[i].id == this.curPrescriptions.advices[a].id) {
1428
             if (this.curDrugs[i].id == this.curPrescriptions.advices[a].id) {
1488
                   medical_insurance_number: temp[b].medical_insurance_number,
1509
                   medical_insurance_number: temp[b].medical_insurance_number,
1489
                   drug: temp[b],
1510
                   drug: temp[b],
1490
                   groupno: index + temp_index,
1511
                   groupno: index + temp_index,
1491
-                  frequency_type:1,
1492
-                  day_count:0,
1493
-                  week_day:"",
1512
+                  frequency_type: 1,
1513
+                  day_count: 0,
1514
+                  week_day: ''
1494
                 }
1515
                 }
1495
 
1516
 
1496
                 if (obj.prescribing_number == 0 || obj.prescribing_number.length == 0) {
1517
                 if (obj.prescribing_number == 0 || obj.prescribing_number.length == 0) {
1501
               this.curStatus = 1
1522
               this.curStatus = 1
1502
             }
1523
             }
1503
 
1524
 
1504
-
1505
             if (temp2.length > 0) {
1525
             if (temp2.length > 0) {
1506
               for (let b = 0; b < temp2.length; b++) {
1526
               for (let b = 0; b < temp2.length; b++) {
1507
                 let obj = {
1527
                 let obj = {
1519
                   medical_code: temp2[b].medical_code,
1539
                   medical_code: temp2[b].medical_code,
1520
                   unit: temp2[b].unit,
1540
                   unit: temp2[b].unit,
1521
                   type: temp2[b].type,
1541
                   type: temp2[b].type,
1522
-                  frequency_type:1,
1523
-                  day_count:0,
1524
-                  week_day:"",
1542
+                  frequency_type: 1,
1543
+                  day_count: 0,
1544
+                  week_day: ''
1525
                 }
1545
                 }
1526
-                if (temp2[b].type == 2){
1546
+                if (temp2[b].type == 2) {
1527
                   obj['project'] = temp2[b].project
1547
                   obj['project'] = temp2[b].project
1528
 
1548
 
1529
-                }else if(temp2[b].type == 3){
1549
+                } else if (temp2[b].type == 3) {
1530
 
1550
 
1531
                   obj['good_info'] = temp2[b].good_info
1551
                   obj['good_info'] = temp2[b].good_info
1532
 
1552
 
1598
                     medical_insurance_number: prescription.advices[b].med_list_codg,
1618
                     medical_insurance_number: prescription.advices[b].med_list_codg,
1599
                     id: prescription.advices[b].drug_id,
1619
                     id: prescription.advices[b].drug_id,
1600
                     drug: prescription.advices[b].drug,
1620
                     drug: prescription.advices[b].drug,
1601
-                    groupno:prescription.advices[b].groupno,
1602
-                    frequency_type:prescription.advices[b].frequency_type,
1603
-                    day_count:prescription.advices[b].day_count,
1604
-                    week_day:prescription.advices[b].week_day
1605
-
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
1606
 
1625
 
1607
                   }
1626
                   }
1608
                   tempAdvice.push(obj)
1627
                   tempAdvice.push(obj)
1625
                     medical_code: prescription.project[b].project.medical_code,
1644
                     medical_code: prescription.project[b].project.medical_code,
1626
                     unit: prescription.project[b].project.unit,
1645
                     unit: prescription.project[b].project.unit,
1627
                     type: prescription.project[b].type,
1646
                     type: prescription.project[b].type,
1628
-                    frequency_type:prescription.project[b].frequency_type,
1629
-                    day_count:prescription.project[b].day_count,
1630
-                    week_day:prescription.project[b].week_day
1647
+                    frequency_type: prescription.project[b].frequency_type,
1648
+                    day_count: prescription.project[b].day_count,
1649
+                    week_day: prescription.project[b].week_day
1631
 
1650
 
1632
                   }
1651
                   }
1633
 
1652
 
1637
                     obj['project_name'] = prescription.project[b].project.project_name
1656
                     obj['project_name'] = prescription.project[b].project.project_name
1638
                     obj['project'] = prescription.project[b].project
1657
                     obj['project'] = prescription.project[b].project
1639
 
1658
 
1640
-
1641
-
1642
-
1643
                   } else if (prescription.project[b].type == 3) {
1659
                   } else if (prescription.project[b].type == 3) {
1644
                     obj['statistical_classification'] = ''
1660
                     obj['statistical_classification'] = ''
1645
                     obj['medical_code'] = prescription.project[b].good_info.medical_insurance_number
1661
                     obj['medical_code'] = prescription.project[b].good_info.medical_insurance_number
1687
                 med_type: ''
1703
                 med_type: ''
1688
               }
1704
               }
1689
 
1705
 
1690
-
1691
-                obj.med_type = 14
1692
-
1693
-
1706
+              obj.med_type = 14
1694
 
1707
 
1695
               this.prescriptions.push(obj)
1708
               this.prescriptions.push(obj)
1696
               this.curPrescriptions = this.prescriptions[0]
1709
               this.curPrescriptions = this.prescriptions[0]
1720
                 unit: project[i].unit,
1733
                 unit: project[i].unit,
1721
                 type: 2,
1734
                 type: 2,
1722
                 is_special_diseases: project[i].disease_directory,
1735
                 is_special_diseases: project[i].disease_directory,
1723
-                project: project[i],
1736
+                project: project[i]
1724
               }
1737
               }
1725
 
1738
 
1726
               this.tabProject.push(obj)
1739
               this.tabProject.push(obj)
1742
                 unit: this.getGoodUnit(good_info[i].good_unit),
1755
                 unit: this.getGoodUnit(good_info[i].good_unit),
1743
                 type: 3,
1756
                 type: 3,
1744
                 is_special_diseases: good_info[i].is_special_diseases,
1757
                 is_special_diseases: good_info[i].is_special_diseases,
1745
-                good_info: good_info[i],
1758
+                good_info: good_info[i]
1746
               }
1759
               }
1747
               this.tabProject.push(obj)
1760
               this.tabProject.push(obj)
1748
             }
1761
             }
1836
                   unit: project[i].project.unit,
1849
                   unit: project[i].project.unit,
1837
                   type: project[i].type,
1850
                   type: project[i].type,
1838
                   is_special_diseases: project[i].project.disease_directory,
1851
                   is_special_diseases: project[i].project.disease_directory,
1839
-                  project:project[i].project,
1852
+                  project: project[i].project
1840
                 }
1853
                 }
1841
                 if (obj.total == 0 || obj.total == undefined) {
1854
                 if (obj.total == 0 || obj.total == undefined) {
1842
                   obj.total = 1
1855
                   obj.total = 1
1859
                   unit: project[i].good_info.unit,
1872
                   unit: project[i].good_info.unit,
1860
                   type: project[i].type,
1873
                   type: project[i].type,
1861
                   is_special_diseases: project[i].good_info.is_special_diseases,
1874
                   is_special_diseases: project[i].good_info.is_special_diseases,
1862
-                  good_info:project[i].good_info,
1875
+                  good_info: project[i].good_info
1863
                 }
1876
                 }
1864
                 if (obj.total == 0 || obj.total == undefined) {
1877
                 if (obj.total == 0 || obj.total == undefined) {
1865
                   obj.total = 1
1878
                   obj.total = 1
1905
         this.$refs.tabProjectTeam.clearSelection()
1918
         this.$refs.tabProjectTeam.clearSelection()
1906
       }
1919
       }
1907
     }, 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
+
1908
       this.getPrescriptionTemplateInfo()
1940
       this.getPrescriptionTemplateInfo()
1909
       this.getInitData()
1941
       this.getInitData()
1910
       //获取所有项目
1942
       //获取所有项目