浏览代码

Merge branch '20200710_pc_vue_new_branch' into 20200916_pc_vue_new_branch

csx 4 年前
父节点
当前提交
80dcde3ca1

+ 7 - 7
src/api/his/his.js 查看文件

34
 
34
 
35
 
35
 
36
 
36
 
37
-// export function createCaseHistory(params) {
38
-//   return request({
39
-//     url: "/api/doctorworkstation/casehistory/create",
40
-//     method: "post",
41
-//     params:params
42
-//   });
43
-// }
37
+export function getInitData(params) {
38
+  return request({
39
+    url: "/api/hisprescription/config",
40
+    method: "get",
41
+    params:params
42
+  });
43
+}
44
 
44
 
45
 
45
 
46
 // export function createCaseHistory(params) {
46
 // export function createCaseHistory(params) {

+ 503 - 384
src/xt_pages/outpatientDoctorStation/components/deskPrescription.vue 查看文件

1
 <template>
1
 <template>
2
-    <div style="height: calc(100% - 36px);display: flex;flex-direction: column;">
3
-        <div style="border-top:1px solid #e5e5e5;margin-top:5px;">
4
-            <div class="mainCell" style="margin-bottom:10px;float:right">
5
-                <el-button size="small" @click="open(1)" type="primary" style="margin-left:10px;">保存</el-button>
6
-                <el-button size="small" @click="open(2)" type="primary">打印</el-button>
7
-                <el-button size="small" @click="open(4)" type="primary">选择模板</el-button>
8
-                <el-button size="small" @click="open(5)" type="primary">存模板</el-button>
9
-            </div>
2
+  <div style="height: calc(100% - 36px);display: flex;flex-direction: column;">
3
+    <div style="border-top:1px solid #e5e5e5;margin-top:5px;">
4
+      <div class="mainCell" style="margin-bottom:10px;float:right">
5
+        <el-button size="small" @click="open(1)" type="primary" style="margin-left:10px;">保存</el-button>
6
+        <el-button size="small" @click="open(2)" type="primary">打印</el-button>
7
+        <el-button size="small" @click="open(4)" type="primary">选择模板</el-button>
8
+        <el-button size="small" @click="open(5)" type="primary">存模板</el-button>
9
+      </div>
10
+    </div>
11
+    <div class="backColor"></div>
12
+    <div class="mainCenter">
13
+      <div class="centerLeft">
14
+        <el-form :model="form" :rules="rules" ref="form" label-width="80px">
15
+          <el-form-item label="姓名:" prop="name">
16
+            <el-input v-model="patientInfo.name" placeholder=""></el-input>
17
+          </el-form-item>
18
+          <el-form-item label="证件号: " prop="name">
19
+            <el-input v-model="patientInfo.id_card_no" placeholder=""></el-input>
20
+          </el-form-item>
21
+          <el-form-item label="挂号类型: " prop="name">
22
+            <el-input v-model="hisPatientInfo.register_type" placeholder=""></el-input>
23
+          </el-form-item>
24
+          <el-form-item label="诊断:" prop="name">
25
+            <el-autocomplete
26
+              style="width:100%;"
27
+              class="inline-input"
28
+              v-model="state1"
29
+              :fetch-suggestions="querySearch"
30
+              placeholder="请输入内容"
31
+              @select="handleSelect"
32
+            ></el-autocomplete>
33
+          </el-form-item>
34
+          <el-form-item label="大病类别: " prop="name">
35
+            <el-input v-model="form.name" placeholder=""></el-input>
36
+          </el-form-item>
37
+          <el-form-item label="处方类型: " prop="name">
38
+            <el-select v-model="value" placeholder="请选择" style="width:100%;">
39
+              <el-option
40
+                v-for="item in options"
41
+                :key="item.value"
42
+                :label="item.label"
43
+                :value="item.value">
44
+              </el-option>
45
+            </el-select>
46
+          </el-form-item>
47
+        </el-form>
48
+        <div class="tabsBox">
49
+
50
+          <el-button type="text" class="addTab" @click="addCharges" icon="el-icon-circle-plus">附加收费</el-button>
51
+          <el-tabs class="preTabs" v-model="editableTabsValue" type="card" closable @tab-remove="removeTab"
52
+                   :before-leave="moreState" @tab-click="tabclickEvent">
53
+            <el-tab-pane
54
+              v-for="(item, index) in prescriptions"
55
+              :key="index"
56
+              :label="item.name"
57
+              :name="item.name"
58
+            >
59
+
60
+            </el-tab-pane>
61
+            <el-tab-pane name="more" closable><span slot="label"><i class="el-icon-plus" @click="addTab"></i></span>
62
+            </el-tab-pane>
63
+            <div class="RP">Rp</div>
64
+            <prescription-table ref="prescription_tables" :prescription="curPrescriptions" :preDrugs="preDrugs" :activeType="activeName"></prescription-table>
65
+          </el-tabs>
66
+
10
         </div>
67
         </div>
