Browse Source

Merge branch '20201109_pc_vue_new_branch' of http://git.shengws.com/csx/Vue_New into 20201109_pc_vue_new_branch

csx 3 years ago
parent
commit
b4a64b82f3

+ 269 - 175
src/xt_pages/outpatientCharges/components/prescriptionTable.vue View File

1
 <template>
1
 <template>
2
   <div class="prescriptionTable">
2
   <div class="prescriptionTable">
3
-    <el-table v-if="prescription.type == 1" :data="prescription.advices" border style="width: 99%;"
4
-              :row-style="{ color: '#303133' }"
5
-              :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}" highlight-current-row>
6
-      <el-table-column fixed align="center" type="index" width="40" label="序号"></el-table-column>
7
-      <el-table-column fixed align="center" prop="name" label="名称">
8
-        <template slot-scope="scope"><span :title='scope.row.drug_name'>{{ scope.row.drug_name }}</span></template>
9
-      </el-table-column>
10
-
11
-      <el-table-column align="center" prop="name" width="90" label="单次用量">
3
+    <el-table
4
+      v-if="prescription.type == 1"
5
+      :data="prescription.advices"
6
+      border
7
+      style="width: 99%"
8
+      :row-style="changColor"
9
+      :row-class-name="tableRowClassName"
10
+      :header-cell-style="{
11
+        color: '#606266',
12
+      }"
13
+      highlight-current-row
14
+    >
15
+      <el-table-column
16
+        fixed
17
+        align="center"
18
+        type="index"
19
+        width="40"
20
+        label="序号"
21
+      ></el-table-column>
22
+      <el-table-column fixed align="center" prop="name" width="200" label="名称">
23
+        <template slot-scope="scope"
24
+          ><span :title="scope.row.drug_name">{{
25
+            scope.row.drug_name
26
+          }}</span></template
27
+        >
28
+      </el-table-column>
29
+
30
+      <el-table-column align="center" prop="name" width="70" label="单次用量">
12
         <template slot-scope="scope">
31
         <template slot-scope="scope">
13
-            <!--<el-input v-model="scope.row.single_dose" readonly style="width:65%;"></el-input>-->
14
-            <div>{{scope.row.single_dose}}&nbsp;&nbsp;{{scope.row.single_dose_unit}}</div>
32
+          <!--<el-input v-model="scope.row.single_dose" readonly style="width:65%;"></el-input>-->
33
+          <div>
34
+            {{ scope.row.single_dose }}&nbsp;&nbsp;{{
35
+              scope.row.single_dose_unit
36
+            }}
37
+          </div>
15
         </template>
38
         </template>
16
       </el-table-column>
39
       </el-table-column>
17
-      <el-table-column align="center" prop="name" width="100" label="用法">
40
+      <el-table-column align="center" prop="name" width="80" label="用法">
18
         <template slot-scope="scope">
41
         <template slot-scope="scope">
19
           <!--<el-input v-model="scope.row.delivery_way" readonly></el-input>-->
42
           <!--<el-input v-model="scope.row.delivery_way" readonly></el-input>-->
20
-          <div> {{scope.row.delivery_way}}</div>
21
-
43
+          <div>{{ scope.row.delivery_way }}</div>
22
         </template>
44
         </template>
23
       </el-table-column>
45
       </el-table-column>
24
-      <el-table-column align="center" prop="name" width="100" label="频率">
46
+      <el-table-column align="center" prop="name" width="80" label="频率">
25
         <template slot-scope="scope">
47
         <template slot-scope="scope">
26
-          <div> {{scope.row.execution_frequency}}</div>
48
+          <div>{{ scope.row.execution_frequency }}</div>
27
 
49
 
28
           <!--<el-input v-model="scope.row.execution_frequency" readonly></el-input>-->
50
           <!--<el-input v-model="scope.row.execution_frequency" readonly></el-input>-->
29
         </template>
51
         </template>
30
       </el-table-column>
52
       </el-table-column>
31
 
53
 
32
-      <el-table-column align="center" prop="day" width="50" label="天数">
33
-        <template slot-scope="scope">{{scope.row.day}}天</template>
54
+      <el-table-column align="center" prop="day" width="80" label="天数">
55
+        <template slot-scope="scope">{{ scope.row.day }}天</template>
34
       </el-table-column>
56
       </el-table-column>
35
 
57
 
36
-      <el-table-column align="center" prop="name" width="100" label="总量">
58
+      <el-table-column align="center" prop="name" width="80" label="总量">
37
         <template slot-scope="scope">
59
         <template slot-scope="scope">
38
-            <!--<el-input v-model="scope.row.prescribing_number" style="width:60%" readonly placeholder=""></el-input>-->
39
-            <div>{{scope.row.prescribing_number}}&nbsp;&nbsp;{{scope.row.prescribing_number_unit}}</div>
60
+          <!--<el-input v-model="scope.row.prescribing_number" style="width:60%" readonly placeholder=""></el-input>-->
61
+          <div>
62
+            {{ scope.row.prescribing_number }}&nbsp;&nbsp;{{
63
+              scope.row.prescribing_number_unit
64
+            }}
65
+          </div>
40
         </template>
66
         </template>
41
       </el-table-column>
67
       </el-table-column>
42
-      <el-table-column align="center" prop="name" width="60" label="单价">
68
+      <el-table-column align="center" prop="name" width="80" label="单价">
43
         <template slot-scope="scope">
69
         <template slot-scope="scope">
44
-          <div> {{scope.row.retail_price}}元</div>
70
+          <div>{{ scope.row.retail_price }}元</div>
45
 
71
 
46
           <!--<el-input v-model="scope.row.retail_price" placeholder="" readonly></el-input>-->
72
           <!--<el-input v-model="scope.row.retail_price" placeholder="" readonly></el-input>-->
47
         </template>
73
         </template>
48
       </el-table-column>
74
       </el-table-column>
49
 
75
 
50
-      <el-table-column align="center" prop="name" width="60" label="执行状态">
76
+      <el-table-column align="center" prop="name" width="80" label="执行状态">
51
         <template slot-scope="scope">
77
         <template slot-scope="scope">
52
-          <div> {{scope.row.execution_state == 1 ? '已执行':'未执行'}}</div>
78
+          <div>{{ scope.row.execution_state == 1 ? "已执行" : "未执行" }}</div>
53
         </template>
79
         </template>
54
       </el-table-column>
80
       </el-table-column>
55
 
81
 
56
-
57
-      <el-table-column align="center" prop="name" width="120" label="医保编码">
82
+      <el-table-column align="center" prop="name" width="320" label="医保编码">
58
         <template slot-scope="scope">
83
         <template slot-scope="scope">
59
-          <div> {{scope.row.code}}</div>
84
+          <div>{{ scope.row.code }}</div>
60
         </template>
85
         </template>
61
       </el-table-column>
86
       </el-table-column>
62
 
87
 
63
-
64
       <el-table-column align="center" prop="name" width="80" label="规格/型号">
88
       <el-table-column align="center" prop="name" width="80" label="规格/型号">
65
         <template slot-scope="scope">
89
         <template slot-scope="scope">
66
-          <div> {{scope.row.spec}}</div>
90
+          <div>{{ scope.row.spec }}</div>
67
         </template>
91
         </template>
68
       </el-table-column>
92
       </el-table-column>
69
 
93
 
70
       <el-table-column align="center" prop="name" width="60" label="金额">
94
       <el-table-column align="center" prop="name" width="60" label="金额">
71
         <template slot-scope="scope">
95
         <template slot-scope="scope">
72
-          <div> {{scope.row.det_item_fee_sumamt}}</div>
96
+          <div>{{ scope.row.det_item_fee_sumamt }}</div>
73
         </template>
97
         </template>
74
       </el-table-column>
98
       </el-table-column>
75
 
99
 
76
-
77
       <el-table-column align="center" prop="name" width="120" label="生产厂家">
100
       <el-table-column align="center" prop="name" width="120" label="生产厂家">
78
         <template slot-scope="scope">
101
         <template slot-scope="scope">
79
-          <div> {{getName(scope.row.name_id)}}</div>
102
+          <div>{{ getName(scope.row.name_id) }}</div>
80
         </template>
103
         </template>
81
       </el-table-column>
104
       </el-table-column>
82
 
105
 
