XMLWAN 3 anos atrás
pai
commit
ab070a092a

+ 48 - 0
src/api/drug/drug_stock.js Ver arquivo

517
     params: params
517
     params: params
518
   })
518
   })
519
 }
519
 }
520
+
521
+export function exportDrugList(params) {
522
+  return request({
523
+    url: '/api/drug/exportdruglist',
524
+    method: 'get',
525
+    params: params
526
+  })
527
+}
528
+
529
+export function getExportOutOrderDrugList(params) {
530
+  return request({
531
+    url: '/api/drug/getexportoutorderdruglist',
532
+    method: 'Get',
533
+    params: params
534
+  })
535
+}
536
+
537
+export function getDrugFlow(params) {
538
+  return request({
539
+    url: '/api/drug/getdrugflow',
540
+    method: 'Get',
541
+    params: params
542
+  })
543
+}
544
+
545
+export function getCancelStockDetail(params) {
546
+  return request({
547
+    url: '/api/drug/getcancelstockdetail',
548
+    method: 'get',
549
+    params: params
550
+  })
551
+}
552
+
553
+export function getCancelDrugOrderPrint(params) {
554
+  return request({
555
+    url: '/api/drug/getcanceldrugorderprint',
556
+    method: 'Get',
557
+    params: params
558
+  })
559
+}
560
+
561
+export function getDrugCancelExportList(params) {
562
+  return request({
563
+    url: '/api/drug/drugcancelexportlist',
564
+    method: 'get',
565
+    params: params
566
+  })
567
+}

+ 16 - 0
src/api/stock.js Ver arquivo

697
     params: params
697
     params: params
698
   })
698
   })
699
 }
699
 }
700
+
701
+export function getStockFlow(params) {
702
+  return request({
703
+    url: '/api/stock/getstockflow',
704
+    method: 'Get',
705
+    params: params
706
+  })
707
+}
708
+
709
+export function getCancelExportList(params) {
710
+  return request({
711
+    url: '/api/cancel/getcancelexportlist',
712
+    method: 'get',
713
+    params: params
714
+  })
715
+}

+ 4 - 4
src/lang/zh.js Ver arquivo

156
     drugsQuery: '库存查询',
156
     drugsQuery: '库存查询',
157
     drugsReportLoss: '药品报损',
157
     drugsReportLoss: '药品报损',
158
     drugsAdjustPrice: '药品调价',
158
     drugsAdjustPrice: '药品调价',
159
-    // drugsStockCancel: '退库单',
159
+    drugsStockCancel: '退库单',
160
     // drugsStockReturn:'退货单',
160
     // drugsStockReturn:'退货单',
161
     drugsStockOut: '出库单',
161
     drugsStockOut: '出库单',
162
     drugsStockIn: '入库单',
162
     drugsStockIn: '入库单',
185
     stockOutDetail: '出库单详情',
185
     stockOutDetail: '出库单详情',
186
     cancelStockDetail: '退库单详情',
186
     cancelStockDetail: '退库单详情',
187
     stockDetail: '明细查询',
187
     stockDetail: '明细查询',
188
-    stockModifyPrice:'耗材调价',
189
-    stockDamaged:'耗材报损',
190
-    stockWarning:'耗材预警',
188
+    stockModifyPrice: '耗材调价',
189
+    stockDamaged: '耗材报损',
190
+    stockWarning: '耗材预警',
191
 
191
 
192
     showconfig: '显示配置',
192
     showconfig: '显示配置',
193
     user_detail: '使用明细',
193
     user_detail: '使用明细',

+ 23 - 6
src/router/modules/drugs.js Ver arquivo

36
     //   name: 'drugsStockReturn',
36
     //   name: 'drugsStockReturn',
37
     //   meta: { title: 'drugsStockReturn', noCache: true }
37
     //   meta: { title: 'drugsStockReturn', noCache: true }
38
     // },
38
     // },
39
-    // {
40
-    //   path: '/stock/drugs/stock/cancel',
41
-    //   component: () => import('@/xt_pages/stock/drugs/cancelDrugStockOrder'),
42
-    //   name: 'drugsStockCancel',
43
-    //   meta: { title: 'drugsStockCancel', noCache: true }
44
-    // },
39
+    {
40
+      path: '/stock/drugs/stock/cancel',
41
+      component: () => import('@/xt_pages/stock/drugs/cancelDrugStockOrder'),
42
+      name: 'drugsStockCancel',
43
+      meta: { title: 'drugsStockCancel', noCache: true }
44
+    },
45
     {
45
     {
46
       path: '/stock/drugs/stock/detail',
46
       path: '/stock/drugs/stock/detail',
47
       component: () => import('@/xt_pages/stock/drugs/drugIndex'),
47
       component: () => import('@/xt_pages/stock/drugs/drugIndex'),
130
       is_menu: false,
130
       is_menu: false,
131
       meta: { title: 'cancelDrugStockDetail', noCache: true }
131
       meta: { title: 'cancelDrugStockDetail', noCache: true }
132
     },
132
     },
133
+    {
134
+      path: '/drugstock/cancel/edit',
135
+      component: () => import('@/xt_pages/stock/drugs/cancelDrugStockOrderEdit'),
136
+      name: 'cancelDrugStockOrderEdit',
137
+      hidden: true,
138
+      is_menu: false,
139
+      meta: { title: 'cancelDrugStockOrderEdit', noCache: true }
140
+    },
133
     {
141
     {
134
       path: '/drugstock/user/detail',
142
       path: '/drugstock/user/detail',
135
       component: () => import('@/xt_pages/stock/drugs/drugStockUserDetail'),
143
       component: () => import('@/xt_pages/stock/drugs/drugStockUserDetail'),
208
       is_menu: false,
216
       is_menu: false,
209
       meta: { title: 'drugStockOutOrderEdit' }
217
       meta: { title: 'drugStockOutOrderEdit' }
210
 
218
 
219
+    },
220
+    {
221
+      path: '/drug/cancel/print',
222
+      component: () => import('@/xt_pages/stock/drugs/cancelDrugOrderPrint'),
223
+      name: 'cancelDrugOrderPrint',
224
+      hidden: true,
225
+      is_menu: false,
226
+      meta: { title: 'cancelDrugOrderPrint' }
227
+
211
     }
228
     }
212
 
229
 
213
   ]
230
   ]

+ 14 - 2
src/router/modules/stock.js Ver arquivo

68
       name: 'stockWarning',
68
       name: 'stockWarning',
69
       meta: { title: 'stockWarning', noCache: true }
69
       meta: { title: 'stockWarning', noCache: true }
70
     },
70
     },
71
-    
71
+
72
     // {
72
     // {
73
     //   path: "/stock/",
73
     //   path: "/stock/",
74
     //   component: Layout,
74
     //   component: Layout,
234
       is_menu: false,
234
       is_menu: false,
235
       name: 'stock_print',
235
       name: 'stock_print',
236
       meta: {
236
       meta: {
237
-        title: '库打印',
237
+        title: '退库打印',
238
         noCache: true
238
         noCache: true
239
       }
239
       }
240
     },
240
     },
305
         title: '耗材退库打印',
305
         title: '耗材退库打印',
306
         noCache: true
306
         noCache: true
307
       }
307
       }
308
+    },
309
+
310
+    {
311
+      path: '/stock/drugs/cancelstockorderprint',
312
+      component: () => import('@/xt_pages/stock/cancelStockOrderPrint'),
313
+      hidden: true,
314
+      is_menu: false,
315
+      name: 'stock_print',
316
+      meta: {
317
+        title: '退库打印',
318
+        noCache: true
319
+      }
308
     }
320
     }
309
   ]
321
   ]
310
 }
322
 }

+ 127 - 22
src/xt_pages/stock/cancelStockOrder.vue Ver arquivo

71
           >全选</el-checkbox
71
           >全选</el-checkbox
72
         >
72
         >
73
         <el-button size="small" icon="el-icon-delete" @click="batchDelete">删除</el-button>
73
         <el-button size="small" icon="el-icon-delete" @click="batchDelete">删除</el-button>
74
-        <!-- <el-button size="small" type="primary" @click="toPrint">打印</el-button> -->
74
+        <el-button size="small" type="primary" @click="toPrint">打印</el-button>
75
+        <el-button size="small" type="primary" @click="toExport">导出</el-button>
75
       </div>
76
       </div>
76
 
77
 
77
       <el-row :gutter="12" style="margin-top: 10px">
78
       <el-row :gutter="12" style="margin-top: 10px">
189
               {{ scope.row.count}}{{scope.row.GoodInfo.packing_unit}}
190
               {{ scope.row.count}}{{scope.row.GoodInfo.packing_unit}}
190
             </template>
191
             </template>
191
           </el-table-column>
192
           </el-table-column>
193
+        
194
+          <el-table-column label="退库单价" align="center">
195
+            <template slot-scope="scope">
196
+              {{ scope.row.price}}
197
+            </template>
198
+          </el-table-column>
199
+
200
+         <el-table-column label="批次" align="center">
201
+            <template slot-scope="scope">
202
+              {{ scope.row.number}}
203
+            </template>
204
+          </el-table-column>
205
+
206
+         <el-table-column label="品名/注册证号(备案凭证号)" align="center">
207
+            <template slot-scope="scope">
208
+              {{ scope.row.register_account}}
209
+            </template>
210
+          </el-table-column>
211
+
212
+         <el-table-column label="生产厂家" align="center">
213
+            <template slot-scope="scope">
214
+              {{ scope.row.manufacturer}}
215
+            </template>
216
+          </el-table-column>
217
+
218
+         <el-table-column label="生产日期" align="center">
219
+            <template slot-scope="scope">
220
+              {{getTime(scope.row.product_date,"{y}-{h}-{d}")}}
221
+            </template>
222
+          </el-table-column>
223
+
224
+          <el-table-column label="有效期" align="center">
225
+            <template slot-scope="scope">
226
+              {{getTime(scope.row.expiry_date,"{y}-{h}-{d}")}}
227
+            </template>
228
+          </el-table-column>
229
+
230
+         <el-table-column label="经销商" align="center">
231
+            <template slot-scope="scope">
232
+              {{ scope.row.dealer}}
233
+            </template>
234
+          </el-table-column>
235
+
236
+         <el-table-column label="退库原因" align="center">
237
+            <template slot-scope="scope">
238
+              {{ scope.row.remark}}
239
+            </template>
240
+          </el-table-column>
241
+
192
         </el-table>
242
         </el-table>
193
       </div>
243
       </div>
194
     </div>
244
     </div>
203
   GetAllConfig,
253
   GetAllConfig,
204
   getCancelStockList,
254
   getCancelStockList,
205
   getSingCancelOrder,
255
   getSingCancelOrder,
206
-  getCancelStockOrderPrint
256
+  getCancelExportList
207
 } from "@/api/stock";
257
 } from "@/api/stock";
208
 import BreadCrumb from "../components/bread-crumb";
258
 import BreadCrumb from "../components/bread-crumb";
209
 
259
 
264
       tableList:[],
314
       tableList:[],
265
       showTable:false,
315
       showTable:false,
266
       order_id:"",
316
       order_id:"",
317
+      exportList:[]
267
     };
318
     };
268
   },
319
   },
269
   methods: {
320
   methods: {
457
         })
508
         })
458
         .catch(() => {});
509
         .catch(() => {});
459
     },
510
     },
460
-    changeAllSelected: function(val) {
461
-      var ids = []
462
-      for(let i=0;i<val.length;i++){
463
-         ids.push(val[i].id)
464
-      }
465
-      this.order_id = ids.join(",")
466
-
511
+    changeAllSelected(val) {
512
+     
467
       if (val) {
513
       if (val) {
468
         this.$refs.multipleTable.toggleAllSelection();
514
         this.$refs.multipleTable.toggleAllSelection();
469
       } else {
515
       } else {
470
         this.$refs.multipleTable.clearSelection();
516
         this.$refs.multipleTable.clearSelection();
471
       }
517
       }
472
     },
518
     },
473
-    select(selection) {
474
-      this.selectedTableData = selection;
519
+    select(val) {
520
+      var ids = []
521
+      for(let i=0;i<val.length;i++){
522
+         ids.push(val[i].id)
523
+      }
524
+      this.order_id = ids.join(",")
525
+      this.selectedTableData = val;
526
+      this.getCancelExportList()
475
     },
527
     },
476
     batchDelete() {
528
     batchDelete() {
477
       if (this.selectedTableData.length <= 0) {
529
       if (this.selectedTableData.length <= 0) {
534
       if(this.order_id == ""){
586
       if(this.order_id == ""){
535
         this.$message.error("请勾选退库单")
587
         this.$message.error("请勾选退库单")
536
       }else{
588
       }else{
537
-        this.getCancelStockOrderPrint()
589
+        console.log("232332332")
590
+        this.$router.push({path:'/stock/drugs/cancelstockorderprint?order_id='+this.order_id+"&start_time="+this.start_time+"&end_time="+this.end_time})
591
+      }
592
+    },
593
+    getTime(val) {
594
+      if(val < 0){
595
+        return ""
538
       }
596
       }
597
+      if(val == ""){
598
+      return ""
599
+      }else {
600
+      return uParseTime(val, '{y}-{m}-{d}')
601
+      }
602
+    },
603
+    getCancelExportList(){
604
+       const Params = {
605
+        start_time: this.start_time,
606
+        end_time: this.end_time,
607
+        order_id:this.order_id,
608
+      };
609
+      console.log("params2323232",Params)
610
+     getCancelExportList(Params).then(response=>{
611
+        if(response.data.state == 1){
612
+          var list =  response.data.data.list
613
+          console.log("list2323232",list)
614
+          this.exportList = list
615
+        }
616
+     })
539
     },
617
     },
540
-    getCancelStockOrderPrint(){
541
-       var params = {
542
-         id:this.order_id
543
-       }
544
-      getCancelStockOrderPrint(params).then(response=>{
545
-         if(response.data.state ==1){
546
-           var list =  response.data.data.list
547
-           console.log("list222",list)
548
-         }
618
+   
619
+    toExport(){
620
+      if(this.order_id == ""){
621
+        this.$message.error("请勾选退库单")
622
+        return
623
+      }
624
+     import('@/vendor/Export2Excel').then(excel => {
625
+      console.log("23232323",this.exportList)
626
+      for(let i=0;i<this.exportList.length;i++){
627
+        this.exportList[i].total_price = this.exportList[i].count * this.exportList[i].price
628
+        this.exportList[i].good_name = this.exportList[i].GoodInfo.good_name
629
+        this.exportList[i].unit = this.exportList[i].GoodInfo.specification_name + "/" +this.exportList[i].packing_unit
630
+        if(this.exportList[i].dealer == 0){
631
+          this.exportList[i].dealer = ""
632
+        }
633
+        if(this.exportList[i].manufacturer == 0){
634
+          this.exportList[i].manufacturer = ""
635
+        }
636
+      
637
+        this.exportList[i].product_date = this.getTime(this.exportList[i].product_date,"{y}-{h}-{d}")
638
+        this.exportList[i].expiry_date = this.getTime(this.exportList[i].expiry_date,"{y}-{h}-{d}")
639
+      }
640
+      const tHeader = ['耗材名称',  '规格&单位','退库数量','退库单价','批次','品名/注册证号(备案凭证号)','生产厂家','生产日期','有效期','退库原因']
641
+      const filterVal = ['good_name', 'unit','count','price','number','register_account','manufacturer','product_date','expiry_date','remark']
642
+      console.log("table",this.exportList)
643
+      
644
+      const data = this.formatJson(filterVal, this.exportList)
645
+      excel.export_json_to_excel({
646
+        header: tHeader,
647
+        data,
648
+        filename: '耗材退库单详情'
549
       })
649
       })
550
-    }
650
+      this.downloadLoading = false
651
+     })
652
+    },
653
+    formatJson(filterVal, jsonData) {
654
+    return jsonData.map(v => filterVal.map(j => v[j]));
655
+   },
551
   }
656
   }
552
 };
657
 };
553
 </script>
658
 </script>

+ 165 - 18
src/xt_pages/stock/cancelStockOrderAdd.vue Ver arquivo

62
           :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }"
62
           :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }"
63
         >
63
         >
64
        
64
        
65
-          <el-table-column align="center" width="250">
65
+          <el-table-column align="center" width="230">
66
              <template slot="header" slot-scope="scope">
66
              <template slot="header" slot-scope="scope">
67
               <span>耗材名称</span>
67
               <span>耗材名称</span>
68
             </template>
68
             </template>
72
                     popper-class="my-autocomplete"
72
                     popper-class="my-autocomplete"
73
                     v-model="scope.row.good_name"
73
                     v-model="scope.row.good_name"
74
                     :fetch-suggestions="querySearchAsync"
74
                     :fetch-suggestions="querySearchAsync"
75
-                    :trigger-on-focus="false"
75
+                    :trigger-on-focus="true"
76
                     placeholder="请输入耗材名称"
76
                     placeholder="请输入耗材名称"
77
                     @select="handleSelect"
77
                     @select="handleSelect"
78
                     @input="changeGoodName(scope.$index)"
78
                     @input="changeGoodName(scope.$index)"
85
                  </el-autocomplete>
85
                  </el-autocomplete>
86
             </template>
86
             </template>
87
           </el-table-column>
87
           </el-table-column>
88
-          <el-table-column align="center" width="300">
88
+          <el-table-column align="center" width="200">
89
             <template slot="header" slot-scope="scope">
89
             <template slot="header" slot-scope="scope">
90
               <span>规格&单位<span style="color: red">*</span></span>
90
               <span>规格&单位<span style="color: red">*</span></span>
91
             </template>
91
             </template>
98
             </template>
98
             </template>
99
           </el-table-column>
99
           </el-table-column>
100
         
100
         
101
-          <el-table-column width="300" align="center">
101
+          <el-table-column width="150" align="center">
102
             <template slot="header" slot-scope="scope">
102
             <template slot="header" slot-scope="scope">
103
               <span>退库数量<span style="color: red">*</span></span>
103
               <span>退库数量<span style="color: red">*</span></span>
104
             </template>
104
             </template>
112
                   placeholder="请输入退库数量"
112
                   placeholder="请输入退库数量"
113
                   type="number"
113
                   type="number"
114
                   v-model="scope.row.return_count"
114
                   v-model="scope.row.return_count"
115
-                ></el-input>
116
-                {{scope.row.packing_unit}}
115
+                ></el-input>      
117
               </el-form-item>
116
               </el-form-item>
117
+              <!-- {{scope.row.packing_unit}} -->
118
             </template>
118
             </template>
119
           </el-table-column>
119
           </el-table-column>
120
-          <el-table-column label="操作" align="center" min-width="20">
120
+          <el-table-column width="150" align="center">
121
+            <template slot="header" slot-scope="scope">
122
+              <span>单价<span style="color: red">*</span></span>
123
+            </template>
124
+            <template slot-scope="scope">
125
+              <el-form-item
126
+                :prop="'recordData.' + scope.$index + '.price'"
127
+                :rules="tableRules.price"
128
+                style="padding-top: 17px"
129
+              >
130
+                <el-input
131
+                  placeholder="请输入退库数量"
132
+                  type="number"
133
+                  v-model="scope.row.price"
134
+                ></el-input>      
135
+              </el-form-item>
136
+              <!-- {{scope.row.packing_unit}} -->
137
+            </template>
138
+          </el-table-column>
139
+          <el-table-column label="总价" align="center" width="150">
140
+            <template slot-scope="scope">
141
+              {{ calculate(scope.row.price * scope.row.return_count) }}
142
+            </template>
143
+          </el-table-column>
144
+          <el-table-column width="200" align="center">
145
+            <template slot="header" slot-scope="scope">
146
+              <span>批次<span style="color: red"></span></span>
147
+            </template>
148
+            <template slot-scope="scope">
149
+              <el-form-item
150
+                :prop="'recordData.' + scope.$index + '.return_count'"
151
+                style="padding-top: 17px"
152
+              >
153
+               <el-select v-model="scope.row.number" filterable placeholder="请选择">
154
+                  <el-option
155
+                    v-for="(item,index) in numberList"
156
+                    :key="index"
157
+                    :label="item.number"
158
+                    :value="item.number">
159
+                  </el-option>
160
+              </el-select>
161
+              </el-form-item>
162
+            </template>
163
+          </el-table-column>
164
+          <el-table-column width="200" align="center">
165
+            <template slot="header" slot-scope="scope">
166
+              <span>品名/注册证号(备案凭证号)<span style="color: red"></span></span>
167
+            </template>
168
+            <template slot-scope="scope">
169
+              <el-form-item
170
+                :prop="'recordData.' + scope.$index + '.return_count'"
171
+                style="padding-top: 17px"
172
+              >
173
+              <el-input v-model="scope.row.register_account"></el-input>
174
+              </el-form-item>
175
+            </template>
176
+          </el-table-column>
177
+           <el-table-column label="生产厂家" width="160" align="center">
178
+            <template slot-scope="scope">
179
+               <el-select v-model="scope.row.manufacturer" filterable placeholder="请选择厂商">
180
+                <el-option
181
+                  v-for="(option, index) in manufacturerList"
182
+                  :key="index"
183
+                  :label="option.manufacturer_name"
184
+                  :value="option.manufacturer_name">
185
+                </el-option>
186
+               </el-select>
187
+            </template>
188
+          </el-table-column>
189
+ 
190
+
191
+          <el-table-column label="生产日期" width="180" align="center">
192
+            <template slot-scope="scope">
193
+              <el-date-picker
194
+                prefix-icon="el-icon-date"
195
+                style="width: 145px"
196
+                v-model="scope.row.product_date"
197
+                type="date"
198
+                placeholder="选择日期时间"
199
+                format="yyyy-MM-dd"
200
+                value-format="yyyy-MM-dd"
201
+              ></el-date-picker>
202
+            </template>
203
+          </el-table-column>
204
+          <el-table-column label="有效日期" width="180" align="center">
205
+            <template slot-scope="scope">
206
+              <el-date-picker
207
+                prefix-icon="el-icon-date"
208
+                style="width: 145px"
209
+                v-model="scope.row.expiry_date"
210
+                type="date"
211
+                placeholder="选择日期时间"
212
+                format="yyyy-MM-dd"
213
+                value-format="yyyy-MM-dd"
214
+              ></el-date-picker>
215
+            </template>
216
+          </el-table-column>
217
+
218
+
219
+        <el-table-column label="经销商" width="160" align="center">
220
+            <template slot-scope="scope">
221
+                <el-select v-model="scope.row.dealer" filterable placeholder="请选择厂商">
222
+                <el-option
223
+                  v-for="(option, index) in dealerList"
224
+                  :key="index"
225
+                  :label="option.dealer_name"
226
+                  :value="option.dealer_name">
227
+                </el-option>
228
+                </el-select>
229
+            </template>
230
+          </el-table-column>
231
+          <el-table-column width="200" align="center">
232
+            <template slot="header" slot-scope="scope">
233
+              <span>退库原因<span style="color: red"></span></span>
234
+            </template>
235
+            <template slot-scope="scope">
236
+              <el-form-item
237
+                :prop="'recordData.' + scope.$index + '.remark'"
238
+                style="padding-top: 17px"
239
+              >
240
+              <el-input v-model="scope.row.remark"></el-input>
241
+              </el-form-item>
242
+            </template>
243
+          </el-table-column>
244
+          <el-table-column label="操作" align="center" width="200" fixed="right">
121
             <template slot-scope="scope">
