Pārlūkot izejas kodu

11月14日 库存扣减更新

XMLWAN 3 gadus atpakaļ
vecāks
revīzija
15ac5644be

+ 29 - 3
src/api/supply.js Parādīt failu

160
   })
160
   })
161
 }
161
 }
162
 
162
 
163
-
164
 export function getSupplierId(params) {
163
 export function getSupplierId(params) {
165
   return request({
164
   return request({
166
     url: '/api/supply/getsupplycode',
165
     url: '/api/supply/getsupplycode',
185
   })
184
   })
186
 }
185
 }
187
 
186
 
188
-
189
 export function getexporthistory(params) {
187
 export function getexporthistory(params) {
190
   return request({
188
   return request({
191
     url: '/api/supply/getsupplylist',
189
     url: '/api/supply/getsupplylist',
267
 }
265
 }
268
 
266
 
269
 export function updatesupply(data) {
267
 export function updatesupply(data) {
270
-  console.log(data,'oopo')
268
+  console.log(data, 'oopo')
271
   return request({
269
   return request({
272
     url: '/api/supply/updatesupply',
270
     url: '/api/supply/updatesupply',
273
     method: 'post',
271
     method: 'post',
275
   })
273
   })
276
 }
274
 }
277
 
275
 
276
+export function checkGoodOrderById(id, params) {
277
+  return request({
278
+    url: '/api/supply/checkgoodorderbyid?id=' + id,
279
+    method: 'get',
280
+    params: params
281
+  })
282
+}
278
 
283
 
279
 // export function getsupplytype(params) {
284
 // export function getsupplytype(params) {
280
 //   return request({
285
 //   return request({
284
 //   })
289
 //   })
285
 // }
290
 // }
286
 
291
 
292
+export function checkReturnOrder(params) {
293
+  return request({
294
+    url: '/api/supply/checkreturnorder',
295
+    method: 'Get',
296
+    params: params
297
+  })
298
+}
287
 
299
 
300
+export function deletePurchOder(params) {
301
+  return request({
302
+    url: '/api/supply/deletepurchaseorder',
303
+    method: 'get',
304
+    params: params
305
+  })
306
+}
288
 
307
 
308
+export function deleteGoodOrderById(params) {
309
+  return request({
310
+    url: '/api/supply/deletegoodorderbyid',
311
+    method: 'get',
312
+    params: params
313
+  })
314
+}

+ 12 - 8
src/xt_pages/supply/components/addGoodOrder.vue Parādīt failu

71
             v-show="showTwo"
71
             v-show="showTwo"
72
             >保存</el-button
72
             >保存</el-button
73
           >
73
           >
74
-          <el-button size="small" type="primary" @click="checkPurchaseOrder"
75
-            >审核</el-button
76
-          >
74
+          <el-button size="small" type="primary" @click="checkGoodOrder" >审核</el-button>
77
         </div>
75
         </div>
78
       </div>
76
       </div>
79
 
77
 
449
   getPurchaseOrderInfo,
447
   getPurchaseOrderInfo,
450
   addGoodOrder,
448
   addGoodOrder,
451
   updateGoodOrder,
449
   updateGoodOrder,
450
+  checkGoodOrderById
452
 } from "@/api/supply";
451
 } from "@/api/supply";
453
 export default {
452
 export default {
454
   name: "addPurchaseOrder",
453
   name: "addPurchaseOrder",
817
     count_arrearage() {
816
     count_arrearage() {
818
       this.payment = this.total_price - this.arrearage;
817
       this.payment = this.total_price - this.arrearage;
819
     },
818
     },
820
-    checkPurchaseOrder(id, index) {
819
+    checkPurchaseOrder() {
821
       this.$confirm("是否审核?", {
820
       this.$confirm("是否审核?", {
822
         confirmButtonText: "确 定",
821
         confirmButtonText: "确 定",
823
         cancelButtonText: "取 消",
822
         cancelButtonText: "取 消",
824
         type: "warning",
823
         type: "warning",
825
-      })
826
-        .then(() => {
824
+      }).then(() => {
827
           checkPurchaseOrder(this.id).then((response) => {
825
           checkPurchaseOrder(this.id).then((response) => {
828
             if (response.data.state == 1) {
826
             if (response.data.state == 1) {
829
               var info = response.data.data.info;
827
               var info = response.data.data.info;
949
             stockIn: this.recordInfo.tableList,
947
             stockIn: this.recordInfo.tableList,
950
             return_remake: this.return_remark,
948
             return_remake: this.return_remark,
951
           };
949
           };
952
-          console.log("stockIN2323322332322323", params);
953
-
954
           addGoodOrder(
950
           addGoodOrder(
955
             params,
951
             params,
956
             this.supplier_name,
952
             this.supplier_name,
1102
         }
1098
         }
1103
       });
1099
       });
1104
     },
1100
     },
1101
+    checkGoodOrder(){
1102
+      checkGoodOrderById(this.warese_out_id).then(response=>{
1103
+         if(response.data.state == 1){
1104
+           var out = response.data.data.out
1105
+           this.$message.success("审核成功!")
1106
+         }
1107
+      })
1108
+    }
1105
   },
1109
   },
1106
   created() {
1110
   created() {
1107
     const tempObj = {};
1111
     const tempObj = {};

+ 18 - 10
src/xt_pages/supply/components/addGoodReturn.vue Parādīt failu

614
       tempObj["project_id"] = 0;
614
       tempObj["project_id"] = 0;
615
       tempObj["supply_unit"] = "";
615
       tempObj["supply_unit"] = "";
616
       tempObj["order_number"] = ""
616
       tempObj["order_number"] = ""
617
+      tempObj["supply_batch_number"] = ""
618
+      tempObj["supply_product_date"] = ""
619
+      tempObj["supply_expiry_date"] = ""
620
+      tempObj["warehousing_id"] =0
621
+      tempObj["warehouse_info_id"] =0
617
       this.recordInfo.tableList.push(tempObj);
622
       this.recordInfo.tableList.push(tempObj);
618
     },
623
     },
619
     handleDelete: function (index, row) {
624
     handleDelete: function (index, row) {
802
             orderInfo[i].supply_unit = orderInfo[i].supply_unit;
807
             orderInfo[i].supply_unit = orderInfo[i].supply_unit;
803
             orderInfo[i].order_number = orderInfo[i].order_number;
808
             orderInfo[i].order_number = orderInfo[i].order_number;
804
             orderInfo[i].good_number = orderInfo[i].good_number;
809
             orderInfo[i].good_number = orderInfo[i].good_number;
805
-            orderInfo[i].supply_total_price = (
806
-              orderInfo[i].count * orderInfo[i].price
807
-            ).toFixed(2);
808
-            orderInfo[i].supply_expiry_date = this.getTimes(
809
-              orderInfo[i].supply_expiry_date
810
-            );
811
-            orderInfo[i].supply_product_date = this.getTimes(
812
-              orderInfo[i].supply_product_date
813
-            );
810
+            orderInfo[i].supply_total_price = ( orderInfo[i].count * orderInfo[i].price).toFixed(2);
811
+            orderInfo[i].supply_expiry_date = orderInfo[i].supply_expiry_date;
812
+            orderInfo[i].supply_product_date = orderInfo[i].supply_product_date;
813
+            orderInfo[i].supply_batch_number = orderInfo[i].supply_batch_number
814
+            orderInfo[i].warehousing_id = orderInfo[i].warehousing_id
815
+            orderInfo[i].warehouse_info_id = orderInfo[i].warehouse_info_id
814
             if (orderInfo[i].is_source == 1) {
816
             if (orderInfo[i].is_source == 1) {
815
               for (let j = 0; j < drugList.length; j++) {
817
               for (let j = 0; j < drugList.length; j++) {
816
                 if (orderInfo[i].project_id == drugList[j].id) {
818
                 if (orderInfo[i].project_id == drugList[j].id) {
865
                 this.recordInfo.tableList[i].supply_manufacturer = this.manufactuerList[j].manufacturer_name;
867
                 this.recordInfo.tableList[i].supply_manufacturer = this.manufactuerList[j].manufacturer_name;
866
               }
868
               }
867
             }
869
             }
870
+          } 
868
            var params = {
871
            var params = {
869
             stockIn:this.recordInfo.tableList,
872
             stockIn:this.recordInfo.tableList,
870
             return_marke:this.return_remark,
873
             return_marke:this.return_remark,
929
                 }
932
                 }
930
              }
933
              }
931
            })
934
            })
932
-          }
935
+          
933
         }
936
         }