11
-        <div class="backColor"></div>
12
-        <div class="mainCenter">
13
-            <div class="centerLeft">
14
-                <el-form :model="form" :rules="rules" ref="form" label-width="80px">
15
-                    <el-form-item label="姓名:" prop="name">
16
-                        <el-input v-model="patientInfo.name" placeholder=""></el-input>
17
-                    </el-form-item>
18
-                    <el-form-item label="证件号: " prop="name">
19
-                        <el-input v-model="patientInfo.id_card_no" placeholder=""></el-input>
20
-                    </el-form-item>
21
-                    <el-form-item label="挂号类型: " prop="name">
22
-                        <el-input v-model="hisPatientInfo.register_type" placeholder=""></el-input>
23
-                    </el-form-item>
24
-                    <el-form-item label="诊断:" prop="name">
25
-                        <el-autocomplete
26
-                        style="width:100%;"
27
-                        class="inline-input"
28
-                        v-model="state1"
29
-                        :fetch-suggestions="querySearch"
30
-                        placeholder="请输入内容"
31
-                        @select="handleSelect"
32
-                        ></el-autocomplete>
33
-                    </el-form-item>
34
-                    <el-form-item label="大病类别: " prop="name">
35
-                        <el-input v-model="form.name" placeholder=""></el-input>
36
-                    </el-form-item>
37
-                    <el-form-item label="处方类型: " prop="name">
38
-                        <el-select v-model="value" placeholder="请选择" style="width:100%;">
39
-                            <el-option
40
-                            v-for="item in options"
41
-                            :key="item.value"
42
-                            :label="item.label"
43
-                            :value="item.value">
44
-                            </el-option>
45
-                        </el-select>
46
-                    </el-form-item>
47
-                </el-form>
48
-                <div class="tabsBox">
49
-
50
-                    <el-button type="text" class="addTab" @click="addCharges" icon="el-icon-circle-plus">附加收费</el-button>
51
-                    <el-tabs class="preTabs" v-model="editableTabsValue" type="card" closable @tab-remove="removeTab" :before-leave="moreState">
52
-                        <el-tab-pane
53
-                            v-for="(item, index) in prescriptions"
54
-                            :key="index"
55
-                            :label="item.name"
56
-                            :name="item.name"
57
-                        >
58
-                            <div class="RP">Rp</div>
59
-                            <prescription-table :prescription="item" :preDrugs="preDrugs" :activeType="activeName"></prescription-table>
60
-                        </el-tab-pane>
61
-                        <el-tab-pane name="more" closable><span slot="label"><i class="el-icon-plus" @click="addTab"></i></span></el-tab-pane>
62
-                    </el-tabs>
63
-                </div>
64
-                <div class="costBox">
65
-                    <span>医生:</span>
66
-                    <el-select style="margin-right:5px;" v-model="doctorValue" placeholder="">
67
-                        <el-option
68
-                        v-for="item in doctorOptions"
69
-                        :key="item.value"
70
-                        :label="item.label"
71
-                        :value="item.value">
72
-                        </el-option>
73
-                    </el-select>
74
-                    <span>科室:</span>
75
-                    <el-select style="margin-right:5px;" v-model="departmentValue" placeholder="">
76
-                        <el-option
77
-                        v-for="item in departmentOptions"
78
-                        :key="item.value"
79
-                        :label="item.label"
80
-                        :value="item.value">
81
-                        </el-option>
82
-                    </el-select>
83
-                    <span>总计:</span>
84
-                    <span style="color:red;">{{ total }}</span>元
85
-                </div>
86
-            </div>
87
-            <div class='centerRight'>
88
-                <div class="rightTab">
89
-                    <p :class="rightTab == 1 ? 'activeP' : ''" @click="clickTab(1)">药品</p>
90
-                    <p :class="rightTab == 2 ? 'activeP' : ''" @click="clickTab(2)">项目</p>
91
-                </div>
92
-                <template>
93
-                    <div style="margin-top:5px;">
94
-                        <el-input style="width:50%;" v-model="input" placeholder=""></el-input>
95
-                        <el-select style="float: right;width: 49%;" v-model="value" placeholder="">
96
-                            <el-option
97
-                            v-for="item in options"
98
-                            :key="item.value"
99
-                            :label="item.label"
100
-                            :value="item.value">
101
-                            </el-option>
102
-                        </el-select>
103
-                    </div>
104
-                    <div style="height:84%;overflow-y: auto;margin-bottom: 60px;">
105
-                        <el-tabs class="rightTabs" v-model="activeName">
106
-                            <el-tab-pane label="药品列表" name="1">
107
-                                <el-table :data="drugTableData" border @select='selectDrugs' style="width: 100%;" :row-style="{ color: '#303133' }" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}" highlight-current-row>
108
-                                    <el-table-column align="center" type="selection" width="40"></el-table-column>
109
-                                    <el-table-column align="center" prop="name" label="名称">
110
-                                        <template slot-scope="scope">{{ scope.row.name }}</template>
111
-                                    </el-table-column>
112
-                                    <el-table-column align="center" label="规格" width="60">
113
-                                        <template slot-scope="scope">{{ scope.row.specifications }}</template>
114
-                                    </el-table-column>
115
-                                    <el-table-column align="center" label="库存" width="60">
116
-                                        <template slot-scope="scope">{{ scope.row.stock }}</template>
117
-                                    </el-table-column>
118
-                                    <el-table-column align="center" label="单价" width="40">
119
-                                        <template slot-scope="scope">{{ scope.row.unitPrice }}</template>
120
-                                    </el-table-column>
121
-                                </el-table>
122
-                            </el-tab-pane>
123
-                            <el-tab-pane label="医嘱模板" name="2">
124
-                                <el-table :data="tableData" border style="width: 100%;" :row-style="{ color: '#303133' }" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}" highlight-current-row>
125
-                                    <el-table-column align="center" type="selection" width="40"></el-table-column>
126
-                                    <el-table-column align="center" prop="name" label="名称">
127
-                                        <template slot-scope="scope">{{ scope.row.date }}</template>
128
-                                    </el-table-column>
129
-                                    <el-table-column align="center" label="规格" width="60">
130
-                                        <template slot-scope="scope">33</template>
131
-                                    </el-table-column>
132
-                                    <el-table-column align="center" label="库存" width="60">
133
-                                        <template slot-scope="scope">22</template>
134
-                                    </el-table-column>
135
-                                    <el-table-column align="center" label="单价" width="40">
136
-                                        <template slot-scope="scope">12</template>
137
-                                    </el-table-column>
138
-                                </el-table>
139
-                            </el-tab-pane>
140
-                        </el-tabs>
141
-                    </div>
142
-                    <div class="comfirmBox">
143
-                        <div>
144
-                            <span>药品类型:</span>
145
-                            <el-select style="margin-right:5px;width:100px;" v-model="value" placeholder="">
146
-                                <el-option
147
-                                v-for="item in options"
148
-                                :key="item.value"
149
-                                :label="item.label"
150
-                                :value="item.value">
151
-                                </el-option>
152
-                            </el-select>
153
-                        </div>
154
-                        <el-button type="primary" size="small" @click="comfirm">确定添加</el-button>
155
-                    </div>
156
-                </template>
157
-            </div>
68
+        <div class="costBox">
69
+          <span>医生:</span>
70
+          <el-select style="margin-right:5px;" v-model="doctorValue" placeholder="">
71
+            <el-option
72
+              v-for="item in doctorOptions"
73
+              :key="item.value"
74
+              :label="item.label"
75
+              :value="item.value">
76
+            </el-option>
77
+          </el-select>
78
+          <span>科室:</span>
79
+          <el-select style="margin-right:5px;" v-model="departmentValue" placeholder="">
80
+            <el-option
81
+              v-for="item in departmentOptions"
82
+              :key="item.value"
83
+              :label="item.label"
84
+              :value="item.value">
85
+            </el-option>
86
+          </el-select>
87
+          <span>总计:</span>
88
+          <span style="color:red;">{{ total }}</span>元
158
         </div>
