XMLWAN 3 år sedan
förälder
incheckning
1c11dd821d

+ 1 - 1
src/api/advice.js Visa fil

@@ -52,7 +52,7 @@ export function ExecDoctorAdvice(patient, id, time, mode,origin) {
52 52
     mode: mode,
53 53
     origin:origin,
54 54
   };
55
-  console.log("paras------",params)
55
+ 
56 56
   return request({
57 57
     url: "/api/patients/advice/exec",
58 58
     method: "Post",

+ 16 - 0
src/api/data.js Visa fil

@@ -304,7 +304,23 @@ export function GetDiagnose(params) {
304 304
   })
305 305
 }
306 306
 
307
+export function getAllDrugList(params){
308
+  
309
+  return request({
310
+    url:"/api/drug/getalldruglist",
311
+    method:"Get",
312
+    params:params
313
+  })
314
+}
307 315
 
316
+export function postSearchDrugList(keyword,params){
317
+  
318
+  return request({
319
+    url:"/api/drug/postsearchdruglist?keyword="+keyword,
320
+    method:"get",
321
+    params:params
322
+  })
323
+}
308 324
 
309 325
 
310 326
 

+ 17 - 0
src/api/drug/drug_stock.js Visa fil

@@ -438,6 +438,23 @@ export function getDrugWarehouseOrderInfo(params){
438 438
 }
439 439
 
440 440
 
441
+export function getDrugStockList(params){
442
+  
443
+  return request({
444
+    url:"/api/drugstock/drugstocklist",
445
+    method:"get",
446
+    params:params
447
+  })
448
+}
449
+
441 450
 
451
+export function getDrugStockFlow(params){
452
+  
453
+  return request({
454
+    url:"/api/drugstock/getdrugstockflow",
455
+    method:"Get",
456
+    params:params
457
+  })
458
+}
442 459
 
443 460
 

+ 10 - 1
src/api/stock.js Visa fil

@@ -618,4 +618,13 @@ export function getWarehouseOrderInfoList(params){
618 618
       method:"get",
619 619
       params:params
620 620
    })
621
-} 
621
+} 
622
+
623
+export function postSearchGoodList(keyword,params){
624
+  
625
+  return request({
626
+    url:"/api/good/postsearchgoodlist?keyword="+keyword,
627
+    method:"Get",
628
+    params:params
629
+  })
630
+}

+ 31 - 2
src/router/modules/drugs.js Visa fil

@@ -79,7 +79,8 @@ export default {
79 79
       hidden: true,
80 80
       is_menu: false,
81 81
       meta: { title: 'drugStockInOrderAdd', noCache: true }
82
-    },{
82
+    },
83
+    {
83 84
       path: '/drugstock/in/detail',
84 85
       component: () => import('@/xt_pages/stock/drugs/drugStockInDetail'),
85 86
       name: 'drugStockInDetail',
@@ -128,7 +129,8 @@ export default {
128 129
       hidden: true,
129 130
       is_menu: false,
130 131
       meta: { title: 'cancelDrugStockDetail', noCache: true }
131
-    },{
132
+    },
133
+    {
132 134
       path: '/drugstock/user/detail',
133 135
       component: () => import('@/xt_pages/stock/drugs/drugStockUserDetail'),
134 136
       name: 'drugStockUserDetail',
@@ -136,5 +138,32 @@ export default {
136 138
       is_menu: false,
137 139
       meta: { title: 'drugStockUserDetail', noCache: true }
138 140
     },
141
+
142
+    //编辑药品入库单
143
+    {
144
+      path:'/drugstock/in/order/edit',
145
+      component:()=>import('@/xt_pages/stock/drugs/drugStockInOrderEdit'),
146
+      name:'drugStockInOrderEdit',
147
+      hidden:true,
148
+      is_menu:false,
149
+      meta: { title: 'drugStockInOrderEdit', noCache: true }
150
+    },
151
+
152
+    {
153
+      path:'/drugstock/in/drugstockflow',
154
+      component:()=>import('@/xt_pages/stock/drugs/drugStockFlow'),
155
+      name:"drugStockFlow",
156
+      hidden:true,
157
+      is_menu:false,
158
+      meta:{title:"drugStockFlow",noCache:true}
159
+    },
160
+    {
161
+      path:'/drugstock/in/drugbatchnumber',
162
+      component:()=>import('@/xt_pages/stock/drugs/drugBatchNumber'),
163
+      name:"drugBatchNumber",
164
+      hidden:true,
165
+      is_menu:false,
166
+      meta:{title:"drugBatchNumber",noCache:true}
167
+    }
139 168
   ]
140 169
 }

+ 46 - 2
src/xt_pages/data/components/addConsumable.vue Visa fil

@@ -48,9 +48,53 @@
48 48
                                 </el-option>
49 49
                             </el-select>
50 50
                         </el-form-item>
51
-                        <el-form-item label="规格型号 : " prop="name" style="width:100%">
51
+                        <!-- <el-form-item label="规格型号 : " prop="name" style="width:100%">
52 52
                             <el-input v-model="form.specification_name" placeholder="" maxlength="30"></el-input>
53
-                        </el-form-item>
53
+                        </el-form-item> -->
54
+                       <div style="width:100%;">
55
+                          <div><span style="color:red;">*</span>单位&规格: <span style="color:#999">例如:0.75 g * 60 粒 / 盒</span></div>
56
+                        </div>
57
+                       <div style="width:100%;display:flex;align-items:center;">
58
+                            <el-form-item prop="dosage" class="noMargin">
59
+                              <el-input v-model="form.dosage" type="number" style="width:100px" placeholder="剂量" :disabled="dosageShow"></el-input>  
60
+                            </el-form-item>
61
+                            <el-form-item prop="max_unit" class="noMargin">
62
+                              <el-select v-model="form.max_unit" style="width:160px;" placeholder="剂量单位" @change="changeMaxUnit">
63
+                                <el-option
64
+                                  v-for="(item,index) in getDataConfig('hemodialysis','units')"
65
+                                  :key="index"
66
+                                  :label="item.name"
67
+                                  :value="item.name">
68
+                                </el-option>
69
+                            </el-select>
70
+                          </el-form-item>
71
+                            *
72
+                            <el-form-item prop="min_number" class="noMargin">
73
+                              <el-input v-model="form.min_number" style="width:100px" type="number" placeholder="拆零"> </el-input>
74
+                            </el-form-item>
75
+                            <el-form-item prop="min_unit" class="noMargin">
76
+                              <el-select v-model="form.min_unit" style="width:160px;"  placeholder="拆零单位"  @change="changeMinUnit">
77
+                                <el-option
78
+                                  v-for="(item,index) in getDataConfig('hemodialysis','units')"
79
+                                  :key="index"
80
+                                  :label="item.name"
81
+                                  :value="item.name">
82
+                                </el-option>
83
+                              </el-select>
84
+                          </el-form-item>
85
+                          /
86
+                          <el-form-item prop="packing_unit" class="noMargin">
87
+                            <el-select v-model="form.packing_unit" style="width:160px;" placeholder="包装单位">
88
+                              <el-option
89
+                                v-for="(item,index) in getDataConfig('hemodialysis','units')"
90
+                                :key="index"
91
+                                :label="item.name"
92
+                                :value="item.name">
93
+                              </el-option>
94
+                            </el-select>
95
+                          </el-form-item>
96
+                        </div>
97
+                       
54 98
                         <el-form-item label="生产厂商 : " prop="name" style="width:100%">
55 99
                             <el-select v-model="form.manufacturer" style="width:100%" placeholder="请选择">
56 100
                                 <el-option

+ 212 - 129
src/xt_pages/data/components/addDrugs.vue Visa fil

@@ -9,31 +9,17 @@
9 9
         <el-tabs v-model="activeName">
10 10
             <el-tab-pane label="基础数据" name="first">
11 11
                 <div>
12
-                    <el-form :model="form" :rules="rules" ref="form" label-width="120px"
13
-                             style="display: flex;flex-wrap: wrap;justify-content: space-between;">
12
+                    <el-form :model="form" :rules="rules" ref="form" label-width="120px" style="display: flex;flex-wrap: wrap;justify-content: space-between;">
14 13
                         <el-form-item label="药品名称 : " prop="drug_name">
15 14
                             <el-input v-model="form.drug_name" style="width:160px;" placeholder=""
16 15
                                       maxlength="30"></el-input>
17 16
                         </el-form-item>
18
-                        <el-form-item label="拼音 : ">
19
-                            <el-input v-model="form.pinyin" style="width:160px;" placeholder=""
20
-                                      maxlength="30"></el-input>
21
-                        </el-form-item>
22
-                        <el-form-item label="五笔 : ">
23
-                            <el-input v-model="form.wubi" style="width:160px;" placeholder="" maxlength="30"></el-input>
24
-                        </el-form-item>
17
+                      
25 18
                         <el-form-item label="药品别名 : ">
26 19
                             <el-input v-model="form.drug_alias" style="width:160px;" placeholder=""
27 20
                                       maxlength="30"></el-input>
28 21
                         </el-form-item>
29
-                        <el-form-item label="别名拼音 : " prop="drug_alias_pinyin">
30
-                            <el-input v-model="form.drug_alias_pinyin" style="width:160px;" placeholder=""
31
-                                      maxlength="30"></el-input>
32
-                        </el-form-item>
33
-                        <el-form-item label="别名五笔 : " prop="drug_alias_wubi">
34
-                            <el-input v-model="form.drug_alias_wubi" style="width:160px;" placeholder=""
35
-                                      maxlength="30"></el-input>
36
-                        </el-form-item>
22
+                        
37 23
                         <el-form-item label="药品类别 : " prop="drug_category">
38 24
                             <el-select v-model="form.drug_category" style="width:160px;" placeholder="请选择">
39 25
                                 <el-option
@@ -44,10 +30,51 @@
44 30
                                 </el-option>
45 31
                             </el-select>
46 32
                         </el-form-item>
47
-                        <el-form-item label="药品规格 : " prop="drug_spec">
48
-                            <el-input v-model="form.drug_spec" style="width:160px;" placeholder=""
49
-                                      maxlength="30"></el-input>
50
-                        </el-form-item>
33
+                        <div style="width:100%;">
34
+                          <div><span style="color:red;">*</span>单位&规格: <span style="color:#999">例如:0.75 g * 60 粒 / 盒</span></div>
35
+                        </div>
36
+                        <div style="width:100%;display:flex;align-items:center;">
37
+                            <el-form-item prop="dose" class="noMargin">
38
+                              <el-input v-model="form.dose" type="number" style="width:100px" placeholder="剂量" :disabled="dosageShow"></el-input>  
39
+                            </el-form-item>
40
+                            <el-form-item prop="dose_unit" class="noMargin">
41
+                              <el-select v-model="form.dose_unit" style="width:160px;" placeholder="剂量单位" @change="changeMaxUnit">
42
+                                <el-option
43
+                                  v-for="(item,index) in getDataConfig('hemodialysis','units')"
44
+                                  :key="index"
45
+                                  :label="item.name"
46
+                                  :value="item.name">
47
+                                </el-option>
48
+                            </el-select>
49
+                          </el-form-item>
50
+                            *
51
+                            <el-form-item prop="min_number" class="noMargin">
52
+                              <el-input v-model="form.min_number" style="width:100px" type="number" placeholder="拆零"> </el-input>
53
+                            </el-form-item>
54
+                            <el-form-item prop="min_unit" class="noMargin">
55
+                              <el-select v-model="form.min_unit" style="width:160px;"  placeholder="拆零单位"  @change="changeMinUnit">
56
+                                <el-option
57
+                                  v-for="(item,index) in getDataConfig('hemodialysis','units')"
58
+                                  :key="index"
59
+                                  :label="item.name"
60
+                                  :value="item.name">
61
+                                </el-option>
62
+                              </el-select>
63
+                          </el-form-item>
64
+                          /
65
+                          <el-form-item prop="max_unit" class="noMargin">
66
+                            <el-select v-model="form.max_unit" style="width:160px;" placeholder="包装单位">
67
+                              <el-option
68
+                                v-for="(item,index) in getDataConfig('hemodialysis','units')"
69
+                                :key="index"
70
+                                :label="item.name"
71
+                                :value="item.name">
72
+                              </el-option>
73
+                            </el-select>
74
+                          </el-form-item>
75
+                        </div>
76
+                       
77
+                        
51 78
                         <el-form-item label="药品类型 : " prop="drug_type">
52 79
                             <el-select v-model="form.drug_type" style="width:160px;" placeholder="请选择">
53 80
                                 <el-option
@@ -58,7 +85,49 @@
58 85
                                 </el-option>
59 86
                             </el-select>
60 87
                         </el-form-item>
61
-                        <el-form-item label="库存警戒:" prop="drug_stock_limit">
88
+
89
+                      <el-form-item label="默认给药途径:" prop="delivery_way">
90
+                        <el-select v-model="form.delivery_way" style="width:160px;" placeholder="请选择">
91
+                            <el-option
92
+                                    v-for="(item, index) in deliveryWayOptions"
93
+                                    :key="index"
94
+                                    :label="item.name"
95
+                                    :value="item.name">
96
+                            </el-option>
97
+                        </el-select>
98
+                    </el-form-item>
99
+                    <el-form-item label="默认执行频率:" prop="execution_frequency">
100
+                        <el-select v-model="form.execution_frequency" style="width:160px;" placeholder="请选择">
101
+                            <el-option
102
+                                    v-for="(item,index) in executionFrequencyOptions"
103
+                                    :key="index"
104
+                                    :label="item.name"
105
+                                    :value="item.name">
106
+                            </el-option>
107
+                        </el-select>
108
+                    </el-form-item>
109
+                  
110
+                    <el-form-item label="默认单次用量 : " prop="drug_dose">
111
+                         <el-input v-model="form.drug_dose" style="width:70px;margin-right:5px;" placeholder=""
112
+                                      maxlength="30"></el-input>
113
+                          <el-select v-model="form.drug_dose_unit" style="width:80px;" placeholder="单次用量单位">
114
+                                <el-option
115
+                                        v-for="(item,index) in unitList"
116
+                                        :key="index"
117
+                                        :label="item.name"
118
+                                        :value="item.id">
119
+                                </el-option>
120
+                           </el-select>
121
+                     </el-form-item>
122
+                    <el-form-item label="默认开药数量:" prop="prescribing_number">
123
+                        <el-input v-model="form.prescribing_number" style="width:160px;" placeholder=""
124
+                                  maxlength="30"></el-input>
125
+                    </el-form-item>
126
+                    <el-form-item label="默认开药天数:" prop="prescribing_number">
127
+                        <el-input v-model="form.drug_day" style="width:160px;" placeholder=""
128
+                                  maxlength="30"></el-input>
129
+                    </el-form-item>
130
+                       <el-form-item label="库存警戒:" prop="drug_stock_limit">
62 131
                             <el-input v-model="form.drug_stock_limit" style="width:160px;" placeholder=""
63 132
                                       maxlength="30"></el-input>
64 133
                         </el-form-item>
@@ -86,35 +155,20 @@
86 155
                                 </el-option>
87 156
                             </el-select>
88 157
                         </el-form-item>
89
-                        <el-form-item label="最大单位 : " prop="max_unit">
90
-                            <el-select v-model="form.max_unit" style="width:160px;" placeholder="请选择">
91
-                                <el-option
92
-                                        v-for="item,index in getDataConfig('hemodialysis','units')"
93
-                                        :key="index"
94
-                                        :label="item.name"
95
-                                        :value="item.name">
96
-                                </el-option>
97
-                            </el-select>
98
-                        </el-form-item>
99
-                        <el-form-item label="最小单位 : " prop="min_unit">
100
-                            <el-select v-model="form.min_unit" style="width:160px;" placeholder="请选择">
101
-                                <el-option
102
-                                        v-for="item,index in getDataConfig('hemodialysis','units')"
103
-                                        :key="index"
104
-                                        :label="item.name"
105
-                                        :value="item.name">
106
-                                </el-option>
107
-                            </el-select>
108
-                        </el-form-item>
158
+                       
109 159
                         <el-form-item label="单位换算 : ">
110 160
                             <el-input v-model="form.unit_matrixing" style="width:160px;" placeholder=""
111 161
                                       maxlength="30"></el-input>
112 162
                         </el-form-item>
113
-                        <el-form-item label="零售价(元) : " prop="retail_price">
114
-                            <el-input v-model="form.retail_price" style="width:160px;" placeholder=""
163
+                        <el-form-item label="拆零零售价(元) : " prop="min_price">
164
+                            <el-input v-model="form.min_price" style="width:160px;" placeholder=""
165
+                                      maxlength="30"></el-input>
166
+                        </el-form-item>
167
+                        <el-form-item label="包装零售价(元) : " prop="retail_price">
168
+                          <el-input v-model="form.retail_price" style="width:160px;" placeholder=""
115 169
                                       maxlength="30"></el-input>
116 170
                         </el-form-item>
117
-                        <el-form-item label="上次进价(元) : " prop="last_price">
171
+                        <el-form-item label="进货价(元) : " prop="last_price">
118 172
                             <el-input v-model="form.last_price" style="width:160px;" placeholder=""
119 173
                                       maxlength="30"></el-input>
120 174
                         </el-form-item>
@@ -142,24 +196,13 @@
142 196
                                 </el-option>
143 197
                             </el-select>
144 198
                         </el-form-item>
145
-                        <el-form-item label="剂量 : " prop="drug_dose">
146
-                            <el-input v-model="form.drug_dose" style="width:70px;margin-right:5px;" placeholder=""
147
-                                      maxlength="30"></el-input>
148
-                            <el-select v-model="form.drug_dose_unit" style="width:80px;" placeholder="请选择">
149
-                                <el-option
150
-                                        v-for="item,index in getDataConfig('hemodialysis','units')"
151
-                                        :key="index"
152
-                                        :label="item.name"
153
-                                        :value="item.id">
154
-                                </el-option>
155
-                            </el-select>
156
-                        </el-form-item>
199
+                      
157 200
 
158 201
 
159 202
                         <el-form-item label="限制性用药 : ">
160 203
                             <el-select v-model="form.lmt_used_flag" style="width:160px;" placeholder="请选择">
161 204
                                 <el-option
162
-                                        v-for="item,index in lmt_used_flags"
205
+                                        v-for="(item,index) in lmt_used_flags"
163 206
                                         :key="index"
164 207
                                         :label="item.name"
165 208
                                         :value="item.id">
@@ -171,7 +214,7 @@
171 214
                         <el-form-item label="审批标志 : ">
172 215
                             <el-select v-model="form.hosp_appr_flag" style="width:160px;" placeholder="请选择">
173 216
                                 <el-option
174
-                                        v-for="item,index in hosp_appr_flags"
217
+                                        v-for="(item,index) in hosp_appr_flags"
175 218
                                         :key="index"
176 219
                                         :label="item.name"
177 220
                                         :value="item.id">
@@ -185,15 +228,7 @@
185 228
                                       maxlength="30"></el-input>
186 229
                         </el-form-item>
187 230
                         <el-form-item label="生产厂商 : " prop="manufacturer">
188
-                            <!-- <el-select v-model="form.manufacturer" style="width:160px;" placeholder="请选择">
189
-                              <el-option
190
-                                v-for="item,index in manufacturers"
191
-                                :key="index"
192
-                                :label="item.manufacturer_name"
193
-                                :value="item.id">
194
-                              </el-option>
195
-                            </el-select> -->
196
-
231
+                           
197 232
                             <el-select v-model="form.manufacturer" style="width:160px;" filterable placeholder="请选择">
198 233
                                 <el-option
199 234
                                         v-for="(item,index) in manufacturerList"
@@ -230,7 +265,7 @@
230 265
                         <el-form-item label="是否特病目录:" prop="is_special_diseases">
231 266
                             <el-select v-model="form.is_special_diseases" style="width:160px;" placeholder="请选择">
232 267
                                 <el-option
233
-                                        v-for="item,index in options"
268
+                                        v-for="(item,index) in options"
234 269
                                         :key="index"
235 270
                                         :label="item.label"
236 271
                                         :value="item.value">
@@ -240,7 +275,7 @@
240 275
                         <el-form-item label="是否备案 : " prop="is_record">
241 276
                             <el-select v-model="form.is_record" style="width:160px;" placeholder="请选择">
242 277
                                 <el-option
243
-                                        v-for="item,index in options"
278
+                                        v-for="(item,index) in options"
244 279
                                         :key="index"
245 280
                                         :label="item.label"
246 281
                                         :value="item.value">
@@ -251,7 +286,7 @@
251 286
                         <el-form-item label="处方药标志">
252 287
                             <el-select v-model="form.prescription_mark" style="width:160px;" placeholder="请选择">
253 288
                                 <el-option
254
-                                        v-for="item,index in options"
289
+                                        v-for="(item,index) in options"
255 290
                                         :key="index"
256 291
                                         :label="item.label"
257 292
                                         :value="item.value">
@@ -263,6 +298,8 @@
263 298
                             <el-input v-model="form.social_security_directory_code" style="width:180px"></el-input>
264 299
                         </el-form-item>
265 300
 
301
+
302
+
266 303
                         <el-form-item label="备案日期:">
267 304
                             <el-date-picker
268 305
                                     value-format="yyyy-MM-dd"
@@ -275,10 +312,7 @@
275 312
                         <el-form-item label="药品备注:">
276 313
                             <el-input v-model="form.drug_remark" style="width:180px"></el-input>
277 314
                         </el-form-item>
278
-                        <!-- <el-form-item label="代理商 : " prop="agent">
279
-                          <el-input v-model="form.agent" style="width:160px;" placeholder="" maxlength="30"></el-input>
280
-                        </el-form-item> -->
281
-
315
+                      
282 316
                         <el-form-item label="经销商: " style="width:100%">
283 317
 
284 318
                             <el-select v-model="form.dealer" style="width:100%;" filterable placeholder="请选择">
@@ -314,38 +348,11 @@
314 348
             <el-tab-pane label="扩展数据" name="second">
315 349
                 <el-form :model="form" label-width="120px"
316 350
                          style="display: flex;flex-wrap: wrap;justify-content: space-between;">
317
-                    <el-form-item label="默认给药途径:" prop="delivery_way">
318
-                        <el-select v-model="form.delivery_way" style="width:160px;" placeholder="请选择">
319
-                            <el-option
320
-                                    v-for="item, index in deliveryWayOptions"
321
-                                    :key="index"
322
-                                    :label="item.name"
323
-                                    :value="item.name">
324
-                            </el-option>
325
-                        </el-select>
326
-                    </el-form-item>
327
-                    <el-form-item label="默认执行频率:" prop="execution_frequency">
328
-                        <el-select v-model="form.execution_frequency" style="width:160px;" placeholder="请选择">
329
-                            <el-option
330
-                                    v-for="item,index in executionFrequencyOptions"
331
-                                    :key="index"
332
-                                    :label="item.name"
333
-                                    :value="item.name">
334
-                            </el-option>
335
-                        </el-select>
336
-                    </el-form-item>
337
-                    <el-form-item label="默认单次用量:" prop="single_dose">
338
-                        <el-input v-model="form.single_dose" style="width:160px;" placeholder=""
339
-                                  maxlength="30"></el-input>
340
-                    </el-form-item>
341
-                    <el-form-item label="默认开药数量:" prop="prescribing_number">
342
-                        <el-input v-model="form.prescribing_number" style="width:160px;" placeholder=""
343
-                                  maxlength="30"></el-input>
344
-                    </el-form-item>
351
+           
345 352
                     <el-form-item label="标签:" prop="label">
