mainqaq 2 years ago
parent
commit
c8e5d4ab9c

+ 230 - 271
src/xt_pages/outpatientDoctorStation/batch_delete.vue View File

@@ -6,7 +6,10 @@
6 6
         <div class="banner_left">
7 7
           <div>
8 8
             透析模式:
9
-            <el-select v-model="modeOptions_value" placeholder="请选择">
9
+            <el-select
10
+              v-model="modeOptions_value"
11
+              placeholder="请选择"
12
+            >
10 13
               <el-option
11 14
                 v-for="item in modeOptions"
12 15
                 :key="item.id"
@@ -18,11 +21,7 @@
18 21
           </div>
19 22
           <div>
20 23
             删除类型:
21
-            <el-select
22
-              v-model="new_type"
23
-              placeholder="请选择"
24
-              @change="changetype"
25
-            >
24
+            <el-select v-model="new_type" placeholder="请选择" @change="changetype">
26 25
               <el-option
27 26
                 v-for="item in options"
28 27
                 :key="item.id"
@@ -68,8 +67,8 @@
68 67
           </div>
69 68
         </div>
70 69
 
71
-        <!--        <button @click="lili">调试</button>-->
72
-        <el-button type="primary" @click="save">保存</el-button>
70
+<!--        <button @click="lili">调试</button>-->
71
+        <el-button @click="save">保存</el-button>
73 72
       </div>
74 73
 
75 74
       <el-container>
@@ -90,16 +89,16 @@
90 89
           >
91 90
             <el-table-column type="selection" width="55"> </el-table-column>
92 91
             <el-table-column label="患者姓名" width="155">
93
-              <template slot-scope="scope">{{ scope.row.name }}</template>
92
+              <template slot-scope="scope" >{{ scope.row.name }}</template>
94 93
             </el-table-column>
95 94
           </el-table>
96 95
         </div>
97 96
 
98 97
         <el-tabs type="border-card" v-if="isshow == 1 && list.length > 0">
99 98
           <el-tab-pane
100
-            v-for="(item, index) in list"
99
+            v-for="(item,index) in list"
101 100
             :key="index"
102
-            :label="'处方' + (index + 1)"
101
+            :label="'处方'+(index+1)"
103 102
             :name="index"
104 103
           >
105 104
             <el-table
@@ -116,31 +115,32 @@
116 115
             >
117 116
               <el-table-column fixed label="药品名称" width="230">
118 117
                 <template slot-scope="scope">
119
-                  {{ scope.row.advice_name }}
118
+                  {{scope.row.advice_name}}
120 119
                 </template>
121 120
               </el-table-column>
122 121
               <el-table-column label="单次用量" width="200">
123 122
                 <template slot-scope="scope">
124
-                  {{ scope.row.single_dose }}{{ scope.row.single_dose_unit }}
123
+                  {{scope.row.single_dose}}{{scope.row.single_dose_unit}}
125 124
                 </template>
126 125
               </el-table-column>
127 126
               <el-table-column label="用法" width="120">
128 127
                 <template slot-scope="scope">
129
-                  {{ scope.row.delivery_way }}
128
+                  {{scope.row.delivery_way}}
130 129
                 </template>
131 130
               </el-table-column>
132 131
               <el-table-column label="频率" width="120">
133 132
                 <template slot-scope="scope">
134
-                  {{ scope.row.execution_frequency }}
133
+                  {{scope.row.execution_frequency}}
135 134
                 </template>
136 135
               </el-table-column>
137 136
               <el-table-column label="天数" width="110">
138
-                <template slot-scope="scope"> {{ scope.row.day }}天 </template>
137
+                <template slot-scope="scope">
138
+                  {{scope.row.day}}天
139
+                </template>
139 140
               </el-table-column>
140 141
               <el-table-column label="总量" width="200">
141 142
                 <template slot-scope="scope">
142
-                  {{ scope.row.prescribing_number
143
-                  }}{{ scope.row.prescribing_number_unit }}
143
+                  {{scope.row.prescribing_number}}{{scope.row.prescribing_number_unit}}
144 144
                 </template>
145 145
               </el-table-column>
146 146
               <el-table-column label="单价" width="120">
@@ -156,10 +156,9 @@
156 156
               <el-table-column label="操作" width="120">
157 157
                 <template slot-scope="scope">
158 158
                   <el-button
159
-                    @click.native.prevent="delects(scope.$index, scope, item)"
159
+                    @click.native.prevent="delects(scope.$index,scope,item)"
160 160
                     type="text"
161
-                    size="small"
162
-                  >
161
+                    size="small">
163 162
                     删除
164 163
                   </el-button>
165 164
                 </template>
@@ -180,79 +179,66 @@
180 179
             >
181 180
               <el-table-column fixed label="项目名称" width="230">
182 181
                 <template slot-scope="scope">
183
-                  <div v-if="scope.row.type == 2">
184
-                    {{ scope.row.project.project_name }}
185
-                  </div>
186
-                  <div v-if="scope.row.type == 3">
187
-                    {{ scope.row.good_info.good_name }}
188
-                  </div>
182
+                  <div v-if="scope.row.type == 2">{{scope.row.project.project_name}}</div>
183
+                  <div v-if="scope.row.type == 3">{{scope.row.good_info.good_name}}</div>
189 184
                 </template>
190 185
               </el-table-column>
191 186
               <el-table-column label="组" width="120">
192 187
                 <template slot-scope="scope">
193
-                  <div v-if="scope.row.type == 2">
194
-                    {{ scope.row.project.translate }}
195
-                  </div>
196
-                  <div v-if="scope.row.type == 3">
197
-                    {{ scope.row.good_info.translate }}
198
-                  </div>
188
+                  <div v-if="scope.row.type == 2">{{scope.row.project.translate}}</div>
189
+                  <div v-if="scope.row.type == 3">{{scope.row.good_info.translate}}</div>
199 190
                 </template>
200 191
               </el-table-column>
201 192
               <el-table-column label="单次用量" width="120">
202 193
                 <template slot-scope="scope">
203
-                  {{ scope.row.single_dose }}
194
+                  {{scope.row.single_dose}}
204 195
                   {{ scope.row.unit }}
205 196
                 </template>
206 197
               </el-table-column>
207 198
               <el-table-column label="用法" width="120">
208 199
                 <template slot-scope="scope">
209
-                  {{ scope.row.delivery_way }}
200
+                  {{scope.row.delivery_way}}
210 201
                 </template>
211 202
               </el-table-column>
212 203
               <el-table-column label="频率" width="120">
213 204
                 <template slot-scope="scope">
214
-                  {{ scope.row.execution_frequency }}
205
+                  {{scope.row.execution_frequency}}
215 206
                 </template>
216 207
               </el-table-column>
217 208
               <el-table-column label="天数" width="110">
218
-                <template slot-scope="scope"> {{ scope.row.day }}天 </template>
209
+                <template slot-scope="scope">
210
+                  {{scope.row.day}}天
211
+                </template>
219 212
               </el-table-column>
220 213
               <el-table-column label="总量" width="100">
221 214
                 <template slot-scope="scope">
222
-                  {{ scope.row.count }}
215
+                  {{scope.row.count}}
223 216
                   {{ scope.row.unit }}
224 217
                 </template>