89
         </div>
159
-        <additionalCharges ref='additionalCharges'></additionalCharges>
160
-        <select-template ref='selectTemplate'></select-template>
161
-        <save-template ref='saveTemplate'></save-template>
90
+      </div>
91
+      <div class='centerRight'>
92
+        <div class="rightTab">
93
+          <p :class="rightTab == 1 ? 'activeP' : ''" @click="clickTab(1)">药品</p>
94
+          <p :class="rightTab == 2 ? 'activeP' : ''" @click="clickTab(2)">项目</p>
95
+        </div>
96
+        <template>
97
+          <div style="margin-top:5px;">
98
+            <el-input style="width:50%;" v-model="input" placeholder=""></el-input>
99
+            <el-select style="float: right;width: 49%;" v-model="value" placeholder="">
100
+              <el-option
101
+                v-for="item in options"
102
+                :key="item.value"
103
+                :label="item.label"
104
+                :value="item.value">
105
+              </el-option>
106
+            </el-select>
107
+          </div>
108
+          <div style="height:84%;overflow-y: auto;margin-bottom: 60px;">
109
+            <el-tabs class="rightTabs" v-model="activeName">
110
+              <el-tab-pane label="药品列表" name="1">
111
+                <el-table :data="drugs" border @select='selectDrugs' style="width: 100%;"
112
+                          :row-style="{ color: '#303133' }"
113
+                          :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
114
+                          highlight-current-row>
115
+                  <el-table-column align="center" type="selection" width="40"></el-table-column>
116
+                  <el-table-column align="center" prop="name" label="名称">
117
+                    <template slot-scope="scope">{{ scope.row.drug_name }}</template>
118
+                  </el-table-column>
119
+                  <el-table-column align="center" label="规格" width="60">
120
+                    <template slot-scope="scope">{{ scope.row.drug_spec }}</template>
121
+                  </el-table-column>
122
+                  <el-table-column align="center" label="单价" width="40">
123
+                    <template slot-scope="scope">{{ scope.row.retail_price }}</template>
124
+                  </el-table-column>
125
+                </el-table>
126
+              </el-tab-pane>
127
+              <el-tab-pane label="医嘱模板" name="2">
128
+                <el-table :data="advices_template" border style="width: 100%;" :row-style="{ color: '#303133' }"
129
+                          :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
130
+                          highlight-current-row>
131
+                  <el-table-column align="center" type="selection" width="40"></el-table-column>
132
+                  <el-table-column align="center" prop="name" label="名称">
133
+                    <template slot-scope="scope">{{}}</template>
134
+                  </el-table-column>
135
+                  <el-table-column align="center" label="规格" width="60">
136
+                    <template slot-scope="scope">33</template>
137
+                  </el-table-column>
138
+                  <el-table-column align="center" label="库存" width="60">
139
+                    <template slot-scope="scope">22</template>
140
+                  </el-table-column>
141
+                  <el-table-column align="center" label="单价" width="40">
142
+                    <template slot-scope="scope">12</template>
143
+                  </el-table-column>
144
+                </el-table>
145
+              </el-tab-pane>
146
+            </el-tabs>
147
+          </div>
148
+          <div class="comfirmBox">
149
+            <div>
150
+              <span>药品类型:</span>
151
+              <el-select style="margin-right:5px;width:100px;" v-model="value" placeholder="" @change="changeKind">
152
+                <el-option
153
+                  label="全部"
154
+                  value="0">
155
+                </el-option>
156
+                <el-option
157
+                  v-for="item,index in getDictionaryDataConfig('system','drug_type')"
158
+                  :key="index"
159
+                  :label="item.name"
160
+                  :value="item.id">
161
+                </el-option>
162
+              </el-select>
163
+            </div>
164
+            <el-button type="primary" size="small" @click="comfirm">确定添加</el-button>
165
+          </div>
166
+        </template>
167
+      </div>
162
     </div>
168
     </div>
169
+    <additionalCharges ref='additionalCharges'></additionalCharges>
170
+    <select-template ref='selectTemplate'></select-template>
171
+    <save-template ref='saveTemplate'></save-template>
172
+  </div>
163
 </template>
173
 </template>
164
 
174
 
165
 
175
 
166
 <script>
176
 <script>