83
-
84
-
85
       <el-table-column align="center" prop="name" width="90" label="全自费金额">
106
       <el-table-column align="center" prop="name" width="90" label="全自费金额">
86
         <template slot-scope="scope">
107
         <template slot-scope="scope">
87
-          <div> {{scope.row.fulamt_ownpay_amt}}元</div>
108
+          <div>{{ scope.row.fulamt_ownpay_amt }}元</div>
88
         </template>
109
         </template>
89
       </el-table-column>
110
       </el-table-column>
90
 
111
 
91
-
92
-
93
       <el-table-column align="center" prop="name" width="90" label="超限价金额">
112
       <el-table-column align="center" prop="name" width="90" label="超限价金额">
94
         <template slot-scope="scope">
113
         <template slot-scope="scope">
95
-          <div> {{scope.row.overlmt_amt}}元</div>
114
+          <div>{{ scope.row.overlmt_amt }}元</div>
96
         </template>
115
         </template>
97
       </el-table-column>
116
       </el-table-column>
98
 
117
 
99
-
100
-      <el-table-column align="center" prop="name" width="90" label="先行自付金额">
118
+      <el-table-column
119
+        align="center"
120
+        prop="name"
121
+        width="90"
122
+        label="先行自付金额"
123
+      >
101
         <template slot-scope="scope">
124
         <template slot-scope="scope">
102
-          <div> {{scope.row.preselfpay_amt}}元</div>
125
+          <div>{{ scope.row.preselfpay_amt }}元</div>
103
         </template>
126
         </template>
104
       </el-table-column>
127
       </el-table-column>
105
 
128
 
106
-
107
-      <el-table-column align="center" prop="name" width="90" label="符合正常范围金额">
129
+      <el-table-column
130
+        align="center"
131
+        prop="name"
132
+        width="90"
133
+        label="符合正常范围金额"
134
+      >
108
         <template slot-scope="scope">
135
         <template slot-scope="scope">
109
-          <div> {{scope.row.inscp_scp_amt}}元</div>
136
+          <div>{{ scope.row.inscp_scp_amt }}元</div>
110
         </template>
137
         </template>
111
       </el-table-column>
138
       </el-table-column>
112
 
139
 
113
-
114
-
115
-
116
-
117
-
118
-
119
       <el-table-column align="center" prop="name" width="50" label="备注">
140
       <el-table-column align="center" prop="name" width="50" label="备注">
120
         <template slot-scope="scope">
141
         <template slot-scope="scope">
121
           <!--<el-input v-model="scope.row.remark" :title="scope.row.remark" placeholder="" readonly></el-input>-->
142
           <!--<el-input v-model="scope.row.remark" :title="scope.row.remark" placeholder="" readonly></el-input>-->
122
-          <div> {{scope.row.remark}}</div>
143
+          <div>{{ scope.row.remark }}</div>
123
         </template>
144
         </template>
124
       </el-table-column>
145
       </el-table-column>
125
     </el-table>
146
     </el-table>
126
-    <el-table v-if="prescription.type == 2" :data="prescription.project" border style="width: 99%;"
127
-              :row-style="{ color: '#303133' }"
128
-              :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}" highlight-current-row>
129
-      <el-table-column fixed align="center" type="index" width="40" label="序号"></el-table-column>
147
+    <el-table
148
+      v-if="prescription.type == 2"
149
+      :data="prescription.project"
150
+      border
151
+      style="width: 99%"
152
+      :row-style="{ color: '#303133' }"
153
+      :header-cell-style="{
154
+        backgroundColor: 'rgb(245, 247, 250)',
155
+        color: '#606266',
156
+      }"
157
+      highlight-current-row
158
+    >
159
+      <el-table-column
160
+        fixed
161
+        align="center"
162
+        type="index"
163
+        width="40"
164
+        label="序号"
165
+      ></el-table-column>
130
       <el-table-column fixed align="center" prop="project_name" label="名称">
166
       <el-table-column fixed align="center" prop="project_name" label="名称">
131
         <template slot-scope="scope">{{ scope.row.project_name }}</template>
167
         <template slot-scope="scope">{{ scope.row.project_name }}</template>
132
       </el-table-column>
168
       </el-table-column>
133
-      <el-table-column align="center" prop="statistical_classification" width="100" label="组">
134
-        <template slot-scope="scope">{{scope.row.type == 2?getGroup(scope.row.statistical_classification):"耗材"}}</template>
135
-      </el-table-column>
136
-      <el-table-column align="center" prop="single_dose" width="80" label="单次用量">
137
-        <template slot-scope="scope">{{scope.row.single_dose}}{{scope.row.unit}}</template>
138
-
139
-      </el-table-column>
140
-      <el-table-column align="center" prop="delivery_way" width="80" label="用法">
141
-        <template slot-scope="scope">{{scope.row.delivery_way}}</template>
142
-      </el-table-column>
143
-      <el-table-column align="center" prop="execution_frequency" width="80" label="频率">
144
-        <template slot-scope="scope">{{scope.row.execution_frequency}}</template>
145
-      </el-table-column>
146
-      <el-table-column align="center" prop="number_days" width="50" label="天数">
147
-        <template slot-scope="scope">{{scope.row.number_days}}天</template>
148
-
169
+      <el-table-column
170
+        align="center"
171
+        prop="statistical_classification"
172
+        width="100"
173
+        label="组"
174
+      >
175
+        <template slot-scope="scope">{{
176
+          scope.row.type == 2
177
+            ? getGroup(scope.row.statistical_classification)
178
+            : "耗材"
179
+        }}</template>
180
+      </el-table-column>
181
+      <el-table-column
182
+        align="center"
183
+        prop="single_dose"
184
+        width="80"
185
+        label="单次用量"
186
+      >
187
+        <template slot-scope="scope"
188
+          >{{ scope.row.single_dose }}{{ scope.row.unit }}</template
189
+        >
190
+      </el-table-column>
191
+      <el-table-column
192
+        align="center"
193
+        prop="delivery_way"
194
+        width="80"
195
+        label="用法"
196
+      >
197
+        <template slot-scope="scope">{{ scope.row.delivery_way }}</template>
198
+      </el-table-column>
199
+      <el-table-column
200
+        align="center"
201
+        prop="execution_frequency"
202
+        width="80"
203
+        label="频率"
204
+      >
205
+        <template slot-scope="scope">{{
206
+          scope.row.execution_frequency
207
+        }}</template>
208
+      </el-table-column>
209
+      <el-table-column
210
+        align="center"
211
+        prop="number_days"
212
+        width="50"
213
+        label="天数"
214
+      >
215
+        <template slot-scope="scope">{{ scope.row.number_days }}天</template>
149
       </el-table-column>
216
       </el-table-column>
150
       <el-table-column align="center" prop="total" width="50" label="总量">
217
       <el-table-column align="center" prop="total" width="50" label="总量">
151
         <template slot-scope="scope">
218
         <template slot-scope="scope">
152
-          <div>{{scope.row.total}} {{scope.row.unit}}</div>
219
+          <div>{{ scope.row.total }} {{ scope.row.unit }}</div>
153
         </template>
220
         </template>
154
       </el-table-column>
221
       </el-table-column>
155
       <el-table-column align="center" prop="name" width="50" label="单价">
222
       <el-table-column align="center" prop="name" width="50" label="单价">
156
-        <template slot-scope="scope">{{scope.row.price}}元</template>
223
+        <template slot-scope="scope">{{ scope.row.price }}元</template>
157
       </el-table-column>
224
       </el-table-column>
158
 
225
 
159
       <el-table-column align="center" prop="name" width="60" label="执行状态">
226
       <el-table-column align="center" prop="name" width="60" label="执行状态">
160
         <template slot-scope="scope">
227
         <template slot-scope="scope">
161
-          <div> {{scope.row.execution_state == 1 ? '已执行':'未执行'}}</div>
228
+          <div>{{ scope.row.execution_state == 1 ? "已执行" : "未执行" }}</div>
162
         </template>
229
         </template>
163
       </el-table-column>
230
       </el-table-column>
164
 
231
 
165
-
166
       <el-table-column align="center" prop="name" width="120" label="医保编码">
232
       <el-table-column align="center" prop="name" width="120" label="医保编码">
167
         <template slot-scope="scope">
233
         <template slot-scope="scope">
