XMLWAN 4 gadus atpakaļ
vecāks
revīzija
2055f2dce0

+ 16 - 14
src/xt_pages/stock/stockInOrder.vue Parādīt failu

@@ -591,12 +591,12 @@ export default {
591 591
       (nowDay < 10 ? "0" + nowDay : nowDay);
592 592
    
593 593
 
594
-      this.warehousing_time =
595
-        nowYear +
596
-        '-' +
597
-        (nowMonth < 10 ? '0' + nowMonth : nowMonth) +
598
-        '-' +
599
-        (nowDay < 10 ? '0' + nowDay : nowDay)
594
+      // this.warehousing_time =
595
+      //   nowYear +
596
+      //   '-' +
597
+      //   (nowMonth < 10 ? '0' + nowMonth : nowMonth) +
598
+      //   '-' +
599
+      //   (nowDay < 10 ? '0' + nowDay : nowDay)
600 600
 
601 601
     
602 602
     this.GetWarehouse();
@@ -668,14 +668,11 @@ export default {
668 668
       },
669 669
 
670 670
       form: {
671
-        manufacturer: '',
672
-        dealer: ''
673
-      },
674
-      dealer: [],
675
-      goodType: [],
676
-      goodInfo:[],
671
+        manufacturer:0,
672
+        dealer:0
673
+      }, 
677 674
       warehousing_time: '',
678
-
675
+     warehouse:{},
679 676
       propForm: {
680 677
         goods: [],
681 678
         goodType: [],
@@ -1085,11 +1082,17 @@ export default {
1085 1082
               response.data.data.info[i].expiry_date,
1086 1083
               "{y}-{m}-{d}"
1087 1084
             );
1085
+            
1088 1086
            response.data.data.info[i].price = response.data.data.info[i].price.toString();
1089 1087
            response.data.data.info[i].warehousing_count = response.data.data.info[i].warehousing_count.toString();
1090 1088
 
1091 1089
             this.recordInfo.recordData.push(response.data.data.info[i]);
1090
+
1091
+          
1092 1092
           }
1093
+           this.warehouse = response.data.data.warehousing;
1094
+           this.warehousing_time = this.getTime(this.warehouse.warehousing_time,"{y}-{m}-{d}");
1095
+           console.log("单据日期",this.warehousing_time)
1093 1096
           this.WarehouseInfo.warehouse = response.data.data.warehousing;
1094 1097
          
1095 1098
         }
@@ -1215,7 +1218,6 @@ export default {
1215 1218
     }, 
1216 1219
 