934
       })
937
       })
935
     }
938
     }
954
     tempObj["project_id"] = 0;
957
     tempObj["project_id"] = 0;
955
     tempObj["supply_unit"] = "";
958
     tempObj["supply_unit"] = "";
956
     tempObj["order_number"] = ""
959
     tempObj["order_number"] = ""
960
+    tempObj["supply_batch_number"] = ""
961
+    tempObj["supply_product_date"] = ""
962
+    tempObj["supply_expiry_date"] = ""
963
+    tempObj["warehousing_id"] =0
964
+    tempObj["warehouse_info_id"] =0
957
     this.recordInfo.tableList.push(tempObj);
965
     this.recordInfo.tableList.push(tempObj);
958
     console.log("即哪里地方2",this.recordInfo.tableList)
966
     console.log("即哪里地方2",this.recordInfo.tableList)
959
     this.getInitOrder();
967
     this.getInitOrder();

+ 5 - 5
src/xt_pages/supply/components/addPurchaseOrder.vue Parādīt failu

211
             </template>
211
             </template>
212
           </el-table-column>
212
           </el-table-column>
213
 
213
 
214
-          <el-table-column label="购单价" align="center" width="140px">
214
+          <el-table-column label="购单价" align="center" width="140px">
215
             <template slot-scope="scope">