168
-          <div> {{scope.row.medical_code}}</div>
234
+          <div>{{ scope.row.medical_code }}</div>
169
         </template>
235
         </template>
170
       </el-table-column>
236
       </el-table-column>
171
 
237
 
172
-
173
       <el-table-column align="center" prop="name" width="80" label="规格/型号">
238
       <el-table-column align="center" prop="name" width="80" label="规格/型号">
174
         <template slot-scope="scope">
239
         <template slot-scope="scope">
175
-          <div> {{scope.row.spec}}</div>
240
+          <div>{{ scope.row.spec }}</div>
176
         </template>
241
         </template>
177
       </el-table-column>
242
       </el-table-column>
178
 
243
 
179
       <el-table-column align="center" prop="name" width="60" label="金额">
244
       <el-table-column align="center" prop="name" width="60" label="金额">
180
         <template slot-scope="scope">
245
         <template slot-scope="scope">
181
-          <div> {{scope.row.det_item_fee_sumamt}}元</div>
246
+          <div>{{ scope.row.det_item_fee_sumamt }}元</div>
182
         </template>
247
         </template>
183
       </el-table-column>
248
       </el-table-column>
184
 
249
 
185
-
186
       <el-table-column align="center" prop="name" width="120" label="生产厂家">
250
       <el-table-column align="center" prop="name" width="120" label="生产厂家">
187
         <template slot-scope="scope">
251
         <template slot-scope="scope">
188
-          <div> {{getName(scope.row.name_id)}}</div>
252
+          <div>{{ getName(scope.row.name_id) }}</div>
189
         </template>
253
         </template>
190
       </el-table-column>
254
       </el-table-column>
191
 
255
 
192
-
193
-
194
       <el-table-column align="center" prop="name" width="90" label="全自费金额">
256
       <el-table-column align="center" prop="name" width="90" label="全自费金额">
195
         <template slot-scope="scope">
257
         <template slot-scope="scope">
196
-          <div> {{scope.row.fulamt_ownpay_amt}}元</div>
258
+          <div>{{ scope.row.fulamt_ownpay_amt }}元</div>
197
         </template>
259
         </template>
198
       </el-table-column>
260
       </el-table-column>
199
 
261
 
200
-
201
-
202
       <el-table-column align="center" prop="name" width="90" label="超限价金额">
262
       <el-table-column align="center" prop="name" width="90" label="超限价金额">
203
         <template slot-scope="scope">
263
         <template slot-scope="scope">
204
-          <div> {{scope.row.overlmt_amt}}元</div>
264
+          <div>{{ scope.row.overlmt_amt }}元</div>
205
         </template>
265
         </template>
206
       </el-table-column>
266
       </el-table-column>
207
 
267
 
208
-
209
-      <el-table-column align="center" prop="name" width="90" label="先行自付金额">
268
+      <el-table-column
269
+        align="center"
270
+        prop="name"
271
+        width="90"
272
+        label="先行自付金额"
273
+      >
210
         <template slot-scope="scope">
274
         <template slot-scope="scope">
211
-          <div> {{scope.row.preselfpay_amt}}元</div>
275
+          <div>{{ scope.row.preselfpay_amt }}元</div>
212
         </template>
276
         </template>
213
       </el-table-column>
277
       </el-table-column>
214
 
278
 
215
-
216
-      <el-table-column align="center" prop="name" width="90" label="符合正常范围金额">
279
+      <el-table-column
280
+        align="center"
281
+        prop="name"
282
+        width="90"
283
+        label="符合正常范围金额"
284
+      >
217
         <template slot-scope="scope">
285
         <template slot-scope="scope">
218
-          <div> {{scope.row.inscp_scp_amt}}元</div>
286
+          <div>{{ scope.row.inscp_scp_amt }}元</div>
219
         </template>
287
         </template>
220
       </el-table-column>
288
       </el-table-column>
221
 
289
 
222
-
223
-
224
-
225
       <el-table-column align="center" prop="name" width="50" label="备注">
290
       <el-table-column align="center" prop="name" width="50" label="备注">
226
-        <template slot-scope="scope">{{scope.row.remark}}</template>
291
+        <template slot-scope="scope">{{ scope.row.remark }}</template>
227
       </el-table-column>
292
       </el-table-column>
228
     </el-table>
293
     </el-table>
229
 
294
 
230
     <div class="additionalBox">
295
     <div class="additionalBox">
231
-      <div class="additionalOne" v-for="(item,index) in prescription.addition" :key="index">
232
-        <span :title="item.item_name">{{item.item_name}}</span>
233
-        <el-input v-model="item.price" placeholder="" style="width:50px;" readonly></el-input>
296
+      <div
297
+        class="additionalOne"
298
+        v-for="(item, index) in prescription.addition"
299
+        :key="index"
300
+      >
301
+        <span :title="item.item_name">{{ item.item_name }}</span>
302
+        <el-input
303
+          v-model="item.price"
304
+          placeholder=""
305
+          style="width: 50px"
306
+          readonly
307
+        ></el-input>
234
308
235
-        <el-input v-model="item.count" placeholder="" style="width:50px;" readonly></el-input>
309
+        <el-input
310
+          v-model="item.count"
311
+          placeholder=""
312
+          style="width: 50px"
313
+          readonly
314
+        ></el-input>
236
315
237
         <!--<i class="el-icon-delete deleteIcon" @click="delAddition(index,item)"></i>-->
316
         <!--<i class="el-icon-delete deleteIcon" @click="delAddition(index,item)"></i>-->
238
       </div>
317
       </div>
241
 </template>
320
 </template>
242
 
321
 
243
 <script>
322
 <script>
244
-  import { getInitData } from '@/api/his/his'
245
-  import { getDictionaryDataConfig} from "@/utils/data";
246
-
247
-  export default {
248
-    props: {
249
-      prescription: Object,
250
-      manufacturers:Array,
323
+import { getInitData } from "@/api/his/his";
324
+import { getDictionaryDataConfig } from "@/utils/data";
325
+
326
+export default {
327
+  props: {
328
+    prescription: Object,
329
+    manufacturers: Array,
330
+  },
331
+  data() {
332
+    return {
333
+      drugways: [],
334
+      efs: [],
335
+    };
336
+  },
337
+  mounted() {
338
+    // getInitData().then(response => {
339
+    //   if (response.data.state == 0) {
340
+    //     this.$message.error(response.data.msg)
341
+    //     return false
342
+    //   } else {
343
+    //     this.drugways = response.data.data.drugways
344
+    //     this.efs = response.data.data.efs
345
+    //   }
346
+    // })
347
+  },
348
+  methods: {
349
+    changColor({ row, rowIndex }) {
350
+     if (rowIndex % 2 == 1) { // 变颜色的条件
351
+		return {
352
+		backgroundColor: "#ACD6FF"  // 这个return的就是样式 可以是color 也可以是backgroundColor
353
+		}
354
+	}else{
355
+    return {
356
+      backgroundColor:"#FFF8D7"
357
+    }
358
+  }
251
     },
359
     },
252
-    data() {
253
-      return {
254
-        drugways: [],
255
-        efs: [],
256
-      }
257
-    }, mounted() {
258
-      // getInitData().then(response => {
259
-      //   if (response.data.state == 0) {
260
-      //     this.$message.error(response.data.msg)
261
-      //     return false
262
-      //   } else {
263
-      //     this.drugways = response.data.data.drugways
264
-      //     this.efs = response.data.data.efs
265
-      //   }
266
-      // })
267
-    }, methods:  {
268
 
360
 
269
-      getName(id){
270
-        let  name = ""
271
-        for(let i = 0; i  < this.manufacturers.length; i++){
272
-          if(id == this.manufacturers[i].id){
273
-            name =  this.manufacturers[i].manufacturer_name
274
-          }
361
+    getName(id) {
362
+      let name = "";
363
+      for (let i = 0; i < this.manufacturers.length; i++) {
364
+        if (id == this.manufacturers[i].id) {
365
+          name = this.manufacturers[i].manufacturer_name;
275
         }
366
         }
276
-        return name
277
-
278
-      },
279
-      getGroup(id){
280
-        var name = ""
281
-        var statistics_category =  getDictionaryDataConfig('system','statistics_category')
282
-        console.log("2235",statistics_category)
283
-        for(let i=0;i<statistics_category.length;i++){
284
-          if(id == statistics_category[i].id){
285
-            name = statistics_category[i].name
286
-          }
367
+      }
368
+      return name;
369
+    },
370
+    getGroup(id) {
371
+      var name = "";
372
+      var statistics_category = getDictionaryDataConfig(
373
+        "system",
374
+        "statistics_category"
375
+      );
376
+      console.log("2235", statistics_category);
377
+      for (let i = 0; i < statistics_category.length; i++) {
378
+        if (id == statistics_category[i].id) {
379
+          name = statistics_category[i].name;
287
         }
380
         }
288
-        return name
289
-      },
290
-
291
-
292
-    }
293
-  }
381
+      }
382
+      return name;
383
+    },
384
+  },
385
+};
294
 </script>