1217 1220
      submit() {
1218
-     
1219 1221
       this.$refs["tableForm"].validate(valid => {
1220 1222
         if (valid) {
1221 1223
           const array = this.recordInfo.recordData;

+ 312 - 5
src/xt_pages/stock/stockOutOrder.vue Parādīt failu

@@ -119,8 +119,23 @@
119 119
           </template>
120 120
         </el-table-column>
121 121
 
122
-        <el-table-column label="操作" align="center">
122
+        <el-table-column label="操作" align="center" width="300px">
123 123
           <template slot-scope="scope">
124
+            <el-tooltip
125
+              class="item"
126
+              effect="dark"
127
+              content="详情"
128
+              placement="top"
129
+            >
130
+              <el-button
131
+                size="small"
132
+                type="primary"
133
+                icon="el-icon-search"
134
+                @click="handleSearch(scope.row.id)"
135
+              >
136
+              </el-button>
137
+            </el-tooltip>
138
+
124 139
             <el-tooltip
125 140
               class="item"
126 141
               effect="dark"
@@ -165,6 +180,183 @@
165 180
       >
166 181
       </el-pagination>
167 182
     </div>
183
+
184
+
185
+
186
+
187
+    <!-- 新增弹窗 -->
188
+
189
+    <el-dialog
190
+      title="提示"
191
+      :visible.sync="dialogVisible"
192
+      width="80%"
193
+     >
194
+      <span>
195
+        <div class="filter-container">
196
+          <span style="font-size: 18px;color: #606266">出库单详情</span>
197
+          <el-row style="float:right;">
198
+            <span style="color: #606266">{{warehousingOutInfo.info.warehouse_out_order_number}}</span>
199
+          </el-row>
200
+        </div>
201
+
202
+        <div class="cell clearfix">
203
+          <span style="width: 300px;color: #606266">单据日期:  {{warehousingOutInfo.info.warehouse_out_time | parseTime('{y}-{m}-{d}')}} </span>
204
+          <span style="width: 300px;color: #606266">厂商 {{getManufactuerName(warehousingOutInfo.info.manufacturer)}}</span>
205
+          <span style="width: 300px;color: #606266">经销商 {{getDealerName(warehousingOutInfo.info.dealer)}}</span>
206
+        </div>
207
+
208
+        <!-- <div class="filter-container" style="margin-top: 10px">
209
+        <el-button size="small" icon="el-icon-edit" @click="editRecord" v-if="warehousingOutInfo.info.is_sys != 1">编辑</el-button>
210
+        <el-button size="small" icon="el-icon-delete" @click="deleteRecord" v-if="warehousingOutInfo.info.is_sys != 1">删除</el-button>
211
+        </div> -->
212
+
213
+
214
+         <el-row :gutter="12" style="margin-top: 10px">
215
+          <el-table :data="warehousingOutInfo.warehousingOutData" :class="signAndWeighBoxPatients" style="width: 100%"
216
+                    border :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
217
+                  
218
+          >
219
+            <el-table-column min-width="35" align="center">
220
+              <template slot="header" slot-scope="scope">
221
+                <span>商品类型</span>
222
+              </template>
223
+
224
+              <template slot-scope="scope">
225
+                <span v-if="scope.row.good_type_id != 0">{{getTypeName(scope.row.good_type_id)}}</span>
226
+              </template>
227
+            </el-table-column>
228
+            <el-table-column min-width="35" align="center">
229
+              <template slot="header" slot-scope="scope">
230
+                <span>规格名称</span>
231
+              </template>
232
+              <template slot-scope="scope">
233
+                <span v-if="scope.row.good_id != 0">{{getSpecificationName(scope.row.good_id)}}</span>
234
+              </template>
235
+            </el-table-column>
236
+
237
+
238
+            <el-table-column min-width="23" align="center">
239
+              <template slot="header" slot-scope="scope">
240
+                <span>单价</span>
241
+              </template>
242
+              <template slot-scope="scope">
243
+                <span>{{scope.row.price}}</span>
244
+              </template>
245
+            </el-table-column>
246
+
247
+            <el-table-column min-width="23" align="center">
248
+              <template slot="header" slot-scope="scope">
249
+                <span>出库数量</span>
250
+              </template>
251
+              <template slot-scope="scope">
252
+                <span>{{scope.row.count}}</span>
253
+
254
+              </template>
255
+            </el-table-column>
256
+            <el-table-column label="总价" min-width="20" align="center">
257
+              <template slot-scope="scope">
258
+                {{calculate(scope.row.price*scope.row.count)}}
259
+              </template>
260
+            </el-table-column>
261
+
262
+            <el-table-column label="备注" min-width="20" align="center">
263
+              <template slot-scope="scope">
264
+                <el-popover placement="top-start" width="250" trigger="hover">
265
+                  <div>{{scope.row.remark}}</div>
266
+                  <span slot="reference"
267
+                        v-if="scope.row.remark.length > 20">{{ scope.row.remark.substr(0,20)+'...' }}</span>
268
+                  <span slot="reference" v-else>{{ scope.row.remark}}</span>
269
+                </el-popover>
270
+
271
+              </template>
272
+            </el-table-column>
273
+
274
+            <el-table-column label="" align="center"  >
275
+              <template slot-scope="scope" v-if="scope.row.is_sys == 1">
276
+              <div style="color: #589ff8" @click="jump(scope.row.id)">使用明细</div>
277
+              </template>
278
+            </el-table-column>
279
+             
280
+
281
+
282
+          </el-table>
283
+      </el-row>
284
+      </span>
285
+      <span slot="footer" class="dialog-footer">
286
+        <el-button @click="dialogVisible = false">取 消</el-button>
287
+        <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
288
+      </span>
289
+   </el-dialog>
290
+
291
+
292
+  <!-- 使用明细查询 -->
293
+   <el-dialog
294
+    title="出库单详情"
295
+    :visible.sync="editdialogVisible"
296
+    width="80%">
297
+    <span>
298
+      <div class="filter-container">
299
+        <span style="font-size: 18px;color: #606266">商品使用明细</span>
300
+      </div>
301
+     
302
+      <div class="cell clearfix">
303
+        <span style="width: 300px;color: #606266">商品类型: {{type_name}} </span>
304
+        <span style="width: 300px;color: #606266">规格名称: {{specification_name}}</span>
305
+      </div>
306
+
307
+       <el-row :gutter="12" style="margin-top: 10px">
308
+        <el-table :data="userList" :class="signAndWeighBoxPatients" style="width: 80%"
309
+                  border :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
310
+        >
311
+          <el-table-column min-width="35" align="center">
312
+            <template slot="header" slot-scope="scope">
313
+              <span>序号</span>
314
+            </template>
315
+            <template slot-scope="scope">
316
+              <span v-if="scope.row.is_total == 0">{{scope.$index+1}}</span>
317
+              <span v-if="scope.row.is_total == 1">{{'合计'}}</span>
318
+            </template>
319
+          </el-table-column>
320
+
321
+          <el-table-column min-width="35" align="center">
322
+            <template slot="header" slot-scope="scope">
323
+              <span>使用人</span>
324
+            </template>
325
+            <template slot-scope="scope">
326
+              <span v-if="scope.row.is_total == 0">{{scope.row.user.name}}</span>
327
+              <span v-if="scope.row.is_total == 1"></span>
328
+            </template>
329
+          </el-table-column>
330
+          <el-table-column min-width="35" align="center">
331
+            <template slot="header" slot-scope="scope">
332
+              <span>使用数量</span>
333
+            </template>
334
+            <template slot-scope="scope">
335
+              <span v-if="scope.row.is_total == 0">{{scope.row.count}}</span>
336
+              <span  v-if="scope.row.is_total == 1">{{scope.row.total}} </span>
337
+
338
+            </template>
339
+          </el-table-column>
340
+          <el-table-column min-width="35" align="center">
341
+            <template slot="header" slot-scope="scope">
342
+              <span>使用时间</span>
343
+            </template>
344
+            <template slot-scope="scope">
345
+              <span>{{scope.row.ctime | parseTime('{y}-{m}-{d} {h}:{i}')}} </span>
346
+
347
+            </template>
348
+          </el-table-column>
349
+
350
+        </el-table>
351
+      </el-row>
352
+    </span>
353
+    <span slot="footer" class="dialog-footer">
354
+      <el-button @click="editdialogVisible = false">取 消</el-button>
355
+      <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
356
+    </span>
357
+  </el-dialog>
358
+ 
359
+
168 360
   </div>
169 361
 </template>
170 362
 
@@ -175,7 +367,9 @@ import { fetchAllAdminUsers, fetchAllDoctorAndNurse } from "@/api/doctor";
175 367
 import {
176 368
   deleteWarehouseOut,
177 369
   GetAllConfig,
178
-  getWarehouseOutList
370
+  getWarehouseOutList,
371
+  getWarehouseOutInfo,
372
+  getWarehouseOutUser
179 373
 } from "@/api/stock";
180 374
 import BreadCrumb from "../components/bread-crumb";
181 375
 
@@ -203,8 +397,9 @@ export default {
203 397
       (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
204 398
       "-" +
205 399
       (nowDay < 10 ? "0" + nowDay : nowDay);
206
-    this.GetWarehouseOut();
207 400
     this.GetConfigInfo();
401
+    this.GetWarehouseOut();
402
+   
208 403
     this.fetchAllAdminUsers();
209 404
   },
210 405
   data() {
@@ -231,7 +426,19 @@ export default {
231 426
       manufacturer: [],
232 427
       selectedTableData: [],
233 428
       dealer: [],
234
-      type: 1
429
+      type: 1,
430
+      drug_id:0,
431
+      dialogVisible:false,
432
+      editdialogVisible:false,
433
+      warehousingOutInfo: {
434
+        loading: false,
435
+        warehousingOutData: [],
436
+        info: {}
437
+      },
438
+      userList:[],
439
+      type_name:'',
440
+      specification_name:"",
441
+      
235 442
     };
236 443
   },
237 444
   methods: {
@@ -366,6 +573,8 @@ export default {
366 573
         } else {
367 574
           this.manufacturer = response.data.data.manufacturer;
368 575
           this.dealer = response.data.data.dealer;
576
+          this.goodInfo = response.data.data.goodInfo
577
+          this.goodType = response.data.data.goodType
369 578
         }
370 579
       });
371 580
     },
@@ -479,7 +688,105 @@ export default {
479 688
           });
480 689
         })