215
             <template slot-scope="scope">
216
               <el-input
216
               <el-input
217
                 v-model="scope.row.supply_price"
217
                 v-model="scope.row.supply_price"
218
                 style="width: 80px"
218
                 style="width: 80px"
219
                 :disabled="disabled"
219
                 :disabled="disabled"
220
-                 placeholder="请输入购单价"
220
+                 placeholder="请输入购单价"
221
               ></el-input>
221
               ></el-input>
222
               <div style="visibility: hidden">/</div>
222
               <div style="visibility: hidden">/</div>
223
             </template>
223
             </template>
224
           </el-table-column>
224
           </el-table-column>
225
 
225
 
226
-          <el-table-column label="购金额" align="center" width="120px">
226
+          <el-table-column label="购金额" align="center" width="120px">
227
             <template slot-scope="scope">
227
             <template slot-scope="scope">
228
               {{ calculate(scope.row.supply_count * scope.row.supply_price) }}
228
               {{ calculate(scope.row.supply_count * scope.row.supply_price) }}
229
             </template>
229
             </template>
369
     return {
369
     return {
370
       Reviewed:false,
370
       Reviewed:false,
371
       crumbs: [
371
       crumbs: [
372
-        { path: false, name: "购订单" },
373
-        { path: "/spply/query", name: "新增购订单" },
372
+        { path: false, name: "购订单" },
373
+        { path: "/spply/query", name: "新增购订单" },
374
       ],
374
       ],
375
       showTwo: true,
375
       showTwo: true,
376
       showOne: false,
376
       showOne: false,

+ 61 - 30
src/xt_pages/supply/components/editGoodOrder.vue Parādīt failu

448
   MofyGoodOrder,
448
   MofyGoodOrder,
449
   UpdateSupplyWahouseingInfo,
449
   UpdateSupplyWahouseingInfo,
450
   getSupplyWarehouseOutById,
450
   getSupplyWarehouseOutById,
451
+  deleteGoodOrderById
451
 } from "@/api/supply";
452
 } from "@/api/supply";
452
 
453
 
453
 export default {
454
 export default {
711
       tempObj["good_number"] = "";
712
       tempObj["good_number"] = "";
712
       this.recordInfo.tableList.push(tempObj);
713
       this.recordInfo.tableList.push(tempObj);
713
     },
714
     },
714
-    handleDelete: function (index, row) {
715
-      if (this.recordInfo.tableList.length <= 1) {
715
+    handleDelete: function (index, row) { 
716
+      if(this.is_check == 1){
717
+        this.$message.error("已审核单据,不能删除!")
718
+        return false
719
+      }
720
+      if(row.id == 0){
721
+        if (this.recordInfo.tableList.length <= 1) {
716
         this.$message.error("只有一条记录的时候无法删除");
722
         this.$message.error("只有一条记录的时候无法删除");
717
         return;
723
         return;
718
       } else {
724
       } else {
719
         this.recordInfo.tableList.splice(index, 1);
725
         this.recordInfo.tableList.splice(index, 1);
726
+       }
727
+      }else{
728
+         const params = {
729
+            id: row.id
730
+          }
731
+          this.$confirm('确认删除吗?', {
732
+            confirmButtonText: '确定',
733
+            cancelButtonText: '取消',
734
+            type: 'warning'
735
+          }).then(() => {
736
+            deleteGoodOrderById(params).then(response => {
737
+              if (response.data.state == 0) {
738
+                this.$message.error(response.data.msg)
739
+                return false
740
+              } else {
741
+                this.$message.success('删除成功')
742
+
743
+                this.recordInfo.tableList.splice(index, 1)
744
+              }
745
+            })
746
+          }).catch(() => {
747
+        })
720
       }
748
       }
721
     },
749
     },
