index.html 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351
  1. {include file="public/header" /}
  2. <div class="page">
  3. <div class="fixed-bar">
  4. <div class="item-title">
  5. <div class="subject">
  6. <h3>{$Think.lang.ds_goods_manage}</h3>
  7. <h5></h5>
  8. </div>
  9. {include file="public/admin_items" /}
  10. </div>
  11. </div>
  12. <div class="fixed-empty"></div>
  13. <div class="explanation" id="explanation">
  14. <div class="title" id="checkZoom">
  15. <h4 title="{$Think.lang.ds_explanation_tip}">{$Think.lang.ds_explanation}</h4>
  16. <span id="explanationZoom" title="{$Think.lang.ds_explanation_close}" class="arrow"></span>
  17. </div>
  18. <ul>
  19. <li>{$Think.lang.goods_index_help1}</li>
  20. <li>{$Think.lang.goods_index_help2}</li>
  21. </ul>
  22. </div>
  23. <form method="get" name="formSearch" id="formSearch">
  24. <div class="ds-search-form">
  25. <dl>
  26. <dt>{$Think.lang.ds_goods_name}</dt>
  27. <dd><input type="text" value="{$Request.get.search_goods_name|default=''}" name="search_goods_name" id="search_goods_name" class="txt"></dd>
  28. </dl>
  29. <dl>
  30. <dt>{$Think.lang.search_commonid}</dt>
  31. <dd><input type="text" value="{$Request.get.search_commonid|default=''}" name="search_commonid" id="search_commonid" class="txt" /></dd>
  32. </dl>
  33. <dl>
  34. <dt>{$Think.lang.goods_index_class_name}</dt>
  35. <dd id="searchgc_td"></dd>
  36. <input type="hidden" id="choose_gcid" name="choose_gcid" value="0"/>
  37. </dl>
  38. <dl>
  39. <dt>{$Think.lang.goods_index_store_name}</dt>
  40. <dd><input type="text" value="{$Request.get.search_store_name|default=''}" name="search_store_name" id="search_store_name" class="txt"></dd>
  41. </dl>
  42. <dl>
  43. <dt>{$Think.lang.goods_index_brand}</dt>
  44. <dd>
  45. <div id="ajax_brand" class="dssc-brand-select w180">
  46. <div class="selection">
  47. <input name="b_name" id="b_name" value="{$Request.param.b_name|default=''}" type="text" class="txt w180" readonly="readonly" />
  48. <input type="hidden" name="b_id" id="b_id" value="{$Request.param.b_id|default=''}" />
  49. </div>
  50. <div class="dssc-brand-select-container">
  51. <div class="brand-index" data-url="{:url('Common/ajax_get_brand')}">
  52. <div class="letter" dstype="letter">
  53. <ul>
  54. <li><a href="javascript:void(0);" data-letter="all">{$Think.lang.all_brands}</a></li>
  55. <li><a href="javascript:void(0);" data-letter="A">A</a></li>
  56. <li><a href="javascript:void(0);" data-letter="B">B</a></li>
  57. <li><a href="javascript:void(0);" data-letter="C">C</a></li>
  58. <li><a href="javascript:void(0);" data-letter="D">D</a></li>
  59. <li><a href="javascript:void(0);" data-letter="E">E</a></li>
  60. <li><a href="javascript:void(0);" data-letter="F">F</a></li>
  61. <li><a href="javascript:void(0);" data-letter="G">G</a></li>
  62. <li><a href="javascript:void(0);" data-letter="H">H</a></li>
  63. <li><a href="javascript:void(0);" data-letter="I">I</a></li>
  64. <li><a href="javascript:void(0);" data-letter="J">J</a></li>
  65. <li><a href="javascript:void(0);" data-letter="K">K</a></li>
  66. <li><a href="javascript:void(0);" data-letter="L">L</a></li>
  67. <li><a href="javascript:void(0);" data-letter="M">M</a></li>
  68. <li><a href="javascript:void(0);" data-letter="N">N</a></li>
  69. <li><a href="javascript:void(0);" data-letter="O">O</a></li>
  70. <li><a href="javascript:void(0);" data-letter="P">P</a></li>
  71. <li><a href="javascript:void(0);" data-letter="Q">Q</a></li>
  72. <li><a href="javascript:void(0);" data-letter="R">R</a></li>
  73. <li><a href="javascript:void(0);" data-letter="S">S</a></li>
  74. <li><a href="javascript:void(0);" data-letter="T">T</a></li>
  75. <li><a href="javascript:void(0);" data-letter="U">U</a></li>
  76. <li><a href="javascript:void(0);" data-letter="V">V</a></li>
  77. <li><a href="javascript:void(0);" data-letter="W">W</a></li>
  78. <li><a href="javascript:void(0);" data-letter="X">X</a></li>
  79. <li><a href="javascript:void(0);" data-letter="Y">Y</a></li>
  80. <li><a href="javascript:void(0);" data-letter="Z">Z</a></li>
  81. <li><a href="javascript:void(0);" data-letter="0-9">{$Think.lang.goods_index_other}</a></li>
  82. </ul>
  83. </div>
  84. <div class="search" dstype="search"><input name="search_brand_keyword" id="search_brand_keyword" type="text" class="text" /><a href="javascript:void(0);" class="dssc-btn-mini" style="vertical-align: top;">Go</a></div>
  85. </div>
  86. <div class="brand-list" dstype="brandList">
  87. <ul dstype="brand_list">
  88. {notempty name="brand_list"}
  89. {foreach name="brand_list" item="val"}
  90. <li data-id='{$val.brand_id}'data-name='{$val.brand_name}'><em>{$val.brand_initial}</em>{$val.brand_name}</li>
  91. {/foreach}
  92. {/notempty}
  93. </ul>
  94. </div>
  95. <div class="no-result" dstype="noBrandList" style="display: none;">{$Think.lang.no_brand_result|raw}</div>
  96. </div>
  97. </div>
  98. </dd>
  99. </dl>
  100. {if $type == 'allgoods'}
  101. <dl>
  102. <dt>{$Think.lang.goods_index_show}</dt>
  103. <dd>
  104. <select name="goods_state">
  105. <option value="">{$Think.lang.ds_please_choose}...</option>
  106. {foreach name="state" item="val" key="key" }
  107. <option value="{$key}" {if isset($search['goods_state']) && $search['goods_state'] == $key }selected{/if}>{$val}</option>
  108. {/foreach}
  109. </select>
  110. </dd>
  111. </dl>
  112. <dl>
  113. <dt>{$Think.lang.goods_verify}</dt>
  114. <dd>
  115. <select name="goods_verify">
  116. <option value="" >{$Think.lang.ds_please_choose}...</option>
  117. {foreach name="verify" item="val" key="key"}
  118. <option value="{$key}" {if isset($search['goods_verify']) && $search['goods_verify'] == $key }selected{/if}>{$val}</option>
  119. {/foreach}
  120. </select>
  121. </dd>
  122. </dl>
  123. {/if}
  124. <div class="btn_group">
  125. <input type="hidden" name="type" value="{$Request.param.type}">
  126. <a href="javascript:void(0);" id="dssubmit" class="btn " title="{$Think.lang.ds_query}">{$Think.lang.ds_query}</a>
  127. <a href="{:url('Goods/index',['type'=>$Request.param.type])}" class="btn btn-default" title="{$Think.lang.ds_cancel}">{$Think.lang.ds_cancel}</a>
  128. </div>
  129. </div>
  130. </form>
  131. <table class="ds-default-table">
  132. <thead>
  133. <tr class="thead">
  134. <th class="w24"></th>
  135. <th class="w24"></th>
  136. <th class="w60 align-center">{$Think.lang.search_commonid}</th>
  137. <th class="w24">{$Think.lang.goods_id}</th>
  138. <th colspan="2">{$Think.lang.ds_goods_name}</th>
  139. <th>{$Think.lang.goods_index_brand}&{$Think.lang.goods_index_class_name}</th>
  140. <th class="w72 align-center">{$Think.lang.goods_price}</th>
  141. <th class="w72 align-center">{$Think.lang.goods_storage}</th>
  142. <th class="w72 align-center">{$Think.lang.goods_state}</th>
  143. <th class="w72 align-center">{$Think.lang.goods_verify}</th>
  144. {if $type == 'allgoods'}
  145. <th class="w72 align-center">{$Think.lang.mall_goods_commend}</th>
  146. <th class="w72 align-center">{$Think.lang.ds_sort}</th>
  147. {/if}
  148. <th class="w200 align-center" >{$Think.lang.ds_handle}</th>
  149. </tr>
  150. </thead>
  151. <tbody>
  152. {notempty name="goods_list"}
  153. {foreach name="goods_list" item="v"}
  154. <tr class="hover edit" id="ds_row_{$v.goods_commonid}">
  155. <td><input type="checkbox" value="{$v.goods_commonid}" class="checkitem"></td>
  156. <td><i class="iconfont icon-jia" status="open" style="cursor: pointer;" dstype="ajaxGoodsList" data-comminid="{$v.goods_commonid}" title="{$Think.lang.show_all_spec}"></i></td>
  157. <td class="align-center">{$v.goods_commonid}</td>
  158. <td class="align-center">{$storage_array[$v['goods_commonid']]['goods_id']}</td>
  159. <td class="w60 picture"><div class="size-56x56"><span class="thumb size-56x56"><i></i><img src="{:goods_thumb($v, 240)}" width="56" height="56"/></span></div></td>
  160. <td>
  161. <dl class="goods-info"><dt class="goods-name">{$v.goods_name}</dt>
  162. <dd class="goods-type">
  163. {if $v.is_virtual eq 1}<span class="virtual" >{$Think.lang.ds_virtual}</span>{/if}
  164. {if $v.is_goodsfcode eq 1}<span class="fcode" >{$Think.lang.ds_fcode}</span>{/if}
  165. {if $v.is_appoint eq 1}<span class="appoint" >{$Think.lang.ds_appoint}</span>{/if}
  166. <i class="iconfont {if $v.mobile_body neq ''}open{/if}" >&#xe72b;</i>
  167. </dd>
  168. <dd class="goods-store">{if isset($ownShopIds[$v['store_id']])}{$Think.lang.ds_platform}{else/}{$Think.lang.ds_three_party}{/if}{$Think.lang.ds_store}:{$v.store_name}</dd></dl>
  169. </td>
  170. <td>
  171. <p>{$v.gc_name}</p>
  172. <p class="goods-brand">{$Think.lang.ds_brand}:{$v.brand_name}</p>
  173. </td>
  174. <td class="align-center">{$v.goods_price}</td>
  175. <td class="align-center">{$storage_array[$v['goods_commonid']]['sum']}</td>
  176. <td class="align-center">{$state[$v['goods_state']]}</td>
  177. <td class="align-center">{$verify[$v['goods_verify']]}</td>
  178. {if $type == 'allgoods'}
  179. <td class="align-center yes-onoff">
  180. {if $v.mall_goods_commend == '0'}
  181. <a href="JavaScript:void(0);" class="disabled" ajax_branch='mall_goods_commend' ds_type="inline_edit" fieldname="mall_goods_commend" fieldid="{$v.goods_commonid}" fieldvalue="0" title="{$Think.lang.ds_editable}"><img src="{$Think.ADMIN_SITE_ROOT}/images/treetable/transparent.gif"></a>
  182. {else /}
  183. <a href="JavaScript:void(0);" class="enabled" ajax_branch='mall_goods_commend' ds_type="inline_edit" fieldname="mall_goods_commend" fieldid="{$v.goods_commonid}" fieldvalue="1" title="{$Think.lang.ds_editable}"><img src="{$Think.ADMIN_SITE_ROOT}/images/treetable/transparent.gif"></a>
  184. {/if}
  185. </td>
  186. <td class="align-center sort">
  187. <span class="editable" ds_type="inline_edit" fieldname="mall_goods_sort" ajax_branch='mall_goods_sort' fieldid="{$v.goods_commonid}" datatype="pint" maxvalue="255" title="{$Think.lang.ds_editable}">{$v.mall_goods_sort}</span>
  188. </td>
  189. {/if}
  190. <td class="align-center">
  191. <a href="{:url('/home/goods/index',['goods_id' =>$storage_array[$v['goods_commonid']]['goods_id']])}" target="_blank" class="dsui-btn-view"><i class="iconfont"></i>{$Think.lang.ds_view}</a>
  192. {if $type == 'lockup'}
  193. <a href="javascript:dsLayerConfirm('{:url('Goods/goods_del',['common_id'=>$v.goods_commonid])}','{$Think.lang.ds_ensure_del}',{$v.goods_commonid})" class="dsui-btn-del"><i class="iconfont"></i>{$Think.lang.ds_del}</a>
  194. {elseif $type == 'waitverify'}
  195. <a href="javascript:void(0);" onclick="goods_verify({$v['goods_commonid']});" class="dsui-btn-edit"><i class="iconfont"></i>{$Think.lang.ds_verify}</a>
  196. {elseif $type == 'allgoods' /}
  197. <a href="javascript:void(0);" onclick="goods_lockup({$v['goods_commonid']});" class="dsui-btn-del"><i class="iconfont"></i>{$Think.lang.goods_index_lock}</a>
  198. {/if}
  199. </td>
  200. </tr>
  201. <tr style="display:none;">
  202. <td colspan="20"><div class="dssc-goods-sku ps-container"></div></td>
  203. </tr>
  204. {/foreach}
  205. {else /}
  206. <tr class="no_data">
  207. <td colspan="15">{$Think.lang.ds_no_record}</td>
  208. </tr>
  209. {/notempty}
  210. </tbody>
  211. <tfoot>
  212. <tr class="tfoot">
  213. &nbsp;&nbsp;
  214. {if $type == 'lockup'}
  215. <td><input type="checkbox" class="checkall" id="checkallBottom"></td>
  216. <td colspan="16"><label for="checkallBottom">{$Think.lang.ds_select_all}</label>
  217. &nbsp;&nbsp;<a href="JavaScript:void(0);" class="btn btn-small" onclick="submit_delete_batch()"><span>{$Think.lang.ds_del}</span></a>
  218. </td>
  219. {elseif $type == 'waitverify'}
  220. <td><input type="checkbox" class="checkall" id="checkallBottom"></td>
  221. <td colspan="16"><label for="checkallBottom">{$Think.lang.ds_select_all}</label>
  222. <a href="javascript:void(0);" class="btn btn-small" dstype="verify_batch"><span>{$Think.lang.ds_verify}</span></a>
  223. </td>
  224. {elseif $type == 'allgoods' /}
  225. <td><input type="checkbox" class="checkall" id="checkallBottom"></td>
  226. <td colspan="16"><label for="checkallBottom">{$Think.lang.ds_select_all}</label>
  227. <a href="JavaScript:void(0);" class="btn btn-small" dstype="lockup_batch"><span>{$Think.lang.goods_index_lock}</span></a>
  228. </td>
  229. {/if}
  230. </tr>
  231. </tfoot>
  232. </table>
  233. {$show_page|raw}
  234. </div>
  235. <script type="text/javascript" src="{$Think.ADMIN_SITE_ROOT}/js/jquery.edit.js" charset="utf-8"></script>
  236. <script type="text/javascript" src="{$Think.PLUGINS_SITE_ROOT}/jquery.mousewheel.js"></script>
  237. <script type="text/javascript" src="{$Think.PLUGINS_SITE_ROOT}/mlselection.js" charset="utf-8"></script>
  238. <script type="text/javascript">
  239. var HOMESITEURL = "{$Think.HOME_SITE_URL}";
  240. $(function(){
  241. //商品分类
  242. init_gcselect({$gc_choose_json|raw},{$gc_json|raw});
  243. /* AJAX选择品牌 */
  244. $("#ajax_brand").brandinit();
  245. $('#dssubmit').click(function(){
  246. $('#formSearch').submit();
  247. });
  248. // 审核批量处理
  249. $('a[dstype="verify_batch"]').click(function(){
  250. ids_str = getItems();
  251. if (ids_str) {
  252. goods_verify(ids_str);
  253. }
  254. });
  255. // 违规下架批量处理
  256. $('a[dstype="lockup_batch"]').click(function(){
  257. ids_str = getItems();
  258. if (ids_str) {
  259. goods_lockup(ids_str);
  260. }
  261. });
  262. // ajax获取商品列表
  263. $('i[dstype="ajaxGoodsList"]').click(
  264. function(){
  265. var status = $(this).attr("status");
  266. if (status == 'open') {
  267. $(this).attr('status', 'close');
  268. $(this).removeClass('icon-jia').addClass('icon-jian');
  269. var _parenttr = $(this).parents('tr');
  270. var _commonid = $(this).attr('data-comminid');
  271. var _div = _parenttr.next().find('.dssc-goods-sku');
  272. if (_div.html() == '') {
  273. $.getJSON('{:url("Goods/get_goods_list_ajax")}' , {commonid : _commonid}, function(date){
  274. if (date != 'false') {
  275. var _ul = $('<ul class="dssc-goods-sku-list"></ul>');
  276. var res = eval('(' + date + ')');
  277. for (var i = 0; i < res.length; i++)
  278. {
  279. $('<li><div class="goods-thumb" title="{$Think.lang.goods_serial}:' + res[i].goods_serial + '"><a href="' + res[i].url + '" target="_blank"><image src="' + res[i].goods_image + '" ></a></div>' + res[i].goods_spec + '<div class="goods-price">{$Think.lang.goods_price}:<em title="¥' + res[i].goods_price + '">¥' + res[i].goods_price + '</em></div><div class="goods-storage">{$Think.lang.goods_storage}:<em title="' + res[i].goods_storage + '">' + res[i].goods_storage + '</em></div><a href="' + res[i].url + '" target="_blank" class="dssc-btn-mini">{$Think.lang.show_goods_detail}</a></li>').appendTo(_ul);
  280. _ul.appendTo(_div);
  281. _parenttr.next().show();
  282. }
  283. // 计算div的宽度
  284. _div.css('width', document.body.clientWidth-54);
  285. // _div.perfectScrollbar();
  286. }
  287. });
  288. } else {
  289. _parenttr.next().show()
  290. }
  291. }else{
  292. $(this).attr('status', 'open');
  293. $(this).removeClass('icon-jian').addClass('icon-jia');
  294. $(this).parents('tr').next().hide();
  295. }
  296. }
  297. );
  298. });
  299. // 获得选中ID
  300. function getItems() {
  301. /* 获取选中的项 */
  302. var items = '';
  303. $('.checkitem:checked').each(function () {
  304. items += this.value + ',';
  305. });
  306. if (items != '') {
  307. items = items.substr(0, (items.length - 1));
  308. }else{
  309. layer.alert('{$Think.lang.please_select_input}', {icon: 2})
  310. }
  311. return items;
  312. }
  313. // 商品下架
  314. function goods_lockup(ids_str) {
  315. _uri = ADMINSITEURL+"/Goods/goods_lockup?commonid=" + ids_str;
  316. dsLayerOpen(_uri,'{$Think.lang.goods_index_lock_reason}','400px','500px');
  317. }
  318. // 商品审核
  319. function goods_verify(ids_str) {
  320. _uri = ADMINSITEURL+"/Goods/goods_verify?commonid=" + ids_str;
  321. dsLayerOpen(_uri,'{$Think.lang.goods_verify}','400px','200px');
  322. }
  323. function submit_delete(ids_str){
  324. _uri = ADMINSITEURL+"/Goods/goods_del.html?common_id=" + ids_str;
  325. dsLayerConfirm(_uri,'{$Think.lang.ds_ensure_del}');
  326. }
  327. </script>
  328. {include file="public/footer" /}