| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504 |
- <template>
- <div class="article-manager video-icon form-submit" id="shopp-manager">
- <div class="i-layout-page-header">
- <PageHeader class="product_tabs" hidden-breadcrumb>
- <div slot="title" class="acea-row row-middle">
- <router-link :to="{ path: `${roterPre}/product/product_list` }">
- <div class="font-sm after-line">
- <span class="iconfont iconfanhui"></span>
- <span class="pl10">返回</span>
- </div>
- </router-link>
- <span v-text="$route.params.id ? '编辑商品' : '添加商品'" class="mr20 ml16"></span>
- </div>
- </PageHeader>
- </div>
- <Card :bordered="false" dis-hover class="ivu-mt mh">
- <div class="new_tab">
- <Tabs v-model="currentTab" @on-click="onhangeTab">
- <TabPane v-for="(item, index) in headTab" v-if="index !=6 || (index==6 && merchantType==0)"
- :key="index+'name'" :label="item.title" :name="item.name"></TabPane>
- </Tabs>
- </div>
- <Form class="formValidate mt20" ref="formValidate" :rules="ruleValidate" :model="formValidate"
- :label-width="labelWidth" :label-position="labelPosition" @submit.native.prevent>
- <Row :gutter="24" type="flex" v-show="currentTab === '1'">
- <!-- 商品信息-->
- <Col span="24">
- <FormItem label="商品类型:" props="is_virtual">
- <div class="productType" :class="formValidate.product_type == item.id ? 'on' : ''"
- v-for="(item, index) in productType" :key="item.id" @click="productTypeTap(1,item)">
- <div class="name">{{ item.name }}</div>
- <div class="title">({{ item.title }})</div>
- <div v-if="formValidate.product_type == item.id" class="jiao"></div>
- <div v-if="formValidate.product_type == item.id" class="iconfont iconduihao"></div>
- </div>
- </FormItem>
- </Col>
- <Col span="24">
- <FormItem label="商品分类:" prop="cate_id">
- <el-cascader placeholder="请选择商品分类" v-width="'50%'" size="mini" v-model="formValidate.cate_id"
- :options="treeSelect" :props="props" filterable clearable>
- </el-cascader>
- <span class="addClass" @click="addClass" v-if="merchantType!=1">新增分类</span>
- <!-- <Select v-model="formValidate.cate_id" multiple v-width="'50%'">
- <Option
- v-for="item in treeSelect"
- :disabled="item.pid === 0"
- :value="item.id"
- :key="item.id"
- >{{ item.html + item.cate_name }}</Option
- >
- </Select> -->
- </FormItem>
- </Col>
- <Col span="24">
- <FormItem label="商品名称:" prop="store_name">
- <Input v-model="formValidate.store_name" placeholder="请输入商品名称" v-width="'50%'" />
- </FormItem>
- </Col>
- <Col span="24" class="brandName">
- <FormItem label="商品品牌:" prop="">
- <Cascader :data="brandData" placeholder="请选择商品品牌" change-on-select
- v-model="formValidate.brand_id" filterable v-width="'50%'"></Cascader>
- <span class="addClass" @click="addBrand" v-if="merchantType!=1">新增品牌</span>
- </FormItem>
- </Col>
- <Col span="24">
- <FormItem label="单位:" prop="unit_name">
- <Select v-model="formValidate.unit_name" clearable filterable v-width="'50%'"
- placeholder="请输入单位">
- <Option v-for="(item, index) in unitNameList" :value="item.name" :key="item.id">
- {{ item.name }}
- </Option>
- </Select>
- <span class="addClass" @click="addUnit" v-if="merchantType!=1">新增单位</span>
- </FormItem>
- </Col>
- <Col span="24">
- <FormItem label="商品条形码:" prop="">
- <Input
- v-model="formValidate.bar_code"
- placeholder="请输入商品条形码"
- v-width="'50%'"
- />
- </FormItem>
- </Col>
- <Col span="24">
- <FormItem label="商品编码:" prop="">
- <Input v-model="formValidate.code" placeholder="请输入商品编码" v-width="'50%'" />
- </FormItem>
- </Col>
- <Col span="24">
- <FormItem label="商品轮播图:" prop="slider_image">
- <div class="acea-row">
- <div class="pictrue" v-for="(item, index) in formValidate.slider_image" :key="index+'img'"
- draggable="true" @dragstart="handleDragStart($event, item)"
- @dragover.prevent="handleDragOver($event, item)"
- @dragenter="handleDragEnter($event, item)" @dragend="handleDragEnd($event, item)">
- <img v-lazy="item" />
- <Button shape="circle" icon="md-close" @click.native="handleRemove(index)"
- class="btndel"></Button>
- </div>
- <div v-if="formValidate.slider_image.length < 10" class="upLoad acea-row row-center-wrapper"
- @click="modalPicTap('duo')">
- <Icon type="ios-camera-outline" size="26" />
- </div>
- <Input v-model="formValidate.slider_image[0]" class="input-display"></Input>
- </div>
- <div class="tips"> 建议尺寸:800 * 800px,可拖拽改变图片顺序,默认首张图为主图,最多上传10张</div>
- </FormItem>
- </Col>
- <Col span="24">
- <FormItem label="商品标签:" prop="store_label_id" class="labelClass">
- <div class="acea-row row-middle">
- <div class="labelInput acea-row row-between-wrapper" @click="openStoreLabel">
- <div style="width: 90%;">
- <div v-if="storeDataLabel.length">
- <Tag closable v-for="(item,index) in storeDataLabel" key="index"
- @on-close="closeStoreLabel(item)">{{item.label_name}}</Tag>
- </div>
- <span class="span" v-else>选择商品标签</span>
- </div>
- <div class="iconfont iconxiayi"></div>
- </div>
- <span class="addClass" @click="addStoreLabel">新增标签</span>
- </div>
- </FormItem>
- </Col>
- <!-- <Col span="24">
- <FormItem label="供应商:" prop="supplier_id" v-if="formValidate.product_type == 0 && merchantType!=1">
- <Select
- v-model="formValidate.supplier_id"
- clearable
- filterable
- v-width="'50%'"
- placeholder="请选择供应商"
- >
- <Option
- v-for="(item, index) in supplierList"
- :value="item.id"
- :key="item.id"
- >{{item.supplier_name }}</Option
- >
- </Select>
- </FormItem>
- </Col> -->
- <Col span="24">
- <FormItem label="添加视频:">
- <i-switch v-model="formValidate.video_open" size="large">
- <span slot="open">开启</span>
- <span slot="close">关闭</span>
- </i-switch>
- </FormItem>
- </Col>
- <Col span="24" v-if="formValidate.video_open">
- <FormItem label="上传视频:" prop="video_link">
- <Button @click="modalPicTap('dan','video')">上传视频</Button>
- <div class="tips">建议使用云存储保存视频,<router-link
- :to="{ path: `${roterPre}/setting/storage` }">配置云存储</router-link>,建议时长:9~30秒,视频宽高比16:9
- <Poptip placement="bottom" trigger="hover" width="440" transfer padding="8px">
- <a>查看示例</a>
- <div class="exampleImg" slot="content">
- <img :src="`${baseURL}/statics/system/productVideo.png`" alt=""
- style="width: 204px;height: 270px;" />
- <img :src="`${baseURL}/statics/system/productVideo2.png`" alt=""
- style="width: 204px;height: 270px;" />
- </div>
- </Poptip>
- </div>
- <div class="iview-video-style" v-if="formValidate.video_link">
- <video class="video-style" :src="formValidate.video_link" controls="controls">
- </video>
- <div class="mark"></div>
- <Icon type="ios-trash-outline" class="iconv" @click="delVideo" />
- </div>
- </FormItem>
- </Col>
- <!-- <Col span="24" v-if="formValidate.video_open">-->
- <!-- <FormItem label="视频类型:">-->
- <!-- <RadioGroup v-model="seletVideo" @on-change="changeVideo">-->
- <!-- <Radio :label="0" class="radio">本地视频</Radio>-->
- <!-- <Radio :label="1">视频链接</Radio>-->
- <!-- </RadioGroup>-->
- <!-- </FormItem>-->
- <!-- </Col>-->
- <!-- <Col span="24" v-if="formValidate.video_open">-->
- <!-- <FormItem label="" prop="video_link">-->
- <!-- <Input-->
- <!-- v-if="seletVideo == 1 && !formValidate.video_link"-->
- <!-- v-width="'50%'"-->
- <!-- v-model="videoLink"-->
- <!-- placeholder="请输入视频链接"-->
- <!-- />-->
- <!-- <input-->
- <!-- type="file"-->
- <!-- ref="refid"-->
- <!-- @change="zh_uploadFile_change"-->
- <!-- class="input-display"-->
- <!-- />-->
- <!-- <div-->
- <!-- v-if="-->
- <!-- seletVideo == 0 &&-->
- <!-- (upload_type !== '1' || videoLink) &&-->
- <!-- !formValidate.video_link-->
- <!-- "-->
- <!-- class="ml10 videbox"-->
- <!-- @click="zh_uploadFile"-->
- <!-- >-->
- <!-- +-->
- <!-- </div>-->
- <!-- <Button-->
- <!-- v-if="-->
- <!-- seletVideo == 1 &&-->
- <!-- (upload_type !== '1' || videoLink) &&-->
- <!-- !formValidate.video_link-->
- <!-- "-->
- <!-- type="primary"-->
- <!-- icon="ios-cloud-upload-outline"-->
- <!-- class="uploadVideo"-->
- <!-- @click="zh_uploadFile"-->
- <!-- >确认添加</Button>-->
- <!-- <Upload-->
- <!-- v-if="upload_type === '1' && !videoLink"-->
- <!-- :show-upload-list="false"-->
- <!-- :action="fileUrl2"-->
- <!-- :before-upload="videoSaveToUrl"-->
- <!-- :data="uploadData"-->
- <!-- :headers="header"-->
- <!-- :multiple="true"-->
- <!-- style="display: inline-block"-->
- <!-- >-->
- <!-- <div-->
- <!-- v-if="seletVideo === 0 && !formValidate.video_link"-->
- <!-- class="videbox"-->
- <!-- >-->
- <!-- +-->
- <!-- </div>-->
- <!-- </Upload>-->
- <!-- <div class="iview-video-style" v-if="formValidate.video_link">-->
- <!-- <video-->
- <!-- class="video-style"-->
- <!-- :src="formValidate.video_link"-->
- <!-- controls="controls"-->
- <!-- >-->
- <!-- 您的浏览器不支持 video 标签。-->
- <!-- </video>-->
- <!-- <div class="mark"></div>-->
- <!-- <Icon-->
- <!-- type="ios-trash-outline"-->
- <!-- class="iconv"-->
- <!-- @click="delVideo"-->
- <!-- />-->
- <!-- </div>-->
- <!-- <Progress-->
- <!-- class="progress"-->
- <!-- :percent="progress"-->
- <!-- :stroke-width="5"-->
- <!-- v-if="upload.videoIng || videoIng"-->
- <!-- />-->
- <!-- <div class="tips">建议时长:9~30秒,视频宽高比16:9</div>-->
- <!-- </FormItem>-->
- <!-- </Col>-->
- <Col span="24" class="goodsShow">
- <FormItem label="上架时间:">
- <RadioGroup v-model="formValidate.is_show" @on-change="goodsOn">
- <Radio :label="1">
- <Icon type="social-apple"></Icon>
- <span>立即上架</span>
- </Radio>
- <Radio :label="2">
- <Icon type="social-android"></Icon>
- <span>定时上架</span>
- </Radio>
- <Radio :label="0">
- <Icon type="social-windows"></Icon>
- <span>放入仓库</span>
- </Radio>
- </RadioGroup>
- </FormItem>
- </Col>
- <Col span="24" v-if="formValidate.is_show==2">
- <FormItem label="">
- <DatePicker type="datetime" @on-change="onchangeShow" :options="startPickOptions"
- :value="formValidate.auto_on_time" v-model="formValidate.auto_on_time" placeholder="请选择上架时间"
- format="yyyy-MM-dd HH:mm" style="width: 260px;"></DatePicker>
- </FormItem>
- </Col>
- <Col span="24" class="goodsShow">
- <FormItem label="定时下架:">
- <Switch v-model="off_show" :true-value="1" :false-value="0" size="large" @on-change="goodsOff">
- <span slot="open">开启</span>
- <span slot="close">关闭</span>
- </Switch>
- </FormItem>
- </Col>
- <Col span="24" v-if="off_show==1">
- <FormItem label="">
- <DatePicker type="datetime" @on-change="onchangeOff" :options="endPickOptions"
- :value="formValidate.auto_off_time" v-model="formValidate.auto_off_time"
- placeholder="请选择下架时间" format="yyyy-MM-dd HH:mm" style="width: 260px;"></DatePicker>
- <div class="tips">开启定时下架后,系统会在设置时间下架该商品。下架时间需晚于开售时间,商品才能定时开售。</div>
- </FormItem>
- </Col>
- <!-- <Col
- :xl="23"
- :lg="24"
- :md="24"
- :sm="24"
- :xs="24"
- v-if="formValidate.spec_type === 0"
- >
- <FormItem>
- <Table :data="oneFormValidate" :columns="columns" border>
- <template slot-scope="{ row, index }" slot="pic">
- <div
- class="acea-row row-middle row-center-wrapper"
- @click="modalPicTap('dan', 'danTable', index)"
- >
- <div
- class="pictrue pictrueTab"
- v-if="oneFormValidate[0].pic"
- >
- <img v-lazy="oneFormValidate[0].pic" />
- </div>
- <div
- class="upLoad pictrueTab acea-row row-center-wrapper"
- v-else
- >
- <Icon type="ios-camera-outline" size="21" />
- </div>
- </div>
- </template>
- <template slot-scope="{ row, index }" slot="price">
- <InputNumber
- v-model="oneFormValidate[0].price"
- :min="0"
- class="priceBox"
- ></InputNumber>
- </template>
- <template slot-scope="{ row, index }" slot="cost">
- <InputNumber
- v-model="oneFormValidate[0].cost"
- :min="0"
- class="priceBox"
- ></InputNumber>
- </template>
- <template slot-scope="{ row, index }" slot="ot_price">
- <InputNumber
- v-model="oneFormValidate[0].ot_price"
- :min="0"
- class="priceBox"
- ></InputNumber>
- </template>
- <template slot-scope="{ row, index }" slot="stock">
- <InputNumber
- v-model="oneFormValidate[0].stock"
- :min="0"
- :precision="0"
- class="priceBox"
- ></InputNumber>
- </template>
- <template slot-scope="{ row, index }" slot="bar_code">
- <Input v-model="oneFormValidate[0].bar_code"></Input>
- </template>
- <template slot-scope="{ row, index }" slot="code">
- <Input v-model="oneFormValidate[0].code"></Input>
- </template>
- <template slot-scope="{ row, index }" slot="weight">
- <InputNumber
- v-model="oneFormValidate[0].weight"
- :min="0"
- class="priceBox"
- ></InputNumber>
- </template>
- <template slot-scope="{ row, index }" slot="volume">
- <InputNumber
- v-model="oneFormValidate[0].volume"
- :min="0"
- class="priceBox"
- ></InputNumber>
- </template>
- </Table>
- </FormItem>
- </Col> -->
- <!-- <Col span="24">
- <FormItem label="商品标签:" prop="label_id">
- <Select v-model="formValidate.label_id" multiple v-width="'50%'">
- <Option v-for="item in labelSelect" :value="item.id" :key="item.id">{{ item.label_name }}</Option>
- </Select>
- </FormItem>
- </Col> -->
- </Row>
- <Row :gutter="24" type="flex" v-show="currentTab === '2'">
- <Col span="24" v-if="formValidate.product_type != 4">
- <FormItem label="商品规格:" props="spec_type">
- <RadioGroup v-model="formValidate.spec_type" @on-change="changeSpec">
- <Radio :label="0" class="radio">单规格</Radio>
- <Radio :label="1">多规格</Radio>
- </RadioGroup>
- </FormItem>
- </Col>
- <Col span="24">
- <FormItem label="是否称重:" props="is_weigh">
- <RadioGroup v-model="formValidate.is_weigh" >
- <Radio :label="0" class="radio">否</Radio>
- <Radio :label="1">是</Radio>
- </RadioGroup>
- </FormItem>
- </Col>
- <!-- 多规格添加-->
- <Col span="24" v-if="formValidate.spec_type === 1 && formValidate.product_type != 4" class="noForm">
- <Col span="24">
- <FormItem label="选择规格:" prop="">
- <div class="acea-row row-middle">
- <Select v-model="formValidate.selectRule" style="width: 23%">
- <Option v-for="(item, index) in ruleList" :value="item.rule_name" :key="item.id">
- {{ item.rule_name }}
- </Option>
- </Select>
- <Button type="primary" class="mr20" @click="confirm">确认</Button>
- <Button @click="addRule">添加规格模板</Button>
- </div>
- </FormItem>
- </Col>
- <Col span="24">
- <FormItem v-if="attrs.length !== 0">
- <draggable class="dragArea list-group" :list="attrs" group="peoples" handle=".move-icon"
- :move="checkMove" @end="end">
- <div v-for="(item, index) in attrs" :key="index+'attrs'" class="acea-row row-middle mb10">
- <div class="move-icon">
- <span class="iconfont icondrag2"></span>
- </div>
- <div style="width: 90%" :class="moveIndex === index ? 'borderStyle' : ''">
- <div class="acea-row row-middle">
- <span class="mr5">{{ item.value }}</span>
- <Icon type="ios-close-circle" size="14" class="curs"
- @click="handleRemoveRole(index)" />
- </div>
- <div class="rulesBox">
- <draggable :list="item.detail" handle=".drag">
- <Tag type="dot" closable color="primary" v-for="(j, indexn) in item.detail"
- :key="indexn" :name="j" class="mr20 drag"
- @on-close="handleRemove2(item.detail, indexn)">{{ j }}</Tag>
- </draggable>
- <Input search enter-button="添加" placeholder="请输入属性名称"
- v-model="item.detail.attrsVal"
- @on-search="createAttr(item.detail.attrsVal, index)" class="width-add" />
- </div>
- </div>
- </div>
- </draggable>
- </FormItem>
- </Col>
- <Col span="24" v-if="createBnt">
- <FormItem>
- <Button type="primary" icon="md-add" @click="addBtn" class="mr15">添加新规格</Button>
- <Button type="success" @click="generate(1)">立即生成</Button>
- </FormItem>
- </Col>
- <Col span="24" v-if="showIput">
- <Col :xl="6" :lg="9" :md="10" :sm="24" :xs="24">
- <FormItem label="规格:">
- <Input placeholder="请输入规格" v-model="formDynamic.attrsName" />
- </FormItem>
- </Col>
- <Col :xl="6" :lg="9" :md="10" :sm="24" :xs="24">
- <FormItem label="规格值:">
- <Input v-model="formDynamic.attrsVal" placeholder="请输入规格值" />
- </FormItem>
- </Col>
- <Col :xl="6" :lg="5" :md="10" :sm="24" :xs="24">
- <FormItem>
- <Button type="primary" class="mr15" @click="createAttrName">确定</Button>
- <Button @click="offAttrName">取消</Button>
- </FormItem>
- </Col>
- </Col>
- <!-- 多规格设置-->
- <Col :xl="24" :lg="24" :md="24" :sm="24" :xs="24" v-if="
- manyFormValidate.length &&
- formValidate.header.length !== 0 &&
- attrs.length !== 0
- ">
- <!-- 批量设置-->
- <Col span="24">
- <FormItem label="批量设置:" class="labeltop">
- <Table :data="oneFormBatch"
- :columns="formValidate.product_type == 1?columnsCarMy:formValidate.product_type == 3?columnsFictitious:columns2"
- border>
- <template slot-scope="{ row, index }" slot="attr">
- <div @click="batchAttr" class="acea-row row-between-wrapper" style="cursor: pointer;">
- <div style="width: 41px;">{{oneFormBatch[0].attr}}</div>
- <span class="iconfont icondrop-down"></span>
- </div>
- </template>
- <template slot-scope="{ row, index }" slot="pic">
- <div class="acea-row row-middle row-center-wrapper"
- @click="modalPicTap('dan', 'duopi', index)">
- <div class="pictrue pictrueTab" v-if="oneFormBatch[0].pic">
- <img v-lazy="oneFormBatch[0].pic" />
- </div>
- <div class="upLoad pictrueTab acea-row row-center-wrapper" v-else>
- <Icon type="ios-camera-outline" size="26" class="iosfont" />
- </div>
- </div>
- </template>
- <template slot-scope="{ row, index }" slot="price">
- <InputNumber v-model="oneFormBatch[0].price" :min="0" class="priceBox"></InputNumber>
- </template>
- <template slot-scope="{ row, index }" slot="settle_price" v-if='merchantType == 2'>
- <InputNumber v-model="oneFormBatch[0].settle_price" :min="0" class="priceBox">
- </InputNumber>
- </template>
- <template slot-scope="{ row, index }" slot="cost">
- <InputNumber v-model="oneFormBatch[0].cost" :min="0" class="priceBox"></InputNumber>
- </template>
- <template slot-scope="{ row, index }" slot="ot_price">
- <InputNumber v-model="oneFormBatch[0].ot_price" :min="0" class="priceBox"></InputNumber>
- </template>
- <template slot-scope="{ row, index }" slot="erp_product_id">
- <Select v-model="oneFormBatch[0].erp_product_id" filterable
- :remote-method="queryWarehouseList" :loading="warehouseListLoding" @on-change="changeErpProductId">
- <Option v-for="(option, index) in warehouseList" :value="option.id" :key="index">
- <div>
- {{option.store_name}}({{option.unit_name}})
- </div>
- </Option>
- </Select>
- </template>
- <template slot-scope="{ row, index }" slot="unit">
- <Input v-model="oneFormBatch[0].unit"></Input>
- </template>
- <template slot-scope="{ row, index }" slot="uint_to_erp_unit">
- <InputNumber v-model="oneFormBatch[0].uint_to_erp_unit" :min="0" class="priceBox">
- </InputNumber>
- </template>
- <!-- <template slot-scope="{ row, index }" slot="stock">
- <InputNumber v-model="oneFormBatch[0].stock" :min="0"
- :disabled="formValidate.product_type == 1 || openErp" class="priceBox">
- </InputNumber>
- </template> -->
- <template slot-scope="{ row, index }" slot="bar_code">
- <Input v-model="oneFormBatch[0].bar_code"></Input>
- </template>
- <template slot-scope="{ row, index }" slot="code">
- <Input v-model="oneFormBatch[0].code"></Input>
- </template>
- <template slot-scope="{ row, index }" slot="weight">
- <InputNumber v-model="oneFormBatch[0].weight" :step="0.1" :min="0" class="priceBox">
- </InputNumber>
- </template>
- <template slot-scope="{ row, index }" slot="volume">
- <InputNumber v-model="oneFormBatch[0].volume" :step="0.1" :min="0" class="priceBox">
- </InputNumber>
- </template>
- <!-- <template slot-scope="{ row, index }" slot="fictitious"
- v-if="formValidate.product_type == 1">
- <Button v-if="
- !row.virtual_list && !row.stock
- " @click="addVirtual(0, 'oneFormBatch')">添加卡密</Button>
- <span v-else class="seeCatMy"
- @click="seeVirtual(oneFormBatch[0], 'oneFormBatch', 0)">已设置</span>
- </template> -->
- <template slot-scope="{ row, index }" slot="action">
- <a @click="batchAdd">批量设置</a>
- <Divider type="vertical" />
- <a @click="batchDel">清空</a>
- </template>
- </Table>
- </FormItem>
- </Col>
- <!-- 多规格表格-->
- <Col span="24">
- <FormItem label="商品属性:" class="labeltop">
- <Table :data="manyFormValidate" :columns="formValidate.header" border>
- <template slot-scope="{ row, index }" v-for="(item,i) in attrData.length"
- :slot="'value'+(i+1)">
- <div :class="manyFormValidate[index].select?'selectOn':''">
- {{manyFormValidate[index]['value'+(i+1)]}}
- </div>
- </template>
- <template slot-scope="{ row, index }" slot="pic">
- <div class="acea-row row-middle row-center-wrapper"
- @click="modalPicTap('dan', 'duoTable', index)">
- <div class="pictrue pictrueTab" v-if="manyFormValidate[index].pic">
- <img v-lazy="manyFormValidate[index].pic" />
- </div>
- <div class="upLoad pictrueTab acea-row row-center-wrapper" v-else>
- <Icon type="ios-camera-outline" size="21" />
- </div>
- </div>
- </template>
- <template slot-scope="{ row, index }" slot="price">
- <InputNumber v-model="manyFormValidate[index].price" :min="0" class="priceBox">
- </InputNumber>
- </template>
- <template slot-scope="{ row, index }" slot="settle_price" v-if="merchantType == 2">
- <InputNumber v-model="manyFormValidate[index].settle_price" :min="0" class="priceBox">
- </InputNumber>
- </template>
- <template slot-scope="{ row, index }" slot="cost">
- <InputNumber v-model="manyFormValidate[index].cost" :min="0" class="priceBox">
- </InputNumber>
- </template>
- <template slot-scope="{ row, index }" slot="ot_price">
- <InputNumber v-model="manyFormValidate[index].ot_price" :min="0" class="priceBox">
- </InputNumber>
- </template>
- <template slot-scope="{ row, index }" slot="erp_product_id">
- <Select v-model="manyFormValidate[index].erp_product_id" filterable :remote-method="queryWarehouseList" :loading="warehouseListLoding" @on-change="changeErpProductId">
- <Option v-for="(option, index) in warehouseList" :value="option.id" :key="index">
- {{option.store_name}}({{option.unit_name}})
- </Option>
- </Select>
- </template>
- <template slot-scope="{ row, index }" slot="unit">
- <Input v-model="manyFormValidate[index].unit"></Input>
- </template>
- <template slot-scope="{ row, index }" slot="uint_to_erp_unit">
- <InputNumber v-model="manyFormValidate[index].uint_to_erp_unit" :min="0"
- class="priceBox"></InputNumber>
- </template>
- <!-- <template slot-scope="{ row, index }" slot="stock">
- <InputNumber v-model="manyFormValidate[index].stock" :min="0" :precision="0"
- :disabled="formValidate.product_type == 1 || openErp" class="priceBox">
- </InputNumber>
- </template> -->
- <!-- <template slot-scope="{ row, index }" slot="fictitious"
- v-if="formValidate.product_type == 1">
- <Button v-if="(!row.virtual_list || !row.virtual_list.length) && !row.stock"
- @click="addVirtual(index, 'manyFormValidate')">添加卡密</Button>
- <span v-else class="seeCatMy"
- @click="seeVirtual(row, 'manyFormValidate', index)">已设置</span>
- </template> -->
- <template slot-scope="{ row, index }" slot="bar_code">
- <Input v-model="manyFormValidate[index].bar_code"></Input>
- </template>
- <template slot-scope="{ row, index }" slot="code">
- <Input v-model="manyFormValidate[index].code"></Input>
- </template>
- <template slot-scope="{ row, index }" slot="weight">
- <InputNumber v-model="manyFormValidate[index].weight" :min="0" class="priceBox">
- </InputNumber>
- </template>
- <template slot-scope="{ row, index }" slot="volume">
- <InputNumber v-model="manyFormValidate[index].volume" :min="0" class="priceBox">
- </InputNumber>
- </template>
- <template slot-scope="{ row, index }" slot="action">
- <a @click="delAttrTable(index)">删除</a>
- </template>
- </Table>
- </FormItem>
- </Col>
- </Col>
- </Col>
- <!-- 单规格表格-->
- <div v-if="formValidate.spec_type === 0 || formValidate.product_type == 4" style="width: 100%;">
- <Col span="24" v-if="formValidate.product_type != 4">
- <FormItem label="图片:" prop="image">
- <div class="pictrueBox" @click="modalPicTap('dan', 'danTable', 0)">
- <div class="pictrue" v-if="oneFormValidate[0].pic">
- <img v-lazy="oneFormValidate[0].pic" />
- </div>
- <div class="upLoad acea-row row-center-wrapper" v-else>
- <Input v-model="oneFormValidate[0].pic" class="input-display"></Input>
- <Icon type="ios-camera-outline" size="26" />
- </div>
- </div>
- </FormItem>
- </Col>
- <Col class="asterisk" span="24" v-if="formValidate.product_type == 4">
- <div class="asteriskInfo on2">*</div>
- <FormItem label="核销次数:">
- <InputNumber v-model="oneFormValidate[0].write_times" :min="1" :max="99999999"
- :precision="0" v-width="'50%'" placeholder="请输入核销次数"></InputNumber>
- </FormItem>
- </Col>
- <Col span="24" v-if="formValidate.product_type == 4">
- <FormItem required label="核销时效:">
- <RadioGroup v-model="oneFormValidate[0].write_valid">
- <Radio :label="1">永久有效</Radio>
- <Radio :label="2">购买后几天有效</Radio>
- <Radio :label="3">固定有效期</Radio>
- </RadioGroup>
- </FormItem>
- </Col>
- <Col span="24" v-if="oneFormValidate[0].write_valid==2">
- <FormItem label="" prop="freight">
- <div class="acea-row row-middle">
- <InputNumber :min="1" v-model="oneFormValidate[0].days" placeholder="请输入有效天数"
- v-width="'50%'" />
- <span class="ml10">天</span>
- </div>
- </FormItem>
- </Col>
- <Col span="24" v-if="oneFormValidate[0].write_valid==3">
- <FormItem label="" prop="freight">
- <div class="acea-row row-middle">
- <DatePicker :editable="false" type="daterange" format="yyyy-MM-dd"
- placeholder="请选择固定有效期" @on-change="onchangeTime" v-width="'50%'"
- :value="oneFormValidate[0].section_time" v-model="oneFormValidate[0].section_time">
- </DatePicker>
- </div>
- </FormItem>
- </Col>
- <Col span="24" class="asterisk">
- <div class="asteriskInfo">*</div>
- <FormItem label="售价:">
- <InputNumber v-model="oneFormValidate[0].price" :min="0" :max="99999999" v-width="'50%'">
- </InputNumber>
- </FormItem>
- </Col>
- <Col span="24" class="asterisk" v-if="merchantType == 2">
- <div class="asteriskInfo on">*</div>
- <FormItem label="结算价:">
- <InputNumber v-model="oneFormValidate[0].settle_price" :min="0" :max="99999999"
- v-width="'50%'"></InputNumber>
- </FormItem>
- </Col>
- <Col span="24" class="asterisk">
- <div class="asteriskInfo on">*</div>
- <FormItem label="成本价:">
- <InputNumber v-model="oneFormValidate[0].cost" :min="0" :max="99999999" v-width="'50%'">
- </InputNumber>
- </FormItem>
- </Col>
- <Col span="24">
- <FormItem label="原价:">
- <InputNumber v-model="oneFormValidate[0].ot_price" :min="0" :max="99999999" v-width="'50%'">
- </InputNumber>
- </FormItem>
- </Col>
- <Col span="24">
- <FormItem label="仓库商品:">
- <Select v-model="oneFormValidate[0].erp_product_id" filterable v-width="'50%'"
- :remote-method="queryWarehouseList" :loading="warehouseListLoding" @on-change="changeErpProductId" >
- <Option v-for="(option, index) in warehouseList" :value="option.id" :key="index">
- {{option.store_name}}({{option.unit_name}})
- </Option>
- </Select>
- </FormItem>
- </Col>
- <Col span="24">
- <FormItem label="规格单位:">
- <Input v-model.trim="oneFormValidate[0].unit" v-width="'50%'"
- placeholder="请输入商品规格单位"></Input>
- </FormItem>
- </Col>
- <Col span="24">
- <FormItem label="转换率:">
- <InputNumber v-model="oneFormValidate[0].uint_to_erp_unit" :min="0" :max="99999999"
- v-width="'50%'"></InputNumber>
- </FormItem>
- </Col>
- <Col span="24" class="asterisk">
- <div class="asteriskInfo">*</div>
- <!-- <FormItem label="库存:">
- <InputNumber v-model="oneFormValidate[0].stock" :min="0" :max="99999999"
- :disabled="formValidate.product_type == 1 || openErp" :precision="0" v-width="'50%'">
- </InputNumber>
- </FormItem> -->
- </Col>
- <Col span="24" v-if="formValidate.product_type != 4">
- <FormItem label="商品条形码:">
- <Input v-model.trim="oneFormValidate[0].bar_code" v-width="'50%'"
- placeholder="请输入商品条形码"></Input>
- </FormItem>
- </Col>
- <Col span="24" v-if="formValidate.product_type != 4">
- <FormItem label="商品编号:">
- <Input v-model.trim="oneFormValidate[0].code" v-width="'50%'" placeholder="请输入商品编码"></Input>
- </FormItem>
- </Col>
- <Col span="24" v-if="formValidate.product_type == 0">
- <FormItem label="重量(KG):">
- <InputNumber v-model="oneFormValidate[0].weight" :min="0" :max="99999999" v-width="'50%'">
- </InputNumber>
- </FormItem>
- </Col>
- <Col span="24" v-if="formValidate.product_type == 0">
- <FormItem label="体积(m³):">
- <InputNumber v-model="oneFormValidate[0].volume" :min="0" :max="99999999" v-width="'50%'">
- </InputNumber>
- </FormItem>
- </Col>
- <!-- <Col span="24" v-if="formValidate.product_type == 1">
- <FormItem label="卡密设置:">
- <Button v-if="
- !oneFormValidate[0].virtual_list.length
- && !oneFormValidate[0].stock
- " @click="addVirtual(0, 'oneFormValidate')">添加卡密</Button>
- <span v-else class="seeCatMy"
- @click="seeVirtual(oneFormValidate[0], 'oneFormValidate', 0)">已设置</span>
- </FormItem>
- </Col> -->
- </div>
- </Row>
- <!-- 商品详情 -->
- <Row v-show="currentTab === '3'" class="mb10">
- <Col span="16">
- <wangeditor style="width: 100%" :content="contents" @editorContent="getEditorContent"></wangeditor>
- </Col>
- <Col span="6" style="width: 33%">
- <div class="ifam">
- <div class="content" v-html="content"></div>
- </div>
- </Col>
- </Row>
- <!-- 物流设置 -->
- <Row v-show="currentTab === '4'">
- <Col v-bind="grid3">
- <FormItem label="配送方式:" prop="" required>
- <CheckboxGroup v-model="formValidate.delivery_type">
- <Checkbox label="1" v-if="merchantType!=1">快递</Checkbox>
- <Checkbox label="3">门店配送</Checkbox>
- <Checkbox label="2">到店自提</Checkbox>
- </CheckboxGroup>
- </FormItem>
- </Col>
- <Col span="24">
- <FormItem label="运费设置:">
- <RadioGroup v-model="formValidate.freight">
- <Radio :label="1">包邮</Radio>
- <Radio :label="2">固定邮费</Radio>
- <Radio :label="3">运费模板</Radio>
- </RadioGroup>
- </FormItem>
- </Col>
- <Col span="24" v-if="formValidate.freight == 2">
- <FormItem label="" prop="freight">
- <div class="acea-row row-middle">
- <InputNumber :min="0" v-model="formValidate.postage" placeholder="请输入金额"
- class="perW20 maxW" />
- <span class="ml10">元</span>
- </div>
- </FormItem>
- </Col>
- <Col span="24" v-if="formValidate.freight == 3">
- <FormItem label="" prop="">
- <div class="acea-row">
- <Select v-model="formValidate.temp_id" clearable class="perW20 maxW">
- <Option v-for="(item, index) in templateList" :value="item.id" :key="item.id">
- {{ item.name }}
- </Option>
- </Select>
- <Button @click="editTemp" class="ml15" v-if="formValidate.temp_id">查看运费模板</Button>
- <Button @click="addTemp" class="ml15" v-else>添加运费模板</Button>
- </div>
- </FormItem>
- </Col>
- </Row>
- <!-- 营销设置 -->
- <Row v-show="currentTab === '5'">
- <Col span="24">
- <FormItem label="已售数量:">
- <InputNumber v-width="'50%'" :min="0" :max="999999" v-model="formValidate.ficti"
- placeholder="请输入已售数量" />
- </FormItem>
- </Col>
- <Col span="24">
- <FormItem label="排序:">
- <InputNumber :min="0" :max="999999" v-width="'50%'" v-model="formValidate.sort"
- placeholder="请输入排序" />
- </FormItem>
- </Col>
- <Col span="24">
- <FormItem label="特价商品:">
- <i-switch v-model="formValidate.is_supreme" :true-value="1" :false-value="0" size="large">
- <span slot="open">是</span>
- <span slot="close">否</span>
- </i-switch>
- </FormItem>
- </Col>
- <Col span="24">
- <div class="lines"></div>
- </Col>
- <Col span="24" v-if="merchantType == 0">
- <FormItem label="赠送积分:" prop="give_integral">
- <InputNumber v-width="'50%'" v-model="formValidate.give_integral" :min="0" :max="999999"
- placeholder="请输入积分" />
- </FormItem>
- </Col>
- <Col v-bind="grid3" v-if="merchantType == 0">
- <FormItem label="赠送优惠券:">
- <div v-if="couponName.length" class="mb20">
- <Tag closable v-for="(item, index) in couponName" :key="index+'coupon'"
- @on-close="handleClose(item)">{{ item.title }}</Tag>
- </div>
- <Button type="primary" @click="addCoupon">添加优惠券</Button>
- </FormItem>
- </Col>
- <Col span="24" v-if="merchantType == 0">
- <FormItem label="关联用户标签:" prop="label_id" class="labelClass">
- <div class="labelInput acea-row row-between-wrapper" @click="openLabel">
- <div style="width: 90%;">
- <div v-if="dataLabel.length">
- <Tag closable v-for="(item,index) in dataLabel" :key="index+'label'"
- @on-close="closeLabel(item)">{{item.label_name}}</Tag>
- </div>
- <span class="span" v-else>选择用户关联标签</span>
- </div>
- <div class="iconfont iconxiayi"></div>
- </div>
- </FormItem>
- </Col>
- <Col span="24" >
- <FormItem label="仅会员可见:" v-if="merchantType==0">
- <i-switch v-model="formValidate.is_vip_product" :true-value="1" :false-value="0" size="large">
- <span slot="open">开启</span>
- <span slot="close">关闭</span>
- </i-switch>
- <div class="tips">开启后仅付费会员可以看见并购买此商品</div>
- </FormItem>
- </Col>
- <Col span="24" v-if="merchantType==0">
- <FormItem label="单独设置:">
- <CheckboxGroup class="checkAlls" v-model="formValidate.is_sub" @on-change="checkAllGroupChange">
- <Checkbox :label="1">佣金设置(数字即返佣金额)</Checkbox>
- <Checkbox :label="0">付费会员价</Checkbox>
- </CheckboxGroup>
- </FormItem>
- </Col>
- <Col span="24" v-if="formValidate.is_sub.length">
- <!--单规格返佣-->
- <FormItem label="商品属性:" v-if="formValidate.spec_type === 0">
- <Table :data="oneFormValidate" :columns="columnsInstall" border>
- <template slot-scope="{ row, index }" slot="pic">
- <div class="pictrue pictrueTab">
- <img v-lazy="oneFormValidate[0].pic" />
- </div>
- </template>
- <template slot-scope="{ row, index }" slot="price">{{
- oneFormValidate[0].price
- }}</template>
- <template slot-scope="{ row, index }" slot="cost">{{
- oneFormValidate[0].cost
- }}</template>
- <template slot-scope="{ row, index }" slot="ot_price">{{
- oneFormValidate[0].ot_price
- }}</template>
- <template slot-scope="{ row, index }" slot="erp_product_id">{{
- oneFormValidate[0].erp_product_id
- }}</template> <template slot-scope="{ row, index }" slot="unit">{{
- oneFormValidate[0].unit
- }}</template> <template slot-scope="{ row, index }" slot="uint_to_erp_unit">{{
- oneFormValidate[0].uint_to_erp_unit
- }}</template>
- <!-- <template slot-scope="{ row, index }" slot="stock">{{
- oneFormValidate[0].stock
- }}</template> -->
- <template slot-scope="{ row, index }" slot="bar_code">{{
- oneFormValidate[0].bar_code
- }}</template>
- <template slot-scope="{ row, index }" slot="code">{{
- oneFormValidate[0].code
- }}</template>
- <template slot-scope="{ row, index }" slot="weight">{{
- oneFormValidate[0].weight
- }}</template>
- <template slot-scope="{ row, index }" slot="volume">{{
- oneFormValidate[0].volume
- }}</template>
- <template slot-scope="{ row, index }" slot="brokerage">
- <InputNumber v-model="oneFormValidate[0].brokerage" :min="0" class="priceBox">
- </InputNumber>
- </template>
- <template slot-scope="{ row, index }" slot="brokerage_two">
- <InputNumber v-model="oneFormValidate[0].brokerage_two" :min="0" class="priceBox">
- </InputNumber>
- </template>
- <template slot-scope="{ row, index }" slot="vip_price">
- <InputNumber v-model="oneFormValidate[0].vip_price" :min="0" class="priceBox">
- </InputNumber>
- </template>
- </Table>
- </FormItem>
- <!--多规格返佣-->
- <FormItem label="批量设置:" v-if="formValidate.spec_type === 1">
- <span v-if="formValidate.is_sub.indexOf(1) > -1">
- 一级返佣:<InputNumber placeholder="请输入一级返佣" :min="0" class="columnsBox perW20"
- v-model="manyBrokerage"></InputNumber>
- 二级返佣:<InputNumber placeholder="请输入二级返佣" :min="0" class="columnsBox perW20"
- v-model="manyBrokerageTwo"></InputNumber>
- </span>
- <span v-if="formValidate.is_sub.indexOf(0) > -1">
- 会员价:<InputNumber placeholder="请输入会员价" :min="0" class="columnsBox perW20"
- v-model="manyVipPrice"></InputNumber>
- </span>
- <Button type="primary" @click="brokerageSetUp">批量设置</Button>
- </FormItem>
- <FormItem label="商品属性:" v-if="formValidate.spec_type === 1 && manyFormValidate.length">
- <Table v-if="formValidate.is_sub" :data="manyFormValidate" :columns="columnsInstal2" border>
- <template slot-scope="{ row, index }" v-for="(item,i) in attrData.length"
- :slot="'value'+(i+1)">
- <div>{{manyFormValidate[index]['value'+(i+1)]}}</div>
- </template>
- <template slot-scope="{ row, index }" slot="pic">
- <div class="pictrue pictrueTab">
- <img v-lazy="manyFormValidate[index].pic" />
- </div>
- </template>
- <template slot-scope="{ row, index }" slot="price">{{
- manyFormValidate[index].price
- }}</template>
- <template slot-scope="{ row, index }" slot="cost">{{
- manyFormValidate[index].cost
- }}</template>
- <template slot-scope="{ row, index }" slot="ot_price">{{
- manyFormValidate[index].ot_price
- }}</template>
- <template slot-scope="{ row, index }" slot="erp_product_id">{{
- manyFormValidate[index].erp_product_id
- }}</template>
- <template slot-scope="{ row, index }" slot="unit">{{
- manyFormValidate[index].unit
- }}</template>
- <template slot-scope="{ row, index }" slot="uint_to_erp_unit">{{
- manyFormValidate[index].uint_to_erp_unit
- }}</template>
- <!-- <template slot-scope="{ row, index }" slot="stock">{{
- manyFormValidate[index].stock
- }}</template> -->
- <template slot-scope="{ row, index }" slot="bar_code">{{
- manyFormValidate[index].bar_code
- }}</template>
- <template slot-scope="{ row, index }" slot="code">{{
- manyFormValidate[index].code
- }}</template>
- <template slot-scope="{ row, index }" slot="weight">{{
- manyFormValidate[index].weight
- }}</template>
- <template slot-scope="{ row, index }" slot="volume">{{
- manyFormValidate[index].volume
- }}</template>
- <template slot-scope="{ row, index }" slot="brokerage">
- <InputNumber v-model="manyFormValidate[index].brokerage" :min="0" class="priceBox">
- </InputNumber>
- </template>
- <template slot-scope="{ row, index }" slot="brokerage_two">
- <InputNumber v-model="manyFormValidate[index].brokerage_two" :min="0" class="priceBox">
- </InputNumber>
- </template>
- <template slot-scope="{ row, index }" slot="vip_price">
- <InputNumber v-model="manyFormValidate[index].vip_price" :min="0" class="priceBox">
- </InputNumber>
- </template>
- </Table>
- </FormItem>
- </Col>
- <Col span="24" v-if="merchantType==0">
- <div class="lines"></div>
- </Col>
- <Col span="24">
- <FormItem label="是否限购:">
- <i-switch v-model="formValidate.is_limit" :true-value="1" :false-value="0" size="large"
- @on-change="limitTap">
- <span slot="open">开启</span>
- <span slot="close">关闭</span>
- </i-switch>
- </FormItem>
- </Col>
- <Col span="24" v-if="formValidate.is_limit">
- <FormItem label="限购类型:">
- <RadioGroup v-model="formValidate.limit_type">
- <Radio :label="1">单次限购</Radio>
- <Radio :label="2">长期限购</Radio>
- </RadioGroup>
- <div class="tips">
- 单次限购是限制每次下单最多购买的数量,长期限购是限制一个用户总共可以购买的数量
- </div>
- </FormItem>
- </Col>
- <Col span="24" v-if="formValidate.is_limit">
- <FormItem label="限购数量:">
- <InputNumber :min="1" v-model="formValidate.limit_num" placeholder="请输入限购数量"
- class="perW20 maxW" />
- </FormItem>
- </Col>
- <Col span="24" v-if="formValidate.product_type == 0 && merchantType==0">
- <FormItem label="预售商品:">
- <i-switch v-model="formValidate.is_presale_product" :true-value="1" :false-value="0"
- size="large">
- <span slot="open">开启</span>
- <span slot="close">关闭</span>
- </i-switch>
- </FormItem>
- </Col>
- <Col span="24" v-if="formValidate.product_type == 0 && formValidate.is_presale_product">
- <FormItem label="预售活动时间:" prop="presale_time">
- <div class="acea-row row-middle">
- <DatePicker :editable="false" :options="datePickerOptions" type="datetimerange"
- format="yyyy-MM-dd HH:mm" placeholder="请选择活动时间" @on-change="onchangeTime"
- :value="formValidate.presale_time" v-model="formValidate.presale_time" v-width="'50%'">
- </DatePicker>
- </div>
- <div class="tips">
- 设置活动开启结束时间,用户可以在设置时间内发起参与预售
- </div>
- </FormItem>
- </Col>
- <Col span="24" v-if="formValidate.product_type == 0 && formValidate.is_presale_product">
- <FormItem label="发货时间:" prop="presale_day">
- <div class="acea-row row-middle">
- <span class="mr10">预售活动结束后</span>
- <InputNumber placeholder="请输入发货时间" :precision="0" :min="1" style="width: 100px;"
- v-model="formValidate.presale_day" />
- <span class="ml10">天之内</span>
- </div>
- </FormItem>
- </Col>
- <Col span="24" v-if="merchantType==0">
- <FormItem label="优品推荐:">
- <i-switch v-model="formValidate.is_good" :true-value="1" :false-value="0" size="large">
- <span slot="open">开启</span>
- <span slot="close">关闭</span>
- </i-switch>
- </FormItem>
- <!-- <FormItem label="优品推荐:">
- <CheckboxGroup
- v-model="formValidate.recommend"
- class="checkAlls"
- >
- <Checkbox label="is_hot">热卖单品</Checkbox>
- <Checkbox label="is_benefit">促销单品</Checkbox>
- <Checkbox label="is_best">精品推荐</Checkbox>
- <Checkbox label="is_new">首发新品</Checkbox>
- <Checkbox label="is_good">优品推荐</Checkbox>
- </CheckboxGroup>
- </FormItem> -->
- </Col>
- <Col v-bind="grid3" v-if="merchantType==0">
- <FormItem label="活动优先级:">
- <div class="color-list acea-row row-middle">
- <div class="color-item acea-row row-center-wrapper" :class="activity[color]"
- v-for="(color,index) in formValidate.activity" v-dragging="{
- item: color,
- list: formValidate.activity,
- group: 'color',
- }" :key="color">
- <div class="num">{{index+1}}</div>
- <div> {{ color }}</div>
- </div>
- <div class="tips">可拖动按钮调整活动的优先展示顺序</div>
- </div>
- </FormItem>
- </Col>
- <Col span="24" v-if="merchantType==0">
- <FormItem label="选择优品推荐商品:">
- <div class="acea-row">
- <div class="pictrue" v-for="(item, index) in goodsData" :key="index+'goods'">
- <img v-lazy="item.image" />
- <Button shape="circle" icon="md-close" @click.native="bindDelete(index)"
- class="btndel"></Button>
- </div>
- <div v-if="goodsData.length < 12" class="upLoad acea-row row-center-wrapper"
- @click="goodsTap">
- <Icon type="ios-camera-outline" size="26" />
- </div>
- </div>
- </FormItem>
- </Col>
- </Row>
- <!-- 其他设置-->
- <Row v-show="currentTab === '6'">
- <Col span="24">
- <FormItem label="商品关键字:" prop="">
- <Input v-model="formValidate.keyword" placeholder="请输入商品关键字" v-width="'50%'" />
- <div class="tips">通过命中关键字搜索对应商品,方便用户查找</div>
- </FormItem>
- </Col>
- <Col span="24">
- <FormItem label="商品简介:" prop="">
- <Input v-model="formValidate.store_info" type="textarea" :rows="3" placeholder="请输入商品简介"
- v-width="'50%'" />
- <div class="tips">微信分享商品时,分享的卡片上会显示商品简介
- <Poptip placement="bottom" trigger="hover" width="256" transfer padding="8px">
- <a>查看示例</a>
- <div class="exampleImg" slot="content">
- <img :src="`${baseURL}/statics/system/productDesc.png`" alt="" />
- </div>
- </Poptip>
- </div>
- </FormItem>
- </Col>
- <Col span="24">
- <FormItem label="商品口令:">
- <Input v-model="formValidate.command_word" type="textarea" :rows="3" placeholder="请输入商品口令"
- v-width="'50%'" />
- <div class="tips">可将淘宝、抖音等平台的口令复制在此处,用户点击商城商品详情后会自动复制口令,随后打开淘宝等平台会自动弹出口令弹窗
- <Poptip placement="bottom" trigger="hover" width="256" transfer padding="8px">
- <a>查看示例</a>
- <div class="exampleImg" slot="content">
- <div style="margin-bottom: 10px;font-size: 12px;line-height: 18px;color: #666666;">
- 商品口令需在淘宝、天猫、京东、苏<br>宁、1688上有同款商品,复制口令后<br>可在相关应用中打开(下图为淘宝展示)</div>
- <img :src="`${baseURL}/statics/system/productCommandWord.png`" alt="" />
- </div>
- </Poptip>
- </div>
- </FormItem>
- </Col>
- <Col span="24">
- <FormItem label="商品推荐图:">
- <div class="acea-row">
- <div v-if="formValidate.recommend_image" class="pictrue">
- <img v-lazy="formValidate.recommend_image" />
- <Button shape="circle" icon="md-close" @click.native="formValidate.recommend_image = ''"
- class="btndel"></Button>
- </div>
- <div v-else class="upLoad acea-row row-center-wrapper"
- @click="modalPicTap('dan', 'recommend_image')">
- <Icon type="ios-camera-outline" size="26" />
- </div>
- <Input v-model="formValidate.recommend_image" class="input-display"></Input>
- </div>
- <div class="tips">在特殊的商品分类样式中显示(建议图片比例5:2)
- <Poptip placement="bottom" trigger="hover" width="256" transfer padding="8px">
- <a>查看示例</a>
- <div class="exampleImg" slot="content">
- <img :src="`${baseURL}/statics/system/productRecommendImage.png`" alt="" />
- </div>
- </Poptip>
- </div>
- </FormItem>
- </Col>
- <Col span="24">
- <FormItem label="服务保障:">
- <CheckboxGroup v-model="formValidate.ensure_id" class="checkAlls">
- <Checkbox :label="item.id" v-for="(item,index) in ensureData" :key="item.id">{{item.name}}
- </Checkbox>
- </CheckboxGroup>
- <div class="tips">
- <Poptip placement="bottom" trigger="hover" width="256" transfer padding="8px">
- <a>查看示例</a>
- <div class="exampleImg" slot="content">
- <img :src="`${baseURL}/statics/system/productEnsure.png`" alt="" />
- </div>
- </Poptip>
- </div>
- </FormItem>
- </Col>
- <Col span="24">
- <FormItem label="商品参数:" prop="">
- <Select v-model="formValidate.specs_id" clearable filterable v-width="'50%'"
- placeholder="请输入商品参数" @on-change="specsInfo">
- <Option v-for="(item, index) in specsData" :value="item.id" :key="item.id">{{ item.name }}
- </Option>
- </Select>
- </FormItem>
- </Col>
- <Col span="24" v-if="formValidate.specs_id">
- <FormItem label="" props="">
- <Table border :columns="specsColumns" :data="specsList" ref="table" class="specsList"
- width="700">
- <template slot-scope="{ row, index }" slot="action">
- <a @click="delSpecs(index)" v-if="index>0">删除</a>
- </template>
- </Table>
- <Button class="mt20" @click="addSpecs">添加参数</Button>
- </FormItem>
- </Col>
- <Col span="24" v-if="formValidate.product_type">
- <FormItem label="支持退款:" props="status" label-for="status">
- <i-switch v-model="formValidate.is_support_refund" :true-value="1" :false-value="0"
- size="large">
- <span slot="open">开启</span>
- <span slot="close">关闭</span>
- </i-switch>
- </FormItem>
- </Col>
- <Col span="24">
- <FormItem label="自定义留言:">
- <i-switch v-model="customBtn" @on-change="customMessBtn" size="large">
- <span slot="open">开启</span>
- <span slot="close">关闭</span>
- </i-switch>
- <div class="mt10" v-if="customBtn">
- <Select v-model="formValidate.system_form_id" filterable v-width="'50%'" placeholder="请选择"
- @on-change="changeForm">
- <Option v-for="(item, index) in formList" :value="item.id" :key="item.id">
- {{ item.name }}
- </Option>
- </Select>
- </div>
- </FormItem>
- </Col>
- <Col span="24" v-if="customBtn && formValidate.system_form_id">
- <FormItem label="" props="">
- <Table border :columns="formColumns" :data="formTypeList" ref="table" class="specsList on">
- <template slot-scope="{ row }" slot="require">
- <span>{{row.require?'必填':'不必填'}}</span>
- </template>
- </Table>
- </FormItem>
- </Col>
- <!-- <Col span="24">-->
- <!-- <FormItem label="自定义留言:">-->
- <!-- <i-switch-->
- <!-- v-model="customBtn"-->
- <!-- @on-change="customMessBtn"-->
- <!-- size="large"-->
- <!-- >-->
- <!-- <span slot="open">开启</span>-->
- <!-- <span slot="close">关闭</span>-->
- <!-- </i-switch>-->
- <!-- <div class="addCustom_content" v-if="customBtn">-->
- <!-- <div-->
- <!-- v-for="(item, index) in formValidate.custom_form"-->
- <!-- type="flex"-->
- <!-- :key="index+'custom'"-->
- <!-- class="custom_box"-->
- <!-- >-->
- <!-- <Input-->
- <!-- v-model.trim="item.title"-->
- <!-- :placeholder="'留言标题' + (index + 1)"-->
- <!-- class="custom-input"-->
- <!-- />-->
- <!-- <Select-->
- <!-- v-model="item.label"-->
- <!-- class="select-add"-->
- <!-- >-->
- <!-- <Option-->
- <!-- v-for="items in customList"-->
- <!-- :value="items.value"-->
- <!-- :key="items.value"-->
- <!-- >{{ items.label }}</Option-->
- <!-- >-->
- <!-- </Select>-->
- <!-- <Checkbox v-model="item.status" :true-value="1" :false-value="0">必填</Checkbox>-->
- <!-- <div class="addfont" @click="delcustom(index)">删除</div>-->
- <!-- </div>-->
- <!-- </div>-->
- <!-- <div class="addCustomBox" v-show="customBtn">-->
- <!-- <div class="btn" @click="addcustom">+ 添加表单</div>-->
- <!-- <div class="tips">用户下单时需填写的信息,最多可设置10条</div>-->
- <!-- </div>-->
- <!-- </FormItem>-->
- <!-- </Col>-->
- </Row>
- <Row v-show="currentTab === '7' && merchantType==0">
- <Col span="24" class="ml10">
- <RadioGroup v-model="formValidate.applicable_type" class="radioGroup">
- <Radio :label="1">全部门店</Radio>
- <Radio :label="2">部分门店</Radio>
- <Radio :label="0">仅平台适用</Radio>
- </RadioGroup>
- <div class="tips">可选择将商品同步到哪些门店使用,选择“仅平台适用“则商品不同步任何门店</div>
- </Col>
- <Col span="24" class="mt20 ml10" v-if="formValidate.applicable_type == 2">
- <Button type="primary" @click="addStore">添加门店</Button>
- </Col>
- <Col span="24" class="ml10">
- <div class="storeTable" v-if="formValidate.applicable_type == 2">
- <Table :columns="storeColumns" :data="storesList" ref="table" class="ivu-mt" highlight-row
- no-userFrom-text="暂无数据" no-filtered-userFrom-text="暂无筛选结果">
- <template slot-scope="{ row }" slot="image">
- <img :src="row.image" />
- </template>
- <template slot-scope="{ row, index }" slot="action">
- <a @click="delte(index)">删除</a>
- </template>
- </Table>
- </div>
- </Col>
- </Row>
- <Spin size="large" fix v-if="spinShow"></Spin>
- </Form>
- <Modal v-model="modalPic" width="960px" scrollable footer-hide closable title="上传商品图" :mask-closable="false"
- :z-index="1">
- <uploadPictures :isChoice="isChoice" @getPic="getPic" @getPicD="getPicD" :gridBtn="gridBtn"
- :gridPic="gridPic" v-if="modalPic"></uploadPictures>
- </Modal>
- </Card>
- <Card :bordered="false" dis-hover class="fixed-card"
- :style="{left: `${!menuCollapse?'200px':isMobile?'0':'80px'}`}">
- <Form>
- <FormItem>
- <Button v-if="currentTab !== '1'" @click="upTab">上一步</Button>
- <Button type="primary" class="submission"
- v-if="(formValidate.product_type && formValidate.product_type !=4 && currentTab !== '6') || (formValidate.product_type == 4 && currentTab !== '7') || (!formValidate.product_type && currentTab !== '7')"
- @click="downTab('formValidate')">下一步</Button>
- <Button type="primary" :disabled="openSubimit" class="submission"
- @click="handleSubmit('formValidate')"
- 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>
- </FormItem>
- </Form>
- </Card>
- <freightTemplate :template="template" :merchantType="merchantType" v-on:changeTemplate="changeTemplate"
- ref="templates"></freightTemplate>
- <add-attr ref="addattr" @getList="userSearchs"></add-attr>
- <coupon-list ref="couponTemplates" @nameId="nameId" :couponids="formValidate.coupon_ids" :updateIds="updateIds"
- :updateName="updateName"></coupon-list>
- <!-- 生成淘宝京东表单-->
- <Modal v-model="modals" @on-cancel="cancel" class="Box" class-name="vertical-center-modal" scrollable
- footer-hide closable title="复制淘宝、天猫、京东、苏宁、1688" :mask-closable="false" width="800" height="500">
- <tao-bao ref="taobaos" v-if="modals" @on-close="onClose"></tao-bao>
- </Modal>
- <!-- 商品列表 -->
- <Modal v-model="goodsModals" title="商品列表" footerHide scrollable width="900" @on-cancel="goodCancel">
- <goods-list v-if="goodsModals" ref="goodslist" @getProductId="getProductId" :ischeckbox="true"></goods-list>
- </Modal>
- <!-- 用户标签 -->
- <Modal v-model="labelShow" scrollable title="选择用户标签" :closable="true" width="540" :footer-hide="true"
- :mask-closable="false">
- <userLabel ref="userLabel" @activeData="activeData" @close="labelClose"></userLabel>
- </Modal>
- <!-- 商品标签 -->
- <Modal v-model="storeLabelShow" scrollable title="选择商品标签" :closable="true" width="540" :footer-hide="true"
- :mask-closable="false">
- <storeLabelList ref="storeLabel" @activeData="activeStoreData" @close="storeLabelClose"></storeLabelList>
- </Modal>
- <menus-from :formValidate="formBrand" :fromName='1' ref="menusFrom"></menus-from>
- <Modal v-model="attrShow" scrollable title="请选择商品规格" :closable="false" width="320" :footer-hide="true"
- :mask-closable="false">
- <attr-list :attrs="attrsList" @activeData="activeAttr" @close="labelAttr" @subAttrs="subAttrs"
- v-if="attrShow"></attr-list>
- </Modal>
- <Modal v-model="carMyShow" scrollable title="添加卡密" closable width="700" :footer-hide="true"
- :mask-closable="false">
- <add-carMy ref="addCarMy" :virtualList="virtualList" @changeVirtual="changeVirtual" @fixdBtn="fixdBtn"
- @closeCarMy="closeCarMy"></add-carMy>
- </Modal>
- <Modal v-model="storeModals" title="门店列表" footerHide scrollable width="900" @on-cancel="cancelStore">
- <store-list ref="storelist" @getStoreId="getStoreId" v-if="storeModals"></store-list>
- </Modal>
- </div>
- </template>
- <script>
- // import COS from 'cos-js-sdk-v5'
- import {
- mapState,
- mapMutations
- } from "vuex";
- import Setting from "@/setting";
- import util from "@/libs/util";
- import vuedraggable from "vuedraggable";
- import uploadPictures from "@/components/uploadPictures";
- import freightTemplate from "@/components/freightTemplate";
- import wangeditor from "@/components/wangEditor/index.vue";
- import storeList from "@/components/storeList";
- import menusFrom from "../productBrand/components/menusFrom";
- import userLabel from "@/components/labelList";
- import storeLabelList from "@/components/storeLabelList";
- import couponList from "@/components/couponList";
- import goodsList from '@/components/goodsList/index';
- import addAttr from "../productAttr/addAttr";
- import attrList from "../components/attrList";
- import addCarMy from "../components/addCarMy";
- import taoBao from './taoBao'
- import {
- productInfoApi,
- cascaderListApi,
- productAddApi,
- generateAttrApi,
- productGetRuleApi,
- productGetTemplateApi,
- productGetTempKeysApi,
- checkActivityApi,
- labelListApi,
- productCache,
- cacheDelete,
- brandList,
- productCreateApi,
- productAllUnit,
- productUnitCreate,
- uploadType,
- productAllEnsure,
- productLabelAdd,
- productAllSpecs,
- allSystemForm
- } from "@/api/product";
- import {
- erpGoods
- } from '@/api/erp'
- import {
- systemFormInfo
- } from '@/api/setting'
- import {
- getSupplierList
- } from '@/api/supplier'
- import {
- erpConfig
- } from "@/api/erp";
- import {
- uploadByPieces
- } from "@/utils/upload"; //引入uploadByPieces方法
- export default {
- name: "product_productAdd",
- components: {
- storeList,
- uploadPictures,
- freightTemplate,
- goodsList,
- addAttr,
- couponList,
- taoBao,
- userLabel,
- menusFrom,
- attrList,
- addCarMy,
- storeLabelList,
- wangeditor,
- draggable: vuedraggable,
- },
- data() {
- return {
- formTypeList: [],
- formColumns: [{
- title: '表单标题',
- key: 'title',
- // align:'center',
- minWidth: 100
- },
- {
- title: '表单类型',
- key: 'name',
- // align:'center',
- minWidth: 100
- },
- {
- title: '是否必填',
- slot: 'require',
- // align:'center',
- minWidth: 100
- }
- ],
- storesList: [],
- tableData: [],
- storeModals: false,
- roterPre: Setting.roterPre,
- specsList: [],
- supplierList: [],
- specsColumns: [{
- title: '参数名称',
- key: 'name',
- align: 'center',
- width: 150,
- render: (h, params) => {
- return h("div", [
- h("Input", {
- props: {
- value: params.row.name,
- placeholder: '请输入参数名称'
- },
- on: {
- "on-change": (e) => {
- params.row.name = e.target.value;
- this.specsList[params.index].name = e.target.value;
- },
- },
- }),
- ]);
- }
- },
- {
- title: '参数值',
- key: 'value',
- align: 'center',
- width: 300,
- render: (h, params) => {
- return h("div", [
- h("Input", {
- props: {
- value: params.row.value,
- placeholder: '请输入参数值'
- },
- on: {
- "on-change": (e) => {
- params.row.value = e.target.value;
- this.specsList[params.index].value = e.target.value;
- },
- },
- }),
- ]);
- }
- },
- {
- title: '排序',
- key: 'sort',
- align: 'center',
- width: 100,
- render: (h, params) => {
- return h("div", [
- h("InputNumber", {
- props: {
- value: parseInt(params.row.sort) || 0,
- placeholder: '排序',
- precision: 0
- },
- on: {
- "on-change": (e) => {
- params.row.sort = e;
- this.specsList[params.index].sort = e;
- },
- },
- }),
- ]);
- }
- },
- {
- title: '操作',
- slot: 'action',
- align: 'center',
- minWidth: 120
- }
- ],
- //自定义留言下拉选择
- customList: [{
- value: "text",
- label: "文本框",
- },
- {
- value: "number",
- label: "数字",
- },
- {
- value: "email",
- label: "邮件",
- },
- {
- value: "data",
- label: "日期",
- },
- {
- value: "time",
- label: "时间",
- },
- {
- value: "id",
- label: "身份证",
- },
- {
- value: "phone",
- label: "手机号",
- },
- {
- value: "img",
- label: "图片",
- },
- ],
- headTab: [{
- title: "基础信息",
- name: "1"
- },
- {
- title: "规格库存",
- name: "2"
- },
- {
- title: "商品详情",
- name: "3"
- },
- {
- title: "物流设置",
- name: "4"
- },
- {
- title: "营销设置",
- name: "5"
- },
- {
- title: "其他设置",
- name: "6"
- },
- {
- title: "适用门店",
- name: "7"
- },
- ],
- productType: [{
- name: "普通商品",
- title: "物流发货",
- id: 0
- },
- {
- name: "卡密/网盘",
- title: "自动发货",
- id: 1
- },
- {
- name: "虚拟商品",
- title: "虚拟发货",
- id: 3
- },
- {
- name: "次卡商品",
- title: "到店核销",
- id: 4
- },
- ],
- virtualList: [],
- carMyShow: false, //是否开启卡密弹窗
- recommend: [], //商品推荐
- customBtn: false, //自定义留言开关
- attrShow: false,
- content: "",
- contents: "",
- seletVideo: 0,
- fileUrl: Setting.apiBaseURL + "/file/upload",
- fileUrl2: Setting.apiBaseURL + "/file/video_upload",
- baseURL: Setting.apiBaseURL.replace(/adminapi/, ''),
- upload_type: "", //视频上传类型 1 本地上传 2 3 4 OSS上传
- uploadData: {}, // 上传参数
- header: {},
- dataLabel: [],
- storeDataLabel: [],
- labelShow: false,
- storeLabelShow: false,
- props: {
- emitPath: false,
- multiple: true,
- checkStrictly: true
- },
- type: 0,
- goodsModals: false,
- off_show: 0,
- modals: false,
- spinShow: false,
- openSubimit: false,
- grid2: {
- xl: 10,
- lg: 12,
- md: 12,
- sm: 24,
- xs: 24,
- },
- grid3: {
- xl: 18,
- lg: 18,
- md: 20,
- sm: 24,
- xs: 24,
- },
- // 批量设置表格data
- oneFormBatch: [{
- attr: "全部",
- pic: "",
- price: 0,
- settle_price: 0,
- cost: 0,
- ot_price: 0,
- erp_product_id: 0,
- unit: 0,
- uint_to_erp_unit: 0,
- // stock: 0,
- bar_code: "",
- code: "",
- weight: 0,
- volume: 0,
- }, ],
- // 规格数据
- formDynamic: {
- attrsName: "",
- attrsVal: "",
- },
- formDynamicNameData: [],
- isBtn: false,
- columnsCarMy: [],
- columns2: [{
- title: "商品规格",
- slot: "attr",
- align: "center",
- minWidth: 80,
- },
- {
- title: "图片",
- slot: "pic",
- align: "center",
- minWidth: 80,
- },
- {
- title: "售价",
- slot: "price",
- align: "center",
- minWidth: 95,
- },
- {
- title: "成本价",
- slot: "cost",
- align: "center",
- minWidth: 95,
- },
- {
- title: "原价",
- slot: "ot_price",
- align: "center",
- minWidth: 95,
- },
- {
- title: "仓库商品",
- slot: "erp_product_id",
- align: "center",
- minWidth: 95,
- },
- {
- title: "规格单位",
- slot: "unit",
- align: "center",
- minWidth: 95,
- },
- {
- title: "转换率",
- slot: "uint_to_erp_unit",
- align: "center",
- minWidth: 95,
- },
- // {
- // title: "库存",
- // slot: "stock",
- // align: "center",
- // minWidth: 95,
- // },
- {
- title: "商品条形码",
- slot: "bar_code",
- align: "center",
- minWidth: 120,
- },
- {
- title: "商品编号",
- slot: "code",
- align: "center",
- minWidth: 120,
- },
- {
- title: "重量(KG)",
- slot: "weight",
- align: "center",
- minWidth: 95,
- },
- {
- title: "体积(m³)",
- slot: "volume",
- align: "center",
- minWidth: 95,
- },
- {
- title: "操作",
- slot: "action",
- // fixed: "right",
- align: "center",
- minWidth: 140,
- },
- ],
- columns: [],
- columnsInstall: [],
- columnsInstal2: [],
- gridPic: {
- xl: 6,
- lg: 8,
- md: 12,
- sm: 12,
- xs: 12,
- },
- gridBtn: {
- xl: 4,
- lg: 8,
- md: 8,
- sm: 8,
- xs: 8,
- },
- formValidate: {
- is_weigh: 0,
- applicable_store_id: [],
- system_form_id: 0, //自定义表单id
- // supplier_id:0,//供应商
- is_presale_product: 0, //预售商品开关
- is_limit: 0, //是否限购开关
- limit_type: 1, //1单次限购,2长期限购
- limit_num: 1, //限购数量
- is_vip_product: 0, //付费会员专属开关
- is_support_refund: 0,
- disk_info: "", //卡密简介
- presale_day: 1, //预售发货时间-结束
- presale_time: [],
- auto_on_time: '',
- video_open: false, //视频按钮是否显示
- store_name: "",
- freight: 1, //运费设置
- postage: 0, //设置运费金额
- custom_form: [], //自定义留言
- cate_id: [],
- label_id: [],
- ensure_id: [],
- keyword: "",
- applicable_type: 1,
- unit_name: "",
- specs_id: 0,
- store_info: "",
- bar_code: "",
- code: "",
- image: "",
- recommend_image: "",
- slider_image: [],
- description: "",
- ficti: 0,
- give_integral: 0,
- sort: 0,
- is_supreme: false,
- is_show: 1,
- is_hot: 0,
- is_benefit: 0,
- is_best: 0,
- is_new: 0,
- is_good: 0,
- is_postage: 0,
- is_sub: [],
- id: 0,
- spec_type: 0,
- video_link: "",
- temp_id: "",
- attrs: [],
- items: [{
- pic: "",
- price: 0,
- cost: 0,
- ot_price: 0,
- erp_product_id: 0,
- unit: '',
- uint_to_erp_unit: 0,
- // stock: 0,
- bar_code: "",
- code: "",
- }, ],
- activity: ["默认", "秒杀", "砍价", "拼团"],
- couponName: [],
- header: [],
- selectRule: "",
- coupon_ids: [],
- command_word: "",
- delivery_type: ['1'],
- specs: [],
- recommend_list: [],
- brand_id: [],
- product_type: 0
- },
- ruleList: [],
- templateList: [],
- createBnt: false,
- showIput: false,
- manyFormValidate: [],
- // 单规格表格data
- oneFormValidate: [{
- pic: "",
- price: 0,
- settle_price: 0,
- cost: 0,
- ot_price: 0,
- erp_product_id: 0,
- unit: '',
- uint_to_erp_unit: 0,
- // stock: 0,
- bar_code: "",
- code: "",
- weight: 0,
- volume: 0,
- brokerage: 0,
- brokerage_two: 0,
- vip_price: 0,
- virtual_list: [],
- write_times: 0, //核销次数
- write_valid: 1, //核销时效
- days: 1
- }, ],
- images: [],
- imagesTable: "",
- currentTab: "1",
- isChoice: "",
- grid: {
- xl: 8,
- lg: 8,
- md: 12,
- sm: 24,
- xs: 24,
- },
- loading: false,
- modalPic: false,
- template: false,
- uploadList: [],
- treeSelect: [],
- labelSelect: [],
- ensureData: [],
- specsData: [],
- picTit: "",
- tableIndex: 0,
- ruleValidate: {
- store_name: [{
- required: true,
- message: "请输入商品名称",
- trigger: "blur"
- }, ],
- cate_id: [{
- required: true,
- message: "请选择商品分类",
- trigger: "change",
- type: "array"
- }, ],
- keyword: [{
- required: true,
- message: "请输入商品关键字",
- trigger: "blur"
- }, ],
- unit_name: [{
- required: true,
- message: "请输入单位",
- trigger: "change",
- }, ],
- store_info: [{
- required: true,
- message: "请输入商品简介",
- trigger: "blur"
- }, ],
- //image: [{ required: true, message: "请上传商品图", trigger: "change" }],
- slider_image: [{
- required: true,
- message: "请上传商品轮播图",
- type: "array",
- trigger: "change",
- }, ],
- spec_type: [{
- required: true,
- message: "请选择商品规格",
- trigger: "change"
- }, ],
- selectRule: [{
- required: true,
- message: "请选择商品规格属性",
- trigger: "change"
- }, ],
- give_integral: [{
- type: "integer",
- message: "请输入整数"
- }],
- // delivery_type:[
- // { required: true, type: 'array', min: 1, message: '请选择配送方式', trigger: 'change' },
- // ]
- },
- manyBrokerage: 0,
- manyBrokerageTwo: 0,
- manyVipPrice: 0,
- upload: {
- videoIng: false, // 是否显示进度条;
- },
- videoIng: false, // 是否显示进度条;
- progress: 0, // 进度条默认0
- videoLink: "",
- attrs: [],
- activity: {
- 默认: "colorBlue",
- 秒杀: "colorBlue",
- 砍价: "colorBlue",
- 拼团: "colorBlue"
- },
- couponName: [],
- updateIds: [],
- updateName: [],
- rakeBack: [{
- title: "一级返佣",
- slot: "brokerage",
- align: "center",
- width: 95,
- },
- {
- title: "二级返佣",
- slot: "brokerage_two",
- align: "center",
- width: 95,
- },
- ],
- member: [{
- title: "会员价",
- slot: "vip_price",
- align: "center",
- width: 95,
- }, ],
- headerCarMy: {
- title: "卡密设置",
- slot: "fictitious",
- align: "center",
- width: 95,
- },
- columnsInstalM: [],
- moveIndex: "",
- goodsData: [],
- brandData: [],
- unitNameList: [],
- formBrand: {},
- attrsList: [],
- activeAtter: [],
- tabIndex: 0,
- tabName: "",
- attrData: [],
- datePickerOptions: {
- disabledDate(date) {
- return date && date.valueOf() < Date.now() - 86400000;
- }
- },
- openErp: false,
- merchantType: 0, //0:平台商品;1:门店商品;2:供应商商品
- formList: [],
- storeColumns: [{
- title: "ID",
- key: "id",
- width: 60,
- },
- {
- title: "门店图片",
- slot: "image",
- minWidth: 80,
- },
- {
- title: "门店分类",
- key: "cate_name",
- minWidth: 80,
- },
- {
- title: "门店名称",
- key: "name",
- minWidth: 80,
- },
- {
- title: "联系电话",
- key: "phone",
- minWidth: 90,
- },
- {
- title: "门店地址",
- key: "address",
- ellipsis: true,
- minWidth: 150,
- },
- {
- title: "营业时间",
- key: "day_time",
- minWidth: 120,
- },
- {
- title: "营业状态",
- key: "status_name",
- minWidth: 80,
- },
- {
- title: "操作",
- slot: "action",
- width: 100,
- }
- ],
- // 仓库查询商品列表
- warehouseList: [],
- // 是否载入中
- warehouseListLoding: false
- };
- },
- computed: {
- ...mapState("admin/layout", ["isMobile", "menuCollapse"]),
- labelWidth() {
- return this.isMobile ? undefined : 120;
- },
- labelPosition() {
- return this.isMobile ? "top" : "right";
- },
- labelBottom() {
- return this.isMobile ? undefined : 15;
- },
- startPickOptions() {
- const that = this;
- return {
- disabledDate(time) {
- if (that.formValidate.auto_off_time) {
- return (
- time.getTime() > new Date(that.formValidate.auto_off_time).getTime()
- )
- }
- return ''
- }
- }
- },
- endPickOptions() {
- const that = this;
- return {
- disabledDate(time) {
- if (that.formValidate.is_show == '1') {
- return time.getTime() < Date.now();
- }
- if (that.formValidate.auto_on_time) {
- return (
- time.getTime() < new Date(that.formValidate.auto_on_time).getTime()
- )
- }
- return ''
- }
- }
- }
- },
- created() {
- this.getSupplierList();
- this.columns = this.columns2.slice(1, 10);
- let data = JSON.parse(JSON.stringify(this.columns2));
- data.splice(8, 2, this.headerCarMy);
- this.columnsCarMy = data;
- let fictitious = JSON.parse(JSON.stringify(this.columns2));
- fictitious.splice(8, 2);
- this.columnsFictitious = fictitious;
- this.getToken();
- this.getErpConfig();
- // this.columnsInstall = this.columns2.slice(0, 4).concat(this.columnsInstall);
- // this.columnsInsta8 = this.columns2.slice(0, 4).concat(this.columnsInsta8);
- },
- mounted() {
- this.setCopyrightShow({
- value: false
- });
- if ((this.$route.params.id !== "0" && this.$route.params.id) || this.$route.query.copy) {
- this.getInfo();
- } else if (this.$route.params.id === "0") {
- productCache()
- .then((res) => {
- let data = res.data.info;
- if (!Array.isArray(data)) {
- let cate_id = data.cate_id.map(Number);
- let label_id = data.label_id.map(Number);
- this.attrs = data.items || [];
- let ids = [];
- // let names = [];
- if (data.coupons) {
- data.coupons.map((item) => {
- ids.push(item.id);
- // names.push(item.title);
- });
- this.couponName = data.coupons;
- }
- this.storesList = data.stores || [];
- let brandIds = [];
- data.brand_id.forEach(item => {
- brandIds.push(item.toString())
- })
- this.formValidate = data;
- this.formTypeList = data.custom_form_info || [];
- // this.couponName = data.coupons;
- // that.couponName = names;
- this.formValidate.brand_id = brandIds;
- this.formValidate.coupon_ids = ids;
- this.formValidate.is_limit = this.formValidate.is_limit ? 1 : 0;
- this.formValidate.limit_type = parseInt(this.formValidate.limit_type);
- this.formValidate.is_support_refund = parseInt(this.formValidate.is_support_refund);
- this.updateIds = ids;
- this.updateName = data.coupons;
- this.formValidate.cate_id = cate_id;
- this.dataLabel = data.label_id;
- this.storeDataLabel = data.store_label_id;
- this.specsList = data.specs;
- this.oneFormValidate = data.attrs;
- console.log(data.attrs,'data.attrs')
- this.formValidate.header = [];
- this.generate(0);
- this.addmanyData(data.attrs);
- this.productTypeTap(2);
- this.columns = this.columns2.slice(1, 10);
- //this.manyFormValidate = data.attrs;
- this.formValidate.system_form_id = data.system_form_id || 0;
- if (this.formValidate.system_form_id) {
- this.customBtn = true;
- }
- this.spec_type = data.spec_type;
- if (data.spec_type === 0) {
- this.manyFormValidate = [];
- } else {
- this.createBnt = true;
- this.oneFormValidate = [{
- pic: data.slider_image[0],
- price: 0,
- settle_price: 0,
- cost: 0,
- ot_price: 0,
- erp_product_id: 0,
- unit: '',
- uint_to_erp_unit: 0,
- // stock: 0,
- bar_code: "",
- code: "",
- weight: 0,
- volume: 0,
- brokerage: 0,
- brokerage_two: 0,
- vip_price: 0,
- virtual_list: [],
- write_times: 0, //核销次数
- write_valid: 1, //核销时效
- days: 1
- }, ];
- }
- this.spinShow = false;
- }
- })
- .catch((err) => {
- this.$Message.error(err.msg);
- });
- }
- if (this.$route.query.type) {
- this.modals = true;
- this.type = this.$route.query.type;
- } else {
- this.type = 0;
- }
- this.goodsCategory();
- this.productGetRule();
- this.productGetTemplate();
- this.getBrandList();
- this.getAllUnit();
- this.uploadType();
- this.getProductAllEnsure();
- this.getProductAllSpecs();
- this.allFormList();
- },
- destroyed() {
- this.setCopyrightShow({
- value: true
- });
- },
- methods: {
- ...mapMutations('admin/layout', [
- 'setCopyrightShow'
- ]),
- changeErpProductId(e) {
- erpGoods({
- id:e
- }).then(res => {
- // this.for
- this.formValidate.is_weigh = res.data.data[0].is_weigh;
- console.log(this.formValidate.is_weigh,'this.formValidate.is_weigh');
- })
- },
- containsChinese(str) {
- return /[\u4e00-\u9fa5]/.test(str);
- },
- // 查询仓库商品
- queryWarehouseList(query) {
- console.log(query,'query')
- const that = this;
-
- if (query !== '') {
- query = query.trim()
- that.warehouseListLoding = true;
- let qdata = {
- page: 1,
- limit: 100,
- }
- if(this.containsChinese(query)) {
- qdata.key = query
- }else {
- qdata.id = query
- }
- erpGoods(qdata).then(res => {
- that.warehouseListLoding = false;
- that.warehouseList = res.data.data;
- }).catch(err => {
- that.warehouseListLoding = false;
- that.$Message.error(err.msg);
- })
- } else {
- this.warehouseList = [];
- }
- },
- changeForm(e) {
- this.getSystemFormInfo(e, {
- type: 1
- });
- },
- getSystemFormInfo(e, data) {
- systemFormInfo(e, data).then(res => {
- this.formTypeList = res.data.info;
- }).catch(err => {
- this.$Message.error(err.msg);
- })
- },
- //删除门店
- delte(index) {
- this.storesList.splice(index, 1)
- },
- //添加门店
- addStore() {
- this.storeModals = true;
- },
- //关闭门店弹窗
- cancelStore() {
- this.storeModals = false;
- },
- allFormList() {
- allSystemForm().then(res => {
- this.formList = res.data;
- }).catch(err => {
- this.$Message.error(err.msg);
- })
- },
- limitTap(e) {
- if (e) {
- this.formValidate.limit_type = (this.formValidate.is_limit && !this.formValidate.limit_type) ? 1 : 0
- this.formValidate.limit_num = (this.formValidate.is_limit && this.formValidate.limit_num == 0) ? 1 : 0
- } else {
- this.formValidate.limit_type = 0;
- this.formValidate.limit_num = 0;
- }
- },
- //erp配置
- getErpConfig() {
- erpConfig().then(res => {
- this.openErp = res.data.open_erp;
- }).catch(err => {
- this.$Message.error(err.msg);
- })
- },
- delSpecs(index) {
- this.specsList.splice(index, 1);
- },
- addSpecs() {
- let obj = {
- 'name': '',
- 'value': '',
- 'sort': 0
- }
- this.specsList.push(obj)
- },
- specsInfo(e) {
- this.specsData.forEach(item => {
- if (item.id == e) {
- this.specsList = item.specs
- }
- })
- },
- getProductAllSpecs() {
- productAllSpecs().then(res => {
- this.specsData = res.data
- }).catch(err => {
- this.$Message.error(err.msg);
- })
- },
- getProductAllEnsure() {
- productAllEnsure().then(res => {
- this.ensureData = res.data
- }).catch(err => {
- this.$Message.error(err.msg);
- })
- },
- //添加倒入卡密的值
- changeVirtual(e) {
- this.virtualList = this.virtualList.concat(e);
- },
- //添加卡密
- addVirtual(index, name) {
- this.tabIndex = index;
- this.tabName = name;
- this.virtualListClear();
- this.$refs.addCarMy.fixedCar = {
- disk_info: '',
- // stock: 0
- }
- this.$refs.addCarMy.cartMyType = 1;
- this.carMyShow = true;
- },
- //确认提交卡密
- fixdBtn(e) {
- if (e.cartMyType == 1) {
- this.$set(this[this.tabName][this.tabIndex], "disk_info", e.disk_info);
- // this.$set(this[this.tabName][this.tabIndex], "stock", Number(e.stock));
- this[this.tabName][this.tabIndex].virtual_list = [];
- } else {
- this.$set(this[this.tabName][this.tabIndex], "virtual_list", e.virtualList);
- // this.$set(this[this.tabName][this.tabIndex], "stock", e.virtualList.length);
- this[this.tabName][this.tabIndex].disk_info = '';
- }
- this.carMyShow = false;
- },
- closeCarMy() {
- this.carMyShow = false;
- },
- //清空卡密
- virtualListClear() {
- this.virtualList = [{
- key: "",
- value: "",
- }, ];
- },
- seeVirtual(data, name, index) {
- this.tabName = name;
- this.tabIndex = index;
- this.virtualListClear();
- this.$refs.addCarMy.fixedCar = {
- disk_info: '',
- // stock: 0
- }
- if (data.virtual_list && data.virtual_list.length) {
- this.$refs.addCarMy.cartMyType = 2;
- this.virtualList = data.virtual_list;
- } else if (data.disk_info) {
- this.$refs.addCarMy.cartMyType = 1;
- this.$refs.addCarMy.fixedCar.disk_info = data.disk_info;
- // this.$refs.addCarMy.fixedCar.stock = data.stock;
- }
- this.carMyShow = true;
- },
- //动态添加组件
- addAssembly() {
- this.formValidate.custom_form.push({
- title: "",
- label: "text",
- value: "",
- status: 0,
- });
- },
- customMessBtn(e) {
- if (!e) {
- this.formValidate.system_form_id = 0;
- }
- },
- addcustom() {
- if (this.formValidate.custom_form.length > 9) {
- this.$Message.warning("最多添加10条");
- } else {
- this.addAssembly();
- }
- },
- delcustom(index) {
- this.formValidate.custom_form.splice(index, 1);
- },
- // 预售具体日期
- onchangeTime(e) {
- this.formValidate.presale_time = e;
- },
- //定时上架
- onchangeShow(e) {
- this.formValidate.auto_on_time = e
- },
- //定时下架
- onchangeOff(e) {
- this.formValidate.auto_off_time = e
- },
- // 获取供应商内容
- getSupplierList() {
- getSupplierList().then(async (res) => {
- this.supplierList = res.data
- }).catch((res) => {
- this.$Message.error(res.msg)
- })
- },
- //打开属性
- batchAttr() {
- this.attrShow = true;
- // if(!this.activeAtter.length){
- // let data = this.attrs;
- // data.map(el=>{
- // el.details = [];
- // el.detail.map(label=>{
- // el.details.push({
- // name:label,
- // select:false
- // })
- // })
- // })
- // this.attrsList = data;
- // }
- },
- //获取属性
- getAttr() {
- this.oneFormBatch[0].attr = '全部';
- let data = this.attrs;
- data.map(el => {
- el.details = [];
- el.detail.map(label => {
- el.details.push({
- name: label,
- select: false
- })
- })
- })
- this.attrsList = data;
- },
- //选中属性
- activeAttr(e) {
- this.attrsList = e;
- },
- //关闭属性弹窗
- labelAttr() {
- this.attrShow = false;
- },
- //多属性为空
- manyEmpty(j) {
- j.pic = '';
- j.price = 0;
- j.settle_price = 0;
- j.cost = 0;
- j.ot_price = 0;
- j.erp_product_id = 0;
- j.unit = '';
- j.uint_to_erp_unit = 0;
- // j.stock = 0;
- j.bar_code = '';
- j.code = '';
- j.weight = 0;
- j.volume = 0;
- j.virtual_list = []
- },
- doCombination(arr) {
- var count = arr.length - 1; //数组长度(从0开始)
- var tmp = [];
- var totalArr = []; // 总数组
- return doCombinationCallback(arr, 0); //从第一个开始
- //js 没有静态数据,为了避免和外部数据混淆,需要使用闭包的形式
- function doCombinationCallback(arr, curr_index) {
- for (let val of arr[curr_index]) {
- tmp[curr_index] = val; //以curr_index为索引,加入数组
- //当前循环下标小于数组总长度,则需要继续调用方法
- if (curr_index < count) {
- doCombinationCallback(arr, curr_index + 1); //继续调用
- } else {
- totalArr.push(tmp.join(',')); //(直接给push进去,push进去的不是值,而是值的地址)
- }
- //js 对象都是 地址引用(引用关系),每次都需要重新初始化,否则 totalArr的数据都会是最后一次的 tmp 数据;
- let oldTmp = tmp;
- tmp = [];
- for (let index of oldTmp) {
- tmp.push(index);
- }
- }
- return totalArr;
- }
- },
- //提交属性值;
- subAttrs(e) {
- let selectData = [];
- this.attrsList.forEach((el, index) => {
- let obj = [];
- el.details.forEach((label) => {
- if (label.select) {
- obj.push(label.name);
- }
- })
- if (obj.length) {
- selectData.push(obj)
- }
- })
- let newData = [];
- if (selectData.length) {
- newData = this.doCombination(selectData);
- }
- this.attrShow = false;
- this.activeAtter = selectData;
- this.oneFormBatch[0].attr = newData.length ? newData.join(';') : '全部';
- this.manyFormValidate.forEach(j => {
- j.select = false;
- if (newData.length) {
- newData.forEach(item => {
- if (j.values.split('').length == item.split('').length) {
- if (j.values == item) {
- j.select = true;
- }
- } else {
- if (j.values.indexOf(item) != -1) {
- j.select = true;
- }
- }
- })
- } else {
- j.select = true;
- }
- })
- this.$set(this, 'manyFormValidate', this.manyFormValidate)
- },
- goodsOn(e) {
- if (e == 0 || e == 1) {
- this.formValidate.auto_on_time = '';
- }
- },
- goodsOff(e) {
- if (!e) {
- this.formValidate.auto_off_time = '';
- }
- },
- addBrand() {
- this.$refs.menusFrom.modals = true
- this.$refs.menusFrom.titleFrom = "添加品牌分类"
- this.formBrand = {
- sort: 0,
- is_show: 1
- }
- this.formBrand.fid = [0];
- this.$refs.menusFrom.type = 1
- },
- getAllUnit() {
- productAllUnit().then(res => {
- this.unitNameList = res.data;
- }).catch(err => {
- this.$Message.error(err.msg);
- })
- },
- addClass() {
- this.$modalForm(productCreateApi()).then(() => this.goodsCategory());
- },
- addUnit() {
- this.$modalForm(productUnitCreate()).then(() => this.getAllUnit());
- },
- addStoreLabel() {
- this.$modalForm(productLabelAdd()).then(() => {});
- },
- productTypeTap(num, item) {
- if (num == 1) {
- if (this.$route.params.id) return this.$Message.error('商品类型不能切换!');
- this.formValidate.product_type = item.id;
- }
- if (this.formValidate.product_type && this.formValidate.product_type != 4) {
- this.headTab = [{
- title: "基础信息",
- name: "1"
- },
- {
- title: "规格库存",
- name: "2"
- },
- {
- title: "商品详情",
- name: "3"
- },
- {
- title: "营销设置",
- name: "5"
- },
- {
- title: "其他设置",
- name: "6"
- },
- ]
- this.formValidate.postage = 0;
- // this.formValidate.supplier_id = 0;
- } else if (this.formValidate.product_type == 4) {
- this.headTab = [{
- title: "基础信息",
- name: "1"
- },
- {
- title: "规格库存",
- name: "2"
- },
- {
- title: "商品详情",
- name: "3"
- },
- {
- title: "营销设置",
- name: "5"
- },
- {
- title: "其他设置",
- name: "6"
- },
- {
- title: "适用门店",
- name: "7"
- },
- ]
- } else {
- this.headTab = [{
- title: "基础信息",
- name: "1"
- },
- {
- title: "规格库存",
- name: "2"
- },
- {
- title: "商品详情",
- name: "3"
- },
- {
- title: "物流设置",
- name: "4"
- },
- {
- title: "营销设置",
- name: "5"
- },
- {
- title: "其他设置",
- name: "6"
- },
- {
- title: "适用门店",
- name: "7"
- },
- ]
- }
- },
- closeLabel(label) {
- let index = this.dataLabel.indexOf(this.dataLabel.filter(d => d.id == label.id)[0]);
- this.dataLabel.splice(index, 1);
- },
- activeData(dataLabel) {
- this.labelShow = false;
- this.dataLabel = dataLabel;
- },
- openLabel(row) {
- this.labelShow = true;
- this.$refs.userLabel.userLabel(JSON.parse(JSON.stringify(this.dataLabel)));
- },
- // 标签弹窗关闭
- labelClose() {
- this.labelShow = false;
- },
- closeStoreLabel(label) {
- let index = this.storeDataLabel.indexOf(this.storeDataLabel.filter(d => d.id == label.id)[0]);
- this.storeDataLabel.splice(index, 1);
- },
- activeStoreData(storeDataLabel) {
- this.storeLabelShow = false;
- this.storeDataLabel = storeDataLabel;
- },
- openStoreLabel(row) {
- this.storeLabelShow = true;
- this.$refs.storeLabel.storeLabel(JSON.parse(JSON.stringify(this.storeDataLabel)));
- },
- // 标签弹窗关闭
- storeLabelClose() {
- this.storeLabelShow = false;
- },
- // 品牌列表
- getBrandList() {
- brandList().then(res => {
- //initBran()函数作用iview中规定value必须是字符串,后台返回成了数字,用于处理这个,给了个递归;
- this.initBran(res.data);
- this.brandData = res.data
- }).catch(err => {
- this.$Message.error(err.msg);
- })
- },
- initBran(data) {
- data.map(item => {
- item.value = item.value.toString();
- if (item.children && item.children.length) {
- this.initBran(item.children);
- }
- })
- },
- getProductId(e) {
- this.goodsModals = false;
- let nArr = this.goodsData.concat(e).filter((element, index, self) => {
- return self.findIndex(x => x.product_id == element.product_id) == index
- })
- this.goodsData = nArr.slice(0, 12);
- },
- goodCancel() {
- this.goodsModals = false;
- },
- goodsTap() {
- this.goodsModals = true;
- this.$refs.goodslist.handleSelectAll();
- },
- bindDelete(index) {
- this.goodsData.splice(index, 1)
- },
- cancel() {
- this.$router.push({
- path: this.roterPre + '/product/product_list'
- });
- },
- videoSaveToUrl(file) {
- let imgTypeArr = ["video/mp4"];
- let imgType = imgTypeArr.indexOf(file.type) !== -1
- if (!imgType) {
- return this.$Message.warning({
- content: '文件 ' + file.name + ' 格式不正确, 请选择格式正确的视频',
- duration: 5
- });
- }
- uploadByPieces({
- randoms: "", // 随机数,这里作为给后端处理分片的标识 根据项目看情况 是否要加
- file: file, // 视频实体
- pieceSize: 3, // 分片大小
- success: (data) => {
- this.formValidate.video_link = data.file_path;
- this.progress = 100;
- },
- error: (e) => {
- this.$Message.error(e.msg);
- },
- uploading: (chunk, allChunk) => {
- this.videoIng = true;
- let st = Math.floor((chunk / allChunk) * 100);
- this.progress = st;
- },
- });
- return false;
- },
- // 上传头部token
- getToken() {
- this.header["Authori-zation"] = "Bearer " + util.cookies.get("token");
- },
- // beforeUpload() {
- // this.uploadData = {};
- // let promise = new Promise((resolve) => {
- // this.$nextTick(function () {
- // resolve(true);
- // });
- // });
- // return promise;
- // },
- // 上传成功
- handleSuccess(res, file, fileList) {
- if (res.status === 200) {
- this.formValidate.video_link = res.data.src;
- this.$Message.success(res.msg);
- } else {
- this.$Message.error(res.msg);
- }
- },
- //获取视频上传类型
- uploadType() {
- uploadType().then((res) => {
- this.upload_type = res.data.upload_type;
- });
- },
- getEditorContent(data) {
- this.content = data;
- },
- infoData(data) {
- console.log(data,'productInfo');
- this.storesList = data.stores || [];
- let cate_id = data.cate_id.map(Number);
- this.attrs = data.items || [];
- let ids = [];
- data.coupons.map((item) => {
- ids.push(item.id);
- });
- this.goodsData = data.recommend_list;
- if (data.auto_off_time) {
- this.off_show = 1;
- } else {
- this.off_show = 0;
- }
- let brandIds = [];
- data.brand_id.forEach(item => {
- brandIds.push(item.toString())
- })
- this.formValidate = data;
- // this.formValidate.
- console.log('na',this.formValidate);
- this.formTypeList = data.custom_form_info;
- this.formValidate.brand_id = brandIds;
- // this.formValidate.supplier_id = data.relation_id;
- this.formValidate.is_limit = this.formValidate.is_limit ? 1 : 0;
- this.formValidate.limit_type = parseInt(data.limit_type);
- this.formValidate.is_support_refund = parseInt(this.formValidate.is_support_refund);
- this.contents = data.description;
- this.couponName = data.coupons;
- this.formValidate.coupon_ids = ids;
- this.updateIds = ids;
- this.updateName = data.coupons;
- this.formValidate.cate_id = cate_id;
- this.dataLabel = data.label_id;
- this.storeDataLabel = data.store_label_id;
- this.specsList = data.specs;
- if (data.attr) {
- this.oneFormValidate = [data.attr];
- }
- this.formValidate.header = [];
- this.generate(0);
- //this.manyFormValidate = data.attrs;
- this.addmanyData(data.attrs);
- this.productTypeTap(2);
- this.formValidate.system_form_id = data.system_form_id || 0;
- if (this.formValidate.system_form_id) {
- this.customBtn = true;
- }
- this.spec_type = data.spec_type;
- if (data.spec_type === 0) {
- this.manyFormValidate = [];
- } else {
- this.createBnt = true;
- this.oneFormValidate = [{
- pic: "",
- price: 0,
- settle_price: 0,
- cost: 0,
- ot_price: 0,
- erp_product_id: 0,
- unit: '',
- uint_to_erp_unit: 0,
- // stock: 0,
- bar_code: "",
- code: "",
- weight: 0,
- volume: 0,
- brokerage: 0,
- brokerage_two: 0,
- vip_price: 0,
- virtual_list: [],
- write_times: 0, //核销次数
- write_valid: 1, //核销时效
- days: 1
- }, ];
- }
- },
- //关闭淘宝弹窗并生成数据;
- onClose(data) {
- this.modals = false;
- this.infoData(data);
- },
- checkMove(evt) {
- this.moveIndex = evt.draggedContext.index;
- },
- end() {
- this.moveIndex = "";
- },
- checkAllGroupChange(data) {
- this.checkAllGroup(data);
- },
- checkAllGroup(data) {
- if (this.formValidate.spec_type === 0) {
- if (data.indexOf(0) > -1) {
- this.columnsInstall = this.columns2.slice(1, 5).concat(this.member);
- } else if (data.indexOf(1) > -1) {
- this.columnsInstall = this.columns2.slice(1, 5).concat(this.rakeBack);
- } else {
- this.columnsInstall = this.columns2.slice(1, 5);
- }
- if (data.length === 2) {
- this.columnsInstall = this.columns2
- .slice(1, 5)
- .concat(this.rakeBack)
- .concat(this.member);
- }
- } else {
- if (data.indexOf(0) > -1) {
- this.columnsInstal2 = this.columnsInstalM
- .slice(0, 4)
- .concat(this.member);
- } else if (data.indexOf(1) > -1) {
- this.columnsInstal2 = this.columnsInstalM
- .slice(0, 4)
- .concat(this.rakeBack);
- } else {
- this.columnsInstal2 = this.columnsInstalM.slice(0, 4);
- }
- if (data.length === 2) {
- this.columnsInstal2 = this.columnsInstalM
- .slice(0, 4)
- .concat(this.rakeBack)
- .concat(this.member);
- }
- }
- },
- // 添加优惠券
- addCoupon() {
- this.$refs.couponTemplates.isTemplate = true;
- this.$refs.couponTemplates.tableList();
- },
- //对象数组去重;
- unique(arr) {
- const res = new Map();
- return arr.filter((arr) => !res.has(arr.id) && res.set(arr.id, 1));
- },
- nameId(id, names) {
- this.formValidate.coupon_ids = id;
- this.couponName = this.unique(names);
- },
- handleClose(name) {
- let index = this.couponName.indexOf(name);
- this.couponName.splice(index, 1);
- let couponIds = this.formValidate.coupon_ids;
- couponIds.splice(index, 1);
- this.updateIds = couponIds;
- this.updateName = this.couponName;
- },
- getStoreId(data) {
- this.storeModals = false;
- let list = this.storesList.concat(data);
- let uni = this.unique(list);
- this.storesList = uni;
- },
- // 运费模板
- getList() {
- this.productGetTemplate();
- },
- // 添加运费模板
- addTemp() {
- this.$refs.templates.isTemplate = true;
- },
- //查看、编辑运费模板
- editTemp() {
- this.$refs.templates.isTemplate = true;
- this.$refs.templates.editFrom(this.formValidate.temp_id);
- },
- // 删除视频;
- delVideo() {
- let that = this;
- that.$set(that.formValidate, "video_link", "");
- that.$set(that, "progress", 0);
- that.videoIng = false;
- that.upload.videoIng = false;
- that.$refs.refid.value = '';
- },
- zh_uploadFile() {
- if (this.seletVideo == 1) {
- if (this.videoLink && this.$getFileType(this.videoLink) == 'video') {
- this.formValidate.video_link = this.videoLink;
- } else {
- return this.$Message.error("请输入正确的视频链接")
- }
- } else {
- this.$refs.refid.click();
- }
- },
- zh_uploadFile_change(evfile) {
- let that = this;
- let suffix = evfile.target.files[0].name.substr(
- evfile.target.files[0].name.indexOf(".")
- );
- if (suffix.indexOf(".mp4") === -1) {
- return that.$Message.error("只能上传MP4文件");
- }
- productGetTempKeysApi()
- .then((res) => {
- that.$videoCloud
- .videoUpload({
- type: res.data.type,
- evfile: evfile,
- res: res,
- uploading(status, progress) {
- that.upload.videoIng = status;
- if (res.status == 200) {
- that.progress = 100;
- }
- },
- })
- .then((res) => {
- that.formValidate.video_link = res.url;
- that.$Message.success("视频上传成功");
- that.upload.videoIng = false;
- })
- .catch((res) => {
- that.$Message.error(res);
- });
- })
- .catch((res) => {
- that.$Message.error(res.msg);
- });
- },
- // 上一页;
- upTab() {
- if (this.currentTab == 5 && this.formValidate.product_type != 0) {
- this.currentTab = (Number(this.currentTab) - 2).toString();
- } else {
- this.currentTab = (Number(this.currentTab) - 1).toString();
- }
- },
- // 下一页;
- downTab(name) {
- this.$refs[name].validate((valid) => {
- if (valid) {
- if (this.formValidate.is_show == 2 && !this.formValidate.auto_on_time) {
- return this.$Message.warning("请填写定时上架时间");
- }
- if (this.off_show == 1 && !this.formValidate.auto_off_time) {
- return this.$Message.warning("请填写定时下架时间");
- }
- if (this.currentTab == 4 && !this.formValidate.delivery_type.length) {
- return this.$Message.warning("请选择配送方式");
- }
- if (this.currentTab == 3 && this.formValidate.product_type != 0) {
- this.currentTab = (Number(this.currentTab) + 2).toString();
- } else {
- this.currentTab = (Number(this.currentTab) + 1).toString();
- }
- } else {
- this.$Message.warning("请完善数据");
- }
- })
- },
- // 属性弹窗回调函数;
- userSearchs() {
- this.productGetRule();
- },
- // 添加规则;
- addRule() {
- this.$refs.addattr.modal = true;
- },
- // 批量设置分佣;
- brokerageSetUp() {
- let that = this;
- if (that.formValidate.is_sub.indexOf(1) > -1) {
- if (that.manyBrokerage <= 0 || that.manyBrokerageTwo <= 0) {
- return that.$Message.error("请填写返佣金额后进行批量添加");
- }
- } else if (that.formValidate.is_sub.indexOf(0) > -1) {
- if (that.manyVipPrice <= 0) {
- return that.$Message.error("请填写会员价后进行批量添加");
- }
- }
- if (this.formValidate.is_sub.length === 2) {
- if (
- that.manyBrokerage <= 0 ||
- that.manyBrokerageTwo <= 0 ||
- that.manyVipPrice <= 0
- ) {
- return that.$Message.error("请填写完金额后进行批量添加");
- }
- }
- for (let val of that.manyFormValidate) {
- this.$set(val, "brokerage", that.manyBrokerage);
- this.$set(val, "brokerage_two", that.manyBrokerageTwo);
- this.$set(val, "vip_price", that.manyVipPrice);
- }
- // let that = this;
- // if (that.manyBrokerage <= 0 || that.manyBrokerageTwo <= 0) {
- // return that.$Message.error('请填写返佣金额在进行批量添加');
- // } else {
- // for (let val of that.manyFormValidate) {
- // this.$set(val, 'brokerage', that.manyBrokerage);
- // this.$set(val, 'brokerage_two', that.manyBrokerageTwo);
- // }
- // }
- },
- // 批量设置会员价
- vipPriceSetUp() {
- let that = this;
- if (that.manyVipPrice <= 0) {
- return that.$Message.error("请填写会员价在进行批量添加");
- } else {
- for (let val of that.manyFormValidate) {
- this.$set(val, "vip_price", that.manyVipPrice);
- }
- }
- },
- batchDel() {
- this.oneFormBatch = [{
- attr: "全部",
- pic: "",
- price: 0,
- settle_price: 0,
- cost: 0,
- ot_price: 0,
- erp_product_id: 0,
- unit: '',
- uint_to_erp_unit: 0,
- // stock: 0,
- bar_code: "",
- code: "",
- weight: 0,
- volume: 0,
- virtualList: [],
- disk_info: ''
- }, ];
- this.activeAtter = [];
- for (let val of this.manyFormValidate) {
- val.select = true;
- }
- },
- confirm() {
- let that = this;
- that.createBnt = true;
- if (that.formValidate.selectRule.trim().length <= 0) {
- return that.$Message.error("请选择属性");
- }
- that.ruleList.forEach(function(item, index) {
- if (item.rule_name === that.formValidate.selectRule) {
- that.attrs = item.rule_value;
- }
- });
- },
- // 获取商品属性模板;
- productGetRule() {
- productGetRuleApi().then((res) => {
- this.ruleList = res.data;
- });
- },
- // 获取运费模板;
- productGetTemplate() {
- let id = this.$route.params.id;
- productGetTemplateApi({
- id: id
- }).then((res) => {
- this.templateList = res.data;
- });
- },
- // 删除表格中的属性
- delAttrTable(index) {
- let id = this.$route.params.id;
- if (id) {
- checkActivityApi(id)
- .then((res) => {
- this.manyFormValidate.splice(index, 1);
- this.$Message.success(res.msg);
- })
- .catch((res) => {
- this.$Message.error(res.msg);
- });
- } else {
- this.manyFormValidate.splice(index, 1);
- }
- },
- // 批量添加
- batchAdd() {
- for (let val of this.manyFormValidate) {
- //this.manyEmpty(val);
- if (val.select) {
- if (this.oneFormBatch[0].pic) {
- this.$set(val, "pic", this.oneFormBatch[0].pic);
- }
- if (this.oneFormBatch[0].price > 0) {
- this.$set(val, "price", this.oneFormBatch[0].price);
- }
- if (this.oneFormBatch[0].settle_price > 0 && this.merchantType == 2) {
- this.$set(val, "settle_price", this.oneFormBatch[0].settle_price);
- }
- if (this.oneFormBatch[0].cost > 0) {
- this.$set(val, "cost", this.oneFormBatch[0].cost);
- }
- if (this.oneFormBatch[0].ot_price > 0) {
- this.$set(val, "ot_price", this.oneFormBatch[0].ot_price);
- }
- if (this.oneFormBatch[0].erp_product_id > 0) {
- this.$set(val, "erp_product_id", this.oneFormBatch[0].erp_product_id);
- }
- if (this.oneFormBatch[0].unit) {
- this.$set(val, "unit", this.oneFormBatch[0].unit);
- }
- if (this.oneFormBatch[0].uint_to_erp_unit > 0) {
- this.$set(val, "uint_to_erp_unit", this.oneFormBatch[0].uint_to_erp_unit*1);
- }
- // if (this.oneFormBatch[0].stock > 0) {
- // this.$set(val, "stock", this.oneFormBatch[0].stock);
- // }
- if (this.oneFormBatch[0].bar_code !== "") {
- this.$set(val, "bar_code", this.oneFormBatch[0].bar_code);
- }
- if (this.oneFormBatch[0].code !== "") {
- this.$set(val, "code", this.oneFormBatch[0].code);
- }
- if (this.oneFormBatch[0].weight > 0) {
- this.$set(val, "weight", this.oneFormBatch[0].weight);
- }
- if (this.oneFormBatch[0].volume > 0) {
- this.$set(val, "volume", this.oneFormBatch[0].volume);
- }
- if (this.formValidate.product_type == 1) {
- if (this.oneFormBatch[0].virtual_list && this.oneFormBatch[0].virtual_list.length) {
- this.$set(val, "virtual_list", this.oneFormBatch[0].virtual_list);
- } else if (this.oneFormBatch[0].disk_info) {
- this.$refs.addCarMy.cartMyType = 1;
- this.$set(val, "disk_info", this.oneFormBatch[0].disk_info);
- }
- }
- }
- }
- },
- // 添加按钮
- addBtn() {
- let id = this.$route.params.id;
- checkActivityApi(id)
- .then((res) => {
- this.clearAttr();
- this.createBnt = false;
- this.showIput = true;
- })
- .catch((res) => {
- this.$Message.error(res.msg);
- });
- },
- addmanyData(data, type) {
- if (type == 1) {
- this.oneFormBatch[0].pic = this.formValidate.image
- data.forEach(item => {
- item.select = true,
- item.pic = this.formValidate.image
- })
- } else {
- data.forEach(item => {
- item.select = true
- })
- }
- this.manyFormValidate = data;
- },
- // 立即生成
- generate(type) {
- generateAttrApi({
- attrs: this.attrs,
- product_type: this.formValidate.product_type
- }, this.formValidate.id, type)
- .then((res) => {
- let info = res.data.info,
- header1 = JSON.parse(JSON.stringify(info.header));
- if ((this.$route.params.id !== "0" && this.type != -1) || type == 1) {
- this.addmanyData(info.value, type);
- }
- this.formValidate.header = header1;
- this.attrData = res.data.info.attr;
- let header = info.header;
- header.pop();
- this.columnsInstalM = info.header;
- this.checkAllGroup(this.formValidate.is_sub);
- if (!this.$route.params.id && this.formValidate.spec_type === 1 && this.type != -1) {
- this.manyFormValidate.map((item) => {
- item.pic = this.formValidate.slider_image[0];
- });
- this.oneFormBatch[0].pic = this.formValidate.slider_image[0];
- } else if (this.$route.params.id) {
- this.manyFormValidate.map((item) => {
- if (!item.pic) {
- item.pic = this.formValidate.slider_image[0];
- }
- });
- this.oneFormBatch[0].pic = this.formValidate.slider_image[0];
- }
- this.getAttr();
- })
- .catch((res) => {
- this.$Message.error(res.msg);
- });
- },
- // 取消
- offAttrName() {
- this.showIput = false;
- this.createBnt = true;
- },
- clearAttr() {
- this.formDynamic.attrsName = "";
- this.formDynamic.attrsVal = "";
- },
- // 删除规格
- handleRemoveRole(index) {
- this.attrs.splice(index, 1);
- this.manyFormValidate.splice(index, 1);
- },
- // 删除属性
- handleRemove2(item, index) {
- item.splice(index, 1);
- },
- // 添加规则名称
- createAttrName() {
- if (this.formDynamic.attrsName && this.formDynamic.attrsVal) {
- let data = {
- value: this.formDynamic.attrsName,
- detail: [this.formDynamic.attrsVal],
- };
- this.attrs.push(data);
- var hash = {};
- this.attrs = this.attrs.reduce(function(item, next) {
- /* eslint-disable */
- hash[next.value] ? "" : (hash[next.value] = true && item.push(next));
- return item;
- }, []);
- this.clearAttr();
- this.showIput = false;
- this.createBnt = true;
- } else {
- this.$Message.warning("请添加完整的规格!");
- }
- },
- // 添加属性
- createAttr(num, idx) {
- if (num) {
- this.attrs[idx].detail.push(num);
- var hash = {};
- this.attrs[idx].detail = this.attrs[idx].detail.reduce(function(
- item,
- next
- ) {
- /* eslint-disable */
- hash[next] ? "" : (hash[next] = true && item.push(next));
- return item;
- },
- []);
- } else {
- this.$Message.warning("请添加属性");
- }
- },
- // 商品分类;
- goodsCategory() {
- cascaderListApi(1)
- .then((res) => {
- this.treeSelect = res.data;
- })
- .catch((res) => {
- this.$Message.error(res.msg);
- });
- },
- //视视上传类型
- changeVideo(e) {
- this.formValidate.video_link = "";
- this.videoLink = "";
- },
- // 改变规格
- changeSpec() {
- this.formValidate.is_sub = [];
- let id = this.$route.params.id;
- if (id) {
- checkActivityApi(id)
- .then((res) => {})
- .catch((res) => {
- this.formValidate.spec_type = this.spec_type;
- this.$Message.error(res.msg);
- });
- }
- },
- // 详情
- getInfo() {
- let that = this;
- that.spinShow = true;
- productInfoApi(that.$route.params.id || this.$route.query.copy)
- .then(async (res) => {
- let data = res.data.productInfo;
-
- this.merchantType = parseInt(data.type);
- if (this.merchantType == 2) {
- let obj = {
- title: "结算价",
- slot: "settle_price",
- align: "center",
- minWidth: 95,
- }
- this.columns2.splice(3, 0, obj)
- }
- this.infoData(data);
- // let cate_id = data.cate_id.map(Number);
- // let label_id = data.label_id.map(Number);
- // this.attrs = data.items || [];
- // let ids = [];
- // data.coupons.map((item) => {
- // ids.push(item.id);
- // });
- // that.formValidate = data;
- // that.couponName = data.coupons;
- // that.formValidate.coupon_ids = ids;
- // that.updateIds = ids;
- // that.updateName = data.coupons;
- // that.formValidate.cate_id = cate_id;
- // that.formValidate.label_id = label_id;
- // that.oneFormValidate = [data.attr];
- // that.formValidate.header = [];
- // that.manyFormValidate = data.attrs;
- // that.generate(0);
- // that.spec_type = data.spec_type;
- // if (data.spec_type === 0) {
- // that.manyFormValidate = [];
- // } else {
- // that.createBnt = true;
- // that.oneFormValidate = [
- // {
- // pic: data.image,
- // price: 0,
- // cost: 0,
- // ot_price: 0,
- // stock: 0,
- // bar_code: "",
- // weight: 0,
- // volume: 0,
- // brokerage: 0,
- // brokerage_two: 0,
- // vip_price: 0,
- // },
- // ];
- // }
- this.spinShow = false;
- })
- .catch((res) => {
- this.spinShow = false;
- this.$Message.error(res.msg);
- });
- },
- // tab切换
- onhangeTab(name) {
- this.currentTab = name;
- },
- handleRemove(i) {
- this.images.splice(i, 1);
- this.formValidate.slider_image.splice(i, 1);
- this.oneFormValidate[0].pic = this.formValidate.slider_image[0];
- },
- // 关闭图片上传模态框
- changeCancel(msg) {
- this.modalPic = false;
- },
- // 点击商品图
- modalPicTap(tit, picTit, index) {
- this.modalPic = true;
- this.isChoice = tit === "dan" ? "单选" : "多选";
- this.picTit = picTit;
- this.tableIndex = index;
- },
- // 获取单张图片信息
- getPic(pc) {
- switch (this.picTit) {
- case "danFrom":
- this.formValidate.image = pc.att_dir;
- if (!this.$route.params.id) {
- if (this.formValidate.spec_type === 0) {
- this.oneFormValidate[0].pic = pc.att_dir;
- } else {
- this.manyFormValidate.map((item) => {
- item.pic = pc.att_dir;
- });
- this.oneFormBatch[0].pic = pc.att_dir;
- }
- }
- break;
- case "danTable":
- this.oneFormValidate[this.tableIndex].pic = pc.att_dir;
- break;
- case "duopi":
- this.oneFormBatch[this.tableIndex].pic = pc.att_dir;
- break;
- case "recommend_image":
- this.formValidate.recommend_image = pc.att_dir;
- break;
- case "video":
- this.formValidate.video_link = pc.att_dir;
- break;
- default:
- this.manyFormValidate[this.tableIndex].pic = pc.att_dir;
- }
- this.modalPic = false;
- },
- // 获取多张图信息
- getPicD(pc) {
- this.images = pc;
- this.images.map((item) => {
- this.formValidate.slider_image.push(item.att_dir);
- this.formValidate.slider_image = this.formValidate.slider_image.splice(
- 0,
- 10
- );
- });
- this.oneFormValidate[0].pic = this.formValidate.slider_image[0];
- this.modalPic = false;
- },
- // 提交
- handleSubmit(name) {
- this.$refs[name].validate((valid) => {
- if (valid) {
- if (!this.formValidate.store_name.trim()) {
- return this.$Message.warning("基础信息-商品名称不能为空");
- }
- if (this.formValidate.is_show == 2 && !this.formValidate.auto_on_time) {
- return this.$Message.warning("基础信息-定时上架时间不能为空");
- }
- if (this.off_show == 1 && !this.formValidate.auto_off_time) {
- return this.$Message.warning("基础信息-定时下架时间不能为空");
- }
- if (this.formValidate.product_type == 4 && !this.oneFormValidate[0].write_times) {
- return this.$Message.warning("规格库存-核销次数必须大于0");
- }
- if (this.formValidate.product_type == 4 && this.oneFormValidate[0].write_valid == 2 && !
- this.oneFormValidate[0].days) {
- return this.$Message.warning("规格库存-有效天数必须大于0");
- }
- if (this.formValidate.product_type == 4 && this.oneFormValidate[0].write_valid == 3 && !
- this.oneFormValidate[0].section_time.length) {
- return this.$Message.warning("规格库存-请输入固定有效期");
- }
- if (this.formValidate.freight == 2 && this.formValidate.product_type == 0 && this
- .formValidate.postage <= 0) {
- return this.$Message.warning("物流设置-固定邮费不能为0");
- }
- if (this.formValidate.freight == 3 && this.formValidate.product_type == 0 && !this
- .formValidate.temp_id) {
- return this.$Message.warning("物流设置-运费模板不能为空");
- }
- if (this.formValidate.product_type == 0 && this.formValidate.is_presale_product && !this
- .formValidate.presale_time[0]) {
- return this.$Message.warning("营销设置-预售时间不能为空");
- }
- // for (let i = 0; i < this.formValidate.custom_form.length; i++) {
- // const element = this.formValidate.custom_form[i];
- // if (!element.title) {
- // return this.$Message.warning("其他设置-留言标题不能为空");
- // }
- // }
- if (this.customBtn && this.formValidate.system_form_id == 0) {
- return this.$Message.warning('其他设置-请选择自定义表单模板');
- }
- let storeId = []
- this.storesList.forEach(item => {
- storeId.push(item.id)
- })
- if (this.formValidate.applicable_type == 2 && !storeId.length) {
- return this.$Message.warning('适用门店-请选择适用门店');
- }
- this.formValidate.applicable_store_id = storeId;
- this.formValidate.type = this.type;
- if (this.formValidate.spec_type === 0) {
- this.formValidate.attrs = this.oneFormValidate;
- this.formValidate.header = [];
- this.formValidate.items = [];
- } else {
- this.formValidate.items = this.attrs;
- this.formValidate.attrs = this.manyFormValidate;
- }
- if (
- this.formValidate.spec_type === 1 &&
- this.manyFormValidate.length === 0
- ) {
- return this.$Message.warning("规格库存-请点击生成多规格");
- // return this.$Message.warning('请点击生成规格!');
- }
- let item = this.formValidate.attrs;
- if (this.formValidate.is_sub.indexOf(1) != -1) {
- for (let i = 0; i < item.length; i++) {
- if (
- item[i].brokerage === null ||
- item[i].brokerage_two === null
- ) {
- return this.$Message.warning("营销设置- 一二级返佣不能为空");
- }
- }
- }
- if (this.formValidate.is_sub.indexOf(0) != -1) {
- for (let i = 0; i < item.length; i++) {
- if (item[i].vip_price === null) {
- return this.$Message.warning("营销设置-会员价不能为空");
- }
- if (item[i].vip_price === 0) {
- return this.$Message.warning("营销设置-会员价不能为0");
- }
- }
- }
- if (this.formValidate.is_sub.length === 2) {
- for (let i = 0; i < item.length; i++) {
- if (
- item[i].brokerage === null ||
- item[i].brokerage_two === null ||
- item[i].vip_price === null
- ) {
- return this.$Message.error(
- "营销设置- 一二级返佣和会员价不能为空"
- );
- }
- }
- }
- for (let i = 0; i < this.specsList.length; i++) {
- let data = this.specsList[i];
- if (!data.name.trim()) {
- return this.$Message.error('请输入参数名称');
- }
- if (!data.value.trim()) {
- return this.$Message.error('请输入参数值');
- }
- }
- if (!this.formValidate.product_type) {
- this.formValidate.is_support_refund = 1;
- }
- this.openSubimit = false;
- this.formValidate.description = this.formatRichText(this.content);
- let goodsId = [];
- this.goodsData.forEach(item => {
- goodsId.push(item.product_id)
- })
- this.formValidate.recommend_list = goodsId;
- // 用户标签
- let activeIds = [];
- this.dataLabel.forEach((item) => {
- activeIds.push(item.id)
- });
- this.formValidate.label_id = activeIds
- // 商品标签
- let storeActiveIds = [];
- this.storeDataLabel.forEach((item) => {
- storeActiveIds.push(item.id)
- });
- this.formValidate.store_label_id = storeActiveIds
- // 商品参数
- this.formValidate.specs = this.specsList;
- if (this.$route.query.copy) {
- this.formValidate.id = 0;
- this.formValidate.soure_link = '';
- }
- if (this.formValidate.product_type == 4) {
- this.formValidate.delivery_type = 2
- }
- productAddApi(this.formValidate)
- .then(async (res) => {
- this.openSubimit = true;
- this.$Message.success(res.msg);
- if (this.$route.params.id === "0") {
- cacheDelete().catch((err) => {
- this.$Message.error(err.msg);
- });
- }
- setTimeout(() => {
- this.$router.push({
- path: this.roterPre + "/product/product_list"
- });
- }, 500);
- })
- .catch((res) => {
- this.openSubimit = false;
- this.$Message.error(res.msg);
- });
- } else {
- if (!this.formValidate.store_name) {
- return this.$Message.warning("基础信息-商品名称不能为空");
- } else if (!this.formValidate.cate_id.length) {
- return this.$Message.warning("基础信息-商品分类不能为空");
- } else if (!this.formValidate.unit_name) {
- return this.$Message.warning("基础信息-商品单位不能为空");
- } else if (!this.formValidate.slider_image.length) {
- return this.$Message.warning("基础信息-商品轮播图不能为空");
- }
- // if(!this.formValidate.store_name || !this.formValidate.cate_id || !this.formValidate.keyword
- // || !this.formValidate.unit_name || !this.formValidate.store_info
- // || !this.formValidate.image || !this.formValidate.slider_image){
- // this.$Message.warning("请填写完整商品信息!");
- // }
- }
- });
- },
- changeTemplate(msg) {
- this.template = msg;
- },
- // 表单验证
- validate(prop, status, error) {
- if (status === false) {
- this.$Message.warning(error);
- }
- },
- // 移动
- handleDragStart(e, item) {
- this.dragging = item;
- },
- handleDragEnd(e, item) {
- this.dragging = null;
- },
- handleDragOver(e) {
- e.dataTransfer.dropEffect = "move";
- },
- handleDragEnter(e, item) {
- e.dataTransfer.effectAllowed = "move";
- if (item === this.dragging) {
- return;
- }
- const newItems = [...this.formValidate.slider_image];
- const src = newItems.indexOf(this.dragging);
- const dst = newItems.indexOf(item);
- newItems.splice(dst, 0, ...newItems.splice(src, 1));
- this.formValidate.slider_image = newItems;
- },
- // 添加自定义弹窗
- addCustomDialog(editorId) {
- window.UE.registerUI(
- "test-dialog",
- function(editor, uiName) {
- // 创建 dialog
- let dialog = new window.UE.ui.Dialog({
- iframeUrl: "/admin/widget.images/index.html?fodder=dialog",
- editor: editor,
- name: uiName,
- title: "上传图片",
- cssRules: "width:1200px;height:500px;padding:20px;",
- });
- this.dialog = dialog;
- let btn = new window.UE.ui.Button({
- name: "dialog-button",
- title: "上传图片",
- cssRules: `background-image: url(https://cdn.oss.9gt.net/prov1.1/1/icons.png);background-position: -726px -77px;`,
- onclick: function() {
- // 渲染dialog
- dialog.render();
- dialog.open();
- },
- });
- return btn;
- },
- 37
- );
- window.UE.registerUI(
- "video-dialog",
- function(editor, uiName) {
- let dialog = new window.UE.ui.Dialog({
- iframeUrl: "/admin/widget.video/index.html?fodder=video",
- editor: editor,
- name: uiName,
- title: "上传视频",
- cssRules: "width:1000px;height:500px;padding:20px;",
- });
- this.dialog = dialog;
- let btn = new window.UE.ui.Button({
- name: "video-button",
- title: "上传视频",
- cssRules: `background-image: url(../../../assets/images/icons.png);background-position: -320px -20px;`,
- onclick: function() {
- // 渲染dialog
- dialog.render();
- dialog.open();
- },
- });
- return btn;
- },
- 38
- );
- },
- formatRichText(html) {
- let newContent = html.replace(/<img[^>]*>/gi, function(match, capture) {
- match = match
- .replace(/style="[^"]+"/gi, "")
- .replace(/style='[^']+'/gi, "");
- match = match
- .replace(/width="[^"]+"/gi, "")
- .replace(/width='[^']+'/gi, "");
- match = match
- .replace(/height="[^"]+"/gi, "")
- .replace(/height='[^']+'/gi, "");
- return match;
- });
- newContent = newContent.replace(
- /style="[^"]+"/gi,
- function(match, capture) {
- match = match
- .replace(/width:[^;]+;/gi, "max-width:100%;")
- .replace(/width:[^;]+;/gi, "max-width:100%;");
- return match;
- }
- );
- // newContent = newContent.replace(/<br[^>]*\/>/gi, "");
- newContent = newContent.replace(
- /\<img/gi,
- '<img style="max-width:100%;height:auto;display:block;margin-top:0;margin-bottom:0;"'
- );
- return newContent;
- },
- },
- };
- </script>
- <style scoped lang="stylus">
- .storeTable img {
- width 36px;
- height 36px;
- }
- .storeTable /deep/.ivu-table-wrapper {
- border: 0 !important
- }
- .radioGroup .ivu-radio-wrapper {
- margin-right 20px;
- }
- .video-style {
- width: 100%;
- height: 100% !important;
- border-radius: 10px;
- }
- .select-add {
- width: 200px;
- margin-left: 6px;
- margin-right: 10px
- }
- .input-display {
- display: none
- }
- .width-add {
- width: 200px;
- }
- .custom-input {
- width: 100px;
- margin-right: 10px
- }
- .asterisk {
- position relative;
- .asteriskInfo {
- position absolute;
- color #ed4014;
- left 73px;
- top 8px;
- &.on {
- left: 62px;
- }
- &.on2 {
- left: 50px;
- }
- }
- }
- .specsList {
- /deep/.ivu-table-header table {
- border: 0 !important
- }
- /deep/.ivu-table-header thead tr th {
- padding 0 !important background-color #EEEEEE !important;
- }
- /deep/.ivu-table-cell {
- padding 0 !important
- }
- /deep/.ivu-table-border th,
- /deep/.ivu-table-border td {
- border-right unset;
- }
- /deep/.ivu-table td {
- height 59px;
- }
- &.on {
- width 50% !important;
- /deep/.ivu-table {
- width 100% !important;
- }
- /deep/.ivu-table td {
- height 40px;
- padding 0 !important;
- }
- /deep/.ivu-table-cell {
- padding 0 16px !important;
- }
- }
- }
- .form-submit {
- /deep/.ivu-card {
- border-radius: 0;
- }
- margin-bottom: 79px;
- .fixed-card {
- position: fixed;
- right: 0;
- bottom: 0;
- left: 200px;
- z-index: 45;
- box-shadow: 0 -1px 2px rgb(240, 240, 240);
- /deep/ .ivu-card-body {
- padding: 15px 16px 14px;
- }
- .ivu-form-item {
- margin-bottom: 0;
- }
- /deep/ .ivu-form-item-content {
- margin-right: 124px;
- text-align: center;
- }
- .ivu-btn {
- height: 36px;
- padding: 0 20px;
- }
- }
- }
- .seeCatMy {
- color: #2d8cf0;
- cursor: pointer;
- }
- .addCustom_content {
- margin-top: 20px;
- .custom_box {
- margin-bottom: 10px;
- }
- .addfont {
- display: inline-block;
- font-size: 13px;
- font-weight: 400;
- color: #1890FF;
- cursor: pointer;
- }
- }
- .addCustomBox {
- margin-top: 12px;
- font-size: 13px;
- font-weight: 400;
- color: #1890FF;
- .btn {
- cursor: pointer;
- width: max-content;
- }
- }
- .checkAlls /deep/.ivu-checkbox-inner {
- width 14px;
- height 14px;
- }
- .checkAlls /deep/.ivu-checkbox-wrapper {
- font-size 12px;
- }
- .lines {
- border-bottom: 1px dashed #eee;
- margin-bottom: 20px;
- }
- .iosfont {
- font-size 20px !important;
- }
- .selectOn {
- color #2d8cf0;
- }
- .ifam {
- width: 344px;
- height: 644px;
- background: url('../../../assets/images/phonebg.png') no-repeat center top;
- background-size: 344px 644px;
- padding: 40px 20px;
- padding-top: 50px;
- margin: 0 auto 0 20px;
- .content {
- height: 560px;
- overflow: hidden;
- scrollbar-width: none;
- /* firefox */
- -ms-overflow-style: none;
- /* IE 10+ */
- overflow-x: hidden;
- overflow-y: auto;
- }
- .content::-webkit-scrollbar {
- display: none;
- /* Chrome Safari */
- }
- }
- .offShow {
- position absolute
- }
- .goodsShow /deep/.ivu-radio-group-vertical .ivu-radio-wrapper {
- height 35px;
- line-height 35px;
- }
- .videbox {
- width: 60px;
- height: 60px;
- background: rgba(0, 0, 0, 0.02);
- border-radius: 4px;
- border: 1px dashed #DDDDDD;
- line-height: 50px;
- text-align: center;
- color: #898989;
- font-size: 30px;
- font-weight: 400;
- cursor: pointer;
- }
- .brandName {
- /deep/.ivu-cascader {
- display inline-block
- }
- }
- .formValidate {
- .addClass {
- color: #1890FF;
- margin-left 14px;
- padding 9px 0;
- cursor pointer;
- }
- }
- .productType {
- width: 120px;
- height: 60px;
- background: #FFFFFF;
- border-radius: 3px;
- border: 1px solid #E7E7E7;
- float: left;
- text-align: center;
- padding-top: 8px;
- position: relative;
- cursor: pointer;
- line-height: 23px;
- margin-right 12px;
- &.on {
- border-color #1890FF;
- }
- .name {
- font-size: 14px;
- font-weight: 600;
- color: rgba(0, 0, 0, 0.85);
- }
- .title {
- font-size: 12px;
- font-weight: 400;
- color: #999999;
- }
- .jiao {
- position: absolute;
- bottom: 0;
- right: 0;
- width: 0;
- height: 0;
- border-bottom: 26px solid #1890FF;
- border-left: 26px solid transparent;
- }
- .iconfont {
- position: absolute;
- bottom: -3px;
- right: 1px;
- color: #FFFFFF;
- font-size 12px;
- }
- }
- .labelInput {
- border: 1px solid #dcdee2;
- width 50%;
- padding 0 5px;
- border-radius 5px;
- min-height 30px;
- cursor pointer;
- .span {
- color: #c5c8ce;
- }
- .iconxiayi {
- font-size 12px
- }
- }
- .labelClass {
- /deep/.ivu-form-item-content {
- line-height unset;
- }
- }
- .ivu-checkbox-wrapper {
- margin-right 19px;
- }
- .list-group {
- margin-left: -8px;
- }
- .borderStyle {
- border: 1px solid #ccc;
- padding: 8px;
- border-radius: 4px;
- }
- .drag {
- cursor: move;
- }
- .move-icon {
- width: 30px;
- cursor: move;
- margin-right: 10px;
- }
- .move-icon .icondrag2 {
- font-size: 26px;
- color: #d8d8d8;
- }
- .maxW /deep/.ivu-select-dropdown {
- max-width: 600px;
- }
- #shopp-manager .ivu-table-wrapper {
- border-left: 1px solid #dcdee2;
- border-top: 1px solid #dcdee2;
- }
- .noLeft {
- >>>.ivu-form-item-content {
- margin-left: 0 !important;
- }
- }
- .tips {
- display: inline-bolck;
- font-size: 12px;
- font-weight: 400;
- color: #999999;
- margin-top: 6px;
- }
- .iview-video-style {
- width: 40%;
- height: 180px;
- border-radius: 10px;
- background-color: #707070;
- margin-top: 10px;
- position: relative;
- overflow: hidden;
- }
- .iview-video-style .iconv {
- color: #fff;
- line-height: 180px;
- width: 50px;
- height: 50px;
- display: inherit;
- font-size: 26px;
- position: absolute;
- top: -74px;
- left: 50%;
- margin-left: -25px;
- }
- .iview-video-style .mark {
- position: absolute;
- width: 100%;
- height: 30px;
- top: 0;
- background-color: rgba(0, 0, 0, 0.5);
- text-align: center;
- }
- .uploadVideo {
- margin-left: 10px;
- }
- .submission {
- margin-left: 10px;
- }
- .form-submit .fixed-card .ivu-btn {
- height: 32px;
- }
- .color-list .tip {
- color: #c9c9c9;
- }
- .color-list .color-item {
- width 70px;
- height: 28px;
- line-height: 28px;
- color: #fff;
- margin-right: 10px;
- border-radius 2px;
- text-align center .num {
- color #1890FF;
- width 14px;
- height 14px;
- text-align center;
- line-height 14px;
- border-radius 50%;
- background-color #fff;
- margin-right 6px;
- }
- }
- .color-list .color-item.blue {
- background-color: #1E9FFF;
- }
- .color-list .color-item.yellow {
- background-color: rgb(254, 185, 0);
- }
- .color-list .color-item.green {
- background-color: #009688;
- }
- .color-list .color-item.red {
- background-color: #ed4014;
- }
- .color-list .color-item.colorBlue {
- background: linear-gradient(270deg, #5ECFFF 0%, #0084FF 100%);
- }
- .columnsBox {
- margin-right: 10px;
- }
- .priceBox {
- width: 100%;
- }
- .rulesBox {
- display: flex;
- flex-wrap: wrap;
- }
- .pictrueBox {
- display: inline-block;
- }
- .pictrueTab {
- width: 40px !important;
- height: 40px !important;
- }
- .pictrue {
- width: 60px;
- height: 60px;
- border: 1px dotted rgba(0, 0, 0, 0.1);
- margin-right: 15px;
- margin-bottom 10px;
- display: inline-block;
- position: relative;
- cursor: pointer;
- img {
- width: 100%;
- height: 100%;
- }
- .btndel {
- position: absolute;
- z-index: 1;
- width: 20px !important;
- height: 20px !important;
- left: 46px;
- top: -4px;
- }
- }
- .upLoad {
- width: 58px;
- height: 58px;
- line-height: 58px;
- border: 1px dotted rgba(0, 0, 0, 0.1);
- border-radius: 4px;
- background: rgba(0, 0, 0, 0.02);
- cursor: pointer;
- }
- .curs {
- cursor: pointer;
- }
- .inpWith {
- width: 60%;
- }
- .labeltop {
- >>>.ivu-form-item-label {
- float: none !important;
- display: inline-block !important;
- margin-left: 120px !important;
- width: auto !important;
- }
- .icondrop-down {
- font-size: 12px;
- margin-left: 5px;
- }
- }
- .video-icon {
- background-image: url('https://cdn.oss.9gt.net/prov1.1/1/icons.png'); // cdn.oss.9gt.net/prov1.1/1/icons.png);
- // background-color: #fff;
- background-position: -9999px;
- background-repeat: no-repeat;
- }
- .progress {
- margin-top: 10px;
- }
- .new_tab {
- >>>.ivu-tabs-nav .ivu-tabs-tab {
- padding: 4px 16px 20px !important;
- font-weight: 500;
- }
- }
- </style>
|