陈少旭 пре 2 дана
родитељ
комит
753da39d39

+ 19 - 8
src/api/project/project.js Прегледај датотеку

@@ -199,6 +199,17 @@ export function DeleteProject(id,params){
199 199
   })
200 200
 }
201 201
 
202
+export function DeleteDrug(id,params){
203
+
204
+  return request({
205
+    url:"/api/his/deletedrug?id="+id,
206
+    methods:"Get",
207
+    params:params
208
+  })
209
+}
210
+
211
+
212
+
202 213
 
203 214
 export function getHisProject(params){
204 215
 
@@ -553,18 +564,18 @@ export function getAllGoodInfoList(params){
553 564
 
554 565
 
555 566
 export function saveGoodList(params,data){
556
-  
567
+
557 568
   return request({
558 569
     url:"/api/savegoodlist",
559 570
     method:"post",
560 571
     params:params,
561 572
     data:data,
562
-   
573
+
563 574
   })
564 575
 }
565 576
 
566 577
 export function getGoodList(params){
567
- 
578
+
568 579
   return request({
569 580
     url:"/api/getgoodlist",
570 581
     method:"get",
@@ -574,7 +585,7 @@ export function getGoodList(params){
574 585
 
575 586
 
576 587
 export function getGoodNameDetail(id,params){
577
-  
588
+
578 589
   return request({
579 590
     url:"/api/getgoodnamedetail?id="+id,
580 591
     method:"get",
@@ -589,12 +600,12 @@ export function updateGoodList(params,data){
589 600
     method:"post",
590 601
     params:params,
591 602
     data:data,
592
-   
603
+
593 604
   })
594 605
 }
595 606
 
596 607
 export function DeleteGoodTeam(id,params){
597
- 
608
+
598 609
   return  request({
599 610
     url:"/api/deletegoodteam?id="+id,
600 611
     method:"Get",
@@ -603,10 +614,10 @@ export function DeleteGoodTeam(id,params){
603 614
 }
604 615
 
605 616
 export function DeleteGood(id,params){
606
- 
617
+
607 618
   return request({
608 619
     url:"/api/deletegood?id="+id,
609 620
     method:"get",
610 621
     params:params
611 622
   })
612
-}
623
+}

+ 1 - 1
src/store/modules/globalConfig.js Прегледај датотеку

@@ -68300,7 +68300,7 @@ const global_config = {
68300 68300
         id: 4,
68301 68301
         name: '丧偶'
68302 68302
       }
68303
-      
68303
+
68304 68304
     ],
68305 68305
     reimbursement_ways: [ // 报销方式
68306 68306
       {

+ 429 - 61
src/xt_pages/data/components/addInspection.vue Прегледај датотеку

@@ -1,7 +1,7 @@
1 1
 <template>
2 2
   <el-dialog
3 3
     :title="formTitle"
4
-    width="900px"
4
+    width="1200px"
5 5
     :visible.sync="visible"
6 6
     :before-close="_close"
7 7
   >
@@ -101,31 +101,98 @@
101 101
             filterable
102 102
             placeholder="请选择"
103 103
             @change="changeProject"
104
-            
104
+
105 105
           >
106 106
             <el-option
107 107
               v-for="item in projectList"
108 108
               :key="item.new_id"
109
-              :label="item.project_name"
109
+              :label="item.type == 1 ?item.drug_name :item.project_name"
110 110
               :value="item.new_id"
111 111
             >
112 112
             </el-option>
113 113
           </el-select>
114 114
         </el-form-item>
115 115
 
116
-        <el-form-item label="数量" style="width: 50%">
117
-          <div style="display: flex">
118
-            <el-input
119
-              v-model="form.number"
120
-              style="margin-right: 10px"
121
-            ></el-input>
116
+<!--        <el-form-item label="数量" style="width: 50%">-->
117
+<!--          <div style="display: flex">-->
118
+<!--            <el-input-->
119
+<!--              v-model="form.number"-->
120
+<!--              style="margin-right: 10px"-->
121
+<!--            ></el-input>-->
122 122
             <el-button type="primary" @click="addProjectList">添加</el-button>
123
-          </div>
124
-        </el-form-item>
123
+<!--          </div>-->
124
+<!--        </el-form-item>-->
125 125
       </el-form>
126 126
       <el-form>
127
+<!--        <el-table-->
128
+<!--          :data="tableData"-->
129
+<!--          max-height="300"-->
130
+<!--          border-->
131
+<!--          style="100%"-->
132
+<!--          :row-style="{ color: '#303133' }"-->
133
+<!--          :header-cell-style="{-->
134
+<!--            backgroundColor: 'rgb(245, 247, 250)',-->
135
+<!--            color: '#606266',-->
136
+<!--          }"-->
137
+<!--          highlight-current-row-->
138
+<!--          ref="tab"-->
139
+<!--        >-->
140
+<!--          <el-table-column align="center" prop="name" label="分类" width="120">-->
141
+<!--            <template slot-scope="scope">-->
142
+<!--              <div>-->
143
+<!--                {{-->
144
+<!--                  scope.row.type == 2-->
145
+<!--                    ? getId(scope.row.statistical_classification)-->
146
+<!--                    : "耗材"-->
147
+<!--                }}-->
148
+<!--              </div>-->
149
+<!--            </template>-->
150
+<!--          </el-table-column>-->
151
+<!--          <el-table-column-->
152
+<!--            align="center"-->
153
+<!--            prop="name"-->
154
+<!--            label="组套明细"-->
155
+<!--            width="120"-->
156
+<!--          >-->
157
+<!--            <template slot-scope="scope">{{ scope.row.project_name }}</template>-->
158
+<!--          </el-table-column>-->
159
+<!--          <el-table-column align="center" prop="name" label="数量" width="120">-->
160
+<!--            <template slot-scope="scope">{{ scope.row.number }}</template>-->
161
+<!--          </el-table-column>-->
162
+<!--          <el-table-column align="center" prop="name" label="单位" width="120">-->
163
+<!--            <template slot-scope="scope">-->
164
+<!--              <div v-if="scope.row.type == 2">{{ scope.row.unit }}</div>-->
165
+<!--              <div v-if="scope.row.type == 3">-->
166
+<!--               {{ scope.row.unit }}-->
167
+<!--              </div>-->
168
+<!--            </template>-->
169
+<!--          </el-table-column>-->
170
+<!--          <el-table-column align="center" prop="name" label="单价" width="120">-->
171
+<!--            <template slot-scope="scope">{{ scope.row.price }}</template>-->
172
+<!--          </el-table-column>-->
173
+<!--          <el-table-column align="center" prop="name" label="操作" >-->
174
+<!--            <template slot-scope="scope">-->
175
+<!--              <el-tooltip-->
176
+<!--                class="item"-->
177
+<!--                effect="dark"-->
178
+<!--                content="删除"-->
179
+<!--                placement="top"-->
180
+<!--              >-->
181
+<!--                <el-button-->
182
+<!--                  type="danger"-->
183
+<!--                  icon="el-icon-delete"-->
184
+<!--                  size="small"-->
185
+<!--                  @click="DeleteProject(scope.row.id, scope.$index,scope.row.type)"-->
186
+<!--                ></el-button>-->
187
+<!--              </el-tooltip>-->
188
+<!--            </template>-->
189
+<!--          </el-table-column>-->
190
+<!--        </el-table>-->
191
+
192
+
127 193
         <el-table
128
-          :data="tableData"
194
+          :data="drug_tableData"
195
+          max-height="300"
129 196
           border
130 197
           style="100%"
131 198
           :row-style="{ color: '#303133' }"
@@ -136,40 +203,149 @@
136 203
           highlight-current-row
137 204
           ref="tab"
138 205
         >
139
-          <el-table-column align="center" prop="name" label="分类" width="120">
206
+          <el-table-column align="center"  label="名称" fixed>
207
+            <template slot-scope="scope"><span>{{ scope.row.type == 1?scope.row.drug_name: scope.row.project_name}}</span>
208
+            </template>
209
+          </el-table-column>
210
+
211
+          <el-table-column align="center" prop="drug_name" width="100" label="规格">
140 212
             <template slot-scope="scope">
141
-              <div>
142
-                {{
143
-                  scope.row.type == 2
144
-                    ? getId(scope.row.statistical_classification)
145
-                    : "耗材"
146
-                }}
147
-              </div>
213
+                  <span v-if="scope.row.type == 1">
214
+                    {{ scope.row.dose }}{{ scope.row.dose_unit }}*{{ scope.row.min_number }}{{ scope.row.min_unit }}/{{ scope.row.max_unit }}
215
+                  </span>
216
+                <span v-if="scope.row.type == 2">
217
+                    {{ "次" }}
218
+
219
+                  </span>
220
+              <span v-if="scope.row.type == 3">
221
+                    {{ scope.row.specification_name }}
222
+                  </span>
148 223
             </template>
149 224
           </el-table-column>
150
-          <el-table-column
151
-            align="center"
152
-            prop="name"
153
-            label="组套明细"
154
-            width="120"
155
-          >
156
-            <template slot-scope="scope">{{ scope.row.project_name }}</template>
225
+          <el-table-column align="center" prop="single_dose" width="180" label="单次用量">
226
+            <template slot-scope="scope">
227
+              <div style="display:flex;align-items:center;" v-if="scope.row.type == 1">
228
+                <el-input  v-model="scope.row.single_dose" @input="getAllChangeTwo(scope)"
229
+                          style="width:50%;"></el-input>
230
+                <!-- <div>{{scope.row.single_dose_unit}}</div> -->
231
+                <el-select v-model="scope.row.single_dose_unit" placeholder="请选择" style="width:50%;"
232
+                           @change="getAllChangeTwo(scope)"  >
233
+                  <el-option :label="scope.row.min_unit" :value="scope.row.min_unit"></el-option>
234
+                  <el-option :label="scope.row.min_unit" :value="scope.row.min_unit"></el-option>
235
+
236
+                  <el-option :label="scope.row.dose_unit"
237
+                             v-if="scope.row.dose_unit != scope.row.min_unit"
238
+                             :value="scope.row.dose_unit"></el-option>
239
+                </el-select>
240
+              </div>
241
+              <span v-if="scope.row.type == 2">
242
+                  </span>
243
+              <span v-if="scope.row.type == 3">
244
+                  </span>
245
+            </template>
157 246
           </el-table-column>
158
-          <el-table-column align="center" prop="name" label="数量" width="120">
159
-            <template slot-scope="scope">{{ scope.row.number }}</template>
247
+          <el-table-column align="center" prop="delivery_way" width="100" label="用法">
248
+            <template slot-scope="scope">
249
+              <div v-if="scope.row.type == 1">
250
+              <el-select v-model="scope.row.delivery_way" placeholder="请选择">
251
+                <el-option
252
+                  v-for="(item,index) in drugways"
253
+                  :key="index"
254
+                  :label="item.name"
255
+                  :value="item.name">
256
+                </el-option>
257
+              </el-select>
258
+              </div>
259
+              <div v-if="scope.row.type == 2">
260
+
261
+              </div>
262
+              <div v-if="scope.row.type == 3">
263
+
264
+              </div>
265
+            </template>
160 266
           </el-table-column>
161
-          <el-table-column align="center" prop="name" label="单位" width="120">
267
+          <el-table-column align="center" prop="execution_frequency" width="100" label="频率">
162 268
             <template slot-scope="scope">
163
-              <div v-if="scope.row.type == 2">{{ scope.row.unit }}</div>
269
+              <div v-if="scope.row.type == 1">
270
+              <el-select  v-model="scope.row.execution_frequency" placeholder="请选择" @change="getAllChangeTwo(scope)">
271
+                <el-option
272
+                  v-for="item,index in efs"
273
+                  :key="index"
274
+                  :label="item.name"
275
+                  :value="item.name">
276
+                </el-option>
277
+              </el-select>
278
+              </div>
279
+              <div v-if="scope.row.type == 2">
280
+
281
+              </div>
164 282
               <div v-if="scope.row.type == 3">
165
-               {{ scope.row.unit }}
283
+
166 284
               </div>
167 285
             </template>
168 286
           </el-table-column>
169
-          <el-table-column align="center" prop="name" label="单价" width="120">
170
-            <template slot-scope="scope">{{ scope.row.price }}</template>
287
+
288
+          <el-table-column align="center" prop="day" width="100" label="天数">
289
+            <template slot-scope="scope">
290
+              <div style="display:flex;align-items:center;" v-if="scope.row.type == 1">
291
+                <el-input  v-model="scope.row.day" @input="getAllChangeTwo(scope)" placeholder=""></el-input>
292
+                {{'天'}}
293
+              </div>
294
+              <div style="display:flex;align-items:center;" v-if="scope.row.type == 2">
295
+<!--                {{'1天'}}-->
296
+              </div>
297
+              <div style="display:flex;align-items:center;" v-if="scope.row.type == 3">
298
+<!--                {{'1天'}}-->
299
+              </div>
300
+            </template>
301
+          </el-table-column>
302
+
303
+          <el-table-column align="center" prop="prescribing_number" width="150" label="总量">
304
+            <template slot-scope="scope">
305
+              <div style="display:flex;align-items:center;" v-if="scope.row.type == 1">
306
+                <el-input v-model="scope.row.prescribing_number"
307
+                          style="width:50%" placeholder=""></el-input>
308
+                <!-- <div> {{scope.row.prescribing_number_unit}}</div> -->
309
+                <el-select v-model="scope.row.prescribing_number_unit" placeholder="请选择" style="width:50%;"
310
+                           @change="getPrescribingNumberUnit(scope)">
311
+                  <el-option :label="scope.row.min_unit" :value="scope.row.min_unit"></el-option>
312
+                  <el-option :label="scope.row.max_unit"
313
+                             v-if="scope.row.min_unit != scope.row.max_unit"
314
+                             :value="scope.row.max_unit"></el-option>
315
+                </el-select>
316
+              </div>
317
+              <div style="display:flex;align-items:center;" v-if="scope.row.type == 2">
318
+                <el-input v-model="scope.row.prescribing_number"
319
+                          style="width:50%" placeholder=""></el-input>
320
+                <div>{{scope.row.unit }}</div>
321
+              </div>
322
+              <div style="display:flex;align-items:center;" v-if="scope.row.type == 3">
323
+                <el-input v-model="scope.row.prescribing_number"
324
+                          style="width:50%" placeholder=""></el-input>
325
+                <div>{{scope.row.unit }}</div>
326
+              </div>
327
+            </template>
171 328
           </el-table-column>
172
-          <el-table-column align="center" prop="name" label="操作">
329
+          <el-table-column align="center" prop="retail_price" width="100" label="单价">
330
+            <template slot-scope="scope">
331
+              <div style="display:flex;align-items:center;" v-if="scope.row.type == 1">
332
+                <el-input v-model="scope.row.retail_price" placeholder="" readonly></el-input>
333
+                <div>{{'元'}}</div>
334
+              </div>
335
+
336
+              <div style="display:flex;align-items:center;" v-if="scope.row.type == 2">
337
+                <el-input v-model="scope.row.retail_price" placeholder="" readonly></el-input>
338
+                <div>{{'元'}}</div>
339
+<!--                <div>{{scope.row.price }}</div>-->
340
+              </div>
341
+              <div style="display:flex;align-items:center;" v-if="scope.row.type == 3">
342
+                <el-input v-model="scope.row.retail_price" placeholder="" readonly></el-input>
343
+                <div>{{'元'}}</div>
344
+              </div>
345
+
346
+            </template>
347
+          </el-table-column>
348
+          <el-table-column align="center" prop="name" label="操作" >
173 349
             <template slot-scope="scope">
174 350
               <el-tooltip
175 351
                 class="item"
@@ -181,12 +357,13 @@
181 357
                   type="danger"
182 358
                   icon="el-icon-delete"
183 359
                   size="small"
184
-                  @click="DeleteProject(scope.row.id, scope.$index)"
360
+                  @click="DeleteProject(scope.row.id, scope.$index,scope.row.type)"
185 361
                 ></el-button>
186 362
               </el-tooltip>
187 363
             </template>
188 364
           </el-table-column>
189 365
         </el-table>
366
+
190 367
       </el-form>
191 368
     </div>
192 369
 
@@ -207,11 +384,14 @@ import {
207 384
   saveProjectTeam,
208 385
 } from "@/api/project/project";
209 386
 
210
-import { saveTeam } from "@/api/his/his";
387
+
388
+import { getInitData,saveTeam } from "@/api/his/his";
211 389
 
212 390
 export default {
213 391
   data() {
214 392
     return {
393
+      drugways: [],
394
+      efs: [],
215 395
       project_name: "",
216 396
       visible: false,
217 397
       formTitle: "",
@@ -244,12 +424,127 @@ export default {
244 424
         //team_type: [{ required: true, message: '请填写组套类型', trigger: 'change' }]
245 425
       },
246 426
       tableData: [],
427
+      drug_tableData: [],
428
+
247 429
       projectList: [],
430
+      drugList: [],
431
+      changeObj:{},
248 432
       tabList: [],
249 433
       itemList: [],
250 434
     };
251 435
   },
252 436
   methods: {
437
+    // getNum(execution_frequency) {
438
+    //   let arr = [
439
+    //     { name: '立即执行', count: 1 },
440
+    //     { name: '透析时', count: 1 },
441
+    //     { name: '透析1h一次', count: 1 },
442
+    //     { name: '透析2h一次', count: 1 },
443
+    //     { name: '透析3h一次', count: 1 },
444
+    //     { name: '每日一次', count: 12 },
445
+    //     { name: '每日两次', count: 6 },
446
+    //     { name: '每日三次', count: 4 },
447
+    //     { name: '每晚一次', count: 1 },
448
+    //     { name: '每晚', count: 1 },
449
+    //     { name: '上机前', count: 1 },
450
+    //     { name: '下机前', count: 1 },
451
+    //     { name: '透析后立即', count: 1 },
452
+    //     { name: '持续使用', count: 1 },
453
+    //     { name: '临时开药', count: 1 },
454
+    //     { name: '临睡前', count: 1 },
455
+    //     { name: '隔日一次', count: 1 },
456
+    //     { name: '隔三日一次', count: 1 },
457
+    //     { name: '每二小时一次', count: 12 },
458
+    //     { name: '每四小时一次', count: 6 },
459
+    //     { name: '每六小时一次', count: 4 },
460
+    //     { name: '每八小时一次', count: 3 }
461
+    //   ]
462
+    //   let num = ''
463
+    //   arr.map(item => {
464
+    //     if (item.name == execution_frequency) {
465
+    //       num = item.count
466
+    //     }
467
+    //   })
468
+    //   if (num == '') {
469
+    //     num = 1
470
+    //   }
471
+    //   return num
472
+    // },
473
+
474
+    getAllChange(scope) {
475
+      if(this.$store.getters.xt_user.org_id != 10206) {
476
+        if (scope.row.min_unit == scope.row.single_dose_unit) {
477
+          if (scope.row.prescribing_number_unit == scope.row.min_unit) {
478
+            console.log(1)
479
+            scope.row.prescribing_number = scope.row.single_dose * (scope.row.execution_frequency ? this.getNum(scope.row.execution_frequency) : 1) * (scope.row.day ? scope.row.day : 1)
480
+          } else {
481
+            console.log(12)
482
+            scope.row.prescribing_number = Math.ceil((scope.row.single_dose * (scope.row.execution_frequency ? this.getNum(scope.row.execution_frequency) : 1)) * (scope.row.day ? scope.row.day : 1) / scope.row.min_number)
483
+          }
484
+        } else {
485
+          if (scope.row.prescribing_number_unit == scope.row.min_unit) {
486
+            console.log(123)
487
+            scope.row.prescribing_number = Math.ceil((scope.row.single_dose * (scope.row.execution_frequency ? this.getNum(scope.row.execution_frequency) : 1) * (scope.row.day ? scope.row.day : 1)) / scope.row.dose)
488
+          } else {
489
+            console.log(1234)
490
+            scope.row.prescribing_number = Math.ceil((scope.row.single_dose * (scope.row.execution_frequency ? this.getNum(scope.row.execution_frequency) : 1) * (scope.row.day ? scope.row.day : 1)) / scope.row.dose / scope.row.min_number)
491
+          }
492
+        }
493
+        if (scope.row.prescribing_number == 0) {
494
+          scope.row.prescribing_number = 1
495
+        }
496
+
497
+      }
498
+
499
+    },
500
+    getInitData() {
501
+      getInitData().then(response => {
502
+        if (response.data.state == 0) {
503
+          this.$message.error(response.data.msg)
504
+          return false
505
+        } else {
506
+          this.drugways = response.data.data.drugways
507
+          this.efs = response.data.data.efs
508
+
509
+        }
510
+      })
511
+
512
+    },
513
+    getAllChangeTwo(scope) {
514
+      if(this.$store.getters.xt_user.org_id != 10206) {
515
+        console.log('yyyyyyyy',scope);
516
+        if (scope.row.min_unit == scope.row.single_dose_unit) {
517
+          if (scope.row.prescribing_number_unit == scope.row.min_unit) {
518
+            console.log(1)
519
+            scope.row.prescribing_number = scope.row.single_dose * (scope.row.execution_frequency ? this.getNum(scope.row.execution_frequency) : 1) * (scope.row.day ? scope.row.day : 1)
520
+          } else {
521
+            console.log(12)
522
+            scope.row.prescribing_number = Math.ceil((scope.row.single_dose * (scope.row.execution_frequency ? this.getNum(scope.row.execution_frequency) : 1)) * (scope.row.day ? scope.row.day : 1) / scope.row.min_number)
523
+          }
524
+        } else {
525
+          if (scope.row.prescribing_number_unit == scope.row.min_unit) {
526
+            console.log('123',scope.row.dose,scope.row.execution_frequency,scope.row.min_unit)
527
+            // 单次用量single_dose,用量单位single_dose_unit,用法delivery_way,频率execution_frequency 总量prescribing_number,规格drug.dose
528
+            scope.row.prescribing_number = Math.ceil((parseInt(scope.row.single_dose) * (scope.row.execution_frequency ? this.getNum(scope.row.execution_frequency) : 1) * (scope.row.day ? scope.row.day : 1)) / parseInt(this.getdrugdose(scope.row.dose)) ) //  / scope.row.drug.dose
529
+          } else {
530
+            console.log(1234,scope.row.dose)
531
+            scope.row.prescribing_number = Math.ceil((scope.row.single_dose * (scope.row.execution_frequency ? this.getNum(scope.row.execution_frequency) : 1) * (scope.row.day ? scope.row.day : 1)) / (scope.row.dose*1) / (scope.row.min_number*1))//
532
+          }
533
+        }
534
+        if (scope.row.prescribing_number == 0) {
535
+          scope.row.prescribing_number = 1
536
+        }
537
+      }
538
+    },
539
+    getPrescribingNumberUnit(scope) {
540
+      if (scope.row.prescribing_number_unit == scope.row.min_unit) {
541
+        scope.row.retail_price = scope.row.drug.min_price
542
+      } else {
543
+        scope.row.retail_price = scope.row.drug.retail_price
544
+      }
545
+      console.log(scope.row)
546
+
547
+    },
253 548
     getUnit(id) {
254 549
       var arr = getDataConfig("hemodialysis", "units");
255 550
       for (let i = 0; i < arr.length; i++) {
@@ -259,6 +554,7 @@ export default {
259 554
       }
260 555
     },
261 556
     changeProject(val) {
557
+      this.changeObj = val
262 558
       this.form.number = 1;
263 559
     },
264 560
     querySearch(queryString, cb) {
@@ -279,7 +575,7 @@ export default {
279 575
       };
280 576
     },
281 577
     handleSelect(val) {
282
-     
578
+
283 579
       this.project_name = val.project_name;
284 580
       this.form.project_detail = val.id;
285 581
     },
@@ -297,8 +593,10 @@ export default {
297 593
       this.form.name = "";
298 594
       this.form.intro = "";
299 595
     },
300
-    show(id) {
596
+    show() {
301 597
       this.visible = true;
598
+      this.drug_tableData = []
599
+      this.tableData = []
302 600
       this.formTitle = "新增";
303 601
     },
304 602
     hide() {
@@ -316,13 +614,29 @@ export default {
316 614
           remark: this.form.remark,
317 615
           sort:parseInt(this.form.sort),
318 616
         };
617
+        this.tableData = []
618
+        this.drug_tableDatas = []
619
+
620
+
621
+        for(let i = 0;i < this.drug_tableData.length;i++){
622
+          if(this.drug_tableData[i].type != 1){
623
+            this.tableData.push(this.drug_tableData[i])
624
+          }
625
+        }
626
+
627
+        for(let i = 0;i < this.drug_tableData.length;i++){
628
+          if(this.drug_tableData[i].type == 1){
629
+            this.drug_tableDatas.push(this.drug_tableData[i])
630
+          }
631
+        }
319 632
         let data = {
320 633
           info: this.tableData,
634
+          drug_info:this.drug_tableDatas
321 635
         };
322 636
         saveTeam(data, params).then((response) => {
323 637
           if (response.data.state == 1) {
324 638
             var projectTeam = response.data.data.projectTeam;
325
-           
639
+
326 640
             this.$message.success("保存成功");
327 641
             this.visible = false;
328 642
             this.form.project_team = "",
@@ -350,16 +664,18 @@ export default {
350 664
         if (response.data.state == 1) {
351 665
           var projectList = response.data.data.projectList;
352 666
           var goodInfos = response.data.data.good_info;
353
-    
667
+          var drug_infos = response.data.data.drug;
668
+
669
+
354 670
           for (let i = 0; i < projectList.length; i++) {
355 671
             let obj = {
356 672
               id: projectList[i].id,
357 673
               statistical_classification:
358 674
               projectList[i].statistical_classification,
359
-              number: "1",
675
+              prescribing_number: 1,
360 676
               project_name: projectList[i].project_name,
361 677
               unit: projectList[i].unit,
362
-              price: projectList[i].price,
678
+              retail_price: projectList[i].price,
363 679
               type: 2,
364 680
               new_id: Math.floor(
365 681
                 (Math.random() + Math.floor(Math.random() * 9 + 1)) *
@@ -373,10 +689,10 @@ export default {
373 689
             let obj = {
374 690
               id: goodInfos[i].id,
375 691
               statistical_classification:goodInfos[i].statistical_classification,
376
-              number: "1",
692
+              prescribing_number: 1,
377 693
               project_name:goodInfos[i].good_name + " " + goodInfos[i].specification_name,
378 694
               unit: goodInfos[i].packing_unit,
379
-              price: goodInfos[i].retail_price,
695
+              retail_price: goodInfos[i].retail_price,
380 696
               type: 3,
381 697
               new_id: Math.floor(
382 698
                 (Math.random() + Math.floor(Math.random() * 9 + 1)) *
@@ -386,7 +702,34 @@ export default {
386 702
             this.projectList.push(obj);
387 703
           }
388 704
 
389
-         
705
+          for (let i = 0; i < drug_infos.length; i++) {
706
+            let obj = {
707
+              id: drug_infos[i].id,
708
+              drug_name: drug_infos[i].drug_name,
709
+              single_dose: drug_infos[i].single_dose.toString(),
710
+              delivery_way: drug_infos[i].delivery_way,
711
+              execution_frequency: drug_infos[i].execution_frequency,
712
+              dose: drug_infos[i].dose,
713
+              dose_unit: drug_infos[i].dose_unit,
714
+              min_number: drug_infos[i].min_number,
715
+              min_unit: drug_infos[i].min_unit,
716
+              max_unit: drug_infos[i].max_unit,
717
+              min_price: drug_infos[i].min_price,
718
+              type: 1,
719
+              retail_price: drug_infos[i].retail_price.toString(),
720
+              remark: '',
721
+              day: '1',
722
+              is_medicine:0,
723
+              prescribing_number: drug_infos[i].prescribing_number,
724
+              single_dose_unit: drug_infos[i].dose_unit,
725
+              prescribing_number_unit: drug_infos[i].prescribing_number_unit,
726
+              medical_insurance_number: drug_infos[i].medical_insurance_number,
727
+              new_id: Math.floor(
728
+                (Math.random() + Math.floor(Math.random() * 9 + 1)) *
729
+                Math.pow(10, 10 - 1)),
730
+            };
731
+            this.projectList.push(obj);
732
+          }
390 733
         }
391 734
       });
392 735
     },
@@ -411,56 +754,81 @@ export default {
411 754
           var projectdetail = response.data.data.projecDetail;
412 755
 
413 756
           this.tableData.push(projectdetail);
757
+          this.drug_tableData.push(projectdetail)
414 758
         }
415 759
       });
416 760
     },
417 761
     addProjectList() {
418 762
         if(this.tableData.length > 0){
419 763
           for(let i=0;i<this.tableData.length;i++){
420
-            if(this.tableData[i].new_id == this.form.project_detail){
764
+            if(this.tableData[i].new_id == this.form.project_detail && this.projectList[i].type != 1){
421 765
                this.$message.error("项目名称已存在")
422 766
                return
423 767
             }
424 768
           }
425 769
         }
426
-        console.log("project_232332323232323232",this.projectList)
427 770
         for (let i = 0; i < this.projectList.length; i++) {
428
-          if (this.form.project_detail == this.projectList[i].new_id) {
429
-            this.projectList[i].number = this.form.number
430
-            this.projectList[i].number = this.projectList[i].number.toString()
431
-            
771
+          if (this.form.project_detail == this.projectList[i].new_id  && this.projectList[i].type != 1) {
772
+            this.projectList[i].prescribing_number = 1
773
+            this.projectList[i].prescribing_number = this.projectList[i].prescribing_number.toString()
432 774
             this.tableData.push(this.projectList[i])
775
+            this.drug_tableData.push(this.projectList[i])
776
+
433 777
             this.form.project_detail = ''
434 778
             this.form.number = 1
435 779
           }
436 780
         }
437
-       
438
-      },
439
-    DeleteProject(id, index) {
781
+
782
+      for (let i = 0; i < this.projectList.length; i++) {
783
+
784
+        if (this.form.project_detail == this.projectList[i].new_id  && this.projectList[i].type == 1) {
785
+          console.log(this.projectList[i])
786
+
787
+          this.projectList[i].prescribing_number =  "1"
788
+          this.drug_tableData.push(this.projectList[i])
789
+          this.form.project_detail = ''
790
+          this.form.number = 1
791
+        }
792
+      }
793
+
794
+
795
+    },
796
+    DeleteProject(id, index,type) {
797
+
440 798
       this.$confirm("确认删除此项目吗?", "删除", {
441 799
         confirmButtonText: "确 定",
442 800
         cancelButtonText: "取 消",
443 801
         type: "warning",
444 802
       })
445 803
         .then(() => {
446
-          this.tableData.splice(index, 1);
804
+          if (type == 1){
805
+            this.drug_tableData.splice(index, 1);
806
+          }else{
807
+            this.tableData.splice(index, 1);
808
+            this.drug_tableData.splice(index, 1);
809
+
810
+
811
+          }
447 812
         })
448 813
         .catch(() => {});
449 814
     },
450 815
   },
451 816
   created() {
452 817
     //获取所以的项目
818
+    this.getInitData()
819
+    this.drug_tableDatas = []
820
+    this.tableData = []
453 821
     this.getlist();
454 822
   },
455 823
   watch: {
456
-    tableData: function () {
824
+    drug_tableData: function () {
457 825
       let c = 0;
458 826
       this.form.price = 0;
459
-      for (let i = 0; i < this.tableData.length; i++) {
460
-        let a = parseFloat(this.tableData[i].number).toFixed(2);
461
-        let b = parseFloat(this.tableData[i].price).toFixed(2);
462
-
827
+      for (let i = 0; i < this.drug_tableData.length; i++) {
828
+        let a = parseFloat(this.drug_tableData[i].prescribing_number).toFixed(2);
829
+        let b = parseFloat(this.drug_tableData[i].retail_price).toFixed(2);
463 830
         c = c + this.form.price + a * b;
831
+        console.log(c)
464 832
       }
465 833
       this.form.price = c.toFixed(2);
466 834
     },

+ 496 - 73
src/xt_pages/data/components/editInspection.vue Прегледај датотеку

@@ -1,7 +1,7 @@
1 1
 <template>
2 2
     <el-dialog
3 3
             :title="formTitle"
4
-            width="900px"
4
+            width="1200px"
5 5
             :visible.sync="visible"
6 6
             :before-close="_close"
7 7
     >
@@ -56,61 +56,228 @@
56 56
                         <el-option
57 57
                                 v-for="item,index in projectList"
58 58
                                 :key="index"
59
-                                :label="item.project_name"
59
+                                :label="item.type == 1 ? item.drug_name : item.project_name"
60 60
                                 :value="item.new_id">
61 61
                         </el-option>
62 62
                     </el-select>
63 63
 
64 64
                 </el-form-item>
65
-                <el-form-item label="数量" style="width:50%;">
65
+                <el-form-item label="操作" style="width:50%;">
66 66
                     <div style="display:flex;">
67
-                        <el-input v-model="form.number" style="margin-right:10px;"></el-input>
67
+<!--                        <el-input v-model="form.number" style="margin-right:10px;"></el-input>-->
68 68
                         <el-button type="primary" @click="addProjectList">添加</el-button>
69 69
                     </div>
70 70
                 </el-form-item>
71 71
             </el-form>
72 72
             <el-form>
73
-                <el-table :data="tableData" border style="100%" :row-style="{ color: '#303133' }"
74
-                          :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
75
-                          highlight-current-row ref="tab">
76
-                    <el-table-column align="center" prop="name" label="分类" width="120">
77
-                        <template slot-scope="scope">
78
-                            <div>{{scope.row.type == 2?getId(scope.row.statistical_classification):'耗材'}}</div>
79
-                        </template>
80
-                    </el-table-column>
81
-                    <el-table-column align="center" prop="name" label="组套明细" width="120">
82
-                        <template slot-scope="scope">{{scope.row.project_name}}</template>
83
-                    </el-table-column>
84
-                    <el-table-column align="center" prop="name" label="数量" width="120">
85
-                        <template slot-scope="scope">{{scope.row.number}}</template>
86
-                    </el-table-column>
87
-                    <el-table-column align="center" prop="name" label="单位" width="120">
88
-                        <template slot-scope="scope">
89
-                            <div v-if="scope.row.type == 2">{{scope.row.unit}}</div>
90
-                            <div v-if="scope.row.type == 3">{{scope.row.unit}}</div>
91
-                        </template>
92
-                    </el-table-column>
93
-                    <el-table-column align="center" prop="name" label="单价" width="120">
94
-                        <template slot-scope="scope">{{scope.row.price}}</template>
95
-                    </el-table-column>
96
-                    <el-table-column align="center" prop="name" label="操作">
97
-                        <template slot-scope="scope">
98
-                            <el-tooltip
99
-                                    class="item"
100
-                                    effect="dark"
101
-                                    content="删除"
102
-                                    placement="top"
103
-                            >
104
-                                <el-button
105
-                                        type="danger"
106
-                                        icon="el-icon-delete"
107
-                                        size="small"
108
-                                        @click="DeleteProject(scope.row.m_id,scope.$index)"
109
-                                ></el-button>
110
-                            </el-tooltip>
111
-                        </template>
112
-                    </el-table-column>
113
-                </el-table>
73
+<!--                <el-table :data="tableData" border style="100%" :row-style="{ color: '#303133' }"-->
74
+<!--                          :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"-->
75
+<!--                          highlight-current-row ref="tab">-->
76
+<!--                    <el-table-column align="center" prop="name" label="分类" width="120">-->
77
+<!--                        <template slot-scope="scope">-->
78
+<!--                            <div>{{scope.row.type == 2?getId(scope.row.statistical_classification):'耗材'}}</div>-->
79
+<!--                        </template>-->
80
+<!--                    </el-table-column>-->
81
+<!--                    <el-table-column align="center" prop="name" label="组套明细" width="120">-->
82
+<!--                        <template slot-scope="scope">{{scope.row.project_name}}</template>-->
83
+<!--                    </el-table-column>-->
84
+<!--                    <el-table-column align="center" prop="name" label="数量" width="120">-->
85
+<!--                        <template slot-scope="scope">{{scope.row.number}}</template>-->
86
+<!--                    </el-table-column>-->
87
+<!--                    <el-table-column align="center" prop="name" label="单位" width="120">-->
88
+<!--                        <template slot-scope="scope">-->
89
+<!--                            <div v-if="scope.row.type == 2">{{scope.row.unit}}</div>-->
90
+<!--                            <div v-if="scope.row.type == 3">{{scope.row.unit}}</div>-->
91
+<!--                        </template>-->
92
+<!--                    </el-table-column>-->
93
+<!--                    <el-table-column align="center" prop="name" label="单价" width="120">-->
94
+<!--                        <template slot-scope="scope">{{scope.row.price}}</template>-->
95
+<!--                    </el-table-column>-->
96
+<!--                    <el-table-column align="center" prop="name" label="操作">-->
97
+<!--                        <template slot-scope="scope">-->
98
+<!--                            <el-tooltip-->
99
+<!--                                    class="item"-->
100
+<!--                                    effect="dark"-->
101
+<!--                                    content="删除"-->
102
+<!--                                    placement="top"-->
103
+<!--                            >-->
104
+<!--                                <el-button-->
105
+<!--                                        type="danger"-->
106
+<!--                                        icon="el-icon-delete"-->
107
+<!--                                        size="small"-->
108
+<!--                                        @click="DeleteProject(scope.row.m_id,scope.$index,scope.row.type)"-->
109
+<!--                                ></el-button>-->
110
+<!--                            </el-tooltip>-->
111
+<!--                        </template>-->
112
+<!--                    </el-table-column>-->
113
+<!--                </el-table>-->
114
+
115
+              <el-table
116
+                :data="drug_tableData"
117
+                max-height="300"
118
+                border
119
+                style="100%"
120
+                :row-style="{ color: '#303133' }"
121
+                :header-cell-style="{
122
+              backgroundColor: 'rgb(245, 247, 250)',
123
+            color: '#606266',
124
+          }"
125
+                highlight-current-row
126
+                ref="tab"
127
+              >
128
+                <el-table-column align="center" prop="drug_name" label="名称" fixed>
129
+                    <template slot-scope="scope"><span>{{ scope.row.type == 1?scope.row.drug_name: scope.row.project_name}}</span>
130
+                    </template>
131
+                </el-table-column>
132
+
133
+                <el-table-column align="center" prop="drug_name" width="100" label="规格">
134
+                  <template slot-scope="scope">
135
+                  <span v-if="scope.row.type == 1" >
136
+                    {{ scope.row.dose }}{{ scope.row.dose_unit }}*{{ scope.row.min_number }}{{ scope.row.min_unit }}/{{ scope.row.max_unit }}
137
+                  </span>
138
+                  </template>
139
+                </el-table-column>
140
+                <el-table-column align="center" prop="single_dose" width="180" label="单次用量">
141
+                  <template slot-scope="scope">
142
+                    <div style="display:flex;align-items:center;" v-if="scope.row.type == 1">
143
+                      <el-input  v-model="scope.row.single_dose" @input="getAllChangeTwo(scope)"
144
+                                 style="width:50%;"></el-input>
145
+                      <!-- <div>{{scope.row.single_dose_unit}}</div> -->
146
+                      <el-select v-model="scope.row.single_dose_unit" placeholder="请选择" style="width:50%;"
147
+                                 @change="getAllChangeTwo(scope)"  >
148
+                        <el-option :label="scope.row.min_unit" :value="scope.row.min_unit"></el-option>
149
+                        <el-option :label="scope.row.min_unit" :value="scope.row.min_unit"></el-option>
150
+
151
+                        <el-option :label="scope.row.dose_unit"
152
+                                   v-if="scope.row.dose_unit != scope.row.min_unit"
153
+                                   :value="scope.row.dose_unit"></el-option>
154
+                      </el-select>
155
+                    </div>
156
+                    <span v-if="scope.row.type == 2">
157
+                  </span>
158
+                    <span v-if="scope.row.type == 3">
159
+                  </span>
160
+                  </template>
161
+                </el-table-column>
162
+                <el-table-column align="center" prop="delivery_way" width="100" label="用法">
163
+                  <template slot-scope="scope">
164
+                    <div v-if="scope.row.type == 1">
165
+                      <el-select v-model="scope.row.delivery_way" placeholder="请选择">
166
+                        <el-option
167
+                          v-for="(item,index) in drugways"
168
+                          :key="index"
169
+                          :label="item.name"
170
+                          :value="item.name">
171
+                        </el-option>
172
+                      </el-select>
173
+                    </div>
174
+                    <div v-if="scope.row.type == 2">
175
+
176
+                    </div>
177
+                    <div v-if="scope.row.type == 3">
178
+
179
+                    </div>
180
+                  </template>
181
+                </el-table-column>
182
+                <el-table-column align="center" prop="execution_frequency" width="100" label="频率">
183
+                  <template slot-scope="scope">
184
+                    <div v-if="scope.row.type == 1">
185
+                      <el-select  v-model="scope.row.execution_frequency" placeholder="请选择" @change="getAllChangeTwo(scope)">
186
+                        <el-option
187
+                          v-for="item,index in efs"
188
+                          :key="index"
189
+                          :label="item.name"
190
+                          :value="item.name">
191
+                        </el-option>
192
+                      </el-select>
193
+                    </div>
194
+                    <div v-if="scope.row.type == 2">
195
+
196
+                    </div>
197
+                    <div v-if="scope.row.type == 3">
198
+
199
+                    </div>
200
+                  </template>
201
+                </el-table-column>
202
+
203
+                <el-table-column align="center" prop="day" width="100" label="天数">
204
+                  <template slot-scope="scope">
205
+                    <div style="display:flex;align-items:center;" v-if="scope.row.type == 1">
206
+                      <el-input  v-model="scope.row.day" @input="getAllChangeTwo(scope)" placeholder=""></el-input>
207
+                      {{'天'}}
208
+                    </div>
209
+                    <div style="display:flex;align-items:center;" v-if="scope.row.type == 2">
210
+                      <!--                {{'1天'}}-->
211
+                    </div>
212
+                    <div style="display:flex;align-items:center;" v-if="scope.row.type == 3">
213
+                      <!--                {{'1天'}}-->
214
+                    </div>
215
+                  </template>
216
+                </el-table-column>
217
+
218
+                <el-table-column align="center" prop="prescribing_number" width="150" label="总量">
219
+                  <template slot-scope="scope">
220
+                    <div style="display:flex;align-items:center;" v-if="scope.row.type == 1">
221
+                      <el-input v-model="scope.row.prescribing_number"
222
+                                style="width:50%" placeholder=""></el-input>
223
+                      <!-- <div> {{scope.row.prescribing_number_unit}}</div> -->
224
+                      <el-select v-model="scope.row.prescribing_number_unit" placeholder="请选择" style="width:50%;"
225
+                                 @change="getPrescribingNumberUnit(scope)">
226
+                        <el-option :label="scope.row.min_unit" :value="scope.row.min_unit"></el-option>
227
+                        <el-option :label="scope.row.max_unit"
228
+                                   v-if="scope.row.min_unit != scope.row.max_unit"
229
+                                   :value="scope.row.max_unit"></el-option>
230
+                      </el-select>
231
+                    </div>
232
+                    <div style="display:flex;align-items:center;" v-if="scope.row.type == 2">
233
+                      <el-input v-model="scope.row.number"
234
+                                style="width:50%" placeholder=""></el-input>
235
+                      <div>{{scope.row.unit }}</div>
236
+                    </div>
237
+                    <div style="display:flex;align-items:center;" v-if="scope.row.type == 3">
238
+                      <el-input v-model="scope.row.number"
239
+                                style="width:50%" placeholder=""></el-input>
240
+                      <div>{{scope.row.unit }}</div>
241
+                    </div>
242
+                  </template>
243
+                </el-table-column>
244
+                <el-table-column align="center" prop="retail_price" width="100" label="单价">
245
+                  <template slot-scope="scope">
246
+                    <div style="display:flex;align-items:center;" v-if="scope.row.type == 1">
247
+                      <el-input v-model="scope.row.retail_price" placeholder="" readonly></el-input>
248
+                      <div>{{'元'}}</div>
249
+                    </div>
250
+
251
+                    <div style="display:flex;align-items:center;" v-if="scope.row.type == 2">
252
+                      <el-input v-model="scope.row.price" placeholder="" readonly></el-input>
253
+                      <div>{{'元'}}</div>
254
+                      <!--                <div>{{scope.row.price }}</div>-->
255
+                    </div>
256
+                    <div style="display:flex;align-items:center;" v-if="scope.row.type == 3">
257
+                      <el-input v-model="scope.row.price" placeholder="" readonly></el-input>
258
+                      <div>{{'元'}}</div>
259
+                    </div>
260
+                  </template>
261
+                </el-table-column>
262
+                <el-table-column align="center" prop="name" label="操作" >
263
+                  <template slot-scope="scope">
264
+                    <el-tooltip
265
+                      class="item"
266
+                      effect="dark"
267
+                      content="删除"
268
+                      placement="top"
269
+                    >
270
+                      <el-button
271
+                        type="danger"
272
+                        icon="el-icon-delete"
273
+                        size="small"
274
+                        @click="DeleteProject(scope.row.m_id, scope.$index,scope.row.type)"
275
+                      ></el-button>
276
+                    </el-tooltip>
277
+                  </template>
278
+                </el-table-column>
279
+              </el-table>
280
+
114 281
             </el-form>
115 282
         </div>
116 283
 
@@ -124,11 +291,13 @@
124 291
 
125 292
 <script>
126 293
   import {
294
+    getInitData,
127 295
     editTeam
128 296
   } from '@/api/his/his'
129 297
   import {
130 298
     addProjectList,
131 299
     DeleteProject,
300
+    DeleteDrug,
132 301
     getAllProjectList,
133 302
     getProjectTeamDetail,
134 303
     updatedProjectTeam
@@ -172,11 +341,124 @@
172 341
           //team_type: [{ required: true, message: '请填写组套类型', trigger: 'change' }]
173 342
         },
174 343
         tableData: [],
344
+        drug_tableData:[],
175 345
         item_id: [],
176
-        projectList: []
346
+        projectList: [],
347
+        drugways: [],
348
+        efs: [],
177 349
       }
178 350
     },
179 351
     methods: {
352
+      // getNum(execution_frequency) {
353
+      //   let arr = [
354
+      //     { name: '立即执行', count: 1 },
355
+      //     { name: '透析时', count: 1 },
356
+      //     { name: '透析1h一次', count: 1 },
357
+      //     { name: '透析2h一次', count: 1 },
358
+      //     { name: '透析3h一次', count: 1 },
359
+      //     { name: '每日一次', count: 12 },
360
+      //     { name: '每日两次', count: 6 },
361
+      //     { name: '每日三次', count: 4 },
362
+      //     { name: '每晚一次', count: 1 },
363
+      //     { name: '每晚', count: 1 },
364
+      //     { name: '上机前', count: 1 },
365
+      //     { name: '下机前', count: 1 },
366
+      //     { name: '透析后立即', count: 1 },
367
+      //     { name: '持续使用', count: 1 },
368
+      //     { name: '临时开药', count: 1 },
369
+      //     { name: '临睡前', count: 1 },
370
+      //     { name: '隔日一次', count: 1 },
371
+      //     { name: '隔三日一次', count: 1 },
372
+      //     { name: '每二小时一次', count: 12 },
373
+      //     { name: '每四小时一次', count: 6 },
374
+      //     { name: '每六小时一次', count: 4 },
375
+      //     { name: '每八小时一次', count: 3 }
376
+      //   ]
377
+      //   let num = ''
378
+      //   arr.map(item => {
379
+      //     if (item.name == execution_frequency) {
380
+      //       num = item.count
381
+      //     }
382
+      //   })
383
+      //   if (num == '') {
384
+      //     num = 1
385
+      //   }
386
+      //   return num
387
+      // },
388
+
389
+      getAllChange(scope) {
390
+        if(this.$store.getters.xt_user.org_id != 10206) {
391
+          if (scope.row.min_unit == scope.row.single_dose_unit) {
392
+            if (scope.row.prescribing_number_unit == scope.row.min_unit) {
393
+              console.log(1)
394
+              scope.row.prescribing_number = scope.row.single_dose * (scope.row.execution_frequency ? this.getNum(scope.row.execution_frequency) : 1) * (scope.row.day ? scope.row.day : 1)
395
+            } else {
396
+              console.log(12)
397
+              scope.row.prescribing_number = Math.ceil((scope.row.single_dose * (scope.row.execution_frequency ? this.getNum(scope.row.execution_frequency) : 1)) * (scope.row.day ? scope.row.day : 1) / scope.row.min_number)
398
+            }
399
+          } else {
400
+            if (scope.row.prescribing_number_unit == scope.row.min_unit) {
401
+              console.log(123)
402
+              scope.row.prescribing_number = Math.ceil((scope.row.single_dose * (scope.row.execution_frequency ? this.getNum(scope.row.execution_frequency) : 1) * (scope.row.day ? scope.row.day : 1)) / scope.row.dose)
403
+            } else {
404
+              console.log(1234)
405
+              scope.row.prescribing_number = Math.ceil((scope.row.single_dose * (scope.row.execution_frequency ? this.getNum(scope.row.execution_frequency) : 1) * (scope.row.day ? scope.row.day : 1)) / scope.row.dose / scope.row.min_number)
406
+            }
407
+          }
408
+          if (scope.row.prescribing_number == 0) {
409
+            scope.row.prescribing_number = 1
410
+          }
411
+
412
+        }
413
+
414
+      },
415
+      getInitData() {
416
+        getInitData().then(response => {
417
+          if (response.data.state == 0) {
418
+            this.$message.error(response.data.msg)
419
+            return false
420
+          } else {
421
+            this.drugways = response.data.data.drugways
422
+            this.efs = response.data.data.efs
423
+
424
+          }
425
+        })
426
+
427
+      },
428
+      getAllChangeTwo(scope) {
429
+        if(this.$store.getters.xt_user.org_id != 10206) {
430
+          console.log('yyyyyyyy',scope);
431
+          if (scope.row.min_unit == scope.row.single_dose_unit) {
432
+            if (scope.row.prescribing_number_unit == scope.row.min_unit) {
433
+              console.log(1)
434
+              scope.row.prescribing_number = scope.row.single_dose * (scope.row.execution_frequency ? this.getNum(scope.row.execution_frequency) : 1) * (scope.row.day ? scope.row.day : 1)
435
+            } else {
436
+              console.log(12)
437
+              scope.row.prescribing_number = Math.ceil((scope.row.single_dose * (scope.row.execution_frequency ? this.getNum(scope.row.execution_frequency) : 1)) * (scope.row.day ? scope.row.day : 1) / scope.row.min_number)
438
+            }
439
+          } else {
440
+            if (scope.row.prescribing_number_unit == scope.row.min_unit) {
441
+              console.log('123',scope.row.dose,scope.row.execution_frequency,scope.row.min_unit)
442
+              // 单次用量single_dose,用量单位single_dose_unit,用法delivery_way,频率execution_frequency 总量prescribing_number,规格drug.dose
443
+              scope.row.prescribing_number = Math.ceil((parseInt(scope.row.single_dose) * (scope.row.execution_frequency ? this.getNum(scope.row.execution_frequency) : 1) * (scope.row.day ? scope.row.day : 1)) / parseInt(this.getdrugdose(scope.row.dose)) ) //  / scope.row.drug.dose
444
+            } else {
445
+              console.log(1234,scope.row.dose)
446
+              scope.row.prescribing_number = Math.ceil((scope.row.single_dose * (scope.row.execution_frequency ? this.getNum(scope.row.execution_frequency) : 1) * (scope.row.day ? scope.row.day : 1)) / (scope.row.dose*1) / (scope.row.min_number*1))//
447
+            }
448
+          }
449
+          if (scope.row.prescribing_number == 0) {
450
+            scope.row.prescribing_number = 1
451
+          }
452
+        }
453
+      },
454
+      getPrescribingNumberUnit(scope) {
455
+
456
+        if (scope.row.prescribing_number_unit == scope.row.min_unit) {
457
+          scope.row.retail_price = scope.row.drug.min_price
458
+        } else {
459
+          scope.row.retail_price = scope.row.drug.retail_price
460
+        }
461
+      },
180 462
       getUnit(id){
181 463
         var arr =  getDataConfig('hemodialysis','units')
182 464
         for(let i = 0;i < arr.length; i++){
@@ -206,17 +488,22 @@
206 488
       show(id) {
207 489
         this.visible = true
208 490
         this.formTitle = '编辑'
491
+        this.getInitData()
209 492
         this.getlist(id)
210 493
         this.getProjectTeamDetail(id)
211 494
         this.projectList = []
212
-      }, 
495
+      },
213 496
       getlist(id) {
214 497
 
215 498
         getAllProjectList().then(response => {
216 499
           if (response.data.state == 1) {
217
-         
500
+
218 501
             var projectList = response.data.data.projectList
219 502
             var goodInfos = response.data.data.good_info
503
+
504
+            var drug_infos = response.data.data.drug;
505
+
506
+
220 507
             console.log("332323232323232",goodInfos)
221 508
             for (let i = 0; i < projectList.length; i++) {
222 509
               let obj = {
@@ -251,7 +538,35 @@
251 538
               }
252 539
               this.projectList.push(obj)
253 540
             }
254
-             console.log("编辑项目23332232323",this.projectList)
541
+
542
+            for (let i = 0; i < drug_infos.length; i++) {
543
+              let obj = {
544
+                id: drug_infos[i].id,
545
+                m_id: 0,
546
+                drug_name: drug_infos[i].drug_name,
547
+                single_dose: drug_infos[i].single_dose.toString(),
548
+                delivery_way: drug_infos[i].delivery_way,
549
+                execution_frequency: drug_infos[i].execution_frequency,
550
+                dose: drug_infos[i].dose,
551
+                dose_unit: drug_infos[i].dose_unit,
552
+                min_number: drug_infos[i].min_number,
553
+                min_unit: drug_infos[i].min_unit,
554
+                max_unit: drug_infos[i].max_unit,
555
+                type: 1,
556
+                retail_price: drug_infos[i].retail_price.toString(),
557
+                remark: '',
558
+                day: '1',
559
+                prescribing_number: drug_infos[i].prescribing_number,
560
+                single_dose_unit: drug_infos[i].dose_unit,
561
+                prescribing_number_unit: drug_infos[i].prescribing_number_unit,
562
+                medical_insurance_number: drug_infos[i].medical_insurance_number,
563
+                new_id: Math.floor(
564
+                  (Math.random() + Math.floor(Math.random() * 9 + 1)) *
565
+                  Math.pow(10, 10 - 1)),
566
+              };
567
+              this.projectList.push(obj);
568
+            }
569
+
255 570
           }
256 571
         })
257 572
       },
@@ -263,11 +578,15 @@
263 578
         getProjectTeamDetail(id).then(response => {
264 579
           if (response.data.state == 1) {
265 580
             this.tableData = []
581
+            this.drug_tableData = []
582
+
266 583
             var projectTeamDetail = response.data.data.projectTeamDetail
267 584
             var hisList = response.data.data.hisList
268 585
 
269
-            for (let i = 0; i < hisList.length; i++) {
586
+            var hisList_drug = response.data.data.hisList_drug
270 587
 
588
+
589
+            for (let i = 0; i < hisList.length; i++) {
271 590
               let obj = {
272 591
                 m_id: hisList[i].id,
273 592
                 id: hisList[i].project_id,
@@ -275,17 +594,40 @@
275 594
                 type: hisList[i].type
276 595
               }
277 596
               if (hisList[i].type == 2) {
278
-                obj['statistical_classification'] = hisList[i].project.statistical_classification
279 597
                 obj['project_name'] = hisList[i].project.project_name
280 598
                 obj['unit'] = hisList[i].project.unit
281 599
                 obj['price'] = hisList[i].project.price
282
-
283 600
               } else {
284 601
                 obj['project_name'] = hisList[i].good_info.good_name
285 602
                 obj['unit'] = hisList[i].good_info.packing_unit
286 603
                 obj['price'] = hisList[i].good_info.retail_price
287 604
               }
288 605
               this.tableData.push(obj)
606
+              this.drug_tableData.push(obj)
607
+            }
608
+            for (let i = 0; i < hisList_drug.length; i++) {
609
+
610
+              let obj = {
611
+                m_id: hisList_drug[i].id,
612
+                id: hisList_drug[i].drug_id,
613
+                drug_name: hisList_drug[i].drug.drug_name,
614
+                single_dose: hisList_drug[i].single_dose.toString(),
615
+                delivery_way: hisList_drug[i].delivery_way,
616
+                execution_frequency: hisList_drug[i].execution_frequency,
617
+                dose: hisList_drug[i].drug.dose,
618
+                dose_unit: hisList_drug[i].drug.dose_unit,
619
+                min_number: hisList_drug[i].drug.min_number,
620
+                min_unit: hisList_drug[i].drug.min_unit,
621
+                max_unit: hisList_drug[i].drug.max_unit,
622
+                type: 1,
623
+                retail_price: hisList_drug[i].drug.retail_price.toString(),
624
+                remark: '',
625
+                day: hisList_drug[i].day_count,
626
+                prescribing_number: hisList_drug[i].prescribing_number,
627
+                single_dose_unit: hisList_drug[i].single_dose_unit,
628
+                prescribing_number_unit: hisList_drug[i].prescribing_number_unit,
629
+              }
630
+              this.drug_tableData.push(obj)
289 631
             }
290 632
             this.form.id = projectTeamDetail.id
291 633
             this.form.project_team = projectTeamDetail.project_team
@@ -316,6 +658,51 @@
316 658
             }
317 659
           }
318 660
 
661
+         var drug_tableDatas = []
662
+          var tableDatas = []
663
+
664
+
665
+          for (let i = 0; i < this.drug_tableData.length; i++) {
666
+
667
+
668
+
669
+            if (this.drug_tableData[i].type == 1) {
670
+              drug_tableDatas.push(this.drug_tableData[i])
671
+            }else{
672
+              this.drug_tableData[i].number =  this.drug_tableData[i].number.toString()
673
+              tableDatas.push(this.drug_tableData[i])
674
+            }
675
+          }
676
+
677
+          if(isNaN(this.form.price)){
678
+            this.form.price = 0
679
+            let c = 0
680
+            for (let i = 0; i < this.drug_tableData.length; i++) {
681
+              if(this.drug_tableData[i].type == 1){
682
+                if(this.drug_tableData[i].retail_price == ""){
683
+                  this.drug_tableData[i].retail_price = 0
684
+                }
685
+                let a = parseFloat(this.drug_tableData[i].prescribing_number).toFixed(2)
686
+                let b = parseFloat(this.drug_tableData[i].retail_price).toFixed(2)
687
+                c = c + this.form.price + (a * b)
688
+              }else{
689
+                if(this.drug_tableData[i].price == ""){
690
+                  this.drug_tableData[i].price = 0
691
+                }
692
+                let a = parseFloat(this.drug_tableData[i].number).toFixed(2)
693
+                let b = parseFloat(this.drug_tableData[i].price).toFixed(2)
694
+                c = c + this.form.price + (a * b)
695
+              }
696
+
697
+            }
698
+            console.log(c)
699
+
700
+            this.form.price = c.toFixed(2)
701
+
702
+          }
703
+
704
+
705
+
319 706
           if (valid) {
320 707
             var params = {
321 708
               id: this.form.id,
@@ -329,7 +716,8 @@
329 716
               sort:parseInt(this.form.sort)
330 717
             }
331 718
             let data = {
332
-              'info': arr
719
+              'info': tableDatas,
720
+              "drug_info": drug_tableDatas,
333 721
             }            // console.log("params",params)
334 722
             editTeam(params, data).then(response => {
335 723
               if (response.data.state == 1) {
@@ -357,41 +745,60 @@
357 745
         return name
358 746
       },
359 747
       addProjectList() {
360
-       
748
+
361 749
         var project_name = ""
362 750
         for(let i=0;i<this.projectList.length;i++){
363
-          if(this.form.project_detail == this.projectList[i].new_id){
751
+          if(this.form.project_detail == this.projectList[i].new_id && this.projectList[i].type != 1){
364 752
              project_name = this.projectList[i].project_name
365 753
           }
366 754
         }
367 755
         if(this.tableData.length > 0){
368 756
           for(let i=0;i<this.tableData.length;i++){
369
-            if(this.tableData[i].project_name == project_name){
757
+            if(this.tableData[i].project_name == project_name && this.projectList[i].type != 1){
370 758
                this.$message.error("项目名称已存在")
371 759
                return
372 760
             }
373 761
           }
374 762
         }
375 763
         for (let i = 0; i < this.projectList.length; i++) {
376
-          if (this.form.project_detail == this.projectList[i].new_id) {
764
+          if (this.form.project_detail == this.projectList[i].new_id && this.projectList[i].type != 1) {
377 765
             this.projectList[i].number = this.form.number
378 766
             this.projectList[i].number = this.projectList[i].number.toString()
379 767
             this.tableData.push(this.projectList[i])
768
+            this.drug_tableData.push(this.projectList[i])
769
+
770
+            this.form.project_detail = ''
771
+            this.form.number = ''
772
+          }
773
+        }
774
+        for (let i = 0; i < this.projectList.length; i++) {
775
+          if (this.form.project_detail == this.projectList[i].new_id && this.projectList[i].type == 1) {
776
+            this.projectList[i].prescribing_number = this.form.number.toString()
777
+            this.projectList[i].m_id = 0
778
+            this.drug_tableData.push(this.projectList[i])
380 779
             this.form.project_detail = ''
381 780
             this.form.number = ''
382 781
           }
383 782
         }
384 783
 
385 784
       },
386
-      DeleteProject(id, index) {
785
+      DeleteProject(id, index,type) {
786
+        console.log(id)
387 787
 
388 788
         if (id == 0) {
789
+
389 790
           this.$confirm('确认删除此项目吗?', '删除', {
390 791
             confirmButtonText: '确 定',
391 792
             cancelButtonText: '取 消',
392 793
             type: 'warning'
393 794
           }).then(() => {
394
-            this.tableData.splice(index, 1)
795
+            if(type == 1){
796
+              this.drug_tableData.splice(index, 1)
797
+            }else{
798
+              this.tableData.splice(index, 1)
799
+              this.drug_tableData.splice(index, 1)
800
+
801
+            }
395 802
 
396 803
           })
397 804
             .catch(() => {
@@ -403,14 +810,27 @@
403 810
             cancelButtonText: '取 消',
404 811
             type: 'warning'
405 812
           }).then(() => {
406
-            DeleteProject(id).then(response => {
407
-              if (response.data.state == 1) {
408
-                this.tableData.splice(index, 1)
813
+            if(type == 1){
814
+              DeleteDrug(id).then(response => {
815
+                if (response.data.state == 1) {
816
+                  this.drug_tableData.splice(index, 1)
817
+                } else {
818
+                }
819
+              })
409 820
 
410
-              } else {
821
+            }else{
822
+              DeleteProject(id).then(response => {
823
+                if (response.data.state == 1) {
824
+                  this.tableData.splice(index, 1)
825
+                  this.drug_tableData.splice(index, 1)
826
+
827
+                } else {
828
+
829
+                }
830
+              })
831
+
832
+            }
411 833
 
412
-              }
413
-            })
414 834
           })
415 835
             .catch(() => {
416 836
             })
@@ -423,17 +843,20 @@
423 843
       this.getlist()
424 844
     },
425 845
     watch: {
426
-      'tableData': function() {
846
+      'drug_tableData': function() {
427 847
         let c = 0
428 848
         this.form.price  = 0
429
-        for (let i = 0; i < this.tableData.length; i++) {
430
-          let a = parseFloat(this.tableData[i].number).toFixed(2)
431
-          let b = parseFloat(this.tableData[i].price).toFixed(2)
432
-          console.log(a)
433
-          console.log(b)
434
-
849
+        for (let i = 0; i < this.drug_tableData.length; i++) {
850
+          if(this.drug_tableData[i].type == 1){
851
+            let a = parseFloat(this.drug_tableData[i].prescribing_number).toFixed(2)
852
+            let b = parseFloat(this.drug_tableData[i].retail_price).toFixed(2)
853
+            c = c + this.form.price + (a * b)
854
+          }else{
855
+            let a = parseFloat(this.drug_tableData[i].number).toFixed(2)
856
+            let b = parseFloat(this.drug_tableData[i].price).toFixed(2)
857
+            c = c + this.form.price + (a * b)
435 858
 
436
-          c = c + this.form.price + (a * b)
859
+          }
437 860
 
438 861
         }
439 862
         this.form.price = c.toFixed(2)

+ 63 - 35
src/xt_pages/eleFaPiao/settleDetail.vue Прегледај датотеку

@@ -1029,45 +1029,73 @@ export default {
1029 1029
         this.$message.error("请勾选需要开票的数据");
1030 1030
         return
1031 1031
       }
1032
-      let params = {
1033
-        id: ids,
1034
-        admin_user_id: this.$store.getters.xt_user.user.id,
1035
-      };
1036
-      var that = this;
1037
-      that.isbatchloading = true
1038 1032
 
1039
-      axios.get('http://127.0.0.1:9532/api/bwfapiao/batchopen',{params:params}).then(function(response) {
1040
-        if (response.data.state == 0) {
1041
-          this.isbatchloading = false
1033
+      var sum = 0
1034
+      for (var i = 0; i < this.selection.length; i++){
1035
+          sum = sum + this.selection[i].medfee_sumamt
1036
+      }
1037
+      sum = sum.toFixed(2)
1038
+      this
1039
+        .$confirm("当前所选开票总金额为" + sum+"元,是否批量开票", '信息', {
1040
+          confirmButtonText: '确 定',
1041
+          type: 'warning'
1042
+        })
1043
+        .then(() => {
1044
+          let ids  = ""
1045
+          for (var i = 0; i < this.selection.length; i++){
1046
+            if (ids.length == 0){
1047
+              ids = this.selection[i].id
1048
+            }else{
1049
+              ids = ids + "," + this.selection[i].id
1050
+            }
1051
+          }
1052
+          if(ids.length == 0 ){
1053
+            this.$message.error("请勾选需要开票的数据");
1054
+            return
1055
+          }
1056
+          let params = {
1057
+            id: ids,
1058
+            admin_user_id: this.$store.getters.xt_user.user.id,
1059
+          };
1060
+          var that = this;
1061
+          that.isbatchloading = true
1062
+
1063
+          axios.get('http://127.0.0.1:9532/api/bwfapiao/batchopen',{params:params}).then(function(response) {
1064
+            if (response.data.state == 0) {
1065
+              this.isbatchloading = false
1066
+
1067
+              that.$message.error(response.data.data.msg);
1068
+              return false
1069
+            } else {
1070
+              that.isbatchloading = false
1071
+              if(response.data.data.failed_code == -10){
1072
+                that.$confirm(response.data.data.msg, '错误信息', {
1073
+                  confirmButtonText: '确 定',
1074
+                  type: 'warning'
1075
+                }).then(() => {
1042 1076
 
1043
-          that.$message.error(response.data.data.msg);
1044
-          return false
1045
-        } else {
1046
-          that.isbatchloading = false
1047
-          if(response.data.data.failed_code == -10){
1048
-            that.$confirm(response.data.data.msg, '错误信息', {
1049
-              confirmButtonText: '确 定',
1050
-              type: 'warning'
1051
-            }).then(() => {
1077
+                }).catch(() => {
1078
+                })
1079
+              }else{
1080
+                that.$confirm(response.data.data.msg, '上传信息', {
1081
+                  confirmButtonText: '确 定',
1082
+                  type: 'warning'
1083
+                }).then(() => {
1084
+                  // that.$message.success( response.data.data.msg)
1085
+                  that.getHisOrderList()
1086
+                }).catch(() => {
1087
+                  that.getHisOrderList()
1088
+                })
1089
+              }
1090
+            }
1091
+          }).catch(function(error) {
1092
+            that.isbatchloading = false
1052 1093
 
1053
-            }).catch(() => {
1054
-            })
1055
-          }else{
1056
-            that.$confirm(response.data.data.msg, '上传信息', {
1057
-              confirmButtonText: '确 定',
1058
-              type: 'warning'
1059
-            }).then(() => {
1060
-              // that.$message.success( response.data.data.msg)
1061
-              that.getHisOrderList()
1062
-            }).catch(() => {
1063
-              that.getHisOrderList()
1064
-            })
1065
-          }
1066
-        }
1067
-      }).catch(function(error) {
1068
-        that.isbatchloading = false
1094
+          })
1095
+        })
1096
+        .catch(() => {
1069 1097
 
1070
-      })
1098
+        })
1071 1099
     },
1072 1100
     handleSelectionChange(val) {
1073 1101
       this.selecting_schs = val

+ 7 - 1
src/xt_pages/outpatientCharges/outpatientChargesManagement.vue Прегледај датотеку

@@ -119,7 +119,7 @@
119 119
 
120 120
             <el-button v-loading="loadingone" size="small"
121 121
                        @click="open(40)"
122
-                       v-if="org_id == 10191 || org_id == 10318 || org_id == 10567  || org_id == 10375 || org_id == 10480 || org_id == 10721 || org_id == 10724 || org_id == 9478"
122
+                       v-if="org_id == 10191 || org_id == 10318 || org_id == 10567  || org_id == 10375 || org_id == 10480 || org_id == 10721 || org_id == 10724 || org_id == 9478 || org_id == 10768"
123 123
                        type="primary">登陆
124 124
             </el-button>
125 125
 
@@ -6379,6 +6379,12 @@ export default {
6379 6379
               this.editableTabsValue = this.getPName(this.big_prescriptions[0].med_type, 1)
6380 6380
             }
6381 6381
 
6382
+            this.big_prescriptions.sort((a, b) => {
6383
+              if (a.med_type === 14 && b.med_type !== 14) return -1;
6384
+              if (b.med_type === 14 && a.med_type !== 14) return 1;
6385
+              return a.med_type - b.med_type; // 其他情况按med_type升序排列
6386
+            });
6387
+
6382 6388
           }
6383 6389
         })
6384 6390
 

+ 22 - 2
src/xt_pages/outpatientCharges/summary.vue Прегледај датотеку

@@ -134,6 +134,20 @@
134 134
           </div>
135 135
 
136 136
 
137
+          <div style="margin-left: 5px;">
138
+            <el-select v-model="feeTypeVal" @change="handleMedChange"
139
+                       placeholder="请选择费用类型" style="width: 100%;"
140
+            >
141
+              <el-option
142
+                v-for="item in fee_options"
143
+                :key="item.id"
144
+                :label="item.text"
145
+                :value="item.id">
146
+              </el-option>
147
+            </el-select>
148
+          </div>
149
+
150
+
137 151
         </div>
138 152
         <div class="content_button">
139 153
           <el-button size="small" type="primary" @click="export_detail_three" v-if="$store.getters.xt_user.org_id == 10265 || $store.getters.xt_user.org_id == 0">报表下载12</el-button>
@@ -717,6 +731,10 @@ export default {
717 731
         { id: 0, text: '全部' },
718 732
         { id: 11, text: '普通门诊' },
719 733
         { id: 14, text: '门诊特殊病' }
734
+      ], fee_options: [
735
+        { id: 0, text: '全部' },
736
+        { id: 1, text: '医保' },
737
+        { id: 2, text: '自费' }
720 738
       ],
721 739
       zone_options: [
722 740
         { id: 0, text: '全部分区' }
@@ -743,6 +761,7 @@ export default {
743 761
       sch_type: '0',//班次
744 762
       zoneVal: 0,//分区
745 763
       medTypeVal: 0,
764
+      feeTypeVal:0,
746 765
       start_time: moment(new Date()).add('year', 0).format('YYYY-MM-DD'),
747 766
       end_time: moment(new Date()).add('year', 0).format('YYYY-MM-DD'),
748 767
       pay_time:"",
@@ -2098,7 +2117,7 @@ export default {
2098 2117
           var tarList = []
2099 2118
           for (let i = 0; i < list.length; i++) {
2100 2119
             let obj = {
2101
-              '周期': '2024年第四季度',
2120
+              '周期': '2025年第一季度',
2102 2121
               '类别': '门诊',
2103 2122
               '医保目录编码': list[i].code,
2104 2123
               '医保目录名称': list[i].name,
@@ -4127,7 +4146,8 @@ export default {
4127 4146
         sort_type: this.sort_type,
4128 4147
         sch_type: this.sch_type,
4129 4148
         zone_type: this.zoneVal,
4130
-        med_type: this.medTypeVal
4149
+        med_type: this.medTypeVal,
4150
+        fee_type: this.feeTypeVal
4131 4151
       }
4132 4152
       getHisOrderList(params).then((response) => {
4133 4153
         if (response.data.state == 0) {

+ 232 - 71
src/xt_pages/outpatientDoctorStation/components/deskPrescription.vue Прегледај датотеку

@@ -315,10 +315,13 @@
315 315
           </el-tab-pane>
316 316
           <el-tab-pane label="项目" :name="2">
317 317
 
318
+          </el-tab-pane>
319
+
320
+          <el-tab-pane label="项目组套" :name="3">
321
+
318 322
           </el-tab-pane>
319 323
           <div style="height:100%;" v-show="showOne">
320 324
             <el-tabs class="rightTabs" v-model="drug_activeName">
321
-              <el-tab-pane label="药品列表" name="1">
322 325
                 <div style="margin-bottom:5px;display:flex;">
323 326
                   <el-input style="width:50%;" @input="searchAction"
324 327
                             @keyup.enter.native='searchAction'
@@ -340,7 +343,7 @@
340 343
                 </div>
341 344
                 <div style="width: 100%;flex:1;overflow: hidden;" ref="rightTable">
342 345
                   <el-table ref="multipleTable"
343
-                            :height="multipleTableHeight != '' ? multipleTableHeight : '200'"
346
+                            :height="multipleTableHeight != '' ? multipleTableHeight : '700'"
344 347
                             :data="drugs" border @select='selectDrugs'
345 348
                             :row-style="{ color: '#303133' }"
346 349
                             @select-all="changeAllGoodInfoTableData"
@@ -401,8 +404,6 @@
401 404
                   </el-table>
402 405
                   <!-- <div>{{3*(2/3)}}</div> -->
403 406
                 </div>
404
-
405
-              </el-tab-pane>
406 407
               <!--<el-tab-pane label="医嘱模板" name="2">-->
407 408
               <!--<div style="margin-bottom:5px;">-->
408 409
               <!--&lt;!&ndash;<el-input style="width:50%;" v-model="input" placeholder=""></el-input>&ndash;&gt;-->
@@ -443,9 +444,9 @@
443 444
               <!--</el-tab-pane>-->
444 445
             </el-tabs>
445 446
           </div>
447
+
446 448
           <div style="height:100%;" v-show="showTwo">
447 449
             <el-tabs class="rightTabs" v-model="activeName">
448
-              <el-tab-pane label="项目列表" name="1">
449 450
                 <div style="margin-bottom:5px;">
450 451
                   <!--<el-input style="width:50%;" v-model="input" placeholder=""></el-input>-->
451 452
                   <el-input style="width:50%;" @input="searchProjectAction"
@@ -469,7 +470,7 @@
469 470
                 </div>
470 471
                 <div style="width: 100%;flex:1;overflow-y: auto;">
471 472
                   <el-table ref="tables"
472
-                            :height="multipleTableHeight != '' ? multipleTableHeight : '200'"
473
+                            :height="multipleTableHeight != '' ? multipleTableHeight : '700'"
473 474
                             :data="tabProject" border @select='selectChange'
474 475
                             :row-style="{ color: '#303133' }"
475 476
                             @select-all="changeAllGoodInfoTableDataTwo"
@@ -505,15 +506,18 @@
505 506
                     </el-table-column>
506 507
                   </el-table>
507 508
                 </div>
508
-              </el-tab-pane>
509
-              <el-tab-pane label="项目组套" name="2">
509
+            </el-tabs>
510
+          </div>
511
+
512
+          <div style="height:100%;" v-show="showThree">
513
+            <el-tabs class="rightTabs" v-model="activeName_two">
510 514
                 <el-input style="width:50%;" @input="searchProjectTeamAction"
511 515
                           @keyup.enter.native='searchProjectTeamAction'
512 516
                           v-model.trim="search_project_team_keyword"
513 517
                           placeholder="请输入项目组套名称" :clearable="true"></el-input>
514 518
                 <div style="width: 100%;flex:1;overflow-y: auto;">
515 519
                   <el-table :data="tabPrjectTeam" border ref="tabProjectTeam"
516
-                            :height="multipleTableHeight != '' ? multipleTableHeight : '200'"
520
+                            :height="multipleTableHeight != '' ? multipleTableHeight : '700'"
517 521
                             :row-style="{ color: '#303133' }"
518 522
                             :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
519 523
                             highlight-current-row
@@ -524,9 +528,9 @@
524 528
                     </el-table-column>
525 529
                   </el-table>
526 530
                 </div>
527
-              </el-tab-pane>
528 531
             </el-tabs>
529 532
           </div>
533
+
530 534
         </el-tabs>
531 535
         <template>
532 536
 
@@ -737,6 +741,7 @@ export default {
737 741
       currenet_inedx: 0,
738 742
       rightTab: 1,
739 743
       activeName: '1',
744
+      activeName_two:'3',
740 745
       drug_activeName: '1',
741 746
       curPrescriptions: null,
742 747
       curMonthPrescriptions: this.month_prescriptions[0],
@@ -757,6 +762,7 @@ export default {
757 762
       strids: '',
758 763
       showOne: true,
759 764
       showTwo: false,
765
+      showThree:false,
760 766
       tableData: [],
761 767
       tabPrjectTeam: [],
762 768
       allTabPrjectTeam: [],
@@ -1621,6 +1627,7 @@ export default {
1621 1627
             this.rightTab = 1
1622 1628
             this.showOne = true
1623 1629
             this.showTwo = false
1630
+            this.showThree = false
1624 1631
           }
1625 1632
           if (this.prescriptions[0].advices.length == 0 && this.prescriptions[0].project.length > 0) {
1626 1633
             this.customTabIndex = 2
@@ -1628,6 +1635,8 @@ export default {
1628 1635
             this.rightTab = 2
1629 1636
             this.showTwo = true
1630 1637
             this.showOne = false
1638
+            this.showThree = false
1639
+
1631 1640
           }
1632 1641
         }
1633 1642
       }
@@ -1686,6 +1695,8 @@ export default {
1686 1695
             this.rightTab = 1
1687 1696
             this.showOne = true
1688 1697
             this.showTwo = false
1698
+            this.showThree = false
1699
+
1689 1700
           }
1690 1701
 
1691 1702
           if (this.prescriptions[0].advices.length == 0 && this.prescriptions[0].project.length > 0) {
@@ -1694,6 +1705,8 @@ export default {
1694 1705
             this.rightTab = 2
1695 1706
             this.showTwo = true
1696 1707
             this.showOne = false
1708
+            this.showThree = false
1709
+
1697 1710
           }
1698 1711
         }
1699 1712
       }
@@ -2153,6 +2166,8 @@ export default {
2153 2166
             this.rightTab = 1
2154 2167
             this.showOne = true
2155 2168
             this.showTwo = false
2169
+            this.showThree = false
2170
+
2156 2171
           }
2157 2172
           if (this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length > 0) {
2158 2173
 
@@ -2162,6 +2177,8 @@ export default {
2162 2177
 
2163 2178
             this.showTwo = true
2164 2179
             this.showOne = false
2180
+            this.showThree = false
2181
+
2165 2182
           }
2166 2183
 
2167 2184
           if (this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length == 0) {
@@ -2298,6 +2315,8 @@ export default {
2298 2315
         this.rightTab = 1
2299 2316
         this.showOne = true
2300 2317
         this.showTwo = false
2318
+        this.showThree = false
2319
+
2301 2320
       }
2302 2321
 
2303 2322
       if (this.curPrescriptions.project.length > 0 && this.curPrescriptions.advices.length == 0) {
@@ -2306,6 +2325,8 @@ export default {
2306 2325
         this.rightTab = 2
2307 2326
         this.showOne = false
2308 2327
         this.showTwo = true
2328
+        this.showThree = false
2329
+
2309 2330
       }
2310 2331
 
2311 2332
       if (this.curPrescriptions.project.length == 0 && this.curPrescriptions.advices.length == 0) {
@@ -2314,6 +2335,8 @@ export default {
2314 2335
         this.rightTab = 1
2315 2336
         this.showOne = true
2316 2337
         this.showTwo = false
2338
+        this.showThree = false
2339
+
2317 2340
       }
2318 2341
 
2319 2342
       if (info.prescription_status == 0) {
@@ -2357,6 +2380,7 @@ export default {
2357 2380
 
2358 2381
       //
2359 2382
       // if (this.org_id == 10598 || this.org_id == 0) {
2383
+      // if (this.org_id == 10598 || this.org_id == 0) {
2360 2384
       //   this.state1 = 662
2361 2385
       // }
2362 2386
 
@@ -2489,7 +2513,7 @@ export default {
2489 2513
         this.state1 = 607
2490 2514
       }
2491 2515
 
2492
-      if (this.org_id == 10598 || this.org_id == 0) {
2516
+      if (this.org_id == 10598 ) {
2493 2517
         this.state1 = 693
2494 2518
       }
2495 2519
 
@@ -2500,13 +2524,26 @@ export default {
2500 2524
         }
2501 2525
       }
2502 2526
 
2503
-      if (this.org_id == 10206 || this.org_id == 0) {
2527
+      if (this.org_id == 10206) {
2504 2528
         this.departmentValue = 263
2505 2529
         if (this.diagnose.length == 0) {
2506 2530
           this.diagnose.push(716)
2507 2531
         }
2508 2532
       }
2509 2533
 
2534
+      if (this.org_id == 10726) {
2535
+        this.doctorValue = 5835
2536
+
2537
+      }
2538
+
2539
+      if (this.org_id == 9478 ) {
2540
+        this.state1 = 827
2541
+      }
2542
+
2543
+      if (this.patientInfo.id == 38626 ) {
2544
+        this.state1 = 828
2545
+      }
2546
+
2510 2547
     },
2511 2548
     setMonthData(info, admin_info, doctors, department, hisPatientInfo, month_data, last_info) {
2512 2549
       // this.start_time = moment(new Date()).subtract(30, 'days').format('YYYY-MM-DD')
@@ -3675,6 +3712,8 @@ export default {
3675 3712
 
3676 3713
         this.showOne = true
3677 3714
         this.showTwo = false
3715
+        this.showThree = false
3716
+
3678 3717
         this.$nextTick(() => {
3679 3718
           this.$refs.prescription_tables.setNewData(this.prescriptions[this.prescriptions.length - 1])
3680 3719
         })
@@ -3686,6 +3725,22 @@ export default {
3686 3725
 
3687 3726
         this.showTwo = true
3688 3727
         this.showOne = false
3728
+        this.showThree = false
3729
+
3730
+        this.$nextTick(() => {
3731
+          this.$refs.prescription_tables.setNewData(this.prescriptions[this.prescriptions.length - 1])
3732
+        })
3733
+        this.customTabIndex = 2
3734
+      }
3735
+
3736
+      if (index == 3) {
3737
+        this.curDrugs = []
3738
+        this.$refs.multipleTable.clearSelection()
3739
+
3740
+        this.showTwo = false
3741
+        this.showOne = false
3742
+        this.showThree = true
3743
+
3689 3744
         this.$nextTick(() => {
3690 3745
           this.$refs.prescription_tables.setNewData(this.prescriptions[this.prescriptions.length - 1])
3691 3746
         })
@@ -3705,8 +3760,8 @@ export default {
3705 3760
       }
3706 3761
       if (this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length == 0) {
3707 3762
         // this.customTabIndex = this.rightTab
3708
-        this.customTabIndex = index
3709
-        this.curStatus = 0
3763
+        this.customTabIndex = 2
3764
+        this.curStatus = 2
3710 3765
 
3711 3766
       }
3712 3767
 
@@ -3891,15 +3946,6 @@ export default {
3891 3946
         }
3892 3947
       }
3893 3948
 
3894
-      // for (let i = 0; i < templateDrugs.length; i++) {
3895
-      //   for (let a = 0; a < this.curPrescriptions.advices.length; a++) {
3896
-      //     if (this.templateDrugs[i].drug_id == this.curPrescriptions.advices[i].id) {
3897
-      //       this.$message.error('改处方存在相同的药品,无法添加相同的药品')
3898
-      //       return
3899
-      //
3900
-      //     }
3901
-      //   }
3902
-      // }
3903 3949
 
3904 3950
       //大丰限制用药提醒逻辑
3905 3951
       var temp = this.deepClone(this.curDrugs)
@@ -4112,7 +4158,7 @@ export default {
4112 4158
           if (this.prescriptions[i].name == this.editableTabsValue) {
4113 4159
             var temp = this.deepClone(this.curDrugs)
4114 4160
             var temp2 = this.deepClone(this.teamList)
4115
-
4161
+            console.log(this.teamList)
4116 4162
             var temp3 = this.deepClone(templateDrugs)
4117 4163
 
4118 4164
             if (temp3.length > 0) {
@@ -4128,7 +4174,6 @@ export default {
4128 4174
                   remark: '',
4129 4175
                   day: '1',
4130 4176
                   is_medicine:0,
4131
-
4132 4177
                   prescribing_number: temp3[b].prescribing_number,
4133 4178
                   single_dose_unit: temp3[b].drug.drug_dose_unit,
4134 4179
                   prescribing_number_unit: temp3[b].drug.prescribing_number_unit,
@@ -4227,61 +4272,131 @@ export default {
4227 4272
 
4228 4273
             }
4229 4274
 
4275
+            var advices = []
4230 4276
             if (temp2.length > 0) {
4231 4277
               for (let b = 0; b < temp2.length; b++) {
4232
-                let obj = {
4233
-                  id: 0,
4234
-                  project_id: temp2[b].id,
4235
-                  project_name: temp2[b].project_name,
4236
-                  statistical_classification: '',
4237
-                  single_dose: temp2[b].single_dose.toString(),
4238
-                  delivery_way: temp2[b].delivery_way,
4239
-                  execution_frequency: temp2[b].execution_frequency,
4240
-                  number_days: temp2[b].number_days.toString(),
4241
-                  total: temp2[b].cus_total,
4242
-                  price: temp2[b].price,
4243
-                  remark: '',
4244
-                  medical_code: temp2[b].medical_code,
4245
-                  type: temp2[b].type,
4246
-                  execution_state: 2
4278
+                if(temp2[b].type == 1){
4279
+                    if (temp2[b].max_unit == temp2[b].min_unit) {
4280
+                      temp2[b].retail_price = temp2[b].min_price
4281
+                    }
4282
+                    let temp_index = 0
4283
+                    if (this.org_id == 0 || this.org_id == 10206) {
4284
+                      temp_index = maxIndexAdvice.groupno
4285
+                    } else {
4286
+                      temp_index = b + 1
4287
+                    }
4288
+                    let obj = {
4289
+                      advice_id: 0,
4290
+                      id: temp2[b].id,
4291
+                      drug_name: temp2[b].drug.drug_name,
4292
+                      single_dose: temp2[b].single_dose,
4293
+                      delivery_way: temp2[b].delivery_way,
4294
+                      execution_frequency: temp2[b].execution_frequency,
4295
+                      retail_price: temp2[b].prescribing_number_unit == temp2[b].drug.max_unit ? temp2[b].drug.retail_price.toString() : temp2[b].drug.min_price.toString(),
4296
+                      remark: '',
4297
+                      day: temp2[b].day,
4298
+                      prescribing_number: temp2[b].prescribing_number,
4299
+                      single_dose_unit: temp2[b].single_dose_unit,
4300
+                      prescribing_number_unit: temp2[b].prescribing_number_unit,
4301
+                      medical_insurance_number: temp2[b].medical_insurance_number,
4302
+                      drug: temp2[b].drug,
4303
+                      groupno: index + temp_index,
4304
+                      hosp_appr_flag: '1',
4305
+                      execution_state: 2,
4306
+                      is_medicine:0,
4307
+                    }
4308
+                    if (obj.prescribing_number == 0 || obj.prescribing_number.length == 0) {
4309
+                      obj.prescribing_number = 1
4310
+                    }
4311
+                  advices.push(obj)
4312
+                }else{
4313
+                  let obj = {
4314
+                    id: 0,
4315
+                    project_id: temp2[b].id,
4316
+                    project_name: temp2[b].project_name,
4317
+                    statistical_classification: '',
4318
+                    single_dose: temp2[b].single_dose.toString(),
4319
+                    delivery_way: temp2[b].delivery_way,
4320
+                    execution_frequency: temp2[b].execution_frequency,
4321
+                    number_days: temp2[b].number_days.toString(),
4322
+                    total: temp2[b].cus_total,
4323
+                    price: temp2[b].price,
4324
+                    remark: '',
4325
+                    medical_code: temp2[b].medical_code,
4326
+                    type: temp2[b].type,
4327
+                    execution_state: 2
4247 4328
 
4248
-                }
4329
+                  }
4330
+                  if (temp2[b].type == 2) {
4331
+                    obj['project'] = temp2[b].project
4332
+                    obj['unit'] = temp2[b].project.unit
4249 4333
 
4250
-                if (temp2[b].type == 2) {
4251
-                  obj['project'] = temp2[b].project
4252
-                  obj['unit'] = temp2[b].project.unit
4334
+                  } else if (temp2[b].type == 3) {
4335
+                    obj['good_info'] = temp2[b].good_info
4336
+                    obj['unit'] = temp2[b].good_info.packing_unit
4253 4337
 
4254
-                } else if (temp2[b].type == 3) {
4255
-                  obj['good_info'] = temp2[b].good_info
4256
-                  obj['unit'] = temp2[b].good_info.packing_unit
4338
+                  }
4339
+                  if (temp2[b].team_id == undefined) {
4340
+                    obj['team_id'] = 0
4341
+                  } else {
4342
+                    obj['team_id'] = temp2[b].team_id
4343
+                  }
4344
+                  if (obj.total == 0 || obj.total == undefined) {
4345
+                    obj.total = 1
4346
+                  }
4347
+                  if (obj.type == 3) {
4348
+                    obj.single_dose = 1
4349
+                  }
4257 4350
 
4351
+                  this.prescriptions[i].project.push(obj)
4258 4352
                 }
4259
-                if (temp2[b].team_id == undefined) {
4260
-                  obj['team_id'] = 0
4353
+                this.curStatus = 2
4354
+              }
4355
+            }
4356
+
4357
+            var nowDate = new Date()
4358
+            var nowYear = nowDate.getFullYear()
4359
+            var nowMonth = nowDate.getMonth() + 1
4360
+            var nowDay = nowDate.getDate()
4361
+            var hours = nowDate.getHours()
4362
+            var min = nowDate.getMinutes()
4363
+            var nowTime =
4364
+              nowYear +
4365
+              '-' +
4366
+              (nowMonth < 10 ? '0' + nowMonth : nowMonth) +
4367
+              '-' +
4368
+              (nowDay < 10 ? '0' + nowDay : nowDay) + ' ' + (hours < 10 ? '0' + hours : hours) +
4369
+              ':' + (min < 10 ? '0' + min : min)
4370
+            if(advices.length > 0){
4371
+              let index = this.prescriptions.length + 1
4372
+              let obj = {
4373
+                id: 0,
4374
+                name: '处方' + index,
4375
+                advices: advices,
4376
+                project: [],
4377
+                addition: [],
4378
+                diagnose: [],
4379
+                order_status: 0,
4380
+                pre_time: nowTime,
4381
+                med_type: "",
4382
+                is_medicine_status: 0,
4383
+              }
4384
+              if (obj.med_type == 0 || obj.med_type == '') {
4385
+                if (this.org_id != 10206) {
4386
+                  obj.med_type = 14
4387
+                  if (this.org_id == 10721 || this.org_id == 0){
4388
+
4389
+                    obj.med_type = 992102
4390
+                  }
4261 4391
                 } else {
4262
-                  obj['team_id'] = temp2[b].team_id
4392
+                  obj.med_type = 1
4263 4393
                 }
4264
-                if (obj.total == 0 || obj.total == undefined) {
4265
-                  obj.total = 1
4266
-                }
4267
-                if (obj.type == 3) {
4268
-                  obj.single_dose = 1
4394
+              }else{
4395
+                if (this.org_id == 10721 || this.org_id == 0){
4396
+                  obj.med_type = 992102
4269 4397
                 }
4270
-                // 针对灵山圣康
4271
-                // if (this.org_id == 0 || this.org_id == 10375) {
4272
-
4273
-                //   if (this.prescriptions[i] != null) {
4274
-
4275
-                //     if (this.prescriptions[i].project.length >= 5) {
4276
-                //       this.$message.error('添加条数已经大于5条,添加失败!')
4277
-                //       return false
4278
-                //     }
4279
-
4280
-                //   }
4281
-                // }
4282
-                this.prescriptions[i].project.push(obj)
4283 4398
               }
4284
-              this.curStatus = 2
4399
+              this.prescriptions.push(obj)
4285 4400
             }
4286 4401
 
4287 4402
             this.curPrescriptions = this.prescriptions[i]
@@ -4515,11 +4630,14 @@ export default {
4515 4630
       for (let i = 0; i < row.length; i++) {
4516 4631
         let team_id = row[i].id
4517 4632
         const params = {
4518
-          project_id: row[i].item_id
4633
+          project_id: row[i].item_id,
4634
+          drug_id: row[i].drug_item_id,
4519 4635
         }
4520 4636
         getPojectListById(params).then(response => {
4521 4637
           if (response.data.state == 1) {
4522 4638
             var project = response.data.data.project
4639
+            var advice = response.data.data.advice
4640
+
4523 4641
             let num = 0
4524 4642
             for (let i = 0; i < project.length; i++) {
4525 4643
               if (project[i].type == 2 && project[i].status == 1) {
@@ -4589,6 +4707,49 @@ export default {
4589 4707
               }
4590 4708
             }
4591 4709
 
4710
+            for (let i = 0; i < advice.length; i++) {
4711
+                if (advice[i].drug.sum_count <= 0 && this.org_id != 10206) {
4712
+                  num++
4713
+                  this.$refs.tabProjectTeam.toggleRowSelection(row)
4714
+                  this.$message.error(advice[i].drug.drug_name  + '库存不足')
4715
+                }
4716
+
4717
+                if (project[i].good_info.zuobiao_stock_num <= 0 && this.org_id == 10206) {
4718
+                  num++
4719
+                  this.$refs.tabProjectTeam.toggleRowSelection(row)
4720
+                  this.$message.error(advice[i].drug.drug_name + '库存不足')
4721
+                }
4722
+
4723
+                if (num > 0) {
4724
+                  this.$refs.tabProjectTeam.clearSelection()
4725
+                }
4726
+
4727
+                let obj = {
4728
+                  advice_id: 0,
4729
+                  id: advice[i].drug_id,
4730
+                  drug_name: advice[i].drug_name,
4731
+                  single_dose: advice[i].single_dose,
4732
+                  delivery_way: advice[i].delivery_way,
4733
+                  execution_frequency: advice[i].execution_frequency,
4734
+                  retail_price: advice[i].prescribing_number_unit == advice[i].drug.max_unit ? advice[i].drug.retail_price.toString() : advice[i].drug.min_price.toString(),
4735
+                  remark: '',
4736
+                  day: advice[i].day_count,
4737
+                  prescribing_number: advice[i].prescribing_number,
4738
+                  single_dose_unit: advice[i].single_dose_unit,
4739
+                  prescribing_number_unit: advice[i].prescribing_number_unit,
4740
+                  medical_insurance_number: advice[i].drug.medical_insurance_number,
4741
+                  drug: advice[i].drug,
4742
+                  groupno: i,
4743
+                  type:1,
4744
+                  hosp_appr_flag: '1',
4745
+                  execution_state: 2,
4746
+                  is_medicine:0,
4747
+                }
4748
+                if (obj.cus_total == 0 || obj.cus_total == undefined) {
4749
+                  obj.cus_total = 1
4750
+                }
4751
+                teamList.push(obj)
4752
+            }
4592 4753
             this.teamList = teamList
4593 4754
           }
4594 4755
         })
@@ -5184,7 +5345,7 @@ p {
5184 5345
 }
5185 5346
 
5186 5347
 .el-tabs__item {
5187
-  width: 50%;
5348
+  width: 30%;
5188 5349
   text-align: center;
5189 5350
 }
5190 5351