245
             <template slot-scope="scope">
122
               <el-tooltip
246
               <el-tooltip
123
                 class="item"
247
                 class="item"
157
 
281
 
158
 <script>
282
 <script>
159
 import { uParseTime } from "@/utils/tools";
283
 import { uParseTime } from "@/utils/tools";
160
-import { getCancelStockConfig, postCancelStock,GetAllConfig,GetAllGoodInfoByID,postSearchGoodList } from "@/api/stock";
284
+import { getCancelStockConfig, postCancelStock,GetAllConfig,GetAllGoodInfoByID,postSearchGoodList,getStockBatchNumber } from "@/api/stock";
161
 import BreadCrumb from "../components/bread-crumb";
285
 import BreadCrumb from "../components/bread-crumb";
162
 import StockInDialog from './Dialog/stockInDialog'
286
 import StockInDialog from './Dialog/stockInDialog'
163
 
287
 
214
       dealer: [],
338
       dealer: [],
215
       goodType: [],
339
       goodType: [],
216
       goodInfo:[],
340
       goodInfo:[],
341
+      numberList:[]
217
     };
342
     };
218
   },
343
   },
219
   methods: {
344
   methods: {
233
             tempForm['good_type_id'] =val.selectedGoodInfo[i].good_type_id
358
             tempForm['good_type_id'] =val.selectedGoodInfo[i].good_type_id
234
             tempForm['good_id'] = val.selectedGoodInfo[i].id
359
             tempForm['good_id'] = val.selectedGoodInfo[i].id
235
             tempForm["return_count"] = "";
360
             tempForm["return_count"] = "";
361
+
236
             this.recordInfo.recordData.splice(this.currentIndex + 1, 0, tempForm)
362
             this.recordInfo.recordData.splice(this.currentIndex + 1, 0, tempForm)
237
           }
363
           }
238
         }
364
         }
297
       tempObj["good_type_id"] = 0;
423
       tempObj["good_type_id"] = 0;
298
       tempObj["good_id"] = 0;
424
       tempObj["good_id"] = 0;
299
       tempObj["return_count"] = "";
425
       tempObj["return_count"] = "";
426
+      tempObj["number"] = ""
427
+      tempObj["dealer"] = ""
428
+      tempObj["manufacturer"]= ""
429
+      tempObj["register_account"] = ""
430
+      tempObj["remark"] = ""
431
+      tempObj["price"] = ""
432
+      tempObj["total"] = ""
300
       this.recordInfo.recordData.push(tempObj);
433
       this.recordInfo.recordData.push(tempObj);
301
     },
434
     },
302
     handleDelete: function(index, row) {
435
     handleDelete: function(index, row) {
393
           const array = this.recordInfo.recordData;
526
           const array = this.recordInfo.recordData;
394
           let total = 0;
527
           let total = 0;
395
           for (let i = 0; i < array.length; i++) {
528
           for (let i = 0; i < array.length; i++) {
396
-            if (array[i].good_type_id == 0) {
397
-              this.$message.error("商品类型不能为空");
398
-              return;
399
-            }
400
-            if (array[i].good_id == 0) {
401
-              this.$message.error("规格名称不能为空");
402
-              return;
403
-            }
529
+            array[i].price = (array[i].price).toString()
404
             total = total + array[i].price * array[i].return_count;
530
             total = total + array[i].price * array[i].return_count;
405
           }
531
           }
406
 
532
 
413
             cancelStock: this.recordInfo.recordData
539
             cancelStock: this.recordInfo.recordData
414
           };
540
           };
415
           console.log("params",params)
541
           console.log("params",params)
416
-         
542
+ 
417
           postCancelStock(
543
           postCancelStock(
418
             params,
544
             params,
419
             this.return_time,
545
             this.return_time,
497
       this.currentIndex = val
623
       this.currentIndex = val
498
     },
624
     },
499
     handleSelect(val){
625
     handleSelect(val){
626
+      //获取当前耗材的批号
627
+      this.getStockBatchNumber(val.id)
500
       for(let i=0;i<this.recordInfo.recordData.length;i++){
628
       for(let i=0;i<this.recordInfo.recordData.length;i++){
501
         if(this.currentIndex == i){
629
         if(this.currentIndex == i){
502
           this.recordInfo.recordData[i].good_type_id = val.id
630
           this.recordInfo.recordData[i].good_type_id = val.id
523
           
651
           
524
         }
652
         }
525
       }
653
       }
526
-    }
654
+    },
655
+    getStockBatchNumber(id){
656
+       var params = {
657
+         id:id
658
+       }
659
+      getStockBatchNumber(params).then(response=>{
660
+        if(response.data.state == 1){
661
+          var list = response.data.data.list
662
+          console.log("list2243444",list)
663
+          this.numberList = list
664
+        }
665
+     })
666
+    },
527
   },
667
   },
528
   created() {
668
   created() {
529
     var nowDate = new Date();
669
     var nowDate = new Date();
541
     tempObj["good_type_id"] = 0;
681
     tempObj["good_type_id"] = 0;
542
     tempObj["good_id"] = 0;
682
     tempObj["good_id"] = 0;
543
     tempObj["return_count"] = "";
683
     tempObj["return_count"] = "";
684
+    tempObj["number"] = ""
685
+    tempObj["dealer"] = ""
686
+    tempObj["manufacturer"]= ""
687
+    tempObj["register_account"] = ""
688
+    tempObj["remark"] = ""
689
+    tempObj["price"] = ""
690
+    tempObj["total"] = ""
544
     this.recordInfo.recordData.push(tempObj);
691
     this.recordInfo.recordData.push(tempObj);
545
     this.GetConfigInfo();
692
     this.GetConfigInfo();
546
     this.propForm.goodUnit = this.$store.getters.good_unit;
693
     this.propForm.goodUnit = this.$store.getters.good_unit;

+ 170 - 10
src/xt_pages/stock/cancelStockOrderEdit.vue Ver arquivo

28
         <el-table :data="recordInfo.recordData" :class="signAndWeighBoxPatients" style="width: 100%" border
28
         <el-table :data="recordInfo.recordData" :class="signAndWeighBoxPatients" style="width: 100%" border
29
              max-height="450" :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}">
29
              max-height="450" :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}">
30
 
30
 
31
-          <el-table-column align="center" width="300">
31
+          <el-table-column align="center" width="230">
32
              <template slot="header" slot-scope="scope">
32
              <template slot="header" slot-scope="scope">
33
               <span>耗材名称</span>
33
               <span>耗材名称</span>
34
             </template>
34
             </template>
38
                     popper-class="my-autocomplete"
38
                     popper-class="my-autocomplete"
39
                     v-model="scope.row.good_name"
39
                     v-model="scope.row.good_name"
40
                     :fetch-suggestions="querySearchAsync"
40
                     :fetch-suggestions="querySearchAsync"
41
-                    :trigger-on-focus="false"
41
+                    :trigger-on-focus="true"
42
                     placeholder="请输入耗材名称"
42
                     placeholder="请输入耗材名称"
43
                     @select="handleSelect"
43
                     @select="handleSelect"
44
                     @input="changeGoodName(scope.$index)"
44
                     @input="changeGoodName(scope.$index)"
53
           </el-table-column>
53
           </el-table-column>
54
 
54
 
55
 
55
 
56
-         <el-table-column align="center" width="300">
56
+         <el-table-column align="center" width="200">
57
             
57
             
58
             <template slot="header" slot-scope="scope">
58
             <template slot="header" slot-scope="scope">
59
               <span>规格&单位<span style="color: red">*</span></span>
59
               <span>规格&单位<span style="color: red">*</span></span>
68
         </el-table-column>
68
         </el-table-column>
69
 
69
 
70
 
70
 
71
-          <el-table-column width="300" align="center">
71
+          <el-table-column width="150" align="center">
72
             <template slot="header" slot-scope="scope">
72
             <template slot="header" slot-scope="scope">
73
               <span>退库数量<span style="color: red">*</span></span>
73
               <span>退库数量<span style="color: red">*</span></span>
74
             </template>
74
             </template>
76
               <el-form-item :prop="'recordData.' + scope.$index + '.count'" :rules='tableRules.count'
76
               <el-form-item :prop="'recordData.' + scope.$index + '.count'" :rules='tableRules.count'
77
                             style="padding-top: 17px">
77
                             style="padding-top: 17px">
78
                 <el-input type="number" v-model="scope.row.count"></el-input>
78
                 <el-input type="number" v-model="scope.row.count"></el-input>
79
-                {{scope.row.packing_unit}}
80
               </el-form-item>
79
               </el-form-item>
81
             </template>
80
             </template>
82
           </el-table-column>
81
           </el-table-column>
82
+          <el-table-column width="150" align="center">
83
+            <template slot="header" slot-scope="scope">
84
+              <span>退库单价<span style="color: red">*</span></span>
85
+            </template>
86
+            <template slot-scope="scope">
87
+              <el-form-item
88
+                :prop="'recordData.' + scope.$index + '.price'"
89
+                :rules="tableRules.price"
90
+                style="padding-top: 17px"
91
+              >
92
+                <el-input
93
+                  placeholder="请输入退库数量"
94
+                  type="number"
95
+                  v-model="scope.row.price"
96
+                ></el-input>      
97
+              </el-form-item>
98
+              <!-- {{scope.row.packing_unit}} -->
99
+            </template>
100
+          </el-table-column>
101
+          <el-table-column label="总价" align="center" width="150">
102
+            <template slot-scope="scope">
103
+              {{ calculate(scope.row.price * scope.row.count) }}
104
+            </template>
105
+          </el-table-column>
106
+          <el-table-column width="200" align="center">
107
+            <template slot="header" slot-scope="scope">
108
+              <span>批次<span style="color: red"></span></span>
109
+            </template>
110
+            <template slot-scope="scope">
111
+              <el-form-item
112
+                :prop="'recordData.' + scope.$index + '.return_count'"
113
+                style="padding-top: 17px"
114
+              >
115
+               <el-select v-model="scope.row.number" filterable placeholder="请选择">
116
+                  <el-option
117
+                    v-for="(item,index) in numberList"
118
+                    :key="index"
119
+                    :label="item.number"
120
+                    :value="item.number">
121
+                  </el-option>
122
+              </el-select>
123
+              </el-form-item>
124
+            </template>
125
+          </el-table-column>
126
+           <el-table-column width="200" align="center">
127
+            <template slot="header" slot-scope="scope">
128
+              <span>品名/注册证号(备案凭证号)<span style="color: red"></span></span>
129
+            </template>
130
+            <template slot-scope="scope">
131
+              <el-form-item
132
+                :prop="'recordData.' + scope.$index + '.return_count'"
133
+                style="padding-top: 17px"
134
+              >
135
+              <el-input v-model="scope.row.register_account"></el-input>
136
+              </el-form-item>
137
+            </template>
138
+          </el-table-column>
139
+           <el-table-column label="生产厂家" width="160" align="center">
140
+            <template slot-scope="scope">
141
+               <el-select v-model="scope.row.manufacturer" filterable placeholder="请选择厂商">
142
+                <el-option
143
+                  v-for="(option, index) in manufacturerList"
144
+                  :key="index"
145
+                  :label="option.manufacturer_name"
146
+                  :value="option.manufacturer_name">
147
+                </el-option>
148
+               </el-select>
149
+            </template>
150
+          </el-table-column>
151
+ 
83
 
152
 
84
-          
153
+          <el-table-column label="生产日期" width="180" align="center">
154
+            <template slot-scope="scope">
155
+              <el-date-picker
156
+                prefix-icon="el-icon-date"
157
+                style="width: 145px"
158
+                v-model="scope.row.product_date"
159
+                type="date"
160
+                placeholder="选择日期时间"
161
+                format="yyyy-MM-dd"
162
+                value-format="yyyy-MM-dd"
163
+              ></el-date-picker>
164
+            </template>
165
+          </el-table-column>
166
+          <el-table-column label="有效日期" width="180" align="center">
167
+            <template slot-scope="scope">
168
+              <el-date-picker
169
+                prefix-icon="el-icon-date"
170
+                style="width: 145px"
171
+                v-model="scope.row.expiry_date"
172
+                type="date"
173
+                placeholder="选择日期时间"
174
+                format="yyyy-MM-dd"
175
+                value-format="yyyy-MM-dd"
176
+              ></el-date-picker>
177
+            </template>
178
+          </el-table-column>
85
 
179
 
86
-          <el-table-column label="操作" align="center" min-width="20">
180
+        <el-table-column label="经销商" width="160" align="center">
181
+            <template slot-scope="scope">
182
+                <el-select v-model="scope.row.dealer" filterable placeholder="请选择厂商">
183
+                <el-option
184
+                  v-for="(option, index) in dealerList"
185
+                  :key="index"
186
+                  :label="option.dealer_name"
187
+                  :value="option.dealer_name">
188
+                </el-option>
189
+                </el-select>
190
+            </template>
191
+          </el-table-column>
192
+          <el-table-column width="200" align="center">
193
+            <template slot="header" slot-scope="scope">
194
+              <span>退库原因<span style="color: red"></span></span>
195
+            </template>
196
+            <template slot-scope="scope">
197
+              <el-form-item
198
+                :prop="'recordData.' + scope.$index + '.remark'"
199
+                :rules="tableRules.return_count"
200
+                style="padding-top: 17px"
201
+              >
202
+              <el-input v-model="scope.row.remark"></el-input>
203
+              </el-form-item>
204
+            </template>
205
+          </el-table-column>
206
+
207
+          <el-table-column label="操作" align="center" width="200" fixed="right">
87
             <template slot-scope="scope">
208
             <template slot-scope="scope">
88
               <el-tooltip class="item" effect="dark" content="新增" placement="top">
209
               <el-tooltip class="item" effect="dark" content="新增" placement="top">
89
 
210
 
119
 <script>
240
 <script>
120
   import { uParseTime } from '@/utils/tools'
241
   import { uParseTime } from '@/utils/tools'
121
 
242
 
122
-  import { deleteCancelStockInfo, editCancelStockInfo, getCancelStockConfig, getCancelStockInfo,GetAllGoodInfoByID,GetAllConfig,postSearchGoodList  } from '@/api/stock'
243
+  import { deleteCancelStockInfo, editCancelStockInfo, getCancelStockConfig, getCancelStockInfo,GetAllGoodInfoByID,GetAllConfig,postSearchGoodList,getStockBatchNumber  } from '@/api/stock'
123
   import BreadCrumb from '../components/bread-crumb'
244
   import BreadCrumb from '../components/bread-crumb'
124
   import StockInDialog from './Dialog/stockInDialog'
245
   import StockInDialog from './Dialog/stockInDialog'
125
 
246
 
190
         goodList:[],
311
         goodList:[],
191
         manufacturerList:[],
312
         manufacturerList:[],
192
         dealerList:[],
313
         dealerList:[],
314
+        numberList:[]
193
       }
315
       }
194
     },
316
     },