386
 </script>
295
 
387
 
388
+
296
 <style lang="scss">
389
 <style lang="scss">
297
-.prescriptionTable{
298
-    .additionalBox{
299
-      margin-top: 20px;
390
+.prescriptionTable {
391
+  .additionalBox {
392
+    margin-top: 20px;
393
+    display: flex;
394
+    flex-wrap: wrap;
395
+    .additionalOne {
396
+      margin-right: 20px;
397
+      margin-bottom: 10px;
300
       display: flex;
398
       display: flex;
301
-      flex-wrap: wrap;
302
-      .additionalOne{
303
-        margin-right:20px;
304
-        margin-bottom:10px;
305
-        display: flex;
306
-        align-items: center;
307
-        >span{
308
-          white-space: nowrap;
309
-          overflow: hidden;
310
-          text-overflow: ellipsis;
311
-          width:80px;
312
-          display: inline-block;
313
-          font-size: 14px;
314
-        }
399
+      align-items: center;
400
+      > span {
401
+        white-space: nowrap;
402
+        overflow: hidden;
403
+        text-overflow: ellipsis;
404
+        width: 80px;
405
+        display: inline-block;
406
+        font-size: 14px;
315
       }
407
       }
316
-      .deleteIcon{
317
-        color:red;
318
-        margin-left:5px;
319
-      }
320
-    }
321
-    .el-table th .cell, .el-table td .cell{
322
-        padding: 0 2px;
323
-        white-space: pre-line;
324
     }
408
     }
325
-    .el-icon-delete{
326
-        color:red;
409
+    .deleteIcon {
410
+      color: red;
411
+      margin-left: 5px;
327
     }
412
     }
413
+  }
414
+  .el-table th .cell,
415
+  .el-table td .cell {
416
+    padding: 0 2px;
417
+    white-space: pre-line;
418
+  }
419
+  .el-icon-delete {
420
+    color: red;
421
+  }
328
 }
422
 }
329
 </style>
423
 </style>

+ 3 - 2
src/xt_pages/outpatientCharges/statementTemplate/printThree.vue View File

147
 
147
 
148
         </div>
148
         </div>
149
         <div v-else id='prescription-print' class="prescription-print" style="position: relative;">
149
         <div v-else id='prescription-print' class="prescription-print" style="position: relative;">
150
-            <img style="width:100%;height:80px" v-if="$store.getters.xt_user.org_id != 10278" src="https://kuyi.shengws.com/bailin/bltotle.jpg" alt="">
151
-            <img style="width:100%;height:80px" v-else src="https://kuyi.shengws.com/beierlog.png" alt="">
150
+            <img style="width:100%;height:80px" v-if="$store.getters.xt_user.org_id == 10138" src="https://kuyi.shengws.com/bailin/bltotle.jpg" alt="">
151
+            <img style="width:100%;height:80px" v-if="$store.getters.xt_user.org_id == 10278" src="https://kuyi.shengws.com/beierlog.png" alt="">
152
+           
152
             <div class="printTitle" style="position: absolute;left: 40%;top: 50px;">门诊收费清单</div>
153
             <div class="printTitle" style="position: absolute;left: 40%;top: 50px;">门诊收费清单</div>
153
             <div style="display:flex;">
154
             <div style="display:flex;">
154
                 <div>单据号:<span style="display:inline-block;width:200px;">{{balanceAccounts.his.number ? balanceAccounts.his.number : ''}}</span>
155
                 <div>单据号:<span style="display:inline-block;width:200px;">{{balanceAccounts.his.number ? balanceAccounts.his.number : ''}}</span>

+ 3 - 3
src/xt_pages/outpatientDoctorStation/template/printThree.vue View File

3
   <div id='prescriptionPrint1'>
3
   <div id='prescriptionPrint1'>
4
     <div v-for="(item,index) in advicePrint" :key="index">
4
     <div v-for="(item,index) in advicePrint" :key="index">
5
       <div id='prescription-print' v-if="item.project.length == 0" v-for='(i,pageIndex) in item.pageArr.length' :key="pageIndex" class="prescription-print" style="page-break-after: always;">
5
       <div id='prescription-print' v-if="item.project.length == 0" v-for='(i,pageIndex) in item.pageArr.length' :key="pageIndex" class="prescription-print" style="page-break-after: always;">
6
-          <span v-if="org_id == 10138"> <img src="https://kuyi.shengws.com/bailin/bltotle.jpg" style="width:100%" alt=""></span>
7
-          <span v-if="org_id == 10278"> <img src="https://kuyi.shengws.com/beierlog.png" style="width:100%" alt=""></span>
6
+          <span v-if="org_id == 10138"> <img src="https://kuyi.shengws.com/bailin/bltotle.jpg" style="width:100%" alt=""></span> 
7
+          <span v-if="org_id == 10278"> <img src="https://kuyi.shengws.com/beierlog.png" style="width:100%" alt=""></span> 
8
           <div class="printTitle">
8
           <div class="printTitle">
9
             处方笺
9
             处方笺
10
             <span v-if="item.med_type == '1111'" style="margin-left: 50px;border: 1px solid #000;">精一</span>
10
             <span v-if="item.med_type == '1111'" style="margin-left: 50px;border: 1px solid #000;">精一</span>
71
           </div>
71
           </div>
72
           <div>*处方当日有效,特殊情况可适当延长,一般不超过3天</div>
72
           <div>*处方当日有效,特殊情况可适当延长,一般不超过3天</div>
73
           <div>*药品属于特殊商品,非质量问题不允许退换</div>
73
           <div>*药品属于特殊商品,非质量问题不允许退换</div>
74
-          <span v-if="org_id == 10138"><img src="https://kuyi.shengws.com/bailin/blend.jpg" style="width:100%" alt=""></span>
74
+          <span v-if="org_id == 10138"><img src="https://kuyi.shengws.com/bailin/blend.jpg" style="width:100%" alt=""></span> 
75
           <span v-if="org_id == 10278"><img src="https://kuyi.shengws.com/bailinbeier.png" style="width:100%" alt=""></span>
75
           <span v-if="org_id == 10278"><img src="https://kuyi.shengws.com/bailinbeier.png" style="width:100%" alt=""></span>
76
           <!-- <div class="doctorBox">
76
           <!-- <div class="doctorBox">
77
               <p>医师:{{item.doctor?item.doctor:""}}</p>
77
               <p>医师:{{item.doctor?item.doctor:""}}</p>

+ 2 - 2
src/xt_pages/outpatientDoctorStation/treatTemplate/printTwo.vue View File

92
           <div style="display:flex;">
92
           <div style="display:flex;">
93
             打印时间:<span style="border-bottom:1px solid #000;">{{getTime(new Date())?getTime(new Date()):""}}</span>
93
             打印时间:<span style="border-bottom:1px solid #000;">{{getTime(new Date())?getTime(new Date()):""}}</span>
94
           </div>
94
           </div>
95
-          <span v-if="org_id == 10138"></span> <img src="https://kuyi.shengws.com/bailin/blend.jpg" style="width:100%" alt="">
96
-          <span v-if="org_id == 10278"></span> <img src="https://kuyi.shengws.com/bailinbeier.png" style="width:100%" alt="">
95
+          <span v-if="org_id == 10138"><img src="https://kuyi.shengws.com/bailin/blend.jpg" style="width:100%" alt=""></span> 
96
+          <span v-if="org_id == 10278"><img src="https://kuyi.shengws.com/bailinbeier.png" style="width:100%" alt=""></span> 
97
           <div style="page-break-after:always"></div>
