index.vue 134 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504
  1. <template>
  2. <div class="article-manager video-icon form-submit" id="shopp-manager">
  3. <div class="i-layout-page-header">
  4. <PageHeader class="product_tabs" hidden-breadcrumb>
  5. <div slot="title" class="acea-row row-middle">
  6. <router-link :to="{ path: `${roterPre}/product/product_list` }">
  7. <div class="font-sm after-line">
  8. <span class="iconfont iconfanhui"></span>
  9. <span class="pl10">返回</span>
  10. </div>
  11. </router-link>
  12. <span v-text="$route.params.id ? '编辑商品' : '添加商品'" class="mr20 ml16"></span>
  13. </div>
  14. </PageHeader>
  15. </div>
  16. <Card :bordered="false" dis-hover class="ivu-mt mh">
  17. <div class="new_tab">
  18. <Tabs v-model="currentTab" @on-click="onhangeTab">
  19. <TabPane v-for="(item, index) in headTab" v-if="index !=6 || (index==6 && merchantType==0)"
  20. :key="index+'name'" :label="item.title" :name="item.name"></TabPane>
  21. </Tabs>
  22. </div>
  23. <Form class="formValidate mt20" ref="formValidate" :rules="ruleValidate" :model="formValidate"
  24. :label-width="labelWidth" :label-position="labelPosition" @submit.native.prevent>
  25. <Row :gutter="24" type="flex" v-show="currentTab === '1'">
  26. <!-- 商品信息-->
  27. <Col span="24">
  28. <FormItem label="商品类型:" props="is_virtual">
  29. <div class="productType" :class="formValidate.product_type == item.id ? 'on' : ''"
  30. v-for="(item, index) in productType" :key="item.id" @click="productTypeTap(1,item)">
  31. <div class="name">{{ item.name }}</div>
  32. <div class="title">({{ item.title }})</div>
  33. <div v-if="formValidate.product_type == item.id" class="jiao"></div>
  34. <div v-if="formValidate.product_type == item.id" class="iconfont iconduihao"></div>
  35. </div>
  36. </FormItem>
  37. </Col>
  38. <Col span="24">
  39. <FormItem label="商品分类:" prop="cate_id">
  40. <el-cascader placeholder="请选择商品分类" v-width="'50%'" size="mini" v-model="formValidate.cate_id"
  41. :options="treeSelect" :props="props" filterable clearable>
  42. </el-cascader>
  43. <span class="addClass" @click="addClass" v-if="merchantType!=1">新增分类</span>
  44. <!-- <Select v-model="formValidate.cate_id" multiple v-width="'50%'">
  45. <Option
  46. v-for="item in treeSelect"
  47. :disabled="item.pid === 0"
  48. :value="item.id"
  49. :key="item.id"
  50. >{{ item.html + item.cate_name }}</Option
  51. >
  52. </Select> -->
  53. </FormItem>
  54. </Col>
  55. <Col span="24">
  56. <FormItem label="商品名称:" prop="store_name">
  57. <Input v-model="formValidate.store_name" placeholder="请输入商品名称" v-width="'50%'" />
  58. </FormItem>
  59. </Col>
  60. <Col span="24" class="brandName">
  61. <FormItem label="商品品牌:" prop="">
  62. <Cascader :data="brandData" placeholder="请选择商品品牌" change-on-select
  63. v-model="formValidate.brand_id" filterable v-width="'50%'"></Cascader>
  64. <span class="addClass" @click="addBrand" v-if="merchantType!=1">新增品牌</span>
  65. </FormItem>
  66. </Col>
  67. <Col span="24">
  68. <FormItem label="单位:" prop="unit_name">
  69. <Select v-model="formValidate.unit_name" clearable filterable v-width="'50%'"
  70. placeholder="请输入单位">
  71. <Option v-for="(item, index) in unitNameList" :value="item.name" :key="item.id">
  72. {{ item.name }}
  73. </Option>
  74. </Select>
  75. <span class="addClass" @click="addUnit" v-if="merchantType!=1">新增单位</span>
  76. </FormItem>
  77. </Col>
  78. <Col span="24">
  79. <FormItem label="商品条形码:" prop="">
  80. <Input
  81. v-model="formValidate.bar_code"
  82. placeholder="请输入商品条形码"
  83. v-width="'50%'"
  84. />
  85. </FormItem>
  86. </Col>
  87. <Col span="24">
  88. <FormItem label="商品编码:" prop="">
  89. <Input v-model="formValidate.code" placeholder="请输入商品编码" v-width="'50%'" />
  90. </FormItem>
  91. </Col>
  92. <Col span="24">
  93. <FormItem label="商品轮播图:" prop="slider_image">
  94. <div class="acea-row">
  95. <div class="pictrue" v-for="(item, index) in formValidate.slider_image" :key="index+'img'"
  96. draggable="true" @dragstart="handleDragStart($event, item)"
  97. @dragover.prevent="handleDragOver($event, item)"
  98. @dragenter="handleDragEnter($event, item)" @dragend="handleDragEnd($event, item)">
  99. <img v-lazy="item" />
  100. <Button shape="circle" icon="md-close" @click.native="handleRemove(index)"
  101. class="btndel"></Button>
  102. </div>
  103. <div v-if="formValidate.slider_image.length < 10" class="upLoad acea-row row-center-wrapper"
  104. @click="modalPicTap('duo')">
  105. <Icon type="ios-camera-outline" size="26" />
  106. </div>
  107. <Input v-model="formValidate.slider_image[0]" class="input-display"></Input>
  108. </div>
  109. <div class="tips"> 建议尺寸:800 * 800px,可拖拽改变图片顺序,默认首张图为主图,最多上传10张</div>
  110. </FormItem>
  111. </Col>
  112. <Col span="24">
  113. <FormItem label="商品标签:" prop="store_label_id" class="labelClass">
  114. <div class="acea-row row-middle">
  115. <div class="labelInput acea-row row-between-wrapper" @click="openStoreLabel">
  116. <div style="width: 90%;">
  117. <div v-if="storeDataLabel.length">
  118. <Tag closable v-for="(item,index) in storeDataLabel" key="index"
  119. @on-close="closeStoreLabel(item)">{{item.label_name}}</Tag>
  120. </div>
  121. <span class="span" v-else>选择商品标签</span>
  122. </div>
  123. <div class="iconfont iconxiayi"></div>
  124. </div>
  125. <span class="addClass" @click="addStoreLabel">新增标签</span>
  126. </div>
  127. </FormItem>
  128. </Col>
  129. <!-- <Col span="24">
  130. <FormItem label="供应商:" prop="supplier_id" v-if="formValidate.product_type == 0 && merchantType!=1">
  131. <Select
  132. v-model="formValidate.supplier_id"
  133. clearable
  134. filterable
  135. v-width="'50%'"
  136. placeholder="请选择供应商"
  137. >
  138. <Option
  139. v-for="(item, index) in supplierList"
  140. :value="item.id"
  141. :key="item.id"
  142. >{{item.supplier_name }}</Option
  143. >
  144. </Select>
  145. </FormItem>
  146. </Col> -->
  147. <Col span="24">
  148. <FormItem label="添加视频:">
  149. <i-switch v-model="formValidate.video_open" size="large">
  150. <span slot="open">开启</span>
  151. <span slot="close">关闭</span>
  152. </i-switch>
  153. </FormItem>
  154. </Col>
  155. <Col span="24" v-if="formValidate.video_open">
  156. <FormItem label="上传视频:" prop="video_link">
  157. <Button @click="modalPicTap('dan','video')">上传视频</Button>
  158. <div class="tips">建议使用云存储保存视频,<router-link
  159. :to="{ path: `${roterPre}/setting/storage` }">配置云存储</router-link>,建议时长:9~30秒,视频宽高比16:9
  160. <Poptip placement="bottom" trigger="hover" width="440" transfer padding="8px">
  161. <a>查看示例</a>
  162. <div class="exampleImg" slot="content">
  163. <img :src="`${baseURL}/statics/system/productVideo.png`" alt=""
  164. style="width: 204px;height: 270px;" />
  165. <img :src="`${baseURL}/statics/system/productVideo2.png`" alt=""
  166. style="width: 204px;height: 270px;" />
  167. </div>
  168. </Poptip>
  169. </div>
  170. <div class="iview-video-style" v-if="formValidate.video_link">
  171. <video class="video-style" :src="formValidate.video_link" controls="controls">
  172. </video>
  173. <div class="mark"></div>
  174. <Icon type="ios-trash-outline" class="iconv" @click="delVideo" />
  175. </div>
  176. </FormItem>
  177. </Col>
  178. <!-- <Col span="24" v-if="formValidate.video_open">-->
  179. <!-- <FormItem label="视频类型:">-->
  180. <!-- <RadioGroup v-model="seletVideo" @on-change="changeVideo">-->
  181. <!-- <Radio :label="0" class="radio">本地视频</Radio>-->
  182. <!-- <Radio :label="1">视频链接</Radio>-->
  183. <!-- </RadioGroup>-->
  184. <!-- </FormItem>-->
  185. <!-- </Col>-->
  186. <!-- <Col span="24" v-if="formValidate.video_open">-->
  187. <!-- <FormItem label="" prop="video_link">-->
  188. <!-- <Input-->
  189. <!-- v-if="seletVideo == 1 && !formValidate.video_link"-->
  190. <!-- v-width="'50%'"-->
  191. <!-- v-model="videoLink"-->
  192. <!-- placeholder="请输入视频链接"-->
  193. <!-- />-->
  194. <!-- <input-->
  195. <!-- type="file"-->
  196. <!-- ref="refid"-->
  197. <!-- @change="zh_uploadFile_change"-->
  198. <!-- class="input-display"-->
  199. <!-- />-->
  200. <!-- <div-->
  201. <!-- v-if="-->
  202. <!-- seletVideo == 0 &&-->
  203. <!-- (upload_type !== '1' || videoLink) &&-->
  204. <!-- !formValidate.video_link-->
  205. <!-- "-->
  206. <!-- class="ml10 videbox"-->
  207. <!-- @click="zh_uploadFile"-->
  208. <!-- >-->
  209. <!-- +-->
  210. <!-- </div>-->
  211. <!-- <Button-->
  212. <!-- v-if="-->
  213. <!-- seletVideo == 1 &&-->
  214. <!-- (upload_type !== '1' || videoLink) &&-->
  215. <!-- !formValidate.video_link-->
  216. <!-- "-->
  217. <!-- type="primary"-->
  218. <!-- icon="ios-cloud-upload-outline"-->
  219. <!-- class="uploadVideo"-->
  220. <!-- @click="zh_uploadFile"-->
  221. <!-- >确认添加</Button>-->
  222. <!-- <Upload-->
  223. <!-- v-if="upload_type === '1' && !videoLink"-->
  224. <!-- :show-upload-list="false"-->
  225. <!-- :action="fileUrl2"-->
  226. <!-- :before-upload="videoSaveToUrl"-->
  227. <!-- :data="uploadData"-->
  228. <!-- :headers="header"-->
  229. <!-- :multiple="true"-->
  230. <!-- style="display: inline-block"-->
  231. <!-- >-->
  232. <!-- <div-->
  233. <!-- v-if="seletVideo === 0 && !formValidate.video_link"-->
  234. <!-- class="videbox"-->
  235. <!-- >-->
  236. <!-- +-->
  237. <!-- </div>-->
  238. <!-- </Upload>-->
  239. <!-- <div class="iview-video-style" v-if="formValidate.video_link">-->
  240. <!-- <video-->
  241. <!-- class="video-style"-->
  242. <!-- :src="formValidate.video_link"-->
  243. <!-- controls="controls"-->
  244. <!-- >-->
  245. <!-- 您的浏览器不支持 video 标签。-->
  246. <!-- </video>-->
  247. <!-- <div class="mark"></div>-->
  248. <!-- <Icon-->
  249. <!-- type="ios-trash-outline"-->
  250. <!-- class="iconv"-->
  251. <!-- @click="delVideo"-->
  252. <!-- />-->
  253. <!-- </div>-->
  254. <!-- <Progress-->
  255. <!-- class="progress"-->
  256. <!-- :percent="progress"-->
  257. <!-- :stroke-width="5"-->
  258. <!-- v-if="upload.videoIng || videoIng"-->
  259. <!-- />-->
  260. <!-- <div class="tips">建议时长:9~30秒,视频宽高比16:9</div>-->
  261. <!-- </FormItem>-->
  262. <!-- </Col>-->
  263. <Col span="24" class="goodsShow">
  264. <FormItem label="上架时间:">
  265. <RadioGroup v-model="formValidate.is_show" @on-change="goodsOn">
  266. <Radio :label="1">
  267. <Icon type="social-apple"></Icon>
  268. <span>立即上架</span>
  269. </Radio>
  270. <Radio :label="2">
  271. <Icon type="social-android"></Icon>
  272. <span>定时上架</span>
  273. </Radio>
  274. <Radio :label="0">
  275. <Icon type="social-windows"></Icon>
  276. <span>放入仓库</span>
  277. </Radio>
  278. </RadioGroup>
  279. </FormItem>
  280. </Col>
  281. <Col span="24" v-if="formValidate.is_show==2">
  282. <FormItem label="">
  283. <DatePicker type="datetime" @on-change="onchangeShow" :options="startPickOptions"
  284. :value="formValidate.auto_on_time" v-model="formValidate.auto_on_time" placeholder="请选择上架时间"
  285. format="yyyy-MM-dd HH:mm" style="width: 260px;"></DatePicker>
  286. </FormItem>
  287. </Col>
  288. <Col span="24" class="goodsShow">
  289. <FormItem label="定时下架:">
  290. <Switch v-model="off_show" :true-value="1" :false-value="0" size="large" @on-change="goodsOff">
  291. <span slot="open">开启</span>
  292. <span slot="close">关闭</span>
  293. </Switch>
  294. </FormItem>
  295. </Col>
  296. <Col span="24" v-if="off_show==1">
  297. <FormItem label="">
  298. <DatePicker type="datetime" @on-change="onchangeOff" :options="endPickOptions"
  299. :value="formValidate.auto_off_time" v-model="formValidate.auto_off_time"
  300. placeholder="请选择下架时间" format="yyyy-MM-dd HH:mm" style="width: 260px;"></DatePicker>
  301. <div class="tips">开启定时下架后,系统会在设置时间下架该商品。下架时间需晚于开售时间,商品才能定时开售。</div>
  302. </FormItem>
  303. </Col>
  304. <!-- <Col
  305. :xl="23"
  306. :lg="24"
  307. :md="24"
  308. :sm="24"
  309. :xs="24"
  310. v-if="formValidate.spec_type === 0"
  311. >
  312. <FormItem>
  313. <Table :data="oneFormValidate" :columns="columns" border>
  314. <template slot-scope="{ row, index }" slot="pic">
  315. <div
  316. class="acea-row row-middle row-center-wrapper"
  317. @click="modalPicTap('dan', 'danTable', index)"
  318. >
  319. <div
  320. class="pictrue pictrueTab"
  321. v-if="oneFormValidate[0].pic"
  322. >
  323. <img v-lazy="oneFormValidate[0].pic" />
  324. </div>
  325. <div
  326. class="upLoad pictrueTab acea-row row-center-wrapper"
  327. v-else
  328. >
  329. <Icon type="ios-camera-outline" size="21" />
  330. </div>
  331. </div>
  332. </template>
  333. <template slot-scope="{ row, index }" slot="price">
  334. <InputNumber
  335. v-model="oneFormValidate[0].price"
  336. :min="0"
  337. class="priceBox"
  338. ></InputNumber>
  339. </template>
  340. <template slot-scope="{ row, index }" slot="cost">
  341. <InputNumber
  342. v-model="oneFormValidate[0].cost"
  343. :min="0"
  344. class="priceBox"
  345. ></InputNumber>
  346. </template>
  347. <template slot-scope="{ row, index }" slot="ot_price">
  348. <InputNumber
  349. v-model="oneFormValidate[0].ot_price"
  350. :min="0"
  351. class="priceBox"
  352. ></InputNumber>
  353. </template>
  354. <template slot-scope="{ row, index }" slot="stock">
  355. <InputNumber
  356. v-model="oneFormValidate[0].stock"
  357. :min="0"
  358. :precision="0"
  359. class="priceBox"
  360. ></InputNumber>
  361. </template>
  362. <template slot-scope="{ row, index }" slot="bar_code">
  363. <Input v-model="oneFormValidate[0].bar_code"></Input>
  364. </template>
  365. <template slot-scope="{ row, index }" slot="code">
  366. <Input v-model="oneFormValidate[0].code"></Input>
  367. </template>
  368. <template slot-scope="{ row, index }" slot="weight">
  369. <InputNumber
  370. v-model="oneFormValidate[0].weight"
  371. :min="0"
  372. class="priceBox"
  373. ></InputNumber>
  374. </template>
  375. <template slot-scope="{ row, index }" slot="volume">
  376. <InputNumber
  377. v-model="oneFormValidate[0].volume"
  378. :min="0"
  379. class="priceBox"
  380. ></InputNumber>
  381. </template>
  382. </Table>
  383. </FormItem>
  384. </Col> -->
  385. <!-- <Col span="24">
  386. <FormItem label="商品标签:" prop="label_id">
  387. <Select v-model="formValidate.label_id" multiple v-width="'50%'">
  388. <Option v-for="item in labelSelect" :value="item.id" :key="item.id">{{ item.label_name }}</Option>
  389. </Select>
  390. </FormItem>
  391. </Col> -->
  392. </Row>
  393. <Row :gutter="24" type="flex" v-show="currentTab === '2'">
  394. <Col span="24" v-if="formValidate.product_type != 4">
  395. <FormItem label="商品规格:" props="spec_type">
  396. <RadioGroup v-model="formValidate.spec_type" @on-change="changeSpec">
  397. <Radio :label="0" class="radio">单规格</Radio>
  398. <Radio :label="1">多规格</Radio>
  399. </RadioGroup>
  400. </FormItem>
  401. </Col>
  402. <Col span="24">
  403. <FormItem label="是否称重:" props="is_weigh">
  404. <RadioGroup v-model="formValidate.is_weigh" >
  405. <Radio :label="0" class="radio">否</Radio>
  406. <Radio :label="1">是</Radio>
  407. </RadioGroup>
  408. </FormItem>
  409. </Col>
  410. <!-- 多规格添加-->
  411. <Col span="24" v-if="formValidate.spec_type === 1 && formValidate.product_type != 4" class="noForm">
  412. <Col span="24">
  413. <FormItem label="选择规格:" prop="">
  414. <div class="acea-row row-middle">
  415. <Select v-model="formValidate.selectRule" style="width: 23%">
  416. <Option v-for="(item, index) in ruleList" :value="item.rule_name" :key="item.id">
  417. {{ item.rule_name }}
  418. </Option>
  419. </Select>
  420. <Button type="primary" class="mr20" @click="confirm">确认</Button>
  421. <Button @click="addRule">添加规格模板</Button>
  422. </div>
  423. </FormItem>
  424. </Col>
  425. <Col span="24">
  426. <FormItem v-if="attrs.length !== 0">
  427. <draggable class="dragArea list-group" :list="attrs" group="peoples" handle=".move-icon"
  428. :move="checkMove" @end="end">
  429. <div v-for="(item, index) in attrs" :key="index+'attrs'" class="acea-row row-middle mb10">
  430. <div class="move-icon">
  431. <span class="iconfont icondrag2"></span>
  432. </div>
  433. <div style="width: 90%" :class="moveIndex === index ? 'borderStyle' : ''">
  434. <div class="acea-row row-middle">
  435. <span class="mr5">{{ item.value }}</span>
  436. <Icon type="ios-close-circle" size="14" class="curs"
  437. @click="handleRemoveRole(index)" />
  438. </div>
  439. <div class="rulesBox">
  440. <draggable :list="item.detail" handle=".drag">
  441. <Tag type="dot" closable color="primary" v-for="(j, indexn) in item.detail"
  442. :key="indexn" :name="j" class="mr20 drag"
  443. @on-close="handleRemove2(item.detail, indexn)">{{ j }}</Tag>
  444. </draggable>
  445. <Input search enter-button="添加" placeholder="请输入属性名称"
  446. v-model="item.detail.attrsVal"
  447. @on-search="createAttr(item.detail.attrsVal, index)" class="width-add" />
  448. </div>
  449. </div>
  450. </div>
  451. </draggable>
  452. </FormItem>
  453. </Col>
  454. <Col span="24" v-if="createBnt">
  455. <FormItem>
  456. <Button type="primary" icon="md-add" @click="addBtn" class="mr15">添加新规格</Button>
  457. <Button type="success" @click="generate(1)">立即生成</Button>
  458. </FormItem>
  459. </Col>
  460. <Col span="24" v-if="showIput">
  461. <Col :xl="6" :lg="9" :md="10" :sm="24" :xs="24">
  462. <FormItem label="规格:">
  463. <Input placeholder="请输入规格" v-model="formDynamic.attrsName" />
  464. </FormItem>
  465. </Col>
  466. <Col :xl="6" :lg="9" :md="10" :sm="24" :xs="24">
  467. <FormItem label="规格值:">
  468. <Input v-model="formDynamic.attrsVal" placeholder="请输入规格值" />
  469. </FormItem>
  470. </Col>
  471. <Col :xl="6" :lg="5" :md="10" :sm="24" :xs="24">
  472. <FormItem>
  473. <Button type="primary" class="mr15" @click="createAttrName">确定</Button>
  474. <Button @click="offAttrName">取消</Button>
  475. </FormItem>
  476. </Col>
  477. </Col>
  478. <!-- 多规格设置-->
  479. <Col :xl="24" :lg="24" :md="24" :sm="24" :xs="24" v-if="
  480. manyFormValidate.length &&
  481. formValidate.header.length !== 0 &&
  482. attrs.length !== 0
  483. ">
  484. <!-- 批量设置-->
  485. <Col span="24">
  486. <FormItem label="批量设置:" class="labeltop">
  487. <Table :data="oneFormBatch"
  488. :columns="formValidate.product_type == 1?columnsCarMy:formValidate.product_type == 3?columnsFictitious:columns2"
  489. border>
  490. <template slot-scope="{ row, index }" slot="attr">
  491. <div @click="batchAttr" class="acea-row row-between-wrapper" style="cursor: pointer;">
  492. <div style="width: 41px;">{{oneFormBatch[0].attr}}</div>
  493. <span class="iconfont icondrop-down"></span>
  494. </div>
  495. </template>
  496. <template slot-scope="{ row, index }" slot="pic">
  497. <div class="acea-row row-middle row-center-wrapper"
  498. @click="modalPicTap('dan', 'duopi', index)">
  499. <div class="pictrue pictrueTab" v-if="oneFormBatch[0].pic">
  500. <img v-lazy="oneFormBatch[0].pic" />
  501. </div>
  502. <div class="upLoad pictrueTab acea-row row-center-wrapper" v-else>
  503. <Icon type="ios-camera-outline" size="26" class="iosfont" />
  504. </div>
  505. </div>
  506. </template>
  507. <template slot-scope="{ row, index }" slot="price">
  508. <InputNumber v-model="oneFormBatch[0].price" :min="0" class="priceBox"></InputNumber>
  509. </template>
  510. <template slot-scope="{ row, index }" slot="settle_price" v-if='merchantType == 2'>
  511. <InputNumber v-model="oneFormBatch[0].settle_price" :min="0" class="priceBox">
  512. </InputNumber>
  513. </template>
  514. <template slot-scope="{ row, index }" slot="cost">
  515. <InputNumber v-model="oneFormBatch[0].cost" :min="0" class="priceBox"></InputNumber>
  516. </template>
  517. <template slot-scope="{ row, index }" slot="ot_price">
  518. <InputNumber v-model="oneFormBatch[0].ot_price" :min="0" class="priceBox"></InputNumber>
  519. </template>
  520. <template slot-scope="{ row, index }" slot="erp_product_id">
  521. <Select v-model="oneFormBatch[0].erp_product_id" filterable
  522. :remote-method="queryWarehouseList" :loading="warehouseListLoding" @on-change="changeErpProductId">
  523. <Option v-for="(option, index) in warehouseList" :value="option.id" :key="index">
  524. <div>
  525. {{option.store_name}}({{option.unit_name}})
  526. </div>
  527. </Option>
  528. </Select>
  529. </template>
  530. <template slot-scope="{ row, index }" slot="unit">
  531. <Input v-model="oneFormBatch[0].unit"></Input>
  532. </template>
  533. <template slot-scope="{ row, index }" slot="uint_to_erp_unit">
  534. <InputNumber v-model="oneFormBatch[0].uint_to_erp_unit" :min="0" class="priceBox">
  535. </InputNumber>
  536. </template>
  537. <!-- <template slot-scope="{ row, index }" slot="stock">
  538. <InputNumber v-model="oneFormBatch[0].stock" :min="0"
  539. :disabled="formValidate.product_type == 1 || openErp" class="priceBox">
  540. </InputNumber>
  541. </template> -->
  542. <template slot-scope="{ row, index }" slot="bar_code">
  543. <Input v-model="oneFormBatch[0].bar_code"></Input>
  544. </template>
  545. <template slot-scope="{ row, index }" slot="code">
  546. <Input v-model="oneFormBatch[0].code"></Input>
  547. </template>
  548. <template slot-scope="{ row, index }" slot="weight">
  549. <InputNumber v-model="oneFormBatch[0].weight" :step="0.1" :min="0" class="priceBox">
  550. </InputNumber>
  551. </template>
  552. <template slot-scope="{ row, index }" slot="volume">
  553. <InputNumber v-model="oneFormBatch[0].volume" :step="0.1" :min="0" class="priceBox">
  554. </InputNumber>
  555. </template>
  556. <!-- <template slot-scope="{ row, index }" slot="fictitious"
  557. v-if="formValidate.product_type == 1">
  558. <Button v-if="
  559. !row.virtual_list && !row.stock
  560. " @click="addVirtual(0, 'oneFormBatch')">添加卡密</Button>
  561. <span v-else class="seeCatMy"
  562. @click="seeVirtual(oneFormBatch[0], 'oneFormBatch', 0)">已设置</span>
  563. </template> -->
  564. <template slot-scope="{ row, index }" slot="action">
  565. <a @click="batchAdd">批量设置</a>
  566. <Divider type="vertical" />
  567. <a @click="batchDel">清空</a>
  568. </template>
  569. </Table>
  570. </FormItem>
  571. </Col>
  572. <!-- 多规格表格-->
  573. <Col span="24">
  574. <FormItem label="商品属性:" class="labeltop">
  575. <Table :data="manyFormValidate" :columns="formValidate.header" border>
  576. <template slot-scope="{ row, index }" v-for="(item,i) in attrData.length"
  577. :slot="'value'+(i+1)">
  578. <div :class="manyFormValidate[index].select?'selectOn':''">
  579. {{manyFormValidate[index]['value'+(i+1)]}}
  580. </div>
  581. </template>
  582. <template slot-scope="{ row, index }" slot="pic">
  583. <div class="acea-row row-middle row-center-wrapper"
  584. @click="modalPicTap('dan', 'duoTable', index)">
  585. <div class="pictrue pictrueTab" v-if="manyFormValidate[index].pic">
  586. <img v-lazy="manyFormValidate[index].pic" />
  587. </div>
  588. <div class="upLoad pictrueTab acea-row row-center-wrapper" v-else>
  589. <Icon type="ios-camera-outline" size="21" />
  590. </div>
  591. </div>
  592. </template>
  593. <template slot-scope="{ row, index }" slot="price">
  594. <InputNumber v-model="manyFormValidate[index].price" :min="0" class="priceBox">
  595. </InputNumber>
  596. </template>
  597. <template slot-scope="{ row, index }" slot="settle_price" v-if="merchantType == 2">
  598. <InputNumber v-model="manyFormValidate[index].settle_price" :min="0" class="priceBox">
  599. </InputNumber>
  600. </template>
  601. <template slot-scope="{ row, index }" slot="cost">
  602. <InputNumber v-model="manyFormValidate[index].cost" :min="0" class="priceBox">
  603. </InputNumber>
  604. </template>
  605. <template slot-scope="{ row, index }" slot="ot_price">
  606. <InputNumber v-model="manyFormValidate[index].ot_price" :min="0" class="priceBox">
  607. </InputNumber>
  608. </template>
  609. <template slot-scope="{ row, index }" slot="erp_product_id">
  610. <Select v-model="manyFormValidate[index].erp_product_id" filterable :remote-method="queryWarehouseList" :loading="warehouseListLoding" @on-change="changeErpProductId">
  611. <Option v-for="(option, index) in warehouseList" :value="option.id" :key="index">
  612. {{option.store_name}}({{option.unit_name}})
  613. </Option>
  614. </Select>
  615. </template>
  616. <template slot-scope="{ row, index }" slot="unit">
  617. <Input v-model="manyFormValidate[index].unit"></Input>
  618. </template>
  619. <template slot-scope="{ row, index }" slot="uint_to_erp_unit">
  620. <InputNumber v-model="manyFormValidate[index].uint_to_erp_unit" :min="0"
  621. class="priceBox"></InputNumber>
  622. </template>
  623. <!-- <template slot-scope="{ row, index }" slot="stock">
  624. <InputNumber v-model="manyFormValidate[index].stock" :min="0" :precision="0"
  625. :disabled="formValidate.product_type == 1 || openErp" class="priceBox">
  626. </InputNumber>
  627. </template> -->
  628. <!-- <template slot-scope="{ row, index }" slot="fictitious"
  629. v-if="formValidate.product_type == 1">
  630. <Button v-if="(!row.virtual_list || !row.virtual_list.length) && !row.stock"
  631. @click="addVirtual(index, 'manyFormValidate')">添加卡密</Button>
  632. <span v-else class="seeCatMy"
  633. @click="seeVirtual(row, 'manyFormValidate', index)">已设置</span>
  634. </template> -->
  635. <template slot-scope="{ row, index }" slot="bar_code">
  636. <Input v-model="manyFormValidate[index].bar_code"></Input>
  637. </template>
  638. <template slot-scope="{ row, index }" slot="code">
  639. <Input v-model="manyFormValidate[index].code"></Input>
  640. </template>
  641. <template slot-scope="{ row, index }" slot="weight">
  642. <InputNumber v-model="manyFormValidate[index].weight" :min="0" class="priceBox">
  643. </InputNumber>
  644. </template>
  645. <template slot-scope="{ row, index }" slot="volume">
  646. <InputNumber v-model="manyFormValidate[index].volume" :min="0" class="priceBox">
  647. </InputNumber>
  648. </template>
  649. <template slot-scope="{ row, index }" slot="action">
  650. <a @click="delAttrTable(index)">删除</a>
  651. </template>
  652. </Table>
  653. </FormItem>
  654. </Col>
  655. </Col>
  656. </Col>
  657. <!-- 单规格表格-->
  658. <div v-if="formValidate.spec_type === 0 || formValidate.product_type == 4" style="width: 100%;">
  659. <Col span="24" v-if="formValidate.product_type != 4">
  660. <FormItem label="图片:" prop="image">
  661. <div class="pictrueBox" @click="modalPicTap('dan', 'danTable', 0)">
  662. <div class="pictrue" v-if="oneFormValidate[0].pic">
  663. <img v-lazy="oneFormValidate[0].pic" />
  664. </div>
  665. <div class="upLoad acea-row row-center-wrapper" v-else>
  666. <Input v-model="oneFormValidate[0].pic" class="input-display"></Input>
  667. <Icon type="ios-camera-outline" size="26" />
  668. </div>
  669. </div>
  670. </FormItem>
  671. </Col>
  672. <Col class="asterisk" span="24" v-if="formValidate.product_type == 4">
  673. <div class="asteriskInfo on2">*</div>
  674. <FormItem label="核销次数:">
  675. <InputNumber v-model="oneFormValidate[0].write_times" :min="1" :max="99999999"
  676. :precision="0" v-width="'50%'" placeholder="请输入核销次数"></InputNumber>
  677. </FormItem>
  678. </Col>
  679. <Col span="24" v-if="formValidate.product_type == 4">
  680. <FormItem required label="核销时效:">
  681. <RadioGroup v-model="oneFormValidate[0].write_valid">
  682. <Radio :label="1">永久有效</Radio>
  683. <Radio :label="2">购买后几天有效</Radio>
  684. <Radio :label="3">固定有效期</Radio>
  685. </RadioGroup>
  686. </FormItem>
  687. </Col>
  688. <Col span="24" v-if="oneFormValidate[0].write_valid==2">
  689. <FormItem label="" prop="freight">
  690. <div class="acea-row row-middle">
  691. <InputNumber :min="1" v-model="oneFormValidate[0].days" placeholder="请输入有效天数"
  692. v-width="'50%'" />
  693. <span class="ml10">天</span>
  694. </div>
  695. </FormItem>
  696. </Col>
  697. <Col span="24" v-if="oneFormValidate[0].write_valid==3">
  698. <FormItem label="" prop="freight">
  699. <div class="acea-row row-middle">
  700. <DatePicker :editable="false" type="daterange" format="yyyy-MM-dd"
  701. placeholder="请选择固定有效期" @on-change="onchangeTime" v-width="'50%'"
  702. :value="oneFormValidate[0].section_time" v-model="oneFormValidate[0].section_time">
  703. </DatePicker>
  704. </div>
  705. </FormItem>
  706. </Col>
  707. <Col span="24" class="asterisk">
  708. <div class="asteriskInfo">*</div>
  709. <FormItem label="售价:">
  710. <InputNumber v-model="oneFormValidate[0].price" :min="0" :max="99999999" v-width="'50%'">
  711. </InputNumber>
  712. </FormItem>
  713. </Col>
  714. <Col span="24" class="asterisk" v-if="merchantType == 2">
  715. <div class="asteriskInfo on">*</div>
  716. <FormItem label="结算价:">
  717. <InputNumber v-model="oneFormValidate[0].settle_price" :min="0" :max="99999999"
  718. v-width="'50%'"></InputNumber>
  719. </FormItem>
  720. </Col>
  721. <Col span="24" class="asterisk">
  722. <div class="asteriskInfo on">*</div>
  723. <FormItem label="成本价:">
  724. <InputNumber v-model="oneFormValidate[0].cost" :min="0" :max="99999999" v-width="'50%'">
  725. </InputNumber>
  726. </FormItem>
  727. </Col>
  728. <Col span="24">
  729. <FormItem label="原价:">
  730. <InputNumber v-model="oneFormValidate[0].ot_price" :min="0" :max="99999999" v-width="'50%'">
  731. </InputNumber>
  732. </FormItem>
  733. </Col>
  734. <Col span="24">
  735. <FormItem label="仓库商品:">
  736. <Select v-model="oneFormValidate[0].erp_product_id" filterable v-width="'50%'"
  737. :remote-method="queryWarehouseList" :loading="warehouseListLoding" @on-change="changeErpProductId" >
  738. <Option v-for="(option, index) in warehouseList" :value="option.id" :key="index">
  739. {{option.store_name}}({{option.unit_name}})
  740. </Option>
  741. </Select>
  742. </FormItem>
  743. </Col>
  744. <Col span="24">
  745. <FormItem label="规格单位:">
  746. <Input v-model.trim="oneFormValidate[0].unit" v-width="'50%'"
  747. placeholder="请输入商品规格单位"></Input>
  748. </FormItem>
  749. </Col>
  750. <Col span="24">
  751. <FormItem label="转换率:">
  752. <InputNumber v-model="oneFormValidate[0].uint_to_erp_unit" :min="0" :max="99999999"
  753. v-width="'50%'"></InputNumber>
  754. </FormItem>
  755. </Col>
  756. <Col span="24" class="asterisk">
  757. <div class="asteriskInfo">*</div>
  758. <!-- <FormItem label="库存:">
  759. <InputNumber v-model="oneFormValidate[0].stock" :min="0" :max="99999999"
  760. :disabled="formValidate.product_type == 1 || openErp" :precision="0" v-width="'50%'">
  761. </InputNumber>
  762. </FormItem> -->
  763. </Col>
  764. <Col span="24" v-if="formValidate.product_type != 4">
  765. <FormItem label="商品条形码:">
  766. <Input v-model.trim="oneFormValidate[0].bar_code" v-width="'50%'"
  767. placeholder="请输入商品条形码"></Input>
  768. </FormItem>
  769. </Col>
  770. <Col span="24" v-if="formValidate.product_type != 4">
  771. <FormItem label="商品编号:">
  772. <Input v-model.trim="oneFormValidate[0].code" v-width="'50%'" placeholder="请输入商品编码"></Input>
  773. </FormItem>
  774. </Col>
  775. <Col span="24" v-if="formValidate.product_type == 0">
  776. <FormItem label="重量(KG):">
  777. <InputNumber v-model="oneFormValidate[0].weight" :min="0" :max="99999999" v-width="'50%'">
  778. </InputNumber>
  779. </FormItem>
  780. </Col>
  781. <Col span="24" v-if="formValidate.product_type == 0">
  782. <FormItem label="体积(m³):">
  783. <InputNumber v-model="oneFormValidate[0].volume" :min="0" :max="99999999" v-width="'50%'">
  784. </InputNumber>
  785. </FormItem>
  786. </Col>
  787. <!-- <Col span="24" v-if="formValidate.product_type == 1">
  788. <FormItem label="卡密设置:">
  789. <Button v-if="
  790. !oneFormValidate[0].virtual_list.length
  791. && !oneFormValidate[0].stock
  792. " @click="addVirtual(0, 'oneFormValidate')">添加卡密</Button>
  793. <span v-else class="seeCatMy"
  794. @click="seeVirtual(oneFormValidate[0], 'oneFormValidate', 0)">已设置</span>
  795. </FormItem>
  796. </Col> -->
  797. </div>
  798. </Row>
  799. <!-- 商品详情 -->
  800. <Row v-show="currentTab === '3'" class="mb10">
  801. <Col span="16">
  802. <wangeditor style="width: 100%" :content="contents" @editorContent="getEditorContent"></wangeditor>
  803. </Col>
  804. <Col span="6" style="width: 33%">
  805. <div class="ifam">
  806. <div class="content" v-html="content"></div>
  807. </div>
  808. </Col>
  809. </Row>
  810. <!-- 物流设置 -->
  811. <Row v-show="currentTab === '4'">
  812. <Col v-bind="grid3">
  813. <FormItem label="配送方式:" prop="" required>
  814. <CheckboxGroup v-model="formValidate.delivery_type">
  815. <Checkbox label="1" v-if="merchantType!=1">快递</Checkbox>
  816. <Checkbox label="3">门店配送</Checkbox>
  817. <Checkbox label="2">到店自提</Checkbox>
  818. </CheckboxGroup>
  819. </FormItem>
  820. </Col>
  821. <Col span="24">
  822. <FormItem label="运费设置:">
  823. <RadioGroup v-model="formValidate.freight">
  824. <Radio :label="1">包邮</Radio>
  825. <Radio :label="2">固定邮费</Radio>
  826. <Radio :label="3">运费模板</Radio>
  827. </RadioGroup>
  828. </FormItem>
  829. </Col>
  830. <Col span="24" v-if="formValidate.freight == 2">
  831. <FormItem label="" prop="freight">
  832. <div class="acea-row row-middle">
  833. <InputNumber :min="0" v-model="formValidate.postage" placeholder="请输入金额"
  834. class="perW20 maxW" />
  835. <span class="ml10">元</span>
  836. </div>
  837. </FormItem>
  838. </Col>
  839. <Col span="24" v-if="formValidate.freight == 3">
  840. <FormItem label="" prop="">
  841. <div class="acea-row">
  842. <Select v-model="formValidate.temp_id" clearable class="perW20 maxW">
  843. <Option v-for="(item, index) in templateList" :value="item.id" :key="item.id">
  844. {{ item.name }}
  845. </Option>
  846. </Select>
  847. <Button @click="editTemp" class="ml15" v-if="formValidate.temp_id">查看运费模板</Button>
  848. <Button @click="addTemp" class="ml15" v-else>添加运费模板</Button>
  849. </div>
  850. </FormItem>
  851. </Col>
  852. </Row>
  853. <!-- 营销设置 -->
  854. <Row v-show="currentTab === '5'">
  855. <Col span="24">
  856. <FormItem label="已售数量:">
  857. <InputNumber v-width="'50%'" :min="0" :max="999999" v-model="formValidate.ficti"
  858. placeholder="请输入已售数量" />
  859. </FormItem>
  860. </Col>
  861. <Col span="24">
  862. <FormItem label="排序:">
  863. <InputNumber :min="0" :max="999999" v-width="'50%'" v-model="formValidate.sort"
  864. placeholder="请输入排序" />
  865. </FormItem>
  866. </Col>
  867. <Col span="24">
  868. <FormItem label="特价商品:">
  869. <i-switch v-model="formValidate.is_supreme" :true-value="1" :false-value="0" size="large">
  870. <span slot="open">是</span>
  871. <span slot="close">否</span>
  872. </i-switch>
  873. </FormItem>
  874. </Col>
  875. <Col span="24">
  876. <div class="lines"></div>
  877. </Col>
  878. <Col span="24" v-if="merchantType == 0">
  879. <FormItem label="赠送积分:" prop="give_integral">
  880. <InputNumber v-width="'50%'" v-model="formValidate.give_integral" :min="0" :max="999999"
  881. placeholder="请输入积分" />
  882. </FormItem>
  883. </Col>
  884. <Col v-bind="grid3" v-if="merchantType == 0">
  885. <FormItem label="赠送优惠券:">
  886. <div v-if="couponName.length" class="mb20">
  887. <Tag closable v-for="(item, index) in couponName" :key="index+'coupon'"
  888. @on-close="handleClose(item)">{{ item.title }}</Tag>
  889. </div>
  890. <Button type="primary" @click="addCoupon">添加优惠券</Button>
  891. </FormItem>
  892. </Col>
  893. <Col span="24" v-if="merchantType == 0">
  894. <FormItem label="关联用户标签:" prop="label_id" class="labelClass">
  895. <div class="labelInput acea-row row-between-wrapper" @click="openLabel">
  896. <div style="width: 90%;">
  897. <div v-if="dataLabel.length">
  898. <Tag closable v-for="(item,index) in dataLabel" :key="index+'label'"
  899. @on-close="closeLabel(item)">{{item.label_name}}</Tag>
  900. </div>
  901. <span class="span" v-else>选择用户关联标签</span>
  902. </div>
  903. <div class="iconfont iconxiayi"></div>
  904. </div>
  905. </FormItem>
  906. </Col>
  907. <Col span="24" >
  908. <FormItem label="仅会员可见:" v-if="merchantType==0">
  909. <i-switch v-model="formValidate.is_vip_product" :true-value="1" :false-value="0" size="large">
  910. <span slot="open">开启</span>
  911. <span slot="close">关闭</span>
  912. </i-switch>
  913. <div class="tips">开启后仅付费会员可以看见并购买此商品</div>
  914. </FormItem>
  915. </Col>
  916. <Col span="24" v-if="merchantType==0">
  917. <FormItem label="单独设置:">
  918. <CheckboxGroup class="checkAlls" v-model="formValidate.is_sub" @on-change="checkAllGroupChange">
  919. <Checkbox :label="1">佣金设置(数字即返佣金额)</Checkbox>
  920. <Checkbox :label="0">付费会员价</Checkbox>
  921. </CheckboxGroup>
  922. </FormItem>
  923. </Col>
  924. <Col span="24" v-if="formValidate.is_sub.length">
  925. <!--单规格返佣-->
  926. <FormItem label="商品属性:" v-if="formValidate.spec_type === 0">
  927. <Table :data="oneFormValidate" :columns="columnsInstall" border>
  928. <template slot-scope="{ row, index }" slot="pic">
  929. <div class="pictrue pictrueTab">
  930. <img v-lazy="oneFormValidate[0].pic" />
  931. </div>
  932. </template>
  933. <template slot-scope="{ row, index }" slot="price">{{
  934. oneFormValidate[0].price
  935. }}</template>
  936. <template slot-scope="{ row, index }" slot="cost">{{
  937. oneFormValidate[0].cost
  938. }}</template>
  939. <template slot-scope="{ row, index }" slot="ot_price">{{
  940. oneFormValidate[0].ot_price
  941. }}</template>
  942. <template slot-scope="{ row, index }" slot="erp_product_id">{{
  943. oneFormValidate[0].erp_product_id
  944. }}</template> <template slot-scope="{ row, index }" slot="unit">{{
  945. oneFormValidate[0].unit
  946. }}</template> <template slot-scope="{ row, index }" slot="uint_to_erp_unit">{{
  947. oneFormValidate[0].uint_to_erp_unit
  948. }}</template>
  949. <!-- <template slot-scope="{ row, index }" slot="stock">{{
  950. oneFormValidate[0].stock
  951. }}</template> -->
  952. <template slot-scope="{ row, index }" slot="bar_code">{{
  953. oneFormValidate[0].bar_code
  954. }}</template>
  955. <template slot-scope="{ row, index }" slot="code">{{
  956. oneFormValidate[0].code
  957. }}</template>
  958. <template slot-scope="{ row, index }" slot="weight">{{
  959. oneFormValidate[0].weight
  960. }}</template>
  961. <template slot-scope="{ row, index }" slot="volume">{{
  962. oneFormValidate[0].volume
  963. }}</template>
  964. <template slot-scope="{ row, index }" slot="brokerage">
  965. <InputNumber v-model="oneFormValidate[0].brokerage" :min="0" class="priceBox">
  966. </InputNumber>
  967. </template>
  968. <template slot-scope="{ row, index }" slot="brokerage_two">
  969. <InputNumber v-model="oneFormValidate[0].brokerage_two" :min="0" class="priceBox">
  970. </InputNumber>
  971. </template>
  972. <template slot-scope="{ row, index }" slot="vip_price">
  973. <InputNumber v-model="oneFormValidate[0].vip_price" :min="0" class="priceBox">
  974. </InputNumber>
  975. </template>
  976. </Table>
  977. </FormItem>
  978. <!--多规格返佣-->
  979. <FormItem label="批量设置:" v-if="formValidate.spec_type === 1">
  980. <span v-if="formValidate.is_sub.indexOf(1) > -1">
  981. 一级返佣:<InputNumber placeholder="请输入一级返佣" :min="0" class="columnsBox perW20"
  982. v-model="manyBrokerage"></InputNumber>
  983. 二级返佣:<InputNumber placeholder="请输入二级返佣" :min="0" class="columnsBox perW20"
  984. v-model="manyBrokerageTwo"></InputNumber>
  985. </span>
  986. <span v-if="formValidate.is_sub.indexOf(0) > -1">
  987. 会员价:<InputNumber placeholder="请输入会员价" :min="0" class="columnsBox perW20"
  988. v-model="manyVipPrice"></InputNumber>
  989. </span>
  990. <Button type="primary" @click="brokerageSetUp">批量设置</Button>
  991. </FormItem>
  992. <FormItem label="商品属性:" v-if="formValidate.spec_type === 1 && manyFormValidate.length">
  993. <Table v-if="formValidate.is_sub" :data="manyFormValidate" :columns="columnsInstal2" border>
  994. <template slot-scope="{ row, index }" v-for="(item,i) in attrData.length"
  995. :slot="'value'+(i+1)">
  996. <div>{{manyFormValidate[index]['value'+(i+1)]}}</div>
  997. </template>
  998. <template slot-scope="{ row, index }" slot="pic">
  999. <div class="pictrue pictrueTab">
  1000. <img v-lazy="manyFormValidate[index].pic" />
  1001. </div>
  1002. </template>
  1003. <template slot-scope="{ row, index }" slot="price">{{
  1004. manyFormValidate[index].price
  1005. }}</template>
  1006. <template slot-scope="{ row, index }" slot="cost">{{
  1007. manyFormValidate[index].cost
  1008. }}</template>
  1009. <template slot-scope="{ row, index }" slot="ot_price">{{
  1010. manyFormValidate[index].ot_price
  1011. }}</template>
  1012. <template slot-scope="{ row, index }" slot="erp_product_id">{{
  1013. manyFormValidate[index].erp_product_id
  1014. }}</template>
  1015. <template slot-scope="{ row, index }" slot="unit">{{
  1016. manyFormValidate[index].unit
  1017. }}</template>
  1018. <template slot-scope="{ row, index }" slot="uint_to_erp_unit">{{
  1019. manyFormValidate[index].uint_to_erp_unit
  1020. }}</template>
  1021. <!-- <template slot-scope="{ row, index }" slot="stock">{{
  1022. manyFormValidate[index].stock
  1023. }}</template> -->
  1024. <template slot-scope="{ row, index }" slot="bar_code">{{
  1025. manyFormValidate[index].bar_code
  1026. }}</template>
  1027. <template slot-scope="{ row, index }" slot="code">{{
  1028. manyFormValidate[index].code
  1029. }}</template>
  1030. <template slot-scope="{ row, index }" slot="weight">{{
  1031. manyFormValidate[index].weight
  1032. }}</template>
  1033. <template slot-scope="{ row, index }" slot="volume">{{
  1034. manyFormValidate[index].volume
  1035. }}</template>
  1036. <template slot-scope="{ row, index }" slot="brokerage">
  1037. <InputNumber v-model="manyFormValidate[index].brokerage" :min="0" class="priceBox">
  1038. </InputNumber>
  1039. </template>
  1040. <template slot-scope="{ row, index }" slot="brokerage_two">
  1041. <InputNumber v-model="manyFormValidate[index].brokerage_two" :min="0" class="priceBox">
  1042. </InputNumber>
  1043. </template>
  1044. <template slot-scope="{ row, index }" slot="vip_price">
  1045. <InputNumber v-model="manyFormValidate[index].vip_price" :min="0" class="priceBox">
  1046. </InputNumber>
  1047. </template>
  1048. </Table>
  1049. </FormItem>
  1050. </Col>
  1051. <Col span="24" v-if="merchantType==0">
  1052. <div class="lines"></div>
  1053. </Col>
  1054. <Col span="24">
  1055. <FormItem label="是否限购:">
  1056. <i-switch v-model="formValidate.is_limit" :true-value="1" :false-value="0" size="large"
  1057. @on-change="limitTap">
  1058. <span slot="open">开启</span>
  1059. <span slot="close">关闭</span>
  1060. </i-switch>
  1061. </FormItem>
  1062. </Col>
  1063. <Col span="24" v-if="formValidate.is_limit">
  1064. <FormItem label="限购类型:">
  1065. <RadioGroup v-model="formValidate.limit_type">
  1066. <Radio :label="1">单次限购</Radio>
  1067. <Radio :label="2">长期限购</Radio>
  1068. </RadioGroup>
  1069. <div class="tips">
  1070. 单次限购是限制每次下单最多购买的数量,长期限购是限制一个用户总共可以购买的数量
  1071. </div>
  1072. </FormItem>
  1073. </Col>
  1074. <Col span="24" v-if="formValidate.is_limit">
  1075. <FormItem label="限购数量:">
  1076. <InputNumber :min="1" v-model="formValidate.limit_num" placeholder="请输入限购数量"
  1077. class="perW20 maxW" />
  1078. </FormItem>
  1079. </Col>
  1080. <Col span="24" v-if="formValidate.product_type == 0 && merchantType==0">
  1081. <FormItem label="预售商品:">
  1082. <i-switch v-model="formValidate.is_presale_product" :true-value="1" :false-value="0"
  1083. size="large">
  1084. <span slot="open">开启</span>
  1085. <span slot="close">关闭</span>
  1086. </i-switch>
  1087. </FormItem>
  1088. </Col>
  1089. <Col span="24" v-if="formValidate.product_type == 0 && formValidate.is_presale_product">
  1090. <FormItem label="预售活动时间:" prop="presale_time">
  1091. <div class="acea-row row-middle">
  1092. <DatePicker :editable="false" :options="datePickerOptions" type="datetimerange"
  1093. format="yyyy-MM-dd HH:mm" placeholder="请选择活动时间" @on-change="onchangeTime"
  1094. :value="formValidate.presale_time" v-model="formValidate.presale_time" v-width="'50%'">
  1095. </DatePicker>
  1096. </div>
  1097. <div class="tips">
  1098. 设置活动开启结束时间,用户可以在设置时间内发起参与预售
  1099. </div>
  1100. </FormItem>
  1101. </Col>
  1102. <Col span="24" v-if="formValidate.product_type == 0 && formValidate.is_presale_product">
  1103. <FormItem label="发货时间:" prop="presale_day">
  1104. <div class="acea-row row-middle">
  1105. <span class="mr10">预售活动结束后</span>
  1106. <InputNumber placeholder="请输入发货时间" :precision="0" :min="1" style="width: 100px;"
  1107. v-model="formValidate.presale_day" />
  1108. <span class="ml10">天之内</span>
  1109. </div>
  1110. </FormItem>
  1111. </Col>
  1112. <Col span="24" v-if="merchantType==0">
  1113. <FormItem label="优品推荐:">
  1114. <i-switch v-model="formValidate.is_good" :true-value="1" :false-value="0" size="large">
  1115. <span slot="open">开启</span>
  1116. <span slot="close">关闭</span>
  1117. </i-switch>
  1118. </FormItem>
  1119. <!-- <FormItem label="优品推荐:">
  1120. <CheckboxGroup
  1121. v-model="formValidate.recommend"
  1122. class="checkAlls"
  1123. >
  1124. <Checkbox label="is_hot">热卖单品</Checkbox>
  1125. <Checkbox label="is_benefit">促销单品</Checkbox>
  1126. <Checkbox label="is_best">精品推荐</Checkbox>
  1127. <Checkbox label="is_new">首发新品</Checkbox>
  1128. <Checkbox label="is_good">优品推荐</Checkbox>
  1129. </CheckboxGroup>
  1130. </FormItem> -->
  1131. </Col>
  1132. <Col v-bind="grid3" v-if="merchantType==0">
  1133. <FormItem label="活动优先级:">
  1134. <div class="color-list acea-row row-middle">
  1135. <div class="color-item acea-row row-center-wrapper" :class="activity[color]"
  1136. v-for="(color,index) in formValidate.activity" v-dragging="{
  1137. item: color,
  1138. list: formValidate.activity,
  1139. group: 'color',
  1140. }" :key="color">
  1141. <div class="num">{{index+1}}</div>
  1142. <div> {{ color }}</div>
  1143. </div>
  1144. <div class="tips">可拖动按钮调整活动的优先展示顺序</div>
  1145. </div>
  1146. </FormItem>
  1147. </Col>
  1148. <Col span="24" v-if="merchantType==0">
  1149. <FormItem label="选择优品推荐商品:">
  1150. <div class="acea-row">
  1151. <div class="pictrue" v-for="(item, index) in goodsData" :key="index+'goods'">
  1152. <img v-lazy="item.image" />
  1153. <Button shape="circle" icon="md-close" @click.native="bindDelete(index)"
  1154. class="btndel"></Button>
  1155. </div>
  1156. <div v-if="goodsData.length < 12" class="upLoad acea-row row-center-wrapper"
  1157. @click="goodsTap">
  1158. <Icon type="ios-camera-outline" size="26" />
  1159. </div>
  1160. </div>
  1161. </FormItem>
  1162. </Col>
  1163. </Row>
  1164. <!-- 其他设置-->
  1165. <Row v-show="currentTab === '6'">
  1166. <Col span="24">
  1167. <FormItem label="商品关键字:" prop="">
  1168. <Input v-model="formValidate.keyword" placeholder="请输入商品关键字" v-width="'50%'" />
  1169. <div class="tips">通过命中关键字搜索对应商品,方便用户查找</div>
  1170. </FormItem>
  1171. </Col>
  1172. <Col span="24">
  1173. <FormItem label="商品简介:" prop="">
  1174. <Input v-model="formValidate.store_info" type="textarea" :rows="3" placeholder="请输入商品简介"
  1175. v-width="'50%'" />
  1176. <div class="tips">微信分享商品时,分享的卡片上会显示商品简介
  1177. <Poptip placement="bottom" trigger="hover" width="256" transfer padding="8px">
  1178. <a>查看示例</a>
  1179. <div class="exampleImg" slot="content">
  1180. <img :src="`${baseURL}/statics/system/productDesc.png`" alt="" />
  1181. </div>
  1182. </Poptip>
  1183. </div>
  1184. </FormItem>
  1185. </Col>
  1186. <Col span="24">
  1187. <FormItem label="商品口令:">
  1188. <Input v-model="formValidate.command_word" type="textarea" :rows="3" placeholder="请输入商品口令"
  1189. v-width="'50%'" />
  1190. <div class="tips">可将淘宝、抖音等平台的口令复制在此处,用户点击商城商品详情后会自动复制口令,随后打开淘宝等平台会自动弹出口令弹窗
  1191. <Poptip placement="bottom" trigger="hover" width="256" transfer padding="8px">
  1192. <a>查看示例</a>
  1193. <div class="exampleImg" slot="content">
  1194. <div style="margin-bottom: 10px;font-size: 12px;line-height: 18px;color: #666666;">
  1195. 商品口令需在淘宝、天猫、京东、苏<br>宁、1688上有同款商品,复制口令后<br>可在相关应用中打开(下图为淘宝展示)</div>
  1196. <img :src="`${baseURL}/statics/system/productCommandWord.png`" alt="" />
  1197. </div>
  1198. </Poptip>
  1199. </div>
  1200. </FormItem>
  1201. </Col>
  1202. <Col span="24">
  1203. <FormItem label="商品推荐图:">
  1204. <div class="acea-row">
  1205. <div v-if="formValidate.recommend_image" class="pictrue">
  1206. <img v-lazy="formValidate.recommend_image" />
  1207. <Button shape="circle" icon="md-close" @click.native="formValidate.recommend_image = ''"
  1208. class="btndel"></Button>
  1209. </div>
  1210. <div v-else class="upLoad acea-row row-center-wrapper"
  1211. @click="modalPicTap('dan', 'recommend_image')">
  1212. <Icon type="ios-camera-outline" size="26" />
  1213. </div>
  1214. <Input v-model="formValidate.recommend_image" class="input-display"></Input>
  1215. </div>
  1216. <div class="tips">在特殊的商品分类样式中显示(建议图片比例5:2)
  1217. <Poptip placement="bottom" trigger="hover" width="256" transfer padding="8px">
  1218. <a>查看示例</a>
  1219. <div class="exampleImg" slot="content">
  1220. <img :src="`${baseURL}/statics/system/productRecommendImage.png`" alt="" />
  1221. </div>
  1222. </Poptip>
  1223. </div>
  1224. </FormItem>
  1225. </Col>
  1226. <Col span="24">
  1227. <FormItem label="服务保障:">
  1228. <CheckboxGroup v-model="formValidate.ensure_id" class="checkAlls">
  1229. <Checkbox :label="item.id" v-for="(item,index) in ensureData" :key="item.id">{{item.name}}
  1230. </Checkbox>
  1231. </CheckboxGroup>
  1232. <div class="tips">
  1233. <Poptip placement="bottom" trigger="hover" width="256" transfer padding="8px">
  1234. <a>查看示例</a>
  1235. <div class="exampleImg" slot="content">
  1236. <img :src="`${baseURL}/statics/system/productEnsure.png`" alt="" />
  1237. </div>
  1238. </Poptip>
  1239. </div>
  1240. </FormItem>
  1241. </Col>
  1242. <Col span="24">
  1243. <FormItem label="商品参数:" prop="">
  1244. <Select v-model="formValidate.specs_id" clearable filterable v-width="'50%'"
  1245. placeholder="请输入商品参数" @on-change="specsInfo">
  1246. <Option v-for="(item, index) in specsData" :value="item.id" :key="item.id">{{ item.name }}
  1247. </Option>
  1248. </Select>
  1249. </FormItem>
  1250. </Col>
  1251. <Col span="24" v-if="formValidate.specs_id">
  1252. <FormItem label="" props="">
  1253. <Table border :columns="specsColumns" :data="specsList" ref="table" class="specsList"
  1254. width="700">
  1255. <template slot-scope="{ row, index }" slot="action">
  1256. <a @click="delSpecs(index)" v-if="index>0">删除</a>
  1257. </template>
  1258. </Table>
  1259. <Button class="mt20" @click="addSpecs">添加参数</Button>
  1260. </FormItem>
  1261. </Col>
  1262. <Col span="24" v-if="formValidate.product_type">
  1263. <FormItem label="支持退款:" props="status" label-for="status">
  1264. <i-switch v-model="formValidate.is_support_refund" :true-value="1" :false-value="0"
  1265. size="large">
  1266. <span slot="open">开启</span>
  1267. <span slot="close">关闭</span>
  1268. </i-switch>
  1269. </FormItem>
  1270. </Col>
  1271. <Col span="24">
  1272. <FormItem label="自定义留言:">
  1273. <i-switch v-model="customBtn" @on-change="customMessBtn" size="large">
  1274. <span slot="open">开启</span>
  1275. <span slot="close">关闭</span>
  1276. </i-switch>
  1277. <div class="mt10" v-if="customBtn">
  1278. <Select v-model="formValidate.system_form_id" filterable v-width="'50%'" placeholder="请选择"
  1279. @on-change="changeForm">
  1280. <Option v-for="(item, index) in formList" :value="item.id" :key="item.id">
  1281. {{ item.name }}
  1282. </Option>
  1283. </Select>
  1284. </div>
  1285. </FormItem>
  1286. </Col>
  1287. <Col span="24" v-if="customBtn && formValidate.system_form_id">
  1288. <FormItem label="" props="">
  1289. <Table border :columns="formColumns" :data="formTypeList" ref="table" class="specsList on">
  1290. <template slot-scope="{ row }" slot="require">
  1291. <span>{{row.require?'必填':'不必填'}}</span>
  1292. </template>
  1293. </Table>
  1294. </FormItem>
  1295. </Col>
  1296. <!-- <Col span="24">-->
  1297. <!-- <FormItem label="自定义留言:">-->
  1298. <!-- <i-switch-->
  1299. <!-- v-model="customBtn"-->
  1300. <!-- @on-change="customMessBtn"-->
  1301. <!-- size="large"-->
  1302. <!-- >-->
  1303. <!-- <span slot="open">开启</span>-->
  1304. <!-- <span slot="close">关闭</span>-->
  1305. <!-- </i-switch>-->
  1306. <!-- <div class="addCustom_content" v-if="customBtn">-->
  1307. <!-- <div-->
  1308. <!-- v-for="(item, index) in formValidate.custom_form"-->
  1309. <!-- type="flex"-->
  1310. <!-- :key="index+'custom'"-->
  1311. <!-- class="custom_box"-->
  1312. <!-- >-->
  1313. <!-- <Input-->
  1314. <!-- v-model.trim="item.title"-->
  1315. <!-- :placeholder="'留言标题' + (index + 1)"-->
  1316. <!-- class="custom-input"-->
  1317. <!-- />-->
  1318. <!-- <Select-->
  1319. <!-- v-model="item.label"-->
  1320. <!-- class="select-add"-->
  1321. <!-- >-->
  1322. <!-- <Option-->
  1323. <!-- v-for="items in customList"-->
  1324. <!-- :value="items.value"-->
  1325. <!-- :key="items.value"-->
  1326. <!-- >{{ items.label }}</Option-->
  1327. <!-- >-->
  1328. <!-- </Select>-->
  1329. <!-- <Checkbox v-model="item.status" :true-value="1" :false-value="0">必填</Checkbox>-->
  1330. <!-- <div class="addfont" @click="delcustom(index)">删除</div>-->
  1331. <!-- </div>-->
  1332. <!-- </div>-->
  1333. <!-- <div class="addCustomBox" v-show="customBtn">-->
  1334. <!-- <div class="btn" @click="addcustom">+ 添加表单</div>-->
  1335. <!-- <div class="tips">用户下单时需填写的信息,最多可设置10条</div>-->
  1336. <!-- </div>-->
  1337. <!-- </FormItem>-->
  1338. <!-- </Col>-->
  1339. </Row>
  1340. <Row v-show="currentTab === '7' && merchantType==0">
  1341. <Col span="24" class="ml10">
  1342. <RadioGroup v-model="formValidate.applicable_type" class="radioGroup">
  1343. <Radio :label="1">全部门店</Radio>
  1344. <Radio :label="2">部分门店</Radio>
  1345. <Radio :label="0">仅平台适用</Radio>
  1346. </RadioGroup>
  1347. <div class="tips">可选择将商品同步到哪些门店使用,选择“仅平台适用“则商品不同步任何门店</div>
  1348. </Col>
  1349. <Col span="24" class="mt20 ml10" v-if="formValidate.applicable_type == 2">
  1350. <Button type="primary" @click="addStore">添加门店</Button>
  1351. </Col>
  1352. <Col span="24" class="ml10">
  1353. <div class="storeTable" v-if="formValidate.applicable_type == 2">
  1354. <Table :columns="storeColumns" :data="storesList" ref="table" class="ivu-mt" highlight-row
  1355. no-userFrom-text="暂无数据" no-filtered-userFrom-text="暂无筛选结果">
  1356. <template slot-scope="{ row }" slot="image">
  1357. <img :src="row.image" />
  1358. </template>
  1359. <template slot-scope="{ row, index }" slot="action">
  1360. <a @click="delte(index)">删除</a>
  1361. </template>
  1362. </Table>
  1363. </div>
  1364. </Col>
  1365. </Row>
  1366. <Spin size="large" fix v-if="spinShow"></Spin>
  1367. </Form>
  1368. <Modal v-model="modalPic" width="960px" scrollable footer-hide closable title="上传商品图" :mask-closable="false"
  1369. :z-index="1">
  1370. <uploadPictures :isChoice="isChoice" @getPic="getPic" @getPicD="getPicD" :gridBtn="gridBtn"
  1371. :gridPic="gridPic" v-if="modalPic"></uploadPictures>
  1372. </Modal>
  1373. </Card>
  1374. <Card :bordered="false" dis-hover class="fixed-card"
  1375. :style="{left: `${!menuCollapse?'200px':isMobile?'0':'80px'}`}">
  1376. <Form>
  1377. <FormItem>
  1378. <Button v-if="currentTab !== '1'" @click="upTab">上一步</Button>
  1379. <Button type="primary" class="submission"
  1380. v-if="(formValidate.product_type && formValidate.product_type !=4 && currentTab !== '6') || (formValidate.product_type == 4 && currentTab !== '7') || (!formValidate.product_type && currentTab !== '7')"
  1381. @click="downTab('formValidate')">下一步</Button>
  1382. <Button type="primary" :disabled="openSubimit" class="submission"
  1383. @click="handleSubmit('formValidate')"
  1384. v-if="$route.params.id || (formValidate.product_type && formValidate.product_type !=4 && currentTab == '6') || (formValidate.product_type == 4 && currentTab == '7') || (!formValidate.product_type && currentTab == '7')">保存</Button>
  1385. </FormItem>
  1386. </Form>
  1387. </Card>
  1388. <freightTemplate :template="template" :merchantType="merchantType" v-on:changeTemplate="changeTemplate"
  1389. ref="templates"></freightTemplate>
  1390. <add-attr ref="addattr" @getList="userSearchs"></add-attr>
  1391. <coupon-list ref="couponTemplates" @nameId="nameId" :couponids="formValidate.coupon_ids" :updateIds="updateIds"
  1392. :updateName="updateName"></coupon-list>
  1393. <!-- 生成淘宝京东表单-->
  1394. <Modal v-model="modals" @on-cancel="cancel" class="Box" class-name="vertical-center-modal" scrollable
  1395. footer-hide closable title="复制淘宝、天猫、京东、苏宁、1688" :mask-closable="false" width="800" height="500">
  1396. <tao-bao ref="taobaos" v-if="modals" @on-close="onClose"></tao-bao>
  1397. </Modal>
  1398. <!-- 商品列表 -->
  1399. <Modal v-model="goodsModals" title="商品列表" footerHide scrollable width="900" @on-cancel="goodCancel">
  1400. <goods-list v-if="goodsModals" ref="goodslist" @getProductId="getProductId" :ischeckbox="true"></goods-list>
  1401. </Modal>
  1402. <!-- 用户标签 -->
  1403. <Modal v-model="labelShow" scrollable title="选择用户标签" :closable="true" width="540" :footer-hide="true"
  1404. :mask-closable="false">
  1405. <userLabel ref="userLabel" @activeData="activeData" @close="labelClose"></userLabel>
  1406. </Modal>
  1407. <!-- 商品标签 -->
  1408. <Modal v-model="storeLabelShow" scrollable title="选择商品标签" :closable="true" width="540" :footer-hide="true"
  1409. :mask-closable="false">
  1410. <storeLabelList ref="storeLabel" @activeData="activeStoreData" @close="storeLabelClose"></storeLabelList>
  1411. </Modal>
  1412. <menus-from :formValidate="formBrand" :fromName='1' ref="menusFrom"></menus-from>
  1413. <Modal v-model="attrShow" scrollable title="请选择商品规格" :closable="false" width="320" :footer-hide="true"
  1414. :mask-closable="false">
  1415. <attr-list :attrs="attrsList" @activeData="activeAttr" @close="labelAttr" @subAttrs="subAttrs"
  1416. v-if="attrShow"></attr-list>
  1417. </Modal>
  1418. <Modal v-model="carMyShow" scrollable title="添加卡密" closable width="700" :footer-hide="true"
  1419. :mask-closable="false">
  1420. <add-carMy ref="addCarMy" :virtualList="virtualList" @changeVirtual="changeVirtual" @fixdBtn="fixdBtn"
  1421. @closeCarMy="closeCarMy"></add-carMy>
  1422. </Modal>
  1423. <Modal v-model="storeModals" title="门店列表" footerHide scrollable width="900" @on-cancel="cancelStore">
  1424. <store-list ref="storelist" @getStoreId="getStoreId" v-if="storeModals"></store-list>
  1425. </Modal>
  1426. </div>
  1427. </template>
  1428. <script>
  1429. // import COS from 'cos-js-sdk-v5'
  1430. import {
  1431. mapState,
  1432. mapMutations
  1433. } from "vuex";
  1434. import Setting from "@/setting";
  1435. import util from "@/libs/util";
  1436. import vuedraggable from "vuedraggable";
  1437. import uploadPictures from "@/components/uploadPictures";
  1438. import freightTemplate from "@/components/freightTemplate";
  1439. import wangeditor from "@/components/wangEditor/index.vue";
  1440. import storeList from "@/components/storeList";
  1441. import menusFrom from "../productBrand/components/menusFrom";
  1442. import userLabel from "@/components/labelList";
  1443. import storeLabelList from "@/components/storeLabelList";
  1444. import couponList from "@/components/couponList";
  1445. import goodsList from '@/components/goodsList/index';
  1446. import addAttr from "../productAttr/addAttr";
  1447. import attrList from "../components/attrList";
  1448. import addCarMy from "../components/addCarMy";
  1449. import taoBao from './taoBao'
  1450. import {
  1451. productInfoApi,
  1452. cascaderListApi,
  1453. productAddApi,
  1454. generateAttrApi,
  1455. productGetRuleApi,
  1456. productGetTemplateApi,
  1457. productGetTempKeysApi,
  1458. checkActivityApi,
  1459. labelListApi,
  1460. productCache,
  1461. cacheDelete,
  1462. brandList,
  1463. productCreateApi,
  1464. productAllUnit,
  1465. productUnitCreate,
  1466. uploadType,
  1467. productAllEnsure,
  1468. productLabelAdd,
  1469. productAllSpecs,
  1470. allSystemForm
  1471. } from "@/api/product";
  1472. import {
  1473. erpGoods
  1474. } from '@/api/erp'
  1475. import {
  1476. systemFormInfo
  1477. } from '@/api/setting'
  1478. import {
  1479. getSupplierList
  1480. } from '@/api/supplier'
  1481. import {
  1482. erpConfig
  1483. } from "@/api/erp";
  1484. import {
  1485. uploadByPieces
  1486. } from "@/utils/upload"; //引入uploadByPieces方法
  1487. export default {
  1488. name: "product_productAdd",
  1489. components: {
  1490. storeList,
  1491. uploadPictures,
  1492. freightTemplate,
  1493. goodsList,
  1494. addAttr,
  1495. couponList,
  1496. taoBao,
  1497. userLabel,
  1498. menusFrom,
  1499. attrList,
  1500. addCarMy,
  1501. storeLabelList,
  1502. wangeditor,
  1503. draggable: vuedraggable,
  1504. },
  1505. data() {
  1506. return {
  1507. formTypeList: [],
  1508. formColumns: [{
  1509. title: '表单标题',
  1510. key: 'title',
  1511. // align:'center',
  1512. minWidth: 100
  1513. },
  1514. {
  1515. title: '表单类型',
  1516. key: 'name',
  1517. // align:'center',
  1518. minWidth: 100
  1519. },
  1520. {
  1521. title: '是否必填',
  1522. slot: 'require',
  1523. // align:'center',
  1524. minWidth: 100
  1525. }
  1526. ],
  1527. storesList: [],
  1528. tableData: [],
  1529. storeModals: false,
  1530. roterPre: Setting.roterPre,
  1531. specsList: [],
  1532. supplierList: [],
  1533. specsColumns: [{
  1534. title: '参数名称',
  1535. key: 'name',
  1536. align: 'center',
  1537. width: 150,
  1538. render: (h, params) => {
  1539. return h("div", [
  1540. h("Input", {
  1541. props: {
  1542. value: params.row.name,
  1543. placeholder: '请输入参数名称'
  1544. },
  1545. on: {
  1546. "on-change": (e) => {
  1547. params.row.name = e.target.value;
  1548. this.specsList[params.index].name = e.target.value;
  1549. },
  1550. },
  1551. }),
  1552. ]);
  1553. }
  1554. },
  1555. {
  1556. title: '参数值',
  1557. key: 'value',
  1558. align: 'center',
  1559. width: 300,
  1560. render: (h, params) => {
  1561. return h("div", [
  1562. h("Input", {
  1563. props: {
  1564. value: params.row.value,
  1565. placeholder: '请输入参数值'
  1566. },
  1567. on: {
  1568. "on-change": (e) => {
  1569. params.row.value = e.target.value;
  1570. this.specsList[params.index].value = e.target.value;
  1571. },
  1572. },
  1573. }),
  1574. ]);
  1575. }
  1576. },
  1577. {
  1578. title: '排序',
  1579. key: 'sort',
  1580. align: 'center',
  1581. width: 100,
  1582. render: (h, params) => {
  1583. return h("div", [
  1584. h("InputNumber", {
  1585. props: {
  1586. value: parseInt(params.row.sort) || 0,
  1587. placeholder: '排序',
  1588. precision: 0
  1589. },
  1590. on: {
  1591. "on-change": (e) => {
  1592. params.row.sort = e;
  1593. this.specsList[params.index].sort = e;
  1594. },
  1595. },
  1596. }),
  1597. ]);
  1598. }
  1599. },
  1600. {
  1601. title: '操作',
  1602. slot: 'action',
  1603. align: 'center',
  1604. minWidth: 120
  1605. }
  1606. ],
  1607. //自定义留言下拉选择
  1608. customList: [{
  1609. value: "text",
  1610. label: "文本框",
  1611. },
  1612. {
  1613. value: "number",
  1614. label: "数字",
  1615. },
  1616. {
  1617. value: "email",
  1618. label: "邮件",
  1619. },
  1620. {
  1621. value: "data",
  1622. label: "日期",
  1623. },
  1624. {
  1625. value: "time",
  1626. label: "时间",
  1627. },
  1628. {
  1629. value: "id",
  1630. label: "身份证",
  1631. },
  1632. {
  1633. value: "phone",
  1634. label: "手机号",
  1635. },
  1636. {
  1637. value: "img",
  1638. label: "图片",
  1639. },
  1640. ],
  1641. headTab: [{
  1642. title: "基础信息",
  1643. name: "1"
  1644. },
  1645. {
  1646. title: "规格库存",
  1647. name: "2"
  1648. },
  1649. {
  1650. title: "商品详情",
  1651. name: "3"
  1652. },
  1653. {
  1654. title: "物流设置",
  1655. name: "4"
  1656. },
  1657. {
  1658. title: "营销设置",
  1659. name: "5"
  1660. },
  1661. {
  1662. title: "其他设置",
  1663. name: "6"
  1664. },
  1665. {
  1666. title: "适用门店",
  1667. name: "7"
  1668. },
  1669. ],
  1670. productType: [{
  1671. name: "普通商品",
  1672. title: "物流发货",
  1673. id: 0
  1674. },
  1675. {
  1676. name: "卡密/网盘",
  1677. title: "自动发货",
  1678. id: 1
  1679. },
  1680. {
  1681. name: "虚拟商品",
  1682. title: "虚拟发货",
  1683. id: 3
  1684. },
  1685. {
  1686. name: "次卡商品",
  1687. title: "到店核销",
  1688. id: 4
  1689. },
  1690. ],
  1691. virtualList: [],
  1692. carMyShow: false, //是否开启卡密弹窗
  1693. recommend: [], //商品推荐
  1694. customBtn: false, //自定义留言开关
  1695. attrShow: false,
  1696. content: "",
  1697. contents: "",
  1698. seletVideo: 0,
  1699. fileUrl: Setting.apiBaseURL + "/file/upload",
  1700. fileUrl2: Setting.apiBaseURL + "/file/video_upload",
  1701. baseURL: Setting.apiBaseURL.replace(/adminapi/, ''),
  1702. upload_type: "", //视频上传类型 1 本地上传 2 3 4 OSS上传
  1703. uploadData: {}, // 上传参数
  1704. header: {},
  1705. dataLabel: [],
  1706. storeDataLabel: [],
  1707. labelShow: false,
  1708. storeLabelShow: false,
  1709. props: {
  1710. emitPath: false,
  1711. multiple: true,
  1712. checkStrictly: true
  1713. },
  1714. type: 0,
  1715. goodsModals: false,
  1716. off_show: 0,
  1717. modals: false,
  1718. spinShow: false,
  1719. openSubimit: false,
  1720. grid2: {
  1721. xl: 10,
  1722. lg: 12,
  1723. md: 12,
  1724. sm: 24,
  1725. xs: 24,
  1726. },
  1727. grid3: {
  1728. xl: 18,
  1729. lg: 18,
  1730. md: 20,
  1731. sm: 24,
  1732. xs: 24,
  1733. },
  1734. // 批量设置表格data
  1735. oneFormBatch: [{
  1736. attr: "全部",
  1737. pic: "",
  1738. price: 0,
  1739. settle_price: 0,
  1740. cost: 0,
  1741. ot_price: 0,
  1742. erp_product_id: 0,
  1743. unit: 0,
  1744. uint_to_erp_unit: 0,
  1745. // stock: 0,
  1746. bar_code: "",
  1747. code: "",
  1748. weight: 0,
  1749. volume: 0,
  1750. }, ],
  1751. // 规格数据
  1752. formDynamic: {
  1753. attrsName: "",
  1754. attrsVal: "",
  1755. },
  1756. formDynamicNameData: [],
  1757. isBtn: false,
  1758. columnsCarMy: [],
  1759. columns2: [{
  1760. title: "商品规格",
  1761. slot: "attr",
  1762. align: "center",
  1763. minWidth: 80,
  1764. },
  1765. {
  1766. title: "图片",
  1767. slot: "pic",
  1768. align: "center",
  1769. minWidth: 80,
  1770. },
  1771. {
  1772. title: "售价",
  1773. slot: "price",
  1774. align: "center",
  1775. minWidth: 95,
  1776. },
  1777. {
  1778. title: "成本价",
  1779. slot: "cost",
  1780. align: "center",
  1781. minWidth: 95,
  1782. },
  1783. {
  1784. title: "原价",
  1785. slot: "ot_price",
  1786. align: "center",
  1787. minWidth: 95,
  1788. },
  1789. {
  1790. title: "仓库商品",
  1791. slot: "erp_product_id",
  1792. align: "center",
  1793. minWidth: 95,
  1794. },
  1795. {
  1796. title: "规格单位",
  1797. slot: "unit",
  1798. align: "center",
  1799. minWidth: 95,
  1800. },
  1801. {
  1802. title: "转换率",
  1803. slot: "uint_to_erp_unit",
  1804. align: "center",
  1805. minWidth: 95,
  1806. },
  1807. // {
  1808. // title: "库存",
  1809. // slot: "stock",
  1810. // align: "center",
  1811. // minWidth: 95,
  1812. // },
  1813. {
  1814. title: "商品条形码",
  1815. slot: "bar_code",
  1816. align: "center",
  1817. minWidth: 120,
  1818. },
  1819. {
  1820. title: "商品编号",
  1821. slot: "code",
  1822. align: "center",
  1823. minWidth: 120,
  1824. },
  1825. {
  1826. title: "重量(KG)",
  1827. slot: "weight",
  1828. align: "center",
  1829. minWidth: 95,
  1830. },
  1831. {
  1832. title: "体积(m³)",
  1833. slot: "volume",
  1834. align: "center",
  1835. minWidth: 95,
  1836. },
  1837. {
  1838. title: "操作",
  1839. slot: "action",
  1840. // fixed: "right",
  1841. align: "center",
  1842. minWidth: 140,
  1843. },
  1844. ],
  1845. columns: [],
  1846. columnsInstall: [],
  1847. columnsInstal2: [],
  1848. gridPic: {
  1849. xl: 6,
  1850. lg: 8,
  1851. md: 12,
  1852. sm: 12,
  1853. xs: 12,
  1854. },
  1855. gridBtn: {
  1856. xl: 4,
  1857. lg: 8,
  1858. md: 8,
  1859. sm: 8,
  1860. xs: 8,
  1861. },
  1862. formValidate: {
  1863. is_weigh: 0,
  1864. applicable_store_id: [],
  1865. system_form_id: 0, //自定义表单id
  1866. // supplier_id:0,//供应商
  1867. is_presale_product: 0, //预售商品开关
  1868. is_limit: 0, //是否限购开关
  1869. limit_type: 1, //1单次限购,2长期限购
  1870. limit_num: 1, //限购数量
  1871. is_vip_product: 0, //付费会员专属开关
  1872. is_support_refund: 0,
  1873. disk_info: "", //卡密简介
  1874. presale_day: 1, //预售发货时间-结束
  1875. presale_time: [],
  1876. auto_on_time: '',
  1877. video_open: false, //视频按钮是否显示
  1878. store_name: "",
  1879. freight: 1, //运费设置
  1880. postage: 0, //设置运费金额
  1881. custom_form: [], //自定义留言
  1882. cate_id: [],
  1883. label_id: [],
  1884. ensure_id: [],
  1885. keyword: "",
  1886. applicable_type: 1,
  1887. unit_name: "",
  1888. specs_id: 0,
  1889. store_info: "",
  1890. bar_code: "",
  1891. code: "",
  1892. image: "",
  1893. recommend_image: "",
  1894. slider_image: [],
  1895. description: "",
  1896. ficti: 0,
  1897. give_integral: 0,
  1898. sort: 0,
  1899. is_supreme: false,
  1900. is_show: 1,
  1901. is_hot: 0,
  1902. is_benefit: 0,
  1903. is_best: 0,
  1904. is_new: 0,
  1905. is_good: 0,
  1906. is_postage: 0,
  1907. is_sub: [],
  1908. id: 0,
  1909. spec_type: 0,
  1910. video_link: "",
  1911. temp_id: "",
  1912. attrs: [],
  1913. items: [{
  1914. pic: "",
  1915. price: 0,
  1916. cost: 0,
  1917. ot_price: 0,
  1918. erp_product_id: 0,
  1919. unit: '',
  1920. uint_to_erp_unit: 0,
  1921. // stock: 0,
  1922. bar_code: "",
  1923. code: "",
  1924. }, ],
  1925. activity: ["默认", "秒杀", "砍价", "拼团"],
  1926. couponName: [],
  1927. header: [],
  1928. selectRule: "",
  1929. coupon_ids: [],
  1930. command_word: "",
  1931. delivery_type: ['1'],
  1932. specs: [],
  1933. recommend_list: [],
  1934. brand_id: [],
  1935. product_type: 0
  1936. },
  1937. ruleList: [],
  1938. templateList: [],
  1939. createBnt: false,
  1940. showIput: false,
  1941. manyFormValidate: [],
  1942. // 单规格表格data
  1943. oneFormValidate: [{
  1944. pic: "",
  1945. price: 0,
  1946. settle_price: 0,
  1947. cost: 0,
  1948. ot_price: 0,
  1949. erp_product_id: 0,
  1950. unit: '',
  1951. uint_to_erp_unit: 0,
  1952. // stock: 0,
  1953. bar_code: "",
  1954. code: "",
  1955. weight: 0,
  1956. volume: 0,
  1957. brokerage: 0,
  1958. brokerage_two: 0,
  1959. vip_price: 0,
  1960. virtual_list: [],
  1961. write_times: 0, //核销次数
  1962. write_valid: 1, //核销时效
  1963. days: 1
  1964. }, ],
  1965. images: [],
  1966. imagesTable: "",
  1967. currentTab: "1",
  1968. isChoice: "",
  1969. grid: {
  1970. xl: 8,
  1971. lg: 8,
  1972. md: 12,
  1973. sm: 24,
  1974. xs: 24,
  1975. },
  1976. loading: false,
  1977. modalPic: false,
  1978. template: false,
  1979. uploadList: [],
  1980. treeSelect: [],
  1981. labelSelect: [],
  1982. ensureData: [],
  1983. specsData: [],
  1984. picTit: "",
  1985. tableIndex: 0,
  1986. ruleValidate: {
  1987. store_name: [{
  1988. required: true,
  1989. message: "请输入商品名称",
  1990. trigger: "blur"
  1991. }, ],
  1992. cate_id: [{
  1993. required: true,
  1994. message: "请选择商品分类",
  1995. trigger: "change",
  1996. type: "array"
  1997. }, ],
  1998. keyword: [{
  1999. required: true,
  2000. message: "请输入商品关键字",
  2001. trigger: "blur"
  2002. }, ],
  2003. unit_name: [{
  2004. required: true,
  2005. message: "请输入单位",
  2006. trigger: "change",
  2007. }, ],
  2008. store_info: [{
  2009. required: true,
  2010. message: "请输入商品简介",
  2011. trigger: "blur"
  2012. }, ],
  2013. //image: [{ required: true, message: "请上传商品图", trigger: "change" }],
  2014. slider_image: [{
  2015. required: true,
  2016. message: "请上传商品轮播图",
  2017. type: "array",
  2018. trigger: "change",
  2019. }, ],
  2020. spec_type: [{
  2021. required: true,
  2022. message: "请选择商品规格",
  2023. trigger: "change"
  2024. }, ],
  2025. selectRule: [{
  2026. required: true,
  2027. message: "请选择商品规格属性",
  2028. trigger: "change"
  2029. }, ],
  2030. give_integral: [{
  2031. type: "integer",
  2032. message: "请输入整数"
  2033. }],
  2034. // delivery_type:[
  2035. // { required: true, type: 'array', min: 1, message: '请选择配送方式', trigger: 'change' },
  2036. // ]
  2037. },
  2038. manyBrokerage: 0,
  2039. manyBrokerageTwo: 0,
  2040. manyVipPrice: 0,
  2041. upload: {
  2042. videoIng: false, // 是否显示进度条;
  2043. },
  2044. videoIng: false, // 是否显示进度条;
  2045. progress: 0, // 进度条默认0
  2046. videoLink: "",
  2047. attrs: [],
  2048. activity: {
  2049. 默认: "colorBlue",
  2050. 秒杀: "colorBlue",
  2051. 砍价: "colorBlue",
  2052. 拼团: "colorBlue"
  2053. },
  2054. couponName: [],
  2055. updateIds: [],
  2056. updateName: [],
  2057. rakeBack: [{
  2058. title: "一级返佣",
  2059. slot: "brokerage",
  2060. align: "center",
  2061. width: 95,
  2062. },
  2063. {
  2064. title: "二级返佣",
  2065. slot: "brokerage_two",
  2066. align: "center",
  2067. width: 95,
  2068. },
  2069. ],
  2070. member: [{
  2071. title: "会员价",
  2072. slot: "vip_price",
  2073. align: "center",
  2074. width: 95,
  2075. }, ],
  2076. headerCarMy: {
  2077. title: "卡密设置",
  2078. slot: "fictitious",
  2079. align: "center",
  2080. width: 95,
  2081. },
  2082. columnsInstalM: [],
  2083. moveIndex: "",
  2084. goodsData: [],
  2085. brandData: [],
  2086. unitNameList: [],
  2087. formBrand: {},
  2088. attrsList: [],
  2089. activeAtter: [],
  2090. tabIndex: 0,
  2091. tabName: "",
  2092. attrData: [],
  2093. datePickerOptions: {
  2094. disabledDate(date) {
  2095. return date && date.valueOf() < Date.now() - 86400000;
  2096. }
  2097. },
  2098. openErp: false,
  2099. merchantType: 0, //0:平台商品;1:门店商品;2:供应商商品
  2100. formList: [],
  2101. storeColumns: [{
  2102. title: "ID",
  2103. key: "id",
  2104. width: 60,
  2105. },
  2106. {
  2107. title: "门店图片",
  2108. slot: "image",
  2109. minWidth: 80,
  2110. },
  2111. {
  2112. title: "门店分类",
  2113. key: "cate_name",
  2114. minWidth: 80,
  2115. },
  2116. {
  2117. title: "门店名称",
  2118. key: "name",
  2119. minWidth: 80,
  2120. },
  2121. {
  2122. title: "联系电话",
  2123. key: "phone",
  2124. minWidth: 90,
  2125. },
  2126. {
  2127. title: "门店地址",
  2128. key: "address",
  2129. ellipsis: true,
  2130. minWidth: 150,
  2131. },
  2132. {
  2133. title: "营业时间",
  2134. key: "day_time",
  2135. minWidth: 120,
  2136. },
  2137. {
  2138. title: "营业状态",
  2139. key: "status_name",
  2140. minWidth: 80,
  2141. },
  2142. {
  2143. title: "操作",
  2144. slot: "action",
  2145. width: 100,
  2146. }
  2147. ],
  2148. // 仓库查询商品列表
  2149. warehouseList: [],
  2150. // 是否载入中
  2151. warehouseListLoding: false
  2152. };
  2153. },
  2154. computed: {
  2155. ...mapState("admin/layout", ["isMobile", "menuCollapse"]),
  2156. labelWidth() {
  2157. return this.isMobile ? undefined : 120;
  2158. },
  2159. labelPosition() {
  2160. return this.isMobile ? "top" : "right";
  2161. },
  2162. labelBottom() {
  2163. return this.isMobile ? undefined : 15;
  2164. },
  2165. startPickOptions() {
  2166. const that = this;
  2167. return {
  2168. disabledDate(time) {
  2169. if (that.formValidate.auto_off_time) {
  2170. return (
  2171. time.getTime() > new Date(that.formValidate.auto_off_time).getTime()
  2172. )
  2173. }
  2174. return ''
  2175. }
  2176. }
  2177. },
  2178. endPickOptions() {
  2179. const that = this;
  2180. return {
  2181. disabledDate(time) {
  2182. if (that.formValidate.is_show == '1') {
  2183. return time.getTime() < Date.now();
  2184. }
  2185. if (that.formValidate.auto_on_time) {
  2186. return (
  2187. time.getTime() < new Date(that.formValidate.auto_on_time).getTime()
  2188. )
  2189. }
  2190. return ''
  2191. }
  2192. }
  2193. }
  2194. },
  2195. created() {
  2196. this.getSupplierList();
  2197. this.columns = this.columns2.slice(1, 10);
  2198. let data = JSON.parse(JSON.stringify(this.columns2));
  2199. data.splice(8, 2, this.headerCarMy);
  2200. this.columnsCarMy = data;
  2201. let fictitious = JSON.parse(JSON.stringify(this.columns2));
  2202. fictitious.splice(8, 2);
  2203. this.columnsFictitious = fictitious;
  2204. this.getToken();
  2205. this.getErpConfig();
  2206. // this.columnsInstall = this.columns2.slice(0, 4).concat(this.columnsInstall);
  2207. // this.columnsInsta8 = this.columns2.slice(0, 4).concat(this.columnsInsta8);
  2208. },
  2209. mounted() {
  2210. this.setCopyrightShow({
  2211. value: false
  2212. });
  2213. if ((this.$route.params.id !== "0" && this.$route.params.id) || this.$route.query.copy) {
  2214. this.getInfo();
  2215. } else if (this.$route.params.id === "0") {
  2216. productCache()
  2217. .then((res) => {
  2218. let data = res.data.info;
  2219. if (!Array.isArray(data)) {
  2220. let cate_id = data.cate_id.map(Number);
  2221. let label_id = data.label_id.map(Number);
  2222. this.attrs = data.items || [];
  2223. let ids = [];
  2224. // let names = [];
  2225. if (data.coupons) {
  2226. data.coupons.map((item) => {
  2227. ids.push(item.id);
  2228. // names.push(item.title);
  2229. });
  2230. this.couponName = data.coupons;
  2231. }
  2232. this.storesList = data.stores || [];
  2233. let brandIds = [];
  2234. data.brand_id.forEach(item => {
  2235. brandIds.push(item.toString())
  2236. })
  2237. this.formValidate = data;
  2238. this.formTypeList = data.custom_form_info || [];
  2239. // this.couponName = data.coupons;
  2240. // that.couponName = names;
  2241. this.formValidate.brand_id = brandIds;
  2242. this.formValidate.coupon_ids = ids;
  2243. this.formValidate.is_limit = this.formValidate.is_limit ? 1 : 0;
  2244. this.formValidate.limit_type = parseInt(this.formValidate.limit_type);
  2245. this.formValidate.is_support_refund = parseInt(this.formValidate.is_support_refund);
  2246. this.updateIds = ids;
  2247. this.updateName = data.coupons;
  2248. this.formValidate.cate_id = cate_id;
  2249. this.dataLabel = data.label_id;
  2250. this.storeDataLabel = data.store_label_id;
  2251. this.specsList = data.specs;
  2252. this.oneFormValidate = data.attrs;
  2253. console.log(data.attrs,'data.attrs')
  2254. this.formValidate.header = [];
  2255. this.generate(0);
  2256. this.addmanyData(data.attrs);
  2257. this.productTypeTap(2);
  2258. this.columns = this.columns2.slice(1, 10);
  2259. //this.manyFormValidate = data.attrs;
  2260. this.formValidate.system_form_id = data.system_form_id || 0;
  2261. if (this.formValidate.system_form_id) {
  2262. this.customBtn = true;
  2263. }
  2264. this.spec_type = data.spec_type;
  2265. if (data.spec_type === 0) {
  2266. this.manyFormValidate = [];
  2267. } else {
  2268. this.createBnt = true;
  2269. this.oneFormValidate = [{
  2270. pic: data.slider_image[0],
  2271. price: 0,
  2272. settle_price: 0,
  2273. cost: 0,
  2274. ot_price: 0,
  2275. erp_product_id: 0,
  2276. unit: '',
  2277. uint_to_erp_unit: 0,
  2278. // stock: 0,
  2279. bar_code: "",
  2280. code: "",
  2281. weight: 0,
  2282. volume: 0,
  2283. brokerage: 0,
  2284. brokerage_two: 0,
  2285. vip_price: 0,
  2286. virtual_list: [],
  2287. write_times: 0, //核销次数
  2288. write_valid: 1, //核销时效
  2289. days: 1
  2290. }, ];
  2291. }
  2292. this.spinShow = false;
  2293. }
  2294. })
  2295. .catch((err) => {
  2296. this.$Message.error(err.msg);
  2297. });
  2298. }
  2299. if (this.$route.query.type) {
  2300. this.modals = true;
  2301. this.type = this.$route.query.type;
  2302. } else {
  2303. this.type = 0;
  2304. }
  2305. this.goodsCategory();
  2306. this.productGetRule();
  2307. this.productGetTemplate();
  2308. this.getBrandList();
  2309. this.getAllUnit();
  2310. this.uploadType();
  2311. this.getProductAllEnsure();
  2312. this.getProductAllSpecs();
  2313. this.allFormList();
  2314. },
  2315. destroyed() {
  2316. this.setCopyrightShow({
  2317. value: true
  2318. });
  2319. },
  2320. methods: {
  2321. ...mapMutations('admin/layout', [
  2322. 'setCopyrightShow'
  2323. ]),
  2324. changeErpProductId(e) {
  2325. erpGoods({
  2326. id:e
  2327. }).then(res => {
  2328. // this.for
  2329. this.formValidate.is_weigh = res.data.data[0].is_weigh;
  2330. console.log(this.formValidate.is_weigh,'this.formValidate.is_weigh');
  2331. })
  2332. },
  2333. containsChinese(str) {
  2334. return /[\u4e00-\u9fa5]/.test(str);
  2335. },
  2336. // 查询仓库商品
  2337. queryWarehouseList(query) {
  2338. console.log(query,'query')
  2339. const that = this;
  2340. if (query !== '') {
  2341. query = query.trim()
  2342. that.warehouseListLoding = true;
  2343. let qdata = {
  2344. page: 1,
  2345. limit: 100,
  2346. }
  2347. if(this.containsChinese(query)) {
  2348. qdata.key = query
  2349. }else {
  2350. qdata.id = query
  2351. }
  2352. erpGoods(qdata).then(res => {
  2353. that.warehouseListLoding = false;
  2354. that.warehouseList = res.data.data;
  2355. }).catch(err => {
  2356. that.warehouseListLoding = false;
  2357. that.$Message.error(err.msg);
  2358. })
  2359. } else {
  2360. this.warehouseList = [];
  2361. }
  2362. },
  2363. changeForm(e) {
  2364. this.getSystemFormInfo(e, {
  2365. type: 1
  2366. });
  2367. },
  2368. getSystemFormInfo(e, data) {
  2369. systemFormInfo(e, data).then(res => {
  2370. this.formTypeList = res.data.info;
  2371. }).catch(err => {
  2372. this.$Message.error(err.msg);
  2373. })
  2374. },
  2375. //删除门店
  2376. delte(index) {
  2377. this.storesList.splice(index, 1)
  2378. },
  2379. //添加门店
  2380. addStore() {
  2381. this.storeModals = true;
  2382. },
  2383. //关闭门店弹窗
  2384. cancelStore() {
  2385. this.storeModals = false;
  2386. },
  2387. allFormList() {
  2388. allSystemForm().then(res => {
  2389. this.formList = res.data;
  2390. }).catch(err => {
  2391. this.$Message.error(err.msg);
  2392. })
  2393. },
  2394. limitTap(e) {
  2395. if (e) {
  2396. this.formValidate.limit_type = (this.formValidate.is_limit && !this.formValidate.limit_type) ? 1 : 0
  2397. this.formValidate.limit_num = (this.formValidate.is_limit && this.formValidate.limit_num == 0) ? 1 : 0
  2398. } else {
  2399. this.formValidate.limit_type = 0;
  2400. this.formValidate.limit_num = 0;
  2401. }
  2402. },
  2403. //erp配置
  2404. getErpConfig() {
  2405. erpConfig().then(res => {
  2406. this.openErp = res.data.open_erp;
  2407. }).catch(err => {
  2408. this.$Message.error(err.msg);
  2409. })
  2410. },
  2411. delSpecs(index) {
  2412. this.specsList.splice(index, 1);
  2413. },
  2414. addSpecs() {
  2415. let obj = {
  2416. 'name': '',
  2417. 'value': '',
  2418. 'sort': 0
  2419. }
  2420. this.specsList.push(obj)
  2421. },
  2422. specsInfo(e) {
  2423. this.specsData.forEach(item => {
  2424. if (item.id == e) {
  2425. this.specsList = item.specs
  2426. }
  2427. })
  2428. },
  2429. getProductAllSpecs() {
  2430. productAllSpecs().then(res => {
  2431. this.specsData = res.data
  2432. }).catch(err => {
  2433. this.$Message.error(err.msg);
  2434. })
  2435. },
  2436. getProductAllEnsure() {
  2437. productAllEnsure().then(res => {
  2438. this.ensureData = res.data
  2439. }).catch(err => {
  2440. this.$Message.error(err.msg);
  2441. })
  2442. },
  2443. //添加倒入卡密的值
  2444. changeVirtual(e) {
  2445. this.virtualList = this.virtualList.concat(e);
  2446. },
  2447. //添加卡密
  2448. addVirtual(index, name) {
  2449. this.tabIndex = index;
  2450. this.tabName = name;
  2451. this.virtualListClear();
  2452. this.$refs.addCarMy.fixedCar = {
  2453. disk_info: '',
  2454. // stock: 0
  2455. }
  2456. this.$refs.addCarMy.cartMyType = 1;
  2457. this.carMyShow = true;
  2458. },
  2459. //确认提交卡密
  2460. fixdBtn(e) {
  2461. if (e.cartMyType == 1) {
  2462. this.$set(this[this.tabName][this.tabIndex], "disk_info", e.disk_info);
  2463. // this.$set(this[this.tabName][this.tabIndex], "stock", Number(e.stock));
  2464. this[this.tabName][this.tabIndex].virtual_list = [];
  2465. } else {
  2466. this.$set(this[this.tabName][this.tabIndex], "virtual_list", e.virtualList);
  2467. // this.$set(this[this.tabName][this.tabIndex], "stock", e.virtualList.length);
  2468. this[this.tabName][this.tabIndex].disk_info = '';
  2469. }
  2470. this.carMyShow = false;
  2471. },
  2472. closeCarMy() {
  2473. this.carMyShow = false;
  2474. },
  2475. //清空卡密
  2476. virtualListClear() {
  2477. this.virtualList = [{
  2478. key: "",
  2479. value: "",
  2480. }, ];
  2481. },
  2482. seeVirtual(data, name, index) {
  2483. this.tabName = name;
  2484. this.tabIndex = index;
  2485. this.virtualListClear();
  2486. this.$refs.addCarMy.fixedCar = {
  2487. disk_info: '',
  2488. // stock: 0
  2489. }
  2490. if (data.virtual_list && data.virtual_list.length) {
  2491. this.$refs.addCarMy.cartMyType = 2;
  2492. this.virtualList = data.virtual_list;
  2493. } else if (data.disk_info) {
  2494. this.$refs.addCarMy.cartMyType = 1;
  2495. this.$refs.addCarMy.fixedCar.disk_info = data.disk_info;
  2496. // this.$refs.addCarMy.fixedCar.stock = data.stock;
  2497. }
  2498. this.carMyShow = true;
  2499. },
  2500. //动态添加组件
  2501. addAssembly() {
  2502. this.formValidate.custom_form.push({
  2503. title: "",
  2504. label: "text",
  2505. value: "",
  2506. status: 0,
  2507. });
  2508. },
  2509. customMessBtn(e) {
  2510. if (!e) {
  2511. this.formValidate.system_form_id = 0;
  2512. }
  2513. },
  2514. addcustom() {
  2515. if (this.formValidate.custom_form.length > 9) {
  2516. this.$Message.warning("最多添加10条");
  2517. } else {
  2518. this.addAssembly();
  2519. }
  2520. },
  2521. delcustom(index) {
  2522. this.formValidate.custom_form.splice(index, 1);
  2523. },
  2524. // 预售具体日期
  2525. onchangeTime(e) {
  2526. this.formValidate.presale_time = e;
  2527. },
  2528. //定时上架
  2529. onchangeShow(e) {
  2530. this.formValidate.auto_on_time = e
  2531. },
  2532. //定时下架
  2533. onchangeOff(e) {
  2534. this.formValidate.auto_off_time = e
  2535. },
  2536. // 获取供应商内容
  2537. getSupplierList() {
  2538. getSupplierList().then(async (res) => {
  2539. this.supplierList = res.data
  2540. }).catch((res) => {
  2541. this.$Message.error(res.msg)
  2542. })
  2543. },
  2544. //打开属性
  2545. batchAttr() {
  2546. this.attrShow = true;
  2547. // if(!this.activeAtter.length){
  2548. // let data = this.attrs;
  2549. // data.map(el=>{
  2550. // el.details = [];
  2551. // el.detail.map(label=>{
  2552. // el.details.push({
  2553. // name:label,
  2554. // select:false
  2555. // })
  2556. // })
  2557. // })
  2558. // this.attrsList = data;
  2559. // }
  2560. },
  2561. //获取属性
  2562. getAttr() {
  2563. this.oneFormBatch[0].attr = '全部';
  2564. let data = this.attrs;
  2565. data.map(el => {
  2566. el.details = [];
  2567. el.detail.map(label => {
  2568. el.details.push({
  2569. name: label,
  2570. select: false
  2571. })
  2572. })
  2573. })
  2574. this.attrsList = data;
  2575. },
  2576. //选中属性
  2577. activeAttr(e) {
  2578. this.attrsList = e;
  2579. },
  2580. //关闭属性弹窗
  2581. labelAttr() {
  2582. this.attrShow = false;
  2583. },
  2584. //多属性为空
  2585. manyEmpty(j) {
  2586. j.pic = '';
  2587. j.price = 0;
  2588. j.settle_price = 0;
  2589. j.cost = 0;
  2590. j.ot_price = 0;
  2591. j.erp_product_id = 0;
  2592. j.unit = '';
  2593. j.uint_to_erp_unit = 0;
  2594. // j.stock = 0;
  2595. j.bar_code = '';
  2596. j.code = '';
  2597. j.weight = 0;
  2598. j.volume = 0;
  2599. j.virtual_list = []
  2600. },
  2601. doCombination(arr) {
  2602. var count = arr.length - 1; //数组长度(从0开始)
  2603. var tmp = [];
  2604. var totalArr = []; // 总数组
  2605. return doCombinationCallback(arr, 0); //从第一个开始
  2606. //js 没有静态数据,为了避免和外部数据混淆,需要使用闭包的形式
  2607. function doCombinationCallback(arr, curr_index) {
  2608. for (let val of arr[curr_index]) {
  2609. tmp[curr_index] = val; //以curr_index为索引,加入数组
  2610. //当前循环下标小于数组总长度,则需要继续调用方法
  2611. if (curr_index < count) {
  2612. doCombinationCallback(arr, curr_index + 1); //继续调用
  2613. } else {
  2614. totalArr.push(tmp.join(',')); //(直接给push进去,push进去的不是值,而是值的地址)
  2615. }
  2616. //js 对象都是 地址引用(引用关系),每次都需要重新初始化,否则 totalArr的数据都会是最后一次的 tmp 数据;
  2617. let oldTmp = tmp;
  2618. tmp = [];
  2619. for (let index of oldTmp) {
  2620. tmp.push(index);
  2621. }
  2622. }
  2623. return totalArr;
  2624. }
  2625. },
  2626. //提交属性值;
  2627. subAttrs(e) {
  2628. let selectData = [];
  2629. this.attrsList.forEach((el, index) => {
  2630. let obj = [];
  2631. el.details.forEach((label) => {
  2632. if (label.select) {
  2633. obj.push(label.name);
  2634. }
  2635. })
  2636. if (obj.length) {
  2637. selectData.push(obj)
  2638. }
  2639. })
  2640. let newData = [];
  2641. if (selectData.length) {
  2642. newData = this.doCombination(selectData);
  2643. }
  2644. this.attrShow = false;
  2645. this.activeAtter = selectData;
  2646. this.oneFormBatch[0].attr = newData.length ? newData.join(';') : '全部';
  2647. this.manyFormValidate.forEach(j => {
  2648. j.select = false;
  2649. if (newData.length) {
  2650. newData.forEach(item => {
  2651. if (j.values.split('').length == item.split('').length) {
  2652. if (j.values == item) {
  2653. j.select = true;
  2654. }
  2655. } else {
  2656. if (j.values.indexOf(item) != -1) {
  2657. j.select = true;
  2658. }
  2659. }
  2660. })
  2661. } else {
  2662. j.select = true;
  2663. }
  2664. })
  2665. this.$set(this, 'manyFormValidate', this.manyFormValidate)
  2666. },
  2667. goodsOn(e) {
  2668. if (e == 0 || e == 1) {
  2669. this.formValidate.auto_on_time = '';
  2670. }
  2671. },
  2672. goodsOff(e) {
  2673. if (!e) {
  2674. this.formValidate.auto_off_time = '';
  2675. }
  2676. },
  2677. addBrand() {
  2678. this.$refs.menusFrom.modals = true
  2679. this.$refs.menusFrom.titleFrom = "添加品牌分类"
  2680. this.formBrand = {
  2681. sort: 0,
  2682. is_show: 1
  2683. }
  2684. this.formBrand.fid = [0];
  2685. this.$refs.menusFrom.type = 1
  2686. },
  2687. getAllUnit() {
  2688. productAllUnit().then(res => {
  2689. this.unitNameList = res.data;
  2690. }).catch(err => {
  2691. this.$Message.error(err.msg);
  2692. })
  2693. },
  2694. addClass() {
  2695. this.$modalForm(productCreateApi()).then(() => this.goodsCategory());
  2696. },
  2697. addUnit() {
  2698. this.$modalForm(productUnitCreate()).then(() => this.getAllUnit());
  2699. },
  2700. addStoreLabel() {
  2701. this.$modalForm(productLabelAdd()).then(() => {});
  2702. },
  2703. productTypeTap(num, item) {
  2704. if (num == 1) {
  2705. if (this.$route.params.id) return this.$Message.error('商品类型不能切换!');
  2706. this.formValidate.product_type = item.id;
  2707. }
  2708. if (this.formValidate.product_type && this.formValidate.product_type != 4) {
  2709. this.headTab = [{
  2710. title: "基础信息",
  2711. name: "1"
  2712. },
  2713. {
  2714. title: "规格库存",
  2715. name: "2"
  2716. },
  2717. {
  2718. title: "商品详情",
  2719. name: "3"
  2720. },
  2721. {
  2722. title: "营销设置",
  2723. name: "5"
  2724. },
  2725. {
  2726. title: "其他设置",
  2727. name: "6"
  2728. },
  2729. ]
  2730. this.formValidate.postage = 0;
  2731. // this.formValidate.supplier_id = 0;
  2732. } else if (this.formValidate.product_type == 4) {
  2733. this.headTab = [{
  2734. title: "基础信息",
  2735. name: "1"
  2736. },
  2737. {
  2738. title: "规格库存",
  2739. name: "2"
  2740. },
  2741. {
  2742. title: "商品详情",
  2743. name: "3"
  2744. },
  2745. {
  2746. title: "营销设置",
  2747. name: "5"
  2748. },
  2749. {
  2750. title: "其他设置",
  2751. name: "6"
  2752. },
  2753. {
  2754. title: "适用门店",
  2755. name: "7"
  2756. },
  2757. ]
  2758. } else {
  2759. this.headTab = [{
  2760. title: "基础信息",
  2761. name: "1"
  2762. },
  2763. {
  2764. title: "规格库存",
  2765. name: "2"
  2766. },
  2767. {
  2768. title: "商品详情",
  2769. name: "3"
  2770. },
  2771. {
  2772. title: "物流设置",
  2773. name: "4"
  2774. },
  2775. {
  2776. title: "营销设置",
  2777. name: "5"
  2778. },
  2779. {
  2780. title: "其他设置",
  2781. name: "6"
  2782. },
  2783. {
  2784. title: "适用门店",
  2785. name: "7"
  2786. },
  2787. ]
  2788. }
  2789. },
  2790. closeLabel(label) {
  2791. let index = this.dataLabel.indexOf(this.dataLabel.filter(d => d.id == label.id)[0]);
  2792. this.dataLabel.splice(index, 1);
  2793. },
  2794. activeData(dataLabel) {
  2795. this.labelShow = false;
  2796. this.dataLabel = dataLabel;
  2797. },
  2798. openLabel(row) {
  2799. this.labelShow = true;
  2800. this.$refs.userLabel.userLabel(JSON.parse(JSON.stringify(this.dataLabel)));
  2801. },
  2802. // 标签弹窗关闭
  2803. labelClose() {
  2804. this.labelShow = false;
  2805. },
  2806. closeStoreLabel(label) {
  2807. let index = this.storeDataLabel.indexOf(this.storeDataLabel.filter(d => d.id == label.id)[0]);
  2808. this.storeDataLabel.splice(index, 1);
  2809. },
  2810. activeStoreData(storeDataLabel) {
  2811. this.storeLabelShow = false;
  2812. this.storeDataLabel = storeDataLabel;
  2813. },
  2814. openStoreLabel(row) {
  2815. this.storeLabelShow = true;
  2816. this.$refs.storeLabel.storeLabel(JSON.parse(JSON.stringify(this.storeDataLabel)));
  2817. },
  2818. // 标签弹窗关闭
  2819. storeLabelClose() {
  2820. this.storeLabelShow = false;
  2821. },
  2822. // 品牌列表
  2823. getBrandList() {
  2824. brandList().then(res => {
  2825. //initBran()函数作用iview中规定value必须是字符串,后台返回成了数字,用于处理这个,给了个递归;
  2826. this.initBran(res.data);
  2827. this.brandData = res.data
  2828. }).catch(err => {
  2829. this.$Message.error(err.msg);
  2830. })
  2831. },
  2832. initBran(data) {
  2833. data.map(item => {
  2834. item.value = item.value.toString();
  2835. if (item.children && item.children.length) {
  2836. this.initBran(item.children);
  2837. }
  2838. })
  2839. },
  2840. getProductId(e) {
  2841. this.goodsModals = false;
  2842. let nArr = this.goodsData.concat(e).filter((element, index, self) => {
  2843. return self.findIndex(x => x.product_id == element.product_id) == index
  2844. })
  2845. this.goodsData = nArr.slice(0, 12);
  2846. },
  2847. goodCancel() {
  2848. this.goodsModals = false;
  2849. },
  2850. goodsTap() {
  2851. this.goodsModals = true;
  2852. this.$refs.goodslist.handleSelectAll();
  2853. },
  2854. bindDelete(index) {
  2855. this.goodsData.splice(index, 1)
  2856. },
  2857. cancel() {
  2858. this.$router.push({
  2859. path: this.roterPre + '/product/product_list'
  2860. });
  2861. },
  2862. videoSaveToUrl(file) {
  2863. let imgTypeArr = ["video/mp4"];
  2864. let imgType = imgTypeArr.indexOf(file.type) !== -1
  2865. if (!imgType) {
  2866. return this.$Message.warning({
  2867. content: '文件 ' + file.name + ' 格式不正确, 请选择格式正确的视频',
  2868. duration: 5
  2869. });
  2870. }
  2871. uploadByPieces({
  2872. randoms: "", // 随机数,这里作为给后端处理分片的标识 根据项目看情况 是否要加
  2873. file: file, // 视频实体
  2874. pieceSize: 3, // 分片大小
  2875. success: (data) => {
  2876. this.formValidate.video_link = data.file_path;
  2877. this.progress = 100;
  2878. },
  2879. error: (e) => {
  2880. this.$Message.error(e.msg);
  2881. },
  2882. uploading: (chunk, allChunk) => {
  2883. this.videoIng = true;
  2884. let st = Math.floor((chunk / allChunk) * 100);
  2885. this.progress = st;
  2886. },
  2887. });
  2888. return false;
  2889. },
  2890. // 上传头部token
  2891. getToken() {
  2892. this.header["Authori-zation"] = "Bearer " + util.cookies.get("token");
  2893. },
  2894. // beforeUpload() {
  2895. // this.uploadData = {};
  2896. // let promise = new Promise((resolve) => {
  2897. // this.$nextTick(function () {
  2898. // resolve(true);
  2899. // });
  2900. // });
  2901. // return promise;
  2902. // },
  2903. // 上传成功
  2904. handleSuccess(res, file, fileList) {
  2905. if (res.status === 200) {
  2906. this.formValidate.video_link = res.data.src;
  2907. this.$Message.success(res.msg);
  2908. } else {
  2909. this.$Message.error(res.msg);
  2910. }
  2911. },
  2912. //获取视频上传类型
  2913. uploadType() {
  2914. uploadType().then((res) => {
  2915. this.upload_type = res.data.upload_type;
  2916. });
  2917. },
  2918. getEditorContent(data) {
  2919. this.content = data;
  2920. },
  2921. infoData(data) {
  2922. console.log(data,'productInfo');
  2923. this.storesList = data.stores || [];
  2924. let cate_id = data.cate_id.map(Number);
  2925. this.attrs = data.items || [];
  2926. let ids = [];
  2927. data.coupons.map((item) => {
  2928. ids.push(item.id);
  2929. });
  2930. this.goodsData = data.recommend_list;
  2931. if (data.auto_off_time) {
  2932. this.off_show = 1;
  2933. } else {
  2934. this.off_show = 0;
  2935. }
  2936. let brandIds = [];
  2937. data.brand_id.forEach(item => {
  2938. brandIds.push(item.toString())
  2939. })
  2940. this.formValidate = data;
  2941. // this.formValidate.
  2942. console.log('na',this.formValidate);
  2943. this.formTypeList = data.custom_form_info;
  2944. this.formValidate.brand_id = brandIds;
  2945. // this.formValidate.supplier_id = data.relation_id;
  2946. this.formValidate.is_limit = this.formValidate.is_limit ? 1 : 0;
  2947. this.formValidate.limit_type = parseInt(data.limit_type);
  2948. this.formValidate.is_support_refund = parseInt(this.formValidate.is_support_refund);
  2949. this.contents = data.description;
  2950. this.couponName = data.coupons;
  2951. this.formValidate.coupon_ids = ids;
  2952. this.updateIds = ids;
  2953. this.updateName = data.coupons;
  2954. this.formValidate.cate_id = cate_id;
  2955. this.dataLabel = data.label_id;
  2956. this.storeDataLabel = data.store_label_id;
  2957. this.specsList = data.specs;
  2958. if (data.attr) {
  2959. this.oneFormValidate = [data.attr];
  2960. }
  2961. this.formValidate.header = [];
  2962. this.generate(0);
  2963. //this.manyFormValidate = data.attrs;
  2964. this.addmanyData(data.attrs);
  2965. this.productTypeTap(2);
  2966. this.formValidate.system_form_id = data.system_form_id || 0;
  2967. if (this.formValidate.system_form_id) {
  2968. this.customBtn = true;
  2969. }
  2970. this.spec_type = data.spec_type;
  2971. if (data.spec_type === 0) {
  2972. this.manyFormValidate = [];
  2973. } else {
  2974. this.createBnt = true;
  2975. this.oneFormValidate = [{
  2976. pic: "",
  2977. price: 0,
  2978. settle_price: 0,
  2979. cost: 0,
  2980. ot_price: 0,
  2981. erp_product_id: 0,
  2982. unit: '',
  2983. uint_to_erp_unit: 0,
  2984. // stock: 0,
  2985. bar_code: "",
  2986. code: "",
  2987. weight: 0,
  2988. volume: 0,
  2989. brokerage: 0,
  2990. brokerage_two: 0,
  2991. vip_price: 0,
  2992. virtual_list: [],
  2993. write_times: 0, //核销次数
  2994. write_valid: 1, //核销时效
  2995. days: 1
  2996. }, ];
  2997. }
  2998. },
  2999. //关闭淘宝弹窗并生成数据;
  3000. onClose(data) {
  3001. this.modals = false;
  3002. this.infoData(data);
  3003. },
  3004. checkMove(evt) {
  3005. this.moveIndex = evt.draggedContext.index;
  3006. },
  3007. end() {
  3008. this.moveIndex = "";
  3009. },
  3010. checkAllGroupChange(data) {
  3011. this.checkAllGroup(data);
  3012. },
  3013. checkAllGroup(data) {
  3014. if (this.formValidate.spec_type === 0) {
  3015. if (data.indexOf(0) > -1) {
  3016. this.columnsInstall = this.columns2.slice(1, 5).concat(this.member);
  3017. } else if (data.indexOf(1) > -1) {
  3018. this.columnsInstall = this.columns2.slice(1, 5).concat(this.rakeBack);
  3019. } else {
  3020. this.columnsInstall = this.columns2.slice(1, 5);
  3021. }
  3022. if (data.length === 2) {
  3023. this.columnsInstall = this.columns2
  3024. .slice(1, 5)
  3025. .concat(this.rakeBack)
  3026. .concat(this.member);
  3027. }
  3028. } else {
  3029. if (data.indexOf(0) > -1) {
  3030. this.columnsInstal2 = this.columnsInstalM
  3031. .slice(0, 4)
  3032. .concat(this.member);
  3033. } else if (data.indexOf(1) > -1) {
  3034. this.columnsInstal2 = this.columnsInstalM
  3035. .slice(0, 4)
  3036. .concat(this.rakeBack);
  3037. } else {
  3038. this.columnsInstal2 = this.columnsInstalM.slice(0, 4);
  3039. }
  3040. if (data.length === 2) {
  3041. this.columnsInstal2 = this.columnsInstalM
  3042. .slice(0, 4)
  3043. .concat(this.rakeBack)
  3044. .concat(this.member);
  3045. }
  3046. }
  3047. },
  3048. // 添加优惠券
  3049. addCoupon() {
  3050. this.$refs.couponTemplates.isTemplate = true;
  3051. this.$refs.couponTemplates.tableList();
  3052. },
  3053. //对象数组去重;
  3054. unique(arr) {
  3055. const res = new Map();
  3056. return arr.filter((arr) => !res.has(arr.id) && res.set(arr.id, 1));
  3057. },
  3058. nameId(id, names) {
  3059. this.formValidate.coupon_ids = id;
  3060. this.couponName = this.unique(names);
  3061. },
  3062. handleClose(name) {
  3063. let index = this.couponName.indexOf(name);
  3064. this.couponName.splice(index, 1);
  3065. let couponIds = this.formValidate.coupon_ids;
  3066. couponIds.splice(index, 1);
  3067. this.updateIds = couponIds;
  3068. this.updateName = this.couponName;
  3069. },
  3070. getStoreId(data) {
  3071. this.storeModals = false;
  3072. let list = this.storesList.concat(data);
  3073. let uni = this.unique(list);
  3074. this.storesList = uni;
  3075. },
  3076. // 运费模板
  3077. getList() {
  3078. this.productGetTemplate();
  3079. },
  3080. // 添加运费模板
  3081. addTemp() {
  3082. this.$refs.templates.isTemplate = true;
  3083. },
  3084. //查看、编辑运费模板
  3085. editTemp() {
  3086. this.$refs.templates.isTemplate = true;
  3087. this.$refs.templates.editFrom(this.formValidate.temp_id);
  3088. },
  3089. // 删除视频;
  3090. delVideo() {
  3091. let that = this;
  3092. that.$set(that.formValidate, "video_link", "");
  3093. that.$set(that, "progress", 0);
  3094. that.videoIng = false;
  3095. that.upload.videoIng = false;
  3096. that.$refs.refid.value = '';
  3097. },
  3098. zh_uploadFile() {
  3099. if (this.seletVideo == 1) {
  3100. if (this.videoLink && this.$getFileType(this.videoLink) == 'video') {
  3101. this.formValidate.video_link = this.videoLink;
  3102. } else {
  3103. return this.$Message.error("请输入正确的视频链接")
  3104. }
  3105. } else {
  3106. this.$refs.refid.click();
  3107. }
  3108. },
  3109. zh_uploadFile_change(evfile) {
  3110. let that = this;
  3111. let suffix = evfile.target.files[0].name.substr(
  3112. evfile.target.files[0].name.indexOf(".")
  3113. );
  3114. if (suffix.indexOf(".mp4") === -1) {
  3115. return that.$Message.error("只能上传MP4文件");
  3116. }
  3117. productGetTempKeysApi()
  3118. .then((res) => {
  3119. that.$videoCloud
  3120. .videoUpload({
  3121. type: res.data.type,
  3122. evfile: evfile,
  3123. res: res,
  3124. uploading(status, progress) {
  3125. that.upload.videoIng = status;
  3126. if (res.status == 200) {
  3127. that.progress = 100;
  3128. }
  3129. },
  3130. })
  3131. .then((res) => {
  3132. that.formValidate.video_link = res.url;
  3133. that.$Message.success("视频上传成功");
  3134. that.upload.videoIng = false;
  3135. })
  3136. .catch((res) => {
  3137. that.$Message.error(res);
  3138. });
  3139. })
  3140. .catch((res) => {
  3141. that.$Message.error(res.msg);
  3142. });
  3143. },
  3144. // 上一页;
  3145. upTab() {
  3146. if (this.currentTab == 5 && this.formValidate.product_type != 0) {
  3147. this.currentTab = (Number(this.currentTab) - 2).toString();
  3148. } else {
  3149. this.currentTab = (Number(this.currentTab) - 1).toString();
  3150. }
  3151. },
  3152. // 下一页;
  3153. downTab(name) {
  3154. this.$refs[name].validate((valid) => {
  3155. if (valid) {
  3156. if (this.formValidate.is_show == 2 && !this.formValidate.auto_on_time) {
  3157. return this.$Message.warning("请填写定时上架时间");
  3158. }
  3159. if (this.off_show == 1 && !this.formValidate.auto_off_time) {
  3160. return this.$Message.warning("请填写定时下架时间");
  3161. }
  3162. if (this.currentTab == 4 && !this.formValidate.delivery_type.length) {
  3163. return this.$Message.warning("请选择配送方式");
  3164. }
  3165. if (this.currentTab == 3 && this.formValidate.product_type != 0) {
  3166. this.currentTab = (Number(this.currentTab) + 2).toString();
  3167. } else {
  3168. this.currentTab = (Number(this.currentTab) + 1).toString();
  3169. }
  3170. } else {
  3171. this.$Message.warning("请完善数据");
  3172. }
  3173. })
  3174. },
  3175. // 属性弹窗回调函数;
  3176. userSearchs() {
  3177. this.productGetRule();
  3178. },
  3179. // 添加规则;
  3180. addRule() {
  3181. this.$refs.addattr.modal = true;
  3182. },
  3183. // 批量设置分佣;
  3184. brokerageSetUp() {
  3185. let that = this;
  3186. if (that.formValidate.is_sub.indexOf(1) > -1) {
  3187. if (that.manyBrokerage <= 0 || that.manyBrokerageTwo <= 0) {
  3188. return that.$Message.error("请填写返佣金额后进行批量添加");
  3189. }
  3190. } else if (that.formValidate.is_sub.indexOf(0) > -1) {
  3191. if (that.manyVipPrice <= 0) {
  3192. return that.$Message.error("请填写会员价后进行批量添加");
  3193. }
  3194. }
  3195. if (this.formValidate.is_sub.length === 2) {
  3196. if (
  3197. that.manyBrokerage <= 0 ||
  3198. that.manyBrokerageTwo <= 0 ||
  3199. that.manyVipPrice <= 0
  3200. ) {
  3201. return that.$Message.error("请填写完金额后进行批量添加");
  3202. }
  3203. }
  3204. for (let val of that.manyFormValidate) {
  3205. this.$set(val, "brokerage", that.manyBrokerage);
  3206. this.$set(val, "brokerage_two", that.manyBrokerageTwo);
  3207. this.$set(val, "vip_price", that.manyVipPrice);
  3208. }
  3209. // let that = this;
  3210. // if (that.manyBrokerage <= 0 || that.manyBrokerageTwo <= 0) {
  3211. // return that.$Message.error('请填写返佣金额在进行批量添加');
  3212. // } else {
  3213. // for (let val of that.manyFormValidate) {
  3214. // this.$set(val, 'brokerage', that.manyBrokerage);
  3215. // this.$set(val, 'brokerage_two', that.manyBrokerageTwo);
  3216. // }
  3217. // }
  3218. },
  3219. // 批量设置会员价
  3220. vipPriceSetUp() {
  3221. let that = this;
  3222. if (that.manyVipPrice <= 0) {
  3223. return that.$Message.error("请填写会员价在进行批量添加");
  3224. } else {
  3225. for (let val of that.manyFormValidate) {
  3226. this.$set(val, "vip_price", that.manyVipPrice);
  3227. }
  3228. }
  3229. },
  3230. batchDel() {
  3231. this.oneFormBatch = [{
  3232. attr: "全部",
  3233. pic: "",
  3234. price: 0,
  3235. settle_price: 0,
  3236. cost: 0,
  3237. ot_price: 0,
  3238. erp_product_id: 0,
  3239. unit: '',
  3240. uint_to_erp_unit: 0,
  3241. // stock: 0,
  3242. bar_code: "",
  3243. code: "",
  3244. weight: 0,
  3245. volume: 0,
  3246. virtualList: [],
  3247. disk_info: ''
  3248. }, ];
  3249. this.activeAtter = [];
  3250. for (let val of this.manyFormValidate) {
  3251. val.select = true;
  3252. }
  3253. },
  3254. confirm() {
  3255. let that = this;
  3256. that.createBnt = true;
  3257. if (that.formValidate.selectRule.trim().length <= 0) {
  3258. return that.$Message.error("请选择属性");
  3259. }
  3260. that.ruleList.forEach(function(item, index) {
  3261. if (item.rule_name === that.formValidate.selectRule) {
  3262. that.attrs = item.rule_value;
  3263. }
  3264. });
  3265. },
  3266. // 获取商品属性模板;
  3267. productGetRule() {
  3268. productGetRuleApi().then((res) => {
  3269. this.ruleList = res.data;
  3270. });
  3271. },
  3272. // 获取运费模板;
  3273. productGetTemplate() {
  3274. let id = this.$route.params.id;
  3275. productGetTemplateApi({
  3276. id: id
  3277. }).then((res) => {
  3278. this.templateList = res.data;
  3279. });
  3280. },
  3281. // 删除表格中的属性
  3282. delAttrTable(index) {
  3283. let id = this.$route.params.id;
  3284. if (id) {
  3285. checkActivityApi(id)
  3286. .then((res) => {
  3287. this.manyFormValidate.splice(index, 1);
  3288. this.$Message.success(res.msg);
  3289. })
  3290. .catch((res) => {
  3291. this.$Message.error(res.msg);
  3292. });
  3293. } else {
  3294. this.manyFormValidate.splice(index, 1);
  3295. }
  3296. },
  3297. // 批量添加
  3298. batchAdd() {
  3299. for (let val of this.manyFormValidate) {
  3300. //this.manyEmpty(val);
  3301. if (val.select) {
  3302. if (this.oneFormBatch[0].pic) {
  3303. this.$set(val, "pic", this.oneFormBatch[0].pic);
  3304. }
  3305. if (this.oneFormBatch[0].price > 0) {
  3306. this.$set(val, "price", this.oneFormBatch[0].price);
  3307. }
  3308. if (this.oneFormBatch[0].settle_price > 0 && this.merchantType == 2) {
  3309. this.$set(val, "settle_price", this.oneFormBatch[0].settle_price);
  3310. }
  3311. if (this.oneFormBatch[0].cost > 0) {
  3312. this.$set(val, "cost", this.oneFormBatch[0].cost);
  3313. }
  3314. if (this.oneFormBatch[0].ot_price > 0) {
  3315. this.$set(val, "ot_price", this.oneFormBatch[0].ot_price);
  3316. }
  3317. if (this.oneFormBatch[0].erp_product_id > 0) {
  3318. this.$set(val, "erp_product_id", this.oneFormBatch[0].erp_product_id);
  3319. }
  3320. if (this.oneFormBatch[0].unit) {
  3321. this.$set(val, "unit", this.oneFormBatch[0].unit);
  3322. }
  3323. if (this.oneFormBatch[0].uint_to_erp_unit > 0) {
  3324. this.$set(val, "uint_to_erp_unit", this.oneFormBatch[0].uint_to_erp_unit*1);
  3325. }
  3326. // if (this.oneFormBatch[0].stock > 0) {
  3327. // this.$set(val, "stock", this.oneFormBatch[0].stock);
  3328. // }
  3329. if (this.oneFormBatch[0].bar_code !== "") {
  3330. this.$set(val, "bar_code", this.oneFormBatch[0].bar_code);
  3331. }
  3332. if (this.oneFormBatch[0].code !== "") {
  3333. this.$set(val, "code", this.oneFormBatch[0].code);
  3334. }
  3335. if (this.oneFormBatch[0].weight > 0) {
  3336. this.$set(val, "weight", this.oneFormBatch[0].weight);
  3337. }
  3338. if (this.oneFormBatch[0].volume > 0) {
  3339. this.$set(val, "volume", this.oneFormBatch[0].volume);
  3340. }
  3341. if (this.formValidate.product_type == 1) {
  3342. if (this.oneFormBatch[0].virtual_list && this.oneFormBatch[0].virtual_list.length) {
  3343. this.$set(val, "virtual_list", this.oneFormBatch[0].virtual_list);
  3344. } else if (this.oneFormBatch[0].disk_info) {
  3345. this.$refs.addCarMy.cartMyType = 1;
  3346. this.$set(val, "disk_info", this.oneFormBatch[0].disk_info);
  3347. }
  3348. }
  3349. }
  3350. }
  3351. },
  3352. // 添加按钮
  3353. addBtn() {
  3354. let id = this.$route.params.id;
  3355. checkActivityApi(id)
  3356. .then((res) => {
  3357. this.clearAttr();
  3358. this.createBnt = false;
  3359. this.showIput = true;
  3360. })
  3361. .catch((res) => {
  3362. this.$Message.error(res.msg);
  3363. });
  3364. },
  3365. addmanyData(data, type) {
  3366. if (type == 1) {
  3367. this.oneFormBatch[0].pic = this.formValidate.image
  3368. data.forEach(item => {
  3369. item.select = true,
  3370. item.pic = this.formValidate.image
  3371. })
  3372. } else {
  3373. data.forEach(item => {
  3374. item.select = true
  3375. })
  3376. }
  3377. this.manyFormValidate = data;
  3378. },
  3379. // 立即生成
  3380. generate(type) {
  3381. generateAttrApi({
  3382. attrs: this.attrs,
  3383. product_type: this.formValidate.product_type
  3384. }, this.formValidate.id, type)
  3385. .then((res) => {
  3386. let info = res.data.info,
  3387. header1 = JSON.parse(JSON.stringify(info.header));
  3388. if ((this.$route.params.id !== "0" && this.type != -1) || type == 1) {
  3389. this.addmanyData(info.value, type);
  3390. }
  3391. this.formValidate.header = header1;
  3392. this.attrData = res.data.info.attr;
  3393. let header = info.header;
  3394. header.pop();
  3395. this.columnsInstalM = info.header;
  3396. this.checkAllGroup(this.formValidate.is_sub);
  3397. if (!this.$route.params.id && this.formValidate.spec_type === 1 && this.type != -1) {
  3398. this.manyFormValidate.map((item) => {
  3399. item.pic = this.formValidate.slider_image[0];
  3400. });
  3401. this.oneFormBatch[0].pic = this.formValidate.slider_image[0];
  3402. } else if (this.$route.params.id) {
  3403. this.manyFormValidate.map((item) => {
  3404. if (!item.pic) {
  3405. item.pic = this.formValidate.slider_image[0];
  3406. }
  3407. });
  3408. this.oneFormBatch[0].pic = this.formValidate.slider_image[0];
  3409. }
  3410. this.getAttr();
  3411. })
  3412. .catch((res) => {
  3413. this.$Message.error(res.msg);
  3414. });
  3415. },
  3416. // 取消
  3417. offAttrName() {
  3418. this.showIput = false;
  3419. this.createBnt = true;
  3420. },
  3421. clearAttr() {
  3422. this.formDynamic.attrsName = "";
  3423. this.formDynamic.attrsVal = "";
  3424. },
  3425. // 删除规格
  3426. handleRemoveRole(index) {
  3427. this.attrs.splice(index, 1);
  3428. this.manyFormValidate.splice(index, 1);
  3429. },
  3430. // 删除属性
  3431. handleRemove2(item, index) {
  3432. item.splice(index, 1);
  3433. },
  3434. // 添加规则名称
  3435. createAttrName() {
  3436. if (this.formDynamic.attrsName && this.formDynamic.attrsVal) {
  3437. let data = {
  3438. value: this.formDynamic.attrsName,
  3439. detail: [this.formDynamic.attrsVal],
  3440. };
  3441. this.attrs.push(data);
  3442. var hash = {};
  3443. this.attrs = this.attrs.reduce(function(item, next) {
  3444. /* eslint-disable */
  3445. hash[next.value] ? "" : (hash[next.value] = true && item.push(next));
  3446. return item;
  3447. }, []);
  3448. this.clearAttr();
  3449. this.showIput = false;
  3450. this.createBnt = true;
  3451. } else {
  3452. this.$Message.warning("请添加完整的规格!");
  3453. }
  3454. },
  3455. // 添加属性
  3456. createAttr(num, idx) {
  3457. if (num) {
  3458. this.attrs[idx].detail.push(num);
  3459. var hash = {};
  3460. this.attrs[idx].detail = this.attrs[idx].detail.reduce(function(
  3461. item,
  3462. next
  3463. ) {
  3464. /* eslint-disable */
  3465. hash[next] ? "" : (hash[next] = true && item.push(next));
  3466. return item;
  3467. },
  3468. []);
  3469. } else {
  3470. this.$Message.warning("请添加属性");
  3471. }
  3472. },
  3473. // 商品分类;
  3474. goodsCategory() {
  3475. cascaderListApi(1)
  3476. .then((res) => {
  3477. this.treeSelect = res.data;
  3478. })
  3479. .catch((res) => {
  3480. this.$Message.error(res.msg);
  3481. });
  3482. },
  3483. //视视上传类型
  3484. changeVideo(e) {
  3485. this.formValidate.video_link = "";
  3486. this.videoLink = "";
  3487. },
  3488. // 改变规格
  3489. changeSpec() {
  3490. this.formValidate.is_sub = [];
  3491. let id = this.$route.params.id;
  3492. if (id) {
  3493. checkActivityApi(id)
  3494. .then((res) => {})
  3495. .catch((res) => {
  3496. this.formValidate.spec_type = this.spec_type;
  3497. this.$Message.error(res.msg);
  3498. });
  3499. }
  3500. },
  3501. // 详情
  3502. getInfo() {
  3503. let that = this;
  3504. that.spinShow = true;
  3505. productInfoApi(that.$route.params.id || this.$route.query.copy)
  3506. .then(async (res) => {
  3507. let data = res.data.productInfo;
  3508. this.merchantType = parseInt(data.type);
  3509. if (this.merchantType == 2) {
  3510. let obj = {
  3511. title: "结算价",
  3512. slot: "settle_price",
  3513. align: "center",
  3514. minWidth: 95,
  3515. }
  3516. this.columns2.splice(3, 0, obj)
  3517. }
  3518. this.infoData(data);
  3519. // let cate_id = data.cate_id.map(Number);
  3520. // let label_id = data.label_id.map(Number);
  3521. // this.attrs = data.items || [];
  3522. // let ids = [];
  3523. // data.coupons.map((item) => {
  3524. // ids.push(item.id);
  3525. // });
  3526. // that.formValidate = data;
  3527. // that.couponName = data.coupons;
  3528. // that.formValidate.coupon_ids = ids;
  3529. // that.updateIds = ids;
  3530. // that.updateName = data.coupons;
  3531. // that.formValidate.cate_id = cate_id;
  3532. // that.formValidate.label_id = label_id;
  3533. // that.oneFormValidate = [data.attr];
  3534. // that.formValidate.header = [];
  3535. // that.manyFormValidate = data.attrs;
  3536. // that.generate(0);
  3537. // that.spec_type = data.spec_type;
  3538. // if (data.spec_type === 0) {
  3539. // that.manyFormValidate = [];
  3540. // } else {
  3541. // that.createBnt = true;
  3542. // that.oneFormValidate = [
  3543. // {
  3544. // pic: data.image,
  3545. // price: 0,
  3546. // cost: 0,
  3547. // ot_price: 0,
  3548. // stock: 0,
  3549. // bar_code: "",
  3550. // weight: 0,
  3551. // volume: 0,
  3552. // brokerage: 0,
  3553. // brokerage_two: 0,
  3554. // vip_price: 0,
  3555. // },
  3556. // ];
  3557. // }
  3558. this.spinShow = false;
  3559. })
  3560. .catch((res) => {
  3561. this.spinShow = false;
  3562. this.$Message.error(res.msg);
  3563. });
  3564. },
  3565. // tab切换
  3566. onhangeTab(name) {
  3567. this.currentTab = name;
  3568. },
  3569. handleRemove(i) {
  3570. this.images.splice(i, 1);
  3571. this.formValidate.slider_image.splice(i, 1);
  3572. this.oneFormValidate[0].pic = this.formValidate.slider_image[0];
  3573. },
  3574. // 关闭图片上传模态框
  3575. changeCancel(msg) {
  3576. this.modalPic = false;
  3577. },
  3578. // 点击商品图
  3579. modalPicTap(tit, picTit, index) {
  3580. this.modalPic = true;
  3581. this.isChoice = tit === "dan" ? "单选" : "多选";
  3582. this.picTit = picTit;
  3583. this.tableIndex = index;
  3584. },
  3585. // 获取单张图片信息
  3586. getPic(pc) {
  3587. switch (this.picTit) {
  3588. case "danFrom":
  3589. this.formValidate.image = pc.att_dir;
  3590. if (!this.$route.params.id) {
  3591. if (this.formValidate.spec_type === 0) {
  3592. this.oneFormValidate[0].pic = pc.att_dir;
  3593. } else {
  3594. this.manyFormValidate.map((item) => {
  3595. item.pic = pc.att_dir;
  3596. });
  3597. this.oneFormBatch[0].pic = pc.att_dir;
  3598. }
  3599. }
  3600. break;
  3601. case "danTable":
  3602. this.oneFormValidate[this.tableIndex].pic = pc.att_dir;
  3603. break;
  3604. case "duopi":
  3605. this.oneFormBatch[this.tableIndex].pic = pc.att_dir;
  3606. break;
  3607. case "recommend_image":
  3608. this.formValidate.recommend_image = pc.att_dir;
  3609. break;
  3610. case "video":
  3611. this.formValidate.video_link = pc.att_dir;
  3612. break;
  3613. default:
  3614. this.manyFormValidate[this.tableIndex].pic = pc.att_dir;
  3615. }
  3616. this.modalPic = false;
  3617. },
  3618. // 获取多张图信息
  3619. getPicD(pc) {
  3620. this.images = pc;
  3621. this.images.map((item) => {
  3622. this.formValidate.slider_image.push(item.att_dir);
  3623. this.formValidate.slider_image = this.formValidate.slider_image.splice(
  3624. 0,
  3625. 10
  3626. );
  3627. });
  3628. this.oneFormValidate[0].pic = this.formValidate.slider_image[0];
  3629. this.modalPic = false;
  3630. },
  3631. // 提交
  3632. handleSubmit(name) {
  3633. this.$refs[name].validate((valid) => {
  3634. if (valid) {
  3635. if (!this.formValidate.store_name.trim()) {
  3636. return this.$Message.warning("基础信息-商品名称不能为空");
  3637. }
  3638. if (this.formValidate.is_show == 2 && !this.formValidate.auto_on_time) {
  3639. return this.$Message.warning("基础信息-定时上架时间不能为空");
  3640. }
  3641. if (this.off_show == 1 && !this.formValidate.auto_off_time) {
  3642. return this.$Message.warning("基础信息-定时下架时间不能为空");
  3643. }
  3644. if (this.formValidate.product_type == 4 && !this.oneFormValidate[0].write_times) {
  3645. return this.$Message.warning("规格库存-核销次数必须大于0");
  3646. }
  3647. if (this.formValidate.product_type == 4 && this.oneFormValidate[0].write_valid == 2 && !
  3648. this.oneFormValidate[0].days) {
  3649. return this.$Message.warning("规格库存-有效天数必须大于0");
  3650. }
  3651. if (this.formValidate.product_type == 4 && this.oneFormValidate[0].write_valid == 3 && !
  3652. this.oneFormValidate[0].section_time.length) {
  3653. return this.$Message.warning("规格库存-请输入固定有效期");
  3654. }
  3655. if (this.formValidate.freight == 2 && this.formValidate.product_type == 0 && this
  3656. .formValidate.postage <= 0) {
  3657. return this.$Message.warning("物流设置-固定邮费不能为0");
  3658. }
  3659. if (this.formValidate.freight == 3 && this.formValidate.product_type == 0 && !this
  3660. .formValidate.temp_id) {
  3661. return this.$Message.warning("物流设置-运费模板不能为空");
  3662. }
  3663. if (this.formValidate.product_type == 0 && this.formValidate.is_presale_product && !this
  3664. .formValidate.presale_time[0]) {
  3665. return this.$Message.warning("营销设置-预售时间不能为空");
  3666. }
  3667. // for (let i = 0; i < this.formValidate.custom_form.length; i++) {
  3668. // const element = this.formValidate.custom_form[i];
  3669. // if (!element.title) {
  3670. // return this.$Message.warning("其他设置-留言标题不能为空");
  3671. // }
  3672. // }
  3673. if (this.customBtn && this.formValidate.system_form_id == 0) {
  3674. return this.$Message.warning('其他设置-请选择自定义表单模板');
  3675. }
  3676. let storeId = []
  3677. this.storesList.forEach(item => {
  3678. storeId.push(item.id)
  3679. })
  3680. if (this.formValidate.applicable_type == 2 && !storeId.length) {
  3681. return this.$Message.warning('适用门店-请选择适用门店');
  3682. }
  3683. this.formValidate.applicable_store_id = storeId;
  3684. this.formValidate.type = this.type;
  3685. if (this.formValidate.spec_type === 0) {
  3686. this.formValidate.attrs = this.oneFormValidate;
  3687. this.formValidate.header = [];
  3688. this.formValidate.items = [];
  3689. } else {
  3690. this.formValidate.items = this.attrs;
  3691. this.formValidate.attrs = this.manyFormValidate;
  3692. }
  3693. if (
  3694. this.formValidate.spec_type === 1 &&
  3695. this.manyFormValidate.length === 0
  3696. ) {
  3697. return this.$Message.warning("规格库存-请点击生成多规格");
  3698. // return this.$Message.warning('请点击生成规格!');
  3699. }
  3700. let item = this.formValidate.attrs;
  3701. if (this.formValidate.is_sub.indexOf(1) != -1) {
  3702. for (let i = 0; i < item.length; i++) {
  3703. if (
  3704. item[i].brokerage === null ||
  3705. item[i].brokerage_two === null
  3706. ) {
  3707. return this.$Message.warning("营销设置- 一二级返佣不能为空");
  3708. }
  3709. }
  3710. }
  3711. if (this.formValidate.is_sub.indexOf(0) != -1) {
  3712. for (let i = 0; i < item.length; i++) {
  3713. if (item[i].vip_price === null) {
  3714. return this.$Message.warning("营销设置-会员价不能为空");
  3715. }
  3716. if (item[i].vip_price === 0) {
  3717. return this.$Message.warning("营销设置-会员价不能为0");
  3718. }
  3719. }
  3720. }
  3721. if (this.formValidate.is_sub.length === 2) {
  3722. for (let i = 0; i < item.length; i++) {
  3723. if (
  3724. item[i].brokerage === null ||
  3725. item[i].brokerage_two === null ||
  3726. item[i].vip_price === null
  3727. ) {
  3728. return this.$Message.error(
  3729. "营销设置- 一二级返佣和会员价不能为空"
  3730. );
  3731. }
  3732. }
  3733. }
  3734. for (let i = 0; i < this.specsList.length; i++) {
  3735. let data = this.specsList[i];
  3736. if (!data.name.trim()) {
  3737. return this.$Message.error('请输入参数名称');
  3738. }
  3739. if (!data.value.trim()) {
  3740. return this.$Message.error('请输入参数值');
  3741. }
  3742. }
  3743. if (!this.formValidate.product_type) {
  3744. this.formValidate.is_support_refund = 1;
  3745. }
  3746. this.openSubimit = false;
  3747. this.formValidate.description = this.formatRichText(this.content);
  3748. let goodsId = [];
  3749. this.goodsData.forEach(item => {
  3750. goodsId.push(item.product_id)
  3751. })
  3752. this.formValidate.recommend_list = goodsId;
  3753. // 用户标签
  3754. let activeIds = [];
  3755. this.dataLabel.forEach((item) => {
  3756. activeIds.push(item.id)
  3757. });
  3758. this.formValidate.label_id = activeIds
  3759. // 商品标签
  3760. let storeActiveIds = [];
  3761. this.storeDataLabel.forEach((item) => {
  3762. storeActiveIds.push(item.id)
  3763. });
  3764. this.formValidate.store_label_id = storeActiveIds
  3765. // 商品参数
  3766. this.formValidate.specs = this.specsList;
  3767. if (this.$route.query.copy) {
  3768. this.formValidate.id = 0;
  3769. this.formValidate.soure_link = '';
  3770. }
  3771. if (this.formValidate.product_type == 4) {
  3772. this.formValidate.delivery_type = 2
  3773. }
  3774. productAddApi(this.formValidate)
  3775. .then(async (res) => {
  3776. this.openSubimit = true;
  3777. this.$Message.success(res.msg);
  3778. if (this.$route.params.id === "0") {
  3779. cacheDelete().catch((err) => {
  3780. this.$Message.error(err.msg);
  3781. });
  3782. }
  3783. setTimeout(() => {
  3784. this.$router.push({
  3785. path: this.roterPre + "/product/product_list"
  3786. });
  3787. }, 500);
  3788. })
  3789. .catch((res) => {
  3790. this.openSubimit = false;
  3791. this.$Message.error(res.msg);
  3792. });
  3793. } else {
  3794. if (!this.formValidate.store_name) {
  3795. return this.$Message.warning("基础信息-商品名称不能为空");
  3796. } else if (!this.formValidate.cate_id.length) {
  3797. return this.$Message.warning("基础信息-商品分类不能为空");
  3798. } else if (!this.formValidate.unit_name) {
  3799. return this.$Message.warning("基础信息-商品单位不能为空");
  3800. } else if (!this.formValidate.slider_image.length) {
  3801. return this.$Message.warning("基础信息-商品轮播图不能为空");
  3802. }
  3803. // if(!this.formValidate.store_name || !this.formValidate.cate_id || !this.formValidate.keyword
  3804. // || !this.formValidate.unit_name || !this.formValidate.store_info
  3805. // || !this.formValidate.image || !this.formValidate.slider_image){
  3806. // this.$Message.warning("请填写完整商品信息!");
  3807. // }
  3808. }
  3809. });
  3810. },
  3811. changeTemplate(msg) {
  3812. this.template = msg;
  3813. },
  3814. // 表单验证
  3815. validate(prop, status, error) {
  3816. if (status === false) {
  3817. this.$Message.warning(error);
  3818. }
  3819. },
  3820. // 移动
  3821. handleDragStart(e, item) {
  3822. this.dragging = item;
  3823. },
  3824. handleDragEnd(e, item) {
  3825. this.dragging = null;
  3826. },
  3827. handleDragOver(e) {
  3828. e.dataTransfer.dropEffect = "move";
  3829. },
  3830. handleDragEnter(e, item) {
  3831. e.dataTransfer.effectAllowed = "move";
  3832. if (item === this.dragging) {
  3833. return;
  3834. }
  3835. const newItems = [...this.formValidate.slider_image];
  3836. const src = newItems.indexOf(this.dragging);
  3837. const dst = newItems.indexOf(item);
  3838. newItems.splice(dst, 0, ...newItems.splice(src, 1));
  3839. this.formValidate.slider_image = newItems;
  3840. },
  3841. // 添加自定义弹窗
  3842. addCustomDialog(editorId) {
  3843. window.UE.registerUI(
  3844. "test-dialog",
  3845. function(editor, uiName) {
  3846. // 创建 dialog
  3847. let dialog = new window.UE.ui.Dialog({
  3848. iframeUrl: "/admin/widget.images/index.html?fodder=dialog",
  3849. editor: editor,
  3850. name: uiName,
  3851. title: "上传图片",
  3852. cssRules: "width:1200px;height:500px;padding:20px;",
  3853. });
  3854. this.dialog = dialog;
  3855. let btn = new window.UE.ui.Button({
  3856. name: "dialog-button",
  3857. title: "上传图片",
  3858. cssRules: `background-image: url(https://cdn.oss.9gt.net/prov1.1/1/icons.png);background-position: -726px -77px;`,
  3859. onclick: function() {
  3860. // 渲染dialog
  3861. dialog.render();
  3862. dialog.open();
  3863. },
  3864. });
  3865. return btn;
  3866. },
  3867. 37
  3868. );
  3869. window.UE.registerUI(
  3870. "video-dialog",
  3871. function(editor, uiName) {
  3872. let dialog = new window.UE.ui.Dialog({
  3873. iframeUrl: "/admin/widget.video/index.html?fodder=video",
  3874. editor: editor,
  3875. name: uiName,
  3876. title: "上传视频",
  3877. cssRules: "width:1000px;height:500px;padding:20px;",
  3878. });
  3879. this.dialog = dialog;
  3880. let btn = new window.UE.ui.Button({
  3881. name: "video-button",
  3882. title: "上传视频",
  3883. cssRules: `background-image: url(../../../assets/images/icons.png);background-position: -320px -20px;`,
  3884. onclick: function() {
  3885. // 渲染dialog
  3886. dialog.render();
  3887. dialog.open();
  3888. },
  3889. });
  3890. return btn;
  3891. },
  3892. 38
  3893. );
  3894. },
  3895. formatRichText(html) {
  3896. let newContent = html.replace(/<img[^>]*>/gi, function(match, capture) {
  3897. match = match
  3898. .replace(/style="[^"]+"/gi, "")
  3899. .replace(/style='[^']+'/gi, "");
  3900. match = match
  3901. .replace(/width="[^"]+"/gi, "")
  3902. .replace(/width='[^']+'/gi, "");
  3903. match = match
  3904. .replace(/height="[^"]+"/gi, "")
  3905. .replace(/height='[^']+'/gi, "");
  3906. return match;
  3907. });
  3908. newContent = newContent.replace(
  3909. /style="[^"]+"/gi,
  3910. function(match, capture) {
  3911. match = match
  3912. .replace(/width:[^;]+;/gi, "max-width:100%;")
  3913. .replace(/width:[^;]+;/gi, "max-width:100%;");
  3914. return match;
  3915. }
  3916. );
  3917. // newContent = newContent.replace(/<br[^>]*\/>/gi, "");
  3918. newContent = newContent.replace(
  3919. /\<img/gi,
  3920. '<img style="max-width:100%;height:auto;display:block;margin-top:0;margin-bottom:0;"'
  3921. );
  3922. return newContent;
  3923. },
  3924. },
  3925. };
  3926. </script>
  3927. <style scoped lang="stylus">
  3928. .storeTable img {
  3929. width 36px;
  3930. height 36px;
  3931. }
  3932. .storeTable /deep/.ivu-table-wrapper {
  3933. border: 0 !important
  3934. }
  3935. .radioGroup .ivu-radio-wrapper {
  3936. margin-right 20px;
  3937. }
  3938. .video-style {
  3939. width: 100%;
  3940. height: 100% !important;
  3941. border-radius: 10px;
  3942. }
  3943. .select-add {
  3944. width: 200px;
  3945. margin-left: 6px;
  3946. margin-right: 10px
  3947. }
  3948. .input-display {
  3949. display: none
  3950. }
  3951. .width-add {
  3952. width: 200px;
  3953. }
  3954. .custom-input {
  3955. width: 100px;
  3956. margin-right: 10px
  3957. }
  3958. .asterisk {
  3959. position relative;
  3960. .asteriskInfo {
  3961. position absolute;
  3962. color #ed4014;
  3963. left 73px;
  3964. top 8px;
  3965. &.on {
  3966. left: 62px;
  3967. }
  3968. &.on2 {
  3969. left: 50px;
  3970. }
  3971. }
  3972. }
  3973. .specsList {
  3974. /deep/.ivu-table-header table {
  3975. border: 0 !important
  3976. }
  3977. /deep/.ivu-table-header thead tr th {
  3978. padding 0 !important background-color #EEEEEE !important;
  3979. }
  3980. /deep/.ivu-table-cell {
  3981. padding 0 !important
  3982. }
  3983. /deep/.ivu-table-border th,
  3984. /deep/.ivu-table-border td {
  3985. border-right unset;
  3986. }
  3987. /deep/.ivu-table td {
  3988. height 59px;
  3989. }
  3990. &.on {
  3991. width 50% !important;
  3992. /deep/.ivu-table {
  3993. width 100% !important;
  3994. }
  3995. /deep/.ivu-table td {
  3996. height 40px;
  3997. padding 0 !important;
  3998. }
  3999. /deep/.ivu-table-cell {
  4000. padding 0 16px !important;
  4001. }
  4002. }
  4003. }
  4004. .form-submit {
  4005. /deep/.ivu-card {
  4006. border-radius: 0;
  4007. }
  4008. margin-bottom: 79px;
  4009. .fixed-card {
  4010. position: fixed;
  4011. right: 0;
  4012. bottom: 0;
  4013. left: 200px;
  4014. z-index: 45;
  4015. box-shadow: 0 -1px 2px rgb(240, 240, 240);
  4016. /deep/ .ivu-card-body {
  4017. padding: 15px 16px 14px;
  4018. }
  4019. .ivu-form-item {
  4020. margin-bottom: 0;
  4021. }
  4022. /deep/ .ivu-form-item-content {
  4023. margin-right: 124px;
  4024. text-align: center;
  4025. }
  4026. .ivu-btn {
  4027. height: 36px;
  4028. padding: 0 20px;
  4029. }
  4030. }
  4031. }
  4032. .seeCatMy {
  4033. color: #2d8cf0;
  4034. cursor: pointer;
  4035. }
  4036. .addCustom_content {
  4037. margin-top: 20px;
  4038. .custom_box {
  4039. margin-bottom: 10px;
  4040. }
  4041. .addfont {
  4042. display: inline-block;
  4043. font-size: 13px;
  4044. font-weight: 400;
  4045. color: #1890FF;
  4046. cursor: pointer;
  4047. }
  4048. }
  4049. .addCustomBox {
  4050. margin-top: 12px;
  4051. font-size: 13px;
  4052. font-weight: 400;
  4053. color: #1890FF;
  4054. .btn {
  4055. cursor: pointer;
  4056. width: max-content;
  4057. }
  4058. }
  4059. .checkAlls /deep/.ivu-checkbox-inner {
  4060. width 14px;
  4061. height 14px;
  4062. }
  4063. .checkAlls /deep/.ivu-checkbox-wrapper {
  4064. font-size 12px;
  4065. }
  4066. .lines {
  4067. border-bottom: 1px dashed #eee;
  4068. margin-bottom: 20px;
  4069. }
  4070. .iosfont {
  4071. font-size 20px !important;
  4072. }
  4073. .selectOn {
  4074. color #2d8cf0;
  4075. }
  4076. .ifam {
  4077. width: 344px;
  4078. height: 644px;
  4079. background: url('../../../assets/images/phonebg.png') no-repeat center top;
  4080. background-size: 344px 644px;
  4081. padding: 40px 20px;
  4082. padding-top: 50px;
  4083. margin: 0 auto 0 20px;
  4084. .content {
  4085. height: 560px;
  4086. overflow: hidden;
  4087. scrollbar-width: none;
  4088. /* firefox */
  4089. -ms-overflow-style: none;
  4090. /* IE 10+ */
  4091. overflow-x: hidden;
  4092. overflow-y: auto;
  4093. }
  4094. .content::-webkit-scrollbar {
  4095. display: none;
  4096. /* Chrome Safari */
  4097. }
  4098. }
  4099. .offShow {
  4100. position absolute
  4101. }
  4102. .goodsShow /deep/.ivu-radio-group-vertical .ivu-radio-wrapper {
  4103. height 35px;
  4104. line-height 35px;
  4105. }
  4106. .videbox {
  4107. width: 60px;
  4108. height: 60px;
  4109. background: rgba(0, 0, 0, 0.02);
  4110. border-radius: 4px;
  4111. border: 1px dashed #DDDDDD;
  4112. line-height: 50px;
  4113. text-align: center;
  4114. color: #898989;
  4115. font-size: 30px;
  4116. font-weight: 400;
  4117. cursor: pointer;
  4118. }
  4119. .brandName {
  4120. /deep/.ivu-cascader {
  4121. display inline-block
  4122. }
  4123. }
  4124. .formValidate {
  4125. .addClass {
  4126. color: #1890FF;
  4127. margin-left 14px;
  4128. padding 9px 0;
  4129. cursor pointer;
  4130. }
  4131. }
  4132. .productType {
  4133. width: 120px;
  4134. height: 60px;
  4135. background: #FFFFFF;
  4136. border-radius: 3px;
  4137. border: 1px solid #E7E7E7;
  4138. float: left;
  4139. text-align: center;
  4140. padding-top: 8px;
  4141. position: relative;
  4142. cursor: pointer;
  4143. line-height: 23px;
  4144. margin-right 12px;
  4145. &.on {
  4146. border-color #1890FF;
  4147. }
  4148. .name {
  4149. font-size: 14px;
  4150. font-weight: 600;
  4151. color: rgba(0, 0, 0, 0.85);
  4152. }
  4153. .title {
  4154. font-size: 12px;
  4155. font-weight: 400;
  4156. color: #999999;
  4157. }
  4158. .jiao {
  4159. position: absolute;
  4160. bottom: 0;
  4161. right: 0;
  4162. width: 0;
  4163. height: 0;
  4164. border-bottom: 26px solid #1890FF;
  4165. border-left: 26px solid transparent;
  4166. }
  4167. .iconfont {
  4168. position: absolute;
  4169. bottom: -3px;
  4170. right: 1px;
  4171. color: #FFFFFF;
  4172. font-size 12px;
  4173. }
  4174. }
  4175. .labelInput {
  4176. border: 1px solid #dcdee2;
  4177. width 50%;
  4178. padding 0 5px;
  4179. border-radius 5px;
  4180. min-height 30px;
  4181. cursor pointer;
  4182. .span {
  4183. color: #c5c8ce;
  4184. }
  4185. .iconxiayi {
  4186. font-size 12px
  4187. }
  4188. }
  4189. .labelClass {
  4190. /deep/.ivu-form-item-content {
  4191. line-height unset;
  4192. }
  4193. }
  4194. .ivu-checkbox-wrapper {
  4195. margin-right 19px;
  4196. }
  4197. .list-group {
  4198. margin-left: -8px;
  4199. }
  4200. .borderStyle {
  4201. border: 1px solid #ccc;
  4202. padding: 8px;
  4203. border-radius: 4px;
  4204. }
  4205. .drag {
  4206. cursor: move;
  4207. }
  4208. .move-icon {
  4209. width: 30px;
  4210. cursor: move;
  4211. margin-right: 10px;
  4212. }
  4213. .move-icon .icondrag2 {
  4214. font-size: 26px;
  4215. color: #d8d8d8;
  4216. }
  4217. .maxW /deep/.ivu-select-dropdown {
  4218. max-width: 600px;
  4219. }
  4220. #shopp-manager .ivu-table-wrapper {
  4221. border-left: 1px solid #dcdee2;
  4222. border-top: 1px solid #dcdee2;
  4223. }
  4224. .noLeft {
  4225. >>>.ivu-form-item-content {
  4226. margin-left: 0 !important;
  4227. }
  4228. }
  4229. .tips {
  4230. display: inline-bolck;
  4231. font-size: 12px;
  4232. font-weight: 400;
  4233. color: #999999;
  4234. margin-top: 6px;
  4235. }
  4236. .iview-video-style {
  4237. width: 40%;
  4238. height: 180px;
  4239. border-radius: 10px;
  4240. background-color: #707070;
  4241. margin-top: 10px;
  4242. position: relative;
  4243. overflow: hidden;
  4244. }
  4245. .iview-video-style .iconv {
  4246. color: #fff;
  4247. line-height: 180px;
  4248. width: 50px;
  4249. height: 50px;
  4250. display: inherit;
  4251. font-size: 26px;
  4252. position: absolute;
  4253. top: -74px;
  4254. left: 50%;
  4255. margin-left: -25px;
  4256. }
  4257. .iview-video-style .mark {
  4258. position: absolute;
  4259. width: 100%;
  4260. height: 30px;
  4261. top: 0;
  4262. background-color: rgba(0, 0, 0, 0.5);
  4263. text-align: center;
  4264. }
  4265. .uploadVideo {
  4266. margin-left: 10px;
  4267. }
  4268. .submission {
  4269. margin-left: 10px;
  4270. }
  4271. .form-submit .fixed-card .ivu-btn {
  4272. height: 32px;
  4273. }
  4274. .color-list .tip {
  4275. color: #c9c9c9;
  4276. }
  4277. .color-list .color-item {
  4278. width 70px;
  4279. height: 28px;
  4280. line-height: 28px;
  4281. color: #fff;
  4282. margin-right: 10px;
  4283. border-radius 2px;
  4284. text-align center .num {
  4285. color #1890FF;
  4286. width 14px;
  4287. height 14px;
  4288. text-align center;
  4289. line-height 14px;
  4290. border-radius 50%;
  4291. background-color #fff;
  4292. margin-right 6px;
  4293. }
  4294. }
  4295. .color-list .color-item.blue {
  4296. background-color: #1E9FFF;
  4297. }
  4298. .color-list .color-item.yellow {
  4299. background-color: rgb(254, 185, 0);
  4300. }
  4301. .color-list .color-item.green {
  4302. background-color: #009688;
  4303. }
  4304. .color-list .color-item.red {
  4305. background-color: #ed4014;
  4306. }
  4307. .color-list .color-item.colorBlue {
  4308. background: linear-gradient(270deg, #5ECFFF 0%, #0084FF 100%);
  4309. }
  4310. .columnsBox {
  4311. margin-right: 10px;
  4312. }
  4313. .priceBox {
  4314. width: 100%;
  4315. }
  4316. .rulesBox {
  4317. display: flex;
  4318. flex-wrap: wrap;
  4319. }
  4320. .pictrueBox {
  4321. display: inline-block;
  4322. }
  4323. .pictrueTab {
  4324. width: 40px !important;
  4325. height: 40px !important;
  4326. }
  4327. .pictrue {
  4328. width: 60px;
  4329. height: 60px;
  4330. border: 1px dotted rgba(0, 0, 0, 0.1);
  4331. margin-right: 15px;
  4332. margin-bottom 10px;
  4333. display: inline-block;
  4334. position: relative;
  4335. cursor: pointer;
  4336. img {
  4337. width: 100%;
  4338. height: 100%;
  4339. }
  4340. .btndel {
  4341. position: absolute;
  4342. z-index: 1;
  4343. width: 20px !important;
  4344. height: 20px !important;
  4345. left: 46px;
  4346. top: -4px;
  4347. }
  4348. }
  4349. .upLoad {
  4350. width: 58px;
  4351. height: 58px;
  4352. line-height: 58px;
  4353. border: 1px dotted rgba(0, 0, 0, 0.1);
  4354. border-radius: 4px;
  4355. background: rgba(0, 0, 0, 0.02);
  4356. cursor: pointer;
  4357. }
  4358. .curs {
  4359. cursor: pointer;
  4360. }
  4361. .inpWith {
  4362. width: 60%;
  4363. }
  4364. .labeltop {
  4365. >>>.ivu-form-item-label {
  4366. float: none !important;
  4367. display: inline-block !important;
  4368. margin-left: 120px !important;
  4369. width: auto !important;
  4370. }
  4371. .icondrop-down {
  4372. font-size: 12px;
  4373. margin-left: 5px;
  4374. }
  4375. }
  4376. .video-icon {
  4377. background-image: url('https://cdn.oss.9gt.net/prov1.1/1/icons.png'); // cdn.oss.9gt.net/prov1.1/1/icons.png);
  4378. // background-color: #fff;
  4379. background-position: -9999px;
  4380. background-repeat: no-repeat;
  4381. }
  4382. .progress {
  4383. margin-top: 10px;
  4384. }
  4385. .new_tab {
  4386. >>>.ivu-tabs-nav .ivu-tabs-tab {
  4387. padding: 4px 16px 20px !important;
  4388. font-weight: 500;
  4389. }
  4390. }
  4391. </style>