195
     methods: {
317
     methods: {
267
         tempObj['good_type_id'] = 0
389
         tempObj['good_type_id'] = 0
268
         tempObj['good_id'] = 0
390
         tempObj['good_id'] = 0
269
         tempObj['count'] = ''
391
         tempObj['count'] = ''
392
+        tempObj["number"] = ""
393
+        tempObj["dealer"] = ""
394
+        tempObj["manufacturer"]= ""
395
+        tempObj["register_account"] = ""
396
+        tempObj["remark"] = ""
397
+        tempObj["price"] = ""
270
         this.recordInfo.recordData.push(tempObj)
398
         this.recordInfo.recordData.push(tempObj)
271
       }, handleDelete: function(index, row) {
399
       }, handleDelete: function(index, row) {
272
         if (row.id == 0) {
400
         if (row.id == 0) {
364
 
492
 
365
       back() {
493
       back() {
366
         this.$router.go(-1)
494
         this.$router.go(-1)
367
-      }, submit() {
495
+      },
496
+      submit() {
368
         this.$refs['tableForm'].validate((valid) => {
497
         this.$refs['tableForm'].validate((valid) => {
369
           if (valid) {
498
           if (valid) {
370
             const array = this.recordInfo.recordData
499
             const array = this.recordInfo.recordData
377
                 this.$message.error('规格名称不能为空')
506
                 this.$message.error('规格名称不能为空')
378
                 return
507
                 return
379
               }
508
               }
509
+              array[i].price = array[i].price.toString()
380
             }
510
             }
381
 
511
 
382
             const params = {
512
             const params = {
383
               'cancelStock': this.recordInfo.recordData
513
               'cancelStock': this.recordInfo.recordData
384
             }
514
             }
515
+            console.log("parasm23232",params)
385
             editCancelStockInfo(params, this.return_time, this.$route.query.id, this.$route.query.type,this.form.manufacturer,this.form.dealer).then(response => {
516
             editCancelStockInfo(params, this.return_time, this.$route.query.id, this.$route.query.type,this.form.manufacturer,this.form.dealer).then(response => {
386
               if (response.data.state == 0) {
517
               if (response.data.state == 0) {
387
                 this.$message.error(response.data.msg)
518
                 this.$message.error(response.data.msg)
406
             this.$message.error(response.data.msg)
537
             this.$message.error(response.data.msg)
407
             return false
538
             return false
408
           } else {
539
           } else {
409
-           
540
+            console.log("猎豹323c",response.data.data.list)
410
             for (let i = 0; i < response.data.data.list.length; i++) {
541
             for (let i = 0; i < response.data.data.list.length; i++) {
411
               response.data.data.list[i].good_name = response.data.data.list[i].GoodInfo.good_name
542
               response.data.data.list[i].good_name = response.data.data.list[i].GoodInfo.good_name
412
               response.data.data.list[i].name = response.data.data.list[i].GoodInfo.specification_name + "/" + response.data.data.list[i].GoodInfo.packing_unit
543
               response.data.data.list[i].name = response.data.data.list[i].GoodInfo.specification_name + "/" + response.data.data.list[i].GoodInfo.packing_unit
413
               response.data.data.list[i].packing_unit = response.data.data.list[i].GoodInfo.packing_unit
544
               response.data.data.list[i].packing_unit = response.data.data.list[i].GoodInfo.packing_unit
414
               response.data.data.list[i].count = response.data.data.list[i].count.toString()
545
               response.data.data.list[i].count = response.data.data.list[i].count.toString()
546
+              response.data.data.list[i].product_date = this.getTime(response.data.data.list[i].product_date,"{y}-{m}-{d}")
547
+              response.data.data.list[i].expiry_date = this.getTime(response.data.data.list[i].expiry_date,"{y}-{m}-{d}")
548
+              response.data.data.list[i].return_count = response.data.data.list[i].count
415
               this.recordInfo.recordData.push(response.data.data.list[i])
549
               this.recordInfo.recordData.push(response.data.data.list[i])
416
             }
550
             }
417
             this.cancelStock = response.data.data.info
551
             this.cancelStock = response.data.data.info
418
             this.return_time = this.getTime(this.cancelStock.return_time, '{y}-{m}-{d}')
552
             this.return_time = this.getTime(this.cancelStock.return_time, '{y}-{m}-{d}')
419
             this.form.manufacturer = this.cancelStock.manufacturer
553
             this.form.manufacturer = this.cancelStock.manufacturer
420
             this.form.dealer = this.cancelStock.dealer
554
             this.form.dealer = this.cancelStock.dealer
555
+          
421
           }
556
           }
422
           if (this.recordInfo.recordData.length == 0) {
557
           if (this.recordInfo.recordData.length == 0) {
423
             const tempObj = {}
558
             const tempObj = {}
427
             tempObj['count'] = ''
562
             tempObj['count'] = ''
428
             this.recordInfo.recordData.push(tempObj)
563
             this.recordInfo.recordData.push(tempObj)
429
           }
564
           }
565
+          this.manufacturerList = []
566
+          this.manufacturerList = response.data.data.manufacturerList
567
+          this.dealerList = []
568
+          this.dealerList = response.data.data.dealerList
569
+
430
         })
570
         })
431
       },changeManufacturer(val) {
571
       },changeManufacturer(val) {
432
         this.propForm.manufacturer = val
572
         this.propForm.manufacturer = val
476
       },
616
       },
477
       handleSelect(val){
617
       handleSelect(val){
478
         console.log("val",val)
618
         console.log("val",val)
619
+        //获取当前耗材的批号
620
+         this.getStockBatchNumber(val.id)
479
          for(let i=0;i<this.recordInfo.recordData.length;i++){
621
          for(let i=0;i<this.recordInfo.recordData.length;i++){
480
            if(this.currentIndex == i){
622
            if(this.currentIndex == i){
481
               this.recordInfo.recordData[i].good_type_id = val.id
623
               this.recordInfo.recordData[i].good_type_id = val.id
502
              
644
              
503
            }
645
            }
504
          }
646
          }
647
+      },
648
+     getStockBatchNumber(id){
649
+       var params = {
650
+         id:id
651
+       }
652
+      getStockBatchNumber(params).then(response=>{
653
+        if(response.data.state == 1){
654
+          var list = response.data.data.list
655
+          console.log("list2243444",list)
656
+          this.numberList = list
657
+        }
658
+      })
659
+     },
660
+     calculate: function(val) {
661
+      if (val == 0) {
662
+        return "";
505
       }
663
       }
664
+      return Math.round(parseFloat(val) * 100) / 100;
665
+     },
506
     },
666
     },
507
     created() {
667
     created() {
508
       this.GetConfigInfo()
668
       this.GetConfigInfo()

+ 199 - 37
src/xt_pages/stock/drugs/cancelDrugStockOrder.vue Ver arquivo

1
 <template>
1
 <template>
2
   <div class="main-contain">
2
   <div class="main-contain">
3
     <div class="position">
3
     <div class="position">
4
-      <!--<bread-crumb :crumbs="crumbs"></bread-crumb>-->
5
       <bread-crumb :crumbs="crumbs"></bread-crumb>
4
       <bread-crumb :crumbs="crumbs"></bread-crumb>
6
       <el-button
5
       <el-button
7
         size="small"
6
         size="small"
71
           @change="changeAllSelected"
70
           @change="changeAllSelected"
72
           >全选</el-checkbox
71
           >全选</el-checkbox
73
         >
72
         >
74
-        <el-button size="small" icon="el-icon-delete" @click="batchDelete"
75
-          >删除</el-button
76
-        >
73
+        <el-button size="small" icon="el-icon-delete" @click="batchDelete">删除</el-button>
74
+        <el-button size="small"  type="primary" @click="toPrint">打印</el-button>
75
+        <el-button size="small"  type="primary" @click="toExport">导出</el-button>
77
       </div>
76
       </div>
78
 
77
 
79
       <el-row :gutter="12" style="margin-top: 10px">
78
       <el-row :gutter="12" style="margin-top: 10px">
83
           border
82
           border
84
           highlight-current-row
83
           highlight-current-row
85
           ref="multipleTable"
84
           ref="multipleTable"
85
+          @current-change="handleCurrentChangeOne"
86
           @selection-change="select"
86
           @selection-change="select"
87
           :row-style="{ color: '#303133' }"
87
           :row-style="{ color: '#303133' }"
88
           :header-cell-style="{
88
           :header-cell-style="{
110
             </template>
110
             </template>
111
           </el-table-column>
111
           </el-table-column>
112
 
112
 
113
-          <el-table-column label="厂家" align="center">
114
-            <template slot-scope="scope">
115
-              {{ getManufactuerName(scope.row.manufacturer) }}
116
-            </template>
117
-          </el-table-column>
118
-
119
-          <el-table-column label="经销商" align="center">
120
-            <template slot-scope="scope">
121
-              {{ getDealerName(scope.row.dealer) }}
122
-            </template>
123
-          </el-table-column>
124
-
125
           <el-table-column label="操作" align="center">
113
           <el-table-column label="操作" align="center">
126
             <template slot-scope="scope">
114
             <template slot-scope="scope">
127
               <el-tooltip
115
               <el-tooltip
169
         </el-pagination>
157
         </el-pagination>
170
       </el-row>
158
       </el-row>
171
     </div>
159
     </div>
160
+
161
+    <div v-show ="showTable" style="margin-top:10px">
162
+       <el-table
163
+          :data="tableList"
164
+          :class="signAndWeighBoxPatients"
165
+          border
166
+          highlight-current-row
167
+          ref="multipleTableOne"
168
+          @current-change="handleCurrentChangeOne"
169
+          @selection-change="select"
170
+          :row-style="{ color: '#303133' }"
171
+          :header-cell-style="{
172
+            backgroundColor: 'rgb(245, 247, 250)',
173
+            color: '#606266'
174
+          }"
175
+        >
176
+
177
+          <el-table-column label="药品名称" align="center">
178
+            <template slot-scope="scope">
179
+              {{ scope.row.BaseDrugLib.drug_name}}
180
+            </template>
181
+          </el-table-column>
182
+          
183
+         <el-table-column label="规格&单位" align="center">
184
+            <template slot-scope="scope">
185
+              {{ scope.row.BaseDrugLib.dose}}{{scope.row.BaseDrugLib.dose_unit}} * {{scope.row.BaseDrugLib.min_number}}{{scope.row.BaseDrugLib.min_unit}} /{{scope.row.BaseDrugLib.max_unit}}
186
+            </template>
187
+          </el-table-column>
188
+         
189
+          <el-table-column label="退库数量" align="center">
190
+            <template slot-scope="scope">
191
+               {{ scope.row.count}}
192
+            </template>
193
+          </el-table-column>
194
+
195
+          <el-table-column label="退库单位" align="center">
196
+            <template slot-scope="scope">
197
+              {{ scope.row.max_unit}}
198
+            </template>
199
+          </el-table-column>
200
+
201
+          <el-table-column label="退库单价" align="center">
202
+            <template slot-scope="scope">
203
+              {{ scope.row.price}}
204
+            </template> 
205
+          </el-table-column>
206
+
207
+           <el-table-column label="批次" align="center">
208
+            <template slot-scope="scope">
209
+              {{ scope.row.batch_number}}
210
+            </template>
211
+          </el-table-column>
212
+
213
+          <el-table-column label="品名/注册证号(备案凭证号)" align="center">
214
+            <template slot-scope="scope">
215
+              {{ scope.row.register_account}}
216
+            </template>
217
+          </el-table-column>
218
+
219
+          <el-table-column label="生产厂家" align="center">
220
+            <template slot-scope="scope">
221
+              {{scope.row.manufacturer}}
222
+            </template>
223
+          </el-table-column>
224
+
225
+          <el-table-column label="生产日期" align="center">
226
+            <template slot-scope="scope">
227
+               {{scope.row.product_date}}
228
+            </template>
229
+          </el-table-column>
230
+
231
+         <el-table-column label="有效日期" align="center">
232
+            <template slot-scope="scope">
233
+              {{scope.row.expiry_date}}
234
+            </template>
235
+          </el-table-column>
236
+         
237
+          <el-table-column label="经销商" align="center">
238
+            <template slot-scope="scope">
239
+              {{scope.row.dealer}}
240
+            </template>
241
+          </el-table-column>
242
+         
243
+          <el-table-column label="退库原因" align="center">
244
+            <template slot-scope="scope">
245
+              {{scope.row.remark}}
246
+            </template>
247
+          </el-table-column>
248
+
249
+        
250
+        </el-table>
251
+    </div>
172
   </div>
252
   </div>
173
 </template>
253
 </template>
174
 
254
 
178
 import {
258
 import {
179
   deleteDrugCancelStock,
259
   deleteDrugCancelStock,
180
   GetAllConfig,
260
   GetAllConfig,
181
-  getDrugCancelStockList
261
+  getDrugCancelStockList,
262
+  getCancelStockDetail,
263
+  getDrugCancelExportList
182
 } from "@/api/drug/drug_stock";
264
 } from "@/api/drug/drug_stock";
183
 import BreadCrumb from '../../components/bread-crumb'
265
 import BreadCrumb from '../../components/bread-crumb'
184
 // import BreadCrumb from "../components/bread-crumb";
266
 // import BreadCrumb from "../components/bread-crumb";
208
       "-" +
290
       "-" +
209
       (nowDay < 10 ? "0" + nowDay : nowDay);
291
       (nowDay < 10 ? "0" + nowDay : nowDay);
210
    
292
    
211
-    // var date1 = new Date();
212
-    // var date2 = new Date(date1);
213
-
214
-    // //-30为30天前,+30可以获得30天后的日期
215
-    // date2.setDate(date1.getDate() - 30);
216
-
217
-    // //30天前(月份判断是否小于10,小于10的前面+0)
218
-    // var agoDay = `${date2.getFullYear()}-${date2.getMonth() + 1<10?`0${date2.getMonth() + 1}`:date2.getMonth() + 1}-${date2.getDate()}`;
219
-      
220
-    // //当前日期
221
-    // var nowDay = `${date1.getFullYear()}-${date1.getMonth() + 1<10?`0${date1.getMonth() + 1}`:date1.getMonth() + 1}-${date1.getDate()}`;
222
-
223
-    //  this.start_time = agoDay
224
-    //  console.log("333333332222",this.start_time)
225
     this.GetCancelStock();
293
     this.GetCancelStock();
226
     this.GetConfigInfo();
294
     this.GetConfigInfo();
227
     this.fetchAllAdminUsers();
295
     this.fetchAllAdminUsers();
250
       goodInfo: [],
318
       goodInfo: [],
251
       manufacturer: [],
319
       manufacturer: [],
252
       selectedTableData: [],
320
       selectedTableData: [],
253
-      dealer: []
321
+      dealer: [],
322
+      tableList:[],
323
+      showTable:false,
324
+      order_id:"",
325
+      exportList:[]
254
     };
326
     };
255
   },
327
   },
256
   methods: {
328
   methods: {
403
       }
475
       }
404
     },
476
     },
405
     handleEdit: function(index, row) {
477
     handleEdit: function(index, row) {
406
-      this.$router.push({
407
-        name: "cancelDrugStockDetail",
408
-        query: { id: row.id, type: this.type }
409
-      });
478
+    
479
+      this.$router.push({path:"/drugstock/cancel/edit?id="+row.id+"&type="+this.type})
410
     },
480
     },
411
     handleDelete: function(index, row) {
481
     handleDelete: function(index, row) {
412
       const ids = [];
482
       const ids = [];
454
       }
524
       }
455
     },
525
     },
456
     select(selection) {
526
     select(selection) {
527
+      var ids= []
528
+      for(let i=0;i<selection.length;i++){
529
+         ids.push(selection[i].id)
530
+      }
531
+      this.order_id =  ids.join(",")
457
       this.selectedTableData = selection;
532
       this.selectedTableData = selection;
533
+      this.getDrugCancelExportList()
458
     },
534
     },
459
     batchDelete() {
535
     batchDelete() {
460
       if (this.selectedTableData.length <= 0) {
536
       if (this.selectedTableData.length <= 0) {
498
           });
574
           });
499
         })
575
         })
500
         .catch(() => {});
576
         .catch(() => {});
501
-    }
577
+    },
578
+    handleCurrentChangeOne(val) {
579
+      this.getCancelStockDetail(val.id)
580
+    },
581
+    getCancelStockDetail(id){
582
+        var params = {
583
+          id:id
584
+        }
585
+      getCancelStockDetail(params).then(response=>{
586
+       if(response.data.state == 1){
587
+         var list =  response.data.data.list
588
+         for(let i=0;i<list.length;i++){
589
+           list[i].product_date = this.getTime(list[i].product_date,"{y}-{h}-{d}")
590
+           list[i].expiry_date = this.getTime(list[i].expiry_date,"{y}-{h}-{d}")
591
+         }
592
+         this.tableList = list
593
+         console.log("list23232",list)
594
+         this.showTable = true
595
+       }
596
+      })
597
+    },
598
+   getTime(val) {
599
+      if(val < 0){
600
+        return ""
601
+      }
602
+      if(val == ""){
603
+      return ""
604
+      }else {
605
+      return uParseTime(val, '{y}-{m}-{d}')
606
+      }
607
+    },
608
+    toPrint(){
609
+      if(this.order_id == ""){
610
+        this.$message.error("请勾选退库单")
611
+        return
612
+      }
613
+     this.$router.push({path:"/drug/cancel/print?order_id="+this.order_id+"&start_time="+this.start_time+"&end_time="+this.end_time})
614
+    },
615
+    getDrugCancelExportList(){
616
+      const params = {
617
+        order_id:this.order_id
618
+      }
619
+     getDrugCancelExportList(params).then(response=>{
620
+        if(response.data.state == 1){
621
+         var list = response.data.data.list
622
+         console.log("导出数据222",list)
623
+         this.exportList = list
624
+        }
625
+     })
626
+    },
627
+    toExport(){
628
+      if(this.order_id == ""){
629
+        this.$message.error("请勾选退库单")
630
+        return
631
+      }
632
+     import('@/vendor/Export2Excel').then(excel => {
633
+      console.log("23232323",this.exportList)
634
+      for(let i=0;i<this.exportList.length;i++){
635
+        this.exportList[i].total_price = this.exportList[i].count * this.exportList[i].price
636
+        this.exportList[i].drug_name = this.exportList[i].BaseDrugLib.drug_name
637
+        this.exportList[i].unit = this.exportList[i].BaseDrugLib.dose + this.exportList[i].BaseDrugLib.dose_unit + "*" + this.exportList[i].BaseDrugLib.min_number +this.exportList[i].BaseDrugLib.min_unit + "/" +this.exportList[i].BaseDrugLib.max_unit
638
+        if(this.exportList[i].dealer == 0){
639
+          this.exportList[i].dealer = ""
640
+        }
641
+        if(this.exportList[i].manufacturer == 0){
642
+          this.exportList[i].manufacturer = ""
643
+        }
644
+      
645
+        this.exportList[i].product_date = this.getTime(this.exportList[i].product_date,"{y}-{h}-{d}")
646
+        this.exportList[i].expiry_date = this.getTime(this.exportList[i].expiry_date,"{y}-{h}-{d}")
647
+      }
648
+      const tHeader = ['药品名称',  '规格&单位','退库数量','退库单价','批次','品名/注册证号(备案凭证号)','生产厂家','生产日期','有效期','退库原因']
649
+      const filterVal = ['drug_name', 'unit','count','price','batch_number','register_account','manufacturer','product_date','expiry_date','remark']
650
+      console.log("table",this.exportList)
651
+    
652
+      const data = this.formatJson(filterVal, this.exportList)
653
+      excel.export_json_to_excel({
654
+        header: tHeader,
655
+        data,
656
+        filename: '药品退库单详情'
657
+      })
658
+      this.downloadLoading = false
659
+     })
660
+    },
661
+    formatJson(filterVal, jsonData) {
662
+    return jsonData.map(v => filterVal.map(j => v[j]));
663
+   },
502
   }
664
   }
503
 };
665
 };
504
 </script>
666
 </script>

+ 250 - 55
src/xt_pages/stock/drugs/cancelDrugStockOrderAdd.vue Ver arquivo

26
 
26
 
27
     <div class="app-container">
27
     <div class="app-container">
28
 
28
 
29
-      <!--<stock-in-dialog-->
30
-        <!--ref="dialog"-->
31
-        <!--:propForm="propForm"-->
32
-        <!--:visibility="isVisibility"-->
33
-        <!--v-on:dialog-comfirm="comfirm"-->
34
-        <!--v-on:dialog-cancle="cancle"-->
35
-      <!--&gt;</stock-in-dialog>-->
36
       <drugs-stock-dialog
29
       <drugs-stock-dialog
37
         ref="dialog"
30
         ref="dialog"
38
         :propForm="propForm"
31
         :propForm="propForm"
61
           ></el-date-picker>
54
           ></el-date-picker>
62
         </div>
55
         </div>
63
 
56
 
64
-        <div class="cell clearfix">
57
+        <!-- <div class="cell clearfix">
65
           <label class="title"><span class="name">经销商</span> : </label>
58
           <label class="title"><span class="name">经销商</span> : </label>
66
           <el-select
59
           <el-select
67
             size="small"
60
             size="small"
78
             >
71
             >
79
             </el-option>
72
             </el-option>
80
           </el-select>
73
           </el-select>
81
-        </div>
74
+        </div> -->
82
 
75
 
83
-        <div class="cell clearfix">
76
+        <!-- <div class="cell clearfix">
84
           <label class="title"><span class="name">厂商</span> : </label>
77
           <label class="title"><span class="name">厂商</span> : </label>
85
           <el-select
78
           <el-select
86
             size="small"
79
             size="small"
97
             >
90
             >
98
             </el-option>
91
             </el-option>
99
           </el-select>
92
           </el-select>
100
-        </div>
93
+        </div> -->
101
       </div>
94
       </div>
102
 
95
 
103
       <el-form :rules="tableRules" :model="recordInfo" ref="tableForm">
96
       <el-form :rules="tableRules" :model="recordInfo" ref="tableForm">
109
           max-height="450"
102
           max-height="450"
110
           :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }"
103
           :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }"
111
         >
104
         >
112
-          <el-table-column min-width="35" align="center">
105
+          <el-table-column align="center" width="200">
113
             <template slot="header" slot-scope="scope">
106
             <template slot="header" slot-scope="scope">
114
-              <span>商品类型<span style="color: red">*</span></span>
107
+              <span>药品名称<span style="color: red">*</span></span>
115
             </template>
108
             </template>
116
 
109
 
117
             <template slot-scope="scope">
110
             <template slot-scope="scope">
118
-              <!--<span @click="showDialog(scope.$index, scope.row)" v-if="scope.row.good_type_id == 0" style="color:#c5c8cf">请输入类型</span>-->
119
-              <!--<span @click="showDialog(scope.$index, scope.row)" v-if="scope.row.good_type_id != 0">{{typeName(scope.row.good_type_id)}}</span>-->
120
-
121
-              <el-form-item style="padding-top: 15px">
111
+              <el-form-item style="padding-top: 20px">
112
+                  <el-autocomplete
113
+                    class="checkSearch"
114
+                    popper-class="my-autocomplete"
115
+                    v-model="scope.row.drug_name"
116
+                    :fetch-suggestions="querySearchAsync"
117
+                    :trigger-on-focus="true"
118
+                    placeholder="请输入药品名称"
119
+                    @select="handleSelect"
120
+                    @input="changeDrugName(scope.$index)"
121
+                    style="width:160px;"
122
+                  >
123
+                    <i class="el-icon-search el-input__icon" slot="suffix"></i>
124
+                  <template slot-scope="{ item }">
125
+                    <div class="name">{{ item.drug_name + item.dose + item.dose_unit + "*" +item.min_number + item.min_unit +"/" + item.max_unit + "  "+item.manufacturer}}</div>
126
+                  </template>
127
+                 </el-autocomplete>
128
+              </el-form-item>
129
+            </template>
130
+          </el-table-column>
131
+          <el-table-column align="center" width="140">
132
+            <template slot="header" slot-scope="scope">
133
+              <span>规格&单位</span>
134
+            </template>
135
+            <template slot-scope="scope">
136
+              <el-form-item style="padding-top: 20px">
122
                 <el-input
137
                 <el-input
123
-                  placeholder="请输入药品名称"
124
-                  v-model="scope.row.drug_id"
125
-                  :value="typeName(scope.row.drug_id)"
126
-                  @focus="showDialog(scope.$index, scope.row)"
138
+                  :disabled="true"
139
+                  placeholder="请输入规格&单位"
140
+                  v-model="scope.row.name"
127
                 ></el-input>
141
                 ></el-input>
128
               </el-form-item>
142
               </el-form-item>
129
             </template>
143
             </template>
130
           </el-table-column>
144
           </el-table-column>
131
-          <el-table-column min-width="35" align="center">
145
+
146
+          <el-table-column width="200" align="center">
132
             <template slot="header" slot-scope="scope">
147
             <template slot="header" slot-scope="scope">
133
-              <span>规格名称<span style="color: red">*</span></span>
148
+              <span>退库数量<span style="color: red">*</span></span>
134
             </template>
149
             </template>
135
             <template slot-scope="scope">
150
             <template slot-scope="scope">
136
-              <el-form-item style="padding-top: 15px">
151
+              <el-form-item
152
+                :prop="'recordData.' + scope.$index + '.return_count'"
153
+                :rules="tableRules.return_count"
154
+                style="padding-top: 17px"
155
+              >
156
+              <div style="display:flex;">
137
                 <el-input
157
                 <el-input
138
-                  placeholder="请输入规格名称"
139
-                  v-model="scope.row.drug_id"
140
-                  :value="specificationName(scope.row.drug_id)"
141
-                  @focus="showDialog(scope.$index, scope.row)"
158
+                  style="width:100px"
159
+                  placeholder="请输入退库数量"
160
+                  type="number"
161
+                  v-model="scope.row.return_count"
142
                 ></el-input>
162
                 ></el-input>
163
+                 <el-select v-model="scope.row.max_unit" filterable placeholder="请选择单位" style="width:80px">
164
+                    <el-option
165
+                      v-for="(option, index) in unitList"
166
+                      :key="index"
167
+                      :label="option.name"
168
+                      :value="option.name">
169
+                    </el-option>
170
+                  </el-select>
171
+                </div>
143
               </el-form-item>
172
               </el-form-item>
144
             </template>
173
             </template>
145
           </el-table-column>
174
           </el-table-column>
146
 
175
 
147
-          <el-table-column align="center" width="150">
176
+         <el-table-column align="center" width="150">
148
             <template slot="header" slot-scope="scope">
177
             <template slot="header" slot-scope="scope">
149
-              <span>进价<span style="color: red">*</span></span>
178
+              <span>退库单价<span style="color: red">*</span></span>
150
             </template>
179
             </template>
151
             <template slot-scope="scope">
180
             <template slot-scope="scope">
152
-              <!--<el-input type="number" v-model="scope.row.price"  @blur="handleBlur(scope.$index, scope.row)"></el-input>-->
153
               <el-form-item
181
               <el-form-item
154
                 :prop="'recordData.' + scope.$index + '.price'"
182
                 :prop="'recordData.' + scope.$index + '.price'"
155
                 :rules="tableRules.price"
183
                 :rules="tableRules.price"
164
             </template>
192
             </template>
165
           </el-table-column>
193
           </el-table-column>
166
 
194
 
195
+          <el-table-column label="总价" align="center" width="150">
196
+            <template slot-scope="scope">
197
+              {{ calculate(scope.row.price * scope.row.return_count) }}
198
+            </template>
199
+          </el-table-column>
167
 
200
 
168
-          <el-table-column min-width="23" align="center">
201
+          <el-table-column width="200" align="center">
169
             <template slot="header" slot-scope="scope">
202
             <template slot="header" slot-scope="scope">
170
-              <span>退库数量<span style="color: red">*</span></span>
203
+              <span>批次<span style="color: red"></span></span>
171
             </template>
204
             </template>
172
             <template slot-scope="scope">
205
             <template slot-scope="scope">
173
               <el-form-item
206
               <el-form-item
174
                 :prop="'recordData.' + scope.$index + '.return_count'"
207
                 :prop="'recordData.' + scope.$index + '.return_count'"
175
-                :rules="tableRules.return_count"
176
                 style="padding-top: 17px"
208
                 style="padding-top: 17px"
177
               >
209
               >
178
-                <el-input
179
-                  placeholder="请输入退库数量"
180
-                  type="number"
181
-                  v-model="scope.row.return_count"
182
-                ></el-input>
210
+               <el-select v-model="scope.row.batch_number" filterable placeholder="请选择">
211
+                  <el-option
212
+                    v-for="(item,index) in numberList"
213
+                    :key="index"
214
+                    :label="item.batch_number"
215
+                    :value="item.batch_number">
216
+                  </el-option>
217
+              </el-select>
183
               </el-form-item>
