mainqaq 2 anni fa
parent
commit
c3d47fb76c

+ 52 - 3
src/api/batch/batch.js Vedi File

@@ -1,10 +1,27 @@
1 1
 import request from '@/utils/request'
2 2
 
3
-export function createArticle(data) {
3
+export function prescriptiontemplate(params,data) {
4 4
   return request({
5
-    url: '/article/create',
5
+    url: '/api/his/addstemplate',
6 6
     method: 'post',
7
-    data
7
+    data:data,
8
+    params:params,
9
+  })
10
+}
11
+export function replacesavedrug(params,data) {
12
+  return request({
13
+    url: '/api/his/replacesavedrug',
14
+    method: 'post',
15
+    data:data,
16
+    params:params,
17
+  })
18
+}
19
+export function replacesaveproject(params,data) {
20
+  return request({
21
+    url: '/api/his/replacesaveproject',
22
+    method: 'post',
23
+    data:data,
24
+    params:params,
8 25
   })
9 26
 }
10 27
 
@@ -40,3 +57,35 @@ export function getdrugsinformation(query) {
40 57
     params: query
41 58
   })
42 59
 }
60
+//替换——获取患者名字
61
+export function replacepeoplename(query) {
62
+  return request({
63
+    url: '/api/his/replacepeoplename',
64
+    method: 'get',
65
+    params: query
66
+  })
67
+}
68
+//替换——配置
69
+export function replaceconfig(query) {
70
+  return request({
71
+    url: '/api/his/replaceconfig',
72
+    method: 'get',
73
+    params: query
74
+  })
75
+}
76
+//批量删除——药品
77
+export function deletedrugsbatch(query) {
78
+  return request({
79
+    url: '/api/his/deletedrugsbatch',
80
+    method: 'get',
81
+    params: query
82
+  })
83
+}
84
+//批量删除——项目
85
+export function batchdeleteitems(query) {
86
+  return request({
87
+    url: '/api/his/batchdeleteitems',
88
+    method: 'get',
89
+    params: query
90
+  })
91
+}

+ 661 - 181
src/xt_pages/outpatientDoctorStation/batch_delete.vue Vedi File

@@ -1,161 +1,624 @@
1
-<template><!--批量删除-->
1
+<template>
2
+  <!--批量删除-->
2 3
   <div class="main-contain">
3 4
     <div class="app-container">
4
-      <div style="margin-bottom:10px">
5
-        透析模式:
6
-        <el-select v-model="value" placeholder="请选择">
7
-          <el-option
8
-            v-for="item in options"
9
-            :key="item.value"
10
-            :label="item.label"
11
-            :value="item.value">
12
-          </el-option>
13
-        </el-select>
14
-        新增类型:
15
-        <el-select v-model="value" placeholder="请选择">
16
-          <el-option
17
-            v-for="item in options"
18
-            :key="item.value"
19
-            :label="item.label"
20
-            :value="item.value">
21
-          </el-option>
22
-        </el-select>
23
-        是否选择所有患者:
24
-        <el-select v-model="value" placeholder="请选择">
25
-          <el-option
26
-            v-for="item in options"
27
-            :key="item.value"
28
-            :label="item.label"
29
-            :value="item.value">
30
-          </el-option>
31
-        </el-select>
32
-      </div>
33
-      <el-container>
34
-
35
-        <div style="width:27%">
36
-
37
-          <el-row>
38
-            <el-table
39
-              ref="singleTable"
40
-              :data="patientList"
41
-              highlight-current-row
42
-              border
43
-              @current-change="handleCurrentChange"
44
-              height="440"
45
-              :row-style="{ color: '#303133' }"
46
-              :header-cell-style="{
47
-                        backgroundColor: 'rgb(245, 247, 250)',
48
-                        color: '#606266'
49
-                        }"
5
+      <div class="bannar_list">
6
+        <div class="banner_left">
7
+          <div>
8
+            透析模式:
9
+            <el-select
10
+              v-model="modeOptions_value"
11
+              placeholder="请选择"
50 12
             >
51
-              <el-table-column align="center" type="selection" width="55">
52
-                <template slot-scope="scope">
53
-
54
-                </template>
55
-              </el-table-column>
56
-              <el-table-column prop="date" label="患者姓名" align="center">
57
-                <template slot-scope="scope">
58
-                  {{scope.row.name}}
59
-                </template>
60
-              </el-table-column>
13
+              <el-option
14
+                v-for="item in modeOptions"
15
+                :key="item.id"
16
+                :label="item.name"
17
+                :value="item.id"
18
+              >
19
+              </el-option>
20
+            </el-select>
21
+          </div>
22
+          <div>
23
+            删除类型:
24
+            <el-select v-model="new_type" placeholder="请选择" @change="changetype">
25
+              <el-option
26
+                v-for="item in options"
27
+                :key="item.id"
28
+                :label="item.name"
29
+                :value="item.id"
30
+              >
31
+              </el-option>
32
+            </el-select>
33
+          </div>
34
+          <div v-if="new_type == 1">
35
+            请输入需要删除的药品:
36
+            <el-select
37
+              v-model="id"
38
+              placeholder="请选择"
39
+              @change="getUsername"
40
+            >
41
+              <el-option
42
+                v-for="item in druglist"
43
+                :key="item.id"
44
+                :label="item.name"
45
+                :value="item.id"
46
+              >
47
+              </el-option>
48
+            </el-select>
49
+          </div>
50
+          <div v-if="new_type == 2">
51
+            请输入需要删除的项目:
52
+            <el-select
53
+              v-model="id"
54
+              placeholder="请选择"
55
+              @change="getUsername"
56
+            >
57
+              <el-option
58
+                v-for="item in projectlist"
59
+                :key="item.id"
60
+                :label="item.name"
61
+                :value="item.id"
62
+              >
63
+              </el-option>
64
+            </el-select>
65
+          </div>
66
+        </div>
61 67
 
68
+        <button @click="lili">调试</button>
69
+        <el-button @click="save">保存</el-button>
70
+      </div>
62 71
 
63
-            </el-table>
64
-          </el-row>
72
+      <el-container>
73
+        <div style="width: 211px">
74
+          <el-table
75
+            border
76
+            ref="multipleTable"
77
+            :data="tableData"
78
+            tooltip-effect="dark"
79
+            style="width: 100%"
80
+            @selection-change="handleSelectionChange"
81
+            :row-style="{ color: '#303133' }"
82
+            :header-cell-style="{
83
+              backgroundColor: 'rgb(245, 247, 250)',
84
+              color: '#606266',
85
+            }"
86
+          >
87
+            <el-table-column type="selection" width="55"> </el-table-column>
88
+            <el-table-column label="患者姓名" width="155">
89
+              <template slot-scope="scope">{{ scope.row.name }}</template>
90
+            </el-table-column>
91
+          </el-table>
65 92
         </div>