97
           <div style="page-break-after:always"></div>
98
      </div>
98
      </div>
99
 
99
 

+ 119 - 3
src/xt_pages/supply/components/addGoodReturn.vue View File

202
                 :rules="tableRules.supply_count"
202
                 :rules="tableRules.supply_count"
203
               >
203
               >
204
                 <el-input
204
                 <el-input
205
+                  @input="getSupplyCount(scope.row.supply_count,scope.row.sum_count,scope.row.supply_unit,scope.row.type,scope.row.min_number,scope.row.max_unit,scope.row.min_unit,scope.$index)"
205
                   v-model="scope.row.supply_count"
206
                   v-model="scope.row.supply_count"
206
                   style="width: 80px"
207
                   style="width: 80px"
207
                   :disabled="disabled"
208
                   :disabled="disabled"
554
               drugList[i].unitList[0].name = drugList[i].max_unit;
555
               drugList[i].unitList[0].name = drugList[i].max_unit;
555
               drugList[i].unitList[1].name = drugList[i].min_unit;
556
               drugList[i].unitList[1].name = drugList[i].min_unit;
556
             }
557
             }
558
+            drugList[i].sum_count =  this.getWarehoseInfoTwo(
559
+              drugList[i].drug_warehouse_info,
560
+              drugList[i].max_unit,
561
+              drugList[i].min_unit,
562
+              drugList[i].min_number
563
+            );
557
             this.tabList.push(drugList[i]);
564
             this.tabList.push(drugList[i]);
558
           }
565
           }
559
           this.drugList = drugList;
566
           this.drugList = drugList;
601
             for (let j = 0; j < goodList[i].unitList.length; j++) {
608
             for (let j = 0; j < goodList[i].unitList.length; j++) {
602
               goodList[i].unitList[0].name = goodList[i].packing_unit;
609
               goodList[i].unitList[0].name = goodList[i].packing_unit;
603
             }
610
             }
611
+        
612
+            goodList[i].sum_count = this.getTotalStockCountTwo(
613
+              goodList[i].good_warehouse_info
614
+            );
604
             this.tabList.push(goodList[i]);
615
             this.tabList.push(goodList[i]);
605
           }
616
           }
606
           this.goodList = goodList;
617
           this.goodList = goodList;
611
       this.currentIndex = val;
622
       this.currentIndex = val;
612
     },
623
     },
613
     changeName(val) {
624
     changeName(val) {
625
+      console.log("val332322323233",val)
614
       for (let i = 0; i < this.recordInfo.tableList.length; i++) {
626
       for (let i = 0; i < this.recordInfo.tableList.length; i++) {
615
         if (this.currentIndex == i) {
627
         if (this.currentIndex == i) {
616
           this.recordInfo.tableList[i].project_id = val.id;
628
           this.recordInfo.tableList[i].project_id = val.id;
643
           this.recordInfo.tableList[i].supply_unit = val.supply_unit;
655
           this.recordInfo.tableList[i].supply_unit = val.supply_unit;
644
           this.recordInfo.tableList[i].unitList = val.unitList;
656
           this.recordInfo.tableList[i].unitList = val.unitList;
645
           this.recordInfo.tableList[i].count = val.count
657
           this.recordInfo.tableList[i].count = val.count
658
+          this.recordInfo.tableList[i].sum_count = val.sum_count
659
+          if(val.type == 1){
660
+            this.recordInfo.tableList[i].min_number = val.min_number
661
+            this.recordInfo.tableList[i].max_unit = val.max_unit
662
+            this.recordInfo.tableList[i].min_unit = val.min_unit
663
+          }else{
664
+             this.recordInfo.tableList[i].max_unit = ""
665
+             this.recordInfo.tableList[i].min_unit = ""
666
+             this.recordInfo.tableList[i].min_number = ""
667
+          }
646
         }
668
         }
647
       }
669
       }
648
     },
670
     },
674
       tempObj["good_number"] = ""
696
       tempObj["good_number"] = ""
675
       tempObj["min_price"] = "";
697
       tempObj["min_price"] = "";
676
       tempObj["deposit_rate"] = ""
698
       tempObj["deposit_rate"] = ""
699
+      tempObj["sum_count"] = 0
700
+      tempObj["min_number"] = 0
701
+      tempObj["max_unit"] = ""
702
+      tempObj["min_unit"] = ""
677
       this.recordInfo.tableList.push(tempObj);
703
       this.recordInfo.tableList.push(tempObj);
678
     },
704
     },
679
     handleDelete: function (index, row) {
705
     handleDelete: function (index, row) {
712
       console.log("hh2332232332",max_str + min_str)
738
       console.log("hh2332232332",max_str + min_str)
713
       return max_str + min_str;
739
       return max_str + min_str;
714
     },
740
     },
741
+    getWarehoseInfoTwo(arr, max_unit, min_unit, min_number){
742
+      var total = 0;
743
+      if (arr.length > 0) {
744
+        for (let i = 0; i < arr.length; i++) {
745
+          total += parseInt(arr[i].stock_max_number+ arr[i].stock_min_number);
746
+        }
747
+      }
748
+      return total
749
+    },
715
     getTotalStockCount(arr) {
750
     getTotalStockCount(arr) {
716
       var total_count = 0;
751
       var total_count = 0;
717
       for (let i = 0; i < arr.length; i++) {
752
       for (let i = 0; i < arr.length; i++) {
723
         return ""
758
         return ""
724
       }
759
       }
725
       
760
       
761
+    },
762
+    getTotalStockCountTwo(arr) {
763
+      var total_count = 0;
764
+      for (let i = 0; i < arr.length; i++) {
765
+        total_count += arr[i].stock_count;
766
+      }
767
+      return total_count
768
+    
726
     },
769
     },
727
     calculate: function (val) {
770
     calculate: function (val) {
728
       if (isNaN(val)) {
771
       if (isNaN(val)) {
833
             }
876
             }
834
             orderInfo[i].id = orderInfo[i].id;
877
             orderInfo[i].id = orderInfo[i].id;
835
             orderInfo[i].supply_count = orderInfo[i].supply_count;
878
             orderInfo[i].supply_count = orderInfo[i].supply_count;
836
-            orderInfo[i].count = orderInfo[i].count
879
+            
837
             orderInfo[i].supply_price = orderInfo[i].price;
880
             orderInfo[i].supply_price = orderInfo[i].price;
838
             orderInfo[i].supply_remake = orderInfo[i].remark;
881
             orderInfo[i].supply_remake = orderInfo[i].remark;
839
             orderInfo[i].type = orderInfo[i].is_source;
882
             orderInfo[i].type = orderInfo[i].is_source;
864
                     orderInfo[i].unitList = [{ id: 1, name: "" }];
907
                     orderInfo[i].unitList = [{ id: 1, name: "" }];
865
                     orderInfo[i].unitList[0].name = drugList[j].max_unit;
908
                     orderInfo[i].unitList[0].name = drugList[j].max_unit;
866
                   }
909
                   }
910
+                   //用来统计数量比大小
911
+                 if(orderInfo[i].supply_unit == drugList[j].max_unit){
912
+                    orderInfo[i].sum_count = orderInfo[i].count*drugList[j].min_number
913
+                  }
914
+                  if(orderInfo[i].supply_unit == drugList[j].min_unit){
915
+                     orderInfo[i].sum_count = orderInfo[i].count
916
+                  }
917
+                  orderInfo[i].min_number =  drugList[j].min_number
918
+                  orderInfo[i].max_unit =drugList[j].max_unit
919
+                  orderInfo[i].min_unit =drugList[j].min_unit
867
                 }
920
                 }
921
+               
868
               }
922
               }
923
+              orderInfo[i].count = orderInfo[i].count + orderInfo[i].supply_unit
869
             }
924
             }
870
             if (orderInfo[i].is_source == 2) {
925
             if (orderInfo[i].is_source == 2) {
871
               for (let j = 0; j < goodList.length; j++) {
926
               for (let j = 0; j < goodList.length; j++) {
874
                   orderInfo[i].unitList[0].name = goodList[j].packing_unit;
929
                   orderInfo[i].unitList[0].name = goodList[j].packing_unit;
875
                 }
930
                 }
876
               }
931
               }