218
               </el-form-item>
184
             </template>
219
             </template>
185
           </el-table-column>
220
           </el-table-column>
186
 
221
 
187
-          <el-table-column label="进价总价" align="center" width="150">
222
+           <el-table-column width="200" align="center">
223
+            <template slot="header" slot-scope="scope">
224
+              <span>品名/注册证号(备案凭证号)<span style="color: red"></span></span>
225
+            </template>
188
             <template slot-scope="scope">
226
             <template slot-scope="scope">
189
-              {{ calculate(scope.row.price * scope.row.return_count) }}
227
+              <el-form-item
228
+                :prop="'recordData.' + scope.$index + '.register_account'"
229
+                style="padding-top: 17px"
230
+              >
231
+              <el-input v-model="scope.row.register_account"></el-input>
232
+              </el-form-item>
190
             </template>
233
             </template>
191
           </el-table-column>
234
           </el-table-column>
235
+           <el-table-column label="生产厂家" width="160" align="center">
236
+            <template slot-scope="scope">
237
+               <el-select v-model="scope.row.manufacturer" filterable placeholder="请选择厂商">
238
+                <el-option
239
+                  v-for="(option, index) in manufacturerList"
240
+                  :key="index"
241
+                  :label="option.manufacturer_name"
242
+                  :value="option.manufacturer_name">
243
+                </el-option>
244
+               </el-select>
245
+            </template>
246
+          </el-table-column>
247
+ 
192
 
248
 
193
-
194
-          <el-table-column label="零价" align="center" width="150">
249
+          <el-table-column label="生产日期" width="180" align="center">
250
+            <template slot-scope="scope">
251
+              <el-date-picker
252
+                prefix-icon="el-icon-date"
253
+                style="width: 145px"
254
+                v-model="scope.row.product_date"
255
+                type="date"
256
+                placeholder="选择日期时间"
257
+                format="yyyy-MM-dd"
258
+                value-format="yyyy-MM-dd"
259
+              ></el-date-picker>
260
+            </template>
261
+          </el-table-column>
262
+          <el-table-column label="有效日期" width="180" align="center">
195
             <template slot-scope="scope">
263
             <template slot-scope="scope">
196
-              {{ scope.row.retail_price }}
264
+              <el-date-picker
265
+                prefix-icon="el-icon-date"
266
+                style="width: 145px"
267
+                v-model="scope.row.expiry_date"
268
+                type="date"
269
+                placeholder="选择日期时间"
270
+                format="yyyy-MM-dd"
271
+                value-format="yyyy-MM-dd"
272
+              ></el-date-picker>
197
             </template>
273
             </template>
198
           </el-table-column>
274
           </el-table-column>
199
 
275
 
200
-          <el-table-column label="零价总价" align="center" width="150">
276
+
277
+        <el-table-column label="经销商" width="160" align="center">
201
             <template slot-scope="scope">
278
             <template slot-scope="scope">
202
-              {{ calculate(scope.row.retail_price * scope.row.return_count) }}
279
+                <el-select v-model="scope.row.dealer" filterable placeholder="请选择厂商">
280
+                <el-option
281
+                  v-for="(option, index) in dealerList"
282
+                  :key="index"
283
+                  :label="option.dealer_name"
284
+                  :value="option.dealer_name">
285
+                </el-option>
286
+                </el-select>
203
             </template>
287
             </template>
204
           </el-table-column>
288
           </el-table-column>
205
-          <el-table-column label="操作" align="center" min-width="20">
289
+          <el-table-column width="200" align="center">
290
+            <template slot="header" slot-scope="scope">
291
+              <span>退库原因<span style="color: red"></span></span>
292
+            </template>
293
+            <template slot-scope="scope">
294
+              <el-form-item
295
+                :prop="'recordData.' + scope.$index + '.remark'"
296
+                style="padding-top: 17px"
297
+              >
298
+              <el-input v-model="scope.row.remark"></el-input>
299
+              </el-form-item>
300
+            </template>
301
+          </el-table-column>
302
+          <el-table-column label="操作" align="center" width="200" fixed="right">
206
             <template slot-scope="scope">
303
             <template slot-scope="scope">
207
               <el-tooltip
304
               <el-tooltip
208
                 class="item"
305
                 class="item"
242
 
339
 
243
 <script>
340
 <script>
244
 import { uParseTime } from "@/utils/tools";
341
 import { uParseTime } from "@/utils/tools";
245
-import {  postDrugCancelStock,GetAllConfig,GetAllDrugInfoByID } from "@/api/drug/drug_stock";
342
+import {  postDrugCancelStock,GetAllConfig,GetAllDrugInfoByID,getDrugBatchNumber } from "@/api/drug/drug_stock";
246
 import BreadCrumb from "../../components/bread-crumb";
343
 import BreadCrumb from "../../components/bread-crumb";
247
 import DrugsStockDialog from './drugsStockDialog/index'
344
 import DrugsStockDialog from './drugsStockDialog/index'
248
-
345
+import {postSearchDrugList } from "@/api/data"
346
+import { getDataConfig } from "@/utils/data";
249
 export default {
347
 export default {
250
   components: { DrugsStockDialog, BreadCrumb },
348
   components: { DrugsStockDialog, BreadCrumb },
251
   name: "salesReturnOrderAdd",
349
   name: "salesReturnOrderAdd",
299
       dealer: [],
397
       dealer: [],
300
       goodType: [],
398
       goodType: [],
301
       goodInfo:[],
399
       goodInfo:[],
400
+      dealerList:[],
401
+      manufacturerList:[],
402
+      numberList:[],
403
+      unitList:[]
302
     };
404
     };
303
   },
405
   },
304
   methods: {
406
   methods: {
389
       tempObj["return_count"] = "";
491
       tempObj["return_count"] = "";
390
       tempObj["price"] = "";
492
       tempObj["price"] = "";
391
       tempObj["retail_price"] = "";
493
       tempObj["retail_price"] = "";
392
-
494
+      tempObj["register_account"] = ""
495
+      tempObj["dealer"] = ""
496
+      tempObj["manufacturer"] =""
497
+      tempObj["remark"] = ""
498
+      tempObj["product_date"] = ""
499
+      tempObj["expiry_date"] = ""
500
+      tempObj["batch_number"] = ""
393
       this.recordInfo.recordData.push(tempObj);
501
       this.recordInfo.recordData.push(tempObj);
394
     },
502
     },
395
     handleDelete: function(index, row) {
503
     handleDelete: function(index, row) {
522
     },
630
     },
523
     changeDealer(val) {
631
     changeDealer(val) {
524
       this.propForm.dealer = val;
632
       this.propForm.dealer = val;
525
-    }
633
+    },
634
+    querySearchAsync(keyword, cb) {
635
+        let key = '';
636
+        if (keyword != undefined) {
637
+          key = keyword
638
+        }
639
+        let searchArray = [];
640
+        postSearchDrugList(key).then(response => {
641
+          if (response.data.state == 1) {
642
+            searchArray = response.data.data.list;
643
+            
644
+             var list = response.data.data.list
645
+             console.log("猎豹22222222222",list)
646
+
647
+             this.drugList = list
648
+             var manufacturerList = response.data.data.manufacturerList
649
+             this.manufacturerList = manufacturerList
650
+             var dealerList = response.data.data.dealerList
651
+             this.dealerList = dealerList
652
+             for(let i=0;i<this.drugList.length;i++){
653
+             
654
+                for(let j=0;j<this.manufacturerList.length;j++){
655
+                  if(this.drugList[i].manufacturer == this.manufacturerList[j].id){
656
+                     this.drugList[i].manufacturer = this.manufacturerList[j].manufacturer_name
657
+                  }
658
+                }
659
+               
660
+
661
+                for(let z=0;z<dealerList.length;z++){
662
+                  if(this.drugList[i].dealer == this.dealerList[z].id){
663
+                      this.drugList[i].dealer = this.dealerList[z].dealer_name
664
+                  }
665
+               
666
+                }
667
+             }
668
+             cb(this.drugList)
669
+          } else {
670
+            cb([])
671
+          }
672
+        })
673
+      },
674
+      changeDrugName(val){
675
+        this.currentIndex = val
676
+      },
677
+      handleSelect(val){
678
+         this.getDrugBatchNumber(val.id)
679
+         for(let i=0;i<this.recordInfo.recordData.length;i++){
680
+           if(i == this.currentIndex){
681
+             this.recordInfo.recordData[i].drug_id  = val.id
682
+             this.recordInfo.recordData[i].drug_name = val.drug_name
683
+             this.recordInfo.recordData[i].drug_type = val.drug_type
684
+             this.recordInfo.recordData[i].name  = val.dose +val.dose_unit+"*"+val.min_number+ val.min_unit+"/"+val.max_unit
685
+             this.recordInfo.recordData[i].last_price = val.last_price
686
+             this.recordInfo.recordData[i].manufacturer =  val.manufacturer
687
+             this.recordInfo.recordData[i].number =  val.number
688
+             this.recordInfo.recordData[i].max_unit = val.max_unit
689
+             this.recordInfo.recordData[i].min_unit = val.min_unit
690
+             if(val.dealer == 0){
691
+               this.recordInfo.recordData[i].dealer = ""
692
+             }else{
693
+               this.recordInfo.recordData[i].dealer = val.dealer
694
+             }
695
+            
696
+           }
697
+        }
698
+        console.log("333333",this.recordInfo.recordData)
699
+      },
700
+      getDrugBatchNumber(id){
701
+          var params = {
702
+            id:id
703
+          }
704
+        getDrugBatchNumber(params).then(response=>{
705
+           if(response.data.state == 1){
706
+             var list = response.data.data.list
707
+             console.log("list2222",list)
708
+             this.numberList = list
709
+           }
710
+        })
711
+      },
712
+      getDataConfig(module, filed_name){
713
+       return getDataConfig(module, filed_name)
714
+      },
526
   },
715
   },
527
   created() {
716
   created() {
528
     var nowDate = new Date();
717
     var nowDate = new Date();
537
       (nowDay < 10 ? "0" + nowDay : nowDay);
726
       (nowDay < 10 ? "0" + nowDay : nowDay);
538
 
727
 
539
     const tempObj = {};
728
     const tempObj = {};
540
-    tempObj["good_type_id"] = 0;
541
-    tempObj["good_id"] = 0;
729
+    tempObj["drug_id"] = 0;
542
     tempObj["return_count"] = "";
730
     tempObj["return_count"] = "";
543
     tempObj["price"] = "";
731
     tempObj["price"] = "";
544
     tempObj["retail_price"] = "";
732
     tempObj["retail_price"] = "";
545
-
546
-
733
+    tempObj["register_account"] = ""
734
+    tempObj["dealer"] = ""
735
+    tempObj["manufacturer"] =""
736
+    tempObj["remark"] = ""
737
+    tempObj["product_date"] = ""
738
+    tempObj["expiry_date"] = ""
739
+    tempObj["batch_number"] = ""
740
+    this.unitList =  getDataConfig('hemodialysis','units')
741
+    console.log("单位",this.unitList)
547
     this.recordInfo.recordData.push(tempObj);
742
     this.recordInfo.recordData.push(tempObj);
548
     this.GetConfigInfo();
743
     this.GetConfigInfo();
549
     this.propForm.goodUnit = this.$store.getters.good_unit;
744
     this.propForm.goodUnit = this.$store.getters.good_unit;

+ 259 - 81
src/xt_pages/stock/drugs/cancelDrugStockOrderEdit.vue Ver arquivo

9
       </div>
9
       </div>
10
     </div>
10
     </div>
11
     <div class="app-container">
11
     <div class="app-container">
12
-      <!--<stock-in-dialog-->
13
-        <!--ref="dialog" :propForm="propForm"-->
14
-        <!--:visibility="isVisibility"-->
15
-        <!--v-on:dialog-comfirm="comfirm"-->
16
-        <!--v-on:dialog-cancle="cancle"-->
17
-      <!--&gt;</stock-in-dialog>-->
12
+    
18
       <drugs-stock-dialog
13
       <drugs-stock-dialog
19
         ref="dialog" :propForm="propForm"
14
         ref="dialog" :propForm="propForm"
20
         :visibility="isVisibility"
15
         :visibility="isVisibility"
30
                         value-format="yyyy-MM-dd"></el-date-picker>
25
                         value-format="yyyy-MM-dd"></el-date-picker>
31
       </div>
26
       </div>
32
 
27
 
33
-      <div class="cell clearfix">
34
-        <label class="title"><span class="name">经销商</span> : </label>
35
-        <el-select   size="small"  v-model="form.dealer" clearable  placeholder="请选择经销商"  @change="changeDealer">
36
-          <el-option
37
-            v-for="(option, index) in dealer"
38
-            :key="index"
39
-            :label="option.dealer_name"
40
-            :value="option.id">
41
-          </el-option>
42
-        </el-select>
43
-      </div>
44
-
45
-      <div class="cell clearfix">
46
-        <label class="title"><span class="name">厂商</span> : </label>
47
-        <el-select  size="small"   v-model="form.manufacturer" clearable  placeholder="请选择厂商" @change="changeManufacturer">
48
-          <el-option
49
-            v-for="(option, index) in manufacturer"
50
-            :key="index"
51
-            :label="option.manufacturer_name"
52
-            :value="option.id">
53
-          </el-option>
54
-        </el-select>
55
-      </div>
56
-
57
-
58
-
59
-
60
-
61
-
62
       <el-form :rules="tableRules" :model="recordInfo" ref="tableForm">
28
       <el-form :rules="tableRules" :model="recordInfo" ref="tableForm">
63
-        <el-table :data="recordInfo.recordData" :class="signAndWeighBoxPatients" style="width: 100%" border
64
-                  max-height="450" :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
29
+        <el-table :data="recordInfo.recordData" :class="signAndWeighBoxPatients" style="width: 100%" border  max-height="450" :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
65
         >
30
         >
66
-
67
-
68
-          <el-table-column min-width="35" align="center">
69
-
31
+             <el-table-column align="center" width="200">
70
             <template slot="header" slot-scope="scope">
32
             <template slot="header" slot-scope="scope">
71
-              <span>商品类型<span style="color: red">*</span></span>
33
+              <span>药品名称<span style="color: red">*</span></span>
72
             </template>
34
             </template>
73
 
35
 
74
             <template slot-scope="scope">
36
             <template slot-scope="scope">
75
-              <el-form-item style="padding-top: 15px">
76
-                <el-input placeholder="请输入药品类型" v-model="scope.row.drug_id"
77
-                          :value="typeName(scope.row.drug_id)"
78
-                          @focus="showDialog(scope.$index, scope.row)"></el-input>
37
+              <el-form-item style="padding-top: 20px">
38
+                  <el-autocomplete
39
+                    class="checkSearch"
40
+                    popper-class="my-autocomplete"
41
+                    v-model="scope.row.drug_name"
42
+                    :fetch-suggestions="querySearchAsync"
43
+                    :trigger-on-focus="true"
44
+                    placeholder="请输入药品名称"
45
+                    @select="handleSelect"
46
+                    @input="changeDrugName(scope.$index)"
47
+                    style="width:160px;"
48
+                  >
49
+                    <i class="el-icon-search el-input__icon" slot="suffix"></i>
50
+                  <template slot-scope="{ item }">
51
+                    <div class="name">{{ item.drug_name + item.dose + item.dose_unit + "*" +item.min_number + item.min_unit +"/" + item.max_unit + "  "+item.manufacturer}}</div>
52
+                  </template>
53
+                 </el-autocomplete>
79
               </el-form-item>
54
               </el-form-item>
80
             </template>
55
             </template>
81
           </el-table-column>
56
           </el-table-column>
82
-          <el-table-column min-width="35" align="center">
57
+          <el-table-column align="center" width="140">
83
             <template slot="header" slot-scope="scope">
58
             <template slot="header" slot-scope="scope">
84
-              <span>规格名称<span style="color: red">*</span></span>
59
+              <span>规格&单位</span>
85
             </template>
60
             </template>
86
             <template slot-scope="scope">
61
             <template slot-scope="scope">
87
-
88
-              <el-form-item style="padding-top: 15px">
89
-                <el-input placeholder="请输入药品规格名称" v-model="scope.row.drug_id"
90
-                          :value="specificationName(scope.row.drug_id)"
91
-                          @focus="showDialog(scope.$index, scope.row)"></el-input>
62
+              <el-form-item style="padding-top: 20px">
63
+                <el-input
64
+                  :disabled="true"
65
+                  placeholder="请输入规格&单位"
66
+                  v-model="scope.row.name"
67
+                ></el-input>
92
               </el-form-item>
68
               </el-form-item>
69
+            </template>
70
+          </el-table-column>
93
 
71
 
72
+          <el-table-column width="200" align="center">
73
+            <template slot="header" slot-scope="scope">
74
+              <span>退库数量<span style="color: red">*</span></span>
75
+            </template>
76
+            <template slot-scope="scope">
77
+              <el-form-item
78
+                :prop="'recordData.' + scope.$index + '.count'"
79
+                :rules="tableRules.count"
80
+                style="padding-top: 17px"
81
+              >
82
+              <div style="display:flex;">
83
+                <el-input
84
+                  style="width:100px"
85
+                  placeholder="请输入退库数量"
86
+                  type="number"
87
+                  v-model="scope.row.count"
88
+                ></el-input>
89
+                 <el-select v-model="scope.row.max_unit" filterable placeholder="请选择单位" style="width:80px">
90
+                    <el-option
91
+                      v-for="(option, index) in unitList"
92
+                      :key="index"
93
+                      :label="option.name"
94
+                      :value="option.name">
95
+                    </el-option>
96
+                  </el-select>
97
+                </div>
98
+              </el-form-item>
94
             </template>
99
             </template>
95
           </el-table-column>
100
           </el-table-column>
96
 
101
 
97
-          <el-table-column align="center" width="150">
102
+         <el-table-column align="center" width="150">
98
             <template slot="header" slot-scope="scope">
103
             <template slot="header" slot-scope="scope">
99
-              <span>进价<span style="color: red">*</span></span>
104
+              <span>退库单价<span style="color: red">*</span></span>
100
             </template>
105
             </template>
101
             <template slot-scope="scope">
106
             <template slot-scope="scope">
102
-              <!--<el-input type="number" v-model="scope.row.price"  @blur="handleBlur(scope.$index, scope.row)"></el-input>-->
103
               <el-form-item
107
               <el-form-item
104
                 :prop="'recordData.' + scope.$index + '.price'"
108
                 :prop="'recordData.' + scope.$index + '.price'"
105
                 :rules="tableRules.price"
109
                 :rules="tableRules.price"
114
             </template>
118
             </template>
115
           </el-table-column>
119
           </el-table-column>
116
 
120
 
121
+          <el-table-column label="总价" align="center" width="150">
122
+            <template slot-scope="scope">
123
+              {{ calculate(scope.row.price * scope.row.count) }}
124
+            </template>
125
+          </el-table-column>
117
 
126
 
118
-          <el-table-column min-width="23" align="center">
127
+          <el-table-column width="200" align="center">
119
             <template slot="header" slot-scope="scope">
128
             <template slot="header" slot-scope="scope">
120
-              <span>退库数量<span style="color: red">*</span></span>
129
+              <span>批次<span style="color: red"></span></span>
121
             </template>
130
             </template>
122
             <template slot-scope="scope">
131
             <template slot-scope="scope">
123
-              <el-form-item :prop="'recordData.' + scope.$index + '.count'" :rules='tableRules.count'
124
-                            style="padding-top: 17px">
125
-                <el-input type="number" v-model="scope.row.count"></el-input>
132
+              <el-form-item
133
+                :prop="'recordData.' + scope.$index + '.return_count'"
134
+                style="padding-top: 17px"
135
+              >
136
+               <el-select v-model="scope.row.batch_number" filterable placeholder="请选择">
137
+                  <el-option
138
+                    v-for="(item,index) in numberList"
139
+                    :key="index"
140
+                    :label="item.batch_number"
141
+                    :value="item.batch_number">
142
+                  </el-option>
143
+              </el-select>
126
               </el-form-item>
144
               </el-form-item>
127
             </template>
145
             </template>
128
           </el-table-column>
146
           </el-table-column>
129
 
147
 
130
-          <el-table-column label="进价总价" align="center" width="150">
148
+           <el-table-column width="200" align="center">
149
+            <template slot="header" slot-scope="scope">
150
+              <span>品名/注册证号(备案凭证号)<span style="color: red"></span></span>
151
+            </template>
131
             <template slot-scope="scope">
152
             <template slot-scope="scope">
132
-              {{ calculate(scope.row.price * scope.row.count) }}
153
+              <el-form-item
154
+                :prop="'recordData.' + scope.$index + '.register_account'"
155
+                style="padding-top: 17px"
156
+              >
157
+              <el-input v-model="scope.row.register_account"></el-input>
158
+              </el-form-item>
133
             </template>
159
             </template>
134
           </el-table-column>
160
           </el-table-column>
135
-
136
-
137
-          <el-table-column label="零价" align="center" width="150">
161
+           <el-table-column label="生产厂家" width="160" align="center">
138
             <template slot-scope="scope">
162
             <template slot-scope="scope">
139
-              {{ scope.row.retail_price }}
163
+               <el-select v-model="scope.row.manufacturer" filterable placeholder="请选择厂商">
164
+                <el-option
165
+                  v-for="(option, index) in manufacturerList"
166
+                  :key="index"
167
+                  :label="option.manufacturer_name"
168
+                  :value="option.manufacturer_name">
169
+                </el-option>
170
+               </el-select>
140
             </template>
171
             </template>
141
           </el-table-column>
172
           </el-table-column>
173
+ 
142
 
174
 
143
-          <el-table-column label="零价总价" align="center" width="150">
175
+          <el-table-column label="生产日期" width="180" align="center">
144
             <template slot-scope="scope">
176
             <template slot-scope="scope">
145
-              {{ calculate(scope.row.retail_price * scope.row.count) }}
177
+              <el-date-picker
178
+                prefix-icon="el-icon-date"
179
+                style="width: 145px"
180
+                v-model="scope.row.product_date"
181
+                type="date"
182
+                placeholder="选择日期时间"
183
+                format="yyyy-MM-dd"
184
+                value-format="yyyy-MM-dd"
185
+              ></el-date-picker>
146
             </template>
186
             </template>
147
           </el-table-column>
187
           </el-table-column>
148
-
149
-          <el-table-column label="操作" align="center" min-width="20">
188
+          <el-table-column label="有效日期" width="180" align="center">
150
             <template slot-scope="scope">
189
             <template slot-scope="scope">
151
-              <el-tooltip class="item" effect="dark" content="新增" placement="top">
190
+              <el-date-picker
191
+                prefix-icon="el-icon-date"
192
+                style="width: 145px"
193
+                v-model="scope.row.expiry_date"
194
+                type="date"
195
+                placeholder="选择日期时间"
196
+                format="yyyy-MM-dd"
197
+                value-format="yyyy-MM-dd"
198
+              ></el-date-picker>
199
+            </template>
200
+          </el-table-column>
152
 
201
 
202
+
203
+        <el-table-column label="经销商" width="160" align="center">
204
+            <template slot-scope="scope">
205
+                <el-select v-model="scope.row.dealer" filterable placeholder="请选择厂商">
206
+                <el-option
207
+                  v-for="(option, index) in dealerList"
208
+                  :key="index"
209
+                  :label="option.dealer_name"
210
+                  :value="option.dealer_name">
211
+                </el-option>
212
+                </el-select>
213
+            </template>
214
+          </el-table-column>
215
+          <el-table-column width="200" align="center">
216
+            <template slot="header" slot-scope="scope">
217
+              <span>退库原因<span style="color: red"></span></span>
218
+            </template>
219
+            <template slot-scope="scope">
220
+              <el-form-item
221
+                :prop="'recordData.' + scope.$index + '.remark'"
222
+                style="padding-top: 17px"
223
+              >
224
+              <el-input v-model="scope.row.remark"></el-input>
225
+              </el-form-item>
226
+            </template>
227
+          </el-table-column>
228
+          <el-table-column label="操作" align="center" width="200" fixed="right">
229
+            <template slot-scope="scope">
230
+              <el-tooltip
231
+                class="item"
232
+                effect="dark"
233
+                content="新增"
234
+                placement="top"
235
+              >
153
                 <el-button
236
                 <el-button
154
                   size="mini"
237
                   size="mini"
155
                   type="primary"
238
                   type="primary"
156
                   icon="el-icon-circle-plus-outline"
239
                   icon="el-icon-circle-plus-outline"
157
-                  @click="handleEdit(scope.$index, scope.row)">
240
+                  @click="handleEdit(scope.$index, scope.row)"
241
+                >
158
                 </el-button>
242
                 </el-button>
159
               </el-tooltip>
243
               </el-tooltip>
160
-              <el-tooltip class="item" effect="dark" content="删除" placement="top">
161
-
244
+              <el-tooltip
245
+                class="item"
246
+                effect="dark"
247
+                content="删除"
248
+                placement="top"
249
+              >
162
                 <el-button
250
                 <el-button
163
                   size="mini"
251
                   size="mini"
164
                   type="danger"
252
                   type="danger"
165
                   icon="el-icon-delete"
253
                   icon="el-icon-delete"
166
-                  @click="handleDelete(scope.$index, scope.row)">
254
+                  @click="handleDelete(scope.$index, scope.row)"
255
+                >
167
                 </el-button>
256
                 </el-button>
168
               </el-tooltip>
257
               </el-tooltip>
169
-
170
             </template>
258
             </template>
171
           </el-table-column>
259
           </el-table-column>
172
 
260
 
173
-
174
         </el-table>
261
         </el-table>
175
       </el-form>
262
       </el-form>
176
 
263
 
182
 <script>
269
 <script>
183
   import { uParseTime } from '@/utils/tools'
270
   import { uParseTime } from '@/utils/tools'
184
 
271
 
185
-  import { deleteDrugCancelStockInfo, editDrugCancelStockInfo, getDrugCancelStockConfig, getDrugCancelStockInfo,GetAllDrugInfoByID,GetAllConfig  } from '@/api/drug/drug_stock'
272
+  import { deleteDrugCancelStockInfo, editDrugCancelStockInfo, getDrugCancelStockConfig, getDrugCancelStockInfo,GetAllDrugInfoByID,GetAllConfig,getDrugBatchNumber  } from '@/api/drug/drug_stock'
186
   import BreadCrumb from '../../components/bread-crumb'
273
   import BreadCrumb from '../../components/bread-crumb'
187
   import DrugsStockDialog from './drugsStockDialog/index'
274
   import DrugsStockDialog from './drugsStockDialog/index'
188
-
275
+  import {postSearchDrugList} from "@/api/data"
189
   export default {
276
   export default {
190
     components: { DrugsStockDialog, BreadCrumb },
277
     components: { DrugsStockDialog, BreadCrumb },
191
     name: 'cancelStockOrderEdit',
278
     name: 'cancelStockOrderEdit',
250
         dealer: [],
337
         dealer: [],
251
         goodType: [],
338
         goodType: [],
252
         goodInfo:[],
339
         goodInfo:[],
340
+        manufacturerList:[],
341
+        dealerList:[],
342
+        numberList:[],
343
+        unitList:[],
253
       }
344
       }
254
     },
345
     },