167
-import prescriptionTable from './prescriptionTable'
168
-import selectTemplate from './selectTemplate'
169
-import saveTemplate from './saveTemplate'
170
-import additionalCharges from './additionalCharges'
171
-import { getPatientInfo, getSchedulePatientList } from '@/api/his/his'
172
-
173
-export default {
174
-    props:{
175
-        patientInfo:Object,
176
-        hisPatientInfo:Object,
177
-        prescriptions:Array,
177
+  import prescriptionTable from './prescriptionTable'
178
+  import selectTemplate from './selectTemplate'
179
+  import saveTemplate from './saveTemplate'
180
+  import additionalCharges from './additionalCharges'
181
+  import { getPatientInfo, getSchedulePatientList, getInitData } from '@/api/his/his'
182
+  import { getDictionaryDataConfig} from "@/utils/data";
183
+
184
+  export default {
185
+    props: {
186
+      patientInfo: Object,
187
+      hisPatientInfo: Object,
188
+      prescriptions: Array
178
     },
189
     },
179
-    components:{
180
-        selectTemplate,
181
-        saveTemplate,
182
-        prescriptionTable,
183
-        additionalCharges
190
+    components: {
191
+      selectTemplate,
192
+      saveTemplate,
193
+      prescriptionTable,
194
+      additionalCharges
184
     },
195
     },
185
-    data(){
186
-        return{
187
-            form:{
188
-                name:''
189
-            },
190
-            editableTabsValue: '1',
191
-            editableTabs: [{
192
-            title: '处方1',
193
-            name: '1',
194
-            }],
195
-            tabIndex: 1,
196
-
197
-            rightTab:1,
198
-            activeName:'1',
199
-
200
-            drugTableData:[],
201
-            preDrugs:[],
202
-            curDrugs:[],
203
-            doctorOptions:[],
204
-            doctorValue:'',
205
-            departmentOptions:[],
206
-            departmentValue:'',
207
-            total:0
208
-        }
196
+    data() {
197
+      return {
198
+        value:"",
199
+        form: {
200
+          name: ''
201
+        },
202
+        drugs:[],
203
+        allDrugs:[],
204
+        advices_template:[],
205
+
206
+        editableTabsValue: '处方1',
207
+        editableTabs: [{
208
+          title: '处方1',
209
+          name: '1'
210
+        }],
211
+        tabIndex: 1,
212
+        currenet_inedx:0,
213
+        rightTab: 1,
214
+        activeName: '1',
215
+        curPrescriptions: this.prescriptions[0],
216
+        drugTableData: [],
217
+        preDrugs: [],
218
+        curDrugs: [],
219
+        doctorOptions: [],
220
+        doctorValue: '',
221
+        departmentOptions: [],
222
+        departmentValue: '',
223
+        total: 0
224
+      }
209
     },
225
     },
210
-    methods:{
211
-        moreState(tab, event){
212
-          if(tab == 'more'){
213
-            return false;
226
+    methods: {
227
+      changeKind(val){
228
+        this.drugs = []
229
+
230
+        if(val == 0){
231
+          this.drugs = this.allDrugs
232
+        }else{
233
+          for (let i = 0; i < this.allDrugs.length; i++){
234
+            if (this.allDrugs[i].drug_type == val){
235
+              this.drugs.push(this.allDrugs[i])
236
+            }
214
           }
237
           }
215
-        },
216
-        open(index){
217
-            if(index == 1){
218
-                localStorage.setItem("drugs",JSON.stringify(this.preDrugs));
219
-                this.$message({message: '保存成功',type: 'success'});
220
-            }else if(index == 2){
221
-                this.$router.push('/outpatientDoctorStation/print')
222
-            }else if(index == 4){
223
-                this.$refs.selectTemplate.show()
224
-            }else if(index == 5){
225
-                this.$refs.saveTemplate.show()
238
+        }
239
+      },
240
+      getDictionaryDataConfig(module, filed_name) {
241
+        return getDictionaryDataConfig(module, filed_name)
242
+
243
+      },
244
+      getInitData(){
245
+        getInitData().then(response => {
246
+          if (response.data.state == 0) {
247
+            this.$message.error(response.data.msg)
248
+            return false
249
+          } else {
250
+            this.drugs = response.data.data.drugs
251
+            this.allDrugs = response.data.data.drugs
252
+            this.advices_template = response.data.data.advices_template
253
+          }
254
+        })
255
+
256
+      },
257
+      tabclickEvent(val){
258
+        console.log(val)
259
+        for (let i= 0; i<this.prescriptions.length; i++){
260
+          console.log(this.prescriptions[i].name)
261
+            if(this.prescriptions[i].name == val.name){
262
+              this.curPrescriptions = this.prescriptions[i]
226
             }
263
             }
264
+        }
265
+      },
266
+      setData(data){
267
+        this.prescriptions = data
268
+        console.log(this.$refs)
269
+        this.$nextTick(() => {
270
+         this.$refs.prescription_tables.setNewData(this.prescriptions[0])
271
+        });
272
+      },
273
+      moreState(tab, event) {
274
+        if (tab == 'more') {
275
+          return false
276
+        }
277
+      },
278
+      open(index) {
279
+        if (index == 1) {
280
+          localStorage.setItem('drugs', JSON.stringify(this.preDrugs))
281
+          this.$message({ message: '保存成功', type: 'success' })
282
+        } else if (index == 2) {
283
+          this.$router.push('/outpatientDoctorStation/print')
284
+        } else if (index == 4) {
285
+          this.$refs.selectTemplate.show()
286
+        } else if (index == 5) {
287
+          this.$refs.saveTemplate.show()
288
+        }
227
 
289
 
228
-        },
229
-        addTab(targetName) {
230
-            let newTabName = ++this.tabIndex + '';
231
-            this.prescriptions.push({
232
-                name: newTabName,
233
-                advice:[],
234
-                project:[],
235
-
236
-            });
237
-            this.editableTabsValue = newTabName;
238
-        },
239
-        removeTab(targetName) {
240
-            let tabs = this.prescriptions;
241
-            let activeName = this.editableTabsValue;
242
-            if (activeName === targetName) {
243
-            tabs.forEach((tab, index) => {
244
-                if (tab.name === targetName) {
245
-                let nextTab = tabs[index + 1] || tabs[index - 1];
246
-                if (nextTab) {
247
-                    activeName = nextTab.name;
248
-                }
249
-                }
250
-            });
290
+      },
291
+      addTab(targetName) {
292
+        ++this.tabIndex
293
+        let newTabName = '处方' + this.tabIndex
294
+        this.prescriptions.push({
295
+          name: newTabName,
296
+          advices: [],
297
+          projects: []
298
+
299
+        })
300
+        this.editableTabsValue = newTabName
301
+        this.curPrescriptions = this.prescriptions[this.prescriptions.length-1]
302
+      },
303
+      removeTab(targetName) {
304
+
305
+        let tabs = this.prescriptions
306
+        let activeName = this.editableTabsValue
307
+        if (activeName === targetName) {
308
+          tabs.forEach((tab, index) => {
309
+            if (tab.name === targetName) {
310
+              let nextTab = tabs[index + 1] || tabs[index - 1]
311
+              if (nextTab) {
312
+                activeName = nextTab.name
313
+              }
251
             }
314
             }
315
+          })
316
+        }
317
+
318
+        this.editableTabsValue = activeName
319
+        this.prescriptions = tabs.filter(tab => tab.name !== targetName)
320
+        console.log(this.prescriptions)
321
+      },
322
+      clickTab(index) {
323
+        console.log(index)
324
+        this.rightTab = index
325
+        // this.curPrescriptions = this.prescriptions[index]
326
+        this.$nextTick(() => {
327
+          this.$refs.prescription_tables.setNewData(this.prescriptions[this.prescriptions.length-1])
328
+        });
252
 
329
 
253
-            this.editableTabsValue = activeName;
254
-            this.prescriptions = tabs.filter(tab => tab.name !== targetName);
255
-        },
256
-        clickTab(index){
257
-            this.rightTab = index
258
-        },
259
-        addCharges(){
260
-            this.$refs.additionalCharges.show()
261
-        },
262
-        selectDrugs(selection, row){
263
-            this.curDrugs = selection
264
-        },
265
-        comfirm(){
266
-            this.preDrugs = this.curDrugs
267
-            this.preDrugs.map(item => {
268
-                this.total += item.unitPrice
269
-            })
270
 
330
 
331
+      },
332
+      addCharges() {
333
+        this.$refs.additionalCharges.show()
334
+      },
335
+      selectDrugs(selection, row) {
336
+        this.curDrugs = selection
337
+      },
338
+      comfirm() {
339
+        this.preDrugs = this.curDrugs
340
+        console.log(this.editableTabsValue)
341
+        for (let i = 0; i < this.prescriptions.length; i++){
342
+          if(this.prescriptions[i].name == this.editableTabsValue){
343
+            this.prescriptions[i].advices = this.preDrugs
344
+            this.curPrescriptions = this.prescriptions[i]
345
+            // this.$refs.prescription_tables.setNewData(this.prescriptions[i])
346
+          }
271
         }
347
         }
348
+
349
+
350
+        // console.log(this.prescriptions)
351
+      }
352
+    },created(){
353
+      this.getInitData()
272
     }
354
     }
273
-}
355
+  }
274
 </script>
