From ec80a41c3ef56cd88743b7a025d45392d791d1cd Mon Sep 17 00:00:00 2001
From: KKSU <15274802129@163.com>
Date: Mon, 03 Jun 2024 16:09:18 +0800
Subject: [PATCH] 退款时,退最后一个商品才退运费

---
 src/main/resources/templates/febs/views/modules/goods/goodsAddNew.html |   90 ++++++++++++++++++++++++++++-----------------
 1 files changed, 56 insertions(+), 34 deletions(-)

diff --git a/src/main/resources/templates/febs/views/modules/goods/goodsAddNew.html b/src/main/resources/templates/febs/views/modules/goods/goodsAddNew.html
index bf9ec93..a6e5ded 100644
--- a/src/main/resources/templates/febs/views/modules/goods/goodsAddNew.html
+++ b/src/main/resources/templates/febs/views/modules/goods/goodsAddNew.html
@@ -57,6 +57,7 @@
                                                 <label class="layui-form-label febs-form-item-require">单位:</label>
                                                 <div class="layui-input-block">
                                                     <input type="text" name="unit"  lay-verify="required" placeholder="" autocomplete="off" class="layui-input">
+                                                    <div class="layui-form-mid layui-word-aux">例如:个、克。</div>
                                                 </div>
                                             </div>
                                             <div class="layui-col-lg6">
@@ -375,7 +376,28 @@
             validate = layui.validate,
             element = layui.element;
 
+        //验证输入数字
+        form.verify({
+            isNum: function(value, item){ //value:表单的值、item:表单的DOM对象
+                if(!new RegExp("^[0-9]+$").test(value)){
+                    return '该字段只能填写数字!';
+                }
+            }
+        });
+
+        // 验证汉字数量不超过100个
+        form.verify({
+            chineseCharCount: function(value, item){ //value:表单的值、item:表单的DOM对象
+                // 使用正则表达式匹配汉字,并计算数量
+                var chineseCharCount = (value.match(/[\u4e00-\u9fa5]/g) || []).length;
+                if(chineseCharCount > 100){
+                    return '汉字数量不能超过100个!';
+                }
+            }
+        });
+
         form.render();
+
         const E = window.wangEditor;
         const editor = new E('#toolbar-container', '#text-container'); // 传入两个元素
         editor.config.showLinkImg = false;
@@ -503,32 +525,32 @@
             });
         })
 
-        var couponRule = xmSelect.render({
-            el: '#coupon-rule',
-            language: 'zn',
-            prop : {
-                value : 'id',
-                children : 'child'
-            },
-            iconfont: {
-                parent: 'hidden',
-            },
-            // radio: true,
-            clickClose: true,
-            tree: {
-                show: true,
-                //非严格模式
-                strict: false,
-            },
-            data: []
-        })
-
-        febs.get(ctx + 'admin/goods/couponTreeSet', null, function(res) {
-            couponRule.update({
-                data : res.data,
-                autoRow: true,
-            });
-        })
+        // var couponRule = xmSelect.render({
+        //     el: '#coupon-rule',
+        //     language: 'zn',
+        //     prop : {
+        //         value : 'id',
+        //         children : 'child'
+        //     },
+        //     iconfont: {
+        //         parent: 'hidden',
+        //     },
+        //     // radio: true,
+        //     clickClose: true,
+        //     tree: {
+        //         show: true,
+        //         //非严格模式
+        //         strict: false,
+        //     },
+        //     data: []
+        // })
+        //
+        // febs.get(ctx + 'admin/goods/couponTreeSet', null, function(res) {
+        //     couponRule.update({
+        //         data : res.data,
+        //         autoRow: true,
+        //     });
+        // })
 
         var tableSkuData=[];
         var tableIns = table.render({
@@ -788,14 +810,14 @@
 
         form.on('submit(goods-add-form-submit)', function (data) {
             data.field.goodsType = 1;
-            let couponRuleList = couponRule.getValue();
-            if (couponRuleList.length > 0) {
-                var couponIds = [];
-                layui.each(couponRuleList, function (key, item) {
-                    couponIds.push(item.id)
-                });
-                data.field.couponIds=couponIds;
-            }
+            // let couponRuleList = couponRule.getValue();
+            // if (couponRuleList.length > 0) {
+            //     var couponIds = [];
+            //     layui.each(couponRuleList, function (key, item) {
+            //         couponIds.push(item.id)
+            //     });
+            //     data.field.couponIds=couponIds;
+            // }
             data.field.addMallGoodsSkuDtos = tableSkuData;
             data.field.categoryId = category.getValue('valueStr');
             data.field.carriageRuleId = carriageRule.getValue('valueStr');

--
Gitblit v1.9.1