zhs 3 years ago
parent
commit
a67164f33d

+ 9 - 0
src/main/java/com/supplier/controller/ReleaseController.java

@@ -178,4 +178,13 @@ public class ReleaseController {
         return map;
     }
 
+    /**
+     * 删除路线
+     * @param uuid 参数
+     * @return 返回结果
+     */
+    @DeleteMapping("delRelease")
+    public Map<String, Object> delRelease(String uuid){
+        return supplierReleaseService.delRelease(uuid);
+    }
 }

+ 2 - 0
src/main/java/com/supplier/mapper/SupplierReleaseMapper.java

@@ -45,4 +45,6 @@ public interface SupplierReleaseMapper{
     String getSupplierOrderType(SupplierRelease supplierRelease1);
 
     Map<String, Object> getSitesInfo();
+
+    void delRelease(String uuid);
 }

+ 2 - 0
src/main/java/com/supplier/service/SupplierReleaseService.java

@@ -39,4 +39,6 @@ public interface SupplierReleaseService{
     String getSupplierOrderType(SupplierRelease supplierRelease1);
 
     Map<String, Object> getSitesInfo();
+
+    Map<String, Object> delRelease(String uuid);
 }

+ 14 - 0
src/main/java/com/supplier/service/impl/SupplierReleaseServiceImpl.java

@@ -124,4 +124,18 @@ public class SupplierReleaseServiceImpl implements SupplierReleaseService {
     public Map<String, Object> getSitesInfo() {
         return supplierReleaseMapper.getSitesInfo();
     }
+
+    @Override
+    public Map<String, Object> delRelease(String uuid) {
+        Map<String, Object> map = new HashMap<>();
+        try{
+            supplierReleaseMapper.delRelease(uuid);
+            map.put("msg", "200");
+        } catch (Exception e){
+            e.printStackTrace();
+            map.put("msg", "500");
+            map.put("errMsg", "服务器请求异常,请稍后再试");
+        }
+        return map;
+    }
 }

+ 4 - 2
src/main/resources/config/mapping/ReleaseMapper.xml

@@ -4,8 +4,8 @@
 <mapper namespace="com.supplier.mapper.ReleaseMapper">
     <!-- 供应商发布路线 -->
     <insert id="addReleaseVal" parameterType="SupplierRoute">