255
     methods: {
346
     methods: {
465
             this.$message.error(response.data.msg)
556
             this.$message.error(response.data.msg)
466
             return false
557
             return false
467
           } else {
558
           } else {
559
+            console.log("list232323",response.data.data.list)
468
             for (let i = 0; i < response.data.data.list.length; i++) {
560
             for (let i = 0; i < response.data.data.list.length; i++) {
469
               response.data.data.list[i].count = response.data.data.list[i].count.toString()
561
               response.data.data.list[i].count = response.data.data.list[i].count.toString()
470
               response.data.data.list[i].price = response.data.data.list[i].price.toString()
562
               response.data.data.list[i].price = response.data.data.list[i].price.toString()
471
               response.data.data.list[i].retail_price = response.data.data.list[i].retail_price.toString()
563
               response.data.data.list[i].retail_price = response.data.data.list[i].retail_price.toString()
564
+              response.data.data.list[i].product_date = this.getTime(response.data.data.list[i].product_date)
565
+              response.data.data.list[i].expiry_date = this.getTime(response.data.data.list[i].expiry_date)
566
+              response.data.data.list[i].drug_name = response.data.data.list[i].drug.drug_name
567
+              response.data.data.list[i].name =  response.data.data.list[i].drug.dose +''+response.data.data.list[i].drug.dose_unit+"*"+response.data.data.list[i].drug.min_number+response.data.data.list[i].drug.min_unit+"/"+response.data.data.list[i].drug.max_unit
568
+
472
               this.recordInfo.recordData.push(response.data.data.list[i])
569
               this.recordInfo.recordData.push(response.data.data.list[i])
473
             }
570
             }
474
             this.cancelStock = response.data.data.info
571
             this.cancelStock = response.data.data.info
490
         this.propForm.manufacturer = val
587
         this.propForm.manufacturer = val
491
       },changeDealer(val){
588
       },changeDealer(val){
492
         this.propForm.dealer = val
589
         this.propForm.dealer = val
493
-      }
590
+      },
591
+       querySearchAsync(keyword, cb) {
592
+        let key = '';
593
+        if (keyword != undefined) {
594
+          key = keyword
595
+        }
596
+        let searchArray = [];
597
+        postSearchDrugList(key).then(response => {
598
+          if (response.data.state == 1) {
599
+            searchArray = response.data.data.list;
600
+            
601
+             var list = response.data.data.list
602
+             console.log("猎豹22222222222",list)
603
+
604
+             this.drugList = list
605
+             var manufacturerList = response.data.data.manufacturerList
606
+             this.manufacturerList = manufacturerList
607
+             var dealerList = response.data.data.dealerList
608
+             this.dealerList = dealerList
609
+             for(let i=0;i<this.drugList.length;i++){
610
+             
611
+                for(let j=0;j<this.manufacturerList.length;j++){
612
+                  if(this.drugList[i].manufacturer == this.manufacturerList[j].id){
613
+                     this.drugList[i].manufacturer = this.manufacturerList[j].manufacturer_name
614
+                  }
615
+                }
616
+               
617
+
618
+                for(let z=0;z<dealerList.length;z++){
619
+                  if(this.drugList[i].dealer == this.dealerList[z].id){
620
+                      this.drugList[i].dealer = this.dealerList[z].dealer_name
621
+                  }
622
+               
623
+                }
624
+             }
625
+             cb(this.drugList)
626
+          } else {
627
+            cb([])
628
+          }
629
+        })
630
+      },
631
+      changeDrugName(val){
632
+        this.currentIndex = val
633
+      },
634
+      handleSelect(val){
635
+         this.getDrugBatchNumber(val.id)
636
+         for(let i=0;i<this.recordInfo.recordData.length;i++){
637
+           if(i == this.currentIndex){
638
+             this.recordInfo.recordData[i].drug_id  = val.id
639
+             this.recordInfo.recordData[i].drug_name = val.drug_name
640
+             this.recordInfo.recordData[i].drug_type = val.drug_type
641
+             this.recordInfo.recordData[i].name  = val.dose +val.dose_unit+"*"+val.min_number+ val.min_unit+"/"+val.max_unit
642
+             this.recordInfo.recordData[i].last_price = val.last_price
643
+             this.recordInfo.recordData[i].manufacturer =  val.manufacturer
644
+             this.recordInfo.recordData[i].number =  val.number
645
+             this.recordInfo.recordData[i].max_unit = val.max_unit
646
+             this.recordInfo.recordData[i].min_unit = val.min_unit
647
+             if(val.dealer == 0){
648
+               this.recordInfo.recordData[i].dealer = ""
649
+             }else{
650
+               this.recordInfo.recordData[i].dealer = val.dealer
651
+             }
652
+            
653
+           }
654
+        }
655
+        console.log("333333",this.recordInfo.recordData)
656
+      },
657
+      getDrugBatchNumber(id){
658
+          var params = {
659
+            id:id
660
+          }
661
+        getDrugBatchNumber(params).then(response=>{
662
+           if(response.data.state == 1){
663
+             var list = response.data.data.list
664
+             console.log("list2222",list)
665
+             this.numberList = list
666
+           }
667
+        })
668
+      },
669
+      getDataConfig(module, filed_name){
670
+       return getDataConfig(module, filed_name)
671
+      },
494
     },
672
     },
495
     created() {
673
     created() {
496
       this.GetConfigInfo()
674
       this.GetConfigInfo()

+ 55 - 47
src/xt_pages/stock/drugs/drugStockFlow.vue Ver arquivo

64
         </el-table-column>
64
         </el-table-column>
65
         <el-table-column prop="drug_type" label="出入库方式" width="180" align="center">
65
         <el-table-column prop="drug_type" label="出入库方式" width="180" align="center">
66
            <template slot-scope="scope">
66
            <template slot-scope="scope">
67
-             <span v-if="scope.row.drug_way == 4">手动入库</span>
68
-             <span v-if="scope.row.drug_way == 2">自动出库</span>
69
-             <span v-if="scope.row.drug_way == 1">手动出库</span>
67
+             <span v-if="scope.row.consumable_type == 1">手动入库</span>
68
+             <span v-if="scope.row.consumable_type == 2">手动出库</span>
69
+             <span v-if="scope.row.consumable_type == 3">自动出库</span>
70
            </template>
70
            </template>
71
         </el-table-column>
71
         </el-table-column>
72
         <el-table-column prop="drug_name" label="出/入库单据编码" align="center">
72
         <el-table-column prop="drug_name" label="出/入库单据编码" align="center">
73
            <template slot-scope="scope">
73
            <template slot-scope="scope">
74
-             <span v-if="scope.row.drug_way == 2 || scope.row.drug_way ==1"> {{scope.row.warehouse_out_order_number}}</span>
75
-             <span v-if="scope.row.drug_way == 4">{{scope.row.warehousing_order}}</span>
76
-            
74
+             <span v-if="scope.row.consumable_type == 1">{{scope.row.warehousing_order}}</span>
75
+              <span v-if="scope.row.consumable_type == 2 || scope.row.consumable_type == 3">{{scope.row.warehouse_out_order_number}}</span>
77
            </template>
76
            </template>
78
         </el-table-column>
77
         </el-table-column>
79
         <el-table-column prop="drug_name" label="操作日期" align="center">
78
         <el-table-column prop="drug_name" label="操作日期" align="center">
80
            <template slot-scope="scope">
79
            <template slot-scope="scope">
81
-             {{getTime(scope.row.ctime)}}
80
+             {{getTime(scope.row.ctime,"{y}-{h}-{d}")}}
82
            </template>
81
            </template>
83
         </el-table-column>
82
         </el-table-column>
84
          <el-table-column prop="drug_name" label="出入库数量" align="center">
83
          <el-table-column prop="drug_name" label="出入库数量" align="center">
85
            <template slot-scope="scope">
84
            <template slot-scope="scope">
86
-             <span v-if="scope.row.drug_way == 4"> {{scope.row.warehousing_count}}{{scope.row.max_unit}}</span>
87
-             <span v-if="scope.row.drug_way == 2 || scope.row.drug_way == 1">{{scope.row.count}}{{scope.row.count_unit}}</span>
88
-           </template>
89
-        </el-table-column>
90
-         <el-table-column prop="drug_name" label="剩余库存量" align="center">
91
-           <template slot-scope="scope">
92
-               {{getCountTwo(scope.row.drug_id,scope.row.min_number,scope.row.max_unit,scope.row.min_unit)}}
93
-             <span></span>
85
+             <span v-if="scope.row.consumable_type == 1">{{scope.row.count}}{{scope.row.max_unit}}</span>
86
+             <span v-if="scope.row.consumable_type == 2">{{scope.row.count}}{{scope.row.max_unit}}{{scope.row.min_unit}}</span>
87
+             <span v-if="scope.row.consumable_type == 3">{{scope.row.count}}{{scope.row.max_unit}}{{scope.row.min_unit}}</span>
88
+
89
+            
94
            </template>
90
            </template>
95
         </el-table-column>
91
         </el-table-column>
92
+       
96
         <el-table-column prop="drug_name" label="进/出货单价" align="center">
93
         <el-table-column prop="drug_name" label="进/出货单价" align="center">
97
            <template slot-scope="scope">
94
            <template slot-scope="scope">
98
-             <span v-if="scope.row.drug_way == 4"> {{scope.row.price}}</span>
99
-             <span v-if="scope.row.drug_way == 2 || scope.row.drug_way == 1">{{scope.row.price}}</span>
95
+              <span>{{scope.row.price}}</span>
100
            </template>
96
            </template>
101
         </el-table-column>
97
         </el-table-column>
102
          <el-table-column prop="drug_name" label="有效期" align="center">
98
          <el-table-column prop="drug_name" label="有效期" align="center">
103
            <template slot-scope="scope">
99
            <template slot-scope="scope">
104
-             <span v-if="scope.row.drug_way == 4"> {{getTime(scope.row.expiry_date,"{y}-{h}-{d}")}}</span>
105
-             <span v-if="scope.row.drug_way == 2 || scope.row.drug_way == 1">{{getTime(scope.row.expiry_date,"{y}-{h}-{d}")}}</span>
100
+              {{getTime(scope.row.expire_date,"{y}-{h}-{d}")}}
101
+            
106
            </template>
102
            </template>
107
         </el-table-column>
103
         </el-table-column>
108
         <el-table-column prop="drug_name" label="批号" align="center">
104
         <el-table-column prop="drug_name" label="批号" align="center">
109
            <template slot-scope="scope">
105
            <template slot-scope="scope">
110
-             <span v-if="scope.row.drug_way == 2 || scope.row.drug_way ==1"> {{scope.row.batch_number}}</span>
111
-             <span v-if="scope.row.drug_way == 4">{{scope.row.batch_number}}</span>
106
+             <span>{{scope.row.batch_number}}</span>
112
            </template>
107
            </template>
113
         </el-table-column>
108
         </el-table-column>
114
         <el-table-column prop="drug_name" label="生产商" align="center">
109
         <el-table-column prop="drug_name" label="生产商" align="center">
115
            <template slot-scope="scope">
110
            <template slot-scope="scope">
116
-             <span v-if="scope.row.drug_way == 4"> {{getManufacturer(scope.row.manufacturer)}}</span>
117
-             <span v-if="scope.row.drug_way == 2 || scope.row.drug_way == 1">{{getManufacturer(scope.row.manufacturer)}}</span>
111
+             {{getManufacturer(scope.row.manufacturer)}}
118
            </template>
112
            </template>
119
         </el-table-column>
113
         </el-table-column>
120
        </el-table>
114
        </el-table>
143
 <script>
137
 <script>
144
   import { uParseTime } from '@/utils/tools'
138
   import { uParseTime } from '@/utils/tools'
145
   import BreadCrumb from '@/xt_pages/components/bread-crumb'
139
   import BreadCrumb from '@/xt_pages/components/bread-crumb'
146
-  import { getDrugStockFlow,getOutDrugStockFlow,getDrugCountList } from '@/api/drug/drug_stock'
140
+  import { getDrugStockFlow,getOutDrugStockFlow,getDrugCountList,getDrugFlow } from '@/api/drug/drug_stock'
147
   import SettingDialog from './settingDialog/index'
141
   import SettingDialog from './settingDialog/index'
148
   import { getDictionaryDataConfig } from "@/utils/data";
142
   import { getDictionaryDataConfig } from "@/utils/data";
149
   export default {
143
   export default {
172
       var drugCategory = getDictionaryDataConfig('system','drug_category')
166
       var drugCategory = getDictionaryDataConfig('system','drug_category')
173
       this.drugCategory.push(...drugCategory)
167
       this.drugCategory.push(...drugCategory)
174
       this.drugTypeList = getDictionaryDataConfig('system','drug_type') 
168
       this.drugTypeList = getDictionaryDataConfig('system','drug_type') 
175
-      this.getlist()
176
-      this.getOutList()
177
-      this.getDrugCountList()
169
+      // this.getlist()
170
+      // this.getOutList()
171
+      // this.getDrugCountList()
172
+
173
+      this.getDrugFlow()
178
     },
174
     },
179
     components: {
175
     components: {
180
       SettingDialog,
176
       SettingDialog,
215
         list:[],
211
         list:[],
216
         stockType:[
212
         stockType:[
217
           {id:0,name:"全部"},
213
           {id:0,name:"全部"},
218
-          {id:1,name:"手动出库"},
219
-          {id:2,name:"自动出库"},
220
-          {id:3,name:"手动入库"},
214
+          {id:1,name:"手动入库"},
215
+          {id:2,name:"手动出库"},
216
+          {id:3,name:"自动出库"},
217
+        
221
 
218
 
222
         ],
219
         ],
223
         outList:[],
220
         outList:[],
285
        },
282
        },
286
        handleSizeChange(val) {
283
        handleSizeChange(val) {
287
         this.limit = val
284
         this.limit = val
288
-        this.getlist()
289
-        this.getOutList()
285
+        this.getDrugFlow()
290
       },
286
       },
291
       handleCurrentChange(val) {
287
       handleCurrentChange(val) {
292
         this.page = val
288
         this.page = val
293
-        this.getlist()
294
-        this.getOutList()
289
+        this.getDrugFlow()
295
       },
290
       },
296
         
291
         
297
     startTimeChange: function(val) {
292
     startTimeChange: function(val) {
301
         this.$message.error("开始时间不能大于结束时间");
296
         this.$message.error("开始时间不能大于结束时间");
302
         this.start_time = "";
297
         this.start_time = "";
303
       } else {
298
       } else {
304
-        this.getlist();
299
+        this.getDrugFlow()
305
       }
300
       }
306
     },
301
     },
307
     endTimeChange: function(val) {
302
     endTimeChange: function(val) {
310
         this.$message.error("结束时间不能小于开始时间");
305
         this.$message.error("结束时间不能小于开始时间");
311
         this.end_time = "";
306
         this.end_time = "";
312
       } else {
307
       } else {
313
-        this.getlist();
314
-        this.getOutList()
308
+        this.getDrugFlow()
315
       }
309
       }
316
      },
310
      },
317
      getManufacturer(id){
311
      getManufacturer(id){
397
       },
391
       },
398
       changeDrug(val){
392
       changeDrug(val){
399
        this.tableList = []
393
        this.tableList = []
400
-        if(val == 0){
401
-         this.getlist()
402
-         this.getOutList()
403
-        }
404
-        if(val == 3){
405
-          this.getlist()
406
-        }
407
-        if(val ==1 || val == 2){
408
-           this.getOutList()
409
-        }
394
+       this.getDrugFlow()
410
        
395
        
411
       },
396
       },
412
       getMinCount(id){
397
       getMinCount(id){
461
          str_min = count%min_number + min_unit
446
          str_min = count%min_number + min_unit
462
        }
447
        }
463
        return str+str_min
448
        return str+str_min
449
+     },
450
+
451
+     getDrugFlow(){
452
+       var params = {
453
+          drug_id:this.$route.query.drug_id,
454
+          start_time:this.start_time,
455
+          end_time:this.end_time,
456
+          page:this.page,
457
+          limit:this.limit,
458
+          stock_type:this.stock_type,  
459
+        }
460
+       getDrugFlow(params).then(response=>{
461
+          if(response.data.state ==1){
462
+            var list = response.data.data.list
463
+            console.log("list232323232",list)
464
+            this.tableList = list
465
+            var total = response.data.data.total
466
+            console.log("total23232",total)
467
+            this.total =total
468
+            this.manufacturerList = response.data.data.manufacturerList
469
+            this.dealerList = response.data.data.dealerList
470
+          }
471
+       })
464
      }
472
      }
465
     }
473
     }
466
   }
474
   }

+ 82 - 5
src/xt_pages/stock/drugs/drugStockInOrder.vue Ver arquivo

72
         >
72
         >
73
         <el-button size="small" icon="el-icon-delete" @click="batchDelete">删除</el-button>
73
         <el-button size="small" icon="el-icon-delete" @click="batchDelete">删除</el-button>
74
         <el-button size="small" type="primary" @click="drugPrint()">打印</el-button>
74
         <el-button size="small" type="primary" @click="drugPrint()">打印</el-button>
75
+        <el-button size="small" type="primary" @click="toExport()">导出</el-button>
75
       </div>
76
       </div>
76
 
77
 
77
       <el-table
