diff --git a/SC-boot/linkage-scm/src/main/java/jnpf/poundlist/controller/PoundlistController.java b/SC-boot/linkage-scm/src/main/java/jnpf/poundlist/controller/PoundlistController.java index 2c0dc76d..863ae28f 100644 --- a/SC-boot/linkage-scm/src/main/java/jnpf/poundlist/controller/PoundlistController.java +++ b/SC-boot/linkage-scm/src/main/java/jnpf/poundlist/controller/PoundlistController.java @@ -147,8 +147,7 @@ public class PoundlistController { }else{ return ActionResult.success(list); } - } - else { + }else { return ActionResult.fail("当前状态不能生成销售订单"); } } diff --git a/SC-boot/linkage-scm/src/main/java/jnpf/saleorder/controller/SaleorderitemController.java b/SC-boot/linkage-scm/src/main/java/jnpf/saleorder/controller/SaleorderitemController.java index 49d28844..56d13915 100644 --- a/SC-boot/linkage-scm/src/main/java/jnpf/saleorder/controller/SaleorderitemController.java +++ b/SC-boot/linkage-scm/src/main/java/jnpf/saleorder/controller/SaleorderitemController.java @@ -34,6 +34,8 @@ import jnpf.materialvo.service.MaterialService; import jnpf.poundlist.entity.PoundlistEntity; import jnpf.poundlist.service.PoundlistService; import jnpf.purchaseorder.entity.Purchaseorder_item0Entity; +import jnpf.purchaseorder.entity.PurchaseorderitemEntity; +import jnpf.purchaseorder.service.PurchaseorderitemService; import jnpf.receiptin.entity.Receiptin_item0Entity; import jnpf.receiptin.service.Receiptin_item0Service; import jnpf.receiptout.entity.ReceiptoutEntity; @@ -166,6 +168,8 @@ public class SaleorderitemController { private CustomerService customerService; @Autowired private VehicleService vehicleService; + @Autowired + private PurchaseorderitemService purchaseorderitemService; /** * 修改磅单单价 @@ -540,36 +544,15 @@ public class SaleorderitemController { entitys.setSalesOrderId(entity.getId()); salesorder_item0Service.save(entitys); } -/* List ReceiptoutsoitemList = JsonUtil.getJsonToList(saleorderitemCrForm.getReceiptoutsoitemList(),ReceiptoutsoitemEntity.class); - for(ReceiptoutsoitemEntity entitys : ReceiptoutsoitemList){ - entitys.setId(RandomUtil.uuId()); - entitys.setSourceNo(entity.getDocumentNo()); - receiptoutsoitemService.save(entitys); - } - List Arinvoices_item0soitemList = JsonUtil.getJsonToList(saleorderitemCrForm.getArinvoices_item0soitemList(),Arinvoices_item0soitemEntity.class); - for(Arinvoices_item0soitemEntity entitys : Arinvoices_item0soitemList){ - entitys.setId(RandomUtil.uuId()); - entitys.setSalesOrderNo(entity.getDocumentNo()); - arinvoices_item0soitemService.save(entitys); - } - List CollectionsoitemList = JsonUtil.getJsonToList(saleorderitemCrForm.getCollectionsoitemList(),CollectionsoitemEntity.class); - for(CollectionsoitemEntity entitys : CollectionsoitemList){ - entitys.setId(RandomUtil.uuId()); - entitys.setSalesOrderNo(entity.getDocumentNo()); - collectionsoitemService.save(entitys); - } - List SalesbacksoitemList = JsonUtil.getJsonToList(saleorderitemCrForm.getSalesbacksoitemList(),SalesbacksoitemEntity.class); - for(SalesbacksoitemEntity entitys : SalesbacksoitemList){ - entitys.setId(RandomUtil.uuId()); - entitys.setSalesOrderId(entity.getId()); - salesbacksoitemService.save(entitys); + if (StringUtils.isNotEmpty(saleorderitemCrForm.getIsTransfer()) && saleorderitemCrForm.getIsTransfer().equals("1")){ + if (StringUtils.isNotEmpty(saleorderitemCrForm.getPurchaseOrderId())){ + PurchaseorderitemEntity purchaseorderitemEntity = purchaseorderitemService.getById(saleorderitemCrForm.getPurchaseOrderId()); + if (ObjectUtils.isNotEmpty(purchaseorderitemEntity)){ + purchaseorderitemEntity.setIsTransfer("1"); + purchaseorderitemService.updateById(purchaseorderitemEntity); + } + } } - List PaymentsoitemList = JsonUtil.getJsonToList(saleorderitemCrForm.getPaymentsoitemList(),PaymentsoitemEntity.class); - for(PaymentsoitemEntity entitys : PaymentsoitemList){ - entitys.setId(RandomUtil.uuId()); - entitys.setPaymentno(entity.getDocumentNo()); - paymentsoitemService.save(entitys); - }*/ return ActionResult.success("创建成功"); } diff --git a/SC-boot/linkage-scm/src/main/java/jnpf/saleorder/model/saleorderitem/SaleorderitemCrForm.java b/SC-boot/linkage-scm/src/main/java/jnpf/saleorder/model/saleorderitem/SaleorderitemCrForm.java index 0d902151..8fe729d6 100644 --- a/SC-boot/linkage-scm/src/main/java/jnpf/saleorder/model/saleorderitem/SaleorderitemCrForm.java +++ b/SC-boot/linkage-scm/src/main/java/jnpf/saleorder/model/saleorderitem/SaleorderitemCrForm.java @@ -130,5 +130,10 @@ public class SaleorderitemCrForm { @TableField("bidSection") private String bidSection; + @TableField("isTransfer") + private String isTransfer; + @TableField("purchaseOrderId") + private String purchaseOrderId; + } \ No newline at end of file diff --git a/SC-boot/linkage-scm/src/main/java/jnpf/tradeupload/controller/TradeuploadController.java b/SC-boot/linkage-scm/src/main/java/jnpf/tradeupload/controller/TradeuploadController.java index 4a2b81e1..87653e32 100644 --- a/SC-boot/linkage-scm/src/main/java/jnpf/tradeupload/controller/TradeuploadController.java +++ b/SC-boot/linkage-scm/src/main/java/jnpf/tradeupload/controller/TradeuploadController.java @@ -745,9 +745,9 @@ public class TradeuploadController { public ActionResult info(@PathVariable("id") String id){ TradeuploadEntity entity= tradeuploadService.getInfo(id); TradeuploadInfoVO vo=JsonUtil.getJsonToBean(entity, TradeuploadInfoVO.class); -// if(vo.getCreatorTime()!=null){ -// vo.setCreatorTime(vo.getCreatorTime()); -// } + if(vo.getCreatorTime()!=null){ + vo.setCreatorTime(vo.getCreatorTime()); + } // vo.setOriginPlace(generaterSwapUtil.provinceData(vo.getOriginPlace())); //子表 //副表 diff --git a/SC-web/src/views/scm/basicInformation/poundlist/salesForm.vue b/SC-web/src/views/scm/basicInformation/poundlist/salesForm.vue index 65c3bc04..8d0297a3 100644 --- a/SC-web/src/views/scm/basicInformation/poundlist/salesForm.vue +++ b/SC-web/src/views/scm/basicInformation/poundlist/salesForm.vue @@ -724,8 +724,9 @@ loading: false, isDetail: false, dataForm: { + isTransfer: '', + purchaseOrderId: '', documentNo: '', - contractId: '', customerId: '', contractName: '', @@ -999,6 +1000,8 @@ this.dataForm.contractNo = list[0].contractNo this.dataForm.contractName = list[0].contractName this.dataForm.customerName = list[0].customerName + this.dataForm.isTransfer = list.isTransfer + this.dataForm.purchaseOrderId = list .purchaseOrderId var num = 0 var amount = 0 var advance = 0 @@ -1012,7 +1015,7 @@ this.dataForm.salesorder_item0List[i].noPrice = this.jnpf.floatDiv(this.dataForm.salesorder_item0List[i].price, this.jnpf.floatAdd((1, this.jnpf.floatDiv(item.fullName,100)))) notPrice = this.jnpf.floatAdd(notPrice, this.dataForm.salesorder_item0List[i].noPrice) } - }) + }) if (list[i].advance == 1) { advance = this.jnpf.floatAdd(advance, this.jnpf.floatMul(list[i].salesPrice, list[i].settlement)) } diff --git a/SC-web/src/views/scm/basicInformation/purchaseorder/index.vue b/SC-web/src/views/scm/basicInformation/purchaseorder/index.vue index bb196a8f..947260ec 100644 --- a/SC-web/src/views/scm/basicInformation/purchaseorder/index.vue +++ b/SC-web/src/views/scm/basicInformation/purchaseorder/index.vue @@ -555,6 +555,20 @@ }) return } + var flag = true; + this.multipleSelectionItem.forEach((item,index) => { + if(item.isTransfer == '1'){ + flag = flase; + } + }) + if(!flag){ + this.$message({ + type: 'error', + message: '此订单已经转销售', + duration: 2500 + }) + return + } console.log('aaaaaaa', this.multipleSelectionItem) var ids = ''; this.multipleSelectionItem[0].poundlistEntityList.forEach((item, index)=>{ @@ -563,13 +577,18 @@ if(ids.length > 0){ ids = ids.substring(0, ids.length - 1); } + debugger request({ url: `/api/poundlist/Poundlist/createsale/${ids}`, method: 'post' }).then(res => { var list = [] for (let i = 0; i < res.data.length; i++) { + // res.data[i].isTransfer = '1' + // res.data[i].purchaseOrderId = this.multipleSelectionItem[0].id let _data = res.data[i] + _data.isTransfer = '1' + _data.purchaseOrderId = this.multipleSelectionItem[0].id list.push(_data) } if (list.length>0) { diff --git a/SC-web/src/views/scm/basicInformation/tradeupload/Form.vue b/SC-web/src/views/scm/basicInformation/tradeupload/Form.vue index f54ba701..07112418 100644 --- a/SC-web/src/views/scm/basicInformation/tradeupload/Form.vue +++ b/SC-web/src/views/scm/basicInformation/tradeupload/Form.vue @@ -25,7 +25,7 @@ + popupType="dialog" popupTitle="选择数据" popupWidth="800px" hasPage :pageSize="20" > @@ -216,7 +216,7 @@ 取 消 确 定 - + 继续上传 @@ -600,16 +600,16 @@ method: 'get' }).then(res => { this.dataInfo(res.data) - // this.dataForm.businessId = this.$store.state.user.userInfo.userId; - // this.dataForm.businessName = this.$store.state.user.userInfo.userName; - // this.dataForm.poundDate = new Date().getTime(); + this.dataForm.businessId = this.$store.state.user.userInfo.userId; + this.dataForm.businessName = this.$store.state.user.userInfo.userName; + this.dataForm.poundDate = new Date().getTime(); this.loading = false }); } else { this.clearData(this.dataForm) - // this.dataForm.businessId = this.$store.state.user.userInfo.userId; - // this.dataForm.businessName = this.$store.state.user.userInfo.userName; - // this.dataForm.poundDate = new Date(); + this.dataForm.businessId = this.$store.state.user.userInfo.userId; + this.dataForm.businessName = this.$store.state.user.userInfo.userName; + this.dataForm.poundDate = new Date().getTime(); } }); this.$store.commit('generator/UPDATE_RELATION_DATA', {}) diff --git a/SC-web/src/views/scm/basicInformation/tradeupload/Form3.vue b/SC-web/src/views/scm/basicInformation/tradeupload/Form3.vue index f779ba1f..eac17aee 100644 --- a/SC-web/src/views/scm/basicInformation/tradeupload/Form3.vue +++ b/SC-web/src/views/scm/basicInformation/tradeupload/Form3.vue @@ -600,16 +600,16 @@ method: 'get' }).then(res => { this.dataInfo(res.data) - // this.dataForm.businessId = this.$store.state.user.userInfo.userId; - // this.dataForm.businessName = this.$store.state.user.userInfo.userName; - // this.dataForm.poundDate = new Date().getTime(); + this.dataForm.businessId = this.$store.state.user.userInfo.userId; + this.dataForm.businessName = this.$store.state.user.userInfo.userName; + this.dataForm.poundDate = new Date().getTime(); this.loading = false }); } else { this.clearData(this.dataForm) - // this.dataForm.businessId = this.$store.state.user.userInfo.userId; - // this.dataForm.businessName = this.$store.state.user.userInfo.userName; - // this.dataForm.poundDate = new Date(); + this.dataForm.businessId = this.$store.state.user.userInfo.userId; + this.dataForm.businessName = this.$store.state.user.userInfo.userName; + this.dataForm.poundDate = new Date().getTime(); } }); this.$store.commit('generator/UPDATE_RELATION_DATA', {}) diff --git a/SC-web/src/views/scm/basicInformation/tradeupload/index.vue b/SC-web/src/views/scm/basicInformation/tradeupload/index.vue index 74b93388..78470155 100644 --- a/SC-web/src/views/scm/basicInformation/tradeupload/index.vue +++ b/SC-web/src/views/scm/basicInformation/tradeupload/index.vue @@ -155,7 +155,7 @@ width="200">