225 218
               </el-table-column>
226 219
               <el-table-column label="单价" width="120">
227 220
                 <template slot-scope="scope">
228
-                  {{ scope.row.price }}元
221
+                  {{scope.row.price}}元
229 222
                 </template>
230 223
               </el-table-column>
231 224
               <el-table-column label="备注" width="120">
232 225
                 <template slot-scope="scope">
233
-                  {{ scope.row.remark }}
226
+                  {{scope.row.remark}}
234 227
                 </template>
235 228
               </el-table-column>
236 229
               <el-table-column label="推送频率" width="120">
237 230
                 <template slot-scope="scope">
238
-                  <div v-if="scope.row.frequency_type == 1">
239
-                    {{ "每次必推" }}
240
-                  </div>
241
-                  <div v-if="scope.row.frequency_type == 2">
242
-                    {{ scope.row.day_count }}天/次
243
-                  </div>
244
-                  <div v-if="scope.row.frequency_type == 3">
245
-                    {{ scope.row.week_days }}
246
-                  </div>
231
+                  <div v-if="scope.row.frequency_type == 1">{{'每次必推'}}</div>
232
+                  <div v-if="scope.row.frequency_type == 2">{{scope.row.day_count}}天/次</div>
233
+                  <div v-if="scope.row.frequency_type == 3">{{scope.row.week_days}}</div>
247 234
                 </template>
248 235
               </el-table-column>
249 236
               <el-table-column fixed="right" label="操作" width="102">
250 237
                 <template slot-scope="scope">
251 238
                   <el-button
252
-                    @click.native.prevent="delects(scope.$index, scope, item)"
239
+                    @click.native.prevent="delects(scope.$index,scope,item)"
253 240
                     type="text"
254
-                    size="small"
255
-                  >
241
+                    size="small">
256 242
                     删除
257 243
                   </el-button>
258 244
                 </template>
@@ -284,128 +270,93 @@ export default {
284 270
       tableList: [],
285 271
       editableTabsValue: "1",
286 272
       modeOptions: {},
287
-      tableDatas: [
288
-        {
289
-          id: "",
290
-          drug_name: "",
291
-          single_dose: "",
292
-          single_dose_unit: "",
293
-          delivery_way: "",
294
-          execution_frequency: "",
295
-          day: "",
296
-          prescribing_number: "",
297
-          prescribing_number_unit: "",
298
-          price: "",
299
-          remark: "",
300
-        },
301
-      ], //药品
302
-      project: [
303
-        {
304
-          id: "",
305
-          drug_name: "",
306
-          translate: "",
307
-          single_dose: "",
308
-          unit: "",
309
-          delivery_way: "",
310
-          execution_frequency: "",
311
-          day: "",
312
-          prescribing_number: "",
313
-          price: "",
314
-          remark: "",
315
-          frequency_type: 1,
316
-          day_count: "",
317
-          week_days: "",
318
-        },
319
-      ], //项目
273
+      tableDatas:[{
274
+        id: "",
275
+        drug_name: "",
276
+        single_dose: "",
277
+        single_dose_unit: "",
278
+        delivery_way: "",
279
+        execution_frequency: "",
280
+        day: "",
281
+        prescribing_number: "",
282
+        prescribing_number_unit: "",
283
+        price: "",
284
+        remark: "",
285
+      },],//药品
286
+      project:[ {
287
+        id: "",
288
+        drug_name: "",
289
+        translate:"",
290
+        single_dose: "",
291
+        unit: "",
292
+        delivery_way: "",
293
+        execution_frequency: "",
294
+        day: "",
295
+        prescribing_number: "",
296
+        price: "",
297
+        remark: "",
298
+        frequency_type:1,
299
+        day_count:"",
300
+        week_days:"",
301
+      },],//项目
320 302
       tabIndex: 2,
321 303
       modeOptions_value: 1, //透析模式
322
-      multipleSelection: [], //选中的患者
323
-      tableData: [],
324
-      options: [
325
-        { id: 1, name: "药品" },
326
-        { id: 2, name: "项目" },
327
-      ],
328
-      options_patient: [
329
-        { id: 1, name: "是" },
330
-        { id: 2, name: "否" },
331
-      ],
332
-      options_2: [
333
-        { id: 1, name: "普通门诊" },
334
-        { id: 2, name: "门诊特殊病" },
335
-      ],
336
-      new_type: 1, //新增类型
337
-      druglist: [], //药品列表
338
-      projectlist: [], //项目列表
339
-      id: "", //药品、项目、耗材
340
-      tmplist: [], //临时
341
-      unit: [
342
-        { id: 1, name: "g" },
343
-        { id: 2, name: "mg" },
344
-        { id: 3, name: "u" },
345
-        { id: 4, name: "ml" },
346
-        { id: 5, name: "万U" },
347
-        { id: 6, name: "枚" },
348
-        { id: 7, name: "粒" },
349
-        { id: 8, name: "片" },
350
-        { id: 9, name: "支" },
351
-        { id: 10, name: "μg" },
352
-        { id: 11, name: "iu" },
353
-        { id: 12, name: "包" },
354
-        { id: 13, name: "袋" },
355
-        { id: 14, name: "万" },
356
-        { id: 15, name: "万iu" },
357
-        { id: 16, name: "丸" },
358
-        { id: 17, name: "盒" },
359
-        { id: 18, name: "瓶" },
360
-        { id: 19, name: "瓶(袋)" },
361
-        { id: 20, name: "次" },
362
-      ],
363
-      usage: [], //用法
364
-      frequency: [], //频率
365
-      frequency_type: "", //周期提醒
366
-      day_count: "", //周期提醒天
367
-      week_days: [], //周期提醒星期
368
-      tabhang: 0, //tab的下标
369
-      hang: 0, //行数
370
-      list: [],
371
-      isshow: 0, //是否显示处方
372
-      tmpid: 0,
373
-    };
304
+      multipleSelection: [],//选中的患者
305
+      tableData:[],
306
+      options:[{id:1,name:"药品"},{id:2,name:"项目"}],
307
+      options_patient:[{id:1,name:"是"},{id:2,name:"否"}],
308
+      options_2:[{id:1,name:"普通门诊"},{id:2,name:"门诊特殊病"}],
309
+      new_type:1,//新增类型
310
+      druglist:[],//药品列表
311
+      projectlist:[],//项目列表
312
+      id:"",//药品、项目、耗材
313
+      tmplist:[],//临时
314
+      unit:[{id:1,name:"g"},{id:2,name:"mg"},{id:3,name:"u"},{id:4,name:"ml"},{id:5,name:"万U"},{id:6,name:"枚"},{id:7,name:"粒"},
315
+        {id:8,name:"片"},{id:9,name:"支"},{id:10,name:"μg"},{id:11,name:"iu"},{id:12,name:"包"},{id:13,name:"袋"},{id:14,name:"万"},
316
+        {id:15,name:"万iu"},{id:16,name:"丸"},{id:17,name:"盒"},{id:18,name:"瓶"},{id:19,name:"瓶(袋)"},{id:20,name:"次"}],
317
+      usage:[],//用法
318
+      frequency:[],//频率
319
+      frequency_type:"",//周期提醒
320
+      day_count:"",//周期提醒天
321
+      week_days:[],//周期提醒星期
322
+      tabhang:0,//tab的下标
323
+      hang:0,//行数
324
+      list:[],
325
+      isshow:0,//是否显示处方
326
+      tmpid:0,
327
+
328
+    }
374 329
   },