66
-        <el-main>
67
-          <el-tabs v-model="editableTabsValue" type="border-card" editable @edit="handleTabsEdit">
68
-            <el-tab-pane
69
-              :key="item.name"
70
-              v-for="(item, index) in editableTabs"
71
-              :label="item.title"
72
-              :name="item.name"
73
-            >
74
-              {{item.content}}
75
-            </el-tab-pane>
76
-          </el-tabs>
77
-        </el-main>
93
+<!--
94
+        <el-table
95
+          v-if="new_type == 1"
96
+          :data="tableDatas"
97
+          style="width: 100%"
98
+          max-height="250"
99
+          border
100
+          :row-style="{ color: '#303133' }"
101
+          :header-cell-style="{
102
+                  backgroundColor: 'rgb(245, 247, 250)',
103
+                  color: '#606266',
104
+                }"
105
+        >
106
+          <el-table-column fixed label="替换药品名称" width="230">
107
+            <template slot-scope="scope">
108
+              <el-select
109
+                v-model="scope.row.drug_name"
110
+                placeholder="请选择"
111
+                @change="changeid(scope.row,scope.$index)"
112
+              >
113
+                <el-option
114
+                  v-for="item in druglist"
115
+                  :key="item.id"
116
+                  :label="item.name"
117
+                  :value="item.id"
118
+                >
119
+                </el-option>
120
+              </el-select>
121
+            </template>
122
+          </el-table-column>
123
+          <el-table-column label="单次用量" width="200">
124
+            <template slot-scope="scope">
125
+              <el-input
126
+                v-model="scope.row.single_dose"
127
+                placeholder="请输入"
128
+                style="width: 75px"
129
+              ></el-input>
130
+              <el-select
131
+                v-model="scope.row.single_dose_unit"
132
+                placeholder="请选择"
133
+                style="width: 90px"
134
+              >
135
+                <el-option
136
+                  v-for="item in unit"
137
+                  :key="item.name"
138
+                  :label="item.name"
139
+                  :value="item.name"
140
+                >
141
+                </el-option>
142
+              </el-select>
143
+            </template>
144
+          </el-table-column>
145
+          <el-table-column label="用法" width="120">
146
+            <template slot-scope="scope">
147
+              <el-select
148
+                v-model="scope.row.delivery_way"
149
+                placeholder="请选择"
150
+              >
151
+                <el-option
152
+                  v-for="item in usage"
153
+                  :key="item.name"
154
+                  :label="item.name"
155
+                  :value="item.name"
156
+                >
157
+                </el-option>
158
+              </el-select>
159
+            </template>
160
+          </el-table-column>
161
+          <el-table-column label="频率" width="120">
162
+            <template slot-scope="scope">
163
+              <el-select
164
+                v-model="scope.row.execution_frequency"
165
+                placeholder="请选择"
166
+              >
167
+                <el-option
168
+                  v-for="item in frequency"
169
+                  :key="item.name"
170
+                  :label="item.name"
171
+                  :value="item.name"
172
+                >
173
+                </el-option>
174
+              </el-select>
175
+            </template>
176
+          </el-table-column>
177
+          <el-table-column label="天数" width="110">
178
+            <template slot-scope="scope">
179
+              <el-input
180
+                v-model="scope.row.day"
181
+                placeholder="请输入"
182
+                style="width: 75px"
183
+              ></el-input
184
+              >天
185
+            </template>
186
+          </el-table-column>
187
+          <el-table-column label="总量" width="200">
188
+            <template slot-scope="scope">
189
+              <el-input
190
+                v-model="scope.row.prescribing_number"
191
+                placeholder="请输入"
192
+                style="width: 75px"
193
+              ></el-input>
194
+              <el-select
195
+                v-model="scope.row.prescribing_number_unit"
196
+                placeholder="请选择"
197
+                style="width: 90px"
198
+              >
199
+                <el-option
200
+                  v-for="item in unit"
201
+                  :key="item.name"
202
+                  :label="item.name"
203
+                  :value="item.name"
204
+                >
205
+                </el-option>
206
+              </el-select>
207
+            </template>
208
+          </el-table-column>
209
+          <el-table-column label="单价" width="120">
210
+            <template slot-scope="scope">
211
+              <el-input
212
+                v-model="scope.row.price"
213
+                style="width: 80px"
214
+              ></el-input
215
+              >元
216
+            </template>
217
+          </el-table-column>
218
+          <el-table-column label="备注" width="120">
219
+            <template slot-scope="scope">
220
+              <el-input
221
+                v-model="scope.row.remark"
222
+                placeholder=""
223
+              ></el-input>
224
+            </template>
225
+          </el-table-column>
226
+        </el-table>
227
+
228
+        <el-table
229
+          v-if="new_type == 2"
230
+          :data="project"
231
+          style="width: 100%"
232
+          max-height="250"
233
+          border
234
+          :row-style="{ color: '#303133' }"
235
+          :header-cell-style="{
236
+                  backgroundColor: 'rgb(245, 247, 250)',
237
+                  color: '#606266',
238
+                }"
239
+        >
240
+          <el-table-column fixed label="替换项目名称" width="230">
241
+            <template slot-scope="scope">
242
+              <el-select
243
+                v-model="scope.row.drug_name"
244
+                placeholder="请选择"
245
+                @change="changeid2(scope.row,scope.$index)"
246
+              >
247
+                <el-option
248
+                  v-for="item in projectlist"
249
+                  :key="item.id"
250
+                  :label="item.name"
251
+                  :value="item.id"
252
+                >
253
+                </el-option>
254
+              </el-select>
255
+            </template>
256
+          </el-table-column>
257
+          <el-table-column label="组" width="120">
258
+            <template slot-scope="scope">
259
+              {{scope.row.translate}}
260
+            </template>
261
+          </el-table-column>
262
+          <el-table-column label="单次用量" width="200">
263
+            <template slot-scope="scope">
264
+              <el-input
265
+                v-model="scope.row.single_dose"
266
+                placeholder="请输入内容"
267
+              ></el-input>
268
+              {{ scope.row.unit }}
269
+            </template>
270
+          </el-table-column>
271
+          <el-table-column label="用法" width="120">
272
+            <template slot-scope="scope">
273
+              <el-select
274
+                v-model="scope.row.delivery_way"
275
+                placeholder="请选择"
276
+              >
277
+                <el-option
278
+                  v-for="item in usage"
279
+                  :key="item.name"
280
+                  :label="item.name"
281
+                  :value="item.name"
282
+                >
283
+                </el-option>
284
+              </el-select>
285
+            </template>
286
+          </el-table-column>
287
+          <el-table-column label="频率" width="120">
288
+            <template slot-scope="scope">
289
+              <el-select
290
+                v-model="scope.row.execution_frequency"
291
+                placeholder="请选择"
292
+              >
293
+                <el-option
294
+                  v-for="item in frequency"
295
+                  :key="item.name"
296
+                  :label="item.name"
297
+                  :value="item.name"
298
+                >
299
+                </el-option>
300
+              </el-select>
301
+            </template>
302
+          </el-table-column>
303
+          <el-table-column label="天数" width="110">
304
+            <template slot-scope="scope">
305
+              <el-input
306
+                v-model="scope.row.day"
307
+                placeholder="请输入"
308
+                style="width: 75px"
309
+              ></el-input>天
310
+            </template>
311
+          </el-table-column>
312
+          <el-table-column label="总量" width="200">
313
+            <template slot-scope="scope">
314
+              <el-input
315
+                v-model="scope.row.prescribing_number"
316
+                placeholder="请输入"
317
+                style="width: 75px"
318
+              ></el-input>
319
+              {{ scope.row.unit }}
320
+            </template>
321
+          </el-table-column>
322
+          <el-table-column label="单价" width="120">
323
+            <template slot-scope="scope">
324
+              <el-input
325
+                v-model="scope.row.price"
326
+                style="width: 80px"
327
+              ></el-input
328
+              >元
329
+            </template>
330
+          </el-table-column>
331
+          <el-table-column label="备注" width="120">
332
+            <template slot-scope="scope">
333
+              <el-input
334
+                v-model="scope.row.remark"
335
+                placeholder=""
336
+              ></el-input>
337
+            </template>
338
+          </el-table-column>
339
+          <el-table-column label="推送频率" width="120">
340
+            <template slot-scope="scope">
341
+              <div v-if="scope.row.frequency_type == 1">{{'每次必推'}}</div>
342
+              <div v-if="scope.row.frequency_type == 2">{{scope.row.day_count}}天/次</div>
343
+              <div v-if="scope.row.frequency_type == 3">{{scope.row.week_days}}</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>
356
+        </el-table>
357
+        -->
358
+
78 359
       </el-container>
79 360
     </div>
80
-  </div>
361
+    <el-dialog
362
+      title="推送频率设置"
363
+      :visible.sync="dialogVisible"
364
+      width="30%"
365
+      :before-close="handleClose">
366
+      <span>周期提醒</span>
367
+      <el-radio-group v-model="frequency_type">
368
+        <el-radio :label="1">每次必推</el-radio>
369
+        <el-radio :label="2">天数频率</el-radio>
370
+        <el-radio :label="3">星期频率</el-radio>
371
+      </el-radio-group>
372
+      <div v-if="frequency_type == 2">
373
+        <el-input style="width: 50px" v-model="day_count"></el-input>&nbsp;
374
+        天/一次
375
+      </div>
376
+      <div v-if="frequency_type == 3">
377
+        <el-checkbox-group v-model="week_days">
378
+          <el-checkbox label="周一" name="周一" key="1">周一</el-checkbox>
379
+          <el-checkbox label="周二" name="周二" key="2">周二</el-checkbox>
380
+          <el-checkbox label="周三" name="周三" key="3">周三</el-checkbox>
381
+          <el-checkbox label="周四" name="周四" key="4">周四</el-checkbox>
382
+          <el-checkbox label="周五" name="周五" key="5">周五</el-checkbox>
383
+          <el-checkbox label="周六" name="周六" key="6">周六</el-checkbox>
384
+          <el-checkbox label="周日" name="周日" key="7">周日</el-checkbox>
385
+        </el-checkbox-group>
386
+      </div>
81 387
 
388
+      <span slot="footer" class="dialog-footer">
389
+        <button @click="lili">调试</button>
390
+    <el-button @click="dialogVisible = false">取 消</el-button>
391
+    <el-button type="primary" @click="baocun">确 定</el-button>
392
+  </span>
393
+    </el-dialog>
394
+  </div>
82 395
 </template>
83 396
 <script>
397
+import { gethisusertoalive } from "@/api/deposit";
398
+import {
399
+  getdrugsinformation,
400
+  replacepeoplename,
401
+  replaceconfig,
402
+  deletedrugsbatch,
403
+  batchdeleteitems,
404
+  getmodeconfigs
405
+} from "@/api/batch/batch";
84 406
 