356
 </script>
275
 
357
 
276
 <style lang="scss" scoped>
358
 <style lang="scss" scoped>
277
-.new-main-contain{
359
+  .new-main-contain {
278
     height: 100%;
360
     height: 100%;
279
     display: flex;
361
     display: flex;
280
     flex-direction: column;
362
     flex-direction: column;
281
-}
282
-.app-container{
283
-    height:100%;
284
-}
285
-.mainCell{
286
-    height:36px;
363
+  }
364
+
365
+  .app-container {
366
+    height: 100%;
367
+  }
368
+
369
+  .mainCell {
370
+    height: 36px;
287
     display: flex;
371
     display: flex;
288
     align-items: center;
372
     align-items: center;
289
-}
290
-.mainLeft{
291
-    width:200px;
373
+  }
374
+
375
+  .mainLeft {
376
+    width: 200px;
292
     height: 100%;
377
     height: 100%;
293
     display: flex;
378
     display: flex;
294
     flex-direction: column;
379
     flex-direction: column;
295
-    .el-radio{
296
-        margin-right:5px;
297
-    }
298
 
380
 
299
-}
300
-.mainRight{
301
-    margin-left:20px;
302
-    flex:1;
381
+  .el-radio {
382
+    margin-right: 5px;
383
+  }
384
+
385
+  }
386
+  .mainRight {
387
+    margin-left: 20px;
388
+    flex: 1;
303
     height: 100%;
389
     height: 100%;
304
     display: flex;
390
     display: flex;
305
     flex-direction: column;
391
     flex-direction: column;
306
-    .cellSpan{
307
-        min-width: 80px;
308
-        display: inline-block;
309
-        margin-right: 10px;
310
-    }
311
-}
312
-.mainCenter{
392
+
393
+  .cellSpan {
394
+    min-width: 80px;
395
+    display: inline-block;
396
+    margin-right: 10px;
397
+  }
398
+
399
+  }
400
+  .mainCenter {
313
     display: flex;
401
     display: flex;
314
-    flex:1;
315
-}
316
-.centerLeft{
402
+    flex: 1;
403
+  }
404
+
405
+  .centerLeft {
317
     flex: 1;
406
     flex: 1;
318
     display: flex;
407
     display: flex;
319
     flex-direction: column;
408
     flex-direction: column;
320
     position: relative;
409
     position: relative;
321
-    .el-form-item{
322
-        width:32%;
323
-        margin-right: 1%;
324
-        float: left;
325
-    }
326
-    .el-form-item__label{
327
-        text-align: left;
328
-    }
329
-}
330
-.backColor{
410
+
411
+  .el-form-item {
412
+    width: 32%;
413
+    margin-right: 1%;
414
+    float: left;
415
+  }
416
+
417
+  .el-form-item__label {
418
+    text-align: left;
419
+  }
420
+
421
+  }
422
+  .backColor {
331
     background: #f6f8f9;
423
     background: #f6f8f9;
332
     height: 5px;
424
     height: 5px;
333
     margin-bottom: 5px;
425
     margin-bottom: 5px;
334
-}
335
-.RP{
336
-    color:#409EFF;
426
+  }
427
+
428
+  .RP {
429
+    color: #409EFF;
337
     font-size: 20px;
430
     font-size: 20px;
338
     margin-bottom: 5px;
431
     margin-bottom: 5px;
339
-}
340
-.tabsBox{
432
+  }
433
+
434
+  .tabsBox {
341
     position: relative;
435
     position: relative;
342
     height: 76%;
436
     height: 76%;
343
     overflow-y: auto;
437
     overflow-y: auto;
344
     margin-bottom: 60px;
438
     margin-bottom: 60px;
345
-    .el-tabs__item{
346
-        padding: 0 10px;
347
-    }
348
-}
349
-.preTabs{
350
-    height:100%;
351
-}
352
-.costBox{
353
-    width:100%;
354
-    height:60px;
355
-    background:#fff;
439
+
440
+  .el-tabs__item {
441
+    padding: 0 10px;
442
+  }
443
+
444
+  }
445
+  .preTabs {
446
+    height: 100%;
447
+  }
448
+
449
+  .costBox {
450
+    width: 100%;
451
+    height: 60px;
452
+    background: #fff;
356
     position: absolute;
453
     position: absolute;
357
-    bottom:0;
454
+    bottom: 0;
358
     display: flex;
455
     display: flex;
359
     align-items: center;
456
     align-items: center;
360
-}
361
-.addTab{
457
+  }
458
+
459
+  .addTab {
362
     position: absolute;
460
     position: absolute;
363
     right: 0;
461
     right: 0;
364
     top: 6px;
462
     top: 6px;
365
     z-index: 20;
463
     z-index: 20;
366
-}
367
-.centerRight{
464
+  }
465
+
466
+  .centerRight {
368
     width: 300px;
467
     width: 300px;
369
     margin-left: 5px;
468
     margin-left: 5px;
370
     display: flex;
469
     display: flex;
371
     flex-direction: column;
470
     flex-direction: column;
372
     position: relative;
471
     position: relative;
373
-}
374
-.rightTab{
472
+  }
473
+
474
+  .rightTab {
375
     height: 40px;
475
     height: 40px;
376
     width: 100%;
476
     width: 100%;
377
     border: 1px solid #d2d2d2;
477
     border: 1px solid #d2d2d2;
378
     box-sizing: border-box;
478
     box-sizing: border-box;
379
 
479
 
380
-    p{
381
-        width: 50%;
382
-        height: 40px;
383
-        line-height: 40px;
384
-        text-align: center;
385
-        background: #eee;
386
-        float: left;
387
-    }
388
-    >p:last-child{
389
-      border-left: 1px solid #d2d2d2;
390
-      float: right;
391
-    }
392
-    .activeP{
393
-        background: #409EFF;
394
-        color:#fff;
395
-    }
396
-}
397
-.comfirmBox{
398
-    width:100%;
399
-    height:60px;
400
-    background:#fff;
480
+  p {
481
+    width: 50%;
482
+    height: 40px;
483
+    line-height: 40px;
484
+    text-align: center;
485
+    background: #eee;
486
+    float: left;
487
+  }
488
+
489
+  > p:last-child {
490
+    border-left: 1px solid #d2d2d2;
491
+    float: right;
492
+  }
493
+
494
+  .activeP {
495
+    background: #409EFF;
496
+    color: #fff;
497
+  }
498
+
499
+  }
500
+  .comfirmBox {
501
+    width: 100%;
502
+    height: 60px;
503
+    background: #fff;
401
     position: absolute;
504
     position: absolute;
402
-    bottom:0;
505
+    bottom: 0;
403
     display: flex;
506
     display: flex;
404
     align-items: center;
507
     align-items: center;
405
     justify-content: space-between;
508
     justify-content: space-between;
406
-}
509
+  }
407
 </style>
