From cebfe8dc36a08a5495f60b93925b4393b8be9acc Mon Sep 17 00:00:00 2001
From: xiaoyong931011 <15274802129@163.com>
Date: Sun, 26 Sep 2021 16:41:05 +0800
Subject: [PATCH] 20210926

---
 src/main/resources/templates/febs/views/modules/goods/goodsAddNew.html      |   44 +++++++---------------
 src/main/resources/templates/febs/views/modules/product/categoryUpdate.html |    7 ++-
 src/main/resources/templates/febs/views/modules/goods/detailGoods.html      |   40 ++++++--------------
 src/main/resources/templates/febs/views/modules/order/withAddress.html      |    3 +
 4 files changed, 33 insertions(+), 61 deletions(-)

diff --git a/src/main/resources/templates/febs/views/modules/goods/detailGoods.html b/src/main/resources/templates/febs/views/modules/goods/detailGoods.html
index 52640f8..2e55f91 100644
--- a/src/main/resources/templates/febs/views/modules/goods/detailGoods.html
+++ b/src/main/resources/templates/febs/views/modules/goods/detailGoods.html
@@ -43,11 +43,8 @@
         <div class="layui-col-lg6">
             <label class="layui-form-label febs-form-item-require">所属分类:</label>
             <div class="layui-input-block">
-                <select name="categoryId"
-                        lay-verify="required"
-                        xm-select-direction="down"
-                        xm-select="user-add-goods"
-                        xm-select-skin="default">
+                <select name="parentId" class="categary-update-category" id="categarySelect" readonly>
+                    <option value="">请选择</option>
                 </select>
             </div>
         </div>
@@ -131,30 +128,17 @@
 
         form.render();
 
-        formSelects.config('user-add-goods', {
-            searchUrl: ctx + 'admin/goodsCategory/categorys',
-            response: {
-                statusCode: 200
-            },
-            beforeSuccess: function (id, url, searchVal, result) {
-                var data = result.data;
-                var tranData = [];
-                for (var i = 0; i < data.length; i++) {
-                    tranData.push({
-                        name: data[i].name,
-                        value: data[i].id
-                    })
-                }
-                result.data = tranData;
-                return result;
-            },
-            success: function () {
-                // formSelects.value('user-add-goods', result.id);
-            },
-            error: function (id, url, searchVal, err) {
-                console.error(err);
-                febs.alert.error('获取分类列表失败');
+        //(下拉框)
+        $.get(ctx + 'admin/goodsCategory/categorys/tree', function (data) {
+            for (var k in data)
+            {
+                $(".categary-update-category").append("<option value='" + data[k].parentId + "'>" + data[k].name + "</option>");
             }
+            layui.use('form', function () {
+                var form = layui.form;
+                $("#categarySelect").val(mailGoodsDetail.categoryId)
+                form.render();
+            });
         });
 
         layedit.set({	//设置图片接口
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 029250f..5a414a2 100644
--- a/src/main/resources/templates/febs/views/modules/goods/goodsAddNew.html
+++ b/src/main/resources/templates/febs/views/modules/goods/goodsAddNew.html
@@ -23,12 +23,8 @@
                                 <div class="layui-col-lg6">
                                     <label class="layui-form-label febs-form-item-require">所属分类:</label>
                                     <div class="layui-input-block">
-                                        <select name="categoryId"
-                                                value="categoryId"
-                                                lay-verify="required"
-                                                xm-select-direction="down"
-                                                xm-select="user-add-goods"
-                                                xm-select-skin="default">
+                                        <select name="parentId" class="categary-update-category" >
+                                            <option value="">请选择</option>
                                         </select>
                                     </div>
                                 </div>
@@ -158,32 +154,20 @@
 
         formSelects.render();
 
-        formSelects.config('user-add-goods', {
-            searchUrl: ctx + 'admin/goodsCategory/categorys',
-            response: {
-                statusCode: 200
-            },
-            beforeSuccess: function (id, url, searchVal, result) {
-                var data = result.data;
-                var tranData = [];
-                for (var i = 0; i < data.length; i++) {
-                    tranData.push({
-                        name: data[i].name,
-                        value: data[i].id
-                    })
-                }
-                result.data = tranData;
-                console.log(result);
-                return result;
-            },
-            success: function () {
-                formSelects.value('user-add-goods', result.id);
-            },
-            error: function (id, url, searchVal, err) {
-                console.error(err);
-                febs.alert.error('获取分类列表失败');
+
+        //(下拉框)
+        $.get(ctx + 'admin/goodsCategory/categorys/tree', function (data) {
+            for (var k in data)
+            {
+                $(".categary-update-category").append("<option value='" + data[k].parentId + "'>" + data[k].name + "</option>");
             }
+            layui.use('form', function () {
+                var form = layui.form;
+                // $("#categarySelect").val(member.parentId)
+                form.render();
+            });
         });
+
         //多图片上传
         upload.render({
             elem: '#thumbsBanner'
diff --git a/src/main/resources/templates/febs/views/modules/order/withAddress.html b/src/main/resources/templates/febs/views/modules/order/withAddress.html
index b8cfc79..4ace8f3 100644
--- a/src/main/resources/templates/febs/views/modules/order/withAddress.html
+++ b/src/main/resources/templates/febs/views/modules/order/withAddress.html
@@ -35,6 +35,9 @@
                 </div>
             </div>
         </div>
+        <div class="layui-form-item">
+                    <div style="text-align:center;color: red">提示:退货地址可到【退货地址管理】里添加/编辑</div>
+        </div>
         <div class="layui-form-item febs-hide">
             <button class="layui-btn" lay-submit="" lay-filter="address-choose-form-submit" id="submit"></button>
         </div>
diff --git a/src/main/resources/templates/febs/views/modules/product/categoryUpdate.html b/src/main/resources/templates/febs/views/modules/product/categoryUpdate.html
index fba11ee..cd8573b 100644
--- a/src/main/resources/templates/febs/views/modules/product/categoryUpdate.html
+++ b/src/main/resources/templates/febs/views/modules/product/categoryUpdate.html
@@ -36,8 +36,8 @@
         <div class="layui-form-item">
             <label class="layui-form-label">父类:</label>
             <div class="layui-input-inline">
-                <select name="parentId" class="categary-update-category">
-                    <option value="'+[[${member}]].parentId+'">请选择</option>
+                <select name="parentId" class="categary-update-category" id="categarySelect">
+                    <option value="">请选择</option>
                 </select>
             </div>
         </div>
@@ -93,6 +93,7 @@
             }
             layui.use('form', function () {
                 var form = layui.form;
+                $("#categarySelect").val(member.parentId)
                 form.render();
             });
         });
@@ -135,7 +136,7 @@
         form.on('submit(categary-update-form-submit)', function (data) {
             febs.post(ctx + 'admin/goodsCategory/updateCategory', data.field, function () {
                 layer.closeAll();
-                febs.alert.success('新增成功');
+                febs.alert.success('操作成功');
                 $('#febs-user').find('#reset').click();
             });
             return false;

--
Gitblit v1.9.1