shopPublish.vue 47 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599
  1. <template>
  2. <div class="components-container main-cont">
  3. <div style="display: inline-block;font-size:18px;margin-bottom: 15px;">
  4. <a href="#" @click="prev" style="text-decoration:none;font-size: 14px;">
  5. <icon-svg
  6. name="jiantou"
  7. style="width: 1.2em;height: 1.2em;position: relative;top: 0.3em;"
  8. ></icon-svg>
  9. 返回
  10. </a>
  11. <span style="display: inline-block;margin: 0 15px;color: #D9D9D9;"
  12. >|</span
  13. >
  14. <span>商品发布</span>
  15. <div style="color:red;">
  16. 新增商品默认库存为1000件,需要修改可点击操作批量修改库存
  17. </div>
  18. </div>
  19. <div v-loading="tableDataLoading">
  20. <div style="position: relative;">
  21. <el-row>
  22. <el-col :span="8">
  23. <span>商品名称:</span>
  24. <el-input
  25. style="width: 200px;"
  26. class="margin15"
  27. placeholder="请输入商品标题"
  28. v-model="goodsName"
  29. autosize
  30. >
  31. </el-input>
  32. </el-col>
  33. <el-col :span="8">
  34. <span>商品分类:</span>
  35. <el-select
  36. v-model="classifyId"
  37. class="margin15"
  38. placeholder="请选择商品类型"
  39. style="width:200px;"
  40. @change="handleChange1"
  41. >
  42. <el-option
  43. v-for="(item, index) in typeDatas"
  44. :key="index"
  45. :label="item.classifyName"
  46. :value="item.classifyId"
  47. >
  48. </el-option>
  49. </el-select>
  50. </el-col>
  51. <!-- <el-col :span="6" >
  52. <span>商户号 :&nbsp;&nbsp;</span>
  53. <el-input style="width:200px;" class="margin15" placeholder="请输入商户号" v-model="merchants" autosize></el-input>
  54. </el-col> -->
  55. <el-col :span="8">
  56. <span>商品原价(选填):</span>
  57. <el-input
  58. style="width:200px;"
  59. class="margin15"
  60. placeholder="请输入商品原价"
  61. type="number"
  62. :min="0"
  63. :controls="false"
  64. v-model="originalMoney"
  65. autosize
  66. ></el-input>
  67. </el-col>
  68. <el-col :span="8">
  69. <span>折扣价格:</span>
  70. <el-input
  71. style="width:200px;"
  72. class="margin15"
  73. placeholder="请输入折扣价格"
  74. type="number"
  75. :min="0"
  76. :controls="false"
  77. v-model="goodsMoney"
  78. autosize
  79. ></el-input>
  80. </el-col>
  81. <el-col :span="8">
  82. <span>打包费(选填):</span>
  83. <el-input
  84. style="width:200px;"
  85. class="margin15"
  86. placeholder="请输入打包费"
  87. type="number"
  88. :min="0"
  89. :controls="false"
  90. v-model="packMoney"
  91. autosize
  92. ></el-input>
  93. </el-col>
  94. <el-col :span="8">
  95. <span>商品销量(选填):</span>
  96. <el-input
  97. style="width:200px;"
  98. class="margin15"
  99. placeholder="请输入商品销量"
  100. type="number"
  101. :min="0"
  102. :controls="false"
  103. v-model="sales"
  104. autosize
  105. ></el-input>
  106. </el-col>
  107. <!-- <el-col :span="8">
  108. <span>库存:</span>
  109. <el-input style="width:200px;" class="margin15" placeholder="请输入库存" type="number" :min="0" :controls="false"
  110. v-model="inventory" autosize></el-input>
  111. </el-col> -->
  112. <!-- <el-col :span="8">
  113. <span>商品状态:</span>
  114. <el-select v-model="status" class="margin15" placeholder="请选择商品状态" style="width:200px;">
  115. <el-option v-for="(item,index) in statusmain2" :key="item.index" :label="item.label"
  116. :value="item.value">
  117. </el-option>
  118. </el-select>
  119. </el-col> -->
  120. <el-col :span="8">
  121. <span>商品简介(选填):</span>
  122. <el-input
  123. style="width:200px;"
  124. class="margin15"
  125. placeholder="请输入商品简介"
  126. type="text"
  127. :controls="false"
  128. v-model="goodsDescribe"
  129. autosize
  130. ></el-input>
  131. </el-col>
  132. </el-row>
  133. <el-row>
  134. <!-- <el-col :span="6">
  135. <span>会员价格:</span>
  136. <el-input style="width:200px;" class="margin15" placeholder="请输入会员价格" type="number" :min="0" :controls="false"
  137. v-model="memberPrice" autosize></el-input>
  138. </el-col>
  139. <el-col :span="6">
  140. <span>商品佣金:</span>
  141. <el-input style="width:200px;" class="margin15" placeholder="例0.1 等于10%" type="number" :min="0"
  142. :controls="false" v-model="commissionPrice" autosize></el-input>
  143. </el-col> -->
  144. </el-row>
  145. <el-row>
  146. <!-- <el-col :span="6">
  147. <span>必买理由:</span>
  148. <el-input style="width:200px;" class="margin15" placeholder="请输入必买理由" v-model="buyReason" autosize></el-input>
  149. </el-col>
  150. <el-col :span="6" style="margin-top: 20px;">
  151. <span>精选好物:</span>
  152. <el-radio-group v-model="isSelect">
  153. <el-radio :label="1">是</el-radio>
  154. <el-radio :label="0">否</el-radio>
  155. </el-radio-group>
  156. </el-col>
  157. <el-col :span="6" style="margin-top: 20px;">
  158. <span>首页商品:</span>
  159. <el-radio-group v-model="homeGoods">
  160. <el-radio :label="1">是</el-radio>
  161. <el-radio :label="0">否</el-radio>
  162. </el-radio-group>
  163. </el-col>
  164. <el-col :span="6" style="margin-top: 20px;">
  165. <span>每日推荐:</span>
  166. <el-radio-group v-model="isRecommend">
  167. <el-radio :label="1">是</el-radio>
  168. <el-radio :label="0">否</el-radio>
  169. </el-radio-group>
  170. </el-col> -->
  171. </el-row>
  172. <el-row>
  173. <!-- <el-col :span="6">
  174. <span>是否发货:</span>
  175. <el-select v-model="isExpress" class="margin15" placeholder="请选择商品是否发货" style="width:200px;">
  176. <el-option v-for="(item,index) in isExpressmain" :key="item.index" :label="item.label" :value="item.value">
  177. </el-option>
  178. </el-select>
  179. </el-col>
  180. <el-col :span="6">
  181. <span>商品品牌:</span>
  182. <el-select v-model="brandId" class="margin15" placeholder="请选择商品品牌" style="width:200px;">
  183. <el-option v-for="(item,index) in brandIds" :key="item.index" :label="item.label" :value="item.value">
  184. </el-option>
  185. </el-select>
  186. </el-col> -->
  187. <el-col :span="24">
  188. <div style="margin-top: 10px;">
  189. <span>商品标签:</span>
  190. <span class="bqList" v-for="(item, index) in labels" :key="index"
  191. >{{ item }}
  192. <span class="delss">
  193. <i class="el-icon-delete" @click="dels1(index)"></i>
  194. </span>
  195. </span>
  196. <el-input
  197. v-model="bq"
  198. style="width:200px;"
  199. placeholder="请输入标签"
  200. onkeyup="this.value=this.value.replace(/[, ]/g,'')"
  201. ></el-input>
  202. <!-- <button class="tj" @click="btnTj">添加标签</button> -->
  203. <el-button
  204. type="primary"
  205. class="tj"
  206. size="mini"
  207. icon="el-icon-edit"
  208. circle
  209. @click="btnTj"
  210. >
  211. </el-button>
  212. </div>
  213. </el-col>
  214. </el-row>
  215. <div style="display: flex;align-items: center;margin: 2% 0;">
  216. <span style="display: inline-block;text-align: right;"
  217. >商品封面图:</span
  218. >
  219. <div
  220. style=" width:148px;height:148px;background-color: #fbfdff; border: 1px dashed #c0ccda;border-radius: 6px;text-align: center;line-height: 148px;"
  221. >
  222. <el-upload
  223. class="avatar-uploader"
  224. v-model="goodsCover"
  225. :action="Tupiantou"
  226. :show-file-list="false"
  227. :on-success="handleAvatarSuccess1"
  228. :before-upload="beforeAvatarUpload"
  229. >
  230. <img
  231. v-if="goodsCover"
  232. :src="goodsCover"
  233. class="avatar"
  234. style="width: 148px;height: 148px;"
  235. />
  236. <i
  237. v-else
  238. class="el-icon-plus avatar-uploader-icon"
  239. style="font-size: 28px;color: #8c939d"
  240. ></i>
  241. </el-upload>
  242. </div>
  243. </div>
  244. <div
  245. style="display: flex;align-items: center;margin: 2% 0;flex-flow: wrap;"
  246. >
  247. <span style="display: inline-block;text-align: right;"
  248. >商品轮播图:</span
  249. >
  250. <div>
  251. <el-upload
  252. :action="Tupiantou"
  253. list-type="picture-card"
  254. :on-success="handleUploadSuccess"
  255. :on-change="handleChange"
  256. :on-remove="handleRemove"
  257. :before-upload="beforeAvatarUpload"
  258. >
  259. <i class="el-icon-plus"></i>
  260. </el-upload>
  261. </div>
  262. </div>
  263. <div style="display: flex;align-items: center;margin: 2% 0;">
  264. <span style="display: inline-block;text-align: right;"
  265. >商品规格:</span
  266. >
  267. <el-radio-group v-model="guige" @change="guigeChange">
  268. <el-radio :label="0">单规格</el-radio>
  269. <el-radio :label="1">多规格</el-radio>
  270. </el-radio-group>
  271. <div v-if="guigeshow" style="margin-left: 20px;">
  272. <el-select
  273. v-model="ruleId"
  274. placeholder="请选择商品规格"
  275. style="width:200px;"
  276. @change="selectTrigger(ruleId)"
  277. >
  278. <el-option
  279. v-for="(item, index) in specifdata"
  280. :key="item.index"
  281. :label="item.ruleName"
  282. :value="item.id"
  283. >
  284. </el-option>
  285. </el-select>
  286. </div>
  287. </div>
  288. <div v-if="ruleValue" style="margin-left: 70px;">
  289. <div class="ruleitem" v-for="(item, index) in ruleValue" :key="index">
  290. <div>
  291. {{ item.value }}
  292. <span @click="deleterule(index)">
  293. <icon-svg name="schu" class="ruleicon"></icon-svg>
  294. </span>
  295. </div>
  296. <div>
  297. <el-tag
  298. :key="tag"
  299. v-for="(tag, j) in item.detail.split(',')"
  300. closable
  301. :disable-transitions="false"
  302. @close="handleClose(tag, j, item)"
  303. >
  304. {{ tag }}
  305. </el-tag>
  306. <el-input
  307. class="input-new-tag"
  308. v-model="inputValues[index]"
  309. ref="saveTagInput"
  310. size="small"
  311. style="width:120px;"
  312. placeholder="请输入属性名"
  313. @keyup.enter.native="handleInputConfirm(index, item)"
  314. >
  315. </el-input>
  316. <el-button
  317. class="button-new-tag"
  318. size="small"
  319. @click="handleInputConfirm(index, item)"
  320. >添加
  321. </el-button>
  322. </div>
  323. </div>
  324. <div style="margin-top:20px;" v-if="ruleshow">
  325. <div v-if="isshow" class="btn_specif">
  326. <el-button type="primary" @click="btnToclick()"
  327. >添加新规格</el-button
  328. >
  329. <el-button type="success" @click="create()">立即生成</el-button>
  330. </div>
  331. </div>
  332. <div style="margin-top:10px;">
  333. <div v-if="!isshow" style="margin-top: 20px;">
  334. <div style="display: inline-block;">
  335. <span
  336. style="width:80px;display: inline-block;text-align: right;"
  337. >规格:</span
  338. >
  339. <el-input
  340. style="width:50%;"
  341. v-model="releobject.value"
  342. placeholder="例:颜色"
  343. ></el-input>
  344. </div>
  345. <div style="display: inline-block;">
  346. <span
  347. style="width:80px;display: inline-block;text-align: right;"
  348. >规格值:</span
  349. >
  350. <el-input
  351. style="width:50%;"
  352. v-model="releobject.detail"
  353. placeholder="例:黑色"
  354. ></el-input>
  355. </div>
  356. <div style="display: inline-block;">
  357. <el-button type="primary" @click="speciTo()">确 定</el-button>
  358. <el-button @click="speciTotwo()">取 消</el-button>
  359. </div>
  360. </div>
  361. </div>
  362. </div>
  363. <div style="display: flex;margin-top: 20px;" v-if="propshow">
  364. <span>商品属性:</span>
  365. <div class="property_table">
  366. <table style="width: 100%;">
  367. <tr style="display:flex;">
  368. <th
  369. style="width:120px;text-align: left;"
  370. v-for="item in headerData"
  371. v-if="item != '图片'"
  372. >
  373. {{ item }}
  374. </th>
  375. </tr>
  376. </table>
  377. <el-table :data="valueData">
  378. <el-table-column
  379. v-if="detailJson.length == 1"
  380. prop="value0"
  381. width="120"
  382. >
  383. </el-table-column>
  384. <el-table-column
  385. v-if="detailJson.length == 2"
  386. prop="value0"
  387. width="120"
  388. >
  389. </el-table-column>
  390. <el-table-column
  391. v-if="detailJson.length == 2"
  392. prop="value1"
  393. width="120"
  394. >
  395. </el-table-column>
  396. <el-table-column
  397. v-if="detailJson.length == 3"
  398. prop="value0"
  399. width="120"
  400. >
  401. </el-table-column>
  402. <el-table-column
  403. v-if="detailJson.length == 3"
  404. prop="value1"
  405. width="120"
  406. >
  407. </el-table-column>
  408. <el-table-column
  409. v-if="detailJson.length == 3"
  410. prop="value2"
  411. width="120"
  412. >
  413. </el-table-column>
  414. <el-table-column
  415. v-if="detailJson.length == 4"
  416. prop="value0"
  417. width="120"
  418. >
  419. </el-table-column>
  420. <el-table-column
  421. v-if="detailJson.length == 4"
  422. prop="value1"
  423. width="120"
  424. >
  425. </el-table-column>
  426. <el-table-column
  427. v-if="detailJson.length == 4"
  428. prop="value2"
  429. width="120"
  430. >
  431. </el-table-column>
  432. <el-table-column
  433. v-if="detailJson.length == 4"
  434. prop="value3"
  435. width="120"
  436. >
  437. </el-table-column>
  438. <el-table-column
  439. v-if="detailJson.length == 5"
  440. prop="value0"
  441. width="120"
  442. >
  443. </el-table-column>
  444. <el-table-column
  445. v-if="detailJson.length == 5"
  446. prop="value1"
  447. width="120"
  448. >
  449. </el-table-column>
  450. <el-table-column
  451. v-if="detailJson.length == 5"
  452. prop="value2"
  453. width="120"
  454. >
  455. </el-table-column>
  456. <el-table-column
  457. v-if="detailJson.length == 5"
  458. prop="value3"
  459. width="120"
  460. >
  461. </el-table-column>
  462. <el-table-column
  463. v-if="detailJson.length == 5"
  464. prop="value4"
  465. width="120"
  466. >
  467. </el-table-column>
  468. <!-- <el-table-column prop="skuImg" width="100">
  469. <template slot-scope="scope">
  470. <div class="imgWrap"
  471. style=" width:60px;height:60px;background-color: #fbfdff; border: 1px dashed #c0ccda;border-radius: 6px;text-align: center;line-height: 60px;">
  472. <el-upload style="width: 60px;height: 60px;" class="avatar-uploader" v-model="scope.row.skuImg"
  473. :action="Tupiantou" :show-file-list="false"
  474. :on-success="handleAvatarSuccess">
  475. <img v-if="scope.row.skuImg" :src="scope.row.skuImg" class="avatar"
  476. style="border-radius: 6px;width:60px;height: 60px;" @click="curRowIndex=scope.$index" />
  477. <i v-else class="el-icon-plus avatar-uploader-icon" @click="curRowIndex=scope.$index"></i>
  478. </el-upload>
  479. </div>
  480. </template>
  481. </el-table-column> -->
  482. <el-table-column prop="skuOriginalPrice" width="120">
  483. <template slot-scope="scope">
  484. <div>
  485. <el-input
  486. type="text"
  487. v-model="scope.row.skuOriginalPrice"
  488. style="width:80px;font-size:14px;"
  489. >
  490. </el-input>
  491. </div>
  492. </template>
  493. </el-table-column>
  494. <el-table-column prop="skuPrice" width="120">
  495. <template slot-scope="scope">
  496. <div>
  497. <el-input
  498. type="text"
  499. v-model="scope.row.skuPrice"
  500. style="width:80px;font-size:14px;"
  501. >
  502. </el-input>
  503. </div>
  504. </template>
  505. </el-table-column>
  506. <!-- <el-table-column prop="memberPrice" width="120">
  507. <template slot-scope="scope">
  508. <div>
  509. <el-input type="text" v-model="scope.row.memberPrice" style="width:80px;font-size:14px;">
  510. </el-input>
  511. </div>
  512. </template>
  513. </el-table-column> -->
  514. <!-- <el-table-column prop="stock" width="120">
  515. <template slot-scope="scope">
  516. <div>
  517. <el-input type="text" v-model="scope.row.stock" style="width:80px;font-size:14px;">
  518. </el-input>
  519. </div>
  520. </template>
  521. </el-table-column> -->
  522. <!-- <el-table-column prop="salesVolume" width="120">
  523. <template slot-scope="scope">
  524. <div>
  525. <el-input type="text" v-model="scope.row.salesVolume" style="width:80px;font-size:14px;">
  526. </el-input>
  527. </div>
  528. </template>
  529. </el-table-column> -->
  530. <el-table-column width="120">
  531. <template slot-scope="scope">
  532. <el-button
  533. size="mini"
  534. type="danger"
  535. @click="deleter(scope.$index)"
  536. >删除
  537. </el-button>
  538. </template>
  539. </el-table-column>
  540. </el-table>
  541. </div>
  542. </div>
  543. <div
  544. style="display: flex;margin-top: 20px;padding-top: 30px;"
  545. v-if="propshow1"
  546. >
  547. <span>商品属性:</span>
  548. <div class="property_table">
  549. <table style="width: 100%;">
  550. <tr style="display:flex;">
  551. <th
  552. style="width:150px;text-align: left;"
  553. v-for="item in headerData2"
  554. v-if="item != '图片'"
  555. >
  556. {{ item }}
  557. </th>
  558. </tr>
  559. </table>
  560. <el-table :data="valueData2">
  561. <!-- <el-table-column prop="skuImg" width="150">
  562. <template slot-scope="scope">
  563. <div class="imgWrap"
  564. style=" width:60px;height:60px;background-color: #fbfdff; border: 1px dashed #c0ccda;border-radius: 6px;text-align: center;line-height: 60px;">
  565. <el-upload style="width: 60px;height: 60px;" class="avatar-uploader" v-model="scope.row.skuImg"
  566. action="https://mxys.chuanghai-tech.com/sqx_fast/alioss/upload" :show-file-list="false"
  567. :on-success="handleAvatarSuccess3">
  568. <img v-if="scope.row.skuImg" :src="scope.row.skuImg" class="avatar"
  569. style="border-radius: 6px;width:60px;height: 60px;" @click="curRowIndex=scope.$index" />
  570. <i v-else class="el-icon-plus avatar-uploader-icon" @click="curRowIndex=scope.$index"></i>
  571. </el-upload>
  572. </div>
  573. </template>
  574. </el-table-column> -->
  575. <el-table-column prop="skuOriginalPrice" width="150">
  576. <template slot-scope="scope">
  577. <div>
  578. <el-input
  579. type="text"
  580. v-model="scope.row.skuOriginalPrice"
  581. style="width:80px;font-size:14px;"
  582. >
  583. </el-input>
  584. </div>
  585. </template>
  586. </el-table-column>
  587. <el-table-column prop="skuPrice" width="150">
  588. <template slot-scope="scope">
  589. <div>
  590. <el-input
  591. type="text"
  592. v-model="scope.row.skuPrice"
  593. style="width:80px;font-size:14px;"
  594. >
  595. </el-input>
  596. </div>
  597. </template>
  598. </el-table-column>
  599. <!-- <el-table-column prop="memberPrice" width="150">
  600. <template slot-scope="scope">
  601. <div>
  602. <el-input type="text" v-model="scope.row.memberPrice" style="width:80px;font-size:14px;">
  603. </el-input>
  604. </div>
  605. </template>
  606. </el-table-column> -->
  607. <!-- <el-table-column prop="stock" width="150">
  608. <template slot-scope="scope">
  609. <div>
  610. <el-input type="text" v-model="scope.row.stock" style="width:80px;font-size:14px;">
  611. </el-input>
  612. </div>
  613. </template>
  614. </el-table-column> -->
  615. <!-- <el-table-column prop="salesVolume" width="150">
  616. <template slot-scope="scope">
  617. <div>
  618. <el-input type="text" v-model="scope.row.salesVolume" style="width:80px;font-size:14px;">
  619. </el-input>
  620. </div>
  621. </template>
  622. </el-table-column> -->
  623. </el-table>
  624. </div>
  625. </div>
  626. <!-- <div style="height: 38px;line-height: 38px;margin:20px 0;">
  627. <span>是否包邮:</span>
  628. <el-radio-group v-model="positage" @change="agreeChange">
  629. <el-radio :label="0">是</el-radio>
  630. <el-radio :label="1">否</el-radio>
  631. <el-input v-if="priceshow" style="width:200px;margin-left: 10px;" placeholder="请输入邮费" type="number"
  632. v-model="postagePrice" autosize></el-input>
  633. </el-radio-group>
  634. </div> -->
  635. </div>
  636. <div class="tinymce-content" style="display: flex;">
  637. <div style="width:90px;">商品详情(选填):</div>
  638. <!-- <textarea id="tinymceId" :value="goodsDescribe" class="tinymce-textarea" /> -->
  639. <!-- <quill-editor ref="myTextEditor" v-model="goodsSynopsis" :options="quillOption"
  640. style="padding-bottom: 50px;height: 300px;width: 72%;display: inline-table;margin-bottom: 60px;">
  641. </quill-editor> -->
  642. <div v-for="(item, index) of goodsParticularsPicture">
  643. <div style="position: relative;margin: 5px;">
  644. <img
  645. :src="item"
  646. class="avatar"
  647. style="width:148px;height: 148px;"
  648. />
  649. <div @click="clearXq(index)" class="divhove">
  650. <i
  651. class="el-icon-delete"
  652. style="margin: 0;font-size: 18px;color: #fff;"
  653. ></i>
  654. </div>
  655. </div>
  656. </div>
  657. <div class="imgs" style="width: 50%;">
  658. <el-upload
  659. :action="Tupiantou"
  660. list-type="picture-card"
  661. :show-file-list="false"
  662. :on-success="handleUploadSuccessXq"
  663. :on-progress="onprogress1"
  664. :before-upload="beforeAvatarUpload"
  665. >
  666. <el-progress
  667. v-if="percentage1 > 0 && percentage1 < 100"
  668. type="circle"
  669. :percentage="percentage1"
  670. >
  671. </el-progress>
  672. <i v-else class="el-icon-plus"></i>
  673. </el-upload>
  674. <el-dialog :visible.sync="dialogVisible">
  675. <img width="100%" :src="dialogImageUrl" alt="" />
  676. </el-dialog>
  677. </div>
  678. </div>
  679. <div style="text-align: center;margin-top:30px;">
  680. <el-button
  681. style="margin:0 20px 0 0;"
  682. size="mini"
  683. type="primary"
  684. icon="document"
  685. @click="prev"
  686. >返回上一页
  687. </el-button>
  688. <el-button
  689. size="mini"
  690. type="primary"
  691. icon="document"
  692. @click="artiReleass"
  693. >发布商品
  694. </el-button>
  695. </div>
  696. </div>
  697. </div>
  698. </template>
  699. <script>
  700. import { quillEditor } from "vue-quill-editor";
  701. import "quill/dist/quill.core.css";
  702. import "quill/dist/quill.snow.css";
  703. import "quill/dist/quill.bubble.css";
  704. import quillConfig from "./quill-config.js";
  705. export default {
  706. components: {
  707. quillEditor
  708. },
  709. name: "Tinymce",
  710. data() {
  711. return {
  712. specif: "",
  713. typeId: "",
  714. goodsName: "",
  715. classifyId: "",
  716. merchants: "",
  717. originalMoney: "",
  718. goodsMoney: "",
  719. packMoney: "",
  720. goodsSynopsis: "",
  721. memberPrice: "",
  722. inventory: "", //库存
  723. labels: [], //标签集合
  724. bq: "", //输入的标签名
  725. positage: 1,
  726. guige: 1,
  727. skuImg: "",
  728. ruleId: "",
  729. postagePrice: "",
  730. priceshow: true,
  731. isshow: true,
  732. commissionPrice: "",
  733. buyReason: "",
  734. ruleshow: false,
  735. propshow: false,
  736. guigeshow: true,
  737. propshow1: false,
  738. tableDataLoading: false,
  739. ruleValue: [],
  740. attr: [],
  741. attrs: [],
  742. headerData: [],
  743. valueData: [],
  744. detailJson: [],
  745. inputValues: {
  746. inputValue0: "",
  747. inputValue1: "",
  748. inputValue2: "",
  749. inputValue3: "",
  750. inputValue4: "",
  751. inputValue5: ""
  752. },
  753. sku: [],
  754. img: "",
  755. sales: 0,
  756. salesVolume: "",
  757. status: 0,
  758. goodsPicture: "",
  759. typeDatas: [],
  760. value: [],
  761. isSelect: 1,
  762. homeGoods: 1,
  763. isRecommend: 1,
  764. isExpress: "",
  765. goodsCover: "",
  766. valueData2: [],
  767. headerData2: [],
  768. statusmain2: [
  769. {
  770. value: 0,
  771. label: "上架"
  772. },
  773. {
  774. value: 1,
  775. label: "下架"
  776. }
  777. ],
  778. isExpressmain: [
  779. {
  780. value: 1,
  781. label: "普通商品需要发货"
  782. },
  783. {
  784. value: 2,
  785. label: "虚拟商品无需发货"
  786. },
  787. {
  788. value: 3,
  789. label: "商铺核销无需发货"
  790. }
  791. ],
  792. attrName: "",
  793. ruleName: "",
  794. attrValue: [],
  795. releobject: {
  796. value: "",
  797. detail: ""
  798. },
  799. brandId: "",
  800. brandIds: [],
  801. specifdata: [],
  802. dialogVisible: false,
  803. isShow: false,
  804. hideUpload: false,
  805. limit: 1,
  806. id: "",
  807. hasChange: false,
  808. hasInit: false,
  809. tinymceId: "tinymceId",
  810. height: 435,
  811. toolbar: [],
  812. menubar: "file edit insert view format table",
  813. languageTypeList: {
  814. en: "en",
  815. zh: "zh_CN"
  816. },
  817. artiCletypes: [],
  818. // 富文本内容
  819. quillOption: quillConfig,
  820. goodsDescribe: "",
  821. potost: [],
  822. shopId: "",
  823. goodsParticularsPicture: [], //商品详情图
  824. percentage1: 0, //进度条
  825. dialogImageUrl: [],
  826. dialogVisible: false
  827. };
  828. },
  829. methods: {
  830. beforeAvatarUpload(file) {
  831. return this.$processImage(this, file, false);
  832. },
  833. // 图标上传
  834. handleAvatarSuccess(file) {
  835. if (this.curRowIndex == 0) {
  836. this.skuImg = file.data;
  837. this.valueData[0].skuImg = this.skuImg;
  838. return;
  839. } else {
  840. this.skuImg = file.data;
  841. this.valueData[this.curRowIndex].skuImg = this.skuImg;
  842. }
  843. },
  844. // 图标上传
  845. handleAvatarSuccess3(file) {
  846. this.skuImg = file.data;
  847. this.valueData2[0].skuImg = this.skuImg;
  848. },
  849. // 是否包邮
  850. agreeChange(val) {
  851. if (val == 1) {
  852. this.priceshow = true;
  853. this.postagePrice = "";
  854. } else {
  855. this.priceshow = false;
  856. this.postagePrice = 0;
  857. }
  858. },
  859. // 是否多规格
  860. guigeChange(val) {
  861. if (val == 1) {
  862. this.ruleId = "";
  863. this.guigeshow = true;
  864. this.propshow1 = false;
  865. } else {
  866. this.ruleId = 0;
  867. this.guigeshow = false;
  868. this.propshow1 = true;
  869. this.propshow = false;
  870. this.ruleshow = false;
  871. this.attr = [];
  872. this.ruleValue = [];
  873. this.guigeclect();
  874. }
  875. },
  876. // 单规格
  877. guigeclect() {
  878. if (this.originalMoney == "") {
  879. this.originalMoney = "0";
  880. }
  881. if (this.goodsMoney == "") {
  882. this.goodsMoney = this.goodsMoney;
  883. }
  884. this.$http({
  885. url: this.$http.adornUrl("admin/goods/onlyFormatAttr"),
  886. method: "get",
  887. params: this.$http.adornParams({
  888. originalPrice: this.originalMoney,
  889. price: this.goodsMoney
  890. // 'coverImg': this.goodsCover,
  891. })
  892. }).then(({ data }) => {
  893. let returnData = data.data;
  894. this.headerData2 = returnData.header;
  895. this.valueData2 = returnData.value;
  896. this.propshow = false;
  897. this.propshow1 = true;
  898. this.sku = returnData.value;
  899. });
  900. },
  901. handleChange1(value) {
  902. this.classifyId = value;
  903. },
  904. handleChange(file, fileList) {
  905. this.hideUpload = fileList.length >= this.limit;
  906. },
  907. handleRemove(file, fileList) {
  908. console.log(file, "删除", fileList);
  909. this.hideUpload = fileList.length >= this.limit;
  910. for (var i in this.potost) {
  911. if (this.potost[i] == file.response.data) {
  912. this.potost.splice(i, 1);
  913. }
  914. }
  915. console.log("this.potost", this.potost);
  916. },
  917. handleAvatarSuccess1(file, fileList) {
  918. this.goodsCover = file.data;
  919. },
  920. //上传成功
  921. handleUploadSuccess(file, fileList) {
  922. // this.goodsPicture += file.data + ','
  923. this.potost.push(file.data);
  924. },
  925. // 返回上一级
  926. prev() {
  927. this.$router.back();
  928. },
  929. // 添加标签
  930. btnTj() {
  931. if (this.bq == "" || this.bq == " ") {
  932. this.$notify({
  933. title: "提示",
  934. duration: 1800,
  935. message: "请输入标签名",
  936. type: "warning"
  937. });
  938. return;
  939. } else {
  940. console.log("this.bq", this.bq);
  941. this.labels.push(this.bq);
  942. this.bq = "";
  943. }
  944. },
  945. // 删除标签
  946. dels1(index) {
  947. this.labels.splice(index, 1);
  948. console.log(this.labels);
  949. },
  950. // 发布商品
  951. artiReleass() {
  952. let photost = this.potost.toString();
  953. console.log(this.goodsDescribe);
  954. console.log(this.potost.toString());
  955. // photost = photost.substr(0, photost.length - 1)
  956. let goodsLabel = this.labels.toString();
  957. if (this.goodsName == "") {
  958. this.$notify({
  959. title: "提示",
  960. duration: 1800,
  961. message: "请输入商品标题",
  962. type: "warning"
  963. });
  964. return;
  965. }
  966. if (this.classifyId == "") {
  967. this.$notify({
  968. title: "提示",
  969. duration: 1800,
  970. message: "请选择商品类型",
  971. type: "warning"
  972. });
  973. return;
  974. }
  975. if (this.originalMoney == "") {
  976. this.originalMoney = this.goodsMoney;
  977. // this.$notify({
  978. // title: '提示',
  979. // duration: 1800,
  980. // message: '请输入商品原价',
  981. // type: 'warning'
  982. // });
  983. // return
  984. }
  985. // if (this.originalMoney < 1) {
  986. // this.$notify({
  987. // title: '提示',
  988. // duration: 1800,
  989. // message: '商品原价不能小于1元',
  990. // type: 'warning'
  991. // });
  992. // return
  993. // }
  994. if (this.goodsMoney === "") {
  995. this.$notify({
  996. title: "提示",
  997. duration: 1800,
  998. message: "请输入折扣价格",
  999. type: "warning"
  1000. });
  1001. return;
  1002. }
  1003. if (this.packMoney == "") {
  1004. this.packMoney = "0";
  1005. // this.$notify({
  1006. // title: '提示',
  1007. // duration: 1800,
  1008. // message: '请输入打包费',
  1009. // type: 'warning'
  1010. // });
  1011. // return
  1012. }
  1013. if (this.goodsDescribe == "") {
  1014. this.goodsDescribe = "无";
  1015. // this.$notify({
  1016. // title: '提示',
  1017. // duration: 1800,
  1018. // message: '请输入简介',
  1019. // type: 'warning'
  1020. // });
  1021. // return
  1022. }
  1023. // if (this.salesVolume == '') {
  1024. // this.$notify({
  1025. // title: '提示',
  1026. // duration: 1800,
  1027. // message: '请输入商品销量',
  1028. // type: 'warning'
  1029. // });
  1030. // return
  1031. // }
  1032. if (this.goodsCover == "") {
  1033. this.$notify({
  1034. title: "提示",
  1035. duration: 1800,
  1036. message: "请选择商品封面图",
  1037. type: "warning"
  1038. });
  1039. return;
  1040. }
  1041. if (this.potost.length == 0) {
  1042. this.$notify({
  1043. title: "提示",
  1044. duration: 1800,
  1045. message: "请选择商品轮播图",
  1046. type: "warning"
  1047. });
  1048. return;
  1049. }
  1050. // if (this.goodsDescribe == '') {
  1051. // this.$notify({
  1052. // title: '提示',
  1053. // duration: 1800,
  1054. // message: '请输入商品详情',
  1055. // type: 'warning'
  1056. // });
  1057. // return
  1058. // }
  1059. // if (this.inventory == '') {
  1060. // this.$notify({
  1061. // title: '提示',
  1062. // duration: 1800,
  1063. // message: '请输入库存',
  1064. // type: 'warning'
  1065. // });
  1066. // return
  1067. // }
  1068. if (this.sku.length == 0) {
  1069. this.$notify({
  1070. title: "提示",
  1071. duration: 1800,
  1072. message: "请选择商品规格",
  1073. type: "warning"
  1074. });
  1075. return;
  1076. }
  1077. if (photost == "") {
  1078. this.$notify({
  1079. title: "提示",
  1080. duration: 1800,
  1081. message: "请上传轮播图",
  1082. type: "warning"
  1083. });
  1084. return;
  1085. }
  1086. if (this.goodsParticularsPicture.length == 0) {
  1087. this.goodsParticularsPicture = [
  1088. this.Tupian("/xiangqing/12ecc56005731327e02f42f0d851848.png")
  1089. ];
  1090. console.log(this.goodsParticularsPicture, "详情图");
  1091. // this.$notify({
  1092. // title: '提示',
  1093. // duration: 1800,
  1094. // message: '请上传商品详情图',
  1095. // type: 'warning'
  1096. // });
  1097. // return
  1098. }
  1099. if (this.guige == 0) {
  1100. if (this.valueData2.length > 0) {
  1101. if (
  1102. this.valueData2[0].skuOriginalPrice == null ||
  1103. this.valueData2[0].skuOriginalPrice === ""
  1104. ) {
  1105. this.$notify({
  1106. title: "提示",
  1107. duration: 1800,
  1108. message: "商品属性原价不能为空",
  1109. type: "warning"
  1110. });
  1111. return;
  1112. }
  1113. if (
  1114. this.valueData2[0].skuPrice == null ||
  1115. this.valueData2[0].skuPrice === ""
  1116. ) {
  1117. this.$notify({
  1118. title: "提示",
  1119. duration: 1800,
  1120. message: "商品属性售价不能为空",
  1121. type: "warning"
  1122. });
  1123. return;
  1124. }
  1125. }
  1126. this.sku = this.valueData2;
  1127. console.log("----", this.valueData2);
  1128. } else {
  1129. this.sku = this.valueData;
  1130. }
  1131. this.tableDataLoading = true;
  1132. this.$http({
  1133. url: this.$http.adornUrl("admin/goods/insertGoods"),
  1134. method: "post",
  1135. data: this.$http.adornData({
  1136. goodsPicture: photost,
  1137. goodsName: this.goodsName,
  1138. classifyId: this.classifyId,
  1139. originalMoney: this.originalMoney,
  1140. goodsMoney: this.goodsMoney,
  1141. packMoney: this.packMoney,
  1142. goodsSynopsis: this.goodsSynopsis,
  1143. memberPrice: this.memberPrice,
  1144. inventory: this.inventory,
  1145. salesVolume: this.salesVolume,
  1146. sales: this.sales,
  1147. status: this.status,
  1148. goodsCover: this.goodsCover,
  1149. goodsDescribe: this.goodsDescribe,
  1150. postagePrice: this.postagePrice,
  1151. sku: this.sku,
  1152. attr: this.attr,
  1153. goodsLabel: goodsLabel,
  1154. shopId: this.shopId,
  1155. goodsParticularsPicture: this.goodsParticularsPicture.toString()
  1156. })
  1157. }).then(({ data }) => {
  1158. if (data.code == 0) {
  1159. this.tableDataLoading = false;
  1160. this.$message({
  1161. message: "操作成功",
  1162. type: "success",
  1163. duration: 1500,
  1164. onClose: () => {
  1165. this.goodsName = "";
  1166. this.type = "";
  1167. this.merchants = "";
  1168. this.goodsMoney = "";
  1169. this.packMoney = "";
  1170. this.goodsSynopsis = "";
  1171. this.memberPrice = "";
  1172. this.inventory = "";
  1173. this.originalMoney = "";
  1174. this.salesVolume = "";
  1175. this.sales = "";
  1176. this.goodsDescribe = "";
  1177. this.postagePrice = "";
  1178. this.status = "";
  1179. this.buyReason = "";
  1180. this.brandId = "";
  1181. // this.$router.push({
  1182. // path: '/shopAdmin'
  1183. // })
  1184. this.$router.back();
  1185. }
  1186. });
  1187. } else {
  1188. this.tableDataLoading = false;
  1189. this.$message({
  1190. message: data.msg,
  1191. type: "warning",
  1192. duration: 1500,
  1193. onClose: () => {}
  1194. });
  1195. }
  1196. });
  1197. },
  1198. // 商品分类
  1199. dataSelect() {
  1200. this.tableDataLoading = true;
  1201. this.shopId = this.$cookie.get("shopId");
  1202. this.$http({
  1203. url: this.$http.adornUrl("admin/goods/selectAllClassify"),
  1204. method: "get",
  1205. params: this.$http.adornParams({
  1206. shopId: this.shopId
  1207. })
  1208. }).then(({ data }) => {
  1209. this.tableDataLoading = false;
  1210. let returnData = data.data;
  1211. this.typeDatas = returnData;
  1212. });
  1213. },
  1214. // 商品规格
  1215. specifSelect() {
  1216. this.shopId = this.$cookie.get("shopId");
  1217. this.$http({
  1218. url: this.$http.adornUrl("selfGoodsRule/list"),
  1219. method: "get",
  1220. params: this.$http.adornParams({
  1221. shopId: this.shopId
  1222. })
  1223. }).then(({ data }) => {
  1224. let returnData = data.data;
  1225. this.specifdata = returnData;
  1226. });
  1227. },
  1228. // 删除商品属性
  1229. deleter(index) {
  1230. let length = this.sku.length;
  1231. if (length == 1) {
  1232. this.$message({
  1233. title: "提示",
  1234. type: "error",
  1235. duration: 1800,
  1236. message: "属性至少要有一个",
  1237. type: "warning"
  1238. });
  1239. return;
  1240. } else {
  1241. this.sku.splice(index, 1);
  1242. }
  1243. },
  1244. // 查询商品规格
  1245. selectTrigger(val) {
  1246. this.$http({
  1247. url: this.$http.adornUrl("selfGoodsRule/find"),
  1248. method: "get",
  1249. params: this.$http.adornParams({
  1250. id: val
  1251. })
  1252. }).then(({ data }) => {
  1253. let returnData = data.data;
  1254. this.ruleValue = returnData.ruleValue;
  1255. this.attrName = returnData.ruleName;
  1256. this.ruleshow = true;
  1257. this.ruleId = returnData.id;
  1258. this.create();
  1259. });
  1260. },
  1261. deleterule(index) {
  1262. this.ruleValue.splice(index, 1);
  1263. },
  1264. btnToclick() {
  1265. this.isshow = false;
  1266. this.releobject.value = "";
  1267. this.releobject.detail = "";
  1268. },
  1269. speciTotwo() {
  1270. this.isshow = true;
  1271. this.releobject.value = "";
  1272. this.releobject.detail = "";
  1273. },
  1274. speciTo() {
  1275. if (this.releobject.value == "") {
  1276. this.$message({
  1277. title: "提示",
  1278. type: "error",
  1279. duration: 1800,
  1280. message: "请输入规格",
  1281. type: "warning"
  1282. });
  1283. return;
  1284. }
  1285. if (this.releobject.detail == "") {
  1286. this.$message({
  1287. title: "提示",
  1288. duration: 1800,
  1289. type: "error",
  1290. message: "请输入规格值",
  1291. type: "warning"
  1292. });
  1293. return;
  1294. }
  1295. this.ruleValue.push({
  1296. value: this.releobject.value,
  1297. detail: this.releobject.detail
  1298. });
  1299. this.isshow = true;
  1300. this.releobject.value = "";
  1301. this.releobject.detail = "";
  1302. },
  1303. handleClose(tag, j, item) {
  1304. var detailarr = item.detail.split(",");
  1305. detailarr.splice(j, 1);
  1306. if (detailarr.length < 1) {
  1307. this.$message({
  1308. title: "提示",
  1309. type: "error",
  1310. duration: 1800,
  1311. message: "规格值至少要有一个",
  1312. type: "warning"
  1313. });
  1314. return;
  1315. } else {
  1316. item.detail = String(detailarr);
  1317. }
  1318. },
  1319. handleInputConfirm(index, item) {
  1320. let inputValue = this.inputValues[index];
  1321. if (inputValue) {
  1322. var detailarr = item.detail.split(",");
  1323. detailarr.push(inputValue);
  1324. for (var i = 0; i < detailarr.length; i++) {
  1325. for (var j = 0; j < detailarr.length; j++) {
  1326. if (detailarr[i] == detailarr[j] && i != j) {
  1327. detailarr.splice(j, 1);
  1328. }
  1329. }
  1330. }
  1331. item.detail = String(detailarr);
  1332. this.inputValues[index] = "";
  1333. }
  1334. this.inputVisible = false;
  1335. },
  1336. // 获取品牌
  1337. // brandSelect() {
  1338. // let page = this.page - 1
  1339. // this.tableDataLoading = true
  1340. // this.$http({
  1341. // url: this.$http.adornUrl('selfGoodsBrand/result'),
  1342. // method: 'get',
  1343. // params: this.$http.adornParams({})
  1344. // }).then(({
  1345. // data
  1346. // }) => {
  1347. // this.tableDataLoading = false
  1348. // let returnData = data.data;
  1349. // this.brandIds = returnData
  1350. // })
  1351. // },
  1352. // 立即生成
  1353. create() {
  1354. this.attr = [];
  1355. this.attr.push({
  1356. attrName: this.attrName,
  1357. attrValue: this.ruleValue,
  1358. ruleId: this.ruleId
  1359. });
  1360. if (this.originalMoney == "") {
  1361. this.originalMoney = "0";
  1362. }
  1363. if (this.goodsMoney == "") {
  1364. this.goodsMoney = "0";
  1365. }
  1366. if (this.memberPrice == "") {
  1367. this.memberPrice = "0";
  1368. }
  1369. var axx = [];
  1370. if (Array.isArray(this.attr) && this.attr.length > 0) {
  1371. console.log(this.attr[0].attrValue, "ddkhg", this.attr[0]);
  1372. axx = this.attr[0].attrValue;
  1373. } else {
  1374. axx = [];
  1375. }
  1376. this.$http({
  1377. url: this.$http.adornUrl(
  1378. // `admin/goods/isFormatAttr?coverImg=${this.goodsCover}&originalPrice=${this.originalMoney}&price=${this.goodsMoney}`
  1379. `admin/goods/isFormatAttr`
  1380. ),
  1381. method: "post",
  1382. params: this.$http.adornParams({
  1383. originalPrice: this.originalMoney,
  1384. price: this.goodsMoney
  1385. }),
  1386. data: this.$http.adornData({
  1387. attrName: this.attr[0].attrName,
  1388. attrValue: axx,
  1389. ruleId: this.attr[0].ruleId
  1390. })
  1391. }).then(({ data }) => {
  1392. console.log(data,'ppp');
  1393. let returnData = data.data;
  1394. this.headerData = returnData.header;
  1395. this.valueData = returnData.value;
  1396. this.propshow = true;
  1397. this.propshow1 = false;
  1398. this.sku = returnData.value;
  1399. this.detailJson = returnData.value[0].detailJson.split(",");
  1400. });
  1401. },
  1402. // 删除详情图
  1403. clearXq(index) {
  1404. this.goodsParticularsPicture.splice(index, 1);
  1405. },
  1406. //上传成功
  1407. handleUploadSuccessXq(file, fileList) {
  1408. this.goodsParticularsPicture.push(file.data);
  1409. },
  1410. onprogress1(event, file, fileList) {
  1411. console.log("详情图上传进度", parseInt(event.percent));
  1412. this.percentage1 = parseInt(event.percent);
  1413. }
  1414. },
  1415. mounted() {
  1416. this.shopId = this.$route.query.shopId;
  1417. console.log("shopId:", this.shopId);
  1418. // this.init()
  1419. this.dataSelect();
  1420. this.specifSelect();
  1421. this.goodsName = "";
  1422. this.type = "";
  1423. this.merchants = "";
  1424. this.goodsMoney = "";
  1425. this.packMoney = "";
  1426. this.goodsSynopsis = "";
  1427. this.memberPrice = "";
  1428. this.inventory = "";
  1429. this.originalMoney = "";
  1430. this.salesVolume = "";
  1431. this.sales = "";
  1432. this.goodsDescribe = "";
  1433. this.postagePrice = "";
  1434. this.status = "";
  1435. this.buyReason = "";
  1436. this.brandId = "";
  1437. // this.brandSelect()
  1438. }
  1439. };
  1440. </script>
  1441. <style scoped="scoped">
  1442. .main-cont {
  1443. max-width: 100%;
  1444. min-width: 80%;
  1445. padding-bottom: 5%;
  1446. background-color: #fff;
  1447. }
  1448. .tinymce-container {
  1449. position: relative;
  1450. line-height: normal;
  1451. }
  1452. .tinymce-container >>> .mce-fullscreen {
  1453. z-index: 10000;
  1454. }
  1455. .tinymce-textarea {
  1456. visibility: hidden;
  1457. z-index: -1;
  1458. }
  1459. .hide .el-upload--picture-card {
  1460. display: none;
  1461. }
  1462. .margin15 {
  1463. margin-right: 15px;
  1464. margin-top: 10px;
  1465. }
  1466. .ruleitem {
  1467. padding-left: 10px;
  1468. margin-top: 15px;
  1469. }
  1470. .ruleitem .ruleicon {
  1471. position: relative;
  1472. top: 3px;
  1473. left: 2px;
  1474. width: 1.2em;
  1475. height: 1.2em;
  1476. }
  1477. .el-tag + .el-tag {
  1478. margin-left: 10px;
  1479. }
  1480. .button-new-tag {
  1481. height: 32px;
  1482. line-height: 31px;
  1483. padding-top: 0;
  1484. padding-bottom: 0;
  1485. border-radius: 4px;
  1486. border-top-left-radius: 0;
  1487. border-bottom-left-radius: 0;
  1488. background-color: #f5f7fa;
  1489. position: relative;
  1490. left: -5px;
  1491. border-color: #dcdfe6;
  1492. border: 1px solid #dcdfe6;
  1493. }
  1494. .input-new-tag {
  1495. width: 90px;
  1496. margin-left: 10px;
  1497. vertical-align: bottom;
  1498. }
  1499. .el-input--small .el-input__inner {
  1500. border-top-right-radius: 0;
  1501. border-bottom-right-radius: 0;
  1502. }
  1503. .el-table--enable-row-transition .el-table__body td {
  1504. text-align: center;
  1505. }
  1506. .imgWrap .avatar-uploader .el-upload {
  1507. width: 60px;
  1508. }
  1509. .el-table .cell {
  1510. text-align: center !important;
  1511. }
  1512. .el-tag--medium {
  1513. margin-right: 10px;
  1514. }
  1515. .bqList {
  1516. padding: 4px 14px;
  1517. margin: 4px;
  1518. border: 1px solid #efefef;
  1519. font-size: 12px;
  1520. color: #999;
  1521. border-radius: 4px;
  1522. margin-right: 15px;
  1523. }
  1524. .delss {
  1525. display: none;
  1526. position: relative;
  1527. }
  1528. .delss .el-icon-delete {
  1529. position: absolute;
  1530. top: 0;
  1531. }
  1532. .bqList:hover .delss {
  1533. display: initial;
  1534. opacity: 0.5;
  1535. }
  1536. .tj {
  1537. padding: 6px !important;
  1538. margin: 4px;
  1539. font-size: 12px;
  1540. border: 1px solid #ccc;
  1541. border-radius: 4px;
  1542. }
  1543. .divhove {
  1544. position: absolute;
  1545. width: 100%;
  1546. height: 100%;
  1547. left: 0;
  1548. top: 0;
  1549. opacity: 0;
  1550. cursor: default;
  1551. text-align: center;
  1552. padding-top: 50%;
  1553. border-radius: 6px;
  1554. background-color: rgba(0, 0, 0, 0.5);
  1555. -webkit-transition: opacity 0.3s;
  1556. transition: opacity 0.3s;
  1557. }
  1558. .el-tag--medium {
  1559. margin-right: 10px;
  1560. }
  1561. .divhove:hover {
  1562. opacity: 0.8;
  1563. }
  1564. </style>