secondHand.jsp 30 KB

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