XMLWAN 3 gadus atpakaļ
vecāks
revīzija
1c11dd821d

+ 1 - 1
src/api/advice.js Parādīt failu

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

+ 16 - 0
src/api/data.js Parādīt failu

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 Parādīt failu

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 Parādīt failu

618
       method:"get",
618
       method:"get",
619
       params:params
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 Parādīt failu

79
       hidden: true,
79
       hidden: true,
80
       is_menu: false,
80
       is_menu: false,
81
       meta: { title: 'drugStockInOrderAdd', noCache: true }
81
       meta: { title: 'drugStockInOrderAdd', noCache: true }
82
-    },{
82
+    },
83
+    {
83
       path: '/drugstock/in/detail',
84
       path: '/drugstock/in/detail',
84
       component: () => import('@/xt_pages/stock/drugs/drugStockInDetail'),
85
       component: () => import('@/xt_pages/stock/drugs/drugStockInDetail'),
85
       name: 'drugStockInDetail',
86
       name: 'drugStockInDetail',
128
       hidden: true,
129
       hidden: true,
129
       is_menu: false,
130
       is_menu: false,
130
       meta: { title: 'cancelDrugStockDetail', noCache: true }
131
       meta: { title: 'cancelDrugStockDetail', noCache: true }
131
-    },{
132
+    },
133
+    {
132
       path: '/drugstock/user/detail',
134
       path: '/drugstock/user/detail',
133
       component: () => import('@/xt_pages/stock/drugs/drugStockUserDetail'),
135
       component: () => import('@/xt_pages/stock/drugs/drugStockUserDetail'),
134
       name: 'drugStockUserDetail',
136
       name: 'drugStockUserDetail',
136
       is_menu: false,
138
       is_menu: false,
137
       meta: { title: 'drugStockUserDetail', noCache: true }
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 Parādīt failu

48
                                 </el-option>
48
                                 </el-option>
49
                             </el-select>
49
                             </el-select>
50
                         </el-form-item>
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
                             <el-input v-model="form.specification_name" placeholder="" maxlength="30"></el-input>
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
                         <el-form-item label="生产厂商 : " prop="name" style="width:100%">
98
                         <el-form-item label="生产厂商 : " prop="name" style="width:100%">
55
                             <el-select v-model="form.manufacturer" style="width:100%" placeholder="请选择">
99
                             <el-select v-model="form.manufacturer" style="width:100%" placeholder="请选择">
56
                                 <el-option
100
                                 <el-option

+ 212 - 129
src/xt_pages/data/components/addDrugs.vue Parādīt failu

9
         <el-tabs v-model="activeName">
9
         <el-tabs v-model="activeName">
10
             <el-tab-pane label="基础数据" name="first">
10
             <el-tab-pane label="基础数据" name="first">
11
                 <div>
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
                         <el-form-item label="药品名称 : " prop="drug_name">
13
                         <el-form-item label="药品名称 : " prop="drug_name">
15
                             <el-input v-model="form.drug_name" style="width:160px;" placeholder=""
14
                             <el-input v-model="form.drug_name" style="width:160px;" placeholder=""
16
                                       maxlength="30"></el-input>
15
                                       maxlength="30"></el-input>
17
                         </el-form-item>
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
                         <el-form-item label="药品别名 : ">
18
                         <el-form-item label="药品别名 : ">
26
                             <el-input v-model="form.drug_alias" style="width:160px;" placeholder=""
19
                             <el-input v-model="form.drug_alias" style="width:160px;" placeholder=""
27
                                       maxlength="30"></el-input>
20
                                       maxlength="30"></el-input>
28
                         </el-form-item>
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
                         <el-form-item label="药品类别 : " prop="drug_category">
23
                         <el-form-item label="药品类别 : " prop="drug_category">
38
                             <el-select v-model="form.drug_category" style="width:160px;" placeholder="请选择">
24
                             <el-select v-model="form.drug_category" style="width:160px;" placeholder="请选择">
39
                                 <el-option
25
                                 <el-option
44
                                 </el-option>
30
                                 </el-option>
45
                             </el-select>
31
                             </el-select>
46
                         </el-form-item>
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
                         <el-form-item label="药品类型 : " prop="drug_type">
78
                         <el-form-item label="药品类型 : " prop="drug_type">
52
                             <el-select v-model="form.drug_type" style="width:160px;" placeholder="请选择">
79
                             <el-select v-model="form.drug_type" style="width:160px;" placeholder="请选择">
53
                                 <el-option
80
                                 <el-option
58
                                 </el-option>
85
                                 </el-option>
59
                             </el-select>
86
                             </el-select>
60
                         </el-form-item>
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
                             <el-input v-model="form.drug_stock_limit" style="width:160px;" placeholder=""
131
                             <el-input v-model="form.drug_stock_limit" style="width:160px;" placeholder=""
63
                                       maxlength="30"></el-input>
132
                                       maxlength="30"></el-input>
64
                         </el-form-item>
133
                         </el-form-item>
86
                                 </el-option>
155
                                 </el-option>
87
                             </el-select>
156
                             </el-select>
88
                         </el-form-item>
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
                         <el-form-item label="单位换算 : ">
159
                         <el-form-item label="单位换算 : ">
110
                             <el-input v-model="form.unit_matrixing" style="width:160px;" placeholder=""
160
                             <el-input v-model="form.unit_matrixing" style="width:160px;" placeholder=""
111
                                       maxlength="30"></el-input>
161
                                       maxlength="30"></el-input>
112
                         </el-form-item>
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
                                       maxlength="30"></el-input>
169
                                       maxlength="30"></el-input>
116
                         </el-form-item>
170
                         </el-form-item>
117
-                        <el-form-item label="上次进价(元) : " prop="last_price">
171
+                        <el-form-item label="进货价(元) : " prop="last_price">
118
                             <el-input v-model="form.last_price" style="width:160px;" placeholder=""
172
                             <el-input v-model="form.last_price" style="width:160px;" placeholder=""
119
                                       maxlength="30"></el-input>
173
                                       maxlength="30"></el-input>
120
                         </el-form-item>
174
                         </el-form-item>
142
                                 </el-option>
196
                                 </el-option>
143
                             </el-select>
197
                             </el-select>
144
                         </el-form-item>
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
                         <el-form-item label="限制性用药 : ">
202
                         <el-form-item label="限制性用药 : ">
160
                             <el-select v-model="form.lmt_used_flag" style="width:160px;" placeholder="请选择">
203
                             <el-select v-model="form.lmt_used_flag" style="width:160px;" placeholder="请选择">
161
                                 <el-option
204
                                 <el-option
162
-                                        v-for="item,index in lmt_used_flags"
205
+                                        v-for="(item,index) in lmt_used_flags"
163
                                         :key="index"
206
                                         :key="index"
164
                                         :label="item.name"
207
                                         :label="item.name"
165
                                         :value="item.id">
208
                                         :value="item.id">
171
                         <el-form-item label="审批标志 : ">
214
                         <el-form-item label="审批标志 : ">
172
                             <el-select v-model="form.hosp_appr_flag" style="width:160px;" placeholder="请选择">
215
                             <el-select v-model="form.hosp_appr_flag" style="width:160px;" placeholder="请选择">
173
                                 <el-option
216
                                 <el-option
174
-                                        v-for="item,index in hosp_appr_flags"
217
+                                        v-for="(item,index) in hosp_appr_flags"
175
                                         :key="index"
218
                                         :key="index"
176
                                         :label="item.name"
219
                                         :label="item.name"
177
                                         :value="item.id">
220
                                         :value="item.id">
185
                                       maxlength="30"></el-input>
228
                                       maxlength="30"></el-input>
186
                         </el-form-item>
229
                         </el-form-item>
187
                         <el-form-item label="生产厂商 : " prop="manufacturer">
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
                             <el-select v-model="form.manufacturer" style="width:160px;" filterable placeholder="请选择">
232
                             <el-select v-model="form.manufacturer" style="width:160px;" filterable placeholder="请选择">
198
                                 <el-option
233
                                 <el-option
199
                                         v-for="(item,index) in manufacturerList"
234
                                         v-for="(item,index) in manufacturerList"
230
                         <el-form-item label="是否特病目录:" prop="is_special_diseases">
265
                         <el-form-item label="是否特病目录:" prop="is_special_diseases">
231
                             <el-select v-model="form.is_special_diseases" style="width:160px;" placeholder="请选择">
266
                             <el-select v-model="form.is_special_diseases" style="width:160px;" placeholder="请选择">
232
                                 <el-option
267
                                 <el-option
233
-                                        v-for="item,index in options"
268
+                                        v-for="(item,index) in options"
234
                                         :key="index"
269
                                         :key="index"
235
                                         :label="item.label"
270
                                         :label="item.label"
236
                                         :value="item.value">
271
                                         :value="item.value">
240
                         <el-form-item label="是否备案 : " prop="is_record">
275
                         <el-form-item label="是否备案 : " prop="is_record">
241
                             <el-select v-model="form.is_record" style="width:160px;" placeholder="请选择">
276
                             <el-select v-model="form.is_record" style="width:160px;" placeholder="请选择">
242
                                 <el-option
277
                                 <el-option
243
-                                        v-for="item,index in options"
278
+                                        v-for="(item,index) in options"
244
                                         :key="index"
279
                                         :key="index"
245
                                         :label="item.label"
280
                                         :label="item.label"
246
                                         :value="item.value">
281
                                         :value="item.value">
251
                         <el-form-item label="处方药标志">
286
                         <el-form-item label="处方药标志">
252
                             <el-select v-model="form.prescription_mark" style="width:160px;" placeholder="请选择">
287
                             <el-select v-model="form.prescription_mark" style="width:160px;" placeholder="请选择">
253
                                 <el-option
288
                                 <el-option
254
-                                        v-for="item,index in options"
289
+                                        v-for="(item,index) in options"
255
                                         :key="index"
290
                                         :key="index"
256
                                         :label="item.label"
291
                                         :label="item.label"
257
                                         :value="item.value">
292
                                         :value="item.value">
263
                             <el-input v-model="form.social_security_directory_code" style="width:180px"></el-input>
298
                             <el-input v-model="form.social_security_directory_code" style="width:180px"></el-input>
264
                         </el-form-item>
299
                         </el-form-item>
265
 
300
 
301
+
302
+
266
                         <el-form-item label="备案日期:">
303
                         <el-form-item label="备案日期:">
267
                             <el-date-picker
304
                             <el-date-picker
268
                                     value-format="yyyy-MM-dd"
305
                                     value-format="yyyy-MM-dd"
275
                         <el-form-item label="药品备注:">
312
                         <el-form-item label="药品备注:">
276
                             <el-input v-model="form.drug_remark" style="width:180px"></el-input>
313
                             <el-input v-model="form.drug_remark" style="width:180px"></el-input>
277
                         </el-form-item>
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
                         <el-form-item label="经销商: " style="width:100%">
316
                         <el-form-item label="经销商: " style="width:100%">
283
 
317
 
284
                             <el-select v-model="form.dealer" style="width:100%;" filterable placeholder="请选择">
318
                             <el-select v-model="form.dealer" style="width:100%;" filterable placeholder="请选择">
314
             <el-tab-pane label="扩展数据" name="second">
348
             <el-tab-pane label="扩展数据" name="second">
315
                 <el-form :model="form" label-width="120px"
349
                 <el-form :model="form" label-width="120px"
316
                          style="display: flex;flex-wrap: wrap;justify-content: space-between;">
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
                     <el-form-item label="标签:" prop="label">
352
                     <el-form-item label="标签:" prop="label">
346
                         <el-select v-model="form.label" style="width:160px;" placeholder="请选择">
353
                         <el-select v-model="form.label" style="width:160px;" placeholder="请选择">
347
                             <el-option
354
                             <el-option
348
-                                    v-for="item,index in sign"
355
+                                    v-for="(item,index) in sign"
349
                                     :key="index"
356
                                     :key="index"
350
                                     :label="item.name"
357
                                     :label="item.name"
351
                                     :value="item.id">
358
                                     :value="item.id">
358
                     <el-form-item label="是否常用医嘱:" prop="is_use_doctor_advice">
365
                     <el-form-item label="是否常用医嘱:" prop="is_use_doctor_advice">
359
                         <el-select v-model="form.is_use_doctor_advice" style="width:160px;" placeholder="请选择">
366
                         <el-select v-model="form.is_use_doctor_advice" style="width:160px;" placeholder="请选择">
360
                             <el-option
367
                             <el-option
361
-                                    v-for="item,index in options"
368
+                                    v-for="(item,index) in options"
362
                                     :key="index"
369
                                     :key="index"
363
                                     :label="item.label"
370
                                     :label="item.label"
364
                                     :value="item.value">
371
                                     :value="item.value">
368
                     <el-form-item label="是否默认:" prop="is_default">
375
                     <el-form-item label="是否默认:" prop="is_default">
369
                         <el-select v-model="form.is_default" style="width:160px;" placeholder="请选择">
376
                         <el-select v-model="form.is_default" style="width:160px;" placeholder="请选择">
370
                             <el-option
377
                             <el-option
371
-                                    v-for="item,index in options"
378
+                                    v-for="(item,index) in options"
372
                                     :key="index"
379
                                     :key="index"
373
                                     :label="item.label"
380
                                     :label="item.label"
374
                                     :value="item.value">
381
                                     :value="item.value">
520
           prescription_mark: '',//处方药标志
527
           prescription_mark: '',//处方药标志
521
           social_security_directory_code: '',//社保目录编码
528
           social_security_directory_code: '',//社保目录编码
522
           record_date: '',//备案日期
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
         rules: {
538
         rules: {
527
           drug_name: [{ required: true, message: '请填写药品名称', trigger: 'blur' }],
539
           drug_name: [{ required: true, message: '请填写药品名称', trigger: 'blur' }],
528
           drug_alias: [{ required: true, message: '请选择药品类别', trigger: 'change' }],
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
           drug_type: [{ required: true, message: '请填写药品类型', trigger: 'blur' }],
548
           drug_type: [{ required: true, message: '请填写药品类型', trigger: 'blur' }],
531
           drug_stock_limit: [{ required: true, message: '请填写库存警戒', trigger: 'blur' }],
549
           drug_stock_limit: [{ required: true, message: '请填写库存警戒', trigger: 'blur' }],
532
           drug_origin_place: [{ required: true, message: '请填写产地', trigger: 'blur' }],
550
           drug_origin_place: [{ required: true, message: '请填写产地', trigger: 'blur' }],
533
           drug_dosage_form: [{ required: true, message: '请填写药品剂型', trigger: 'blur' }],
551
           drug_dosage_form: [{ required: true, message: '请填写药品剂型', trigger: 'blur' }],
534
           medical_insurance_level: [{ required: true, message: '请选择医保等级', trigger: 'change' }],
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
           unit_matrixing: [{ required: true, message: '请填写单位换算', trigger: 'blur' }],
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
           drug_classify: [{ required: true, message: '请选择药物分类', trigger: 'change' }],
558
           drug_classify: [{ required: true, message: '请选择药物分类', trigger: 'change' }],
541
           drug_dose: [{ required: true, message: '请填写剂量', trigger: 'blur' }],
559
           drug_dose: [{ required: true, message: '请填写剂量', trigger: 'blur' }],
542
           manufacturer: [{ required: true, message: '请选择生产产商', trigger: 'change' }],
560
           manufacturer: [{ required: true, message: '请选择生产产商', trigger: 'change' }],
547
           drug_remark: [{ required: true, message: '请填写药品备注' }],
565
           drug_remark: [{ required: true, message: '请填写药品备注' }],
548
           lmt_used_flag:[{ required: true, message: '请选择是否限制用药' }],
566
           lmt_used_flag:[{ required: true, message: '请选择是否限制用药' }],
549
           hosp_appr_flag:[{ required: true, message: '请选择审批标志' }],
567
           hosp_appr_flag:[{ required: true, message: '请选择审批标志' }],
550
-
568
+      
551
         },
569
         },
552
         page: 1,
570
         page: 1,
553
         limit: 500,
571
         limit: 500,
560
         drugControlList:[],
578
         drugControlList:[],
561
         drugClassifyList:[],
579
         drugClassifyList:[],
562
         statisticsCategoryList:[],
580
         statisticsCategoryList:[],
563
-        pharmacologyCategoryList:[]
581
+        pharmacologyCategoryList:[],
582
+        dosageShow:false,
583
+        unitList:[]
564
       }