932
+              orderInfo[i].sum_count = orderInfo[i].count
933
+              orderInfo[i].min_number = 0
934
+              orderInfo[i].count = orderInfo[i].count;
935
+              orderInfo[i].max_unit =""
936
+              orderInfo[i].min_unit =""
877
             }
937
             }
878
           }
938
           }
879
 
939
 
880
           this.recordInfo.tableList = [];
940
           this.recordInfo.tableList = [];
941
+          console.log("相亲233232322332323223322323",orderInfo)
881
           this.recordInfo.tableList = orderInfo;
942
           this.recordInfo.tableList = orderInfo;
882
           this.tableDataList = []
943
           this.tableDataList = []
883
           this.tableDataList = orderInfo
944
           this.tableDataList = orderInfo
894
         if(valid){
955
         if(valid){
895
           this.loading = true
956
           this.loading = true
896
           for(let i=0;i<this.recordInfo.tableList.length;i++){
957
           for(let i=0;i<this.recordInfo.tableList.length;i++){
958
+            if(this.recordInfo.tableList[i].count == ""){
959
+              this.$message.error(this.recordInfo.tableList[i].name+"无可退库数量,保存失败!")
960
+              this.loading = false
961
+              return false
962
+            }
897
             this.recordInfo.tableList[i].supply_count = parseInt(this.recordInfo.tableList[i].supply_count);
963
             this.recordInfo.tableList[i].supply_count = parseInt(this.recordInfo.tableList[i].supply_count);
898
             this.recordInfo.tableList[i].supply_price =this.recordInfo.tableList[i].supply_price.toString();
964
             this.recordInfo.tableList[i].supply_price =this.recordInfo.tableList[i].supply_price.toString();
899
             this.recordInfo.tableList[i].supply_total =this.recordInfo.tableList[i].supply_total.toString();
965
             this.recordInfo.tableList[i].supply_total =this.recordInfo.tableList[i].supply_total.toString();
916
             }
982
             }
917
           } 
983
           } 
918
            //判断是否在采购单数据中做了删除,如果长度相等则代表没有删除,如果不等则代表做了删除或者新增
984
            //判断是否在采购单数据中做了删除,如果长度相等则代表没有删除,如果不等则代表做了删除或者新增
919
-           if(this.recordInfo.tableList.length != this.tableDataList.length){
985
+           if(this.recordInfo.tableList.length < this.tableDataList.length){
920
              warehouse_out_id = 0
986
              warehouse_out_id = 0
921
              for(let i=0;i<this.recordInfo.tableList.length;i++){
987
              for(let i=0;i<this.recordInfo.tableList.length;i++){
922
                 this.recordInfo.tableList[i].id = 0
988
                 this.recordInfo.tableList[i].id = 0
1102
         }
1168
         }
1103
       });
1169
       });
1104
     },
1170
     },
1105
-   
1171
+    getSupplyCount(supply_count,sum_count,supply_unit,type,min_number,max_unit,min_unit,index){
1172
+     console.log("val23322323",supply_count,sum_count,supply_unit,type,min_number,max_unit,min_unit)
1173
+      var total_count = 0
1174
+      
1175
+      if(type == 1){
1176
+       if(supply_unit == max_unit){
1177
+          total_count = supply_count * min_number
1178
+       }
1179
+       if(supply_unit == min_unit){
1180
+         total_count = supply_count
1181
+       }
1182
+       console.log("sum_counts",sum_count)
1183
+       console.log("count232232332",total_count)
1184
+       if(total_count > sum_count){
1185
+         this.$message.error("数量不能大于可退数量!")
1186
+         for(let i=0;i<this.recordInfo.tableList.length;i++){
1187
+           if(index == i){
1188
+             this.recordInfo.tableList[i].supply_count = ""
1189
+           }
1190
+         }
1191
+       }else{
1192
+           for(let i=0;i<this.recordInfo.tableList.length;i++){
1193
+            if(index == i){
1194
+              this.recordInfo.tableList[i].supply_count = supply_count
1195
+            }
1196
+          }
1197
+         }
1198
+      }
1199
+       
1200
+      if(type == 2){
1201
+         if(supply_count > sum_count){
1202
+          this.$message.error("数量不能大于可退数量!")
1203
+          for(let i=0;i<this.recordInfo.tableList.length;i++){
1204
+            if(index == i){
1205
+              this.recordInfo.tableList[i].supply_count = ""
1206
+            }
1207
+          }
1208
+         }else{
1209
+           for(let i=0;i<this.recordInfo.tableList.length;i++){
1210
+            if(index == i){
1211
+              this.recordInfo.tableList[i].supply_count = supply_count
1212
+            }
1213
+          }
1214
+         }
1215
+      }
1216
+    
1217
+    },
1106
   },
1218
   },
1107
   created() {
1219
   created() {
1108
     const tempObj = {};
1220
     const tempObj = {};
1132
     tempObj["good_number"] = ""
1244
     tempObj["good_number"] = ""
1133
     tempObj["min_price"] = "";
1245
     tempObj["min_price"] = "";
1134
     tempObj["deposit_rate"] = ""
1246
     tempObj["deposit_rate"] = ""
1247
+    tempObj["sum_count"] = 0
1248
+    tempObj["min_number"] = 0
1249
+    tempObj["max_unit"] = ""
1250
+    tempObj["min_unit"] = ""
1135
     this.recordInfo.tableList.push(tempObj);
1251
     this.recordInfo.tableList.push(tempObj);
1136
    
1252
    
1137
     this.getInitOrder();
1253
     this.getInitOrder();

+ 131 - 16
src/xt_pages/supply/components/editGoodReturn.vue View File

174
                   placeholder="请选择"
174
                   placeholder="请选择"
175
                   :disabled="disabled"
175
                   :disabled="disabled"
176
                 >
176
                 >
177
-                  <!-- <el-option
178
-                            v-for="(item,index) in scope.row.unitList"
179
-                            :key="index"
180
-                            :label="item.name"
181
-                            :value="item.name">
182
-                        </el-option> -->
177
+                  <el-option
178
+                    v-for="(item,index) in scope.row.unitList"
179
+                    :key="index"
180
+                    :label="item.name"
181
+                    :value="item.name">
182
+                  </el-option>
183
                 </el-select>
183
                 </el-select>
184
               </el-form-item>
184
               </el-form-item>
185
             </template>
185
             </template>
214
                 :rules="tableRules.supply_count"
214
                 :rules="tableRules.supply_count"
215
               >
215
               >
216
                 <el-input
216
                 <el-input
217
+                 @input="getSupplyCount(scope.row.supply_count,scope.row.sum_count,scope.row.supply_unit,scope.row.type,scope.row.min_number,scope.row.max_unit,scope.row.min_unit,scope.$index)"
217
                   v-model="scope.row.supply_count"
218
                   v-model="scope.row.supply_count"
218
                   style="width: 80px"
219
                   style="width: 80px"
219
                   :disabled="disabled"
220
                   :disabled="disabled"
554
               drugList[i].min_unit,
555
               drugList[i].min_unit,
555
               drugList[i].min_number
556
               drugList[i].min_number
556
             );
557
             );
558
+            
557
             drugList[i].supply_count = "";
559
             drugList[i].supply_count = "";
558
             drugList[i].supply_total_price = "";
560
             drugList[i].supply_total_price = "";
559
             drugList[i].supply_manufacturer = drugList[i].manufacturer;
561
             drugList[i].supply_manufacturer = drugList[i].manufacturer;
562
             drugList[i].type = 1;
564
             drugList[i].type = 1;
563
             drugList[i].supply_price = drugList[i].last_price;
565
             drugList[i].supply_price = drugList[i].last_price;
564
             drugList[i].name = drugList[i].drug_name;
566
             drugList[i].name = drugList[i].drug_name;
565
-            drugList[i].count = ""
566
             drugList[i].unitList = [
567
             drugList[i].unitList = [
567
               { id: 1, name: "" },
568
               { id: 1, name: "" },
568
               { id: 2, name: "" },
569
               { id: 2, name: "" },
572
               drugList[i].unitList[0].name = drugList[i].max_unit;
573
               drugList[i].unitList[0].name = drugList[i].max_unit;
573
               drugList[i].unitList[1].name = drugList[i].min_unit;
574
               drugList[i].unitList[1].name = drugList[i].min_unit;
574
             }
575
             }