85 407
 export default {
86
-  data(){
87
-    return{
88
-      patientList:[
89
-        {id:1,name:"张三"}
90
-      ],
91
-      tableList:[],
92
-      editableTabsValue: '2',
93
-      editableTabs: [{
94
-        title: 'Tab 1',
95
-        name: '1',
96
-        content: 'Tab 1 content'
97
-      }, {
98
-        title: 'Tab 2',
99
-        name: '2',
100
-        content: 'Tab 2 content'
101
-      }],
408
+  data() {
409
+    return {
410
+      dialogVisible: false,
411
+      tableList: [],
412
+      editableTabsValue: "1",
413
+      modeOptions: {},
414
+      tableDatas:[{
415
+        id: "",
416
+        drug_name: "",
417
+        single_dose: 0,
418
+        single_dose_unit: "",
419
+        delivery_way: "",
420
+        execution_frequency: "",
421
+        day: 0,
422
+        prescribing_number: 0,
423
+        prescribing_number_unit: "",
424
+        price: "",
425
+        remark: "",
426
+      },],//药品
427
+      project:[ {
428
+        id: "",
429
+        drug_name: "",
430
+        translate:"",
431
+        single_dose: 0,
432
+        unit: "",
433
+        delivery_way: "",
434
+        execution_frequency: "",
435
+        day: 0,
436
+        prescribing_number: 0,
437
+        price: "",
438
+        remark: "",
439
+        frequency_type:1,
440
+        day_count:"",
441
+        week_days:"",
442
+      },],//项目
102 443
       tabIndex: 2,
103
-      options: [{
104
-        value: '选项1',
105
-        label: '黄金糕'
106
-      }, {
107
-        value: '选项2',
108
-        label: '双皮奶'
109
-      }, {
110
-        value: '选项3',
111
-        label: '蚵仔煎'
112
-      }, {
113
-        value: '选项4',
114
-        label: '龙须面'
115
-      }, {
116
-        value: '选项5',
117
-        label: '北京烤鸭'
118
-      }],
119
-      value: ''
444
+      modeOptions_value: 1, //透析模式
445
+      multipleSelection: [],//选中的患者
446
+      tableData:[],
447
+      options:[{id:1,name:"药品"},{id:2,name:"项目"}],
448
+      options_patient:[{id:1,name:"是"},{id:2,name:"否"}],
449
+      options_2:[{id:1,name:"普通门诊"},{id:2,name:"门诊特殊病"}],
450
+      new_type:1,//新增类型
451
+      druglist:[],//药品列表
452
+      projectlist:[],//项目列表
453
+      id:"",//药品、项目、耗材
454
+      tmplist:[],//临时
455
+      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:"粒"},
456
+        {id:8,name:"片"},{id:9,name:"支"},{id:10,name:"μg"},{id:11,name:"iu"},{id:12,name:"包"},{id:13,name:"袋"},{id:14,name:"万"},
457
+        {id:15,name:"万iu"},{id:16,name:"丸"},{id:17,name:"盒"},{id:18,name:"瓶"},{id:19,name:"瓶(袋)"},{id:20,name:"次"}],
458
+      usage:[],//用法
459
+      frequency:[],//频率
460
+      frequency_type:"",//周期提醒
461
+      day_count:"",//周期提醒天
462
+      week_days:[],//周期提醒星期
463
+      tabhang:0,//tab的下标
464
+      hang:0,//行数
465
+
120 466
     }
121 467
   },
122
-  created(){
123
-
468
+  created() {
469
+    // console.log("this.$store.getters.treatment_mode",this.$store.getters.treatment_mode)
470
+    for (let key in this.$store.getters.treatment_mode) {
471
+      this.modeOptions[key] = this.$store.getters.treatment_mode[key]
472
+    }
473
+    // console.log("this.modeOptions",this.modeOptions)
474
+    this.getdrugconfigs();
124 475
   },
125
-  methods:{
126
-    handleTabsEdit(targetName, action) {
127
-      if (action === 'add') {
128
-        let newTabName = ++this.tabIndex + '';
129
-        this.editableTabs.push({
130
-          title: 'New Tab',
131
-          name: newTabName,
132
-          content: 'New Tab content'
133
-        });
134
-        this.editableTabsValue = newTabName;
135
-      }
136
-      if (action === 'remove') {
137
-        let tabs = this.editableTabs;
138
-        let activeName = this.editableTabsValue;
139
-        if (activeName === targetName) {
140
-          tabs.forEach((tab, index) => {
141
-            if (tab.name === targetName) {
142
-              let nextTab = tabs[index + 1] || tabs[index - 1];
143
-              if (nextTab) {
144
-                activeName = nextTab.name;
145
-              }
476
+  methods: {
477
+    save() {
478
+      this.$confirm(
479
+        "注:该操作将会把选中的药品或项目从所选患者处方模板中移除,请确定是否删除?",
480
+        "",
481
+        {
482
+          confirmButtonText: "确 定",
483
+          cancelButtonText: "取 消",
484
+          type: "warning",
485
+        }
486
+      ).then(() => {
487
+        if (this.multipleSelection.length == 0){
488
+          this.$message.error('没有选中有效信息')
489
+          return
490
+        }
491
+        let st = ""
492
+        for (let i = 0;i < this.multipleSelection.length;i++){
493
+          st = st + this.multipleSelection[i].id + ","
494
+        }
495
+        console.log("string",st)
496
+        let params = {
497
+          mode_id:this.modeOptions_value,
498
+          patient_id: st,
499
+          type:this.new_type,
500
+          replaced: this.id,
501
+        }
502
+        if (this.new_type == 1){
503
+          deletedrugsbatch(params).then((res) =>{
504
+            if (res.data.state == 1){
505
+              this.$message.success('删除成功')
506
+              this.getUsername()
507
+            }else{
508
+              this.$message.error(res.data.msg)
509
+            }
510
+          })
511
+        }else{
512
+          batchdeleteitems(params).then((res) =>{
513
+            if (res.data.state == 1){
514
+              this.$message.success('删除成功')
515
+              this.getUsername()
516
+            }else{
517
+              this.$message.error(res.data.msg)
146 518
             }
147
-          });
519
+          })
148 520
         }
521
+      });
522
+    },
149 523
 
150
-        this.editableTabsValue = activeName;
151
-        this.editableTabs = tabs.filter(tab => tab.name !== targetName);
524
+    lili() {
525
+      console.log("this.multipleSelection",this.multipleSelection);
526
+      console.log("this.tableData",this.tableData)
527
+      // console.log("this.mode",this.modeOptions_value)
528
+      // console.log("this.projectlist2",this.projectlist2)
529
+      // console.log("patient_value",this.patient_value)
530
+    },
531
+    addopen(hang){
532
+      this.hang = hang
533
+      //清空
534
+      this.week_days = [];
535
+      this.day_count = "";
536
+      this.frequency_type = 1;
537
+      this.dialogVisible = true
538
+    },
539
+    changetype(){
540
+      console.log(">>>>>>>",this.new_type)
541
+      this.id = ""
542
+      this.tableData = []
543
+    },
544
+    changeid(item,index){
545
+      item.id = item.drug_name
546
+      var params = {
547
+        id:item.id
152 548
       }
549
+      getdrugsinformation(params).then((res) =>{
550
+        if (res.data.state == 1){
551
+          console.log("res??",res)
552
+          this.tableDatas[0].single_dose = res.data.data.list[0].single_dose;
553
+          this.tableDatas[0].single_dose_unit = res.data.data.list[0].single_dose_unit;
554
+          this.tableDatas[0].delivery_way = res.data.data.list[0].delivery_way;
555
+          this.tableDatas[0].execution_frequency = res.data.data.list[0].execution_frequency;
556
+          this.tableDatas[0].day = res.data.data.list[0].drug_day;
557
+          this.tableDatas[0].prescribing_number = res.data.data.list[0].prescribing_number;
558
+          this.tableDatas[0].prescribing_number_unit = res.data.data.list[0].prescribing_number_unit;
559
+          this.tableDatas[0].price = res.data.data.list[0].retail_price;
560
+          this.tableDatas[0].remark = res.data.data.list[0].remark;
561
+        }
562
+      })
153 563
     },
154
-    handleCurrentChange(){
155
-
564
+    handleSelectionChange(val) {
565
+      this.multipleSelection = val;
566
+    },
567
+    changeid2(item,index){
568
+      item.id = item.drug_name
569
+      var params = {
570
+        id:item.id
571
+      }
572
+      getdrugsinformation(params).then((res) =>{
573
+        if (res.data.state == 1){
574
+          console.log("res??",res)
575
+          this.project[0].single_dose = res.data.data.list[0].single_dose;
576
+          this.project[0].translate = res.data.data.list[0].translate;
577
+          this.project[0].delivery_way = res.data.data.list[0].delivery_way;
578
+          this.project[0].execution_frequency = res.data.data.list[0].execution_frequency;
579
+          this.project[0].day = res.data.data.list[0].day;
580
+          this.project[0].prescribing_number = res.data.data.list[0].prescribing_number;
581
+          this.project[0].unit = res.data.data.list[0].unit;
582
+          this.project[0].price = res.data.data.list[0].retail_price;
583
+          this.project[0].remark = res.data.data.list[0].remark;
584
+        }
585
+      })
586
+    },
587
+    //获取配置
588
+    getdrugconfigs(){
589
+      var params = {}
590
+      replaceconfig(params).then((res) =>{
591
+        if (res.data.state == 1){
592
+          this.druglist = res.data.data.list
593
+          this.projectlist = res.data.data.list2
594
+        }
595
+      })
596
+      getmodeconfigs(params).then((res) =>{
597
+        if (res.data.state == 1){
598
+          this.frequency = res.data.data.efs
599
+          this.usage = res.data.data.drugways
600
+        }
601
+      })
602
+    },
603
+    getUsername(){
604
+      var params = {
605
+        id: this.id,
606
+        mode: this.modeOptions_value
607
+      }
608
+      replacepeoplename(params).then((res) =>{
609
+        if (res.data.state == 1){
610
+          this.tableData = res.data.data.list
611
+        }
612
+      })
613
+    },
614
+    handleClose(done) {
615
+      this.$confirm('确认关闭?')
616
+        .then(_ => {
617
+          done();
618
+        })
619
+        .catch(_ => {});
156 620
     }
157
-  },
158
-
621
+  }
159 622
 
160 623
 }
161 624
 </script>
@@ -163,17 +626,29 @@ export default {
163 626
 
164 627
 
165 628
 <style lang="scss" scoped>
166
-
167
-.zone{
629
+.bannar_list {
630
+  margin-bottom: 10px;
631
+  display: flex;
632
+  justify-content: space-between;
633
+.banner_left {
634
+  width: 1000px;
635
+  display: flex;
636
+  justify-content: space-around;
637
+div {
638
+  white-space: nowrap;
639
+}
640
+}
641
+}
642
+.zone {
168 643
 //  margin-left: 30px;
169 644
 //  text-align: left;
170 645
   width: 70px;
171 646
   display: inline-block;
172
-  color:#606266;
647
+  color: #606266;
173 648
 }
174
-.disinfect{
649
+.disinfect {
175 650
   position: relative;
176
-.newButton{
651
+.newButton {
177 652
 // position: absolute;
178 653
 // right: 2%;
179 654
 // top:4px;
@@ -182,36 +657,36 @@ export default {
182 657
   margin-left: 90%;
183 658
 }
184 659
 }
185
-.disinfectOne{
660
+.disinfectOne {
186 661
   position: relative;
187
-.newButtonOne{
662
+.newButtonOne {
188 663
   position: absolute;
189 664
   right: 0;
190 665
   top: -10;
191 666
   z-index: 18;
192 667
 }
193 668
 }
194
-.but{
669
+.but {
195 670
   width: 200px;
196 671
   height: 50px;
197 672
 // border: solid 1px red;
198 673
   margin-left: 77%;
199 674
 }
200
-.clearn{
675
+.clearn {
201 676
   width: 460px;
202 677
   height: 50px;
203 678
 // border:solid 1px red;
204
-  margin-left:650px;
679
+  margin-left: 650px;
205 680
 }
206 681
 
207
-.zClass{
682
+.zClass {
208 683
   width: 200px;
209 684
   height: 200px;
210 685
 // border:solid 1px red;
211 686
   margin-left: 450px;
212 687
   margin-top: 200px;
213 688
 }
214
-.warn{
689
+.warn {
215 690
   color: red;
216 691
   font-size: 14px;
217 692
   width: 100%;
@@ -219,47 +694,44 @@ export default {
219 694
   margin-left: 96px;
220 695
 }
221 696
 
222
-.userbutton{
697
+.userbutton {
223 698
   margin-bottom: 10px;
224
-  margin-left: 82%
699
+  margin-left: 82%;
225 700
 }
226
-
227 701
 </style>
228 702
 <style lang="scss" >
229
-
230
-.a{
703
+.a {
231 704
   margin-bottom: 10px;
232 705
   margin-top: 6px;
233
-
234 706
 }
235 707
 
236
-.b{
237
-.el-button{
708
+.b {
709
+.el-button {
238 710
   margin-left: 90%;
239 711
   margin-bottom: 10px;
240 712
 }
241 713
 }
242 714
 
243
-.stoppage{
244
-.el-form-item__label{
245
-  width:190px;
715
+.stoppage {
716
+.el-form-item__label {
717
+  width: 190px;
246 718
 }
247 719
 }
248
-.st{
249
-.el-form-item__label{
250
-  width:-10px;
720
+.st {
721
+.el-form-item__label {
722
+  width: -10px;
251 723
 }
252 724
 }
253
-.main{
725
+.main {
254 726
   position: relative;
255
-.newButtonOne{
256
-  position:absolute;
727
+.newButtonOne {
728
+  position: absolute;
257 729
   right: 0;
258 730
   z-index: 2;
259 731
 }
260 732
 }
261 733
 
262
-.elbutton{
734
+.elbutton {
263 735
 // border: solid 1px red;
264 736
   height: 50px;
265 737
   width: 400px;
@@ -280,45 +752,53 @@ export default {
280 752
   overflow: hidden;
281 753
   padding-left: 4px;
282 754
   text-overflow: ellipsis;
283
-  transition: color .3s;
755
+  transition: color 0.3s;
284 756
   white-space: nowrap;
285 757
 }
286
-.el-main{
758
+.el-main {
287 759
   padding-top: 0px;
288 760
 }
289
-.newMain{
290
-.el-form-item__label{
761
+.newMain {
762
+.el-form-item__label {
291 763
   width: 104px;
292 764
 }
293 765
 }
294
-.newDisinfectOne{
295
-.el-input--prefix .el-input__inner{
296
-  padding-left: 15px
766
+.newDisinfectOne {
767
+.el-input--prefix .el-input__inner {
768
+  padding-left: 15px;
297 769
 }
298 770
 }
299
-.stoppage{
300
-.el-form-item__label{
771
+.stoppage {
772
+.el-form-item__label {
301 773
   width: 18%;
302 774
 }
303 775
 }
304
-.newItem{
305
-.el-form-item__label{
776
+.newItem {
777
+.el-form-item__label {
306 778
   width: 130px;
307 779
 }
308 780
 }
309
-.formItem{
310
-.el-form-item__label{
781
+.formItem {
782
+.el-form-item__label {
311 783
   width: 104px;
312 784
   line-height: 30px;
313 785
 }
314 786
 }
315
-.newname{
316
-.el-form-item__label{
787
+.newname {
788
+.el-form-item__label {
317 789
   width: 60px;
318 790
 }
319 791
 }
320
-::-webkit-scrollbar{
792
+::-webkit-scrollbar {
321 793
   height: 20px;
322 794
 }
323 795
 
796
+.el-button {
797
+  color: #fff;
798
+  background-color: #409eff;
799
+  border-color: #409eff;
800
+}
801
+.el-table td .cell {
802
+  padding: 0 10px;
803
+}
324 804
 </style>

+ 270 - 53
src/xt_pages/outpatientDoctorStation/batch_mode_template.vue Vedi File

@@ -22,7 +22,7 @@
22 22
           </div>
23 23
           <div>
24 24
             新增类型:
25
-            <el-select v-model="new_type" placeholder="请选择">
25
+            <el-select v-model="new_type" placeholder="请选择" @change="changetype">
26 26
               <el-option
27 27
                 v-for="item in options"
28 28
                 :key="item.id"
@@ -166,9 +166,9 @@
166 166
                     >
167 167
                       <el-option
168 168
                         v-for="item in usage"
169
-                        :key="item.id"
169
+                        :key="item.name"
170 170
                         :label="item.name"
171
-                        :value="item.id"
171
+                        :value="item.name"
172 172
                       >
173 173
                       </el-option>
174 174
                     </el-select>
@@ -182,9 +182,9 @@
182 182
                     >
183 183
                       <el-option
184 184
                         v-for="item in frequency"
185
-                        :key="item.id"
185
+                        :key="item.name"
186 186
                         :label="item.name"
187
-                        :value="item.id"
187
+                        :value="item.name"
188 188
                       >
189 189
                       </el-option>
190 190
                     </el-select>
@@ -270,8 +270,14 @@
270 270
                 :data="item.project"
271 271
                 style="width: 100%"
272 272
                 max-height="250"
273
+                border
274
+                :row-style="{ color: '#303133' }"
275
+                :header-cell-style="{
276
+                  backgroundColor: 'rgb(245, 247, 250)',
277
+                  color: '#606266',
278
+                }"
273 279
               >
274
-                <el-table-column fixed label="新增项目名称" width="250">
280
+                <el-table-column fixed label="新增项目名称" width="230">
275 281
                   <template slot-scope="scope">
276 282
                     <el-select
277 283
                       v-model="scope.row.drug_name"
@@ -290,11 +296,11 @@
290 296
                   </template>
291 297
                 </el-table-column>
292 298
                 <el-table-column label="组" width="120">
293
-                  <template slot-scope="scope" width="100">
294
-                    {{scrope.row.translate}}
299
+                  <template slot-scope="scope">
300
+                    {{scope.row.translate}}
295 301
                   </template>
296 302
                 </el-table-column>
297
-                <el-table-column label="单次用量" width="120">
303
+                <el-table-column label="单次用量" width="200">
298 304
                   <template slot-scope="scope">
299 305
                     <el-input
300 306
                       v-model="scope.row.single_dose"
@@ -311,9 +317,9 @@
311 317
                     >
312 318
                       <el-option
313 319
                         v-for="item in usage"
314
-                        :key="item.id"
320
+                        :key="item.name"
315 321
                         :label="item.name"
316
-                        :value="item.id"
322
+                        :value="item.name"
317 323
                       >
318 324
                       </el-option>
319 325
                     </el-select>
@@ -327,36 +333,38 @@
327 333
                     >
328 334
                       <el-option
329 335
                         v-for="item in frequency"
330
-                        :key="item.id"
336
+                        :key="item.name"
331 337
                         :label="item.name"
332
-                        :value="item.id"
338
+                        :value="item.name"
333 339
                       >
334 340
                       </el-option>
335 341
                     </el-select>
336 342
                   </template>
337 343
                 </el-table-column>
338
-                <el-table-column label="天数" width="120">
344
+                <el-table-column label="天数" width="110">
339 345
                   <template slot-scope="scope">
340 346
                     <el-input
341 347
                       v-model="scope.row.day"
342
-                      placeholder="请输入内容"
343
-                    ></el-input
344
-                    >天
348
+                      placeholder="请输入"
349
+                      style="width: 75px"
350
+                    ></el-input>
345 351
                   </template>
346 352
                 </el-table-column>
347
-                <el-table-column label="总量" width="120">
353
+                <el-table-column label="总量" width="200">
348 354
                   <template slot-scope="scope">
349 355
                     <el-input
350 356
                       v-model="scope.row.prescribing_number"
351
-                      placeholder="请输入内容"
357
+                      placeholder="请输入"
358
+                      style="width: 75px"
352 359
                     ></el-input>
353 360
                     {{ scope.row.unit }}
354 361
                   </template>
355 362
                 </el-table-column>
356 363
                 <el-table-column label="单价" width="120">
357
-                  <template slot-scope="scope"><!--:disabled="true"-->
364
+                  <template slot-scope="scope">
358 365
                     <el-input
359 366
                       v-model="scope.row.price"
367
+                      style="width: 80px"
360 368
                     ></el-input
361 369
                     >元
362 370
                   </template>
@@ -369,7 +377,14 @@
369 377
                     ></el-input>
370 378
                   </template>
371 379
                 </el-table-column>
372
-                <el-table-column fixed="right" label="操作" width="120">
380
+                <el-table-column label="推送频率" width="120">
381
+                  <template slot-scope="scope">
382
+                    <div v-if="scope.row.frequency_type == 1">{{'每次必推'}}</div>
383
+                    <div v-if="scope.row.frequency_type == 2">{{scope.row.day_count}}天/次</div>
384
+                    <div v-if="scope.row.frequency_type == 3">{{scope.row.week_days}}</div>
385
+                  </template>
386
+                </el-table-column>
387
+                <el-table-column fixed="right" label="操作" width="102">
373 388
                   <template slot-scope="scope">
374 389
                     <el-button
375 390
                       @click.native.prevent="addopen(scope.$index)"
@@ -398,8 +413,142 @@
398 413
                   </template>
399 414
                 </el-table-column>
400 415
               </el-table>
401
-            </el-tab-pane>
402 416
 
417
+<!--              <el-table-->
418
+<!--                v-if="new_type == 2"-->
419
+<!--                :data="item.project"-->
420
+<!--                style="width: 100%"-->
421
+<!--                max-height="250"-->
422
+<!--              >-->
423
+<!--                <el-table-column fixed label="新增项目名称" width="250">-->
424
+<!--                  <template slot-scope="scope2">-->
425
+<!--                    <el-select-->
426
+<!--                      v-model="scope2.row.drug_name"-->
427
+<!--                      placeholder="请选择"-->
428
+<!--                      @focus="clicktmp(item.patient_value,scope2.row,item)"-->
429
+<!--                      @change="changeid2(scope2.row,scope2.$index)"-->
430
+<!--                    >-->
431
+<!--                      <el-option-->
432
+<!--                        v-for="item in tmplist"-->
433
+<!--                        :key="item.id"-->
434
+<!--                        :label="item.name"-->
435
+<!--                        :value="item.id"-->
436
+<!--                      >-->
437
+<!--                      </el-option>-->
438
+<!--                    </el-select>-->
439
+<!--                  </template>-->
440
+<!--                </el-table-column>-->
441
+<!--                <el-table-column label="组" width="120">-->
442
+<!--                  <template slot-scope="scope2" width="100">-->
443
+<!--                    {{scope2.row.translate}}-->
444
+<!--                  </template>-->
445
+<!--                </el-table-column>-->
446
+<!--                <el-table-column label="单次用量" width="120">-->
447
+<!--                  <template slot-scope="scope2">-->
448
+<!--                    <el-input-->
449
+<!--                      v-model="scope2.row.single_dose"-->
450
+<!--                      placeholder="请输入内容"-->
451
+<!--                    ></el-input>-->
452
+<!--                    {{ scope2.row.unit }}-->
453
+<!--                  </template>-->
454
+<!--                </el-table-column>-->
455
+<!--                <el-table-column label="用法" width="120">-->
456
+<!--                  <template slot-scope="scope2">-->
457
+<!--                    <el-select-->
458
+<!--                      v-model="scope2.row.delivery_way"-->
459
+<!--                      placeholder="请选择"-->
460
+<!--                    >-->
461
+<!--                      <el-option-->
462
+<!--                        v-for="item in usage"-->
463
+<!--                        :key="item.id"-->
464
+<!--                        :label="item.name"-->
465
+<!--                        :value="item.id"-->
466
+<!--                      >-->
467
+<!--                      </el-option>-->
468
+<!--                    </el-select>-->
469
+<!--                  </template>-->
470
+<!--                </el-table-column>-->
471
+<!--                <el-table-column label="频率" width="120">-->
472
+<!--                  <template slot-scope="scope2">-->
473
+<!--                    <el-select-->
474
+<!--                      v-model="scope2.row.execution_frequency"-->
475
+<!--                      placeholder="请选择"-->
476
+<!--                    >-->
477
+<!--                      <el-option-->
478
+<!--                        v-for="item in frequency"-->
479
+<!--                        :key="item.id"-->
480
+<!--                        :label="item.name"-->
481
+<!--                        :value="item.id"-->
482
+<!--                      >-->
483
+<!--                      </el-option>-->
484
+<!--                    </el-select>-->
485
+<!--                  </template>-->
486
+<!--                </el-table-column>-->
487
+<!--                <el-table-column label="天数" width="120">-->
488
+<!--                  <template slot-scope="scope2">-->
489
+<!--                    <el-input-->
490
+<!--                      v-model="scope2.row.day"-->
491
+<!--                      placeholder="请输入内容"-->
492
+<!--                    ></el-input-->
493
+<!--                    >天-->
494
+<!--                  </template>-->
495
+<!--                </el-table-column>-->
496
+<!--                <el-table-column label="总量" width="120">-->
497
+<!--                  <template slot-scope="scope2">-->
498
+<!--                    <el-input-->
499
+<!--                      v-model="scope2.row.prescribing_number"-->
500
+<!--                      placeholder="请输入内容"-->
501
+<!--                    ></el-input>-->
502
+<!--                    {{ scope.row.unit }}-->
503
+<!--                  </template>-->
504
+<!--                </el-table-column>-->
505
+<!--                <el-table-column label="单价" width="120">-->
506
+<!--                  <template slot-scope="scope2">&lt;!&ndash;:disabled="true"&ndash;&gt;-->
507
+<!--                    <el-input-->
508
+<!--                      v-model="scope2.row.price"-->
509
+<!--                    ></el-input-->
510
+<!--                    >元-->
511
+<!--                  </template>-->
512
+<!--                </el-table-column>-->
513
+<!--                <el-table-column label="备注" width="120">-->
514
+<!--                  <template slot-scope="scope2">-->
515
+<!--                    <el-input-->
516
+<!--                      v-model="scope2.row.remark"-->
517
+<!--                      placeholder=""-->
518
+<!--                    ></el-input>-->
519
+<!--                  </template>-->
520
+<!--                </el-table-column>-->
521
+<!--                <el-table-column fixed="right" label="操作" width="120">-->
522
+<!--                  <template slot-scope="scope2">-->
523
+<!--                    <el-button-->
524
+<!--                      @click.native.prevent="addopen(scope2.$index)"-->
525
+<!--                      type="text"-->
526
+<!--                      size="small">-->
527
+<!--                      推送-->
528
+<!--                    </el-button>-->
529
+<!--                    <el-button-->
530
+<!--                      @click.native.prevent="-->
531
+<!--                        addRow2(scope2.$index, item.project)-->
532
+<!--                      "-->
533
+<!--                      type="text"-->
534
+<!--                      size="small"-->
535
+<!--                    >-->
536
+<!--                      添加-->
537
+<!--                    </el-button>-->
538
+<!--                    <el-button-->
539
+<!--                      @click.native.prevent="-->
540
+<!--                        deleteRow(scope2.$index, item.project)-->
541
+<!--                      "-->
542
+<!--                      type="text"-->
543
+<!--                      size="small"-->
544
+<!--                    >-->
545
+<!--                      移除-->
546
+<!--                    </el-button>-->
547
+<!--                  </template>-->
548
+<!--                </el-table-column>-->
549
+<!--              </el-table>-->
550
+
551
+            </el-tab-pane>
403 552
           </el-tabs>
404 553
         </el-main>
405 554
       </el-container>
@@ -446,6 +595,7 @@ import {
446 595
   getdrugsname,
447 596
   getmodeconfigs,
448 597
   getdrugsinformation,
598
+  prescriptiontemplate
449 599
 } from "@/api/batch/batch";
450 600
 
451 601
 export default {
@@ -464,11 +614,11 @@ export default {
464 614
           tableDatas: [
465 615
             {
466 616
               id: "",
467
-              drug_name: "王小美",
617
+              drug_name: "",
468 618
               single_dose: 0,
469 619
               single_dose_unit: "",
470
-              delivery_way: "给药途径",
471
-              execution_frequency: "执行频率",
620
+              delivery_way: "",
621
+              execution_frequency: "",
472 622
               day: 0,
473 623
               prescribing_number: 0,
474 624
               prescribing_number_unit: "",
@@ -479,17 +629,17 @@ export default {
479 629
           project: [
480 630
             {
481 631
               id: "",
482
-              drug_name: "王小美",
483
-              translate:"",
632
+              drug_name: "",
633
+              translate:"",
484 634
               single_dose: 0,
485
-              unit: "",
486
-              delivery_way: "给药途径",
487
-              execution_frequency: "执行频率",
635
+              unit: "",
636
+              delivery_way: "",
637
+              execution_frequency: "",
488 638
               day: 0,
489 639
               prescribing_number: 0,
490 640
               price: "",
491 641
               remark: "",
492
-              frequency_type:"",
642
+              frequency_type:1,
493 643
               day_count:"",
494 644
               week_days:"",
495 645
             },
@@ -498,7 +648,7 @@ export default {
498 648
       ],
499 649
       tabIndex: 2,
500 650
       modeOptions_value: 1, //透析模式
501
-      multipleSelection: [],
651
+      multipleSelection: [],//选中的患者
502 652
       tableData:[],
503 653
       options:[{id:1,name:"药品"},{id:2,name:"项目"}],
504 654
       options_patient:[{id:1,name:"是"},{id:2,name:"否"}],
@@ -543,13 +693,38 @@ export default {
543 693
           cancelButtonText: "取 消",
544 694
           type: "warning",
545 695
         }
546
-      ).then(() => {});
696
+      ).then(() => {
697
+        if (this.multipleSelection.length == 0){
698
+          this.$message.error('没有选中有效信息')
699
+          return
700
+        }
701
+        let st = ""
702
+        for (let i = 0;i < this.multipleSelection.length;i++){
703
+          st = st + this.multipleSelection[i].id + ","
704
+        }
705
+        console.log("string",st)
706
+        let params = {
707
+          mode_id:this.modeOptions_value,
708
+          patient_id: st,
709
+          type:this.new_type,
710
+        }
711
+        let data = {
712
+          "prescriptions": this.editableTabs
713
+        }
714
+        prescriptiontemplate(params,data).then((res) =>{
715
+          if (res.data.state == 1){
716
+            this.$message.success('保存成功')
717
+          }else{
718
+            this.$message.error(res.data.msg)
719
+          }
720
+        })
721
+      });
547 722
     },
548 723
 
549 724
     lili() {
550
-      console.log("this.hang",this.hang);
551
-      console.log("this.week_days",this.week_days)
552
-      console.log("this.editableTabs",this.editableTabs)
725
+      console.log("this.editableTabs",this.editableTabs);
726
+      // console.log("this.week_days",this.week_days)
727
+      // console.log("this.editableTabs",this.editableTabs)
553 728
       // console.log("this.projectlist2",this.projectlist2)
554 729
       // console.log("patient_value",this.patient_value)
555 730
     },
@@ -561,6 +736,47 @@ export default {
561 736
       this.frequency_type = 1;
562 737
       this.dialogVisible = true
563 738
     },
739
+    changetype(){
740
+      console.log(">>>>>>>",this.new_type)
741
+      this.editableTabs = [{
742
+        title: "处方1",
743
+        name: "1",
744
+        patient_value: 1,
745
+        tableDatas: [
746
+          {
747
+            id: "",
748
+            drug_name: "",
749
+            single_dose: 0,
750
+            single_dose_unit: "",
751
+            delivery_way: "",
752
+            execution_frequency: "",
753
+            day: 0,
754
+            prescribing_number: 0,
755
+            prescribing_number_unit: "",
756
+            price: "",
757
+            remark: "",
758
+          },
759
+        ],
760
+        project: [
761
+          {
762
+            id: "",
763
+            drug_name: "",
764
+            translate:"",
765
+            single_dose: 0,
766
+            unit: "",
767
+            delivery_way: "",
768
+            execution_frequency: "",
769
+            day: 0,
770
+            prescribing_number: 0,
771
+            price: "",
772
+            remark: "",
773
+            frequency_type:1,
774
+            day_count:"",
775
+            week_days:"",
776
+          },
777
+        ],
778
+      },];
779
+    },
564 780
     baocun(){
565 781
       let tmp = ""
566 782
       for (let i = 0;i < this.week_days.length;i++){
@@ -600,8 +816,8 @@ export default {
600 816
       })
601 817
     },
602 818
     changeid2(item,index){
603
-      console.log("ididiididid",item)
604
-      console.log("index???",index)
819
+      console.log("this.tabhang",this.tabhang)
820
+      console.log("this.hang???",this.hang)
605 821
       this.hang = index
606 822
       item.id = item.drug_name
607 823
       var params = {
@@ -622,9 +838,10 @@ export default {
622 838
         }
623 839
       })
624 840
     },
625
-    clicktmp(tmp,item){
626
-      // console.log("hahahhatmp",tmp)
627
-      // console.log("hahahitem",item)
841
+    clicktmp(tmp,ite,item){
842
+      console.log("???????hatmp",tmp)
843
+      console.log("??????hscope2.rowitem",ite)
844
+      console.log("??????item",item)
628 845
       if (this.new_type == 1){
629 846
         if(tmp == 2){
630 847
           this.tmplist = this.druglist
@@ -664,8 +881,8 @@ export default {
664 881
         drug_name: '',
665 882
         single_dose:0,
666 883
         single_dose_unit: '',
667
-        delivery_way: '给药途径',
668
-        execution_frequency: '执行频率',
884
+        delivery_way: '',
885
+        execution_frequency: '',
669 886
         day: 0,
670 887
         prescribing_number:0,
671 888
         prescribing_number_unit:"",
@@ -676,11 +893,11 @@ export default {
676 893
     addRow2(index, rows){
677 894
       rows.splice(index+1,0,{
678 895
         id: "",
679
-        drug_name: "王小美",
896
+        drug_name: "",
680 897
         single_dose: 0,
681
-        unit: "",
682
-        delivery_way: "给药途径",
683
-        execution_frequency: "执行频率",
898
+        unit: "",
899
+        delivery_way: "",
900
+        execution_frequency: "",
684 901
         day: 0,
685 902
         prescribing_number: 0,
686 903
         price: "",
@@ -749,8 +966,8 @@ export default {
749 966
               drug_name: "",
750 967
               single_dose: 0,
751 968
               single_dose_unit: "",
752
-              delivery_way: "给药途径",
753
-              execution_frequency: "执行频率",
969
+              delivery_way: "",
970
+              execution_frequency: "",
754 971
               day: 0,
755 972
               prescribing_number: 0,
756 973
               prescribing_number_unit: "",
@@ -761,11 +978,11 @@ export default {
761 978
           project: [
762 979
             {
763 980
               id: "",
764
-              drug_name: "王小美",
981
+              drug_name: "",
765 982
               single_dose: 0,
766
-              unit: "",
767
-              delivery_way: "给药途径",
768
-              execution_frequency: "执行频率",
983
+              unit: "",
984
+              delivery_way: "",
985
+              execution_frequency: "",
769 986
               day: 0,
770 987
               prescribing_number: 0,
771 988
               price: "",

+ 669 - 181
src/xt_pages/outpatientDoctorStation/batch_replacement.vue Vedi File

@@ -1,161 +1,632 @@
1
-<template><!--批量替换-->
1
+<template>
2
+  <!--批量替换-->
2 3
   <div class="main-contain">
3 4
     <div class="app-container">
4
-      <div style="margin-bottom:10px">
5
-        透析模式:
6
-        <el-select v-model="value" placeholder="请选择">
7
-          <el-option
8
-            v-for="item in options"
9
-            :key="item.value"
10
-            :label="item.label"
11
-            :value="item.value">
12
-          </el-option>
13
-        </el-select>
14
-        新增类型:
15
-        <el-select v-model="value" placeholder="请选择">
16
-          <el-option
17
-            v-for="item in options"
18
-            :key="item.value"
19
-            :label="item.label"
20
-            :value="item.value">
21
-          </el-option>
22
-        </el-select>
23
-        是否选择所有患者:
24
-        <el-select v-model="value" placeholder="请选择">
25
-          <el-option
26
-            v-for="item in options"
27
-            :key="item.value"
28
-            :label="item.label"
29
-            :value="item.value">
30
-          </el-option>
31
-        </el-select>
32
-      </div>
33
-      <el-container>
34
-
35
-        <div style="width:27%">
36
-
37
-          <el-row>
38
-            <el-table
39
-              ref="singleTable"
40
-              :data="patientList"
41
-              highlight-current-row
42
-              border
43
-              @current-change="handleCurrentChange"
44
-              height="440"
45
-              :row-style="{ color: '#303133' }"
46
-              :header-cell-style="{
47
-                        backgroundColor: 'rgb(245, 247, 250)',
48
-                        color: '#606266'
49
-                        }"
5
+      <div class="bannar_list">
6
+        <div class="banner_left">
7
+          <div>
8
+            透析模式:
9
+            <el-select
10
+              v-model="modeOptions_value"
11
+              placeholder="请选择"
50 12
             >
51
-              <el-table-column align="center" type="selection" width="55">
52
-                <template slot-scope="scope">
53
-
54
-                </template>
55
-              </el-table-column>
56
-              <el-table-column prop="date" label="患者姓名" align="center">
57
-                <template slot-scope="scope">
58
-                  {{scope.row.name}}
59
-                </template>
60
-              </el-table-column>
13
+              <el-option
14
+                v-for="item in modeOptions"
15
+                :key="item.id"
16
+                :label="item.name"
17
+                :value="item.id"
18
+              >
19
+              </el-option>
20
+            </el-select>
21
+          </div>
22
+          <div>
23
+            替换类型:
24
+            <el-select v-model="new_type" placeholder="请选择" @change="changetype">
25
+              <el-option
26
+                v-for="item in options"
27
+                :key="item.id"
28
+                :label="item.name"
29
+                :value="item.id"
30
+              >
31
+              </el-option>
32
+            </el-select>
33
+          </div>
34
+          <div v-if="new_type == 1">
35
+            请输入需要替换的药品:
36
+            <el-select
37
+              v-model="id"
38
+              placeholder="请选择"
39
+              @change="getUsername"
40
+            >
41
+              <el-option
42
+                v-for="item in druglist"
43
+                :key="item.id"
44
+                :label="item.name"
45
+                :value="item.id"
46
+              >
47
+              </el-option>
48
+            </el-select>
49
+          </div>
50
+          <div v-if="new_type == 2">
51
+            请输入需要替换的项目:
52
+            <el-select
53
+              v-model="id"
54
+              placeholder="请选择"
55
+              @change="getUsername"
56
+            >
57
+              <el-option
58
+                v-for="item in projectlist"
59
+                :key="item.id"
60
+                :label="item.name"
61
+                :value="item.id"
62
+              >
63
+              </el-option>
64
+            </el-select>
65
+          </div>
66
+        </div>
61 67
 
68
+        <button @click="lili">调试</button>
69
+        <el-button @click="save">保存</el-button>
70
+      </div>
62 71
 
63
-            </el-table>
64
-          </el-row>
72
+      <el-container>
73
+        <div style="width: 211px">
74
+          <el-table
75
+            border
76
+            ref="multipleTable"
77
+            :data="tableData"
78
+            tooltip-effect="dark"
79
+            style="width: 100%"
80
+            @selection-change="handleSelectionChange"
81
+            :row-style="{ color: '#303133' }"
82
+            :header-cell-style="{
83
+              backgroundColor: 'rgb(245, 247, 250)',
84
+              color: '#606266',
85
+            }"
86
+          >
87
+            <el-table-column type="selection" width="55"> </el-table-column>
88
+            <el-table-column label="患者姓名" width="155">
89
+              <template slot-scope="scope">{{ scope.row.name }}</template>
90
+            </el-table-column>
91
+          </el-table>
65 92
         </div>
66
-        <el-main>
67
-          <el-tabs v-model="editableTabsValue" type="border-card" editable @edit="handleTabsEdit">
68
-            <el-tab-pane
69
-              :key="item.name"
70
-              v-for="(item, index) in editableTabs"
71
-              :label="item.title"
72
-              :name="item.name"
73
-            >
74
-              {{item.content}}
75
-            </el-tab-pane>
76
-          </el-tabs>
77
-        </el-main>
93
+
94
+        <el-table
95
+          v-if="new_type == 1"
96
+          :data="tableDatas"
97
+          style="width: 100%"
98
+          max-height="250"
99
+          border
100
+          :row-style="{ color: '#303133' }"
101
+          :header-cell-style="{
102
+                  backgroundColor: 'rgb(245, 247, 250)',
103
+                  color: '#606266',
104
+                }"
105
+        >
106
+          <el-table-column fixed label="替换药品名称" width="230">
107
+            <template slot-scope="scope">
108
+              <el-select
109
+                v-model="scope.row.drug_name"
110
+                placeholder="请选择"
111
+                @change="changeid(scope.row,scope.$index)"
112
+              >
113
+                <el-option
114
+                  v-for="item in druglist"
115
+                  :key="item.id"
116
+                  :label="item.name"
117
+                  :value="item.id"
118
+                >
119
+                </el-option>
120
+              </el-select>
121
+            </template>
122
+          </el-table-column>
123
+          <el-table-column label="单次用量" width="200">
124
+            <template slot-scope="scope">
125
+              <el-input
126
+                v-model="scope.row.single_dose"
127
+                placeholder="请输入"
128
+                style="width: 75px"
129
+              ></el-input>
130
+              <el-select
131
+                v-model="scope.row.single_dose_unit"
132
+                placeholder="请选择"
133
+                style="width: 90px"
134
+              >
135
+                <el-option
136
+                  v-for="item in unit"
137
+                  :key="item.name"
138
+                  :label="item.name"
139
+                  :value="item.name"
140
+                >
141
+                </el-option>
142
+              </el-select>
143
+            </template>
144
+          </el-table-column>
145
+          <el-table-column label="用法" width="120">
146
+            <template slot-scope="scope">
147
+              <el-select
148
+                v-model="scope.row.delivery_way"
149
+                placeholder="请选择"
150
+              >
151
+                <el-option
152
+                  v-for="item in usage"
153
+                  :key="item.name"
154
+                  :label="item.name"
155
+                  :value="item.name"
156
+                >
157
+                </el-option>
158
+              </el-select>
159
+            </template>
160
+          </el-table-column>
161
+          <el-table-column label="频率" width="120">
162
+            <template slot-scope="scope">
163
+              <el-select
164
+                v-model="scope.row.execution_frequency"
165
+                placeholder="请选择"
166
+              >
167
+                <el-option
168
+                  v-for="item in frequency"
169
+                  :key="item.name"
170
+                  :label="item.name"
171
+                  :value="item.name"
172
+                >
173
+                </el-option>
174
+              </el-select>
175
+            </template>
176
+          </el-table-column>
177
+          <el-table-column label="天数" width="110">
178
+            <template slot-scope="scope">
179
+              <el-input
180
+                v-model="scope.row.day"
181
+                placeholder="请输入"
182
+                style="width: 75px"
183
+              ></el-input
184
+              >天
185
+            </template>
186
+          </el-table-column>
187
+          <el-table-column label="总量" width="200">
188
+            <template slot-scope="scope">
189
+              <el-input
190
+                v-model="scope.row.prescribing_number"
191
+                placeholder="请输入"
192
+                style="width: 75px"
193
+              ></el-input>
194
+              <el-select
195
+                v-model="scope.row.prescribing_number_unit"
196
+                placeholder="请选择"
197
+                style="width: 90px"
198
+              >
199
+                <el-option
200
+                  v-for="item in unit"
201
+                  :key="item.name"
202
+                  :label="item.name"
203
+                  :value="item.name"
204
+                >
205
+                </el-option>
206
+              </el-select>
207
+            </template>
208
+          </el-table-column>
209
+          <el-table-column label="单价" width="120">
210
+            <template slot-scope="scope">
211
+              <el-input
212
+                v-model="scope.row.price"
213
+                style="width: 80px"
214
+              ></el-input
215
+              >元
216
+            </template>
217
+          </el-table-column>
218
+          <el-table-column label="备注" width="120">
219
+            <template slot-scope="scope">
220
+              <el-input
221
+                v-model="scope.row.remark"
222
+                placeholder=""
223
+              ></el-input>
224
+            </template>
225
+          </el-table-column>
226
+        </el-table>
227
+
228
+        <el-table
229
+          v-if="new_type == 2"
230
+          :data="project"
231
+          style="width: 100%"
232
+          max-height="250"
233
+          border
234
+          :row-style="{ color: '#303133' }"
235
+          :header-cell-style="{
236
+                  backgroundColor: 'rgb(245, 247, 250)',
237
+                  color: '#606266',
238
+                }"
239
+        >
240
+          <el-table-column fixed label="替换项目名称" width="230">
241
+            <template slot-scope="scope">
242
+              <el-select
243
+                v-model="scope.row.drug_name"
244
+                placeholder="请选择"
245
+                @change="changeid2(scope.row,scope.$index)"
246
+              >
247
+                <el-option
248
+                  v-for="item in projectlist"
249
+                  :key="item.id"
250
+                  :label="item.name"
251
+                  :value="item.id"
252
+                >
253
+                </el-option>
254
+              </el-select>
255
+            </template>
256
+          </el-table-column>
257
+          <el-table-column label="组" width="120">
258
+            <template slot-scope="scope">
259
+              {{scope.row.translate}}
260
+            </template>
261
+          </el-table-column>
262
+          <el-table-column label="单次用量" width="200">
263
+            <template slot-scope="scope">
264
+              <el-input
265
+                v-model="scope.row.single_dose"
266
+                placeholder="请输入内容"
267
+              ></el-input>
268
+              {{ scope.row.unit }}
269
+            </template>
270
+          </el-table-column>
271
+          <el-table-column label="用法" width="120">
272
+            <template slot-scope="scope">
273
+              <el-select
274
+                v-model="scope.row.delivery_way"
275
+                placeholder="请选择"
276
+              >
277
+                <el-option
278
+                  v-for="item in usage"
279
+                  :key="item.name"
280
+                  :label="item.name"
281
+                  :value="item.name"
282
+                >
283
+                </el-option>
284
+              </el-select>
285
+            </template>
286
+          </el-table-column>
287
+          <el-table-column label="频率" width="120">
288
+            <template slot-scope="scope">
289
+              <el-select
290
+                v-model="scope.row.execution_frequency"
291
+                placeholder="请选择"
292
+              >
293
+                <el-option
294
+                  v-for="item in frequency"
295
+                  :key="item.name"
296
+                  :label="item.name"
297
+                  :value="item.name"
298
+                >
299
+                </el-option>
300
+              </el-select>
301
+            </template>
302
+          </el-table-column>
303
+          <el-table-column label="天数" width="110">
304
+            <template slot-scope="scope">
305
+              <el-input
306
+                v-model="scope.row.day"
307
+                placeholder="请输入"
308
+                style="width: 75px"
309
+              ></el-input>天
310
+            </template>
311
+          </el-table-column>
312
+          <el-table-column label="总量" width="200">
313
+            <template slot-scope="scope">
314
+              <el-input
315
+                v-model="scope.row.prescribing_number"
316
+                placeholder="请输入"
317
+                style="width: 75px"
318
+              ></el-input>
319
+              {{ scope.row.unit }}
320
+            </template>
321
+          </el-table-column>
322
+          <el-table-column label="单价" width="120">
323
+            <template slot-scope="scope">
324
+              <el-input
325
+                v-model="scope.row.price"
326
+                style="width: 80px"
327
+              ></el-input
328
+              >元
329
+            </template>
330
+          </el-table-column>
331
+          <el-table-column label="备注" width="120">
332
+            <template slot-scope="scope">
333
+              <el-input
334
+                v-model="scope.row.remark"
335
+                placeholder=""
336
+              ></el-input>
337
+            </template>
338
+          </el-table-column>
339
+          <el-table-column label="推送频率" width="120">
340
+            <template slot-scope="scope">
341
+              <div v-if="scope.row.frequency_type == 1">{{'每次必推'}}</div>
342
+              <div v-if="scope.row.frequency_type == 2">{{scope.row.day_count}}天/次</div>
343
+              <div v-if="scope.row.frequency_type == 3">{{scope.row.week_days}}</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>
356
+        </el-table>
78 357
       </el-container>
79 358
     </div>
80
-  </div>
359
+    <el-dialog
360
+      title="推送频率设置"
361
+      :visible.sync="dialogVisible"
362
+      width="30%"
363
+      :before-close="handleClose">
364
+      <span>周期提醒</span>
365
+      <el-radio-group v-model="frequency_type">
366
+        <el-radio :label="1">每次必推</el-radio>
367
+        <el-radio :label="2">天数频率</el-radio>
368
+        <el-radio :label="3">星期频率</el-radio>
369
+      </el-radio-group>
370
+      <div v-if="frequency_type == 2">
371
+        <el-input style="width: 50px" v-model="day_count"></el-input>&nbsp;
372
+        天/一次
373
+      </div>
374
+      <div v-if="frequency_type == 3">
375
+        <el-checkbox-group v-model="week_days">
376
+          <el-checkbox label="周一" name="周一" key="1">周一</el-checkbox>
377
+          <el-checkbox label="周二" name="周二" key="2">周二</el-checkbox>
378
+          <el-checkbox label="周三" name="周三" key="3">周三</el-checkbox>
379
+          <el-checkbox label="周四" name="周四" key="4">周四</el-checkbox>
380
+          <el-checkbox label="周五" name="周五" key="5">周五</el-checkbox>
381
+          <el-checkbox label="周六" name="周六" key="6">周六</el-checkbox>
382
+          <el-checkbox label="周日" name="周日" key="7">周日</el-checkbox>
383
+        </el-checkbox-group>
384
+      </div>
81 385
 
386
+      <span slot="footer" class="dialog-footer">
387
+        <button @click="lili">调试</button>
388
+    <el-button @click="dialogVisible = false">取 消</el-button>
389
+    <el-button type="primary" @click="baocun">确 定</el-button>
390
+  </span>
391
+    </el-dialog>
392
+  </div>
82 393
 </template>
83 394
 <script>
395
+import { gethisusertoalive } from "@/api/deposit";
396
+import {
397
+  getdrugsinformation,
398
+  replacepeoplename,
399
+  replaceconfig,
400
+  replacesavedrug,
401
+  replacesaveproject,
402
+  getmodeconfigs
403
+} from "@/api/batch/batch";
84 404
 
85 405
 export default {
86
-  data(){
87
-    return{
88
-      patientList:[
89
-        {id:1,name:"张三"}
90
-      ],
91
-      tableList:[],
92
-      editableTabsValue: '2',
93
-      editableTabs: [{
94
-        title: 'Tab 1',
95
-        name: '1',
96
-        content: 'Tab 1 content'
97
-      }, {
98
-        title: 'Tab 2',
99
-        name: '2',
100
-        content: 'Tab 2 content'
101
-      }],
406
+  data() {
407
+    return {
408
+      dialogVisible: false,
409
+      tableList: [],
410
+      editableTabsValue: "1",
411
+      modeOptions: {},
412
+      tableDatas:[{
413
+        id: "",
414
+        drug_name: "",
415
+        single_dose: 0,
416
+        single_dose_unit: "",
417
+        delivery_way: "",
418
+        execution_frequency: "",
419
+        day: 0,
420
+        prescribing_number: 0,
421
+        prescribing_number_unit: "",
422
+        price: "",
423
+        remark: "",
424
+      },],//药品
425
+      project:[ {
426
+        id: "",
427
+        drug_name: "",
428
+        translate:"",
429
+        single_dose: 0,
430
+        unit: "",
431
+        delivery_way: "",
432
+        execution_frequency: "",
433
+        day: 0,
434
+        prescribing_number: 0,
435
+        price: "",
436
+        remark: "",
437
+        frequency_type:1,
438
+        day_count:"",
439
+        week_days:"",
440
+      },],//项目
102 441
       tabIndex: 2,
103
-      options: [{
104
-        value: '选项1',
105
-        label: '黄金糕'
106
-      }, {
107
-        value: '选项2',
108
-        label: '双皮奶'
109
-      }, {
110
-        value: '选项3',
111
-        label: '蚵仔煎'
112
-      }, {
113
-        value: '选项4',
114
-        label: '龙须面'
115
-      }, {
116
-        value: '选项5',
117
-        label: '北京烤鸭'
118
-      }],
119
-      value: ''
442
+      modeOptions_value: 1, //透析模式
443
+      multipleSelection: [],//选中的患者
444
+      tableData:[],
445
+      options:[{id:1,name:"药品"},{id:2,name:"项目"}],
446
+      options_patient:[{id:1,name:"是"},{id:2,name:"否"}],
447
+      options_2:[{id:1,name:"普通门诊"},{id:2,name:"门诊特殊病"}],
448
+      new_type:1,//新增类型
449
+      druglist:[],//药品列表
450
+      projectlist:[],//项目列表
451
+      id:"",//药品、项目、耗材
452
+      tmplist:[],//临时
453
+      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:"粒"},
454
+        {id:8,name:"片"},{id:9,name:"支"},{id:10,name:"μg"},{id:11,name:"iu"},{id:12,name:"包"},{id:13,name:"袋"},{id:14,name:"万"},
455
+        {id:15,name:"万iu"},{id:16,name:"丸"},{id:17,name:"盒"},{id:18,name:"瓶"},{id:19,name:"瓶(袋)"},{id:20,name:"次"}],
456
+      usage:[],//用法
457
+      frequency:[],//频率
458
+      frequency_type:"",//周期提醒
459
+      day_count:"",//周期提醒天
460
+      week_days:[],//周期提醒星期
461
+      tabhang:0,//tab的下标
462
+      hang:0,//行数
463
+
120 464
     }
121 465
   },
122
-  created(){
123
-
466
+  created() {
467
+    // console.log("this.$store.getters.treatment_mode",this.$store.getters.treatment_mode)
468
+    for (let key in this.$store.getters.treatment_mode) {
469
+      this.modeOptions[key] = this.$store.getters.treatment_mode[key]
470
+    }
471
+    // console.log("this.modeOptions",this.modeOptions)
472
+    this.getdrugconfigs();
124 473
   },
125
-  methods:{
126
-    handleTabsEdit(targetName, action) {
127
-      if (action === 'add') {
128
-        let newTabName = ++this.tabIndex + '';
129
-        this.editableTabs.push({
130
-          title: 'New Tab',
131
-          name: newTabName,
132
-          content: 'New Tab content'
133
-        });
134
-        this.editableTabsValue = newTabName;
135
-      }
136
-      if (action === 'remove') {
137
-        let tabs = this.editableTabs;
138
-        let activeName = this.editableTabsValue;
139
-        if (activeName === targetName) {
140
-          tabs.forEach((tab, index) => {
141
-            if (tab.name === targetName) {
142
-              let nextTab = tabs[index + 1] || tabs[index - 1];
143
-              if (nextTab) {
144
-                activeName = nextTab.name;
145
-              }
474
+  methods: {
475
+    save() {
476
+      this.$confirm(
477
+        "注:该操作将会把所选患者的XX透析模式中的新增XXX,请确定是否保存?",
478
+        "",
479
+        {
480
+          confirmButtonText: "确 定",
481
+          cancelButtonText: "取 消",
482
+          type: "warning",
483
+        }
484
+      ).then(() => {
485
+        if (this.multipleSelection.length == 0){
486
+          this.$message.error('没有选中有效信息')
487
+          return
488
+        }
489
+        let st = ""
490
+        for (let i = 0;i < this.multipleSelection.length;i++){
491
+          st = st + this.multipleSelection[i].id + ","
492
+        }
493
+        console.log("string",st)
494
+        let params = {
495
+          mode_id:this.modeOptions_value,
496
+          patient_id: st,
497
+          type:this.new_type,
498
+          replaced: this.id,
499
+        }
500
+        let data1 = {
501
+          "prescriptions": this.tableDatas
502
+        }
503
+        let data2 = {
504
+          "prescriptions": this.project
505
+        }
506
+        if (this.new_type == 1){
507
+          replacesavedrug(params,data1).then((res) =>{
508
+            if (res.data.state == 1){
509
+              this.$message.success('替换成功')
510
+              this.multipleSelection = []
511
+              this.druglist = []
512
+              this.projectlist = []
513
+            }else{
514
+              this.$message.error(res.data.msg)
146 515
             }
147
-          });
516
+          })
517
+        }else{
518
+          replacesaveproject(params,data2).then((res) =>{
519
+            if (res.data.state == 1){
520
+              this.$message.success('替换成功')
521
+              this.multipleSelection = []
522
+              this.druglist = []
523
+              this.projectlist = []
524
+            }else{
525
+              this.$message.error(res.data.msg)
526
+            }
527
+          })
148 528
         }
529
+      });
530
+    },
149 531
 
150
-        this.editableTabsValue = activeName;
151
-        this.editableTabs = tabs.filter(tab => tab.name !== targetName);
532
+    lili() {
533
+      console.log("this.multipleSelection",this.multipleSelection);
534
+      console.log("this.tableData",this.tableData)
535
+      // console.log("this.mode",this.modeOptions_value)
536
+      // console.log("this.projectlist2",this.projectlist2)
537
+      // console.log("patient_value",this.patient_value)
538
+    },
539
+    addopen(hang){
540
+      this.hang = hang
541
+      //清空
542
+      this.week_days = [];
543
+      this.day_count = "";
544
+      this.frequency_type = 1;
545
+      this.dialogVisible = true
546
+    },
547
+    changetype(){
548
+      console.log(">>>>>>>",this.new_type)
549
+      this.id = ""
550
+      this.tableData = []
551
+    },
552
+    changeid(item,index){
553
+      item.id = item.drug_name
554
+      var params = {
555
+        id:item.id
152 556
       }
557
+      getdrugsinformation(params).then((res) =>{
558
+        if (res.data.state == 1){
559
+          console.log("res??",res)
560
+          this.tableDatas[0].single_dose = res.data.data.list[0].single_dose;
561
+          this.tableDatas[0].single_dose_unit = res.data.data.list[0].single_dose_unit;
562
+          this.tableDatas[0].delivery_way = res.data.data.list[0].delivery_way;
563
+          this.tableDatas[0].execution_frequency = res.data.data.list[0].execution_frequency;
564
+          this.tableDatas[0].day = res.data.data.list[0].drug_day;
565
+          this.tableDatas[0].prescribing_number = res.data.data.list[0].prescribing_number;
566
+          this.tableDatas[0].prescribing_number_unit = res.data.data.list[0].prescribing_number_unit;
567
+          this.tableDatas[0].price = res.data.data.list[0].retail_price;
568
+          this.tableDatas[0].remark = res.data.data.list[0].remark;
569
+        }
570
+      })
153 571
     },
154
-    handleCurrentChange(){
155
-
572
+    handleSelectionChange(val) {
573
+      this.multipleSelection = val;
574
+    },
575
+    changeid2(item,index){
576
+      item.id = item.drug_name
577
+      var params = {
578
+        id:item.id
579
+      }
580
+      getdrugsinformation(params).then((res) =>{
581
+        if (res.data.state == 1){
582
+          console.log("res??",res)
583
+          this.project[0].single_dose = res.data.data.list[0].single_dose;
584
+          this.project[0].translate = res.data.data.list[0].translate;
585
+          this.project[0].delivery_way = res.data.data.list[0].delivery_way;
586
+          this.project[0].execution_frequency = res.data.data.list[0].execution_frequency;
587
+          this.project[0].day = res.data.data.list[0].day;
588
+          this.project[0].prescribing_number = res.data.data.list[0].prescribing_number;
589
+          this.project[0].unit = res.data.data.list[0].unit;
590
+          this.project[0].price = res.data.data.list[0].retail_price;
591
+          this.project[0].remark = res.data.data.list[0].remark;
592
+        }
593
+      })
594
+    },
595
+    //获取配置
596
+    getdrugconfigs(){
597
+      var params = {}
598
+      replaceconfig(params).then((res) =>{
599
+        if (res.data.state == 1){
600
+          this.druglist = res.data.data.list
601
+          this.projectlist = res.data.data.list2
602
+        }
603
+      })
604
+      getmodeconfigs(params).then((res) =>{
605
+        if (res.data.state == 1){
606
+          this.frequency = res.data.data.efs
607
+          this.usage = res.data.data.drugways
608
+        }
609
+      })
610
+    },
611
+    getUsername(){
612
+      var params = {
613
+        id: this.id,
614
+        mode: this.modeOptions_value
615
+      }
616
+      replacepeoplename(params).then((res) =>{
617
+        if (res.data.state == 1){
618
+          this.tableData = res.data.data.list
619
+        }
620
+      })
621
+    },
622
+    handleClose(done) {
623
+      this.$confirm('确认关闭?')
624
+        .then(_ => {
625
+          done();
626
+        })
627
+        .catch(_ => {});
156 628
     }
157
-  },
158
-
629
+  }
159 630
 
160 631
 }
161 632
 </script>
@@ -163,17 +634,29 @@ export default {
163 634
 
164 635
 
165 636
 <style lang="scss" scoped>
166
-
167
-.zone{
637
+.bannar_list {
638
+  margin-bottom: 10px;
639
+  display: flex;
640
+  justify-content: space-between;
641
+.banner_left {
642
+  width: 1000px;
643
+  display: flex;
644
+  justify-content: space-around;
645
+div {
646
+  white-space: nowrap;
647
+}
648
+}
649
+}
650
+.zone {
168 651
 //  margin-left: 30px;
169 652
 //  text-align: left;
170 653
   width: 70px;
171 654
   display: inline-block;
172
-  color:#606266;
655
+  color: #606266;
173 656
 }
174
-.disinfect{
657
+.disinfect {
175 658
   position: relative;
176
-.newButton{
659
+.newButton {
177 660
 // position: absolute;
178 661
 // right: 2%;
179 662
 // top:4px;
@@ -182,36 +665,36 @@ export default {
182 665
   margin-left: 90%;
183 666
 }
184 667
 }
185
-.disinfectOne{
668
+.disinfectOne {
186 669
   position: relative;
187
-.newButtonOne{
670
+.newButtonOne {
188 671
   position: absolute;
189 672
   right: 0;
190 673
   top: -10;
191 674
   z-index: 18;
192 675
 }
193 676
 }
194
-.but{
677
+.but {
195 678
   width: 200px;
196 679
   height: 50px;
197 680
 // border: solid 1px red;
198 681
   margin-left: 77%;
199 682
 }
200
-.clearn{
683
+.clearn {
201 684
   width: 460px;
202 685
   height: 50px;
203 686
 // border:solid 1px red;
204
-  margin-left:650px;
687
+  margin-left: 650px;
205 688
 }
206 689
 
207
-.zClass{
690
+.zClass {
208 691
   width: 200px;
209 692
   height: 200px;
210 693
 // border:solid 1px red;
211 694
   margin-left: 450px;
212 695
   margin-top: 200px;
213 696
 }
214
-.warn{
697
+.warn {
215 698
   color: red;
216 699
   font-size: 14px;
217 700
   width: 100%;
@@ -219,47 +702,44 @@ export default {
219 702
   margin-left: 96px;
220 703
 }
221 704
 
222
-.userbutton{
705
+.userbutton {
223 706
   margin-bottom: 10px;
224
-  margin-left: 82%
707
+  margin-left: 82%;
225 708
 }
226
-
227 709
 </style>
228 710
 <style lang="scss" >
229
-
230
-.a{
711
+.a {
231 712
   margin-bottom: 10px;
232 713
   margin-top: 6px;
233
-
234 714
 }
235 715
 
236
-.b{
237
-.el-button{
716
+.b {
717
+.el-button {
238 718
   margin-left: 90%;
239 719
   margin-bottom: 10px;
240 720
 }
241 721
 }
242 722
 
243
-.stoppage{
244
-.el-form-item__label{
245
-  width:190px;
723
+.stoppage {
724
+.el-form-item__label {
725
+  width: 190px;
246 726
 }
247 727
 }
248
-.st{
249
-.el-form-item__label{
250
-  width:-10px;
728
+.st {
729
+.el-form-item__label {
730
+  width: -10px;
251 731
 }
252 732
 }
253
-.main{
733
+.main {
254 734
   position: relative;
255
-.newButtonOne{
256
-  position:absolute;
735
+.newButtonOne {
736
+  position: absolute;
257 737
   right: 0;
258 738
   z-index: 2;
259 739
 }
260 740
 }
261 741
 
262
-.elbutton{
742
+.elbutton {
263 743
 // border: solid 1px red;
264 744
   height: 50px;
265 745
   width: 400px;
@@ -280,45 +760,53 @@ export default {
280 760
   overflow: hidden;
281 761
   padding-left: 4px;
282 762
   text-overflow: ellipsis;
283
-  transition: color .3s;
763
+  transition: color 0.3s;
284 764
   white-space: nowrap;
285 765
 }
286
-.el-main{
766
+.el-main {
287 767
   padding-top: 0px;
288 768
 }
289
-.newMain{
290
-.el-form-item__label{
769
+.newMain {
770
+.el-form-item__label {
291 771
   width: 104px;
292 772
 }
293 773
 }
294
-.newDisinfectOne{
295
-.el-input--prefix .el-input__inner{
296
-  padding-left: 15px
774
+.newDisinfectOne {
775
+.el-input--prefix .el-input__inner {
776
+  padding-left: 15px;
297 777
 }
298 778
 }
299
-.stoppage{
300
-.el-form-item__label{
779
+.stoppage {
780
+.el-form-item__label {
301 781
   width: 18%;
302 782
 }
303 783
 }
304
-.newItem{
305
-.el-form-item__label{
784
+.newItem {
785
+.el-form-item__label {
306 786
   width: 130px;
307 787
 }
308 788
 }
309
-.formItem{
310
-.el-form-item__label{
789
+.formItem {
790
+.el-form-item__label {
311 791
   width: 104px;
312 792
   line-height: 30px;
313 793
 }
314 794
 }
315
-.newname{
316
-.el-form-item__label{
795
+.newname {
796
+.el-form-item__label {
317 797
   width: 60px;
318 798
 }
319 799
 }
320
-::-webkit-scrollbar{
800
+::-webkit-scrollbar {
321 801
   height: 20px;
322 802
 }
323 803
 
804
+.el-button {
805
+  color: #fff;
806
+  background-color: #409eff;
807
+  border-color: #409eff;
808
+}
809
+.el-table td .cell {
810
+  padding: 0 10px;
811
+}
324 812
 </style>

+ 2 - 2
src/xt_pages/outpatientDoctorStation/prescriptionTemplate.vue Vedi File

@@ -3,8 +3,8 @@
3 3
         <div class="position">
4 4
             <bread-crumb :crumbs='crumbs'></bread-crumb>
5 5
             <el-button type="primary" @click="batchAdds">批量新增</el-button>
6
-            <el-button type="primary" @click="batchAdds">批量替换</el-button>
7
-            <el-button type="primary" @click="batchAdds">批量删除</el-button>
6
+            <el-button type="primary" @click="batchReplace">批量替换</el-button>
7
+            <el-button type="primary" @click="batchDeletes">批量删除</el-button>
8 8
             <el-button type="primary" @click="add">新增</el-button>
9 9
 
10 10
         </div>