78
       <el-table
349
   GetAllConfig,
350
   GetAllConfig,
350
   getDrugWarehouseInfoList,
351
   getDrugWarehouseInfoList,
351
   getDrugWarehouseList,
352
   getDrugWarehouseList,
352
- 
353
+  exportDrugList
353
 } from "@/api/drug/drug_stock";
354
 } from "@/api/drug/drug_stock";
354
 import {getAllDrugList}from "@/api/data"
355
 import {getAllDrugList}from "@/api/data"
355
  import {getDictionaryDataConfig } from "@/utils/data";
356
  import {getDictionaryDataConfig } from "@/utils/data";
422
       drugTypeList:[],
423
       drugTypeList:[],
423
       manufacturerList:[],
424
       manufacturerList:[],
424
       order_id:"",
425
       order_id:"",
425
-      dealerList:[]
426
+      dealerList:[],
427
+      exportList:[],
426
     };
428
     };
427
   },
429
   },
428
   methods: {
430
   methods: {
681
       }
683
       }
682
     },
684
     },
683
     select(selection) {
685
     select(selection) {
684
-      // console.log("selection",selection)
685
-      // this.order_id = selection[0].id
686
+     
686
       var ids=[]
687
       var ids=[]
687
       for(let i=0;i<selection.length;i++){
688
       for(let i=0;i<selection.length;i++){
688
          ids.push(selection[i].id)
689
          ids.push(selection[i].id)
689
       }
690
       }
690
       this.order_id = ids.join(",")
691
       this.order_id = ids.join(",")
691
       this.selectedTableData = selection;
692
       this.selectedTableData = selection;
693
+      this.exportDrugList()
692
     },
694
     },
693
     batchDelete() {
695
     batchDelete() {
694
       if (this.selectedTableData.length <= 0) {
696
       if (this.selectedTableData.length <= 0) {
793
         this.$router.push({path:"/stock/drugStockInOrderDetailPrint?id="+this.order_id})
795
         this.$router.push({path:"/stock/drugStockInOrderDetailPrint?id="+this.order_id})
794
       }
796
       }
795
       
797
       
796
-    }
798
+    },
799
+    exportDrugList(){
800
+     
801
+      var params = {
802
+        order_id:this.order_id,
803
+      }
804
+      exportDrugList(params).then(response=>{
805
+         if(response.data.state == 1){
806
+          var list =  response.data.data.list
807
+          console.log("list23232323",list)
808
+          for(let i=0;i<list.length;i++){
809
+            list[i].product_date = this.getTime(list[i].product_date)
810
+            list[i].expiry_date = this.getTime(list[i].expiry_date)
811
+          }
812
+          this.exportList = list
813
+          var manufacturerList = response.data.data.manufacturerList
814
+          this.manufacturerList = manufacturerList
815
+          var dealerList = response.data.data.dealerList
816
+          console.log("经销是,",dealerList)
817
+          this.dealerList = dealerList
818
+         }
819
+      })
820
+    },
821
+
822
+    toExport(){
823
+      if(this.order_id == ""){
824
+        this.$message.error("请勾选入库单")
825
+      }
826
+      console.log("hhhh2323",this.exportList)
827
+      for(let i=0;i<this.exportList.length;i++){
828
+        this.exportList[i].unit = this.exportList[i].dose + this.exportList[i].dose_unit + "*" + this.exportList[i].min_number + this.exportList[i].min_unit + "/"+this.exportList[i].max_unit
829
+
830
+        this.exportList[i].total_price = (this.exportList[i].warehousing_count * this.exportList[i].price).toFixed(2)
831
+         for(let j=0;j<this.manufacturerList.length;j++){
832
+           if(this.exportList[i].manufacturer == this.manufacturerList[j].id){
833
+             this.exportList[i].manufacturer = this.manufacturerList[j].manufacturer_name
834
+           }
835
+         }
836
+
837
+         for(let z=0;z<this.dealerList.length;z++){
838
+           if(this.exportList[i].dealer == this.dealerList[z].id){
839
+              this.exportList[i].dealer = this.dealerList[z].dealer_name
840
+           }
841
+         }
842
+      }
843
+      
844
+      import('@/vendor/Export2Excel').then(excel => {
845
+        console.log("232323",this.drugTypeList)
846
+        console.log("hhh23",this.exportList)
847
+         for(let i=0;i<this.exportList.length;i++){
848
+           for(let j=0;j<this.drugTypeList.length;j++){
849
+             if(this.exportList[i].drug_type == this.drugTypeList[j].value){
850
+               this.exportList[i].drug_type = this.drugTypeList[j].name
851
+             }
852
+           }
853
+         }
854
+       
855
+       
856
+        const tHeader = ['药品名称','药品类型','规格&单位', '批号','入库数量','进货价','总价','生产厂家','生产日期','有效日期','经销商','批注文号','备注']
857
+        const filterVal = ['drug_name', 'drug_type','unit','number','warehousing_count','price','total_price','manufacturer','product_date','expiry_date','dealer','batch_number','remark']
858
+         
859
+     
860
+        console.log("table",this.exportList)
861
+      
862
+        const data = this.formatJson(filterVal, this.exportList)
863
+        excel.export_json_to_excel({
864
+          header: tHeader,
865
+          data,
866
+          filename: '药品入库单详情'
867
+        })
868
+        this.downloadLoading = false
869
+      })
870
+    },
871
+   formatJson(filterVal, jsonData) {
872
+    return jsonData.map(v => filterVal.map(j => v[j]));
873
+   },
797
   }
874
   }
798
 };
875
 };
799
 </script>
876
 </script>

+ 2 - 3
src/xt_pages/stock/drugs/drugStockInOrderAdd.vue Ver arquivo

63
                   >
63
                   >
64
                     <i class="el-icon-search el-input__icon" slot="suffix"></i>
64
                     <i class="el-icon-search el-input__icon" slot="suffix"></i>
65
                   <template slot-scope="{ item }">
65
                   <template slot-scope="{ item }">
66
-                    <div class="name">{{ item.drug_name + item.dose + "*"+ item.dose_unit +item.min_number + item.min_unit +"/" + item.max_unit + "  "+item.manufacturer}}</div>
66
+                    <div class="name">{{ item.drug_name + item.dose + item.dose_unit + "*" +item.min_number + item.min_unit +"/" + item.max_unit + "  "+item.manufacturer}}</div>
67
                   </template>
67
                   </template>
68
                  </el-autocomplete>
68
                  </el-autocomplete>
69
               </el-form-item>
69
               </el-form-item>
218
             <template slot-scope="scope">
218
             <template slot-scope="scope">
219
               <el-form-item style="padding-top: 20px">
219
               <el-form-item style="padding-top: 20px">
220
                 <el-input
220
                 <el-input
221
-                 :disabled="true"
222
                   placeholder="请输入批准文号"
221
                   placeholder="请输入批准文号"
223
                   v-model="scope.row.number"
222
                   v-model="scope.row.number"
224
                 ></el-input>
223
                 ></el-input>
849
       tempObj['manufacturer'] = ''
848
       tempObj['manufacturer'] = ''
850
       tempObj['batch_number'] = ''
849
       tempObj['batch_number'] = ''
851
       tempObj['drug_type'] = ''
850
       tempObj['drug_type'] = ''
852
-      tempObj['batch_number'] = ''
853
       tempObj['dealer'] = ''
851
       tempObj['dealer'] = ''
852
+      tempObj["number"] = ''
854
       this.recordInfo.recordData.push(tempObj)
853
       this.recordInfo.recordData.push(tempObj)
855
       
854
       
856
       this.GetConfigInfo()
855
       this.GetConfigInfo()

+ 6 - 6
src/xt_pages/stock/drugs/drugStockInOrderDetailPrint.vue Ver arquivo

21
               <td style="line-height:18px;" width="80">注册证号/批准文号/备案凭证号</td>
21
               <td style="line-height:18px;" width="80">注册证号/批准文号/备案凭证号</td>
22
               <td style="line-height:18px;" width="100">规格<br>型号</td>
22
               <td style="line-height:18px;" width="100">规格<br>型号</td>
23
               <td style="line-height:18px;" width="80">生产<br>厂商</td>
23
               <td style="line-height:18px;" width="80">生产<br>厂商</td>
24
-              <td style="line-height:18px;" width="80">单位</td>
24
+            
25
               <td style="line-height:18px;" width="80">进货价</td>
25
               <td style="line-height:18px;" width="80">进货价</td>
26
               <td style="line-height:18px;" width="80">入库<br>数量</td>
26
               <td style="line-height:18px;" width="80">入库<br>数量</td>
27
+              <td style="line-height:18px;" width="80">单位</td>
27
               <td style="line-height:18px;" width="60">总价</td>
28
               <td style="line-height:18px;" width="60">总价</td>
28
               <td style="line-height:18px;" width="80">批号</td>
29
               <td style="line-height:18px;" width="80">批号</td>
29
               <td style="line-height:18px;" width="120">生产日期</td>
30
               <td style="line-height:18px;" width="120">生产日期</td>
36
               <td style="line-height: 18px">
37
               <td style="line-height: 18px">
37
                  <span v-if="item.drug_id != 0">{{item.drug_name}}</span>
38
                  <span v-if="item.drug_id != 0">{{item.drug_name}}</span>
38
               </td>
39
               </td>
39
-              <td style="line-height: 18px">{{ item.number }}</td>
40
+              <td style="line-height: 18px">{{ item.batch_number }}</td>
40
               <td style="line-height: 18px">
41
               <td style="line-height: 18px">
41
                  <span v-if="item.drug_id != 0">{{item.dose}}{{item.dose_unit}}*{{item.min_number}}{{item.min_unit}}/{{item.max_unit}}</span>
42
                  <span v-if="item.drug_id != 0">{{item.dose}}{{item.dose_unit}}*{{item.min_number}}{{item.min_unit}}/{{item.max_unit}}</span>
42
               </td>
43
               </td>
43
               <td style="line-height: 18px">{{ getManufacturer(item.manufacturer) }}</td>
44
               <td style="line-height: 18px">{{ getManufacturer(item.manufacturer) }}</td>
44
-              <td style="line-height: 18px">
45
-                <span>{{item.max_unit}}</span>
46
-              </td>
47
               <td style="line-height:18px">
45
               <td style="line-height:18px">
48
                   {{item.price}}
46
                   {{item.price}}
49
               </td>
47
               </td>
50
               <td style="line-height: 18px">
48
               <td style="line-height: 18px">
51
                    <span>{{ item.warehousing_count }}</span>
49
                    <span>{{ item.warehousing_count }}</span>
52
               </td>
50
               </td>
53
-
51
+              <td style="line-height: 18px">
52
+                <span>{{item.max_unit}}</span>
53
+              </td>
54
               <td style="line-height:18px">
54
               <td style="line-height:18px">
55
                   <span>{{(item.warehousing_count * item.price).toFixed(2)}}</span>
55
                   <span>{{(item.warehousing_count * item.price).toFixed(2)}}</span>
56
               </td>
56
               </td>

+ 1 - 2
src/xt_pages/stock/drugs/drugStockInOrderEdit.vue Ver arquivo

128
                   >
128
                   >
129
                     <i class="el-icon-search el-input__icon" slot="suffix"></i>
129
                     <i class="el-icon-search el-input__icon" slot="suffix"></i>
130
                   <template slot-scope="{ item }">
130
                   <template slot-scope="{ item }">
131
-                    <div class="name">{{ item.drug_name + item.dose + "*"+ item.dose_unit +item.min_number + item.min_unit +"/" + item.max_unit + " "+item.manufacturer}}</div>
131
+                    <div class="name">{{ item.drug_name + item.dose +  item.dose_unit +"*" +item.min_number + item.min_unit +"/" + item.max_unit + " "+item.manufacturer}}</div>
132
                   </template>
132
                   </template>
133
                  </el-autocomplete>
133
                  </el-autocomplete>
134
               </el-form-item>
134
               </el-form-item>
285
             <template slot-scope="scope">
285
             <template slot-scope="scope">
286
               <el-form-item style="padding-top: 20px">
286
               <el-form-item style="padding-top: 20px">
287
                 <el-input
287
                 <el-input
288
-                  :disabled="true"
289
                   placeholder="请输入批准文号"
288
                   placeholder="请输入批准文号"
290
                   v-model="scope.row.number"
289
                   v-model="scope.row.number"
291
                 ></el-input>
290
                 ></el-input>

+ 107 - 8
src/xt_pages/stock/drugs/drugStockOutOrder.vue Ver arquivo

70
         >
70
         >
71
         <el-button size="small" icon="el-icon-delete" @click="batchDelete">删除</el-button>
71
         <el-button size="small" icon="el-icon-delete" @click="batchDelete">删除</el-button>
72
         <el-button size="small" type="primary" @click="toPrint">打印</el-button>
72
         <el-button size="small" type="primary" @click="toPrint">打印</el-button>
73
+        <el-button size="small" type="primary" @click="toExport">导出</el-button>
73
       </div>
74
       </div>
74
 
75
 
75
       <el-table
76
       <el-table
431
   getDrugAutoMaticList,
432
   getDrugAutoMaticList,
432
   getSinleOrderDetail,
433
   getSinleOrderDetail,
433
   getAutoDrugDetail,
434
   getAutoDrugDetail,
434
-  getDrugCountList
435
+  getDrugCountList,
436
+  getExportOutOrderDrugList
435
 } from "@/api/drug/drug_stock";
437
 } from "@/api/drug/drug_stock";
436
 import BreadCrumb from "../../components/bread-crumb";
438
 import BreadCrumb from "../../components/bread-crumb";
437
 import { getInitializtion } from '@/api/stock'
439
 import { getInitializtion } from '@/api/stock'
462
     this.GetWarehouseOut();
464
     this.GetWarehouseOut();
463
     this.fetchAllAdminUsers();
465
     this.fetchAllAdminUsers();
464
     this.getDrugCountList()
466
     this.getDrugCountList()
467
+    this.getInitializtion()
465
   },
468
   },
466
   data() {
469
   data() {
467
     return {
470
     return {
516
       drugOutList:[],
519
       drugOutList:[],
517
       outList:[],
520
       outList:[],
518
       userListOne:[],
521
       userListOne:[],
522
+      exportList:[]
519
     };
523
     };
520
   },
524
   },
521
   methods: {
525
   methods: {
721
       }
725
       }
722
       this.order_id =  ids.join(",")
726
       this.order_id =  ids.join(",")
723
       this.selectedTableData = selection;
727
       this.selectedTableData = selection;
728
+      this.getExportOutOrderDrugList()
724
     },
729
     },
725
     batchDelete() {
730
     batchDelete() {
726
       if (this.selectedTableData.length <= 0) {
731
       if (this.selectedTableData.length <= 0) {
949
              }
954
              }
950
           }
955
           }
951
           this.outList = outList
956
           this.outList = outList
952
-       
953
-          // console.log("list",list)
954
-          // console.log("outList222",outList)
957
+         console.log("outList222",outList)
955
          this.manufacturerList = response.data.data.manufacturerList
958
          this.manufacturerList = response.data.data.manufacturerList
956
          this.dealerList = response.data.data.dealerList
959
          this.dealerList = response.data.data.dealerList
957
          for(let i=0;i<list.length;i++){
960
          for(let i=0;i<list.length;i++){
977
      this.userList = []
980
      this.userList = []
978
      getAutoDrugDetail(params).then(response=>{
981
      getAutoDrugDetail(params).then(response=>{
979
        if(response.data.state == 1){
982
        if(response.data.state == 1){
983
+        console.log("list23232323232",response.data.data.list)
980
       
984
       
981
         var total = 0
985
         var total = 0
982
         for (let i = 0; i < response.data.data.list.length; i++) {
986
         for (let i = 0; i < response.data.data.list.length; i++) {
983
           var obj = response.data.data.list[i]
987
           var obj = response.data.data.list[i]
984
           obj['is_total'] = 0
988
           obj['is_total'] = 0
985
           this.userList.push(obj)
989
           this.userList.push(obj)
986
-         total = this.getTotalCount(response.data.data.list[i].drug_id)
990
+          var str = 0
991
+          var max_unit = ""
992
+          var min_unit = ""
993
+          var number = 0
994
+          var min_str = 0
995
+         for(let i=0;i<response.data.data.list.length;i++){
996
+             min_str = response.data.data.list[0].drug.min_str
997
+             max_unit = response.data.data.list[0].drug.max_unit
998
+             min_unit = response.data.data.list[0].drug.min_unit
999
+             number = response.data.data.list[0].drug.min_number
1000
+           if(response.data.data.list[i].count_unit == response.data.data.list[i].drug.max_unit){
1001
+              response.data.data.list[i].count = response.data.data.list[i].count * response.data.data.list[i].drug.min_number
1002
+           }
1003
+         }
1004
+         var total_count = 0
1005
+         for(let i=0;i<response.data.data.list.length;i++){
1006
+            total_count += response.data.data.list[i].count 
1007
+         }
1008
+         console.log("总规格2323232",total_count,number)
1009
+         
1010
+        if(parseInt(total_count)!=0){
1011
+          str = parseInt(total_count/number)
1012
+         }
1013
+        if(parseInt(total_count)!=0){
1014
+          min_str =  parseInt(total_count)%number
1015
+        }
1016
+        
1017
+        total = str + max_unit + min_str + min_unit
1018
+        console.log("h2hh2h323",str,min_str)
1019
+ 
987
         }
1020
         }
988
         this.userList.push({
1021
         this.userList.push({
989
           is_total: 1,
1022
           is_total: 1,
1092
          }
1125
          }
1093
          strprice = str * price 
1126
          strprice = str * price 
1094
          minstrprice = min_str * min_price 
1127
          minstrprice = min_str * min_price 
1095
-        //  console.log("strprice3",strprice)
1096
-        //  console.log("minstrprice",minstrprice)
1128
+       
1097
          total_price = strprice + minstrprice
1129
          total_price = strprice + minstrprice
1098
          return  total_price
1130
          return  total_price
1099
       },
1131
       },
1114
           }
1146
           }
1115
         }
1147
         }
1116
         return batchNumber.join(",")
1148
         return batchNumber.join(",")
1117
-      }
1149
+      },
1118
     
1150
     
1151
+      getExportOutOrderDrugList(){
1152
+
1153
+         var params = {
1154
+           order_id:this.order_id
1155
+         }
1156
+        getExportOutOrderDrugList(params).then(response=>{
1157
+           if(response.data.state == 1){
1158
+            var list = response.data.data.list
1159
+            console.log("list22222",list)
1160
+            this.exportList = list
1161
+            this.manufacturerList  = response.data.data.manufacturerList
1162
+            this.dealerList = response.data.data.dealerList
1163
+           }
1164
+        })
1165
+      },
1166
+      toExport(){
1167
+        if(this.order_id == ""){
1168
+          this.$message.error("请勾选出库单")
1169
+          return
1170
+        }
1171
+        for(let i=0;i<this.exportList.length;i++){
1172
+          this.exportList[i].unit = this.exportList[i].dose + this.exportList[i].dose_unit + "*" + this.exportList[i].min_number + this.exportList[i].min_unit + "/"+this.exportList[i].max_unit
1173
+
1174
+          this.exportList[i].total_price = (this.exportList[i].count * this.exportList[i].price).toFixed(2)
1175
+          this.exportList[i].expire_date  = this.getTime(this.exportList[i].expiry_date,"{y}-{h}-{d}")
1176
+           this.exportList[i].product_date = this.getTime(this.exportList[i].product_date,"{y}-{h}-{d}")
1177
+          for(let j=0;j<this.manufacturerList.length;j++){
1178
+            if(this.exportList[i].manufacturer == this.manufacturerList[j].id){
1179
+              this.exportList[i].manufacturer = this.manufacturerList[j].manufacturer_name
1180
+            }
1181
+          }
1182
+
1183
+          for(let z=0;z<this.dealerList.length;z++){
1184
+            if(this.exportList[i].dealer == this.dealerList[z].id){
1185
+                this.exportList[i].dealer = this.dealerList[z].dealer_name
1186
+            }
1187
+          }
1188
+         
1189
+        }
1190
+        console.log("23232323",this.exportList)
1191
+         console.log("了下23",this.drugTypeList)
1192
+      
1193
+       import('@/vendor/Export2Excel').then(excel => {
1194
+        for(let i=0;i<this.exportList.length;i++){
1195
+          for(let j=0;j<this.drugTypeList.length;j++){
1196
+            if(this.exportList[i].drug_type == this.drugTypeList[j].value){
1197
+              this.exportList[i].drug_type = this.drugTypeList[j].name
1198
+            }
1199
+          }
1200
+        }
1201
+        const tHeader = ['药品名称','药品类型','规格&单位', '批号','出库数量','出货单价','拆零零售价','总价','生产厂家','生产日期','有效日期','经销商','批准文号','备注']
1202
+        const filterVal = ['drug_name','drug_type','unit','batch_number', 'count','price','min_price','total_price','manufacturer','product_date','expiry_date','dealer','number','remark']
1203
+
1204
+        console.log("table",this.exportList)
1205
+         
1206
+        const data = this.formatJson(filterVal, this.exportList)
1207
+        excel.export_json_to_excel({
1208
+          header: tHeader,
1209
+          data,
1210
+          filename: '药品出库单详情'
1211
+        })
1212
+        this.downloadLoading = false
1213
+      })
1214
+      },
1215
+     formatJson(filterVal, jsonData) {
1216
+      return jsonData.map(v => filterVal.map(j => v[j]));
1217
+     },
1119
   }
1218
   }
1120
 };
1219
 };
1121
 </script>
1220
 </script>

+ 13 - 11
src/xt_pages/stock/drugs/drugStockOutOrderAdd.vue Ver arquivo

81
                   >
81
                   >
82
                     <i class="el-icon-search el-input__icon" slot="suffix"></i>
82
                     <i class="el-icon-search el-input__icon" slot="suffix"></i>
83
                   <template slot-scope="{ item }">
83
                   <template slot-scope="{ item }">
84
-                    <div class="name">{{ item.drug_name + item.dose + "*"+ item.dose_unit +item.min_number + item.min_unit +"/" + item.max_unit + " " + item.manufacturer}}</div>
84
+                    <div class="name">{{ item.drug_name + item.dose + item.dose_unit + "*" +item.min_number + item.min_unit +"/" + item.max_unit + " " + item.manufacturer}}</div>
85
                   </template>
