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("caimeiCore", Global.getConfig("caimei.core"));%>
  297. <script type="text/javascript">
  298. var num = '';
  299. function page(n,s){
  300. $("#pageNo").val(n);
  301. $("#pageSize").val(s);
  302. $("#searchForm").submit();
  303. return false;
  304. }
  305. loadInstrumentType();
  306. // preferredFlag条件搜索
  307. $(document).ready(function() {
  308. $("body").on("change", "input[name=preferredBox]", function(){
  309. var preferredFlag = 0;
  310. for (var i = 0; i < $("input[name=preferredBox]").length; i++) {
  311. if ($("input[name=preferredBox]").eq(i).attr('checked')) {
  312. preferredFlag += $("input[name=preferredBox]").eq(i).val()*1;
  313. }
  314. }
  315. $("#preferredFlag").val(preferredFlag);
  316. });
  317. var smallType = $("#smallType option:selected").val();
  318. var tinyType = $("#tinyType option:selected").val();
  319. $("#smallType").val(smallType);
  320. $("#smallType").prev().find(".select2-chosen").text($("#smallType option:selected").text());
  321. setTimeout(function(){
  322. $("#tinyType").val(tinyType);
  323. $("#tinyType").prev().find(".select2-chosen").text($("#tinyType option:selected").text());
  324. },500)
  325. });
  326. // 选择配置
  327. function settingApplets(that) {
  328. var productId = that.attr('data-productid');
  329. var preferred = that.attr('data-preferred');
  330. var html = '<div id="auditBox"><div>请选择把该商品加入到如下商品列表中(可以多选)</div><div class="preferred">'
  331. +'<label><input '+(parseInt(preferred%10)>=1?'checked':'')+' name="preferredFlag" type="checkbox" value="1">新品上线</label>'
  332. +'<label><input '+(parseInt((preferred%100)/10)>=1?'checked':'')+' name="preferredFlag" type="checkbox" value="10">优惠商品</label>'
  333. +'<label><input '+(parseInt(preferred/100)>=1?'checked':'')+' name="preferredFlag" type="checkbox" value="100">常用商品</label>'
  334. +'</div></div>';
  335. var submit = function (v, h, f) {
  336. // 新品上线(001) 优惠商品(010) 常用商品(100),三者同时存在111
  337. var preferredFlag = 0;
  338. if (f.preferredFlag) {
  339. var temp = f.preferredFlag.toString().split(",");
  340. temp.forEach(function(item){
  341. preferredFlag += item*1;
  342. });
  343. }
  344. $.post("${ctx}/product/new/addPreferred", {
  345. 'productId': productId,
  346. 'preferredFlag': preferredFlag
  347. }, function (data) {
  348. if (true == data.success) {
  349. $.jBox.tip(data.msg, 'info');
  350. $("#searchForm").submit();
  351. } else {
  352. $.jBox.tip(data.msg, 'error');
  353. }
  354. }, "JSON");
  355. };
  356. $.jBox(html, {title: "选择配置", submit: submit});
  357. }
  358. // 更新索引
  359. function updateIndex(id) {
  360. $.post("${caimeiCore}/commodity/search/index/update/product", {productId: id}, function(res){
  361. $.jBox.tip(res.msg, 'info');
  362. });
  363. }
  364. // 商品下架、下架
  365. function line(productId,validFlag) {
  366. var submit = function (v, h, f) {
  367. $.post("${ctx}/product/new/line", {
  368. 'productId': productId,
  369. 'validFlag': validFlag
  370. }, function (data) {
  371. if (true == data.success) {
  372. $.jBox.tip(data.msg, 'info');
  373. <%--window.location.href="${ctx}/product/new/list";--%>
  374. $("#searchForm").submit();
  375. } else {
  376. $.jBox.tip(data.msg, 'error');
  377. }
  378. }, "JSON");
  379. };
  380. if(2 == validFlag){
  381. $.jBox.confirm("确定上架该商品吗?", "提示", submit, { buttons: { '确认': true, '取消': false} });
  382. }else{
  383. $.jBox.confirm("确定下架该商品吗?", "提示", submit, { buttons: { '确认': true, '取消': false} });
  384. }
  385. }
  386. // 审核(二手)
  387. function auditThisBySencodeProduct(id,costPrice){
  388. var html = "<div id='auditBox'>"
  389. + "<div class='bd-row'>"
  390. + " <span><font color='red'>*</font>审核:</span>"
  391. + " <select name='validFlag' id='validFlag'>"
  392. + " <option value='2'>审核通过</option>"
  393. + " <option value='8'>审核未通过</option>"
  394. + " <select/>"
  395. + "</div>"
  396. + "</div>";
  397. var submit = function (v, h, f) {
  398. if (f.auditStatus == '') {
  399. $.jBox.tip("请选择状态", 'error', {focusId: "validFlag"});
  400. return false;
  401. }
  402. $.post("${ctx}/product/new/auditProductBySencondProduct", {
  403. 'productID': id,
  404. 'validFlag': f.validFlag
  405. }, function (data) {
  406. if (true == data.success) {
  407. $.jBox.tip(data.msg, 'info');
  408. $("#searchForm").submit();
  409. } else {
  410. $.jBox.tip(data.msg, 'error');
  411. }
  412. }, "JSON");
  413. };
  414. $.jBox(html, {title: "审核", submit: submit});
  415. }
  416. // 审核(正常)
  417. function auditThis(id,name,status,costCheckFlag,costPrice,costProportional) {
  418. // 商品成本判断
  419. if(null == costCheckFlag || "" == costCheckFlag){
  420. alertx("成本价未填写,请编辑成本价后再审核");
  421. return;
  422. }else if(costCheckFlag == 1){
  423. //固定成本
  424. if(null == costPrice || "" == costPrice){
  425. alertx("成本价未填写,请编辑成本价后再审核");
  426. return;
  427. }
  428. }else if(costCheckFlag == 2){
  429. //比例成
  430. if(null == costProportional || "" == costProportional){
  431. alertx("成本价未填写,请编辑成本价后再审核");
  432. return;
  433. }
  434. }
  435. // 0:待审核,1:审核通过,2:审核失败
  436. if(status == 0 && name != "" ){
  437. alertx("该商品的品牌:"+name+",尚未审核。请先审核通过该品牌再审核商品");
  438. return;
  439. }
  440. if(status == 2 && name != "" ){
  441. alertx("该商品的品牌:"+name+",审核未通过。请通知供应商重新编辑提交品牌再审核商品或者直接修改品牌信息审核通过后再审核商品");
  442. return;
  443. }
  444. var html = "<div id='auditBox'>"
  445. + "<div class='bd-row'>"
  446. + " <span><font color='red'>*</font>审核:</span>"
  447. + " <select name='validFlag' id='validFlag'>"
  448. + " <option value='2'>审核通过</option>"
  449. + " <option value='8'>审核未通过</option>"
  450. + " <select/>"
  451. + "</div>"
  452. + "</div>";
  453. var submit = function (v, h, f) {
  454. if (f.auditStatus == '') {
  455. $.jBox.tip("请选择状态", 'error', {focusId: "validFlag"});
  456. return false;
  457. }
  458. $.post("${ctx}/product/new/auditProduct", {
  459. 'productID': id,
  460. 'validFlag': f.validFlag
  461. }, function (data) {
  462. if (true == data.success) {
  463. $.jBox.tip(data.msg, 'info');
  464. $("#searchForm").submit();
  465. } else {
  466. $.jBox.tip(data.msg, 'error');
  467. }
  468. }, "JSON");
  469. };
  470. $.jBox(html, {title: "审核", submit: submit});
  471. }
  472. function validChange(id, flag) {
  473. var msg = "提示信息";
  474. if(flag == 9){
  475. msg = "确定冻结该商品吗?冻结后该商品不会出现在采美商城。";
  476. }else if(flag == 2){
  477. msg = "确定解除冻结该商品吗?";
  478. }else if(flag == 0){
  479. msg = "确定删除该二手商品吗?删除后需要重新发布";
  480. }
  481. top.$.jBox.confirm(msg,'系统提示',function(v,h,f){
  482. if(v=='ok'){
  483. $.post("${ctx}/product/new/auditProduct",{'productID': id,'validFlag': flag}, function(data) {
  484. if(true==data.success){
  485. $.jBox.tip(data.msg, 'info');
  486. } else {
  487. $.jBox.tip(data.msg,'error');
  488. }
  489. $("#searchForm").submit();
  490. },"JSON");//这里返回的类型有:json,html,xml,text
  491. }
  492. return;
  493. },{buttonsFocus:1,persistent: true});
  494. }
  495. function loadInstrumentType() {
  496. var secondHandType = $("#secondHandType option:selected").val();
  497. var instrumentType = $("#instrumentType option:selected").val();
  498. console.log(secondHandType)
  499. if (secondHandType == 1) {
  500. if (instrumentType == ''){
  501. $("#instrumentType").html();
  502. $("#instrumentType").find("option").remove();
  503. $(".select2-chosen").eq(1).html("请选择");
  504. $("#instrumentType").append("<option value=''>请选择</option>")
  505. $("#instrumentType").append("<option value='1'>美容仪器</option>")
  506. }
  507. }else {
  508. $("#instrumentType").html();
  509. $("#instrumentType").find("option").remove();
  510. $(".select2-chosen").eq(1).html("无");
  511. $("#instrumentType").append("<option value='' selected>无</option>")
  512. }
  513. }
  514. // 二级分类
  515. var smalltypeList = [
  516. <c:forEach items="${classify.smalltypeList}" var="smalltype" varStatus="index">
  517. <c:if test="${index.index > 0}">,</c:if>
  518. {
  519. smallTypeID: ${smalltype.smallTypeID},
  520. name: "${smalltype.name}",
  521. bigTypeID: ${smalltype.bigTypeID},
  522. }
  523. </c:forEach>
  524. ];
  525. // 三级分类
  526. var tinytypeList = [
  527. <c:forEach items="${classify.tinytypeList}" var="tinytype" varStatus="index">
  528. <c:if test="${index.index > 0}">,</c:if>
  529. {
  530. tinyTypeID: ${tinytype.tinyTypeID},
  531. name: "${tinytype.name}",
  532. smallTypeID: ${tinytype.smallTypeID}
  533. }
  534. </c:forEach>
  535. ];
  536. </script>
  537. </body>
  538. </html>