Jelajahi Sumber

特殊供应商

zhijiezhao 3 tahun lalu
induk
melakukan
575d03e3f2

+ 9 - 0
src/main/java/com/caimei/modules/user/entity/NewCmShop.java

@@ -80,6 +80,7 @@ public class NewCmShop extends DataEntity<NewCmShop> {
     private List<SplitCode> splitCodes; //分账方,子商户商编
     private String splitCode;  //列表页回显
     private String socialCreditCode; //统一社会信用代码
+    private Integer shopType;//供应商类别,普通1,新品供应商2,二手供应商3
 
     /**
      * 非持久化字段
@@ -111,6 +112,14 @@ public class NewCmShop extends DataEntity<NewCmShop> {
         this.checkMan = checkMan;
     }
 
+    public Integer getShopType() {
+        return shopType;
+    }
+
+    public void setShopType(Integer shopType) {
+        this.shopType = shopType;
+    }
+
     public String getSplitCode() {
         return splitCode;
     }

+ 21 - 0
src/main/java/com/caimei/modules/user/web/NewCmShopController.java

@@ -89,6 +89,27 @@ public class NewCmShopController extends BaseController {
         return "modules/user/newCmShopList";
     }
 
+    @RequestMapping(value = "/special/new")
+    public String specialList(NewCmShop newCmShop, HttpServletRequest request, HttpServletResponse response, Model model) {
+        //新品供应商
+        newCmShop.setShopType(2);
+        Page<NewCmShop> page = newCmShopService.findPage(new Page<NewCmShop>(request, response), newCmShop);
+        model.addAttribute("page", page);
+        model.addAttribute("shopType",2);
+        return "modules/user/cmNewProductShopList";
+    }
+
+    @RequestMapping(value = "/special/second")
+    public String secondList(NewCmShop newCmShop, HttpServletRequest request, HttpServletResponse response, Model model) {
+        //二手供应商
+        newCmShop.setShopType(3);
+        Page<NewCmShop> page = newCmShopService.findPage(new Page<NewCmShop>(request, response), newCmShop);
+        model.addAttribute("page", page);
+        model.addAttribute("shopType",3);
+        return "modules/user/cmNewProductShopList";
+    }
+
+
     @RequiresPermissions("user:newCmShop:view")
     @RequestMapping(value = "form")
     public String form(NewCmShop newCmShop, Model model) {

+ 8 - 8
src/main/resources/mappings/modules/user/NewCmShopMapper.xml

@@ -91,10 +91,7 @@
 		<where>
 
 			<if test="name != null and name != ''">
-				AND a.name LIKE
-					<if test="dbName == 'oracle'">'%'||#{name}||'%'</if>
-					<if test="dbName == 'mssql'">'%'+#{name}+'%'</if>
-					<if test="dbName == 'mysql'">concat('%',#{name},'%')</if>
+				AND a.name LIKE concat('%',#{name},'%')
 			</if>
 			<if test="status != null and status != ''">
 				AND a.status = #{status}
@@ -103,10 +100,10 @@
 				AND a.contractMobile = #{contractMobile}
 			</if>
 			<if test="linkMan != null and linkMan != ''">
-				AND a.linkMan LIKE
-				<if test="dbName == 'oracle'">'%'||#{linkMan}||'%'</if>
-				<if test="dbName == 'mssql'">'%'+#{linkMan}+'%'</if>
-				<if test="dbName == 'mysql'">concat('%',#{linkMan},'%')</if>
+				AND a.linkMan LIKE concat('%',#{linkMan},'%')
+			</if>
+			<if test="shopType !=null">
+				AND a.shopType = #{shopType}
 			</if>
 			<if test="startTime != null and startTime != ''">
 				AND (u.registerTime &gt; #{startTime} OR  u.registerTime = #{startTime})
@@ -120,6 +117,9 @@
 			<if test="source != null and source != ''">
 				AND u.source = #{source}
 			</if>
+			<if test="shopID != null and shopID>0">
+				AND a.shopID = #{shopID}
+			</if>
 		</where>
 		<choose>
 			<when test="page !=null and page.orderBy != null and page.orderBy != ''">

+ 988 - 0
src/main/webapp/WEB-INF/views/modules/product-new/cmNewProductForm.jsp

@@ -0,0 +1,988 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
+<html>
+<head>
+    <title>二手商品管理</title>
+    <meta name="decorator" content="default"/>
+    <script type="text/javascript">
+        $(document).ready(function () {
+            //$("#name").focus();订单来源
+            $("#inputForm").validate({
+                submitHandler: function (form) {
+                    var costCheckFlag = $("input[name='costCheckFlag']:checked").val();
+                    var find = $("input[name='ids']:checked").val();
+                    if (!find >= 1) {
+                        alertx("请选择商品包含的文件!");
+                        return false;
+                    }
+                    var publishIdentity = $("input[name='publishIdentity']:checked").val();
+                    console.log(publishIdentity);
+                    if (!publishIdentity > 0) {
+                        alertx("请选择用户身份");
+                        return false;
+                    }
+                    if (publishIdentity * 1 === 2) {
+                        if ($("#companyName").val() == '') {
+                            alertx("公司名称不能为空!");
+                            return false;
+                        }
+                    }
+                    if (costCheckFlag * 1 === 1) {
+                        if ($("#costPrice").val() == '') {
+                            alertx("请输入成本价");
+                            return false;
+                        }
+                        var costPrice = $("#costPrice").val();
+                        if (0 == costPrice) {
+                            alertx('成本价不能为0');
+                            return false;
+                        }
+                    } else {
+                        if ($("#costProportional").val() == '') {
+                            alertx("请输入成本比例");
+                            return false;
+                        }
+                    }
+
+                    // 验证填写参数
+                    var payStatus = $('#payStatus').val();
+                    if (payStatus == 2) {
+                        var payAmount = $("#payAmount").val();
+                        // (验证付款金额)
+                        if (payAmount == "" || payAmount == null) {
+                            alertx('请填写付款金额');
+                            return false;
+                        }
+                        if (0 == payAmount) {
+                            alertx('付款金额不能为0');
+                            return false;
+                        }
+                    }
+
+                    var price = $("#price").val();
+                    if (0 == price) {
+                        alertx('交易价不能为0');
+                        return false;
+                    }
+
+                    var secondHandType = $("input[name ='secondHandType']:checked").val();
+                    if (secondHandType == 2) {
+                        var maturityYears = $("#maturityYears").val();
+                        // (验证到期时期)
+                        if (maturityYears == null || maturityYears == "") {
+                            alertx('请输入产品到期日');
+                            return false;
+                        }
+                        //(验证临期价格信息)
+                        var normalPrice = $("#normalPrice").val();
+                        if (null == normalPrice || normalPrice == "") {
+                            alertx('请输入市场价');
+                            return false;
+                        }
+                        if (0 == normalPrice) {
+                            alertx('市场价不能为0');
+                            return false;
+                        }
+                        //
+                        var originalPrice = $("#originalPrice").val();
+                        if (null == originalPrice || originalPrice == "") {
+                            alertx('请输入采购价/原价');
+                            return false;
+                        }
+                        if (0 == originalPrice) {
+                            alertx('采购价/原价不能为0');
+                            return false;
+                        }
+
+                        var stock = $("#stock").val();
+                        if (null == stock || stock == "") {
+                            alertx('请输入数量');
+                            return false;
+                        }
+                    }
+                    //获取选中townID给Form标签
+                    var townId = $("#town option:selected").attr("townId");
+                    $("#townId").val(townId);
+
+                    var peopleMobile = $("#dockingPeopleMobile").val();
+                    if (peopleMobile != '' && peopleMobile != undefined) {
+                        var reg = new RegExp('^1[0-9]{10}$');
+                        if (!reg.test(peopleMobile)) {
+                            alertx('请填写正确的采美对接人联系方式');
+                            return false;
+                        }
+                    }
+                    loading('正在提交,请稍等...');
+                    form.submit();
+                },
+                errorContainer: "#messageBox",
+                errorPlacement: function (error, element) {
+                    $("#messageBox").text("输入有误,请先更正。");
+                    if (element.is(":checkbox") || element.is(":radio") || element.parent().is(".input-append")) {
+                        error.appendTo(element.parent().parent());
+                    } else {
+                        error.insertAfter(element);
+                    }
+                }
+            });
+        });
+
+    </script>
+    <style>
+        .form-horizontal .controls {
+            margin-left: 0;
+        }
+
+        .form-horizontal .control-label {
+            float: left;
+            width: 181px;
+            padding-top: 5px;
+            text-align: right;
+        }
+
+        #increase, #decrease, .lineNum {
+            width: 30px;
+            height: 30px;
+        }
+
+        .lineNum {
+            text-align: center;
+        }
+
+        .dateInput input {
+            width: 150px;
+        }
+
+        .clause span {
+            margin-left: 30px;
+        }
+
+        #productTable th {
+            text-align: center;
+            white-space: nowrap;
+        }
+
+        #productTable td {
+            text-align: center;
+            white-space: nowrap;
+        }
+
+        .iconBox {
+            font-size: 0;
+        }
+
+        .controls .conList {
+            display: inline-block;
+            margin-right: 15px;
+        }
+
+        .conList .btn:nth-of-type(1) {
+            margin-left: 25px;
+        }
+
+        .select2-choice {
+            width: 100px;
+        }
+
+        .upload-content {
+            margin-top: -70px;
+            display: inline-block;
+        }
+
+        .upload-content .conList .btn:nth-of-type(1) {
+            width: 90px;
+            height: 100px;
+            border: 2px solid #eee;
+            background: #fff;
+            position: relative;
+        }
+
+        .upload-content .conList .btn:nth-of-type(1) > div {
+            position: absolute;
+            top: 50%;
+            left: 50%;
+            transform: translate(-50%, -50%);
+            color: #666;
+        }
+
+        .upload-content .conList .btn:nth-of-type(1) span {
+            font-size: 35px;
+        }
+
+        .upload-content .conList .btn:nth-of-type(1) h5 {
+            color: #666;
+        }
+
+        .cancel-upload {
+            background: transparent;
+            border: none;
+            box-shadow: none;
+            position: relative;
+            top: -38px;
+            left: -25px;
+            cursor: pointer;
+            z-index: 100;
+        }
+
+        .upload-content .conList ol li {
+            width: 114px;
+            min-height: 80px;
+            text-align: center;
+            background: #fff;
+            position: relative;
+            top: 120px;
+            margin-left: 2px;
+        }
+
+        .upload-content-image {
+            margin-top: -70px;
+        }
+
+        .upload-content-image .conList .btn:nth-of-type(1) {
+            width: 90px;
+            height: 100px;
+            border: 2px solid #eee;
+            background: #fff;
+            position: relative;
+        }
+
+        .upload-content-image .conList .btn:nth-of-type(1) > div {
+            position: absolute;
+            top: 50%;
+            left: 50%;
+            transform: translate(-50%, -50%);
+            color: #666;
+        }
+
+        .upload-content-image .conList .btn:nth-of-type(1) span {
+            font-size: 35px;
+        }
+
+        .upload-content-image .conList .btn:nth-of-type(1) h5 {
+            color: #666;
+        }
+
+        .upload-content-image .conList ol li {
+            width: 114px;
+            min-height: 80px;
+            text-align: center;
+            background: #fff;
+            position: relative;
+            top: 120px;
+            margin-left: 2px;
+        }
+
+        .cancel-upload-image {
+            background: transparent;
+            border: none;
+            box-shadow: none;
+            position: relative;
+            top: -38px;
+            left: -25px;
+            cursor: pointer;
+            z-index: 100;
+        }
+
+        .hide-pic {
+            display: none !important;
+        }
+
+        .hide-pic-image {
+            display: none !important;
+        }
+
+        .upload-tips {
+            margin: 10px 0;
+        }
+    </style>
+</head>
+<body>
+<ul class="nav nav-tabs">
+    <li><a href="${ctx}/product/new/list?searchProductCategory=2">二手商品列表</a></li>
+    <li class="active"><a
+            href="${ctx}/product/cmSecondHandDetail/form?id=${cmSecondHandDetail.id}">二手商品<shiro:hasPermission
+            name="product:cmSecondHandDetail:edit">${not empty cmSecondHandDetail.id?'编辑':'添加'}</shiro:hasPermission><shiro:lacksPermission
+            name="product:cmSecondHandDetail:edit">查看</shiro:lacksPermission></a></li>
+</ul>
+<br/>
+<form:form id="inputForm" modelAttribute="cmSecondHandDetail"
+           action="${ctx}/product/cmSecondHandDetail/save?searchName=${cmSecondHandDetail.searchName}&searchShopID=${cmSecondHandDetail.searchShopID}&searchShopName=${cmSecondHandDetail.searchShopName}&searchBigTypeID=${cmSecondHandDetail.searchBigTypeID}&searchSmallTypeID=${cmSecondHandDetail.searchSmallTypeID}&searchTinyTypeID=${cmSecondHandDetail.searchTinyTypeID}&searchValidFlag=${cmSecondHandDetail.searchValidFlag}&searchActStatus=${cmSecondHandDetail.searchActStatus}&searchProductType=${cmSecondHandDetail.searchProductType}&searchBrandID=${cmSecondHandDetail.searchBrandID}&searchPreferredFlag=${cmSecondHandDetail.searchPreferredFlag}&searchProductCategory=${cmSecondHandDetail.searchProductCategory}&editFlag=${cmSecondHandDetail.editFlag}"
+           method="post" class="form-horizontal">
+    <sys:message content="${message}"/>
+    <%--		新增加不需要显示--%>
+    <c:if test="${ not empty cmSecondHandDetail.id}">
+    <tr>
+        <th><span class="red">*</span>商品显示名:</th>
+        <td colspan="3">
+            <form:input path="name" maxlength="100" onchange="checkmaxlength(this.value)"
+                        class="input-small required"/>
+            <span>
+                    <span style="font-weight: bold;">商品编码:</span>
+                    <span><form:input path="productCode" maxlength="100"/></span>
+                </span>
+        </td>
+    </tr>
+    <tr>
+        <th><span class="red">*</span>内部商品名:</th>
+        <td colspan="3">
+            <form:input path="aliasName" maxlength="100" onchange="checkmaxlength(this.value)"
+                        class="input-small required"/>
+            <span>
+                    <span style="font-weight: bold;">商品备注:</span>
+                    <span><form:input path="productRemarks" maxlength="60" onchange="checkmaxlengths(this.value,60)"
+                                      class="input-small"/></span>
+                </span>
+        </td>
+    </tr>
+    <tr>
+        <th>搜索关键字:</th>
+        <td colspan="3" class="skword">
+            <form:input path="searchKeyList[0]" maxlength="32" placeholder="建议输入品牌关键词"
+                        onchange="checkmaxlengthsBySearch(this,this.value,32)" class="input-small"/>
+            <form:input path="searchKeyList[1]" maxlength="32" placeholder="建议输入商品学名关键词"
+                        onchange="checkmaxlengthsBySearch(this,this.value,32)" class="input-small"/>
+            <form:input path="searchKeyList[2]" maxlength="32" placeholder="建议输入商品别名/市场称呼关键词"
+                        onchange="checkmaxlengthsBySearch(this,this.value,32)" class="input-small"/>
+            <form:input path="searchKeyList[3]" maxlength="32" placeholder="建议输入商品大分类关键词"
+                        onchange="checkmaxlengthsBySearch(this,this.value,32)" class="input-small"/>
+            <form:input path="searchKeyList[4]" maxlength="32" placeholder="建议输入商品小分类关键词"
+                        onchange="checkmaxlengthsBySearch(this,this.value,32)" class="input-small"/>
+            <p>请务必准确定义关键词,关键词会影响商品的搜索结果,建议从品牌,商品学名,商品别名,商品大类别和商品小类别5个方面考虑,每个关键词不超过16个汉字。</p>
+        </td>
+    </tr>
+    <tr>
+        <th>相关参数:</th>
+        <td colspan="3" class="params">
+            <div id="addParamsItems">
+                    <%--相关参数层--%>
+                <input type="hidden" value="${fn:length(product.productParametersList)}"
+                       id="productParametersLength">
+                <c:forEach items="${product.productParametersList}" var="item" varStatus="varIndex">
+                    <div id="paramsItem" class="paramsItem">
+                        <form:input path="productParametersList[${varIndex.index}].paramsName" id="paramsName"
+                                    cssStyle="width:142px" maxlength="10" placeholder="参数名称" class="input-small"/>
+                        <form:input path="productParametersList[${varIndex.index}].paramsContent" id="paramsContent"
+                                    cssStyle="width:680px" maxlength="50" placeholder="请输入参数信息"
+                                    class="input-small"/>
+                        <span type="button" style="cursor: pointer;color: #0B61A4"
+                              onclick="deleteParams(this)">删除</span>
+                    </div>
+                </c:forEach>
+            </div>
+            <button class="addParams" onclick="return false">添加参数</button>
+        </td>
+    </tr>
+    <tr>
+        <th>品牌:</th>
+        <td colspan="3">
+            <form:select path="brandID" class="input-small">
+                <form:option value="" label="请选择"/>
+                <form:options items="${brandList}" itemLabel="name" itemValue="id" htmlEscape="false"/>
+            </form:select>
+        </td>
+    </tr>
+    <div class="control-group">
+        <label class="control-label" style="margin-top: 17px">图片:</label>
+        <div class="controls upload-content" id="secondHandImage">
+            <div class="conList">
+                <form:hidden value="${cmSecondHandDetail.image1}" id="image1" path="image1" htmlEscape="false"
+                             maxlength="255" class="input-xlarge"/>
+                <sys:ckfinder input="image1" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100"
+                              maxHeight="100"/>
+            </div>
+            <div class="conList hide-pic">
+                <form:hidden value="${cmSecondHandDetail.image2}" id="image2" path="image2" htmlEscape="false"
+                             maxlength="255" class="input-xlarge"/>
+                <sys:ckfinder input="image2" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100"
+                              maxHeight="100"/>
+            </div>
+            <div class="conList hide-pic">
+                <form:hidden value="${cmSecondHandDetail.image3}" id="image3" path="image3" htmlEscape="false"
+                             maxlength="255" class="input-xlarge"/>
+                <sys:ckfinder input="image3" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100"
+                              maxHeight="100"/>
+            </div>
+            <div class="conList hide-pic">
+                <form:hidden value="${cmSecondHandDetail.image4}" id="image4" path="image4" htmlEscape="false"
+                             maxlength="255" class="input-xlarge"/>
+                <sys:ckfinder input="image4" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100"
+                              maxHeight="100"/>
+            </div>
+            <div class="conList hide-pic">
+                <form:hidden value="${cmSecondHandDetail.image5}" id="image5" path="image5" htmlEscape="false"
+                             maxlength="255" class="input-xlarge"/>
+                <sys:ckfinder input="image5" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100"
+                              maxHeight="100"/>
+            </div>
+        </div>
+        <div class="conList upload-tips" style="margin-left: 205px">
+            <font color="red">最多上传5张商品图片,请尽量全部上传,单张图片不能超过5M</font>
+        </div>
+    </div>
+
+    <div class="form-actions">
+        <input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>
+        <input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
+    </div>
+</form:form>
+<script>
+
+    //图片初始化
+    $(function () {
+        var ids = [];
+        if (999 !=${cmSecondHandDetail.fileTypes}) {
+            ids =${cmSecondHandDetail.fileTypes};
+            for (let i = 0; i < ids.length; i++) {
+                if (1 == ids[i]) {
+                    $("#yqht").attr("checked", true);
+                }
+                if (2 == ids[i]) {
+                    $("#yqzc").attr("checked", true);
+                }
+                if (3 == ids[i]) {
+                    $("#yqfp").attr("checked", true);
+                }
+                if (4 == ids[i]) {
+                    $("#yqbg").attr("checked", true);
+                }
+                if (5 == ids[i]) {
+                    $("#wrh").attr("checked", true);
+                }
+            }
+        }
+
+        var publishIdentity = $("input[name='publishIdentity']:checked").val();
+        if (publishIdentity * 1 === 1) {
+            $("#gsmc").hide();
+            $("#yyzz").hide();
+            $("#sfz").show();
+        } else {
+            $("#gsmc").show();
+            $("#sfz").hide();
+            $("#yyzz").show();
+        }
+
+        $('.upload-content .conList .btn:nth-of-type(1)').html('<div><span>+</span><h5>选择图片</h5></div>');
+        $('.upload-content .conList .btn:nth-of-type(2)').after('<img class="cancel-upload" src="/static/images/close-btn1.png">').remove();
+        $('.upload-content .conList').find('.cancel-upload').hide();
+        var observeEle = document.getElementsByClassName('upload-content')[0];
+
+        var MutationObserver = window.MutationObserver || window.WebKitMutationObserver;
+        var MutationObserverConfig = {
+            childList: true,
+            subtree: true,
+            characterData: true
+        };
+        var observer = new MutationObserver(function (mutations) {
+            $.each(mutations, function (index, item) {
+                if (item.type === 'childList') {
+                    // 在创建新的 element 时调用
+                    var target = $(item.target),
+                        thisWrapper = target.closest('.conList'),
+                        nextEle = thisWrapper.next();
+                    thisWrapper.find('li').css('z-index', 99);
+                    thisWrapper.find('.cancel-upload').show();
+                    if (nextEle.hasClass('hide-pic')) {
+                        nextEle.removeClass('hide-pic');
+                    }
+                }
+            })
+        });
+        observer.observe(observeEle, MutationObserverConfig);
+
+
+        $('body').on('click', '.upload-content li', function () {
+            var index = $(this).closest('.conList').index() + 1,
+                str = 'image' + index + 'FinderOpen';
+            eval(str + '()');
+        });
+        $('body').on('click', '.cancel-upload', function () {
+            debugger
+            var wrapper = $(this).closest('.conList');
+            wrapper.find('li').css('z-index', '-1');
+            wrapper.find('input').val('');
+            $(this).hide();
+            if ($('.cancel-upload:visible').length < 9) {
+                wrapper.addClass("hide-pic");
+            } else {
+                wrapper.removeClass("hide-pic");
+            }
+            wrapper.parent().append(wrapper.clone());
+            wrapper.remove();
+            $(".conList").each(function (i, ele) {
+                if ($(ele).find("input.input-xlarge").val()) {
+                    $(ele).next().removeClass("hide-pic")
+                }
+            })
+        });
+        $(window).on("load", function () {
+            setTimeout(function () {
+                $("#secondHandImage").find("input.input-xlarge").each(function (i, ele) {
+                    if ($(ele).val()) {
+                        $(ele).next().find("li").css("z-index", "99");
+                        $(ele).parents(".conList").find(".cancel-upload").show();
+                        $(ele).parents(".conList").next().removeClass("hide-pic")
+                    }
+                })
+            }, 500);
+        });
+
+
+        $('.upload-content-image .conList .btn:nth-of-type(1)').html('<div><span>+</span><h5>选择图片</h5></div>');
+        $('.upload-content-image .conList .btn:nth-of-type(2)').after('<img class="cancel-upload-image" src="/static/images/close-btn1.png">').remove();
+        $('.upload-content-image .conList').find('.cancel-upload-image').hide();
+        var observeEleImage = document.getElementsByClassName('upload-content-image')[0];
+        var observeEleImage1 = document.getElementsByClassName('upload-content-image')[1];
+        var MutationObserverImage = window.MutationObserver || window.WebKitMutationObserver;
+        var MutationObserverConfigImage = {
+            childList: true,
+            subtree: true,
+            characterData: true
+        };
+        var observerImage = new MutationObserverImage(function (mutations) {
+            $.each(mutations, function (index, item) {
+                if (item.type === 'childList') {
+                    // 在创建新的 element 时调用
+                    var target = $(item.target),
+                        thisWrapper = target.closest('.conList'),
+                        nextEle = thisWrapper.next();
+                    thisWrapper.find('li').css('z-index', 99);
+                    thisWrapper.find('.cancel-upload-image').show();
+                    if (nextEle.hasClass('hide-pic-image')) {
+                        nextEle.removeClass('hide-pic-image');
+                    }
+                }
+            })
+        });
+        observerImage.observe(observeEleImage, MutationObserverConfigImage);
+        observerImage.observe(observeEleImage1, MutationObserverConfigImage);
+
+        $('body').on('click', '.upload-content-image li', function () {
+            var index = $(this).closest('.conList').index() + 1,
+                str = 'remarkImage' + index + 'FinderOpen';
+            eval(str + '()');
+        });
+        $('body').on('click', '.cancel-upload-image', function () {
+            var wrapper = $(this).closest('.conList');
+            wrapper.find('li').css('z-index', '-1');
+            wrapper.find('input').val('');
+            $(this).hide();
+            wrapper.removeClass("hide-pic-image");
+            wrapper.parent().append(wrapper.clone());
+            wrapper.remove();
+            $(".conList").each(function (i, ele) {
+                if ($(ele).find("input.input-xlarge").val()) {
+                    $(ele).next().removeClass("hide-pic-image")
+                }
+            })
+        });
+        $(window).on("load", function () {
+            setTimeout(function () {
+                var input = $("#authenticationImage");
+                if (input.val()) {
+                    input.next().find("li").css("z-index", "99");
+                    input.parents(".conList").find(".cancel-upload-image").show();
+                    input.parents(".conList").next().removeClass("hide-pic-image")
+                }
+                var input = $("#authenticationBackImage");
+                if (input.val()) {
+                    input.next().find("li").css("z-index", "99");
+                    input.parents(".conList").find(".cancel-upload-image").show();
+                    input.parents(".conList").next().removeClass("hide-pic-image")
+                }
+                var input = $("#licenseImage");
+                if (input.val()) {
+                    input.next().find("li").css("z-index", "99");
+                    input.parents(".conList").find(".cancel-upload-image").show();
+                    input.parents(".conList").next().removeClass("hide-pic-image")
+                }
+                input = $("#commitmentImage");
+                if (input.val()) {
+                    input.next().find("li").css("z-index", "99");
+                    input.parents(".conList").find(".cancel-upload-image").show();
+                    input.parents(".conList").next().removeClass("hide-pic-image")
+                }
+            }, 500);
+        });
+
+        var controlsFiles = document.getElementById("controlsFiles");
+        controlsFiles.addEventListener("change", function () {
+            $('#uploadFileName').val(name.substring(0, name.indexOf('.')));
+            var files = $('#controlsFiles').prop('files');
+            var data = new FormData();
+            var url = "${ctx}/oss/cmOssArchive/fileUpload";
+            data.append('file', files[0]);
+            $.ajax({
+                url: url,
+                data: data,
+                type: "POST",
+                processData: false,
+                contentType: false,
+                dataType: "json",
+                success: function (res) {
+                    var html = "<span>" + res.fileName + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href=" + res.url + " style='position: relative' target='_blank'>预览</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href='${ctx}/oss/cmOssArchive/fileDownload?ossName=" + res.ossName + "&fileName=" + res.fileName + "' style='position: relative'>下载</a></span>";
+                    $("#file-list-display").html(html);
+                    $("#controlsFiles").val("");
+                    $("#ossName").val(res.ossName);
+                    $("#fileName").val(res.fileName);
+                },
+                error: function (error) {
+                    alertx(error);
+                }
+            });
+        })
+    });
+    $(function () {
+        // 加载地址
+        loadProvince();
+
+        // 初始化付款状态
+        if ($('#payStatus').val() == '1' || $('#payStatus').val() == '3') {
+            //待支付情况下不能填写付款金额
+            $('.payAmount').hide();
+            $('#payAmount').removeClass('required');
+        }
+
+        if ($('#payStatus').val() == '2') {
+            //已支付情况下需要填写付款金额, 而且必填
+            $('.payAmount').show();
+            $('#payAmount').addClass('required');
+        }
+
+        // 初始化分类
+        var val = $("input[name ='secondHandType']:checked").val();
+        // 分类控制
+        if (val == 2 || val == 3 || val == undefined) {
+            $('.bigTypeList').hide();
+        }
+        if (val == 1) {
+            $('.bigTypeList').show();
+        }
+
+
+        // 价格控制
+        if (val == 1 || val == 3) {
+            $('.showClassDiv').hide();
+        }
+        if (val == 2) {
+            $('.showClassDiv').show();
+        }
+
+
+        $('#brandID').change(function () {
+            var val = $(this).val();
+            if (val == '161') {
+                //显示输入框
+                $("#brandName").show();
+            }
+            if (val != '161') {
+                //隐藏输入框
+                $("#brandName").hide();
+            }
+        });
+
+        //初始化
+        var val = $("#brandID option:selected").val();
+        if (val == '161') {
+            //显示输入框
+            $("#brandName").show();
+        }
+        if (val != '161') {
+            //隐藏输入框
+            $("#brandName").hide();
+        }
+
+        //	修改支付状态
+        $('#payStatus').change(function () {
+                var val = $("#payStatus").val();
+                if (val == 1 || val == 3) {
+                    //待支付情况下不能填写付款金额
+                    $('.payAmount').hide();
+                    $('#payAmount').removeClass('required');
+                }
+                if (val == 2) {
+                    //待支付情况下不能填写付款金额
+                    $('.payAmount').show();
+                    $('#payAmount').addClass('required');
+                }
+            }
+        );
+        // 修改分类
+        $("input[name='secondHandType']").change(function () {
+            var val = $(this).val();
+            // 分类控制
+            if (val == 2 || val == 3) {
+                $('.bigTypeList').hide();
+            }
+            if (val == 1) {
+                $('.bigTypeList').show();
+            }
+
+            // 价格控制
+            if (val == 1 || val == 3) {
+                $('.showClassDiv').hide();
+            }
+            if (val == 2) {
+                $('.showClassDiv').show();
+            }
+
+        });
+
+    });
+
+    /**
+     * 加载省份
+     * @param curProvince
+     */
+    function loadProvince() {
+        var curProvince = $("#curProvince").val();
+        $.ajax({
+            type: 'POST',
+            dataType: 'json',
+            url: '/area/loadProvince',
+            success: function (data) {
+                $("#s2id_province .select2-chosen").html("市");
+                $("#province").html("");
+                $("#province").append("<option value=''>省</option>");
+                for (var i = 0; i < data.length; i++) {
+                    if (curProvince != '' && curProvince != null && typeof (curProvince) != "undefined" && curProvince == data[i].name) {
+                        $("#province").append("<option value='" + data[i].name + "' provinceId=" + data[i].id + " selected>" + data[i].name + "</option>");
+                        $("#s2id_province .select2-chosen").html(curProvince);
+                        loadCity($("#curCity").val());
+                    } else {
+                        $("#province").append("<option value='" + data[i].name + "' provinceId=" + data[i].id + ">" + data[i].name + "</option>");
+                    }
+                }
+            }
+
+        });
+    }
+
+    /**
+     * 加载城市
+     */
+    function loadCity(curCity) {
+        var provinceId = $("#province option:selected").attr("provinceId");
+        if (typeof (provinceId) != "undefined" && provinceId * 1 > 0) {
+            $.ajax({
+                type: 'POST',
+                dataType: 'json',
+                data: {'provinceId': provinceId},
+                url: '/area/loadCity',
+                success: function (data) {
+                    $("#s2id_city .select2-chosen").html("市");
+                    $("#city").html("");
+                    $("#city").append("<option value=''>市</option>");
+                    for (var i = 0; i < data.length; i++) {
+                        if (curCity != null && typeof (curCity) != "undefined" && curCity == data[i].name) {
+                            $("#city").append("<option value='" + data[i].name + "' selected cityId=" + data[i].id + ">" + data[i].name + "</option>");
+                            $("#s2id_city .select2-chosen").html(curCity);
+                            loadTown($("#curTown").val());
+                        } else {
+                            $("#city").append("<option value='" + data[i].name + "' cityId=" + data[i].id + ">" + data[i].name + "</option>");
+                        }
+
+
+                    }
+                }
+
+            });
+        } else {
+            $("#city").html("");
+            $(".select2-chosen").eq(3).html("市");
+            $("#city").append("<option value=''>市</option>");
+
+            $("#town").html("");
+            $(".select2-chosen").eq(4).html("区");
+            $("#town").append("<option value=''>区</option>");
+        }
+    }
+
+    /**
+     * 加载县区
+     * @param curTown
+     */
+    function loadTown(curTown) {
+        var cityId = $("#city option:selected").attr("cityId");
+        if (typeof (cityId) != "undefined" && cityId * 1 > 0) {
+            $.ajax({
+                type: 'POST',
+                dataType: 'json',
+                data: {'cityId': cityId},
+                url: '/area/loadTown',
+                success: function (data) {
+                    $("#s2id_town .select2-chosen").html("区");
+                    $("#town").html("");
+                    $("#town").append("<option value='' >区</option>");
+                    for (var i = 0; i < data.length; i++) {
+                        if (curTown != null && typeof (curTown) != "undefined" && curTown == data[i].name) {
+                            $("#town").append("<option value='" + data[i].name + "' selected townId=" + data[i].id + ">" + data[i].name + "</option>");
+                            $("#s2id_town .select2-chosen").html(curTown);
+                        } else {
+                            $("#town").append("<option value='" + data[i].name + "' townId=" + data[i].id + ">" + data[i].name + "</option>");
+                        }
+                    }
+                }
+
+            });
+        } else {
+            $("#town").html("");
+            $(".select2-chosen").eq(4).html("区");
+            $("#town").append("<option value=''>区</option>");
+        }
+
+    }
+
+    /**
+     * @param obj
+     * jquery控制input只能输入数字和两位小数
+     */
+    function num(obj) {
+        obj.value = obj.value.replace(/[^\d.]/g, ""); //清除"数字"和"."以外的字符
+        obj.value = obj.value.replace(/^\./g, ""); //验证第一个字符是数字
+        obj.value = obj.value.replace(/\.{2,}/g, "."); //只保留第一个, 清除多余的
+        obj.value = obj.value.replace(".", "$#$").replace(/\./g, "").replace("$#$", ".");
+        obj.value = obj.value.replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3'); //只能输入两个小数
+    }
+
+    function Idcheck(val) {
+        var c = val;
+        console.log(c);
+        if (1 === c) {
+            $("#yyzz").hide();
+            $("#sfz").show();
+            $("#gsmc").hide();
+        } else {
+            $("#gsmc").show();
+            $("#sfz").hide();
+            $("#yyzz").show();
+        }
+    }
+
+</script>
+</body>
+<head>
+    <title>二手商品管理</title>
+    <meta name="decorator" content="default"/>
+    <script type="text/javascript">
+        $(document).ready(function () {
+            //$("#name").focus();订单来源
+
+            //获取是否是选中状态
+            var check = $("#detailTalk").is(':checked');
+            if (check) {
+                $("#detailTalkFlag").val(2);
+            } else {
+                $("#detailTalkFlag").val(1);
+            }
+
+            $("#inputForm").validate({
+                submitHandler: function (form) {
+
+                    // 验证填写参数
+                    var payStatus = $('#payStatus').val();
+                    if (payStatus == 2) {
+                        var payAmount = $("#payAmount").val();
+                        // (验证付款金额)
+                        if (payAmount == "" || payAmount == null) {
+                            alertx('请填写付款金额');
+                            return false;
+                        }
+                    }
+
+                    var secondHandType = $("input[name ='secondHandType']:checked").val();
+                    if (secondHandType == 2) {
+                        var maturityYears = $("#maturityYears").val();
+                        // (验证到期时期)
+                        if (maturityYears == null || maturityYears == "") {
+                            alertx('请输入产品到期日');
+                            return false;
+                        }
+                        //(验证临期价格信息)
+                        var normalPrice = $("#normalPrice").val();
+                        if (null == normalPrice || normalPrice == "") {
+                            alertx('请输入市场价');
+                            return false;
+                        }
+                        //
+                        var originalPrice = $("#originalPrice").val();
+                        if (null == originalPrice || originalPrice == "") {
+                            alertx('请输入采购价/原价');
+                            return false;
+                        }
+
+                        var stock = $("#stock").val();
+                        if (null == stock || stock == "") {
+                            alertx('请输入采购价/原价');
+                            return false;
+                        }
+
+
+                    }
+
+
+                    loading('正在提交,请稍等...');
+                    form.submit();
+                },
+                errorContainer: "#messageBox",
+                errorPlacement: function (error, element) {
+                    $("#messageBox").text("输入有误,请先更正。");
+                    if (element.is(":checkbox") || element.is(":radio") || element.parent().is(".input-append")) {
+                        error.appendTo(element.parent().parent());
+                    } else {
+                        error.insertAfter(element);
+                    }
+                }
+            });
+        });
+
+        $(document).ready(function () {
+            changeCostPriceShow();
+        });
+
+        function detailTalkFlagCheckd() {
+            //获取是否是选中状态
+            var check = $("#detailTalk").is(':checked');
+            if (check) {
+                $("#detailTalkFlag").val(2);
+            } else {
+                $("#detailTalkFlag").val(1);
+            }
+        }
+
+        /**
+         * @param obj
+         * jquery控制input只能输入数字
+         */
+        function onlynum(obj) {
+            obj.value = obj.value.replace(/[^\d]/g, ""); //清除"数字"以外的字符
+//            alertx("排序值只能填写大于等于1的整数!");
+        }
+
+        function onLine() {
+            // 设置已上架
+            $("#validFlag").val("2")
+        }
+
+        // 是否固定成本
+        function changeCostPriceShow() {
+            var costCheckFlag = $("input[name='costCheckFlag']:checked").val();
+            if (costCheckFlag * 1 === 1) {
+                $(".costPriceShow").show();
+                $(".costPropShow").hide();
+            } else {
+                $(".costPriceShow").hide();
+                $(".costPropShow").show();
+            }
+        }
+
+
+    </script>
+    <style>
+
+    </style>
+</head>
+</html>
+

+ 800 - 0
src/main/webapp/WEB-INF/views/modules/user/cmNewProductShopList.jsp

@@ -0,0 +1,800 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
+<html>
+<head>
+	<title>供应商信息管理</title>
+	<meta name="decorator" content="default"/>
+	<style type="text/css">
+		.table th{text-align: center;}
+		.table td{text-align: center;}
+	</style>
+    <style>
+        .modal{
+            width: 900px;
+            margin-left: -450px;
+        }
+        #medicalPracticeLicenseImg1Preview,#medicalPracticeLicenseImg2Preview,#medicalPracticeLicenseImg3Preview{
+            display: inline-block;
+        }
+
+        .reg-row .new-tag.active {
+            border: 1px solid #de5801;
+        }
+        .reg-row {
+            margin-bottom: 20px;
+        }
+        .reg-row .reg-label {
+            display: inline-block;
+            width: 120px;
+            text-align: right;
+            font-size: 13px;
+        }
+        .the-oradio {
+            display: inline-block;
+            vertical-align: top;
+        }
+        .the-oradio div {
+            width: 85px;
+            display: inline-block;
+            font-size: 12px;
+            color: #666;
+            /* margin-right: 25px; */
+        }
+        .the-oradio div input[type="radio"] {
+            width: 17px;
+            height: 17px;
+            margin-right: 5px;
+            vertical-align: text-top;
+        }
+        .med-option {
+            display: block;
+            margin: 10px 0 0 125px;
+        }
+		.smed-option{
+			margin: 20px 0 20px 123px;
+			display: block;
+		}
+        .reg-row .business-license {
+            position: relative;
+            display: inline-block;
+            width: 166px;
+            height: 123px;
+            border-radius: 6px;
+            margin: 18px 0 0 125px;
+        }
+        #medicalPracticeLicenseImgPreview{
+            display: inline-block;
+        }
+        .qualification{
+            margin-top: 20px;
+        }
+        .reg-row .tags-area {
+            display: inline-block;
+            width: 420px;
+        }
+        .reg-row .new-tag {
+            display: inline-block;
+            width: 70px;
+            /*height: 26px;*/
+            border: 1px solid #e5e5e5;
+            border-radius: 6px;
+            padding: 5px;
+            margin-right: 14px;
+            margin-bottom: 14px;
+            text-align: center;
+            font-size: 10px;
+            overflow: hidden;
+            text-overflow: ellipsis;
+            white-space: nowrap;
+            cursor: pointer;
+        }
+        .reg-row .tags-operate {
+            margin-left: 125px;
+        }
+        .reg-row .reg-input {
+            width: 336px;
+            height: 32px;
+            padding: 0 8px;
+            margin-right: 20px;
+            border: 1px solid #dcdcdc;
+            border-radius: 6px;
+        }
+        .reg-row .tags-operate .tag-input {
+            width: 159px;
+            margin-right: 13px;
+            display: none;
+            vertical-align: top;
+        }
+        .reg-row .tags-operate .tag-add {
+            /*height: 32px;*/
+            line-height: 20px;
+            vertical-align: middle;
+            margin-bottom: 0;
+            vertical-align: top;
+        }
+        .reg-row .tags-area{
+            vertical-align: top;
+        }
+        .tag-add {
+            display: none;
+        }
+		#myModal2{display: none;}
+		.modal-body{
+			max-height: 300px !important;
+		}
+		.modal.fade.in{
+			top: 0 !important;
+		}
+		#auditBox .auditCheckBox {
+            width: 250px;
+            margin: 0 auto;
+        }
+
+        #auditBox .auditCheckBox label {
+            margin: 0 5px 5px 0
+        }
+
+        #auditBox .auditCheckBox input {
+            display: none;
+        }
+
+        #auditBox .auditCheckBox input + span {
+            display: inline-block;
+            line-height: 24px;
+            padding: 1px 6px;
+            border: 1px solid #666;
+            border-radius: 5px;
+        }
+		.auditNote{
+			width: 250px;
+			height: 50px;
+			margin: 0 auto;
+		}
+        #auditBox .auditCheckBox input:checked + span {
+            background-color: #E6633A
+        }
+    </style>
+	<script type="text/javascript">
+		$(document).ready(function() {
+
+		});
+		function page(n,s){
+			$("#pageNo").val(n);
+			$("#pageSize").val(s);
+			$("#searchForm").submit();
+        	return false;
+        }
+	</script>
+
+</head>
+<body>
+<ul class="nav nav-tabs">
+		<li class="active"><a href="${ctx}/user/newCmShop/special/new">新品供应商</a></li>
+		<li><a href="${ctx}/user/newCmShop/special/second">二手供应商</a></li>
+</ul>
+<form:form id="searchForm" modelAttribute="newCmShop" action="${ctx}/user/newCmShop/special/new" method="post" class="breadcrumb form-search">
+		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
+		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
+	<div class="ul-form">
+        <div class="flex-wrap">
+			<div class="item">
+				<label>供应商ID:</label>
+					<form:input path="shopID" htmlEscape="false" maxlength="10" class="input-medium"/>
+				<label>公司名称:</label>
+					<form:input path="name" htmlEscape="false" maxlength="50" class="input-medium"/>
+            </div>
+			<div class="item">
+				 <label>  状态:</label>
+				<form:select path="status" class="input-medium">
+					<form:option value="" label="请选择"/>
+					<form:options items="${fns:getDictList('shop_status')}" itemLabel="label" itemValue="value"
+								  htmlEscape="false"/>
+				</form:select>
+				 <label>手机号:</label>
+					<form:input path="contractMobile" htmlEscape="false" maxlength="100" class="input-medium"/>
+            </div>
+			<div class="item">
+				 <label>联系人:</label>
+				<form:input path="linkMan" htmlEscape="false" maxlength="100" class="input-medium"/>
+            </div>
+			<div class="item">
+				&nbsp;&nbsp;<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
+			</div>
+		</div>
+	</div>
+</form:form>
+<sys:message content="${message}"/>
+<table id="contentTable" class="table table-striped table-bordered table-condensed">
+		<thead>
+			<tr>
+				<th>供应商ID</th>
+				<th>供应商名称</th>
+				<th>联系人</th>
+				<th>手机号</th>
+				<c:if test="${shopType eq 3}>">
+				<th>收款卡号</th>
+				</c:if>
+				<th>状态</th>
+				<th>线上分帐号</th>
+				<th>添加时间</th>
+				<th>操作</th>
+			</tr>
+		</thead>
+		<tbody>
+		<c:forEach items="${page.list}" var="newCmShop">
+			<tr>
+				<td>
+					${newCmShop.shopID}
+				</td>
+				<td>
+					${newCmShop.name}
+				</td>
+				<td>
+					${newCmShop.linkMan}
+				</td>
+				<td>
+					${newCmShop.contractMobile}
+				</td>
+				<td>
+
+				</td>
+				<td>
+					<c:if test="${newCmShop.status eq 3}">
+						<font color="black">待审核</font>
+					</c:if>
+					<c:if test="${newCmShop.status eq 90}">
+						<font color="green">已上线</font>
+					</c:if>
+					<c:if test="${newCmShop.status eq 91}">
+						<font color="red">已下线</font>
+					</c:if>
+					<c:if test="${newCmShop.status eq 92}">
+						<font color="red" <c:if test="${not empty newCmShop.auditNote}">onclick="alertx('审核未通过原因:'+'${newCmShop.auditNote}')"</c:if> style="cursor:pointer;text-decoration: underline" >审核未通过</font>
+					</c:if>
+
+					<c:if test="${newCmShop.status eq 90}">
+						<a href="javascript:void(0);" onclick="offline(${newCmShop.userID})">下线</a>
+					</c:if>
+					<c:if test="${newCmShop.status eq 91}">
+						<a href="javascript:void(0);" onclick="online(${newCmShop.userID})">上线</a>
+					</c:if>
+				</td>
+				<td>
+					${newCmShop.splitCode}
+				</td>
+				<td>
+					${newCmShop.addTime}
+				</td>
+				<td>
+					<a href="${ctx}/user/newCmShop/form?id=${newCmShop.shopID}&editStatus=1">编辑</a>
+				</td>
+			</tr>
+		</c:forEach>
+		</tbody>
+</table>
+<div class="pagination">${page}</div>
+<!-- 模态框(Modal)供应商暂存 -->
+<div class="modal fade" id="myModal2" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
+    <div class="modal-dialog">
+        <div class="modal-content">
+            <div class="modal-header">
+                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
+                <h4 class="modal-title" id="myModalLabel"></h4>
+            </div>
+            <div class="modal-body">
+                <div class="reg-row">
+                    <label class="reg-label" for=""><span class="require-xin">*</span>会所类型:</label>
+                    <div class="smedical-radio the-oradio">
+                        <div class="smed-beauty"><input  name="firstShopType" value="1" type="radio"/>医疗</div>
+                        <div class="sraw-beauty"><input  name="firstShopType" value="2" type="radio"/>非医疗</div>
+                    </div>
+                    <span class="err-tip"></span>
+                    <div class="smed-option the-oradio" style="display: none">
+                        <div class="smed-beauty"><input name="secondShopType" value="1" type="radio"/>一级器械</div>
+                        <div class="smed-beauty"><input name="secondShopType" value="2" type="radio"/>二级器械</div>
+                        <div class="smed-beauty"><input name="secondShopType" value="3" type="radio"/>三级器械</div>
+                        <div class="smed-beauty"><input name="secondShopType" value="4" type="radio"/>其他</div>
+                        <span class="err-tip"></span>
+                    </div>
+                    <div class="squalification reg-row" style="display: none">
+                        <label class="reg-label" for=""><span class="require-xin">*</span>资质:</label>
+                        <div style="display: inline-block;margin-right: 10px">
+                            <input id="medicalPracticeLicenseImg1" name="url" type="hidden" maxlength="255" class="input-xlarge ">
+                            <sys:ckfinder input="medicalPracticeLicenseImg1" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
+                        </div>
+                        <div class="two-up" style="display: none;margin-left: 123px;margin-right: 10px">
+                            <input id="medicalPracticeLicenseImg2" name="url" type="hidden" maxlength="255" class="input-xlarge ">
+                            <sys:ckfinder input="medicalPracticeLicenseImg2" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
+                        </div>
+                        <div class="there-up" style="display:none;margin-left: 123px;margin-right: 0">
+                            <input id="medicalPracticeLicenseImg3" name="url" type="hidden" maxlength="255" class="input-xlarge ">
+                            <sys:ckfinder input="medicalPracticeLicenseImg3" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
+                        </div>
+                        <button class="go-up">点击继续上传</button>
+                    </div>
+
+                </div>
+
+                <div class="reg-row">
+                    <label class="reg-label top-label" for=""><span class="require-xin">*</span>主营内容:</label>
+                    <div class="tags-area" id="shopArea">
+
+                    </div>
+                    <span class="err-tip" style="display: inline-block;margin-left:-55px;"></span>
+                    <input type="hidden" name="mainpro" value="" id="sMainPro">
+                    <div class="tags-operate">
+                        <span class="new-tag tag-other" id="shopOther">其他</span>
+                        <input type="text" class="reg-input tag-input" id="shopInput" placeholder="请输入自定义品项目">
+                        <span class="new-tag tag-add" id="shopAdd">确认添加</span>
+                    </div>
+                </div>
+            </div>
+            <div class="modal-footer">
+                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
+                <button type="button" class="btn btn-primary" id="confirm">确认</button>
+            </div>
+        </div><!-- /.modal-content -->
+    </div><!-- /.modal -->
+</div>
+<%--js--%>
+<script>
+    $(document).ready(function() {
+
+        //供应商默认主营内容
+        var html='';
+        html+='<span class="new-tag up-club-tag" data-typeName="产品">产品</span>',
+		html+='<span class="new-tag up-club-tag" data-typeName="仪器">仪器</span>',
+		html+='<span class="new-tag up-club-tag" data-typeName="服务">服务</span>';
+        $('#shopArea').html(html);
+        //供应商
+        $('.smedical-radio div input[name="firstShopType"]').on('click',function () {
+            var nameval = $(this).val();
+            if(nameval == '1'){
+                $('.smed-option').show();
+            }else if(nameval == '2'){
+                $('.smed-option,.squalification,.epart').hide();
+                $('input[name="secondShopType"]').attr('checked',false);
+            }
+        });
+        //医疗二级选择
+        $('input[name="secondShopType"]').on('click',function () {
+            var nameVal = $(this).val();
+            if(nameVal == '1'){
+                $('.squalification').hide()
+            }else if(nameVal == '2'){
+                $('.squalification').hide()
+            }else if(nameVal == '3'){
+                $('.squalification').show()
+            }else if(nameVal == '4'){
+                $('.squalification').hide()
+            }
+        });
+        //点击继续上传
+        var record ='';
+        $('.go-up').on('click',function () {
+            if(record == 1){
+                if($('#medicalPracticeLicenseImg2').val() != ''){
+                    $('.there-up').css({'display':'inline-block'});
+                    record = 2
+                }else {
+                    alertx('请上传资质')
+                    _util.hideTip($('.err-tip'));
+                }
+            }else if(record == 2){
+                alertx('只需要上传三张资质');
+//					$('.go-up').hide();
+            } else {
+                if($('#medicalPracticeLicenseImg1').val() != ''){
+                    $('.two-up').css({'display':'inline-block'});
+                    record = 1;
+                }else if($('#medicalPracticeLicenseImg2').val() != ''){
+                    $('.there-up').css({'display':'inline-block'});
+                    record = 2
+                }else {
+                    alertx('请上传资质')
+                    _util.hideTip($('.err-tip'));
+                    record = ''
+                }
+            }
+        });
+        //供应商品项选择
+        var opts = {
+            $tag:$('.up-shop-tag'),
+            $tagArea:$('#shopArea'),
+            $mainPro:$('#sMainPro'),
+            $other:$('#shopOther'),
+            $input:$('#shopInput'),
+            $add:$('#shopAdd'),
+            $type:'shop'
+        };
+        _util.getTags(opts);
+        $('#confirm').on('click',function () {
+            //公司类型
+            if(!$('input[name="firstShopType"]').is(':checked')){
+                $('input[name="firstShopType"]').parents('.smedical-radio').next().show().html('请选择公司类型');
+                _util.hideTip($('.err-tip'));
+                return false
+            }else if($('input[name="firstShopType"]:checked').val() == 1){
+                if(!$('input[name="secondShopType"]').is(':checked')){
+                    $('input[name="secondShopType"]').parents('.smed-option').find('.err-tip').show().html('请选择公司类型');
+                    _util.hideTip($('.err-tip'));
+                    return false
+                }
+            }
+            if($('input[name="secondShopType"]:checked').val() == 3){
+                // 会所资质
+                if($('#medicalPracticeLicenseImg1').val() == ''){
+                    alertx('请上传资质')
+                }
+
+                if($('.two-up').css('display')!='none'){
+                    if($('#medicalPracticeLicenseImg2').val() == ''){
+                        alertx('请上传资质')
+                        return false
+                    }
+                }
+                if($('.there-up').css('display')!='none'){
+                    if($('#medicalPracticeLicenseImg3').val() == ''){
+                        alertx('请上传资质')
+                        return false
+                    }
+                }
+            }
+            if($('#sMainPro').val() == ''){
+                alertx('请选择主营内容')
+                return false
+            }
+            var params = {
+                mainpro:$('#sMainPro').val(),
+                shopID:$(this).attr('data-id'),
+                flagC:$(this).attr('data-flag')
+			};
+            if($('input[name="firstShopType"]:checked').val() == 1){
+                params.firstShopType = 1;//公司分类
+                params.secondShopType =$('input[name="secondShopType"]:checked').val();//二级分类
+                if($('input[name="secondShopType"]:checked').val() == 3){
+                    if($('#medicalPracticeLicenseImg1').val() != ''){
+                        params.medicalPracticeLicenseImg1 = $('#medicalPracticeLicenseImg1').val();//资质
+                        // if($('#medicalPracticeLicenseImg2').val() != ''){
+                        //     params.medicalPracticeLicenseImg2 = $('#qualification2').val();//资质
+                        //     if($('#medicalPracticeLicenseImg3').val() != ''){
+                        //         params.medicalPracticeLicenseImg3 = $('#qualification3').val();//资质
+                        //     }
+                        // }
+                    }
+                    if($('#medicalPracticeLicenseImg2').val() != '') {
+                        params.medicalPracticeLicenseImg2 = $('#medicalPracticeLicenseImg2').val();//资质
+					}
+					if($('#medicalPracticeLicenseImg3').val() != '') {
+                        params.medicalPracticeLicenseImg3 = $('#medicalPracticeLicenseImg3').val();//资质
+					}
+
+                }
+            }else {
+                params.firstShopType = 2;//公司分类
+            }
+            $.ajax({
+                type: "post",
+                url: "${ctx}/user/newCmShop/editShopType",
+                data: params,
+                success : function (res) {
+                    if(res.errcode == '1') {
+                        alertx(res.errmsg);
+                    }
+                    if(res.errcode == '0') {
+                        console.log(res.data);
+                        window.location.href = res.data;
+                    }
+                },
+                error : function (res) {
+                }
+            });
+        })
+    });
+    var _util = {
+        // 隐藏输入错误提示(参数为提示元素)
+        hideTip : function($ele){
+            setTimeout(function () {
+                $ele.hide();
+            }, 5000);
+        },
+        setTags:function (opts) {
+            var tagArr = [];
+            opts.$tagArea.find('.new-tag.active').each(function(i,v){
+                var _typeName = $(v).attr('data-typeName');
+                tagArr.push(_typeName);
+                opts.$mainPro.val(tagArr.join('/'));
+            })
+        },
+        getTags:function (opts) {
+            opts.$tagArea.on('click','.new-tag',function(){
+                var $this = $(this);
+                $this.toggleClass('active');
+                _util.setTags(opts);
+            })
+            opts.$other.on('click',function(){
+                opts.$input.css('display','inline-block');
+                opts.$add.css('display','inline-block');
+            })
+            opts.$add.on('click',function(){
+                var _tag = $.trim(opts.$input.val());
+                if(_tag){
+                    var flag = false;
+                    opts.$tagArea.find('.new-tag').each(function(i,v){
+                        var _name = $(v).attr('data-typeName');
+                        if(_tag == _name){
+                            flag=true;
+                            return false;
+                        }else{
+                            if(i==opts.$tagArea.find('.new-tag').length){
+                                flag=false;
+                            }
+                        }
+
+                    })
+                    if(flag){
+                        opts.$tagArea.find('.new-tag').each(function(i,v){
+                            var _name = $(v).attr('data-typeName');
+                            if(_tag == _name){
+                                $(v).addClass('active');
+//                                layer.tips('该类型已存在',opts.$add);
+                                alertx('该类型已存在')
+                                flag=true;
+                                return false;
+                            }
+
+                        })
+                    }else{
+                        opts.$tagArea.append('<span class="new-tag up-'+opts.$type+'-tag active" data-typeName="'+_tag+'">'+_tag+'</span> ');
+                        _util.setTags(opts);
+                        opts.$input.val('');
+                        return;
+                    }
+                }
+            })
+        },
+    }
+</script>
+<script>
+    $(document).ready(function() {
+        $('.shopType').on('click',function () {
+            $('#confirm').attr('data-id',$(this).attr('data-shopID'))
+            $('#confirm').attr('data-flag',$(this).attr('data-flag'))
+            $('#myModal2').modal();
+             var that = $(this);
+            // var flag = that.attr("data-flag");
+            // $('#confirm').attr('data-flag',flag)
+            // var shopID = that.attr("data-shopID");
+            // var that = $(this);
+            var flag = that.attr("data-flag");
+            if ("0" == flag) {
+                $("#myModalLabel").html("设置分类");
+            }
+            if ("1" == flag) {
+                $("#myModalLabel").html("修改分类");
+                var json = JSON.parse($(this).attr('data-value'));
+                var firstShopType = json["firstShopType"];
+                var secondShopType = json["secondShopType"];
+                var medicalPracticeLicenseImg1 = json["medicalPracticeLicenseImg1"];
+                var medicalPracticeLicenseImg2 = json["medicalPracticeLicenseImg2"];
+                var medicalPracticeLicenseImg3 = json["medicalPracticeLicenseImg3"];
+                var mainpro = json["mainpro"];
+                if (firstShopType) {
+                    $('input[name="firstShopType"]').parent('div').eq(firstShopType-1).find('input').attr("checked","checked")
+                    $('input[name="firstShopType"]').parent('div').eq(firstShopType-1).find('input').click();
+                    if(secondShopType){
+                        $('input[name="secondShopType"]').parent('div').eq(secondShopType-1).find('input').attr("checked","checked")
+                        $('input[name="secondShopType"]').parent('div').eq(secondShopType-1).find('input').click();
+                    }
+                    if(medicalPracticeLicenseImg1){
+                        $('#medicalPracticeLicenseImg1').val(medicalPracticeLicenseImg1);
+                        $('#medicalPracticeLicenseImg1Preview').find('li').html('<img style="max-width:100px;max-height:100px;_height:100px;border:0;padding:3px;" src="'+medicalPracticeLicenseImg1+'" />')
+                    }
+                    if(medicalPracticeLicenseImg2){
+                        $('.two-up').css({'display':'inline-block'});
+                        $('#medicalPracticeLicenseImg2').val(medicalPracticeLicenseImg2);
+                        $('#medicalPracticeLicenseImg2Preview').find('li').html('<img style="max-width:100px;max-height:100px;_height:100px;border:0;padding:3px;" src="'+medicalPracticeLicenseImg2+'" />')
+                    }
+                    if(medicalPracticeLicenseImg3){
+                        $('.there-up').css({'display':'inline-block'});
+                        $('#medicalPracticeLicenseImg3').val(medicalPracticeLicenseImg3);
+                        $('#medicalPracticeLicenseImg3Preview').find('li').html('<img style="max-width:100px;max-height:100px;_height:100px;border:0;padding:3px;" src="'+medicalPracticeLicenseImg3+'" />')
+                    }
+
+                    if(mainpro){
+                        var span_ = $('#shopArea').find('span');
+                        var mainpro_ = mainpro.split('/');
+                        var html='';
+                        var defaultVal = [];
+                        var resArr = [];
+                        var html='';
+                        $('#shopArea').html('');
+                        for(var i=0; i<span_.length;i++) {
+                            defaultVal.push(span_[i].textContent);
+                        }
+                        var concatArr = defaultVal.concat(mainpro_);
+                        for(var i=0; i<concatArr.length; i++) {
+                            if(resArr.indexOf(concatArr[i]) == -1) {
+                                resArr.push(concatArr[i]);
+                                html += '<span class="new-tag up-club-tag '+concatArr[i]+'" data-typeName="'+concatArr[i]+'">'+concatArr[i]+'</span>';
+                            }
+                        }
+                        $('#shopArea').append(html);
+                        for(var i=0; i<mainpro_.length; i++) {
+                            $('.'+mainpro_[i]).addClass('active');
+                        }
+                    }
+                }
+                var spanSp = $('#shopArea').find('span');
+                console.log(spanSp)
+                spanSp.each(function (i,l) {
+                    if($(this).hasClass('active')){
+                        $('#sMainPro').val($(this).text())
+                    }
+                });
+
+            }
+        })
+    });
+
+    // 修改密码
+    function updatePwd(id) {
+        var regPwd = /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{8,16}$/;
+        var html = "<div style='padding:20px;'><font color='red'>*</font> 新密码 :" +
+            "<input type='password' id='newPwd' name='newPwd' rows='1' cols='12'/>" +
+            "</br><font color='red'>*</font>确认密码:" +
+            "<input type='password' id='surePwd' name='surePwd' rows='1' cols='12'/></div>";
+        var submit = function (v, h, f) {
+            // 密码
+            if (!regPwd.test(f.newPwd)) {
+                $.jBox.tip("密码需8-16位字母数字组合", 'error', {focusId: "newPwd"});
+                return false;
+            }
+            if (f.newPwd !== f.surePwd) {
+                $.jBox.tip("确认密码与登录密码不一致", 'error', {focusId: "surePwd"});
+                return false;
+            }
+            $.post("${ctx}/user/newCmShop/updatePwd", {'password': f.newPwd, 'id': id}, function (data) {
+                if (true == data.success) {
+                    $.jBox.tip(data.msg, 'info');
+                    $("#searchForm").submit();
+                } else {
+                    $.jBox.tip(data.msg, 'error');
+                }
+            }, "JSON");//这里返回的类型有:json,html,xml,text
+        };
+        $.jBox(html, {title: "确定修改密码?", submit: submit});
+    }
+    //修改手机号码
+    function updateMobile(id) {
+        var regMobile = /^1[3,4,5,6,7,8,9]\d{9}$/;
+        var html = "<div style='padding:20px;'><font color='red'>*</font> 手机号码 :" +
+            "<input type='text' id='newMobile' name='newMobile' rows='1' cols='12'/>" +
+            "</div>";
+        var submit = function (v, h, f) {
+            // 密码
+            if (!regMobile.test(f.newMobile)) {
+                $.jBox.tip("请输入正确的手机号码", 'error', {focusId: "newMobile"});
+                return false;
+            }
+            $.post("${ctx}/user/newCmShop/updateMobile", {'mobile': f.newMobile, 'id': id}, function (data) {
+                if (true == data.success) {
+                    $.jBox.tip(data.msg, 'info');
+                    $("#searchForm").submit();
+                } else {
+                    $.jBox.tip(data.msg, 'error');
+                }
+            }, "JSON");//这里返回的类型有:json,html,xml,text
+        };
+        $.jBox(html, {title: "确定修改手机号码?", submit: submit});
+    }
+
+    function offline(userId) {
+    	$.jBox.confirm("确定下线该供应商吗?","提示",function(v,h,f){
+    		if(v === 1){
+    			window.location.href="${ctx}/user/newCmShop/offline?userID="+userId;
+    		}
+    	} ,{ buttons: {  '确定': 1,'取消':2}});
+	}
+
+	function online(userId) {
+		$.jBox.confirm("确定上线该供应商吗?","提示",function(v,h,f){
+    		if(v === 1){
+    			window.location.href="${ctx}/user/newCmShop/online?userID="+userId;
+    		}
+    	} ,{ buttons: {  '确定': 1,'取消':2}});
+	}
+
+	/**
+* 供应商审核
+* */
+function auditShop(shopId,userId,townID,address,name,linkMan,contractMobile) {
+	if(null == townID || "" == townID || "" == address || null == address){
+		alertx("地址尚未填写,请先编辑地址再进行审核");
+		return;
+	}
+	if(null == name || "" == name){
+		alertx("公司名称尚未填写,请先编辑公司名称再进行审核");
+		return;
+	}
+	if(null == linkMan || "" == linkMan){
+		alertx("联系人尚未尚未填写,请先编辑联系人再进行审核");
+		return;
+	}
+	if(null == contractMobile || "" == contractMobile){
+		alertx("手机号尚未填写,请先编辑手机号再进行审核");
+		return;
+	}
+	var html = "<div id='auditBox'>"
+                        + "   <div class='bd-row'>"
+                        + "       <span><font color='red'>*</font>审核:</span>"
+                        + "       <select name='auditStatus' id='auditStatus'>"
+                        + "           <option value='1'>审核通过</option>"
+                        + "           <option value='2'>审核未通过</option>"
+                        + "       <select/>"
+                        + "   </div>"
+                        + "   <div id='auditNopass' style='display: none;'>"
+                        + "       <div class='bd-row'>"
+                        + "           <span><font color='red'>*</font>原因:</span>"
+                        + "           <div class='auditCheckBox'>"
+                        + "               <label><input name='auditCheckBox' type='checkbox' value='入驻资质不达标'><span>入驻资质不达标</span></label>"
+                        + "               <label><input name='auditCheckBox' type='checkbox' value='品牌评估不通过'><span>品牌评估不通过</span></label>"
+                        + "               <label><input name='auditCheckBox' type='checkbox' value='相关证照不清晰'><span>相关证照不清晰</span></label>"
+                        + "               <label><input name='auditCheckBox' type='checkbox' value='企业经营异常'><span>企业经营异常</span></label>"
+                        + "               <label><input name='auditCheckBox' type='checkbox' value='其他'><span>其他</span></label>"
+                        + "           </div>"
+                        + "       </div>"
+                        + "       <div class='bd-row'>"
+                        + "           <span></span>"
+                        + "           <div class='auditNote'>"
+                        + "               <textarea name='auditNote' placeholder='可以补充其它原因,最多50个字'></textarea>"
+                        + "               <p class='err-tip' style='display:none;margin-left:-55px;color:red;'>请选择审核未通过的原因</p>"
+                        + "           </div>"
+                        + "       </div>"
+                        + "   </div>"
+                        + "</div>";
+                    var submit = function (v, h, f) {
+                        if (f.auditStatus == '') {
+                            $.jBox.tip("请选择状态", 'error', {focusId: "auditStatus"});
+                            return false;
+                        } else if (f.auditStatus == 2 && f.auditNote == '' && !f.auditCheckBox) {
+                            $.jBox.tip("请选择审核未通过的原因", 'error', {focusId: "auditNote"});
+                            return false;
+                        } else if (f.auditStatus == 2 && f.auditNote.length > 50) {
+                            $.jBox.tip("内容过长", 'error', {focusId: "auditNote"});
+                            return false;
+                        }
+                        var auditText = f.auditCheckBox ? (f.auditCheckBox.toString() + ',' + f.auditNote) : f.auditNote;
+
+                        $.post("${ctx}/user/newCmShop/auditShopInfo", {
+                            'auditStatus': f.auditStatus,
+                            'shopId': shopId,
+                            'userId': userId,
+                            'auditNote': auditText
+                        }, function (data) {
+                        console.log( data.success)
+                        console.log( true == data.success)
+                            if (true == data.success) {
+                                $.jBox.tip(data.msg, 'info');
+                                // $("#searchForm").submit();
+                                window.location.href = "${ctx}/user/newCmShop/";
+                            } else {
+                                $.jBox.tip(data.msg, 'error');
+                            }
+                        }, "JSON");//这里返回的类型有:json,html,xml,text
+                    };
+                    $.jBox(html, {title: "审核", submit: submit});
+}
+
+// 审核
+$(document).on("change", "#auditStatus", function () {
+			if ($("#auditStatus").val() == 2) {
+				$("#auditNopass").show();
+			} else {
+				$("#auditNopass").hide();
+			}
+});
+
+</script>
+</body>
+</html>