secondHand.jsp 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599
  1. <%@ page import="com.thinkgem.jeesite.common.config.Global" %>
  2. <%@ page contentType="text/html;charset=UTF-8" %>
  3. <%@ include file="/WEB-INF/views/include/taglib.jsp"%>
  4. <html>
  5. <head>
  6. <title>二手商品列表</title>
  7. <meta name="decorator" content="default"/>
  8. <style>
  9. .customize-class-ct{display:inline-block;width:350px;vertical-align:top}.block-cuz{margin-left:89px}.table th{text-align:center}.table td{text-align:center}.input-mini{margin-right:10px}.modal{width:700px!important;top:0!important}.modal-body{max-height:none!important;height:350px}.main{margin:0 auto}.content{box-sizing:border-box;padding:15px 30px;color:#333}.the-shop{margin-bottom:20px;font-size:12px}#myModal{display:none}.the-shop label{display:inline-block;margin-right:15px;vertical-align:top;width:70px}.shop-img .img{display:inline-block;width:150px;height:100px;background-color:#ccc;border:1px solid #000}.shop-img .img img{width:100%;height:100%}.default-class label{vertical-align:middle}.default-class span{display:inline-block;width:80px;height:20px;line-height:20px;text-align:center;border:1px solid #666;margin-right:15px;border-radius:15px;vertical-align:middle;cursor:pointer}.customize-select-c{display:inline-block;vertical-align:middle}.customize-class-ct label{vertical-align:middle}.customize-class-ct select{width:100px;height:30px;line-height:30px;margin-right:10px;font-size:14px}.add-select{display:inline-block;vertical-align:top;font-size:26px;height:30px;line-height:30px;cursor:pointer}.close-select{display:inline-block;vertical-align:top;font-size:26px;height:30px;line-height:30px;cursor:pointer}.block-cus{display:block;margin:10px 0 0 90px}.active{color:#00bbd3;border-color:#00bbd3!important}
  10. #auditBox{padding:20px;line-height:30px;}
  11. #auditBox .preferred label{margin:0 5px 5px 0}
  12. .todo a{white-space:nowrap;padding: 0 2px;}
  13. .checkbox input{margin:3px;}
  14. .red{color: red;}
  15. .flex-wrap >.item {margin-right: 20px;}
  16. .jbox span.jbox-icon {top: auto !important;}
  17. </style>
  18. </head>
  19. <body>
  20. <ul class="nav nav-tabs">
  21. <li class="active"><a href="${ctx}/product/new/list?searchProductCategory=2">二手商品列表</a></li>
  22. <li><a href="${ctx}/product/cmSecondHandDetail/form?searchName=${searchName}&searchShopID=${searchShopID}&searchShopName=${searchShopName}&searchBigTypeID=${searchBigTypeID}&searchSmallTypeID=${searchSmallTypeID}&searchTinyTypeID=${searchTinyTypeID}&searchValidFlag=${searchValidFlag}&searchActStatus=${searchActStatus}&searchProductType=${searchProductType}&searchBrandID=${searchBrandID}&searchPreferredFlag=${searchPreferredFlag}&fileTypes=999">添加二手预成交商品</a></li>
  23. <li><a href="${ctx}/product/cmSecondHandDetail/cmSecondDetailForm?searchName=${searchName}&searchShopID=${searchShopID}&searchShopName=${searchShopName}&searchBigTypeID=${searchBigTypeID}&searchSmallTypeID=${searchSmallTypeID}&searchTinyTypeID=${searchTinyTypeID}&searchValidFlag=${searchValidFlag}&searchActStatus=${searchActStatus}&searchProductType=${searchProductType}&searchBrandID=${searchBrandID}&searchPreferredFlag=${searchPreferredFlag}&fileTypes=999">二手估价商品添加</a></li>
  24. </ul>
  25. <form:form id="searchForm" modelAttribute="product" action="${ctx}/product/new/list" method="post" class="breadcrumb form-search">
  26. <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
  27. <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
  28. <input id="searchProductCategory" name="searchProductCategory" value="2" type="hidden">
  29. <div class="ul-form">
  30. <div class="flex-wrap">
  31. <div class="item">
  32. <label>商品ID:</label>
  33. <form:input path="id" type="number" htmlEscape="false" maxlength="11" class="input-medium"/>
  34. </div>
  35. <div class="item">
  36. <label>商品名称:</label>
  37. <form:input path="searchName" htmlEscape="false" maxlength="300" class="input-medium"/>
  38. </div>
  39. <div class="item">
  40. <label>一级分类:</label>
  41. <form:select path="secondHandType" class="input-medium" id="secondHandType" onchange="loadInstrumentType()">
  42. <form:option value="" label="请选择"/>
  43. <form:option value="1" label="二手仪器"/>
  44. <form:option value="3" label="其他"/>
  45. </form:select>
  46. </div>
  47. <div class="item">
  48. <label>二级分类:</label>
  49. <form:select path="instrumentType" class="input-medium" id="instrumentType">
  50. <form:option value="" label="请选择"/>
  51. <form:option value="1" label="美容仪器"/>
  52. </form:select>
  53. </div>
  54. <div class="item">
  55. <label>商品状态:</label>
  56. <form:select path="validFlag" class="input-medium">
  57. <form:option value="" label="请选择"/>
  58. <form:option value="1" label="待审核"/>
  59. <form:option value="2" label="已上架"/>
  60. <form:option value="3" label="已下架"/>
  61. <form:option value="8" label="审核未通过"/>
  62. </form:select>
  63. </div>
  64. <div class="item">
  65. <label>交易状态:</label>
  66. <form:select path="sold" class="input-medium">
  67. <form:option value="" label="请选择"/>
  68. <form:option value="0" label="未售"/>
  69. <form:option value="1" label="已售"/>
  70. </form:select>
  71. </div>
  72. <div class="item">
  73. <label>商品品牌:</label>
  74. <form:select path="brandID" class="input-medium">
  75. <form:option value="0" label="请选择"/>
  76. <c:forEach items="${brandList}" var="brand">
  77. <form:option value="${brand.id}">${brand.name}</form:option>
  78. </c:forEach>
  79. <form:option value="161">
  80. 其他
  81. </form:option>
  82. </form:select>
  83. </div>
  84. <div class="item">
  85. <label>来源:</label>
  86. <form:select path="source" class="input-medium">
  87. <form:option value="" label="请选择"/>
  88. <form:option value="1" label="网站"/>
  89. <form:option value="2" label="小程序"/>
  90. <form:option value="3" label="后台"/>
  91. <form:option value="4" label="小程序-协销"/>
  92. </form:select>
  93. </div>
  94. <div class="item">
  95. <label>发布者身份:</label>
  96. <form:select path="publishIdentity" class="input-medium">
  97. <form:option value="" label="请选择"/>
  98. <form:option value="1" label="个人身份"/>
  99. <form:option value="2" label="机构身份"/>
  100. </form:select>
  101. </div>
  102. <div class="item">
  103. <label>卖家:</label>
  104. <form:input path="contactName" htmlEscape="false" maxlength="30" class="input-medium"/>
  105. </div>
  106. <div class="item">
  107. <label>发布类型:</label>
  108. <form:select path="announType" class="input-medium">
  109. <form:option value="" label="请选择"/>
  110. <form:option value="1" label="二手预成交商品"/>
  111. <form:option value="2" label="二手估价商品"/>
  112. </form:select>
  113. </div>
  114. <div class="item">
  115. <input id="btnSubmit" class="btn btn-primary" type="submit" value="查询" style="margin-left:20px;"/>
  116. </div>
  117. </div>
  118. </div>
  119. </form:form>
  120. <sys:message content="${message}"/>
  121. <table id="contentTable" class="table table-striped table-bordered table-condensed">
  122. <thead>
  123. <tr>
  124. <th>商品ID</th>
  125. <th>商品图片</th>
  126. <th>商品品牌</th>
  127. <th>商品名称</th>
  128. <th>发布者身份</th>
  129. <th>卖家</th>
  130. <th>采美对接人</th>
  131. <th>来源</th>
  132. <th>交易价</th>
  133. <th>线上分帐号</th>
  134. <th>发布类型</th>
  135. <th>分类</th>
  136. <th>商品状态</th>
  137. <th>交易状态</th>
  138. <th>提交时间</th>
  139. <th>审核时间</th>
  140. <th>到期时间</th>
  141. <shiro:hasPermission name="product:product:edit"><th>操作</th></shiro:hasPermission>
  142. </tr>
  143. </thead>
  144. <tbody>
  145. <c:forEach items="${page.list}" var="product">
  146. <tr>
  147. <td>
  148. ${product.id}
  149. </td>
  150. <td><a href="${product.mainImage}" target="_blank">
  151. <img src="${product.mainImage}" width="50" height="50">
  152. </a></td>
  153. <td>
  154. <c:if test="${product.brandID ne 161}">
  155. ${product.brandName}
  156. </c:if>
  157. <c:if test="${product.brandID eq 161}">
  158. 其他
  159. <c:if test="${product.otherBrandName ne '' && product.otherBrandName ne null && product.otherBrandName ne '其他'}">
  160. -${product.otherBrandName}
  161. </c:if>
  162. </c:if>
  163. </td>
  164. <td>
  165. <c:if test="${product.productCategory eq 2}">
  166. <a href="${fns:getConfig('wwwServer')}flea-market-${product.id}.html" target="_blank">
  167. <div style='max-width:180px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;margin: 0 auto;' title='${product.name}'>${product.name}</div>
  168. </a>
  169. </c:if>
  170. <c:if test="${product.productCategory ne 2}">
  171. <a href="${fns:getConfig('wwwServer')}product-${product.id}.html" target="_blank">
  172. <div style='max-width:180px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;margin: 0 auto;' title='${product.name}'>${product.name}</div>
  173. </a>
  174. </c:if>
  175. </td>
  176. <td>
  177. <c:if test="${product.publishIdentity eq 1}">
  178. 个人身份
  179. </c:if>
  180. <c:if test="${product.publishIdentity eq 2}">
  181. 公司身份
  182. </c:if>
  183. </td>
  184. <td>
  185. <c:if test="${product.publishIdentity eq 1}">
  186. ${product.contactName}
  187. </c:if>
  188. <c:if test="${product.publishIdentity eq 2}">
  189. ${product.companyName}
  190. </c:if>
  191. </td>
  192. <td>${product.dockingPeopleName}</td>
  193. <td>
  194. <c:if test="${product.source eq 1}">
  195. 网站
  196. </c:if>
  197. <c:if test="${product.source eq 2}">
  198. 小程序
  199. </c:if>
  200. <c:if test="${product.source eq 3}">
  201. 后台
  202. </c:if>
  203. <c:if test="${product.source eq 4}">
  204. 小程序-协销
  205. </c:if>
  206. </td>
  207. <td>${product.price}</td>
  208. <td>
  209. ${product.splitCode}
  210. </td>
  211. <td>
  212. <c:if test="${product.announType eq 1}">
  213. 二手预成交商品
  214. </c:if>
  215. <c:if test="${product.announType eq 2}">
  216. 二手估价商品
  217. </c:if>
  218. </td>
  219. <td>
  220. ${product.secondHandType eq 1?'二手仪器':product.secondHandType eq 2?'临期产品':'其他'}
  221. <c:if test="${product.secondHandType eq 1}">
  222. -${product.instrumentType}
  223. </c:if>
  224. </td>
  225. <td>
  226. <font color=${product.validFlag eq '1'?'blue':product.validFlag eq '2'?'green':product.validFlag eq '3'?'orange':'red'}>${product.validFlag eq '1'?'待审核':product.validFlag eq '2'?'已上架':product.validFlag eq '3'?'已下架':product.validFlag eq '8'?'审核未通过':'其他'}</font>
  227. </td>
  228. <td>
  229. ${product.sold eq '1'?'已售':'未售'}
  230. </td>
  231. <td>
  232. <c:if test="${empty product.submitDate}">
  233. ---
  234. </c:if>
  235. <c:if test="${not empty product.submitDate}">
  236. ${product.submitDate}
  237. </c:if>
  238. </td>
  239. <td>
  240. <c:if test="${empty product.reviewedDate}">
  241. ---
  242. </c:if>
  243. <c:if test="${not empty product.reviewedDate}">
  244. ${product.reviewedDate}
  245. </c:if>
  246. </td>
  247. <td>
  248. <c:if test="${empty product.onLineDate}">
  249. ---
  250. </c:if>
  251. <c:if test="${not empty product.onLineDate}">
  252. ${product.onLineDate}
  253. </c:if>
  254. </td>
  255. <shiro:hasPermission name="product:product:edit">
  256. <c:if test="${product.validFlag eq 0}">
  257. <td class="todo">无</td>
  258. </c:if>
  259. <c:if test="${product.productCategory eq 2}">
  260. <c:if test="${product.validFlag ne 0}">
  261. <td class="todo">
  262. <c:if test="${product.announType eq 1}">
  263. <a href="${ctx}/product/cmSecondHandDetail/form?id=${product.id}&searchName=${searchName}&searchShopID=${searchShopID}&searchShopName=${searchShopName}&searchBigTypeID=${searchBigTypeID}&searchSmallTypeID=${searchSmallTypeID}&searchTinyTypeID=${searchTinyTypeID}&searchValidFlag=${searchValidFlag}&searchActStatus=${searchActStatus}&searchProductType=${searchProductType}&searchBrandID=${searchBrandID}&searchPreferredFlag=${searchPreferredFlag}&searchProductCategory=${searchProductCategory}&editFlag=${editFlag}&fileTypes=999">商品编辑</a>
  264. </c:if>
  265. <c:if test="${product.announType eq 2}">
  266. <a href="${ctx}/product/cmSecondHandDetail/cmSecondDetailForm?id=${product.id}&searchProductCategory=2&searchName=${searchName}&searchShopID=${searchShopID}&searchShopName=${searchShopName}&searchBigTypeID=${searchBigTypeID}&searchSmallTypeID=${searchSmallTypeID}&searchTinyTypeID=${searchTinyTypeID}&searchValidFlag=${searchValidFlag}&searchActStatus=${searchActStatus}&searchProductType=${searchProductType}&searchBrandID=${searchBrandID}&searchPreferredFlag=${searchPreferredFlag}&fileTypes=999&searchProductCategory=${searchProductCategory}&editFlag=${editFlag}">商品编辑</a>
  267. <a href="${ctx}/product/cmSecondHandDetail/form?id=${product.id}&searchName=${searchName}&searchShopID=${searchShopID}&searchShopName=${searchShopName}&searchBigTypeID=${searchBigTypeID}&searchSmallTypeID=${searchSmallTypeID}&searchTinyTypeID=${searchTinyTypeID}&searchValidFlag=${searchValidFlag}&searchActStatus=${searchActStatus}&searchProductType=${searchProductType}&searchBrandID=${searchBrandID}&searchPreferredFlag=${searchPreferredFlag}&searchProductCategory=${searchProductCategory}&editFlag=${editFlag}&fileTypes=999">转为预成交商品</a>
  268. <%-- <a href="${ctx}/product/cmSecondHandDetail/form?searchName=${searchName}&searchShopID=${searchShopID}&searchShopName=${searchShopName}&searchBigTypeID=${searchBigTypeID}&searchSmallTypeID=${searchSmallTypeID}&searchTinyTypeID=${searchTinyTypeID}&searchValidFlag=${searchValidFlag}&searchActStatus=${searchActStatus}&searchProductType=${searchProductType}&searchBrandID=${searchBrandID}&searchPreferredFlag=${searchPreferredFlag}&fileTypes=999">转为预成交商品</a>--%>
  269. </c:if>
  270. <a href="${ctx}/product/cmSecondHandTransaction/toRecommend?id=${product.id}&searchName=${searchName}&searchShopID=${searchShopID}&searchShopName=${searchShopName}&searchBigTypeID=${searchBigTypeID}&searchSmallTypeID=${searchSmallTypeID}&searchTinyTypeID=${searchTinyTypeID}&searchValidFlag=${searchValidFlag}&searchActStatus=${searchActStatus}&searchProductType=${searchProductType}&searchBrandID=${searchBrandID}&searchPreferredFlag=${searchPreferredFlag}&searchProductCategory=${searchProductCategory}">相关推荐</a><br>
  271. <%-- <a href="${ctx}/product/new/imageList?id=${product.id}&searchName=${searchName}&searchShopID=${searchShopID}&searchShopName=${searchShopName}&searchBigTypeID=${searchBigTypeID}&searchSmallTypeID=${searchSmallTypeID}&searchTinyTypeID=${searchTinyTypeID}&searchValidFlag=${searchValidFlag}&searchActStatus=${searchActStatus}&searchProductType=${searchProductType}&searchBrandID=${searchBrandID}&searchPreferredFlag=${searchPreferredFlag}&searchProductCategory=${searchProductCategory}">图片管理</a>--%>
  272. <%--待审核或审核未通过才需要审核( 1待审核 2已上架 3已下架 8审核未通过 9已冻结)--%>
  273. <c:if test="${product.validFlag eq 1 or product.validFlag eq 8}">
  274. <a class="red" href="javascript:void(0);" onclick="auditThisBySencodeProduct(${product.id},'${product.costPrice}',${product.price})">审核</a>
  275. </c:if>
  276. <%--已上架的才可以下架--%>
  277. <c:if test="${product.validFlag eq 2}">
  278. <a class="red" href="javascript:void(0);" onclick="line(${product.id}, 3)">下架</a>
  279. </c:if>
  280. <%--已下架的才可以上架--%>
  281. <c:if test="${product.validFlag eq 3}">
  282. <a class="red" href="javascript:void(0);" onclick="line(${product.id}, 2)">上架</a>
  283. </c:if>
  284. <a class="red" href="javascript:void(0);" onclick="validChange(${product.id},0)" >删除</a>
  285. </td>
  286. </c:if>
  287. </c:if>
  288. <c:if test="${product.productCategory ne 2}">
  289. <c:if test="${product.validFlag ne 0}">
  290. <td class="todo">
  291. <a href="${ctx}/product/new/fastEdit?id=${product.id}&searchName=${searchName}&searchShopID=${searchShopID}&searchShopName=${searchShopName}&searchBigTypeID=${searchBigTypeID}&searchSmallTypeID=${searchSmallTypeID}&searchTinyTypeID=${searchTinyTypeID}&searchValidFlag=${searchValidFlag}&searchActStatus=${searchActStatus}&searchProductType=${searchProductType}&searchBrandID=${searchBrandID}&searchPreferredFlag=${searchPreferredFlag}&searchProductCategory=${searchProductCategory}">快编</a>
  292. <a href="${ctx}/product/new/productEdit?id=${product.id}&searchName=${searchName}&searchShopID=${searchShopID}&searchShopName=${searchShopName}&searchBigTypeID=${searchBigTypeID}&searchSmallTypeID=${searchSmallTypeID}&searchTinyTypeID=${searchTinyTypeID}&searchValidFlag=${searchValidFlag}&searchActStatus=${searchActStatus}&searchProductType=${searchProductType}&searchBrandID=${searchBrandID}&searchPreferredFlag=${searchPreferredFlag}&searchProductCategory=${searchProductCategory}&editFlag=${editFlag}">商品编辑</a>
  293. <a href="${ctx}/product/new/setCategory?id=${product.id}&searchName=${searchName}&searchShopID=${searchShopID}&searchShopName=${searchShopName}&searchBigTypeID=${searchBigTypeID}&searchSmallTypeID=${searchSmallTypeID}&searchTinyTypeID=${searchTinyTypeID}&searchValidFlag=${searchValidFlag}&searchActStatus=${searchActStatus}&searchProductType=${searchProductType}&searchBrandID=${searchBrandID}&searchPreferredFlag=${searchPreferredFlag}&searchProductCategory=${searchProductCategory}">设置分类</a>
  294. <a href="${ctx}/product/new/recommend?id=${product.id}&searchName=${searchName}&searchShopID=${searchShopID}&searchShopName=${searchShopName}&searchBigTypeID=${searchBigTypeID}&searchSmallTypeID=${searchSmallTypeID}&searchTinyTypeID=${searchTinyTypeID}&searchValidFlag=${searchValidFlag}&searchActStatus=${searchActStatus}&searchProductType=${searchProductType}&searchBrandID=${searchBrandID}&searchPreferredFlag=${searchPreferredFlag}&searchProductCategory=${searchProductCategory}">相关推荐</a><br>
  295. <a href="javascript:void(0);" onclick="updateIndex('${product.id}')">更新索引</a>
  296. <a href="${ctx}/product/new/imageList?id=${product.id}&searchName=${searchName}&searchShopID=${searchShopID}&searchShopName=${searchShopName}&searchBigTypeID=${searchBigTypeID}&searchSmallTypeID=${searchSmallTypeID}&searchTinyTypeID=${searchTinyTypeID}&searchValidFlag=${searchValidFlag}&searchActStatus=${searchActStatus}&searchProductType=${searchProductType}&searchBrandID=${searchBrandID}&searchPreferredFlag=${searchPreferredFlag}&searchProductCategory=${searchProductCategory}">图片管理</a>
  297. <a href="${ctx}/product/hehe/edit?id=${product.id}&searchName=${searchName}&searchShopID=${searchShopID}&searchShopName=${searchShopName}&searchBigTypeID=${searchBigTypeID}&searchSmallTypeID=${searchSmallTypeID}&searchTinyTypeID=${searchTinyTypeID}&searchValidFlag=${searchValidFlag}&searchActStatus=${searchActStatus}&searchProductType=${searchProductType}&searchBrandID=${searchBrandID}&searchPreferredFlag=${searchPreferredFlag}&searchProductCategory=${searchProductCategory}">参与呵呵商城</a><br>
  298. <a href="javascript:void(0);" data-productid="${product.id}" data-preferred="${product.preferredFlag}" onclick="settingApplets($(this))">小程序配置</a>
  299. <c:if test="${product.validFlag eq 1 or product.validFlag eq 8}">
  300. <a class="red" href="javascript:void(0);" onclick="auditThis(${product.id},'${product.brand.name}',${product.brand.status},'${product.costCheckFlag}','${product.costPrice}','${product.costProportional}')">审核</a>
  301. </c:if>
  302. <c:if test="${product.validFlag ne 9}">
  303. <a class="red" href="javascript:void(0);" onclick="validChange(${product.id}, 9)">冻结</a>
  304. </c:if>
  305. <c:if test="${product.validFlag eq 9}">
  306. <a class="red" href="javascript:void(0);" onclick="validChange(${product.id}, 2)">解除冻结</a>
  307. </c:if>
  308. <a class="red" href="javascript:void(0);" onclick="validChange(${product.id}, 0)" >删除</a>
  309. </td>
  310. </c:if>
  311. </c:if>
  312. </shiro:hasPermission>
  313. </tr>
  314. </c:forEach>
  315. </tbody>
  316. </table>
  317. <div class="pagination">${page}</div>
  318. <% request.setAttribute("caimeiCore", Global.getConfig("caimei.core"));%>
  319. <script type="text/javascript">
  320. var num = '';
  321. function page(n,s){
  322. $("#pageNo").val(n);
  323. $("#pageSize").val(s);
  324. $("#searchForm").submit();
  325. return false;
  326. }
  327. loadInstrumentType();
  328. // preferredFlag条件搜索
  329. $(document).ready(function() {
  330. $("body").on("change", "input[name=preferredBox]", function(){
  331. var preferredFlag = 0;
  332. for (var i = 0; i < $("input[name=preferredBox]").length; i++) {
  333. if ($("input[name=preferredBox]").eq(i).attr('checked')) {
  334. preferredFlag += $("input[name=preferredBox]").eq(i).val()*1;
  335. }
  336. }
  337. $("#preferredFlag").val(preferredFlag);
  338. });
  339. var smallType = $("#smallType option:selected").val();
  340. var tinyType = $("#tinyType option:selected").val();
  341. $("#smallType").val(smallType);
  342. $("#smallType").prev().find(".select2-chosen").text($("#smallType option:selected").text());
  343. setTimeout(function(){
  344. $("#tinyType").val(tinyType);
  345. $("#tinyType").prev().find(".select2-chosen").text($("#tinyType option:selected").text());
  346. },500)
  347. });
  348. // 选择配置
  349. function settingApplets(that) {
  350. var productId = that.attr('data-productid');
  351. var preferred = that.attr('data-preferred');
  352. var html = '<div id="auditBox"><div>请选择把该商品加入到如下商品列表中(可以多选)</div><div class="preferred">'
  353. +'<label><input '+(parseInt(preferred%10)>=1?'checked':'')+' name="preferredFlag" type="checkbox" value="1">新品上线</label>'
  354. +'<label><input '+(parseInt((preferred%100)/10)>=1?'checked':'')+' name="preferredFlag" type="checkbox" value="10">优惠商品</label>'
  355. +'<label><input '+(parseInt(preferred/100)>=1?'checked':'')+' name="preferredFlag" type="checkbox" value="100">常用商品</label>'
  356. +'</div></div>';
  357. var submit = function (v, h, f) {
  358. // 新品上线(001) 优惠商品(010) 常用商品(100),三者同时存在111
  359. var preferredFlag = 0;
  360. if (f.preferredFlag) {
  361. var temp = f.preferredFlag.toString().split(",");
  362. temp.forEach(function(item){
  363. preferredFlag += item*1;
  364. });
  365. }
  366. $.post("${ctx}/product/new/addPreferred", {
  367. 'productId': productId,
  368. 'preferredFlag': preferredFlag
  369. }, function (data) {
  370. if (true == data.success) {
  371. $.jBox.tip(data.msg, 'info');
  372. $("#searchForm").submit();
  373. } else {
  374. $.jBox.tip(data.msg, 'error');
  375. }
  376. }, "JSON");
  377. };
  378. $.jBox(html, {title: "选择配置", submit: submit});
  379. }
  380. // 更新索引
  381. function updateIndex(id) {
  382. $.post("${caimeiCore}/commodity/search/index/update/product", {productId: id}, function(res){
  383. $.jBox.tip(res.msg, 'info');
  384. });
  385. }
  386. // 商品下架、下架
  387. function line(productId,validFlag) {
  388. var submit = function (v, h, f) {
  389. $.post("${ctx}/product/new/line", {
  390. 'productId': productId,
  391. 'validFlag': validFlag
  392. }, function (data) {
  393. if (true == data.success) {
  394. $.jBox.tip(data.msg, 'info');
  395. <%--window.location.href="${ctx}/product/new/list";--%>
  396. $("#searchForm").submit();
  397. } else {
  398. $.jBox.tip(data.msg, 'error');
  399. }
  400. }, "JSON");
  401. };
  402. if(2 == validFlag){
  403. $.jBox.confirm("确定上架该商品吗?", "提示", submit, { buttons: { '确认': true, '取消': false} });
  404. }else{
  405. $.jBox.confirm("确定下架该商品吗?", "提示", submit, { buttons: { '确认': true, '取消': false} });
  406. }
  407. }
  408. // 审核(二手)
  409. function auditThisBySencodeProduct(id,costPrice,price,costProportional){
  410. var html = "<div id='auditBox'>"
  411. + "<div class='bd-row'>"
  412. + " <span><font color='red'>*</font>审核:</span>"
  413. + " <select name='validFlag' id='validFlag'>"
  414. + " <option value='2'>审核通过</option>"
  415. + " <option value='8'>审核未通过</option>"
  416. + " <select/>"
  417. + "</div>"
  418. + "</div>";
  419. var htmls = "<div id='auditBox'>"
  420. + "<div class='bd-row'>"
  421. + " <span><font color='red'>*</font>审核通过前请先填写交易价和成本</span>"
  422. + "</div>"
  423. + "</div>";
  424. var submit = function (v, h, f) {
  425. console.log(f.validFlag)
  426. if(f.validFlag ==2) {
  427. if (((costPrice == 0.00 || costPrice == undefined) && (price == undefined || price == '')) || ((costProportional == '' || costProportional == undefined) && (price == undefined || price == ''))) {
  428. $.jBox(htmls, {title: "提示"});
  429. // $.jBox.tip("审核通过前请先填写交易价和成本", 'error', {focusId: "validFlag"});
  430. return false;
  431. }
  432. }
  433. if (f.auditStatus == '') {
  434. $.jBox.tip("请选择状态", 'error', {focusId: "validFlag"});
  435. return false;
  436. }
  437. $.post("${ctx}/product/new/auditProductBySencondProduct", {
  438. 'productID': id,
  439. 'validFlag': f.validFlag
  440. }, function (data) {
  441. if (true == data.success) {
  442. $.jBox.tip(data.msg, 'info');
  443. $("#searchForm").submit();
  444. } else {
  445. $.jBox.tip(data.msg, 'error');
  446. }
  447. }, "JSON");
  448. };
  449. $.jBox(html, {title: "审核", submit: submit});
  450. }
  451. // 审核(正常)
  452. function auditThis(id,name,status,costCheckFlag,costPrice,costProportional) {
  453. // 商品成本判断
  454. if(null == costCheckFlag || "" == costCheckFlag){
  455. alertx("成本价未填写,请编辑成本价后再审核");
  456. return;
  457. }else if(costCheckFlag == 1){
  458. //固定成本
  459. if(null == costPrice || "" == costPrice){
  460. alertx("成本价未填写,请编辑成本价后再审核");
  461. return;
  462. }
  463. }else if(costCheckFlag == 2){
  464. //比例成
  465. if(null == costProportional || "" == costProportional){
  466. alertx("成本价未填写,请编辑成本价后再审核");
  467. return;
  468. }
  469. }
  470. // 0:待审核,1:审核通过,2:审核失败
  471. if(status == 0 && name != "" ){
  472. alertx("该商品的品牌:"+name+",尚未审核。请先审核通过该品牌再审核商品");
  473. return;
  474. }
  475. if(status == 2 && name != "" ){
  476. alertx("该商品的品牌:"+name+",审核未通过。请通知供应商重新编辑提交品牌再审核商品或者直接修改品牌信息审核通过后再审核商品");
  477. return;
  478. }
  479. var html = "<div id='auditBox'>"
  480. + "<div class='bd-row'>"
  481. + " <span><font color='red'>*</font>审核:</span>"
  482. + " <select name='validFlag' id='validFlag'>"
  483. + " <option value='2'>审核通过</option>"
  484. + " <option value='8'>审核未通过</option>"
  485. + " <select/>"
  486. + "</div>"
  487. + "</div>";
  488. var submit = function (v, h, f) {
  489. if (f.auditStatus == '') {
  490. $.jBox.tip("请选择状态", 'error', {focusId: "validFlag"});
  491. return false;
  492. }
  493. $.post("${ctx}/product/new/auditProduct", {
  494. 'productID': id,
  495. 'validFlag': f.validFlag
  496. }, function (data) {
  497. if (true == data.success) {
  498. $.jBox.tip(data.msg, 'info');
  499. $("#searchForm").submit();
  500. } else {
  501. $.jBox.tip(data.msg, 'error');
  502. }
  503. }, "JSON");
  504. };
  505. $.jBox(html, {title: "审核", submit: submit});
  506. }
  507. function validChange(id, flag) {
  508. var msg = "提示信息";
  509. if(flag == 9){
  510. msg = "确定冻结该商品吗?冻结后该商品不会出现在采美商城。";
  511. }else if(flag == 2){
  512. msg = "确定解除冻结该商品吗?";
  513. }else if(flag == 0){
  514. msg = "确定删除该二手商品吗?删除后需要重新发布";
  515. }
  516. top.$.jBox.confirm(msg,'系统提示',function(v,h,f){
  517. if(v=='ok'){
  518. $.post("${ctx}/product/new/auditProduct",{'productID': id,'validFlag': flag}, function(data) {
  519. if(true==data.success){
  520. $.jBox.tip(data.msg, 'info');
  521. } else {
  522. $.jBox.tip(data.msg,'error');
  523. }
  524. $("#searchForm").submit();
  525. },"JSON");//这里返回的类型有:json,html,xml,text
  526. }
  527. return;
  528. },{buttonsFocus:1,persistent: true});
  529. }
  530. function loadInstrumentType() {
  531. var secondHandType = $("#secondHandType option:selected").val();
  532. var instrumentType = $("#instrumentType option:selected").val();
  533. console.log(secondHandType)
  534. if (secondHandType == 1) {
  535. if (instrumentType == ''){
  536. $("#instrumentType").html();
  537. $("#instrumentType").find("option").remove();
  538. $(".select2-chosen").eq(1).html("请选择");
  539. $("#instrumentType").append("<option value=''>请选择</option>")
  540. $("#instrumentType").append("<option value='1'>美容仪器</option>")
  541. }
  542. }else {
  543. $("#instrumentType").html();
  544. $("#instrumentType").find("option").remove();
  545. $(".select2-chosen").eq(1).html("无");
  546. $("#instrumentType").append("<option value='' selected>无</option>")
  547. }
  548. }
  549. // 二级分类
  550. var smalltypeList = [
  551. <c:forEach items="${classify.smalltypeList}" var="smalltype" varStatus="index">
  552. <c:if test="${index.index > 0}">,</c:if>
  553. {
  554. smallTypeID: ${smalltype.smallTypeID},
  555. name: "${smalltype.name}",
  556. bigTypeID: ${smalltype.bigTypeID},
  557. }
  558. </c:forEach>
  559. ];
  560. // 三级分类
  561. var tinytypeList = [
  562. <c:forEach items="${classify.tinytypeList}" var="tinytype" varStatus="index">
  563. <c:if test="${index.index > 0}">,</c:if>
  564. {
  565. tinyTypeID: ${tinytype.tinyTypeID},
  566. name: "${tinytype.name}",
  567. smallTypeID: ${tinytype.smallTypeID}
  568. }
  569. </c:forEach>
  570. ];
  571. </script>
  572. </body>
  573. </html>