addgoods.html 163 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <?php $shoname_name = D('Home/Front')->get_config_by_name('shoname'); ?>
  6. <title><?php echo $shoname; ?></title>
  7. <link rel="shortcut icon" href="" />
  8. <meta name="renderer" content="webkit">
  9. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  10. <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  11. <link rel="stylesheet" href="/layuiadmin/style/admin.css" media="all">
  12. <!-- 让IE8/9支持媒体查询,从而兼容栅格 -->
  13. <!--[if lt IE 9]>
  14. <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
  15. <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
  16. <![endif]-->
  17. <link href="./resource/css/bootstrap.min.css?v=201903260001" rel="stylesheet">
  18. <link href="./resource/css/common.css?v=201903260001" rel="stylesheet">
  19. <script type="text/javascript">
  20. window.sysinfo = {
  21. <?php if (!empty($_W['uniacid']) ){ ?>'uniacid': '{$_W['uniacid']}',<?php } ?>
  22. <?php if( !empty($_W['acid']) ){ ?>'acid': '{$_W['acid']}',<?php } ?>
  23. <?php if (!empty($_W['openid']) ) { ?>'openid': '{$_W['openid']}',<?php } ?>
  24. <?php if( !empty($_W['uid']) ) { ?>'uid': '{$_W['uid']}',<?php } ?>
  25. 'isfounder': <?php if (!empty($_W['isfounder']) ) { ?>1<?php }else{ ?>0<?php } ?>,
  26. 'siteroot': '{$_W['siteroot']}',
  27. 'siteurl': '{$_W['siteurl']}',
  28. 'attachurl': '{$_W['attachurl']}',
  29. 'attachurl_local': '{$_W['attachurl_local']}',
  30. 'attachurl_remote': '{$_W['attachurl_remote']}',
  31. 'module' : {'url' : '<?php if( defined('MODULE_URL') ) { ?>{MODULE_URL}<?php } ?>', 'name' : '<?php if (defined('IN_MODULE') ) { ?>{IN_MODULE}<?php } ?>'},
  32. 'cookie' : {'pre': ''},
  33. 'account' : {:json_encode($_W['account'])},
  34. };
  35. </script>
  36. <script type="text/javascript" src="./resource/js/lib/jquery-1.11.1.min.js"></script>
  37. <script type="text/javascript" src="./resource/js/lib/bootstrap.min.js"></script>
  38. <script type="text/javascript" src="./resource/js/app/util.js?v=201903260001"></script>
  39. <script type="text/javascript" src="./resource/js/app/common.min.js?v=201903260001"></script>
  40. <script type="text/javascript" src="./resource/js/require.js?v=201903260001"></script>
  41. <link rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all">
  42. <link href="/static/css/snailfish.css" rel="stylesheet">
  43. <script type="text/javascript" src="/static/js/dist/area/cascade.js"></script>
  44. <script type="text/javascript" src="/static/js/dist/select2/select2.min.js"></script>
  45. <link rel="stylesheet" href="/static/js/dist/select2/select2-bootstrap.css">
  46. <link rel="stylesheet" href="/static/js/dist/select2/select2.css">
  47. <script type="text/javascript" src="/web/resource/js/lib/moment.js"></script>
  48. <link rel="stylesheet" href="/web/resource/components/datetimepicker/jquery.datetimepicker.css">
  49. <link rel="stylesheet" href="/web/resource/components/daterangepicker/daterangepicker.css">
  50. <style type='text/css'>
  51. .tabs-container .layui-form-item {overflow: hidden;}
  52. .tabs-container .tabs-left > .nav-tabs {}
  53. .tab-goods .nav li {float:left;}
  54. .spec_item_thumb {position: relative; width: 30px; height: 20px; padding: 0; border-left: none;}
  55. .spec_item_thumb i {position: absolute; top: -5px; right: -5px;}
  56. .input-group .spec_item_thumb{padding:0px;}
  57. .multi-img-details, .multi-audio-details {margin-top:.5em;max-width: 700px; padding:0; }
  58. .multi-audio-details .multi-audio-item {width:155px; height: 40px; position:relative; float: left; margin-right: 5px;}
  59. .region-goods-details {
  60. background: #f8f8f8;
  61. margin-bottom: 10px;
  62. padding: 0 10px;
  63. }
  64. .region-goods-left{
  65. text-align: center;
  66. font-weight: bold;
  67. color: #333;
  68. font-size: 14px;
  69. padding: 20px 0;
  70. }
  71. .region-goods-right{
  72. border-left: 3px solid #fff;
  73. padding: 10px 10px;
  74. }
  75. .input-group .input-group-btn .btn:hover{background-color:#5bc0de}
  76. .layui-form-select{display:none;}
  77. .daterangepicker select.ampmselect, .daterangepicker select.hourselect, .daterangepicker select.minuteselect {
  78. width: auto!important;
  79. }
  80. .input-group .input-group-addon{}
  81. .fa-arrows{display:none;}
  82. .spec_item_thumb img{min-height:20px;}
  83. .choose_room_title{position: absolute;top: 0px;left: -90px;font-size: 14px;}
  84. </style>
  85. </head>
  86. <body layadmin-themealias="default">
  87. <div class="layui-fluid">
  88. <div class="layui-card">
  89. <div class="layui-card-header layui-elem-quote">当前位置:<span class="line-text"><?php if( !empty($item['id'])){ ?>编辑<?php }else{ ?>添加<?php } ?>商品 <small><?php if( !empty($item['id'])){ ?>修改【<span class="text-info">{$item['goodsname']}</span>】<?php } ?></small></span></div>
  90. <div class="layui-card-body" style="padding:15px;">
  91. <form action="" method="post" class="layui-form" lay-filter="component-layui-form-item" enctype="multipart/form-data" >
  92. <input type="hidden" name="goods_id" id="goods_id" value="{$id}"/>
  93. <input type="hidden" name="head_id_arr" id="head_id_arr" value="{$head_id_arr}"/>
  94. <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
  95. <ul class="layui-tab-title">
  96. <li <?php if( empty($_GPC['tab']) || $_GPC['tab']=='basic'){ ?>class="layui-this"<?php } ?>>基本信息</li>
  97. <li <?php if( $_GPC['tab']=='option'){ ?>class="layui-this"<?php } ?> >规格库存</li>
  98. <li <?php if( $_GPC['tab']=='des'){ ?>class="layui-this"<?php } ?> >商品详情</li>
  99. <?php $commiss_level = D('Home/Front')->get_config_by_name('commiss_level'); ?>
  100. <li <?php if( $_GPC['tab']=='community_head_level'){ ?>class="layui-this"<?php } ?> >等级/分销</li>
  101. <?php if( !empty($is_open_goods_relative_goods) && $is_open_goods_relative_goods == 1 ){ ?>
  102. <li <?php if( $_GPC['tab']=='goods_relative_goods'){ ?>class="layui-this"<?php } ?> >推荐商品</li>
  103. <?php } ?>
  104. <?php if (!defined('ROLE')) { ?>
  105. <?php if($isopen_localtown_delivery == 1){ ?>
  106. <li <?php if( $_GPC['tab']=='goods_distribution'){ ?>class="layui-this"<?php } ?> >同城配送</li>
  107. <?php $open_goods_distribution = 1 ?>
  108. <?php } ?>
  109. <?php } ?>
  110. <?php if (defined('ROLE') && ROLE == 'agenter' ){ ?>
  111. <?php if($isopen_localtown_delivery == 1 && $supply_is_open_localtown_distribution == 1){ ?>
  112. <li <?php if( $_GPC['tab']=='goods_distribution'){ ?>class="layui-this"<?php } ?> >同城配送</li>
  113. <?php $open_goods_distribution = 1 ?>
  114. <?php }?>
  115. <?php }?>
  116. <li <?php if( $_GPC['tab']=='hexiao'){ ?>class="layui-this"<?php } ?> >到店核销</li>
  117. </ul>
  118. <div class="layui-tab-content" >
  119. <div class="layui-tab-item <?php if( empty($_GPC['tab']) || $_GPC['tab']=='basic'){ ?>layui-show<?php } ?>" >
  120. <!---- 基本信息begin --->
  121. <div class="region-goods-details layui-row">
  122. <div class="layui-form-item">
  123. <div class="layui-form-item" style="padding-top:10px;">
  124. <label class="layui-form-label must">商品名称<label style="color:red;font-size:16px;font-weight:900">*</label></label>
  125. <div class="layui-input-block" style="padding-right:0;" >
  126. <input type="text" name="goodsname" id="goodsname" class="form-control" value="{$item['goodsname']}" data-rule-required="true" />
  127. </div>
  128. </div>
  129. <div class="layui-form-item" style="display:none;">
  130. <label class="layui-form-label">商品分类</label>
  131. <div class="layui-input-block">
  132. <select id="cates" multiple="multiple" name='cates[]' class="form-control select2" >
  133. <?php foreach( $category as $c ){ ?>
  134. <option value="{$c['id']}" <?php if( is_array($item['cates']) && in_array($c['id'],$item['cates'])){ ?>selected<?php } ?> >{$c['name']}</option>
  135. <?php } ?>
  136. </select>
  137. </div>
  138. </div>
  139. <div class="layui-form-item">
  140. <label class="layui-form-label">商品简介</label>
  141. <div class="layui-input-block">
  142. <textarea name="subtitle" id="subtitle" rows="5" class="form-control" data-parent=".subtitle" maxlength="100" data-rule-maxlength="100">{$item['subtitle']}</textarea>
  143. <div class="layui-form-mid layui-word-aux">商品名称下方的副标题,标题长度请控制在100字以内</div>
  144. </div>
  145. </div>
  146. <div class="layui-form-item" style="display:none;">
  147. <label class="layui-form-label">默认商品预达简介</label>
  148. <div class="layui-input-block ">
  149. <input type="checkbox" lay-skin="primary" name="is_show_arrive" class="form-control valid" <?php if( empty($item) || $item['is_show_arrive'] ==1 || !isset($item['is_show_arrive']) ){ ?>checked<?php } ?> value="1" title="展示预达时间" />
  150. <br/>
  151. <div class="layui-form-mid layui-word-aux">“商品预达简介”为商品名称下方的“预计送达时间”。例如:"现在下单 预计(12点前下单,预计当天送达)可自提" 默认开启,关闭后不进行显示。</div>
  152. </div>
  153. </div>
  154. <div class="layui-form-item" style="display:none;">
  155. <label class="layui-form-label">商品自定义预达简介</label>
  156. <div class="layui-input-block">
  157. <label class="radio-inline"><input type="radio" name="diy_arrive_switch" value="0" <?php if( !isset($item['diy_arrive_switch']) || $item['diy_arrive_switch'] == 0 ){ ?>checked="true"<?php } ?> title="关闭" /> </label>
  158. <label class="radio-inline"><input type="radio" name="diy_arrive_switch" value="1" <?php if( isset($item['diy_arrive_switch']) && $item['diy_arrive_switch'] == 1 ){ ?>checked="true"<?php } ?> title="开启" /> </label>
  159. <div class="layui-form-mid layui-word-aux">“商品自定义预达简介”为商品名称下方“预计送达时间”,配合“商品预达简介”使用默认关闭状态,在“商品预达简介”描述不精确的情况下建议使用此项,如果使用此项建议关闭“商品预达简介”。</div>
  160. </div>
  161. </div>
  162. <div class="layui-form-item" style="display:none;">
  163. <label class="layui-form-label"></label>
  164. <div class="layui-input-block">
  165. <textarea name="diy_arrive_details" id="diy_arrive_details" rows="3" class="form-control" maxlength="35" data-rule-maxlength="35">{$item['diy_arrive_details']}</textarea>
  166. <div class="layui-form-mid layui-word-aux">文字的长度请控制在35字以内</div>
  167. </div>
  168. </div>
  169. <div class="layui-form-item">
  170. <label class="layui-form-label">商品简短标题</label>
  171. <div class="layui-input-block">
  172. <input type="text" name="print_sub_title" id="print_sub_title" class="form-control" value="{$item['print_sub_title']}" />
  173. <div class="layui-form-mid layui-word-aux">小票打印机使用,请控制字数,未填写默认截取商品标题(无须打印的可以不填写)</div>
  174. </div>
  175. </div>
  176. <div class="layui-form-item">
  177. <label class="layui-form-label must">商品视频</label>
  178. <div class="layui-input-block gimgs">
  179. {:tpl_form_field_video('video',$item['video'] );}
  180. <span class="layui-form-mid layui-word-aux image-block">
  181. 请输入视频链接地址或者选择上传视频(支持抖音视频地址)
  182. </span>
  183. </div>
  184. </div>
  185. <div class="layui-form-item">
  186. <label class="layui-form-label must">首页商品(大图)</label>
  187. <div class="layui-input-block gimgs">
  188. {:tpl_form_field_image2('big_img',$item['big_img'])}
  189. <span class="layui-form-mid layui-word-aux image-block">此图为首页商品大图模式封面图,最佳尺寸:710*400</span>
  190. </div>
  191. </div>
  192. <div class="layui-form-item">
  193. <label class="layui-form-label must">商品图片<label style="color:red;font-size:16px;font-weight:900">*</label></label>
  194. <div class="layui-input-block gimgs" id="gimgs_mult">
  195. {:tpl_form_field_multi_image3('thumbs',$item['piclist'])}
  196. <span class="layui-form-mid layui-word-aux image-block">商品详情页主图(轮播图),第一张为商品列表调用图,<span style="color: red;">图片类型必须为jpg或者png24,不支持png8</span>,建议为正方型,尺寸建议宽度为640,并保持图片大小一致,可拖拽改变图片顺序</span>
  197. </div>
  198. </div>
  199. <div class="layui-form-item">
  200. <label class="layui-form-label">分享标题</label>
  201. <div class="layui-input-block">
  202. <input type="text" name="share_title" class="form-control" value="{$item['share_title']}" />
  203. <div class="layui-form-mid layui-word-aux"></div>
  204. </div>
  205. </div>
  206. <div class="layui-form-item">
  207. <label class="layui-form-label ">分享图片</label>
  208. <div class="layui-input-block gimgs">
  209. {:tpl_form_field_image2('goods_share_image',$item['goods_share_image'])}
  210. <span class="layui-form-mid layui-word-aux image-block">此图为商品详情页分享图片(比例为长宽比5:4)</span>
  211. </div>
  212. </div>
  213. <div class="layui-form-item">
  214. <label class="layui-form-label">起售数量</label>
  215. <div class="layui-input-block">
  216. <div style="float: left;height: 35px;line-height:35px">商品至少&nbsp;&nbsp;</div>
  217. <input style="width: 35px; height: 35px; border: 2px white; float: left;" type="button" value="-" onclick="reduction(this)"/>
  218. <input type="text" name="goods_start_count" class="layui-input goods_start_count" value="<?php if( isset($item['goods_start_count']) && !empty($item['goods_start_count'])){echo $item['goods_start_count'];}else{echo '1';} ?>" maxlength="10" style="width: 100px;float: left;" onchange="validationNumber(this, 0)"/>
  219. <input style="width: 35px; height: 35px; border: 2px white;float: left;" type="button" value="+" onclick="add(this)"/>
  220. <div style="float: left;height: 35px;line-height:35px">&nbsp;&nbsp;件起售</div>
  221. <br/>
  222. <div style="clear:both;"></div>
  223. <span class="layui-form-mid layui-word-aux image-block">起售数量超出商品库存时,买家无法购买该商品</span>
  224. </div>
  225. </div>
  226. <?php if($is_updown){ ?>
  227. <div class="layui-form-item">
  228. <label class="layui-form-label">商品状态</label>
  229. <div class="layui-input-block">
  230. <label class="radio-inline"><input type="radio" name="grounding" value="1" <?php if( !isset($item['grounding']) || $item['grounding'] == 1){ ?>checked="true"<?php } ?> title="上架" /> </label>
  231. <label class="radio-inline"><input type="radio" name="grounding" value="0" <?php if( isset($item['grounding']) && $item['grounding'] == 0){ ?>checked="true"<?php } ?> title="下架" /> </label>
  232. </div>
  233. </div>
  234. <?php } ?>
  235. <?php if($is_index){ ?>
  236. <div class="layui-form-item">
  237. <label class="layui-form-label">首页推荐</label>
  238. <div class="layui-input-block">
  239. <label class="radio-inline"><input type="radio" name="is_index_show" value="1" <?php if( !isset($item['is_index_show']) || $item['is_index_show'] == 1){ ?>checked="true"<?php } ?> title="是" /> </label>
  240. <label class="radio-inline"><input type="radio" name="is_index_show" value="0" <?php if( isset($item['is_index_show']) && $item['is_index_show'] == 0){ ?>checked="true"<?php } ?> title="否" /> </label>
  241. </div>
  242. </div>
  243. <?php } ?>
  244. <div class="layui-form-item" style="display:none;">
  245. <label class="layui-form-label">分享描述</label>
  246. <div class="layui-input-block">
  247. <input type="text" name="share_description" class="form-control" value="{$item['share_description']}" />
  248. <div class="layui-form-mid layui-word-aux">公众号才有的,小程序没有这个描述</div>
  249. </div>
  250. </div>
  251. <div class="layui-form-item price" >
  252. <label class="layui-form-label">售价<label style="color:red;font-size:16px;font-weight:900">*</label></label>
  253. <div class="layui-input-block">
  254. <div class="input-group">
  255. <input type="text" name="price" id="price" class="form-control" value="{$item['price']}" <?php if($item['hasoption']!=1){ ?> <?php } ?> />
  256. <span class="input-group-addon">元&nbsp;</span>
  257. <span class="input-group-addon">原价(市场价、划线价)</span>
  258. <input type="text" name="productprice" id="productprice" class="form-control" value="{$item['productprice']}" />
  259. <span class="input-group-addon">元&nbsp;</span>
  260. <span class="input-group-addon"> 成本价</span>
  261. <input type="text" name="costprice" id="costpriceprice" class="form-control" value="{$item['costprice']}" placeholder=""/>
  262. <span class="input-group-addon">元&nbsp;</span>
  263. </div>
  264. <span class='layui-form-mid layui-word-aux' style="display:none;">如未启用商品规格,请填写商品价格</span>
  265. </div>
  266. </div>
  267. <?php if( !empty($is_open_vipcard_buy) && $is_open_vipcard_buy == 1 && false){ ?>
  268. <div class="layui-form-item" >
  269. <label class="layui-form-label">付费会员专享价</label>
  270. <div class="col-sm-10 col-xs-12" style="width: 600px;">
  271. <div class="radio-inline">
  272. <input type="checkbox" lay-skin="primary" lay-filter="is_take_vipcard" name="is_take_vipcard" <?php if( isset($item['is_take_vipcard']) && $item['is_take_vipcard'] ==1 ){ ?> checked <?php } ?> value="1" />
  273. <div class="input-group card_price_txt" style="width:500px;float: right; <?php if( isset($item['is_take_vipcard']) && $item['is_take_vipcard'] ==1 ){ ?><?php }else{?>display: none;<?php } ?>">
  274. <span class="input-group-addon">商品付费会员价</span>
  275. <input type="text" name="card_price" id="card_price" style="width: 360px;" class="form-control" value="{$item['card_price']}" placeholder="请填写会员价"/>
  276. <span class="input-group-addon" style="width: auto;">元&nbsp;</span>
  277. </div>
  278. <div style="clear:both;"></div>
  279. <span class="layui-form-mid layui-word-aux">开启后,付费会员下单享专属价格</span>
  280. </div>
  281. </div>
  282. </div>
  283. <?php } ?>
  284. <?php if($is_vir_count){ ?>
  285. <div class="layui-form-item" >
  286. <label class="layui-form-label">已出售数</label>
  287. <div class="layui-input-block">
  288. <div class="input-group">
  289. <input type="text" name="sales" id="sales" class="form-control" value="{$item['sales']}" />
  290. <span class="input-group-addon">备注:前台销量=虚拟销量+实际销量</span>
  291. </div>
  292. </div>
  293. </div>
  294. <?php } ?>
  295. <div class="layui-form-item" >
  296. <label class="layui-form-label">提货时间</label>
  297. <div class="col-sm-10 col-xs-12" id="radPickupDateTip">
  298. <?php $item['pick_up_type'] = isset($item['pick_up_type']) ? $item['pick_up_type'] : 1; ?>
  299. <label class="radio-inline"><input type="radio" name="pick_up_type" <?php if( !isset($item['pick_up_type']) || $item['pick_up_type'] ==0 ){ ?> checked <?php } ?> value="0" title="当日达" /><span class="fake-radio"></span></label>
  300. <label class="radio-inline"><input type="radio" name="pick_up_type" <?php if( isset($item['pick_up_type']) && $item['pick_up_type'] ==1 ){ ?> checked <?php } ?> value="1" title="次日达" /><span class="fake-radio"></span></label>
  301. <label class="radio-inline"><input type="radio" name="pick_up_type" <?php if( isset($item['pick_up_type']) && $item['pick_up_type'] ==2 ){ ?> checked <?php } ?> value="2" title="隔日达" /><span class="fake-radio"></span></label>
  302. <label class="radio-inline"><input type="radio" name="pick_up_type" <?php if( isset($item['pick_up_type']) && $item['pick_up_type'] ==3 ){ ?> checked <?php } ?> value="3" title="自定义" /><span class="fake-radio"></span></label>
  303. <input class="form-control " id="txtPickupDateTip" name="pick_up_modify" style="vertical-align: sub; <?php if( isset($item['pick_up_type']) && $item['pick_up_type'] ==3){ ?>display:inline-block;<?php }else{ ?>display: none;<?php } ?>width: 120px;" type="text" value="{$item['pick_up_modify']}">
  304. <div style="clear:both;"></div>
  305. <span class="layui-form-mid layui-word-aux">系统会根据当前日期自动生成具体提货时间,或直接显示自定义内容</span>
  306. </div>
  307. </div>
  308. <div class="layui-form-item" style="display:none;">
  309. <label class="layui-form-label"></label>
  310. <div class="layui-input-block">
  311. <label class="checkbox-inline"><input type="checkbox" name="showsales" value="1" <?php if( $item['showsales'] == 1){ ?>checked="true"<?php } ?> /> 显示销量</label>
  312. <span class="layui-form-mid layui-word-aux"></span>
  313. </div>
  314. </div>
  315. <div class="layui-form-item" style="display:none;">
  316. <label class="layui-form-label">标签</label>
  317. <div class="layui-input-block">
  318. <label class="checkbox-inline"><input type="checkbox" name="quality" value="1" <?php if( !empty($item['quality'])){ ?>checked="true"<?php } ?> /> 正品保证</label>
  319. <label class="checkbox-inline"><input type="checkbox" name="seven" value="1" <?php if( !empty($item['seven'])){ ?>checked="true"<?php } ?> /> 7天无理由退换</label>
  320. <label class="checkbox-inline"><input type="checkbox" name="repair" value="1" <?php if( !empty($item['repair'])){ ?>checked="true"<?php } ?> /> 保修</label>
  321. </div>
  322. </div>
  323. <div class="layui-form-item">
  324. <label class="layui-form-label">自定义标签</label>
  325. <div class="layui-input-block">
  326. <div class="input-group " style="margin: 0;">
  327. <input type="text" disabled value="{$item['label']['id']}" class="form-control valid" name="labelname" placeholder="" id="label_id">
  328. <span class="input-group-btn">
  329. <span data-input="#label_id" id="chose_label_id" class="btn btn-default">选择标签</span>
  330. </span>
  331. </div>
  332. <?php if( $item['label']){ ?>
  333. <div class="input-group " style="margin: 0;">
  334. <div class="layadmin-text-center choose_user">
  335. <div class="" style="">{$item['label']['tagname']}</div>
  336. <button type="button" class="layui-btn layui-btn-sm" onclick="cancle_bind(this,'label_id')"><i class="layui-icon">&#xe640;</i></button>
  337. </div>
  338. </div>
  339. <?php } ?>
  340. </div>
  341. </div>
  342. <?php if($is_open_only_express == 1){ ?>
  343. <div class="layui-form-item" >
  344. <label class="layui-form-label">仅快递</label>
  345. <div class="col-sm-10 col-xs-12" >
  346. <input type="checkbox" lay-skin="primary" lay-filter="is_only_express" id="is_only_express" name="is_only_express" <?php if(isset($item['is_only_express']) && $item['is_only_express'] ==1 ){ ?> checked <?php } ?> value="1" />
  347. <div style="clear:both;"></div>
  348. <span class="layui-form-mid layui-word-aux">勾选后该商品会在购物车中显示快递配送,所有仅快递的商品单独结算,订单提交页只有快递配送方式<br />
  349. <font color="red">勾选后,此商品为仅快递商品。会自动取消同城配送和到店核销的勾选</font>
  350. </span>
  351. <!--
  352. <span class="layui-form-mid layui-word-aux">开启仅快递后,该商品只会快递商品一起下单<br/>
  353. <font color="red">用户开启仅快递的时候,该商品只能快递配送。</font><br/>
  354. <font color="red">其他配送服务失效。</font><br/>
  355. <font color="red">购物车中,只能和快递商品一起结算。</font><br/>
  356. </span>-->
  357. </div>
  358. </div>
  359. <?php } ?>
  360. <div class="layui-form-item dispatch_info">
  361. <label class="layui-form-label">运费设置</label>
  362. <div class="layui-input-block" style='padding-left:0'>
  363. <div class="input-group">
  364. <span class='input-group-addon' style='border:none;padding:0px;'><label class="radio-inline" style='margin-top:-7px;' ><input type="radio" name="dispatchtype" value="0" <?php if( empty($item['dispatchtype'])){ ?>checked="true"<?php } ?> title="运费模板" /> </label></span>
  365. <select class="form-control tpl-category-parent select2" id="dispatchid" name="dispatchid">
  366. <?php foreach( $dispatch_data as $dispatch_item ){ ?>
  367. <option value="{$dispatch_item['id']}" <?php if( $item['dispatchid'] == $dispatch_item['id']){ ?>selected="true"<?php } ?>>{$dispatch_item['name']}</option>
  368. <?php } ?>
  369. </select>
  370. </div>
  371. </div>
  372. </div>
  373. <div class="layui-form-item dispatch_info">
  374. <label class="layui-form-label"></label>
  375. <div class="layui-input-block" style='padding-left:0'>
  376. <div class="input-group">
  377. <span class='input-group-addon' style='border:none;padding:0px;'><label class="radio-inline" style='margin-top:-7px;' >
  378. <input type="radio"name="dispatchtype" value="1" <?php if( $item['dispatchtype'] == 1){ ?>checked="true"<?php } ?> title="统一邮费" /> </label></span>
  379. <input type="text" name="dispatchprice" id="dispatchprice" class="form-control" value="{$item['dispatchprice']}" />
  380. <span class="input-group-addon">元</span>
  381. </div>
  382. </div>
  383. </div>
  384. <?php
  385. $is_show_fullre = true;
  386. if (defined('ROLE') && ROLE == 'agenter' ) {
  387. $supper_info = get_agent_logininfo();
  388. if($supper_info['type'] == 1)
  389. {
  390. $is_show_fullre = false;
  391. }
  392. }
  393. ?>
  394. <?php if( $is_show_fullre && !empty($is_open_fullreduction) && $is_open_fullreduction == 1){ ?>
  395. <div class="layui-form-item" style="display:none;" >
  396. <label class="layui-form-label">满减活动</label>
  397. <div class="col-sm-10 col-xs-12">
  398. <label class="radio-inline"><input type="radio" name="is_take_fullreduction" <?php if( !isset($item['is_take_fullreduction']) || $item['is_take_fullreduction'] ==1 ){ ?> checked <?php } ?> value="1" title="参与" /><span class="fake-radio"></span></label>
  399. <label class="radio-inline"><input type="radio" name="is_take_fullreduction" <?php if( isset($item['is_take_fullreduction']) && $item['is_take_fullreduction'] ==0 ){ ?> checked <?php } ?> value="0" title="不参与" /><span class="fake-radio"></span></label>
  400. <div style="color:red;margin-left: 25px;">独立供应商不参与平台满减活动</div>
  401. </div>
  402. </div>
  403. <?php } ?>
  404. <?php if($open_buy_send_score == 1){ ?>
  405. <?php if($supply_can_goods_sendscore == 1){ ?>
  406. <div class="layui-form-item" >
  407. <label class="layui-form-label">下单送积分</label>
  408. <div class="col-sm-10 col-xs-12" id="send_score_div">
  409. <input type="checkbox" lay-filter="is_modify_sendscore" lay-skin="primary" name="is_modify_sendscore" <?php if(isset($item['is_modify_sendscore']) && $item['is_modify_sendscore'] ==1){ ?> checked <?php } ?> value="1" />
  410. <input class="form-control " id="send_score_divTip" name="send_socre" style="vertical-align: sub; <?php if(isset($item['is_modify_sendscore']) && $item['is_modify_sendscore'] ==1){ ?>display:inline;<?php }else{ ?>display: none;<?php } ?>width: 120px;" type="text" value="{$item['send_socre']}" >
  411. <div id="send_score_divTip2" style=" display: inline; <?php if(isset($item['is_modify_sendscore']) && $item['is_modify_sendscore'] ==1){ ?>display:inline;<?php }else{ ?>display: none;<?php } ?>">积分</div>
  412. <div style="clear:both;"></div>
  413. <div style="color:#999">赠送数量 = 商品数量 * 下单送积分数量(未开启,则使用系统全局设置)</div>
  414. <div style="color:#999">订单结算,才送积分。订单结算时间,请看订单——订单设置——售后期设置</div>
  415. </div>
  416. </div>
  417. <?php } ?>
  418. <?php } ?>
  419. <?php if($index_sort_method == 1){ ?>
  420. <div class="layui-form-item" >
  421. <label class="layui-form-label">首页排序</label>
  422. <div class="layui-input-block">
  423. <div class="input-group">
  424. <input type="text" name="index_sort" id="index_sort" class="form-control" value="{$item['index_sort']}" />
  425. <span class="input-group-addon">备注:排序越大显示越靠前</span>
  426. </div>
  427. </div>
  428. </div>
  429. <?php } ?>
  430. </div>
  431. </div>
  432. <div class="region-goods-details ">
  433. <div class="layui-form-item">
  434. <div class="layui-form-item">
  435. <label class="layui-form-label">团购时间</label>
  436. <div class="layui-input-block">
  437. {:tpl_form_field_daterange('time', array('starttime'=>date('Y-m-d H:i', $item['begin_time']),'endtime'=>date('Y-m-d H:i', $item['end_time'])),true);}
  438. </div>
  439. </div>
  440. </div>
  441. </div>
  442. <div class="region-goods-details ">
  443. <div class="layui-form-item">
  444. <div class="layui-form-item">
  445. <label class="layui-form-label">每天限购</label>
  446. <div class="layui-input-block">
  447. <input type="text" name="oneday_limit_count" class="form-control " value="{$item['oneday_limit_count']}" />
  448. <div class="layui-form-mid layui-word-aux">用户每天提交订单最多可购买数,默认为0表示不限制</div>
  449. </div>
  450. </div>
  451. </div>
  452. </div>
  453. <div class="region-goods-details ">
  454. <div class="layui-form-item">
  455. <div class="layui-form-item">
  456. <label class="layui-form-label">单次限购</label>
  457. <div class="layui-input-block">
  458. <input type="text" name="one_limit_count" class="form-control " value="{$item['one_limit_count']}" />
  459. <div class="layui-form-mid layui-word-aux">用户单次提交订单最多可购买数,默认为0表示不限制</div>
  460. </div>
  461. </div>
  462. <div class="layui-form-item">
  463. <label class="layui-form-label">历史限购</label>
  464. <div class="layui-input-block">
  465. <input type="text" name="total_limit_count" class="form-control" value="{$item['total_limit_count']}" />
  466. <div class="layui-form-mid layui-word-aux">用户历史累积最多可购买数,默认为0表示不限制</div>
  467. </div>
  468. </div>
  469. </div>
  470. </div>
  471. <div class="region-goods-details ">
  472. <div class="layui-form-item">
  473. <div class="layui-form-item">
  474. <label class="layui-form-label">预售方式</label>
  475. <div class="layui-input-block">
  476. <label class="radio-inline"><input type="radio" lay-filter="presale_type" class="radio_sale" name="presale_type" value="0" <?php if( !isset($item['presale_type']) || $item['presale_type'] == 0){ ?>checked="true"<?php } ?> title="定金" /> </label>
  477. <label class="radio-inline"><input type="radio" lay-filter="presale_type" class="radio_sale" name="presale_type" value="1" <?php if( isset($item['presale_type']) && $item['presale_type'] == 1){ ?>checked="true"<?php } ?> title="全款" /> </label>
  478. <br />
  479. <div class="layui-form-mid layui-word-aux">定金预售的付款方式是“商品定金+商品尾款”,全款预售的付款方式是“商品全款”</div>
  480. </div>
  481. </div>
  482. <div id="presale_ding_money" class="layui-form-item" <?php if( !isset($item['presale_type']) || $item['presale_type'] == 0){ ?><?php }else{ ?>style="display:none;"<?php } ?>>
  483. <label class="layui-form-label">定金金额</label>
  484. <div class="layui-input-block">
  485. <div class="input-group" style="width:600px;">
  486. <input type="text" name="presale_ding_money" class="form-control valid" value="{$item['presale_ding_money']}" />
  487. <span class="input-group-addon">元 </span>
  488. </div>
  489. <div class="layui-form-mid layui-word-aux">定金金额不能大于商品价格</div>
  490. </div>
  491. </div>
  492. <div class="layui-form-item" >
  493. <label class="layui-form-label">定金支付时间</label>
  494. <div class="layui-input-block">
  495. {:tpl_form_field_daterange('presale_ding_time', array('starttime'=>date('Y-m-d H:i', $item['presale_ding_time_start']),'endtime'=>date('Y-m-d H:i', $item['presale_ding_time_end'])),true);}
  496. </div>
  497. </div>
  498. <div class="layui-form-item" id="presale_limit_balancepaytime" <?php if( !isset($item['presale_type']) || $item['presale_type'] == 0){ ?><?php }else{ ?>style="display:none;"<?php } ?>>
  499. <label class="layui-form-label">限制尾款支付时间</label>
  500. <div class="layui-input-block">
  501. <label class="radio-inline"><input type="radio" lay-filter="presale_limit_balancepaytime" class="presale_limit_balancepaytime" name="presale_limit_balancepaytime" value="0" <?php if( !isset($item['presale_limit_balancepaytime']) || $item['presale_limit_balancepaytime'] == 0){ ?>checked="true"<?php } ?> title="不限制" /> </label>
  502. <label class="radio-inline"><input type="radio" lay-filter="presale_limit_balancepaytime" class="presale_limit_balancepaytime" name="presale_limit_balancepaytime" value="1" <?php if( isset($item['presale_limit_balancepaytime']) && $item['presale_limit_balancepaytime'] == 1){ ?>checked="true"<?php } ?> title="限制" /> </label>
  503. </div>
  504. </div>
  505. <div id="presale_balance_paytime" class="layui-form-item" <?php if( ( !isset($item['presale_type']) || $item['presale_type'] == 0) && isset($item['presale_limit_balancepaytime']) && $item['presale_limit_balancepaytime'] == 1){ ?><?php }else{ ?>style="display:none;"<?php } ?>>
  506. <label class="layui-form-label">&nbsp;</label>
  507. <div class="layui-input-block">
  508. <div class="input-group" style="width:600px;">
  509. <input type="text" name="presale_balance_paytime" class="form-control valid" value="{$item['presale_balance_paytime']}" />
  510. <span class="input-group-addon">天内 </span>
  511. </div>
  512. <div class="layui-form-mid layui-word-aux">
  513. 定金支付时间结束以后(定金时间即为活动时间),开始尾款支付,用户期限内未支付尾款,<br/>
  514. 尾款支付时间结束订单为失效状态(例如:定金支付时间为:2020-01-01 00:00 至 2020-01-05 00:00 <br/>
  515. 尾款支付时间 5 天,尾款支付时间就是 2020-01-05 00:00 - 2020-01-10 00:00)
  516. </div>
  517. </div>
  518. </div>
  519. <div class="layui-form-item" >
  520. <label class="layui-form-label">预计发货时间</label>
  521. <div class="layui-input-block">
  522. <label class="radio-inline"><input type="radio" lay-filter="presale_sendorder_type" class="presale_sendorder_type" name="presale_sendorder_type" value="0" <?php if( !isset($item['presale_sendorder_type']) || $item['presale_sendorder_type'] == 0){ ?>checked="true"<?php } ?> title="固定日期" /> </label>
  523. <label class="radio-inline"><input type="radio" lay-filter="presale_sendorder_type" class="presale_sendorder_type" name="presale_sendorder_type" value="1" <?php if( isset($item['presale_sendorder_type']) && $item['presale_sendorder_type'] == 1){ ?>checked="true"<?php } ?> title="购买后几日发货" /> </label>
  524. </div>
  525. </div>
  526. <div id="presale_sendorder_datetime" class="layui-form-item" <?php if( !isset($item['presale_sendorder_type']) || $item['presale_sendorder_type'] == 0){ ?><?php }else{ ?>style="display:none;"<?php } ?>>
  527. <label class="layui-form-label">&nbsp;</label>
  528. <div class="layui-input-block">
  529. <div class="input-group" style="width:600px;">
  530. {:tpl_form_field_date('presale_sendorder_datetime', date('Y-m-d H:i', empty($item['presale_sendorder_datetime']) ? (time() + 3 * 86400):$item['presale_sendorder_datetime']),false);}
  531. </div>
  532. <div class="layui-form-mid layui-word-aux">指定开始发货日期</div>
  533. </div>
  534. </div>
  535. <div id="presale_sendorder_afterday" class="layui-form-item" <?php if( isset($item['presale_sendorder_type']) && $item['presale_sendorder_type'] == 1){ ?><?php }else{ ?>style="display:none;"<?php } ?>>
  536. <label class="layui-form-label">&nbsp;</label>
  537. <div class="layui-input-block">
  538. <div class="input-group" style="width:600px;">
  539. <input type="text" name="presale_sendorder_afterday" class="form-control valid" value="{$item['presale_sendorder_afterday']}" />
  540. <span class="input-group-addon">天内发货 </span>
  541. </div>
  542. <div class="layui-form-mid layui-word-aux">尾款支付后几天内发货,不支持小数:例如:5.6 ,保存后变成5</div>
  543. </div>
  544. </div>
  545. </div>
  546. </div>
  547. <div class="region-goods-details ">
  548. <div class="region-goods-right col-sm-10">
  549. <?php if( empty($community_head_level) || count($community_head_level) ==1 || $is_head_takegoods ==0 ){ ?>
  550. <div class="layui-form-item">
  551. <label class="layui-form-label"></label>
  552. <div class="layui-col-sm-10 ">
  553. <input type="checkbox" id="is_community_head_commission" lay-skin="primary" value="1" name="is_community_head_commission" lay-filter="is_community_head_commission" <?php if( $item['is_community_head_commission']==1){ ?>checked<?php } ?> title="商品启用独立团长提成" />
  554. <br />
  555. <div class="layui-form-mid layui-word-aux" style="margin-left: 155px;" >勾选使用 商品独立团长提成 计算佣金,不勾选则使用 后台——“团长设置”中团长提成比例 计算佣金</div>
  556. </div>
  557. </div>
  558. <div id="head_commission_div2" <?php if( empty($item['is_community_head_commission'])){ ?>style="display:none"<?php } ?> >
  559. <div class="layui-form-item">
  560. <label class="layui-form-label">商品独立团长提成</label>
  561. <?php if( !empty($community_money_type) && $community_money_type ==1 ){ ?>
  562. <div class="layui-col-sm-10 ">
  563. <div class="input-group">
  564. <input type="text" name="community_head_commission" id="community_head_commission" class="form-control valid" value="<?php if(empty($item)){ ?>{$communityhead_commission}<?php }else{ ?>{$item['community_head_commission']}<?php } ?>" />
  565. <span class="input-group-addon">元 </span>
  566. </div>
  567. <div class="layui-form-mid layui-word-aux">预计团长可得佣金¥<font ><?php if(isset($item['community_head_commission'])){ ?>{:round( $item['community_head_commission'] ,2) }<?php }else{ ?>0.00<?php } ?></font></div>
  568. </div>
  569. <?php }else{ ?>
  570. <div class="layui-col-sm-10 ">
  571. <div class="input-group">
  572. <input type="text" name="community_head_commission" id="community_head_commission" class="form-control valid" value="<?php if( empty($item)){ ?>{$communityhead_commission}<?php }else{ ?>{$item['community_head_commission']}<?php } ?>" />
  573. <span class="input-group-addon">% </span>
  574. </div>
  575. <div class="layui-form-mid layui-word-aux">预计团长可得佣金¥<font id="precommiss_head_money_tip"><?php if( isset($item['community_head_commission'])){ ?><?php echo round( ($item['community_head_commission']*$item['price'])/100 ,2); ?><?php }else{ ?>0.00<?php } ?></font>,将根据商品最终的成交价格来计算佣金</div>
  576. </div>
  577. <?php } ?>
  578. </div>
  579. </div>
  580. <?php } ?>
  581. <!--<div class="layui-form-item">
  582. <label class="layui-form-label">所有团长可销售</label>
  583. <div class="layui-input-block ">
  584. <input type="checkbox" lay-skin="primary" name="is_all_sale" class="form-control valid" <?php if( empty($item) || $item['is_all_sale'] ==1 || !isset($item['is_all_sale'])){ ?>checked<?php } ?> value="1" />
  585. </div>
  586. </div>-->
  587. <?php if($supply_can_distribution_sale == 1){ ?>
  588. <div class="layui-form-item">
  589. <label class="layui-form-label">售卖团长</label>
  590. <div class="layui-input-block">
  591. <label class="radio-inline"><input type="radio" class="radio_sale" name="is_all_sale" value="1" <?php if( !isset($item['is_all_sale']) || $item['is_all_sale'] == 1){ ?>checked="true"<?php } ?> title="所有团长可售" /> </label>
  592. <label class="radio-inline"><input type="radio" class="radio_sale" name="is_all_sale" value="0" <?php if( isset($item['is_all_sale']) && $item['is_all_sale'] == 0){ ?>checked="true"<?php } ?> title="部分团长可售" /> </label>
  593. </div>
  594. <div class="layui-form-mid layui-word-aux" style="margin-left:15px;">选择所有团长可售,部分团长可售失效</div>
  595. </div>
  596. <?php } ?>
  597. <?php if($is_newbuy){ ?>
  598. <div class="layui-form-item">
  599. <label class="layui-form-label">新人专享</label>
  600. <div class="layui-input-block ">
  601. <input type="checkbox" id="xinrenckbox" lay-filter="xinrenckbox" lay-skin="primary" name="is_new_buy" class="form-control valid" <?php if( !empty($item) && $item['is_new_buy'] ==1 ){ ?>checked<?php } ?> value="1" />
  602. </div>
  603. <div class="layui-form-mid layui-word-aux" style="margin-left:15px;">未付款过的用户。勾选后,只在首页新人专区显示</div>
  604. </div>
  605. <?php } ?>
  606. <?php if( $seckill_is_open == 1 ){ ?>
  607. <div class="layui-form-item">
  608. <label class="layui-form-label">整点秒杀</label>
  609. <div class="layui-input-block ">
  610. <input type="checkbox" id="is_seckill" lay-filter="is_seckill" lay-skin="primary" name="is_seckill" class="form-control valid" <?php if( !empty($item) && $item['is_seckill'] ==1 ){ ?>checked<?php } ?> value="1" />
  611. </div>
  612. <div class="layui-form-mid layui-word-aux" style="margin-left:15px;">
  613. 勾选后,商品团购时间设置整点,后台——营销——整点秒杀勾选这个整点,系统会自动调用显示到“整点秒杀”方块以及该页面中。该整点开始前设置好这些,才会调用
  614. </div>
  615. </div>
  616. <?php } ?>
  617. <?php if($is_goodsspike){ ?>
  618. <div class="layui-form-item">
  619. <label class="layui-form-label">限时秒杀</label>
  620. <div class="layui-input-block ">
  621. <input type="checkbox" id="xianshickbox" lay-filter="xianshickbox" lay-skin="primary" name="is_spike_buy" class="form-control valid" <?php if(!empty($item) && $item['is_spike_buy'] ==1){ ?>checked<?php } ?> value="1" />
  622. </div>
  623. <div class="layui-form-mid layui-word-aux" style="margin-left:15px;">
  624. 勾选后,只在首页限时秒杀显示
  625. </div>
  626. </div>
  627. <?php } ?>
  628. <div class="layui-form-item">
  629. <label class="layui-form-label">限制普通会员下单</label>
  630. <div class="layui-input-block ">
  631. <input type="checkbox" lay-skin="primary" name="is_limit_levelunbuy" class="form-control valid" <?php if( !empty($item) && $item['is_limit_levelunbuy'] ==1 ){ ?>checked<?php } ?> value="1" />
  632. </div>
  633. <div class="layui-form-mid layui-word-aux" style="margin-left:15px;">
  634. 勾选后,默认等级会员不能购买此商品
  635. </div>
  636. </div>
  637. <!-- 预售暂时屏蔽 -->
  638. <div class="layui-form-item" style="display:none;">
  639. <label class="layui-form-label">付费会员专享</label>
  640. <div class="layui-input-block ">
  641. <input type="checkbox" lay-skin="primary" name="is_limit_vipmember_buy" class="form-control valid" <?php if( !empty($item) && $item['is_limit_vipmember_buy'] ==1 ){ ?>checked<?php } ?> value="1" />
  642. </div>
  643. <div class="layui-form-mid layui-word-aux" style="margin-left:15px;">
  644. 勾选后,非vip会员不能购买此商品
  645. </div>
  646. </div>
  647. </div>
  648. </div>
  649. <?php if( !defined('ROLE') ){
  650. ?>
  651. <div class="region-goods-details ">
  652. <div class="layui-form-item">
  653. <label class="layui-form-label">选择供应商</label>
  654. <div class="layui-input-block">
  655. <div class="input-group " style="margin: 0;">
  656. <input type="text" disabled value="{$item['supply_id']}" class="form-control valid" name="supply_id" placeholder="" id="member_id">
  657. <span class="input-group-btn">
  658. <span data-input="#member_id" id="chose_member_id" class="btn btn-default">选择供应商</span>
  659. </span>
  660. </div>
  661. <?php if( $item['supply_info']){ ?>
  662. <div class="input-group " style="margin: 0;">
  663. <div class="layadmin-text-center choose_user">
  664. <img style="" src="{:tomedia($item['supply_info']['logo'])}">
  665. <div class="layadmin-maillist-img" style="">{$item['supply_info']['shopname']}</div>
  666. <button type="button" class="layui-btn layui-btn-sm" onclick="cancle_bind(this,'member_id')"><i class="layui-icon">&#xe640;</i></button>
  667. </div>
  668. </div>
  669. <?php } ?>
  670. </div>
  671. </div>
  672. </div>
  673. <?php } ?>
  674. <script language="javascript">
  675. function validationNumber(e, num) {
  676. var regu = /^[\-0-9]+\.?[0-9]*$/;
  677. if (e.value != "") {
  678. if (!regu.test(e.value)) {
  679. e.value = 1;
  680. e.focus();
  681. } else {
  682. if (num == 0) {
  683. if (e.value.indexOf('.') > -1) {
  684. e.value = e.value.substring(0, e.value.length - e.value.split('.')[1].length - 1);
  685. e.focus();
  686. }
  687. }
  688. if (e.value.indexOf('.') > -1) {
  689. if (e.value.split('.')[1].length > num) {
  690. e.value = e.value.substring(0, e.value.length - e.value.split('.')[1].length - 1);
  691. e.focus();
  692. }
  693. }
  694. if(parseFloat(e.value) < 1){
  695. e.value = 1;
  696. e.focus();
  697. }
  698. }
  699. }
  700. }
  701. function reduction(obj){
  702. var goods_start_count = $.trim($('.goods_start_count').val());
  703. if(goods_start_count == ''){
  704. $('.goods_start_count').val(1);
  705. }else{
  706. var count = parseInt(goods_start_count)-1;
  707. if(count < 1){
  708. $('.goods_start_count').val(1);
  709. }else{
  710. $('.goods_start_count').val(count);
  711. }
  712. }
  713. }
  714. function add(obj){
  715. var goods_start_count = $.trim($('.goods_start_count').val());
  716. if(goods_start_count == ''){
  717. $('.goods_start_count').val(1);
  718. }else{
  719. var count = parseInt(goods_start_count)+1;
  720. $('.goods_start_count').val(count);
  721. }
  722. }
  723. $(function () {
  724. $('#price').blur(function(){
  725. var price = parseFloat( $("#price").val() );
  726. var community_head_commission = parseFloat( $("#community_head_commission").val() );
  727. if(price > 0 && community_head_commission >0)
  728. {
  729. $('#precommiss_head_money_tip').html( ( (price * community_head_commission) /100 ).toFixed(2) );
  730. }else{
  731. $('#precommiss_head_money_tip').html('0.00');
  732. }
  733. })
  734. $("#community_head_commission").blur(function(){
  735. var price = parseFloat( $("#price").val() );
  736. var community_head_commission = parseFloat( $(this).val() );
  737. if(price > 0 && community_head_commission >0)
  738. {
  739. $('#precommiss_head_money_tip').html( ( (price * community_head_commission) /100 ).toFixed(2) );
  740. }else{
  741. $('#precommiss_head_money_tip').html('0.00');
  742. }
  743. });
  744. $('#radPickupDateTip input[type=radio]').click(function(){
  745. var s_val = $(this).val();
  746. if(s_val == 3)
  747. {
  748. $('#txtPickupDateTip').css('display','inline-block');
  749. }else{
  750. $('#txtPickupDateTip').css('display', 'none');
  751. }
  752. })
  753. $("input[name=isstatustime]").off('click').on('click',function () {
  754. if($(this).val()==1){
  755. $("#shelves").show()
  756. }else{
  757. $("#shelves").hide();
  758. }
  759. })
  760. })
  761. </script>
  762. <!--- 基本信息 end -->
  763. </div>
  764. <div class="layui-tab-item <?php if( $_GPC['tab']=='option'){ ?>layui-show<?php } ?>" >
  765. <!--规格begin-->
  766. <div class="region-goods-details ">
  767. <div class="region-goods-left col-sm-2">规格库存</div>
  768. <div class="region-goods-right col-sm-10">
  769. <div class="layui-form-item">
  770. <label class="layui-form-label">商品编码</label>
  771. <div class="layui-input-block">
  772. <input type="text" name="codes" class="form-control" value="{$item['codes']}" />
  773. <div class="help-block">商品编码 用部分商家用于统计</div>
  774. </div>
  775. </div>
  776. <div class="layui-form-item">
  777. <label class="layui-form-label">重量</label>
  778. <div class="layui-input-block">
  779. <div class="input-group fixsingle-input-group">
  780. <input type="text" name="weight" id="weight" <?php if( $item['hasoption']){ ?>readonly<?php } ?> class="form-control hasoption" value="{$item['weight']}"/>
  781. <span class="input-group-addon">克</span>
  782. </div>
  783. </div>
  784. </div>
  785. <div class="layui-form-item">
  786. <label class="layui-form-label">库存<label style="color:red;font-size:16px;font-weight:900">*</label></label>
  787. <div class="layui-input-block">
  788. <input type="text" name="total" id="total" class="form-control hasoption" lay-verify="" value="{$item['total']}" style="width:150px;display: inline;margin-right: 20px;" <?php if( $item['hasoption']){ ?>readonly<?php } ?>/>
  789. <span class="help-block">商品的剩余数量, 如启用多规格,则此处设置无效.</span>
  790. </div>
  791. </div>
  792. </div>
  793. </div>
  794. <div class="region-goods-details ">
  795. <div class="region-goods-left col-sm-2">
  796. 规格
  797. </div>
  798. <div class="region-goods-right col-sm-10">
  799. <div class="layui-form-item">
  800. <div class="layui-row" style=''>
  801. <input type="checkbox" lay-skin="primary" title="启用商品规格" lay-filter="hasoption" value="1" id="hasoption" name="hasoption" <?php if( $item['hasoption']==1){ ?>checked<?php } ?> />
  802. <span class="help-block">启用商品规格后,商品的价格及库存以商品规格为准,库存设置为0则会到”已售罄“中,手机也不会显示</span>
  803. </div>
  804. </div>
  805. <div id='tboption' style="padding-left:15px;<?php if( $item['hasoption']!=1){ ?>display:none<?php } ?>" >
  806. <div class="alert alert-info" style="display:none;">
  807. 1. 拖动规格可调整规格显示顺序, 更改规格及规格项后请点击下方的【刷新规格项目表】来更新数据。<br/>
  808. 2. 每一种规格代表不同型号,例如颜色为一种规格,尺寸为一种规格,如果设置多规格,手机用户必须每一种规格都选择一个规格项,才能添加购物车或购买。
  809. </div>
  810. <div id='specs'>
  811. <?php foreach( $item['allspecs'] as $spec ){ ?>
  812. <!--spec-->
  813. <div class='spec_item spec_class_{$cur_cate_id}' id="spec_{$spec['id']}" >
  814. <div style='border:1px solid #e7eaec;padding:10px;margin-bottom: 10px;' >
  815. <input name="spec_id[]" type="hidden" class="form-control spec_id" value="{$spec['id']}"/>
  816. <div class="form-group">
  817. <div class="col-sm-12">
  818. <div class='input-group'>
  819. <input name="spec_title[{$spec['id']}]" type="text" class="form-control spec_title" value="{$spec['title']}" placeholder="规格名称 (比如: 颜色)"/>
  820. <div class='input-group-btn'>
  821. <a href="javascript:;" id="add-specitem-{$spec['id']}" specid='{$spec['id']}' class='btn btn-info add-specitem' onclick="addSpecItem('{$spec['id']}')"><i class="fa fa-plus"></i> 添加规格项</a>
  822. <a href="javascript:void(0);" class='btn btn-danger' onclick="removeSpec('{$spec['id']}')"><i class="fa fa-remove"></i></a>
  823. </div>
  824. </div>
  825. </div>
  826. </div>
  827. <div class="form-group">
  828. <div class="col-md-12">
  829. <div id='spec_item_{$spec['id']}' class='spec_item_items'>
  830. <?php foreach( $spec['items'] as $specitem ){ ?>
  831. <!--spec_item begin-->
  832. <div class="spec_item_item" style="float:left;margin:5px;width:250px; position: relative">
  833. <input type="hidden" class="form-control spec_item_show" name="spec_item_show_{$spec['id']}[]" value="{$specitem['show']}" />
  834. <input type="hidden" class="form-control spec_item_id" name="spec_item_id_{$spec['id']}[]" value="{$specitem['id']}" />
  835. <div class="input-group">
  836. <span class="input-group-addon">
  837. <input type="checkbox" lay-skin="primary" <?php if( $specitem['id']>0){ ?>checked<?php } ?> value="1" onclick='showItem(this)'>
  838. </span>
  839. <input type="text" class="form-control spec_item_title" onblur="refreshOptions()" name="spec_item_title_{$spec['id']}[]" VALUE="{$specitem['title']}" />
  840. <span class="input-group-addon spec_item_thumb <?php if( !empty($specitem['thumb'])){ ?>has_thumb<?php } ?>">
  841. <input type='hidden' name="spec_item_thumb_{$spec['id']}[]" value="{$specitem['thumb']}"
  842. />
  843. <img onclick="selectSpecItemImage(this)"
  844. src="<?php if( empty($specitem['thumb'])){ ?><?php }else{ ?>{:resize($specitem['thumb'],100)}<?php } ?>" style='width:100%;'
  845. <?php if( !empty($specitem['thumb'])){ ?>
  846. data-toggle='popover'
  847. data-html ='true'
  848. data-placement='top'
  849. data-trigger ='hover'
  850. data-content="<img src='{:tomedia($specitem['thumb'])}' style='width:100px;height:100px;' />"
  851. <?php } ?>
  852. >
  853. <i class="fa fa-times-circle" <?php if( empty($specitem['thumb'])){ ?>style="display:none"<?php } ?>></i>
  854. </span>
  855. <span class="input-group-addon">
  856. <a href="javascript:;" onclick="removeSpecItem(this)" title='删除'><i class="fa fa-times"></i></a>
  857. <a href="javascript:;" class="fa fa-arrows" title="拖动调整显示顺序" ></a>
  858. </span>
  859. </div>
  860. </div>
  861. <!--spec_item end-->
  862. <?php } ?>
  863. </div>
  864. </div>
  865. </div>
  866. </div>
  867. </div>
  868. <!--end spec-->
  869. <?php } ?>
  870. </div>
  871. <table class="table">
  872. <tr>
  873. <td>
  874. <div class="layui-form-item">
  875. <label class="col-sm-2 control-label">选择已有规格</label>
  876. <div class="col-sm-8 col-xs-12">
  877. <select id="cates2" name='options[]' class="form-control select2" style='width:605px;' multiple='' >
  878. <?php foreach( $spec_list as $c ){ ?>
  879. <option value="{$c['id']}" data-names="{$c['value_str']}">{$c['name']}</option>
  880. <?php } ?>
  881. </select>
  882. </div>
  883. </div>
  884. <td>
  885. </tr>
  886. <tr>
  887. <td>
  888. <h4>
  889. <a href="javascript:;" class='btn btn-primary' id='add-spec' onclick="addSpec()" style="margin-top:10px;margin-bottom:10px;" title="新建规格"><i class='fa fa-plus'></i> 新建规格</a>
  890. <a style="display:none;" href="javascript:;" onclick="refreshOptions();" title="刷新规格项目表" class="btn btn-primary"><i class="fa fa-refresh"></i> 刷新规格项目表</a>
  891. </h4>
  892. </td>
  893. </tr>
  894. <tr style="display: none;" >
  895. <td>
  896. <div class="alert alert-danger">警告:规格数据有变动,请重新点击上方 [刷新规格项目表] 按钮!</div>
  897. </td>
  898. </tr>
  899. </table>
  900. <div class="alert alert-info wholesalewarning" style="display:none;">
  901. </div>
  902. <div id="options" style="padding:0;">{$item['html']}</div>
  903. </div>
  904. </div>
  905. </div>
  906. <input type="hidden" name="optionArray" value=''>
  907. <input type="hidden" name="isdiscountDiscountsArray" value=''>
  908. <input type="hidden" name="discountArray" value=''>
  909. <input type="hidden" name="commissionArray" value=''>
  910. <!--规格end-->
  911. </div>
  912. <div class="layui-tab-item <?php if( $_GPC['tab']=='des'){ ?>layui-show<?php } ?>" >
  913. <div class="region-goods-details row">
  914. <div class="region-goods-left col-sm-2">商品详情</div>
  915. <div class=" region-goods-right col-sm-10">
  916. <div class="" >
  917. {:tpl_ueditor('content',htmlspecialchars_decode($item['content']),array('height'=>'300'))}
  918. </div>
  919. </div>
  920. </div>
  921. </div>
  922. <!---团长分销begin --->
  923. <div class="layui-tab-item <?php if( $_GPC['tab']=='community_head_level'){ ?>layui-show<?php } ?>" >
  924. <?php if( !empty($community_head_level) && count($community_head_level) > 1 && $is_head_takegoods == 1 ) { ?>
  925. <div class="region-goods-details row">
  926. <div class="region-goods-left col-sm-2">团长提成</div>
  927. <div class="region-goods-right col-sm-10">
  928. <div class="form-group">
  929. <label class="col-sm-2 control-label">独立规则</label>
  930. <div class="col-sm-9 col-xs-12">
  931. <input type="checkbox" id="is_modify_head_commission" lay-skin="primary" value="1" name="is_modify_head_commission" lay-filter="is_modify_head_commission" <?php if( $item['is_modify_head_commission']==1){ ?>checked<?php } ?> title="启用独立团长提成" />
  932. <span class="help-block">默认使用团长等级提成设置,启用独立团长提成设置,此商品拥有独自的团长提成比例,不受团长等级比例及默认设置限制,团长提成 = 订单有效金额 * 设置比例</span>
  933. </div>
  934. </div>
  935. <div id="head_commission_div" <?php if( empty($item['is_modify_head_commission'])){ ?>style="display:none"<?php } ?> >
  936. <?php foreach($community_head_level as $head_level){ ?>
  937. <div class="form-group">
  938. <label class="col-sm-2 control-label"><?php echo $head_level['levelname']; ?></label>
  939. <div class="col-sm-4 col-xs-12">
  940. <div class="input-group">
  941. <input type="text" name="head_level<?php echo $head_level['id']; ?>" class="form-control" value="<?php echo $item['head_level'.$head_level['id']]; ?>" />
  942. <?php if( !empty($community_money_type) && $community_money_type ==1 ){ ?>
  943. <div class="input-group-addon">元 </div>
  944. <?php }else{ ?>
  945. <div class="input-group-addon">%</div>
  946. <?php } ?>
  947. </div>
  948. </div>
  949. </div>
  950. <?php } ?>
  951. </div>
  952. </div>
  953. </div>
  954. <?php } ?>
  955. <?php if($commiss_level > 0){ ?>
  956. <div class="region-goods-details row">
  957. <div class="region-goods-left col-sm-2">会员分销</div>
  958. <div class="region-goods-right col-sm-10">
  959. <div class="form-group">
  960. <label class="col-sm-2 control-label">是否参与分销</label>
  961. <div class="col-sm-9 col-xs-12">
  962. <input type="radio" value="0" name="nocommission" <?php if($item['nocommission']==0){ ?>checked<?php } ?> title="参与分销" />
  963. <input type="radio" value="1" name="nocommission" <?php if($item['nocommission']==1){ ?>checked<?php } ?> title="不参与分销" />
  964. <span class="help-block">如果不参与分销,则不产生分销佣金</span>
  965. </div>
  966. </div>
  967. <div class="form-group">
  968. <label class="col-sm-2 control-label">独立规则</label>
  969. <div class="col-sm-9 col-xs-12">
  970. <input type="checkbox" lay-filter="hascommission" lay-skin="primary" id="hascommission" value="1" name="hascommission" <?php if($item['hascommission']==1){ ?>checked<?php } ?> title="启用独立佣金比例" />
  971. <span class="help-block">启用独立佣金设置,此商品拥有独自的佣金比例,不受分销商等级比例及默认设置限制</span>
  972. </div>
  973. </div>
  974. <div style="clear:both;"></div>
  975. <div id="commission_div" <?php if(empty($item['hascommission'])){ ?>style="display:none"<?php } ?> >
  976. <div id="commission_0" <?php if($commission_type!=0){ ?> style="display:none;" <?php } ?>>
  977. <div class='alert alert-danger'>
  978. 如果比例为空,则使用固定规则,如果都为空则无分销佣金,都填写则以比例优先
  979. </div>
  980. <?php if($set['commiss_level']>=1){ ?>
  981. <div class="form-group">
  982. <label class="col-sm-2 control-label">一级分销</label>
  983. <div class="col-sm-4 col-xs-12">
  984. <div class="input-group">
  985. <input type="text" name="commission1_rate" id="commission1_rate" class="form-control" value="{$item['commission1_rate']}" />
  986. <div class="input-group-addon">% 固定</div>
  987. <input type="text" name="commission1_pay" id="commission1_pay" class="form-control" value="{$item['commission1_pay']}" />
  988. <div class="input-group-addon">元</div>
  989. </div>
  990. </div>
  991. </div>
  992. <?php } ?>
  993. <?php if($set['commiss_level']>=2){ ?>
  994. <div class="form-group">
  995. <label class="col-sm-2 control-label">二级分销</label>
  996. <div class="col-sm-4 col-xs-12">
  997. <div class="input-group">
  998. <input type="text" name="commission2_rate" id="commission2_rate" class="form-control" value="{$item['commission2_rate']}" />
  999. <div class="input-group-addon">% 固定</div>
  1000. <input type="text" name="commission2_pay" id="commission2_pay" class="form-control" value="{$item['commission2_pay']}" />
  1001. <div class="input-group-addon">元</div>
  1002. </div>
  1003. </div>
  1004. </div>
  1005. <?php } ?>
  1006. <?php if($set['commiss_level']>=3){ ?>
  1007. <div class="form-group">
  1008. <label class="col-sm-2 control-label">三级分销</label>
  1009. <div class="col-sm-4 col-xs-12">
  1010. <div class="input-group">
  1011. <input type="text" name="commission3_rate" id="commission3_rate" class="form-control" value="{$item['commission3_rate']}" />
  1012. <div class="input-group-addon">% 固定</div>
  1013. <input type="text" name="commission3_pay" id="commission3_pay" class="form-control" value="{$item['commission3_pay']}" />
  1014. <div class="input-group-addon">元</div>
  1015. </div>
  1016. </div>
  1017. </div>
  1018. <?php } ?>
  1019. </div>
  1020. </div>
  1021. </div>
  1022. </div>
  1023. <?php } ?>
  1024. <!-- 预售暂时隐藏-->
  1025. <div class="region-goods-details row" style="display:none;">
  1026. <div class="region-goods-left col-sm-2">会员等级折扣</div>
  1027. <div class="region-goods-right col-sm-10">
  1028. <div class="form-group">
  1029. <label class="col-sm-2 control-label">是否参与会员折扣</label>
  1030. <div class="col-sm-9 col-xs-12">
  1031. <input type="radio" value="1" name="is_mb_level_buy" <?php if(!isset($item['is_mb_level_buy']) || $item['is_mb_level_buy']==1){ ?>checked<?php } ?> title="参与" />
  1032. <input type="radio" value="0" name="is_mb_level_buy" <?php if($item['is_mb_level_buy']==0){ ?>checked<?php } ?> title="不参与" />
  1033. <span class="help-block">如果不参与会员折扣,则不打折</span>
  1034. </div>
  1035. </div>
  1036. <div class="form-group">
  1037. <label class="col-sm-2 control-label">独立规则</label>
  1038. <div class="col-sm-9 col-xs-12">
  1039. <input type="checkbox" lay-filter="has_mb_level_buy" lay-skin="primary" id="has_mb_level_buy" value="1" name="has_mb_level_buy" <?php if($item['has_mb_level_buy']==1){ ?>checked<?php } ?> title="启用独立折扣比例" />
  1040. <span class="help-block">启用独立折扣设置,此商品拥有独立的会员等级折扣比例,不受会员等级折扣设置限制</span>
  1041. </div>
  1042. </div>
  1043. <div style="clear:both;"></div>
  1044. <div id="mb_level_div" <?php if(empty($item['has_mb_level_buy'])){ ?>style="display:none"<?php } ?> >
  1045. <div id="mb_level_tip">
  1046. <div class='alert alert-danger'>
  1047. 请填写1-99的<span style="color:red">整数</span>,100不打折。例如:80,打八折,该会员对应等级会员价=商品现价*80%
  1048. <?php if( empty($member_level_ist) ){ ?>
  1049. <br>
  1050. <span style="color:red">暂无会员等级,请前往会员--》会员等级 添加会员等级</span>
  1051. <?php } ?>
  1052. </div>
  1053. </div>
  1054. <?php foreach($member_level_ist as $k=>$v){?>
  1055. <div class="form-group">
  1056. <label class="col-sm-2 control-label"><?php echo $v['levelname']?></label>
  1057. <div class="col-sm-4 col-xs-4">
  1058. <div class="input-group">
  1059. <input type="hidden" name="level_id[]" class="form-control" value="<?php echo $v['id']?>" />
  1060. <input type="text" name="discount[]" class="form-control" value="<?php echo $mb_level_discount_list[$v['id']];?>" />
  1061. <div class="input-group-addon">% </div>
  1062. </div>
  1063. </div>
  1064. </div>
  1065. <?php }?>
  1066. </div>
  1067. </div>
  1068. </div>
  1069. <!--团长分销end--->
  1070. </div>
  1071. <?php if( !empty($is_open_goods_relative_goods) && $is_open_goods_relative_goods == 1 ){ ?>
  1072. <div class="layui-tab-item <?php if( $_GPC['tab']=='goods_relative_goods'){ ?>layui-show<?php } ?>" >
  1073. <div class="region-goods-details row">
  1074. <div class="region-goods-left col-sm-2">推荐商品</div>
  1075. <div class=" region-goods-right col-sm-10">
  1076. <div class="input-group " style="margin: 0;">
  1077. <input type="text" disabled value="" class="form-control valid" name="" placeholder="" id="agent_id">
  1078. <span class="input-group-btn">
  1079. <span data-input="#agent_id" id="chose_agent_id2" class="btn btn-default">选择商品</span>
  1080. </span>
  1081. </div>
  1082. <?php if(!empty($limit_goods)){ ?>
  1083. <?php foreach( $limit_goods as $goods ){ ?>
  1084. <div class="input-group mult_choose_goodsid" data-gid="{$goods['gid']}" style="border-radius: 0;float: left;margin: 10px;margin-left:0px;width: 22%;">
  1085. <div class="layadmin-text-center choose_user">
  1086. <img style="" src="{$goods['image']}">
  1087. <div class="layadmin-maillist-img" style="">{$goods['goodsname']}</div>
  1088. <button type="button" class="layui-btn layui-btn-sm" onclick="cancle_bind(this)">
  1089. <i class="layui-icon"></i>
  1090. </button>
  1091. </div>
  1092. </div>
  1093. <?php }} ?>
  1094. </div>
  1095. </div>
  1096. </div>
  1097. <?php } ?>
  1098. <?php if( $open_goods_distribution == 1 ) { ?>
  1099. <div class="layui-tab-item <?php if( $_GPC['tab']=='goods_distribution'){ ?>layui-show<?php } ?>" >
  1100. <div class="region-goods-details row">
  1101. <div class="region-goods-left col-sm-2">同城配送</div>
  1102. <div class=" region-goods-right col-sm-10">
  1103. <div class="form-group">
  1104. <label class="col-sm-2 control-label">同城配送</label>
  1105. <div class="col-sm-4 col-xs-12 col-md-10">
  1106. <div class="input-group">
  1107. <input type="checkbox" lay-skin="primary" id="is_only_distribution" name="is_only_distribution" lay-filter="is_only_distribution" <?php if(isset($item['is_only_distribution']) && $item['is_only_distribution'] ==1 ){ ?> checked <?php } ?> value="1" />
  1108. </div>
  1109. <span style="color:#999!important;">勾选后该商品会在购物车中显示同城配送,所有同城配送的商品单独结算,订单提交只有同城配送方式</span><br />
  1110. <span style="color:red">勾选后,此商品为同城配送商品。会自动取消仅快递和到店核销的勾选</span>
  1111. </div>
  1112. </div>
  1113. <div class="form-group">
  1114. <label class="col-sm-2 control-label">包装费</label>
  1115. <div class="col-sm-4 col-xs-12">
  1116. <div class="input-group">
  1117. <input type="text" name="packing_free" id="packing_free" class="form-control" value="<?php if( !isset($item['packing_free']) ){ ?>0<?php }else{ ?>{$item['packing_free']}<?php } ?>" />
  1118. <div class="input-group-addon">元</div>
  1119. </div>
  1120. <span style="color:#999!important;">零元表示没有包装费这一项</span>
  1121. </div>
  1122. </div>
  1123. </div>
  1124. </div>
  1125. </div>
  1126. <?php } ?>
  1127. <div class="layui-tab-item <?php if( $_GPC['tab']=='hexiao'){ ?>layui-show<?php } ?>" >
  1128. <div class="region-goods-details row">
  1129. <div class="region-goods-left col-sm-2">到店核销</div>
  1130. <div class="region-goods-right col-sm-10">
  1131. <?php if(empty($is_exist_salesroom)){ ?>
  1132. <div class="form-group" style="margin: 20px;">
  1133. <div class="col-sm-12 col-xs-12 col-md-12">
  1134. <span style="color:red;">“到店核销”功能需要与门店信息配合使用,您暂无设置门店信息,请先<a href="{:U('salesroom/index')}" style="color:#428bca;">去添加</a>门店信息然后再进行到店核销设置</span>
  1135. </div>
  1136. </div>
  1137. <?php }else{ ?>
  1138. <div class="form-group">
  1139. <label class="col-sm-2 control-label">到店核销</label>
  1140. <div class="col-sm-4 col-xs-12 col-md-10">
  1141. <div class="input-group">
  1142. <input type="checkbox" lay-skin="primary" name="is_only_hexiao" id="is_only_hexiao" lay-filter="is_only_hexiao" <?php if(isset($item['is_only_hexiao']) && $item['is_only_hexiao'] ==1 ){ ?> checked <?php } ?> value="1" />
  1143. </div>
  1144. <span style="color:#999!important;">勾选后该商品会在购物车中显示核销商品,所有核销商品单独结算,订单提交只有到店核销方式</span><br />
  1145. <span style="color:red">勾选后,此商品为到店核销商品。会自动取消仅快递和同城配送的勾选</span>
  1146. </div>
  1147. </div>
  1148. <div class="form-group">
  1149. <label class="col-sm-2 control-label">核销方式</label>
  1150. <div class="col-sm-9 col-xs-12">
  1151. <input type="radio" value="0" name="hexiao_type" lay-filter="hexiao_type" <?php if(!isset($item['hexiao_type']) || $item['hexiao_type'] == 0){ ?>checked<?php } ?> title="订单核销" />
  1152. <input type="radio" value="1" name="hexiao_type" lay-filter="hexiao_type" <?php if(isset($item['hexiao_type']) && $item['hexiao_type'] == 1){ ?>checked<?php } ?> title="自定义核销次数" />
  1153. <span class="help-block" style="font-size: 12px;<?php if(!isset($item['hexiao_type']) || $item['hexiao_type'] == 0){ ?>display:block;<?php }else{ ?>display:none;<?php } ?>" id="hexiao_type_0">核销一次后即过期</span>
  1154. <span class="help-block" style="font-size: 12px;margin-left:120px;<?php if(isset($item['hexiao_type']) && $item['hexiao_type'] == 1){ ?>display:block;<?php }else{ ?>display:none;<?php } ?>" id="hexiao_type_1">设置的单个到店核销次数核销</span>
  1155. </div>
  1156. </div>
  1157. <div class="form-group" id="hx_goods_time" style="<?php if(isset($item['hexiao_type']) && $item['hexiao_type'] == 1){ ?>display:block;<?php }else{ ?>display:none;<?php } ?>">
  1158. <label class="col-sm-2 control-label"></label>
  1159. <div class="col-sm-9 col-xs-12">
  1160. <div class="col-sm-9 col-xs-12">
  1161. <label class="col-sm-2 control-label">单个到店核销次数</label>
  1162. <div class="col-sm-9 col-xs-12">
  1163. <input type="text" name="hx_one_goods_time" id="hx_one_goods_time" class="form-control" value="{$item['hx_one_goods_time']}" style="width: 500px;"/>
  1164. <span class="help-block" style="font-size: 12px;">单个到店核销次数,不填或填写0及以下为默认不限次数,核销员 “全部核销” 为一次核销完成,管理员订单 “确认使用” 为一次核销完成</span>
  1165. </div>
  1166. </div>
  1167. </div>
  1168. </div>
  1169. <div class="form-group">
  1170. <label class="col-sm-2 control-label">核销有效期</label>
  1171. <div class="col-sm-9 col-xs-12">
  1172. <input type="radio" value="0" name="hx_expire_type" lay-filter="hx_expire_type" <?php if(!isset($item['hx_expire_type']) || $item['hx_expire_type'] == 0){ ?>checked<?php } ?> title="购买后有效期" />
  1173. <input type="radio" value="1" name="hx_expire_type" lay-filter="hx_expire_type" <?php if(isset($item['hx_expire_type']) && $item['hx_expire_type'] == 1){ ?>checked<?php } ?> title="指定过期时间" />
  1174. </div>
  1175. </div>
  1176. <div class="form-group" id="hx_expire_type_0" style="<?php if(!isset($item['hx_expire_type']) || $item['hx_expire_type'] == 0){ ?>display:block;<?php }else{ ?>display:none;<?php } ?>">
  1177. <label class="col-sm-2 control-label"></label>
  1178. <div class="col-sm-9 col-xs-12">
  1179. <div class="col-sm-9 col-xs-12">
  1180. <label class="col-sm-2 control-label">有效天数</label>
  1181. <div class="col-sm-9 col-xs-12">
  1182. <input type="text" name="hx_expire_day" id="hx_expire_day" class="form-control" value="{$item['hx_expire_day']}" style="width: 300px;display: inline-block;"/><span style="margin:5px;">天</span>
  1183. <span class="help-block" style="font-size: 12px;">自购买之日起多少天内有效,不写默认90天</span>
  1184. </div>
  1185. </div>
  1186. </div>
  1187. </div>
  1188. <div class="form-group" id="hx_expire_type_1" style="<?php if(isset($item['hx_expire_type']) && $item['hx_expire_type'] == 1){ ?>display:block;<?php }else{ ?>display:none;<?php } ?>">
  1189. <label class="col-sm-2 control-label"></label>
  1190. <div class="col-sm-9 col-xs-12">
  1191. <div class="col-sm-9 col-xs-12">
  1192. <label class="col-sm-2 control-label">过期时间</label>
  1193. <div class="col-sm-9 col-xs-12">
  1194. <input type="text" name="hx_expire_end_time" id="hx_expire_end_time" class="form-control" value="{$item['hx_expire_end_time']}" lay-filter="hx_expire_end_time" placeholder="yyyy-MM-dd HH:mm:ss" style="width: 300px;"/>
  1195. <span class="help-block" style="font-size: 12px;">在指定过期时间之前才能核销</span>
  1196. </div>
  1197. <label class="col-sm-2 control-label"></label>
  1198. <div class="col-sm-9 col-xs-12 input-group fixsingle-input-group" style="padding-left: 15px;">
  1199. <div class="input-group-addon"><input type="checkbox" lay-skin="primary" name="hx_auto_off" id="hx_auto_off" lay-filter="hx_auto_off" <?php if(!isset($item['hx_auto_off']) || $item['hx_auto_off'] == 1){ ?>checked<?php } ?> value="1" />自动下架商品,提前</div>
  1200. <input class="form-control" name="hx_auto_off_time" id="hx_auto_off_time" type="text" placeholder="" value="<?php if(!isset($item['hx_auto_off'])){?>6<?php }else{ echo $item['hx_auto_off_time'];} ?>">
  1201. <div class="input-group-addon">小时</div>
  1202. </div>
  1203. <label class="col-sm-2 control-label" style="margin-right: 15px;"></label>
  1204. <span class="layui-form-mid layui-word-aux" style="font-size: 12px;">在指定过期时间前多少个小时自动下架,防止已过期商品还可以购买;没勾选,到期自动下架。 </span>
  1205. </div>
  1206. </div>
  1207. </div>
  1208. <div class="form-group">
  1209. <label class="col-sm-2 control-label">指定门店</label>
  1210. <div class="col-sm-9 col-xs-12">
  1211. <input type="radio" value="0" name="hx_assign_salesroom" lay-filter="hx_assign_salesroom" <?php if(!isset($item['hx_assign_salesroom']) || $item['hx_assign_salesroom'] == 0){ ?>checked<?php } ?> title="所有门店" />
  1212. <input type="radio" value="1" name="hx_assign_salesroom" lay-filter="hx_assign_salesroom" <?php if(isset($item['hx_assign_salesroom']) && $item['hx_assign_salesroom'] == 1){ ?>checked<?php } ?> title="指定门店" />
  1213. </div>
  1214. </div>
  1215. <div class="form-group" id="hx_assign_salesroom_1" style="<?php if(isset($item['hx_assign_salesroom']) && $item['hx_assign_salesroom'] == 1){ ?>display:block;<?php }else{ ?>display:none;<?php } ?>">
  1216. <label class="col-sm-2 control-label"></label>
  1217. <div class="col-sm-9 col-xs-12">
  1218. <div class="input-group " style="margin: 0;">
  1219. <input type="text" disabled value="" class="form-control valid" placeholder="" id="salesroom_id">
  1220. <span class="input-group-btn">
  1221. <span data-input="#hexiao_salesroom_list" id="chose_salesroom_id" class="btn btn-default">选择门店</span>
  1222. </span>
  1223. </div>
  1224. <span class="help-block" style="font-size: 12px;">门店下方所有核销人员都可以核销该商品,也可以单独指定门店的核销人员进行核销。</span>
  1225. </div>
  1226. </div>
  1227. <div class="form-group" id="hx_salesroom_list" style="<?php if(isset($item['hx_assign_salesroom']) && $item['hx_assign_salesroom'] == 1){ ?>display:block;<?php }else{ ?>display:none;<?php } ?>">
  1228. <label class="col-sm-2 control-label"></label>
  1229. <div class="col-sm-9 col-xs-12">
  1230. <?php if(isset($item['salesroom_list']) && count($item['salesroom_list']) > 0){ $i = 1;?>
  1231. <?php foreach($item['salesroom_list'] as $rk=>$rv){?>
  1232. <div class="input-group mult_choose_room_list" style="width:100%">
  1233. <div class="input-group mult_choose_roomid" data-roomid="<?php echo $rv['salesroom_id']; ?>" style="border-radius: 0;margin: 10px;margin-left:0px;">
  1234. <div class="choose_room_title">指定门店<?php echo $i;$i++;?></div>
  1235. <div class="layadmin-text-center choose_user">
  1236. <img style="" src="<?php echo tomedia($rv['room_logo']);?>">
  1237. <div class="layadmin-maillist-img" style=""><?php echo $rv['room_name']; ?></div>
  1238. <button type="button" class="layui-btn layui-btn-sm" onclick="cancle_room_bind(this)">
  1239. <i class="layui-icon"></i>
  1240. </button>
  1241. </div>
  1242. </div>
  1243. <div class="input-group" style="margin-top: 10px;">
  1244. <input type="checkbox" class="is_hx_member" lay-filter="is_hx_member" lay-skin="primary" name="is_hx_member" value="1" title="是否指定核销人员" <?php if(isset($rv['is_hx_member']) && $rv['is_hx_member'] == 1){ ?>checked<?php } ?>>
  1245. <div class="layui-unselect layui-form-checkbox" lay-skin="primary">
  1246. <span>是否指定核销人员</span>
  1247. <i class="layui-icon layui-icon-ok"></i>
  1248. </div>
  1249. </div>
  1250. <div class="input-group selectHxMember" style="margin-top: 10px;<?php if(empty($rv['smember_list'])){ ?>display:none;<?php } ?>">
  1251. <input type="text" disabled="" value="" class="form-control valid" name="smember_id" placeholder="">
  1252. <span class="input-group-btn">
  1253. <span data-input="#hexiao_smember_list_<?php echo $rv['salesroom_id']; ?>" class="btn btn-default chose_smember_id">选择核销人员</span>
  1254. </span>
  1255. </div>
  1256. <div class="form-group hx_smember_list" id="hx_smember_list" style="<?php if(empty($rv['smember_list'])){ ?>display:none;<?php } ?>">
  1257. <div class="col-sm-12 col-xs-12">
  1258. <div id="hexiao_smember_list_<?php echo $rv['salesroom_id']; ?>"></div>
  1259. <?php if(isset($rv['smember_list']) && count($rv['smember_list']) > 0){?>
  1260. <?php foreach($rv['smember_list'] as $mk=>$mv){?>
  1261. <div class="input-group mult_choose_smemberid" data-smemberid="<?php echo $mv['smember_id']; ?>" style="border-radius: 0;float: left;margin: 10px;margin-left:0px;">
  1262. <div class="layadmin-text-center choose_user">
  1263. <img src="<?php echo $mv['avatar']; ?>" style="padding1px;border:1px solid #ccc">
  1264. <div class="layadmin-maillist-img" style=""><?php echo $mv['username']; ?></div>
  1265. <button type="button" class="layui-btn layui-btn-sm" onclick="cancle_bind(this)">
  1266. <i class="layui-icon"></i>
  1267. </button>
  1268. </div>
  1269. </div>
  1270. <?php } ?>
  1271. <?php } ?>
  1272. </div>
  1273. </div>
  1274. </div>
  1275. <?php } ?>
  1276. <?php } ?>
  1277. <div id="hexiao_salesroom_list"></div>
  1278. </div>
  1279. </div>
  1280. <?php } ?>
  1281. <!--
  1282. <div class="form-group">
  1283. <label class="col-sm-2 control-label"></label>
  1284. <div class="col-sm-9 col-xs-12">
  1285. <input type="button" value="测试按钮" class="btn btn-primary hexiao_btn" />
  1286. </div>
  1287. </div>-->
  1288. </div>
  1289. </div>
  1290. </div>
  1291. </div>
  1292. <script>
  1293. $(function(){
  1294. $(".select2").select2({
  1295. placeholder:'请选择',
  1296. allowClear:true
  1297. })
  1298. })
  1299. </script>
  1300. <div class="layui-form-item">
  1301. <label class="layui-form-label"> </label>
  1302. <div class="layui-input-block">
  1303. <input type="submit" value="提交" lay-submit lay-filter="formDemo" class="btn btn-primary" />
  1304. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1305. <a class="btn btn-default" style='margin-left:10px;' href="{:U('goods/index' , array( 'ok' => 1))}">返回列表</a>
  1306. </div>
  1307. </div>
  1308. </form>
  1309. </div>
  1310. </div>
  1311. </div>
  1312. <div id="batchheads" style="z-index: 999;display: none;position: fixed;top: 0;left: 0;right: 0;bottom: 0;background: rgba(0,0,0,0.5)" class="form-horizontal form-validate batchcates" enctype="multipart/form-data">
  1313. <div class="modal-dialog" style="position: absolute;margin-top: -300px">
  1314. <div class="modal-content">
  1315. <div class="modal-header" style="padding:5px;">
  1316. <button data-dismiss="modal" class="close" type="button">×</button>
  1317. <h4 class="modal-title">选取团长</h4>
  1318. </div>
  1319. <div class="modal-body" style="height:600px">
  1320. <div class="form-group">
  1321. <label class="col-sm-2 control-label">社区位置</label>
  1322. <div class="col-sm-10 col-xs-12">
  1323. <p>
  1324. <select id="sel-provance" name="province_id" onChange="selectCity();" class="select form-control" style="width:160px;display:inline;">
  1325. <option value="" selected="true">省/直辖市</option>
  1326. </select>
  1327. <select id="sel-city" name="city_id" onChange="selectcounty(0)" class="select form-control" style="width:160px;display:inline;">
  1328. <option value="" selected="true">请选择</option>
  1329. </select>
  1330. <select id="sel-area" name="area_id" onChange="selectstreet(0)" class="select form-control" style="width:160px;display:inline;">
  1331. <option value="" selected="true">请选择</option>
  1332. </select>
  1333. <select id="sel-street" name="country_id" class="select form-control" style="width:160px;display:inline;">
  1334. <option value="" selected="true">请选择</option>
  1335. </select>
  1336. </p>
  1337. </div>
  1338. </div>
  1339. <div class="form-group">
  1340. <label class="col-sm-2 control-label">团长名称</label>
  1341. <div class="col-sm-10 col-xs-12">
  1342. <div class="input-group">
  1343. <input type="text" class="form-control" name="keyword" id="supply_id_input" placeholder="团长名称/团长手机号/社区地址">
  1344. <span class="input-group-btn">
  1345. <button type="button" class="btn btn-default" onclick="search_heads()">搜索</button>
  1346. </span>
  1347. </div>
  1348. </div>
  1349. </div>
  1350. <div class="form-group">
  1351. <div class="col-sm-1 control-label">
  1352. </div>
  1353. <div class="col-sm-10 col-xs-12">
  1354. <div class="page-table-header">
  1355. <input type="checkbox" class="check_heads_all">
  1356. <div class="btn-group">
  1357. 全选/反选
  1358. </div>
  1359. <br/>
  1360. <label><input type="checkbox" class="is_cancle_old" id="is_cancle_old" style="vertical-align: text-bottom;">
  1361. <div class="btn-group" style="color:#666;">
  1362. 同时取消以前所有分配
  1363. </div>
  1364. </label>
  1365. &nbsp;&nbsp;&nbsp;&nbsp;
  1366. <label><input type="checkbox" class="is_cancle_allhead" id="is_cancle_allhead" style="vertical-align: text-bottom;">
  1367. <div class="btn-group" style="color:#666;">
  1368. 同时取消商品 “所有团长可售”
  1369. </div>
  1370. </label>
  1371. </div>
  1372. </div>
  1373. </div>
  1374. <div class="row">
  1375. <label class="col-sm-1 control-label"></label>
  1376. <div class="col-sm-11 col-xs-12">
  1377. <div class="content" style="padding-top:5px;" data-name="supply_id">
  1378. <div style="max-height:410px;overflow:auto;" id="batchheads_content">
  1379. </div>
  1380. <div class="" id="batchheads_page">
  1381. </div>
  1382. </div>
  1383. </div>
  1384. </div>
  1385. </div>
  1386. <div class="modal-footer">
  1387. <button class="btn btn-primary model_heads">确认</button>
  1388. <button class="btn btn-default" >取消</button>
  1389. </div>
  1390. </div>
  1391. </div>
  1392. </div>
  1393. <script src="/layuiadmin/layui/layui.js"></script>
  1394. <script type="text/javascript" src="/static/js/jquery-migrate-1.1.1.js"></script>
  1395. <script src="/static/js/jquery-ui.min.js"></script>
  1396. <style>
  1397. .multi-img-details{width:100%;}
  1398. </style>
  1399. <script>
  1400. layui.config({
  1401. base: '/layuiadmin/' //静态资源所在路径
  1402. }).extend({
  1403. index: 'lib/index' //主入口模块
  1404. }).use('index');
  1405. </script>
  1406. <script>
  1407. //由于模块都一次性加载,因此不用执行 layui.use() 来加载对应模块,直接使用即可:
  1408. var layer = layui.layer;
  1409. var $;
  1410. var cur_open_div;
  1411. var form;
  1412. layui.use(['jquery', 'layer','form', 'laydate'], function(){
  1413. $ = layui.$;
  1414. form = layui.form;
  1415. laydate = layui.laydate;
  1416. laydate.render({
  1417. elem: '#hx_expire_end_time'
  1418. ,type: 'datetime'
  1419. ,min: '<?php echo date("Y-m-d H:i:s"); ?>'
  1420. });
  1421. form.on('radio(linktype)', function(data){
  1422. if (data.value == 2) {
  1423. $('#typeGroup').show();
  1424. } else {
  1425. $('#typeGroup').hide();
  1426. }
  1427. });
  1428. form.on('checkbox(is_modify_sendscore)', function(data){
  1429. console.log(data.elem.checked)
  1430. if (data.elem.checked) {
  1431. console.log(12);
  1432. $("#send_score_divTip").css('display','inline');
  1433. $("#send_score_divTip2").css('display','inline');
  1434. } else {
  1435. console.log(33);
  1436. $("#send_score_divTip").hide();
  1437. $("#send_score_divTip2").hide();
  1438. }
  1439. form.render('checkbox');
  1440. });
  1441. form.on('checkbox(xinrenckbox)', function(data){
  1442. if (data.elem.checked) {
  1443. $("#xianshickbox").removeAttr("checked");
  1444. } else {
  1445. }
  1446. form.render('checkbox');
  1447. });
  1448. form.on('checkbox(xianshickbox)', function(data){
  1449. if (data.elem.checked) {
  1450. $("#xinrenckbox").removeAttr("checked");
  1451. } else {
  1452. }
  1453. form.render('checkbox');
  1454. });
  1455. form.on('checkbox(hascommission)', function(data){
  1456. if (data.elem.checked) {
  1457. $('#commission_div').show();
  1458. } else {
  1459. $('#commission_div').hide();
  1460. }
  1461. })
  1462. //hascommission
  1463. form.on('checkbox(has_mb_level_buy)', function(data){
  1464. if (data.elem.checked) {
  1465. $('#mb_level_div').show();
  1466. } else {
  1467. $('#mb_level_div').hide();
  1468. }
  1469. })
  1470. form.on('checkbox(is_hx_member)', function(data){
  1471. if (data.elem.checked) {
  1472. $(this).parent().parent().find('.selectHxMember').show();
  1473. $(this).parent().parent().find('.hx_smember_list').show();
  1474. } else {
  1475. $(this).parent().parent().find('.selectHxMember').hide();
  1476. $(this).parent().parent().find('.hx_smember_list').hide();
  1477. }
  1478. })
  1479. form.on('radio(hexiao_type)', function(data){
  1480. if (data.elem.value == 1) {
  1481. $('#hexiao_type_0').hide();
  1482. $('#hexiao_type_1').show();
  1483. $('#hx_goods_time').show();
  1484. } else {
  1485. $('#hexiao_type_0').show();
  1486. $('#hexiao_type_1').hide();
  1487. $('#hx_goods_time').hide();
  1488. }
  1489. })
  1490. form.on('radio(hx_expire_type)', function(data){
  1491. if (data.elem.value == 1) {
  1492. $('#hx_expire_type_0').hide();
  1493. $('#hx_expire_type_1').show();
  1494. } else {
  1495. $('#hx_expire_type_0').show();
  1496. $('#hx_expire_type_1').hide();
  1497. }
  1498. })
  1499. form.on('radio(hx_assign_salesroom)', function(data){
  1500. if (data.elem.value == 1) {
  1501. $('#hx_assign_salesroom_1').show();
  1502. $('#hx_salesroom_list').show();
  1503. } else {
  1504. $('#hx_assign_salesroom_1').hide();
  1505. $('#hx_salesroom_list').hide();
  1506. }
  1507. })
  1508. //同城配送
  1509. form.on('checkbox(is_only_distribution)', function (data) {
  1510. if (data.elem.checked) {
  1511. $("#is_only_hexiao").removeAttr("checked");
  1512. $("#is_only_express").removeAttr("checked");
  1513. }
  1514. form.render('checkbox');
  1515. });
  1516. //仅快递
  1517. form.on('checkbox(is_only_express)', function (data) {
  1518. if (data.elem.checked) {
  1519. $("#is_only_distribution").removeAttr("checked");
  1520. $("#is_only_hexiao").removeAttr("checked");
  1521. }
  1522. form.render('checkbox');
  1523. });
  1524. //核销
  1525. form.on('checkbox(is_only_hexiao)', function (data) {
  1526. if (data.elem.checked) {
  1527. $("#is_only_distribution").removeAttr("checked");
  1528. $("#is_only_express").removeAttr("checked");
  1529. }
  1530. form.render('checkbox');
  1531. });
  1532. //切换预售
  1533. form.on('radio(presale_type)',function(data){
  1534. if (data.elem.value == 0) {
  1535. $('#presale_deduction_money').show();
  1536. $('#presale_limit_balancepaytime').show();
  1537. if( $("input[name='presale_limit_balancepaytime']:checked").val() == 1)
  1538. $('#presale_balance_paytime').show();
  1539. $('#presale_ding_money').show();
  1540. } else {
  1541. $('#presale_ding_money').hide();
  1542. $('#presale_limit_balancepaytime').hide();
  1543. $('#presale_balance_paytime').hide();
  1544. $('#presale_deduction_money').hide();
  1545. }
  1546. });
  1547. form.on('radio(presale_limit_balancepaytime)',function(data){
  1548. if (data.elem.value == 0) {
  1549. $('#presale_balance_paytime').hide();
  1550. } else {
  1551. $('#presale_balance_paytime').show();
  1552. }
  1553. });
  1554. form.on('radio(presale_sendorder_type)',function(data){
  1555. if (data.elem.value == 0) {
  1556. $('#presale_sendorder_afterday').hide();
  1557. $('#presale_sendorder_datetime').show();
  1558. } else {
  1559. $('#presale_sendorder_datetime').hide();
  1560. $('#presale_sendorder_afterday').show();
  1561. }
  1562. });
  1563. $('#chose_salesroom_id').click(function(){
  1564. var supply_id = $('input[name="supply_id"]').val();
  1565. cur_open_div = $(this).attr('data-input');
  1566. $.post("{:U('salesroom/query', array('template' => 'mult_goods'))}", {supply_id:supply_id}, function(shtml){
  1567. layer.open({
  1568. type: 1,
  1569. area: '930px',
  1570. content: shtml //注意,如果str是object,那么需要字符拼接。
  1571. });
  1572. });
  1573. })
  1574. $('.chose_smember_id').live('click',function(){
  1575. var room_id = $(this).parent().parent().parent().find('.mult_choose_roomid').attr('data-roomid');
  1576. cur_open_div = $(this).attr('data-input');
  1577. var post_url = "{:U('salesroom_member/query', array('template' => 'mult_goods'))}";
  1578. $.post(post_url, {room_id:room_id}, function(shtml){
  1579. layer.open({
  1580. type: 1,
  1581. area: '930px',
  1582. content: shtml //注意,如果str是object,那么需要字符拼接。
  1583. });
  1584. });
  1585. })
  1586. /**
  1587. <?php if($delivery_type_express == 2){?>
  1588. form.on('checkbox(is_only_express111)', function(data){
  1589. if (data.elem.checked) {
  1590. $('#is_only_express').removeAttr("checked");
  1591. layer.msg("启用仅快递配送模式,请在物流设置开启快递配送方式!",{icon: 2,time: 3000});
  1592. }
  1593. form.render('checkbox');
  1594. })
  1595. <?php } ?>
  1596. **/
  1597. $('#chose_label_id').click(function(){
  1598. cur_open_div = $(this).attr('data-input');
  1599. $.post("{:U('goods/labelquery', array('ok' => 1))}", {}, function(shtml){
  1600. layer.open({
  1601. type: 1,
  1602. area: '930px',
  1603. content: shtml //注意,如果str是object,那么需要字符拼接。
  1604. });
  1605. });
  1606. })
  1607. $('#chose_member_id').click(function(){
  1608. cur_open_div = $(this).attr('data-input');
  1609. $.post("{:U('supply/zhenquery', array('ok' => 1))}", {}, function(shtml){
  1610. layer.open({
  1611. type: 1,
  1612. area: '930px',
  1613. content: shtml //注意,如果str是object,那么需要字符拼接。
  1614. });
  1615. });
  1616. })
  1617. $('#chose_agent_id').click(function(){
  1618. cur_open_div = $(this).attr('data-input');
  1619. $.post("{:U('communityhead/query_head_user', array('ok' => 1))}", {}, function(shtml){
  1620. layer.open({
  1621. type: 1,
  1622. area: '930px',
  1623. content: shtml //注意,如果str是object,那么需要字符拼接。
  1624. });
  1625. });
  1626. })
  1627. $('#chose_link').click(function(){
  1628. cur_open_div = $(this).attr('data-input');
  1629. $.post("{:U('util.selecturl', array('ok' => 1))}", {}, function(shtml){
  1630. layer.open({
  1631. type: 1,
  1632. area: '930px',
  1633. content: shtml //注意,如果str是object,那么需要字符拼接。
  1634. });
  1635. });
  1636. })
  1637. $('.layui-tab-title li').click(function(){
  1638. form.render('radio');
  1639. form.render('checkbox');
  1640. })
  1641. //监听提交
  1642. form.on('submit(formDemo)', function(data){
  1643. var loadingIndex = layer.load();
  1644. $('input').blur(function () {
  1645. $(this).css('border','#e7e7eb 1px solid');
  1646. })
  1647. var goodsname = $.trim($('#goodsname').val());
  1648. if(goodsname == ''){
  1649. layer.msg('商品名称必须填写',{icon: 1,time: 2000});
  1650. $('#goodsname').focus();
  1651. $('#goodsname').css('border','red 2px solid');
  1652. layer.close(loadingIndex);
  1653. return false;
  1654. }
  1655. var price = $.trim($('#price').val());
  1656. if(price == ''){
  1657. layer.msg('售价必须填写',{icon: 1,time: 2000});
  1658. $('#price').focus();
  1659. $('#price').css('border','red 2px solid');
  1660. layer.close(loadingIndex);
  1661. return false;
  1662. }
  1663. var productprice = $.trim($('#productprice').val());
  1664. if(productprice == ''){
  1665. layer.msg('原价必须填写',{icon: 1,time: 2000});
  1666. $('#productprice').focus();
  1667. $('#productprice').css('border','red 2px solid');
  1668. layer.close(loadingIndex);
  1669. return false;
  1670. }
  1671. if($('#hasoption').get(0).checked == false){
  1672. console.log(222);
  1673. var total =$('#total').val();
  1674. if(total == ''){
  1675. layer.msg('库存必须填写',{icon: 1,time: 2000});
  1676. $('#total').focus();
  1677. $('#total').css('border','red 2px solid');
  1678. layer.close(loadingIndex);
  1679. return false;
  1680. }
  1681. }
  1682. var goods_start_count = $.trim($('input[name="goods_start_count"]').val());
  1683. var r = /^\+?[1-9][0-9]*$/;  //正整数
  1684. if(r.test(goods_start_count)){
  1685. var oneday_limit_count = $.trim($('input[name="oneday_limit_count"]').val());
  1686. if(parseInt(oneday_limit_count) > 0){
  1687. if(parseInt(goods_start_count) > parseInt(oneday_limit_count)){
  1688. layer.msg('起购数量必须小于每天限购',{icon: 1,time: 2000});
  1689. $('input[name="goods_start_count"]').focus();
  1690. layer.close(loadingIndex);
  1691. return false;
  1692. }
  1693. }
  1694. var one_limit_count = $.trim($('input[name="one_limit_count"]').val());
  1695. if(parseInt(one_limit_count) > 0){
  1696. if(parseInt(goods_start_count) > parseInt(one_limit_count)){
  1697. layer.msg('起购数量必须小于单次限购',{icon: 1,time: 2000});
  1698. $('input[name="goods_start_count"]').focus();
  1699. layer.close(loadingIndex);
  1700. return false;
  1701. }
  1702. }
  1703. var total_limit_count = $.trim($('input[name="total_limit_count"]').val());
  1704. if(parseInt(total_limit_count) > 0){
  1705. if(parseInt(goods_start_count) > parseInt(total_limit_count)){
  1706. layer.msg('起购数量必须小于历史限购',{icon: 1,time: 2000});
  1707. $('input[name="goods_start_count"]').focus();
  1708. layer.close(loadingIndex);
  1709. return false;
  1710. }
  1711. }
  1712. }
  1713. //判断付费会员价
  1714. var is_take_vipcard = $('input[name="is_take_vipcard"]').prop('checked');
  1715. if(is_take_vipcard){
  1716. var card_price = $.trim($('#card_price').val());
  1717. var price = $.trim($('#price').val());
  1718. var fix_amountTest=/^(([1-9]\d*)|\d)(\.\d{1,2})?$/;
  1719. if(card_price == '' || fix_amountTest.test(card_price)==false){
  1720. layer.msg('请填写正确的商品付费会员专享价');
  1721. layer.close(loadingIndex);
  1722. return false;
  1723. }
  1724. if(price == '' || fix_amountTest.test(price)==false){
  1725. layer.msg('请填写正确的商品价格售价');
  1726. layer.close(loadingIndex);
  1727. return false;
  1728. }
  1729. if(parseFloat(card_price) > parseFloat(price)){
  1730. layer.msg('付费会员专享价不能大于售价');
  1731. layer.close(loadingIndex);
  1732. return false;
  1733. }
  1734. var check_cardprice = true;
  1735. var check_market_price = true;
  1736. var check_card_market = true;
  1737. $('.option_cardprice').each(function(){
  1738. var cardprice = $.trim($(this).val());
  1739. var marketprice = $.trim($(this).parent().parent().find('.option_marketprice').val());
  1740. if(cardprice == '' || fix_amountTest.test(cardprice) == false || parseFloat(cardprice) < 0.01){
  1741. check_cardprice = false;
  1742. }
  1743. if(marketprice == '' || fix_amountTest.test(marketprice) == false || parseFloat(marketprice) < 0.01){
  1744. check_market_price = false;
  1745. }
  1746. if(parseFloat(cardprice) > parseFloat(marketprice)){
  1747. check_card_market = false;
  1748. }
  1749. })
  1750. if(!check_cardprice){
  1751. layer.msg('多规格付费会员专享价不能为空且最低0.01元');
  1752. layer.close(loadingIndex);
  1753. return false;
  1754. }
  1755. if(!check_market_price){
  1756. layer.msg('多规格商品售价不能为空且最低0.01元');
  1757. layer.close(loadingIndex);
  1758. return false;
  1759. }
  1760. if(!check_card_market){
  1761. layer.msg('多规格付费会员专享价不能大于售价');
  1762. layer.close(loadingIndex);
  1763. return false;
  1764. }
  1765. }
  1766. var s_cates = $('#cates').val();
  1767. var cate_mult = [];
  1768. for(var i in s_cates)
  1769. {
  1770. cate_mult.push(s_cates[i]);
  1771. }
  1772. data.field.cate_mult = cate_mult;
  1773. <?php if( !empty($is_open_goods_relative_goods) && $is_open_goods_relative_goods == 1 ){ ?>
  1774. var gd_ar = [];
  1775. var gd_str = '';
  1776. $('.mult_choose_goodsid').each(function(){
  1777. gd_ar.push( $(this).attr('data-gid') );
  1778. })
  1779. gd_str = gd_ar.join(',');
  1780. data.field.limit_goods_list = gd_str;
  1781. <?php } ?>
  1782. var is_mult_option = $('input[name=hasoption]').is(':checked');
  1783. if( is_mult_option )
  1784. {
  1785. var spec_item_all_count = 0;
  1786. var spec_item_all = false;
  1787. $('.spec_item').each(function(){
  1788. spec_item_all_count++;
  1789. });
  1790. if(spec_item_all || spec_item_all_count == 0)
  1791. {
  1792. layer.msg('请填写商品的规格名称');
  1793. layer.close(loadingIndex);
  1794. return false;
  1795. }
  1796. var is_spec_break = false;
  1797. $('.spec_item').each(function(){
  1798. spec_item_all_count++;
  1799. //检测商品规格是否配置
  1800. var spec_val;
  1801. var spec_item_val;
  1802. var is_spec = false;
  1803. var is_spec_item = false;
  1804. var spec_count = 0;
  1805. var spec_item_count = 0;
  1806. $(this).find('.spec_title').each(function(){
  1807. spec_val = $(this).val();
  1808. spec_count++;
  1809. if( spec_val == '' )
  1810. {
  1811. is_spec = true;
  1812. }
  1813. if(is_spec || spec_count == 0)
  1814. {
  1815. is_spec_break = true;
  1816. layer.msg('请填写商品的规格名称',{icon:2});
  1817. $(this).focus();
  1818. $(this).css('border','2px solid #FF0000');
  1819. layer.close(loadingIndex);
  1820. return false;
  1821. }
  1822. })
  1823. $(this).find('.spec_item_title').each(function(){
  1824. spec_item_val = $(this).val();
  1825. spec_item_count++;
  1826. if( spec_item_val == '' )
  1827. {
  1828. is_spec_item = true;
  1829. }
  1830. if(is_spec_item || spec_item_count == 0){
  1831. is_spec_break = true;
  1832. $(this).focus();
  1833. $(this).css('border','2px solid #FF0000');
  1834. //$('.hasoption').focus();
  1835. layer.msg('请填写商品的具体规格值',{icon:2});
  1836. layer.close(loadingIndex);
  1837. return false;
  1838. }
  1839. })
  1840. })
  1841. if(is_spec_break){
  1842. layer.close(loadingIndex);
  1843. return false;
  1844. }
  1845. var t_val;
  1846. var is_pos = false;
  1847. var s_total = 0;
  1848. var is_break = false;
  1849. $('.option_stock').each(function(){
  1850. t_val = $(this).val();
  1851. if( t_val == '' )
  1852. {
  1853. is_pos = true;
  1854. }
  1855. if(is_pos)
  1856. {
  1857. layer.msg('多规格商品库存未填写',{icon:2});
  1858. $(this).focus();
  1859. $(this).css('border','red 2px solid');
  1860. console.log(888);
  1861. layer.close(loadingIndex);
  1862. is_break = true;
  1863. return false;
  1864. }
  1865. s_total += parseInt( t_val );
  1866. })
  1867. if(is_break){
  1868. return false;
  1869. }
  1870. var t_val2;
  1871. var is_pos2 = false;
  1872. $('.option_marketprice').each(function(){
  1873. t_val2 = $(this).val();
  1874. if( t_val2 == '' )
  1875. {
  1876. is_pos2 = true;
  1877. }
  1878. console.log(is_pos2);
  1879. if(is_pos2)
  1880. {
  1881. layer.msg('多规格商品价格未填写',{icon:2});
  1882. $(this).focus();
  1883. $(this).css('border','red 2px solid');
  1884. layer.close(loadingIndex);
  1885. is_break = true;
  1886. return false;
  1887. }
  1888. })
  1889. if(is_break){
  1890. return false;
  1891. }
  1892. var t_val3;
  1893. var is_pos3 = false;
  1894. $('.option_productprice').each(function(){
  1895. t_val3 = $(this).val();
  1896. if( t_val3 == '' )
  1897. {
  1898. is_pos3 = true;
  1899. }
  1900. })
  1901. if(is_pos3)
  1902. {
  1903. layer.msg('多规格商品原价未填写',{icon:2});
  1904. layer.close(loadingIndex);
  1905. return false;
  1906. }
  1907. if( s_total > 100000 || s_total< 0 )
  1908. {
  1909. layer.msg('商品库存值的取值范围是1~100000',{icon:2});
  1910. layer.close(loadingIndex);
  1911. return false;
  1912. }
  1913. }else{
  1914. var g_total = $('#total').val();
  1915. if( g_total > 100000 || g_total< 0 )
  1916. {
  1917. layer.msg('商品库存值的取值范围是1~100000',{icon:2});
  1918. layer.close(loadingIndex);
  1919. return false;
  1920. }
  1921. }
  1922. /**
  1923. var supply_id = $('input[name=supply_id]').val();
  1924. var is_only_distribution = $('input[name=is_only_distribution]').is(':checked');
  1925. if(supply_id != '' && supply_id > 0){
  1926. if(is_only_distribution){
  1927. layer.msg('独立供应商不能开启同城配送');
  1928. layer.close(loadingIndex);
  1929. return false;
  1930. }
  1931. }**/
  1932. //商品核销
  1933. var is_only_hexiao = $('input[name=is_only_hexiao]').is(':checked');
  1934. if(is_only_hexiao){
  1935. var hx_expire_type = $('input:radio[name="hx_expire_type"]:checked').val();
  1936. if(hx_expire_type == 1){
  1937. if($.trim($('#hx_expire_end_time').val()) == ''){
  1938. layer.msg('指定过期时间不能为空');
  1939. layer.close(loadingIndex);
  1940. return false;
  1941. }
  1942. }
  1943. var goods_room = [];
  1944. var goods_room_smember = {};
  1945. var goods_is_hx_member = {};
  1946. var goods_room_ids = "";
  1947. $('#hx_salesroom_list').find('.mult_choose_room_list').each(function(){
  1948. var goods_room_sid = [];
  1949. var room_id = $(this).find('.mult_choose_roomid').attr('data-roomid');
  1950. $(this).find('.mult_choose_smemberid').each(function(){
  1951. var smember_id = $(this).attr('data-smemberid');
  1952. goods_room_sid.push(smember_id);
  1953. });
  1954. goods_room_smember[room_id] = goods_room_sid.join(',');
  1955. goods_room.push(room_id);
  1956. $(this).find('.is_hx_member').each(function(){
  1957. if($(this).is(':checked')){
  1958. goods_is_hx_member[room_id] = 1;
  1959. }else{
  1960. goods_is_hx_member[room_id] = 0;
  1961. }
  1962. });
  1963. });
  1964. goods_room_ids = goods_room.join(',');
  1965. data.field.goods_room_ids = goods_room_ids;
  1966. data.field.goods_room_smember = goods_room_smember;
  1967. data.field.goods_is_hx_member = goods_is_hx_member;
  1968. var hx_assign_salesroom = $('input:radio[name="hx_assign_salesroom"]:checked').val();
  1969. if(hx_assign_salesroom == 1){
  1970. if(goods_room_ids == ''){
  1971. layer.msg('请选择指定门店');
  1972. layer.close(loadingIndex);
  1973. return false;
  1974. }
  1975. }
  1976. }
  1977. $.ajax({
  1978. url: data.form.action,
  1979. type: data.form.method,
  1980. data: data.field,
  1981. dataType:'json',
  1982. success: function (info) {
  1983. if(info.status == 0)
  1984. {
  1985. layer.msg(info.result.message,{icon: 1,time: 2000});
  1986. layer.close(loadingIndex);
  1987. }else if(info.status == 1){
  1988. var go_url = location.href;
  1989. if( info.result.hasOwnProperty("url") )
  1990. {
  1991. go_url = info.result.url;
  1992. }
  1993. layer.msg('操作成功',{time: 1000,
  1994. end:function(){
  1995. location.href = info.result.url;
  1996. }
  1997. });
  1998. }
  1999. }
  2000. });
  2001. return false;
  2002. });
  2003. form.on('checkbox(hasoption)', function(data){
  2004. if(data.elem.checked)
  2005. {
  2006. $('#goodssn').attr('readonly',true);
  2007. $('#productsn').attr('readonly',true);
  2008. $('#weight').attr('readonly',true);
  2009. $('#total').attr('readonly',true);
  2010. $("#tboption").show();
  2011. $("#tbdiscount").show();
  2012. $("#isdiscount_discounts").show();
  2013. $("#isdiscount_discounts_default").hide();
  2014. $("#commission").show();
  2015. $("#commission_default").hide();
  2016. $("#discounts_type1").show().parent().show();
  2017. refreshOptions();
  2018. }else{
  2019. $('#weight').removeAttr('readonly');
  2020. $('#total').removeAttr('readonly');
  2021. $("#tboption").hide();
  2022. refreshOptions();
  2023. $("#isdiscount_discounts").hide();
  2024. var isdiscount_discounts = $("#isdiscount_discounts").html();
  2025. $("#isdiscount_discounts").html('');
  2026. $("#isdiscount_discounts").html(isdiscount_discounts);
  2027. $("#tbdiscount").hide();
  2028. $("#isdiscount_discounts_default").show();
  2029. $("#commission_default").show();
  2030. $('#goodssn').removeAttr('readonly');
  2031. $('#productsn').removeAttr('readonly');
  2032. $("#discounts_type1").hide().parent().hide();
  2033. $("#discounts_type0").click();
  2034. $(this).prop("checked", false);
  2035. }
  2036. form.render('checkbox');
  2037. });
  2038. $('#chose_agent_id2').click(function(){
  2039. cur_open_div = $(this).attr('data-input');
  2040. $.post("{:U('goods/query_normal', array('template' => 'mult', 'unselect_goodsid' => $id))}", {}, function(shtml){
  2041. layer.open({
  2042. type: 1,
  2043. area: '930px',
  2044. content: shtml //注意,如果str是object,那么需要字符拼接。
  2045. });
  2046. });
  2047. })
  2048. form.on('checkbox(is_modify_head_commission)', function(data){
  2049. if(data.elem.checked)
  2050. {
  2051. $("#head_commission_div").show();
  2052. }else{
  2053. $("#head_commission_div").hide();
  2054. }
  2055. form.render('checkbox');
  2056. });
  2057. form.on('checkbox(is_community_head_commission)', function(data){
  2058. if(data.elem.checked)
  2059. {
  2060. $("#head_commission_div2").show();
  2061. }else{
  2062. $("#head_commission_div2").hide();
  2063. }
  2064. form.render('checkbox');
  2065. });
  2066. form.on('checkbox(is_take_vipcard)', function(data){
  2067. if(data.elem.checked)
  2068. {
  2069. $(".card_price_txt").show();
  2070. }else{
  2071. $(".card_price_txt").hide();
  2072. }
  2073. form.render('checkbox');
  2074. refreshOptions();
  2075. });
  2076. })
  2077. function cancle_bind(obj,sdiv)
  2078. {
  2079. $('#'+sdiv).val('');
  2080. $(obj).parent().parent().remove();
  2081. }
  2082. function cancle_room_bind(obj){
  2083. $(obj).parent().parent().parent().remove();
  2084. }
  2085. </script>
  2086. <script>
  2087. $(function () {
  2088. // 拖拽时开始滚动的间距
  2089. var scrollingSensitivity = 20
  2090. // 拖拽时滚动速度
  2091. let scrollingSpeed = 20
  2092. // 拖拽前的父级节点
  2093. let dragBeforeParentNode = null
  2094. // 初始化拖拽函数
  2095. $('.multi-img-details').sortable({
  2096. // 自适应placeholder的大小
  2097. forceHelperSize: true,
  2098. // 拖拽时的鼠标形状
  2099. cursor: '-webkit-grabbing',
  2100. // 拖拽的父级节点(该节点一定要注意,配置错误会导致当前屏幕外的元素没法自动滚动拖拽,两列之间拖拽的滚动也会出问题)
  2101. appendTo: '.layui-form-item',
  2102. // 拖拽时的倾斜度
  2103. rotate: '5deg',
  2104. // 延迟时间(毫秒),避免和click同时操作时出现的冲突
  2105. delay: 0,
  2106. // 以clone方式拖拽
  2107. helper: 'clone',
  2108. // 拖拽到边框出现滚动的间距,
  2109. scrollSensitivity: scrollingSensitivity,
  2110. // 应用于拖拽空白区域的样式
  2111. placeholder: 'portlet-placeholder ui-state-highlight',
  2112. // 允许拖拽预留空白区域
  2113. forcePlaceholderSize: false,
  2114. // 多个列表之间的拖拽的dom元素
  2115. connectWith: '.multi-img-details',
  2116. // 鼠标到区域则填充
  2117. tolerance: "pointer",
  2118. // 可以拖拽的项
  2119. items: '.multi-item',
  2120. // 填充动画
  2121. revert: 0,
  2122. // 拖拽结束函数
  2123. stop: (e, ui) => {
  2124. // 当前拽入的元素
  2125. let item = $(ui.item)
  2126. // 当前拽入元素的下标
  2127. let index = item.index()
  2128. let kid = ''
  2129. // xxxx 这里面可以操作数据更新
  2130. },
  2131. // 开始拖拽时的函数
  2132. start: (e, ui) => {
  2133. // 拖拽前的父级节点
  2134. dragBeforeParentNode = ui.item[0].parentNode
  2135. // 让placeholder和源高度一致
  2136. ui.helper.addClass('item').width(110)
  2137. // xxxx 这里可以记录一些拖拽前的元素属性
  2138. },
  2139. // 处理两列滚动条问题
  2140. sort: function (event, ui) {
  2141. var scrollContainer = ui.placeholder[0].parentNode
  2142. // 设置拽入的列表的滚动位置
  2143. var overflowOffset = $(scrollContainer).offset()
  2144. if ((overflowOffset.top + scrollContainer.offsetHeight) - event.pageY <
  2145. scrollingSensitivity) {
  2146. scrollContainer.scrollTop = scrollContainer.scrollTop + scrollingSpeed
  2147. } else if (event.pageY - overflowOffset.top < scrollingSensitivity) {
  2148. scrollContainer.scrollTop = scrollContainer.scrollTop - scrollingSpeed
  2149. }
  2150. }
  2151. }).disableSelection()
  2152. })
  2153. </script>
  2154. <script language="javascript">
  2155. var chose_cate = -1;
  2156. var chose_cate_id_arr = [];
  2157. $(function(){
  2158. $('#cates2').on('change',function(){
  2159. var s_length = $("#cates2 option:selected").length -1;
  2160. var options_name = $("#cates2 option:selected:eq("+s_length+")").text();
  2161. var options_str = $("#cates2 option:selected:eq("+s_length+")").attr('data-names');
  2162. if(s_length > chose_cate)
  2163. {
  2164. chose_cate++;
  2165. var cur_cate_id = '';
  2166. $("#cates2 option:selected").each(function(){
  2167. var tmp_cate_id = parseInt($(this).val());
  2168. if( $.inArray( tmp_cate_id, chose_cate_id_arr ) == -1)
  2169. {
  2170. chose_cate_id_arr.push( parseInt(tmp_cate_id) );
  2171. cur_cate_id = tmp_cate_id;
  2172. }
  2173. })
  2174. addSpecList(options_name,options_str,cur_cate_id);
  2175. }else{
  2176. chose_cate--;
  2177. var new_chose_cate_id_arr = [];
  2178. if(chose_cate_id_arr.length == 1)
  2179. {
  2180. $('.spec_class_'+chose_cate_id_arr[0]).remove();
  2181. }
  2182. $("#cates2 option:selected").each(function(){
  2183. var tmp_cate_id = parseInt( $(this).val() );
  2184. if( $.inArray( tmp_cate_id, chose_cate_id_arr ) != -1)
  2185. {
  2186. new_chose_cate_id_arr.push( parseInt(tmp_cate_id) );
  2187. chose_cate_id_arr.splice($.inArray( tmp_cate_id, chose_cate_id_arr ), 1);
  2188. }
  2189. })
  2190. if(chose_cate_id_arr.length == 1)
  2191. {
  2192. $('.spec_class_'+chose_cate_id_arr[0]).remove();
  2193. }
  2194. chose_cate_id_arr = new_chose_cate_id_arr;
  2195. refreshOptions();
  2196. }
  2197. })
  2198. $(document).on('input propertychange change', '#specs input', function () {
  2199. window.optionchanged = true;
  2200. $('#optiontip').show();
  2201. });
  2202. $(document).on('input propertychange change', '#specs input', function () {
  2203. window.optionchanged = true;
  2204. $('#optiontip').show();
  2205. });
  2206. $(".spec_item_thumb").find('i').click(function(){
  2207. var group =$(this).parent();
  2208. group.find('img').attr('src',"{SNAILFISH_LOCAL}static/images/nopic100.jpg");
  2209. group.find(':hidden').val('');
  2210. $(this).hide();
  2211. group.find('img').popover('destroy');
  2212. });
  2213. });
  2214. function selectSpecItemImage(obj){
  2215. util.image('',function(val){
  2216. $(obj).attr('src',val.url).popover({
  2217. trigger: 'hover',
  2218. html: true,
  2219. container: $(document.body),
  2220. content: "<img src='" + val.url + "' style='width:100px;height:100px;' />",
  2221. placement: 'top'
  2222. });
  2223. var group =$(obj).parent();
  2224. group.find(':hidden').val(val.attachment), group.find('i').show().unbind('click').click(function(){
  2225. $(obj).attr('src',"{SNAILFISH_LOCAL}static/images/nopic100.jpg");
  2226. group.find(':hidden').val('');
  2227. group.find('i').hide();
  2228. $(obj).popover('destroy');
  2229. });
  2230. });
  2231. }
  2232. function addSpecList(options_name,spec_str, cur_cate_id)
  2233. {
  2234. var len = $(".spec_item").length;
  2235. $("#add-spec").html("正在处理...").attr("disabled", "true").toggleClass("btn-primary");
  2236. var url = "{:U('goods/mult_tpl',array('tpl'=>'spec'))}";
  2237. $.ajax({
  2238. "url": url,
  2239. type:'post',
  2240. data:{options_name:options_name,spec_str:spec_str,cur_cate_id:cur_cate_id},
  2241. success:function(data){
  2242. $("#add-spec").html('<i class="fa fa-plus"></i> 新建规格').removeAttr("disabled").toggleClass("btn-primary"); ;
  2243. $('#specs').append(data);
  2244. var len = $(".add-specitem").length -1;
  2245. $(".add-specitem:eq(" +len+ ")").focus();
  2246. refreshOptions();
  2247. }
  2248. });
  2249. }
  2250. function addSpec(){
  2251. var len = $(".spec_item").length;
  2252. $("#add-spec").html("正在处理...").attr("disabled", "true").toggleClass("btn-primary");
  2253. var url = "{:U('goods/tpl',array('tpl'=>'spec'))}";
  2254. $.ajax({
  2255. "url": url,
  2256. success:function(data){
  2257. $("#add-spec").html('<i class="fa fa-plus"></i> 新建规格').removeAttr("disabled").toggleClass("btn-primary"); ;
  2258. $('#specs').append(data);
  2259. var len = $(".add-specitem").length -1;
  2260. $(".add-specitem:eq(" +len+ ")").focus();
  2261. refreshOptions();
  2262. }
  2263. });
  2264. }
  2265. function removeSpec(specid){
  2266. if (confirm('确认要删除此规格?')){
  2267. $("#spec_" + specid).remove();
  2268. refreshOptions();
  2269. }
  2270. }
  2271. function addSpecItem(specid){
  2272. $("#add-specitem-" + specid).html("正在处理...").attr("disabled", "true");
  2273. var url = "{:U('goods/tpl',array('tpl'=>'specitem'))}" + "&specid=" + specid;
  2274. $.ajax({
  2275. "url": url,
  2276. success:function(data){
  2277. $("#add-specitem-" + specid).html('<i class="fa fa-plus"></i> 添加规格项').removeAttr("disabled");
  2278. $('#spec_item_' + specid).append(data);
  2279. var len = $("#spec_" + specid + " .spec_item_title").length -1;
  2280. $("#spec_" + specid + " .spec_item_title:eq(" +len+ ")").focus();
  2281. refreshOptions
  2282. if(type==3 && virtual==0){
  2283. $(".choosetemp").show();
  2284. }
  2285. }
  2286. });
  2287. }
  2288. function removeSpecItem(obj){
  2289. $(obj).closest('.spec_item_item').remove();
  2290. refreshOptions();
  2291. }
  2292. function refreshOptions(){
  2293. // 刷新后重置
  2294. window.optionchanged = false;
  2295. $('#optiontip').hide();
  2296. var html = '<table class="table table-bordered table-condensed"><thead><tr class="active">';
  2297. var specs = [];
  2298. if($('.spec_item').length<=0){
  2299. $("#options").html('');
  2300. $("#discount").html('');
  2301. $("#isdiscount_discounts").html('');
  2302. $("#commission").html('');
  2303. return;
  2304. }
  2305. $(".spec_item").each(function(i){
  2306. var _this = $(this);
  2307. var spec = {
  2308. id: _this.find(".spec_id").val(),
  2309. title: _this.find(".spec_title").val()
  2310. };
  2311. var items = [];
  2312. _this.find(".spec_item_item").each(function(){
  2313. var __this = $(this);
  2314. var item = {
  2315. id: __this.find(".spec_item_id").val(),
  2316. title: __this.find(".spec_item_title").val(),
  2317. virtual: __this.find(".spec_item_virtual").val(),
  2318. show:__this.find(".spec_item_show").get(0).checked?"1":"0"
  2319. }
  2320. items.push(item);
  2321. });
  2322. spec.items = items;
  2323. specs.push(spec);
  2324. });
  2325. specs.sort(function(x,y){
  2326. if (x.items.length > y.items.length){
  2327. return 1;
  2328. }
  2329. if (x.items.length < y.items.length) {
  2330. return -1;
  2331. }
  2332. });
  2333. var len = specs.length;
  2334. var newlen = 1;
  2335. var h = new Array(len);
  2336. var rowspans = new Array(len);
  2337. for(var i=0;i<len;i++){
  2338. html+="<th>" + specs[i].title + "</th>";
  2339. var itemlen = specs[i].items.length;
  2340. if(itemlen<=0) { itemlen = 1 };
  2341. newlen*=itemlen;
  2342. h[i] = new Array(newlen);
  2343. for(var j=0;j<newlen;j++){
  2344. h[i][j] = new Array();
  2345. }
  2346. var l = specs[i].items.length;
  2347. rowspans[i] = 1;
  2348. for(j=i+1;j<len;j++){
  2349. rowspans[i]*= specs[j].items.length;
  2350. }
  2351. }
  2352. var is_take_vipcard = $('input[name="is_take_vipcard"]').prop('checked');
  2353. html += '<th><div class=""><div style="padding-bottom:10px;text-align:center;">库存<label style="color:red;font-size:16px;font-weight:900">*</label></div><div class="input-group"><input type="text" class="form-control input-sm option_stock_all" VALUE=""/><span class="input-group-addon"><a href="javascript:;" class="fa fa-angle-double-down" title="批量设置" onclick="setCol(\'option_stock\');"></a></span></div></div></th>';
  2354. html += '<th class="type-4"><div class=""><div style="padding-bottom:10px;text-align:center;">售价<label style="color:red;font-size:16px;font-weight:900">*</label></div><div class="input-group"><input type="text" class="form-control input-sm option_marketprice_all"VALUE=""/><span class="input-group-addon"><a href="javascript:;" class="fa fa-angle-double-down" title="批量设置" onclick="setCol(\'option_marketprice\');"></a></span></div></div></th>';
  2355. html+='<th class="type-4"><div class=""><div style="padding-bottom:10px;text-align:center;">原价<label style="color:red;font-size:16px;font-weight:900">*</label></div><div class="input-group"><input type="text" class="form-control input-sm option_productprice_all"VALUE=""/><span class="input-group-addon"><a href="javascript:;" class="fa fa-angle-double-down" title="批量设置" onclick="setCol(\'option_productprice\');"></a></span></div></div></th>';
  2356. <?php if( !empty($is_open_vipcard_buy) && $is_open_vipcard_buy == 1){ ?>
  2357. html += '<th class="type-4 cardprice_title"><div class=""><div style="padding-bottom:10px;text-align:center;">付费会员专享价</div><div class="input-group"><input type="text" class="form-control input-sm option_cardprice_all"VALUE=""/><span class="input-group-addon"><a href="javascript:;" class="fa fa-angle-double-down" title="批量设置" onclick="setCol(\'option_cardprice\');"></a></span></div></div></th>';
  2358. <?php } ?>
  2359. html+='<th class="type-4"><div class=""><div style="padding-bottom:10px;text-align:center;">成本价</div><div class="input-group"><input type="text" class="form-control input-sm option_costprice_all"VALUE=""/><span class="input-group-addon"><a href="javascript:;" class="fa fa-angle-double-down" title="批量设置" onclick="setCol(\'option_costprice\');"></a></span></div></div></th>';
  2360. html+='<th><div class=""><div style="padding-bottom:10px;text-align:center;">编码</div><div class="input-group"><input type="text" class="form-control input-sm option_goodssn_all"VALUE=""/><span class="input-group-addon"><a href="javascript:;" class="fa fa-angle-double-down" title="批量设置" onclick="setCol(\'option_goodssn\');"></a></span></div></div></th>';
  2361. html+='<th><div class=""><div style="padding-bottom:10px;text-align:center;">重量(克)</div><div class="input-group"><input type="text" class="form-control input-sm option_weight_all"VALUE=""/><span class="input-group-addon"><a href="javascript:;" class="fa fa-angle-double-down" title="批量设置" onclick="setCol(\'option_weight\');"></a></span></div></div></th>';
  2362. html+='</tr></thead>';
  2363. for(var m=0;m<len;m++){
  2364. var k = 0,kid = 0,n=0;
  2365. for(var j=0;j<newlen;j++){
  2366. var rowspan = rowspans[m];
  2367. if( j % rowspan==0){
  2368. h[m][j]={title: specs[m].items[kid].title, virtual: specs[m].items[kid].virtual,html: "<td class='full' rowspan='" +rowspan + "'>"+ specs[m].items[kid].title+"</td>\r\n",id: specs[m].items[kid].id};
  2369. }
  2370. else{
  2371. h[m][j]={title:specs[m].items[kid].title,virtual: specs[m].items[kid].virtual, html: "",id: specs[m].items[kid].id};
  2372. }
  2373. n++;
  2374. if(n==rowspan){
  2375. kid++; if(kid>specs[m].items.length-1) { kid=0; }
  2376. n=0;
  2377. }
  2378. }
  2379. }
  2380. var hh = "";
  2381. for(var i=0;i<newlen;i++){
  2382. hh+="<tr>";
  2383. var ids = [];
  2384. var titles = [];
  2385. var virtuals = [];
  2386. /*for(var j=0;j<len;j++){
  2387. hh+=h[j][i].html;
  2388. ids.push( h[j][i].id);
  2389. titles.push( h[j][i].title);
  2390. virtuals.push( h[j][i].virtual);
  2391. }*/
  2392. for(var j=len-1;j >= 0;j--){
  2393. hh+=h[j][i].html;
  2394. ids.push( h[j][i].id);
  2395. titles.push( h[j][i].title);
  2396. virtuals.push( h[j][i].virtual);
  2397. }
  2398. ids =ids.join('_');
  2399. titles= titles.join('+');
  2400. var val ={ id : "",title:titles, stock : "",presell : "",costprice : "",productprice : "",<?php if( !empty($is_open_vipcard_buy) && $is_open_vipcard_buy == 1 ){ ?>cardprice:"",<?php } ?>marketprice : "",weight:"",productsn:"",goodssn:"",virtual:virtuals };
  2401. if( $(".option_id_" + ids).length>0){
  2402. val ={
  2403. id : $(".option_id_" + ids+":eq(0)").val(),
  2404. title: titles,
  2405. stock : $(".option_stock_" + ids+":eq(0)").val(),
  2406. presell : $(".option_presell_" + ids+":eq(0)").val(),
  2407. costprice : $(".option_costprice_" + ids+":eq(0)").val(),
  2408. <?php if( !empty($is_open_vipcard_buy) && $is_open_vipcard_buy == 1){ ?>
  2409. cardprice : $(".option_cardprice_" + ids+":eq(0)").val(),
  2410. cardprice_hi : $(".option_cardprice_hi_" + ids+":eq(0)").val(),
  2411. <?php } ?>
  2412. productprice : $(".option_productprice_" + ids+":eq(0)").val(),
  2413. marketprice : $(".option_marketprice_" + ids +":eq(0)").val(),
  2414. goodssn : $(".option_goodssn_" + ids +":eq(0)").val(),
  2415. productsn : $(".option_productsn_" + ids +":eq(0)").val(),
  2416. weight : $(".option_weight_" + ids+":eq(0)").val(),
  2417. virtual : virtuals
  2418. }
  2419. }
  2420. hh += '<td>'
  2421. hh += '<input name="option_stock_' + ids +'" type="text" class="form-control option_stock option_stock_' + ids +'" value="' +(val.stock=='undefined'?'':val.stock )+'"/></td>';
  2422. hh += '<input name="option_id_' + ids+'" type="hidden" class="form-control option_id option_id_' + ids +'" value="' +(val.id=='undefined'?'':val.id )+'"/>';
  2423. hh += '<input name="option_ids[]" type="hidden" class="form-control option_ids option_ids_' + ids +'" value="' + ids +'"/>';
  2424. hh += '<input name="option_title_' + ids +'" type="hidden" class="form-control option_title option_title_' + ids +'" value="' +(val.title=='undefined'?'':val.title )+'"/></td>';
  2425. hh += '<input name="option_virtual_' + ids +'" type="hidden" class="form-control option_virtual option_virtual_' + ids +'" value="' +(val.virtual=='undefined'?'':val.virtual )+'"/></td>';
  2426. hh += '<input name="option_cardprice_hi_' + ids +'" type="hidden" class="form-control option_virtual option_cardprice_hi_' + ids +'" value="' +(val.cardprice=='undefined'?'':val.cardprice )+'"/></td>';
  2427. hh += '</td>';
  2428. //hh += '<td class="type-4"><input data-name="option_presell_' + ids+'" type="text" class="form-control option_presell option_presell_' + ids +'" value="' +(val.presell=='undefined'?'':val.presell )+'"/></td>';
  2429. hh += '<td class="type-4"><input name="option_marketprice_' + ids+'" type="text" class="form-control option_marketprice option_marketprice_' + ids +'" value="' +(val.marketprice=='undefined'?'':val.marketprice )+'"/></td>';
  2430. hh += '<td class="type-4"><input name="option_productprice_' + ids+'" type="text" class="form-control option_productprice option_productprice_' + ids +'" " value="' +(val.productprice=='undefined'?'':val.productprice )+'"/></td>';
  2431. <?php if( !empty($is_open_vipcard_buy) && $is_open_vipcard_buy == 1){ ?>
  2432. if(typeof(val.cardprice) == "undefined" || val.cardprice == 'undefined' || val.cardprice == null){
  2433. val.cardprice = "";
  2434. }
  2435. if(val.cardprice == ""){
  2436. if(typeof(val.cardprice_hi) == "undefined" || val.cardprice_hi == 'undefined' || val.cardprice_hi == null){
  2437. val.cardprice = "";
  2438. }else{
  2439. val.cardprice = val.cardprice_hi;
  2440. }
  2441. }
  2442. console.log(val.cardprice+'=='+val.cardprice_hi);
  2443. hh += '<td class="type-4 cardprice_td"><input name="option_cardprice_' + ids + '" type="text" class="form-control option_cardprice option_cardprice_' + ids + '" " value="' + (val.cardprice=='undefined' ? '' : val.cardprice ) + '"/></td>';
  2444. <?php } ?>
  2445. hh += '<td class="type-4"><input name="option_costprice_' +ids+'" type="text" class="form-control option_costprice option_costprice_' + ids +'" " value="' +(val.costprice=='undefined'?'':val.costprice )+'"/></td>';
  2446. hh += '<td><input name="option_goodssn_' +ids+'" type="text" class="form-control option_goodssn option_goodssn_' + ids +'" " value="' +(val.goodssn=='undefined'?'':val.goodssn )+'"/></td>';
  2447. //hh += '<td><input data-name="option_productsn_' +ids+'" type="text" class="form-control option_productsn option_productsn_' + ids +'" " value="' +(val.productsn=='undefined'?'':val.productsn )+'"/></td>';
  2448. hh += '<td><input name="option_weight_' + ids +'" type="text" class="form-control option_weight option_weight_' + ids +'" " value="' +(val.weight=='undefined'?'':val.weight )+'"/></td>';
  2449. hh += "</tr>";
  2450. }
  2451. html+=hh;
  2452. html+="</table>";
  2453. $("#options").html(html);
  2454. refreshDiscount();
  2455. refreshIsDiscount();
  2456. if(window.type=='4'){
  2457. $('.type-4').hide();
  2458. }else{
  2459. $('.type-4').show();
  2460. }
  2461. if(is_take_vipcard) {
  2462. $('.cardprice_td').show();
  2463. $('.cardprice_title').show();
  2464. }else{
  2465. $('.cardprice_td').hide();
  2466. $('.cardprice_title').hide();
  2467. }
  2468. }
  2469. function refreshDiscount() {
  2470. var html = '<table class="table table-bordered table-condensed"><thead><tr class="active">';
  2471. var specs = [];
  2472. $(".spec_item").each(function (i) {
  2473. var _this = $(this);
  2474. var spec = {
  2475. id: _this.find(".spec_id").val(),
  2476. title: _this.find(".spec_title").val()
  2477. };
  2478. var items = [];
  2479. _this.find(".spec_item_item").each(function () {
  2480. var __this = $(this);
  2481. var item = {
  2482. id: __this.find(".spec_item_id").val(),
  2483. title: __this.find(".spec_item_title").val(),
  2484. virtual: __this.find(".spec_item_virtual").val(),
  2485. show: __this.find(".spec_item_show").get(0).checked ? "1" : "0"
  2486. }
  2487. items.push(item);
  2488. });
  2489. spec.items = items;
  2490. specs.push(spec);
  2491. });
  2492. specs.sort(function (x, y) {
  2493. if (x.items.length > y.items.length) {
  2494. return 1;
  2495. }
  2496. if (x.items.length < y.items.length) {
  2497. return -1;
  2498. }
  2499. });
  2500. var len = specs.length;
  2501. var newlen = 1;
  2502. var h = new Array(len);
  2503. var rowspans = new Array(len);
  2504. for (var i = 0; i < len; i++) {
  2505. html += "<th>" + specs[i].title + "</th>";
  2506. var itemlen = specs[i].items.length;
  2507. if (itemlen <= 0) {
  2508. itemlen = 1
  2509. }
  2510. ;
  2511. newlen *= itemlen;
  2512. h[i] = new Array(newlen);
  2513. for (var j = 0; j < newlen; j++) {
  2514. h[i][j] = new Array();
  2515. }
  2516. var l = specs[i].items.length;
  2517. rowspans[i] = 1;
  2518. for (j = i + 1; j < len; j++) {
  2519. rowspans[i] *= specs[j].items.length;
  2520. }
  2521. }
  2522. <?php foreach( $levels as $level ){ ?>
  2523. <?php if( $level['key']=='default'){ ?>
  2524. html += '<th><div class=""><div style="padding-bottom:10px;text-align:center;">{$level['levelname']}</div><div class="input-group"><input type="text" class="form-control input-sm discount_{$level["key"]}_all"VALUE=""/><span class="input-group-addon"><a href="javascript:;" class="fa fa-angle-double-down" title="批量设置" onclick="setCol(\'discount_{$level["key"]}\');"></a></span></div></div></th>';
  2525. <?php }else{ ?>
  2526. html += '<th><div class=""><div style="padding-bottom:10px;text-align:center;">{$level['levelname']}</div><div class="input-group"><input type="text" class="form-control input-sm discount_level{$level['id']}_all"VALUE=""/><span class="input-group-addon"><a href="javascript:;" class="fa fa-angle-double-down" title="批量设置" onclick="setCol(\'discount_level{$level['id']}\');"></a></span></div></div></th>';
  2527. <?php } ?>
  2528. <?php } ?>
  2529. html += '</tr></thead>';
  2530. for (var m = 0; m < len; m++) {
  2531. var k = 0, kid = 0, n = 0;
  2532. for (var j = 0; j < newlen; j++) {
  2533. var rowspan = rowspans[m];
  2534. if (j % rowspan == 0) {
  2535. h[m][j] = {
  2536. title: specs[m].items[kid].title,
  2537. virtual: specs[m].items[kid].virtual,
  2538. html: "<td class='full' rowspan='" + rowspan + "'>" + specs[m].items[kid].title + "</td>\r\n",
  2539. id: specs[m].items[kid].id
  2540. };
  2541. }
  2542. else {
  2543. h[m][j] = {
  2544. title: specs[m].items[kid].title,
  2545. virtual: specs[m].items[kid].virtual,
  2546. html: "",
  2547. id: specs[m].items[kid].id
  2548. };
  2549. }
  2550. n++;
  2551. if (n == rowspan) {
  2552. kid++;
  2553. if (kid > specs[m].items.length - 1) {
  2554. kid = 0;
  2555. }
  2556. n = 0;
  2557. }
  2558. }
  2559. }
  2560. var hh = "";
  2561. for (var i = 0; i < newlen; i++) {
  2562. hh += "<tr>";
  2563. var ids = [];
  2564. var titles = [];
  2565. var virtuals = [];
  2566. for (var j = 0; j < len; j++) {
  2567. hh += h[j][i].html;
  2568. ids.push(h[j][i].id);
  2569. titles.push(h[j][i].title);
  2570. virtuals.push(h[j][i].virtual);
  2571. }
  2572. ids = ids.join('_');
  2573. titles = titles.join('+');
  2574. var val = {
  2575. id: "",
  2576. title: titles,
  2577. <?php foreach( $levels as $level ){ ?>
  2578. <?php if( $level['key']=='default'){ ?>
  2579. level{$level['key']}: '',
  2580. <?php }else{ ?>
  2581. level{$level['id']}: '',
  2582. <?php } ?>
  2583. <?php } ?>
  2584. costprice: "",
  2585. presell: "",
  2586. productprice: "",
  2587. <?php if( !empty($is_open_vipcard_buy) && $is_open_vipcard_buy == 1){ ?>
  2588. cardprice: "",
  2589. <?php } ?>
  2590. marketprice: "",
  2591. weight: "",
  2592. productsn: "",
  2593. goodssn: "",
  2594. virtual: virtuals
  2595. };
  2596. var val ={ id : "",title:titles,<?php foreach( $levels as $level ){ ?><?php if( $level['key']=='default'){ ?> level{$level['key']}: '',<?php }else{ ?> level{$level['id']}: '',<?php } ?><?php } ?>costprice : "",productprice : "",marketprice : "",weight:"",productsn:"",goodssn:"",virtual:virtuals };
  2597. if ($(".discount_id_" + ids).length > 0) {
  2598. val = {
  2599. id: $(".discount_id_" + ids + ":eq(0)").val(),
  2600. title: titles,
  2601. <?php foreach( $levels as $level ){ ?>
  2602. <?php if( $level['key']=='default'){ ?>
  2603. level{$level['key']}: $(".discount_{$level['key']}_" + ids + ":eq(0)").val(),
  2604. <?php }else{ ?>
  2605. level{$level['id']}: $(".discount_level{$level['id']}_" + ids + ":eq(0)").val(),
  2606. <?php } ?>
  2607. <?php } ?>
  2608. costprice: $(".discount_costprice_" + ids + ":eq(0)").val(),
  2609. presell: $(".discount_presell_" + ids + ":eq(0)").val(),
  2610. productprice: $(".discount_productprice_" + ids + ":eq(0)").val(),
  2611. <?php if( !empty($is_open_vipcard_buy) && $is_open_vipcard_buy == 1){ ?>
  2612. cardprice: $(".discount_cardprice_" + ids + ":eq(0)").val(),
  2613. <?php } ?>
  2614. marketprice: $(".discount_marketprice_" + ids + ":eq(0)").val(),
  2615. presell: $(".discount_presell_" + ids + ":eq(0)").val(),
  2616. goodssn: $(".discount_goodssn_" + ids + ":eq(0)").val(),
  2617. productsn: $(".discount_productsn_" + ids + ":eq(0)").val(),
  2618. weight: $(".discount_weight_" + ids + ":eq(0)").val(),
  2619. virtual: virtuals
  2620. }
  2621. }
  2622. <?php foreach( $levels as $level ){ ?>
  2623. hh += '<td>'
  2624. <?php if( $level['key']=='default'){ ?>
  2625. hh += '<input data-name="discount_level_{$level['key']}_' + ids +'"type="text" class="form-control discount_{$level['key']} discount_{$level['key']}_' + ids +'" value="' +(val.level{$level['key']}=='undefined'?'':val.level{$level['key']} )+'"/>';
  2626. <?php }else{ ?>
  2627. hh += '<input data-name="discount_level_{$level['id']}_' + ids +'"type="text" class="form-control discount_level{$level['id']} discount_level{$level['id']}_' + ids +'" value="' +(val.level{$level['id']}=='undefined'?'':val.level{$level['id']} )+'"/>';
  2628. <?php } ?>
  2629. hh += '</td>';
  2630. <?php } ?>
  2631. hh += '<input data-name="discount_id_' + ids+'"type="hidden" class="form-control discount_id discount_id_' + ids +'" value="' +(val.id=='undefined'?'':val.id )+'"/>';
  2632. hh += '<input data-name="discount_ids"type="hidden" class="form-control discount_ids discount_ids_' + ids +'" value="' + ids +'"/>';
  2633. hh += '<input data-name="discount_title_' + ids +'"type="hidden" class="form-control discount_title discount_title_' + ids +'" value="' +(val.title=='undefined'?'':val.title )+'"/></td>';
  2634. hh += '<input data-name="discount_virtual_' + ids +'"type="hidden" class="form-control discount_virtual discount_virtual_' + ids +'" value="' +(val.virtual=='undefined'?'':val.virtual )+'"/></td>';
  2635. hh += "</tr>";
  2636. }
  2637. html += hh;
  2638. html += "</table>";
  2639. $("#discount").html(html);
  2640. }
  2641. function refreshIsDiscount() {
  2642. var html = '<table class="table table-bordered table-condensed"><thead><tr class="active">';
  2643. var specs = [];
  2644. $(".spec_item").each(function (i) {
  2645. var _this = $(this);
  2646. var spec = {
  2647. id: _this.find(".spec_id").val(),
  2648. title: _this.find(".spec_title").val()
  2649. };
  2650. var items = [];
  2651. _this.find(".spec_item_item").each(function () {
  2652. var __this = $(this);
  2653. var item = {
  2654. id: __this.find(".spec_item_id").val(),
  2655. title: __this.find(".spec_item_title").val(),
  2656. virtual: __this.find(".spec_item_virtual").val(),
  2657. show: __this.find(".spec_item_show").get(0).checked ? "1" : "0"
  2658. }
  2659. items.push(item);
  2660. });
  2661. spec.items = items;
  2662. specs.push(spec);
  2663. });
  2664. specs.sort(function (x, y) {
  2665. if (x.items.length > y.items.length) {
  2666. return 1;
  2667. }
  2668. if (x.items.length < y.items.length) {
  2669. return -1;
  2670. }
  2671. });
  2672. var len = specs.length;
  2673. var newlen = 1;
  2674. var h = new Array(len);
  2675. var rowspans = new Array(len);
  2676. for (var i = 0; i < len; i++) {
  2677. html += "<th>" + specs[i].title + "</th>";
  2678. var itemlen = specs[i].items.length;
  2679. if (itemlen <= 0) {
  2680. itemlen = 1
  2681. }
  2682. ;
  2683. newlen *= itemlen;
  2684. h[i] = new Array(newlen);
  2685. for (var j = 0; j < newlen; j++) {
  2686. h[i][j] = new Array();
  2687. }
  2688. var l = specs[i].items.length;
  2689. rowspans[i] = 1;
  2690. for (j = i + 1; j < len; j++) {
  2691. rowspans[i] *= specs[j].items.length;
  2692. }
  2693. }
  2694. <?php foreach( $levels as $level ){ ?>
  2695. <?php if( $level['key']=='default'){ ?>
  2696. html += '<th><div class=""><div style="padding-bottom:10px;text-align:center;">{$level['levelname']}</div><div class="input-group"><input type="text" class="form-control input-sm isdiscount_discounts_{$level['key']}_all"VALUE=""/><span class="input-group-addon"><a href="javascript:;" class="fa fa-angle-double-down" title="批量设置" onclick="setCol(\'isdiscount_discounts_{$level['key']}\');"></a></span></div></div></th>';
  2697. <?php }else{ ?>
  2698. html += '<th><div class=""><div style="padding-bottom:10px;text-align:center;">{$level['levelname']}</div><div class="input-group"><input type="text" class="form-control input-sm isdiscount_discounts_level{$level['id']}_all"VALUE=""/><span class="input-group-addon"><a href="javascript:;" class="fa fa-angle-double-down" title="批量设置" onclick="setCol(\'isdiscount_discounts_level{$level['id']}\');"></a></span></div></div></th>';
  2699. <?php } ?>
  2700. <?php } ?>
  2701. html += '</tr></thead>';
  2702. for (var m = 0; m < len; m++) {
  2703. var k = 0, kid = 0, n = 0;
  2704. for (var j = 0; j < newlen; j++) {
  2705. var rowspan = rowspans[m];
  2706. if (j % rowspan == 0) {
  2707. h[m][j] = {
  2708. title: specs[m].items[kid].title,
  2709. virtual: specs[m].items[kid].virtual,
  2710. html: "<td class='full' rowspan='" + rowspan + "'>" + specs[m].items[kid].title + "</td>\r\n",
  2711. id: specs[m].items[kid].id
  2712. };
  2713. }
  2714. else {
  2715. h[m][j] = {
  2716. title: specs[m].items[kid].title,
  2717. virtual: specs[m].items[kid].virtual,
  2718. html: "",
  2719. id: specs[m].items[kid].id
  2720. };
  2721. }
  2722. n++;
  2723. if (n == rowspan) {
  2724. kid++;
  2725. if (kid > specs[m].items.length - 1) {
  2726. kid = 0;
  2727. }
  2728. n = 0;
  2729. }
  2730. }
  2731. }
  2732. var hh = "";
  2733. for (var i = 0; i < newlen; i++) {
  2734. hh += "<tr>";
  2735. var ids = [];
  2736. var titles = [];
  2737. var virtuals = [];
  2738. for (var j = 0; j < len; j++) {
  2739. hh += h[j][i].html;
  2740. ids.push(h[j][i].id);
  2741. titles.push(h[j][i].title);
  2742. virtuals.push(h[j][i].virtual);
  2743. }
  2744. ids = ids.join('_');
  2745. titles = titles.join('+');
  2746. var val = {
  2747. id: "",
  2748. title: titles,
  2749. <?php foreach( $levels as $level ){ ?>
  2750. <?php if( $level['key']=='default'){ ?>
  2751. level{$level['key']}: '',
  2752. <?php }else{ ?>
  2753. level{$level['if']}: '',
  2754. <?php } ?>
  2755. <?php } ?>
  2756. costprice: "",
  2757. presell: "",
  2758. productprice: "",
  2759. marketprice: "",
  2760. weight: "",
  2761. productsn: "",
  2762. goodssn: "",
  2763. virtual: virtuals
  2764. };
  2765. var val ={ id : "",title:titles,<?php foreach( $levels as $level ){ ?><?php if( $level['key']=='default'){ ?> level{$level['key']}: '',<?php }else{ ?> level{$level['id']}: '',<?php } ?><?php } ?>costprice : "",productprice : "",marketprice : "",weight:"",productsn:"",goodssn:"",virtual:virtuals };
  2766. if ($(".isdiscount_discounts_id_" + ids).length > 0) {
  2767. val = {
  2768. id: $(".isdiscount_discounts_id_" + ids + ":eq(0)").val(),
  2769. title: titles,
  2770. <?php foreach( $levels as $level ){ ?>
  2771. <?php if( $level['key']=='default'){ ?>
  2772. level{$level['key']}: $(".isdiscount_discounts_{$level['key']}_" + ids + ":eq(0)").val(),
  2773. <?php }else{ ?>
  2774. level{$level['id']}: $(".isdiscount_discounts_level{$level['id']}_" + ids + ":eq(0)").val(),
  2775. <?php } ?>
  2776. <?php } ?>
  2777. costprice: $(".isdiscount_discounts_costprice_" + ids + ":eq(0)").val(),
  2778. productprice: $(".isdiscount_discounts_productprice_" + ids + ":eq(0)").val(),
  2779. marketprice: $(".isdiscount_discounts_marketprice_" + ids + ":eq(0)").val(),
  2780. presell: $(".isdiscount_discounts_presell_" + ids + ":eq(0)").val(),
  2781. goodssn: $(".isdiscount_discounts_goodssn_" + ids + ":eq(0)").val(),
  2782. productsn: $(".isdiscount_discounts_productsn_" + ids + ":eq(0)").val(),
  2783. weight: $(".isdiscount_discounts_weight_" + ids + ":eq(0)").val(),
  2784. virtual: virtuals
  2785. }
  2786. }
  2787. <?php foreach( $levels as $level ){ ?>
  2788. hh += '<td>'
  2789. <?php if( $level['key']=='default'){ ?>
  2790. hh += '<input data-name="isdiscount_discounts_level_{$level['key']}_' + ids +'"type="text" class="form-control isdiscount_discounts_{$level['key']} isdiscount_discounts_{$level['key']}_' + ids +'" value="' +(val.level{$level['key']}=='undefined'?'':val.level{$level['key']} )+'"/>';
  2791. <?php }else{ ?>
  2792. hh += '<input data-name="isdiscount_discounts_level_{$level['id']}_' + ids +'"type="text" class="form-control isdiscount_discounts_level{$level['id']} isdiscount_discounts_level{$level['id']}_' + ids +'" value="' +(val.level{$level['id']}=='undefined'?'':val.level{$level['id']} )+'"/>';
  2793. <?php } ?>
  2794. hh += '</td>';
  2795. <?php } ?>
  2796. hh += '<input data-name="isdiscount_discounts_id_' + ids+'"type="hidden" class="form-control isdiscount_discounts_id isdiscount_discounts_id_' + ids +'" value="' +(val.id=='undefined'?'':val.id )+'"/>';
  2797. hh += '<input data-name="isdiscount_discounts_ids"type="hidden" class="form-control isdiscount_discounts_ids isdiscount_discounts_ids_' + ids +'" value="' + ids +'"/>';
  2798. hh += '<input data-name="isdiscount_discounts_title_' + ids +'"type="hidden" class="form-control isdiscount_discounts_title isdiscount_discounts_title_' + ids +'" value="' +(val.title=='undefined'?'':val.title )+'"/></td>';
  2799. hh += '<input data-name="isdiscount_discounts_virtual_' + ids +'"type="hidden" class="form-control isdiscount_discounts_virtual isdiscount_discounts_virtual_' + ids +'" value="' +(val.virtual=='undefined'?'':val.virtual )+'"/></td>';
  2800. hh += "</tr>";
  2801. }
  2802. html += hh;
  2803. html += "</table>";
  2804. $("#isdiscount_discounts").html(html);
  2805. }
  2806. function refreshCommission() {
  2807. var commission_level = {:json_encode($commission_level)};
  2808. var html = '<table class="table table-bordered table-condensed"><thead><tr class="active">';
  2809. var specs = [];
  2810. $(".spec_item").each(function (i) {
  2811. var _this = $(this);
  2812. var spec = {
  2813. id: _this.find(".spec_id").val(),
  2814. title: _this.find(".spec_title").val()
  2815. };
  2816. var items = [];
  2817. _this.find(".spec_item_item").each(function () {
  2818. var __this = $(this);
  2819. var item = {
  2820. id: __this.find(".spec_item_id").val(),
  2821. title: __this.find(".spec_item_title").val(),
  2822. virtual: __this.find(".spec_item_virtual").val(),
  2823. show: __this.find(".spec_item_show").get(0).checked ? "1" : "0"
  2824. }
  2825. items.push(item);
  2826. });
  2827. spec.items = items;
  2828. specs.push(spec);
  2829. });
  2830. specs.sort(function (x, y) {
  2831. if (x.items.length > y.items.length) {
  2832. return 1;
  2833. }
  2834. if (x.items.length < y.items.length) {
  2835. return -1;
  2836. }
  2837. });
  2838. var len = specs.length;
  2839. var newlen = 1;
  2840. var h = new Array(len);
  2841. var rowspans = new Array(len);
  2842. for (var i = 0; i < len; i++) {
  2843. html += "<th>" + specs[i].title + "</th>";
  2844. var itemlen = specs[i].items.length;
  2845. if (itemlen <= 0) {
  2846. itemlen = 1
  2847. }
  2848. ;
  2849. newlen *= itemlen;
  2850. h[i] = new Array(newlen);
  2851. for (var j = 0; j < newlen; j++) {
  2852. h[i][j] = new Array();
  2853. }
  2854. var l = specs[i].items.length;
  2855. rowspans[i] = 1;
  2856. for (j = i + 1; j < len; j++) {
  2857. rowspans[i] *= specs[j].items.length;
  2858. }
  2859. }
  2860. $.each(commission_level,function (key,level) {
  2861. html += '<th><div class=""><div style="padding-bottom:10px;text-align:center;">'+level.levelname+'</div></div></th>';
  2862. })
  2863. html += '</tr></thead>';
  2864. for (var m = 0; m < len; m++) {
  2865. var k = 0, kid = 0, n = 0;
  2866. for (var j = 0; j < newlen; j++) {
  2867. var rowspan = rowspans[m];
  2868. if (j % rowspan == 0) {
  2869. h[m][j] = {
  2870. title: specs[m].items[kid].title,
  2871. virtual: specs[m].items[kid].virtual,
  2872. html: "<td class='full' rowspan='" + rowspan + "'>" + specs[m].items[kid].title + "</td>\r\n",
  2873. id: specs[m].items[kid].id
  2874. };
  2875. }
  2876. else {
  2877. h[m][j] = {
  2878. title: specs[m].items[kid].title,
  2879. virtual: specs[m].items[kid].virtual,
  2880. html: "",
  2881. id: specs[m].items[kid].id
  2882. };
  2883. }
  2884. n++;
  2885. if (n == rowspan) {
  2886. kid++;
  2887. if (kid > specs[m].items.length - 1) {
  2888. kid = 0;
  2889. }
  2890. n = 0;
  2891. }
  2892. }
  2893. }
  2894. var hh = "";
  2895. for (var i = 0; i < newlen; i++) {
  2896. hh += "<tr>";
  2897. var ids = [];
  2898. var titles = [];
  2899. var virtuals = [];
  2900. for (var j = 0; j < len; j++) {
  2901. hh += h[j][i].html;
  2902. ids.push(h[j][i].id);
  2903. titles.push(h[j][i].title);
  2904. virtuals.push(h[j][i].virtual);
  2905. }
  2906. ids = ids.join('_');
  2907. titles = titles.join('+');
  2908. var val = {
  2909. id: "",
  2910. title: titles,
  2911. <?php foreach( $commission_level as $level ){ ?>
  2912. <?php if( $level["key"] == "default"){ ?>
  2913. level{$level['key']}: '',
  2914. <?php }else{ ?>
  2915. level{$level['id']}: '',
  2916. <?php } ?>
  2917. <?php } ?>
  2918. costprice: "",
  2919. presell: "",
  2920. productprice: "",
  2921. marketprice: "",
  2922. weight: "",
  2923. productsn: "",
  2924. goodssn: "",
  2925. virtual: virtuals
  2926. };
  2927. var val ={ id : "",title:titles,<?php foreach( $commission_level as $level ){ ?> <?php if( $level["key"] == "default"){ ?>level{$level['key']}: '',<?php }else{ ?>level{$level['id']}: '',<?php } ?><?php } ?>costprice : "",productprice : "",marketprice : "",weight:"",productsn:"",goodssn:"",virtual:virtuals };
  2928. <?php foreach( $commission_level as $level ){ ?>
  2929. <?php if( $level["key"] == "default"){ ?>
  2930. var level{$level['key']} = new Array(3);
  2931. $(".commission_{$level['key']}_"+ ids).each(function(index,val){
  2932. level{$level['key']}[index] = val;
  2933. })
  2934. <?php }else{ ?>
  2935. var level{$level['id']} = new Array(3);
  2936. $(".commission_level{$level['id']}_"+ ids).each(function(index,val){
  2937. level{$level['id']}[index] = val;
  2938. })
  2939. <?php } ?>
  2940. <?php } ?>
  2941. if ($(".commission_id_" + ids).length > 0) {
  2942. val = {
  2943. id: $(".commission_id_" + ids + ":eq(0)").val(),
  2944. title: titles,
  2945. costprice: $(".commission_costprice_" + ids + ":eq(0)").val(),
  2946. presell: $(".commission_presell_" + ids + ":eq(0)").val(),
  2947. productprice: $(".commission_productprice_" + ids + ":eq(0)").val(),
  2948. marketprice: $(".commission_marketprice_" + ids + ":eq(0)").val(),
  2949. goodssn: $(".commission_goodssn_" + ids + ":eq(0)").val(),
  2950. productsn: $(".commission_productsn_" + ids + ":eq(0)").val(),
  2951. weight: $(".commission_weight_" + ids + ":eq(0)").val(),
  2952. virtual: virtuals
  2953. }
  2954. }
  2955. <?php foreach( $commission_level as $level ){ ?>
  2956. hh += '<td>';
  2957. var level_temp = <?php if( $level['key'] == 'default'){ ?>level{$level['key']}<?php }else{ ?>level{$level['id']}<?php } ?>;
  2958. if (len >= i && typeof (level_temp) != 'undefined')
  2959. {
  2960. if('{$level['key']}' == 'default')
  2961. {
  2962. for (var li = 0; li<{$shopset_level};li++)
  2963. {
  2964. if (typeof (level_temp[li])!= "undefined")
  2965. {
  2966. hh += '<input data-name="commission_level_{$level['key']}_' +ids+ '" type="text" class="form-control commission_{$level['key']} commission_{$level['key']}_' +ids+ '" value="' +$(level_temp[li]).val()+ '" style="display:inline;width: '+96/parseInt({$shopset_level})+'%;"/> ';
  2967. }
  2968. else
  2969. {
  2970. hh += '<input data-name="commission_level_{$level['key']}_' +ids+ '" type="text" class="form-control commission_{$level['key']} commission_{$level['key']}_' +ids+ '" value="" style="display:inline;width: '+96/parseInt({$shopset_level})+'%;"/> ';
  2971. }
  2972. }
  2973. }
  2974. else
  2975. {
  2976. for (var li = 0; li<{$shopset_level};li++)
  2977. {
  2978. if (typeof (level_temp[li])!= "undefined")
  2979. {
  2980. hh += '<input data-name="commission_level_{$level['id']}_' +ids+ '" type="text" class="form-control commission_level{$level['id']} commission_level{$level['id']}_' +ids+ '" value="' +$(level_temp[li]).val()+ '" style="display:inline;width: '+96/parseInt({$shopset_level})+'%;"/> ';
  2981. }
  2982. else
  2983. {
  2984. hh += '<input data-name="commission_level_{$level['id']}_' +ids+ '" type="text" class="form-control commission_level{$level['id']} commission_level{$level['id']}_' +ids+ '" value="" style="display:inline;width: '+96/parseInt({$shopset_level})+'%;"/> ';
  2985. }
  2986. }
  2987. }
  2988. }
  2989. else
  2990. {
  2991. if('{$level['key']}' == 'default')
  2992. {
  2993. for (var li = 0; li<{$shopset_level};li++)
  2994. {
  2995. if (typeof (level_temp[li])!= "undefined")
  2996. {
  2997. hh += '<input data-name="commission_level_{$level['key']}_' +ids+ '" type="text" class="form-control commission_{$level['key']} commission_{$level['key']}_' +ids+ '" value="' +$(level_temp[li]).val()+ '" style="display:inline;width: '+96/parseInt({$shopset_level})+'%;"/> ';
  2998. }
  2999. else
  3000. {
  3001. hh += '<input data-name="commission_level_{$level['key']}_' +ids+ '" type="text" class="form-control commission_{$level['key']} commission_{$level['key']}_' +ids+ '" value="" style="display:inline;width: '+96/parseInt({$shopset_level})+'%;"/> ';
  3002. }
  3003. }
  3004. }
  3005. else
  3006. {
  3007. for (var li = 0; li<{$shopset_level};li++)
  3008. {
  3009. if (typeof (level_temp[li])!= "undefined")
  3010. {
  3011. hh += '<input data-name="commission_level_{$level['id']}_' +ids+ '" type="text" class="form-control commission_level{$level['id']} commission_level{$level['id']}_' +ids+ '" value="' +$(level_temp[li]).val()+ '" style="display:inline;width: '+96/parseInt({$shopset_level})+'%;"/> ';
  3012. }
  3013. else
  3014. {
  3015. hh += '<input data-name="commission_level_{$level['id']}_' +ids+ '" type="text" class="form-control commission_level{$level['id']} commission_level{$level['id']}_' +ids+ '" value="" style="display:inline;width: '+96/parseInt({$shopset_level})+'%;"/> ';
  3016. }
  3017. }
  3018. }
  3019. }
  3020. hh += '</td>';
  3021. <?php } ?>
  3022. hh += '<input data-name="commission_id_' + ids+'"type="hidden" class="form-control commission_id commission_id_' + ids +'" value="' +(val.id=='undefined'?'':val.id )+'"/>';
  3023. hh += '<input data-name="commission_ids"type="hidden" class="form-control commission_ids commission_ids_' + ids +'" value="' + ids +'"/>';
  3024. hh += '<input data-name="commission_title_' + ids +'"type="hidden" class="form-control commission_title commission_title_' + ids +'" value="' +(val.title=='undefined'?'':val.title )+'"/></td>';
  3025. hh += '<input data-name="commission_virtual_' + ids +'"type="hidden" class="form-control commission_virtual commission_virtual_' + ids +'" value="' +(val.virtual=='undefined'?'':val.virtual )+'"/></td>';
  3026. hh += "</tr>";
  3027. }
  3028. html += hh;
  3029. html += "</table>";
  3030. $("#commission").html(html);
  3031. }
  3032. function setCol(cls){
  3033. $("."+cls).val( $("."+cls+"_all").val());
  3034. }
  3035. function showItem(obj){
  3036. var show = $(obj).get(0).checked?"1":"0";
  3037. $(obj).parents('.spec_item_item').find('.spec_item_show:eq(0)').val(show);
  3038. }
  3039. function nofind(){
  3040. var img=event.srcElement;
  3041. img.src="./resource/image/module-nopic-small.jpg";
  3042. img.onerror=null;
  3043. }
  3044. function choosetemp(id){
  3045. $('#modal-module-chooestemp').modal();
  3046. $('#modal-module-chooestemp').data("temp",id);
  3047. }
  3048. function addtemp(){
  3049. var id = $('#modal-module-chooestemp').data("temp");
  3050. var temp_id = $('#modal-module-chooestemp').find("select").val();
  3051. var temp_name = $('#modal-module-chooestemp option[value='+temp_id+']').text();
  3052. //alert(temp_id+":"+temp_name);
  3053. $("#temp_name_"+id).val(temp_name);
  3054. $("#temp_id_"+id).val(temp_id);
  3055. $('#modal-module-chooestemp .close').click();
  3056. refreshOptions()
  3057. }
  3058. function setinterval(type)
  3059. {
  3060. var intervalfloor =$('#intervalfloor').val();
  3061. if(intervalfloor=="")
  3062. {
  3063. intervalfloor=0;
  3064. }
  3065. intervalfloor = parseInt(intervalfloor);
  3066. if(type=='plus')
  3067. {
  3068. if(intervalfloor==3)
  3069. {
  3070. tip.msgbox.err("最多添加三个区间价格");
  3071. return;
  3072. }
  3073. intervalfloor=intervalfloor+1;
  3074. }
  3075. else if(type=='minus')
  3076. {
  3077. if(intervalfloor==0)
  3078. {
  3079. tip.msgbox.err("请最少添加一个区间价格");
  3080. return;
  3081. }
  3082. intervalfloor=intervalfloor-1;
  3083. }else
  3084. {
  3085. return;
  3086. }
  3087. if(intervalfloor<1)
  3088. {
  3089. $('#interval1').hide();
  3090. $('#intervalnum1').val("");
  3091. $('#intervalprice1').val("");
  3092. }else
  3093. {
  3094. $('#interval1').show();
  3095. }
  3096. if(intervalfloor<2)
  3097. {
  3098. $('#interval2').hide();
  3099. $('#intervalnum2').val("");
  3100. $('#intervalprice2').val("");
  3101. }else
  3102. {
  3103. $('#interval2').show();
  3104. }
  3105. if(intervalfloor<3)
  3106. {
  3107. $('#interval3').hide();
  3108. $('#intervalnum3').val("");
  3109. $('#intervalprice3').val("");
  3110. }else
  3111. {
  3112. $('#interval3').show();
  3113. }
  3114. $('#intervalfloor').val(intervalfloor);
  3115. }
  3116. </script>
  3117. <script language="javascript">
  3118. $(function() {
  3119. })
  3120. </script>
  3121. <script>
  3122. var heads_page = 1;
  3123. $("body").delegate("#batchheads_page .pagination a","click",function(){
  3124. heads_page = $(this).attr('page');
  3125. search_heads_do();
  3126. })
  3127. function search_heads()
  3128. {
  3129. heads_page = 1;
  3130. search_heads_do();
  3131. }
  3132. function search_heads_do()
  3133. {
  3134. var province_name = $('#sel-provance').val();
  3135. var city_name = $('#sel-city').val();
  3136. var area_name = $('#sel-area').val();
  3137. var country_name = $('#sel-street').val();
  3138. var keyword = $('#supply_id_input').val();
  3139. $.post("{:U('communityhead/query_head')}",{page:heads_page,'province_name':province_name,'city_name': city_name,'area_name':area_name,'country_name':country_name,'keyword':keyword},
  3140. function (ret) {
  3141. if (ret.status == 1) {
  3142. $('#batchheads_content').html(ret.html);
  3143. $('#batchheads_page').html(ret.page_html);
  3144. return
  3145. } else {
  3146. layer.msg('修改失败');
  3147. }
  3148. }, 'json');
  3149. }
  3150. //显示批量分类
  3151. $('#batchcatesbut').click(function () {
  3152. // var index = layer.load(1);
  3153. var index = layer.open({
  3154. type: 1,
  3155. area: '500px',
  3156. title: '选取分类'
  3157. ,content: $('#batchcates_html').html(),
  3158. yes: function(index, layero){
  3159. //do something
  3160. layer.close(index); //如果设定了yes回调,需进行手工关闭
  3161. }
  3162. });
  3163. })
  3164. $('#batch_head_group').click(function () {
  3165. // var index = layer.load(1);
  3166. var index = layer.open({
  3167. type: 1,
  3168. area: '500px',
  3169. title: '选取团长分组'
  3170. ,content: $('#batchcates_headgroup_html').html(),
  3171. yes: function(index, layero){
  3172. //do something
  3173. layer.close(index); //如果设定了yes回调,需进行手工关闭
  3174. }
  3175. });
  3176. })
  3177. $('#batch_head_group2').click(function () {
  3178. // var index = layer.load(1);
  3179. var index = layer.open({
  3180. type: 1,
  3181. area: '500px',
  3182. title: '选取团长分组'
  3183. ,content: $('#batchcates_headgroup_html').html(),
  3184. yes: function(index, layero){
  3185. //do something
  3186. layer.close(index); //如果设定了yes回调,需进行手工关闭
  3187. }
  3188. });
  3189. })
  3190. $('.check_heads_all').click(function(){
  3191. //head_id
  3192. if($(this).is(':checked')){
  3193. $('.head_id').prop('checked',true);
  3194. }else{
  3195. $('.head_id').prop('checked',false);
  3196. }
  3197. })
  3198. $(".radio_sale").click(function(){
  3199. var checkedvalue = $("input[name='is_all_sale']:checked").val();
  3200. if(checkedvalue == 1){
  3201. }else{
  3202. cascdeInit("1","1","","","","");
  3203. search_heads_do();
  3204. var offs_lf = ( $(window).width() -720 )/2;
  3205. var offs_ht = ( $(window).height() -690 )/2;
  3206. $('#batchheads .modal-dialog').css('top',offs_ht+'px');
  3207. $('#batchheads .modal-dialog').css('margin-top','0px');
  3208. $('#batchheads .modal-dialog').css('left',offs_lf+'px');
  3209. $('#batchheads .modal-dialog').css('margin-left','0px');
  3210. $('#batchheads').show();
  3211. }
  3212. })
  3213. $('#batchcatesbut2').click(function () {
  3214. var index = layer.open({
  3215. type: 1,
  3216. area: '500px',
  3217. title: '选取分类'
  3218. ,content: $('#batchcates_html').html(),
  3219. yes: function(index, layero){
  3220. //do something
  3221. layer.close(index); //如果设定了yes回调,需进行手工关闭
  3222. }
  3223. });
  3224. })
  3225. //关闭批量分类
  3226. $('.modal-header .close').click(function () {
  3227. $('#batchcates').hide();
  3228. $('#batchheads').hide();
  3229. $('#batch_time').hide();
  3230. })
  3231. // 取消批量分类
  3232. $('.modal-footer .btn.btn-default').click(function () {
  3233. $('#batchcates').hide();
  3234. $('#batchheads').hide();
  3235. $('#batch_time').hide();
  3236. })
  3237. $('.model_heads').click(function(){
  3238. var head_id_arr = [];
  3239. $('.head_id').each(function(){
  3240. if($(this).is(':checked')) {
  3241. head_id_arr.push( $(this).val() )
  3242. }
  3243. })
  3244. //modal-group-head
  3245. var is_clear_old = 0;
  3246. if( $('#is_cancle_old').is(':checked') )
  3247. {
  3248. is_clear_old = 1;
  3249. }
  3250. var is_cancle_allhead2 = 0;
  3251. if( $('#is_cancle_allhead').is(':checked') )
  3252. {
  3253. is_cancle_allhead2 = 1;
  3254. }
  3255. is_cancle_allhead2 = 1;
  3256. //is_cancle_allhead2
  3257. if(head_id_arr.length > 0)
  3258. {
  3259. var goodsids = [];
  3260. var goods_id = $('#goods_id').val();
  3261. goodsids.push(goods_id);
  3262. if(goods_id != '')
  3263. {
  3264. $.post("{:U('goods/ajax_batchheads')}",{'goodsids':goodsids,'head_id_arr': head_id_arr,'is_cancle_allhead':is_cancle_allhead2,'is_clear_old':is_clear_old}, function (ret) {
  3265. if (ret.status == 1) {
  3266. $('#batchheads').hide();
  3267. layer.msg('分配成功', {
  3268. time: 1000
  3269. }, function(){
  3270. window.location.reload();
  3271. });
  3272. return
  3273. } else {
  3274. layer.msg('修改失败');
  3275. }
  3276. }, 'json');
  3277. }else{
  3278. $('#head_id_arr').val(head_id_arr);
  3279. $('#batchheads').hide();
  3280. layer.msg('团长选择成功', {
  3281. time: 1000
  3282. });
  3283. }
  3284. }else{
  3285. layer.msg('请选择团长');
  3286. }
  3287. })
  3288. //确认
  3289. var cates2 = 0;
  3290. $("body").delegate("#cates2","click",function(){
  3291. cates2 = $(this).val() ;
  3292. })
  3293. var group_heads2 = 'default';
  3294. $("body").delegate("#group_heads","click",function(){
  3295. group_heads2 = $(this).val() ;
  3296. })
  3297. $("body").delegate(".cancle","click",function(){
  3298. layer.closeAll();
  3299. })
  3300. $("body").delegate(".modal-group-head","click",function(){
  3301. var group_heads=$('#group_heads').val();
  3302. if(group_heads2 != 'default')
  3303. {
  3304. group_heads = group_heads2;
  3305. }
  3306. var selected_checkboxs = $('.table-responsive tbody tr td:first-child [type="checkbox"]:checked');
  3307. var goodsids = selected_checkboxs.map(function () {
  3308. return $(this).val()
  3309. }).get();
  3310. if(goodsids.length <=0 )
  3311. {
  3312. layer.msg('请先选择商品');
  3313. return false;
  3314. }
  3315. var is_clear_old = 0;
  3316. $('.is_cancle_old2').each(function(){
  3317. if( $(this).is(':checked') )
  3318. {
  3319. is_clear_old = 1;
  3320. }
  3321. })
  3322. var is_cancle_allhead = 0;
  3323. $('.is_cancle_allhead2').each(function(){
  3324. if( $(this).is(':checked') )
  3325. {
  3326. is_cancle_allhead = 1;
  3327. }
  3328. })
  3329. var iscover=$('input[name="iscover"]:checked').val();
  3330. $.post("{:U('goods/ajax_batchcates_headgroup')}",{'goodsids':goodsids,'groupid': group_heads,'is_cancle_allhead':is_cancle_allhead,'is_clear_old' : is_clear_old }, function (ret) {
  3331. if (ret.status == 1) {
  3332. layer.msg('分配成功', {
  3333. time: 1000
  3334. }, function(){
  3335. window.location.reload();
  3336. });
  3337. return
  3338. } else {
  3339. layer.msg('分配失败');
  3340. }
  3341. }, 'json');
  3342. })
  3343. $('.layui-table-sort').click(function(){
  3344. $(this).attr('lay-sort','asc');
  3345. })
  3346. $("body").delegate(".modal-fenlei","click",function(){
  3347. var cates=$('#cates2').val();
  3348. if(cates2 != 0)
  3349. {
  3350. cates = cates2;
  3351. }
  3352. var selected_checkboxs = $('.table-responsive tbody tr td:first-child [type="checkbox"]:checked');
  3353. var goodsids = selected_checkboxs.map(function () {
  3354. return $(this).val()
  3355. }).get();
  3356. //id="cates"
  3357. var iscover=$('input[name="iscover"]:checked').val();
  3358. $.post("{:U('goods/ajax_batchcates')}",{'goodsids':goodsids,'cates': cates,'iscover':iscover}, function (ret) {
  3359. if (ret.status == 1) {
  3360. $('#batchcates').hide();
  3361. layer.msg('修改成功', {
  3362. time: 1000
  3363. }, function(){
  3364. window.location.reload();
  3365. });
  3366. return
  3367. } else {
  3368. layer.msg('修改失败');
  3369. }
  3370. }, 'json');
  3371. })
  3372. //----
  3373. //显示时间设置
  3374. $('#batchtime,#batchtime2').click(function () {
  3375. var offs_lf = ( $(window).width() -720 )/2;
  3376. var offs_ht = ( $(window).height() -290 )/2;
  3377. $('#batch_time .modal-dialog').css('top',offs_ht+'px');
  3378. $('#batch_time .modal-dialog').css('margin-top','0px');
  3379. $('#batch_time .modal-dialog').css('left',offs_lf+'px');
  3380. $('#batch_time .modal-dialog').css('margin-left','0px');
  3381. $('#batch_time').show();
  3382. })
  3383. $('.modal-time').click(function () {
  3384. var selected_checkboxs = $('.table-responsive tbody tr td:first-child [type="checkbox"]:checked');
  3385. var goodsids = selected_checkboxs.map(function () {
  3386. return $(this).val()
  3387. }).get();
  3388. var begin_time=$('#batch_time input[name="setsametime[start]"]').val();
  3389. var end_time=$('#batch_time input[name="setsametime[end]"]').val();
  3390. $.post("{:U('goods/ajax_batchtime')}",{'goodsids':goodsids,'begin_time': begin_time,'end_time':end_time}, function (ret) {
  3391. if (ret.status == 1) {
  3392. $('#batch_time').hide();
  3393. layer.msg('设置成功');
  3394. window.location.reload();
  3395. return
  3396. } else {
  3397. layer.msg('设置失败');
  3398. }
  3399. }, 'json');
  3400. })
  3401. $(document).on("click", '[data-toggle="ajaxEdit"]', function(e) {
  3402. var obj = $(this),
  3403. url = obj.data('href') || obj.attr('href'),
  3404. data = obj.data('set') || {},
  3405. html = $.trim(obj.text()),
  3406. required = obj.data('required') || true,
  3407. edit = obj.data('edit') || 'input';
  3408. var oldval = $.trim($(this).text());
  3409. e.preventDefault();
  3410. submit = function() {
  3411. e.preventDefault();
  3412. var val = $.trim(input.val());
  3413. if (required) {
  3414. if (val == '') {
  3415. layer.msg(tip.lang.empty);
  3416. return
  3417. }
  3418. }
  3419. if (val == html) {
  3420. input.remove(), obj.html(val).show();
  3421. return
  3422. }
  3423. if (url) {
  3424. $.post(url, {
  3425. value: val
  3426. }, function(ret) {
  3427. ret = eval("(" + ret + ")");
  3428. if (ret.status == 1) {
  3429. obj.html(val).show()
  3430. } else {
  3431. layer.msg(ret.result.message, ret.result.url)
  3432. }
  3433. input.remove()
  3434. }).fail(function() {
  3435. input.remove(), layer.msg(tip.lang.exception)
  3436. })
  3437. } else {
  3438. input.remove();
  3439. obj.html(val).show()
  3440. }
  3441. obj.trigger('valueChange', [val, oldval])
  3442. }, obj.hide().html('<i class="fa fa-spinner fa-spin"></i>');
  3443. var input = $('<input type="text" class="form-control input-sm" style="width: 80%;display: inline;" />');
  3444. if (edit == 'textarea') {
  3445. input = $('<textarea type="text" class="form-control" style="resize:none" rows=3 ></textarea>')
  3446. }
  3447. obj.after(input);
  3448. input.val(html).select().blur(function() {
  3449. submit(input)
  3450. }).keypress(function(e) {
  3451. if (e.which == 13) {
  3452. submit(input)
  3453. }
  3454. })
  3455. })
  3456. </script>
  3457. </body>