584
       }
565
     },
585
     },
566
     props: {
586
     props: {
619
         this.form.intro = ''
639
         this.form.intro = ''
620
       },
640
       },
621
       show(id, obj) {
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
         this.getInitializtion()
655
         this.getInitializtion()
624
         this.getlist()
656
         this.getlist()
625
         this.GetAllConfig()
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
         if(obj.dealer == 0){
664
         if(obj.dealer == 0){
628
            obj.dealer = ""
665
            obj.dealer = ""
629
         }
666
         }
735
         form['social_security_directory_code'] = this.form.social_security_directory_code
772
         form['social_security_directory_code'] = this.form.social_security_directory_code
736
         form['record_date'] = this.form.record_date
773
         form['record_date'] = this.form.record_date
737
         form['drug_remark'] = this.form.drug_remark
774
         form['drug_remark'] = this.form.drug_remark
738
-
739
         form['hosp_appr_flag'] = this.form.hosp_appr_flag
775
         form['hosp_appr_flag'] = this.form.hosp_appr_flag
740
         form['lmt_used_flag'] = this.form.lmt_used_flag
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
         return form
783
         return form
743
       },
784
       },
744
       getlist() {
785
       getlist() {
768
         getInitializtion().then(response=>{
809
         getInitializtion().then(response=>{
769
            if(response.data.state ==1){
810
            if(response.data.state ==1){
770
              var drugCategoryList =  response.data.data.drugCategoryList
811
              var drugCategoryList =  response.data.data.drugCategoryList
771
-             console.log("药品类别",drugCategoryList) 
812
+            
772
              this.drugCategoryList = drugCategoryList
813
              this.drugCategoryList = drugCategoryList
773
              var drugTypeList = response.data.data.drugTypeList
814
              var drugTypeList = response.data.data.drugTypeList
774
-              console.log("药物分类",drugTypeList)
815
+             
775
               this.drugTypeList = drugTypeList
816
               this.drugTypeList = drugTypeList
776
              var drugDosageFormList =  response.data.data.drugDosageFormList
817
              var drugDosageFormList =  response.data.data.drugDosageFormList
777
-             console.log("药品剂型",drugDosageFormList) 
818
+            
778
              this.drugDosageFormList = drugDosageFormList
819
              this.drugDosageFormList = drugDosageFormList
779
              var medicalInsuranceLevelList =  response.data.data.medicalInsuranceLevelList
820
              var medicalInsuranceLevelList =  response.data.data.medicalInsuranceLevelList
780
-             console.log("医保等级",medicalInsuranceLevelList)
821
+           
781
              this.medicalInsuranceLevelList = medicalInsuranceLevelList
822
              this.medicalInsuranceLevelList = medicalInsuranceLevelList
782
              var drugControlList = response.data.data.drugControlList
823
              var drugControlList = response.data.data.drugControlList
783
-             console.log("开药控制",drugControlList)
824
+             
784
              this.drugControlList = drugControlList
825
              this.drugControlList = drugControlList
785
              var drugClassifyList = response.data.data.drugClassifyList
826
              var drugClassifyList = response.data.data.drugClassifyList
786
-             console.log("药物分类",drugClassifyList)
827
+           
787
              this.drugClassifyList = drugClassifyList
828
              this.drugClassifyList = drugClassifyList
788
              var statisticsCategoryList =  response.data.data.statisticsCategoryList
829
              var statisticsCategoryList =  response.data.data.statisticsCategoryList
789
-             console.log("统计分类",statisticsCategoryList)
830
+            
790
              this.statisticsCategoryList = statisticsCategoryList
831
              this.statisticsCategoryList = statisticsCategoryList
791
              var pharmacologyCategoryList = response.data.data.pharmacologyCategoryList
832
              var pharmacologyCategoryList = response.data.data.pharmacologyCategoryList
792
-             console.log("药理分类",pharmacologyCategoryList)
833
+           
793
              this.pharmacologyCategoryList = pharmacologyCategoryList
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
     }, watch: {
875
     }, watch: {
798
       visible(val) {
876
       visible(val) {
815
 <style lang="scss">
893
 <style lang="scss">
816
     .addDrugsDialog {
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
 </style>
906
 </style>

+ 20 - 36
src/xt_pages/data/components/consumables.vue Parādīt failu

10
         <label class="title"><span class="name">是否启用</span> : </label>
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">
11
         <el-select v-model="is_use" style="width:140px;margin-right:10px;" placeholder="请选择" @change="changeUser">
12
           <el-option
12
           <el-option
13
-            v-for="item in options"
14
-            :key="item.value"
13
+            v-for="(item,z) in options"
14
+            :key="z"
15
             :label="item.label"
15
             :label="item.label"
16
             :value="item.value">
16
             :value="item.value">
17
           </el-option>
17
           </el-option>
19
         <label class="title"><span class="name">生产厂商</span> : </label>
19
         <label class="title"><span class="name">生产厂商</span> : </label>
20
         <el-select v-model="manufacturer" style="width:140px;margin-right:10px;" placeholder="请选择" @change="changeManufacture">
20
         <el-select v-model="manufacturer" style="width:140px;margin-right:10px;" placeholder="请选择" @change="changeManufacture">
21
           <el-option
21
           <el-option
22
-            v-for="item in manufacturers"
23
-            :key="item.id"
22
+            v-for="(item,y) in manufacturers"
23
+            :key="y"
24
             :label="item.manufacturer_name"
24
             :label="item.manufacturer_name"
25
             :value="item.id">
25
             :value="item.id">
26
           </el-option>
26
           </el-option>
28
         <span style="color: #909399;font-size:14px;">备案 : &nbsp;</span>
28
         <span style="color: #909399;font-size:14px;">备案 : &nbsp;</span>
29
         <el-select v-model="is_record" style="width:140px;margin-right:10px;" placeholder="请选择" @change="changeRecord">
29
         <el-select v-model="is_record" style="width:140px;margin-right:10px;" placeholder="请选择" @change="changeRecord">
30
           <el-option
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
             :label="item.label"
33
             :label="item.label"
43
             :value="item.value">
34
             :value="item.value">
44
           </el-option>
35
           </el-option>
45
         </el-select>
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
       </div>
38
       </div>
60
       <div>
39
       <div>
61
         <el-button type="primary" @click="openForm()">新增</el-button>
40
         <el-button type="primary" @click="openForm()">新增</el-button>
206
       width="40%"
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
         <span> {{ item.export_time | parseTime('{y}-{m}-{d} {h}:{i}:{s}')}}</span>
189
         <span> {{ item.export_time | parseTime('{y}-{m}-{d} {h}:{i}:{s}')}}</span>
211
         <br/>
190
         <br/>
212
         <br/>
191
         <br/>
327
               good_number:'',
306
               good_number:'',
328
               social_security_directory_code:"",
307
               social_security_directory_code:"",
329
               special_medical:"",
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
             isVisibility: false,
316
             isVisibility: false,
333
 
317
 
706
             }else{
690
             }else{
707
               this.goodInfo.goodInfoDialog.formValue.special_medical = response.data.data.goodInfo.special_medical.toString()
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
             this.$refs.addConsumable.show(row.id, this.goodInfo.goodInfoDialog.formValue)
698
             this.$refs.addConsumable.show(row.id, this.goodInfo.goodInfoDialog.formValue)
711
           }
699
           }
712
         })
700
         })
791
         })
779
         })
792
       },
780
       },