576
+            drugList[i].sum_count =  this.getWarehoseInfoTwo(
577
+              drugList[i].drug_warehouse_info,
578
+              drugList[i].max_unit,
579
+              drugList[i].min_unit,
580
+              drugList[i].min_number
581
+            );
575
             this.tabList.push(drugList[i]);
582
             this.tabList.push(drugList[i]);
576
           }
583
           }
577
           this.drugList = drugList;
584
           this.drugList = drugList;
617
             ];
624
             ];
618
 
625
 
619
             goodList[i].supply_unit = goodList[i].packing_unit;
626
             goodList[i].supply_unit = goodList[i].packing_unit;
620
-            goodList[i].count = ""
627
+
621
             for (let j = 0; j < goodList[i].unitList.length; j++) {
628
             for (let j = 0; j < goodList[i].unitList.length; j++) {
622
               goodList[i].unitList[0].name = goodList[i].packing_unit;
629
               goodList[i].unitList[0].name = goodList[i].packing_unit;
623
             }
630
             }
631
+            goodList[i].sum_count = this.getTotalStockCountTwo(
632
+              goodList[i].good_warehouse_info
633
+            );
624
             this.tabList.push(goodList[i]);
634
             this.tabList.push(goodList[i]);
625
           }
635
           }
626
           this.goodList = goodList;
636
           this.goodList = goodList;
631
       this.currentIndex = val;
641
       this.currentIndex = val;
632
     },
642
     },
633
     changeName(val) {
643
     changeName(val) {
644
+    
634
       for (let i = 0; i < this.recordInfo.tableList.length; i++) {
645
       for (let i = 0; i < this.recordInfo.tableList.length; i++) {
635
         if (this.currentIndex == i) {
646
         if (this.currentIndex == i) {
636
           this.recordInfo.tableList[i].project_id = val.id;
647
           this.recordInfo.tableList[i].project_id = val.id;
638
           this.recordInfo.tableList[i].name = val.name;
649
           this.recordInfo.tableList[i].name = val.name;
639
           this.recordInfo.tableList[i].supply_name = val.supply_name;
650
           this.recordInfo.tableList[i].supply_name = val.supply_name;
640
           this.recordInfo.tableList[i].supply_type = val.supply_type;
651
           this.recordInfo.tableList[i].supply_type = val.supply_type;
641
-          this.recordInfo.tableList[i].supply_specification_name =
642
-            val.supply_specification_name;
652
+          this.recordInfo.tableList[i].supply_specification_name = val.supply_specification_name;
643
           this.recordInfo.tableList[i].supply_total = val.supply_total;
653
           this.recordInfo.tableList[i].supply_total = val.supply_total;
644
           if (val.supply_count == NaN) {
654
           if (val.supply_count == NaN) {
645
             this.recordInfo.tableList[i].supply_count = "";
655
             this.recordInfo.tableList[i].supply_count = "";
663
           this.recordInfo.tableList[i].supply_unit = val.supply_unit;
673
           this.recordInfo.tableList[i].supply_unit = val.supply_unit;
664
           this.recordInfo.tableList[i].unitList = val.unitList;
674
           this.recordInfo.tableList[i].unitList = val.unitList;
665
           this.recordInfo.tableList[i].count = val.count
675
           this.recordInfo.tableList[i].count = val.count
676
+          this.recordInfo.tableList[i].sum_count = val.sum_count
677
+          
678
+          if(val.type == 1){
679
+            this.recordInfo.tableList[i].min_number = val.min_number
680
+            this.recordInfo.tableList[i].max_unit = val.max_unit
681
+            this.recordInfo.tableList[i].min_unit = val.min_unit
682
+          }else{
683
+             this.recordInfo.tableList[i].max_unit = ""
684
+             this.recordInfo.tableList[i].min_unit = ""
685
+             this.recordInfo.tableList[i].min_number = ""
686
+          }
687
+          
688
+         
666
         }
689
         }
667
       }
690
       }
668
     },
691
     },
698
       tempObj["good_number"] = ""
721
       tempObj["good_number"] = ""
699
       tempObj["deposit_rate"] = ""
722
       tempObj["deposit_rate"] = ""
700
       tempObj["order_number"] = ""
723
       tempObj["order_number"] = ""
724
+      tempObj["sum_count"] =0
725
+      tempObj["min_number"] = 0
726
+      tempObj["max_unit"] = ""
727
+      tempObj["min_unit"] = ""
701
       this.recordInfo.tableList.push(tempObj);
728
       this.recordInfo.tableList.push(tempObj);
702
     },
729
     },
703
     handleDelete: function (index, row) {
730
     handleDelete: function (index, row) {
744
       var min_str = "";
771
       var min_str = "";
745
       if (arr.length > 0) {
772
       if (arr.length > 0) {
746
         for (let i = 0; i < arr.length; i++) {
773
         for (let i = 0; i < arr.length; i++) {
774
+
747
           total += parseInt(arr[i].stock_max_number+ arr[i].stock_min_number);
775
           total += parseInt(arr[i].stock_max_number+ arr[i].stock_min_number);
748
         }
776
         }
749
       }
777
       }
764
       }
792
       }
765
       return max_str + min_str;
793
       return max_str + min_str;
766
     },
794
     },
795
+    getWarehoseInfoTwo(arr, max_unit, min_unit, min_number){
796
+      var total = 0;
797
+      if (arr.length > 0) {
798
+        for (let i = 0; i < arr.length; i++) {
799
+          total += parseInt(arr[i].stock_max_number+ arr[i].stock_min_number);
800
+        }
801
+      }
802
+      return total
803
+    },
767
     getTotalStockCount(arr) {
804
     getTotalStockCount(arr) {
768
       var total_count = 0;
805
       var total_count = 0;
769
       for (let i = 0; i < arr.length; i++) {
806
       for (let i = 0; i < arr.length; i++) {
775
         return ""
812
         return ""
776
       }
813
       }
777
     
814
     
815
+    },
816
+    getTotalStockCountTwo(arr) {
817
+      var total_count = 0;
818
+      for (let i = 0; i < arr.length; i++) {
819
+        total_count += arr[i].stock_count;
820
+      }
821
+      return total_count
822
+    
778
     },
823
     },