481 690
         .catch(() => {});
482
-    }
691
+    },
692
+
693
+ 
694
+
695
+    
696
+    //新增
697
+    handleSearch(id){ 
698
+      this.GetOrderDetailOne(id)
699
+      this.dialogVisible = true
700
+    },
701
+  
702
+    //获取出库单详情数据
703
+    GetOrderDetailOne(id) {
704
+        const params = {
705
+          'id': id
706
+        }
707
+      getWarehouseOutInfo(params).then(response => {
708
+          if (response.data.state == 0) {
709
+
710
+            this.$message.error(response.data.msg)
711
+            return false
712
+          } else {
713
+            for (let i = 0; i < response.data.data.list.length; i++) {
714
+              this.warehousingOutInfo.warehousingOutData.push(response.data.data.list[i])
715
+            }
716
+            this.warehousingOutInfo.info = response.data.data.info
717
+            this.handleSpanTempArr()
718
+          }
719
+        })
720
+     }, 
721
+
722
+      getTypeName: function(id) {
723
+        let name = ''
724
+        for (let i = 0; i < this.goodType.length; i++) {
725
+          if (this.goodType[i].id == id) {
726
+            name = this.goodType[i].type_name
727
+          }
728
+        }
729
+        return name
730
+      },
731
+
732
+     getSpecificationName: function(id) {
733
+        let name = ''
734
+        for (let i = 0; i < this.goodInfo.length; i++) {
735
+          if (this.goodInfo[i].id == id) {
736
+            name = this.goodInfo[i].specification_name
737
+          }
738
+        }
739
+        return name
740
+      },
741
+     getManufactuerName: function(manufacturer_id) {
742
+        for (let i = 0; i < this.manufacturer.length; i++) {
743
+          if (this.manufacturer[i].id == manufacturer_id) {
744
+            return this.manufacturer[i].manufacturer_name
745
+          }
746
+        }
747
+      }, 
748
+
749
+    jump(id){
750
+      this.GetOrderDetail(id)
751
+     
752
+    },
753
+
754
+     GetOrderDetail: function(order_id) {
755
+        const params = {
756
+          'id': order_id
757
+        }
758
+        console.log("params 0---------",params)
759
+        getWarehouseOutUser(params).then(response => {
760
+          if (response.data.state == 0) {
761
+            this.$message.error(response.data.msg)
762
+            return false
763
+          } else {
764
+            var total = 0
765
+            for (let i = 0; i < response.data.data.list.length; i++) {
766
+              var obj = response.data.data.list[i]
767
+              console.log("obj---------",obj)
768
+              obj['is_total'] = 0
769
+              this.userList.push(obj)
770
+              total = total + response.data.data.list[i].count
771
+            }
772
+            this.userList.push({
773
+              is_total: 1,
774
+              total: total,
775
+            })
776
+            this.type_name = this.userList[0].type.type_name
777
+            this.specification_name = this.userList[0].info.specification_name
778
+            console.log("详情数据区",this.userList)
779
+              this.editdialogVisible = true
780
+          }
781
+        })
782
+      },
783
+
784
+      editRecord(){
785
+     
786
+      },
787
+      deleteRecord(){
788
+
789
+      }
483 790
   }