-        insert into bus_supplier_route(code,origin,destination,start_time,end_time,look_num,title_img,offer_name,price_all,people_num,uuid,jdrq,update_date,title_day_name)
-        values(#{code},#{origin},#{destination},#{startTime},#{endTime},0,#{titleImg},#{offerName},#{priceAll},#{peopleNum},#{uuid},CONVERT(VARCHAR(100), SYSDATETIME(), 20),CONVERT(VARCHAR(100), SYSDATETIME(), 20),#{titleDayName})
+        insert into bus_supplier_route(code,origin,destination,start_time,end_time,look_num,title_img,offer_name,price_all,people_num,uuid,jdrq,update_date,title_day_name,state_type)
+        values(#{code},#{origin},#{destination},#{startTime},#{endTime},0,#{titleImg},#{offerName},#{priceAll},#{peopleNum},#{uuid},CONVERT(VARCHAR(100), SYSDATETIME(), 20),CONVERT(VARCHAR(100), SYSDATETIME(), 20),#{titleDayName},'1')
     </insert>
     <!-- 查询路线发布 -->
     <select id="getRelease" parameterType="SupplierRoute" resultType="SupplierRoute">
@@ -20,6 +20,7 @@
             <if test="code != null and code !=''">
                 and code = #{code}
             </if>
+            and state_type = '1'
             and id not in (select top ${page} id  from bus_supplier_route
             <trim prefix="WHERE" prefixOverrides="and | or">
                 <if test="startTime != null and startTime !=''">
@@ -49,6 +50,7 @@
             <if test="code != null and code !=''">
                 and code = #{code}
             </if>
+            and state_type = '1'
         </trim>
     </select>
     <!-- 查询路线条数 -->

+ 4 - 0
src/main/resources/config/mapping/SupplierReleaseMapper.xml

@@ -157,4 +157,8 @@
     <select id="getSitesInfo" resultType="Map">
         select * from tuya_sites_info where site_id = 1
     </select>
+    <!-- 删除路线 伪删除 -->
+    <update id="delRelease" parameterType="String">
+        update bus_supplier_route set state_type = '0' where uuid = #{uuid}
+    </update>
 </mapper>

+ 4 - 0
src/main/resources/static/css/demandForSingle/index.css

@@ -195,4 +195,8 @@ body,html{
 }
 .layui-laydate-range{
     width: 547px;
+}
+.delete_button{
+    width: 104px;
+    background: #ff5722;
 }

+ 3 - 3
src/main/resources/static/css/indexHome/index.css

@@ -40,15 +40,15 @@ body,html{
     position: relative;
 }
 .message_num{
-    width: 22px;
-    height: 22px;
+    width: 20px;
+    height: 20px;
     background: #ffad1a;
     border-radius: 50%;
     position: absolute;
     right: -9px;
     top: -11px;
     text-align: center;
-    line-height: 24px;
+    line-height: 20px;
     color: #fff;
     display: none;
 }

BIN
src/main/resources/static/images/indeHome/message.png


+ 10 - 10
src/main/resources/static/js/demandForSingle/offer/function.js

@@ -25,16 +25,16 @@ function getPrivateOrder(){
                     offerCode = data.data.userId;
                 }
                 //滚动条监听
-                var observer = new IntersectionObserver(value => {
-                    console.log(value)
-                    var target = value[0].target
-                    console.log($(target).attr("dayNum"))
-                }, {
-                    root: document.querySelector(".content_right")
-                });
-                $.each($(".content_add_div"), (index, item) => {
-                    observer.observe(item)
-                });
+                // var observer = new IntersectionObserver(value => {
+                //     console.log(value)
+                //     var target = value[0].target
+                //     console.log($(target).attr("dayNum"))
+                // }, {
+                //     root: document.querySelector(".content_right")
+                // });
+                // $.each($(".content_add_div"), (index, item) => {
+                //     observer.observe(item)
+                // });
             } else {
                 layer.alert(paramReturn("服务器异常,请联系管理员", parent.type), {icon: 2});
             }

+ 28 - 0
src/main/resources/static/js/indexHome/function.js

@@ -496,4 +496,32 @@ function clickHeadHove(obj){
         $(".layui-nav-item").eq(3).addClass("layui-nav-itemed");
         $(".layui-nav-item").eq(3).click();
     }
+}
+//查询报价单
+function getQuotation(page, limit){
+    layer.load(3);
+    $.ajax({
+        url: "/privateOrder/getPrivateOrder",
+        type: "get",
+        data: {
+            "page": 1,
+            "limit": 7,
+            "orderType": "0"
+        },
+        headers: {"token": localStorage.getItem("token")},
+        dataType: "json",
+        success: (data) => {
+            if(data.msg == "200"){
+                if(data.count != 0){
+                    $($(".layui-nav-item")[0]).find("a").eq(0).click()
+                    $(".layui-nav-child .message_num").html(data.count).show();
+                }
+            }
+            layer.closeAll("loading");
+        },
+        error: () => {
+            layer.alert(paramReturn("服务器异常,请联系管理员", parent.type), {icon: 2});
+            layer.closeAll("loading");
+        }
+    });
 }

+ 1 - 0
src/main/resources/static/js/indexHome/index.js

@@ -167,4 +167,5 @@ layui.use(["layer", "form", "upload"], function(){
         $(".right_el_scrollbar div").remove();
     });
     translationVal(type);
+    getQuotation();
 });

+ 37 - 1
src/main/resources/static/js/release/indexPage/function.js

@@ -26,6 +26,7 @@ function getQuotation(page, limit, startTime, endTime, destination){
                         "<div class=\"head_name\" style=\"width: 15%;\">"+ item.peopleNum +"</div>\n" +
                         "<div class=\"head_name\" style=\"width: 20%;\">\n" +
                         "<button class=\"offer_button button_div_head\" onclick='offerClick(this)' data-locale=\"xiugai\"><img src=\"/images/demandForSingle/offer.png\"/>"+ paramReturn("修改", parent.type) +"</button>\n" +
+                        "<button class=\"delete_button button_div_head\" onclick='deleteClick(this)' data-locale=\"shanchu\"><img src=\"/images/demandForSingle/offer.png\"/>"+ paramReturn("删除", parent.type) +"</button>\n" +
                         "</div>\n" +
                         "</div>\n" +
                         "</div>")