510
 </style>
408
 
511
 
409
 <style lang="scss">
512
 <style lang="scss">
410
-.centerLeft{
411
-    .el-form-item__label{
412
-        text-align: left;
413
-    }
414
-}
415
-.tabsBox{
416
-    .el-tabs__item{
417
-        padding: 0 10px;
418
-    }
419
-    .el-tabs--bottom .el-tabs--left>.el-tabs__header .el-tabs__item:nth-child(2), .el-tabs--bottom .el-tabs--right>.el-tabs__header .el-tabs__item:nth-child(2), .el-tabs--bottom.el-tabs--border-card>.el-tabs__header .el-tabs__item:nth-child(2), .el-tabs--bottom.el-tabs--card>.el-tabs__header .el-tabs__item:nth-child(2), .el-tabs--top .el-tabs--left>.el-tabs__header .el-tabs__item:nth-child(2), .el-tabs--top .el-tabs--right>.el-tabs__header .el-tabs__item:nth-child(2), .el-tabs--top.el-tabs--border-card>.el-tabs__header .el-tabs__item:nth-child(2), .el-tabs--top.el-tabs--card>.el-tabs__header .el-tabs__item:nth-child(2){
420
-        padding: 0 10px;
421
-    }
422
-    .el-tabs--bottom .el-tabs--left>.el-tabs__header .el-tabs__item:last-child, .el-tabs--bottom .el-tabs--right>.el-tabs__header .el-tabs__item:last-child, .el-tabs--bottom.el-tabs--border-card>.el-tabs__header .el-tabs__item:last-child, .el-tabs--bottom.el-tabs--card>.el-tabs__header .el-tabs__item:last-child, .el-tabs--top .el-tabs--left>.el-tabs__header .el-tabs__item:last-child, .el-tabs--top .el-tabs--right>.el-tabs__header .el-tabs__item:last-child, .el-tabs--top.el-tabs--border-card>.el-tabs__header .el-tabs__item:last-child, .el-tabs--top.el-tabs--card>.el-tabs__header .el-tabs__item:last-child{
423
-        padding: 0 10px;
424
-    }
425
-    .el-tabs--card>.el-tabs__header .el-tabs__item.is-active.is-closable{
426
-        padding: 0 10px;
427
-    }
428
-}
429
-.centerRight{
430
-    .el-tabs__nav-scroll{
431
-        display: flex;
432
-    }
433
-    .el-tabs__nav{
434
-        margin: 0 auto;
435
-    }
436
-    .el-table th .cell, .el-table td .cell{
437
-        padding: 0 2px;
438
-    }
439
-}
440
-.preTabs{
441
-    // .el-tabs__content{
442
-    //     height:69%;
443
-    //     overflow-y: auto;
444
-    // }
445
-}
446
-.rightTabs{
513
+  .centerLeft {
514
+
515
+  .el-form-item__label {
516
+    text-align: left;
517
+  }
518
+
519
+  }
520
+  .tabsBox {
521
+
522
+  .el-tabs__item {
523
+    padding: 0 10px;
524
+  }
525
+
526
+  .el-tabs--bottom .el-tabs--left > .el-tabs__header .el-tabs__item:nth-child(2), .el-tabs--bottom .el-tabs--right > .el-tabs__header .el-tabs__item:nth-child(2), .el-tabs--bottom.el-tabs--border-card > .el-tabs__header .el-tabs__item:nth-child(2), .el-tabs--bottom.el-tabs--card > .el-tabs__header .el-tabs__item:nth-child(2), .el-tabs--top .el-tabs--left > .el-tabs__header .el-tabs__item:nth-child(2), .el-tabs--top .el-tabs--right > .el-tabs__header .el-tabs__item:nth-child(2), .el-tabs--top.el-tabs--border-card > .el-tabs__header .el-tabs__item:nth-child(2), .el-tabs--top.el-tabs--card > .el-tabs__header .el-tabs__item:nth-child(2) {
527
+    padding: 0 10px;
528
+  }
529
+
530
+  .el-tabs--bottom .el-tabs--left > .el-tabs__header .el-tabs__item:last-child, .el-tabs--bottom .el-tabs--right > .el-tabs__header .el-tabs__item:last-child, .el-tabs--bottom.el-tabs--border-card > .el-tabs__header .el-tabs__item:last-child, .el-tabs--bottom.el-tabs--card > .el-tabs__header .el-tabs__item:last-child, .el-tabs--top .el-tabs--left > .el-tabs__header .el-tabs__item:last-child, .el-tabs--top .el-tabs--right > .el-tabs__header .el-tabs__item:last-child, .el-tabs--top.el-tabs--border-card > .el-tabs__header .el-tabs__item:last-child, .el-tabs--top.el-tabs--card > .el-tabs__header .el-tabs__item:last-child {
531
+    padding: 0 10px;
532
+  }
533
+
534
+  .el-tabs--card > .el-tabs__header .el-tabs__item.is-active.is-closable {
535
+    padding: 0 10px;
536
+  }
537
+
538
+  }
539
+  .centerRight {
540
+
541
+  .el-tabs__nav-scroll {
542
+    display: flex;
543
+  }
544
+
545
+  .el-tabs__nav {
546
+    margin: 0 auto;
547
+  }
548
+
549
+  .el-table th .cell, .el-table td .cell {
550
+    padding: 0 2px;
551
+  }
552
+
553
+  }
554
+  .preTabs {
555
+
556
+  .el-tabs__content {
557
+
558
+  }
559
+
560
+  }
561
+  .rightTabs {
447
     height: 100%;
562
     height: 100%;
448
-    // .el-tabs__content{
449
-    //     height:72%;
450
-    //     overflow-y: auto;
451
-    // }
452
-}
453
-#tab-more{
454
-    .el-icon-close{
455
-        display: none;
456
-    }
457
-}
563
+
564
+
565
+  .el-tabs__content {
566
+
567
+  }
568
+
569
+  }
570
+  #tab-more {
571
+
572
+  .el-icon-close {
573
+    display: none;
574
+  }
575
+
576
+  }
458
 </style>
