see999 3 년 전
부모
커밋
8ea74e691f

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 847 - 835
src/xt_pages/dialysis/details/dialog/dialysisPrescriptionDialog.vue


+ 135 - 131
src/xt_pages/hospitalStation/components/deskPrescription.vue 파일 보기

@@ -2169,157 +2169,161 @@
2169 2169
         }
2170 2170
       },
2171 2171
       open(index, isLoading) {
2172
-        if (this.dayorMonth == 'day') {
2173
-          if (this.prescriptions[0].advices.length == 0 && this.prescriptions[0].project.length == 0) {
2174
-            this.$message.error('请先开处方')
2175
-            return
2176
-          }
2177
-
2178
-        }
2172
+        if(!isLoading){
2173
+          if (this.dayorMonth == 'day') {
2174
+            if (this.prescriptions[0].advices.length == 0 && this.prescriptions[0].project.length == 0) {
2175
+              this.$message.error('请先开处方')
2176
+              return
2177
+            }
2179 2178
 
2180
-        if (this.dayorMonth == 'day') {
2181
-          if (this.curPrescriptions.order_status == 2 ||this.curPrescriptions.order_status == 4 ) {
2182
-            this.$message.error('当前处方已经结算或者已经上传医保系统,无法保存')
2183
-            return
2184
-          }
2185
-          if (this.doctorValue.length <= 0) {
2186
-            this.$message.error('医生不能为空')
2187
-            return
2188 2179
           }
2189 2180
 
2190
-          if (this.departmentValue.length <= 0) {
2191
-            this.$message.error('科室不能为空')
2192
-            return
2193
-          }
2194
-          if (this.state1 <= 0) {
2195
-            this.$message.error('疾病类型不能为空')
2196
-            return
2197
-          }
2198
-          for (let i = 0; i < this.prescriptions.length; i++) {
2199
-            for (let b = 0; b < this.prescriptions[i].advices.length; b++) {
2200
-              if (this.prescriptions[i].advices[b].prescribing_number == 0 || this.prescriptions[i].advices[b].prescribing_number == '') {
2201
-                this.$message.error('药品处方总量不能为0')
2202
-                return
2203
-              }
2204
-            }
2205
-          }
2206
-          for (let i = 0; i < this.prescriptions.length; i++) {
2207
-            for (let b = 0; b < this.prescriptions[i].project.length; b++) {
2208
-              if (this.prescriptions[i].project[b].total == 0 || this.prescriptions[i].project[b].total == '') {
2209
-                this.$message.error('项目处方总量不能为0')
2210
-                return
2211
-              }
2181
+          if (this.dayorMonth == 'day') {
2182
+            if (this.curPrescriptions.order_status == 2 ||this.curPrescriptions.order_status == 4 ) {
2183
+              this.$message.error('当前处方已经结算或者已经上传医保系统,无法保存')
2184
+              return
2212 2185
             }
2213
-          }
2214
-          for (let i = 0; i < this.prescriptions.length; i++) {
2215
-            if (this.prescriptions[i].med_type == 0 || this.prescriptions[i].med_type == '') {
2216
-              this.$message.error('处方医疗类型不能为空')
2186
+            if (this.doctorValue.length <= 0) {
2187
+              this.$message.error('医生不能为空')
2217 2188
               return
2218 2189
             }
2219
-          }
2220
-          if (index == 1) {
2221
-            console.log(this.prescriptions)
2222
-
2223
-            // for (let i = 0; i < this.prescriptions.length; i++) {
2224
-            //   for(let b = 0; b < this.prescriptions[i].advices.length; b++){
2225
-            //     if (this.prescriptions[i].med_type == 14 && this.prescriptions[i].advices[b].drug.is_special_diseases != 1) {
2226
-            //       this.$message.error(this.prescriptions[i].name.toString() +"属于特病类型处方,开非特病类型的药")
2227
-            //       return
2228
-            //     }
2229
-            //   }
2230
-            //   for(let c = 0; c < this.prescriptions[i].project.length; c++){
2231
-            //     if (this.prescriptions[i].med_type == 14 && this.prescriptions[i].project[c].type == 2  && this.prescriptions[i].project[c].project.disease_directory != 1) {
2232
-            //       this.$message.error(this.prescriptions[i].name.toString() +"属于特病类型处方,请开特病类型的项目")
2233
-            //       return
2234
-            //     }
2235
-            //
2236
-            //     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) {
2237
-            //       this.$message.error(this.prescriptions[i].name.toString() +"属于特病类型处方,请开特病类型的耗材")
2238
-            //       return
2239
-            //     }
2240
-            //   }
2241
-            // }
2242
-            //
2243 2190
 
2191
+            if (this.departmentValue.length <= 0) {
2192
+              this.$message.error('科室不能为空')
2193
+              return
2194
+            }
2195
+            if (this.state1 <= 0) {
2196
+              this.$message.error('疾病类型不能为空')
2197
+              return
2198
+            }
2244 2199
             for (let i = 0; i < this.prescriptions.length; i++) {
2245
-              if (this.prescriptions[i].advices.length == 0 && this.prescriptions[i].project.length == 0) {
2246
-                this.$message.error('处方内容不能为空')
2247
-                return
2200
+              for (let b = 0; b < this.prescriptions[i].advices.length; b++) {
2201
+                if (this.prescriptions[i].advices[b].prescribing_number == 0 || this.prescriptions[i].advices[b].prescribing_number == '') {
2202
+                  this.$message.error('药品处方总量不能为0')
2203
+                  return
2204
+                }
2248 2205
               }
2249 2206
             }
2250
-
2251
-            let params = {
2252
-              p_type: 1,
2253
-              patient_id: this.patientInfo.id,
2254
-              diagnose: this.diagnose.join(','),
2255
-              sick_type: this.state1,
2256
-              sick_history: this.state2,
2257
-              doctor: this.doctorValue,
2258
-              department: this.departmentValue,
2259
-              record_date: this.record_date,
2260
-              his_patient_id: this.hisPatientInfo.id,
2261
-              reg_type: this.register_type
2207
+            for (let i = 0; i < this.prescriptions.length; i++) {
2208
+              for (let b = 0; b < this.prescriptions[i].project.length; b++) {
2209
+                if (this.prescriptions[i].project[b].total == 0 || this.prescriptions[i].project[b].total == '') {
2210
+                  this.$message.error('项目处方总量不能为0')
2211
+                  return
2212
+                }
2213
+              }
2262 2214
             }
2263
-
2264 2215
             for (let i = 0; i < this.prescriptions.length; i++) {
2265
-              if (this.prescriptions[i].advices.length > 0 && this.prescriptions[i].project.length == 0) {
2266
-                this.prescriptions[i]['type'] = 1
2216
+              if (this.prescriptions[i].med_type == 0 || this.prescriptions[i].med_type == '') {
2217
+                this.$message.error('处方医疗类型不能为空')
2218
+                return
2267 2219
               }
2268
-              if (this.prescriptions[i].advices.length == 0 && this.prescriptions[i].project.length > 0) {
2269
-                this.prescriptions[i]['type'] = 2
2220
+            }
2221
+            if (index == 1) {
2222
+              console.log(this.prescriptions)
2223
+
2224
+              // for (let i = 0; i < this.prescriptions.length; i++) {
2225
+              //   for(let b = 0; b < this.prescriptions[i].advices.length; b++){
2226
+              //     if (this.prescriptions[i].med_type == 14 && this.prescriptions[i].advices[b].drug.is_special_diseases != 1) {
2227
+              //       this.$message.error(this.prescriptions[i].name.toString() +"属于特病类型处方,开非特病类型的药")
2228
+              //       return
2229
+              //     }
2230
+              //   }
2231
+              //   for(let c = 0; c < this.prescriptions[i].project.length; c++){
2232
+              //     if (this.prescriptions[i].med_type == 14 && this.prescriptions[i].project[c].type == 2  && this.prescriptions[i].project[c].project.disease_directory != 1) {
2233
+              //       this.$message.error(this.prescriptions[i].name.toString() +"属于特病类型处方,请开特病类型的项目")
2234
+              //       return
2235
+              //     }
2236
+              //
2237
+              //     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) {
2238
+              //       this.$message.error(this.prescriptions[i].name.toString() +"属于特病类型处方,请开特病类型的耗材")
2239
+              //       return
2240
+              //     }
2241
+              //   }
2242
+              // }
2243
+              //
2244
+
2245
+              for (let i = 0; i < this.prescriptions.length; i++) {
2246
+                if (this.prescriptions[i].advices.length == 0 && this.prescriptions[i].project.length == 0) {
2247
+                  this.$message.error('处方内容不能为空')
2248
+                  return
2249
+                }
2250
+              }
2251
+              this.$emit('editKeepLoad', true)
2252
+              let params = {
2253
+                p_type: 1,
2254
+                patient_id: this.patientInfo.id,
2255
+                diagnose: this.diagnose.join(','),
2256
+                sick_type: this.state1,
2257
+                sick_history: this.state2,
2258
+                doctor: this.doctorValue,
2259
+                department: this.departmentValue,
2260
+                record_date: this.record_date,
2261
+                his_patient_id: this.hisPatientInfo.id,
2262
+                reg_type: this.register_type
2270 2263
               }
2271 2264
 
2272
-              for (let b = 0; b < this.prescriptions[i].advices.length; b++) {
2273
-                this.prescriptions[i].advices[b].single_dose = this.prescriptions[i].advices[b].single_dose.toString()
2274
-                this.prescriptions[i].advices[b].prescribing_number = this.prescriptions[i].advices[b].prescribing_number.toString()
2275
-                this.prescriptions[i].advices[b].retail_price = this.prescriptions[i].advices[b].retail_price.toString()
2276
-                this.prescriptions[i].advices[b].day = parseInt(this.prescriptions[i].advices[b].day)
2277
-                this.prescriptions[i].advices[b].groupno = parseInt(this.prescriptions[i].advices[b].groupno)
2265
+              for (let i = 0; i < this.prescriptions.length; i++) {
2266
+                if (this.prescriptions[i].advices.length > 0 && this.prescriptions[i].project.length == 0) {
2267
+                  this.prescriptions[i]['type'] = 1
2268
+                }
2269
+                if (this.prescriptions[i].advices.length == 0 && this.prescriptions[i].project.length > 0) {
2270
+                  this.prescriptions[i]['type'] = 2
2271
+                }
2278 2272
 
2279
-              }
2273
+                for (let b = 0; b < this.prescriptions[i].advices.length; b++) {
2274
+                  this.prescriptions[i].advices[b].single_dose = this.prescriptions[i].advices[b].single_dose.toString()
2275
+                  this.prescriptions[i].advices[b].prescribing_number = this.prescriptions[i].advices[b].prescribing_number.toString()
2276
+                  this.prescriptions[i].advices[b].retail_price = this.prescriptions[i].advices[b].retail_price.toString()
2277
+                  this.prescriptions[i].advices[b].day = parseInt(this.prescriptions[i].advices[b].day)
2278
+                  this.prescriptions[i].advices[b].groupno = parseInt(this.prescriptions[i].advices[b].groupno)
2280 2279
 
2281
-              for (let b = 0; b < this.prescriptions[i].project.length; b++) {
2282
-                this.prescriptions[i].project[b].price = this.prescriptions[i].project[b].price.toString()
2283
-                this.prescriptions[i].project[b].total = this.prescriptions[i].project[b].total.toString()
2284
-                this.prescriptions[i].project[b].delivery_way = this.prescriptions[i].project[b].delivery_way.toString()
2285
-                this.prescriptions[i].project[b].single_dose = this.prescriptions[i].project[b].single_dose.toString()
2280
+                }
2286 2281
 
2287
-              }
2282
+                for (let b = 0; b < this.prescriptions[i].project.length; b++) {
2283
+                  this.prescriptions[i].project[b].price = this.prescriptions[i].project[b].price.toString()
2284
+                  this.prescriptions[i].project[b].total = this.prescriptions[i].project[b].total.toString()
2285
+                  this.prescriptions[i].project[b].delivery_way = this.prescriptions[i].project[b].delivery_way.toString()
2286
+                  this.prescriptions[i].project[b].single_dose = this.prescriptions[i].project[b].single_dose.toString()
2288 2287
 
2289
-              for (let b = 0; b < this.prescriptions[i].addition.length; b++) {
2290
-                this.prescriptions[i].addition[b].id = prarseInt(this.prescriptions[i].addition[b].id)
2291
-                this.prescriptions[i].addition[b].item_id = parseInt(this.prescriptions[i].addition[b].item_id)
2292
-                this.prescriptions[i].addition[b].price = this.prescriptions[i].addition[b].price.toString()
2293
-                this.prescriptions[i].addition[b].count = this.prescriptions[i].addition[b].count.toString()
2294
-              }
2295
-            }
2296
-            let data = {
2297
-              'prescriptions': this.prescriptions
2298
-            }
2299
-            isLoading = true
2300
-            console.log('this.prescriptionsthis.prescriptions', this.prescriptions)
2301
-            let num = 0
2302
-            // this.prescriptions.map(item => {
2303
-            //   if (item.advices.length > 0) {
2304
-            //     item.advices.map(it => {
2305
-            //       if (it.drug.total <= 0) {
2306
-            //         num++
2307
-            //         setTimeout(() => {
2308
-            //           this.$message.error(it.drug.drug_name + '库存不足')
2309
-            //         }, 100)
2310
-            //       }
2311
-            //     })
2312
-            //   }
2313
-            // })
2314
-            if (num == 0) {
2315
-              createHisPrescription(data, params).then(response => {
2316
-                if (response.data.state == 1) {
2317
-                  this.$emit('change', this.patientInfo.id)
2318
-                  this.$message.success('保存成功')
2319
-                } else {
2320
-                  this.$message.error(response.data.msg)
2321 2288
                 }
2322
-              })
2289
+
2290
+                for (let b = 0; b < this.prescriptions[i].addition.length; b++) {
2291
+                  this.prescriptions[i].addition[b].id = prarseInt(this.prescriptions[i].addition[b].id)
2292
+                  this.prescriptions[i].addition[b].item_id = parseInt(this.prescriptions[i].addition[b].item_id)
2293
+                  this.prescriptions[i].addition[b].price = this.prescriptions[i].addition[b].price.toString()
2294
+                  this.prescriptions[i].addition[b].count = this.prescriptions[i].addition[b].count.toString()
2295
+                }
2296
+              }
2297
+              let data = {
2298
+                'prescriptions': this.prescriptions
2299
+              }
2300
+              isLoading = true
2301
+              console.log('this.prescriptionsthis.prescriptions', this.prescriptions)
2302
+              let num = 0
2303
+              // this.prescriptions.map(item => {
2304
+              //   if (item.advices.length > 0) {
2305
+              //     item.advices.map(it => {
2306
+              //       if (it.drug.total <= 0) {
2307
+              //         num++
2308
+              //         setTimeout(() => {
2309
+              //           this.$message.error(it.drug.drug_name + '库存不足')
2310
+              //         }, 100)
2311
+              //       }
2312
+              //     })
2313
+              //   }
2314
+              // })
2315
+              if (num == 0) {
2316
+                createHisPrescription(data, params).then(response => {
2317
+                  if (response.data.state == 1) {
2318
+                    this.$emit('change', this.patientInfo.id)
2319
+                    this.$message.success('保存成功')
2320
+                    this.$emit('editKeepLoad', false)
2321
+                  } else {
2322
+                    this.$message.error(response.data.msg)
2323
+                    this.$emit('editKeepLoad', false)
2324
+                  }
2325
+                })
2326
+              }
2323 2327
             }
2324 2328
 
2325 2329
           } else if (index == 2) {

+ 4 - 1
src/xt_pages/hospitalStation/doctorDesk.vue 파일 보기

@@ -121,7 +121,7 @@
121 121
                                    :month_prescriptions="month_prescriptions"
122 122
                                    ref="prescriptions" :prescriptions="prescriptions" :patientInfo="patientInfo"
123 123
                                    :hisPatientInfo="hisPatientInfo" @event1="changetwo($event)"
124
-                                   :org_id="org_id"
124
+                                   :org_id="org_id" @editKeepLoad="editKeepLoad"
125 125
                                    v-if="titleType == '电子处方'" style="flex:1;"></desk-prescription>
126 126
 
127 127
 
@@ -397,6 +397,9 @@
397 397
       }
398 398
     },
399 399
     methods: {
400
+      editKeepLoad(data){
401
+        this.saveLoading = data
402
+      },
400 403
       changeTimeTwo() {
401 404
         this.getList()
402 405
       },

+ 128 - 124
src/xt_pages/outpatientDoctorStation/components/deskPrescription.vue 파일 보기

@@ -2167,159 +2167,163 @@
2167 2167
         }
2168 2168
       },
2169 2169
       open(index, isLoading) {
2170
-        if (this.dayorMonth == 'day') {
2171
-          if (this.prescriptions[0].advices.length == 0 && this.prescriptions[0].project.length == 0) {
2172
-            this.$message.error('请先开处方')
2173
-            return
2174
-          }
2175
-
2176
-        }
2170
+        if(!isLoading){
2171
+          if (this.dayorMonth == 'day') {
2172
+            if (this.prescriptions[0].advices.length == 0 && this.prescriptions[0].project.length == 0) {
2173
+              this.$message.error('请先开处方')
2174
+              return
2175
+            }
2177 2176
 
2178
-        if (this.dayorMonth == 'day') {
2179
-          if (this.curPrescriptions.order_status == 2) {
2180
-            this.$message.error('当前处方已经结算,无法保存')
2181
-            return
2182
-          }
2183
-          if (this.doctorValue.length <= 0) {
2184
-            this.$message.error('医生不能为空')
2185
-            return
2186 2177
           }
2187 2178
 
2188
-          if (this.departmentValue.length <= 0) {
2189
-            this.$message.error('科室不能为空')
2190
-            return
2191
-          }
2192
-          if (this.state1 <= 0) {
2193
-            this.$message.error('疾病类型不能为空')
2194
-            return
2195
-          }
2196
-          for (let i = 0; i < this.prescriptions.length; i++) {
2197
-            for (let b = 0; b < this.prescriptions[i].advices.length; b++) {
2198
-              if (this.prescriptions[i].advices[b].prescribing_number == 0 || this.prescriptions[i].advices[b].prescribing_number == '') {
2199
-                this.$message.error('药品处方总量不能为0')
2200
-                return
2201
-              }
2202
-            }
2203
-          }
2204
-          for (let i = 0; i < this.prescriptions.length; i++) {
2205
-            for (let b = 0; b < this.prescriptions[i].project.length; b++) {
2206
-              if (this.prescriptions[i].project[b].total == 0 || this.prescriptions[i].project[b].total == '') {
2207
-                this.$message.error('项目处方总量不能为0')
2208
-                return
2209
-              }
2179
+          if (this.dayorMonth == 'day') {
2180
+            if (this.curPrescriptions.order_status == 2) {
2181
+              this.$message.error('当前处方已经结算,无法保存')
2182
+              return
2210 2183
             }
2211
-          }
2212
-          for (let i = 0; i < this.prescriptions.length; i++) {
2213
-            if (this.prescriptions[i].med_type == 0 || this.prescriptions[i].med_type == '') {
2214
-              this.$message.error('处方医疗类型不能为空')
2184
+            if (this.doctorValue.length <= 0) {
2185
+              this.$message.error('医生不能为空')
2215 2186
               return
2216 2187
             }
2217
-          }
2218
-          if (index == 1) {
2219
-            console.log(this.prescriptions)
2220 2188
 
2189
+            if (this.departmentValue.length <= 0) {
2190
+              this.$message.error('科室不能为空')
2191
+              return
2192
+            }
2193
+            if (this.state1 <= 0) {
2194
+              this.$message.error('疾病类型不能为空')
2195
+              return
2196
+            }
2221 2197
             for (let i = 0; i < this.prescriptions.length; i++) {
2222
-              for(let b = 0; b < this.prescriptions[i].advices.length; b++){
2223
-                if (this.prescriptions[i].med_type == 14 && this.prescriptions[i].advices[b].drug.is_special_diseases != 1) {
2224
-                  this.$message.error(this.prescriptions[i].name.toString() +"属于特病类型处方,不能开非特病类型的药")
2198
+              for (let b = 0; b < this.prescriptions[i].advices.length; b++) {
2199
+                if (this.prescriptions[i].advices[b].prescribing_number == 0 || this.prescriptions[i].advices[b].prescribing_number == '') {
2200
+                  this.$message.error('药品处方总量不能为0')
2225 2201
                   return
2226 2202
                 }
2227 2203
               }
2228
-              for(let c = 0; c < this.prescriptions[i].project.length; c++){
2229
-                if (this.prescriptions[i].med_type == 14 && this.prescriptions[i].project[c].type == 2  && this.prescriptions[i].project[c].project.disease_directory != 1) {
2230
-                  this.$message.error(this.prescriptions[i].name.toString() +"属于特病类型处方,请开特病类型的项目")
2231
-                  return
2232
-                }
2233
-
2234
-                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) {
2235
-                  this.$message.error(this.prescriptions[i].name.toString() +"属于特病类型处方,请开特病类型的耗材")
2204
+            }
2205
+            for (let i = 0; i < this.prescriptions.length; i++) {
2206
+              for (let b = 0; b < this.prescriptions[i].project.length; b++) {
2207
+                if (this.prescriptions[i].project[b].total == 0 || this.prescriptions[i].project[b].total == '') {
2208
+                  this.$message.error('项目处方总量不能为0')
2236 2209
                   return
2237 2210
                 }
2238 2211
               }
2239 2212
             }
2240
-
2241
-
2242 2213
             for (let i = 0; i < this.prescriptions.length; i++) {
2243
-              if (this.prescriptions[i].advices.length == 0 && this.prescriptions[i].project.length == 0) {
2244
-                this.$message.error('处方内容不能为空')
2214
+              if (this.prescriptions[i].med_type == 0 || this.prescriptions[i].med_type == '') {
2215
+                this.$message.error('处方医疗类型不能为空')
2245 2216
                 return
2246 2217
               }
2247 2218
             }
2219
+            if (index == 1) {
2220
+              console.log(this.prescriptions)
2248 2221
 
2249
-            let params = {
2250
-              p_type: 2,
2251
-              patient_id: this.patientInfo.id,
2252
-              diagnose: this.diagnose.join(','),
2253
-              sick_type: this.state1,
2254
-              sick_history: this.state2,
2255
-              doctor: this.doctorValue,
2256
-              department: this.departmentValue,
2257
-              record_date: this.record_date,
2258
-              his_patient_id: this.hisPatientInfo.id,
2259
-              reg_type: this.register_type
2260
-            }
2222
+              for (let i = 0; i < this.prescriptions.length; i++) {
2223
+                for(let b = 0; b < this.prescriptions[i].advices.length; b++){
2224
+                  if (this.prescriptions[i].med_type == 14 && this.prescriptions[i].advices[b].drug.is_special_diseases != 1) {
2225
+                    this.$message.error(this.prescriptions[i].name.toString() +"属于特病类型处方,不能开非特病类型的药")
2226
+                    return
2227
+                  }
2228
+                }
2229
+                for(let c = 0; c < this.prescriptions[i].project.length; c++){
2230
+                  if (this.prescriptions[i].med_type == 14 && this.prescriptions[i].project[c].type == 2  && this.prescriptions[i].project[c].project.disease_directory != 1) {
2231
+                    this.$message.error(this.prescriptions[i].name.toString() +"属于特病类型处方,请开特病类型的项目")
2232
+                    return
2233
+                  }
2261 2234
 
2262
-            for (let i = 0; i < this.prescriptions.length; i++) {
2263
-              if (this.prescriptions[i].advices.length > 0 && this.prescriptions[i].project.length == 0) {
2264
-                this.prescriptions[i]['type'] = 1
2265
-              }
2266
-              if (this.prescriptions[i].advices.length == 0 && this.prescriptions[i].project.length > 0) {
2267
-                this.prescriptions[i]['type'] = 2
2235
+                  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) {
2236
+                    this.$message.error(this.prescriptions[i].name.toString() +"属于特病类型处方,请开特病类型的耗材")
2237
+                    return
2238
+                  }
2239
+                }
2268 2240
               }
2269 2241
 
2270
-              for (let b = 0; b < this.prescriptions[i].advices.length; b++) {
2271
-                this.prescriptions[i].advices[b].single_dose = this.prescriptions[i].advices[b].single_dose.toString()
2272
-                this.prescriptions[i].advices[b].prescribing_number = this.prescriptions[i].advices[b].prescribing_number.toString()
2273
-                this.prescriptions[i].advices[b].retail_price = this.prescriptions[i].advices[b].retail_price.toString()
2274
-                this.prescriptions[i].advices[b].day = parseInt(this.prescriptions[i].advices[b].day)
2275
-                this.prescriptions[i].advices[b].groupno = parseInt(this.prescriptions[i].advices[b].groupno)
2276 2242
 
2243
+              for (let i = 0; i < this.prescriptions.length; i++) {
2244
+                if (this.prescriptions[i].advices.length == 0 && this.prescriptions[i].project.length == 0) {
2245
+                  this.$message.error('处方内容不能为空')
2246
+                  return
2247
+                }
2248
+              }
2249
+              this.$emit('editKeepLoad', true)
2250
+              let params = {
2251
+                p_type: 2,
2252
+                patient_id: this.patientInfo.id,
2253
+                diagnose: this.diagnose.join(','),
2254
+                sick_type: this.state1,
2255
+                sick_history: this.state2,
2256
+                doctor: this.doctorValue,
2257
+                department: this.departmentValue,
2258
+                record_date: this.record_date,
2259
+                his_patient_id: this.hisPatientInfo.id,
2260
+                reg_type: this.register_type
2277 2261
               }
2278 2262
 
2279
-              for (let b = 0; b < this.prescriptions[i].project.length; b++) {
2280
-                this.prescriptions[i].project[b].price = this.prescriptions[i].project[b].price.toString()
2281
-                this.prescriptions[i].project[b].total = this.prescriptions[i].project[b].total.toString()
2282
-                this.prescriptions[i].project[b].delivery_way = this.prescriptions[i].project[b].delivery_way.toString()
2283
-                this.prescriptions[i].project[b].single_dose = this.prescriptions[i].project[b].single_dose.toString()
2263
+              for (let i = 0; i < this.prescriptions.length; i++) {
2264
+                if (this.prescriptions[i].advices.length > 0 && this.prescriptions[i].project.length == 0) {
2265
+                  this.prescriptions[i]['type'] = 1
2266
+                }
2267
+                if (this.prescriptions[i].advices.length == 0 && this.prescriptions[i].project.length > 0) {
2268
+                  this.prescriptions[i]['type'] = 2
2269
+                }
2284 2270
 
2285
-              }
2271
+                for (let b = 0; b < this.prescriptions[i].advices.length; b++) {
2272
+                  this.prescriptions[i].advices[b].single_dose = this.prescriptions[i].advices[b].single_dose.toString()
2273
+                  this.prescriptions[i].advices[b].prescribing_number = this.prescriptions[i].advices[b].prescribing_number.toString()
2274
+                  this.prescriptions[i].advices[b].retail_price = this.prescriptions[i].advices[b].retail_price.toString()
2275
+                  this.prescriptions[i].advices[b].day = parseInt(this.prescriptions[i].advices[b].day)
2276
+                  this.prescriptions[i].advices[b].groupno = parseInt(this.prescriptions[i].advices[b].groupno)
2286 2277
 
2287
-              for (let b = 0; b < this.prescriptions[i].addition.length; b++) {
2288
-                this.prescriptions[i].addition[b].id = prarseInt(this.prescriptions[i].addition[b].id)
2289
-                this.prescriptions[i].addition[b].item_id = parseInt(this.prescriptions[i].addition[b].item_id)
2290
-                this.prescriptions[i].addition[b].price = this.prescriptions[i].addition[b].price.toString()
2291
-                this.prescriptions[i].addition[b].count = this.prescriptions[i].addition[b].count.toString()
2292
-              }
2293
-            }
2294
-            let data = {
2295
-              'prescriptions': this.prescriptions
2296
-            }
2297
-            isLoading = true
2298
-            console.log('this.prescriptionsthis.prescriptions', this.prescriptions)
2299
-            let num = 0
2300
-            // this.prescriptions.map(item => {
2301
-            //   if (item.advices.length > 0) {
2302
-            //     item.advices.map(it => {
2303
-            //       if (it.drug.total <= 0) {
2304
-            //         num++
2305
-            //         setTimeout(() => {
2306
-            //           this.$message.error(it.drug.drug_name + '库存不足')
2307
-            //         }, 100)
2308
-            //       }
2309
-            //     })
2310
-            //   }
2311
-            // })
2312
-            if (num == 0) {
2313
-
2314
-              createHisPrescription(data, params).then(response => {
2315
-                if (response.data.state == 1) {
2316
-                  this.$emit('change', this.patientInfo.id)
2317
-                  this.$message.success('保存成功')
2318
-                } else {
2319
-                  this.$message.error(response.data.msg)
2320 2278
                 }
2321
-              })
2322
-            }
2279
+
2280
+                for (let b = 0; b < this.prescriptions[i].project.length; b++) {
2281
+                  this.prescriptions[i].project[b].price = this.prescriptions[i].project[b].price.toString()
2282
+                  this.prescriptions[i].project[b].total = this.prescriptions[i].project[b].total.toString()
2283
+                  this.prescriptions[i].project[b].delivery_way = this.prescriptions[i].project[b].delivery_way.toString()
2284
+                  this.prescriptions[i].project[b].single_dose = this.prescriptions[i].project[b].single_dose.toString()
2285
+
2286
+                }
2287
+
2288
+                for (let b = 0; b < this.prescriptions[i].addition.length; b++) {
2289
+                  this.prescriptions[i].addition[b].id = prarseInt(this.prescriptions[i].addition[b].id)
2290
+                  this.prescriptions[i].addition[b].item_id = parseInt(this.prescriptions[i].addition[b].item_id)
2291
+                  this.prescriptions[i].addition[b].price = this.prescriptions[i].addition[b].price.toString()
2292
+                  this.prescriptions[i].addition[b].count = this.prescriptions[i].addition[b].count.toString()
2293
+                }
2294
+              }
2295
+              let data = {
2296
+                'prescriptions': this.prescriptions
2297
+              }
2298
+              isLoading = true
2299
+              console.log('this.prescriptionsthis.prescriptions', this.prescriptions)
2300
+              let num = 0
2301
+              // this.prescriptions.map(item => {
2302
+              //   if (item.advices.length > 0) {
2303
+              //     item.advices.map(it => {
2304
+              //       if (it.drug.total <= 0) {
2305
+              //         num++
2306
+              //         setTimeout(() => {
2307
+              //           this.$message.error(it.drug.drug_name + '库存不足')
2308
+              //         }, 100)
2309
+              //       }
2310
+              //     })
2311
+              //   }
2312
+              // })
2313
+              if (num == 0) {
2314
+
2315
+                createHisPrescription(data, params).then(response => {
2316
+                  if (response.data.state == 1) {
2317
+                    this.$emit('change', this.patientInfo.id)
2318
+                    this.$message.success('保存成功')
2319
+                    this.$emit('editKeepLoad', false)
2320
+                  } else {
2321
+                    this.$message.error(response.data.msg)
2322
+                    this.$emit('editKeepLoad', false)
2323
+                  }
2324
+                })
2325
+              }
2326
+          }
2323 2327
 
2324 2328
           } else if (index == 2) {
2325 2329
             this.$router.push('/outpatientDoctorStation/print')

+ 6 - 3
src/xt_pages/outpatientDoctorStation/doctorDesk.vue 파일 보기

@@ -135,7 +135,7 @@
135 135
                         <!-- <el-button size="small" ref="button_four"  @click="open(5)" type="primary" :disabled='prescriptions && prescriptions[0].advices && prescriptions[0].project ? prescriptions[0].advices.length == 0 && prescriptions[0].project.length == 0 : false'>存模板</el-button> -->
136 136
                     </div>
137 137
                     <div class="mainCell fixedCell" style="float:right" v-if="titleType == '电子病历'">
138
-                        <el-button size="small" @click="opentwo(1)" type="primary">保存</el-button>
138
+                        <el-button size="small" :loading="keepLoad" @click="opentwo(1)" type="primary">保存</el-button>
139 139
                         <el-button size="small" @click="opentwo(2)" type="primary">打印</el-button>
140 140
                         <el-button size="small" @click="opentwo(3)" type="primary">病历调用</el-button>
141 141
                         <el-button size="small" @click="opentwo(4)" type="primary">存模板</el-button>
@@ -157,7 +157,7 @@
157 157
                                    :month_prescriptions="month_prescriptions"
158 158
                                    :org_id="org_id"
159 159
                                    ref="prescriptions" :prescriptions="prescriptions" :patientInfo="patientInfo"
160
-                                   :hisPatientInfo="hisPatientInfo" @event1="changetwo($event)"
160
+                                   :hisPatientInfo="hisPatientInfo" @event1="changetwo($event)" @editKeepLoad="editKeepLoad"
161 161
                                    v-if="titleType == '电子处方'" style="flex:1;"></desk-prescription>
162 162
 
163 163
 
@@ -425,10 +425,13 @@
425 425
         all_his_patients: [],
426 426
         checkVisible: false,
427 427
         current_tab: 'day',
428
-        org_id:0,
428
+        org_id:0
429 429
       }
430 430
     },
431 431
     methods: {
432
+      editKeepLoad(data){
433
+        this.saveLoading = data
434
+      },
432 435
       changeTimeTwo() {
433 436
         this.getList()
434 437
       },

+ 18 - 5
src/xt_pages/outpatientDoctorStation/prescriptionTemplate.vue 파일 보기

@@ -174,12 +174,12 @@
174 174
         })
175 175
 
176 176
       },
177
-      choosePatient(val) {
177
+      choosePatient(val,column) {
178 178
         this.page = 1
179 179
         this.limit = 10
180 180
         this.patient_id = val.id
181 181
         this.patient_name = val.name
182
-
182
+        sessionStorage.setItem('templateIndex', val.id)
183 183
         let params = {
184 184
           patient_id: val.id,
185 185
           page: this.page,
@@ -203,10 +203,23 @@
203 203
           if (response.data.state == 1) {
204 204
             this.data = response.data.data.list
205 205
             this.all_data = response.data.data.list
206
+            let index = null
207
+            if(sessionStorage.getItem('templateIndex') && sessionStorage.getItem('templateIndex') != ''){
208
+              this.data.map((item, i) => {
209
+                if(sessionStorage.getItem('templateIndex') == item.id){
210
+                  index = i
211
+                }
212
+              })
213
+              this.$refs.tab.setCurrentRow(this.data[index])
214
+              this.patient_id = this.data[index].id
215
+              this.patient_name = this.data[index].name
216
+            }else{
217
+              this.$refs.tab.setCurrentRow(this.data[0])
218
+              this.patient_id = this.data[0].id
219
+              this.patient_name = this.data[0].name
220
+            }
206 221
 
207
-            this.$refs.tab.setCurrentRow(this.data[0])
208
-            this.patient_id = this.data[0].id
209
-            this.patient_name = this.data[0].name
222
+            
210 223
             this.GetPrescriptionTemplateList()
211 224
 
212 225
           }

+ 1 - 0
src/xt_pages/outpatientDoctorStation/prescriptionTemplatedetail.vue 파일 보기

@@ -491,6 +491,7 @@
491 491
                 delete this.modeOptions[mkey]
492 492
               }
493 493
             }
494
+            this.$router.go(-1)
494 495
           } else {
495 496
             this.$message.error(response.data.msg)
496 497
           }