shopAmend.vue 48 KB

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