diff --git a/jnpf-java-boot/jnpf-example/jnpf-example-biz/src/main/java/jnpf/service/impl/BillTableServiceImpl.java b/jnpf-java-boot/jnpf-example/jnpf-example-biz/src/main/java/jnpf/service/impl/BillTableServiceImpl.java index a40afdb..1818408 100644 --- a/jnpf-java-boot/jnpf-example/jnpf-example-biz/src/main/java/jnpf/service/impl/BillTableServiceImpl.java +++ b/jnpf-java-boot/jnpf-example/jnpf-example-biz/src/main/java/jnpf/service/impl/BillTableServiceImpl.java @@ -595,12 +595,13 @@ public class BillTableServiceImpl extends ServiceImpl wrapper = new LambdaQueryWrapper<>(BillTableEntity.class) + .eq(BillTableEntity::getContractId, billTableForm.getContractId()); + if (ObjectUtil.isNotNull(this.getOne(wrapper))) { + return "已存在相同合同数据!"; + } if (isSave) { - //同一个合同只能创建一条 - LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(BillTableEntity.class).eq(BillTableEntity::getContractId, billTableForm.getContractId()); - if (ObjectUtil.isNotNull(this.getOne(wrapper))) { - return "已存在相同合同数据!"; - } //获取当前年月日 String currentDate = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyMMdd")); entity.setBillNumbe("ZD" + currentDate + RandomUtil.uuId().substring(0, 3)); @@ -684,7 +685,7 @@ public class BillTableServiceImpl extends ServiceImpl - + @@ -749,6 +749,14 @@ export default { this.$emit('refreshDataList', true) }, changeData(model, index) { + if (model == 'contractId' && (this.dataForm.contractId != null || this.dataForm.contractId != undefined)) { + request({ + url: '/api/example/Contract/getMerchantById/' + this.dataForm.contractId, + method: 'get' + }).then(res => { + this.$set(this.dataForm, 'merchantId', res.data.merchantName); + }); + } this.isEdit = false this.childIndex = index let modelAll = model.split("-"); diff --git a/jnpf-java-boot/jnpf-web/src/views/scm/billtable/index.vue b/jnpf-java-boot/jnpf-web/src/views/scm/billtable/index.vue index eb0f999..6630c4f 100644 --- a/jnpf-java-boot/jnpf-web/src/views/scm/billtable/index.vue +++ b/jnpf-java-boot/jnpf-web/src/views/scm/billtable/index.vue @@ -76,7 +76,7 @@ - +