375 330
   created() {
376 331
     // console.log("this.$store.getters.treatment_mode",this.$store.getters.treatment_mode)
377 332
     for (let key in this.$store.getters.treatment_mode) {
378
-      this.modeOptions[key] = this.$store.getters.treatment_mode[key];
333
+      this.modeOptions[key] = this.$store.getters.treatment_mode[key]
379 334
     }
380 335
     // console.log("this.modeOptions",this.modeOptions)
381 336
     this.getdrugconfigs();
382
-    this.isshow = 0;
337
+    this.isshow = 0
383 338
     this.tmpid = 0;
384 339
   },
385 340
   methods: {
386 341
     save() {
387
-      var tmp = this.modeOptions[this.modeOptions_value].name;
388
-      var tmp2 = "";
389
-      if (this.druglist != null) {
390
-        for (let i = 0; i < this.druglist.length; i++) {
391
-          if (this.id == this.druglist[i].id) {
392
-            tmp2 = this.druglist[i].name;
342
+      var tmp = this.modeOptions[this.modeOptions_value].name
343
+      var tmp2 = ""
344
+      if (this.druglist != null){
345
+        for(let i = 0;i < this.druglist.length;i++){
346
+          if (this.id == this.druglist[i].id){
347
+            tmp2 = this.druglist[i].name
393 348
           }
394 349
         }
395 350
       }
396
-      if (this.projectlist != null) {
397
-        for (let j = 0; j < this.projectlist.length; j++) {
398
-          if (this.id == this.projectlist[j].id) {
399
-            tmp2 = this.projectlist[j].name;
351
+      if(this.projectlist != null){
352
+        for (let j = 0;j < this.projectlist.length;j++){
353
+          if (this.id == this.projectlist[j].id){
354
+            tmp2 = this.projectlist[j].name
400 355
           }
401 356
         }
402 357
       }
403 358
       this.$confirm(
404
-        "注:该操作将会把所选患者的" +
405
-          tmp +
406
-          "透析模式中的" +
407
-          tmp2 +
408
-          "进行删除,请确定是否删除?",
359
+        "请确定是否删除?",//注:该操作将会把所选患者的"+tmp+"透析模式中的"+tmp2+"进行删除,
409 360
         "",
410 361
         {
411 362
           confirmButtonText: "确 定",
@@ -413,111 +364,120 @@ export default {
413 364
           type: "warning",
414 365
         }
415 366
       ).then(() => {
416
-        if (this.multipleSelection.length == 0) {
417
-          this.$message.error("没有选中有效信息");
418
-          return;
367
+        if (this.multipleSelection.length == 0){
368
+          this.$message.error('没有选中有效信息')
369
+          return
419 370
         }
420
-        let st = "";
421
-        for (let i = 0; i < this.multipleSelection.length; i++) {
422
-          st = st + this.multipleSelection[i].id + ",";
371
+        let st = ""
372
+        for (let i = 0;i < this.multipleSelection.length;i++){
373
+          st = st + this.multipleSelection[i].id + ","
423 374
         }
424
-        console.log("string", st);
375
+        console.log("string",st)
425 376
         let params = {
426
-          mode_id: this.modeOptions_value,
377
+          mode_id:this.modeOptions_value,
427 378
           patient_id: st,
428
-          type: this.new_type,
379
+          type:this.new_type,
429 380
           replaced: this.id,
430
-        };
431
-        if (this.new_type == 1) {
432
-          deletedrugsbatch(params).then((res) => {
433
-            if (res.data.state == 1) {
434
-              this.$message.success("删除成功");
435
-              this.getUsername();
436
-            } else {
437
-              this.$message.error(res.data.msg);
381
+        }
382
+        if (this.new_type == 1){
383
+          deletedrugsbatch(params).then((res) =>{
384
+            if (res.data.state == 1){
385
+              this.$message.success('删除成功')
386
+              this.getUsername()
387
+            }else{
388
+              this.$message.error(res.data.msg)
438 389
             }
439
-          });
440
-        } else {
441
-          batchdeleteitems(params).then((res) => {
442
-            if (res.data.state == 1) {
443
-              this.$message.success("删除成功");
444
-              this.getUsername();
445
-            } else {
446
-              this.$message.error(res.data.msg);
390
+          })
391
+        }else{
392
+          batchdeleteitems(params).then((res) =>{
393
+            if (res.data.state == 1){
394
+              this.$message.success('删除成功')
395
+              this.getUsername()
396
+            }else{
397
+              this.$message.error(res.data.msg)
447 398
             }
448
-          });
399
+          })
449 400
         }
450 401
       });
451 402
     },
452
-    test(val) {
453
-      console.log("val?:", val);
454
-      this.tmpid = val.id;
403
+    test(val){
404
+      console.log("val?:",val);
405
+      this.tmpid = val.id
455 406
       var params = {
456
-        mode_id: this.modeOptions_value,
457
-        patient_id: val.id,
458
-      };
459
-      ptemplateinformation(params).then((res) => {
460
-        if (res.data.state == 1) {
461
-          this.list = res.data.data.list;
462
-          this.isshow = 1;
407
+        mode_id:this.modeOptions_value,
408
+        patient_id:val.id,
409
+      }
410
+      ptemplateinformation(params).then((res) =>{
411
+        if (res.data.state == 1){
412
+          this.list = res.data.data.list
413
+          this.isshow = 1
463 414
         }
464
-      });
415
+      })
465 416
     },
466 417
     lili() {
467
-      console.log("this.list", this.list);
468
-      console.log("this.multipleSelection", this.multipleSelection);
418
+      console.log("this.list",this.list);
419
+      console.log("this.multipleSelection",this.multipleSelection)
469 420
       // console.log("this.mode",this.modeOptions_value)
470 421
       // console.log("this.projectlist2",this.projectlist2)
471 422
       // console.log("patient_value",this.patient_value)
472 423
     },
473
-    delects(hang, sc, item) {
474
-      console.log("hang", hang);
475
-      console.log("sc", sc);
476
-      console.log("item", item);
477
-      var params = {
478
-        type: item.type, //1药品2项目
479
-        id: sc.row.id,
480
-      };
481
-      var params2 = {
482
-        mode_id: this.modeOptions_value,
483
-        patient_id: this.tmpid,
484
-      };
485
-      deleteone(params).then((res) => {
486
-        if (res.data.state == 1) {
487
-          this.$message.success("删除成功");
488
-          ptemplateinformation(params2).then((res) => {
489
-            if (res.data.state == 1) {
490
-              this.list = res.data.data.list;
491
-              this.isshow = 1;
492
-            }
493
-          });
424
+    delects(hang,sc,item){
425
+      this.$confirm('删除后不可恢复,是否确认删除?', '删除', {
426
+        confirmButtonText: '确定',
427
+        cancelButtonText: '取消',
428
+        type: 'warning'
429
+      }).then(() => {
430
+        var params ={
431
+          type:item.type,//1药品2项目
432
+          id:sc.row.id,
433
+        }
434
+        var params2 = {
435
+          mode_id:this.modeOptions_value,
436
+          patient_id:this.tmpid,
494 437
         }
438
+        deleteone(params).then((res) =>{
439
+          if (res.data.state == 1){
440
+            this.$message.success('删除成功')
441
+            ptemplateinformation(params2).then((res) =>{
442
+              if (res.data.state == 1){
443
+                this.list = res.data.data.list
444
+                this.isshow = 1
445
+              }
446
+            })
447
+          }
448
+        })
449
+      }).catch(() => {
450
+        this.$message({
451
+          type: 'info',
452
+          message: '已取消删除'
453
+        });
495 454
       });
455
+      // console.log("hang",hang)
456
+      // console.log("sc",sc)
457
+      // console.log("item",item)
458
+
459
+
496 460
     },
497
-    changetype() {
498
-      console.log(">>>>>>>", this.new_type);
499
-      this.id = "";
500
-      this.tableData = [];
461
+    changetype(){
462
+      console.log(">>>>>>>",this.new_type)
463
+      this.id = ""
464
+      this.tableData = []
501 465
     },
502
-    changeid(item, index) {
503
-      item.id = item.drug_name;
466
+    changeid(item,index){
467
+      item.id = item.drug_name
504 468
       var params = {
505
-        id: item.id,
506
-      };
507
-      getdrugsinformation(params).then((res) => {
508
-        if (res.data.state == 1) {
509
-          console.log("res??", res);
469
+        id:item.id
470
+      }
471
+      getdrugsinformation(params).then((res) =>{
472
+        if (res.data.state == 1){
473
+          console.log("res??",res)
510 474
           this.tableDatas[0].single_dose = res.data.data.list[0].single_dose;
511
-          this.tableDatas[0].single_dose_unit =
512
-            res.data.data.list[0].single_dose_unit;
475
+          this.tableDatas[0].single_dose_unit = res.data.data.list[0].single_dose_unit;
513 476
           this.tableDatas[0].delivery_way = res.data.data.list[0].delivery_way;
514
-          this.tableDatas[0].execution_frequency =
515
-            res.data.data.list[0].execution_frequency;
477
+          this.tableDatas[0].execution_frequency = res.data.data.list[0].execution_frequency;
516 478
           this.tableDatas[0].day = res.data.data.list[0].drug_day;
517
-          this.tableDatas[0].prescribing_number =
518
-            res.data.data.list[0].prescribing_number;
519
-          this.tableDatas[0].prescribing_number_unit =
520
-            res.data.data.list[0].prescribing_number_unit;
479
+          this.tableDatas[0].prescribing_number = res.data.data.list[0].prescribing_number;
480
+          this.tableDatas[0].prescribing_number_unit = res.data.data.list[0].prescribing_number_unit;
521 481
           this.tableDatas[0].price = res.data.data.list[0].retail_price;
522 482
           this.tableDatas[0].remark = res.data.data.list[0].remark;
523 483
         }
@@ -526,22 +486,20 @@ export default {
526 486
     handleSelectionChange(val) {
527 487
       this.multipleSelection = val;
528 488
     },
529
-    changeid2(item, index) {
530
-      item.id = item.drug_name;
489
+    changeid2(item,index){
490
+      item.id = item.drug_name
531 491
       var params = {
532
-        id: item.id,
533
-      };
534
-      getdrugsinformation(params).then((res) => {
535
-        if (res.data.state == 1) {
536
-          console.log("res??", res);
492
+        id:item.id
493
+      }
494
+      getdrugsinformation(params).then((res) =>{
495
+        if (res.data.state == 1){
496
+          console.log("res??",res)
537 497
           this.project[0].single_dose = res.data.data.list[0].single_dose;
538 498
           this.project[0].translate = res.data.data.list[0].translate;
539 499
           this.project[0].delivery_way = res.data.data.list[0].delivery_way;
540
-          this.project[0].execution_frequency =
541
-            res.data.data.list[0].execution_frequency;
500
+          this.project[0].execution_frequency = res.data.data.list[0].execution_frequency;
542 501
           this.project[0].day = res.data.data.list[0].day;
543
-          this.project[0].prescribing_number =
544
-            res.data.data.list[0].prescribing_number;
502
+          this.project[0].prescribing_number = res.data.data.list[0].prescribing_number;
545 503
           this.project[0].unit = res.data.data.list[0].unit;
546 504
           this.project[0].price = res.data.data.list[0].retail_price;
547 505
           this.project[0].remark = res.data.data.list[0].remark;
@@ -549,41 +507,42 @@ export default {
549 507
       });
550 508
     },
551 509
     //获取配置
552
-    getdrugconfigs() {
553
-      var params = {};
554
-      replaceconfig(params).then((res) => {
555
-        if (res.data.state == 1) {
556
-          this.druglist = res.data.data.list;
557
-          this.projectlist = res.data.data.list2;
510
+    getdrugconfigs(){
511
+      var params = {}
512
+      replaceconfig(params).then((res) =>{
513
+        if (res.data.state == 1){
514
+          this.druglist = res.data.data.list
515
+          this.projectlist = res.data.data.list2
558 516
         }
559
-      });
560
-      getmodeconfigs(params).then((res) => {
561
-        if (res.data.state == 1) {
562
-          this.frequency = res.data.data.efs;
563
-          this.usage = res.data.data.drugways;
517
+      })
518
+      getmodeconfigs(params).then((res) =>{
519
+        if (res.data.state == 1){
520
+          this.frequency = res.data.data.efs
521
+          this.usage = res.data.data.drugways
564 522
         }
565
-      });
523
+      })
566 524
     },
567
-    getUsername() {
525
+    getUsername(){
568 526
       var params = {
569 527
         id: this.id,
570
-        mode: this.modeOptions_value,
571
-      };
572
-      replacepeoplename(params).then((res) => {
573
-        if (res.data.state == 1) {
574
-          this.tableData = res.data.data.list;
528
+        mode: this.modeOptions_value
529
+      }
530
+      replacepeoplename(params).then((res) =>{
531
+        if (res.data.state == 1){
532
+          this.tableData = res.data.data.list
575 533
         }
576
-      });
534
+      })
577 535
     },
578 536
     handleClose(done) {
579
-      this.$confirm("确认关闭?")
580
-        .then((_) => {
537
+      this.$confirm('确认关闭?')
538
+        .then(_ => {
581 539
           done();
582 540
         })
583
-        .catch((_) => {});
584
-    },
585
-  },
586
-};
541
+        .catch(_ => {});
542
+    }
543
+  }
544
+
545
+}
587 546
 </script>
588 547
 
589 548
 
@@ -605,8 +564,8 @@ export default {
605 564
   }
606 565
 }
607 566
 .zone {
608
-  //  margin-left: 30px;
609
-  //  text-align: left;
567
+//  margin-left: 30px;
568
+//  text-align: left;
610 569
   width: 70px;
611 570
   display: inline-block;
612 571
   color: #606266;

File diff suppressed because it is too large
+ 468 - 491
src/xt_pages/outpatientDoctorStation/batch_mode_template.vue


+ 265 - 314
src/xt_pages/outpatientDoctorStation/batch_replacement.vue View File

@@ -68,8 +68,8 @@
68 68
           </div>
69 69
         </div>
70 70
 
71
-        <button @click="lili">调试</button>
72
-        <el-button type="primary" @click="save">保存</el-button>
71
+<!--        <button @click="lili">调试</button>-->
72
+        <el-button @click="save">保存</el-button>
73 73
       </div>
74 74
 
75 75
       <el-container>
@@ -246,7 +246,7 @@
246 246
                 filterable
247 247
                 v-model="scope.row.drug_name"
248 248
                 placeholder="请选择"
249
-                @change="changeid2(scope.row, scope.$index)"
249
+                @change="changeid2(scope.row,scope.$index)"
250 250
               >
251 251
                 <el-option
252 252
                   v-for="item in projectlist"
@@ -260,7 +260,7 @@
260 260
           </el-table-column>
261 261
           <el-table-column label="组" width="120">
262 262
             <template slot-scope="scope">
263
-              {{ scope.row.translate }}
263
+              {{scope.row.translate}}
264 264
             </template>
265 265
           </el-table-column>
266 266
           <el-table-column label="单次用量" width="200">
@@ -274,7 +274,10 @@
274 274
           </el-table-column>
275 275
           <el-table-column label="用法" width="120">
276 276
             <template slot-scope="scope">
277
-              <el-select v-model="scope.row.delivery_way" placeholder="请选择">
277
+              <el-select
278
+                v-model="scope.row.delivery_way"
279
+                placeholder="请选择"
280
+              >
278 281
                 <el-option
279 282
                   v-for="item in usage"
280 283
                   :key="item.name"
@@ -307,8 +310,7 @@
307 310
                 v-model="scope.row.day"
308 311
                 placeholder="请输入"
309 312
                 style="width: 75px"
310
-              ></el-input
311
-              >天
313
+              ></el-input>天
312 314
             </template>
313 315
           </el-table-column>
314 316
           <el-table-column label="总量" width="200">
@@ -332,27 +334,23 @@
332 334
               <el-input v-model="scope.row.remark" placeholder=""></el-input>
333 335
             </template>
334 336
           </el-table-column>
335
-          <el-table-column label="推送频率" width="120">
336
-            <template slot-scope="scope">
337
-              <div v-if="scope.row.frequency_type == 1">{{ "每次必推" }}</div>
338
-              <div v-if="scope.row.frequency_type == 2">
339
-                {{ scope.row.day_count }}天/次
340
-              </div>
341
-              <div v-if="scope.row.frequency_type == 3">
342
-                {{ scope.row.week_days }}
343
-              </div>
344
-            </template>
345
-          </el-table-column>
346
-          <!--          <el-table-column fixed="right" label="操作" width="102">-->
347
-          <!--            <template slot-scope="scope">-->
348
-          <!--              <el-button-->
349
-          <!--                @click.native.prevent="addopen(scope.$index)"-->
350
-          <!--                type="text"-->
351
-          <!--                size="small">-->
352
-          <!--                推送-->
353
-          <!--              </el-button>-->
354
-          <!--            </template>-->
355
-          <!--          </el-table-column>-->
337
+<!--          <el-table-column label="推送频率" width="120">-->
338
+<!--            <template slot-scope="scope">-->
339
+<!--              <div v-if="scope.row.frequency_type == 1">{{'每次必推'}}</div>-->
340
+<!--              <div v-if="scope.row.frequency_type == 2">{{scope.row.day_count}}天/次</div>-->
341
+<!--              <div v-if="scope.row.frequency_type == 3">{{scope.row.week_days}}</div>-->
342
+<!--            </template>-->
343
+<!--          </el-table-column>-->
344
+<!--          <el-table-column fixed="right" label="操作" width="102">-->
345
+<!--            <template slot-scope="scope">-->
346
+<!--              <el-button-->
347
+<!--                @click.native.prevent="addopen(scope.$index)"-->
348
+<!--                type="text"-->
349
+<!--                size="small">-->
350
+<!--                推送-->
351
+<!--              </el-button>-->
352
+<!--            </template>-->
353
+<!--          </el-table-column>-->
356 354
         </el-table>
357 355
       </el-container>
358 356
     </div>
@@ -360,8 +358,7 @@
360 358
       title="推送频率设置"
361 359
       :visible.sync="dialogVisible"
362 360
       width="30%"
363
-      :before-close="handleClose"
364
-    >
361
+      :before-close="handleClose">
365 362
       <span>周期提醒</span>
366 363
       <el-radio-group v-model="frequency_type">
367 364
         <el-radio :label="1">每次必推</el-radio>
@@ -386,9 +383,9 @@
386 383
 
387 384
       <span slot="footer" class="dialog-footer">
388 385
         <button @click="lili">调试</button>
389
-        <el-button @click="dialogVisible = false">取 消</el-button>
390
-        <el-button type="primary" @click="baocun">确 定</el-button>
391
-      </span>
386
+    <el-button @click="dialogVisible = false">取 消</el-button>
387
+    <el-button type="primary" @click="baocun">确 定</el-button>
388
+  </span>
392 389
     </el-dialog>
393 390
   </div>
394 391
 </template>
@@ -410,151 +407,120 @@ export default {
410 407
       tableList: [],
411 408
       editableTabsValue: "1",
412 409
       modeOptions: {},
413
-      tableDatas: [
414
-        {
415
-          id: "",
416
-          drug_name: "",
417
-          single_dose: "",
418
-          single_dose_unit: "",
419
-          delivery_way: "",
420
-          execution_frequency: "",
421
-          day: "",
422
-          prescribing_number: "",
423
-          prescribing_number_unit: "",
424
-          price: "",
425
-          remark: "",
426
-        },
427
-      ], //药品
428
-      project: [
429
-        {
430
-          id: "",
431
-          drug_name: "",
432
-          translate: "",
433
-          single_dose: "",
434
-          unit: "",
435
-          delivery_way: "",
436
-          execution_frequency: "",
437
-          day: "",
438
-          prescribing_number: "",
439
-          price: "",
440
-          remark: "",
441
-          frequency_type: 1,
442
-          day_count: "",
443
-          week_days: "",
444
-        },
445
-      ], //项目
410
+      tableDatas:[{
411
+        id: "",
412
+        drug_name: "",
413
+        single_dose: "",
414
+        single_dose_unit: "",
415
+        delivery_way: "",
416
+        execution_frequency: "",
417
+        day: "",
418
+        prescribing_number: "",
419
+        prescribing_number_unit: "",
420
+        price: "",
421
+        remark: "",
422
+      },],//药品
423
+      project:[ {
424
+        id: "",
425
+        drug_name: "",
426
+        translate:"",
427
+        single_dose: "",
428
+        unit: "",
429
+        delivery_way: "",
430
+        execution_frequency: "",
431
+        day: "",
432
+        prescribing_number: "",
433
+        price: "",
434
+        remark: "",
435
+        frequency_type:1,
436
+        day_count:"",
437
+        week_days:"",
438
+      },],//项目
446 439
       tabIndex: 2,
447 440
       modeOptions_value: 1, //透析模式
448
-      multipleSelection: [], //选中的患者
449
-      tableData: [],
450
-      options: [
451
-        { id: 1, name: "药品" },
452
-        { id: 2, name: "项目" },
453
-      ],
454
-      options_patient: [
455
-        { id: 1, name: "是" },
456
-        { id: 2, name: "否" },
457
-      ],
458
-      options_2: [
459
-        { id: 1, name: "普通门诊" },
460
-        { id: 2, name: "门诊特殊病" },
461
-      ],
462
-      new_type: 1, //新增类型
463
-      druglist: [], //药品列表
464
-      projectlist: [], //项目列表
465
-      id: "", //药品、项目、耗材
466
-      tmplist: [], //临时
467
-      unit: [
468
-        { id: 1, name: "g" },
469
-        { id: 2, name: "mg" },
470
-        { id: 3, name: "u" },
471
-        { id: 4, name: "ml" },
472
-        { id: 5, name: "万U" },
473
-        { id: 6, name: "枚" },
474
-        { id: 7, name: "粒" },
475
-        { id: 8, name: "片" },
476
-        { id: 9, name: "支" },
477
-        { id: 10, name: "μg" },
478
-        { id: 11, name: "iu" },
479
-        { id: 12, name: "包" },
480
-        { id: 13, name: "袋" },
481
-        { id: 14, name: "万" },
482
-        { id: 15, name: "万iu" },
483
-        { id: 16, name: "丸" },
484
-        { id: 17, name: "盒" },
485
-        { id: 18, name: "瓶" },
486
-        { id: 19, name: "瓶(袋)" },
487
-        { id: 20, name: "次" },
488
-      ],
489
-      usage: [], //用法
490
-      frequency: [], //频率
491
-      frequency_type: "", //周期提醒
492
-      day_count: "", //周期提醒天
493
-      week_days: [], //周期提醒星期
494
-      tabhang: 0, //tab的下标
495
-      hang: 0, //行数
496
-    };
441
+      multipleSelection: [],//选中的患者
442
+      tableData:[],
443
+      options:[{id:1,name:"药品"},{id:2,name:"项目"}],
444
+      options_patient:[{id:1,name:"是"},{id:2,name:"否"}],
445
+      options_2:[{id:1,name:"普通门诊"},{id:2,name:"门诊特殊病"}],
446
+      new_type:1,//新增类型
447
+      druglist:[],//药品列表
448
+      projectlist:[],//项目列表
449
+      id:"",//药品、项目、耗材
450
+      tmplist:[],//临时
451
+      unit:[{id:1,name:"g"},{id:2,name:"mg"},{id:3,name:"u"},{id:4,name:"ml"},{id:5,name:"万U"},{id:6,name:"枚"},{id:7,name:"粒"},
452
+        {id:8,name:"片"},{id:9,name:"支"},{id:10,name:"μg"},{id:11,name:"iu"},{id:12,name:"包"},{id:13,name:"袋"},{id:14,name:"万"},
453
+        {id:15,name:"万iu"},{id:16,name:"丸"},{id:17,name:"盒"},{id:18,name:"瓶"},{id:19,name:"瓶(袋)"},{id:20,name:"次"}],
454
+      usage:[],//用法
455
+      frequency:[],//频率
456
+      frequency_type:"",//周期提醒
457
+      day_count:"",//周期提醒天
458
+      week_days:[],//周期提醒星期
459
+      tabhang:0,//tab的下标
460
+      hang:0,//行数
461
+
462
+    }
497 463
   },
498 464
   created() {
499 465
     // console.log("this.$store.getters.treatment_mode",this.$store.getters.treatment_mode)
500 466
     for (let key in this.$store.getters.treatment_mode) {
501
-      this.modeOptions[key] = this.$store.getters.treatment_mode[key];
467
+      this.modeOptions[key] = this.$store.getters.treatment_mode[key]
502 468
     }
503 469
     // console.log("this.modeOptions",this.modeOptions)
504 470
     this.getdrugconfigs();
505 471
   },
506 472
   methods: {
507 473
     save() {
508
-      var tmp = this.modeOptions[this.modeOptions_value].name;
509
-      var tmp2 = "";
510
-      var tmp3 = "";
511
-      if (this.new_type == 2) {
512
-        if (this.projectlist != null) {
513
-          for (let p1 = 0; p1 < this.projectlist.length; p1++) {
514
-            if (this.id == this.projectlist[p1].id) {
515
-              tmp2 = this.projectlist[p1].name;
474
+      var tmp = this.modeOptions[this.modeOptions_value].name
475
+      var tmp2 = ""
476
+      var tmp3 = ""
477
+      if (this.new_type == 2){
478
+        if (this.projectlist != null){
479
+          for(let p1 = 0;p1 < this.projectlist.length;p1++){
480
+            if(this.id == this.projectlist[p1].id){
481
+              tmp2 =  this.projectlist[p1].name
516 482
             }
517
-            if (this.project != null) {
518
-              if (this.project[0].id == this.projectlist[p1].id) {
519
-                tmp3 = this.projectlist[p1].name;
483
+            if(this.project != null){
484
+              if(this.project[0].id == this.projectlist[p1].id){
485
+                tmp3 = this.projectlist[p1].name
520 486
               }
521 487
             }
522 488
           }
523 489
         }
524
-        if (this.projectlist2 != null) {
525
-          for (let p2 = 0; p2 < this.projectlist2.length; p2++) {
526
-            if (this.id == this.projectlist2[p2].id) {
527
-              tmp2 = this.projectlist2[p2].name;
490
+        if(this.projectlist2 != null){
491
+          for(let p2 = 0;p2 < this.projectlist2.length;p2++){
492
+            if(this.id == this.projectlist2[p2].id){
493
+              tmp2 = this.projectlist2[p2].name
528 494
             }
529
-            if (this.project != null) {
530
-              if (this.project[0].id == this.projectlist2[p2].id) {
531
-                tmp3 = this.projectlist2[p2].name;
495
+            if(this.project != null){
496
+              if(this.project[0].id == this.projectlist2[p2].id){
497
+                tmp3 = this.projectlist2[p2].name
532 498
               }
533 499
             }
534 500
           }
535 501
         }
536 502
       }
537
-      if (this.new_type == 1) {
538
-        if (this.druglist != null) {
539
-          for (let d1 = 0; d1 < this.druglist.length; d1++) {
540
-            if (this.id == this.druglist[d1].id) {
541
-              tmp2 = this.druglist[d1].name;
503
+      if (this.new_type == 1){
504
+        if(this.druglist != null){
505
+          for(let d1 = 0;d1 < this.druglist.length;d1++){
506
+            if(this.id == this.druglist[d1].id){
507
+              tmp2 = this.druglist[d1].name
542 508
             }
543
-            if (this.tableDatas != null) {
544
-              if (this.tableDatas[0].id == this.druglist[d1].id) {
545
-                tmp3 = this.druglist[d1].name;
509
+            if(this.tableDatas != null){
510
+              if(this.tableDatas[0].id == this.druglist[d1].id){
511
+                tmp3 = this.druglist[d1].name
546 512
               }
547 513
             }
548 514
           }
549 515
         }
550
-        if (this.druglist2 != null) {
551
-          for (let d2 = 0; d2 < this.druglist2.length; d2++) {
552
-            if (this.id == this.druglist2[d2].id) {
553
-              tmp2 = tmp2 + this.druglist2[d2].name;
516
+        if(this.druglist2 != null){
517
+          for(let d2 = 0;d2 < this.druglist2.length;d2++){
518
+            if(this.id == this.druglist2[d2].id){
519
+              tmp2 = tmp2 + this.druglist2[d2].name
554 520
             }
555
-            if (this.tableDatas != null) {
556
-              if (this.tableDatas[0].id == this.druglist2[d2].id) {
557
-                tmp3 = this.druglist2[d2].name;
521
+            if(this.tableDatas != null){
522
+              if(this.tableDatas[0].id == this.druglist2[d2].id){
523
+                tmp3 = this.druglist2[d2].name
558 524
               }
559 525
             }
560 526
           }
@@ -562,13 +528,7 @@ export default {
562 528
       }
563 529
 
564 530
       this.$confirm(
565
-        "注:该操作将会把所选患者的" +
566
-          tmp +
567
-          "透析模式中的" +
568
-          tmp2 +
569
-          "替换为" +
570
-          tmp3 +
571
-          ",请确定是否保存?",
531
+        "请确定是否保存?",//注:该操作将会把所选患者的"+tmp+"透析模式中的"+tmp2+"替换为"+tmp3+",
572 532
         "",
573 533
         {
574 534
           confirmButtonText: "确 定",
@@ -576,111 +536,103 @@ export default {
576 536
           type: "warning",
577 537
         }
578 538
       ).then(() => {
579
-        if (this.multipleSelection.length == 0) {
580
-          this.$message.error("没有选中有效信息");
581
-          return;
539
+        if (this.multipleSelection.length == 0){
540
+          this.$message.error('没有选中有效信息')
541
+          return
582 542
         }
583
-        let st = "";
584
-        for (let i = 0; i < this.multipleSelection.length; i++) {
585
-          st = st + this.multipleSelection[i].id + ",";
543
+        let st = ""
544
+        for (let i = 0;i < this.multipleSelection.length;i++){
545
+          st = st + this.multipleSelection[i].id + ","
586 546
         }
587
-        console.log("string", st);
547
+        console.log("string",st)
588 548
         let params = {
589
-          mode_id: this.modeOptions_value,
549
+          mode_id:this.modeOptions_value,
590 550
           patient_id: st,
591
-          type: this.new_type,
551
+          type:this.new_type,
592 552
           replaced: this.id,
593
-        };
553
+        }
594 554
         let data1 = {
595
-          prescriptions: this.tableDatas,
596
-        };
555
+          "prescriptions": this.tableDatas
556
+        }
597 557
         let data2 = {
598
-          prescriptions: this.project,
599
-        };
600
-        if (this.new_type == 1) {
601
-          replacesavedrug(params, data1).then((res) => {
602
-            if (res.data.state == 1) {
603
-              this.$message.success("替换成功");
604
-              this.multipleSelection = [];
605
-              this.tableData = [];
606
-              this.tableDatas = [
607
-                {
608
-                  id: "",
609
-                  drug_name: "",
610
-                  single_dose: "",
611
-                  single_dose_unit: "",
612
-                  delivery_way: "",
613
-                  execution_frequency: "",
614
-                  day: "",
615
-                  prescribing_number: "",
616
-                  prescribing_number_unit: "",
617
-                  price: "",
618
-                  remark: "",
619
-                },
620
-              ];
621
-              this.project = [
622
-                {
623
-                  id: "",
624
-                  drug_name: "",
625
-                  translate: "",
626
-                  single_dose: "",
627
-                  unit: "",
628
-                  delivery_way: "",
629
-                  execution_frequency: "",
630
-                  day: "",
631
-                  prescribing_number: "",
632
-                  price: "",
633
-                  remark: "",
634
-                  frequency_type: 1,
635
-                  day_count: "",
636
-                  week_days: "",
637
-                },
638
-              ];
639
-            } else {
640
-              this.$message.error(res.data.msg);
558
+          "prescriptions": this.project
559
+        }
560
+        if (this.new_type == 1){
561
+          replacesavedrug(params,data1).then((res) =>{
562
+            if (res.data.state == 1){
563
+              this.$message.success('替换成功')
564
+              this.multipleSelection = []
565
+              this.tableData=[]
566
+              this.tableDatas=[{
567
+                id: "",
568
+                drug_name: "",
569
+                single_dose: "",
570
+                single_dose_unit: "",
571
+                delivery_way: "",
572
+                execution_frequency: "",
573
+                day: "",
574
+                prescribing_number: "",
575
+                prescribing_number_unit: "",
576
+                price: "",
577
+                remark: "",
578
+              },];
579
+              this.project=[ {
580
+                id: "",
581
+                drug_name: "",
582
+                translate:"",
583
+                single_dose: "",
584
+                unit: "",
585
+                delivery_way: "",
586
+                execution_frequency: "",
587
+                day: "",
588
+                prescribing_number: "",
589
+                price: "",
590
+                remark: "",
591
+                frequency_type:1,
592
+                day_count:"",
593
+                week_days:"",
594
+              },];
595
+            }else{
596
+              this.$message.error(res.data.msg)
641 597
             }
642
-          });
643
-        } else {
644
-          replacesaveproject(params, data2).then((res) => {
645
-            if (res.data.state == 1) {
646
-              this.$message.success("替换成功");
647
-              this.multipleSelection = [];
648
-              this.tableData = [];
649
-              this.tableDatas = [
650
-                {
651
-                  id: "",
652
-                  drug_name: "",
653
-                  single_dose: "",
654
-                  single_dose_unit: "",
655
-                  delivery_way: "",
656
-                  execution_frequency: "",
657
-                  day: "",
658
-                  prescribing_number: "",
659
-                  prescribing_number_unit: "",
660
-                  price: "",
661
-                  remark: "",
662
-                },
663
-              ];
664
-              this.project = [
665
-                {
666
-                  id: "",
667
-                  drug_name: "",
668
-                  translate: "",
669
-                  single_dose: "",
670
-                  unit: "",
671
-                  delivery_way: "",
672
-                  execution_frequency: "",
673
-                  day: "",
674
-                  prescribing_number: "",
675
-                  price: "",
676
-                  remark: "",
677
-                  frequency_type: 1,
678
-                  day_count: "",
679
-                  week_days: "",
680
-                },
681
-              ];
682
-            } else {
683
-              this.$message.error(res.data.msg);
598
+          })
599
+        }else{
600
+          replacesaveproject(params,data2).then((res) =>{
601
+            if (res.data.state == 1){
602
+              this.$message.success('替换成功')
603
+              this.multipleSelection = []
604
+              this.tableData=[]
605
+              this.tableDatas=[{
606
+                id: "",
607
+                drug_name: "",
608
+                single_dose: "",
609
+                single_dose_unit: "",
610
+                delivery_way: "",
611
+                execution_frequency: "",
612
+                day: "",
613
+                prescribing_number: "",
614
+                prescribing_number_unit: "",
615
+                price: "",
616
+                remark: "",
617
+              },];
618
+              this.project=[ {
619
+                id: "",
620
+                drug_name: "",
621
+                translate:"",
622
+                single_dose: "",
623
+                unit: "",
624
+                delivery_way: "",
625
+                execution_frequency: "",
626
+                day: "",
627
+                prescribing_number: "",
628
+                price: "",
629
+                remark: "",
630
+                frequency_type:1,
631
+                day_count:"",
632
+                week_days:"",
633
+              },];
634
+            }else{
635
+              this.$message.error(res.data.msg)
684 636
             }
685 637
           });
686 638
         }
@@ -689,115 +641,114 @@ export default {
689 641
 
690 642
     lili() {
691 643
       // console.log("this.multipleSelection",this.multipleSelection);
692
-      console.log("this.tableDatas", this.tableDatas);
644
+      console.log("this.tableDatas",this.tableDatas)
693 645
       // console.log("this.mode",this.modeOptions_value)
694 646
       // console.log("this.projectlist2",this.projectlist2)
695 647
       // console.log("patient_value",this.patient_value)
696 648
     },
697
-    addopen(hang) {
698
-      this.hang = hang;
649
+    addopen(hang){
650
+      this.hang = hang
699 651
       //清空
700 652
       this.week_days = [];
701 653
       this.day_count = "";
702 654
       this.frequency_type = 1;
703 655
       this.dialogVisible = true;
704 656
     },
705
-    changetype() {
706
-      console.log(">>>>>>>", this.new_type);
707
-      this.id = "";
708
-      this.tableData = [];
657
+    changetype(){
658
+      console.log(">>>>>>>",this.new_type)
659
+      this.id = ""
660
+      this.tableData = []
709 661
     },
710 662
     changeid(item, index) {
711 663
       console.log("");
712 664
       item.id = item.drug_name;
713 665
       var params = {
714
-        id: item.id,
715
-      };
716
-      getdrugsinformation(params).then((res) => {
717
-        if (res.data.state == 1) {
718
-          console.log("res??", res);
666
+        id:item.id
667
+      }
668
+      getdrugsinformation(params).then((res) =>{
669
+        if (res.data.state == 1){
670
+          console.log("res??",res)
719 671
           this.tableDatas[0].single_dose = res.data.data.list[0].single_dose;
720
-          this.tableDatas[0].single_dose_unit =
721
-            res.data.data.list[0].single_dose_unit;
672
+          this.tableDatas[0].single_dose_unit = res.data.data.list[0].single_dose_unit;
722 673
           this.tableDatas[0].delivery_way = res.data.data.list[0].delivery_way;
723
-          this.tableDatas[0].execution_frequency =
724
-            res.data.data.list[0].execution_frequency;
674
+          this.tableDatas[0].execution_frequency = res.data.data.list[0].execution_frequency;
725 675
           this.tableDatas[0].day = res.data.data.list[0].drug_day;
726
-          this.tableDatas[0].prescribing_number =
727
-            res.data.data.list[0].prescribing_number;
728
-          this.tableDatas[0].prescribing_number_unit =
729
-            res.data.data.list[0].prescribing_number_unit;
730
-          this.tableDatas[0].price = res.data.data.list[0].retail_price;
676
+          this.tableDatas[0].prescribing_number = res.data.data.list[0].prescribing_number;
677
+          this.tableDatas[0].prescribing_number_unit = res.data.data.list[0].prescribing_number_unit;
678
+          if (res.data.data.list[0].prescribing_number_unit == res.data.data.list[0].min_unit){
679
+            this.tableDatas[0].price = res.data.data.list[0].min_price;
680
+          }else{
681
+            this.tableDatas[0].price = res.data.data.list[0].retail_price;
682
+          }
731 683
           this.tableDatas[0].remark = res.data.data.list[0].remark;
732 684
         }
733
-      });
685
+      })
734 686
     },
735 687
     handleSelectionChange(val) {
736 688
       this.multipleSelection = val;
737 689
     },
738
-    changeid2(item, index) {
739
-      item.id = item.drug_name;
690
+    changeid2(item,index){
691
+      item.id = item.drug_name
740 692
       var params = {
741
-        id: item.id,
742
-      };
743
-      getdrugsinformation(params).then((res) => {
744
-        if (res.data.state == 1) {
745
-          console.log("res??", res);
693
+        id:item.id
694
+      }
695
+      getdrugsinformation(params).then((res) =>{
696
+        if (res.data.state == 1){
697
+          console.log("res??",res)
746 698
           this.project[0].single_dose = res.data.data.list[0].single_dose;
747 699
           this.project[0].translate = res.data.data.list[0].translate;
748 700
           this.project[0].delivery_way = res.data.data.list[0].delivery_way;
749
-          this.project[0].execution_frequency =
750
-            res.data.data.list[0].execution_frequency;
701
+          this.project[0].execution_frequency = res.data.data.list[0].execution_frequency;
751 702
           this.project[0].day = res.data.data.list[0].day;
752
-          this.project[0].prescribing_number =
753
-            res.data.data.list[0].prescribing_number;
703
+          this.project[0].prescribing_number = res.data.data.list[0].prescribing_number;
754 704
           this.project[0].unit = res.data.data.list[0].unit;
755
-          if (res.data.data.list[0].retail_price != null) {
705
+          if (res.data.data.list[0].retail_price != null){
756 706
             this.project[0].price = res.data.data.list[0].retail_price;
757
-          } else {
707
+          }else{
758 708
             this.project[0].price = res.data.data.list[0].price;
759 709
           }
760 710
 
761 711
           this.project[0].remark = res.data.data.list[0].remark;
762 712
         }
763
-      });
713
+      })
764 714
     },
765 715
     //获取配置
766
-    getdrugconfigs() {
767
-      var params = {};
768
-      replaceconfig(params).then((res) => {
769
-        if (res.data.state == 1) {
770
-          this.druglist = res.data.data.list;
771
-          this.projectlist = res.data.data.list2;
716
+    getdrugconfigs(){
717
+      var params = {}
718
+      replaceconfig(params).then((res) =>{
719
+        if (res.data.state == 1){
720
+          this.druglist = res.data.data.list
721
+          this.projectlist = res.data.data.list2
772 722
         }
773
-      });
774
-      getmodeconfigs(params).then((res) => {
775
-        if (res.data.state == 1) {
776
-          this.frequency = res.data.data.efs;
777
-          this.usage = res.data.data.drugways;
723
+      })
724
+      getmodeconfigs(params).then((res) =>{
725
+        if (res.data.state == 1){
726
+          this.frequency = res.data.data.efs
727
+          this.usage = res.data.data.drugways
778 728
         }
779
-      });
729
+      })
780 730
     },
781
-    getUsername() {
731
+    getUsername(){
782 732
       var params = {
783 733
         id: this.id,
784
-        mode: this.modeOptions_value,
785
-      };
786
-      replacepeoplename(params).then((res) => {
787
-        if (res.data.state == 1) {
788
-          this.tableData = res.data.data.list;
734
+        mode: this.modeOptions_value
735
+      }
736
+      replacepeoplename(params).then((res) =>{
737
+        if (res.data.state == 1){
738
+          this.tableData = res.data.data.list
789 739
         }
790
-      });
740
+      })
791 741
     },
792 742
     handleClose(done) {
793
-      this.$confirm("确认关闭?")
794
-        .then((_) => {
743
+      this.$confirm('确认关闭?')
744
+        .then(_ => {
795 745
           done();
796 746
         })
797
-        .catch((_) => {});
798
-    },
799
-  },
800
-};
747
+        .catch(_ => {});
748
+    }
749
+  }
750
+
751
+}
801 752
 </script>
802 753
 
803 754