722
 
750
 
931
           var params = {
959
           var params = {
932
             stockIn: this.recordInfo.tableList,
960
             stockIn: this.recordInfo.tableList,
933
             return_remake: this.return_remark,
961
             return_remake: this.return_remark,
934
-          };
935
-          updateGoodOrder(
936
-            params,
937
-            this.supplier_name,
938
-            start,
939
-            this.arrearage,
940
-            this.payment,
941
-            warehose_out_id,
942
-            this.number,
943
-            this.rate_of_concession,
944
-            this.discount_amount,
945
-            this.good_number
946
-          ).then((response) => {
962
+          }
963
+          console.log("param23322332323",params)
964
+        
965
+          updateGoodOrder(params,this.supplier_name,start,this.arrearage,this.payment,warehose_out_id,this.number,this.rate_of_concession,this.discount_amount,this.good_number).then((response) => {
947
             if (response.data.state == 1) {
966
             if (response.data.state == 1) {
948
               this.loading = false;
967
               this.loading = false;
949
               this.$message.success("保存成功!");
968
               this.$message.success("保存成功!");
1076
       getSupplyWarehouseOutById(id).then((response) => {
1095
       getSupplyWarehouseOutById(id).then((response) => {
1077
         if (response.data.state == 1) {
1096
         if (response.data.state == 1) {
1078
           var cancelList = response.data.data.cancelList;
1097
           var cancelList = response.data.data.cancelList;
1079
-          console.log("cancelList23232232323323223", cancelList);
1098
+          console.log("退库单", cancelList);
1080
            var drugList = response.data.data.drugList;
1099
            var drugList = response.data.data.drugList;
1081
-          console.log("drugList233223232323232", drugList);
1100
+          console.log("药品列表", drugList);
1082
           var cancelOrderList = response.data.data.cancelOrderList;
1101
           var cancelOrderList = response.data.data.cancelOrderList;
1083
-          console.log("cancelOrderList2323322322332", cancelOrderList);
1102
+          console.log("退库单详情", cancelOrderList);
1084
           var ids =""
1103
           var ids =""
1085
           if(cancelList.length == 0){
1104
           if(cancelList.length == 0){
1086
             this.$router.push({ path: "/good/return/add?id=" + this.id+"&ids="+ids });
1105
             this.$router.push({ path: "/good/return/add?id=" + this.id+"&ids="+ids });
1087
           }
1106
           }
1088
           if (cancelList.length > 0) {
1107
           if (cancelList.length > 0) {
1089
             var outList = response.data.data.outList;
1108
             var outList = response.data.data.outList;
1109
+            console.log("购货单2322323",outList)
1090
             for(let i=0;i<outList.length;i++){
1110
             for(let i=0;i<outList.length;i++){
1091
               if(outList[i].is_source == 1){
1111
               if(outList[i].is_source == 1){
1092
                 for(let j=0;j<drugList.length;j++){
1112
                 for(let j=0;j<drugList.length;j++){
1103
             for(let i=0;i<cancelOrderList.length;i++){
1123
             for(let i=0;i<cancelOrderList.length;i++){
1104
              if(cancelOrderList[i].is_source == 1){
1124
              if(cancelOrderList[i].is_source == 1){
1105
                 for(let j=0;j<drugList.length;j++){
1125
                 for(let j=0;j<drugList.length;j++){
1106
-                  if(cancelOrderList[i].supply_unit == drugList[j].max_unit){
1107
-                    cancelOrderList[i].count = cancelOrderList[i].count * drugList[j].min_number
1126
+                  if(cancelOrderList[i].project_id == drugList[j].id){
1127
+                    if(cancelOrderList[i].supply_unit == drugList[j].max_unit){
1128
+                      cancelOrderList[i].count = cancelOrderList[i].count * drugList[j].min_number
1129
+                    }
1108
                   }
1130
                   }
1109
                  }
1131
                  }
1110
                }
1132
                }
1111
             }
1133
             }
1112
-            
1134
+
1135
+            console.log("数据变了后23323233",outList)
1136
+           
1113
             let objInfo = {};
1137
             let objInfo = {};
1114
             if(cancelOrderList.length >0){
1138
             if(cancelOrderList.length >0){
1115
               cancelOrderList.forEach((item, index) => {
1139
               cancelOrderList.forEach((item, index) => {
1123
                 }
1147
                 }
1124
               });
1148
               });
1125
               let newArr = Object.values(objInfo)
1149
               let newArr = Object.values(objInfo)
1126
-
1127
-              console.log("outList2332232332", outList)
1150
+              console.log("最好的输3233232323323223", newArr)
1151
+              console.log("数据变了后23323233",cancelOrderList)
1128
               for (let i = 0; i < cancelOrderList.length; i++) {
1152
               for (let i = 0; i < cancelOrderList.length; i++) {
1129
                 for (let j = 0; j < newArr.length; j++) {
1153
                 for (let j = 0; j < newArr.length; j++) {
1130
                   if (cancelOrderList[i].project_id == newArr[j].project_id) {
1154
                   if (cancelOrderList[i].project_id == newArr[j].project_id) {
1131
                     newArr[j].child.push(cancelOrderList[i])
1155
                     newArr[j].child.push(cancelOrderList[i])
1132
                 }
1156
                 }
1133
               }
1157
               }
1134
-              console.log("newAr2332232323", newArr)
1158
+              
1159
+             } 
1160
+
1161
+            for (let i = 0; i < newArr.length; i++) {
1162
+              for (let j = 0; j < newArr[i].child.length; j++) {
1163
+                newArr[i].count += newArr[i].child[j].count;
1164
+              }
1165
+            }
1135
            
1166
            
1136
             var arr = []
1167
             var arr = []
1137
             var total = 0;
1168
             var total = 0;
1143
                   if (outList[i].project_id == newArr[j].project_id) {
1174
                   if (outList[i].project_id == newArr[j].project_id) {
1144
                     //根据商品ID比较数量大小,把数量不足的商品ID储存,表示退货单的数量未满足采购单的数据,可以继续生成退货单
1175
                     //根据商品ID比较数量大小,把数量不足的商品ID储存,表示退货单的数量未满足采购单的数据,可以继续生成退货单
1145
                     if (outList[i].count > newArr[j].count) {
1176
                     if (outList[i].count > newArr[j].count) {
1146
-                      arr.push(outList[i].project_id);
1177
+                       arr.push(outList[i].project_id);
1147
                     }
1178
                     }
1148
                   }
1179
                   }
1149
                 }
1180
                 }
1151
               //如果total的长度等于 采购单的长度,怎表示该采购订单已经全部生成
1182
               //如果total的长度等于 采购单的长度,怎表示该采购订单已经全部生成
1152
 
1183
 
1153
               if (arr.length == 0) {
1184
               if (arr.length == 0) {
1154
-                this.$message.error("该订单已全部生成采购单,请知悉!");
1155
-                return;
1185
+                this.$message.error("该订单已全部生成退库单,请知悉!");
1186
+                return 
1156
               }
1187
               }
1157
-
1158
-              if (total != cancelOrderList.length) {
1188
+              console.log("arr23323232232323",arr)
1189
+              if (arr.length > 0) {
1159
                 str = arr.join(",");
1190
                 str = arr.join(",");
1160
                 this.$router.push({ path: "/good/return/edit?id=" + id + "&ids=" + str});
1191
                 this.$router.push({ path: "/good/return/edit?id=" + id + "&ids=" + str});
1161
               }
1192
               }
1162
              }
1193
              }
1163
-            }
1194
+         
1164
           }
1195
           }
1165
          }
1196
          }
1166
         }
1197
         }

+ 26 - 4
src/xt_pages/supply/components/editGoodReturn.vue Parādīt failu

60
         </div>
60
         </div>
61
         <div>
61
         <div>
62
           <el-button size="small" type="primary" @click="updateGoodReturn">保存</el-button>
62
           <el-button size="small" type="primary" @click="updateGoodReturn">保存</el-button>
63
-          <el-button size="small" type="primary" @click="updatePurchaseOrder">审核</el-button>
63
+          <el-button size="small" type="primary" @click="checkReturnOrder">审核</el-button>
64
         </div>
64
         </div>
65
       </div>
65
       </div>
66
 
66
 
337
 import {
337
 import {
338
   getInitOrder,
338
   getInitOrder,
339
   getGoodReturnDetail,
339
   getGoodReturnDetail,
340
-  updateGoodReturn
340
+  updateGoodReturn,
341
+  checkReturnOrder
341
 } from "@/api/supply";
342
 } from "@/api/supply";
342
 export default {
343
 export default {
343
   name: "addPurchaseOrder",
344
   name: "addPurchaseOrder",
399
       is_check: 0,
400
       is_check: 0,
400
       dialogVisible: false,
401
       dialogVisible: false,
401
       return_remark:"",
402
       return_remark:"",
403
+      warehouse_out_id:0,
402
     };
404
     };
403
   },
405
   },
404
   methods: {
406
   methods: {
577
       tempObj["is_total"] = 1;
579
       tempObj["is_total"] = 1;
578
       tempObj["project_id"] = 0;
580
       tempObj["project_id"] = 0;
579
       tempObj["supply_unit"] = "";
581
       tempObj["supply_unit"] = "";
582
+      tempObj["supply_batch_number"] = ""
583
+      tempObj["supply_product_date"] = ""
584
+      tempObj["supply_expiry_date"] = ""
585
+      tempObj["warehousing_id"] =0
586
+      tempObj["warehouse_info_id"] =0
580
       this.recordInfo.tableList.push(tempObj);
587
       this.recordInfo.tableList.push(tempObj);
581
     },
588
     },
582
     handleDelete: function (index, row) {
589
     handleDelete: function (index, row) {
734
         if(response.data.state == 1){
741
         if(response.data.state == 1){
735
           var out = response.data.data.cancelDetail
742
           var out = response.data.data.cancelDetail
736
           console.log("out23322323232323",out)
743
           console.log("out23322323232323",out)
744
+          this.warehouse_out_id = out.warehouse_out_id
737
           this.is_check = out.is_check
745
           this.is_check = out.is_check
738
           this.id = out.id
746
           this.id = out.id
739
           this.supplier_name = out.supplier_id
747
           this.supplier_name = out.supplier_id
757
               orderInfo[i].order_number =  orderInfo[i].order_number
765
               orderInfo[i].order_number =  orderInfo[i].order_number
758
               orderInfo[i].good_number = orderInfo[i].good_number
766
               orderInfo[i].good_number = orderInfo[i].good_number
759
               orderInfo[i].supply_total_price = (orderInfo[i].count * orderInfo[i].price).toFixed(2)
767
               orderInfo[i].supply_total_price = (orderInfo[i].count * orderInfo[i].price).toFixed(2)
760
-              orderInfo[i].supply_expiry_date = this.getTimes(orderInfo[i].supply_expiry_date)
761
-              orderInfo[i].supply_product_date = this.getTimes(orderInfo[i].supply_product_date)
768
+              orderInfo[i].supply_expiry_date =  orderInfo[i].supply_expiry_date
769
+              orderInfo[i].supply_product_date = orderInfo[i].supply_product_date
762
             if(orderInfo[i].is_source == 1){
770
             if(orderInfo[i].is_source == 1){
763
               for(let j=0;j<drugList.length;j++){
771
               for(let j=0;j<drugList.length;j++){
764
                   if( orderInfo[i].project_id == drugList[j].id){
772
                   if( orderInfo[i].project_id == drugList[j].id){
830
           })
838
           })
831
         }
839
         }
832
       })
840
       })
841
+    },
842
+    checkReturnOrder(){
843
+     var params = {
844
+       warehouse_out_id:this.warehouse_out_id,
845
+       id:this.id,
846
+     }
847
+     checkReturnOrder(params).then(response=>{
848
+
849
+     })
833
     }
850
     }
834
   },
851
   },
835
   created() {
852
   created() {
850
     tempObj["is_total"] = 1;
867
     tempObj["is_total"] = 1;
851
     tempObj["project_id"] = 0;
868
     tempObj["project_id"] = 0;
852
     tempObj["supply_unit"] = "";
869
     tempObj["supply_unit"] = "";
870
+    tempObj["supply_batch_number"] = ""
871
+    tempObj["supply_product_date"] = ""
872
+    tempObj["supply_expiry_date"] = ""
873
+    tempObj["warehousing_id"] =0
874
+    tempObj["warehouse_info_id"] =0
853
     this.recordInfo.tableList.push(tempObj);
875
     this.recordInfo.tableList.push(tempObj);
854
     this.getInitOrder();
876
     this.getInitOrder();
855
     //获取购货单列表
877
     //获取购货单列表

+ 40 - 13
src/xt_pages/supply/components/editPurchaseOrder.vue Parādīt failu

374
   getAllOrderCountList,
374
   getAllOrderCountList,
375
   getGoodOrderList,
375
   getGoodOrderList,
376
   getReturnOrder,
376
   getReturnOrder,
377
+  deletePurchaseOrder
377
 } from "@/api/supply";
378
 } from "@/api/supply";
378
 export default {
379
 export default {
379
   name: "addPurchaseOrder",
380
   name: "addPurchaseOrder",
383
   },
384
   },
384
   data() {
385
   data() {
385
     return {
386
     return {
386
-      content_2:"购单",
387
-      content:"购订单",
387
+      content_2:"购单",
388
+      content:"购订单",
388
       content_1:"已有以下关联数据,不能反审核",
389
       content_1:"已有以下关联数据,不能反审核",
389
       type:1,
390
       type:1,
390
       Reviewed: false,
391
       Reviewed: false,
630
       this.recordInfo.tableList.push(tempObj);
631
       this.recordInfo.tableList.push(tempObj);
631
     },
632
     },
632
     handleDelete: function (index, row) {
633
     handleDelete: function (index, row) {
633
-      if (this.recordInfo.tableList.length <= 1) {
634
-        this.$message.error("只有一条记录的时候无法删除");
635
-        return;
636
-      } else {
637
-        this.recordInfo.tableList.splice(index, 1);
634
+      if(this.is_check == 1){
635
+         this.$message.error("已审核单据,不能删除!")
636
+         return false
638
       }
637
       }
638
+      if(row.id == 0){
639
+        if (this.recordInfo.tableList.length <= 1) {
640
+          this.$message.error("只有一条记录的时候无法删除");
641
+          return;
642
+        } else {
643
+          this.recordInfo.tableList.splice(index, 1);
644
+        }
645
+      }else{
646
+          const params = {
647
+            id: row.id
648
+          }
649
+          this.$confirm('确认删除吗?', {
650
+            confirmButtonText: '确定',
651
+            cancelButtonText: '取消',
652
+            type: 'warning'
653
+          }).then(() => {
654
+            deletePurchaseOrder(params).then(response => {
655
+              if (response.data.state == 0) {
656
+                this.$message.error(response.data.msg)
657
+                return false
658
+              } else {
659
+                this.$message.success('删除成功')
660
+
661
+                this.recordInfo.tableList.splice(index, 1)
662
+              }
663
+            })
664
+          }).catch(() => {
665
+        })
666
+        
667
+      }
668
+      
639
     },
669
     },
640
 
670
 
641
     changeTypeName() {},
671
     changeTypeName() {},
769
         confirmButtonText: "确 定",
799
         confirmButtonText: "确 定",
770
         cancelButtonText: "取 消",
800
         cancelButtonText: "取 消",
771
         type: "warning",
801
         type: "warning",
772
-      })
773
-        .then(() => {
802
+      }).then(() => {
774
           checkPurchaseOrder(this.id).then((response) => {
803
           checkPurchaseOrder(this.id).then((response) => {
775
             if (response.data.state == 1) {
804
             if (response.data.state == 1) {
776
               var info = response.data.data.info;
805
               var info = response.data.data.info;
882
           var ids = "";
911
           var ids = "";
883
           // 如果采购单没有数据,则代表改订单第一次生成采购订单数据
912
           // 如果采购单没有数据,则代表改订单第一次生成采购订单数据
884
           if (goodOrder.length == 0) {
913
           if (goodOrder.length == 0) {
885
-            this.$router.push({
886
-              path: "/good/order/add?id=" + id + "&ids=" + ids,
887
-            });
914
+            this.$router.push({path: "/good/order/add?id=" + id + "&ids=" + ids});
888
           }
915
           }
889
           for (let i = 0; i < purcaseOrder.length; i++) {
916
           for (let i = 0; i < purcaseOrder.length; i++) {
890
             for (let j = 0; j < drugList.length; j++) {
917
             for (let j = 0; j < drugList.length; j++) {
958
                 return;
985
                 return;
959
               }
986
               }
960
 
987
 
961
-              if (total != goodOrder.length) {
988
+              if (arr.length >0) {
962
                 str = arr.join(",");
989
                 str = arr.join(",");
963
                 this.$router.push({path: "/good/order/add?id=" + id + "&ids=" + str});
990
                 this.$router.push({path: "/good/order/add?id=" + id + "&ids=" + str});
964
               }
991
               }

+ 12 - 12
src/xt_pages/supply/goodreturn.vue Parādīt failu

105
         </el-table-column>
105
         </el-table-column>
106
         <el-table-column label="购货金额" align="center" width="200">
106
         <el-table-column label="购货金额" align="center" width="200">
107
           <template slot-scope="scope">
107
           <template slot-scope="scope">
108
-             <!-- <span v-if="getAllBuyPrice(scope.row.orderInfo)>0">{{getAllBuyPrice(scope.row.orderInfo)}}</span>  -->
108
+             <span v-if="getAllBuyPrice(scope.row.cancelOrder)>0">{{getAllBuyPrice(scope.row.cancelOrder)}}</span> 
109
           </template>
109
           </template>
110
         </el-table-column>
110
         </el-table-column>
111
         <el-table-column label="优惠后金额" align="center" width="200">
111
         <el-table-column label="优惠后金额" align="center" width="200">
112
          <template slot-scope="scope">
112
          <template slot-scope="scope">
113
-           <!-- {{getAllCount(scope.row.orderInfo)}} -->
113
+          <span v-if="getAllBuyPrice(scope.row.cancelOrder)>0">{{getAllBuyPrice(scope.row.cancelOrder) - scope.row.discount_amount}}</span> 
114
          </template>
114
          </template>
115
        </el-table-column>
115
        </el-table-column>
116
-        <el-table-column label="已退款" align="center" width="200">
116
+        <!-- <el-table-column label="已退款" align="center" width="200">
117
          <template slot-scope="scope">
117
          <template slot-scope="scope">
118
-           <!-- {{getAllCount(scope.row.orderInfo)}} -->
118
+         
119
          </template>
119
          </template>
120
-       </el-table-column>
120
+       </el-table-column> -->
121
        <el-table-column label="源数量" align="center" width="200">
121
        <el-table-column label="源数量" align="center" width="200">
122
          <template slot-scope="scope">
122
          <template slot-scope="scope">
123
            <!-- {{getAllCount(scope.row.orderInfo)}} -->
123
            <!-- {{getAllCount(scope.row.orderInfo)}} -->
124
          </template>
124
          </template>
125
        </el-table-column>
125
        </el-table-column>
126
 
126
 
127
-       <el-table-column label="退款状态" align="center" width="200">
127
+       <el-table-column label="款状态" align="center" width="200">
128
          <template slot-scope="scope">
128
          <template slot-scope="scope">
129
-           <span v-if="scope.row.is_check == 2">未审核</span>
130
-           <span v-if="scope.row.is_check == 1">已审核</span>
129
+           <!-- <span v-if="scope.row.is_check == 2">未审核</span>
130
+           <span v-if="scope.row.is_check == 1">已审核</span> -->
131
          </template>
131
          </template>
132
        </el-table-column>
132
        </el-table-column>
133
       
133
       
228
        this.$router.push({path:"/good/return/add"})
228
        this.$router.push({path:"/good/return/add"})
229
      },
229
      },
230
      changeTypeName(){
230
      changeTypeName(){
231
-
231
+       this.getlist()
232
      },
232
      },
233
      startTimeChange(){
233
      startTimeChange(){
234
-
234
+       this.getlist()
235
      },
235
      },
236
      endTimeChange(){
236
      endTimeChange(){
237
-
237
+      this.getlist()
238
      },
238
      },
239
      search(){
239
      search(){
240
-
240
+      this.getlist()
241
      },
241
      },
242
      handleSizeChange(val){
242
      handleSizeChange(val){
243
        this.limit = val
243
        this.limit = val