484 791
 };
485 792
 </script>

+ 8 - 4
src/xt_pages/stock/stockOutOrderDetail.vue Parādīt failu

@@ -152,7 +152,8 @@
152 152
           }
153 153
         }
154 154
         return name
155
-      }, getTypeName: function(id) {
155
+      },
156
+       getTypeName: function(id) {
156 157
         let name = ''
157 158
         for (let i = 0; i < this.goodType.length; i++) {
158 159
           if (this.goodType[i].id == id) {
@@ -160,7 +161,8 @@
160 161
           }
161 162
         }
162 163
         return name
163
-      }, GetConfigInfo: function() {
164
+      },
165
+       GetConfigInfo: function() {
164 166
         GetAllConfig().then(response => {
165 167
           if (response.data.state == 0) {
166 168
             this.$message.error(response.data.msg)
@@ -184,12 +186,14 @@
184 186
             return this.dealer[i].dealer_name
185 187
           }
186 188
         }
187
-      }, calculate: function(val) {
189
+      }, 
190
+      calculate: function(val) {
188 191
         if (val == 0) {
189 192
           return ''
190 193
         }
191 194
         return Math.round(parseFloat(val) * 100) / 100
192
-      }, GetOrderDetail: function(order_id) {
195
+      },
196
+       GetOrderDetail: function(order_id) {
193 197
         const params = {
194 198
           'id': order_id
195 199
         }

+ 2 - 1
src/xt_pages/stock/stockOutOrderEdit.vue Parādīt failu

@@ -422,7 +422,8 @@
422 422
 
423 423
       back() {
424 424
         this.$router.go(-1)
425
-      }, submit() {
425
+      },
426
+       submit() {
426 427
         this.$refs['tableForm'].validate((valid) => {
427 428
           if (valid) {
428 429
             const array = this.recordInfo.recordData

+ 2 - 1
src/xt_pages/stock/stockUserDetail.vue Parādīt failu

@@ -106,7 +106,8 @@
106 106
           }
107 107
         }
108 108
         return name
109
-      }, GetOrderDetail: function(order_id) {
109
+      },
110
+       GetOrderDetail: function(order_id) {
110 111
         const params = {
111 112
           'id': order_id
112 113
         }