346 353
                         <el-select v-model="form.label" style="width:160px;" placeholder="请选择">
347 354
                             <el-option
348
-                                    v-for="item,index in sign"
355
+                                    v-for="(item,index) in sign"
349 356
                                     :key="index"
350 357
                                     :label="item.name"
351 358
                                     :value="item.id">
@@ -358,7 +365,7 @@
358 365
                     <el-form-item label="是否常用医嘱:" prop="is_use_doctor_advice">
359 366
                         <el-select v-model="form.is_use_doctor_advice" style="width:160px;" placeholder="请选择">
360 367
                             <el-option
361
-                                    v-for="item,index in options"
368
+                                    v-for="(item,index) in options"
362 369
                                     :key="index"
363 370
                                     :label="item.label"
364 371
                                     :value="item.value">
@@ -368,7 +375,7 @@
368 375
                     <el-form-item label="是否默认:" prop="is_default">
369 376
                         <el-select v-model="form.is_default" style="width:160px;" placeholder="请选择">
370 377
                             <el-option
371
-                                    v-for="item,index in options"
378
+                                    v-for="(item,index) in options"
372 379
                                     :key="index"
373 380
                                     :label="item.label"
374 381
                                     :value="item.value">
@@ -520,23 +527,34 @@
520 527
           prescription_mark: '',//处方药标志
521 528
           social_security_directory_code: '',//社保目录编码
522 529
           record_date: '',//备案日期
523
-          drug_remark: ''//药品备注
530
+          drug_remark: '',//药品备注
531
+          drug_day:"",//默认开药天数
532
+          min_number:"",//拆零数量
533
+          min_price:"",//拆零零售价
534
+          dose_unit:"",//剂量
535
+          dose:"",//剂量单位
524 536
         },
525 537
 
526 538
         rules: {
527 539
           drug_name: [{ required: true, message: '请填写药品名称', trigger: 'blur' }],
528 540
           drug_alias: [{ required: true, message: '请选择药品类别', trigger: 'change' }],
529
-          drug_spec: [{ required: true, message: '请填写药品规格', trigger: 'blur' }],
541
+          // drug_spec: [{ required: true, message: '请填写药品规格', trigger: 'blur' }],
542
+          dosage:[{required:true,message:'请输入药品剂量',trigger:'blur'}],
543
+          max_unit: [{ required: true, message: '请填写剂量单位', trigger: 'change' }],
544
+          min_unit: [{ required: true, message: '请填写拆零单位', trigger: 'change' }],
545
+          unval:[{required:true,message:"请填写拆零",trigger:'change'}],
546
+          min_number:[{required:true,message:"请填写拆零",trigger:'change'}],
547
+          packing_unit: [{ required: true, message: '请填写包装单位', trigger: 'change' }],
530 548
           drug_type: [{ required: true, message: '请填写药品类型', trigger: 'blur' }],
531 549
           drug_stock_limit: [{ required: true, message: '请填写库存警戒', trigger: 'blur' }],
532 550
           drug_origin_place: [{ required: true, message: '请填写产地', trigger: 'blur' }],
533 551
           drug_dosage_form: [{ required: true, message: '请填写药品剂型', trigger: 'blur' }],
534 552
           medical_insurance_level: [{ required: true, message: '请选择医保等级', trigger: 'change' }],
535
-          max_unit: [{ required: true, message: '请填写最大单位', trigger: 'change' }],
536
-          min_unit: [{ required: true, message: '请填写最小单位', trigger: 'change' }],
553
+         
537 554
           unit_matrixing: [{ required: true, message: '请填写单位换算', trigger: 'blur' }],
538
-          retail_price: [{ required: true, message: '请填写零售价', trigger: 'blur' }],
539
-          last_price: [{ required: true, message: '请填写上次进价', trigger: 'blur' }],
555
+          retail_price: [{ required: true, message: '请填写拆零零售价', trigger: 'blur' }],
556
+          last_price: [{ required: true, message: '请填写进货价', trigger: 'blur' }],
557
+          packing_price:[{required:true,message:'请填写包装零售价',trigger:'blur'}],
540 558
           drug_classify: [{ required: true, message: '请选择药物分类', trigger: 'change' }],
541 559
           drug_dose: [{ required: true, message: '请填写剂量', trigger: 'blur' }],
542 560
           manufacturer: [{ required: true, message: '请选择生产产商', trigger: 'change' }],
@@ -547,7 +565,7 @@
547 565
           drug_remark: [{ required: true, message: '请填写药品备注' }],
548 566
           lmt_used_flag:[{ required: true, message: '请选择是否限制用药' }],
549 567
           hosp_appr_flag:[{ required: true, message: '请选择审批标志' }],
550
-
568
+      
551 569
         },
552 570
         page: 1,
553 571
         limit: 500,
@@ -560,7 +578,9 @@
560 578
         drugControlList:[],
561 579
         drugClassifyList:[],
562 580
         statisticsCategoryList:[],
563
-        pharmacologyCategoryList:[]
581
+        pharmacologyCategoryList:[],
582
+        dosageShow:false,
583
+        unitList:[]
564 584
       }
565 585
     },
566 586
     props: {
@@ -619,11 +639,28 @@
619 639
         this.form.intro = ''
620 640
       },
621 641
       show(id, obj) {
622
-        console.log("obj333333333",obj)
642
+        
643
+        this.unitList = []
644
+        var arr =  getDataConfig('hemodialysis','units')
645
+        for(let i=0;i<arr.length;i++){
646
+            if(obj.max_unit == arr[i].name){
647
+              this.unitList.push(arr[i])
648
+            }
649
+        }
650
+        for(let i=0;i<arr.length;i++){
651
+            if(obj.min_unit == arr[i].name){
652
+              this.unitList.push(arr[i])
653
+            }
654
+        }
623 655
         this.getInitializtion()
624 656
         this.getlist()
625 657
         this.GetAllConfig()
626
-        obj.drug_classify = parseInt(obj.drug_classify)
658
+        if(obj.drug_classify == 0){
659
+           obj.drug_classify = ""
660
+        }else{
661
+          obj.drug_classify = parseInt(obj.drug_classify)
662
+        }
663
+       
627 664
         if(obj.dealer == 0){
628 665
            obj.dealer = ""
629 666
         }
@@ -735,10 +772,14 @@
735 772
         form['social_security_directory_code'] = this.form.social_security_directory_code
736 773
         form['record_date'] = this.form.record_date
737 774
         form['drug_remark'] = this.form.drug_remark
738
-
739 775
         form['hosp_appr_flag'] = this.form.hosp_appr_flag
740 776
         form['lmt_used_flag'] = this.form.lmt_used_flag
741
-       
777
+
778
+        form['min_number'] = this.form.min_number
779
+        form["drug_day"] = this.form.drug_day
780
+        form['dose'] = this.form.dose,
781
+        form['dose_unit'] = this.form.dose_unit
782
+        form['min_price'] = this.form.min_price
742 783
         return form
743 784
       },
744 785
       getlist() {
@@ -768,31 +809,68 @@
768 809
         getInitializtion().then(response=>{
769 810
            if(response.data.state ==1){
770 811
              var drugCategoryList =  response.data.data.drugCategoryList
771
-             console.log("药品类别",drugCategoryList) 
812
+            
772 813
              this.drugCategoryList = drugCategoryList
773 814
              var drugTypeList = response.data.data.drugTypeList
774
-              console.log("药物分类",drugTypeList)
815
+             
775 816
               this.drugTypeList = drugTypeList
776 817
              var drugDosageFormList =  response.data.data.drugDosageFormList
777
-             console.log("药品剂型",drugDosageFormList) 
818
+            
778 819
              this.drugDosageFormList = drugDosageFormList
779 820
              var medicalInsuranceLevelList =  response.data.data.medicalInsuranceLevelList
780
-             console.log("医保等级",medicalInsuranceLevelList)
821
+           
781 822
              this.medicalInsuranceLevelList = medicalInsuranceLevelList
782 823
              var drugControlList = response.data.data.drugControlList
783
-             console.log("开药控制",drugControlList)
824
+             
784 825
              this.drugControlList = drugControlList
785 826
              var drugClassifyList = response.data.data.drugClassifyList
786
-             console.log("药物分类",drugClassifyList)
827
+           
787 828
              this.drugClassifyList = drugClassifyList
788 829
              var statisticsCategoryList =  response.data.data.statisticsCategoryList
789
-             console.log("统计分类",statisticsCategoryList)
830
+            
790 831
              this.statisticsCategoryList = statisticsCategoryList
791 832
              var pharmacologyCategoryList = response.data.data.pharmacologyCategoryList
792
-             console.log("药理分类",pharmacologyCategoryList)
833
+           
793 834
              this.pharmacologyCategoryList = pharmacologyCategoryList
794 835
            }
795 836
         })
837
+      },
838
+      changeMaxUnit(val){
839
+        if(val == this.form.min_unit){
840
+          this.form.dose = 1
841
+          this.dosageShow = true
842
+        }
843
+        if(val !=this.form.min_unit){
844
+          this.dosageShow = false 
845
+        } 
846
+       var arr =  getDataConfig('hemodialysis','units')
847
+      
848
+       for(let i=0;i<arr.length;i++){
849
+          if(val == arr[i].name){
850
+             this.unitList.push(arr[i])
851
+          }
852
+       }
853
+               
854
+      },
855
+      changeMinUnit(val){
856
+        if(val == this.form.max_unit){
857
+          this.form.dose = 1
858
+          this.dosageShow = true
859
+        }
860
+        if(val != this.form.max_unit){
861
+          this.dosageShow = false
862
+        }
863
+        
864
+        if(this.form.dosage == "" || this.form.max_unit == ""){
865
+           this.form.min_number = 1
866
+        } 
867
+        var arr =  getDataConfig('hemodialysis','units')
868
+        for(let i=0;i<arr.length;i++){
869
+            if(val == arr[i].name){
870
+              this.unitList.push(arr[i])
871
+            }
872
+        }
873
+       
796 874
       }
797 875
     }, watch: {
798 876
       visible(val) {
@@ -815,9 +893,14 @@
815 893
 <style lang="scss">
816 894
     .addDrugsDialog {
817 895
 
818
-    .el-dialog__body {
819
-        padding-top: 0px;
820
-    }
896
+      .el-dialog__body {
897
+          padding-top: 0px;
898
+      }
899
+      .noMargin{
900
+        .el-form-item__content{
901
+          margin-left: 0 !important;
902
+        }
903
+      }
821 904
 
822 905
     }
823 906
 </style>

+ 20 - 36
src/xt_pages/data/components/consumables.vue Visa fil

@@ -10,8 +10,8 @@
10 10
         <label class="title"><span class="name">是否启用</span> : </label>
11 11
         <el-select v-model="is_use" style="width:140px;margin-right:10px;" placeholder="请选择" @change="changeUser">
12 12
           <el-option
13
-            v-for="item in options"
14
-            :key="item.value"
13
+            v-for="(item,z) in options"
14
+            :key="z"
15 15
             :label="item.label"
16 16
             :value="item.value">
17 17
           </el-option>
@@ -19,8 +19,8 @@
19 19
         <label class="title"><span class="name">生产厂商</span> : </label>
20 20
         <el-select v-model="manufacturer" style="width:140px;margin-right:10px;" placeholder="请选择" @change="changeManufacture">
21 21
           <el-option
22
-            v-for="item in manufacturers"
23
-            :key="item.id"
22
+            v-for="(item,y) in manufacturers"
23
+            :key="y"
24 24
             :label="item.manufacturer_name"
25 25
             :value="item.id">
26 26
           </el-option>
@@ -28,34 +28,13 @@
28 28
         <span style="color: #909399;font-size:14px;">备案 : &nbsp;</span>
29 29
         <el-select v-model="is_record" style="width:140px;margin-right:10px;" placeholder="请选择" @change="changeRecord">
30 30
           <el-option
31
-            v-for="item in optionOne"
32
-            :key="item.value"
33
-            :label="item.label"
34
-            :value="item.value">
35
-          </el-option>
36
-        </el-select>
37
-        <!-- <label class="title"><span class="name">是否收费</span> : </label>
38
-        <el-select v-model="is_charge" style="width:140px;margin-right:10px;" placeholder="请选择" @change="changeCharge">
39
-          <el-option
40
-            v-for="item in options"
41
-            :key="item.value"
31
+            v-for="(item,index) in optionOne"
32
+            :key="index"
42 33
             :label="item.label"
43 34
             :value="item.value">
44 35
           </el-option>
45 36
         </el-select>
46
-        <span style="color: #909399;font-size:14px;">耗材种类 : &nbsp;</span>
47
-        <el-select v-model="good_kind" style="width:140px;margin-right:10px;" placeholder="请选择" @change="changeKind">
48
-          <el-option
49
-            label="全部"
50
-            value="0">
51
-          </el-option>
52
-          <el-option
53
-            v-for="item,index in  getDictionaryDataConfig('system','good_kind')"
54
-            :key="index"
55
-            :label="item.name"
56
-            :value="item.id">
57
-          </el-option>
58
-        </el-select> -->
37
+       
59 38
       </div>
60 39
       <div>
61 40
         <el-button type="primary" @click="openForm()">新增</el-button>
@@ -206,7 +185,7 @@
206 185
       width="40%"
207 186
     >
208 187
 
209
-      <div v-for="(item,index) in logs" :key="index">
188
+      <div v-for="(item,i) in logs" :key="i">
210 189
         <span> {{ item.export_time | parseTime('{y}-{m}-{d} {h}:{i}:{s}')}}</span>
211 190
         <br/>
212 191
         <br/>
@@ -327,7 +306,12 @@
327 306
               good_number:'',
328 307
               social_security_directory_code:"",
329 308
               special_medical:"",
330
-              production_type:""
309
+              production_type:"",
310
+              min_number:"",
311
+              packing_unit:"",
312
+              packing_price:'',
313
+              default_count_unit:"",
314
+              min_unit:"",
331 315
             },
332 316
             isVisibility: false,
333 317
 
@@ -706,7 +690,11 @@
706 690
             }else{
707 691
               this.goodInfo.goodInfoDialog.formValue.special_medical = response.data.data.goodInfo.special_medical.toString()
708 692
             }
709
-
693
+            this.goodInfo.goodInfoDialog.formValue.min_unit = response.data.data.goodInfo.min_unit
694
+            this.goodInfo.goodInfoDialog.formValue.min_number = response.data.data.goodInfo.min_number
695
+            this.goodInfo.goodInfoDialog.formValue.packing_unit = response.data.data.goodInfo.packing_unit
696
+            this.goodInfo.goodInfoDialog.formValue.packing_price = response.data.data.goodInfo.packing_price
697
+            this.goodInfo.goodInfoDialog.formValue.default_count_unit = response.data.data.goodInfo.default_count_unit
710 698
             this.$refs.addConsumable.show(row.id, this.goodInfo.goodInfoDialog.formValue)
711 699
           }
712 700
         })
@@ -791,16 +779,12 @@
791 779
         })
792 780
       },
