From 84b539a2bd610a946b02f36722f154e916037102 Mon Sep 17 00:00:00 2001 From: xd <844539747@qq.com> Date: Fri, 26 Jul 2024 11:16:57 +0800 Subject: [PATCH] '123' --- .../web/controller/quot/QuotController.java | 18 ++++------------- ruoyi-ui/src/main.js | 20 +++++++++---------- 2 files changed, 14 insertions(+), 24 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/quot/QuotController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/quot/QuotController.java index 9babd5e..6e0428c 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/quot/QuotController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/quot/QuotController.java @@ -764,24 +764,14 @@ public class QuotController extends BaseController } //厂价金额小于10万 不走OA审批 - BigDecimal tpxd = BigDecimal.ONE; - List materials = quot.getQuotMaterialList(); - if(materials!=null&&materials.size()>0){ - BigDecimal matQuotTp = materials.get(0).getMatQuotTp(); - if(matQuotTp == null || BigDecimal.ZERO.compareTo(matQuotTp)==0){ - matQuotTp = BigDecimal.ONE; - } - tpxd = matQuotTp; - } + String quotTotalPrice = quot.getQuotTotalPrice();//报价金额 + BigDecimal totalPrice = new BigDecimal(quotTotalPrice); String allowFactoryPrice = configService.selectConfigByKey("quot:allow.factoryPrice"); BigDecimal factoryPrice = new BigDecimal(allowFactoryPrice); - String quotTotalPrice = quot.getQuotTotalPrice();//报价金额 - BigDecimal changj = new BigDecimal(quotTotalPrice).divide(tpxd,2,RoundingMode.HALF_UP);//厂价金额 - - if(changj.compareTo(factoryPrice)<0){ - return error("厂价金额不超过"+allowFactoryPrice+",无法提交OA审批"); + if(totalPrice.compareTo(factoryPrice)<0){ + return error("总金额不超过"+allowFactoryPrice+",无法提交OA审批"); } // 报价单提交OA,插入中间表 sys_oa_quot sys_oa_quot_material diff --git a/ruoyi-ui/src/main.js b/ruoyi-ui/src/main.js index 89c7946..2577c69 100644 --- a/ruoyi-ui/src/main.js +++ b/ruoyi-ui/src/main.js @@ -127,19 +127,19 @@ Element.Dialog.props.closeOnClickModal.default = false //聚焦事件 Vue.directive("focus", { - bind:function (el) { // 1.每当指令绑定到元素上的时候,会立即执行这个bind函数,【执行一次】 - el.focus() - }, inserted:function (el) { // 2.当元素插入到DOM中的时候,会执行 inserted 函数, 【触发一次】 - if(el.tagName.toLocaleLowerCase() == 'input'){ + if (el.nodeName === 'INPUT' || el.nodeName === 'TEXTAREA') { + // 如果直接是input标签/textarea标签 el.focus() - }else{ - if(el.getElementsByTagName('input')){ - el.getElementsByTagName('input')[0].focus() + } else { + // 指令在van-search组件身上, 获取的是组件根标签div, 而input在标签内 + const inp = el.querySelector('input') + const textArea = el.querySelector('textarea') + // 如果找到了 + if (inp || textArea) { + inp && inp.focus() + textArea && textArea.focus() } } - }, - updated:function ( ) { // 3.当VNode更新的时候,会执行 updated,【可能触发多次】 - el.focus() } })