577
 </style>

+ 23 - 5
src/xt_pages/outpatientDoctorStation/components/prescriptionTable.vue 查看文件

1
 <template>
1
 <template>
2
   <div class="prescriptionTable">
2
   <div class="prescriptionTable">
3
-    <el-table v-if="activeType  == '1'" :data="prescription.advice" border style="width: 98%;" :row-style="{ color: '#303133' }"
3
+    <div>{{prescription.name}}</div>
4
+    <el-table v-if="activeType  == '1'" :data="prescription.advices" border style="width: 98%;" :row-style="{ color: '#303133' }"
4
               :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}" highlight-current-row>
5
               :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}" highlight-current-row>
5
       <el-table-column align="center" type="selection" width="40"></el-table-column>
6
       <el-table-column align="center" type="selection" width="40"></el-table-column>
6
       <el-table-column align="center" type="index" width="40" label="序号"></el-table-column>
7
       <el-table-column align="center" type="index" width="40" label="序号"></el-table-column>
7
       <el-table-column align="center" prop="name" label="名称">
8
       <el-table-column align="center" prop="name" label="名称">
8
-        <template slot-scope="scope">{{ scope.row.name }}</template>
9
+        <template slot-scope="scope">{{ scope.row.drug_name }}</template>
9
       </el-table-column>
10
       </el-table-column>
10
 
11
 
11
       <el-table-column align="center" prop="name" width="50" :label="'单次\n用量'">
12
       <el-table-column align="center" prop="name" width="50" :label="'单次\n用量'">
12
         <template slot-scope="scope">
13
         <template slot-scope="scope">
13
-          <el-input v-model="input" placeholder=""></el-input>
14
+          <!--<el-input v-model="input" placeholder=""></el-input>-->
15
+          <!--<el-input  v-model="scope.row.single_dose"></el-input>-->
14
         </template>
16
         </template>
15
       </el-table-column>
17
       </el-table-column>
16
       <el-table-column align="center" prop="name" width="50" label="用法">
18
       <el-table-column align="center" prop="name" width="50" label="用法">
189
     props: {
191
     props: {
190
       preDrugs: Array,
192
       preDrugs: Array,
191
       activeType: String,
193
       activeType: String,
192
-      prescription:Object,
194
+      prescription:{
195
+        type:Object,
196
+        default: function () {
197
+          return {
198
+            name:"",
199
+            advices:[],
200
+            projects:[],
201
+          };
202
+        }
203
+
204
+      },
193
     },
205
     },