793 781
       goodInfoDialogComfirm: function(val) {
794
-
782
+        console.log("val22222",val)
795 783
         if (val.isCreated == 2) {
796 784
           //修改
797 785
           val['id'] = this.goodInfo.editGoodId;
798 786
           val['good_code'] = this.goodInfo.good_code;
799 787
 
800
-
801
-
802
-
803
-
804 788
           modifyGoodInfo(val).then(response => {
805 789
             if (response.data.state == 0) {
806 790
               // this.$message.error(response.data.msg)

+ 176 - 144
src/xt_pages/data/components/drugs.vue Visa fil

@@ -7,15 +7,7 @@
7 7
         <el-button style="margin-right:10px;" class="filter-item" type="primary" icon="el-icon-search"
8 8
                    @click="searchAction">搜索
9 9
         </el-button>
10
-        <!-- <label class="title"><span class="name">是否启用</span> : </label>
11
-        <el-select v-model="is_use" style="width:140px;margin-right:10px;" placeholder="请选择" @change="changeUser">
12
-          <el-option
13
-            v-for="item in options"
14
-            :key="item.value"
15
-            :label="item.label"
16
-            :value="item.value">
17
-          </el-option>
18
-        </el-select> -->
10
+      
19 11
        <label class="title"><span class="name">生产厂商</span> : </label>
20 12
         <el-select v-model="manufacturer" style="width:140px;margin-right:10px;" placeholder="请选择" @change="changeManufacture">
21 13
           <el-option
@@ -34,15 +26,7 @@
34 26
             :value="item.value">
35 27
           </el-option>
36 28
         </el-select>
37
-        <!-- <span style="color: #909399;font-size:14px;">是否注射类别 : &nbsp;</span>
38
-        <el-select v-model="is_inject" style="width:140px;margin-right:10px;" placeholder="请选择" @change="changeInject">
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> -->
29
+   
46 30
 
47 31
         <span style="color: #909399;font-size:14px;">备案 : &nbsp;</span>
48 32
         <el-select v-model="is_record" style="width:140px;margin-right:10px;" placeholder="请选择" @change="changeRecord">
@@ -56,8 +40,7 @@
56 40
       </div>
57 41
       <div>
58 42
         <el-button type="primary" @click="openForm(0)">新增</el-button>
59
-        <!-- <el-button type="primary" @click="BatchDelete()" v-if="$store.getters.xt_user.org_id == 9504 || $store.getters.xt_user.org_id == 10028" >批量备案</el-button>
60
-        <el-button type="primary" v-if="$store.getters.xt_user.org_id != 9504 && $store.getters.xt_user.org_id != 10028" @click="GDYBBatchPutOnRecord()">批量备案</el-button> -->
43
+       
61 44
       </div>
62 45
 
63 46
     </div>
@@ -98,9 +81,10 @@
98 81
           <div>{{scope.row.drug_name}}</div>
99 82
         </template>
100 83
       </el-table-column>
101
-      <el-table-column prop="date" label="规格" width="60" align="center">
84
+      <el-table-column prop="date" label="单位&规格" width="120" align="center">
102 85
         <template slot-scope="scope">
103
-          <div>{{scope.row.drug_spec}}</div>
86
+          <!-- <div>{{scope.row.drug_spec}}</div> -->
87
+          <div>{{scope.row.dose}}{{scope.row.dose_unit}}&nbsp;* &nbsp;{{scope.row.min_number}}{{scope.row.min_unit}}/{{scope.row.max_unit}}</div>
104 88
         </template>
105 89
       </el-table-column>
106 90
       <el-table-column prop="date" label="最大单位" width="60" align="center">
@@ -329,6 +313,9 @@
329 313
           drug_code: '',
330 314
           hosp_appr_flag:'',
331 315
           lmt_used_flag:'',
316
+          dose_unit:'',
317
+          min_price:'',
318
+          drug_day:"",//默认开药天数
332 319
         },
333 320
         tempFormValue: {
334 321
           drug_name: '',//药品名称
@@ -381,7 +368,11 @@
381 368
           prescription_mark:'',
382 369
           hosp_appr_flag:'',
383 370
           lmt_used_flag:'',
384
-
371
+          dosage:'', //剂量
372
+          unval:'',//拆零
373
+          packing_unit:"",//包装单位
374
+          packing_price:"",//包装零售价
375
+          drug_day:"",//默认开药天数
385 376
         },
386 377
 
387 378
         current_id: 0,
@@ -500,6 +491,10 @@
500 491
         if (val.id > 0) {
501 492
           //修改
502 493
           val['id'] = this.current_id;
494
+          console.log("9999999999999999999",val.min_number)
495
+          val.min_number =  parseInt(val.min_number)
496
+          console.log("min_22222222",val)
497
+         
503 498
           editBaseDrugLib(val,untit).then(response => {
504 499
             if (response.data.state == 0) {
505 500
               this.$message.error(response.data.msg);
@@ -512,8 +507,8 @@
512 507
           })
513 508
         } else if (val.id == 0) {
514 509
           //新增
515
-
516
-
510
+          console.log("val2222222",val)
511
+        
517 512
           createBaseDrugLib(val).then(response => {
518 513
             if (response.data.state == 0) {
519 514
               this.$message.error(response.data.msg);
@@ -567,7 +562,7 @@
567 562
               this.$message.error(response.data.msg);
568 563
               return false
569 564
             } else {
570
-
565
+              console.log("药品详情",response.data.data.drug)
571 566
               for (let key in response.data.data.drug) {
572 567
                 this.formValue[key] = response.data.data.drug[key]
573 568
               }
@@ -680,6 +675,11 @@
680 675
               if(this.formValue.hosp_appr_flag == 0){
681 676
                 this.formValue.hosp_appr_flag = ""
682 677
               }
678
+              if(this.formValue.drug_classify == 0){
679
+                 this.formValue.drug_classify = ""
680
+              }
681
+
682
+
683 683
 
684 684
               this.$refs.addDrugs.show(id, this.formValue)
685 685
 
@@ -734,10 +734,10 @@
734 734
           } else {
735 735
             this.total = response.data.data.total;
736 736
             this.list = [];
737
-
738 737
             for (let i = 0; i < response.data.data.list.length; i++) {
739 738
               this.list.push(response.data.data.list[i])
740 739
             }
740
+            console.log("数据库字典",this.list)
741 741
           }
742 742
         })
743 743
       },
@@ -928,40 +928,48 @@
928 928
      },
929 929
 
930 930
       handleSuccessTwo({ results, header }) {
931
-
931
+         console.log("header22222",header)
932 932
         if (header != undefined && header.length > 0) {
933 933
 
934 934
           var isHasDrugName = header.includes('*药品名称');
935
-
936
-          var isHasDrugSpec = header.includes('*药品规格');
937
-
935
+          console.log("isHasDrugName",isHasDrugName)
936
+          var isHasUnval = header.includes('*拆零');
937
+          console.log("isHasUnval",isHasUnval)
938
+          var isHasMinUnit= header.includes('*拆零单位');
939
+           console.log("isHasMinUnit",isHasMinUnit)
940
+          var isHasDosage =  header.includes('*剂量')
941
+          console.log("isHasDosage",isHasDosage)
942
+        
943
+          var isHasMaxUnit= header.includes('*剂量单位');
944
+          console.log("isHasMaxUnit",isHasMaxUnit)
945
+          var isHasPackingUnit = header.includes('*包装单位')
946
+          console.log("isHasPackingUnit",isHasPackingUnit)
938 947
           var isHasDrugType =  header.includes('*药品类型');
939
-
948
+          console.log("isHasDrugType",isHasDrugType)
940 949
           var isHasDrugStockLimit =  header.includes('*库存警戒');
941
-
950
+          console.log("isHasDrugStockLimit",isHasDrugStockLimit)
942 951
           var isHasDrugOriginPlace= header.includes('*产地');
943
-
952
+          console.log("isHasDrugOriginPlace",isHasDrugOriginPlace)
944 953
           var isHasDrugDosageForm = header.includes('*药品剂型');
945
-
946
-          var isHasMaxUnit= header.includes('*最大单位');
947
-
948
-          var isHasMinUnit= header.includes('*最小单位');
949
-
954
+          console.log("isHasDrugDosageForm",isHasDrugDosageForm)
955
+      
950 956
           var isHasUnitMatrixing= header.includes("*单位换算");
951
-
952
-          var isHasRetailPrice = header.includes('*单零售价');
953
-
954
-          var isHasLastPrice = header.includes('*上次进价');
955
-
957
+          console.log("isHasUnitMatrixing",isHasUnitMatrixing)
958
+          var isHasRetailPrice = header.includes('*拆零零售价');
959
+          console.log("isHasRetailPrice",isHasRetailPrice)
960
+          var isHasLastPrice = header.includes('*进货价');
961
+          var isHasPackingPrice= header.includes('*包装零售价');
962
+         console.log("isHasLastPrice",isHasLastPrice)
956 963
           var isHasDrugClassifye = header.includes('*药物分类');
957
-
964
+         console.log("isHasDrugClassifye",isHasDrugClassifye)
958 965
          var isHasManufacturer = header.includes('*生产厂商');
959
-
960
-         var isHasDrugDose = header.includes('*剂量');
961
-
962
-         var isDrugDoseUnit = header.includes('*剂量单位');
963
-
964
-          if (!(isHasDrugName  && isHasDrugSpec && isHasDrugType && isHasDrugStockLimit && isHasDrugOriginPlace && isHasDrugDosageForm && isHasMaxUnit &&  isHasMinUnit && isHasUnitMatrixing &&  isHasRetailPrice && isHasLastPrice && isHasDrugClassifye && isHasManufacturer && isHasDrugDose && isDrugDoseUnit)) {
966
+         console.log("isHasManufacturer",isHasManufacturer)
967
+         var isHasDrugDose = header.includes('*默认单次用量');
968
+        console.log("isHasDrugDose",isHasDrugDose)
969
+         var isDrugDoseUnit = header.includes('*默认单次用量单位');
970
+         console.log("isDrugDoseUnit",isDrugDoseUnit)
971
+          if (!(isHasDrugName  && isHasUnval && isHasDrugType && isHasDrugStockLimit && isHasDrugOriginPlace && isHasDrugDosageForm && isHasMaxUnit &&  isHasMinUnit && isHasUnitMatrixing &&  isHasRetailPrice && isHasLastPrice && isHasPackingPrice && isHasDrugClassifye && isHasManufacturer && isHasDrugDose && isDrugDoseUnit && isHasDosage && isHasPackingUnit)) {
972
+            console.log("分区222222222222222222222222222222")
965 973
             this.dialogVisible = true;
966 974
             return
967 975
           }
@@ -984,22 +992,74 @@
984 992
            }
985 993
 
986 994
 
987
-           if (results[i]['药品别名'] === undefined) {
988
-                obj['drug_alias'] = ''
995
+          if (results[i]['*拆零'] === undefined) {
996
+                obj['min_number'] = ''
989 997
               } else {
990
-           if (key == '药品别名') {
991
-               obj['drug_alias'] = results[i][key].replace(/\s/g,"")
998
+           if (key == '*拆零') {
999
+               obj['min_number'] = results[i][key].replace(/\s/g,"")
1000
+              }
1001
+           }
1002
+
1003
+           if (results[i]['*拆零单位'] === undefined) {
1004
+                obj['min_unit'] = ''
1005
+              } else {
1006
+           if (key == '*拆零单位') {
1007
+               obj['min_unit'] = results[i][key].replace(/\s/g,"")
1008
+              }
1009
+           }
1010
+
1011
+
1012
+            if (results[i]['*剂量'] === undefined) {
1013
+                obj['dosage'] = ''
1014
+              } else {
1015
+            if (key == '*剂量') {
1016
+                obj['dosage'] = results[i][key].replace(/\s/g,"")
1017
+              }
1018
+           }
1019
+
1020
+           if (results[i]['*剂量单位'] === undefined) {
1021
+                obj['max_unit'] = ''
1022
+              } else {
1023
+           if (key == '*剂量单位') {
1024
+               obj['max_unit'] = results[i][key].replace(/\s/g,"")
992 1025
               }
993 1026
            }
1027
+          
1028
+            if (results[i]['*包装单位'] === undefined) {
1029
+                obj['packing_unit'] = ''
1030
+              } else {
1031
+           if (key == '*包装单位') {
1032
+               obj['packing_unit'] = results[i][key].replace(/\s/g,"")
1033
+              }
1034
+           }
1035
+
994 1036
 
995
-            if (results[i]['*药品规格'] === undefined) {
996
-                obj['drug_spec'] = ''
1037
+          if (results[i]['默认给药途径'] === undefined) {
1038
+                obj['delivery_way'] = ''
997 1039
               } else {
998
-           if (key == '*药品规格') {
999
-               obj['drug_spec'] = results[i][key].replace(/\s/g,"")
1040
+           if (key == '默认给药途径') {
1041
+               obj['delivery_way'] = results[i][key].replace(/\s/g,"")
1042
+              }
1043
+           }
1044
+          
1045
+           if (results[i]['默认执行频率'] === undefined) {
1046
+                obj['execution_frequency'] = ''
1047
+              } else {
1048
+           if (key == '默认执行频率') {
1049
+               obj['execution_frequency'] = results[i][key].replace(/\s/g,"")
1000 1050
               }
1001 1051
            }
1002 1052
 
1053
+          if (results[i]['默认开药天数'] === undefined) {
1054
+                obj['drug_day'] = ''
1055
+              } else {
1056
+           if (key == '默认开药天数') {
1057
+               obj['drug_day'] = results[i][key].replace(/\s/g,"")
1058
+              }
1059
+           }
1060
+          
1061
+
1062
+
1003 1063
             if (results[i]['*药品类型'] === undefined) {
1004 1064
                 obj['drug_type'] = ''
1005 1065
               } else {
@@ -1017,6 +1077,7 @@
1017 1077
               }
1018 1078
            }
1019 1079
 
1080
+
1020 1081
            if (results[i]['*产地'] === undefined) {
1021 1082
                 obj['drug_origin_place'] = ''
1022 1083
               } else {
@@ -1042,22 +1103,8 @@
1042 1103
               }
1043 1104
            }
1044 1105
 
1045
-           if (results[i]['*最大单位'] === undefined) {
1046
-                obj['max_unit'] = ''
1047
-              } else {
1048
-           if (key == '*最大单位') {
1049
-               obj['max_unit'] = results[i][key].replace(/\s/g,"")
1050
-              }
1051
-           }
1052
-
1053
-           if (results[i]['*最小单位'] === undefined) {
1054
-                obj['min_unit'] = ''
1055
-              } else {
1056
-           if (key == '*最小单位') {
1057
-               obj['min_unit'] = results[i][key].replace(/\s/g,"")
1058
-              }
1059
-           }
1060 1106
 
1107
+          
1061 1108
 
1062 1109
             if (results[i]['*单位换算'] === undefined) {
1063 1110
                 obj['unit_matrixing'] = ''
@@ -1067,23 +1114,36 @@
1067 1114
               }
1068 1115
            }
1069 1116
 
1070
-            if (results[i]['*单零售价'] === undefined) {
1117
+
1118
+
1119
+
1120
+          if (results[i]['*拆零零售价'] === undefined) {
1071 1121
                 obj['retail_price'] = ''
1072 1122
               } else {
1073
-           if (key == '*单零售价') {
1123
+           if (key == '*拆零零售价') {
1074 1124
                obj['retail_price'] = results[i][key].replace(/\s/g,"")
1075 1125
               }
1076 1126
            }
1077 1127
 
1128
+          
1129
+          if (results[i]['*包装零售价'] === undefined) {
1130
+                obj['packing_price'] = ''
1131
+              } else {
1132
+           if (key == '*包装零售价') {
1133
+               obj['packing_price'] = results[i][key].replace(/\s/g,"")
1134
+              }
1135
+           }
1136
+
1078 1137
 
1079
-         if (results[i]['*上次进价'] === undefined) {
1138
+         if (results[i]['*进价'] === undefined) {
1080 1139
                 obj['last_price'] = ''
1081 1140
               } else {
1082
-           if (key == '*上次进价') {
1141
+           if (key == '*进价') {
1083 1142
                obj['last_price'] = results[i][key].replace(/\s/g,"")
1084 1143
               }
1085 1144
            }
1086 1145
 
1146
+
1087 1147
             if (results[i]['*药物分类'] === undefined) {
1088 1148
                 obj['drug_classify'] = ''
1089 1149
               } else {
@@ -1093,64 +1153,63 @@
1093 1153
            }
1094 1154
 
1095 1155
 
1096
-            if (results[i]['*生产厂商'] === undefined) {
1097
-                obj['manufacturer'] = ''
1098
-              } else {
1099
-           if (key == '*生产厂商') {
1100
-               obj['manufacturer'] = results[i][key].replace(/\s/g,"")
1101
-              }
1102
-           }
1103 1156
 
1104
-            if (results[i]['经销商'] === undefined) {
1105
-                obj['dealer'] = ''
1157
+          
1158
+
1159
+           if (results[i]['*默认单次用量'] === undefined) {
1160
+                obj['drug_dose'] = ''
1106 1161
               } else {
1107
-            if (key == '经销商') {
1108
-                obj['dealer'] = results[i][key].replace(/\s/g,"")
1162
+           if (key == '*默认单次用量') {
1163
+               obj['drug_dose'] = results[i][key].replace(/\s/g,"")
1109 1164
               }
1110 1165
            }
1111 1166
 
1112
-           if (results[i]['拼音'] === undefined) {
1113
-                obj['pinyin'] = ''
1167
+
1168
+           if (results[i]['*默认单次用量单位'] === undefined) {
1169
+                obj['drug_dose_unit'] = ''
1114 1170
               } else {
1115
-            if (key == '拼音') {
1116
-                obj['pinyin'] = results[i][key].replace(/\s/g,"")
1171
+           if (key == '*默认单次用量单位') {
1172
+               obj['drug_dose_unit'] = results[i][key].replace(/\s/g,"")
1117 1173
               }
1118 1174
            }
1119 1175
 
1120
-           if (results[i]['五笔'] === undefined) {
1121
-                obj['wubi'] = ''
1176
+           if (results[i]['*生产厂商'] === undefined) {
1177
+                obj['manufacturer'] = ''
1122 1178
               } else {
1123
-            if (key == '五笔') {
1124
-                obj['wubi'] = results[i][key].replace(/\s/g,"")
1179
+           if (key == '*生产厂商') {
1180
+               obj['manufacturer'] = results[i][key].replace(/\s/g,"")
1125 1181
               }
1126 1182
            }
1127 1183
 
1128 1184
 
1129 1185
 
1130
-            if (results[i]['别名拼音'] === undefined) {
1131
-                obj['drug_alias_pinyin'] = ''
1186
+            if (results[i]['经销商'] === undefined) {
1187
+                obj['dealer'] = ''
1132 1188
               } else {
1133
-            if (key == '别名拼音') {
1134
-                obj['drug_alias_pinyin'] = results[i][key].replace(/\s/g,"")
1189
+            if (key == '经销商') {
1190
+                obj['dealer'] = results[i][key].replace(/\s/g,"")
1135 1191
               }
1136 1192
            }
1137
-
1138
-            if (results[i]['别名拼音'] === undefined) {
1139
-                obj['drug_alias_pinyin'] = ''
1193
+          
1194
+           if (results[i]['限制性用药'] === undefined) {
1195
+                obj['lmt_used_flag'] = ''
1140 1196
               } else {
1141
-            if (key == '别名拼音') {
1142
-                obj['drug_alias_pinyin'] = results[i][key].replace(/\s/g,"")
1197
+            if (key == '限制性用药') {
1198
+                obj['lmt_used_flag'] = results[i][key].replace(/\s/g,"")
1143 1199
               }
1144 1200
            }
1201
+           
1202
+
1145 1203
 
1146
-            if (results[i]['别名五笔'] === undefined) {
1147
-                obj['drug_alias_wubi'] = ''
1204
+           if (results[i]['药品别名'] === undefined) {
1205
+                obj['drug_alias'] = ''
1148 1206
               } else {
1149
-            if (key == '别名五笔') {
1150
-                obj['drug_alias_wubi'] = results[i][key].replace(/\s/g,"")
1207
+           if (key == '药品别名') {
1208
+               obj['drug_alias'] = results[i][key].replace(/\s/g,"")
1151 1209
               }
1152 1210
            }
1153 1211
 
1212
+          
1154 1213
              if (results[i]['药品类别'] === undefined) {
1155 1214
                 obj['drug_category'] = ''
1156 1215
               } else {
@@ -1159,6 +1218,8 @@
1159 1218
               }
1160 1219
            }
1161 1220
 
1221
+
1222
+
1162 1223
            if (results[i]['开药控制'] === undefined) {
1163 1224
                 obj['drug_control'] = ''
1164 1225
               } else {
@@ -1175,13 +1236,7 @@
1175 1236
               }
1176 1237
            }
1177 1238
 
1178
-          if (results[i]['审批标志'] === undefined) {
1179
-                obj['hosp_appr_flag'] = ''
1180
-              } else {
1181
-            if (key == '审批标志') {
1182
-                obj['hosp_appr_flag'] = results[i][key].replace(/\s/g,"")
1183
-              }
1184
-           }
1239
+         
1185 1240
 
1186 1241
             if (results[i]['审批标志'] === undefined) {
1187 1242
                 obj['hosp_appr_flag'] = ''
@@ -1207,6 +1262,7 @@
1207 1262
               }
1208 1263
            }
1209 1264
 
1265
+
1210 1266
            if (results[i]['统计分类'] === undefined) {
1211 1267
                 obj['statistics_category'] = ''
1212 1268
               } else {
@@ -1287,32 +1343,7 @@
1287 1343
                 obj['limit_remark'] = results[i][key].replace(/\s/g,"")
1288 1344
               }
1289 1345
            }
1290
-
1291
-          if (results[i]['*剂量'] === undefined) {
1292
-                obj['drug_dose'] = ''
1293
-              } else {
1294
-            if (key == '*剂量') {
1295
-                obj['drug_dose'] = results[i][key].replace(/\s/g,"")
1296
-              }
1297
-           }
1298
-
1299
-           if (results[i]['*剂量单位'] === undefined) {
1300
-                obj['drug_dose_unit'] = ''
1301
-              } else {
1302
-            if (key == '*剂量单位') {
1303
-                obj['drug_dose_unit'] = results[i][key].replace(/\s/g,"")
1304
-              }
1305
-           }
1306
-
1307
-           if (results[i]['限制性用药'] === undefined) {
1308
-                obj['lmt_used_flag'] = ''
1309
-              } else {
1310
-            if (key == '限制性用药') {
1311
-                obj['lmt_used_flag'] = results[i][key].replace(/\s/g,"")
1312
-              }
1313
-           }
1314
-
1315
-
1346
+           
1316 1347
          }
1317 1348
          var newArr = [];
1318 1349
          tableData.push(obj);
@@ -1384,7 +1415,8 @@
1384 1415
        let params = {
1385 1416
           'drugs':tableData
1386 1417
         };
1387
-
1418
+        console.log("params222222222",params)
1419
+        
1388 1420
         postDrugInformation(params).then(response=>{
1389 1421
            if(response.data.state == 1){
1390 1422
              var msg =  response.data.data.msg;

+ 131 - 19
src/xt_pages/stock/Dialog/goodInfoDailog.vue Visa fil

@@ -51,9 +51,41 @@
51 51
                 </el-option>
52 52
               </el-select>
53 53
             </el-form-item>
54
-            <el-form-item label="规格型号 : " prop="specification_name" style="width:100%">
55
-              <el-input v-model="form.specification_name" placeholder="" maxlength="30"></el-input>
56
-            </el-form-item>
54
+           
55
+           <div style="width:100%;">
56
+              <div><span style="color:red;">*</span>单位&规格: <span style="color:#999">例如:0.75 g * 60 粒 / 盒</span></div>
57
+          </div>
58
+          <div style="width:100%;display:flex;align-items:center;">
59
+               <el-form-item label="规格型号 : " prop="specification_name" style="width:200px">
60
+                 <el-input v-model="form.specification_name" placeholder="" maxlength="30"></el-input>
61
+               </el-form-item>
62
+          
63
+                <el-form-item prop="min_number" class="noMargin">
64
+                  <el-input v-model="form.min_number" :disabled="showMinNumber" style="width:100px" type="number" placeholder="拆零"> </el-input>
65
+                </el-form-item>
66
+                <el-form-item prop="min_unit" class="noMargin">
67
+                  <el-select v-model="form.min_unit" style="width:160px;"  placeholder="拆零单位"  @change="changeMinUnit">
68
+                    <el-option
69
+                      v-for="(item,index) in getDataConfig('hemodialysis','units')"
70
+                      :key="index"
71
+                      :label="item.name"
72
+                      :value="item.name">
73
+                    </el-option>
74
+                  </el-select>
75
+              </el-form-item>
76
+              /
77
+              <el-form-item prop="packing_unit" class="noMargin">
78
+                <el-select v-model="form.packing_unit" style="width:160px;" placeholder="包装单位" @change="changePackingUnit">
79
+                  <el-option
80
+                    v-for="(item,index) in getDataConfig('hemodialysis','units')"
81
+                    :key="index"
82
+                    :label="item.name"
83
+                    :value="item.name">
84
+                  </el-option>
85
+                </el-select>
86
+              </el-form-item>
87
+            </div>
88
+                       
57 89
             <el-form-item label="生产厂商 : " prop="manufacturer" style="width:100%">
58 90
              
59 91
                <el-select v-model="form.manufacturer" style="width:100%;" filterable placeholder="请选择">
@@ -65,7 +97,7 @@
65 97
                   </el-option>
66 98
              </el-select>
67 99
             </el-form-item>
68
-            <el-form-item label="单位 : " prop="good_unit">
100
+            <!-- <el-form-item label="单位 : " prop="good_unit">
69 101
               <el-select v-model="form.good_unit" style="width:160px;" placeholder="请选择">
70 102
                 <el-option
71 103
                   v-for="item,index in form.goodUnit"
@@ -73,20 +105,29 @@
73 105
                   :label="item.name"
74 106
                   :value="item.id">
75 107
                 </el-option>
76
-               <!-- <el-option
77
-                  v-for="item,index in getDataConfig('hemodialysis','units')"
78
-                  :key="index"
79
-                  :label="item.name"
80
-                  :value="item.name">
81
-               </el-option> -->
82 108
               </el-select>
109
+            </el-form-item> -->
110
+            <el-form-item label="包装零售价 : " prop="retail_price">
111
+              <el-input v-model="form.packing_price" style="width:160px;" placeholder="" maxlength="30"></el-input>
83 112
             </el-form-item>
84
-            <el-form-item label="零价 : " prop="retail_price">
113
+            <el-form-item label="拆零零售价 : " prop="retail_price">
85 114
               <el-input v-model="form.retail_price" style="width:160px;" placeholder="" maxlength="30"></el-input>
86 115
             </el-form-item>
87
-            <el-form-item label="最新进价 : " prop="buy_price">
116
+         
117
+            <el-form-item label="进货价 : " prop="buy_price">
88 118
               <el-input v-model="form.buy_price" style="width:160px;" placeholder="" maxlength="30"></el-input>
89 119
             </el-form-item>
120
+            <el-form-item label="默认单次用量:" prop="name">
121
+              <el-input v-model="form.default_count" style="width:80px;" placeholder="" maxlength="30"></el-input>
122
+                <el-select v-model="form.default_count_unit" style="width:80px;" placeholder="单次用量单位" @change="changeDefaultCountUnit">
123
+                  <el-option
124
+                    v-for="(item,index) in unitList"
125
+                    :key="index"
126
+                    :label="item.name"
127
+                    :value="item.name">
128
+                  </el-option>
129
+                </el-select>
130
+             </el-form-item>
90 131
             <el-form-item label="库存警戒 : " prop="stock_warn_count">
91 132
               <el-input v-model="form.stock_warn_count" style="width:160px;" placeholder="" maxlength="30"></el-input>
92 133
             </el-form-item>
@@ -184,9 +225,7 @@
184 225
       <el-tab-pane label="扩展数据" name="second">
185 226
         <el-form :model="form" label-width="120px"
186 227
                  style="display: flex;flex-wrap: wrap;justify-content: space-between;">
187
-          <el-form-item label="默认使用数量:" prop="name">
188
-            <el-input v-model="form.default_count" style="width:160px;" placeholder="" maxlength="30"></el-input>
189
-          </el-form-item>
228
+         
190 229
           <el-form-item label="标签:" prop="sign">
191 230
             <el-select v-model="form.sign" style="width:160px;" placeholder="请选择">
192 231
               <el-option
@@ -339,6 +378,11 @@
339 378
           social_security_directory_code:"",
340 379
           production_type:"",
341 380
           special_medical:"",
381
+          min_number:"",
382
+          packing_unit:"",
383
+          packing_price:'',
384
+          default_count_unit:"",
385
+          min_unit:"",
342 386
         },
343 387
 
344 388
         rules: {
@@ -376,7 +420,9 @@
376 420
         dealer:[],
377 421
         goodKindList:[],
378 422
         medicalInsuranceLevelList:[],
379
-        statisticsCategoryList:[]
423
+        statisticsCategoryList:[],
424
+        unitList:[],
425
+        showMinNumber:false,
380 426
       }
381 427
     },
382 428
     props: {
@@ -403,6 +449,24 @@
403 449
         return getDataConfig(module, filed_name)
404 450
       },
405 451
       show(id,form) {
452
+        console.log("form",form)
453
+
454
+        if(form!=undefined){
455
+          this.unitList = []
456
+          var arr =  getDataConfig('hemodialysis','units')
457
+          for(let i=0;i<arr.length;i++){
458
+            if(form.min_unit == arr[i].name){
459
+              this.unitList.push(arr[i])
460
+            }
461
+          }
462
+          for(let j=0;j<arr.length;j++){
463
+          if(form.packing_unit == arr[j].name){
464
+              this.unitList.push(arr[j])
465
+            }
466
+          } 
467
+          console.log("列表222",this.unitList)
468
+        }
469
+       
406 470
         this.visible = true
407 471
         this.good_status =[]
408 472
         this.getlist()
@@ -442,7 +506,12 @@
442 506
               is_statistics_work: '',
443 507
               sort: '',
444 508
               is_doctor_use: '',
445
-              good_number: ''
509
+              good_number: '',
510
+              min_number:"",
511
+              packing_unit:"",
512
+              packing_price:'',
513
+              default_count_unit:"",
514
+            
446 515
             }
447 516
           this.good_status = []
448 517
           for (let key in tempform) {
@@ -525,6 +594,11 @@
525 594
         form['social_security_directory_code'] = this.form.social_security_directory_code
526 595
         form['production_type'] = this.form.production_type
527 596
         form['special_medical'] = this.form.special_medical
597
+        form['min_unit'] = this.form.min_unit
598
+        form['min_number'] = this.form.min_number
599
+        form["packing_unit"]= this.form.packing_unit
600
+        form["packing_price"] = this.form.packing_price
601
+        form["default_count_unit"] = this.form.default_count_unit
528 602
         return form
529 603
       }, changeSelected: function(val) {
530 604
         console.log(val)
@@ -567,6 +641,40 @@
567 641
 
568 642
          }
569 643
        })
644
+      },
645
+      changeMinUnit(val){
646
+        if(this.form.packing_unit == val){
647
+          this.form.min_number = 1
648
+          this.showMinNumber = true
649
+        }else{
650
+          this.showMinNumber = false
651
+        }
652
+        var arr =  getDataConfig('hemodialysis','units')
653
+        for(let i=0;i<arr.length;i++){
654
+          if(val == arr[i].name){
655
+           this.unitList.push(arr[i])
656
+          }
657
+        }
658
+        
659
+      },
660
+      changePackingUnit(val){
661
+        if(this.form.min_unit == val){
662
+           this.form.min_number = 1
663
+           this.showMinNumber = true
664
+        }else{
665
+          this.showMinNumber = false
666
+         }
667
+        var arr =  getDataConfig('hemodialysis','units')
668
+        for(let i=0;i<arr.length;i++){
669
+          if(val == arr[i].name){
670
+           this.unitList.push(arr[i])
671
+          }
672
+        }
673
+      },
674
+     changeDefaultCountUnit(val){
675
+       console.log("val2222",val)
676
+       this.form.default_count_unit = ''
677
+        this.form.default_count_unit = val
570 678
       }
571 679
     },
572 680
     watch: {
@@ -589,6 +697,10 @@
589 697
 
590 698
 </script>
591 699
 
592
-<style scoped>
593
-
700
+<style lang="scss">
701
+   .noMargin{
702
+    .el-form-item__content{
703
+        margin-left: 0 !important;
704
+      }
705
+    }
594 706
 </style>

+ 20 - 6
src/xt_pages/stock/config/goodInfo.vue Visa fil

@@ -210,7 +210,10 @@
210 210
               sort:'',
211 211
               is_use_doctor_advice:'',
212 212
               good_number:'',
213
-
213
+              min_number:"",
214
+              packing_unit:"",
215
+              packing_price:'',
216
+              default_count_unit:""
214 217
             },
215 218
 
216 219
             isVisibility: false
@@ -223,6 +226,7 @@
223 226
         this.getList()
224 227
       },
225 228
       handleGoodInfoEdit: function(index, row) {
229
+       
226 230
         this.getAllDealer()
227 231
         this.getAllManufacturer()
228 232
         this.getAllGoodType()
@@ -232,12 +236,14 @@
232 236
         let params = {
233 237
           id: row.id
234 238
         }
239
+
235 240
         GetGoodInfo(params).then(response => {
236 241
           if (response.data.state == 0) {
237 242
             this.$message.error(response.data.msg)
238 243
             return false
239 244
           } else {
240
-            console.log(response.data.data.goodInfo)
245
+             
246
+            console.log("详情",response.data.data.goodInfo)
241 247
 
242 248
             if (response.data.data.goodInfo.good_unit <= 0) {
243 249
               this.goodInfo.goodInfoDialog.formValue.good_unit = ''
@@ -422,9 +428,12 @@
422 428
 
423 429
 
424 430
 
425
-            this.goodInfo.goodInfoDialog.formValue.good_number =
426
-              response.data.data.goodInfo.agent
431
+            this.goodInfo.goodInfoDialog.formValue.good_number = response.data.data.goodInfo.agent
427 432
 
433
+            this.goodInfo.goodInfoDialog.formValue.min_number = response.data.data.goodInfo.min_number
434
+            this.goodInfo.goodInfoDialog.formValue.packing_unit = response.data.data.goodInfo.packing_unit
435
+            this.goodInfo.goodInfoDialog.formValue.packing_price = response.data.data.goodInfo.packing_price
436
+            this.goodInfo.goodInfoDialog.formValue.default_count_unit = response.data.data.goodInfo.default_count_unit
428 437
 
429 438
 
430 439
             this.$refs.dialog.show()
@@ -482,10 +491,13 @@
482 491
               response.data.data.goodInfo.stock_warn_count
483 492
             this.goodInfo.goodInfoDialog.formValue.is_reuse = response.data.data.goodInfo.is_reuse.toString()
484 493
 
485
-            this.goodInfo.goodInfoDialog.formValue.remark =
486
-              response.data.data.goodInfo.remark
494
+            this.goodInfo.goodInfoDialog.formValue.remark = response.data.data.goodInfo.remark
487 495
             this.goodInfo.goodInfoDialog.isCreated = 3
488 496
             this.goodInfo.goodInfoDialog.isVisibility = true
497
+            this.goodInfo.goodInfoDialog.formValue.min_number = response.data.data.min_number
498
+            this.goodInfo.goodInfoDialog.formValue.packing_unit = response.data.data.packing_unit
499
+            this.goodInfo.goodInfoDialog.formValue.packing_price= response.data.data.packing_price
500
+            this.goodInfo.goodInfoDialog.formValue.default_count_unit = response.data.data.default_count_unit
489 501
           }
490 502
         })
491 503
       },
@@ -628,6 +640,8 @@
628 640
         this.goodInfo.goodInfoDialog.formValue.expiry_date_warn_day_count = ''
629 641
         this.goodInfo.goodInfoDialog.formValue.stock_warn_count = ''
630 642
         this.goodInfo.goodInfoDialog.formValue.is_reuse = '2'
643
+
644
+      
631 645
       },
632 646
       getAllDealer: function() {
633 647
         this.goodInfo.goodInfoDialog.formValue.dealers = []

+ 184 - 29
src/xt_pages/stock/drugs/drugStockInOrder.vue Visa fil

@@ -90,6 +90,7 @@
90 90
           backgroundColor: 'rgb(245, 247, 250)',
91 91
           color: '#606266'
92 92
         }"
93
+       @current-change="handleCurrentChangeOne"
93 94
       >
94 95
         <el-table-column align="center" type="selection" width="55">
95 96
         </el-table-column>
@@ -112,7 +113,7 @@
112 113
           </template>
113 114
         </el-table-column>
114 115
 
115
-        <el-table-column label="厂家" align="center">
116
+        <!-- <el-table-column label="厂家" align="center">
116 117
           <template slot-scope="scope">
117 118
             {{scope.row.manufacturers ? scope.row.manufacturers.manufacturer_name:''}}
118 119
           </template>
@@ -122,12 +123,12 @@
122 123
           <template slot-scope="scope">
123 124
             {{scope.row.dealers ? scope.row.dealers.dealer_name:''}}
124 125
           </template>
125
-        </el-table-column>
126
+        </el-table-column> -->
126 127
 
127 128
         <el-table-column label="操作" align="center" width="240">
128 129
           <template slot-scope="scope">
129 130
 
130
-             <el-tooltip
131
+             <!-- <el-tooltip
131 132
               class="item"
132 133
               effect="dark"
133 134
               content="详情"
@@ -140,7 +141,7 @@
140 141
                 @click="handleSearch(scope.row.id)"
141 142
               >
142 143
               </el-button>
143
-            </el-tooltip>
144
+            </el-tooltip> -->
144 145
             
145 146
             <el-tooltip
146 147
               class="item"
@@ -282,6 +283,119 @@
282 283
         <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
283 284
       </span>
284 285
     </el-dialog>
286
+
287
+    
288
+
289
+
290
+      <el-table
291
+        v-show="showOne"
292
+        :data="WarehouseInfo.warehouseInfoDate"
293
+        :class="signAndWeighBoxPatients"
294
+        style="width: 100%"
295
+        border
296
+        highlight-current-row
297
+        v-loading="Warehouse.loading"
298
+        ref="multipleTable"
299
+        @selection-change="select"
300
+        :row-style="{ color: '#303133' }"
301
+        :header-cell-style="{
302
+          backgroundColor: 'rgb(245, 247, 250)',
303
+          color: '#606266'
304
+        }"
305
+      >
306
+        <el-table-column align="center" type="selection" width="55">
307
+        </el-table-column>
308
+
309
+        <el-table-column label="药品名称" align="center">
310
+          <template slot-scope="scope">
311
+             {{scope.row.drug.drug_name}}
312
+          </template>
313
+        </el-table-column>
314
+
315
+        <el-table-column label="药品类型" align="center">
316
+          <template slot-scope="scope">
317
+              {{getDrugType(scope.row.drug.drug_type)}}
318
+          </template>
319
+        </el-table-column>
320
+
321
+        <el-table-column label="规格&单位" align="center">
322
+          <template slot-scope="scope">
323
+             {{scope.row.drug.dosage}}&nbsp;{{scope.row.drug.max_unit}}*{{scope.row.drug.unval}}{{scope.row.drug.min_unit}}/{{scope.row.drug.packing_unit}}
324
+          </template>
325
+        </el-table-column>
326
+       
327
+        <el-table-column label="批号" align="center">
328
+          <template slot-scope="scope">
329
+           {{scope.row.number}}
330
+          </template>
331
+        </el-table-column>
332
+        
333
+        <el-table-column label="入库数量" align="center">
334
+          <template slot-scope="scope">
335
+             {{scope.row.warehousing_count}}
336
+          </template>
337
+        </el-table-column>
338
+
339
+       <el-table-column label="进货价" align="center">
340
+          <template slot-scope="scope">
341
+            {{scope.row.price}}
342
+          </template>
343
+        </el-table-column>
344
+
345
+      
346
+       <el-table-column label="总价" align="center">
347
+          <template slot-scope="scope">
348
+             {{scope.row.total_price}}
349
+          </template>
350
+        </el-table-column>
351
+      
352
+
353
+       <el-table-column label="生产厂家" align="center">
354
+          <template slot-scope="scope">
355
+             {{getManufacturer(scope.row.drug.manufacturer)}}
356
+          </template>
357
+        </el-table-column>
358
+
359
+
360
+       <el-table-column label="生产日期" align="center">
361
+          <template slot-scope="scope">
362
+             {{getTime(scope.row.product_date)}}
363
+          </template>
364
+        </el-table-column>
365
+       
366
+
367
+       <el-table-column label="有效日期" align="center">
368
+          <template slot-scope="scope">
369
+             {{getTime(scope.row.expiry_date)}}
370
+          </template>
371
+        </el-table-column>
372
+
373
+        <el-table-column label="批准文号" align="center">
374
+          <template slot-scope="scope">
375
+             {{scope.row.number}}
376
+          </template>
377
+        </el-table-column>
378
+
379
+
380
+        <el-table-column label="备注" align="center">
381
+          <template slot-scope="scope">
382
+            {{scope.row.remark}}
383
+          </template>
384
+        </el-table-column>
385
+      </el-table>
386
+
387
+      <el-pagination
388
+        @size-change="handleSizeChange"
389
+        @current-change="handleCurrentChange"
390
+        :page-sizes="[10, 50, 100]"
391
+        :page-size="10"
392
+        background
393
+        style="margin-top:20px;float: right"
394
+        layout="total, sizes, prev, pager, next, jumper"
395
+        :total="total"
396
+      >
397
+      </el-pagination>
398
+
285 399
   </div>
286 400
 </template>
287 401
 
@@ -295,12 +409,15 @@ import {
295 409
   getDrugWarehouseList,
296 410
  
297 411
 } from "@/api/drug/drug_stock";
412
+import {getAllDrugList}from "@/api/data"
413
+ import {getDictionaryDataConfig } from "@/utils/data";
298 414
 import BreadCrumb from "../../components/bread-crumb";
299 415
 
300 416
 export default {
301 417
   name: "drugStockInOrder",
302 418
   components: { BreadCrumb },
303 419
   created() {
420
+    this.drugTypeList = getDictionaryDataConfig('system','drug_type') 
304 421
     var nowDate = new Date();
305 422
     var nowYear = nowDate.getFullYear();
306 423
     var nowMonth = nowDate.getMonth() + 1;
@@ -321,23 +438,8 @@ export default {
321 438
       (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
322 439
       "-" +
323 440
       (nowDay < 10 ? "0" + nowDay : nowDay);
324
-    
325
-    // var date1 = new Date();
326
-    // var date2 = new Date(date1);
327
-
328
-    // //-30为30天前,+30可以获得30天后的日期
329
-    // date2.setDate(date1.getDate() - 30);
330 441
 
331
-    // //30天前(月份判断是否小于10,小于10的前面+0)
332
-    // var agoDay = `${date2.getFullYear()}-${date2.getMonth() + 1<10?`0${date2.getMonth() + 1}`:date2.getMonth() + 1}-${date2.getDate()}`;
333
-      
334
-    // //当前日期
335
-    // var nowDay = `${date1.getFullYear()}-${date1.getMonth() + 1<10?`0${date1.getMonth() + 1}`:date1.getMonth() + 1}-${date1.getDate()}`;
336
-
337
-    //  this.start_time = agoDay
338
-    //  console.log("333333332222",this.start_time)
339 442
     this.GetWarehouse();
340
-    // this.GetConfigInfo();
341 443
     this.fetchAllAdminUsers();
342 444
    
343 445
   },
@@ -373,7 +475,10 @@ export default {
373 475
       },
374 476
       
375 477
       startTime: "",
376
-      dialogVisible:false
478
+      dialogVisible:false,
479
+      showOne:false,
480
+      drugTypeList:[],
481
+      manufacturerList:[]
377 482
     };
378 483
   },
379 484
   methods: {
@@ -545,12 +650,18 @@ export default {
545 650
       return Math.round(parseFloat(val) * 100) / 100;
546 651
     },
547 652
 
548
-    handleEdit: function(index, row) {
549
-      this.$router.push({
550
-        name: "drugStockInDetail",
551
-        query: { id: row.id, type: this.type }
552
-      });
653
+    // handleEdit: function(index, row) {
654
+    //   this.$router.push({
655
+    //     name: "drugStockInDetail",
656
+    //     query: { id: row.id, type: this.type }
657
+    //   });
553 658
     
659
+    // },
660
+    handleEdit:function(index,row){
661
+       this.$router.push({
662
+         name:"drugStockInOrderEdit",
663
+         query:{id:row.id,type:this.type}
664
+       })
554 665
     },
555 666
     handleSearch(id){
556 667
        this.WarehouseInfo.warehouseInfoDate=[]
@@ -561,18 +672,20 @@ export default {
561 672
       const params = {
562 673
         id: order_id
563 674
       };
675
+   
564 676
       getDrugWarehouseInfoList(params).then(response => {
565 677
         if (response.data.state == 0) {
566 678
           this.$message.error(response.data.msg);
567 679
           return false;
568 680
         } else {
569 681
           for (let i = 0; i < response.data.data.info.length; i++) {
682
+            this.showOne = true
570 683
             this.WarehouseInfo.warehouseInfoDate = []
571
-            this.WarehouseInfo.warehouseInfoDate.push(
572
-              response.data.data.info[i]
573
-            );
684
+            this.WarehouseInfo.warehouseInfoDate.push(response.data.data.info[i]);
685
+            console.log("列表详情",this.WarehouseInfo.warehouseInfoDate)
574 686
           }
575 687
           this.WarehouseInfo.warehouse = response.data.data.warehousing;
688
+          this.getAllDrugList()
576 689
         }
577 690
       });
578 691
     },
@@ -667,7 +780,49 @@ export default {
667 780
         })
668 781
         .catch(() => {});
669 782
     },
670
-   
783
+    handleCurrentChangeOne(val){
784
+      this.GetOrderDetail(val.id)
785
+      
786
+    },
787
+    getTime(val) {
788
+       if(val < 0){
789
+           return ""
790
+       }
791
+       if(val == ""){
792
+          return ""
793
+        }else {
794
+          return uParseTime(val, '{y}-{m}-{d}')
795
+        }
796
+     },
797
+     getDrugType(id){
798
+       var name = ""
799
+       for(let i=0;i<this.drugTypeList.length;i++){
800
+          if(id == this.drugTypeList[i].id){
801
+            name = this.drugTypeList[i].name
802
+          }
803
+       }
804
+       return name
805
+     },
806
+     getAllDrugList(){
807
+       getAllDrugList().then(response=>{
808
+          if(response.data.state == 1){
809
+            var manufacturerList = response.data.data.manufacturerList
810
+            this.manufacturerList = manufacturerList
811
+          }
812
+       })
813
+     },
814
+     getManufacturer(id){
815
+        var name = ""
816
+        for(let i=0;i<this.manufacturerList.length;i++){
817
+           if(id == this.manufacturerList[i].id){
818
+               name = this.manufacturerList[i].manufacturer_name
819
+           }
820
+        }
821
+        return name
822
+     },
823
+     getDictionaryDataConfig(module, filed_name) {
824
+        return getDictionaryDataConfig(module, filed_name)
825
+      },
671 826
   }
672 827
 };
673 828
 </script>

+ 234 - 110
src/xt_pages/stock/drugs/drugStockInOrderAdd.vue Visa fil

@@ -12,10 +12,7 @@
12 12
     </div>
13 13
     <div class="app-container">
14 14
 
15
-      <!--<stock-in-dialog ref="dialog" :propForm="propForm"-->
16
-                       <!--:visibility="isVisibility"-->
17
-                       <!--v-on:dialog-comfirm="comfirm"-->
18
-                       <!--v-on:dialog-cancle="cancle"></stock-in-dialog>-->
15
+    
19 16
       <drugs-stock-dialog
20 17
         ref="dialog"
21 18
         :propForm="propForm"
@@ -30,9 +27,11 @@
30 27
         <el-date-picker size="small" v-model="warehousing_time" prefix-icon="el-icon-date" :editable="false"
31 28
                         style="width: 196px;" type="date" placeholder="选择日期时间" align="right" format="yyyy-MM-dd"
32 29
                         value-format="yyyy-MM-dd"></el-date-picker>
30
+         <div class="titleOne">制单人:{{this.$store.getters.xt_user.user.user_name}}</div>
31
+         <div class="titleOne">当前进货价合计:</div>
33 32
       </div>
34
-
35
-      <div class="cell clearfix">
33
+     
34
+      <!-- <div class="cell clearfix">
36 35
         <label class="title"><span class="name">经销商</span> : </label>
37 36
         <el-select size="small" v-model="form.dealer" filterable placeholder="请选择经销商" @change="changeDealer">
38 37
           <el-option
@@ -42,9 +41,9 @@
42 41
             :value="option.id">
43 42
           </el-option>
44 43
         </el-select>
45
-      </div>
44
+      </div> -->
46 45
 
47
-      <div class="cell clearfix">
46
+      <!-- <div class="cell clearfix">
48 47
         <label class="title"><span class="name">厂商</span> : </label>
49 48
 
50 49
         <el-select size="small" v-model="form.manufacturer" filterable placeholder="请选择厂商"
@@ -56,7 +55,7 @@
56 55
             :value="option.id">
57 56
           </el-option>
58 57
         </el-select>
59
-      </div>
58
+      </div> -->
60 59
 
61 60
       <el-form :rules="tableRules" :model="recordInfo" ref="tableForm">
62 61
         <el-table
@@ -75,131 +74,132 @@
75 74
 
76 75
             <template slot-scope="scope">
77 76
               <el-form-item style="padding-top: 15px">
78
-                <el-input
79
-                  placeholder="请输入药品名称"
80
-                  v-model="scope.row.drug_id"
81
-                  :value="typeName(scope.row.drug_id)"
82
-                  @focus="showDialog(scope.$index, scope.row)"
83
-                ></el-input>
77
+                  <el-autocomplete
78
+                    class="checkSearch"
79
+                    popper-class="my-autocomplete"
80
+                    v-model="scope.row.drug_name"
81
+                    :fetch-suggestions="querySearchAsync"
82
+                    :trigger-on-focus="false"
83
+                    placeholder="请输入病人名字"
84
+                    @select="handleSelect"
85
+                    @input="changeDrugName(scope.$index)"
86
+                    style="width:160px;"
87
+                  >
88
+                    <i class="el-icon-search el-input__icon" slot="suffix"></i>
89
+                  <template slot-scope="{ item }">
90
+                    <div class="name">{{ item.drug_name }}</div>
91
+                  </template>
92
+                 </el-autocomplete>
84 93
               </el-form-item>
85 94
             </template>
95
+          </el-table-column>
96
+           <el-table-column align="center" width="200">
97
+            <template slot="header" slot-scope="scope">
98
+              <span>药品类型</span>
99
+            </template>
100
+             <template slot-scope="scope">
101
+               <el-select size="small" v-model="scope.row.drug_type" filterable placeholder="请选择厂商">
102
+                <el-option
103
+                  v-for="(option, index) in drugTypeList"
104
+                  :key="index"
105
+                  :label="option.name"
106
+                  :value="option.id">
107
+                </el-option>
108
+               </el-select>
109
+            </template>
86 110
           </el-table-column>
87 111
           <el-table-column align="center" width="200">
88 112
             <template slot="header" slot-scope="scope">
89
-              <span>规格名称<span style="color: red">*</span></span>
113
+              <span>规格&单位</span>
90 114
             </template>
91 115
             <template slot-scope="scope">
92 116
               <el-form-item style="padding-top: 15px">
93 117
                 <el-input
94
-                  placeholder="请输入规格名称"
95
-                  v-model="scope.row.drug_id"
96
-                  :value="specificationName(scope.row.drug_id)"
97
-                  @focus="showDialog(scope.$index, scope.row)"
118
+                  :disabled="true"
119
+                  placeholder="请输入规格&单位"
120
+                  v-model="scope.row.name"
98 121
                 ></el-input>
99 122
               </el-form-item>
100 123
             </template>
101 124
           </el-table-column>
102
-
103
-          <el-table-column align="center" width="150">
125
+         <el-table-column align="center" width="200">
126
+          <template slot="header" slot-scope="scope" >
127
+                <span>批号</span>
128
+            </template>
129
+              <template slot-scope="scope">
130
+                <el-form-item style="padding-top: 15px">
131
+                  <el-input
132
+                    placeholder="请输入批号"
133
+                    v-model="scope.row.lot_number"
134
+                  ></el-input>
135
+                </el-form-item>
136
+              </template>
137
+         </el-table-column>
138
+
139
+         <el-table-column align="center" width="180">
104 140
             <template slot="header" slot-scope="scope">
105
-              <span>进价<span style="color: red">*</span></span>
141
+              <span>入库数量<span style="color: red">*</span></span>
106 142
             </template>
107 143
             <template slot-scope="scope">
108
-              <!--<el-input type="number" v-model="scope.row.price"  @blur="handleBlur(scope.$index, scope.row)"></el-input>-->
109 144
               <el-form-item
110
-                :prop="'recordData.' + scope.$index + '.price'"
111
-                :rules="tableRules.price"
145
+                :prop="'recordData.' + scope.$index + '.warehousing_count'"
146
+                :rules="tableRules.warehousing_count"
112 147
                 style="padding-top: 17px"
113 148
               >
114 149
                 <el-input
115
-                  placeholder="请输入单价"
150
+                  placeholder="请输入入库数量"
116 151
                   type="number"
117
-                  v-model="scope.row.price"
152
+                  v-model="scope.row.warehousing_count"
153
+                  style="width:100px"
118 154
                 ></el-input>
155
+                {{scope.row.max_unit}}
119 156
               </el-form-item>
120 157
             </template>
121 158
           </el-table-column>
122
-
123
-
124
-           <el-table-column align="center" width="180">
125
-            <template slot="header" slot-scope="scope">
126
-              <span>单位<span style="color: red">*</span></span>
127
-            </template>
128
-            <template slot-scope="scope">
129
-             
130
-              <el-form-item
131
-                :prop="'recordData.' + scope.$index + '.min_unit'"
132
-                :rules="tableRules.min_unit"
133
-                style="padding-top: 17px"
134
-              >
135
-               <el-select v-model="scope.row.min_unit" style="width:160px;" placeholder="请选择">
136
-                <el-option
137
-                  v-for="(item,index) in getDataConfig('hemodialysis','units')"
138
-                  :key="index"
139
-                  :label="item.name"
140
-                  :value="item.name">
141
-                </el-option>
142
-              </el-select>
143
-              </el-form-item>
144
-            </template>
145
-          </el-table-column>
146
-
147
-
148
-          <el-table-column align="center" width="180">
159
+       
160
+          <el-table-column align="center" width="150">
149 161
             <template slot="header" slot-scope="scope">
150
-              <span>入库数量<span style="color: red">*</span></span>
162
+              <span>进货单价(元)<span style="color: red">*</span></span>
151 163
             </template>
152 164
             <template slot-scope="scope">
153
-              <!--{{scope.row.warehousing_count}}-->
154
-              <!--<el-input type="number" v-model="scope.row.warehousing_count"   @blur="handleBlur(scope.$index, scope.row)"></el-input>-->
155
-
156 165
               <el-form-item
157
-                :prop="'recordData.' + scope.$index + '.warehousing_count'"
158
-                :rules="tableRules.warehousing_count"
166
+                :prop="'recordData.' + scope.$index + '.price'"
167
+                :rules="tableRules.last_price"
159 168
                 style="padding-top: 17px"
160 169
               >
161 170
                 <el-input
162
-                  placeholder="请输入入库数量"
171
+                  style="width:100px"
172
+                  placeholder="请输入单价"
163 173
                   type="number"
164
-                  v-model="scope.row.warehousing_count"
174
+                  v-model="scope.row.last_price"
165 175
                 ></el-input>
176
+               
166 177
               </el-form-item>
167 178
             </template>
168 179
           </el-table-column>
169
-          <el-table-column label="进价总价" align="center" width="150">
170
-            <template slot-scope="scope">
171
-              {{ calculate(scope.row.price * scope.row.warehousing_count) }}
172
-            </template>
173
-          </el-table-column>
174 180
 
175
-          <el-table-column label="零售价" align="center" width="150">
181
+          <el-table-column label="总价(元)" align="center" width="150">
176 182
             <template slot-scope="scope">
177
-              {{ scope.row.retail_price }}
183
+              {{ calculate(scope.row.last_price * scope.row.warehousing_count) }} 
178 184
             </template>
179 185
           </el-table-column>
180 186
 
181
-          <el-table-column label="零价总价" align="center" width="150">
187
+          <el-table-column label="生产厂家" width="250" align="center">
182 188
             <template slot-scope="scope">
183
-              {{ calculate(scope.row.retail_price * scope.row.warehousing_count) }}
184
-            </template>
185
-          </el-table-column>
186
-          <el-table-column align="center" width="150">
187
-            <template slot="header" slot-scope="scope">
188
-              <span>批号</span>
189
-            </template>
190
-            <template slot-scope="scope">
191
-              <el-form-item>
192
-                <el-input
193
-                  placeholder="请输入批号"
194
-                  v-model="scope.row.number"
195
-                ></el-input>
196
-              </el-form-item>
189
+               <el-select size="small" v-model="scope.row.manufacturer" filterable placeholder="请选择厂商">
190
+                <el-option
191
+                  v-for="(option, index) in manufacturerList"
192
+                  :key="index"
193
+                  :label="option.manufacturer_name"
194
+                  :value="option.id">
195
+                </el-option>
196
+               </el-select>
197 197
             </template>
198 198
           </el-table-column>
199
+ 
199 200
 
200 201
           <el-table-column label="生产日期" width="250" align="center">
201 202
             <template slot-scope="scope">
202
-              <!--{{scope.row.product_date | parseTime("{y}-{m}-{d}")}}-->
203 203
               <el-date-picker
204 204
                 prefix-icon="el-icon-date"
205 205
                 style="width: 145px"
@@ -213,7 +213,6 @@
213 213
           </el-table-column>
214 214
           <el-table-column label="有效日期" width="250" align="center">
215 215
             <template slot-scope="scope">
216
-              <!--{{ scope.row.expiry_date | parseTime("{y}-{m}-{d}")}}-->
217 216
               <el-date-picker
218 217
                 prefix-icon="el-icon-date"
219 218
                 style="width: 145px"
@@ -225,6 +224,18 @@
225 224
               ></el-date-picker>
226 225
             </template>
227 226
           </el-table-column>
227
+        
228
+        <el-table-column align="center" width="150" label="批准文号">
229
+            <template slot-scope="scope">
230
+              <el-form-item>
231
+                <el-input
232
+                  placeholder="请输入批准文号"
233
+                  v-model="scope.row.batch_number"
234
+                ></el-input>
235
+              </el-form-item>
236
+            </template>
237
+          </el-table-column>
238
+       
228 239
           <el-table-column label="备注" width="150" align="center">
229 240
             <template slot-scope="scope">
230 241
               <el-input v-model="scope.row.remark"></el-input>
@@ -279,7 +290,6 @@
279 290
 
280 291
 <script>
281 292
   import { uParseTime } from '@/utils/tools'
282
-
283 293
   import {
284 294
     GetAllConfig,
285 295
     GetAllDrugInfoByID,
@@ -287,7 +297,8 @@
287 297
   } from "@/api/drug/drug_stock";
288 298
   import BreadCrumb from '../../components/bread-crumb'
289 299
   import DrugsStockDialog from './drugsStockDialog/index'
290
-  import {getDataConfig } from "@/utils/data";
300
+  import {getDataConfig, getDictionaryDataConfig } from "@/utils/data";
301
+  import {getAllDrugList,postSearchDrugList } from "@/api/data"
291 302
   export default {
292 303
     components: { DrugsStockDialog, BreadCrumb },
293 304
     name: 'stockIn',
@@ -392,7 +403,13 @@
392 403
         manufacturer: [],
393 404
         dealer: [],
394 405
         goodType: [],
395
-        goodInfo:[]
406
+        goodInfo:[],
407
+        drugList:[],
408
+        manufacturerList:[],
409
+        showOne:true,
410
+        showTwo:false,
411
+        drugTypeList:[],
412
+        totalPrice:0,
396 413
       }
397 414
     },
398 415
     methods: {
@@ -421,7 +438,6 @@
421 438
         this.isVisibility = true
422 439
       }, 
423 440
       comfirm: function(val) {
424
-        console.log("Val2222222",val)
425 441
         this.$refs.dialog.hide()
426 442
         if (val.selectedGoodInfo.length > 0) {
427 443
           for (let i = val.selectedGoodInfo.length - 1; i >= 0; i--) {
@@ -498,7 +514,8 @@
498 514
           }
499 515
         }
500 516
         return name;
501
-      }, specificationName: function(drug_id) {
517
+      },
518
+       specificationName: function(drug_id) {
502 519
         let name = "";
503 520
         for (let i = 0; i < this.goodInfo.length; i++) {
504 521
           if (this.goodInfo[i].id == drug_id) {
@@ -506,9 +523,19 @@
506 523
           }
507 524
         }
508 525
         return name;
526
+      },
527
+      getDrugName:function(drug_id){
528
+        let name = ""
529
+        for(let i=0;i<this.recordInfo.recordData.length;i++){
530
+           if(drug_id == this.recordInfo.recordData[i].id){
531
+              name = this.recordInfo.recordData[i].dosage + this.recordInfo.recordData[i].max_unit + "*" + this.recordInfo.recordData[i].min_number + this.recordInfo.recordData[i].min_unit + "/"+this.recordInfo.recordData[i].packing_unit
532
+           }
533
+        }
534
+        return name
509 535
       },
510 536
        handleEdit: function(index, row) {
511 537
         const tempObj = {}
538
+        tempObj['drug_name'] = ''
512 539
         tempObj['drug_id'] = 0
513 540
         tempObj['number'] = ''
514 541
         tempObj['product_date'] = ''
@@ -520,6 +547,8 @@
520 547
         tempObj['dealer'] = ''
521 548
         tempObj['manufacturer'] = ''
522 549
         tempObj['min_unit'] = ''
550
+        tempObj["drug_type"] = ''
551
+        tempObj['batch_number'] = ''
523 552
         this.recordInfo.recordData.push(tempObj)
524 553
       }, handleDelete: function(index, row) {
525 554
         if (this.recordInfo.recordData.length <= 1) {
@@ -534,19 +563,7 @@
534 563
         }
535 564
         return Math.round(parseFloat(val) * 100) / 100
536 565
       },
537
-      // GetWarehouseInfoByOrdeNumber: function() {
538
-      //   const params = {
539
-      //     'warehousing_order': sessionStorage.getItem('warehousing_orders')
540
-      //   }
541
-      //   this.recordInfo.recordData = []
542
-      //   getWarehouseInfoByOrdeNumber(params).then(response => {
543
-      //     if (response.data.state != 0) {
544
-      //       for (let i = 0; i < response.data.data.info.length; i++) {
545
-      //         this.recordInfo.recordData.push(response.data.data.info[i])
546
-      //       }
547
-      //     }
548
-      //   })
549
-      // },
566
+     
550 567
       getTime(val, temp) {
551 568
         if (val != 0) {
552 569
           return uParseTime(val, temp)
@@ -642,8 +659,9 @@
642 659
       submit() {
643 660
         this.$refs['tableForm'].validate((valid) => {
644 661
           if (valid) {
662
+            
645 663
             const array = this.recordInfo.recordData
646
-            console.log(array)
664
+          
647 665
             for (let i = 0; i < array.length; i++) {
648 666
 
649 667
               if (array[i].drug_id == 0) {
@@ -656,10 +674,13 @@
656 674
               this.$message.success('请添加入库商品')
657 675
               return
658 676
             }
659
-
677
+            for(let i=0;i<this.recordInfo.recordData.length;i++){
678
+               this.recordInfo.recordData[i].last_price = this.recordInfo.recordData[i].last_price.toString()
679
+            }
660 680
             const params = {
661 681
               'stockIn': this.recordInfo.recordData
662 682
             }
683
+            console.log("params2222222",params)
663 684
             postDrugWarehouse(params, this.warehousing_time, this.form.manufacturer, this.form.dealer, this.type).then(response => {
664 685
               if (response.data.state == 0) {
665 686
                 this.$message.error(response.data.msg)
@@ -686,9 +707,90 @@
686 707
       getDataConfig(module, filed_name){
687 708
         return getDataConfig(module, filed_name)
688 709
       },
710
+     
711
+      getDictionaryDataConfig(module, filed_name) {
712
+        return getDictionaryDataConfig(module, filed_name)
713
+      },
714
+
715
+  // 改版后的JS
716
+      getlist(){
717
+        getAllDrugList().then(response=>{
718
+           if(response.data.state == 1){
719
+             var list = response.data.data.list
720
+             this.drugList = list
721
+             var manufacturerList = response.data.data.manufacturerList
722
+             this.manufacturerList = manufacturerList
723
+             for(let i=0;i<this.drugList.length;i++){
724
+                for(let j=0;j<this.manufacturerList.length;j++){
725
+                  if(this.drugList[i].manufacturer == this.manufacturerList[j].id){
726
+                     this.drugList[i].manufacturer = this.manufacturerList[j].manufacturer_name
727
+                  }
728
+                }
729
+             }
730
+           }
731
+        })
732
+      },
733
+
734
+      changeDrugName(val){
735
+        console.log("val22222",val)
736
+        this.showOne = false
737
+        this.showTwo = true
738
+      },
739
+      querySearchAsync(keyword, cb) {
740
+        let key = '';
741
+        if (keyword != undefined) {
742
+          key = keyword
743
+        }
744
+        let searchArray = [];
745
+        postSearchDrugList(key).then(response => {
746
+          if (response.data.state == 1) {
747
+            searchArray = response.data.data.list;
748
+            
749
+             var list = response.data.data.list
750
+             console.log("猎豹22222222222",list)
751
+
752
+             this.drugList = list
753
+             var manufacturerList = response.data.data.manufacturerList
754
+             this.manufacturerList = manufacturerList
755
+             for(let i=0;i<this.drugList.length;i++){
756
+             
757
+                for(let j=0;j<this.manufacturerList.length;j++){
758
+                  if(this.drugList[i].manufacturer == this.manufacturerList[j].id){
759
+                     this.drugList[i].manufacturer = this.manufacturerList[j].manufacturer_name
760
+                  }
761
+                }
762
+             }
763
+           
764
+             cb(this.drugList)
765
+          } else {
766
+            cb([])
767
+          }
768
+        })
769
+      },
770
+      changeDrugName(val){
771
+        this.currentIndex = val
772
+      },
773
+      handleSelect(val){
774
+         for(let i=0;i<this.recordInfo.recordData.length;i++){
775
+           if(i == this.currentIndex){
776
+             this.recordInfo.recordData[i].drug_id  = val.id
777
+             this.recordInfo.recordData[i].drug_name = val.drug_name
778
+             this.recordInfo.recordData[i].drug_type = val.drug_type
779
+             this.recordInfo.recordData[i].name  = val.dose +val.dose_unit+"*"+val.min_number+ val.min_unit+"/"+val.max_unit
780
+             this.recordInfo.recordData[i].last_price = val.last_price
781
+             this.recordInfo.recordData[i].manufacturer =  val.manufacturer
782
+             this.recordInfo.recordData[i].batch_number = val.number
783
+             this.recordInfo.recordData[i].max_unit = val.max_unit
784
+           }
785
+        }
786
+        console.log("333333",this.recordInfo.recordData)
787
+      }
788
+     
689 789
     }
690 790
     ,
691 791
     created() {
792
+      this.drugTypeList = getDictionaryDataConfig('system','drug_type') 
793
+     
692 794
       var nowDate = new Date()
693 795
       var nowYear = nowDate.getFullYear()
694 796
       var nowMonth = nowDate.getMonth() + 1
@@ -700,20 +802,33 @@
700 802
         '-' +
701 803
         (nowDay < 10 ? '0' + nowDay : nowDay)
702 804
       const tempObj = {}
805
+
703 806
       tempObj['drug_id'] = 0
704
-      tempObj['number'] = ''
807
+      tempObj['drug_name'] = ''
808
+      tempObj['dosage'] = ''
809
+      tempObj['max_unit'] = ''
810
+      tempObj['min_unit'] = '',
811
+      tempObj['packing_unit'] = '',
812
+      tempObj['lot_number'] = ''
705 813
       tempObj['product_date'] = ''
706 814
       tempObj['expiry_date'] = ''
707 815
       tempObj['warehousing_count'] = ''
708 816
       tempObj['retail_price'] = ''
709
-      tempObj['price'] = ''
817
+      tempObj['last_price'] = ''
710 818
       tempObj['remark'] = ''
711 819
       tempObj['dealer'] = ''
712 820
       tempObj['manufacturer'] = ''
713
-      tempObj['min_unit'] = ''
821
+      tempObj['batch_number'] = ''
822
+      tempObj['drug_type'] = ''
823
+      tempObj['batch_number'] = ''
824
+      
714 825
       this.recordInfo.recordData.push(tempObj)
826
+      
715 827
       this.GetConfigInfo()
716 828
       this.propForm.goodUnit = this.$store.getters.good_unit
829
+      
830
+     
831
+    
717 832
     }
718 833
 
719 834
   }
@@ -743,6 +858,15 @@
743 858
     margin-bottom: 15px;
744 859
   }
745 860
 
861
+  .titleOne {
862
+    width: 120px;
863
+    display: inline-block;
864
+    font-weight: normal;
865
+    color: #909399;
866
+    padding: 6px 0;
867
+    margin-left:20px;
868
+}
869
+
746 870
 </style>
747 871
 
748 872
 <style>

+ 1 - 1
src/xt_pages/stock/drugs/drugStockInOrderDetail.vue Visa fil

@@ -37,7 +37,7 @@
37 37
 
38 38
       <div class="cell clearfix" style="margin-top: 10px">
39 39
         <el-button size="small" icon="el-icon-edit" @click="editRecord"
40
-          >编辑</el-button
40
+          >编辑222</el-button
41 41
         >
42 42
         <el-button size="small" icon="el-icon-delete" @click="deleteRecord"
43 43
           >删除</el-button

+ 188 - 96
src/xt_pages/stock/drugs/drugStockInOrderEdit.vue Visa fil

@@ -58,7 +58,7 @@
58 58
         </el-date-picker>
59 59
       </div>
60 60
 
61
-      <div class="cell clearfix">
61
+      <!-- <div class="cell clearfix">
62 62
         <label class="title"><span class="name">经销商</span> : </label>
63 63
         <el-select
64 64
           size="small"
@@ -93,8 +93,11 @@
93 93
           >
94 94
           </el-option>
95 95
         </el-select>
96
-      </div>
96
+      </div> -->
97
+
97 98
 
99
+
100
+   <!-- 编辑入库单详情 -->
98 101
       <el-form :rules="tableRules" :model="recordInfo" ref="tableForm">
99 102
         <el-table
100 103
           id="oictable"
@@ -112,59 +115,73 @@
112 115
 
113 116
             <template slot-scope="scope">
114 117
               <el-form-item style="padding-top: 15px">
115
-                <el-input
116
-                  placeholder="请输入药品名称"
117
-                  v-model="scope.row.drug_id"
118
-                  :value="typeName(scope.row.drug_id)"
119
-                  @focus="showDialog(scope.$index, scope.row)"
120
-                ></el-input>
118
+                 <el-autocomplete
119
+                    class="checkSearch"
120
+                    popper-class="my-autocomplete"
121
+                    v-model="scope.row.drug_name"
122
+                    :fetch-suggestions="querySearchAsync"
123
+                    :trigger-on-focus="false"
124
+                    placeholder="请输入病人名字"
125
+                    @select="handleSelect"
126
+                    @input="changeDrugName(scope.$index)"
127
+                    style="width:160px;"
128
+                  >
129
+                    <i class="el-icon-search el-input__icon" slot="suffix"></i>
130
+                  <template slot-scope="{ item }">
131
+                    <div class="name">{{ item.drug_name }}</div>
132
+                  </template>
133
+                 </el-autocomplete>
121 134
               </el-form-item>
122 135
             </template>
123 136
           </el-table-column>
124
-          <el-table-column align="center" width="200">
137
+         <el-table-column align="center" width="200">
125 138
             <template slot="header" slot-scope="scope">
126
-              <span>规格名称<span style="color: red">*</span></span>
139
+              <span>药品类型</span>
127 140
             </template>
128
-            <template slot-scope="scope">
129
-              <el-form-item style="padding-top: 15px">
130
-                <el-input
131
-                  placeholder="请输入规格名称"
132
-                  v-model="scope.row.drug_id"
133
-                  :value="specificationName(scope.row.drug_id)"
134
-                  @focus="showDialog(scope.$index, scope.row)"
135
-                ></el-input>
136
-              </el-form-item>
141
+             <template slot-scope="scope">
142
+               <el-select size="small" v-model="scope.row.drug_type" filterable placeholder="请选择厂商">
143
+                <el-option
144
+                  v-for="(option, index) in drugTypeList"
145
+                  :key="index"
146
+                  :label="option.name"
147
+                  :value="option.id">
148
+                </el-option>
149
+               </el-select>
137 150
             </template>
138 151
           </el-table-column>
139
-
140
-          <el-table-column align="center" width="150">
152
+          <el-table-column align="center" width="200">
141 153
             <template slot="header" slot-scope="scope">
142
-              <span>进价<span style="color: red">*</span></span>
154
+              <span>规格&单位</span>
143 155
             </template>
144 156
             <template slot-scope="scope">
145
-              <!--<el-input type="number" v-model="scope.row.price"  @blur="handleBlur(scope.$index, scope.row)"></el-input>-->
146
-              <el-form-item
147
-                :prop="'recordData.' + scope.$index + '.price'"
148
-                :rules="tableRules.price"
149
-                style="padding-top: 17px"
150
-              >
157
+              <el-form-item style="padding-top: 15px">
151 158
                 <el-input
152
-                  placeholder="请输入单价"
153
-                  type="number"
154
-                  v-model="scope.row.price"
159
+                  :disabled="true"
160
+                  placeholder="请输入规格&单位"
161
+                  v-model="scope.row.name"
155 162
                 ></el-input>
156 163
               </el-form-item>
157 164
             </template>
158 165
           </el-table-column>
159
-
160
-          <el-table-column align="center" width="180">
166
+          <el-table-column align="center" width="200">
167
+            <template slot="header" slot-scope="scope" >
168
+              <span>批号</span>
169
+              </template>
170
+                <template slot-scope="scope">
171
+                  <el-form-item style="padding-top: 15px">
172
+                    <el-input
173
+                      placeholder="请输入批号"
174
+                      v-model="scope.row.lot_number"
175
+                    ></el-input>
176
+                  </el-form-item>
177
+                </template>
178
+          </el-table-column>
179
+                   
180
+         <el-table-column align="center" width="180">
161 181
             <template slot="header" slot-scope="scope">
162 182
               <span>入库数量<span style="color: red">*</span></span>
163 183
             </template>
164 184
             <template slot-scope="scope">
165
-              <!--{{scope.row.warehousing_count}}-->
166
-              <!--<el-input type="number" v-model="scope.row.warehousing_count"   @blur="handleBlur(scope.$index, scope.row)"></el-input>-->
167
-
168 185
               <el-form-item
169 186
                 :prop="'recordData.' + scope.$index + '.warehousing_count'"
170 187
                 :rules="tableRules.warehousing_count"
@@ -174,44 +191,54 @@
174 191
                   placeholder="请输入入库数量"
175 192
                   type="number"
176 193
                   v-model="scope.row.warehousing_count"
194
+                  style="width:100px"
177 195
                 ></el-input>
196
+                {{scope.row.max_unit}}
178 197
               </el-form-item>
179 198
             </template>
180 199
           </el-table-column>
181
-          <el-table-column label="进价总价" align="center" width="150">
182
-            <template slot-scope="scope">
183
-              {{ calculate(scope.row.price * scope.row.warehousing_count) }}
184
-            </template>
185
-          </el-table-column>
186
-
187
-          <el-table-column label="零价" align="center" width="150">
188
-            <template slot-scope="scope">
189
-              {{ scope.row.retail_price }}
190
-            </template>
200
+          <el-table-column>
201
+            <template slot="header" slot-scope="scope">
202
+                <span>进货单价(元)<span style="color: red">*</span></span>
203
+              </template>
204
+              <template slot-scope="scope">
205
+                <el-form-item
206
+                  :prop="'recordData.' + scope.$index + '.price'"
207
+                  :rules="tableRules.last_price"
208
+                  style="padding-top: 17px"
209
+                >
210
+                  <el-input
211
+                    style="width:100px"
212
+                    placeholder="请输入单价"
213
+                    type="number"
214
+                    v-model="scope.row.last_price"
215
+                  ></el-input>
216
+                
217
+                </el-form-item>
218
+              </template>
191 219
           </el-table-column>
192 220
 
193
-          <el-table-column label="零价总价" align="center" width="150">
221
+          <el-table-column label="总价(元)" align="center" width="150">
194 222
             <template slot-scope="scope">
195
-              {{ calculate(scope.row.retail_price * scope.row.warehousing_count) }}
223
+              {{ calculate(scope.row.last_price * scope.row.warehousing_count) }} 
196 224
             </template>
197 225
           </el-table-column>
198
-          <el-table-column align="center" width="150">
199
-            <template slot="header" slot-scope="scope">
200
-              <span>批号</span>
201
-            </template>
226
+         
227
+          <el-table-column label="生产厂家" width="250" align="center">
202 228
             <template slot-scope="scope">
203
-              <el-form-item>
204
-                <el-input
205
-                  placeholder="请输入批号"
206
-                  v-model="scope.row.number"
207
-                ></el-input>
208
-              </el-form-item>
229
+               <el-select size="small" v-model="scope.row.manufacturer" filterable placeholder="请选择厂商">
230
+                <el-option
231
+                  v-for="(option, index) in manufacturerList"
232
+                  :key="index"
233
+                  :label="option.manufacturer_name"
234
+                  :value="option.id">
235
+                </el-option>
236
+               </el-select>
209 237
             </template>
210 238
           </el-table-column>
211 239
 
212 240
           <el-table-column label="生产日期" width="250" align="center">
213 241
             <template slot-scope="scope">
214
-              <!--{{scope.row.product_date | parseTime("{y}-{m}-{d}")}}-->
215 242
               <el-date-picker
216 243
                 prefix-icon="el-icon-date"
217 244
                 style="width: 145px"
@@ -223,9 +250,10 @@
223 250
               ></el-date-picker>
224 251
             </template>
225 252
           </el-table-column>
226
-          <el-table-column label="有效日期" width="250" align="center">
253
+
254
+
255
+         <el-table-column label="有效日期" width="250" align="center">
227 256
             <template slot-scope="scope">
228
-              <!--{{ scope.row.expiry_date | parseTime("{y}-{m}-{d}")}}-->
229 257
               <el-date-picker
230 258
                 prefix-icon="el-icon-date"
231 259
                 style="width: 145px"
@@ -237,6 +265,7 @@
237 265
               ></el-date-picker>
238 266
             </template>
239 267
           </el-table-column>
268
+ 
240 269
           <el-table-column label="备注" width="150" align="center">
241 270
             <template slot-scope="scope">
242 271
               <el-input v-model="scope.row.remark"></el-input>
@@ -301,7 +330,8 @@ import {
301 330
 } from "@/api/drug/drug_stock";
302 331
 import BreadCrumb from "../../components/bread-crumb";
303 332
 import DrugsStockDialog from './drugsStockDialog/index'
304
-
333
+import {postSearchDrugList} from "@/api/data"
334
+import {getDataConfig, getDictionaryDataConfig } from "@/utils/data";
305 335
 export default {
306 336
   components: { DrugsStockDialog, BreadCrumb },
307 337
   name: "stockIn",
@@ -369,12 +399,14 @@ export default {
369 399
       dealer: [],
370 400
       goodType: [],
371 401
       goodInfo:[],
402
+      drugList:[],
403
+      manufacturerList:[],
372 404
     };
373 405
   },
374 406
   methods: {
375 407
     comfirm: function(val) {
376 408
       this.$refs.dialog.hide();
377
-      console.log(val)
409
+   
378 410
       if (val.selectedGoodInfo.length > 0) {
379 411
         for (let i = val.selectedGoodInfo.length - 1; i >= 0 ; i--) {
380 412
           if (i == 0) {
@@ -409,7 +441,7 @@ export default {
409 441
         }
410 442
       }
411 443
 
412
-      console.log( this.recordInfo.recordData)
444
+      // console.log( this.recordInfo.recordData)
413 445
 
414 446
       this.currentIndex = -1;
415 447
     },
@@ -458,7 +490,7 @@ export default {
458 490
       return name;
459 491
     },
460 492
     specificationName: function(drug_id) {
461
-      console.log(this.goodInfo)
493
+ 
462 494
       let name = "";
463 495
       for (let i = 0; i < this.goodInfo.length; i++) {
464 496
         if (this.goodInfo[i].id == drug_id) {
@@ -480,8 +512,8 @@ export default {
480 512
       tempObj["dealer"] = "";
481 513
       tempObj["manufacturer"] = "";
482 514
       tempObj['retail_price'] = ""
483
-
484
-
515
+      tempObj['drug_name'] = ""
516
+      tempObj['manufacturer'] = ""
485 517
       this.recordInfo.recordData.push(tempObj);
486 518
     },
487 519
     handleDelete: function(index, row) {
@@ -580,6 +612,7 @@ export default {
580 612
       this.$refs["tableForm"].validate(valid => {
581 613
         if (valid) {
582 614
           const array = this.recordInfo.recordData;
615
+        
583 616
           for (let i = 0; i < array.length; i++) {
584 617
             if (array[i].drug_id == 0) {
585 618
               this.$message.error("药品名称或者药品规格名称不能为空");
@@ -594,12 +627,15 @@ export default {
594 627
              if(this.recordInfo.recordData[i].manufacturer == ""){
595 628
                this.recordInfo.recordData[i].manufacturer = 0
596 629
              }
630
+
631
+             this.recordInfo.recordData[i].last_price = this.recordInfo.recordData[i].drug.last_price.toString()
632
+             this.recordInfo.recordData[i].manufacturer = this.recordInfo.recordData[i].drug.manufacturer
597 633
             
598 634
           }
599 635
           const params = {
600 636
             stockIn: this.recordInfo.recordData
601 637
           };
602
-          console.log("params",params)
638
+          console.log("params22222222222",params)
603 639
          
604 640
           EditDrugWarehouse(
605 641
             params,
@@ -632,6 +668,9 @@ export default {
632 668
           this.$message.error(response.data.msg);
633 669
           return false;
634 670
         } else {
671
+       
672
+          var manufacturerList = response.data.data.manufacturerList
673
+          console.log("000000000000",response.data.data.info)
635 674
           for (let i = 0; i < response.data.data.info.length; i++) {
636 675
             response.data.data.info[i].product_date = this.getTime(
637 676
               response.data.data.info[i].product_date,
@@ -641,22 +680,38 @@ export default {
641 680
               response.data.data.info[i].expiry_date,
642 681
               "{y}-{m}-{d}"
643 682
             );
644
-            response.data.data.info[i].price = response.data.data.info[
645
-              i
646
-            ].price.toString();
683
+            response.data.data.info[i].price = response.data.data.info[i].price.toString();
684
+
685
+            response.data.data.info[i].retail_price = response.data.data.info[i].retail_price.toString();
686
+
687
+            response.data.data.info[i].warehousing_count = response.data.data.info[i].warehousing_count.toString();
688
+             
689
+            response.data.data.info[i].name = response.data.data.info[i].drug.dose + response.data.data.info[i].drug.dose_unit+"*"+response.data.data.info[i].drug.min_number+ response.data.data.info[i].drug.min_unit+"/"+response.data.data.info[i].drug.max_unit
690
+
691
+            response.data.data.info[i].lot_number = response.data.data.info[i].number
647 692
 
648
-            response.data.data.info[i].retail_price = response.data.data.info[
649
-              i
650
-              ].retail_price.toString();
693
+            response.data.data.info[i].drug_name = response.data.data.info[i].drug.drug_name
651 694
 
652
-            response.data.data.info[
653
-              i
654
-            ].warehousing_count = response.data.data.info[
655
-              i
656
-            ].warehousing_count.toString();
695
+            response.data.data.info[i].last_price = response.data.data.info[i].drug.last_price
696
+
697
+            response.data.data.info[i].max_unit = response.data.data.info[i].drug.max_unit
698
+            
699
+            response.data.data.info[i].drug_type = response.data.data.info[i].drug.drug_type
657 700
 
701
+           if(response.data.data.info[i].manufacturer == 0){
702
+               response.data.data.info[i].manufacturer = ""
703
+            }
704
+          
658 705
             this.recordInfo.recordData.push(response.data.data.info[i]);
706
+           
707
+            for(let j=0;j<manufacturerList.length;j++){
708
+              if(response.data.data.info[i].manufacturer == manufacturerList[j].id){
709
+                 response.data.data.info[i].manufacturer = manufacturerList[j].manufacturer_name
710
+               }
711
+            }
659 712
           }
713
+          console.log("列表详情",this.recordInfo.recordData)
714
+
660 715
 
661 716
           this.warehouse = response.data.data.warehousing;
662 717
           this.form.manufacturer = this.warehouse.manufacturer;
@@ -667,28 +722,65 @@ export default {
667 722
             "{y}-{m}-{d}"
668 723
           );
669 724
 
670
-          if (this.recordInfo.recordData.length == 0) {
671
-            const tempObj = {};
672
-            tempObj["id"] = 0;
673
-            tempObj["drug_id"] = 0;
674
-            tempObj["number"] = "";
675
-            tempObj["product_date"] = "";
676
-            tempObj["expiry_date"] = "";
677
-            tempObj["warehousing_count"] = "";
678
-            tempObj["price"] = "";
679
-            tempObj["remark"] = "";
680
-            tempObj["dealer"] = "";
681
-            tempObj["manufacturer"] = "";
682
-            tempObj['retail_price'] = ""
683
-
684
-            this.recordInfo.recordData.push(tempObj);
685
-          }
725
+        
686 726
         }
687 727
       });
688
-    }
728
+    },
729
+      getDictionaryDataConfig(module, filed_name) {
730
+        return getDictionaryDataConfig(module, filed_name)
731
+      },
732
+
733
+      querySearchAsync(keyword, cb) {
734
+        let key = '';
735
+        if (keyword != undefined) {
736
+          key = keyword
737
+        }
738
+        let searchArray = [];
739
+        postSearchDrugList(key).then(response => {
740
+          if (response.data.state == 1) {
741
+             searchArray = response.data.data.list;
742
+             var list = response.data.data.list
743
+         
744
+             this.drugList = list
745
+             var manufacturerList = response.data.data.manufacturerList
746
+             this.manufacturerList = manufacturerList
747
+             for(let i=0;i<this.drugList.length;i++){
748
+               
749
+                for(let j=0;j<this.manufacturerList.length;j++){
750
+                  if(this.drugList[i].manufacturer == this.manufacturerList[j].id){
751
+                     this.drugList[i].manufacturer = this.manufacturerList[j].manufacturer_name
752
+
753
+                  }
754
+                }
755
+             }
756
+             cb(this.drugList)
757
+          } else {
758
+            cb([])
759
+          }
760
+        })
761
+      },
762
+      changeDrugName(val){
763
+        this.currentIndex = val
764
+      },
765
+      handleSelect(val){
766
+        for(let i=0;i<this.recordInfo.recordData.length;i++){
767
+           if(i == this.currentIndex){
768
+             this.recordInfo.recordData[i].lot_number = ""
769
+             this.recordInfo.recordData[i].drug_name = val.drug_name
770
+             this.recordInfo.recordData[i].drug_type = val.drug_type
771
+             this.recordInfo.recordData[i].name  = val.dose +val.dose_unit+"*"+val.min_number+ val.min_unit+"/"+val.max_unit
772
+             this.recordInfo.recordData[i].last_price = val.last_price
773
+             this.recordInfo.recordData[i].manufacturer =  val.manufacturer
774
+             this.recordInfo.recordData[i].batch_number = val.number
775
+             this.recordInfo.recordData[i].max_unit = val.max_unit
776
+           }
777
+        }
778
+      },
779
+    
689 780
 
690 781
   },
691 782
   created() {
783
+    this.drugTypeList = getDictionaryDataConfig('system','drug_type') 
692 784
     this.GetConfigInfo();
693 785
     this.propForm.goodUnit = this.$store.getters.good_unit;
694 786
     const order_id = this.$route.query.id;

+ 3 - 1
src/xt_pages/stock/drugs/drugStockOutOrder.vue Visa fil

@@ -607,6 +607,7 @@ export default {
607 607
             this.$message.error(response.data.msg)
608 608
             return false
609 609
           } else {
610
+          
610 611
             this.warehousingOutInfo.warehousingOutData=[]
611 612
             for (let i = 0; i < response.data.data.list.length; i++) {
612 613
 
@@ -727,6 +728,7 @@ export default {
727 728
           } else {
728 729
             this.userList=[]
729 730
             var total = 0
731
+            console.log("888888888888",response.data.data.list)
730 732
             for (let i = 0; i < response.data.data.list.length; i++) {
731 733
               var obj = response.data.data.list[i]
732 734
               obj['is_total'] = 0
@@ -739,7 +741,7 @@ export default {
739 741
               total: total,
740 742
             })
741 743
 
742
-            console.log(this.userList)
744
+            
743 745
           }
744 746
         })
745 747
       },

+ 231 - 35
src/xt_pages/stock/drugs/drugStockOutOrderAdd.vue Visa fil

@@ -111,72 +111,111 @@
111 111
 
112 112
             <template slot-scope="scope">
113 113
               <el-form-item style="padding-top: 15px">
114
-                <el-input
115
-                  placeholder="请输入药品名称"
116
-                  v-model="scope.row.drug_id"
117
-                  :value="typeName(scope.row.drug_id)"
118
-                  @focus="showDialog(scope.$index, scope.row)"
119
-                ></el-input>
114
+                <el-autocomplete
115
+                    class="checkSearch"
116
+                    popper-class="my-autocomplete"
117
+                    v-model="scope.row.drug_name"
118
+                    :fetch-suggestions="querySearchAsync"
119
+                    :trigger-on-focus="false"
120
+                    placeholder="请输入病人名字"
121
+                    @select="handleSelect"
122
+                    style="width:160px;"
123
+                  >
124
+                    <i class="el-icon-search el-input__icon" slot="suffix"></i>
125
+                  <template slot-scope="{ item }">
126
+                    <div class="name">{{ item.drug_name }}</div>
127
+                  </template>
128
+                 </el-autocomplete>
120 129
               </el-form-item>
121 130
             </template>
122 131
           </el-table-column>
123 132
           <el-table-column align="center" width="200">
124 133
             <template slot="header" slot-scope="scope">
125
-              <span>规格名称<span style="color: red">*</span></span>
134
+              <span>药品类型</span>
135
+            </template>
136
+             <template slot-scope="scope">
137
+               <el-select size="small" v-model="scope.row.drug_type" filterable placeholder="请选择厂商">
138
+                <el-option
139
+                  v-for="(option, index) in drugTypeList"
140
+                  :key="index"
141
+                  :label="option.name"
142
+                  :value="option.id">
143
+                </el-option>
144
+               </el-select>
145
+            </template>
146
+          </el-table-column>
147
+          <el-table-column align="center" width="200">
148
+            <template slot="header" slot-scope="scope">
149
+              <span>规格&单位<span style="color: red">*</span></span>
126 150
             </template>
127 151
             <template slot-scope="scope">
128 152
               <el-form-item style="padding-top: 15px">
129 153
                 <el-input
130
-                  placeholder="请输入规格名称"
131
-                  v-model="scope.row.drug_id"
132
-                  :value="specificationName(scope.row.drug_id)"
133
-                  @focus="showDialog(scope.$index, scope.row)"
154
+                  :disabled="true"
155
+                  placeholder="请输入规格&单位"
156
+                  v-model="scope.row.name"
134 157
                 ></el-input>
135 158
               </el-form-item>
136 159
             </template>
137 160
           </el-table-column>
138
-
139
-          <el-table-column width="100" align="center">
161
+          <el-table-column align="center" width="200">
162
+            <template slot="header" slot-scope="scope" >
163
+                  <span>批号</span>
164
+              </template>
165
+                <template slot-scope="scope">
166
+                  <el-form-item style="padding-top: 15px">
167
+                    <el-input
168
+                      placeholder="请输入批号"
169
+                      v-model="scope.row.batch_number"
170
+                    ></el-input>
171
+                  </el-form-item>
172
+              </template>
173
+          </el-table-column>
174
+          <el-table-column width="180" align="center">
140 175
             <template slot="header" slot-scope="scope">
141
-              <span>出库价<span style="color: red">*</span></span>
176
+              <span>出库数量<span style="color: red">*</span></span>
142 177
             </template>
143 178
             <template slot-scope="scope">
144
-            
145 179
               <el-form-item
146
-                :prop="'recordData.' + scope.$index + '.price'"
147
-                :rules="tableRules.price"
180
+                :prop="'recordData.' + scope.$index + '.count'"
181
+                :rules="tableRules.count"
148 182
                 style="padding-top: 17px"
149 183
               >
150 184
                 <el-input
151
-                  placeholder="请输入进价"
185
+                  placeholder="请输入出库数量"
152 186
                   type="number"
153
-                  v-model="scope.row.price"
187
+                  v-model="scope.row.count"
188
+                  style="width:100px"
154 189
                 ></el-input>
190
+                {{scope.row.packing_unit}}
155 191
               </el-form-item>
192
+              
156 193
             </template>
157 194
           </el-table-column>
158
-
159 195
           <el-table-column width="100" align="center">
160 196
             <template slot="header" slot-scope="scope">
161
-              <span>出库数量<span style="color: red">*</span></span>
197
+              <span>出货价<span style="color: red">*</span></span>
162 198
             </template>
163 199
             <template slot-scope="scope">
200
+            
164 201
               <el-form-item
165
-                :prop="'recordData.' + scope.$index + '.count'"
166
-                :rules="tableRules.count"
202
+                :prop="'recordData.' + scope.$index + '.last_price'"
203
+                :rules="tableRules.last_price"
167 204
                 style="padding-top: 17px"
168 205
               >
169 206
                 <el-input
170
-                  placeholder="请输入出库数量"
207
+                  placeholder="请输入出货价"
171 208
                   type="number"
172
-                  v-model="scope.row.count"
209
+                  v-model="scope.row.last_price"
173 210
                 ></el-input>
174 211
               </el-form-item>
175 212
             </template>
176 213
           </el-table-column>
214
+
215
+        
177 216
          
178 217
           
179
-          <el-table-column width="80" align="center">
218
+          <!-- <el-table-column width="80" align="center">
180 219
             <template slot="header" slot-scope="scope">
181 220
               <span>单位<span style="color: red">*</span></span>
182 221
             </template>
@@ -191,18 +230,18 @@
191 230
               </el-select>
192 231
             </template>
193 232
           </el-table-column>
194
-         
233
+          -->
195 234
 
196 235
           
197 236
 
198
-          <el-table-column label="进价总价" width="100" align="center">
237
+          <el-table-column label="总价" width="100" align="center">
199 238
             <template slot-scope="scope">
200
-              {{ calculate(scope.row.price * scope.row.count) }}
239
+              {{ calculate(scope.row.last_price * scope.row.count) }}
201 240
             </template>
202 241
           </el-table-column>
203 242
 
204 243
 
205
-          <el-table-column label="零售价" align="center" width="150">
244
+          <!-- <el-table-column label="零售价" align="center" width="150">
206 245
             <template slot-scope="scope">
207 246
               {{ scope.row.retail_price }}
208 247
             </template>
@@ -212,8 +251,59 @@
212 251
             <template slot-scope="scope">
213 252
               {{ calculate(scope.row.retail_price * scope.row.count) }}
214 253
             </template>
254
+          </el-table-column> -->
255
+          
256
+             <el-table-column label="生产厂家" width="250" align="center">
257
+            <template slot-scope="scope">
258
+               <el-select size="small" v-model="scope.row.manufacturer" filterable placeholder="请选择厂商">
259
+                <el-option
260
+                  v-for="(option, index) in manufacturerList"
261
+                  :key="index"
262
+                  :label="option.manufacturer_name"
263
+                  :value="option.id">
264
+                </el-option>
265
+               </el-select>
266
+            </template>
215 267
           </el-table-column>
268
+ 
216 269
 
270
+          <el-table-column label="生产日期" width="250" align="center">
271
+            <template slot-scope="scope">
272
+              <el-date-picker
273
+                prefix-icon="el-icon-date"
274
+                style="width: 145px"
275
+                v-model="scope.row.product_date"
276
+                type="date"
277
+                placeholder="选择日期时间"
278
+                format="yyyy-MM-dd"
279
+                value-format="yyyy-MM-dd"
280
+              ></el-date-picker>
281
+            </template>
282
+          </el-table-column>
283
+          <el-table-column label="有效日期" width="250" align="center">
284
+            <template slot-scope="scope">
285
+              <el-date-picker
286
+                prefix-icon="el-icon-date"
287
+                style="width: 145px"
288
+                v-model="scope.row.expiry_date"
289
+                type="date"
290
+                placeholder="选择日期时间"
291
+                format="yyyy-MM-dd"
292
+                value-format="yyyy-MM-dd"
293
+              ></el-date-picker>
294
+            </template>
295
+          </el-table-column>
296
+        
297
+        <el-table-column align="center" width="150" label="批准文号">
298
+            <template slot-scope="scope">
299
+              <el-form-item>
300
+                <el-input
301
+                  placeholder="请输入批准文号"
302
+                  v-model="scope.row.number"
303
+                ></el-input>
304
+              </el-form-item>
305
+            </template>
306
+          </el-table-column>
217 307
 
218 308
           <el-table-column label="备注" width="80" align="center">
219 309
             <template slot-scope="scope">
@@ -265,7 +355,8 @@ import {  postDrugWarehouseOut,GetAllConfig,GetAllDrugInfoByID } from "@/api/dru
265 355
 
266 356
 import BreadCrumb from "../../components/bread-crumb";
267 357
 import DrugsStockDialog from './drugsStockDialog/index'
268
-import { getDataConfig } from "@/utils/data";
358
+import { getDataConfig,getDictionaryDataConfig } from "@/utils/data";
359
+import {postSearchDrugList} from "@/api/data"
269 360
 export default {
270 361
   components: { DrugsStockDialog,   BreadCrumb },
271 362
   name: "salesReturnOrderAdd",
@@ -317,7 +408,13 @@ export default {
317 408
       manufacturer: [],
318 409
       dealer: [],
319 410
       goodType: [],
320
-      goodInfo:[]
411
+      goodInfo:[],
412
+      drugList:[],
413
+      manufacturerList:[],
414
+      showOne:true,
415
+      showTwo:false,
416
+      drugTypeList:[],
417
+      totalPrice:0,
321 418
     };
322 419
   },
323 420
   methods: {
@@ -546,11 +643,14 @@ export default {
546 643
             this.$message.success("请添加出库商品");
547 644
             return;
548 645
           }
549
-
646
+          for(let i=0;i<this.recordInfo.recordData.length;i++){
647
+            this.recordInfo.recordData[i].last_price = this.recordInfo.recordData[i].last_price.toString()
648
+          }
550 649
           const params = {
551 650
             stockOut: this.recordInfo.recordData
552 651
           };
553
-
652
+          console.log("params222222",params)
653
+      
554 654
           postDrugWarehouseOut(
555 655
             params,
556 656
             this.warehouse_out_time,
@@ -584,8 +684,97 @@ export default {
584 684
     getDataConfig(module, filed_name){
585 685
      return getDataConfig(module, filed_name)
586 686
     },
687
+    querySearchAsync(keyword, cb) {
688
+        let key = '';
689
+        if (keyword != undefined) {
690
+          key = keyword
691
+        }
692
+        let searchArray = [];
693
+        postSearchDrugList(key).then(response => {
694
+          if (response.data.state == 1) {
695
+            searchArray = response.data.data.list;
696
+            
697
+             var list = response.data.data.list
698
+             this.drugList = list
699
+             var manufacturerList = response.data.data.manufacturerList
700
+             this.manufacturerList = manufacturerList
701
+             for(let i=0;i<this.drugList.length;i++){
702
+                for(let j=0;j<this.manufacturerList.length;j++){
703
+                  if(this.drugList[i].manufacturer == this.manufacturerList[j].id){
704
+                     this.drugList[i].manufacturer = this.manufacturerList[j].manufacturer_name
705
+                  }
706
+                }
707
+             }
708
+             cb(this.drugList)
709
+          } else {
710
+            cb([])
711
+          }
712
+        })
713
+      },
714
+      handleSelect(val){
715
+         if(this.recordInfo.recordData.length == 1){
716
+            this.recordInfo.recordData[0].drug_id = val.id
717
+            this.recordInfo.recordData[0].drug_name = val.drug_name
718
+            this.recordInfo.recordData[0].drug_type = val.drug_type
719
+            this.recordInfo.recordData[0].dosage = val.dosage
720
+            this.recordInfo.recordData[0].max_unit = val.max_unit
721
+            this.recordInfo.recordData[0].unval = val.unval
722
+            this.recordInfo.recordData[0].min_unit = val.min_unit
723
+            this.recordInfo.recordData[0].packing_unit = val.packing_unit
724
+            this.recordInfo.recordData[0].number = val.number
725
+            this.recordInfo.recordData[0].last_price = val.last_price
726
+            this.recordInfo.recordData[0].manufacturer = val.manufacturer
727
+         for(let i=0;i<this.recordInfo.recordData.length;i++){       
728
+           this.recordInfo.recordData[i].name = this.recordInfo.recordData[i].dosage + this.recordInfo.recordData[i].max_unit + "*" + this.recordInfo.recordData[i].unval + this.recordInfo.recordData[i].min_unit + "/"+this.recordInfo.recordData[i].packing_unit
729
+           this.totalPrice += this.recordInfo.recordData[i].last_price * this.recordInfo.recordData[i].warehousing_count
730
+           for(let j=0;j<this.drugTypeList.length;j++){
731
+               if(this.recordInfo.recordData[i].drug_type == this.drugTypeList[j].id){
732
+                  this.recordInfo.recordData[i].drug_type = this.drugTypeList[j].name
733
+               } 
734
+           }
735
+         }
736
+         }else{
737
+            var arr = []
738
+            for(let i=0;i<this.recordInfo.recordData.length;i++){ 
739
+              if(this.recordInfo.recordData[i].drug_id> 0){
740
+                 arr.push(this.recordInfo.recordData[i])
741
+              }
742
+            } 
743
+            this.recordInfo.recordData = arr
744
+            const tempObj = {}
745
+            tempObj['drug_name'] = val.drug_name
746
+            tempObj['drug_id'] = val.id
747
+            tempObj['number'] = ''
748
+            tempObj['product_date'] = ''
749
+            tempObj['expiry_date'] = ''
750
+            tempObj['warehousing_count'] = ''
751
+            tempObj['retail_price'] = ''
752
+            tempObj['price'] = ''
753
+            tempObj['remark'] = ''
754
+            tempObj['dealer'] = ''
755
+            tempObj['manufacturer'] = ''
756
+            tempObj['min_unit'] = ''
757
+            tempObj['batch_number'] = ''
758
+            tempObj['drug_type'] = ''
759
+            this.recordInfo.recordData.push(tempObj) 
760
+         }
761
+
762
+        for(let i=0;i<this.recordInfo.recordData.length;i++){       
763
+          this.recordInfo.recordData[i].name = this.recordInfo.recordData[i].dosage + this.recordInfo.recordData[i].max_unit + "*" + this.recordInfo.recordData[i].unval + this.recordInfo.recordData[i].min_unit + "/"+this.recordInfo.recordData[i].packing_unit
764
+          this.totalPrice += this.recordInfo.recordData[i].last_price * this.recordInfo.recordData[i].warehousing_count
765
+          for(let j=0;j<this.drugTypeList.length;j++){
766
+             if(this.recordInfo.recordData[i].drug_type == this.drugTypeList[j].id){
767
+                this.recordInfo.recordData[i].drug_type = this.drugTypeList[j].name
768
+              } 
769
+           }
770
+        }
771
+      },
772
+      getDictionaryDataConfig(module, filed_name) {
773
+        return getDictionaryDataConfig(module, filed_name)
774
+      },
587 775
   },
588 776
   created() {
777
+    this.drugTypeList = getDictionaryDataConfig('system','drug_type') 
589 778
     var nowDate = new Date();
590 779
     var nowYear = nowDate.getFullYear();
591 780
     var nowMonth = nowDate.getMonth() + 1;
@@ -598,11 +787,18 @@ export default {
598 787
       (nowDay < 10 ? "0" + nowDay : nowDay);
599 788
     const tempObj = {};
600 789
     tempObj["drug_id"] = 0;
790
+    tempObj['dosage'] = ''
791
+    tempObj['max_unit'] = ''
792
+    tempObj['unval'] = ''
793
+    tempObj['min_unit'] = '',
794
+    tempObj['packing_unit'] = '',
601 795
     tempObj["return_count"] = 0;
602 796
     tempObj["price"] = "";
603 797
     tempObj["remark"] = "";
604 798
     tempObj["min_unit"] = "";
605
-
799
+    tempObj['manufacturer'] = ''
800
+    tempObj['batch_number'] = ''
801
+    tempObj['drug_type'] = ''
606 802
     this.recordInfo.recordData.push(tempObj);
607 803
     this.GetConfigInfo();
608 804
     this.propForm.goodUnit = this.$store.getters.good_unit;

+ 129 - 81
src/xt_pages/stock/drugs/query.vue Visa fil

@@ -82,91 +82,85 @@
82 82
           >搜索
83 83
           </el-button>
84 84
       </div>
85
-
86
-
87
-      <el-table
88
-        :row-style="{ color: '#303133' }"
89
-        :header-cell-style="{
90
-          backgroundColor: 'rgb(245, 247, 250)',
91
-          color: '#606266'
92
-        }"
93
-        :data="WarehouseInfo.warehouseInfoDate"
94
-        :class="signAndWeighBoxPatients"
85
+      
86
+       <el-table
87
+        :data="tableList"
95 88
         border
96
-        v-loading="WarehouseInfo.loading"
97
-        :span-method="merge"
98
-
99
-      >
100
-        <el-table-column label="药品名称" align="center">
101
-          <template slot-scope="scope">
102
-            {{ scope.row.drug_name }}
103
-          </template>
89
+        style="width: 100%">
90
+        <el-table-column prop="date" label="药品编号" width="180">
91
+           <template  slot-scope="scope">
92
+              
93
+           </template>
104 94
         </el-table-column>
105
-        <el-table-column label="规格名称" align="center">
106
-          <template slot-scope="scope">
107
-            <span>{{ scope.row.drug_spec }}</span>
108
-          </template>
95
+        <el-table-column prop="drug_type" label="药品类型" width="180">
96
+           <template slot-scope="scope">
97
+             {{getDrugType(scope.row.drug_type)}}
98
+           </template>
109 99
         </el-table-column>
110
-        <el-table-column label="入库数量" align="center">
111
-          <template slot-scope="scope">
112
-            <span
113
-              @click="showStockInDetailDialog(scope.row.drug_id)"
114
-            >{{ stockInCount(scope.row) }}</span
115
-            >
116
-          </template>
100
+        <el-table-column prop="drug_name" label="药品名称">
101
+           <template slot-scope="scope">
102
+             {{scope.row.drug_name}}
103
+           </template>
117 104
         </el-table-column>
118
-         <el-table-column label="单价" align="center">
119
-          <template slot-scope="scope">
120
-            <span>{{ scope.row.last_price}}</span
121
-            >
122
-          </template>
105
+        <el-table-column prop="drug_name" label="规格&&单位">
106
+           <template slot-scope="scope">
107
+             {{scope.row.dosage + scope.row.max_unit +"*"+scope.row.min_number+scope.row.min_unit+"/"+scope.row.packing_unit}}
108
+           </template>
123 109
         </el-table-column>
124
-        <el-table-column label="入库退货" align="center">
125
-          <template slot-scope="scope">
126
-            <span
127
-              @click="showSaleReturnDetailDialog(scope.row)"
128
-            >{{ salesReturnCount(scope.row) }}</span
129
-            >
130
-          </template>
110
+         <el-table-column prop="drug_name" label="进货单价">
111
+           <template slot-scope="scope">
112
+             {{scope.row.last_price}}
113
+           </template>
131 114
         </el-table-column>
132
-        <el-table-column label="实际入库" align="center">
133
-          <template slot-scope="scope">
134
-            {{ stockInCount(scope.row) - salesReturnCount(scope.row) }}
135
-          </template>
115
+         <el-table-column prop="drug_name" label="厂家">
116
+           <template slot-scope="scope">
117
+             {{getManufacturerList(scope.row.manufacturer)}}
118
+           </template>
136 119
         </el-table-column>
137
-        <el-table-column label="出库数量" align="center">
138
-          <template slot-scope="scope">
139
-            <span
140
-              @click="showStockOutDetailDialog(scope.row.drug_id)"
141
-            >{{ stockOutCount(scope.row) }}</span
142
-            >
143
-          </template>
120
+        <el-table-column prop="drug_name" label="剩余库存量">
121
+           <template slot-scope="scope">
122
+            <span v-if="scope.row.stock_max_number!=''">
123
+              {{scope.row.stock_max_number}}{{scope.row.packing_unit}}
124
+              <span v-if="scope.row.stock_min_number!=''">
125
+                {{scope.row.stock_min_number}}{{scope.row.min_unit}}
126
+              </span>
127
+            </span> 
128
+           </template>
144 129
         </el-table-column>
145
-        <el-table-column label="出库退库" align="center">
130
+        <el-table-column prop="drug_name" label="操作">
146 131
           <template slot-scope="scope">
147
-            <span
148
-              @click="showCancelStockDetailDialog(scope.row)"
149
-            >{{ cancelStockCount(scope.row) }}</span
132
+            <el-tooltip
133
+              class="item"
134
+              effect="dark"
135
+              content="库存流水"
136
+              placement="top"
150 137
             >
138
+              <el-button
139
+                size="small"
140
+                type="warning"
141
+                icon="el-icon-edit-outline"
142
+                @click="handleDetail(scope.row.drug_id)"
143
+              >
144
+              </el-button>
145
+            </el-tooltip>
146
+            <el-tooltip
147
+              class="item"
148
+              effect="dark"
149
+              content="批次"
150
+              placement="top"
151
+            >
152
+              <el-button
153
+                size="small"
154
+                type="primary"
155
+                icon="el-icon-edit-outline"
156
+                @click="handleBatch(scope.row.drug_id)"
157
+              >
158
+              </el-button>
159
+            </el-tooltip>
151 160
           </template>
152 161
         </el-table-column>
153
-        <el-table-column label="实际出库" align="center">
154
-          <template slot-scope="scope">
155
-            {{ stockOutCount(scope.row) - cancelStockCount(scope.row) }}
156
-          </template>
157
-        </el-table-column>
158
-
159
-        <el-table-column label="剩余库存" align="center">
160
-          <template slot-scope="scope">
161
-            <span>{{
162
-              stockInCount(scope.row) -
163
-                salesReturnCount(scope.row) -
164
-                stockOutCount(scope.row) +
165
-                cancelStockCount(scope.row)
166
-            }}</span>
167
-          </template>
168
-        </el-table-column>
169
-      </el-table>
162
+       </el-table>
163
+       
170 164
       <el-pagination
171 165
         @size-change="handleSizeChange"
172 166
         @current-change="handleCurrentChange"
@@ -191,17 +185,18 @@
191 185
 <script>
192 186
   import { uParseTime } from '@/utils/tools'
193 187
   import BreadCrumb from '@/xt_pages/components/bread-crumb'
194
-  import { getAllDrugStockQueryList } from '@/api/drug/drug_stock'
188
+  import { getAllDrugStockQueryList,getDrugStockList } from '@/api/drug/drug_stock'
195 189
   import SettingDialog from './settingDialog/index'
196 190
   import { getDictionaryDataConfig } from "@/utils/data";
197 191
   export default {
198 192
     name: 'stockIn',
199 193
     created() {
200
-      this.GetAllDrugStockQueryList()
201
-
194
+      //  this.GetAllDrugStockQueryList()
202 195
       var drugCategory = getDictionaryDataConfig('system','drug_category')
203 196
       this.drugCategory.push(...drugCategory)
204
-      console.log("透析记录",this.drugCategory)
197
+      this.drugTypeList = getDictionaryDataConfig('system','drug_type') 
198
+  
199
+      this.getlist()
205 200
     },
206 201
     components: {
207 202
       SettingDialog,
@@ -233,7 +228,10 @@
233 228
         drug_category:0,
234 229
         drugCategory:[
235 230
           {id:0,name:"全部"}
236
-        ]
231
+        ],
232
+        drugTypeList:[],
233
+        tableList:[],
234
+        manufacturerList:[]
237 235
       }
238 236
     },
239 237
     methods: {
@@ -293,7 +291,6 @@
293 291
           start_time:this.start_time,
294 292
           end_time:this.end_time,
295 293
         }
296
-        console.log("parasm22222",Params)
297 294
         this.WarehouseInfo.loading = true
298 295
         this.WarehouseInfo.warehouseInfoDate = []
299 296
         getAllDrugStockQueryList(Params).then(response => {
@@ -309,7 +306,7 @@
309 306
               this.WarehouseInfo.warehouseInfoDate.push(response.data.data.list[i])
310 307
               arr.push(response.data.data.list[i])
311 308
             }
312
-            console.log("数据源头",arr)
309
+           
313 310
             for(let i=0;i<arr.length;i++){
314 311
                arr[i].stockInCount =  this.stockInCount(arr[i])
315 312
                arr[i].salesReturnCount = this.salesReturnCount(arr[i])
@@ -319,7 +316,7 @@
319 316
                arr[i].reactOutCount = (this.stockOutCount(arr[i]) - this.cancelStockCount(arr[i]))?(this.stockOutCount(arr[i]) - this.cancelStockCount(arr[i])):0
320 317
                arr[i].overplusCount = (this.stockInCount(arr[i])-this.salesReturnCount(arr[i])-this.stockOutCount(arr[i])+this.cancelStockCount(arr[i]))?this.stockInCount(arr[i])-this.salesReturnCount(arr[i])-this.stockOutCount(arr[i])+this.cancelStockCount(arr[i]):0
321 318
             }
322
-             console.log("arr222222222",arr)
319
+          
323 320
              this.tableData = arr
324 321
             this.handleSpanTempArr()
325 322
           }
@@ -457,6 +454,57 @@
457 454
           name: "drugQueryPrint",
458 455
           query: {drug_category:this.drug_category,keyword:this.keywords,start_time:this.start_time,end_time:this.end_time,page:this.page,limit:this.limit}
459 456
         });
457
+      },
458
+ 
459
+  //获取库存
460
+      getlist(){
461
+        const params = {
462
+          page: this.page,
463
+          limit: this.limit,
464
+          keyword: this.keywords,
465
+          drug_category:this.drug_category,
466
+          start_time:this.start_time,
467
+          end_time:this.end_time,
468
+        }
469
+       
470
+        getDrugStockList(params).then(response=>{
471
+          if(response.data.state == 1){
472
+             var list = response.data.data.list
473
+           
474
+             this.tableList = list
475
+             var total = response.data.data.total
476
+             this.total = total
477
+             this.manufacturerList = response.data.data.manufacturerList
478
+           
479
+           }
480
+        })
481
+      },
482
+      getDrugType(id){
483
+       
484
+        var name = ""
485
+        for(let i=0;i<this.drugTypeList.length;i++){
486
+           if(this.drugTypeList[i].id == id){
487
+
488
+             name = this.drugTypeList[i].name
489
+           }
490
+        }
491
+     
492
+        return name
493
+      },
494
+      getManufacturerList(id){
495
+        var name = ""
496
+        for(let i=0;i<this.manufacturerList.length;i++){
497
+          if(id == this.manufacturerList[i].id){
498
+             name = this.manufacturerList[i].manufacturer_name
499
+          }
500
+        }
501
+        return name
502
+      },
503
+      handleDetail(id){
504
+        this.$router.push({path:'/drugstock/in/drugstockflow?drug_id='+id})
505
+      },
506
+      handleBatch(id){
507
+        this.$router.push({path:'/drugstock/in/drugbatchnumber?drug_id'+id})
460 508
       }
461 509
     }
462 510
   }

+ 121 - 63
src/xt_pages/stock/stockInOrderAdd.vue Visa fil

@@ -58,7 +58,29 @@
58 58
                   style="width: 100%"
59 59
                   max-height="450" :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
60 60
         >
61
-      
61
+          <el-table-column align="center" width="200">
62
+             <template slot="header" slot-scope="scope">
63
+              <span>耗材名称</span>
64
+            </template>
65
+            <template slot-scope="scope">
66
+                <el-autocomplete
67
+                    class="checkSearch"
68
+                    popper-class="my-autocomplete"
69
+                    v-model="scope.row.good_name"
70
+                    :fetch-suggestions="querySearchAsync"
71
+                    :trigger-on-focus="false"
72
+                    placeholder="请输入病人名字"
73
+                    @select="handleSelect"
74
+                    @input="changeGoodName(scope.$index)"
75
+                    style="width:160px;"
76
+                  >
77
+                    <i class="el-icon-search el-input__icon" slot="suffix"></i>
78
+                  <template slot-scope="{ item }">
79
+                    <div class="name">{{ item.good_name }}</div>
80
+                  </template>
81
+                 </el-autocomplete>
82
+            </template>
83
+          </el-table-column>
62 84
           <el-table-column align="center" width="200">
63 85
             
64 86
             <template slot="header" slot-scope="scope">
@@ -67,77 +89,42 @@
67 89
      
68 90
             <template slot-scope="scope">
69 91
               <el-form-item style="padding-top: 15px;margin-left: 10px;margin-right: 10px">
70
-                <el-input placeholder="请输入耗材类型" v-model="scope.row.good_type_id"
71
-                          :value="typeName(scope.row.good_type_id)"
72
-                          @focus="showDialog(scope.$index, scope.row)"></el-input>
92
+                <el-input placeholder="请输入耗材类型" v-model="scope.row.good_type_id" :value="typeName(scope.row.good_type_id)"></el-input>
73 93
               </el-form-item>
74 94
             </template>
75 95
           </el-table-column>
76
-          <el-table-column align="center" width="200">
77
-             <template slot="header" slot-scope="scope">
78
-              <span>耗材名称</span>
79
-            </template>
80
-            <template slot-scope="scope">
81
-               <el-input v-model="scope.row.good_name" :disabled="true"></el-input>
82
-            </template>
83
-          </el-table-column>
84 96
           <el-table-column align="center" width="200">
85 97
             
86 98
             <template slot="header" slot-scope="scope">
87
-              <span>规格名称<span style="color: red">*</span></span>
99
+              <span>规格&单位<span style="color: red">*</span></span>
88 100
             </template>
89 101
             <template slot-scope="scope">
90 102
 
91 103
               <el-form-item style="padding-top: 15px">
92
-                <el-input placeholder="请输入规格名称" v-model="scope.row.good_id"
93
-                          :value="specificationName(scope.row.good_id)"
94
-                          @focus="showDialog(scope.$index, scope.row)"></el-input>
104
+                <el-input placeholder="请输入规格名称" v-model="scope.row.name"></el-input>
95 105
               </el-form-item>
96 106
 
97 107
             </template>
98 108
           </el-table-column>
99
-          <el-table-column align="center" width="200">
100
-             <template slot="header" slot-scope="scope">
101
-              <span>单位<span style="color: red">*</span></span>
102
-            </template>
103
-            <template slot-scope="scope">
104
-              <el-form-item style="padding-top:15px">
105
-              <el-select v-model="scope.row.good_unit" style="width:160px;" placeholder="请选择">
106
-                 <el-option
107
-                   v-for="(item,index) in propForm.goodUnit"
108
-                   :key="index"
109
-                   :label="item.name"
110
-                   :value="item.id">
111
-                </el-option>
112
-              </el-select>
113
- 
114
-              </el-form-item>
115
-            </template>
116
-          </el-table-column>
117
-
109
+        
118 110
           <el-table-column align="center" width="150">
119 111
             <template slot="header" slot-scope="scope">
120
-              <span>进货价<span style="color: red">*</span></span>
112
+              <span>批号</span>
121 113
             </template>
122 114
             <template slot-scope="scope">
123
-              <!--<el-input type="number" v-model="scope.row.price"  @blur="handleBlur(scope.$index, scope.row)"></el-input>-->
124
-              <el-form-item :prop="'recordData.' + scope.$index + '.price'" :rules='tableRules.price'
125
-                            style="padding-top: 17px">
126
-                <el-input placeholder="请输入单价" type="number" v-model="scope.row.price"></el-input>
115
+              <el-form-item style="padding-top: 17px">
116
+                <el-input placeholder="请输入批号" v-model="scope.row.number"></el-input>
127 117
               </el-form-item>
128 118
 
129
-
130 119
             </template>
131 120
           </el-table-column>
132 121
 
122
+
133 123
           <el-table-column align="center" width="180">
134 124
             <template slot="header" slot-scope="scope">
135 125
               <span>入库数量<span style="color: red">*</span></span>
136 126
             </template>
137 127
             <template slot-scope="scope">
138
-              <!--{{scope.row.warehousing_count}}-->
139
-              <!--<el-input type="number" v-model="scope.row.warehousing_count"   @blur="handleBlur(scope.$index, scope.row)"></el-input>-->
140
-
141 128
               <el-form-item :prop="'recordData.' + scope.$index + '.warehousing_count'"
142 129
                             :rules='tableRules.warehousing_count' style="padding-top: 17px">
143 130
                 <el-input placeholder="请输入入库数量" type="number" v-model="scope.row.warehousing_count"></el-input>
@@ -145,41 +132,60 @@
145 132
             </template>
146 133
           </el-table-column>
147 134
 
148
-          <el-table-column label="总价" align="center" width="150">
149
-            <template slot-scope="scope">
150
-              {{calculate(scope.row.price*scope.row.warehousing_count)}}
151
-            </template>
152
-          </el-table-column>
153
-
154 135
           <el-table-column align="center" width="150">
155 136
             <template slot="header" slot-scope="scope">
156
-              <span>批号</span>
137
+              <span>进货单价<span style="color: red">*</span></span>
157 138
             </template>
158 139
             <template slot-scope="scope">
159
-              <el-form-item style="padding-top: 17px">
160
-                <el-input placeholder="请输入批号" v-model="scope.row.number"></el-input>
140
+            
141
+              <el-form-item :prop="'recordData.' + scope.$index + '.price'" :rules='tableRules.price'
142
+                            style="padding-top: 17px">
143
+                <el-input placeholder="请输入单价" type="number" v-model="scope.row.price"></el-input>
161 144
               </el-form-item>
162 145
 
146
+
147
+            </template>
148
+          </el-table-column>
149
+
150
+          <el-table-column label="总价" align="center" width="150">
151
+            <template slot-scope="scope">
152
+              {{calculate(scope.row.price*scope.row.warehousing_count)}}
163 153
             </template>
164 154
           </el-table-column>
155
+          
156
+          <el-table-column label="生产厂家" align="center" width="150">
157
+             <template slot-scope="scope">
158
+               <el-select size="small" v-model="scope.row.manufacturer" filterable placeholder="请选择厂商">
159
+                <el-option
160
+                  v-for="(option, index) in manufacturerList"
161
+                  :key="index"
162
+                  :label="option.manufacturer_name"
163
+                  :value="option.id">
164
+                </el-option>
165
+               </el-select>
166
+            </template>
167
+          </el-table-column>
168
+        
165 169
           <el-table-column label="生产日期" align="center" width="250">
166 170
             <template slot-scope="scope">
167
-              <!--{{scope.row.product_date | parseTime("{y}-{m}-{d}")}}-->
168 171
               <el-date-picker prefix-icon="el-icon-date" style="width: 145px" v-model="scope.row.product_date"
169 172
                               type="date" placeholder="选择日期时间" format="yyyy-MM-dd"
170
-                              value-format="yyyy-MM-dd"></el-date-picker>
173
+                              value-format="yyyy-MM-dd">
174
+              </el-date-picker>
171 175
 
172 176
             </template>
173 177
           </el-table-column>
174 178
           <el-table-column label="有效日期" align="center" width="250">
175 179
             <template slot-scope="scope">
176
-              <!--{{ scope.row.expiry_date | parseTime("{y}-{m}-{d}")}}-->
177 180
               <el-date-picker prefix-icon="el-icon-date" style="width: 145px" v-model="scope.row.expiry_date"
178 181
                               type="date" placeholder="选择日期时间" format="yyyy-MM-dd"
179
-                              value-format="yyyy-MM-dd"></el-date-picker>
182
+                              value-format="yyyy-MM-dd">
183
+              </el-date-picker>
180 184
 
181 185
             </template>
182 186
           </el-table-column>
187
+         
188
+
183 189
           <el-table-column label="备注" align="center" width="150">
184 190
             <template slot-scope="scope">
185 191
               <el-input placeholder="请输入备注" v-model="scope.row.remark"></el-input>
@@ -231,7 +237,8 @@
231 237
     GetAllGoodType,
232 238
     getWarehouseInfoByOrdeNumber,
233 239
     modifyWarehouseInfo,
234
-    postWarehouse
240
+    postWarehouse,
241
+    postSearchGoodList
235 242
   } from '@/api/stock'
236 243
   import BreadCrumb from '../components/bread-crumb'
237 244
 
@@ -340,7 +347,9 @@
340 347
 
341 348
         manufacturer: [],
342 349
         dealer: [],
343
-        goodType: []
350
+        goodType: [],
351
+        manufacturerList:[],
352
+        goodList:[]
344 353
       }
345 354
     },
346 355
     methods: {
@@ -487,6 +496,8 @@
487 496
         tempObj['dealer'] = ''
488 497
         tempObj['manufacturer'] = ''
489 498
         tempObj['good_unit'] = ''
499
+        tempObj['specification_name'] = ''
500
+        tempObj['name'] = ''
490 501
         this.recordInfo.recordData.push(tempObj)
491 502
       }, handleDelete: function(index, row) {
492 503
         if (this.recordInfo.recordData.length <= 1) {
@@ -628,10 +639,7 @@
628 639
                 this.$message.error('商品类型不能为空')
629 640
                 return
630 641
               }
631
-              if (array[i].good_id == 0) {
632
-                this.$message.error('规格名称不能为空')
633
-                return
634
-              }
642
+              array[i].price = array[i].price.toString()
635 643
             }
636 644
 
637 645
             if(this.recordInfo.recordData.length <= 0){
@@ -666,6 +674,53 @@
666 674
       getDataConfig(module, filed_name){
667 675
          return getDataConfig(module, filed_name)
668 676
        },
677
+      querySearchAsync(keyword, cb) {
678
+        let key = '';
679
+        if (keyword != undefined) {
680
+          key = keyword
681
+        }
682
+        console.log("keyrowrd",key)
683
+        postSearchGoodList(key).then(response => {
684
+          if (response.data.state == 1) {
685
+           
686
+             var list = response.data.data.list
687
+             this.goodList = list
688
+             var manufacturerList = response.data.data.manufacturerList
689
+             this.manufacturerList = manufacturerList
690
+             for(let i=0;i<this.goodList.length;i++){
691
+                for(let j=0;j<this.manufacturerList.length;j++){
692
+                  if(this.goodList[i].manufacturer == this.manufacturerList[j].id){
693
+                     this.goodList[i].manufacturer = this.manufacturerList[j].manufacturer_name
694
+                  }
695
+                }
696
+             }
697
+           
698
+             cb(this.goodList)
699
+          } else {
700
+            cb([])
701
+          }
702
+        })
703
+      },
704
+      changeGoodName(val){
705
+        this.currentIndex = val
706
+      },
707
+      handleSelect(val){
708
+        console.log("val",val)
709
+         for(let i=0;i<this.recordInfo.recordData.length;i++){
710
+           if(this.currentIndex == i){
711
+              this.recordInfo.recordData[i].good_type_id = val.id
712
+              this.recordInfo.recordData[i].good_name = val.good_name
713
+              this.recordInfo.recordData[i].good_type_id = val.good_type_id
714
+              this.recordInfo.recordData[i].name = val.specification_name + "*" + val.min_number+val.min_unit +"/"+val.packing_unit
715
+              this.recordInfo.recordData[i].number =  val.number
716
+              this.recordInfo.recordData[i].manufacturer = val.manufacturer
717
+              this.recordInfo.recordData[i].remark = val.remark
718
+              this.recordInfo.recordData[i].price = val.buy_price
719
+              this.recordInfo.recordData[i].specification_name = val.specification_name
720
+              this.recordInfo.recordData[i].good_id = val.id
721
+           }
722
+         }
723
+      }
669 724
     }
670 725
     ,
671 726
     created() {
@@ -691,6 +746,9 @@
691 746
       tempObj['dealer'] = ''
692 747
       tempObj['manufacturer'] = ''
693 748
       tempObj['good_unit'] = ''
749
+      tempObj['good_name'] = ''
750
+      tempObj['specification_name'] = ''
751
+      tempObj['name'] = ''
694 752
       this.recordInfo.recordData.push(tempObj)
695 753
       this.GetConfigInfo()
696 754
       this.propForm.goodUnit = this.$store.getters.good_unit

+ 152 - 131
src/xt_pages/stock/stockOutOrderAdd.vue Visa fil

@@ -25,13 +25,7 @@
25 25
     </div>
26 26
 
27 27
     <div class="app-container">
28
-    <!---->
29
-      <!--<stock-in-dialog-->
30
-        <!--ref="dialog" :propForm="propForm"-->
31
-        <!--:visibility="isVisibility"-->
32
-        <!--v-on:dialog-comfirm="comfirm"-->
33
-        <!--v-on:dialog-cancle="cancle"-->
34
-      <!--&gt;</stock-in-dialog>-->
28
+    
35 29
 
36 30
       <stock-in-dialog
37 31
         ref="dialog" :propForm="propForm"
@@ -107,119 +101,161 @@
107 101
           max-height="450"
108 102
           :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }"
109 103
         >
110
-          <el-table-column min-width="35" align="center">
104
+         <el-table-column width="150" align="center">
111 105
             <template slot="header" slot-scope="scope">
112
-              <span>耗材类型</span>
106
+              <span>耗材名称</span>
113 107
             </template>
114 108
 
115 109
             <template slot-scope="scope">
116
-              <!--<span @click="showDialog(scope.$index, scope.row)" v-if="scope.row.good_type_id == 0" style="color:#c5c8cf">请输入类型</span>-->
117
-              <!--<span @click="showDialog(scope.$index, scope.row)" v-if="scope.row.good_type_id != 0">{{typeName(scope.row.good_type_id)}}</span>-->
118
-
119 110
               <el-form-item style="padding-top: 15px">
120
-                <el-input
121
-                  placeholder="请输入商品类型"
122
-                  v-model="scope.row.good_type_id"
123
-                  :value="typeName(scope.row.good_type_id)"
124
-                  @focus="showDialog(scope.$index, scope.row)"
125
-                ></el-input>
111
+                <el-autocomplete
112
+                    class="checkSearch"
113
+                    popper-class="my-autocomplete"
114
+                    v-model="scope.row.good_name"
115
+                    :fetch-suggestions="querySearchAsync"
116
+                    :trigger-on-focus="false"
117
+                    placeholder="请输入病人名字"
118
+                    @select="handleSelect"
119
+                    @input="changeGoodName(scope.$index)"
120
+                    style="width:150px;"
121
+                  >
122
+                    <i class="el-icon-search el-input__icon" slot="suffix"></i>
123
+                  <template slot-scope="{ item }">
124
+                    <div class="name">{{ item.good_name }}</div>
125
+                  </template>
126
+                 </el-autocomplete>
126 127
               </el-form-item>
127 128
             </template>
128 129
           </el-table-column>
129
-           <el-table-column min-width="35" align="center">
130
+          <el-table-column  width="150" align="center">
130 131
             <template slot="header" slot-scope="scope">
131
-              <span>耗材名称</span>
132
+              <span>耗材类型</span>
132 133
             </template>
133 134
 
134 135
             <template slot-scope="scope">
136
+             
137
+
135 138
               <el-form-item style="padding-top: 15px">
136 139
                 <el-input
137
-                  placeholder=""
138
-                  v-model="scope.row.good_id"
139
-                  :value="typeNameOne(scope.row.good_id)"
140
-                  :disabled="true"
140
+                  placeholder="请输入商品类型"
141
+                  v-model="scope.row.good_type_id"
142
+                  :value="typeName(scope.row.good_type_id)"
143
+                  @focus="showDialog(scope.$index, scope.row)"
141 144
                 ></el-input>
142 145
               </el-form-item>
143 146
             </template>
144 147
           </el-table-column>
148
+      
145 149
           
146
-          <el-table-column min-width="35" align="center">
150
+          <el-table-column width="150" align="center">
147 151
             <template slot="header" slot-scope="scope">
148
-              <span>规格名称<span style="color: red">*</span></span>
152
+              <span>规格&&单位<span style="color: red">*</span></span>
149 153
             </template>
150 154
             <template slot-scope="scope">
151 155
               <el-form-item style="padding-top: 15px">
152
-                <el-input
153
-                  placeholder="请输入规格名称"
154
-                  v-model="scope.row.good_id"
155
-                  :value="specificationName(scope.row.good_id)"
156
-                  @focus="showDialog(scope.$index, scope.row)"
157
-                ></el-input>
156
+                <el-input v-model="scope.row.name"></el-input>
158 157
               </el-form-item>
159 158
             </template>
160 159
           </el-table-column>
161 160
           
162
-          <el-table-column min-width="35" align="center">
161
+          <el-table-column  width="150" align="center">
163 162
              <template slot="header" slot-scope="scope">
164
-              <span>单位<span style="color: red">*</span></span>
163
+              <span>批号<span style="color: red">*</span></span>
165 164
             </template>
166 165
             <template slot-scope="scope">
167
-              <el-select v-model="scope.row.good_unit" style="width:160px;" placeholder="请选择">
168
-                 <el-option
169
-                   v-for="(item,index) in propForm.goodUnit"
170
-                   :key="index"
171
-                   :label="item.name"
172
-                   :value="item.id">
173
-                </el-option>
174
-              </el-select>
166
+               <el-input placeholder="请输入批号" v-model="scope.row.number"></el-input>
175 167
             </template>
176 168
           </el-table-column>
177 169
 
178
-          <el-table-column min-width="23" align="center">
170
+         <el-table-column  width="150" align="center">
179 171
             <template slot="header" slot-scope="scope">
180
-              <span>出货价<span style="color: red">*</span></span>
172
+              <span>出库数量<span style="color: red">*</span></span>
181 173
             </template>
182 174
             <template slot-scope="scope">
183
-              <!--<el-input type="number" v-model="scope.row.price"  @blur="handleBlur(scope.$index, scope.row)"></el-input>-->
184 175
               <el-form-item
185
-                :prop="'recordData.' + scope.$index + '.price'"
186
-                :rules="tableRules.price"
176
+                :prop="'recordData.' + scope.$index + '.count'"
177
+                :rules="tableRules.count"
187 178
                 style="padding-top: 17px"
188 179
               >
189 180
                 <el-input
190
-                  placeholder="请输入单价"
181
+                  placeholder="请输入出库数量"
191 182
                   type="number"
192
-                  v-model="scope.row.price"
183
+                  v-model="scope.row.count"
193 184
                 ></el-input>
194 185
               </el-form-item>
195 186
             </template>
196 187
           </el-table-column>
197 188
 
198
-          <el-table-column min-width="23" align="center">
189
+          <el-table-column  width="150" align="center">
199 190
             <template slot="header" slot-scope="scope">
200
-              <span>出库数量<span style="color: red">*</span></span>
191
+              <span>出货单价<span style="color: red">*</span></span>
201 192
             </template>
202 193
             <template slot-scope="scope">
203 194
               <el-form-item
204
-                :prop="'recordData.' + scope.$index + '.count'"
205
-                :rules="tableRules.count"
195
+                :prop="'recordData.' + scope.$index + '.price'"
196
+                :rules="tableRules.price"
206 197
                 style="padding-top: 17px"
207 198
               >
208 199
                 <el-input
209
-                  placeholder="请输入出库数量"
200
+                  placeholder="请输入单价"
210 201
                   type="number"
211
-                  v-model="scope.row.count"
202
+                  v-model="scope.row.price"
212 203
                 ></el-input>
213 204
               </el-form-item>
214 205
             </template>
215 206
           </el-table-column>
216 207
 
217
-          <el-table-column label="总价" min-width="20" align="center">
208
+
209
+
210
+          <el-table-column label="总价"  width="150" align="center">
218 211
             <template slot-scope="scope">
219 212
               {{ calculate(scope.row.price * scope.row.count) }}
220 213
             </template>
221 214
           </el-table-column>
222
-          <el-table-column label="备注" min-width="20" align="center">
215
+
216
+          <el-table-column label="生产厂商"  width="150" align="center">
217
+            <template slot-scope="scope">
218
+               <el-select size="small" v-model="scope.row.manufacturer" filterable placeholder="请选择厂商">
219
+                <el-option
220
+                  v-for="(option, index) in manufacturerList"
221
+                  :key="index"
222
+                  :label="option.manufacturer_name"
223
+                  :value="option.id">
224
+                </el-option>
225
+               </el-select>
226
+            </template>   
227
+          </el-table-column>
228
+
229
+         <!-- <el-table-column label="生产日期"  width="150" align="center">
230
+           <template slot-scope="scope">
231
+              <el-date-picker
232
+                prefix-icon="el-icon-date"
233
+                style="width: 145px"
234
+                v-model="scope.row.product_date"
235
+                type="date"
236
+                placeholder="选择日期时间"
237
+                format="yyyy-MM-dd"
238
+                value-format="yyyy-MM-dd"
239
+              ></el-date-picker>
240
+            </template>
241
+         </el-table-column>
242
+
243
+          <el-table-column label="有效期"  width="150" align="center">
244
+            <template slot-scope="scope">
245
+              <el-date-picker
246
+                prefix-icon="el-icon-date"
247
+                style="width: 145px"
248
+                v-model="scope.row.expiry_date"
249
+                type="date"
250
+                placeholder="选择日期时间"
251
+                format="yyyy-MM-dd"
252
+                value-format="yyyy-MM-dd"
253
+              ></el-date-picker>
254
+            </template>
255
+          </el-table-column> -->
256
+
257
+
258
+          <el-table-column label="备注"  width="150" align="center">
223 259
             <template slot-scope="scope">
224 260
               <el-input v-model="scope.row.remark"></el-input>
225 261
             </template>
@@ -265,7 +301,7 @@
265 301
 
266 302
 <script>
267 303
 import { uParseTime } from "@/utils/tools";
268
-import { getSalesReturnConfig, postWarehouseOut,GetAllConfig,GetAllGoodInfoByID } from "@/api/stock";
304
+import { getSalesReturnConfig, postWarehouseOut,GetAllConfig,GetAllGoodInfoByID,postSearchGoodList } from "@/api/stock";
269 305
 
270 306
 import BreadCrumb from "../components/bread-crumb";
271 307
 import StockInDialog from './Dialog/stockInDialog'
@@ -320,7 +356,9 @@ export default {
320 356
       manufacturer: [],
321 357
       dealer: [],
322 358
       goodType: [],
323
-      goodInfo:[]
359
+      goodInfo:[],
360
+      goodList:[],
361
+      manufacturerList:[]
324 362
     };
325 363
   },
326 364
   methods: {
@@ -352,36 +390,7 @@ export default {
352 390
 
353 391
       this.currentIndex = -1
354 392
 
355
-      // this.$refs.dialog.hide();
356
-      // this.propForm.goodType = [];
357
-      // if (val.selectedGoodInfo.length > 0) {
358
-      //   for (let i = val.selectedGoodInfo.length - 1; i >= 0; i--) {
359
-      //     if (i == 0) {
360
-      //       this.recordInfo.recordData[this.currentIndex].good_type_id =
361
-      //         val.selectedGoodInfo[i].good_type_id;
362
-      //       this.recordInfo.recordData[this.currentIndex].good_id =
363
-      //         val.selectedGoodInfo[i].id;
364
-      //       this.recordInfo.recordData[
365
-      //         this.currentIndex
366
-      //       ].price = val.selectedGoodInfo[i].buy_price.toString();
367
-      //     } else {
368
-      //       console.log(val.selectedGoodInfo[i].buy_price.toString());
369
-      //       const tempForm = {};
370
-      //       tempForm["good_type_id"] = val.selectedGoodInfo[i].good_type_id;
371
-      //       tempForm["good_id"] = val.selectedGoodInfo[i].id;
372
-      //       tempForm["count"] = "";
373
-      //       tempForm["price"] = val.selectedGoodInfo[i].buy_price.toString();
374
-      //       tempForm["remark"] = "";
375
-      //       this.recordInfo.recordData.splice(
376
-      //         this.currentIndex + 1,
377
-      //         0,
378
-      //         tempForm
379
-      //       );
380
-      //     }
381
-      //   }
382
-      // }
383
-      //
384
-      // this.currentIndex = -1;
393
+    
385 394
     },
386 395
     cancle: function() {
387 396
       this.$refs.dialog.hide();
@@ -404,22 +413,6 @@ export default {
404 413
           return false;
405 414
         } else {
406 415
           loading.close();
407
-          // var warehouseInfoList = response.data.data.warehouseInfoList;
408
-          // this.warehouseInfoList = response.data.data.warehouseInfoList;
409
-          // for (let i = 0; i < warehouseInfoList.length; i++) {
410
-          //   if (warehouseInfoList[i].info.manufacturers.id > 0) {
411
-          //     this.manufacturer.push(warehouseInfoList[i].info.manufacturers);
412
-          //   }
413
-          //   if (warehouseInfoList[i].info.dealers.id > 0) {
414
-          //     this.dealer.push(warehouseInfoList[i].info.dealers);
415
-          //   }
416
-          // }
417
-          //
418
-          // for (let i = 0; i < this.warehouseInfoList.length; i++) {
419
-          //   this.goodType.push(this.warehouseInfoList[i].info.type);
420
-          // }
421
-
422
-
423 416
           this.manufacturer = response.data.data.manufacturer
424 417
           this.dealer = response.data.data.dealer
425 418
           this.goodType = response.data.data.goodType
@@ -429,29 +422,6 @@ export default {
429 422
           this.manufacturer.splice(0, 0, { id: -1, manufacturer_name: '其他' })
430 423
           this.dealer.splice(0, 0, { id: -1, dealer_name: '其他' })
431 424
 
432
-
433
-
434
-          // const obj = {};
435
-          // const obj2 = {};
436
-          // const obj3 = {};
437
-          // // 去重复
438
-          // this.manufacturer = this.manufacturer.reduce((cur, next) => {
439
-          //   obj[next.id] ? "" : (obj[next.id] = true && cur.push(next));
440
-          //   return cur;
441
-          // }, []);
442
-          // // 去重复
443
-          // this.dealer = this.dealer.reduce((cur, next) => {
444
-          //   obj2[next.id] ? "" : (obj2[next.id] = true && cur.push(next));
445
-          //   return cur;
446
-          // }, []);
447
-          //
448
-          // this.goodType = this.goodType.reduce((cur, next) => {
449
-          //   obj3[next.id] ? "" : (obj3[next.id] = true && cur.push(next));
450
-          //   return cur;
451
-          // }, []);
452
-          //
453
-          // this.manufacturer.splice(0, 0, { id: 0, manufacturer_name: "全部" });
454
-          // this.dealer.splice(0, 0, { id: 0, dealer_name: "全部" });
455 425
         }
456 426
       });
457 427
     },
@@ -490,6 +460,8 @@ export default {
490 460
       tempObj["price"] = "";
491 461
       tempObj["remark"] = "";
492 462
       tempObj["good_unit"] = "";
463
+      tempObj["number"] = ""
464
+      tempObj["specification_name"] = ""
493 465
       this.recordInfo.recordData.push(tempObj);
494 466
     },
495 467
     handleDelete: function(index, row) {
@@ -607,8 +579,8 @@ export default {
607 579
           const params = {
608 580
             stockOut: this.recordInfo.recordData
609 581
           };
610
-          console.log(this.form.dealer);
611
-
582
+          console.log(this.recordInfo.recordData);
583
+          return
612 584
           postWarehouseOut(
613 585
             params,
614 586
             this.warehouse_out_time,
@@ -635,7 +607,54 @@ export default {
635 607
     },
636 608
     changeDealer(val) {
637 609
       this.propForm.dealer = val;
638
-    }
610
+    },
611
+    querySearchAsync(keyword, cb) {
612
+      let key = '';
613
+      if (keyword != undefined) {
614
+        key = keyword
615
+      }
616
+      console.log("keyrowrd",key)
617
+      postSearchGoodList(key).then(response => {
618
+        if (response.data.state == 1) {
619
+          
620
+            var list = response.data.data.list
621
+            this.goodList = list
622
+            var manufacturerList = response.data.data.manufacturerList
623
+            this.manufacturerList = manufacturerList
624
+            for(let i=0;i<this.goodList.length;i++){
625
+              for(let j=0;j<this.manufacturerList.length;j++){
626
+                if(this.goodList[i].manufacturer == this.manufacturerList[j].id){
627
+                    this.goodList[i].manufacturer = this.manufacturerList[j].manufacturer_name
628
+                }
629
+              }
630
+            }
631
+          
632
+            cb(this.goodList)
633
+        } else {
634
+          cb([])
635
+        }
636
+      })
637
+    },
638
+    changeGoodName(val){
639
+      this.currentIndex = val
640
+    },
641
+    handleSelect(val){
642
+      console.log("val",val)
643
+        for(let i=0;i<this.recordInfo.recordData.length;i++){
644
+          if(this.currentIndex == i){
645
+            this.recordInfo.recordData[i].good_type_id = val.id
646
+            this.recordInfo.recordData[i].good_name = val.good_name
647
+            this.recordInfo.recordData[i].good_type_id = val.good_type_id
648
+            this.recordInfo.recordData[i].name = val.specification_name + "*" + val.min_number+val.min_unit +"/"+val.packing_unit
649
+            // this.recordInfo.recordData[i].number =  val.number
650
+            this.recordInfo.recordData[i].manufacturer = val.manufacturer
651
+            this.recordInfo.recordData[i].remark = val.remark
652
+            this.recordInfo.recordData[i].price = val.buy_price
653
+            this.recordInfo.recordData[i].specification_name = val.specification_name
654
+            this.recordInfo.recordData[i].good_id = val.id
655
+          }
656
+        }
657
+      }
639 658
   },
640 659
   created() {
641 660
     var nowDate = new Date();
@@ -655,6 +674,8 @@ export default {
655 674
     tempObj["price"] = "";
656 675
     tempObj["remark"] = "";
657 676
     tempObj["good_unit"] = ""
677
+    tempObj["number"] = ""
678
+    tempObj["specification_name"] = ""
658 679
     this.recordInfo.recordData.push(tempObj);
659 680
     this.GetConfigInfo();
660 681
     this.propForm.goodUnit = this.$store.getters.good_unit;