85
                   </template>
86
                  </el-autocomplete>
86
                  </el-autocomplete>
87
               </el-form-item>
87
               </el-form-item>
137
                   </el-form-item>
137
                   </el-form-item>
138
               </template>
138
               </template>
139
           </el-table-column>
139
           </el-table-column>
140
-          <el-table-column width="120" align="center">
140
+          <el-table-column width="200" align="center">
141
             <template slot="header" slot-scope="scope">
141
             <template slot="header" slot-scope="scope">
142
               <span>出库数量<span style="color: red">*</span></span>
142
               <span>出库数量<span style="color: red">*</span></span>
143
             </template>
143
             </template>
149
               >
149
               >
150
                 <div style="display:flex;">
150
                 <div style="display:flex;">
151
                   <el-input
151
                   <el-input
152
+                    style="width:80px"
152
                     placeholder="请输入出库数量"
153
                     placeholder="请输入出库数量"
153
                     type="number"
154
                     type="number"
154
                     v-model="scope.row.count"
155
                     v-model="scope.row.count"
155
                   ></el-input>
156
                   ></el-input>
157
+                  <el-select v-model="scope.row.max_unit" filterable placeholder="请选择单位" style="width:80px">
158
+                    <el-option
159
+                      v-for="(option, index) in unitList"
160
+                      :key="index"
161
+                      :label="option.name"
162
+                      :value="option.name">
163
+                    </el-option>
164
+                  </el-select>
156
                 </div>
165
                 </div>
157
               </el-form-item>
166
               </el-form-item>
158
-              <el-select v-model="scope.row.max_unit" filterable placeholder="请选择单位">
159
-                <el-option
160
-                  v-for="(option, index) in unitList"
161
-                  :key="index"
162
-                  :label="option.name"
163
-                  :value="option.name">
164
-                </el-option>
165
-               </el-select>
167
+              
166
             </template>
168
             </template>
167
 
169
 
168
           </el-table-column>
170
           </el-table-column>
237
             <template slot-scope="scope">
239
             <template slot-scope="scope">
238
               <el-form-item style="padding-top: 20px" :disabled="true">
240
               <el-form-item style="padding-top: 20px" :disabled="true">
239
                 <el-input
241
                 <el-input
240
-                  :disabled="true"
241
                   placeholder="请输入批准文号"
242
                   placeholder="请输入批准文号"
242
                   v-model="scope.row.number"
243
                   v-model="scope.row.number"
243
                 ></el-input>
244
                 ></el-input>
737
     tempObj['dose_unit'] = ""
738
     tempObj['dose_unit'] = ""
738
     tempObj["min_number"] = ""
739
     tempObj["min_number"] = ""
739
     tempObj["dealer"] = ""
740
     tempObj["dealer"] = ""
741
+    tempObj["number"] = ""
740
     this.recordInfo.recordData.push(tempObj);
742
     this.recordInfo.recordData.push(tempObj);
741
     this.GetConfigInfo();
743
     this.GetConfigInfo();
742
     this.propForm.goodUnit = this.$store.getters.good_unit;
744
     this.propForm.goodUnit = this.$store.getters.good_unit;

+ 6 - 7
src/xt_pages/stock/drugs/drugStockOutOrderDetailPrint.vue Ver arquivo

19
             <tr>
19
             <tr>
20
               <td style="line-height: 50px" width="230">药品名称</td>
20
               <td style="line-height: 50px" width="230">药品名称</td>
21
               <td style="line-height: 50px" width="230">规格型号</td>
21
               <td style="line-height: 50px" width="230">规格型号</td>
22
-              <td style="line-height: 50px" width="50">单位</td>
23
               <td style="line-height: 50px" width="80">出货数量</td>
22
               <td style="line-height: 50px" width="80">出货数量</td>
23
+              <td style="line-height: 50px" width="50">单位</td>
24
               <td style="line-height:50px" width="80">出库价格</td>
24
               <td style="line-height:50px" width="80">出库价格</td>
25
               <td style="line-height: 50px" width="">总价</td>
25
               <td style="line-height: 50px" width="">总价</td>
26
               <td style="line-height: 50px" width="">批号</td>
26
               <td style="line-height: 50px" width="">批号</td>
36
                   <span v-if="item.drug_id != 0">{{item.dose}}{{item.dose_unit}}*{{item.min_number}}{{item.min_unit}}/{{item.max_unit}}</span>
36
                   <span v-if="item.drug_id != 0">{{item.dose}}{{item.dose_unit}}*{{item.min_number}}{{item.min_unit}}/{{item.max_unit}}</span>
37
               </td>
37
               </td>
38
               <td style="line-height: 50px">
38
               <td style="line-height: 50px">
39
-                <span>{{item.max_unit}}</span>
39
+                  {{item.count}}
40
               </td>
40
               </td>
41
-
42
               <td style="line-height: 50px">
41
               <td style="line-height: 50px">
43
-                  {{item.count}}
42
+                <span>{{item.count_unit}}</span>
44
               </td>
43
               </td>
45
               <td style="line-height:50px">
44
               <td style="line-height:50px">
46
                   {{item.last_price}}
45
                   {{item.last_price}}
48
              <td  style="line-height:50px">
47
              <td  style="line-height:50px">
49
                 {{(item.count * item.last_price).toFixed(2)}}
48
                 {{(item.count * item.last_price).toFixed(2)}}
50
              </td>
49
              </td>
51
-             <td>{{getNumber(item.drug_id)}}</td>
52
-             <td>{{getProductDate(item.drug_id)}}</td>
53
-             <td>{{getExpiryDate(item.drug_id)}}</td>
50
+             <td>{{item.batch_number}}</td>
51
+             <td>{{(getTime(item.product_date))}}</td>
52
+             <td>{{(getTime(item.expiry_date))}}</td>
54
             </tr>
53
             </tr>
55
              <tr>
54
              <tr>
56
                <td style="line-height:50px">合计</td>
55
                <td style="line-height:50px">合计</td>

+ 21 - 6
src/xt_pages/stock/drugs/drugStockOutOrderEdit.vue Ver arquivo

49
                   >
49
                   >
50
                     <i class="el-icon-search el-input__icon" slot="suffix"></i>
50
                     <i class="el-icon-search el-input__icon" slot="suffix"></i>
51
                   <template slot-scope="{ item }">
51
                   <template slot-scope="{ item }">
52
-                    <div class="name">{{ item.drug_name + item.dose + "*"+ item.dose_unit +item.min_number + item.min_unit +"/" + item.max_unit + " "+item.manufacturer}}</div>
52
+                    <div class="name">{{ item.drug_name + item.dose + item.dose_unit + "*" +item.min_number + item.min_unit +"/" + item.max_unit + " "+item.manufacturer}}</div>
53
                   </template>
53
                   </template>
54
                  </el-autocomplete>
54
                  </el-autocomplete>
55
               </el-form-item>
55
               </el-form-item>
98
                   </el-form-item>
98
                   </el-form-item>
99
               </template>
99
               </template>
100
           </el-table-column>
100
           </el-table-column>
101
-           <el-table-column width="120" align="center">
101
+           <el-table-column width="200" align="center">
102
             <template slot="header" slot-scope="scope">
102
             <template slot="header" slot-scope="scope">
103
               <span>出库数量<span style="color: red">*</span></span>
103
               <span>出库数量<span style="color: red">*</span></span>
104
             </template>
104
             </template>
110
               >
110
               >
111
                 <div style="display:flex;">
111
                 <div style="display:flex;">
112
                   <el-input
112
                   <el-input
113
+                   style="width:100px"
113
                    :disabled="drug_show"
114
                    :disabled="drug_show"
114
                     placeholder="请输入出库数量"
115
                     placeholder="请输入出库数量"
115
                     type="number"
116
                     type="number"
116
                     v-model="scope.row.count"
117
                     v-model="scope.row.count"
117
                   ></el-input>
118
                   ></el-input>
118
-                  {{scope.row.count_unit}}
119
+                  <el-select v-model="scope.row.count_unit" filterable placeholder="请选择单位" style="width:80px" :disabled="unitShow">
120
+                    <el-option
121
+                      v-for="(option, index) in unitList"
122
+                      :key="index"
123
+                      :label="option.name"
124
+                      :value="option.name">
125
+                    </el-option>
126
+                  </el-select>
119
                 </div>
127
                 </div>
120
               </el-form-item>
128
               </el-form-item>
121
               
129
               
202
             <template slot-scope="scope">
210
             <template slot-scope="scope">
203
               <el-form-item style="padding-top: 20px" :disabled="true">
211
               <el-form-item style="padding-top: 20px" :disabled="true">
204
                 <el-input
212
                 <el-input
205
-                 :disabled="drug_show"
206
                   placeholder="请输入批准文号"
213
                   placeholder="请输入批准文号"
207
                   v-model="scope.row.number"
214
                   v-model="scope.row.number"
208
                 ></el-input>
215
                 ></el-input>
254
   import BreadCrumb from '../../components/bread-crumb'
261
   import BreadCrumb from '../../components/bread-crumb'
255
   import DrugsStockDialog from './drugsStockDialog/index'
262
   import DrugsStockDialog from './drugsStockDialog/index'
256
   import {postSearchDrugList } from "@/api/data"
263
   import {postSearchDrugList } from "@/api/data"
257
-  import { getDictionaryDataConfig } from "@/utils/data";
264
+  import { getDictionaryDataConfig,getDataConfig } from "@/utils/data";
258
   export default {
265
   export default {
259
     components: { DrugsStockDialog, BreadCrumb},
266
     components: { DrugsStockDialog, BreadCrumb},
260
     name: 'salesReturnEdit',
267
     name: 'salesReturnEdit',
320
         goodInfo:[],
327
         goodInfo:[],
321
         drugTypeList:[],
328
         drugTypeList:[],
322
         manufacturerList:[],
329
         manufacturerList:[],
323
-        drug_show:false
330
+        drug_show:false,
331
+        unitList:[],
332
+        unitShow:true
324
       }
333
       }
325
     },
334
     },
326
     methods: {
335
     methods: {
415
         return name;
424
         return name;
416
       },
425
       },
417
        handleEdit: function(index, row) {
426
        handleEdit: function(index, row) {
427
+        this.unitShow = false
418
         if(this.drug_show == true){
428
         if(this.drug_show == true){
419
           this.$message.error("自动出库数据不能编辑")
429
           this.$message.error("自动出库数据不能编辑")
420
           return
430
           return
701
       getDictionaryDataConfig(module, filed_name) {
711
       getDictionaryDataConfig(module, filed_name) {
702
         return getDictionaryDataConfig(module, filed_name)
712
         return getDictionaryDataConfig(module, filed_name)
703
       },
713
       },
714
+     getDataConfig(module, filed_name){
715
+       return getDataConfig(module, filed_name)
716
+     },
704
     },
717
     },
705
     created() {
718
     created() {
706
       this.drugTypeList = getDictionaryDataConfig('system','drug_type') 
719
       this.drugTypeList = getDictionaryDataConfig('system','drug_type') 
715
       if(sys == 1){
728
       if(sys == 1){
716
         this.drug_show = true
729
         this.drug_show = true
717
       }
730
       }
731
+     this.unitList =  getDataConfig('hemodialysis','units')
732
+      console.log("单位",this.unitList)
718
     }
733
     }
719
 
734
 
720
   }
735
   }

+ 34 - 23
src/xt_pages/stock/stockBatchNumber.vue Ver arquivo

6
     <div class="app-container ">
6
     <div class="app-container ">
7
       <div class="cell clearfix">
7
       <div class="cell clearfix">
8
         耗材名称:{{this.$route.query.good_name}} &nbsp;
8
         耗材名称:{{this.$route.query.good_name}} &nbsp;
9
-        库存: {{getInCount(this.$route.query.id)- getOutCount(this.$route.query.id) - getAutoCount(this.$route.query.id) + getCancelCount(this.$route.query.id)}}{{this.$route.query.packing_unit}}&nbsp;
9
+        <!-- 库存: {{getInCount(this.$route.query.id)- getOutCount(this.$route.query.id) - getAutoCount(this.$route.query.id) + getCancelCount(this.$route.query.id)}}{{this.$route.query.packing_unit}}&nbsp; -->
10
+         {{getStockCount(this.$route.query.id)}}
10
         规格:{{this.$route.query.specification_name}} &nbsp;
11
         规格:{{this.$route.query.specification_name}} &nbsp;
11
         厂家:{{this.$route.query.manufacturer}} 
12
         厂家:{{this.$route.query.manufacturer}} 
12
       </div>
13
       </div>
307
       return new Date(time).getTime() / 1000;
308
       return new Date(time).getTime() / 1000;
308
      },
309
      },
309
     getStockDrugCount(){
310
     getStockDrugCount(){
310
-        var params ={
311
-          keywords: this.keywords,
312
-          start_time:this.start_time,
313
-          end_time:this.end_time,
311
+          var params ={
312
+            keywords: this.keywords,
313
+            start_time:this.start_time,
314
+            end_time:this.end_time,
315
+          }
316
+        getStockDrugCount(params).then(response=>{
317
+          if(response.data.state == 1){
318
+            var count = response.data.data.count
319
+            console.log("详情入库统计",count)
320
+            this.countList = count
321
+            var outlist = response.data.data.outList
322
+            console.log("详情出库数量",outlist)
323
+            
324
+            this.outCountList = outlist
325
+            var autoCount = response.data.data.autoCount
326
+            console.log("详情自动出库",autoCount)
327
+            this.autoCountList = autoCount
328
+            var totalCount = response.data.data.totalCount
329
+            console.log("totalcount",totalCount)
330
+            this.cancelCountList = totalCount
331
+          }
332
+        })
333
+      },
334
+      getStockCount(id){
335
+        var stock_count = 0
336
+        for(let i=0;i<this.countList.length;i++){
337
+          if(id == this.countList[i].good_id){
338
+            stock_count = this.countList[i].stock_count
339
+          }
314
         }
340
         }
315
-      getStockDrugCount(params).then(response=>{
316
-         if(response.data.state == 1){
317
-           var count = response.data.data.count
318
-           console.log("详情入库统计",count)
319
-           this.countList = count
320
-           var outlist = response.data.data.outList
321
-           console.log("详情出库数量",outlist)
322
-          
323
-           this.outCountList = outlist
324
-           var autoCount = response.data.data.autoCount
325
-           console.log("详情自动出库",autoCount)
326
-           this.autoCountList = autoCount
327
-           var totalCount = response.data.data.totalCount
328
-           console.log("totalcount",totalCount)
329
-           this.cancelCountList = totalCount
330
-         }
331
-      })
332
-    },
341
+       return stock_count
342
+      }
343
+      
333
 
344
 
334
     }
345
     }
335
   }
346
   }

+ 132 - 108
src/xt_pages/stock/stockFlow.vue Ver arquivo

6
     <div class="app-container ">
6
     <div class="app-container ">
7
       <div class="cell clearfix">
7
       <div class="cell clearfix">
8
        耗材名称:{{this.$route.query.good_name}} &nbsp;
8
        耗材名称:{{this.$route.query.good_name}} &nbsp;
9
-       库存:  {{getInCount(this.$route.query.id)- getOutCount(this.$route.query.id) - getAutoCount(this.$route.query.id) + getCancelCount(this.$route.query.id)}}{{this.$route.query.packing_unit }} &nbsp;
9
+       <!-- 库存:  {{getInCount(this.$route.query.id)- getOutCount(this.$route.query.id) - getAutoCount(this.$route.query.id) + getCancelCount(this.$route.query.id)}}{{this.$route.query.packing_unit }} &nbsp; -->
10
+       库存: {{getStockCount(this.$route.query.id)}}{{this.$route.query.packing_unit }}
10
        规格:{{this.$route.query.specification_name}} &nbsp;
11
        规格:{{this.$route.query.specification_name}} &nbsp;
11
        厂家:{{this.$route.query.manufacturer}} 
12
        厂家:{{this.$route.query.manufacturer}} 
12
       </div>
13
       </div>
48
               :value="item.id">
49
               :value="item.id">
49
             </el-option>
50
             </el-option>
50
         </el-select>
51
         </el-select>
51
-        
52
-        
53
       </div>
52
       </div>
54
       
53
       
55
        <el-table
54
        <el-table
63
         </el-table-column>
62
         </el-table-column>
64
         <el-table-column prop="drug_type" label="出入库方式" width="180" align="center">
63
         <el-table-column prop="drug_type" label="出入库方式" width="180" align="center">
65
            <template slot-scope="scope">
64
            <template slot-scope="scope">
66
-             <span v-if="scope.row.stock_way == 4">手动入库</span>
67
-             <span v-if="scope.row.stock_way == 3">手动出库</span>
68
-             <span v-if="scope.row.stock_way == 2">自动出库</span>
65
+             <span v-if="scope.row.consumable_type == 1">手动入库</span>
66
+             <span v-if="scope.row.consumable_type == 2">手动出库</span>
67
+             <span v-if="scope.row.consumable_type == 3">自动出库</span>
69
            </template>
68
            </template>
70
         </el-table-column>
69
         </el-table-column>
71
         <el-table-column prop="drug_name" label="出/入库单据编码" align="center">
70
         <el-table-column prop="drug_name" label="出/入库单据编码" align="center">
72
            <template slot-scope="scope">
71
            <template slot-scope="scope">
73
-             <span v-if="scope.row.stock_way == 2 || scope.row.stock_way == 3"> {{scope.row.warehouse_out_order_number}}</span>
74
-             <span v-if="scope.row.stock_way == 4">{{scope.row.warehousing_order}}</span>
75
-            
72
+            <span v-if="scope.row.consumable_type == 1">{{scope.row.warehousing_order}}</span>
73
+            <span v-if="scope.row.consumable_type == 2">{{scope.row.warehouse_out_order_number}}</span>  
76
            </template>
74
            </template>
77
         </el-table-column>
75
         </el-table-column>
78
         <el-table-column prop="drug_name" label="操作日期" align="center">
76
         <el-table-column prop="drug_name" label="操作日期" align="center">
80
              {{getTime(scope.row.ctime)}}
78
              {{getTime(scope.row.ctime)}}
81
            </template>
79
            </template>
82
         </el-table-column>
80
         </el-table-column>
83
-         <el-table-column prop="drug_name" label="出入库数量"  align="center">
81
+         <el-table-column prop="drug_name" label="数量"  align="center">
84
            <template slot-scope="scope">
82
            <template slot-scope="scope">
85
-             <span v-if="scope.row.stock_way == 4 && scope.row.warehousing_count!=0"> {{scope.row.warehousing_count}}{{packing_unit}}</span>
86
-             <span v-if="(scope.row.stock_way == 2 || scope.row.stock_way == 3) && scope.row.count!=0">{{scope.row.count}}{{packing_unit}}</span>
83
+             <span>{{scope.row.count}}{{packing_unit}}</span>
87
            </template>
84
            </template>
88
         </el-table-column>
85
         </el-table-column>
89
-       <el-table-column label="退库数量" align="center">
86
+     
87
+       <el-table-column label="是否退库" align="center">
90
          <template slot-scope="scope">
88
          <template slot-scope="scope">
91
-           <span>{{getCancelCount(scope.row.good_id)}}{{packing_unit}}</span>
89
+           <span v-if="scope.row.is_edit == 2">是</span>
90
+           <span v-if="scope.row.is_edit ==1">否</span>   
91
+         </template>
92
+       </el-table-column>
92
 
93
 
94
+       <el-table-column label="批次" align="center">
95
+         <template slot-scope="scope">
96
+           <span>{{scope.row.number}}</span>
93
          </template>
97
          </template>
94
        </el-table-column>
98
        </el-table-column>
95
-         <el-table-column prop="drug_name" label="剩余库存量"  align="center">
96
-           <template slot-scope="scope">
97
-             <!-- <span v-if="scope.row.stock_way == 4 && scope.row.stock_count!=0">{{scope.row.stock_count}} </span> -->
98
-              {{getInCount(scope.row.good_id)- getOutCount(scope.row.good_id) - getAutoCount(scope.row.good_id)}}{{packing_unit}}
99
-           </template>
100
-        </el-table-column>
99
+
100
+    
101
         <el-table-column prop="drug_name" label="进/出货单价"  align="center">
101
         <el-table-column prop="drug_name" label="进/出货单价"  align="center">
102
            <template slot-scope="scope">
102
            <template slot-scope="scope">
103
-             <span v-if="scope.row.stock_way == 4"> {{scope.row.price}}</span>
104
-             <span v-if="scope.row.stock_way == 2 || scope.row.stock_way == 3">{{scope.row.price}}</span>
103
+             <span>{{scope.row.price}}</span>
105
            </template>
104
            </template>
106
         </el-table-column>
105
         </el-table-column>
107
          <el-table-column prop="drug_name" label="有效期" align="center">
106
          <el-table-column prop="drug_name" label="有效期" align="center">
108
            <template slot-scope="scope" >
107
            <template slot-scope="scope" >
109
-             <span v-if="scope.row.stock_way == 4"> {{getTime(scope.row.expiry_date)}}</span>
110
-             <span v-if="scope.row.stock_way == 2 || scope.row.stock_way == 3">{{getTime(scope.row.expiry_date)}}</span>
108
+             <span>{{getTime(scope.row.expire_date,"{y}-{h}-{d}")}}</span>
111
            </template>
109
            </template>
112
         </el-table-column>
110
         </el-table-column>
113
-        <el-table-column prop="drug_name" label="批号" align="center">
111
+        <el-table-column prop="drug_name" label="批准文号" align="center">
114
            <template slot-scope="scope" >
112
            <template slot-scope="scope" >
115
-             <span v-if="scope.row.stock_way == 2"> {{scope.row.number}}</span>
116
-             <span v-if="scope.row.stock_way == 4 || scope.row.stock_way == 3">{{scope.row.number}}</span>
113
+             <span>{{scope.row.license_number}}</span>
117
            </template>
114
            </template>
118
         </el-table-column>
115
         </el-table-column>
119
         <el-table-column prop="drug_name" label="生产商" align="center">
116
         <el-table-column prop="drug_name" label="生产商" align="center">
120
            <template slot-scope="scope">
117
            <template slot-scope="scope">