194
     data() {
206
     data() {
195
       return {
207
       return {
208
+        advices:[],
196
         tableData: [],
209
         tableData: [],
197
         newoptions: [{
210
         newoptions: [{
198
           value: '1',
211
           value: '1',
213
         value: '1',
226
         value: '1',
214
         input: 1
227
         input: 1
215
       }
228
       }
216
-    }
229
+    },methods:{
230
+      setNewData:function(data){
231
+
232
+        // this.prescription.advices = data.advices
233
+      }
234
+    },
217
   }
235
   }
218
 </script>
236
 </script>
219
 
237
 

+ 54 - 36
src/xt_pages/outpatientDoctorStation/doctorDesk.vue 查看文件

42
             <el-radio-button label="病历"></el-radio-button>
42
             <el-radio-button label="病历"></el-radio-button>
43
           </el-radio-group>
43
           </el-radio-group>
44
         </div>
44
         </div>
45
-        <desk-prescription :prescriptions="prescriptions" :patientInfo="patientInfo" :hisPatientInfo="hisPatientInfo" v-if="titleType == '处方'" style="flex:1;"></desk-prescription>
46
-        <desk-record :record_date="record_date" :case_history="case_history" :patientInfo="patientInfo" :hisPatientInfo="hisPatientInfo"  v-if="titleType == '病历'"></desk-record>
45
+        <desk-prescription ref="prescriptions"  :prescriptions="prescriptions" :patientInfo="patientInfo" :hisPatientInfo="hisPatientInfo"
46
+                           v-if="titleType == '处方'" style="flex:1;"></desk-prescription>
47
+        <desk-record :record_date="record_date" :case_history="case_history" :patientInfo="patientInfo"
48
+                     :hisPatientInfo="hisPatientInfo" v-if="titleType == '病历'"></desk-record>
47
       </div>
49
       </div>
48
 
50
 
49
     </div>
51
     </div>
56
   import deskRecord from './components/deskRecord'
58
   import deskRecord from './components/deskRecord'
57
   import { getPatientInfo, getSchedulePatientList } from '@/api/his/his'
59
   import { getPatientInfo, getSchedulePatientList } from '@/api/his/his'
58
 
60
 
59
-  import {
60
-    uParseTime
61
-  } from "@/utils/tools";
61
+  import { uParseTime } from '@/utils/tools'
62
+
62
   export default {
63
   export default {
63
     components: {
64
     components: {
64
       BreadCrumb,
65
       BreadCrumb,
67
     },
68
     },
68
     data() {
69
     data() {
69
       return {
70
       return {
70
-        prescriptions:[
71
+        prescriptions: [
71
           {
72
           {
72
-            name:"处方1",
73
-            advice:[],
74
-            project:[],
73
+            name: '处方1',
74
+            advice: [],
75
+            project: []
75
           }
76
           }
76
         ],
77
         ],
77
         search_input: '',
78
         search_input: '',
87
         patientTableData: [{}],
88
         patientTableData: [{}],
88
         patientInfo: {},
89
         patientInfo: {},
89
         hisPatientInfo: {},
90
         hisPatientInfo: {},
90
-        case_history:{},
91
+        case_history: {}
91
       }
92
       }
92
     },
93
     },
93
     methods: {
94
     methods: {
94
-      changeTab(val){
95
-
96
-
95
+      changeTab(val) {
97
 
96
 
98
       },
97
       },
99
       searchAction() {
98
       searchAction() {
144
             this.patientInfo = response.data.data.xt_info
143
             this.patientInfo = response.data.data.xt_info
145
             this.hisPatientInfo = response.data.data.his_info
144
             this.hisPatientInfo = response.data.data.his_info
146
             this.case_history = response.data.data.case_history
145
             this.case_history = response.data.data.case_history
147
-            this.patientInfo.birth = uParseTime(this.patientInfo.birthday, "{y}-{m}-{d}");
148
-            if(this.case_history.temperature <= 0){
149
-              this.case_history.temperature = ""
146
+            this.patientInfo.birth = uParseTime(this.patientInfo.birthday, '{y}-{m}-{d}')
147
+            if (this.case_history.temperature <= 0) {
148
+              this.case_history.temperature = ''
150
             }
149
             }
151
-            if(this.case_history.blood_sugar <= 0){
152
-              this.case_history.blood_sugar = ""
150
+            if (this.case_history.blood_sugar <= 0) {
151
+              this.case_history.blood_sugar = ''
153
             }
152
             }
154
-            if(this.case_history.pulse <= 0){
155
-              this.case_history.pulse = ""
153
+            if (this.case_history.pulse <= 0) {
154
+              this.case_history.pulse = ''
156
             }
155
             }
157
-            if(this.case_history.sbp <= 0){
158
-              this.case_history.sbp = ""
156
+            if (this.case_history.sbp <= 0) {
157
+              this.case_history.sbp = ''
159
             }
158
             }
160
-            if(this.case_history.dbp <= 0){
161
-              this.case_history.dbp = ""
159
+            if (this.case_history.dbp <= 0) {
160
+              this.case_history.dbp = ''
162
             }
161
             }
163
-            if(this.case_history.height <= 0){
164
-              this.case_history.height = ""
162
+            if (this.case_history.height <= 0) {
163
+              this.case_history.height = ''
165
             }
164
             }
166
-            if(this.case_history.blood_fat <= 0){
167
-              this.case_history.blood_fat = ""
165
+            if (this.case_history.blood_fat <= 0) {
166
+              this.case_history.blood_fat = ''
168
             }
167
             }
169
-            if(this.case_history.sick_type <= 0){
170
-              this.case_history.sick_type = ""
168
+            if (this.case_history.sick_type <= 0) {
169
+              this.case_history.sick_type = ''
171
             }
170
             }
172
-            this.case_history.sick_date = uParseTime(this.case_history.sick_date, "{y}-{m}-{d}");
173
-            if(this.case_history.is_infect == 1){
171
+            this.case_history.sick_date = uParseTime(this.case_history.sick_date, '{y}-{m}-{d}')
172
+            if (this.case_history.is_infect == 1) {
174
               this.case_history.is_infect = true
173
               this.case_history.is_infect = true
175
-            }else{
174
+            } else {
176
               this.case_history.is_infect = false
175
               this.case_history.is_infect = false
177
-
178
             }
176
             }
179
-
180
-
177
+            this.prescriptions = []
178
+            if (response.data.data.prescription.length > 0) {
179
+              for (let i = 0; i < response.data.data.prescription.length; i++) {
180
+                var prescription = response.data.data.prescription[i]
181
+                let index = i + 1
182
+                let obj = {
183
+                  name: "处方" + index,
184
+                  advices: prescription.advices,
185
+                  projects: prescription.project,
186
+                }
187
+                this.prescriptions.push(obj)
188
+              }
189
+            }else{
190
+              let obj = {
191
+                name: "处方" + 1,
192
+                advices: [],
193
+                projects: [],
194
+              }
195
+              this.prescriptions.push(obj)
196
+            }
197
+            console.log()
198
+            this.$refs.prescriptions.setData(this.prescriptions)
181
           }
199
           }
182
         })
200
         })
183
 
201