|
@@ -30,10 +30,10 @@
|
30
|
30
|
@change="startTimeChange"
|
31
|
31
|
></el-date-picker>
|
32
|
32
|
|
33
|
|
- <el-input @keyup.enter.native='searchAction' v-model="keywords"
|
|
33
|
+ <!-- <el-input @keyup.enter.native='searchAction' v-model="keywords"
|
34
|
34
|
class="filter-item"/>
|
35
|
35
|
<el-button class="filter-item" type="primary" icon="el-icon-search"
|
36
|
|
- @click="searchAction">搜索</el-button>
|
|
36
|
+ @click="searchAction">搜索</el-button> -->
|
37
|
37
|
</div>
|
38
|
38
|
|
39
|
39
|
<el-table
|
|
@@ -52,16 +52,55 @@
|
52
|
52
|
ref="singleTable"
|
53
|
53
|
@current-change="handleCurrentChange"
|
54
|
54
|
>
|
55
|
|
- <el-table-column align="center" prop="name" label="姓名" wdith="89">
|
56
|
|
- <template slot-scope="scope"></template>
|
|
55
|
+ <el-table-column align="center" prop="name" label="名称" wdith="89">
|
|
56
|
+ <template slot-scope="scope">
|
|
57
|
+ {{scope.row.drug_name}}
|
|
58
|
+ </template>
|
|
59
|
+ </el-table-column>
|
|
60
|
+ <el-table-column align="center" prop="name" label="规格" wdith="89">
|
|
61
|
+ <template slot-scope="scope">
|
|
62
|
+ {{scope.row.dose}}{{scope.row.dose_unit}}*{{scope.row.min_number}}{{scope.row.min_unit}}/{{scope.row.max_unit}}
|
|
63
|
+ </template>
|
|
64
|
+ </el-table-column>
|
|
65
|
+ <el-table-column align="center" prop="name" label="库存" wdith="89">
|
|
66
|
+ <template slot-scope="scope">
|
|
67
|
+ {{getWarehoseInfo(scope.row.drug_warehouse_info,scope.row.max_unit,scope.row.min_unit,scope.row.min_number)}}
|
|
68
|
+ </template>
|
57
|
69
|
</el-table-column>
|
58
|
70
|
</el-table>
|
59
|
71
|
</div>
|
60
|
72
|
</div>
|
61
|
73
|
<div class="mainRight">
|
62
|
74
|
<el-tabs v-model="titleType">
|
63
|
|
- <el-tab-pane label="明细" name="明细"></el-tab-pane>
|
64
|
|
- <el-tab-pane label="汇总" name="汇总"></el-tab-pane>
|
|
75
|
+ <el-tab-pane label="明细" name="明细">
|
|
76
|
+
|
|
77
|
+ <el-table
|
|
78
|
+ :data="tableData"
|
|
79
|
+ border
|
|
80
|
+ style="width: 100%">
|
|
81
|
+ <el-table-column prop="date" label="序号" width="180">
|
|
82
|
+ <template slot-scope="scope">
|
|
83
|
+
|
|
84
|
+ </template>
|
|
85
|
+ </el-table-column>
|
|
86
|
+ <el-table-column prop="name" label="单据编码" width="180">
|
|
87
|
+ </el-table-column>
|
|
88
|
+ <el-table-column prop="address" label="患者姓名">
|
|
89
|
+ </el-table-column>
|
|
90
|
+ <el-table-column prop="address" label="单次用量">
|
|
91
|
+ </el-table-column>
|
|
92
|
+ <el-table-column prop="address" label="用法">
|
|
93
|
+ </el-table-column>
|
|
94
|
+ <el-table-column prop="address" label="频率">
|
|
95
|
+ </el-table-column>
|
|
96
|
+ <el-table-column prop="address" label="天数">
|
|
97
|
+ </el-table-column>
|
|
98
|
+ <el-table-column prop="address" label="总量">
|
|
99
|
+ </el-table-column>
|
|
100
|
+ </el-table>
|
|
101
|
+
|
|
102
|
+ </el-tab-pane>
|
|
103
|
+
|
65
|
104
|
</el-tabs>
|
66
|
105
|
</div>
|
67
|
106
|
</div>
|
|
@@ -69,9 +108,9 @@
|
69
|
108
|
</template>
|
70
|
109
|
|
71
|
110
|
<script>
|
72
|
|
-import { getTodayAdviceList } from "@/api/his/advice";
|
|
111
|
+import { getTodayAdviceList,getPharmacyBaseDrug } from "@/api/his/advice";
|
73
|
112
|
import BreadCrumb from "@/xt_pages/components/bread-crumb";
|
74
|
|
-
|
|
113
|
+const moment = require('moment')
|
75
|
114
|
export default {
|
76
|
115
|
components: {
|
77
|
116
|
BreadCrumb,
|
|
@@ -88,7 +127,8 @@ export default {
|
88
|
127
|
titleType: "明细",
|
89
|
128
|
patient_id: 0,
|
90
|
129
|
keywords: "",
|
91
|
|
- start_time:new Date(),
|
|
130
|
+ start_time:moment(new Date()).add('year',0).format("YYYY-MM-DD"),
|
|
131
|
+ tableData:[],
|
92
|
132
|
};
|
93
|
133
|
},
|
94
|
134
|
|
|
@@ -131,8 +171,8 @@ export default {
|
131
|
171
|
this.getPatientList();
|
132
|
172
|
},
|
133
|
173
|
handleCurrentChange(row) {
|
134
|
|
- this.patient_id = row.id;
|
135
|
|
-
|
|
174
|
+
|
|
175
|
+ this.getPharmacyBaseDrug(row.id)
|
136
|
176
|
},
|
137
|
177
|
getlist(){
|
138
|
178
|
var params = {
|
|
@@ -140,8 +180,58 @@ export default {
|
140
|
180
|
keywords:this.keywords,
|
141
|
181
|
}
|
142
|
182
|
getTodayAdviceList(params).then(response=>{
|
143
|
|
-
|
|
183
|
+ if(response.data.state == 1){
|
|
184
|
+ var list = response.data.data.list
|
|
185
|
+ this.$refs.singleTable.setCurrentRow(list[0])
|
|
186
|
+ this.patientTableData = list
|
|
187
|
+ }
|
144
|
188
|
})
|
|
189
|
+ },
|
|
190
|
+ getWarehoseInfo(arr, max_unit, min_unit, min_number) {
|
|
191
|
+ var total = 0;
|
|
192
|
+ var max_str = "";
|
|
193
|
+ var min_str = "";
|
|
194
|
+ if (arr.length > 0) {
|
|
195
|
+ for (let i = 0; i < arr.length; i++) {
|
|
196
|
+ total += parseInt(arr[i].stock_max_number+ arr[i].stock_min_number);
|
|
197
|
+ }
|
|
198
|
+ }
|
|
199
|
+ if (total < min_number) {
|
|
200
|
+ min_str = total + min_unit;
|
|
201
|
+ }
|
|
202
|
+ if (total == 0) {
|
|
203
|
+ min_str = "";
|
|
204
|
+ max_str = "";
|
|
205
|
+ }
|
|
206
|
+ if (total >= min_number) {
|
|
207
|
+ if (parseInt(total / min_number) != 0) {
|
|
208
|
+ max_str = parseInt(total / min_number) + max_unit;
|
|
209
|
+ }
|
|
210
|
+ if (total % min_number != 0) {
|
|
211
|
+ min_str = (total % min_number) + min_unit;
|
|
212
|
+ }
|
|
213
|
+ }
|
|
214
|
+ return max_str + min_str;
|
|
215
|
+ },
|
|
216
|
+ startTimeChange(){
|
|
217
|
+
|
|
218
|
+ },
|
|
219
|
+ getPharmacyBaseDrug(drug_id){
|
|
220
|
+ var params = {
|
|
221
|
+ start_time:this.start_time,
|
|
222
|
+ drug_id:drug_id,
|
|
223
|
+ }
|
|
224
|
+ console.log("param23232323322332",params)
|
|
225
|
+ getPharmacyBaseDrug(params).then(response=>{
|
|
226
|
+ if(response.data.state == 1){
|
|
227
|
+ var advicelist = response.data.data.advicelist
|
|
228
|
+ console.log("advicelist23323232323323",advicelist)
|
|
229
|
+ var hisAdviceList = response.data.data.hisAdviceList
|
|
230
|
+ console.log("hisadvicelist23233232233",hisAdviceList)
|
|
231
|
+ var patient = response.data.data.patient
|
|
232
|
+ console.log("patient23322323232332",patient)
|
|
233
|
+ }
|
|
234
|
+ })
|
145
|
235
|
}
|
146
|
236
|
},
|
147
|
237
|
created() {
|