121
-             <span v-if="scope.row.stock_way == 4"> {{getManufacturer(scope.row.manufacturer)}}</span>
122
-             <span v-if="scope.row.stock_way == 2 || scope.row.stock_way == 3">{{getManufacturer(scope.row.manufacturer)}}</span>
118
+             <span > {{getManufacturer(scope.row.manufacturer)}}</span>
123
            </template>
119
            </template>
124
         </el-table-column>
120
         </el-table-column>
125
        </el-table>
121
        </el-table>
142
 <script>
138
 <script>
143
   import { uParseTime } from '@/utils/tools'
139
   import { uParseTime } from '@/utils/tools'
144
   import BreadCrumb from '@/xt_pages/components/bread-crumb'
140
   import BreadCrumb from '@/xt_pages/components/bread-crumb'
145
-  import {getStockInList,getStockOutList} from "@/api/drug/drug_stock";
146
-  import {getStockDrugCount} from "@/api/stock"
141
+  import {getStockDrugCount,getStockFlow} from "@/api/stock"
147
   export default {
142
   export default {
148
     name: 'stockIn',
143
     name: 'stockIn',
149
     created() {
144
     created() {
167
         (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
162
         (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
168
         "-" +
163
         "-" +
169
         (nowDay < 10 ? "0" + nowDay : nowDay);
164
         (nowDay < 10 ? "0" + nowDay : nowDay);
170
-      this.getlist()
165
+      // this.getlist()
166
+      // this.getStockOutList()
171
       this.getStockDrugCount()
167
       this.getStockDrugCount()
172
-      this.getStockOutList()
168
+    
169
+      this.getStockFlow()
173
       this.packing_unit = this.$route.query.packing_unit
170
       this.packing_unit = this.$route.query.packing_unit
174
     },
171
     },
175
     components: {
172
     components: {
209
         manufacturerList:[],
206
         manufacturerList:[],
210
         stockType:[
207
         stockType:[
211
           {id:0,name:"全部"},
208
           {id:0,name:"全部"},
212
-          {id:3,name:"手动出库"},
213
-          {id:2,name:"动出库"},
214
-          {id:4,name:"手动入库"},
209
+          {id:1,name:"手动入库"},
210
+          {id:2,name:"动出库"},
211
+          {id:3,name:"自动出库"},
215
         ],
212
         ],
216
         countList:[],
213
         countList:[],
217
         outCountList:[],
214
         outCountList:[],
223
       }
220
       }
224
     },
221
     },
225
     methods:{
222
     methods:{
226
-    
227
-     
228
-       handleSizeChange(val) {
223
+     handleSizeChange(val) {
229
         this.limit = val
224
         this.limit = val
230
-        this.getlist()
231
-        this.getStockOutList()
225
+        this.getStockFlow()
232
       },
226
       },
233
       handleCurrentChange(val) {
227
       handleCurrentChange(val) {
234
         this.page = val
228
         this.page = val
235
-        this.getlist()
236
-        this.getStockOutList()
229
+        this.getStockFlow()
237
       },
230
       },
238
         
231
         
239
     startTimeChange: function(val) {
232
     startTimeChange: function(val) {
244
         this.$message.error("开始时间不能大于结束时间");
237
         this.$message.error("开始时间不能大于结束时间");
245
         this.start_time = "";
238
         this.start_time = "";
246
       } else {
239
       } else {
247
-        
248
-        this.getlist()
249
-        this.getStockOutList()
240
+         
241
+         this.getStockFlow()
242
+     
250
       }
243
       }
251
     },
244
     },
252
     endTimeChange: function(val) {
245
     endTimeChange: function(val) {
256
         this.$message.error("结束时间不能小于开始时间");
249
         this.$message.error("结束时间不能小于开始时间");
257
         this.end_time = "";
250
         this.end_time = "";
258
       } else {
251
       } else {
259
-       this.getlist()
260
-       this.getStockOutList()
252
+        this.getStockFlow()
261
       }
253
       }
262
      },
254
      },
263
      getManufacturer(id){
255
      getManufacturer(id){
280
       }
272
       }
281
      },
273
      },
282
      //入库详情
274
      //入库详情
283
-     getlist(){
284
-        var params= {
285
-          limit:this.limit,
286
-          page:this.page,
287
-          id:this.$route.query.id,
288
-          start_time:this.start_time,
289
-          end_time:this.end_time,
290
-          is_sys:this.stockType 
291
-        } 
292
-      getStockInList(params).then(response=>{
293
-         if(response.data.state == 1){
294
-           var list = response.data.data.list
295
-           for(let i=0;i<list.length;i++){
296
-             list[i].stock_way = 4
297
-             this.tableList.push(list[i])
298
-           }
299
-           var total = response.data.data.total
300
-           this.total = total
301
-          //  console.log("入库数据",this.tableList)
302
-           var manufacturerList = response.data.data.manufacturerList
303
-           this.manufacturerList = manufacturerList
304
-         }
305
-      })
306
-     },
307
-    getStockOutList(){
308
-       var params= {
309
-          limit:this.limit,
310
-          page:this.page,
311
-          id:this.$route.query.id,
312
-          start_time:this.start_time,
313
-          end_time:this.end_time, 
314
-          is_sys:this.stock_type 
315
-        } 
316
-      getStockOutList(params).then(response=>{
317
-        if(response.data.state == 1){
318
-          var outList = response.data.data.outList
319
-          console.log("outList990-0000990",outList)
320
-           for(let i=0;i<outList.length;i++){
321
-             if(outList[i].is_sys == 0){
322
-                outList[i].stock_way = 3
323
-             }
324
-             if(outList[i].is_sys == 1){
325
-                outList[i].stock_way = 2
326
-             }
327
-             this.tableList.push(outList[i])
328
-           }
329
-          console.log("hhhhhhhhhh",this.tableList)
330
-          var total = response.data.data.total
331
-          this.total = total
332
-        }  
333
-      })
334
-    },
275
+    //  getlist(){
276
+    //     var params= {
277
+    //       limit:this.limit,
278
+    //       page:this.page,
279
+    //       id:this.$route.query.id,
280
+    //       start_time:this.start_time,
281
+    //       end_time:this.end_time,
282
+    //       is_sys:this.stockType 
283
+    //     } 
284
+    //   getStockInList(params).then(response=>{
285
+    //      if(response.data.state == 1){
286
+    //        var list = response.data.data.list
287
+    //        for(let i=0;i<list.length;i++){
288
+    //          list[i].stock_way = 4
289
+    //          this.tableList.push(list[i])
290
+    //        }
291
+    //        var total = response.data.data.total
292
+    //        this.total = total
293
+    //       //  console.log("入库数据",this.tableList)
294
+    //        var manufacturerList = response.data.data.manufacturerList
295
+    //        this.manufacturerList = manufacturerList
296
+    //      }
297
+    //   })
298
+    //  },
299
+    // getStockOutList(){
300
+    //    var params= {
301
+    //       limit:this.limit,
302
+    //       page:this.page,
303
+    //       id:this.$route.query.id,
304
+    //       start_time:this.start_time,
305
+    //       end_time:this.end_time, 
306
+    //       is_sys:this.stock_type 
307
+    //     } 
308
+    //   getStockOutList(params).then(response=>{
309
+    //     if(response.data.state == 1){
310
+    //       var outList = response.data.data.outList
311
+    //       console.log("outList990-0000990",outList)
312
+    //        for(let i=0;i<outList.length;i++){
313
+    //          if(outList[i].is_sys == 0){
314
+    //             outList[i].stock_way = 3
315
+    //          }
316
+    //          if(outList[i].is_sys == 1){
317
+    //             outList[i].stock_way = 2
318
+    //          }
319
+    //          this.tableList.push(outList[i])
320
+    //        }
321
+    //       console.log("hhhhhhhhhh",this.tableList)
322
+    //       var total = response.data.data.total
323
+    //       this.total = total
324
+    //     }  
325
+    //   })
326
+    // },
335
     getStockDrugCount(){
327
     getStockDrugCount(){
336
         var params ={
328
         var params ={
337
           keywords: this.keywords,
329
           keywords: this.keywords,
384
         }
376
         }
385
         return count
377
         return count
386
       },
378
       },
387
-    getCancelCount(id){
388
-      var count = 0
389
-      for(let i=0;i<this.cancelCountList.length;i++){
390
-        if(id == this.cancelCountList[i].good_id){
391
-            count = this.cancelCountList[i].count
379
+      getCancelCount(id){
380
+        var count = 0
381
+        for(let i=0;i<this.cancelCountList.length;i++){
382
+          if(id == this.cancelCountList[i].good_id){
383
+              count = this.cancelCountList[i].count
384
+          }
392
         }
385
         }
393
-      }
394
-      return count
395
-    },
386
+        return count
387
+      },
396
      getTimestamp(time) {
388
      getTimestamp(time) {
397
       // 把时间日期转成时间戳
389
       // 把时间日期转成时间戳
398
       return new Date(time).getTime() / 1000;
390
       return new Date(time).getTime() / 1000;
405
        if(val == 2 || val == 3 || val == 0){
397
        if(val == 2 || val == 3 || val == 0){
406
         this.getStockOutList()
398
         this.getStockOutList()
407
        }
399
        }
400
+     },
401
+     getStockCount(id){
402
+      var stock_count = 0
403
+      for(let i=0;i<this.countList.length;i++){
404
+        if(id == this.countList[i].good_id){
405
+          stock_count = this.countList[i].stock_count
406
+        }
407
+      }
408
+      return stock_count
409
+     },
410
+
411
+     getStockFlow(){
412
+        var params= {
413
+          limit:this.limit,
414
+          page:this.page,
415
+          good_id:this.$route.query.id,
416
+          start_time:this.start_time,
417
+          end_time:this.end_time,
418
+          is_sys:this.stockType 
419
+        } 
420
+       getStockFlow(params).then(response=>{
421
+          if(response.data.state == 1){
422
+            var list =  response.data.data.list
423
+            console.log("list2323",list)
424
+            var total = response.data.data.total
425
+            console.log("total",total)
426
+            this.tableList = list
427
+            this.total = total
428
+           var manufacturerList = response.data.data.manufacturerList
429
+           this.manufacturerList = manufacturerList
430
+          }
431
+       })
408
      }
432
      }
409
     }
433
     }
410
   }
434
   }

+ 20 - 5
src/xt_pages/stock/stockInOrder.vue Ver arquivo

1473
              }
1473
              }
1474
            }
1474
            }
1475
           for(let i=0;i<list.length;i++){
1475
           for(let i=0;i<list.length;i++){
1476
-            list[i].unit = list[i].specification_name + list[i].packing_unit
1476
+            list[i].unit = list[i].specification_name +"/"+ list[i].packing_unit
1477
             list[i].total_price = (list[i].warehousing_count * list[i].price).toFixed(2)
1477
             list[i].total_price = (list[i].warehousing_count * list[i].price).toFixed(2)
1478
             list[i].expiry_date = this.getTime(list[i].expiry_date,"{y}-{m}-{d}")
1478
             list[i].expiry_date = this.getTime(list[i].expiry_date,"{y}-{m}-{d}")
1479
             list[i].product_date = this.getTime(list[i].product_date,"{y}-{m}-{d}")
1479
             list[i].product_date = this.getTime(list[i].product_date,"{y}-{m}-{d}")
1501
         return
1501
         return
1502
       }
1502
       }
1503
       import('@/vendor/Export2Excel').then(excel => {
1503
       import('@/vendor/Export2Excel').then(excel => {
1504
-
1505
-      const tHeader = ['耗材名称','注册证号/批准文号/备案凭证号', '规格型号','生产厂家','单位','进货价','入库数量','总价','批号','生产日期','有效日期','经销商']
1506
-      const filterVal = ['good_name', 'license_number', 'unit','manufacturer','packing_unit','price','warehousing_count','total_price','number','product_date','expiry_date','dealer']
1504
+        console.log(this.goodType)
1505
+        console.log(this.exportList)
1506
+      for(let i=0;i<this.exportList.length;i++){
1507
+        for(let j=0;j<this.goodType.length;j++){
1508
+           if(this.exportList[i].good_type_id == this.goodType[j].id){
1509
+             this.exportList[i].good_type_id = this.goodType[j].type_name
1510
+           }
1511
+        }
1512
+        if(this.exportList[i].dealer == 0){
1513
+           this.exportList[i].dealer = ""
1514
+        }
1515
+        if(this.exportList[i].manufacturer == 0){
1516
+           this.exportList[i].manufacturer = ""
1517
+        }
1518
+      }
1519
+    
1520
+      const tHeader = ['耗材名称','耗材类型', '规格&单位','批号','入库数量','进货价','总价','生产厂家','生产日期','有效期','经销商','批准文号','备注']
1521
+      const filterVal = ['good_name', 'good_type_id', 'unit','number','warehousing_count','price','total_price','manufacturer','product_date','expiry_date','dealer','license_number','remark']
1507
 
1522
 
1508
       console.log("table",this.exportList)
1523
       console.log("table",this.exportList)
1509
-      
1524
+     
1510
       const data = this.formatJson(filterVal, this.exportList)
1525
       const data = this.formatJson(filterVal, this.exportList)
1511
       excel.export_json_to_excel({
1526
       excel.export_json_to_excel({
1512
         header: tHeader,
1527
         header: tHeader,

+ 36 - 5
src/xt_pages/stock/stockOutOrder.vue Ver arquivo

1098
             if(response.data.state == 1){
1098
             if(response.data.state == 1){
1099
               this.tableShow = true
1099
               this.tableShow = true
1100
               var list = response.data.data.list
1100
               var list = response.data.data.list
1101
-              console.log("list22222222",list)
1101
+              // console.log("list22222222",list)
1102
+              // for(let i=0;i<list.length;i++){
1103
+              //   if(list[i].dealer == 0){
1104
+              //     list[i].dealer = ""
1105
+              //   }
1106
+              //   if(list[i].manufacturer == 0){
1107
+              //     list[i].manufacturer = ""
1108
+              //   }
1109
+              //   this.tableList.push(list[i])
1110
+              // }
1111
+              var list = response.data.data.info
1112
+              console.log("info2232323",list)
1102
               for(let i=0;i<list.length;i++){
1113
               for(let i=0;i<list.length;i++){
1103
                 if(list[i].dealer == 0){
1114
                 if(list[i].dealer == 0){
1104
                   list[i].dealer = ""
1115
                   list[i].dealer = ""
1105
                 }
1116
                 }
1106
                 if(list[i].manufacturer == 0){
1117
                 if(list[i].manufacturer == 0){
1107
                   list[i].manufacturer = ""
1118
                   list[i].manufacturer = ""
1108
-                }
1119
+                }  
1120
+                list[i].good_name = list[i].info.good_name
1121
+                list[i].specification_name = list[i].info.specification_name
1122
+                list[i].packing_unit = list[i].info.packing_unit
1109
                 this.tableList.push(list[i])
1123
                 this.tableList.push(list[i])
1110
               }
1124
               }
1125
+             
1111
             }
1126
             }
1112
         })
1127
         })
1113
       },
1128
       },
1576
             var outCount = response.data.data.outCount
1591
             var outCount = response.data.data.outCount
1577
             console.log("outCount",outCount)
1592
             console.log("outCount",outCount)
1578
             for(let i=0;i<list.length;i++){
1593
             for(let i=0;i<list.length;i++){
1579
-               list[i].unit = list[i].specification_name + list[i].packing_unit
1594
+               list[i].unit = list[i].specification_name +"/" + list[i].packing_unit
1580
                list[i].total_price = (list[i].total_count * list[i].price).toFixed(2)
1595
                list[i].total_price = (list[i].total_count * list[i].price).toFixed(2)
1581
                list[i].expiry_date = this.getTime(list[i].expiry_date,"{y}-{m}-{d}")
1596
                list[i].expiry_date = this.getTime(list[i].expiry_date,"{y}-{m}-{d}")
1582
                list[i].product_date = this.getTime(list[i].product_date,"{y}-{m}-{d}") 
1597
                list[i].product_date = this.getTime(list[i].product_date,"{y}-{m}-{d}") 
1607
          return
1622
          return
1608
         }
1623
         }
1609
         import('@/vendor/Export2Excel').then(excel => {
1624
         import('@/vendor/Export2Excel').then(excel => {
1625
+          console.log("23232323",this.exportList)
1610
         for(let i=0;i<this.exportList.length;i++){
1626
         for(let i=0;i<this.exportList.length;i++){
1611
           this.exportList[i].total_price = this.exportList[i].count * this.exportList[i].price
1627
           this.exportList[i].total_price = this.exportList[i].count * this.exportList[i].price
1628
+          for(let j=0;j<this.goodType.length;j++){
1629
+            if(this.exportList[i].good_type_id == this.goodType[j].id){
1630
+               this.exportList[i].good_type_id = this.goodType[j].type_name
1631
+            }
1632
+          }
1633
+          if(this.exportList[i].dealer == 0){
1634
+            this.exportList[i].dealer = ""
1635
+          }
1636
+          if(this.exportList[i].manufacturer == 0){
1637
+            this.exportList[i].manufacturer = ""
1638
+          }
1612
         }
1639
         }
1613
-        const tHeader = ['耗材名称', '规格型号', '单位','出库数量','出库价格','总价','批号','生产日期','有效日期']
1614
-        const filterVal = ['good_name', 'specification_name', 'packing_unit','count','price','total_price','number','product_date','expiry_date']
1640
+        console.log("hhhh323223",this.goodType)
1641
+       
1642
+      
1643
+        const tHeader = ['耗材名称', '耗材类型', '规格&单位','出库数量','出货价','总价','生产厂商','经销商','生产日期','有效期','备注']
1644
+        const filterVal = ['good_name', 'good_type_id', 'unit','count','price','total_price','manufacturer','dealer','product_date','expiry_date','remark']
1615
         console.log("table",this.exportList)
1645
         console.log("table",this.exportList)
1646
+       
1616
         const data = this.formatJson(filterVal, this.exportList)
1647
         const data = this.formatJson(filterVal, this.exportList)
1617
         excel.export_json_to_excel({
1648
         excel.export_json_to_excel({
1618
           header: tHeader,
1649
           header: tHeader,

+ 1 - 1
src/xt_pages/stock/stockOutOrderAdd.vue Ver arquivo

602
             stockOut: this.recordInfo.recordData
602
             stockOut: this.recordInfo.recordData
603
           };
603
           };
604
           console.log("2323223223",this.recordInfo.recordData);
604
           console.log("2323223223",this.recordInfo.recordData);
605
- 
605
+          
606
           postWarehouseOut(
606
           postWarehouseOut(
607
             params,
607
             params,
608
             this.warehouse_out_time,
608
             this.warehouse_out_time,

+ 14 - 3
src/xt_pages/stock/stockOutOrderEdit.vue Ver arquivo

563
               'stockOut': this.recordInfo.recordData
563
               'stockOut': this.recordInfo.recordData
564
             }
564
             }
565
            
565
            
566
-            console.log("stockout",params)
566
+            console.log("stockout",params,this.$route.query.id)
567
             
567
             
568
             editWarehouseoutInfo(params, this.warehouse_out_time, this.$route.query.id, this.$route.query.type, this.form.manufacturer, this.form.dealer).then(response => {
568
             editWarehouseoutInfo(params, this.warehouse_out_time, this.$route.query.id, this.$route.query.type, this.form.manufacturer, this.form.dealer).then(response => {
569
               if (response.data.state == 0) {
569
               if (response.data.state == 0) {
570
                 this.$message.error(response.data.msg)
570
                 this.$message.error(response.data.msg)
571
                 return false
571
                 return false
572
               } else {
572
               } else {
573
-                this.$message.success('保存成功')
574
-                this.$router.back(-1)
573
+                if(response.data.data.msg == 1){
574
+                  this.$message.success('保存成功')
575
+                  this.$router.back(-1)
576
+                }
577
+
578
+                if(response.data.data.msg == 5){
579
+                  this.$message.error("该耗材无库存,请入库")
580
+                }
581
+
582
+                if(response.data.data.msg == 6){
583
+                  this.$message.error("该耗材的退库数量大于入库数量,无法出库,请新增出库另一个批次")
584
+                }
585
+                
575
               }
586
               }
576
             })
587
             })
577
           } else {
588
           } else {

+ 15 - 2
src/xt_pages/stock/stockQuery.vue Ver arquivo

108
        </el-table-column>
108
        </el-table-column>
109
        <el-table-column label="出库数量" align="center">
109
        <el-table-column label="出库数量" align="center">
110
          <template slot-scope="scope">
110
          <template slot-scope="scope">
111
-           <span>{{getOutCount(scope.row.good_id) + getAutoCount(scope.row.good_id)}}{{scope.row.packing_unit}}</span>
111
+           <!-- <span>{{getOutCount(scope.row.good_id) + getAutoCount(scope.row.good_id)}}{{scope.row.packing_unit}}</span> -->
112
 
112
 
113
+           {{getInCount(scope.row.good_id) - getStockCount(scope.row.good_id)}}{{scope.row.packing_unit}}
113
          </template>
114
          </template>
114
        </el-table-column>
115
        </el-table-column>
115
 
116
 
122
       
123
       
123
        <el-table-column label="剩余库存量" align="center">
124
        <el-table-column label="剩余库存量" align="center">
124
          <template slot-scope="scope">
125
          <template slot-scope="scope">
125
-           {{getInCount(scope.row.good_id)- getOutCount(scope.row.good_id) - getAutoCount(scope.row.good_id) + getCancelCount(scope.row.good_id)}} {{scope.row.packing_unit}}
126
+           <!-- {{getInCount(scope.row.good_id)- getOutCount(scope.row.good_id) - getAutoCount(scope.row.good_id) + getCancelCount(scope.row.good_id)}} {{scope.row.packing_unit}} -->
127
+           
128
+           {{getStockCount(scope.row.good_id)}} {{scope.row.packing_unit}} 
129
+
126
          </template>
130
          </template>
127
        </el-table-column>
131
        </el-table-column>
128
        <el-table-column label="操作" align="center" width="260px">
132
        <el-table-column label="操作" align="center" width="260px">
570
        }
574
        }
571
      }
575
      }
572
      return count
576
      return count
577
+   },
578
+   getStockCount(id){
579
+     var stock_count = 0
580
+     for(let i=0;i<this.countList.length;i++){
581
+       if(id == this.countList[i].good_id){
582
+         stock_count = this.countList[i].stock_count
583
+       }
584
+     }
585
+     return stock_count
573
    }
586
    }
574
   }
587
   }
575
 };
588
 };