sku.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721
  1. <template>
  2. <div class="container add_edit">
  3. <el-form label-width="150px">
  4. <div>
  5. <h3 class="margin_b_20">SKU</h3>
  6. <div>
  7. <el-form-item label="开启SKU">
  8. <el-switch @change="open_switch_sku" v-model="switch_sku" active-color="#ff6a6c"
  9. inactive-color="#dcdfe6"></el-switch>
  10. </el-form-item>
  11. <el-button v-if="skuGroups.length<2 && switch_sku" class="button-new-tag" size="small"
  12. @click="addSKU" style="margin:0 80px 20px;">添加SKU</el-button>
  13. <div v-for="(item,index) in skuGroups">
  14. <el-form-item :label="`编辑SKU${index+1}`" v-if="switch_sku">
  15. <div>
  16. <!-- <el-checkbox @change="open_spec" class="margin_r_10"
  17. v-model="checked_spec"></el-checkbox> -->
  18. <el-input v-model="item.attrName" placeholder="编辑SKU"></el-input>
  19. </div>
  20. <div class="dflex margin_t_20">
  21. <el-tag type="info" class="tag-new-tag" :key="idx" v-for="(tag, idx) in item.attrValues"
  22. :closable="checked_spec" :disable-transitions="false"
  23. @close="handleClose_spec(tag,index)">
  24. {{ tag.attrValue }}
  25. </el-tag>
  26. <el-input class="input-new-tag" v-if="tagindex == item.attrName && inputVisible_spec"
  27. v-model="inputValue_spec" ref="saveTagInput_spec"
  28. @keyup.enter.native="handleInputConfirm_spec(item,index)"
  29. @blur="handleInputConfirm_spec(item,index)"></el-input>
  30. <el-button :disabled="!checked_spec" v-else class="button-new-tag" size="small"
  31. @click="showInput_spec(item,index)">添加</el-button>
  32. </div>
  33. </el-form-item>
  34. </div>
  35. <!-- <el-form-item label="编辑SKU1" v-if="switch_sku">
  36. <div>
  37. <el-checkbox @change="open_spec" class="margin_r_10" v-model="checked_spec"></el-checkbox>
  38. <el-input v-model="spec_s" placeholder="规格"></el-input>
  39. </div>
  40. <div class="dflex margin_t_20">
  41. <el-tag type="info" class="tag-new-tag" :key="idx" v-for="(tag, idx) in dynamicTags_spec"
  42. :closable="checked_spec" :disable-transitions="false" @close="handleClose_spec(tag)">
  43. {{ tag }}
  44. </el-tag>
  45. <el-input class="input-new-tag" v-if="inputVisible_spec" v-model="inputValue_spec"
  46. ref="saveTagInput_spec" @keyup.enter.native="handleInputConfirm_spec"
  47. @blur="handleInputConfirm_spec"></el-input>
  48. <el-button :disabled="!checked_spec" v-else class="button-new-tag" size="small"
  49. @click="showInput_spec">添加</el-button>
  50. </div>
  51. </el-form-item>
  52. <el-form-item label="编辑SKU2" v-if="switch_sku">
  53. <div>
  54. <el-checkbox @change="open_spec2" class="margin_r_10" v-model="checked_spec2"></el-checkbox>
  55. <el-input v-model="spec_s2" placeholder="颜色"></el-input>
  56. </div>
  57. <div class="dflex margin_t_20">
  58. <el-tag type="info" class="tag-new-tag" :key="idx" v-for="(tag, idx) in dynamicTags_spec2"
  59. :closable="checked_spec2" :disable-transitions="false" @close="handleClose_spec2(tag)">
  60. {{ tag }}
  61. </el-tag>
  62. <el-input class="input-new-tag" v-if="inputVisible_spec2" v-model="inputValue_spec2"
  63. ref="saveTagInput_spec2" @keyup.enter.native="handleInputConfirm_spec2"
  64. @blur="handleInputConfirm_spec2"></el-input>
  65. <el-button :disabled="!checked_spec2" v-else class="button-new-tag" size="small"
  66. @click="showInput_spec2">添加</el-button>
  67. </div>
  68. </el-form-item> -->
  69. <el-form-item v-if="switch_sku">
  70. <el-table :data="tableSkuData" border>
  71. <el-table-column label="图片" align="center">
  72. <template slot-scope="scope">
  73. <image style="width: 80px;height: 80px;" width="60%" :src="scope.row.skuImg" alt="">
  74. </image>
  75. <el-upload action="" list-type="picture" :on-remove="handleRemove"
  76. :on-change="handleChange" :http-request="
  77. (file) => {
  78. return handleUpload(file, scope.row);
  79. }
  80. ">
  81.                           <template #trigger>
  82.                             <view>+
  83. <!-- <image style="width: 80px;height: 80px;" width="60%" :src="scope.row.skuImg" alt=""></image> -->
  84. </view>
  85.                           </template>
  86.                         </el-upload>
  87. <!-- <uni-file-picker v-model="scope.row.imgs" fileMediatype="image" returnType="object"
  88. @select="imgDelete" @delete="Delete" /> -->
  89. </template>
  90. </el-table-column>
  91. <el-table-column label="销售价格" align="center">
  92. <template slot-scope="scope">
  93. <el-input class="sort-container"
  94. oninput="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" min="0.01"
  95. v-model="scope.row.price">
  96. </el-input>
  97. </template>
  98. </el-table-column>
  99. <el-table-column label="市场价格" align="center">
  100. <template slot-scope="scope">
  101. <el-input class="sort-container"
  102. oninput="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" min="0.01"
  103. v-model="scope.row.marketPrice">
  104. </el-input>
  105. </template>
  106. </el-table-column>
  107. <el-table-column label="库存" align="center">
  108. <template slot-scope="scope">
  109. <el-input class="sort-container" type="number" v-model.number="scope.row.stockNum">
  110. </el-input>
  111. </template>
  112. </el-table-column>
  113. <!-- <el-table-column v-for="i in skuGroups" :prop="skuGroups.length==1?'spec':'spec2'"
  114. :label="i.attrName" align="center">
  115. </el-table-column> -->
  116. <template v-if="skuGroups.length==1">
  117. <el-table-column prop="spec" :label="skuGroups[0].attrName" align="center">
  118. </el-table-column>
  119. </template>
  120. <template v-if="skuGroups.length==2">
  121. <el-table-column prop="spec" :label="skuGroups[0].attrName" align="center">
  122. </el-table-column>
  123. <el-table-column prop="spec2" :label="skuGroups[1].attrName" align="center">
  124. </el-table-column>
  125. </template>
  126. </el-table>
  127. </el-form-item>
  128. </div>
  129. </div>
  130. </el-form>
  131. </div>
  132. </template>
  133. <script>
  134. export default {
  135. data() {
  136. return {
  137. switch_sku: true,
  138. skus: [],
  139. goods: {},
  140. skuGroups: [],
  141. tagindex: "", // 点击那个规格
  142. dynamicTags_spec: [], //规格
  143. dynamicTags_spec2: [], //颜色
  144. inputVisible_spec: false,
  145. inputVisible_spec2: false,
  146. inputValue_spec: '',
  147. inputValue_spec2: '',
  148. checked_spec: true,
  149. checked_spec2: true,
  150. spec_s: '规格',
  151. spec_s2: '颜色',
  152. tableData: [],
  153. tableSkuData: [],
  154. form: {}
  155. };
  156. },
  157. watch: {
  158. checked_spec: function(arrs) {
  159. for (var i = 0; i < arrs.length; i++) {
  160. for (var j = i + 1; j < arrs.length; j++) {
  161. if (arrs[i] == arrs[j]) {
  162. //第一个等同于第二个,splice方法删除第二个
  163. arrs.splice(j, 1);
  164. j--;
  165. }
  166. }
  167. }
  168. }
  169. },
  170. methods: {
  171. submitData(callback) {
  172. this.skus = [];
  173. console.log(this.tableSkuData)
  174. this.tableSkuData.forEach(x => {
  175. this.skus.push(x);
  176. });
  177. if (typeof callback === 'function') {
  178. callback(
  179. this.skus, this.switch_sku,
  180. JSON.stringify({
  181. spec_s: this.spec_s,
  182. spec_s2: this.spec_s2,
  183. spec: this.dynamicTags_spec,
  184. spec2: this.dynamicTags_spec2,
  185. })
  186. );
  187. }
  188. },
  189. getData(callback) {
  190. this.submitData(callback);
  191. },
  192. setData(res) {
  193. console.log(res, 'goods')
  194. if (!res.skus) {
  195. this.switch_sku = false
  196. }
  197. this.form = res;
  198. console.log(this.form.skuGroups, 'skus')
  199. this.form.skuGroups.forEach(item => {
  200. item.attrValues.forEach(i => {
  201. if (item.attrName) {
  202. i.attrName = item.attrName
  203. }
  204. })
  205. })
  206. this.skuGroups = this.form.skuGroups
  207. console.log(this.skuGroups, "skuGroups数据");
  208. let skus = this.form.skuGroups
  209. this.tableSkuData = res.skus;
  210. // let skus = JSON.parse(this.form);
  211. console.log(skus, 'skus', skus[0].attrName)
  212. // this.spec_s = skus[0].attrName
  213. // this.spec_s2 = skus[1].attrName;
  214. for (var i = 0; i < this.tableSkuData.length; i++) {
  215. if (this.tableSkuData[i].saleAttrs.length == 1) {
  216. this.tableSkuData[i].spec = this.tableSkuData[i].saleAttrs[0].attrValue
  217. } else if (this.tableSkuData[i].saleAttrs.length == 2) {
  218. this.tableSkuData[i].spec = this.tableSkuData[i].saleAttrs[0].attrValue
  219. this.tableSkuData[i].spec2 = this.tableSkuData[i].saleAttrs[1].attrValue
  220. } else if (this.tableSkuData[i].saleAttrs.length == 0) {
  221. this.tableSkuData[i].spec = ''
  222. }
  223. }
  224. console.log(this.tableSkuData)
  225. skus[0].attrValues.forEach(data => {
  226. this.dynamicTags_spec.push(data.attrValue)
  227. })
  228. skus[1].attrValues.forEach(data => {
  229. this.dynamicTags_spec2.push(data.attrValue)
  230. })
  231. console.log(this.dynamicTags_spec)
  232. this.checked_spec = this.dynamicTags_spec.length > 0;
  233. },
  234. setGoods(res) {
  235. this.goods = res;
  236. },
  237. // 标签循环数据(递归)
  238. // tagForE(data, ind) {
  239. // this.tableSkuData = []
  240. // new Promise(function(resolve) {
  241. // data.forEach(item => {
  242. // arr.forEach()
  243. // })
  244. // resolve();
  245. // }).then(() => {
  246. // for (let i = 0; i < 10; i++) {
  247. // //异步操作
  248. // tagForE.exec(i);
  249. // }
  250. // }).then(() => {
  251. // console.log("All Promise finished");
  252. // });
  253. // },
  254. affirm() {
  255. var imgsku = ''
  256. if (!this.form.skus) {
  257. if (!this.goods.imgs) {
  258. imgsku = ''
  259. } else {
  260. if (this.goods.imgs.search(',') == (-1)) {
  261. imgsku = this.goods.imgs
  262. } else {
  263. var a = this.goods.imgs.indexOf(',')
  264. imgsku = this.goods.imgs.substring(0, a)
  265. }
  266. }
  267. } else {
  268. imgsku = this.goods.imgs
  269. }
  270. // 规格
  271. this.tableSkuData = []
  272. if (this.skuGroups.length == 2) {
  273. let arr1 = this.skuGroups[0].attrValues;
  274. let arr2 = this.skuGroups[1].attrValues;
  275. if (arr1.length > 0) {
  276. if (arr2.length > 0) {
  277. arr1.forEach((item, index) => {
  278. arr2.forEach((i, ind) => {
  279. this.tableSkuData.push({
  280. skuId: '',
  281. skuName: item.attrValue + '+' + i.attrValue,
  282. skuDesc: '',
  283. skuImg: imgsku,
  284. price: this.goods.price,
  285. marketPrice: this.goods.marketPrice,
  286. stockNum: this.goods.stockNum,
  287. spec: item.attrValue,
  288. spec_s: index,
  289. spec2: i.attrValue,
  290. spec_s2: ind,
  291. state: '1',
  292. // shuxing:this.spec_s,
  293. saleAttrs: [{
  294. attrId: '',
  295. skuId: '',
  296. attrName: item.attrName,
  297. attrValue: item.attrValue,
  298. },
  299. {
  300. attrId: '',
  301. skuId: '',
  302. attrName: i.attrName,
  303. attrValue: i.attrValue,
  304. }
  305. ],
  306. });
  307. // }
  308. })
  309. })
  310. } else {
  311. arr1.forEach((item, index) => {
  312. this.tableSkuData.push({
  313. skuId: '',
  314. skuName: item.attrValue,
  315. skuDesc: '',
  316. skuImg: imgsku,
  317. price: this.goods.price,
  318. marketPrice: this.goods.marketPrice,
  319. stockNum: this.goods.stockNum,
  320. spec: item.attrValue,
  321. spec_s: index,
  322. spec2: "",
  323. spec_s2: "",
  324. state: '1',
  325. // shuxing:this.spec_s,
  326. saleAttrs: [{
  327. attrId: '',
  328. skuId: '',
  329. attrName: item.attrName,
  330. attrValue: item.attrValue,
  331. }],
  332. // }
  333. })
  334. })
  335. }
  336. } else {
  337. if (arr2.length > 0) {
  338. arr2.forEach((i, ind) => {
  339. this.tableSkuData.push({
  340. skuId: '',
  341. skuName: i.attrValue,
  342. skuDesc: '',
  343. skuImg: imgsku,
  344. price: this.goods.price,
  345. marketPrice: this.goods.marketPrice,
  346. stockNum: this.goods.stockNum,
  347. spec: "",
  348. spec_s: "",
  349. spec2: i.attrValue,
  350. spec_s2: ind,
  351. state: '1',
  352. // shuxing:this.spec_s,
  353. saleAttrs: [{
  354. attrId: '',
  355. skuId: '',
  356. attrName: i.attrName,
  357. attrValue: i.attrValue,
  358. }],
  359. // }
  360. })
  361. })
  362. } else {
  363. this.tableSkuData = []
  364. }
  365. }
  366. } else if (this.skuGroups.length == 1) {
  367. let arr1 = this.skuGroups[0].attrValues;
  368. arr1.forEach((item, index) => {
  369. this.tableSkuData.push({
  370. skuId: '',
  371. skuName: item.attrValue,
  372. skuDesc: '',
  373. skuImg: imgsku,
  374. price: this.goods.price,
  375. marketPrice: this.goods.marketPrice,
  376. stockNum: this.goods.stockNum,
  377. spec: item.attrValue,
  378. spec_s: index,
  379. spec2: "",
  380. spec_s2: "",
  381. state: '1',
  382. // shuxing:this.spec_s,
  383. saleAttrs: [{
  384. attrId: '',
  385. skuId: '',
  386. attrName: item.attrName,
  387. attrValue: item.attrValue,
  388. }],
  389. // }
  390. })
  391. })
  392. } else {
  393. this.tableSkuData = []
  394. }
  395. console.log(this.tableSkuData, "11111111111");
  396. },
  397. // 添加SKU
  398. addSKU() {
  399. this.skuGroups.push({
  400. attrName: "",
  401. attrValues: []
  402. })
  403. },
  404. affirm2() {
  405. var imgsku = ''
  406. if (!this.form.skus) {
  407. if (!this.goods.imgs) {
  408. if (this.goods.imgs.search(',') == (-1)) {
  409. imgsku = this.goods.imgs
  410. } else {
  411. var a = this.goods.imgs.indexOf(',')
  412. imgsku = this.goods.imgs.substring(0, a)
  413. }
  414. return
  415. }
  416. imgsku = ''
  417. } else {
  418. imgsku = this.goods.imgs
  419. }
  420. //颜色
  421. if (this.dynamicTags_spec2.length > 0) {
  422. console.log(this.dynamicTags_spec)
  423. this.dynamicTags_spec2.forEach((spec2, spec_idx2) => {
  424. console.log(spec_idx2, '颜色', spec2)
  425. if (!this.tableSkuData.find(x => x.spec2 == spec2)) {
  426. console.log(this.tableSkuData)
  427. this.tableSkuData.push({
  428. skuId: '',
  429. skuName: this.dynamicTags_spec[spec_idx2] + '+' + spec2,
  430. skuDesc: '',
  431. skuImg: imgsku,
  432. price: this.goods.price,
  433. marketPrice: this.goods.marketPrice,
  434. stockNum: this.goods.stockNum,
  435. spec: this.dynamicTags_spec[spec_idx2],
  436. spec_s: spec_idx2,
  437. spec2: spec2,
  438. spec_s2: spec_idx2,
  439. state: '1',
  440. // shuxing:this.spec_s2
  441. saleAttrs: [{
  442. attrId: '',
  443. skuId: '',
  444. attrName: this.spec_s,
  445. attrValue: this.dynamicTags_spec[spec_idx2],
  446. },
  447. {
  448. attrId: '',
  449. skuId: '',
  450. attrName: this.spec_s2,
  451. attrValue: spec2,
  452. }
  453. ],
  454. // arr2:[
  455. // {
  456. // attrId:'',
  457. // skuId:'',
  458. // attrName:this.spec_s2,
  459. // attrValue:spec2,
  460. // }
  461. // ]
  462. });
  463. }
  464. });
  465. this.tableSkuData = this.tableSkuData.filter(x => this.dynamicTags_spec2.find(s => s == x.spec2));
  466. console.log(this.tableSkuData)
  467. }
  468. },
  469. //规格
  470. handleClose_spec(tag, index) {
  471. console.log(tag.attrValue);
  472. this.skuGroups[index].attrValues.splice(this.skuGroups[index].attrValues.indexOf(tag.attrValue).toString(),
  473. 1);
  474. this.affirm()
  475. },
  476. showInput_spec(item, index) {
  477. this.inputVisible_spec = true;
  478. this.tagindex = item.attrName;
  479. this.$nextTick(() => {
  480. // console.log(this.$refs.saveTagInput_spec);
  481. this.$refs.saveTagInput_spec[0].focus();
  482. });
  483. },
  484. handleInputConfirm_spec(item) {
  485. console.log(item);
  486. if (this.inputValue_spec) {
  487. if (item.attrValues.find(x => x.attrValue == this.inputValue_spec)) {
  488. this.$message({
  489. message: this.inputValue_spec + '已存在',
  490. type: 'warning'
  491. });
  492. return;
  493. }
  494. let arr = {
  495. attrValue: this.inputValue_spec,
  496. skuIds: "",
  497. attrName: item.attrName,
  498. }
  499. item.attrValues.push(arr);
  500. this.affirm();
  501. console.log(this.skuGroups, "skuGroups数据");
  502. }
  503. this.inputVisible_spec = false;
  504. this.inputValue_spec = '';
  505. },
  506. // 颜色
  507. handleClose_spec2(tag) {
  508. this.dynamicTags_spec2.splice(this.dynamicTags_spec2.indexOf(tag), 1);
  509. this.affirm()
  510. },
  511. showInput_spec2() {
  512. this.inputVisible_spec2 = true;
  513. this.$nextTick(() => {
  514. this.$refs.saveTagInput_spec2.$refs.input.focus();
  515. });
  516. },
  517. handleInputConfirm_spec2() {
  518. if (this.inputValue_spec2) {
  519. if (this.dynamicTags_spec2.find(x => x == this.inputValue_spec2)) {
  520. this.$message({
  521. message: this.inputValue_spec2 + '已存在',
  522. type: 'warning'
  523. });
  524. return;
  525. }
  526. this.dynamicTags_spec2.push(this.inputValue_spec2);
  527. this.affirm();
  528. }
  529. this.inputVisible_spec2 = false;
  530. this.inputValue_spec2 = '';
  531. },
  532. open_spec() {
  533. if (this.checked_spec) {
  534. return;
  535. };
  536. this.$confirm(`此操作将清除【${this.spec_s}】数据, 是否继续?`, '提示', {
  537. confirmButtonText: '确定',
  538. cancelButtonText: '取消',
  539. type: 'warning'
  540. })
  541. .then(() => {
  542. this.$message({
  543. type: 'success',
  544. message: '清除成功!'
  545. });
  546. this.dynamicTags_spec = [];
  547. this.tableSkuData = [];
  548. })
  549. .catch(() => {
  550. this.checked_spec = true;
  551. });
  552. },
  553. open_switch_sku() {
  554. if (this.switch_sku) {
  555. return;
  556. };
  557. this.$confirm(`此操作将清除数据, 是否继续?`, '提示', {
  558. confirmButtonText: '确定',
  559. cancelButtonText: '取消',
  560. type: 'warning'
  561. })
  562. .then(() => {
  563. this.$message({
  564. type: 'success',
  565. message: '清除成功!'
  566. });
  567. this.dynamicTags_spec = [];
  568. this.tableData = [];
  569. this.tableSkuData = [];
  570. })
  571. .catch(() => {
  572. this.switch_sku = true;
  573. });
  574. },
  575. handleChange(file, fileLists) {
  576. // this.goods.skuImg=res.data
  577. //   console.log(file, "file11111");
  578. },
  579. // 可以获取图片参数(封面图上传图片)
  580. handleUpload(file2, row) {
  581. console.log(file2, "2222", row);
  582. const file = file2.file;
  583. const formData = new FormData();
  584. formData.append('file', file);
  585. // 文件上传
  586. this.$axios.post("/file/open/", formData, {
  587. headers: {
  588. 'Content-type': 'multipart/form-data'
  589. }
  590. }).then(response => {
  591. let res = response
  592. if (res.success) {
  593. row.skuImg = res.data
  594. // this.goods.skuImg=res.data
  595. // console.log(this.tableSkuData.skuImg)
  596. } else {
  597. uni.showToast({
  598. icon: 'error',
  599. title: '请重新上传!'
  600. });
  601. }
  602. }).catch(res => {});
  603. },
  604. handleRemove(e) {
  605. // 删除文件
  606. this.$axios.delete("/file/open/?url=" + this.tableSkuData.skuImg, {}).then(response => {
  607. let res = response
  608. if (res.success) {
  609. this.tableSkuData.skuImg = ''
  610. } else {
  611. }
  612. }).catch(res => {});
  613. },
  614. imgDelete(e) {
  615. console.log(e)
  616. var img = e.tempFiles[0].file;
  617. const file = img;
  618. const formData = new FormData();
  619. formData.append('file', file);
  620. // 文件上传
  621. this.$axios.post("/file/open/", formData, {
  622. headers: {
  623. 'Content-type': 'multipart/form-data'
  624. }
  625. }).then(response => {
  626. let res = response
  627. if (res.success) {
  628. this.tableSkuData.skuImg = res.data
  629. console.log(this.tableSkuData.skuImg)
  630. } else {
  631. uni.showToast({
  632. icon: 'error',
  633. title: '请重新上传!'
  634. });
  635. }
  636. }).catch(res => {});
  637. },
  638. Delete(e) {
  639. // 删除文件
  640. this.$axios.delete("/file/open/?url=" + this.tableSkuData.skuImg, {}).then(response => {
  641. let res = response
  642. if (res.success) {
  643. this.tableSkuData.skuImg = ''
  644. } else {
  645. }
  646. }).catch(res => {});
  647. },
  648. }
  649. };
  650. </script>
  651. <style>
  652. input[type='file'] {
  653. position: absolute;
  654. top: 0;
  655. right: 0;
  656. bottom: 0;
  657. left: 0;
  658. width: 100%;
  659. cursor: pointer;
  660. opacity: 0;
  661. z-index: 99;
  662. }
  663. </style>
  664. <style>
  665. .tag-new-tag {
  666. margin-left: 24px;
  667. }
  668. .button-new-tag,
  669. .input-new-tag {
  670. margin-left: 24px;
  671. height: 32px;
  672. margin-top: 0;
  673. }
  674. .input-new-tag {
  675. width: 100px;
  676. line-height: 32px;
  677. }
  678. >>>.input-new-tag .el-input__inner {
  679. height: 100%;
  680. }
  681. .el-button--small {
  682. border: 1px solid #dcdfe6;
  683. }
  684. >>>.el-upload-list {
  685. display: none;
  686. }
  687. </style>