@@ -33,7 +34,7 @@ function getQuotation(page, limit, startTime, endTime, destination){
                 //自定义样式分页
                 laypage.render({
                     elem: 'demo2'
-                    ,count: data.data.length
+                    ,count: data.count
                     ,theme: '#1E9FFF'
                     , limit: limit
                     , curr: page
@@ -59,6 +60,41 @@ function offerClick(obj){
     let uuid = $(obj).parent().parent().parent().attr("uuid");
     window.location.href = "/page/releaseModel?type=updateReleaseVal&uuid=" + uuid;
 }
+//删除路线
+function deleteClick(obj){
+    layer.confirm("确认要删除吗?",{
+        btn: ['确认', '取消'],
+        title: "昵称修改",
+        skin: 'layclass'
+    }, function () {
+        layer.load(3);
+        var uuid = $(obj).parent().parent().parent().attr("uuid");
+        $.ajax({
+            async: false,
+            url: "/releaseCotroller/delRelease",
+            type: "delete",
+            data: {
+                "uuid": uuid
+            },
+            headers: {"token": localStorage.getItem("token")},
+            dataType: "json",
+            success: (data) => {
+                console.log(1)
+                if(data.msg == "200"){
+                    getQuotation(1, 7, startTime, endTime, destination);//查询报价单数据渲染
+                    layer.msg("删除成功", {icon: 1});
+                }
+                layer.closeAll("loading");
+            },
+            error: () => {
+                layer.alert("服务器异常,请联系管理员", {icon: 2});
+                layer.closeAll("loading");
+            }
+        });
+    }, function (){
+        layer.closeAll();
+    })
+}
 //查询供应商信息
 function getCompany(){
     var company = null;

+ 3 - 1
src/main/resources/static/json/kor.json

@@ -131,6 +131,7 @@
   "qiehuanwenjian": "파일바꾸기",
   "quedingshangchuan": "전송등록",
   "jiaotongxinxi": "교통 정보",
+  "shanchu": "삭제",
   "报价单权限余额": "견적횟수잔액",
   "日期": "일자",
   "请输入内容": "내용을 입력하십시오",
@@ -184,5 +185,6 @@
   "人数不能为空": "사람 수가 비어 있어서는 안 된다",
   "起始地不能为空": "처음부터 텅 비워서는 안 된다",
   "目的地不能为空": "목적지가 비어 있으면 안 됩니다",
-  "酒店名称": "호텔명"
+  "酒店名称": "호텔명",
+  "删除": "삭제"
 }

+ 3 - 1
src/main/resources/static/json/zh.json

@@ -48,6 +48,7 @@
   "hetongshangchuan": "合同上传",
   "jiagemingxijieshao": "价格明细介绍",
   "qita": "其他",
+  "shanchu": "删除",
   "wugouwu": "无购物",
   "wuzifei": "无自费",
   "chengtuanbaozhang": "成团保障",
@@ -192,5 +193,6 @@
   "qiehuanwenjian": "切换文件",
   "quedingshangchuan": "确定上传",
   "交通信息": "交通信息",
-  "酒店名称": "酒店名称"
+  "酒店名称": "酒店名称",
+  "删除": "删除"
 }

+ 4 - 1
src/main/resources/templates/indexHome.html

@@ -89,7 +89,10 @@
                                 </dd>
                                 <dd>
                                     <a lay-id="HotDestination" lay-url="HotDestination" locale="daihuida" idVal="0" onClick="iframeClick(this)">
-                                        <cite data-locale="daihuida" name="待回答">待回答</cite>
+                                        <cite name="待回答">
+                                            <span data-locale="daihuida">待回答</span>
+                                            <div class="message_num" style="top: 11px;left: 128px;">0</div>
+                                        </cite>
                                     </a>
                                 </dd>
                                 <dd>