shopAmend.vue 48 KB

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