| | |
| | | </div> |
| | | </vuedraggable> |
| | | <!-- todo 3--> |
| | | <Upload ref="uploadSku" action="-" |
| | | <Upload ref="uploadSku" :action="uploadFileUrl" |
| | | v-if="val.images < 1" |
| | | :before-upload="handleBeforeUpload" |
| | | :format="['jpg', 'jpeg', 'png', 'webp']" |
| | | :max-size="2048" |
| | | :headers="{ ...accessToken }" |
| | | :on-error="() => { $Spin.hide(); }" |
| | | :on-exceeded-size="handleMaxSize" |
| | | :on-format-error="handleFormatError" |
| | |
| | | } |
| | | }, |
| | | // sku图片上传前钩子 |
| | | // async handleBeforeUpload(file) { |
| | | // const check = |
| | | // this.selectedSku.images !== undefined && |
| | | // this.selectedSku.images.length > 5; |
| | | // if (check) { |
| | | // this.$Notice.warning({title: "图片数量不能大于五张"}); |
| | | // return false; |
| | | // } |
| | | // }, |
| | | // sku图片上传前钩子 |
| | | async handleBeforeUpload(file) { |
| | | const check = |
| | | this.selectedSku.images !== undefined && |
| | |
| | | this.$Message.error("已存在相同规格项!"); |
| | | return; |
| | | } |
| | | if (this.zz(0, val) > 20) { |
| | | this.$Message.error("规格值最多十个字符长度!"); |
| | | if (this.zz(0, val) > 30) { |
| | | this.$Message.error("规格值最多十五个字符长度!"); |
| | | // val = val.toString().slice(0, 4); |
| | | this.skuInfo[index].name = this.countCharacters(val, 10); |
| | | this.$forceUpdate();// 调用该方法会触发组件的重新渲染 |
| | |
| | | if (val.value === '') { |
| | | return; |
| | | } |
| | | if (this.zz(0, val.value) > 20) { |
| | | this.$Message.error("规格值最多十个字符长度!"); |
| | | if (this.zz(0, val.value) > 30) { |
| | | this.$Message.error("规格值最多十五个字符长度!"); |
| | | // val.value = val.value.toString().slice(0, 4); |
| | | this.skuInfo[$index].spec_values[index].value = this.countCharacters(val.value, 10); |
| | | this.$forceUpdate();// 调用该方法会触发组件的重新渲染 |
| | |
| | | this.categoryId = cateId[2]; |
| | | this.baseInfoForm.categoryPath = cateId.toString(); |
| | | this.baseInfoForm.goodsType = this.firstData.goodsType; |
| | | |
| | | |
| | | |
| | | |
| | | if (this.categoryId!=null && this.categoryId!=='') { |