XMLWAN 3 anos atrás
pai
commit
fef1dca8b9

+ 20 - 0
src/xt_pages/stock/drugs/drugBatchNumber.vue Ver arquivo

111
   export default {
111
   export default {
112
     name: 'stockIn',
112
     name: 'stockIn',
113
     created() {
113
     created() {
114
+       var nowDate = new Date();
115
+      var nowYear = nowDate.getFullYear();
116
+      var nowMonth = nowDate.getMonth() + 1;
117
+      var nowDay = nowDate.getDate();
118
+      this.end_time =
119
+        nowYear +
120
+        "-" +
121
+        (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
122
+        "-" +
123
+        (nowDay < 10 ? "0" + nowDay : nowDay);
124
+      nowDate.setMonth(nowDate.getMonth() - 1);
125
+      nowYear = nowDate.getFullYear();
126
+      nowMonth = nowDate.getMonth() + 1;
127
+      nowDay = nowDate.getDate();
128
+      this.start_time =
129
+        nowYear +
130
+        "-" +
131
+        (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
132
+        "-" +
133
+        (nowDay < 10 ? "0" + nowDay : nowDay);
114
       var drugCategory = getDictionaryDataConfig('system','drug_category')
134
       var drugCategory = getDictionaryDataConfig('system','drug_category')
115
       this.drugCategory.push(...drugCategory)
135
       this.drugCategory.push(...drugCategory)
116
       this.drugTypeList = getDictionaryDataConfig('system','drug_type') 
136
       this.drugTypeList = getDictionaryDataConfig('system','drug_type') 

+ 20 - 0
src/xt_pages/stock/drugs/drugStockFlow.vue Ver arquivo

150
   export default {
150
   export default {
151
     name: 'stockIn',
151
     name: 'stockIn',
152
     created() {
152
     created() {
153
+       var nowDate = new Date();
154
+      var nowYear = nowDate.getFullYear();
155
+      var nowMonth = nowDate.getMonth() + 1;
156
+      var nowDay = nowDate.getDate();
157
+      this.end_time =
158
+        nowYear +
159
+        "-" +
160
+        (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
161
+        "-" +
162
+        (nowDay < 10 ? "0" + nowDay : nowDay);
163
+      nowDate.setMonth(nowDate.getMonth() - 1);
164
+      nowYear = nowDate.getFullYear();
165
+      nowMonth = nowDate.getMonth() + 1;
166
+      nowDay = nowDate.getDate();
167
+      this.start_time =
168
+        nowYear +
169
+        "-" +
170
+        (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
171
+        "-" +
172
+        (nowDay < 10 ? "0" + nowDay : nowDay);
153
       var drugCategory = getDictionaryDataConfig('system','drug_category')
173
       var drugCategory = getDictionaryDataConfig('system','drug_category')
154
       this.drugCategory.push(...drugCategory)
174
       this.drugCategory.push(...drugCategory)
155
       this.drugTypeList = getDictionaryDataConfig('system','drug_type') 
175
       this.drugTypeList = getDictionaryDataConfig('system','drug_type') 

+ 26 - 7
src/xt_pages/stock/drugs/query.vue Ver arquivo

7
           size="small"
7
           size="small"
8
           class="filter-item"
8
           class="filter-item"
9
           type="primary"
9
           type="primary"
10
-          icon="el-icon-search"
11
           @click="setting"
10
           @click="setting"
12
         >设置
11
         >设置
13
         </el-button
12
         </el-button
16
           size="small"
15
           size="small"
17
           class="filter-item"
16
           class="filter-item"
18
           type="primary"
17
           type="primary"
19
-          icon="el-icon-search"
18
+          icon="el-icon-printer"
20
           @click="printOrder"
19
           @click="printOrder"
21
         >打印
20
         >打印
22
       </el-button>
21
       </el-button>
24
           size="small"
23
           size="small"
25
           class="filter-item"
24
           class="filter-item"
26
           type="primary"
25
           type="primary"
27
-          icon="el-icon-search"
28
           @click="exportStock"
26
           @click="exportStock"
29
         >导出
27
         >导出
30
         </el-button>
28
         </el-button>
178
   export default {
176
   export default {
179
     name: 'stockIn',
177
     name: 'stockIn',
180
     created() {
178
     created() {
179
+      var nowDate = new Date();
180
+      var nowYear = nowDate.getFullYear();
181
+      var nowMonth = nowDate.getMonth() + 1;
182
+      var nowDay = nowDate.getDate();
183
+      this.end_time =
184
+        nowYear +
185
+        "-" +
186
+        (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
187
+        "-" +
188
+        (nowDay < 10 ? "0" + nowDay : nowDay);
189
+      nowDate.setMonth(nowDate.getMonth() - 1);
190
+      nowYear = nowDate.getFullYear();
191
+      nowMonth = nowDate.getMonth() + 1;
192
+      nowDay = nowDate.getDate();
193
+      this.start_time =
194
+        nowYear +
195
+        "-" +
196
+        (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
197
+        "-" +
198
+        (nowDay < 10 ? "0" + nowDay : nowDay);
181
       var drugCategory = getDictionaryDataConfig('system','drug_category')
199
       var drugCategory = getDictionaryDataConfig('system','drug_category')
182
       this.drugCategory.push(...drugCategory)
200
       this.drugCategory.push(...drugCategory)
183
       var drugTypeList = getDictionaryDataConfig('system','drug_type') 
201
       var drugTypeList = getDictionaryDataConfig('system','drug_type') 
538
           start_time:this.start_time,
556
           start_time:this.start_time,
539
           end_time:this.end_time,
557
           end_time:this.end_time,
540
          }
558
          }
559
+         console.log("paramsw2ww",params)
541
         getDrugCountList(params).then(response=>{
560
         getDrugCountList(params).then(response=>{
542
           if(response.data.state == 1){
561
           if(response.data.state == 1){
543
             var countlist =  response.data.data.countList
562
             var countlist =  response.data.data.countList
564
         })
583
         })
565
       },
584
       },
566
       getInCount(id){
585
       getInCount(id){
567
-        var count = ""
586
+        var count = 0
568
         for(let i=0;i<this.countList.length;i++){
587
         for(let i=0;i<this.countList.length;i++){
569
            if(id == this.countList[i].drug_id){
588
            if(id == this.countList[i].drug_id){
570
              count = this.countList[i].count
589
              count = this.countList[i].count
574
       },
593
       },
575
 
594
 
576
       getOutCount(id){
595
       getOutCount(id){
577
-        var count = ""
596
+        var count = 0
578
         for(let i=0;i<this.outCountList.length;i++){
597
         for(let i=0;i<this.outCountList.length;i++){
579
            if(id == this.outCountList[i].drug_id){
598
            if(id == this.outCountList[i].drug_id){
580
                count = this.outCountList[i].count
599
                count = this.outCountList[i].count
583
         return count
602
         return count
584
       },
603
       },
585
       getAutoCount(id){
604
       getAutoCount(id){
586
-        var count= ""
605
+        var count= 0
587
         for(let i=0;i<this.autoCountList.length;i++){
606
         for(let i=0;i<this.autoCountList.length;i++){
588
           if(id == this.autoCountList[i].drug_id){
607
           if(id == this.autoCountList[i].drug_id){
589
             count = this.autoCountList[i].count
608
             count = this.autoCountList[i].count
592
         return count
611
         return count
593
       },
612
       },
594
       getMinCount(id){
613
       getMinCount(id){
595
-        var count=""
614
+        var count= 0
596
         for(let i=0;i<this.minCount.length;i++){
615
         for(let i=0;i<this.minCount.length;i++){
597
           if(id == this.minCount[i].drug_id){
616
           if(id == this.minCount[i].drug_id){
598
             count = this.minCount[i].count
617
             count = this.minCount[i].count

+ 20 - 0
src/xt_pages/stock/stockBatchNumber.vue Ver arquivo

118
   export default {
118
   export default {
119
     name: 'stockIn',
119
     name: 'stockIn',
120
     created() {
120
     created() {
121
+      var nowDate = new Date();
122
+      var nowYear = nowDate.getFullYear();
123
+      var nowMonth = nowDate.getMonth() + 1;
124
+      var nowDay = nowDate.getDate();
125
+      this.end_time =
126
+        nowYear +
127
+        "-" +
128
+        (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
129
+        "-" +
130
+        (nowDay < 10 ? "0" + nowDay : nowDay);
131
+      nowDate.setMonth(nowDate.getMonth() - 1);
132
+      nowYear = nowDate.getFullYear();
133
+      nowMonth = nowDate.getMonth() + 1;
134
+      nowDay = nowDate.getDate();
135
+      this.start_time =
136
+        nowYear +
137
+        "-" +
138
+        (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
139
+        "-" +
140
+        (nowDay < 10 ? "0" + nowDay : nowDay);
121
       this.getlist()
141
       this.getlist()
122
       this.getStockDrugCount()
142
       this.getStockDrugCount()
123
       this.packing_unit = this.$route.query.packing_unit
143
       this.packing_unit = this.$route.query.packing_unit

+ 23 - 1
src/xt_pages/stock/stockFlow.vue Ver arquivo

141
   export default {
141
   export default {
142
     name: 'stockIn',
142
     name: 'stockIn',
143
     created() {
143
     created() {
144
-     
144
+      var nowDate = new Date();
145
+      var nowYear = nowDate.getFullYear();
146
+      var nowMonth = nowDate.getMonth() + 1;
147
+      var nowDay = nowDate.getDate();
148
+      this.end_time =
149
+        nowYear +
150
+        "-" +
151
+        (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
152
+        "-" +
153
+        (nowDay < 10 ? "0" + nowDay : nowDay);
154
+      nowDate.setMonth(nowDate.getMonth() - 1);
155
+      nowYear = nowDate.getFullYear();
156
+      nowMonth = nowDate.getMonth() + 1;
157
+      nowDay = nowDate.getDate();
158
+      this.start_time =
159
+        nowYear +
160
+        "-" +
161
+        (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
162
+        "-" +
163
+        (nowDay < 10 ? "0" + nowDay : nowDay);
145
       this.getlist()
164
       this.getlist()
146
       this.getStockDrugCount()
165
       this.getStockDrugCount()
147
       this.getStockOutList()
166
       this.getStockOutList()
211
       },
230
       },
212
         
231
         
213
     startTimeChange: function(val) {
232
     startTimeChange: function(val) {
233
+      this.tableList = []
214
       var time = this.getTimestamp(val) - this.getTimestamp(this.end_time);
234
       var time = this.getTimestamp(val) - this.getTimestamp(this.end_time);
215
       
235
       
216
       if (time > 0) {
236
       if (time > 0) {
217
         this.$message.error("开始时间不能大于结束时间");
237
         this.$message.error("开始时间不能大于结束时间");
218
         this.start_time = "";
238
         this.start_time = "";
219
       } else {
239
       } else {
240
+        
220
         this.getlist()
241
         this.getlist()
221
         this.getStockOutList()
242
         this.getStockOutList()
222
       }
243
       }
223
     },
244
     },
224
     endTimeChange: function(val) {
245
     endTimeChange: function(val) {
246
+      this.tableList = []
225
       var time = this.getTimestamp(val) - this.getTimestamp(this.start_time);
247
       var time = this.getTimestamp(val) - this.getTimestamp(this.start_time);
226
       if (time < 0) {
248
       if (time < 0) {
227
         this.$message.error("结束时间不能小于开始时间");
249
         this.$message.error("结束时间不能小于开始时间");

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

227
             {{ getTime(scope.row.expiry_date,"{y}-{m}-{d}")}}
227
             {{ getTime(scope.row.expiry_date,"{y}-{m}-{d}")}}
228
           </template>
228
           </template>
229
         </el-table-column>
229
         </el-table-column>
230
+       <el-table-column label="批准文号" align="center">
231
+          <template slot-scope="scope">
232
+            {{ scope.row.license_number}}
233
+          </template>
234
+        </el-table-column>
230
         <el-table-column label="备注" align="center">
235
         <el-table-column label="备注" align="center">
231
           <template slot-scope="scope">
236
           <template slot-scope="scope">
232
             {{ scope.row.remark }}
237
             {{ scope.row.remark }}

+ 14 - 1
src/xt_pages/stock/stockInOrderAdd.vue Ver arquivo

186
 
186
 
187
             </template>
187
             </template>
188
           </el-table-column>
188
           </el-table-column>
189
+
190
+         <el-table-column align="center" width="150">
191
+            <template slot="header" slot-scope="scope">
192
+              <span>批准文号</span>
193
+            </template>
194
+            <template slot-scope="scope">
195
+              <el-form-item style="padding-top: 20px">
196
+                <el-input placeholder="请输入批号" v-model="scope.row.license_number"></el-input>
197
+              </el-form-item>
198
+            </template>
199
+          </el-table-column>
189
            <el-table-column label="经销商" align="center" width="150">
200
            <el-table-column label="经销商" align="center" width="150">
190
              <template slot-scope="scope">
201
              <template slot-scope="scope">
191
                <el-select size="small" v-model="scope.row.dealer" filterable placeholder="请选择厂商">
202
                <el-select size="small" v-model="scope.row.dealer" filterable placeholder="请选择厂商">
512
         tempObj['good_unit'] = ''
523
         tempObj['good_unit'] = ''
513
         tempObj['specification_name'] = ''
524
         tempObj['specification_name'] = ''
514
         tempObj['name'] = ''
525
         tempObj['name'] = ''
526
+        tempObj['license_number'] = ""
515
         this.recordInfo.recordData.push(tempObj)
527
         this.recordInfo.recordData.push(tempObj)
516
       }, handleDelete: function(index, row) {
528
       }, handleDelete: function(index, row) {
517
         if (this.recordInfo.recordData.length <= 1) {
529
         if (this.recordInfo.recordData.length <= 1) {
679
               'stockIn': this.recordInfo.recordData
691
               'stockIn': this.recordInfo.recordData
680
             }
692
             }
681
             console.log("stockIn",this.recordInfo.recordData)
693
             console.log("stockIn",this.recordInfo.recordData)
682
-           
694
+            
683
             postWarehouse(params, this.warehousing_time, this.form.manufacturer, this.form.dealer, this.type).then(response => {
695
             postWarehouse(params, this.warehousing_time, this.form.manufacturer, this.form.dealer, this.type).then(response => {
684
               if (response.data.state == 0) {
696
               if (response.data.state == 0) {
685
                 this.$message.error(response.data.msg)
697
                 this.$message.error(response.data.msg)
792
       tempObj['good_name'] = ''
804
       tempObj['good_name'] = ''
793
       tempObj['specification_name'] = ''
805
       tempObj['specification_name'] = ''
794
       tempObj['name'] = ''
806
       tempObj['name'] = ''
807
+      tempObj['license_number'] = ''
795
       this.recordInfo.recordData.push(tempObj)
808
       this.recordInfo.recordData.push(tempObj)
796
       this.GetConfigInfo()
809
       this.GetConfigInfo()
797
       this.propForm.goodUnit = this.$store.getters.good_unit
810
       this.propForm.goodUnit = this.$store.getters.good_unit

+ 15 - 8
src/xt_pages/stock/stockInOrderDetailPrint.vue Ver arquivo

46
                             <tbody>
46
                             <tbody>
47
                                 <tr v-for='(item,index) in it.child' :key="index">
47
                                 <tr v-for='(item,index) in it.child' :key="index">
48
                                     <td style="line-height:18px;"><span v-if="item.good_id != 0">{{getTypeNameOne(item.good_id)}}</span></td>
48
                                     <td style="line-height:18px;"><span v-if="item.good_id != 0">{{getTypeNameOne(item.good_id)}}</span></td>
49
-                                    <td style="line-height:18px;">{{ item.remark }}</td>
49
+                                    <td style="line-height:18px;">{{ item.license_number }}</td>
50
                                     <td style="line-height:18px;"><span v-if="item.good_id != 0">{{getSpecificationName(item.good_id)}}</span></td>
50
                                     <td style="line-height:18px;"><span v-if="item.good_id != 0">{{getSpecificationName(item.good_id)}}</span></td>
51
                                     <td style="line-height:18px;">{{ getManufacturer(item.good_id) }}</td>
51
                                     <td style="line-height:18px;">{{ getManufacturer(item.good_id) }}</td>
52
                                     <td style="line-height:18px;"><span v-if="item.good_id!=0">{{item.GoodInfo.packing_unit}}</span></td>
52
                                     <td style="line-height:18px;"><span v-if="item.good_id!=0">{{item.GoodInfo.packing_unit}}</span></td>
61
                                 </tr>
61
                                 </tr>
62
                                 <tr>
62
                                 <tr>
63
                                   <td>合计</td>
63
                                   <td>合计</td>
64
-                                  <td colspan="12" style="text-align:right;">{{allPrice.toFixed(2)}}</td>
64
+                                  <td colspan="12" style="text-align:right;">{{getAllPice(it.id).toFixed(2)}}</td>
65
                                </tr>
65
                                </tr>
66
                             </tbody>
66
                             </tbody>
67
                         </table>
67
                         </table>
132
             orgName:'',
132
             orgName:'',
133
             orgId:'',
133
             orgId:'',
134
             adminUserOptions:[],
134
             adminUserOptions:[],
135
-            warehousingInfo:[]
135
+            warehousingInfo:[],
136
+            warehousList:[]
136
         }
137
         }
137
     },
138
     },
138
     methods:{
139
     methods:{
198
              console.log("info2222",info)
199
              console.log("info2222",info)
199
              var warehousing = response.data.data.warehousing
200
              var warehousing = response.data.data.warehousing
200
              console.log("warehousing",warehousing)
201
              console.log("warehousing",warehousing)
202
+             this.warehousList = info
201
              for(let i=0;i<warehousing.length;i++){
203
              for(let i=0;i<warehousing.length;i++){
202
                 warehousing[i].child = []
204
                 warehousing[i].child = []
203
               for(let j=0;j<info.length;j++){
205
               for(let j=0;j<info.length;j++){
207
               }
209
               }
208
              }
210
              }
209
              this.warehousingInfo = warehousing
211
              this.warehousingInfo = warehousing
210
-            var total_price = 0
211
-            for(let i=0;i<info.length;i++){
212
-               total_price += info[i].warehousing_count * info[i].price   
213
-            }
214
-            this.allPrice = total_price
212
+          
215
             }
213
             }
216
         });
214
         });
217
        },
215
        },
340
         }
338
         }
341
         return name;
339
         return name;
342
       },
340
       },
341
+      getAllPice(id){
342
+        var  total_price = 0 
343
+        for(let i=0;i<this.warehousList.length;i++){
344
+          if(id == this.warehousList[i].warehousing_id){
345
+             total_price += this.warehousList[i].warehousing_count * this.warehousList[i].price
346
+          }
347
+        }
348
+        return total_price
349
+      }
343
     },
350
     },
344
     created(){
351
     created(){
345
       this.orgName = this.$store.getters.xt_user.org.org_name;
352
       this.orgName = this.$store.getters.xt_user.org.org_name;

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

263
                 value-format="yyyy-MM-dd"
263
                 value-format="yyyy-MM-dd"
264
               ></el-date-picker>
264
               ></el-date-picker>
265
             </template>
265
             </template>
266
+          </el-table-column>
267
+           <el-table-column align="center" width="150">
268
+            <template slot="header" slot-scope="scope">
269
+              <span>批准文号</span>
270
+            </template>
271
+            <template slot-scope="scope">
272
+              <el-form-item style="padding-top: 20px">
273
+                <el-input
274
+                  placeholder="请输入批号"
275
+                  v-model="scope.row.license_number"
276
+                ></el-input>
277
+              </el-form-item>
278
+            </template>
266
           </el-table-column>
279
           </el-table-column>
267
           <el-table-column label="经销商" align="center" width="150">
280
           <el-table-column label="经销商" align="center" width="150">
268
              <template slot-scope="scope">
281
              <template slot-scope="scope">
511
       tempObj["dealer"] = "";
524
       tempObj["dealer"] = "";
512
       tempObj["manufacturer"] = "";
525
       tempObj["manufacturer"] = "";
513
       tempObj["number"] = ""
526
       tempObj["number"] = ""
527
+      tempObj["license_number"] = ""
514
       this.recordInfo.recordData.push(tempObj);
528
       this.recordInfo.recordData.push(tempObj);
515
     },
529
     },
516
     handleDelete: function(index, row) {
530
     handleDelete: function(index, row) {
634
               return;
648
               return;
635
             }
649
             }
636
           }
650
           }
637
-          console.log("昌吉",this.manufacturerList)
651
+         
638
           for(let i=0;i<this.recordInfo.recordData.length;i++){
652
           for(let i=0;i<this.recordInfo.recordData.length;i++){
639
             this.recordInfo.recordData[i].price = this.recordInfo.recordData[i].price.toString()
653
             this.recordInfo.recordData[i].price = this.recordInfo.recordData[i].price.toString()
640
-
654
+            
641
           for(let j=0;j<this.manufacturerList.length;j++){
655
           for(let j=0;j<this.manufacturerList.length;j++){
642
               if(this.recordInfo.recordData[i].manufacturer == this.manufacturerList[j].manufacturer_name){
656
               if(this.recordInfo.recordData[i].manufacturer == this.manufacturerList[j].manufacturer_name){
643
                   this.recordInfo.recordData[i].manufacturer = this.manufacturerList[j].id
657
                   this.recordInfo.recordData[i].manufacturer = this.manufacturerList[j].id
676
       const params = {
690
       const params = {
677
         id: order_id
691
         id: order_id
678
       };
692
       };
693
+      console.log("parm2222222222",params)
679
       getWarehouseInfoList(params).then(response => {
694
       getWarehouseInfoList(params).then(response => {
680
         if (response.data.state == 0) {
695
         if (response.data.state == 0) {
681
           this.$message.error(response.data.msg);
696
           this.$message.error(response.data.msg);
699
             response.data.data.info[i].packing_unit = response.data.data.info[i].GoodInfo.packing_unit
714
             response.data.data.info[i].packing_unit = response.data.data.info[i].GoodInfo.packing_unit
700
             
715
             
701
            
716
            
702
-           
703
             this.recordInfo.recordData.push(response.data.data.info[i]);
717
             this.recordInfo.recordData.push(response.data.data.info[i]);
704
            
718
            
705
             console.log("列表",this.recordInfo.recordData)
719
             console.log("列表",this.recordInfo.recordData)
706
           }
720
           }
707
 
721
 
708
           this.warehouse = response.data.data.warehousing;
722
           this.warehouse = response.data.data.warehousing;
709
-        
710
-
723
+          console.log("jhhahfhh",this.warehouse)
724
+ 
711
           this.warehousing_time = this.getTime(
725
           this.warehousing_time = this.getTime(
712
-            this.warehouse.warehousing_time,
726
+            this.warehouse[0].warehousing_time,
713
             "{y}-{m}-{d}"
727
             "{y}-{m}-{d}"
714
           );
728
           );
715
 
729
 
726
             tempObj["remark"] = "";
740
             tempObj["remark"] = "";
727
             tempObj["dealer"] = "";
741
             tempObj["dealer"] = "";
728
             tempObj["manufacturer"] = "";
742
             tempObj["manufacturer"] = "";
743
+            tempObj["license_number"] = ""
729
             this.recordInfo.recordData.push(tempObj);
744
             this.recordInfo.recordData.push(tempObj);
730
           }
745
           }
731
         }
746
         }

+ 20 - 10
src/xt_pages/stock/stockOutOrder.vue Ver arquivo

19
           style="width: 400px;"
19
           style="width: 400px;"
20
           class="filter-item"
20
           class="filter-item"
21
           v-model.trim="searchKey"
21
           v-model.trim="searchKey"
22
-          placeholder="单据编码/制单人/厂商"
22
+          placeholder="单据编码/制单人/耗材名称"
23
         />
23
         />
24
         <el-button
24
         <el-button
25
           size="small"
25
           size="small"
108
             {{ getXuserName(scope.row.creater) }}
108
             {{ getXuserName(scope.row.creater) }}
109
           </template>
109
           </template>
110
         </el-table-column>
110
         </el-table-column>
111
+
112
+       <el-table-column label="出库方式" align="center">
113
+          <template slot-scope="scope">
114
+            <span v-if="scope.row.is_sys == 1">自动出库</span>
115
+            <span v-if="scope.row.is_sys == 0">手动出库</span>
116
+          </template>
117
+        </el-table-column>
111
        
118
        
112
 
119
 
113
         <el-table-column label="操作" align="center" width="300px">
120
         <el-table-column label="操作" align="center" width="300px">
213
               {{ getManufactuerName(scope.row.manufacturer)}}
220
               {{ getManufactuerName(scope.row.manufacturer)}}
214
             </template>
221
             </template>
215
           </el-table-column>
222
           </el-table-column>
216
-          <!-- <el-table-column label="生产日期" align="center">
223
+          <el-table-column label="经销商" align="center">
224
+            <template slot-scope="scope">
225
+              {{getDealerName(scope.row.dealer) }}
226
+            </template>
227
+          </el-table-column>
228
+          <el-table-column label="生产日期" align="center">
217
             <template slot-scope="scope">
229
             <template slot-scope="scope">
218
-              {{ getTime(scope.row.product_date)}}
230
+              {{ getTime(scope.row.product_date,"{y}-{h}-{d}")}}
219
             </template>
231
             </template>
220
           </el-table-column>
232
           </el-table-column>
221
           <el-table-column label="有效期" align="center">
233
           <el-table-column label="有效期" align="center">
222
             <template slot-scope="scope">
234
             <template slot-scope="scope">
223
-              {{ getTime(scope.row.expiry_date)}}
235
+              {{ getTime(scope.row.expiry_date,"{y}-{h}-{d}")}}
224
             </template>
236
             </template>
225
-          </el-table-column> -->
237
+          </el-table-column>
226
           <el-table-column label="备注" align="center">
238
           <el-table-column label="备注" align="center">
227
             <template slot-scope="scope">
239
             <template slot-scope="scope">
228
               {{ scope.row.remark }}
240
               {{ scope.row.remark }}
818
           return false;
830
           return false;
819
         } else {
831
         } else {
820
           console.log("parsm",response.data.data)
832
           console.log("parsm",response.data.data)
833
+          
821
           this.total = response.data.data.total;
834
           this.total = response.data.data.total;
822
           for (let i = 0; i < response.data.data.list.length; i++) {
835
           for (let i = 0; i < response.data.data.list.length; i++) {
823
             
836
             
936
       }
949
       }
937
     },
950
     },
938
     handleEdit: function(index, row) {
951
     handleEdit: function(index, row) {
939
-      // this.$router.push({
940
-      //   name: "stockOutDetail",
941
-      //   query: { id: row.id, type: this.type,warehouse_out_time:row.warehouse_out_time }
942
-      // });
943
-      this.$router.push({path:'/stock/stockoutorderedit?id='+row.id})
952
+      
953
+      this.$router.push({path:'/stock/stockoutorderedit?id='+row.id+"&is_sys="+row.is_sys})
944
        
954
        
945
     },
955
     },
946
     handleDelete: function(index, row) {
956
     handleDelete: function(index, row) {

+ 48 - 10
src/xt_pages/stock/stockOutOrderAdd.vue Ver arquivo

164
               <span>批号<span style="color: red"></span></span>
164
               <span>批号<span style="color: red"></span></span>
165
             </template>
165
             </template>
166
             <template slot-scope="scope">
166
             <template slot-scope="scope">
167
-               <!-- <el-input placeholder="请输入批号" v-model="scope.row.number"></el-input> -->
168
-                <el-select v-model="scope.row.number" filterable placeholder="请选择">
167
+               <el-input placeholder="请输入批号" v-model="scope.row.number"></el-input>
168
+                <!-- <el-select v-model="scope.row.number" filterable placeholder="请选择">
169
                   <el-option
169
                   <el-option
170
                     v-for="(item,index) in numberList"
170
                     v-for="(item,index) in numberList"
171
                     :key="index"
171
                     :key="index"
172
                     :label="item.number"
172
                     :label="item.number"
173
                     :value="item.number">
173
                     :value="item.number">
174
                   </el-option>
174
                   </el-option>
175
-                </el-select>
175
+                </el-select> -->
176
             </template>
176
             </template>
177
           </el-table-column>
177
           </el-table-column>
178
 
178
 
266
 
266
 
267
           <el-table-column label="经销商"  width="150" align="center">
267
           <el-table-column label="经销商"  width="150" align="center">
268
             <template slot-scope="scope">
268
             <template slot-scope="scope">
269
-               <el-select size="small" v-model="scope.row.manufacturer" filterable placeholder="请选择厂商">
269
+               <el-select size="small" v-model="scope.row.dealer" filterable placeholder="请选择厂商">
270
                 <el-option
270
                 <el-option
271
-                  v-for="(option, index) in manufacturerList"
271
+                  v-for="(option, index) in dealerList"
272
                   :key="index"
272
                   :key="index"
273
-                  :label="option.manufacturer_name"
273
+                  :label="option.dealer_name"
274
                   :value="option.id">
274
                   :value="option.id">
275
                 </el-option>
275
                 </el-option>
276
                </el-select>
276
                </el-select>
488
       tempObj["number"] = ""
488
       tempObj["number"] = ""
489
       tempObj["specification_name"] = ""
489
       tempObj["specification_name"] = ""
490
       tempObj["number"] = ""
490
       tempObj["number"] = ""
491
+      tempObj["expiry_date"] = ""
492
+      tempObj["product_date"] = ""
491
       this.recordInfo.recordData.push(tempObj);
493
       this.recordInfo.recordData.push(tempObj);
492
     },
494
     },
493
     handleDelete: function(index, row) {
495
     handleDelete: function(index, row) {
601
             this.$message.success("请添加出库商品");
603
             this.$message.success("请添加出库商品");
602
             return;
604
             return;
603
           }
605
           }
606
+       
604
           for(let i=0;i<this.recordInfo.recordData.length;i++){
607
           for(let i=0;i<this.recordInfo.recordData.length;i++){
608
+            if(this.recordInfo.recordData[i].expiry_date == "" || this.recordInfo.recordData[i].expiry_date == undefined){
609
+              this.recordInfo.recordData[i].expiry_date = ""
610
+            } 
611
+            if(this.recordInfo.recordData[i].product_date == "" || this.recordInfo.recordData[i].product_date == undefined){
612
+              this.recordInfo.recordData[i].product_date = ""
613
+            }
614
+           
605
              this.recordInfo.recordData[i].price = this.recordInfo.recordData[i].price.toString()
615
              this.recordInfo.recordData[i].price = this.recordInfo.recordData[i].price.toString()
606
           }
616
           }
607
           for(let i=0;i<this.recordInfo.recordData.length;i++){
617
           for(let i=0;i<this.recordInfo.recordData.length;i++){
610
                  this.recordInfo.recordData[i].manufacturer = this.manufacturerList[j].id
620
                  this.recordInfo.recordData[i].manufacturer = this.manufacturerList[j].id
611
               }
621
               }
612
             }
622
             }
623
+            for(let z=0;z<this.dealerList.length;z++){
624
+              if(this.recordInfo.recordData[i].dealer == this.dealerList[z].dealer_name){
625
+                  this.recordInfo.recordData[i].dealer = this.dealerList[z].id
626
+              }
627
+            }
613
           }
628
           }
614
           const params = {
629
           const params = {
615
             stockOut: this.recordInfo.recordData
630
             stockOut: this.recordInfo.recordData
624
             this.type
639
             this.type
625
           ).then(response => {
640
           ).then(response => {
626
             if (response.data.state == 0) {
641
             if (response.data.state == 0) {
627
-              this.$message.error(response.data.msg);
642
+              // this.$message.error(response.data.msg);
643
+              this.$message.error("库存不足")
628
               return false;
644
               return false;
629
             } else {
645
             } else {
630
-              this.$message.success("出库成功");
631
-              this.recordInfo.recordData = [];
632
-              this.$router.back(-1);
646
+               var msg = response.data.data.msg
647
+               var good_name = response.data.data.good_name
648
+               var specification_name = response.data.data.specification_name
649
+               var str = good_name +"*" + specification_name +"无库存,请入库"
650
+               console.log("msg222222222",msg)
651
+               if(msg == 1){
652
+                  this.$message.error(str)
653
+               }
654
+               if(msg == 2){
655
+                 this.$message.success("出库成功");
656
+                 this.recordInfo.recordData = [];
657
+                 this.$router.back(-1);
658
+               }
659
+             
660
+             
633
             }
661
             }
634
           });
662
           });
635
         } else {
663
         } else {
657
             this.goodList = list
685
             this.goodList = list
658
             var manufacturerList = response.data.data.manufacturerList
686
             var manufacturerList = response.data.data.manufacturerList
659
             this.manufacturerList = manufacturerList
687
             this.manufacturerList = manufacturerList
688
+            var dealerList =  response.data.data.dealerList
689
+            this.dealerList = dealerList
660
             for(let i=0;i<this.goodList.length;i++){
690
             for(let i=0;i<this.goodList.length;i++){
661
               for(let j=0;j<this.manufacturerList.length;j++){
691
               for(let j=0;j<this.manufacturerList.length;j++){
662
                 if(this.goodList[i].manufacturer == this.manufacturerList[j].id){
692
                 if(this.goodList[i].manufacturer == this.manufacturerList[j].id){
663
                     this.goodList[i].manufacturer = this.manufacturerList[j].manufacturer_name
693
                     this.goodList[i].manufacturer = this.manufacturerList[j].manufacturer_name
664
                 }
694
                 }
665
               }
695
               }
696
+
697
+              for(let z=0;z<this.dealerList.length;z++){
698
+                if(this.goodList[i].dealer == this.dealerList[z].id){
699
+                   this.goodList[i].dealer = this.dealerList[z].dealer_name
700
+                }
701
+              }
666
             }
702
             }
703
+         
667
           
704
           
668
             cb(this.goodList)
705
             cb(this.goodList)
669
         } else {
706
         } else {
687
             this.recordInfo.recordData[i].price = val.buy_price
724
             this.recordInfo.recordData[i].price = val.buy_price
688
             this.recordInfo.recordData[i].specification_name = val.specification_name
725
             this.recordInfo.recordData[i].specification_name = val.specification_name
689
             this.recordInfo.recordData[i].good_id = val.id
726
             this.recordInfo.recordData[i].good_id = val.id
727
+            this.recordInfo.recordData[i].dealer = val.dealer
690
          }
728
          }
691
       }
729
       }
692
 
730
 

+ 10 - 6
src/xt_pages/stock/stockOutOrderDetailPrint.vue Ver arquivo

53
                                 <tr>
53
                                 <tr>
54
                                   <td>合计</td>
54
                                   <td>合计</td>
55
                                   <td colspan="7"></td>
55
                                   <td colspan="7"></td>
56
-                                  <td>{{allPrice.toFixed(2)}}</td>
56
+                                  <td>{{getAllPice(it.id).toFixed(2)}}</td>
57
                                </tr>
57
                                </tr>
58
                             </tbody>
58
                             </tbody>
59
                         </table>
59
                         </table>
326
              }
326
              }
327
              console.log("详情打印222222",list)
327
              console.log("详情打印222222",list)
328
              this.tableList = order
328
              this.tableList = order
329
-             var total_price = 0
330
-             for(let i=0;i<list.length;i++){
331
-               total_price += response.data.data.list[i].price * response.data.data.list[i].count
332
-             }
333
-             this.allPrice =  total_price
334
            }
329
            }
335
         })
330
         })
336
      },
331
      },
332
+     getAllPice(id){
333
+        var  total_price = 0 
334
+        for(let i=0;i<this.orderList.length;i++){
335
+          if(id == this.orderList[i].warehouse_out_id){
336
+             total_price += this.orderList[i].count * this.orderList[i].price
337
+          }
338
+        }
339
+        return total_price
340
+      }
337
 
341
 
338
     },
342
     },
339
     created(){
343
     created(){

+ 113 - 92
src/xt_pages/stock/stockOutOrderEdit.vue Ver arquivo

32
       </div>
32
       </div>
33
 
33
 
34
 
34
 
35
-      <!-- <div class="cell clearfix">
36
-        <label class="title"><span class="name">经销商</span> : </label>
37
-        <el-select size="small" v-model="form.dealer" clearable placeholder="请选择经销商" @change="changeDealer" style="width: 200px;">
38
-          <el-option
39
-            v-for="(option, index) in dealer"
40
-            :key="index"
41
-            :label="option.dealer_name"
42
-            :value="option.id">
43
-          </el-option>
44
-        </el-select>
45
-      </div> -->
46
-
47
-
48
-      <!-- <div class="cell clearfix">
49
-        <label class="title"><span class="name">厂商</span> : </label>
50
-        <el-select size="small" v-model="form.manufacturer" clearable placeholder="请选择厂商" @change="changeManufacturer" style="width: 200px;">
51
-          <el-option
52
-            v-for="(option, index) in manufacturer"
53
-            :key="index"
54
-            :label="option.manufacturer_name"
55
-            :value="option.id">
56
-          </el-option>
57
-        </el-select>
58
-      </div> -->
35
+    
36
+
37
+
59
 
38
 
60
       <el-form :rules="tableRules" :model="recordInfo" ref="tableForm">
39
       <el-form :rules="tableRules" :model="recordInfo" ref="tableForm">
61
         <el-table :data="recordInfo.recordData" :class="signAndWeighBoxPatients" style="width: 100%" border
40
         <el-table :data="recordInfo.recordData" :class="signAndWeighBoxPatients" style="width: 100%" border
80
                       @select="handleSelect"
59
                       @select="handleSelect"
81
                       @input="changeGoodName(scope.$index)"
60
                       @input="changeGoodName(scope.$index)"
82
                       style="width:150px;"
61
                       style="width:150px;"
62
+                      :disabled="stockShow"
83
                     >
63
                     >
84
                       <i class="el-icon-search el-input__icon" slot="suffix"></i>
64
                       <i class="el-icon-search el-input__icon" slot="suffix"></i>
85
                     <template slot-scope="{ item }">
65
                     <template slot-scope="{ item }">
97
             <template slot-scope="scope">
77
             <template slot-scope="scope">
98
               <el-form-item style="padding-top: 20px">
78
               <el-form-item style="padding-top: 20px">
99
                 <el-input
79
                 <el-input
80
+                 :disabled="stockShow"
100
                   placeholder="请输入商品类型"
81
                   placeholder="请输入商品类型"
101
                   v-model="scope.row.good_type_id"
82
                   v-model="scope.row.good_type_id"
102
                   :value="typeName(scope.row.good_type_id)"
83
                   :value="typeName(scope.row.good_type_id)"
112
             </template>
93
             </template>
113
             <template slot-scope="scope">
94
             <template slot-scope="scope">
114
               <el-form-item style="padding-top: 20px">
95
               <el-form-item style="padding-top: 20px">
115
-                <el-input v-model="scope.row.name"></el-input>
96
+                <el-input v-model="scope.row.name"  :disabled="stockShow"></el-input>
116
               </el-form-item>
97
               </el-form-item>
117
             </template>
98
             </template>
118
           </el-table-column>
99
           </el-table-column>
123
             </template>
104
             </template>
124
             <template slot-scope="scope">
105
             <template slot-scope="scope">
125
               <el-form-item style="padding-top: 20px">
106
               <el-form-item style="padding-top: 20px">
126
-               <el-select v-model="scope.row.number" filterable placeholder="请选择">
107
+                <el-input placeholder="请输入批号" v-model="scope.row.number"  :disabled="stockShow"></el-input>
108
+               <!-- <el-select v-model="scope.row.number" filterable placeholder="请选择">
127
                   <el-option
109
                   <el-option
128
                     v-for="(item,index) in numberList"
110
                     v-for="(item,index) in numberList"
129
                     :key="index"
111
                     :key="index"
130
                     :label="item.number"
112
                     :label="item.number"
131
                     :value="item.number">
113
                     :value="item.number">
132
                   </el-option>
114
                   </el-option>
133
-                </el-select>
115
+                </el-select> -->
134
               </el-form-item>
116
               </el-form-item>
135
             </template>
117
             </template>
136
           </el-table-column>
118
           </el-table-column>
137
          
119
          
138
-          <el-table-column min-width="23" align="center">
120
+          <el-table-column width="150" align="center">
139
             <template slot="header" slot-scope="scope">
121
             <template slot="header" slot-scope="scope">
140
               <span>单价<span style="color: red">*</span></span>
122
               <span>单价<span style="color: red">*</span></span>
141
             </template>
123
             </template>
143
               <!--<el-input type="number" v-model="scope.row.price"  @blur="handleBlur(scope.$index, scope.row)"></el-input>-->
125
               <!--<el-input type="number" v-model="scope.row.price"  @blur="handleBlur(scope.$index, scope.row)"></el-input>-->
144
               <el-form-item :prop="'recordData.' + scope.$index + '.price'" :rules='tableRules.price'
126
               <el-form-item :prop="'recordData.' + scope.$index + '.price'" :rules='tableRules.price'
145
                             style="padding-top: 17px">
127
                             style="padding-top: 17px">
146
-                <el-input type="number" v-model="scope.row.price"></el-input>
128
+                <el-input type="number" v-model="scope.row.price"  :disabled="stockShow"></el-input>
147
               </el-form-item>
129
               </el-form-item>
148
 
130
 
149
 
131
 
150
             </template>
132
             </template>
151
           </el-table-column>
133
           </el-table-column>
152
 
134
 
153
-          <el-table-column min-width="23" align="center">
135
+          <el-table-column width="150" align="center">
154
             <template slot="header" slot-scope="scope">
136
             <template slot="header" slot-scope="scope">
155
               <span>出库数量<span style="color: red">*</span></span>
137
               <span>出库数量<span style="color: red">*</span></span>
156
             </template>
138
             </template>
157
             <template slot-scope="scope">
139
             <template slot-scope="scope">
158
               <el-form-item :prop="'recordData.' + scope.$index + '.count'" :rules='tableRules.count'
140
               <el-form-item :prop="'recordData.' + scope.$index + '.count'" :rules='tableRules.count'
159
                             style="padding-top: 17px">
141
                             style="padding-top: 17px">
160
-                <el-input type="number" v-model="scope.row.count"></el-input>
142
+                <el-input type="number" v-model="scope.row.count"  :disabled="stockShow"></el-input>
161
               </el-form-item>
143
               </el-form-item>
162
             </template>
144
             </template>
163
           </el-table-column>
145
           </el-table-column>
164
 
146
 
165
-          <el-table-column label="总价" min-width="20" align="center">
147
+          <el-table-column label="总价" width="150" align="center">
166
             <template slot-scope="scope">
148
             <template slot-scope="scope">
167
               {{calculate(scope.row.price*scope.row.count)}}
149
               {{calculate(scope.row.price*scope.row.count)}}
168
             </template>
150
             </template>
169
           </el-table-column>
151
           </el-table-column>
170
           <el-table-column label="生产厂商"  width="150" align="center">
152
           <el-table-column label="生产厂商"  width="150" align="center">
171
             <template slot-scope="scope">
153
             <template slot-scope="scope">
172
-               <el-select size="small" v-model="scope.row.manufacturer" filterable placeholder="请选择厂商">
154
+               <el-select size="small" v-model="scope.row.manufacturer" filterable placeholder="请选择厂商"  :disabled="stockShow">
173
                 <el-option
155
                 <el-option
174
                   v-for="(option, index) in manufacturerList"
156
                   v-for="(option, index) in manufacturerList"
175
                   :key="index"
157
                   :key="index"
179
                </el-select>
161
                </el-select>
180
             </template>   
162
             </template>   
181
           </el-table-column>
163
           </el-table-column>
182
-          <el-table-column label="备注" min-width="20" align="center">
164
+         <el-table-column label="生产日期"  width="150" align="center">
165
+           <template slot-scope="scope">
166
+              <el-date-picker
167
+               :disabled="stockShow"
168
+                prefix-icon="el-icon-date"
169
+                style="width: 145px"
170
+                v-model="scope.row.product_date"
171
+                type="date"
172
+                placeholder="选择日期时间"
173
+                format="yyyy-MM-dd"
174
+                value-format="yyyy-MM-dd"
175
+              ></el-date-picker>
176
+            </template>
177
+         </el-table-column>
178
+
179
+          <el-table-column label="有效期"  width="150" align="center">
180
+            <template slot-scope="scope">
181
+              <el-date-picker
182
+               :disabled="stockShow"
183
+                prefix-icon="el-icon-date"
184
+                style="width: 145px"
185
+                v-model="scope.row.expiry_date"
186
+                type="date"
187
+                placeholder="选择日期时间"
188
+                format="yyyy-MM-dd"
189
+                value-format="yyyy-MM-dd"
190
+              ></el-date-picker>
191
+            </template>
192
+          </el-table-column>
193
+         
194
+
195
+          <el-table-column label="经销商"  width="150" align="center">
196
+            <template slot-scope="scope">
197
+               <el-select size="small" v-model="scope.row.dealer" filterable placeholder="请选择厂商"  :disabled="stockShow">
198
+                <el-option
199
+                  v-for="(option, index) in dealerList"
200
+                  :key="index"
201
+                  :label="option.dealer_name"
202
+                  :value="option.id">
203
+                </el-option>
204
+               </el-select>
205
+            </template>   
206
+          </el-table-column>
207
+
208
+          <el-table-column label="备注" width="150" align="center">
183
             <template slot-scope="scope">
209
             <template slot-scope="scope">
184
-              <el-input v-model="scope.row.remark"></el-input>
210
+              <el-input v-model="scope.row.remark"  :disabled="stockShow"></el-input>
185
             </template>
211
             </template>
186
           </el-table-column>
212
           </el-table-column>
187
-          <el-table-column label="操作" align="center" min-width="30"  fixed="right">
213
+          <el-table-column label="操作" align="center" width="150"  fixed="right">
188
             <template slot-scope="scope">
214
             <template slot-scope="scope">
189
               <el-tooltip class="item" effect="dark" content="新增" placement="top">
215
               <el-tooltip class="item" effect="dark" content="新增" placement="top">
190
 
216
 
286
         goodType: [],
312
         goodType: [],
287
         goodInfo:[],
313
         goodInfo:[],
288
         numberList:[],
314
         numberList:[],
315
+        stockShow:false
289
       }
316
       }
290
     },
317
     },
291
     methods: {
318
     methods: {
365
         return name;
392
         return name;
366
       }, 
393
       }, 
367
       handleEdit: function(index, row) {
394
       handleEdit: function(index, row) {
395
+        if(this.stockShow == true){
396
+         this.$message.error("自动出库数据无法编辑")
397
+         return
398
+        }
368
         const tempObj = {}
399
         const tempObj = {}
369
         tempObj['id'] = 0
400
         tempObj['id'] = 0
370
         tempObj['good_type_id'] = 0
401
         tempObj['good_type_id'] = 0
374
         tempObj['remark'] = ''
405
         tempObj['remark'] = ''
375
         tempObj['number'] = ""
406
         tempObj['number'] = ""
376
         this.recordInfo.recordData.push(tempObj)
407
         this.recordInfo.recordData.push(tempObj)
377
-      }, handleDelete: function(index, row) {
408
+      }, 
409
+      handleDelete: function(index, row) {
410
+        if(this.stockShow == true){
411
+         this.$message.error("自动出库数据无法删除")
412
+         return
413
+        }
378
         if (row.id == 0) {
414
         if (row.id == 0) {
379
           this.recordInfo.recordData.splice(index, 1)
415
           this.recordInfo.recordData.splice(index, 1)
380
         } else {
416
         } else {
488
               }
524
               }
489
             }
525
             }
490
             for(let i=0;i<this.recordInfo.recordData.length;i++){
526
             for(let i=0;i<this.recordInfo.recordData.length;i++){
527
+              if(this.recordInfo.recordData[i].expiry_date == "" || this.recordInfo.recordData[i].expiry_date == undefined){
528
+                this.recordInfo.recordData[i].expiry_date = ""
529
+              } 
530
+              if(this.recordInfo.recordData[i].product_date == "" || this.recordInfo.recordData[i].product_date == undefined){
531
+                this.recordInfo.recordData[i].product_date = ""
532
+              }
491
                this.recordInfo.recordData[i].price = this.recordInfo.recordData[i].price.toString()
533
                this.recordInfo.recordData[i].price = this.recordInfo.recordData[i].price.toString()
534
+            
492
               for(let j=0;j<this.manufacturerList.length;j++){
535
               for(let j=0;j<this.manufacturerList.length;j++){
493
                 if(this.recordInfo.recordData[i].manufacturer == this.manufacturerList[j].manufacturer_name){
536
                 if(this.recordInfo.recordData[i].manufacturer == this.manufacturerList[j].manufacturer_name){
494
                   this.recordInfo.recordData[i].manufacturer = this.manufacturerList[j].id
537
                   this.recordInfo.recordData[i].manufacturer = this.manufacturerList[j].id
495
                 }
538
                 }
496
               }
539
               }
540
+              for(let z=0;z<this.dealerList.length;z++){
541
+                if(this.recordInfo.recordData[i].dealer == this.dealerList[z].dealer_name){
542
+                    this.recordInfo.recordData[i].dealer = this.dealerList[z].id
543
+                }
544
+              }
497
             }
545
             }
498
             const params = {
546
             const params = {
499
               'stockOut': this.recordInfo.recordData
547
               'stockOut': this.recordInfo.recordData
500
             }
548
             }
501
            
549
            
502
-            for(let i=0;i<this.goodList.length;i++){
503
-             
504
-            }
505
-
506
-           
507
             console.log("stockout",params)
550
             console.log("stockout",params)
508
-          
551
+            
509
             editWarehouseoutInfo(params, this.warehouse_out_time, this.$route.query.id, this.$route.query.type, this.form.manufacturer, this.form.dealer).then(response => {
552
             editWarehouseoutInfo(params, this.warehouse_out_time, this.$route.query.id, this.$route.query.type, this.form.manufacturer, this.form.dealer).then(response => {
510
               if (response.data.state == 0) {
553
               if (response.data.state == 0) {
511
                 this.$message.error(response.data.msg)
554
                 this.$message.error(response.data.msg)
520
           }
563
           }
521
         })
564
         })
522
       }, 
565
       }, 
523
-      GetOrderDetail: function(order_id) {
524
-        const params = {
525
-          'id': order_id
526
-        }
527
-        getWarehouseOutInfo(params).then(response => {
528
-          if (response.data.state == 0) {
529
-            this.$message.error(response.data.msg)
530
-            return false
531
-          } else {
532
-            console.log("详情",response.data.data.list)
533
-            for (let i = 0; i < response.data.data.list.length; i++) {
534
-              response.data.data.list[i].price = response.data.data.list[i].price.toString()
535
-              response.data.data.list[i].count = response.data.data.list[i].count.toString()
536
-              response.data.data.list[i].good_name = response.data.data.list[i].GoodInfo.good_name
537
-              response.data.data.list[i].name = response.data.data.list[i].GoodInfo.good_name + "*" + response.data.data.list[i].GoodInfo.specification_name
538
-
539
-              this.recordInfo.recordData.push(response.data.data.list[i])
540
-            }
541
-            this.warehouseOut = response.data.data.info
542
-            this.warehouse_out_time = this.getTime(this.warehouseOut.warehouse_out_time, '{y}-{m}-{d}')
543
-            this.form.manufacturer = this.warehouseOut.manufacturer
544
-            this.form.dealer = this.warehouseOut.dealer
545
-
546
-          }
547
-
548
-          if (this.recordInfo.recordData.length == 0) {
549
-            const tempObj = {}
550
-            tempObj['id'] = 0
551
-            tempObj['good_type_id'] = 0
552
-            tempObj['good_id'] = 0
553
-            tempObj['count'] = ''
554
-            tempObj['price'] = ''
555
-            tempObj['remark'] = ''
556
-            this.recordInfo.recordData.push(tempObj)
557
-          }
558
-        })
559
-      }, calculate: function(val) {
566
+     calculate: function(val) {
560
         if (val == 0) {
567
         if (val == 0) {
561
           return ''
568
           return ''
562
         }
569
         }
585
                     this.goodList[i].manufacturer = this.manufacturerList[j].manufacturer_name
592
                     this.goodList[i].manufacturer = this.manufacturerList[j].manufacturer_name
586
                 }
593
                 }
587
               }
594
               }
595
+             for(let z=0;z<this.dealerList.length;z++){
596
+                if(this.goodList[i].dealer == this.dealerList[z].id){
597
+                   this.goodList[i].dealer = this.dealerList[z].dealer_name
598
+                }
599
+              }
588
             }
600
             }
589
           
601
           
590
             cb(this.goodList)
602
             cb(this.goodList)
609
             this.recordInfo.recordData[i].price = val.buy_price
621
             this.recordInfo.recordData[i].price = val.buy_price
610
             this.recordInfo.recordData[i].specification_name = val.specification_name
622
             this.recordInfo.recordData[i].specification_name = val.specification_name
611
             this.recordInfo.recordData[i].good_id = val.id
623
             this.recordInfo.recordData[i].good_id = val.id
624
+             this.recordInfo.recordData[i].dealer = val.dealer
612
          }
625
          }
613
       }
626
       }
614
-      console.log("hhhhh232323232",val.xt_warehouse_info)
615
-      if(val.xt_warehouse_info.length > 0){
616
-         console.log("hhhhhhhhhh")
617
-          for(let j=0;j<val.xt_warehouse_info.length;j++){
618
-            this.numberList.push(val.xt_warehouse_info[j])
619
-          }
620
-         this.recordInfo.recordData[i].number = val.xt_warehouse_info[0].number
621
-      }else{
622
-        this.recordInfo.recordData[i].number = ""
623
-      }
627
+      // if(val.xt_warehouse_info.length > 0){
628
+      //     for(let j=0;j<val.xt_warehouse_info.length;j++){
629
+      //       this.numberList.push(val.xt_warehouse_info[j])
630
+      //     }
631
+      //    this.recordInfo.recordData[i].number = val.xt_warehouse_info[0].number
632
+      // }else{
633
+      //   this.recordInfo.recordData[i].number = ""
634
+      // }
624
     },
635
     },
625
      getSingleOutOrderDetail(order_id){
636
      getSingleOutOrderDetail(order_id){
626
        const params = {
637
        const params = {
632
           var dealerList = response.data.data.dealerList
643
           var dealerList = response.data.data.dealerList
633
           this.dealerList = dealerList
644
           this.dealerList = dealerList
634
           var manufacturerList = response.data.data.manufacturerList
645
           var manufacturerList = response.data.data.manufacturerList
635
-          console.log("hhhhhhhhh",manufacturerList)
646
+          // console.log("hhhhhhhhh",manufacturerList)
636
           this.manufacturerList = manufacturerList
647
           this.manufacturerList = manufacturerList
637
           this.goodType = response.data.data.goodType
648
           this.goodType = response.data.data.goodType
638
           for (let i = 0; i < response.data.data.list.length; i++) {
649
           for (let i = 0; i < response.data.data.list.length; i++) {
642
             response.data.data.list[i].good_name = response.data.data.list[i].good_name
653
             response.data.data.list[i].good_name = response.data.data.list[i].good_name
643
             response.data.data.list[i].name = response.data.data.list[i].specification_name + "/" + response.data.data.list[i].packing_unit
654
             response.data.data.list[i].name = response.data.data.list[i].specification_name + "/" + response.data.data.list[i].packing_unit
644
             response.data.data.list[i].good_type_id = response.data.data.list[i].good_type_id
655
             response.data.data.list[i].good_type_id = response.data.data.list[i].good_type_id
645
-            this.numberList.push(response.data.data.list[i])
656
+            response.data.data.list[i].expiry_date = this.getTime(response.data.data.list[i].expiry_date,"{y}-{m}-{d}")
657
+            response.data.data.list[i].product_date = this.getTime(response.data.data.list[i].product_date,"{y}-{m}-{d}")
658
+            response.data.data.list[i].remark = response.data.data.list[i].remark
659
+            // this.numberList.push(response.data.data.list[i])
646
             this.recordInfo.recordData.push(response.data.data.list[i])
660
             this.recordInfo.recordData.push(response.data.data.list[i])
647
           }
661
           }
648
          
662
          
664
       this.propForm.goodUnit = this.$store.getters.good_unit
678
       this.propForm.goodUnit = this.$store.getters.good_unit
665
       const order_id = this.$route.query.id  
679
       const order_id = this.$route.query.id  
666
       this.getSingleOutOrderDetail(order_id)
680
       this.getSingleOutOrderDetail(order_id)
681
+      var is_sys = this.$route.query.is_sys
682
+      if(is_sys == 0){
683
+        this.stockShow = false
684
+      }
685
+      if(is_sys == 1){
686
+        this.stockShow = true
687
+      }
667
     }
688
     }
668
 
689
 
669
   }
690
   }

+ 25 - 5
src/xt_pages/stock/stockQuery.vue Ver arquivo

165
 export default {
165
 export default {
166
   name: "stockIn",
166
   name: "stockIn",
167
   created() {
167
   created() {
168
+    var nowDate = new Date();
169
+    var nowYear = nowDate.getFullYear();
170
+    var nowMonth = nowDate.getMonth() + 1;
171
+    var nowDay = nowDate.getDate();
172
+    this.end_time =
173
+      nowYear +
174
+      "-" +
175
+      (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
176
+      "-" +
177
+      (nowDay < 10 ? "0" + nowDay : nowDay);
178
+    nowDate.setMonth(nowDate.getMonth() - 1);
179
+    nowYear = nowDate.getFullYear();
180
+    nowMonth = nowDate.getMonth() + 1;
181
+    nowDay = nowDate.getDate();
182
+    this.start_time =
183
+      nowYear +
184
+      "-" +
185
+      (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
186
+      "-" +
187
+      (nowDay < 10 ? "0" + nowDay : nowDay);
168
     this.GetAllGoodInfo();
188
     this.GetAllGoodInfo();
169
     this.GetAllGoodType();
189
     this.GetAllGoodType();
170
     this.getlist()
190
     this.getlist()
373
     exportList(){
393
     exportList(){
374
          import('@/vendor/Export2Excel').then(excel => {
394
          import('@/vendor/Export2Excel').then(excel => {
375
 
395
 
376
-         const tHeader = ['耗材类型', '耗材名称', '规格&单位','规格型号','进货单价','生产商','入库数量','出库数量','库存剩余量']
377
-         const filterVal = ['type_name', 'good_name', 'unit','specification_name','price','prodect_name','inCount','outCount','overplus']
396
+         const tHeader = ['耗材类型', '耗材名称', '规格&单位','进货单价','生产商','入库数量','出库数量','库存剩余量']
397
+         const filterVal = ['type_name', 'good_name', 'unit','price','prodect_name','inCount','outCount','overplus']
378
 
398
 
379
        
399
        
380
          for(let i=0;i<this.tableList.length;i++){
400
          for(let i=0;i<this.tableList.length;i++){
505
       })
525
       })
506
     },
526
     },
507
     getInCount(id){
527
     getInCount(id){
508
-      var count= ""
528
+      var count= 0
509
      for(let i=0;i<this.countList.length;i++){
529
      for(let i=0;i<this.countList.length;i++){
510
       if(id == this.countList[i].good_id){
530
       if(id == this.countList[i].good_id){
511
           count = this.countList[i].count
531
           count = this.countList[i].count
514
      return count
534
      return count
515
     },
535
     },
516
     getOutCount(id){
536
     getOutCount(id){
517
-      var count = ""
537
+      var count = 0
518
       for(let i=0;i<this.outCountList.length;i++){
538
       for(let i=0;i<this.outCountList.length;i++){
519
          if(id == this.outCountList[i].good_id){
539
          if(id == this.outCountList[i].good_id){
520
            count = this.outCountList[i].count
540
            count = this.outCountList[i].count
523
       return count
543
       return count
524
     },
544
     },
525
    getAutoCount(id){
545
    getAutoCount(id){
526
-     var count= ""
546
+     var count= 0
527
      for(let i=0;i<this.autoCountList.length;i++){
547
      for(let i=0;i<this.autoCountList.length;i++){
528
        if(id == this.autoCountList[i].good_id){
548
        if(id == this.autoCountList[i].good_id){
529
          count = this.autoCountList[i].count
549
          count = this.autoCountList[i].count