peng
7 天以前 bd26bb7a8827d792e84e05ac2ebd6e81aad82873
seller/src/views/goods/goods-seller/goodsOperationSec.vue
@@ -271,11 +271,12 @@
                                    </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"
@@ -1116,6 +1117,16 @@
      }
    },
    // 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 &&
@@ -1459,8 +1470,8 @@
        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();// 调用该方法会触发组件的重新渲染
@@ -1515,8 +1526,8 @@
      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();// 调用该方法会触发组件的重新渲染
@@ -2303,8 +2314,6 @@
        this.categoryId = cateId[2];
        this.baseInfoForm.categoryPath = cateId.toString();
        this.baseInfoForm.goodsType = this.firstData.goodsType;
        if (this.categoryId!=null && this.categoryId!=='') {