793
       goodInfoDialogComfirm: function(val) {
781
       goodInfoDialogComfirm: function(val) {
794
-
782
+        console.log("val22222",val)
795
         if (val.isCreated == 2) {
783
         if (val.isCreated == 2) {
796
           //修改
784
           //修改
797
           val['id'] = this.goodInfo.editGoodId;
785
           val['id'] = this.goodInfo.editGoodId;
798
           val['good_code'] = this.goodInfo.good_code;
786
           val['good_code'] = this.goodInfo.good_code;
799
 
787
 
800
-
801
-
802
-
803
-
804
           modifyGoodInfo(val).then(response => {
788
           modifyGoodInfo(val).then(response => {
805
             if (response.data.state == 0) {
789
             if (response.data.state == 0) {
806
               // this.$message.error(response.data.msg)
790
               // this.$message.error(response.data.msg)

+ 176 - 144
src/xt_pages/data/components/drugs.vue Parādīt failu

7
         <el-button style="margin-right:10px;" class="filter-item" type="primary" icon="el-icon-search"
7
         <el-button style="margin-right:10px;" class="filter-item" type="primary" icon="el-icon-search"
8
                    @click="searchAction">搜索
8
                    @click="searchAction">搜索
9
         </el-button>
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
        <label class="title"><span class="name">生产厂商</span> : </label>
11
        <label class="title"><span class="name">生产厂商</span> : </label>
20
         <el-select v-model="manufacturer" style="width:140px;margin-right:10px;" placeholder="请选择" @change="changeManufacture">
12
         <el-select v-model="manufacturer" style="width:140px;margin-right:10px;" placeholder="请选择" @change="changeManufacture">
21
           <el-option
13
           <el-option
34
             :value="item.value">
26
             :value="item.value">
35
           </el-option>
27
           </el-option>
36
         </el-select>
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
         <span style="color: #909399;font-size:14px;">备案 : &nbsp;</span>
31
         <span style="color: #909399;font-size:14px;">备案 : &nbsp;</span>
48
         <el-select v-model="is_record" style="width:140px;margin-right:10px;" placeholder="请选择" @change="changeRecord">
32
         <el-select v-model="is_record" style="width:140px;margin-right:10px;" placeholder="请选择" @change="changeRecord">
56
       </div>
40
       </div>
57
       <div>
41
       <div>
58
         <el-button type="primary" @click="openForm(0)">新增</el-button>
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
       </div>
44
       </div>
62
 
45
 
63
     </div>
46
     </div>
98
           <div>{{scope.row.drug_name}}</div>
81
           <div>{{scope.row.drug_name}}</div>
99
         </template>
82
         </template>
100
       </el-table-column>
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
         <template slot-scope="scope">
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
         </template>
88
         </template>
105
       </el-table-column>
89
       </el-table-column>
106
       <el-table-column prop="date" label="最大单位" width="60" align="center">
90
       <el-table-column prop="date" label="最大单位" width="60" align="center">
329
           drug_code: '',
313
           drug_code: '',
330
           hosp_appr_flag:'',
314
           hosp_appr_flag:'',
331
           lmt_used_flag:'',
315
           lmt_used_flag:'',
316
+          dose_unit:'',
317
+          min_price:'',
318
+          drug_day:"",//默认开药天数
332
         },
319
         },
333
         tempFormValue: {
320
         tempFormValue: {
334
           drug_name: '',//药品名称
321
           drug_name: '',//药品名称
381
           prescription_mark:'',
368
           prescription_mark:'',
382
           hosp_appr_flag:'',
369
           hosp_appr_flag:'',
383
           lmt_used_flag:'',
370
           lmt_used_flag:'',
384
-
371
+          dosage:'', //剂量
372
+          unval:'',//拆零
373
+          packing_unit:"",//包装单位
374
+          packing_price:"",//包装零售价
375
+          drug_day:"",//默认开药天数
385
         },
376
         },
386
 
377
 
387
         current_id: 0,
378
         current_id: 0,
500
         if (val.id > 0) {
491
         if (val.id > 0) {
501
           //修改
492
           //修改
502
           val['id'] = this.current_id;
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
           editBaseDrugLib(val,untit).then(response => {
498
           editBaseDrugLib(val,untit).then(response => {
504
             if (response.data.state == 0) {
499
             if (response.data.state == 0) {
505
               this.$message.error(response.data.msg);
500
               this.$message.error(response.data.msg);
512
           })
507
           })
513
         } else if (val.id == 0) {
508
         } else if (val.id == 0) {
514
           //新增
509
           //新增
515
-
516
-
510
+          console.log("val2222222",val)
511
+        
517
           createBaseDrugLib(val).then(response => {
512
           createBaseDrugLib(val).then(response => {
518
             if (response.data.state == 0) {
513
             if (response.data.state == 0) {
519
               this.$message.error(response.data.msg);
514
               this.$message.error(response.data.msg);
567
               this.$message.error(response.data.msg);
562
               this.$message.error(response.data.msg);
568
               return false
563
               return false
569
             } else {
564
             } else {
570
-
565
+              console.log("药品详情",response.data.data.drug)
571
               for (let key in response.data.data.drug) {
566
               for (let key in response.data.data.drug) {
572
                 this.formValue[key] = response.data.data.drug[key]
567
                 this.formValue[key] = response.data.data.drug[key]
573
               }
568
               }
680
               if(this.formValue.hosp_appr_flag == 0){
675
               if(this.formValue.hosp_appr_flag == 0){
681
                 this.formValue.hosp_appr_flag = ""
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
               this.$refs.addDrugs.show(id, this.formValue)
684
               this.$refs.addDrugs.show(id, this.formValue)
685
 
685
 
734
           } else {
734
           } else {
735
             this.total = response.data.data.total;
735
             this.total = response.data.data.total;
736
             this.list = [];
736
             this.list = [];
737
-
738
             for (let i = 0; i < response.data.data.list.length; i++) {
737
             for (let i = 0; i < response.data.data.list.length; i++) {
739
               this.list.push(response.data.data.list[i])
738
               this.list.push(response.data.data.list[i])
740
             }
739
             }
740
+            console.log("数据库字典",this.list)
741
           }
741
           }
742
         })
742
         })
743
       },
743
       },
928
      },
928
      },
929
 
929
 
930
       handleSuccessTwo({ results, header }) {
930
       handleSuccessTwo({ results, header }) {
931
-
931
+         console.log("header22222",header)
932
         if (header != undefined && header.length > 0) {
932
         if (header != undefined && header.length > 0) {
933
 
933
 
934
           var isHasDrugName = header.includes('*药品名称');
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
           var isHasDrugType =  header.includes('*药品类型');
947
           var isHasDrugType =  header.includes('*药品类型');
939
-
948
+          console.log("isHasDrugType",isHasDrugType)
940
           var isHasDrugStockLimit =  header.includes('*库存警戒');
949
           var isHasDrugStockLimit =  header.includes('*库存警戒');
941
-
950
+          console.log("isHasDrugStockLimit",isHasDrugStockLimit)
942
           var isHasDrugOriginPlace= header.includes('*产地');
951
           var isHasDrugOriginPlace= header.includes('*产地');
943
-
952
+          console.log("isHasDrugOriginPlace",isHasDrugOriginPlace)
944
           var isHasDrugDosageForm = header.includes('*药品剂型');
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
           var isHasUnitMatrixing= header.includes("*单位换算");
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
           var isHasDrugClassifye = header.includes('*药物分类');
963
           var isHasDrugClassifye = header.includes('*药物分类');
957
-
964
+         console.log("isHasDrugClassifye",isHasDrugClassifye)
958
          var isHasManufacturer = header.includes('*生产厂商');
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
             this.dialogVisible = true;
973
             this.dialogVisible = true;
966
             return
974
             return
967
           }
975
           }
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
               } else {
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
               } else {
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
             if (results[i]['*药品类型'] === undefined) {
1063
             if (results[i]['*药品类型'] === undefined) {
1004
                 obj['drug_type'] = ''
1064
                 obj['drug_type'] = ''
1005
               } else {
1065
               } else {
1017
               }
1077
               }
1018
            }
1078
            }
1019
 
1079
 
1080
+
1020
            if (results[i]['*产地'] === undefined) {
1081
            if (results[i]['*产地'] === undefined) {
1021
                 obj['drug_origin_place'] = ''
1082
                 obj['drug_origin_place'] = ''
1022
               } else {
1083
               } else {
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
             if (results[i]['*单位换算'] === undefined) {
1109
             if (results[i]['*单位换算'] === undefined) {
1063
                 obj['unit_matrixing'] = ''
1110
                 obj['unit_matrixing'] = ''
1067
               }
1114
               }
1068
            }
1115
            }
1069
 
1116
 
1070
-            if (results[i]['*单零售价'] === undefined) {
1117
+
1118
+
1119
+
1120
+          if (results[i]['*拆零零售价'] === undefined) {
1071
                 obj['retail_price'] = ''
1121
                 obj['retail_price'] = ''
1072
               } else {
1122
               } else {
1073
-           if (key == '*单零售价') {
1123
+           if (key == '*拆零零售价') {
1074
                obj['retail_price'] = results[i][key].replace(/\s/g,"")
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
                 obj['last_price'] = ''
1139
                 obj['last_price'] = ''
1081
               } else {
1140
               } else {
1082
-           if (key == '*上次进价') {
1141
+           if (key == '*进价') {
1083
                obj['last_price'] = results[i][key].replace(/\s/g,"")
1142
                obj['last_price'] = results[i][key].replace(/\s/g,"")
1084
               }
1143
               }
1085
            }
1144
            }
1086
 
1145
 
1146
+
1087
             if (results[i]['*药物分类'] === undefined) {
1147
             if (results[i]['*药物分类'] === undefined) {
1088
                 obj['drug_classify'] = ''
1148
                 obj['drug_classify'] = ''
1089
               } else {
1149
               } else {
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
               } else {
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
               } else {
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
               } else {
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
               } else {
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
               } else {
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
               } else {
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
              if (results[i]['药品类别'] === undefined) {
1213
              if (results[i]['药品类别'] === undefined) {
1155
                 obj['drug_category'] = ''
1214
                 obj['drug_category'] = ''
1156
               } else {
1215
               } else {
1159
               }
1218
               }
1160
            }
1219
            }
1161
 
1220
 
1221
+
1222
+
1162
            if (results[i]['开药控制'] === undefined) {
1223
            if (results[i]['开药控制'] === undefined) {
1163
                 obj['drug_control'] = ''
1224
                 obj['drug_control'] = ''
1164
               } else {
1225
               } else {
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
             if (results[i]['审批标志'] === undefined) {
1241
             if (results[i]['审批标志'] === undefined) {
1187
                 obj['hosp_appr_flag'] = ''
1242
                 obj['hosp_appr_flag'] = ''
1207
               }
1262
               }
1208
            }
1263
            }
1209
 
1264
 
1265
+
1210
            if (results[i]['统计分类'] === undefined) {
1266
            if (results[i]['统计分类'] === undefined) {
1211
                 obj['statistics_category'] = ''
1267
                 obj['statistics_category'] = ''
1212
               } else {
1268
               } else {
1287
                 obj['limit_remark'] = results[i][key].replace(/\s/g,"")
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
          var newArr = [];
1348
          var newArr = [];
1318
          tableData.push(obj);
1349
          tableData.push(obj);
1384
        let params = {
1415
        let params = {
1385
           'drugs':tableData
1416
           'drugs':tableData
1386
         };
1417
         };
1387
-
1418
+        console.log("params222222222",params)
1419
+        
1388
         postDrugInformation(params).then(response=>{
1420
         postDrugInformation(params).then(response=>{
1389
            if(response.data.state == 1){
1421
            if(response.data.state == 1){
1390
              var msg =  response.data.data.msg;
1422
              var msg =  response.data.data.msg;

+ 131 - 19
src/xt_pages/stock/Dialog/goodInfoDailog.vue Parādīt failu

51
                 </el-option>
51
                 </el-option>
52
               </el-select>
52
               </el-select>
53
             </el-form-item>
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
             <el-form-item label="生产厂商 : " prop="manufacturer" style="width:100%">
89
             <el-form-item label="生产厂商 : " prop="manufacturer" style="width:100%">
58
              
90
              
59
                <el-select v-model="form.manufacturer" style="width:100%;" filterable placeholder="请选择">
91
                <el-select v-model="form.manufacturer" style="width:100%;" filterable placeholder="请选择">
65
                   </el-option>
97
                   </el-option>
66
              </el-select>
98
              </el-select>
67
             </el-form-item>
99
             </el-form-item>
68
-            <el-form-item label="单位 : " prop="good_unit">
100
+            <!-- <el-form-item label="单位 : " prop="good_unit">
69
               <el-select v-model="form.good_unit" style="width:160px;" placeholder="请选择">
101
               <el-select v-model="form.good_unit" style="width:160px;" placeholder="请选择">
70
                 <el-option
102
                 <el-option
71
                   v-for="item,index in form.goodUnit"
103
                   v-for="item,index in form.goodUnit"
73
                   :label="item.name"
105
                   :label="item.name"
74
                   :value="item.id">
106
                   :value="item.id">
75
                 </el-option>
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
               </el-select>
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
             </el-form-item>
112
             </el-form-item>
84
-            <el-form-item label="零价 : " prop="retail_price">
113
+            <el-form-item label="拆零零售价 : " prop="retail_price">
85
               <el-input v-model="form.retail_price" style="width:160px;" placeholder="" maxlength="30"></el-input>
114
               <el-input v-model="form.retail_price" style="width:160px;" placeholder="" maxlength="30"></el-input>
86
             </el-form-item>
115
             </el-form-item>
87
-            <el-form-item label="最新进价 : " prop="buy_price">
116
+         
117
+            <el-form-item label="进货价 : " prop="buy_price">
88
               <el-input v-model="form.buy_price" style="width:160px;" placeholder="" maxlength="30"></el-input>
118
               <el-input v-model="form.buy_price" style="width:160px;" placeholder="" maxlength="30"></el-input>
89
             </el-form-item>
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
             <el-form-item label="库存警戒 : " prop="stock_warn_count">
131
             <el-form-item label="库存警戒 : " prop="stock_warn_count">
91
               <el-input v-model="form.stock_warn_count" style="width:160px;" placeholder="" maxlength="30"></el-input>
132
               <el-input v-model="form.stock_warn_count" style="width:160px;" placeholder="" maxlength="30"></el-input>
92
             </el-form-item>
133
             </el-form-item>
184
       <el-tab-pane label="扩展数据" name="second">
225
       <el-tab-pane label="扩展数据" name="second">
185
         <el-form :model="form" label-width="120px"
226
         <el-form :model="form" label-width="120px"
186
                  style="display: flex;flex-wrap: wrap;justify-content: space-between;">
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
           <el-form-item label="标签:" prop="sign">
229
           <el-form-item label="标签:" prop="sign">
191
             <el-select v-model="form.sign" style="width:160px;" placeholder="请选择">
230
             <el-select v-model="form.sign" style="width:160px;" placeholder="请选择">
192
               <el-option
231
               <el-option
339
           social_security_directory_code:"",
378
           social_security_directory_code:"",
340
           production_type:"",
379
           production_type:"",
341
           special_medical:"",
380
           special_medical:"",
381
+          min_number:"",
382
+          packing_unit:"",
383
+          packing_price:'',
384
+          default_count_unit:"",
385
+          min_unit:"",
342
         },
386
         },
343
 
387
 
344
         rules: {
388
         rules: {
376
         dealer:[],
420
         dealer:[],
377
         goodKindList:[],
421
         goodKindList:[],
378
         medicalInsuranceLevelList:[],
422
         medicalInsuranceLevelList:[],
379
-        statisticsCategoryList:[]
423
+        statisticsCategoryList:[],
424
+        unitList:[],
425
+        showMinNumber:false,
380
       }
426
       }
381
     },
427
     },
382
     props: {
428
     props: {
403
         return getDataConfig(module, filed_name)
449
         return getDataConfig(module, filed_name)
404
       },
450
       },
405
       show(id,form) {
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
         this.visible = true
470
         this.visible = true
407
         this.good_status =[]
471
         this.good_status =[]
408
         this.getlist()
472
         this.getlist()
442
               is_statistics_work: '',
506
               is_statistics_work: '',
443
               sort: '',
507
               sort: '',
444
               is_doctor_use: '',
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
           this.good_status = []
516
           this.good_status = []
448
           for (let key in tempform) {
517
           for (let key in tempform) {
525
         form['social_security_directory_code'] = this.form.social_security_directory_code
594
         form['social_security_directory_code'] = this.form.social_security_directory_code
526
         form['production_type'] = this.form.production_type
595
         form['production_type'] = this.form.production_type
527
         form['special_medical'] = this.form.special_medical
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
         return form
602
         return form
529
       }, changeSelected: function(val) {
603
       }, changeSelected: function(val) {
530
         console.log(val)
604
         console.log(val)
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
     watch: {
680
     watch: {
589
 
697
 
590
 </script>
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
 </style>
706
 </style>

+ 20 - 6
src/xt_pages/stock/config/goodInfo.vue Parādīt failu

210
               sort:'',
210
               sort:'',
211
               is_use_doctor_advice:'',
211
               is_use_doctor_advice:'',
212
               good_number:'',
212
               good_number:'',
213
-
213
+              min_number:"",
214
+              packing_unit:"",
215
+              packing_price:'',
216
+              default_count_unit:""
214
             },
217
             },
215
 
218
 
216
             isVisibility: false
219
             isVisibility: false
223
         this.getList()
226
         this.getList()
224
       },
227
       },
225
       handleGoodInfoEdit: function(index, row) {
228
       handleGoodInfoEdit: function(index, row) {
229
+       
226
         this.getAllDealer()
230
         this.getAllDealer()
227
         this.getAllManufacturer()
231
         this.getAllManufacturer()
228
         this.getAllGoodType()
232
         this.getAllGoodType()
232
         let params = {
236
         let params = {
233
           id: row.id
237
           id: row.id
234
         }
238
         }
239
+
235
         GetGoodInfo(params).then(response => {
240
         GetGoodInfo(params).then(response => {
236
           if (response.data.state == 0) {
241
           if (response.data.state == 0) {
237
             this.$message.error(response.data.msg)
242
             this.$message.error(response.data.msg)
238
             return false
243
             return false
239
           } else {
244
           } else {
240
-            console.log(response.data.data.goodInfo)
245
+             
246
+            console.log("详情",response.data.data.goodInfo)
241
 
247
 
242
             if (response.data.data.goodInfo.good_unit <= 0) {
248
             if (response.data.data.goodInfo.good_unit <= 0) {
243
               this.goodInfo.goodInfoDialog.formValue.good_unit = ''
249
               this.goodInfo.goodInfoDialog.formValue.good_unit = ''
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
             this.$refs.dialog.show()
439
             this.$refs.dialog.show()
482
               response.data.data.goodInfo.stock_warn_count
491
               response.data.data.goodInfo.stock_warn_count
483
             this.goodInfo.goodInfoDialog.formValue.is_reuse = response.data.data.goodInfo.is_reuse.toString()
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
             this.goodInfo.goodInfoDialog.isCreated = 3
495
             this.goodInfo.goodInfoDialog.isCreated = 3
488
             this.goodInfo.goodInfoDialog.isVisibility = true
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
         this.goodInfo.goodInfoDialog.formValue.expiry_date_warn_day_count = ''
640
         this.goodInfo.goodInfoDialog.formValue.expiry_date_warn_day_count = ''
629
         this.goodInfo.goodInfoDialog.formValue.stock_warn_count = ''
641
         this.goodInfo.goodInfoDialog.formValue.stock_warn_count = ''
630
         this.goodInfo.goodInfoDialog.formValue.is_reuse = '2'
642
         this.goodInfo.goodInfoDialog.formValue.is_reuse = '2'
643
+
644
+      
631
       },
645
       },
632
       getAllDealer: function() {
646
       getAllDealer: function() {
633
         this.goodInfo.goodInfoDialog.formValue.dealers = []
647
         this.goodInfo.goodInfoDialog.formValue.dealers = []

+ 184 - 29
src/xt_pages/stock/drugs/drugStockInOrder.vue Parādīt failu

90
           backgroundColor: 'rgb(245, 247, 250)',
90
           backgroundColor: 'rgb(245, 247, 250)',
91
           color: '#606266'
91
           color: '#606266'
92
         }"
92
         }"
93
+       @current-change="handleCurrentChangeOne"
93
       >
94
       >
94
         <el-table-column align="center" type="selection" width="55">
95
         <el-table-column align="center" type="selection" width="55">
95
         </el-table-column>
96
         </el-table-column>
112
           </template>
113
           </template>
113
         </el-table-column>
114
         </el-table-column>
114
 
115
 
115
-        <el-table-column label="厂家" align="center">
116
+        <!-- <el-table-column label="厂家" align="center">
116
           <template slot-scope="scope">
117
           <template slot-scope="scope">
117
             {{scope.row.manufacturers ? scope.row.manufacturers.manufacturer_name:''}}
118
             {{scope.row.manufacturers ? scope.row.manufacturers.manufacturer_name:''}}
118
           </template>
119
           </template>
122
           <template slot-scope="scope">
123
           <template slot-scope="scope">
123
             {{scope.row.dealers ? scope.row.dealers.dealer_name:''}}
124
             {{scope.row.dealers ? scope.row.dealers.dealer_name:''}}
124
           </template>
125
           </template>
125
-        </el-table-column>
126
+        </el-table-column> -->
126
 
127
 
127
         <el-table-column label="操作" align="center" width="240">
128
         <el-table-column label="操作" align="center" width="240">
128
           <template slot-scope="scope">
129
           <template slot-scope="scope">
129
 
130
 
130
-             <el-tooltip
131
+             <!-- <el-tooltip
131
               class="item"
132
               class="item"
132
               effect="dark"
133
               effect="dark"
133
               content="详情"
134
               content="详情"
140
                 @click="handleSearch(scope.row.id)"
141
                 @click="handleSearch(scope.row.id)"
141
               >
142
               >
142
               </el-button>
143
               </el-button>
143
-            </el-tooltip>
144
+            </el-tooltip> -->
144
             
145
             
145
             <el-tooltip
146
             <el-tooltip
146
               class="item"
147
               class="item"
282
         <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
283
         <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
283
       </span>
284
       </span>
284
     </el-dialog>
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
   </div>
399
   </div>
286
 </template>
400
 </template>
287
 
401
 
295
   getDrugWarehouseList,
409
   getDrugWarehouseList,
296
  
410
  
297
 } from "@/api/drug/drug_stock";
411
 } from "@/api/drug/drug_stock";
412
+import {getAllDrugList}from "@/api/data"
413
+ import {getDictionaryDataConfig } from "@/utils/data";
298
 import BreadCrumb from "../../components/bread-crumb";
414
 import BreadCrumb from "../../components/bread-crumb";
299
 
415
 
300
 export default {
416
 export default {
301
   name: "drugStockInOrder",
417
   name: "drugStockInOrder",
302
   components: { BreadCrumb },
418
   components: { BreadCrumb },
303
   created() {
419
   created() {
420
+    this.drugTypeList = getDictionaryDataConfig('system','drug_type') 
304
     var nowDate = new Date();
421
     var nowDate = new Date();
305
     var nowYear = nowDate.getFullYear();
422
     var nowYear = nowDate.getFullYear();
306
     var nowMonth = nowDate.getMonth() + 1;
423
     var nowMonth = nowDate.getMonth() + 1;
321
       (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
438
       (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
322
       "-" +
439
       "-" +
323
       (nowDay < 10 ? "0" + nowDay : nowDay);
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
     this.GetWarehouse();
442
     this.GetWarehouse();
340
-    // this.GetConfigInfo();
341
     this.fetchAllAdminUsers();
443
     this.fetchAllAdminUsers();
342
    
444
    
343
   },
445
   },
373
       },
475
       },
374
       
476
       
375
       startTime: "",
477
       startTime: "",
376
-      dialogVisible:false
478
+      dialogVisible:false,
479
+      showOne:false,
480
+      drugTypeList:[],
481
+      manufacturerList:[]
377
     };
482
     };
378
   },
483
   },
379
   methods: {
484
   methods: {
545
       return Math.round(parseFloat(val) * 100) / 100;
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
     handleSearch(id){
666
     handleSearch(id){
556
        this.WarehouseInfo.warehouseInfoDate=[]
667
        this.WarehouseInfo.warehouseInfoDate=[]
561
       const params = {
672
       const params = {
562
         id: order_id
673
         id: order_id
563
       };
674
       };
675
+   
564
       getDrugWarehouseInfoList(params).then(response => {
676
       getDrugWarehouseInfoList(params).then(response => {
565
         if (response.data.state == 0) {
677
         if (response.data.state == 0) {
566
           this.$message.error(response.data.msg);
678
           this.$message.error(response.data.msg);
567
           return false;
679
           return false;
568
         } else {
680
         } else {
569
           for (let i = 0; i < response.data.data.info.length; i++) {
681
           for (let i = 0; i < response.data.data.info.length; i++) {
682
+            this.showOne = true
570
             this.WarehouseInfo.warehouseInfoDate = []
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
           this.WarehouseInfo.warehouse = response.data.data.warehousing;
687
           this.WarehouseInfo.warehouse = response.data.data.warehousing;
688
+          this.getAllDrugList()
576
         }
689
         }
577
       });
690
       });
578
     },
691
     },
667
         })
780
         })
668
         .catch(() => {});
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
 </script>
828
 </script>

+ 234 - 110
src/xt_pages/stock/drugs/drugStockInOrderAdd.vue Parādīt failu

12
     </div>
12
     </div>
13
     <div class="app-container">
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
       <drugs-stock-dialog
16
       <drugs-stock-dialog
20
         ref="dialog"
17
         ref="dialog"
21
         :propForm="propForm"
18
         :propForm="propForm"
30
         <el-date-picker size="small" v-model="warehousing_time" prefix-icon="el-icon-date" :editable="false"
27
         <el-date-picker size="small" v-model="warehousing_time" prefix-icon="el-icon-date" :editable="false"
31
                         style="width: 196px;" type="date" placeholder="选择日期时间" align="right" format="yyyy-MM-dd"
28
                         style="width: 196px;" type="date" placeholder="选择日期时间" align="right" format="yyyy-MM-dd"
32
                         value-format="yyyy-MM-dd"></el-date-picker>
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
       </div>
32
       </div>
34
-
35
-      <div class="cell clearfix">
33
+     
34
+      <!-- <div class="cell clearfix">
36
         <label class="title"><span class="name">经销商</span> : </label>
35
         <label class="title"><span class="name">经销商</span> : </label>
37
         <el-select size="small" v-model="form.dealer" filterable placeholder="请选择经销商" @change="changeDealer">
36
         <el-select size="small" v-model="form.dealer" filterable placeholder="请选择经销商" @change="changeDealer">
38
           <el-option
37
           <el-option
42
             :value="option.id">
41
             :value="option.id">
43
           </el-option>
42
           </el-option>
44
         </el-select>
43
         </el-select>
45
-      </div>
44
+      </div> -->
46
 
45
 
47
-      <div class="cell clearfix">
46
+      <!-- <div class="cell clearfix">
48
         <label class="title"><span class="name">厂商</span> : </label>
47
         <label class="title"><span class="name">厂商</span> : </label>
49
 
48
 
50
         <el-select size="small" v-model="form.manufacturer" filterable placeholder="请选择厂商"
49
         <el-select size="small" v-model="form.manufacturer" filterable placeholder="请选择厂商"
56
             :value="option.id">
55
             :value="option.id">
57
           </el-option>
56
           </el-option>
58
         </el-select>
57
         </el-select>
59
-      </div>
58
+      </div> -->
60
 
59
 
61
       <el-form :rules="tableRules" :model="recordInfo" ref="tableForm">
60
       <el-form :rules="tableRules" :model="recordInfo" ref="tableForm">
62
         <el-table
61
         <el-table
75
 
74
 
76
             <template slot-scope="scope">
75
             <template slot-scope="scope">
77
               <el-form-item style="padding-top: 15px">
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
               </el-form-item>
93
               </el-form-item>
85
             </template>
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
           </el-table-column>
110
           </el-table-column>
87
           <el-table-column align="center" width="200">
111
           <el-table-column align="center" width="200">
88
             <template slot="header" slot-scope="scope">
112
             <template slot="header" slot-scope="scope">
89
-              <span>规格名称<span style="color: red">*</span></span>
113
+              <span>规格&单位</span>
90
             </template>
114
             </template>
91
             <template slot-scope="scope">
115
             <template slot-scope="scope">
92
               <el-form-item style="padding-top: 15px">
116
               <el-form-item style="padding-top: 15px">
93
                 <el-input
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
                 ></el-input>
121
                 ></el-input>
99
               </el-form-item>
122
               </el-form-item>
100
             </template>
123
             </template>
101
           </el-table-column>
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
             <template slot="header" slot-scope="scope">
140
             <template slot="header" slot-scope="scope">
105
-              <span>进价<span style="color: red">*</span></span>
141
+              <span>入库数量<span style="color: red">*</span></span>
106
             </template>
142
             </template>
107
             <template slot-scope="scope">
143
             <template slot-scope="scope">
108
-              <!--<el-input type="number" v-model="scope.row.price"  @blur="handleBlur(scope.$index, scope.row)"></el-input>-->
109
               <el-form-item
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
                 style="padding-top: 17px"
147
                 style="padding-top: 17px"
113
               >
148
               >
114
                 <el-input
149
                 <el-input
115
-                  placeholder="请输入单价"
150
+                  placeholder="请输入入库数量"
116
                   type="number"
151
                   type="number"
117
-                  v-model="scope.row.price"
152
+                  v-model="scope.row.warehousing_count"
153
+                  style="width:100px"
118
                 ></el-input>
154
                 ></el-input>
155
+                {{scope.row.max_unit}}
119
               </el-form-item>
156
               </el-form-item>
120
             </template>
157
             </template>
121
           </el-table-column>
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
             <template slot="header" slot-scope="scope">
161
             <template slot="header" slot-scope="scope">
150
-              <span>入库数量<span style="color: red">*</span></span>
162
+              <span>进货单价(元)<span style="color: red">*</span></span>
151
             </template>
163
             </template>
152
             <template slot-scope="scope">
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
               <el-form-item
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
                 style="padding-top: 17px"
168
                 style="padding-top: 17px"
160
               >
169
               >
161
                 <el-input
170
                 <el-input
162
-                  placeholder="请输入入库数量"
171
+                  style="width:100px"
172
+                  placeholder="请输入单价"
163
                   type="number"
173
                   type="number"
164
-                  v-model="scope.row.warehousing_count"
174
+                  v-model="scope.row.last_price"
165
                 ></el-input>
175
                 ></el-input>
176
+               
166
               </el-form-item>
177
               </el-form-item>
167
             </template>
178
             </template>
168
           </el-table-column>
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
             <template slot-scope="scope">
182
             <template slot-scope="scope">
177
-              {{ scope.row.retail_price }}
183
+              {{ calculate(scope.row.last_price * scope.row.warehousing_count) }} 
178
             </template>
184
             </template>
179
           </el-table-column>
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
             <template slot-scope="scope">
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
             </template>
197
             </template>
198
           </el-table-column>
198
           </el-table-column>
199
+ 
199
 
200
 
200
           <el-table-column label="生产日期" width="250" align="center">
201
           <el-table-column label="生产日期" width="250" align="center">
201
             <template slot-scope="scope">
202
             <template slot-scope="scope">
202
-              <!--{{scope.row.product_date | parseTime("{y}-{m}-{d}")}}-->
203
               <el-date-picker
203
               <el-date-picker
204
                 prefix-icon="el-icon-date"
204
                 prefix-icon="el-icon-date"
205
                 style="width: 145px"
205
                 style="width: 145px"
213
           </el-table-column>
213
           </el-table-column>
214
           <el-table-column label="有效日期" width="250" align="center">
214
           <el-table-column label="有效日期" width="250" align="center">
215
             <template slot-scope="scope">
215
             <template slot-scope="scope">
216
-              <!--{{ scope.row.expiry_date | parseTime("{y}-{m}-{d}")}}-->
217
               <el-date-picker
216
               <el-date-picker
218
                 prefix-icon="el-icon-date"
217
                 prefix-icon="el-icon-date"
219
                 style="width: 145px"
218
                 style="width: 145px"
225
               ></el-date-picker>
224
               ></el-date-picker>
226
             </template>
225
             </template>
227
           </el-table-column>
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
           <el-table-column label="备注" width="150" align="center">
239
           <el-table-column label="备注" width="150" align="center">
229
             <template slot-scope="scope">
240
             <template slot-scope="scope">
230
               <el-input v-model="scope.row.remark"></el-input>
241
               <el-input v-model="scope.row.remark"></el-input>
279
 
290
 
280
 <script>
291
 <script>
281
   import { uParseTime } from '@/utils/tools'
292
   import { uParseTime } from '@/utils/tools'
282
-
283
   import {
293
   import {
284
     GetAllConfig,
294
     GetAllConfig,
285
     GetAllDrugInfoByID,
295
     GetAllDrugInfoByID,
287
   } from "@/api/drug/drug_stock";
297
   } from "@/api/drug/drug_stock";
288
   import BreadCrumb from '../../components/bread-crumb'
298
   import BreadCrumb from '../../components/bread-crumb'
289
   import DrugsStockDialog from './drugsStockDialog/index'
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
   export default {
302
   export default {
292
     components: { DrugsStockDialog, BreadCrumb },
303
     components: { DrugsStockDialog, BreadCrumb },
293
     name: 'stockIn',
304
     name: 'stockIn',
392
         manufacturer: [],
403
         manufacturer: [],
393
         dealer: [],
404
         dealer: [],
394
         goodType: [],
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
     methods: {
415
     methods: {
421
         this.isVisibility = true
438
         this.isVisibility = true
422
       }, 
439
       }, 
423
       comfirm: function(val) {
440
       comfirm: function(val) {
424
-        console.log("Val2222222",val)
425
         this.$refs.dialog.hide()
441
         this.$refs.dialog.hide()
426
         if (val.selectedGoodInfo.length > 0) {
442
         if (val.selectedGoodInfo.length > 0) {
427
           for (let i = val.selectedGoodInfo.length - 1; i >= 0; i--) {
443
           for (let i = val.selectedGoodInfo.length - 1; i >= 0; i--) {
498
           }
514
           }
499
         }
515
         }
500
         return name;
516
         return name;
501
-      }, specificationName: function(drug_id) {
517
+      },
518
+       specificationName: function(drug_id) {
502
         let name = "";
519
         let name = "";
503
         for (let i = 0; i < this.goodInfo.length; i++) {
520
         for (let i = 0; i < this.goodInfo.length; i++) {
504
           if (this.goodInfo[i].id == drug_id) {
521
           if (this.goodInfo[i].id == drug_id) {
506
           }
523
           }
507
         }
524
         }
508
         return name;
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
        handleEdit: function(index, row) {
536
        handleEdit: function(index, row) {
511
         const tempObj = {}
537
         const tempObj = {}
538
+        tempObj['drug_name'] = ''
512
         tempObj['drug_id'] = 0
539
         tempObj['drug_id'] = 0
513
         tempObj['number'] = ''
540
         tempObj['number'] = ''
514
         tempObj['product_date'] = ''
541
         tempObj['product_date'] = ''
520
         tempObj['dealer'] = ''
547
         tempObj['dealer'] = ''
521
         tempObj['manufacturer'] = ''
548
         tempObj['manufacturer'] = ''
522
         tempObj['min_unit'] = ''
549
         tempObj['min_unit'] = ''
550
+        tempObj["drug_type"] = ''
551
+        tempObj['batch_number'] = ''
523
         this.recordInfo.recordData.push(tempObj)
552
         this.recordInfo.recordData.push(tempObj)
524
       }, handleDelete: function(index, row) {
553
       }, handleDelete: function(index, row) {
525
         if (this.recordInfo.recordData.length <= 1) {
554
         if (this.recordInfo.recordData.length <= 1) {
534
         }
563
         }
535
         return Math.round(parseFloat(val) * 100) / 100
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
       getTime(val, temp) {
567
       getTime(val, temp) {
551
         if (val != 0) {
568
         if (val != 0) {
552
           return uParseTime(val, temp)
569
           return uParseTime(val, temp)
642
       submit() {
659
       submit() {
643
         this.$refs['tableForm'].validate((valid) => {
660
         this.$refs['tableForm'].validate((valid) => {
644
           if (valid) {
661
           if (valid) {
662
+            
645
             const array = this.recordInfo.recordData
663
             const array = this.recordInfo.recordData
646
-            console.log(array)
664
+          
647
             for (let i = 0; i < array.length; i++) {
665
             for (let i = 0; i < array.length; i++) {
648
 
666
 
649
               if (array[i].drug_id == 0) {
667
               if (array[i].drug_id == 0) {
656
               this.$message.success('请添加入库商品')
674
               this.$message.success('请添加入库商品')
657
               return
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
             const params = {
680
             const params = {
661
               'stockIn': this.recordInfo.recordData
681
               'stockIn': this.recordInfo.recordData
662
             }
682
             }
683
+            console.log("params2222222",params)
663
             postDrugWarehouse(params, this.warehousing_time, this.form.manufacturer, this.form.dealer, this.type).then(response => {
684
             postDrugWarehouse(params, this.warehousing_time, this.form.manufacturer, this.form.dealer, this.type).then(response => {
664
               if (response.data.state == 0) {
685
               if (response.data.state == 0) {
665
                 this.$message.error(response.data.msg)
686
                 this.$message.error(response.data.msg)
686
       getDataConfig(module, filed_name){
707
       getDataConfig(module, filed_name){
687
         return getDataConfig(module, filed_name)
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
     created() {
791
     created() {
792
+      this.drugTypeList = getDictionaryDataConfig('system','drug_type') 
793
+     
692
       var nowDate = new Date()
794
       var nowDate = new Date()
693
       var nowYear = nowDate.getFullYear()
795
       var nowYear = nowDate.getFullYear()
694
       var nowMonth = nowDate.getMonth() + 1
796
       var nowMonth = nowDate.getMonth() + 1
700
         '-' +
802
         '-' +
701
         (nowDay < 10 ? '0' + nowDay : nowDay)
803
         (nowDay < 10 ? '0' + nowDay : nowDay)
702
       const tempObj = {}
804
       const tempObj = {}
805
+
703
       tempObj['drug_id'] = 0
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
       tempObj['product_date'] = ''
813
       tempObj['product_date'] = ''
706
       tempObj['expiry_date'] = ''
814
       tempObj['expiry_date'] = ''
707
       tempObj['warehousing_count'] = ''
815
       tempObj['warehousing_count'] = ''
708
       tempObj['retail_price'] = ''
816
       tempObj['retail_price'] = ''
709
-      tempObj['price'] = ''
817
+      tempObj['last_price'] = ''
710
       tempObj['remark'] = ''
818
       tempObj['remark'] = ''
711
       tempObj['dealer'] = ''
819
       tempObj['dealer'] = ''
712
       tempObj['manufacturer'] = ''
820
       tempObj['manufacturer'] = ''
713
-      tempObj['min_unit'] = ''
821
+      tempObj['batch_number'] = ''
822
+      tempObj['drug_type'] = ''
823
+      tempObj['batch_number'] = ''
824
+      
714
       this.recordInfo.recordData.push(tempObj)
825
       this.recordInfo.recordData.push(tempObj)
826
+      
715
       this.GetConfigInfo()
827
       this.GetConfigInfo()
716
       this.propForm.goodUnit = this.$store.getters.good_unit
828
       this.propForm.goodUnit = this.$store.getters.good_unit
829
+      
830
+     
831
+    
717
     }
832
     }
718
 
833
 
719
   }
834
   }
743
     margin-bottom: 15px;
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
 </style>
870
 </style>
747
 
871
 
748
 <style>
872
 <style>

+ 1 - 1
src/xt_pages/stock/drugs/drugStockInOrderDetail.vue Parādīt failu

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

+ 188 - 96
src/xt_pages/stock/drugs/drugStockInOrderEdit.vue Parādīt failu

58
         </el-date-picker>
58
         </el-date-picker>
59
       </div>
59
       </div>
60
 
60
 
61
-      <div class="cell clearfix">
61
+      <!-- <div class="cell clearfix">
62
         <label class="title"><span class="name">经销商</span> : </label>
62
         <label class="title"><span class="name">经销商</span> : </label>
63
         <el-select
63
         <el-select
64
           size="small"
64
           size="small"
93
           >
93
           >
94
           </el-option>
94
           </el-option>
95
         </el-select>
95
         </el-select>
96
-      </div>
96
+      </div> -->
97
+
97
 
98
 
99
+
100
+   <!-- 编辑入库单详情 -->
98
       <el-form :rules="tableRules" :model="recordInfo" ref="tableForm">
101
       <el-form :rules="tableRules" :model="recordInfo" ref="tableForm">
99
         <el-table
102
         <el-table
100
           id="oictable"
103
           id="oictable"
112
 
115
 
113
             <template slot-scope="scope">
116
             <template slot-scope="scope">
114
               <el-form-item style="padding-top: 15px">
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
               </el-form-item>
134
               </el-form-item>
122
             </template>
135
             </template>
123
           </el-table-column>
136
           </el-table-column>
124
-          <el-table-column align="center" width="200">
137
+         <el-table-column align="center" width="200">
125
             <template slot="header" slot-scope="scope">
138
             <template slot="header" slot-scope="scope">
126
-              <span>规格名称<span style="color: red">*</span></span>
139
+              <span>药品类型</span>
127
             </template>
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
             </template>
150
             </template>
138
           </el-table-column>
151
           </el-table-column>
139
-
140
-          <el-table-column align="center" width="150">
152
+          <el-table-column align="center" width="200">
141
             <template slot="header" slot-scope="scope">
153
             <template slot="header" slot-scope="scope">
142
-              <span>进价<span style="color: red">*</span></span>
154
+              <span>规格&单位</span>
143
             </template>
155
             </template>
144
             <template slot-scope="scope">
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
                 <el-input
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
                 ></el-input>
162
                 ></el-input>
156
               </el-form-item>
163
               </el-form-item>
157
             </template>
164
             </template>
158
           </el-table-column>
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
             <template slot="header" slot-scope="scope">
181
             <template slot="header" slot-scope="scope">
162
               <span>入库数量<span style="color: red">*</span></span>
182
               <span>入库数量<span style="color: red">*</span></span>
163
             </template>
183
             </template>
164
             <template slot-scope="scope">
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
               <el-form-item
185
               <el-form-item
169
                 :prop="'recordData.' + scope.$index + '.warehousing_count'"
186
                 :prop="'recordData.' + scope.$index + '.warehousing_count'"
170
                 :rules="tableRules.warehousing_count"
187
                 :rules="tableRules.warehousing_count"
174
                   placeholder="请输入入库数量"
191
                   placeholder="请输入入库数量"
175
                   type="number"
192
                   type="number"
176
                   v-model="scope.row.warehousing_count"
193
                   v-model="scope.row.warehousing_count"
194
+                  style="width:100px"
177
                 ></el-input>
195
                 ></el-input>
196
+                {{scope.row.max_unit}}
178
               </el-form-item>
197
               </el-form-item>
179
             </template>
198
             </template>
180
           </el-table-column>
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
           </el-table-column>
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
             <template slot-scope="scope">
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
             </template>
224
             </template>
197
           </el-table-column>
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
             <template slot-scope="scope">
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
             </template>
237
             </template>
210
           </el-table-column>
238
           </el-table-column>
211
 
239
 
212
           <el-table-column label="生产日期" width="250" align="center">
240
           <el-table-column label="生产日期" width="250" align="center">
213
             <template slot-scope="scope">
241
             <template slot-scope="scope">
214
-              <!--{{scope.row.product_date | parseTime("{y}-{m}-{d}")}}-->
215
               <el-date-picker
242
               <el-date-picker
216
                 prefix-icon="el-icon-date"
243
                 prefix-icon="el-icon-date"
217
                 style="width: 145px"
244
                 style="width: 145px"
223
               ></el-date-picker>
250
               ></el-date-picker>
224
             </template>
251
             </template>
225
           </el-table-column>
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
             <template slot-scope="scope">
256
             <template slot-scope="scope">
228
-              <!--{{ scope.row.expiry_date | parseTime("{y}-{m}-{d}")}}-->
229
               <el-date-picker
257
               <el-date-picker
230
                 prefix-icon="el-icon-date"
258
                 prefix-icon="el-icon-date"
231
                 style="width: 145px"
259
                 style="width: 145px"
237
               ></el-date-picker>
265
               ></el-date-picker>
238
             </template>
266
             </template>
239
           </el-table-column>
267
           </el-table-column>
268
+ 
240
           <el-table-column label="备注" width="150" align="center">
269
           <el-table-column label="备注" width="150" align="center">
241
             <template slot-scope="scope">
270
             <template slot-scope="scope">
242
               <el-input v-model="scope.row.remark"></el-input>
271
               <el-input v-model="scope.row.remark"></el-input>
301
 } from "@/api/drug/drug_stock";
330
 } from "@/api/drug/drug_stock";
302
 import BreadCrumb from "../../components/bread-crumb";
331
 import BreadCrumb from "../../components/bread-crumb";
303
 import DrugsStockDialog from './drugsStockDialog/index'
332
 import DrugsStockDialog from './drugsStockDialog/index'
304
-
333
+import {postSearchDrugList} from "@/api/data"
334
+import {getDataConfig, getDictionaryDataConfig } from "@/utils/data";
305
 export default {
335
 export default {
306
   components: { DrugsStockDialog, BreadCrumb },
336
   components: { DrugsStockDialog, BreadCrumb },
307
   name: "stockIn",
337
   name: "stockIn",
369
       dealer: [],
399
       dealer: [],
370
       goodType: [],
400
       goodType: [],
371
       goodInfo:[],
401
       goodInfo:[],
402
+      drugList:[],
403
+      manufacturerList:[],
372
     };
404
     };
373
   },
405
   },
374
   methods: {
406
   methods: {
375
     comfirm: function(val) {
407
     comfirm: function(val) {
376
       this.$refs.dialog.hide();
408
       this.$refs.dialog.hide();
377
-      console.log(val)
409
+   
378
       if (val.selectedGoodInfo.length > 0) {
410
       if (val.selectedGoodInfo.length > 0) {
379
         for (let i = val.selectedGoodInfo.length - 1; i >= 0 ; i--) {
411
         for (let i = val.selectedGoodInfo.length - 1; i >= 0 ; i--) {
380
           if (i == 0) {
412
           if (i == 0) {
409
         }
441
         }
410
       }
442
       }
411
 
443
 
412
-      console.log( this.recordInfo.recordData)
444
+      // console.log( this.recordInfo.recordData)
413
 
445
 
414
       this.currentIndex = -1;
446
       this.currentIndex = -1;
415
     },
447
     },
458
       return name;
490
       return name;
459
     },
491
     },
460
     specificationName: function(drug_id) {
492
     specificationName: function(drug_id) {
461
-      console.log(this.goodInfo)
493
+ 
462
       let name = "";
494
       let name = "";
463
       for (let i = 0; i < this.goodInfo.length; i++) {
495
       for (let i = 0; i < this.goodInfo.length; i++) {
464
         if (this.goodInfo[i].id == drug_id) {
496
         if (this.goodInfo[i].id == drug_id) {
480
       tempObj["dealer"] = "";
512
       tempObj["dealer"] = "";
481
       tempObj["manufacturer"] = "";
513
       tempObj["manufacturer"] = "";
482
       tempObj['retail_price'] = ""
514
       tempObj['retail_price'] = ""
483
-
484
-
515
+      tempObj['drug_name'] = ""
516
+      tempObj['manufacturer'] = ""
485
       this.recordInfo.recordData.push(tempObj);
517
       this.recordInfo.recordData.push(tempObj);
486
     },
518
     },
487
     handleDelete: function(index, row) {
519
     handleDelete: function(index, row) {
580
       this.$refs["tableForm"].validate(valid => {
612
       this.$refs["tableForm"].validate(valid => {
581
         if (valid) {
613
         if (valid) {
582
           const array = this.recordInfo.recordData;
614
           const array = this.recordInfo.recordData;
615
+        
583
           for (let i = 0; i < array.length; i++) {
616
           for (let i = 0; i < array.length; i++) {
584
             if (array[i].drug_id == 0) {
617
             if (array[i].drug_id == 0) {
585
               this.$message.error("药品名称或者药品规格名称不能为空");
618
               this.$message.error("药品名称或者药品规格名称不能为空");
594
              if(this.recordInfo.recordData[i].manufacturer == ""){
627
              if(this.recordInfo.recordData[i].manufacturer == ""){
595
                this.recordInfo.recordData[i].manufacturer = 0
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
           const params = {
635
           const params = {
600
             stockIn: this.recordInfo.recordData
636
             stockIn: this.recordInfo.recordData
601
           };
637
           };
602
-          console.log("params",params)
638
+          console.log("params22222222222",params)
603
          
639
          
604
           EditDrugWarehouse(
640
           EditDrugWarehouse(
605
             params,
641
             params,
632
           this.$message.error(response.data.msg);
668
           this.$message.error(response.data.msg);
633
           return false;
669
           return false;
634
         } else {
670
         } else {
671
+       
672
+          var manufacturerList = response.data.data.manufacturerList
673
+          console.log("000000000000",response.data.data.info)
635
           for (let i = 0; i < response.data.data.info.length; i++) {
674
           for (let i = 0; i < response.data.data.info.length; i++) {
636
             response.data.data.info[i].product_date = this.getTime(
675
             response.data.data.info[i].product_date = this.getTime(
637
               response.data.data.info[i].product_date,
676
               response.data.data.info[i].product_date,
641
               response.data.data.info[i].expiry_date,
680
               response.data.data.info[i].expiry_date,
642
               "{y}-{m}-{d}"
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
             this.recordInfo.recordData.push(response.data.data.info[i]);
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
           this.warehouse = response.data.data.warehousing;
716
           this.warehouse = response.data.data.warehousing;
662
           this.form.manufacturer = this.warehouse.manufacturer;
717
           this.form.manufacturer = this.warehouse.manufacturer;
667
             "{y}-{m}-{d}"
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
   created() {
782
   created() {
783
+    this.drugTypeList = getDictionaryDataConfig('system','drug_type') 
692
     this.GetConfigInfo();
784
     this.GetConfigInfo();
693
     this.propForm.goodUnit = this.$store.getters.good_unit;
785
     this.propForm.goodUnit = this.$store.getters.good_unit;
694
     const order_id = this.$route.query.id;
786
     const order_id = this.$route.query.id;

+ 3 - 1
src/xt_pages/stock/drugs/drugStockOutOrder.vue Parādīt failu

607
             this.$message.error(response.data.msg)
607
             this.$message.error(response.data.msg)
608
             return false
608
             return false
609
           } else {
609
           } else {
610
+          
610
             this.warehousingOutInfo.warehousingOutData=[]
611
             this.warehousingOutInfo.warehousingOutData=[]
611
             for (let i = 0; i < response.data.data.list.length; i++) {
612
             for (let i = 0; i < response.data.data.list.length; i++) {
612
 
613
 
727
           } else {
728
           } else {
728
             this.userList=[]
729
             this.userList=[]
729
             var total = 0
730
             var total = 0
731
+            console.log("888888888888",response.data.data.list)
730
             for (let i = 0; i < response.data.data.list.length; i++) {
732
             for (let i = 0; i < response.data.data.list.length; i++) {
731
               var obj = response.data.data.list[i]
733
               var obj = response.data.data.list[i]
732
               obj['is_total'] = 0
734
               obj['is_total'] = 0
739
               total: total,
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 Parādīt failu

111
 
111
 
112
             <template slot-scope="scope">
112
             <template slot-scope="scope">
113
               <el-form-item style="padding-top: 15px">
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
               </el-form-item>
129
               </el-form-item>
121
             </template>
130
             </template>
122
           </el-table-column>
131
           </el-table-column>
123
           <el-table-column align="center" width="200">
132
           <el-table-column align="center" width="200">
124
             <template slot="header" slot-scope="scope">
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
             </template>
150
             </template>
127
             <template slot-scope="scope">
151
             <template slot-scope="scope">
128
               <el-form-item style="padding-top: 15px">
152
               <el-form-item style="padding-top: 15px">
129
                 <el-input
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
                 ></el-input>
157
                 ></el-input>
135
               </el-form-item>
158
               </el-form-item>
136
             </template>
159
             </template>
137
           </el-table-column>
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
             <template slot="header" slot-scope="scope">
175
             <template slot="header" slot-scope="scope">
141
-              <span>出库价<span style="color: red">*</span></span>
176
+              <span>出库数量<span style="color: red">*</span></span>
142
             </template>
177
             </template>
143
             <template slot-scope="scope">
178
             <template slot-scope="scope">
144
-            
145
               <el-form-item
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
                 style="padding-top: 17px"
182
                 style="padding-top: 17px"
149
               >
183
               >
150
                 <el-input
184
                 <el-input
151
-                  placeholder="请输入进价"
185
+                  placeholder="请输入出库数量"
152
                   type="number"
186
                   type="number"
153
-                  v-model="scope.row.price"
187
+                  v-model="scope.row.count"
188
+                  style="width:100px"
154
                 ></el-input>
189
                 ></el-input>
190
+                {{scope.row.packing_unit}}
155
               </el-form-item>
191
               </el-form-item>
192
+              
156
             </template>
193
             </template>
157
           </el-table-column>
194
           </el-table-column>
158
-
159
           <el-table-column width="100" align="center">
195
           <el-table-column width="100" align="center">
160
             <template slot="header" slot-scope="scope">
196
             <template slot="header" slot-scope="scope">
161
-              <span>出库数量<span style="color: red">*</span></span>
197
+              <span>出货价<span style="color: red">*</span></span>
162
             </template>
198
             </template>
163
             <template slot-scope="scope">
199
             <template slot-scope="scope">
200
+            
164
               <el-form-item
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
                 style="padding-top: 17px"
204
                 style="padding-top: 17px"
168
               >
205
               >
169
                 <el-input
206
                 <el-input
170
-                  placeholder="请输入出库数量"
207
+                  placeholder="请输入出货价"
171
                   type="number"
208
                   type="number"
172
-                  v-model="scope.row.count"
209
+                  v-model="scope.row.last_price"
173
                 ></el-input>
210
                 ></el-input>
174
               </el-form-item>
211
               </el-form-item>
175
             </template>
212
             </template>
176
           </el-table-column>
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
             <template slot="header" slot-scope="scope">
219
             <template slot="header" slot-scope="scope">
181
               <span>单位<span style="color: red">*</span></span>
220
               <span>单位<span style="color: red">*</span></span>
182
             </template>
221
             </template>
191
               </el-select>
230
               </el-select>
192
             </template>
231
             </template>
193
           </el-table-column>
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
             <template slot-scope="scope">
238
             <template slot-scope="scope">
200
-              {{ calculate(scope.row.price * scope.row.count) }}
239
+              {{ calculate(scope.row.last_price * scope.row.count) }}
201
             </template>
240
             </template>
202
           </el-table-column>
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
             <template slot-scope="scope">
245
             <template slot-scope="scope">
207
               {{ scope.row.retail_price }}
246
               {{ scope.row.retail_price }}
208
             </template>
247
             </template>
212
             <template slot-scope="scope">
251
             <template slot-scope="scope">
213
               {{ calculate(scope.row.retail_price * scope.row.count) }}
252
               {{ calculate(scope.row.retail_price * scope.row.count) }}
214
             </template>
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
           </el-table-column>
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
           <el-table-column label="备注" width="80" align="center">
308
           <el-table-column label="备注" width="80" align="center">
219
             <template slot-scope="scope">
309
             <template slot-scope="scope">
265
 
355
 
266
 import BreadCrumb from "../../components/bread-crumb";
356
 import BreadCrumb from "../../components/bread-crumb";
267
 import DrugsStockDialog from './drugsStockDialog/index'
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
 export default {
360
 export default {
270
   components: { DrugsStockDialog,   BreadCrumb },
361
   components: { DrugsStockDialog,   BreadCrumb },
271
   name: "salesReturnOrderAdd",
362
   name: "salesReturnOrderAdd",
317
       manufacturer: [],
408
       manufacturer: [],
318
       dealer: [],
409
       dealer: [],
319
       goodType: [],
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
   methods: {
420
   methods: {
546
             this.$message.success("请添加出库商品");
643
             this.$message.success("请添加出库商品");
547
             return;
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
           const params = {
649
           const params = {
551
             stockOut: this.recordInfo.recordData
650
             stockOut: this.recordInfo.recordData
552
           };
651
           };
553
-
652
+          console.log("params222222",params)
653
+      
554
           postDrugWarehouseOut(
654
           postDrugWarehouseOut(
555
             params,
655
             params,
556
             this.warehouse_out_time,
656
             this.warehouse_out_time,
584
     getDataConfig(module, filed_name){
684
     getDataConfig(module, filed_name){
585
      return getDataConfig(module, filed_name)
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
   created() {
776
   created() {
777
+    this.drugTypeList = getDictionaryDataConfig('system','drug_type') 
589
     var nowDate = new Date();
778
     var nowDate = new Date();
590
     var nowYear = nowDate.getFullYear();
779
     var nowYear = nowDate.getFullYear();
591
     var nowMonth = nowDate.getMonth() + 1;
780
     var nowMonth = nowDate.getMonth() + 1;
598
       (nowDay < 10 ? "0" + nowDay : nowDay);
787
       (nowDay < 10 ? "0" + nowDay : nowDay);
599
     const tempObj = {};
788
     const tempObj = {};
600
     tempObj["drug_id"] = 0;
789
     tempObj["drug_id"] = 0;
790
+    tempObj['dosage'] = ''
791
+    tempObj['max_unit'] = ''
792
+    tempObj['unval'] = ''
793
+    tempObj['min_unit'] = '',
794
+    tempObj['packing_unit'] = '',
601
     tempObj["return_count"] = 0;
795
     tempObj["return_count"] = 0;
602
     tempObj["price"] = "";
796
     tempObj["price"] = "";
603
     tempObj["remark"] = "";
797
     tempObj["remark"] = "";
604
     tempObj["min_unit"] = "";
798
     tempObj["min_unit"] = "";
605
-
799
+    tempObj['manufacturer'] = ''
800
+    tempObj['batch_number'] = ''
801
+    tempObj['drug_type'] = ''
606
     this.recordInfo.recordData.push(tempObj);
802
     this.recordInfo.recordData.push(tempObj);
607
     this.GetConfigInfo();
803
     this.GetConfigInfo();
608
     this.propForm.goodUnit = this.$store.getters.good_unit;
804
     this.propForm.goodUnit = this.$store.getters.good_unit;

+ 129 - 81
src/xt_pages/stock/drugs/query.vue Parādīt failu

82
           >搜索
82
           >搜索
83
           </el-button>
83
           </el-button>
84
       </div>
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
         border
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
         </el-table-column>
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
         </el-table-column>
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
         </el-table-column>
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
         </el-table-column>
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
         </el-table-column>
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
         </el-table-column>
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
         </el-table-column>
129
         </el-table-column>
145
-        <el-table-column label="出库退库" align="center">
130
+        <el-table-column prop="drug_name" label="操作">
146
           <template slot-scope="scope">
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
           </template>
160
           </template>
152
         </el-table-column>
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
       <el-pagination
164
       <el-pagination
171
         @size-change="handleSizeChange"
165
         @size-change="handleSizeChange"
172
         @current-change="handleCurrentChange"
166
         @current-change="handleCurrentChange"
191
 <script>
185
 <script>
192
   import { uParseTime } from '@/utils/tools'
186
   import { uParseTime } from '@/utils/tools'
193
   import BreadCrumb from '@/xt_pages/components/bread-crumb'
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
   import SettingDialog from './settingDialog/index'
189
   import SettingDialog from './settingDialog/index'
196
   import { getDictionaryDataConfig } from "@/utils/data";
190
   import { getDictionaryDataConfig } from "@/utils/data";
197
   export default {
191
   export default {
198
     name: 'stockIn',
192
     name: 'stockIn',
199
     created() {
193
     created() {
200
-      this.GetAllDrugStockQueryList()
201
-
194
+      //  this.GetAllDrugStockQueryList()
202
       var drugCategory = getDictionaryDataConfig('system','drug_category')
195
       var drugCategory = getDictionaryDataConfig('system','drug_category')
203
       this.drugCategory.push(...drugCategory)
196
       this.drugCategory.push(...drugCategory)
204
-      console.log("透析记录",this.drugCategory)
197
+      this.drugTypeList = getDictionaryDataConfig('system','drug_type') 
198
+  
199
+      this.getlist()
205
     },
200
     },
206
     components: {
201
     components: {
207
       SettingDialog,
202
       SettingDialog,
233
         drug_category:0,
228
         drug_category:0,
234
         drugCategory:[
229
         drugCategory:[
235
           {id:0,name:"全部"}
230
           {id:0,name:"全部"}
236
-        ]
231
+        ],
232
+        drugTypeList:[],
233
+        tableList:[],
234
+        manufacturerList:[]
237
       }
235
       }
238
     },
236
     },
239
     methods: {
237
     methods: {
293
           start_time:this.start_time,
291
           start_time:this.start_time,
294
           end_time:this.end_time,
292
           end_time:this.end_time,
295
         }
293
         }
296
-        console.log("parasm22222",Params)
297
         this.WarehouseInfo.loading = true
294
         this.WarehouseInfo.loading = true
298
         this.WarehouseInfo.warehouseInfoDate = []
295
         this.WarehouseInfo.warehouseInfoDate = []
299
         getAllDrugStockQueryList(Params).then(response => {
296
         getAllDrugStockQueryList(Params).then(response => {
309
               this.WarehouseInfo.warehouseInfoDate.push(response.data.data.list[i])
306
               this.WarehouseInfo.warehouseInfoDate.push(response.data.data.list[i])
310
               arr.push(response.data.data.list[i])
307
               arr.push(response.data.data.list[i])
311
             }
308
             }
312
-            console.log("数据源头",arr)
309
+           
313
             for(let i=0;i<arr.length;i++){
310
             for(let i=0;i<arr.length;i++){
314
                arr[i].stockInCount =  this.stockInCount(arr[i])
311
                arr[i].stockInCount =  this.stockInCount(arr[i])
315
                arr[i].salesReturnCount = this.salesReturnCount(arr[i])
312
                arr[i].salesReturnCount = this.salesReturnCount(arr[i])
319
                arr[i].reactOutCount = (this.stockOutCount(arr[i]) - this.cancelStockCount(arr[i]))?(this.stockOutCount(arr[i]) - this.cancelStockCount(arr[i])):0
316
                arr[i].reactOutCount = (this.stockOutCount(arr[i]) - this.cancelStockCount(arr[i]))?(this.stockOutCount(arr[i]) - this.cancelStockCount(arr[i])):0
320
                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
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
              this.tableData = arr
320
              this.tableData = arr
324
             this.handleSpanTempArr()
321
             this.handleSpanTempArr()
325
           }
322
           }
457
           name: "drugQueryPrint",
454
           name: "drugQueryPrint",
458
           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}
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 Parādīt failu

58
                   style="width: 100%"
58
                   style="width: 100%"
59
                   max-height="450" :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
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
           <el-table-column align="center" width="200">
84
           <el-table-column align="center" width="200">
63
             
85
             
64
             <template slot="header" slot-scope="scope">
86
             <template slot="header" slot-scope="scope">
67
      
89
      
68
             <template slot-scope="scope">
90
             <template slot-scope="scope">
69
               <el-form-item style="padding-top: 15px;margin-left: 10px;margin-right: 10px">
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
               </el-form-item>
93
               </el-form-item>
74
             </template>
94
             </template>
75
           </el-table-column>
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
           <el-table-column align="center" width="200">
96
           <el-table-column align="center" width="200">
85
             
97
             
86
             <template slot="header" slot-scope="scope">
98
             <template slot="header" slot-scope="scope">
87
-              <span>规格名称<span style="color: red">*</span></span>
99
+              <span>规格&单位<span style="color: red">*</span></span>
88
             </template>
100
             </template>
89
             <template slot-scope="scope">
101
             <template slot-scope="scope">
90
 
102
 
91
               <el-form-item style="padding-top: 15px">
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
               </el-form-item>
105
               </el-form-item>
96
 
106
 
97
             </template>
107
             </template>
98
           </el-table-column>
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
           <el-table-column align="center" width="150">
110
           <el-table-column align="center" width="150">
119
             <template slot="header" slot-scope="scope">
111
             <template slot="header" slot-scope="scope">
120
-              <span>进货价<span style="color: red">*</span></span>
112
+              <span>批号</span>
121
             </template>
113
             </template>
122
             <template slot-scope="scope">
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
               </el-form-item>
117
               </el-form-item>
128
 
118
 
129
-
130
             </template>
119
             </template>
131
           </el-table-column>
120
           </el-table-column>
132
 
121
 
122
+
133
           <el-table-column align="center" width="180">
123
           <el-table-column align="center" width="180">
134
             <template slot="header" slot-scope="scope">
124
             <template slot="header" slot-scope="scope">
135
               <span>入库数量<span style="color: red">*</span></span>
125
               <span>入库数量<span style="color: red">*</span></span>
136
             </template>
126
             </template>
137
             <template slot-scope="scope">
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
               <el-form-item :prop="'recordData.' + scope.$index + '.warehousing_count'"
128
               <el-form-item :prop="'recordData.' + scope.$index + '.warehousing_count'"
142
                             :rules='tableRules.warehousing_count' style="padding-top: 17px">
129
                             :rules='tableRules.warehousing_count' style="padding-top: 17px">
143
                 <el-input placeholder="请输入入库数量" type="number" v-model="scope.row.warehousing_count"></el-input>
130
                 <el-input placeholder="请输入入库数量" type="number" v-model="scope.row.warehousing_count"></el-input>
145
             </template>
132
             </template>
146
           </el-table-column>
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
           <el-table-column align="center" width="150">
135
           <el-table-column align="center" width="150">
155
             <template slot="header" slot-scope="scope">
136
             <template slot="header" slot-scope="scope">
156
-              <span>批号</span>
137
+              <span>进货单价<span style="color: red">*</span></span>
157
             </template>
138
             </template>
158
             <template slot-scope="scope">
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
               </el-form-item>
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
             </template>
153
             </template>
164
           </el-table-column>
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
           <el-table-column label="生产日期" align="center" width="250">
169
           <el-table-column label="生产日期" align="center" width="250">
166
             <template slot-scope="scope">
170
             <template slot-scope="scope">
167
-              <!--{{scope.row.product_date | parseTime("{y}-{m}-{d}")}}-->
168
               <el-date-picker prefix-icon="el-icon-date" style="width: 145px" v-model="scope.row.product_date"
171
               <el-date-picker prefix-icon="el-icon-date" style="width: 145px" v-model="scope.row.product_date"
169
                               type="date" placeholder="选择日期时间" format="yyyy-MM-dd"
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
             </template>
176
             </template>
173
           </el-table-column>
177
           </el-table-column>
174
           <el-table-column label="有效日期" align="center" width="250">
178
           <el-table-column label="有效日期" align="center" width="250">
175
             <template slot-scope="scope">
179
             <template slot-scope="scope">
176
-              <!--{{ scope.row.expiry_date | parseTime("{y}-{m}-{d}")}}-->
177
               <el-date-picker prefix-icon="el-icon-date" style="width: 145px" v-model="scope.row.expiry_date"
180
               <el-date-picker prefix-icon="el-icon-date" style="width: 145px" v-model="scope.row.expiry_date"
178
                               type="date" placeholder="选择日期时间" format="yyyy-MM-dd"
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
             </template>
185
             </template>
182
           </el-table-column>
186
           </el-table-column>
187
+         
188
+
183
           <el-table-column label="备注" align="center" width="150">
189
           <el-table-column label="备注" align="center" width="150">
184
             <template slot-scope="scope">
190
             <template slot-scope="scope">
185
               <el-input placeholder="请输入备注" v-model="scope.row.remark"></el-input>
191
               <el-input placeholder="请输入备注" v-model="scope.row.remark"></el-input>
231
     GetAllGoodType,
237
     GetAllGoodType,
232
     getWarehouseInfoByOrdeNumber,
238
     getWarehouseInfoByOrdeNumber,
233
     modifyWarehouseInfo,
239
     modifyWarehouseInfo,
234
-    postWarehouse
240
+    postWarehouse,
241
+    postSearchGoodList
235
   } from '@/api/stock'
242
   } from '@/api/stock'
236
   import BreadCrumb from '../components/bread-crumb'
243
   import BreadCrumb from '../components/bread-crumb'
237
 
244
 
340
 
347
 
341
         manufacturer: [],
348
         manufacturer: [],
342
         dealer: [],
349
         dealer: [],
343
-        goodType: []
350
+        goodType: [],
351
+        manufacturerList:[],
352
+        goodList:[]
344
       }
353
       }
345
     },
354
     },
346
     methods: {
355
     methods: {
487
         tempObj['dealer'] = ''
496
         tempObj['dealer'] = ''
488
         tempObj['manufacturer'] = ''
497
         tempObj['manufacturer'] = ''
489
         tempObj['good_unit'] = ''
498
         tempObj['good_unit'] = ''
499
+        tempObj['specification_name'] = ''
500
+        tempObj['name'] = ''
490
         this.recordInfo.recordData.push(tempObj)
501
         this.recordInfo.recordData.push(tempObj)
491
       }, handleDelete: function(index, row) {
502
       }, handleDelete: function(index, row) {
492
         if (this.recordInfo.recordData.length <= 1) {
503
         if (this.recordInfo.recordData.length <= 1) {
628
                 this.$message.error('商品类型不能为空')
639
                 this.$message.error('商品类型不能为空')
629
                 return
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
             if(this.recordInfo.recordData.length <= 0){
645
             if(this.recordInfo.recordData.length <= 0){
666
       getDataConfig(module, filed_name){
674
       getDataConfig(module, filed_name){
667
          return getDataConfig(module, filed_name)
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
     created() {
726
     created() {
691
       tempObj['dealer'] = ''
746
       tempObj['dealer'] = ''
692
       tempObj['manufacturer'] = ''
747
       tempObj['manufacturer'] = ''
693
       tempObj['good_unit'] = ''
748
       tempObj['good_unit'] = ''
749
+      tempObj['good_name'] = ''
750
+      tempObj['specification_name'] = ''
751
+      tempObj['name'] = ''
694
       this.recordInfo.recordData.push(tempObj)
752
       this.recordInfo.recordData.push(tempObj)
695
       this.GetConfigInfo()
753
       this.GetConfigInfo()
696
       this.propForm.goodUnit = this.$store.getters.good_unit
754
       this.propForm.goodUnit = this.$store.getters.good_unit

+ 152 - 131
src/xt_pages/stock/stockOutOrderAdd.vue Parādīt failu

25
     </div>
25
     </div>
26
 
26
 
27
     <div class="app-container">
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
       <stock-in-dialog
30
       <stock-in-dialog
37
         ref="dialog" :propForm="propForm"
31
         ref="dialog" :propForm="propForm"
107
           max-height="450"
101
           max-height="450"
108
           :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }"
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
             <template slot="header" slot-scope="scope">
105
             <template slot="header" slot-scope="scope">
112
-              <span>耗材类型</span>
106
+              <span>耗材名称</span>
113
             </template>
107
             </template>
114
 
108
 
115
             <template slot-scope="scope">
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
               <el-form-item style="padding-top: 15px">
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
               </el-form-item>
127
               </el-form-item>
127
             </template>
128
             </template>
128
           </el-table-column>
129
           </el-table-column>
129
-           <el-table-column min-width="35" align="center">
130
+          <el-table-column  width="150" align="center">
130
             <template slot="header" slot-scope="scope">
131
             <template slot="header" slot-scope="scope">
131
-              <span>耗材名称</span>
132
+              <span>耗材类型</span>
132
             </template>
133
             </template>
133
 
134
 
134
             <template slot-scope="scope">
135
             <template slot-scope="scope">
136
+             
137
+
135
               <el-form-item style="padding-top: 15px">
138
               <el-form-item style="padding-top: 15px">
136
                 <el-input
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
                 ></el-input>
144
                 ></el-input>
142
               </el-form-item>
145
               </el-form-item>
143
             </template>
146
             </template>
144
           </el-table-column>
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
             <template slot="header" slot-scope="scope">
151
             <template slot="header" slot-scope="scope">
148
-              <span>规格名称<span style="color: red">*</span></span>
152
+              <span>规格&&单位<span style="color: red">*</span></span>
149
             </template>
153
             </template>
150
             <template slot-scope="scope">
154
             <template slot-scope="scope">
151
               <el-form-item style="padding-top: 15px">
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
               </el-form-item>
157
               </el-form-item>
159
             </template>
158
             </template>
160
           </el-table-column>
159
           </el-table-column>
161
           
160
           
162
-          <el-table-column min-width="35" align="center">
161
+          <el-table-column  width="150" align="center">
163
              <template slot="header" slot-scope="scope">
162
              <template slot="header" slot-scope="scope">
164
-              <span>单位<span style="color: red">*</span></span>
163
+              <span>批号<span style="color: red">*</span></span>
165
             </template>
164
             </template>
166
             <template slot-scope="scope">
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
             </template>
167
             </template>
176
           </el-table-column>
168
           </el-table-column>
177
 
169
 
178
-          <el-table-column min-width="23" align="center">
170
+         <el-table-column  width="150" align="center">
179
             <template slot="header" slot-scope="scope">
171
             <template slot="header" slot-scope="scope">
180
-              <span>出货价<span style="color: red">*</span></span>
172
+              <span>出库数量<span style="color: red">*</span></span>
181
             </template>
173
             </template>
182
             <template slot-scope="scope">
174
             <template slot-scope="scope">
183
-              <!--<el-input type="number" v-model="scope.row.price"  @blur="handleBlur(scope.$index, scope.row)"></el-input>-->
184
               <el-form-item
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
                 style="padding-top: 17px"
178
                 style="padding-top: 17px"
188
               >
179
               >
189
                 <el-input
180
                 <el-input
190
-                  placeholder="请输入单价"
181
+                  placeholder="请输入出库数量"
191
                   type="number"
182
                   type="number"
192
-                  v-model="scope.row.price"
183
+                  v-model="scope.row.count"
193
                 ></el-input>
184
                 ></el-input>
194
               </el-form-item>
185
               </el-form-item>
195
             </template>
186
             </template>
196
           </el-table-column>
187
           </el-table-column>
197
 
188
 
198
-          <el-table-column min-width="23" align="center">
189
+          <el-table-column  width="150" align="center">
199
             <template slot="header" slot-scope="scope">
190
             <template slot="header" slot-scope="scope">
200
-              <span>出库数量<span style="color: red">*</span></span>
191
+              <span>出货单价<span style="color: red">*</span></span>
201
             </template>
192
             </template>
202
             <template slot-scope="scope">
193
             <template slot-scope="scope">
203
               <el-form-item
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
                 style="padding-top: 17px"
197
                 style="padding-top: 17px"
207
               >
198
               >
208
                 <el-input
199
                 <el-input
209
-                  placeholder="请输入出库数量"
200
+                  placeholder="请输入单价"
210
                   type="number"
201
                   type="number"
211
-                  v-model="scope.row.count"
202
+                  v-model="scope.row.price"
212
                 ></el-input>
203
                 ></el-input>
213
               </el-form-item>
204
               </el-form-item>
214
             </template>
205
             </template>
215
           </el-table-column>
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
             <template slot-scope="scope">
211
             <template slot-scope="scope">
219
               {{ calculate(scope.row.price * scope.row.count) }}
212
               {{ calculate(scope.row.price * scope.row.count) }}
220
             </template>
213
             </template>
221
           </el-table-column>
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
             <template slot-scope="scope">
259
             <template slot-scope="scope">
224
               <el-input v-model="scope.row.remark"></el-input>
260
               <el-input v-model="scope.row.remark"></el-input>
225
             </template>
261
             </template>
265
 
301
 
266
 <script>
302
 <script>
267
 import { uParseTime } from "@/utils/tools";
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
 import BreadCrumb from "../components/bread-crumb";
306
 import BreadCrumb from "../components/bread-crumb";
271
 import StockInDialog from './Dialog/stockInDialog'
307
 import StockInDialog from './Dialog/stockInDialog'
320
       manufacturer: [],
356
       manufacturer: [],
321
       dealer: [],
357
       dealer: [],
322
       goodType: [],
358
       goodType: [],
323
-      goodInfo:[]
359
+      goodInfo:[],
360
+      goodList:[],
361
+      manufacturerList:[]
324
     };
362
     };
325
   },
363
   },
326
   methods: {
364
   methods: {
352
 
390
 
353
       this.currentIndex = -1
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
     cancle: function() {
395
     cancle: function() {
387
       this.$refs.dialog.hide();
396
       this.$refs.dialog.hide();
404
           return false;
413
           return false;
405
         } else {
414
         } else {
406
           loading.close();
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
           this.manufacturer = response.data.data.manufacturer
416
           this.manufacturer = response.data.data.manufacturer
424
           this.dealer = response.data.data.dealer
417
           this.dealer = response.data.data.dealer
425
           this.goodType = response.data.data.goodType
418
           this.goodType = response.data.data.goodType
429
           this.manufacturer.splice(0, 0, { id: -1, manufacturer_name: '其他' })
422
           this.manufacturer.splice(0, 0, { id: -1, manufacturer_name: '其他' })
430
           this.dealer.splice(0, 0, { id: -1, dealer_name: '其他' })
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
       tempObj["price"] = "";
460
       tempObj["price"] = "";
491
       tempObj["remark"] = "";
461
       tempObj["remark"] = "";
492
       tempObj["good_unit"] = "";
462
       tempObj["good_unit"] = "";
463
+      tempObj["number"] = ""
464
+      tempObj["specification_name"] = ""
493
       this.recordInfo.recordData.push(tempObj);
465
       this.recordInfo.recordData.push(tempObj);
494
     },
466
     },
495
     handleDelete: function(index, row) {
467
     handleDelete: function(index, row) {
607
           const params = {
579
           const params = {
608
             stockOut: this.recordInfo.recordData
580
             stockOut: this.recordInfo.recordData
609
           };
581
           };
610
-          console.log(this.form.dealer);
611
-
582
+          console.log(this.recordInfo.recordData);
583
+          return
612
           postWarehouseOut(
584
           postWarehouseOut(
613
             params,
585
             params,
614
             this.warehouse_out_time,
586
             this.warehouse_out_time,
635
     },
607
     },
636
     changeDealer(val) {
608
     changeDealer(val) {
637
       this.propForm.dealer = val;
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
   created() {
659
   created() {
641
     var nowDate = new Date();
660
     var nowDate = new Date();
655
     tempObj["price"] = "";
674
     tempObj["price"] = "";
656
     tempObj["remark"] = "";
675
     tempObj["remark"] = "";
657
     tempObj["good_unit"] = ""
676
     tempObj["good_unit"] = ""
677
+    tempObj["number"] = ""
678
+    tempObj["specification_name"] = ""
658
     this.recordInfo.recordData.push(tempObj);
679
     this.recordInfo.recordData.push(tempObj);
659
     this.GetConfigInfo();
680
     this.GetConfigInfo();
660
     this.propForm.goodUnit = this.$store.getters.good_unit;
681
     this.propForm.goodUnit = this.$store.getters.good_unit;