779
     calculate: function (val) {
824
     calculate: function (val) {
780
       if (isNaN(val)) {
825
       if (isNaN(val)) {
893
     count_arrearage() {
938
     count_arrearage() {
894
       this.payment = this.total_price - this.arrearage;
939
       this.payment = this.total_price - this.arrearage;
895
     },
940
     },
941
+    getSupplyCount(supply_count,sum_count,supply_unit,type,min_number,max_unit,min_unit,index){
942
+     console.log("val23322323",supply_count,sum_count,supply_unit,type,min_number,max_unit,min_unit)
943
+      var total_count = 0
944
+      
945
+      if(type == 1){
946
+       if(supply_unit == max_unit){
947
+          total_count = supply_count * min_number
948
+       }
949
+       if(supply_unit == min_unit){
950
+         total_count = supply_count
951
+       }
952
+       console.log("sum_counts",sum_count)
953
+       console.log("count232232332",total_count)
954
+       if(total_count > sum_count){
955
+         this.$message.error("数量不能大于可退数量!")
956
+         for(let i=0;i<this.recordInfo.tableList.length;i++){
957
+           if(index == i){
958
+             this.recordInfo.tableList[i].supply_count = ""
959
+           }
960
+         }
961
+       }else{
962
+           for(let i=0;i<this.recordInfo.tableList.length;i++){
963
+            if(index == i){
964
+              this.recordInfo.tableList[i].supply_count = supply_count
965
+            }
966
+          }
967
+         }
968
+      }
969
+       
970
+      if(type == 2){
971
+         if(supply_count > sum_count){
972
+          this.$message.error("数量不能大于可退数量!")
973
+          for(let i=0;i<this.recordInfo.tableList.length;i++){
974
+            if(index == i){
975
+              this.recordInfo.tableList[i].supply_count = ""
976
+            }
977
+          }
978
+         }else{
979
+           for(let i=0;i<this.recordInfo.tableList.length;i++){
980
+            if(index == i){
981
+              this.recordInfo.tableList[i].supply_count = supply_count
982
+            }
983
+          }
984
+         }
985
+      }
986
+    
987
+    },
896
     getGoodReturnDetail() {
988
     getGoodReturnDetail() {
897
       var id = this.$route.query.id;
989
       var id = this.$route.query.id;
898
       getGoodReturnDetail(id).then((response) => {
990
       getGoodReturnDetail(id).then((response) => {
921
           for (let i = 0; i < orderInfo.length; i++) {
1013
           for (let i = 0; i < orderInfo.length; i++) {
922
             orderInfo[i].id = orderInfo[i].id;
1014
             orderInfo[i].id = orderInfo[i].id;
923
             orderInfo[i].supply_count = orderInfo[i].supply_count;
1015
             orderInfo[i].supply_count = orderInfo[i].supply_count;
924
-            orderInfo[i].count = orderInfo[i].count;
925
             orderInfo[i].supply_price = orderInfo[i].price;
1016
             orderInfo[i].supply_price = orderInfo[i].price;
926
             orderInfo[i].supply_remake = orderInfo[i].remark;
1017
             orderInfo[i].supply_remake = orderInfo[i].remark;
927
             orderInfo[i].type = orderInfo[i].is_source;
1018
             orderInfo[i].type = orderInfo[i].is_source;
937
             if (orderInfo[i].is_source == 1) {
1028
             if (orderInfo[i].is_source == 1) {
938
               for (let j = 0; j < drugList.length; j++) {
1029
               for (let j = 0; j < drugList.length; j++) {
939
                 if (orderInfo[i].project_id == drugList[j].id) {
1030
                 if (orderInfo[i].project_id == drugList[j].id) {
1031
+                  
940
                   if (drugList[j].max_unit != drugList[j].min_unit) {
1032
                   if (drugList[j].max_unit != drugList[j].min_unit) {
941
-                    orderInfo[i].unitList = [
942
-                      { id: 1, name: "" },
943
-                      { id: 2, name: "" },
944
-                    ];
1033
+                    orderInfo[i].unitList = [{ id: 1, name: "" },{ id: 2, name: "" }];
945
                     orderInfo[i].unitList[0].name = drugList[j].max_unit;
1034
                     orderInfo[i].unitList[0].name = drugList[j].max_unit;
946
                     orderInfo[i].unitList[1].name = drugList[j].min_unit;
1035
                     orderInfo[i].unitList[1].name = drugList[j].min_unit;
947
                   }
1036
                   }
949
                     orderInfo[i].unitList = [{ id: 1, name: "" }];
1038
                     orderInfo[i].unitList = [{ id: 1, name: "" }];
950
                     orderInfo[i].unitList[0].name = drugList[j].max_unit;
1039
                     orderInfo[i].unitList[0].name = drugList[j].max_unit;
951
                   }
1040
                   }
1041
+                  //用来统计数量比大小
1042
+                  if(orderInfo[i].supply_unit == drugList[j].max_unit){
1043
+                    orderInfo[i].sum_count = orderInfo[i].count*drugList[j].min_number
1044
+                  }
1045
+                  if(orderInfo[i].supply_unit == drugList[j].min_unit){
1046
+                     orderInfo[i].sum_count = orderInfo[i].count
1047
+                  }
1048
+                  orderInfo[i].min_number =  drugList[j].min_number
1049
+                  orderInfo[i].max_unit =drugList[j].max_unit
1050
+                  orderInfo[i].min_unit =drugList[j].min_unit
952
                 }
1051
                 }
953
               }
1052
               }
1053
+              orderInfo[i].count = orderInfo[i].count + orderInfo[i].supply_unit
954
             }
1054
             }
955
             if (orderInfo[i].is_source == 2) {
1055
             if (orderInfo[i].is_source == 2) {
956
               for (let j = 0; j < goodList.length; j++) {
1056
               for (let j = 0; j < goodList.length; j++) {
959
                   orderInfo[i].unitList[0].name = goodList[j].packing_unit;
1059
                   orderInfo[i].unitList[0].name = goodList[j].packing_unit;
960
                 }
1060
                 }
961
               }
1061
               }
1062
+              orderInfo[i].sum_count = orderInfo[i].count
1063
+              orderInfo[i].min_number = 0
1064
+              orderInfo[i].count = orderInfo[i].count;
1065
+              orderInfo[i].max_unit =""
1066
+              orderInfo[i].min_unit =""
962
             }
1067
             }
963
           }
1068
           }
964
 
1069
 
965
           this.recordInfo.tableList = [];
1070
           this.recordInfo.tableList = [];
1071
+          console.log("or233232332233223233223",orderInfo)
966
           this.recordInfo.tableList = orderInfo;
1072
           this.recordInfo.tableList = orderInfo;
967
         }
1073
         }
968
       });
1074
       });
977
         if (valid) {
1083
         if (valid) {
978
           this.loading = true;
1084
           this.loading = true;
979
           for (let i = 0; i < this.recordInfo.tableList.length; i++) {
1085
           for (let i = 0; i < this.recordInfo.tableList.length; i++) {
1086
+            if(this.recordInfo.tableList[i].count == ""){
1087
+              this.$message.error(this.recordInfo.tableList[i].name+"无可退库数量,保存失败!")
1088
+              this.loading = false
1089
+              return false
1090
+            }
980
             this.recordInfo.tableList[i].supply_count = parseInt(
1091
             this.recordInfo.tableList[i].supply_count = parseInt(
981
               this.recordInfo.tableList[i].supply_count
1092
               this.recordInfo.tableList[i].supply_count
982
             );
1093
             );
1008
             return_marke: this.return_remark,
1119
             return_marke: this.return_remark,
1009
           };
1120
           };
1010
           console.log("parms32322332",params)
1121
           console.log("parms32322332",params)
1011
-         
1122
+          
1012
           updateGoodReturn(
1123
           updateGoodReturn(
1013
             params,
1124
             params,
1014
             warehouse_out_id,
1125
             warehouse_out_id,
1114
     tempObj["good_number"] = ""
1225
     tempObj["good_number"] = ""
1115
     tempObj["deposit_rate"] = ""
1226
     tempObj["deposit_rate"] = ""
1116
     tempObj["order_number"] = ""
1227
     tempObj["order_number"] = ""
1228
+    tempObj["sum_count"] = 0
1229
+    tempObj["min_number"] = 0
1230
+    tempObj["max_unit"] = ""
1231
+    tempObj["min_unit"] = ""
1117
     this.recordInfo.tableList.push(tempObj);
1232
     this.recordInfo.tableList.push(tempObj);
1118
     this.getInitOrder();
1233
     this.getInitOrder();
1119
 
1234
 

+ 10 - 3
src/xt_pages/supply/purchaseOrderQuery.vue View File

128
             <!-- <span v-if="scope.row.is_warehouse == 1">全部入库</span>
128
             <!-- <span v-if="scope.row.is_warehouse == 1">全部入库</span>
129
             <span v-if="scope.row.is_warehouse == 2">未入库</span>
129
             <span v-if="scope.row.is_warehouse == 2">未入库</span>
130
             <span v-if="scope.row.is_warehouse == 3">部分入库</span> -->
130
             <span v-if="scope.row.is_warehouse == 3">部分入库</span> -->
131
-            <span v-if="scope.row.orderOut!= undefined && scope.row.orderOut.length == 0">未入库</span> 
131
+          
132
             <span v-if="scope.row.orderOut!= undefined && scope.row.orderOut.length > 0">
132
             <span v-if="scope.row.orderOut!= undefined && scope.row.orderOut.length > 0">
133
-            <span v-if="getStatus(scope.row.orderOut) >= getAllCount(scope.row.orderInfo) ">全部入库</span> 
134
-            <span v-if="getStatus(scope.row.orderOut) < getAllCount(scope.row.orderInfo) ">部分入库</span> 
133
+              <span >
134
+                <span v-if="getStatus(scope.row.orderOut) == 0">未入库</span>
135
+                <span v-if="getStatus(scope.row.orderOut) > 0">
136
+                  <span v-if="getStatus(scope.row.orderOut) >= getAllCount(scope.row.orderInfo) ">全部入库</span> 
137
+                  <span v-if="getStatus(scope.row.orderOut) < getAllCount(scope.row.orderInfo) ">部分入库</span>
138
+                </span>
139
+              </span> 
140
+              
141
+              
135
             </span> 
142
             </span> 
136
           </template>
143
           </template>
137
         </el-table-column>
144
         </el-table-column>