diff --git a/SC-boot/linkage-scm/src/main/java/jnpf/purchaseorder/controller/PurchaseorderController.java b/SC-boot/linkage-scm/src/main/java/jnpf/purchaseorder/controller/PurchaseorderController.java index 476fbdb2..54e16bda 100644 --- a/SC-boot/linkage-scm/src/main/java/jnpf/purchaseorder/controller/PurchaseorderController.java +++ b/SC-boot/linkage-scm/src/main/java/jnpf/purchaseorder/controller/PurchaseorderController.java @@ -30,6 +30,7 @@ import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.*; import org.springframework.beans.factory.annotation.Autowired; +import javax.servlet.http.HttpServletResponse; import javax.validation.Valid; import java.io.FileOutputStream; import java.io.IOException; @@ -88,11 +89,11 @@ public class PurchaseorderController { * @return */ @PostMapping("pigeonhole") - public ActionResult pigeonhole(@PathVariable("id") String id, @RequestBody @Valid PurchaseorderUpForm purchaseorderUpForm) { - PurchaseorderitemEntity purchaseorder = JsonUtil.getJsonToBean(purchaseorderUpForm, PurchaseorderitemEntity.class); + public ActionResult pigeonhole(@RequestBody PigeonholeModel pigeonholeModel) { + PurchaseorderitemEntity purchaseorder = purchaseorderitemService.getById(pigeonholeModel.getId()); if (purchaseorder.getInvoiceAmount().equals(purchaseorder.getAmount()) && purchaseorder.getInvoiceAmount().equals(purchaseorder.getPayPrice())){ purchaseorder.setStatus("3"); - purchaseorderitemService.update(id,purchaseorder); + purchaseorderitemService.updateById(purchaseorder); return ActionResult.success("归档成功!"); }else{ return ActionResult.fail("发票金额、金额、已付款金额三者不一致!"); @@ -405,7 +406,7 @@ public class PurchaseorderController { * @return */ @GetMapping("/detail/{id}") - public ActionResult detailInfo(@PathVariable("id") String id){ + public ActionResult detailInfo(@PathVariable("id") String id) throws IOException { PurchaseorderitemEntity entity= purchaseorderitemService.getInfo(id); PurchaseorderInfoVO vo=JsonUtil.getJsonToBean(entity, PurchaseorderInfoVO.class); diff --git a/SC-boot/linkage-scm/src/main/java/jnpf/purchaseorder/model/purchaseorder/PigeonholeModel.java b/SC-boot/linkage-scm/src/main/java/jnpf/purchaseorder/model/purchaseorder/PigeonholeModel.java new file mode 100644 index 00000000..b377dfa5 --- /dev/null +++ b/SC-boot/linkage-scm/src/main/java/jnpf/purchaseorder/model/purchaseorder/PigeonholeModel.java @@ -0,0 +1,86 @@ +package jnpf.purchaseorder.model.purchaseorder; + +import lombok.Data; + +import java.math.BigDecimal; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +@Data +public class PigeonholeModel { + /** id **/ + @JsonProperty("id") + private String id; + + /** 单据编号 **/ + @JsonProperty("documentNo") + private String documentNo; + + /** 合同编码 **/ + @JsonProperty("contractCode") + private String contractCode; + + /** 合同名称 **/ + @JsonProperty("contractName") + private String contractName; + + /** 供应商名称 **/ + @JsonProperty("supplierName") + private String supplierName; + + /** 币种 **/ + @JsonProperty("currency") + private String currency; + + /** 对方合同号 **/ + @JsonProperty("contractNo") + private String contractNo; + + /** 垫资金额 **/ + @JsonProperty("advanceAmount") + private String advanceAmount; + + /** 重量 **/ + @JsonProperty("num") + private String num; + + /** 金额 **/ + @JsonProperty("amount") + private BigDecimal amount; + + /** 不含税金额 **/ + @JsonProperty("notAmount") + private String notAmount; + + /** 备注信息 **/ + @JsonProperty("remark") + private String remark; + + /** 制单人 **/ + @JsonProperty("creatorUserName") + private String creatorUserName; + + /** 制单时间 **/ + @JsonProperty("creatorTime") + private String creatorTime; + + /** ERP订单号 **/ + @JsonProperty("erpNo") + private String erpNo; + + /** 已付款金额 **/ + @JsonProperty("payPrice") + private BigDecimal payPrice; + + /** 发票数量 **/ + @JsonProperty("invoiceNum") + private String invoiceNum; + + /** 发票金额 **/ + @JsonProperty("invoiceAmount") + private BigDecimal invoiceAmount; + + /** 单据状态 **/ + @JsonProperty("status") + private String status; +} diff --git a/SC-web/src/router/index.js b/SC-web/src/router/index.js index 6ddb3e64..9704e996 100644 --- a/SC-web/src/router/index.js +++ b/SC-web/src/router/index.js @@ -5,6 +5,7 @@ Vue.use(Router) /* Layout */ import Layout from '@/layout' +import pament from '@/views/scm/basicInformation/paymentdoc/Form' /* Router Modules */ @@ -58,6 +59,11 @@ export const constantRoutes = [{ path: '/auth-redirect', component: (resolve) => require(['@/views/login/auth-redirect'], resolve), hidden: true + }, + { + path:'/paymentdoc', + component: (resolve) => require(['@/views/scm/basicInformation/paymentdoc/index'],resolve), + hidden: true } ] @@ -84,4 +90,4 @@ export function resetRouter() { router.matcher = newRouter.matcher // reset router } -export default router \ No newline at end of file +export default router diff --git a/SC-web/src/views/scm/basicInformation/purchaseorder/index.vue b/SC-web/src/views/scm/basicInformation/purchaseorder/index.vue index b9567787..d7c0d007 100644 --- a/SC-web/src/views/scm/basicInformation/purchaseorder/index.vue +++ b/SC-web/src/views/scm/basicInformation/purchaseorder/index.vue @@ -28,6 +28,8 @@ 归档 + 付款申请 +
@@ -103,9 +105,17 @@ import ExportBox from './ExportBox' import {getDataInterfaceRes} from '@/api/systemData/dataInterface' import Detail from './Detail' + import pament from '@/views/scm/basicInformation/paymentdoc/Form' export default { components: {JNPFForm, ExportBox,Detail}, + // routes:[ + // { + // path:'/paymentdoc', + // name:'payment', + // component:pament + // } + // ], data() { return { detailVisible: false, @@ -146,7 +156,7 @@ ], currencyOptions:[{"fullName":"人民币","id":"0"},{"fullName":"美元","id":"1"},{"fullName":"英镑","id":"2"}], currencyProps:{"label":"fullName","value":"id"}, - statusOptions:[{"fullName":"已保存","id":"0"},{"fullName":"开票中","id":"1"},{"fullName":"付款申请","id":"2"},{"fullName":"待付款","id":"3"},{"fullName":"付款中","id":"4"},{"fullName":"归档","id":"5"}], + statusOptions:[{"fullName":"待开票","id":"0"},{"fullName":"开票中","id":"1"},{"fullName":"付款中","id":"2"},{"fullName":"归档","id":"3"}], statusProps:{"label":"fullName","value":"id"}, } }, @@ -250,11 +260,70 @@ this.$refs.JNPFForm.init(id, isDetail) }) }, - pigeonhole(id,isDetail){ - this.$nextTick(() => { - this.$refs.JNPFForm.init(id,isDetail) + pigeonhole(){ + if (!this.multipleSelection.length) { + this.$message({ + type: 'error', + message: '请选择一条数据', + duration: 1500, + }) + return + } + // let id = {} + let id = this.multipleSelection.join() + let param ={}; + param = this.list.find(function(param) { + return param.id == id; + }) + debugger + request({ + url: `/api/purchaseorder/Purchaseorder/pigeonhole`, + method: 'POST', + data: param + }).then(res => { + this.$message({ + type: 'success', + message: res.msg, + onClose: () => { + this.initData() + } + }); }) }, + payment(){ + if (!this.multipleSelection.length) { + this.$message({ + type: 'error', + message: '请选择一条数据', + duration: 1500, + }) + return + } + let ids = this.multipleSelection.join() + if (this.multipleSelection.length ===1){ + let info = {}; + info = this.list.find(function(info) { + return info.id == ids + }) + if (info.amount != info.invoiceAmount){ + this.$message({ + type: 'error', + message: '请先开具发票', + duration: 1500, + }) + return + }else{ + debugger + // window.navigator("views/scm/basicInformation/paymentdoc/index.vue"); + // window.location.href="views/scm/basicInformation/paymentdoc/index.vue"; + // this.formVisible = true + // this.$nextTick((id,isDetail) => { + // this.$refs.JNPFForm.init(id, isDetail) + // }) + this.$router.push({path:'/paymentdoc'}) + } + } + }, exportData() { this.exportBoxVisible = true this.$nextTick(() => {