From 5d89f11376a6a1206359c2a3951c324e2203ac50 Mon Sep 17 00:00:00 2001 From: jiyufei <67400194@qq.com> Date: Fri, 23 Aug 2024 17:04:14 +0800 Subject: [PATCH] =?UTF-8?q?feat():=E8=AE=BE=E5=A4=87=E7=BC=96=E7=A0=81?= =?UTF-8?q?=E4=B8=8D=E5=85=81=E8=AE=B8=E9=87=8D=E5=A4=8D=E5=88=9B=E5=BB=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/jnpf/service/YysDeviceService.java | 2 +- .../service/impl/YysDeviceServiceImpl.java | 9 +- .../jnpf/controller/YysDeviceController.java | 23 ++- .../jnpf-web/src/views/yys/yysdevice/form.vue | 131 ++++-------------- 4 files changed, 50 insertions(+), 115 deletions(-) diff --git a/jnpf-java-boot/jnpf-example/jnpf-example-biz/src/main/java/jnpf/service/YysDeviceService.java b/jnpf-java-boot/jnpf-example/jnpf-example-biz/src/main/java/jnpf/service/YysDeviceService.java index ddb65f5..a8d663c 100644 --- a/jnpf-java-boot/jnpf-example/jnpf-example-biz/src/main/java/jnpf/service/YysDeviceService.java +++ b/jnpf-java-boot/jnpf-example/jnpf-example-biz/src/main/java/jnpf/service/YysDeviceService.java @@ -31,7 +31,7 @@ public interface YysDeviceService extends IService { //副表数据方法 String checkForm(YysDeviceForm form, int i); - void saveOrUpdate(YysDeviceForm yysDeviceForm, String id, boolean isSave) throws Exception; + String saveOrUpdate(YysDeviceForm yysDeviceForm, String id, boolean isSave); /** * 根据设备code查询设备名称 diff --git a/jnpf-java-boot/jnpf-example/jnpf-example-biz/src/main/java/jnpf/service/impl/YysDeviceServiceImpl.java b/jnpf-java-boot/jnpf-example/jnpf-example-biz/src/main/java/jnpf/service/impl/YysDeviceServiceImpl.java index cb4cbfd..05c3610 100644 --- a/jnpf-java-boot/jnpf-example/jnpf-example-biz/src/main/java/jnpf/service/impl/YysDeviceServiceImpl.java +++ b/jnpf-java-boot/jnpf-example/jnpf-example-biz/src/main/java/jnpf/service/impl/YysDeviceServiceImpl.java @@ -22,6 +22,7 @@ import jnpf.service.YysDeviceMaterialService; import jnpf.service.YysDeviceService; import jnpf.service.YysDeviceUpkeepService; import jnpf.util.*; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -309,7 +310,7 @@ public class YysDeviceServiceImpl extends ServiceImpl wrapper1 = new LambdaQueryWrapper<>(); + wrapper1.eq(YysDeviceMaterialEntity::getDeviceCode, entity.getDeviceCode()); + if (CollectionUtils.isNotEmpty(yysDeviceMaterialService.list(wrapper1))) { + return "不可以重复创建"; + } String mainId = RandomUtil.uuId(); entity.setCreatorTime(DateUtil.getNowDate()); entity.setCreatorUserId(userInfo.getUserId()); @@ -335,6 +341,7 @@ public class YysDeviceServiceImpl extends ServiceImpl - + - + - + 取 消 - 确 定 + 确 定 - + @@ -302,6 +227,9 @@ export default { }; }, computed: { + isDisabled() { + return !this.dataForm.id; + }, ...mapGetters(["userInfo"]) }, watch: {}, @@ -310,8 +238,9 @@ export default { this.initDefaultData(); this.dataValueAll = JSON.parse(JSON.stringify(this.dataForm)); }, - mounted() {}, + mounted() { }, methods: { + fnMaterialListDialog() { this.$nextTick(() => { this.$refs.materialListDialog.init(this.dataForm.data); @@ -425,7 +354,7 @@ export default { } } }, - dataAll() {}, + dataAll() { }, clearData() { this.dataForm = JSON.parse(JSON.stringify(this.dataValueAll)); }, @@ -465,7 +394,7 @@ export default { this.$store.commit("generator/UPDATE_RELATION_DATA", {}); }, //初始化默认数据 - initDefaultData() {}, + initDefaultData() { }, // 表单提交 dataFormSubmit(type) { this.dataFormSubmitType = type ? type : 0;