Преглед изворни кода

11月14日 库存扣减更新

XMLWAN пре 3 година
родитељ
комит
b0b43d0fff

+ 15 - 1
src/xt_pages/stock/drugs/drugStockInOrder.vue Прегледај датотеку

@@ -618,7 +618,7 @@ export default {
618 618
     handleEdit:function(index,row){
619 619
        this.$router.push({
620 620
          name:"drugStockInOrderEdit",
621
-         query:{id:row.id,type:this.type}
621
+         query:{id:row.id,type:this.type,supply_warehouse_id:row.supply_warehouse_id}
622 622
        })
623 623
     },
624 624
     handleSearch(id){
@@ -649,6 +649,11 @@ export default {
649 649
       });
650 650
     },
651 651
     handleDelete: function(index, row) {
652
+      console.log("rowe23323223",row)
653
+      if(row.supply_warehouse_id >0 ){
654
+        this.$message.error("自动入库数据不能删除!")
655
+        return false
656
+      }
652 657
       const ids = [];
653 658
       ids.push(row.id);
654 659
       const idStr = ids.join(",");
@@ -709,8 +714,17 @@ export default {
709 714
         return;
710 715
       }
711 716
       const ids = [];
717
+      const idOne = []
712 718
       for (let i = 0; i < this.selectedTableData.length; i++) {
713 719
         ids.push(this.selectedTableData[i].id);
720
+        idOne.push(this.selectedTableData[i].supply_warehouse_id)
721
+      }
722
+      console.log("idson233223233223",idOne)
723
+      for(let i=0;i<idOne.length;i++){
724
+        if(idOne[i] >0 ){
725
+           this.$message.error("自动入库数据不能删除!")
726
+           return false
727
+        }
714 728
       }
715 729
       const idStr = ids.join(",");
716 730
       const params = {

+ 34 - 10
src/xt_pages/stock/drugs/drugStockInOrderEdit.vue Прегледај датотеку

@@ -48,6 +48,7 @@
48 48
           align="right"
49 49
           format="yyyy-MM-dd"
50 50
           value-format="yyyy-MM-dd"
51
+          :disabled="disabled"
51 52
         >
52 53
         </el-date-picker>
53 54
       </div>
@@ -83,7 +84,8 @@
83 84
                     @select="handleSelect"
84 85
                     @input="changeDrugName(scope.$index)"
85 86
                     style="width:160px;"
86
-                    :disabled="drug_show"
87
+                    :disabled="disabled"
88
+                   
87 89
                   >
88 90
                     <i class="el-icon-search el-input__icon" slot="suffix"></i>
89 91
                   <template slot-scope="{ item }">
@@ -99,12 +101,14 @@
99 101
               <span>药品类型</span>
100 102
             </template>
101 103
              <template slot-scope="scope">
102
-               <el-select v-model="scope.row.drug_type" filterable placeholder="请选择厂商">
104
+               <el-select v-model="scope.row.drug_type" filterable placeholder="请选择厂商" :disabled="disabled">
103 105
                 <el-option
104 106
                   v-for="(option, index) in drugTypeList"
105 107
                   :key="index"
106 108
                   :label="option.name"
107
-                  :value="option.id">
109
+                  :value="option.id"
110
+                  
111
+                  >
108 112
                 </el-option>
109 113
                </el-select>
110 114
             </template>
@@ -130,6 +134,7 @@
130 134
               <template slot-scope="scope">
131 135
                 <el-form-item style="padding-top: 20px" :rules="tableRules.batch_number"  :prop="'recordData.' + scope.$index + '.batch_number'">
132 136
                   <el-input
137
+                   :disabled="disabled"
133 138
                     placeholder="请输入批号"
134 139
                     v-model="scope.row.batch_number"
135 140
                   ></el-input>
@@ -150,6 +155,7 @@
150 155
               >
151 156
                 <div style="display:flex;">
152 157
                   <el-input
158
+                   :disabled="disabled"
153 159
                     oninput="value=value.replace(/\D|^0/g,'')"
154 160
                     placeholder="请输入入库数量"
155 161
                     type="number"
@@ -157,12 +163,13 @@
157 163
                     style="width:80px"
158 164
                   ></el-input>
159 165
                    <!-- {{scope.row.max_unit}} -->
160
-                   <el-select v-model="scope.row.max_unit" filterable placeholder="请选择单位" style="width:80px">
166
+                   <el-select v-model="scope.row.max_unit" filterable placeholder="请选择单位" style="width:80px"  :disabled="disabled">
161 167
                     <el-option
162 168
                       v-for="(option, index) in unitList"
163 169
                       :key="index"
164 170
                       :label="option.name"
165
-                      :value="option.name">
171
+                      :value="option.name"
172
+                     >
166 173
                     </el-option>
167 174
                   </el-select>
168 175
                 </div>
@@ -226,6 +233,7 @@
226 233
                 :rules="tableRules.expiry_date"
227 234
                 style="padding-top: 20px">
228 235
                 <el-date-picker
236
+                 :disabled="disabled"
229 237
                   prefix-icon="el-icon-date"
230 238
                   style="width: 145px"
231 239
                   v-model="scope.row.expiry_date"
@@ -241,6 +249,7 @@
241 249
           <el-table-column label="生产日期" width="180" align="center">
242 250
             <template slot-scope="scope">
243 251
               <el-date-picker
252
+              :disabled="disabled"
244 253
                 prefix-icon="el-icon-date"
245 254
                 style="width: 145px"
246 255
                 v-model="scope.row.product_date"
@@ -255,12 +264,13 @@
255 264
              
256 265
           <el-table-column label="生产厂家" width="140" align="center">
257 266
             <template slot-scope="scope">
258
-               <el-select v-model="scope.row.manufacturer" filterable placeholder="请选择厂商">
267
+               <el-select v-model="scope.row.manufacturer" filterable placeholder="请选择厂商"  :disabled="disabled">
259 268
                 <el-option
260 269
                   v-for="(option, index) in manufacturerList"
261 270
                   :key="index"
262 271
                   :label="option.manufacturer_name"
263
-                  :value="option.id">
272
+                  :value="option.id"
273
+                 >
264 274
                 </el-option>
265 275
                </el-select>
266 276
             </template>
@@ -274,7 +284,8 @@
274 284
                   v-for="(option, index) in dealerList"
275 285
                   :key="index"
276 286
                   :label="option.dealer_name"
277
-                  :value="option.id">
287
+                  :value="option.id"
288
+                  :disabled="disabled">
278 289
                 </el-option>
279 290
                 </el-select>
280 291
             </template>
@@ -285,6 +296,7 @@
285 296
             <template slot-scope="scope">
286 297
               <el-form-item style="padding-top: 20px">
287 298
                 <el-input
299
+                 :disabled="disabled"
288 300
                   placeholder="请输入批准文号"
289 301
                   v-model="scope.row.number"
290 302
                 ></el-input>
@@ -294,7 +306,7 @@
294 306
  
295 307
           <el-table-column label="备注" width="150" align="center">
296 308
             <template slot-scope="scope">
297
-              <el-input v-model="scope.row.remark"></el-input>
309
+              <el-input v-model="scope.row.remark" :disabled="disabled"></el-input>
298 310
             </template>
299 311
           </el-table-column>
300 312
 
@@ -439,6 +451,7 @@ export default {
439 451
       unitList:[],
440 452
       drug_show:false,
441 453
       loading:false,
454
+      disabled:false,
442 455
     };
443 456
   },
444 457
   methods: {
@@ -538,6 +551,11 @@ export default {
538 551
       return name;
539 552
     },
540 553
     handleEdit: function(index, row) {
554
+      console.log("row23323223",row)
555
+      if(row.supply_warehouse_id > 0){
556
+        this.$message.error("自动入库数据不能新增!")
557
+        return false
558
+      }
541 559
       const tempObj = {};
542 560
       tempObj["id"] = 0;
543 561
       tempObj["drug_id"] = 0;
@@ -555,6 +573,10 @@ export default {
555 573
       this.recordInfo.recordData.push(tempObj);
556 574
     },
557 575
     handleDelete: function(index, row) {
576
+      if(row.supply_warehouse_id > 0){
577
+        this.$message.error("自动入库数据不能删除!")
578
+        return false
579
+      }
558 580
       if (row.id == 0) {
559 581
         this.recordInfo.recordData.splice(index, 1);
560 582
       } else {
@@ -883,11 +905,13 @@ export default {
883 905
   created() {
884 906
    
885 907
     this.drugTypeList = getDictionaryDataConfig('system','drug_type') 
886
-    //this.GetConfigInfo();
887 908
     this.propForm.goodUnit = this.$store.getters.good_unit;
888 909
     const order_id = this.$route.query.id;
889 910
     this.GetOrderDetail(order_id);
890 911
     this.unitList =  getDataConfig('hemodialysis','units')
912
+    if( parseInt(this.$route.query.supply_warehouse_id)>0){
913
+      this.disabled = true
914
+    }
891 915
   }
892 916
 };
893 917
 </script>

+ 17 - 1
src/xt_pages/stock/stockInOrder.vue Прегледај датотеку

@@ -1060,9 +1060,14 @@ export default {
1060 1060
     },
1061 1061
     handleEdit: function(index, row) {
1062 1062
       console.log("rowe232323232332",row)
1063
-      this.$router.push({path:"/stock/in/order/edit?id="+row.id})
1063
+      this.$router.push({path:"/stock/in/order/edit?id="+row.id+"&supply_warehouse_id="+row.supply_warehouse_id})
1064 1064
     },
1065 1065
     handleDelete: function(index, row) {
1066
+     
1067
+      if(row.supply_warehouse_id > 0){
1068
+        this.$message.error("自动生成入库单不能删除!")
1069
+        return false
1070
+      }
1066 1071
       const ids = [];
1067 1072
       ids.push(row.id);
1068 1073
       const idStr = ids.join(",");
@@ -1119,9 +1124,19 @@ export default {
1119 1124
         return;
1120 1125
       }
1121 1126
       const ids = [];
1127
+      const idOne = []
1122 1128
       for (let i = 0; i < this.selectedTableData.length; i++) {
1123 1129
         ids.push(this.selectedTableData[i].id);
1130
+        idOne.push(this.selectedTableData[i].supply_warehouse_id)
1131
+      }
1132
+      console.log("idson23322323",idOne)
1133
+      for(let i=0;i<idOne.length;i++){
1134
+        if(idOne[i] >0){
1135
+          this.$message.error("自动入库数据不能删除!")
1136
+          return false
1137
+        }
1124 1138
       }
1139
+    
1125 1140
       const idStr = ids.join(",");
1126 1141
       const params = {
1127 1142
         ids: idStr
@@ -1368,6 +1383,7 @@ export default {
1368 1383
       },
1369 1384
 
1370 1385
      DeleteWarehouseInfoItem: function(index, row) {
1386
+       
1371 1387
       if (row.id == 0) {
1372 1388
         this.recordInfo.recordData.splice(index, 1);
1373 1389
       } else {

+ 28 - 7
src/xt_pages/stock/stockInOrderEdit.vue Прегледај датотеку

@@ -46,6 +46,7 @@
46 46
           align="right"
47 47
           format="yyyy-MM-dd"
48 48
           value-format="yyyy-MM-dd"
49
+          :disabled="disabled"
49 50
         >
50 51
         </el-date-picker>
51 52
       </div>
@@ -74,6 +75,7 @@
74 75
                     @select="handleSelect"
75 76
                     @input="changeGoodName(scope.$index)"
76 77
                     style="width:150px;"
78
+                    :disabled ="disabled"
77 79
                   >
78 80
                     <i class="el-icon-search el-input__icon" slot="suffix"></i>
79 81
                   <template slot-scope="{ item }">
@@ -93,6 +95,7 @@
93 95
                   placeholder="请输入耗材类型"
94 96
                   v-model="scope.row.good_type_id"
95 97
                   :value="typeName(scope.row.good_type_id)"
98
+                   :disabled ="disabled"
96 99
                 ></el-input>
97 100
               </el-form-item>
98 101
             </template>
@@ -105,7 +108,7 @@
105 108
             <template slot-scope="scope">
106 109
 
107 110
               <el-form-item style="padding-top: 20px">
108
-                <el-input placeholder="请输入规格名称" v-model="scope.row.name"></el-input>
111
+                <el-input placeholder="请输入规格名称" v-model="scope.row.name"  :disabled ="disabled"></el-input>
109 112
               </el-form-item>
110 113
 
111 114
             </template>
@@ -118,7 +121,7 @@
118 121
             <template slot-scope="scope">
119 122
               <el-form-item style="padding-top: 20px" :prop="'recordData.' + scope.$index + '.number'"
120 123
                             :rules='tableRules.number' >
121
-                <el-input placeholder="请输入批号" v-model="scope.row.number"></el-input>
124
+                <el-input placeholder="请输入批号" v-model="scope.row.number"  :disabled ="disabled"></el-input>
122 125
               </el-form-item>
123 126
             </template>
124 127
           </el-table-column>
@@ -172,6 +175,7 @@
172 175
                   placeholder="请输入入库数量"
173 176
                   type="number"
174 177
                   v-model="scope.row.warehousing_count"
178
+                   :disabled ="disabled"
175 179
                 ></el-input>
176 180
                 {{scope.row.min_unit}}
177 181
               </el-form-item>
@@ -192,7 +196,7 @@
192 196
                 :rules="tableRules.expiry_date">
193 197
                 <el-date-picker prefix-icon="el-icon-date" style="width: 145px" v-model="scope.row.expiry_date"
194 198
                                 type="date" placeholder="选择日期时间" format="yyyy-MM-dd"
195
-                                value-format="yyyy-MM-dd">
199
+                                value-format="yyyy-MM-dd"  :disabled ="disabled">
196 200
                 </el-date-picker>
197 201
              </el-form-item>
198 202
             </template>
@@ -209,13 +213,14 @@
209 213
                 placeholder="选择日期时间"
210 214
                 format="yyyy-MM-dd"
211 215
                 value-format="yyyy-MM-dd"
216
+                :disabled ="disabled"
212 217
               ></el-date-picker>
213 218
             </template>
214 219
           </el-table-column>
215 220
 
216 221
            <el-table-column label="生产厂家" align="center" width="150">
217 222
              <template slot-scope="scope">
218
-               <el-select size="small" v-model="scope.row.manufacturer" filterable placeholder="请选择厂商">
223
+               <el-select size="small" v-model="scope.row.manufacturer" filterable placeholder="请选择厂商"  :disabled ="disabled">
219 224
                 <el-option
220 225
                   v-for="(option, index) in manufacturerList"
221 226
                   :key="index"
@@ -237,7 +242,7 @@
237 242
                 <el-input
238 243
                   placeholder="请输入批准文号"
239 244
                   v-model="scope.row.license_number"
240
-                  
245
+                  :disabled ="disabled"
241 246
                 ></el-input>
242 247
               </el-form-item>
243 248
             </template>
@@ -249,14 +254,15 @@
249 254
                   v-for="(option, index) in dealerList"
250 255
                   :key="index"
251 256
                   :label="option.dealer_name"
252
-                  :value="option.id">
257
+                  :value="option.id"
258
+                   :disabled ="disabled">
253 259
                 </el-option>
254 260
                </el-select>
255 261
             </template>
256 262
           </el-table-column>
257 263
           <el-table-column label="备注" width="150" align="center">
258 264
             <template slot-scope="scope">
259
-              <el-input v-model="scope.row.remark"></el-input>
265
+              <el-input v-model="scope.row.remark"  :disabled ="disabled"></el-input>
260 266
             </template>
261 267
           </el-table-column>
262 268
 
@@ -395,6 +401,7 @@ export default {
395 401
       manufacturerList:[],
396 402
       numberList:[],
397 403
       loading:false,
404
+      disabled:false,
398 405
     };
399 406
   },
400 407
   methods: {
@@ -486,6 +493,10 @@ export default {
486 493
       return name;
487 494
     },
488 495
     handleEdit: function(index, row) {
496
+      if(row.supply_warehouse_id > 0){
497
+        this.$message.error("自动入库数据不能新增!")
498
+        return false
499
+      }
489 500
       const tempObj = {};
490 501
       tempObj["id"] = 0;
491 502
       tempObj["good_type_id"] = 0;
@@ -503,6 +514,11 @@ export default {
503 514
       this.recordInfo.recordData.push(tempObj);
504 515
     },
505 516
     handleDelete: function(index, row) {
517
+      console.log("Row2332233232",row)
518
+      if(row.supply_warehouse_id >0){
519
+        this.$message.error("自动入库数据不能删除!")
520
+        return false
521
+      }
506 522
       if (row.id == 0) {
507 523
         this.recordInfo.recordData.splice(index, 1);
508 524
       } else {
@@ -819,7 +835,12 @@ export default {
819 835
     this.GetConfigInfo();
820 836
     this.propForm.goodUnit = this.$store.getters.good_unit;
821 837
     const order_id = this.$route.query.id;
838
+    var supply_warehouse_id =  parseInt(this.$route.query.supply_warehouse_id)  
839
+    if(supply_warehouse_id > 0){
840
+      this.disabled = true
841
+    }
822 842
     this.GetOrderDetail(order_id);
843
+
823 844
   }
824 845
 };
825 846
 </script>

+ 164 - 28
src/xt_pages/supply/components/addGoodOrder.vue Прегледај датотеку

@@ -71,7 +71,9 @@
71 71
             v-show="showTwo"
72 72
             >保存</el-button
73 73
           >
74
-          <el-button size="small" type="primary" @click="checkGoodOrder" >审核</el-button>
74
+          <el-button size="small" type="primary" @click="checkGoodOrder" v-if="is_check == 2" >审核</el-button>
75
+          <el-button size="small" type="primary" @click="MofyGoodOrder" v-if="is_check == 1">反审核</el-button>
76
+          <el-button size="small" type="primary" @click="" v-if="is_check == 1" >生成采购退货单</el-button>
75 77
         </div>
76 78
       </div>
77 79
 
@@ -238,6 +240,18 @@
238 240
             </template>
239 241
           </el-table-column>
240 242
 
243
+           <el-table-column label="拆零零售价" align="center" width="180px">
244
+            <template slot-scope="scope">
245
+              <el-input
246
+                v-model="scope.row.min_price"
247
+                style="width: 140px"
248
+                :disabled="disabled"
249
+                placeholder="请输入拆零零售价"
250
+              ></el-input>
251
+              <div style="visibility: hidden">/</div>
252
+            </template>
253
+          </el-table-column>
254
+
241 255
           <el-table-column label="采购单价" align="center" width="180px">
242 256
             <template slot-scope="scope">
243 257
               <el-input
@@ -449,7 +463,8 @@ import {
449 463
   updateGoodOrder,
450 464
   checkGoodOrderById,
451 465
   getGoodOrderCountList,
452
-  ModefySupplyWarehousing
466
+  ModefySupplyWarehousing,
467
+  MofyGoodOrder
453 468
 } from "@/api/supply";
454 469
 export default {
455 470
   name: "addPurchaseOrder",
@@ -518,7 +533,7 @@ export default {
518 533
       goodList: [],
519 534
       id: 0,
520 535
       disabled: false,
521
-      is_check: 0,
536
+      is_check: 2,
522 537
       dialogVisible: false,
523 538
       arrearage: "",
524 539
       payment: "",
@@ -597,6 +612,7 @@ export default {
597 612
             drugList[i].supply_remake = "";
598 613
             drugList[i].type = 1;
599 614
             drugList[i].supply_price = drugList[i].last_price;
615
+            drugList[i].min_price = drugList[i].min_price
600 616
             drugList[i].name = drugList[i].drug_name;
601 617
             if (drugList[i].max_unit != drugList[i].min_unit) {
602 618
               drugList[i].unitList = [
@@ -652,6 +668,7 @@ export default {
652 668
             goodList[i].name = goodList[i].good_name;
653 669
             goodList[i].unitList = [{ id: 1, name: "" }];
654 670
             goodList[i].supply_unit = goodList[i].packing_unit;
671
+            goodList[i].min_price = goodList[i].retail_price
655 672
             for (let j = 0; j < goodList[i].unitList.length; j++) {
656 673
               goodList[i].unitList[0].name = goodList[i].packing_unit;
657 674
             }
@@ -672,9 +689,9 @@ export default {
672 689
           this.recordInfo.tableList[i].name = val.name;
673 690
           this.recordInfo.tableList[i].supply_name = val.supply_name;
674 691
           this.recordInfo.tableList[i].supply_type = val.supply_type;
675
-          this.recordInfo.tableList[i].supply_specification_name =
676
-            val.supply_specification_name;
692
+          this.recordInfo.tableList[i].supply_specification_name = val.supply_specification_name;
677 693
           this.recordInfo.tableList[i].supply_total = val.supply_total;
694
+          this.recordInfo.tableList[i].min_price = val.min_price  
678 695
           if (val.supply_count == NaN) {
679 696
             this.recordInfo.tableList[i].supply_count = "";
680 697
           } else {
@@ -723,6 +740,7 @@ export default {
723 740
       tempObj["order_number"] = "";
724 741
       tempObj["supply_expiry_date"] = "";
725 742
       tempObj["manufacturer_id"] = "";
743
+      tempObj["min_price"] = ""
726 744
       this.recordInfo.tableList.push(tempObj);
727 745
     },
728 746
     handleDelete: function (index, row) {
@@ -839,7 +857,9 @@ export default {
839 857
       getPurchaseOrderInfo(id, ids).then((response) => {
840 858
         if (response.data.state == 1) {
841 859
           var info = response.data.data.info;
842
-          this.is_check = info.is_check;
860
+          
861
+         
862
+
843 863
           this.id = info.id;
844 864
           this.supplier_name = info.supplier_id;
845 865
           this.rate_of_concession = info.rate_of_concession;
@@ -862,6 +882,7 @@ export default {
862 882
             orderInfo[i].project_id = orderInfo[i].project_id;
863 883
             orderInfo[i].supply_unit = orderInfo[i].supply_unit;
864 884
             orderInfo[i].order_number = orderInfo[i].order_number;
885
+            orderInfo[i].min_price = ""
865 886
             orderInfo[i].supply_total_price = (orderInfo[i].count * orderInfo[i].price).toFixed(2);
866 887
             if (orderInfo[i].is_source == 1) {
867 888
               for (let j = 0; j < drugList.length; j++) {
@@ -919,6 +940,7 @@ export default {
919 940
           this.recordInfo.tableList[i].supply_total_price.toString();
920 941
         this.recordInfo.tableList[i].supply_total =
921 942
           this.recordInfo.tableList[i].supply_total.toString();
943
+          this.recordInfo.tableList[i].min_price = this.recordInfo.tableList[i].min_price.toString()
922 944
 
923 945
         for (let j = 0; j < this.manufactuerList.length; j++) {
924 946
           if (
@@ -944,7 +966,7 @@ export default {
944 966
           var warehousing_id = this.$route.query.id;
945 967
           //判断是否在采购订单数据中做了删除,如果长度相等则代表没有删除,如果不等则代表做了删除或者新增
946 968
           console.log("长度2332233232",this.tableDataList.length)
947
-          console.log("产股2333223232323",this.recordInfo.tableList)
969
+          console.log("产股2333223232323",this.recordInfo.tableList.length)
948 970
           if(this.tableDataList.length != this.recordInfo.tableList.length){
949 971
              warehousing_id = 0
950 972
              for(let i=0;i<this.recordInfo.tableList.length;i++){
@@ -964,6 +986,7 @@ export default {
964 986
               this.showTwo = true;
965 987
               var orderInfo = response.data.data.list;
966 988
               var warehouseOut = response.data.data.warehouseOut;
989
+              console.log("采购单323322323",warehouseOut)
967 990
               this.warese_out_id = warehouseOut.id;
968 991
               this.good_number = warehouseOut.good_number;
969 992
               this.rate_of_concession = warehouseOut.rate_of_concession;
@@ -994,23 +1017,13 @@ export default {
994 1017
                 if (orderInfo[i].is_source == 1) {
995 1018
                   for (let j = 0; j < this.drugList.length; j++) {
996 1019
                     if (orderInfo[i].project_id == this.drugList[j].id) {
997
-                      if (
998
-                        this.drugList[j].max_unit != this.drugList[j].min_unit
999
-                      ) {
1000
-                        orderInfo[i].unitList = [
1001
-                          { id: 1, name: "" },
1002
-                          { id: 2, name: "" },
1003
-                        ];
1004
-                        orderInfo[i].unitList[0].name =
1005
-                          this.drugList[j].max_unit;
1006
-                        orderInfo[i].unitList[1].name =
1007
-                          this.drugList[j].min_unit;
1020
+                      if (this.drugList[j].max_unit != this.drugList[j].min_unit) {
1021
+                        orderInfo[i].unitList = [{ id: 1, name: "" },{ id: 2, name: "" }];
1022
+                        orderInfo[i].unitList[0].name = this.drugList[j].max_unit;
1023
+                        orderInfo[i].unitList[1].name = this.drugList[j].min_unit;
1008 1024
                       }
1009
-                      if (
1010
-                        this.drugList[j].max_unit == this.drugList[j].min_unit
1011
-                      ) {
1012
-                        orderInfo[i].unitList[0].name =
1013
-                          this.drugList[j].max_unit;
1025
+                      if (this.drugList[j].max_unit == this.drugList[j].min_unit) {
1026
+                        orderInfo[i].unitList[0].name = this.drugList[j].max_unit;
1014 1027
                       }
1015 1028
                     }
1016 1029
                   }
@@ -1019,8 +1032,7 @@ export default {
1019 1032
                   for (let j = 0; j < this.goodList.length; j++) {
1020 1033
                     if (orderInfo[i].project_id == this.goodList[j].id) {
1021 1034
                       orderInfo[i].unitList = [{ id: 1, name: "" }];
1022
-                      orderInfo[i].unitList[0].name =
1023
-                        this.goodList[j].packing_unit;
1035
+                      orderInfo[i].unitList[0].name = this.goodList[j].packing_unit;
1024 1036
                     }
1025 1037
                   }
1026 1038
                 }
@@ -1048,7 +1060,7 @@ export default {
1048 1060
           this.recordInfo.tableList[i].supply_total_price.toString();
1049 1061
         this.recordInfo.tableList[i].supply_total =
1050 1062
           this.recordInfo.tableList[i].supply_total.toString();
1051
-
1063
+        this.recordInfo.tableList[i].min_price = this.recordInfo.tableList[i].min_price.toString()
1052 1064
         for (let j = 0; j < this.manufactuerList.length; j++) {
1053 1065
           if (
1054 1066
             this.recordInfo.tableList[i].supply_manufacturer ==
@@ -1099,12 +1111,13 @@ export default {
1099 1111
     checkGoodOrder() {
1100 1112
       var id = this.warese_out_id;
1101 1113
       var warehousing_id = this.id;
1102
-      console.log("id23322332233223",id)
1103
-      console.log("checkGoodOrder23323",warehousing_id)
1114
+      console.log("采购单ID",id)
1115
+      console.log("采购订单ID",warehousing_id)
1104 1116
     
1105 1117
       getGoodOrderCountList(id, warehousing_id).then((response) => {
1106 1118
         if (response.data.state == 1) {
1107 1119
           this.$message.success("审核成功!");
1120
+          
1108 1121
           this.is_check = 1
1109 1122
           this.showOne = false;
1110 1123
           this.showTwo = true;
@@ -1210,6 +1223,128 @@ export default {
1210 1223
         }
1211 1224
       });
1212 1225
     },
1226
+    MofyGoodOrder() {
1227
+      var id = this.warese_out_id;
1228
+      console.log("采购单ID",id)
1229
+      var params = {
1230
+        id: id,
1231
+      };
1232
+      MofyGoodOrder(params).then((response) => {
1233
+        if (response.data.state == 1) {
1234
+          var msg = response.data.data.msg;
1235
+          if (msg == 1) {
1236
+            this.$message.success("反审核成功!");
1237
+            this.is_check = 2
1238
+            this.disabled = false
1239
+            this.Reviewed = false
1240
+            return
1241
+          }
1242
+          if (msg == 2) {
1243
+            var cancelList = response.data.data.cancelList
1244
+            console.log("cancelLIST2332322332232323",cancelList)
1245
+            this.orderList = cancelList
1246
+            this.$refs.Popup.dialogVisible = true
1247
+            return
1248
+          }
1249
+
1250
+          var purcaseOrder = response.data.data.purcaseOrder;
1251
+          console.log("采购订单", purcaseOrder);
1252
+          var goodOrder = response.data.data.goodOrder;
1253
+          console.log("采购单", goodOrder);
1254
+          var drugList = response.data.data.drugList;
1255
+          console.log("druglist23323223", drugList);
1256
+          var ids = "";
1257
+          // 如果采购单没有数据,则代表改订单第一次生成采购订单数据
1258
+          if (goodOrder.length == 0) {
1259
+            this.$router.push({path: "/good/order/add?id=" + id + "&ids=" + ids});
1260
+          }
1261
+          for (let i = 0; i < purcaseOrder.length; i++) {
1262
+            for (let j = 0; j < drugList.length; j++) {
1263
+              if (purcaseOrder[i].is_source == 1) {
1264
+                if (purcaseOrder[i].supply_unit == drugList[j].max_unit) {
1265
+                  purcaseOrder[i].count = purcaseOrder[i].count * drugList[j].min_number;
1266
+                }
1267
+              }
1268
+            }
1269
+          }
1270
+
1271
+          for (let i = 0; i < goodOrder.length; i++) {
1272
+            for (let j = 0; j < drugList.length; j++) {
1273
+              if (goodOrder[i].is_source == 1) {
1274
+                if (goodOrder[i].supply_unit == drugList[j].max_unit) {
1275
+                  goodOrder[i].count = goodOrder[i].count * drugList[j].min_number;
1276
+                }
1277
+              }
1278
+            }
1279
+          }
1280
+
1281
+          let objInfo = {};
1282
+          if (goodOrder.length > 0) {
1283
+            goodOrder.forEach((item, index) => {
1284
+              let { project_id } = item;
1285
+              if (!objInfo[project_id]) {
1286
+                objInfo[project_id] = {
1287
+                  project_id,
1288
+                  child: [],
1289
+                  count: 0,
1290
+                };
1291
+              }
1292
+            });
1293
+            let newArr = Object.values(objInfo);
1294
+
1295
+            for (let i = 0; i < goodOrder.length; i++) {
1296
+              for (let j = 0; j < newArr.length; j++) {
1297
+                if (goodOrder[i].project_id == newArr[j].project_id) {
1298
+                  newArr[j].child.push(goodOrder[i]);
1299
+                }
1300
+              }
1301
+            }
1302
+            console.log("newAr2332232323", newArr);
1303
+
1304
+            for (let i = 0; i < newArr.length; i++) {
1305
+              for (let j = 0; j < newArr[i].child.length; j++) {
1306
+                newArr[i].count += newArr[i].child[j].count;
1307
+              }
1308
+            }
1309
+
1310
+            var arr = [];
1311
+            var total = 0;
1312
+            var str = "";
1313
+
1314
+            //如果采购单有数据,则需要比较数量
1315
+            if (newArr.length > 0) {
1316
+              for (let i = 0; i < purcaseOrder.length; i++) {
1317
+                for (let j = 0; j < newArr.length; j++) {
1318
+                  if (purcaseOrder[i].project_id == newArr[j].project_id) {
1319
+                    //根据商品ID比较数量大小,如果采购单的数量大于采购订单的数据
1320
+                    if (purcaseOrder[i].count < newArr[j].count) {
1321
+                      arr.push(purcaseOrder[i].project_id);
1322
+                    }
1323
+                  }
1324
+                }
1325
+              }
1326
+              //如果total的长度等于0,怎修改该订单的状态为全部入库
1327
+
1328
+              if (arr.length > 0) {
1329
+                //修改采购订单的状态为全部入库
1330
+                this.UpdateSupplyWahouseingInfo();
1331
+              }
1332
+            }
1333
+          }
1334
+        }
1335
+      });
1336
+    },
1337
+    UpdateSupplyWahouseingInfo() {
1338
+      var params = {
1339
+        warehousing_id: this.$route.query.warehousing_id,
1340
+      };
1341
+      console.log("采购单ID",params)
1342
+      UpdateSupplyWahouseingInfo(params).then((response) => {
1343
+        if (response.data.state == 1) {
1344
+          var msg = response.data.data.msg;
1345
+        }
1346
+      });
1347
+    },
1213 1348
   },
1214 1349
   created() {
1215 1350
     const tempObj = {};
@@ -1234,6 +1369,7 @@ export default {
1234 1369
     tempObj["order_number"] = "";
1235 1370
     tempObj["supply_expiry_date"] = "";
1236 1371
     tempObj["manufacturer_id"] = "";
1372
+    tempObj["min_price"] = ""
1237 1373
     this.recordInfo.tableList.push(tempObj);
1238 1374
     this.getInitOrder();
1239 1375
     if (parseInt(this.$route.query.id) > 0) {

+ 7 - 4
src/xt_pages/supply/components/addPurchaseOrder.vue Прегледај датотеку

@@ -94,9 +94,8 @@
94 94
             size="small"
95 95
             type="primary"
96 96
             @click="updatePurchaseOrder"
97
-            v-show="showOne"
98
-            >保存</el-button
99
-          >
97
+            v-show="showThree">保存
98
+          </el-button>
100 99
         </div>
101 100
       </div>
102 101
 
@@ -390,6 +389,7 @@ export default {
390 389
       ],
391 390
       showTwo: true,
392 391
       showOne: false,
392
+      showThree:false,
393 393
       recordInfo: {
394 394
         tableList: [],
395 395
       },
@@ -724,6 +724,7 @@ export default {
724 724
               }
725 725
               this.showTwo = false;
726 726
               this.showOne = true;
727
+              this.showThree = true
727 728
             }
728 729
           });
729 730
         }
@@ -865,6 +866,8 @@ export default {
865 866
               var info = response.data.data.info;
866 867
               this.is_check = info.is_check
867 868
               this.showOne = false
869
+              this.showTwo = false
870
+              this.showThree = true
868 871
               this.disabled = true;
869 872
               this.$message.success("审核成功!");
870 873
               this.Reviewed = true
@@ -919,7 +922,7 @@ export default {
919 922
           var ids = "";
920 923
           // 如果采购单没有数据,则代表改订单第一次生成采购订单数据
921 924
           if (goodOrder.length == 0) {
922
-            this.$router.push({path: "/good/order/add?id=" + id + "&ids=" + ids});
925
+            this.$router.push({path: "/good/order/add?id=" + this.id + "&ids=" + ids});
923 926
           }
924 927
           for (let i = 0; i < purcaseOrder.length; i++) {
925 928
             for (let j = 0; j < drugList.length; j++) {

+ 25 - 5
src/xt_pages/supply/components/editGoodOrder.vue Прегледај датотеку

@@ -236,6 +236,18 @@
236 236
             </template>
237 237
           </el-table-column>
238 238
 
239
+          <el-table-column label="拆零零售价" align="center" width="180px">
240
+            <template slot-scope="scope">
241
+              <el-input
242
+                v-model="scope.row.min_price"
243
+                style="width: 140px"
244
+                :disabled="disabled"
245
+                placeholder="请输入拆零零售价"
246
+              ></el-input>
247
+              <div style="visibility: hidden">/</div>
248
+            </template>
249
+          </el-table-column>
250
+
239 251
           <el-table-column label="采购单价" align="center" width="180px">
240 252
             <template slot-scope="scope">
241 253
               <el-input
@@ -248,6 +260,8 @@
248 260
             </template>
249 261
           </el-table-column>
250 262
 
263
+      
264
+
251 265
           <el-table-column label="采购金额" align="center" width="120px">
252 266
             <template slot-scope="scope">
253 267
               {{ calculate(scope.row.supply_count * scope.row.supply_price) }}
@@ -588,6 +602,7 @@ export default {
588 602
             drugList[i].type = 1;
589 603
             drugList[i].supply_price = drugList[i].last_price;
590 604
             drugList[i].name = drugList[i].drug_name;
605
+            drugList[i].min_price = drugList[i].min_price
591 606
             if (drugList[i].max_unit != drugList[i].min_unit) {
592 607
               drugList[i].unitList = [
593 608
                 { id: 1, name: "" },
@@ -642,6 +657,7 @@ export default {
642 657
             goodList[i].supply_unit = goodList[i].packing_unit;
643 658
             goodList[i].warehouse_info_id = 0;
644 659
             goodList[i].warehousing_id = 0;
660
+            goodList[i].min_price = goodList[i].retail_price
645 661
             for (let j = 0; j < goodList[i].unitList.length; j++) {
646 662
               goodList[i].unitList[0].name = goodList[i].packing_unit;
647 663
             }
@@ -662,10 +678,9 @@ export default {
662 678
           this.recordInfo.tableList[i].name = val.name;
663 679
           this.recordInfo.tableList[i].supply_name = val.supply_name;
664 680
           this.recordInfo.tableList[i].supply_type = val.supply_type;
665
-          this.recordInfo.tableList[i].supply_specification_name =
666
-            val.supply_specification_name;
681
+          this.recordInfo.tableList[i].supply_specification_name = val.supply_specification_name;
667 682
           this.recordInfo.tableList[i].supply_total = val.supply_total;
668
-
683
+          this.recordInfo.tableList[i].min_price = val.min_price  
669 684
           if (val.supply_count == NaN) {
670 685
             this.recordInfo.tableList[i].supply_count = "";
671 686
           } else {
@@ -725,6 +740,7 @@ export default {
725 740
       tempObj["warehousing_id"] = "";
726 741
       tempObj["number"] = "";
727 742
       tempObj["good_number"] = "";
743
+      tempObj["min_price"] = ""
728 744
       this.recordInfo.tableList.push(tempObj);
729 745
     },
730 746
     handleDelete: function (index, row) {
@@ -857,7 +873,7 @@ export default {
857 873
               var info = response.data.data.info;
858 874
               this.disabled = true;
859 875
               this.$message.success("审核成功!");
860
-              this.getPurchaseOrderDetail();
876
+              // this.getPurchaseOrderDetail();
861 877
             }
862 878
           });
863 879
         })
@@ -961,6 +977,7 @@ export default {
961 977
             tempObj["warehousing_id"] = "";
962 978
             tempObj["number"] = "";
963 979
             tempObj["good_number"] = "";
980
+            tempObj["min_price"] = ""
964 981
             this.recordInfo.tableList = [];
965 982
             this.recordInfo.tableList.push(tempObj);
966 983
           }else{
@@ -990,7 +1007,7 @@ export default {
990 1007
         this.recordInfo.tableList[i].supply_price = this.recordInfo.tableList[i].supply_price.toString();
991 1008
         this.recordInfo.tableList[i].supply_total_price =  this.recordInfo.tableList[i].supply_total_price.toString();
992 1009
         this.recordInfo.tableList[i].supply_total = this.recordInfo.tableList[i].supply_total.toString();
993
-
1010
+        this.recordInfo.tableList[i].min_price = this.recordInfo.tableList[i].min_price.toString();
994 1011
         for (let j = 0; j < this.manufactuerList.length; j++) {
995 1012
           if ( this.recordInfo.tableList[i].supply_manufacturer == this.manufactuerList[j].manufacturer_name) {
996 1013
             this.recordInfo.tableList[i].manufacturer_id = this.manufactuerList[j].id;
@@ -1034,6 +1051,8 @@ export default {
1034 1051
     checkGoodOrder() {
1035 1052
       var id = this.$route.query.id;
1036 1053
       var warehousing_id = this.$route.query.warehousing_id;
1054
+      console.log("采购单ID",id)
1055
+      console.log("采购订单ID",warehousing_id)
1037 1056
       getGoodOrderCountList(id, warehousing_id).then((response) => {
1038 1057
         if (response.data.state == 1) {
1039 1058
           this.$message.success("审核成功!");
@@ -1407,6 +1426,7 @@ export default {
1407 1426
     tempObj["warehousing_id"] = "";
1408 1427
     tempObj["number"] = "";
1409 1428
     tempObj["good_number"] = "";
1429
+    tempObj["min_price"] = ""
1410 1430
     this.recordInfo.tableList.push(tempObj);
1411 1431
     this.getInitOrder();
1412 1432
     if (parseInt(this.$route.query.id) > 0) {

+ 1 - 0
src/xt_pages/supply/components/editPurchaseOrder.vue Прегледај датотеку

@@ -317,6 +317,7 @@
317 317
             :rows="2"
318 318
             placeholder="备注信息"
319 319
             v-model="return_remark"
320
+            :disabled="disabled"
320 321
           >
321 322
           </el-input>
322 323
         </div>