secondHand.jsp 30 KB

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