update.vue 23.6 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521
<!-- 商品编辑 -->
<template>
  <d2-container class="edit-productManage" v-loading="$store.state.d2admin.loading.value">
    <div v-if="show">
      <!-- SPU -->
      <sourceMaterial ref="source-material-form" :add-or-edit="addOrEdit" :form-data="productFormData" />
      <!-- SKU -->
      <specifications ref="specifications-form" @checkGoodsInfo="checkGoodsInfo"></specifications>
      <div style="margin-top: 40px;text-align: center;">
        <el-button
          type="primary"
          @click="handleUp(1)"
          :disabled="$store.state.d2admin.loading.value || pageDisabled"
          class="width_100">提交</el-button>
        <el-button
          type="primary"
          plain
          @click="handleUp()"
          v-if="filterEmpty(goodsInfoData.status) || goodsInfoData.status == 3"
          class="width_100">保存</el-button>
        <el-button class="width_100 cancel-btn"
                   @click="handleClose">取消</el-button>
      </div>
    </div>
  </d2-container>
</template>

<script>
import { deepClone } from '@/common/util'
import { mapActions, mapGetters, mapMutations } from 'vuex'
import sourceMaterial from './components/sourceMaterial.vue'
import specifications from './components/specifications.vue'
import { addProductManage, UpdateProductManage } from '@api/productManage'
import { BaseData, applicableModelTypeList } from '@/common/constants.js'
import { getGoodsInfoById } from '@api/commodity'
import { baseConfig } from '@/main'
export default {
  name: 'EditProductManage',
  components: {
    sourceMaterial,
    specifications
  },
  provide() {
    return {
      pageData: this
    }
  },
  data() {
    return {
      equitySceneType: baseConfig.equitySceneType || [], // 权益类目
      extendedPosiType: baseConfig.extendedPosiType || [], // 延保类
      membraneTypeList: baseConfig.membraneTypeList,
      userInfo: this.$store.state.d2admin.user.info,
      show: false,
      copyUpgradeGoodsList: [],
      resetData: {
        id: '',
        baseGoodsId: '',
        sapCode: '',
        supplierCode: '',
        supplierName: '',
        sceneName: '',
        sceneType: '',
        goodsName: '',
        baseGoodsName: '',
        goodsCode: '',
        brandMerchantName: '',
        specificationType: '1',
        thumbUrl: [],
        goodsTypeName: '',
        goodsImgList: [],
        goodsId: [],
        specificationDetailList: [],
        upgradeGoodsList: [],
        distributionType: '0',
        goodsSpecificationNameList: [],
        status: '',
        goodsSpecificationList: [],
        goodsPositionList: [],
        applicableModelNames: '',
        positionNames: '',
        shoppingMallFlag: '0',
        goodsSpecificationSingleList: [],
        specificationSingleDetailList: [],
        goodsType: '',
        baseGoodsNameEmpty: false,
        scrmFlag: 'N'
      },
      editGoodsData: false,
      productFormData: {
        carTypeList: [1, 2, 3, 4]
      },
      positionTypeList: [],
      pageDisabled: false
    }
  },

  created() {
    this.addOrEdit = this.$route.params.addOrEdit || 'add'
    this.getBaseData()
  },
  mounted() {
    this.show = false
    // add - 新增;edit - 编辑
    this.addOrEdit = this.$route.params.addOrEdit || 'add'
    if (this.addOrEdit === 'edit') {
      this.getGoodsInfo(this.$route.params.id)
    } else {
      this.$nextTick(() => {
        this.show = true
      })
    }
  },
  computed: {
    ...mapGetters('goodsInfoData', { goodsInfoData: 'getGoodsInfoData' })
  },
  methods: {
    ...mapActions({
      get: 'd2admin/base/get'
    }),
    ...mapMutations('goodsInfoData', ['setUpdateGoodsInfo']),
    ...mapActions({ close: 'd2admin/page/close' }),
    async getBaseData() {
      this.positionTypeList = await this.get(BaseData.positionTypeList)
    },
    getGoodsInfo(id) {
      getGoodsInfoById({ id: id }).then(res => {
        const specificationDetailList = []
        let objData = {}
        this.copyUpgradeGoodsList = deepClone(res.upgradeGoodsList).map((val, index) => {
          val?.upgradeGoodsServiceItemsList?.forEach(v => {
            v.uniqueValue = `${v.serviceName}-${v.serviceGrade}/${v.servicePeriod}`
            v.uniqueCode = `${v.serviceCode}-${v.serviceGrade}/${v.servicePeriod}`
          })
          return {
            id: val.id,
            position: val.position ? (val.position + '')?.split(',')?.map(Number) : [],
            purchasePrice: val.purchasePrice,
            specificationData: val.specificationData,
            specsValueList: val.specificationData?.split(';~;'),
            type: val.type,
            thirdPartyCode: val.thirdPartyCode,
            upgradePrice: val.upgradePrice,
            warningValue: val.warningValue,
            warningValueMax: val.warningValueMax,
            warrantyPeriod: val.warrantyPeriod,
            editGoodNameInput: false,
            serviceItemArr: val.upgradeGoodsServiceItemsList || [],
            extendServiceItemArr: val.upgradeGoodsServiceItemsList || [],
            entityCardFlag: val.entityCardFlag == 'Y',
            merchantGoodsInfos: val?.merchantGoodsInfos,
            djCost: val.djCost,
            // 编辑产品价格输入框限制
            oldpurchasePrice: val.purchasePrice,
            oldupgradePrice: val.upgradePrice,
            oldwarningValue: val.warningValue,
            oldwarningValueMax: val.warningValueMax,
            oldwarrantyPeriod: val.warrantyPeriod,
            olddjCost: val.djCost,
            selectCarSerise: val?.carTypeConfigList?.map(v => {
              return {
                brandId: v.brandId,
                brandName: v.brandName,
                childId: v.childId,
                childName: v.childName,
                seriesId: v.seriesId,
                seriesName: v.seriesName
              }
            }),
            checked: false
          }
        })
        res.goodsInfo.goodsSource = 0
        res.goodsSpecificationNameList && res.goodsSpecificationNameList.forEach(val => {
          val.specificationValueList = val.goodsSpecificationValueList || []
          val.specificationTypeSequence = val.type // 预规格类型
          specificationDetailList.push(val)
        })
        const selectedPositions = res.goodsInfo?.goodsPositionList?.map((val) => { return val.position }) || []
        const { goodsType, secondaryGoodsType, thirdLevelGoodsType } = res.goodsInfo || {}
        const tempGoodsType = [goodsType, secondaryGoodsType, thirdLevelGoodsType].filter(item => item != -1 && Boolean(item)) // 未设置时后端会返回默认值-1
        objData = {
          status: res.status,
          goodsType: res.goodsInfo.goodsType,
          tempGoodsType: tempGoodsType,
          secondaryGoodsType: res.goodsInfo.secondaryGoodsType,
          thirdLevelGoodsType: res.goodsInfo.thirdLevelGoodsType,
          goodsCode: res.goodsInfo.goodsCode,
          goodsSpecificationNameList: res.goodsSpecificationNameList,
          specificationDetailList: specificationDetailList, // 多规格数据
          specificationSingleDetailList: specificationDetailList, // 单规格数据
          goodsSpecificationSingleList: deepClone(this.copyUpgradeGoodsList),
          upgradeGoodsList: res.upgradeGoodsList?.map(val => {
            val?.upgradeGoodsServiceItemsList?.map(v => {
              v.uniqueValue = `${v.serviceName}-${v.serviceGrade}/${v.servicePeriod}`
              v.uniqueCode = `${v.serviceCode}-${v.serviceGrade}/${v.servicePeriod}`
              return v
            })
            return val
          }),
          goodsSpecificationList: deepClone(this.copyUpgradeGoodsList),
          id: res.id,
          baseGoodsName: res.baseGoodsName,
          distributionType: res.distributionType ? (res.distributionType + '') : '0',
          baseGoodsId: res.id,
          shoppingMallFlag: res.shoppingMallFlag ? (res.shoppingMallFlag + '') : '0',
          goodsPositionList: selectedPositions,
          goodsName: res.goodsInfo.goodsName,
          applicableModelNames: res.goodsInfo?.goodsType == 1 ? deepClone(applicableModelTypeList).filter(val => res.goodsInfo?.carTypeList?.indexOf(val.confId) > -1).map(item => item.confName).join('/') : '',
          positionNames: res.goodsInfo?.goodsType == 1 ? deepClone(this.positionTypeList).filter(val => selectedPositions.indexOf(val.position) > -1).map(item => item.confName).join('/') : '',
          supplierCode: res.goodsInfo.supplierCode,
          merchantGoodsInfos: res?.merchantGoodsInfos,
          scrmFlag: res?.goodsInfo?.scrmFlag
        }
        this.productFormData = deepClone({ ...res.goodsInfo, status: res?.status, oldconvertedValue: res.goodsInfo?.convertedValue, tempGoodsType: tempGoodsType,
          secondaryGoodsType: res.goodsInfo.secondaryGoodsType,
          thirdLevelGoodsType: res.goodsInfo.thirdLevelGoodsType }) || {}
        this.setUpdateGoodsInfo(objData)
        this.show = true
        // 保留一份类目和供应方,广联直营的延保商品并且不是SCRM同步过来的,页面不能提交修改
        this.pageDisabled = this.extendedPosiType.includes(res?.goodsInfo?.goodsType) && !this.baseConfig.supplierCode.includes(res?.goodsInfo?.supplierCode) && res?.goodsInfo?.scrmFlag != 'Y'
        // this.$nextTick(() => {
        //   if (res.goodsSpecificationNameList?.length > 1) this.$refs['specifications-form']?.$refs['multipleSpecificationFormRef'].changeSpecs()
        // })
      })
    },
    handleClose(isRefresh = false) {
      if (isRefresh) {
        this.close({ tagName: '/productManage' })
        this.$router.push({ name: 'productManage' })
        this.close({ tagName: '/productManage' })
      } else {
        this.$confirm('内容未保存,是否返回?', '提示', {
          confirmButtonText: '确定',
          type: 'warning'
        }).then(() => {
          this.close({ tagName: '/productManage' })
          this.$router.push({ name: 'productManage' })
          this.close({ tagName: '/productManage' })
        })
      }
    },
    handleUp(flag) {
      this.checkGoodsInfo((productFormData) => {
        this.handleAddConfirm(this.goodsInfoData, this.goodsInfoData.specificationType, productFormData, flag)
      })
    },
    handleAddConfirm(e, num, productFormData, flag) {
      // num 规格类型
      const data = deepClone(e)
      let [goodsSpecificationNameList, goodsSpecificationList, specificationPermutationList] = [[], [], []]
      if (num == '1') { // 单规格
        data.specificationSingleDetailList.length && data.specificationSingleDetailList.map(val => {
          const goodsSpecificationValueList = []
          val.specificationValueList.forEach(v => {
            goodsSpecificationValueList.push({
              id: v.id,
              specificationValue: v.specificationValue
            })
          })
          goodsSpecificationNameList.push({
            specificationName: val.specificationName,
            id: val.id,
            goodsSpecificationValueList: goodsSpecificationValueList
          })
        })
        const arr = []
        data.goodsSpecificationSingleList.forEach(item => {
          const serviceArr = []
          this.equitySceneType?.includes(productFormData?.goodsType) && !this.baseConfig.supplierCode.includes(`${productFormData.supplierCode}`) && item.serviceItemArr.forEach(val => {
            serviceArr.push({
              gradeId: val.gradeId,
              serviceCode: val.serviceCode,
              serviceName: val.serviceName,
              serviceGrade: val.serviceGrade,
              servicePeriod: val.servicePeriod,
              standardSalesCost: val.standardSalesCost
            })
          })
          arr.push({
            baseGoodsId: data.baseGoodsId,
            goodsCode: data.goodsCode,
            id: item.id,
            specificationData: item.specificationData,
            specsValueList: [item.specificationData],
            upgradePrice: item.upgradePrice,
            warrantyPeriod: this.membraneTypeList.includes(productFormData?.goodsType) ? item.warrantyPeriod : '', // 质保年限 仅膜类
            position: productFormData?.goodsType === 1 ? item.position?.join(',') : [], // 部位 太阳膜
            type: item.type,
            thirdPartyCode: item.thirdPartyCode,
            purchasePrice: data?.shoppingMallFlag == 1 ? item.purchasePrice : '', // 采购价 仅上架至采购商城
            warningValue: item.warningValue,
            warningValueMax: item.warningValueMax,
            upgradeGoodsServiceItemsList: this.equitySceneType?.includes(productFormData?.goodsType) && !this.baseConfig.supplierCode.includes(`${productFormData.supplierCode}`) ? serviceArr : [], // 服务项目 权益类目(供应方为非第三方)
            entityCardFlag: this.equitySceneType.includes(productFormData?.goodsType) ? (item.entityCardFlag ? 'Y' : 'N') : '', // 是否实体卡
            djCost: this.equitySceneType?.concat(this.extendedPosiType)?.includes(productFormData?.goodsType) && !this.baseConfig.supplierCode.includes(`${productFormData.supplierCode}`) ? item.djCost : '',
            carTypeConfigList: item.selectCarSerise
          })
        })
        goodsSpecificationList = arr
      } else {
        data.specificationDetailList.length && data.specificationDetailList.map(val => {
          const goodsSpecificationValueList = []
          val.specificationValueList.forEach(v => {
            goodsSpecificationValueList.push({
              id: v.id,
              specificationValue: v.specificationValue,
            })
          })
          goodsSpecificationNameList.push({
            specificationName: val.specificationName,
            type: val.specificationTypeSequence || 0,
            id: val.id,
            goodsSpecificationValueList: goodsSpecificationValueList
          })
        })
        data.goodsSpecificationList.forEach(item => {
          var specificationData = ''
          item.specsValueList.forEach((subItem, subIndex) => {
            if (subIndex != 0) {
              specificationData += ';~;' // 多规格以特殊符号做分隔符
            }
            specificationData = specificationData + subItem
          })
          const serviceArr = []
          this.equitySceneType?.includes(productFormData?.goodsType) && !this.baseConfig.supplierCode.includes(`${productFormData.supplierCode}`) && item.serviceItemArr.forEach(val => {
            serviceArr.push({
              gradeId: val.gradeId,
              serviceCode: val.serviceCode,
              serviceName: val.serviceName,
              serviceGrade: val.serviceGrade,
              servicePeriod: val.servicePeriod,
              standardSalesCost: val.standardSalesCost
            })
          })
          if (item.statusFlag != 2) {
            goodsSpecificationList.push({
              baseGoodsId: data.baseGoodsId,
              goodsCode: data.goodsCode,
              id: item.id,
              specificationData: specificationData,
              upgradePrice: item.upgradePrice,
              warrantyPeriod: this.membraneTypeList.includes(productFormData?.goodsType) ? item.warrantyPeriod : '', // 质保年限 仅膜类
              position: (productFormData?.goodsType === 1 || (this.extendedPosiType.includes(productFormData?.goodsType) && !this.baseConfig.supplierCode.includes(`${productFormData.supplierCode}`))) ? item.position?.join(',') : [], // 部位 太阳膜/延保类(供应方为第三方)
              type: item.type,
              thirdPartyCode: item.thirdPartyCode,
              purchasePrice: data?.shoppingMallFlag == 1 ? item.purchasePrice : '', // 采购价 仅上架至采购商城
              warningValue: item.warningValue,
              warningValueMax: item.warningValueMax,
              upgradeGoodsServiceItemsList: this.equitySceneType?.includes(productFormData?.goodsType) && !this.baseConfig.supplierCode.includes(`${productFormData.supplierCode}`) ? serviceArr : [], // 服务项目 仅权益类目/延保类目 供应方为第三方
              entityCardFlag: this.equitySceneType.includes(productFormData?.goodsType) ? (item.entityCardFlag ? 'Y' : 'N') : '', // 是否实体卡
              djCost: this.equitySceneType?.concat(this.extendedPosiType)?.includes(productFormData?.goodsType) && !this.baseConfig.supplierCode.includes(`${productFormData.supplierCode}`) ? item.djCost : '',
              carTypeConfigList: item.selectCarSerise,
              specificationNameSequence: goodsSpecificationNameList?.map(v => v.specificationName)?.join(';~;'),
              specificationTypeSequence: goodsSpecificationNameList?.map(v => v.type)?.join(';~;'),
            })
          }
          specificationPermutationList.push({
            specificationNameSequence: goodsSpecificationNameList?.map(v => v.specificationName)?.join(';~;'),
            specificationTypeSequence: goodsSpecificationNameList?.map(v => v.type)?.join(';~;'),
            specificationValueSequence: specificationData,
            statusFlag: item.statusFlag != 2 ? 'Y' : 'N'
          })
        })
      }
      // 不包含 1太阳膜 14改色膜 6改色膜(众筹)12车衣 4车衣(众筹)删除比例换算和适用车型和部位
      if (!this.membraneTypeList.includes(productFormData?.goodsType)) {
        delete productFormData.convertedValue
        delete productFormData.carTypeList
        delete productFormData.goodsPositionList
      }
      var params = {
        goodsInfo: this.dealObjectValue(deepClone(productFormData)),
        upgradeGoods: {
          id: data.id || '',
          baseGoodsName: data.specificationType == 1 ? '' : data.baseGoodsName,
          goodsSpecificationNameList: goodsSpecificationNameList,
          goodsSpecificationList: goodsSpecificationList,
          specificationPermutationList: specificationPermutationList,
          shoppingMallFlag: data.shoppingMallFlag
        },
        saveDraft: flag !== 1 // flag 1提交 2存草稿
      }
      if (this.equitySceneType?.includes(params.goodsInfo?.goodsType) && specificationPermutationList?.findIndex(v => v.specificationTypeSequence?.includes('1')) < 0) {
        return this.$message({
          type: 'warning',
          message: '权益类需配置服务年限预设规格'
        })
      }
      if (params?.upgradeGoods?.goodsSpecificationList?.length > 75) {
        return this.$message({
          type: 'warning',
          message: '商品数量过多,无法操作,请确认后重新保存'
        })
      }
      // 添加详情描述 未填写文字或上传图片 删除请求参数字段
      params?.goodsInfo?.goodsDescList.forEach((subVal, subIdx) => {
        if (!subVal?.content) delete params.goodsInfo.goodsDescList[subIdx]
      })
      const requestEvent = this.addOrEdit == 'add' ? addProductManage : UpdateProductManage
      requestEvent(params).then(res => {
        this.notice.okTips()
        this.handleClose(true)
      })
    },
    dealObjectValue(obj) {
      var param = {}
      if (obj === null || obj === undefined || obj === "") return param
      for (var key in obj) {
        if (obj[key] !== null && obj[key] !== undefined && obj[key] !== "") {
          param[key] = obj[key]
        }
      }
      return param
    },

    filterEmpty(data) {
      return data instanceof Array ? data.length <= 0 : (data ?? '') === ''
    },
    checkGoodsInfo(callback) {
      // 校验SPU
      this.$refs['source-material-form'].$refs.d2GoodsProductForm.handleUp((productFormData) => {
        this.checkGoods(() => {
          callback(productFormData)
        })
      })
    },
    checkGoods(callback) {
      // 根据规格类型赋值进行校验判断
      let confirmShopData = this.goodsInfoData.specificationType == 1 ?
        deepClone(this.goodsInfoData.goodsSpecificationSingleList) :
        this.goodsInfoData.goodsSpecificationList // 仅校验显示的已启用数据
      if (this.goodsInfoData.specificationType == '2') {
        this.setUpdateGoodsInfo({...this.goodsInfoData, baseGoodsNameEmpty: true})
        if (this.filterEmpty(this.goodsInfoData.baseGoodsName)) return this.$message.warning('商品名称是必填项')
      }
      // 将禁用的排除掉
      let confirmShopDataArr = deepClone(confirmShopData)?.filter(v => v.statusFlag != 2)
      if (!confirmShopDataArr?.length) {
        this.$message({
          message: '请配置SKU',
          type: 'warning'
        })
        return document.getElementById('specificationDetailList').scrollIntoView()
      }
      if (this.goodsInfoData.specificationType == '2' && this.goodsInfoData.specificationDetailList.length <= 1) {
        this.$message({
          message: '请添加多个规格',
          type: 'warning'
        })
        return document.getElementById('specificationDetailList').scrollIntoView()
      }
      const arr = confirmShopData.map(item => {
        // 禁用的无需校验
        if (item.statusFlag == 2) return item
        item.specificationDataEmpty = true
        if (this.goodsInfoData.goodsType == 1 || (this.extendedPosiType.includes(this.goodsInfoData.goodsType) && !this.baseConfig.supplierCode.includes(`${this.goodsInfoData.supplierCode}`))) item.positionEmpty = true // 太阳膜/延保类(仅供应方是非第三方)
        if (this.goodsInfoData.shoppingMallFlag == 1) item.purchasePriceEmpty = true // 上架到采购商城
        if (this.equitySceneType.includes(this.goodsInfoData.goodsType) && !this.baseConfig.supplierCode.includes(`${this.goodsInfoData.supplierCode}`)) { // 会员权益升级类目(仅供应方是非第三方)
          item.serviceItemArrEmpty = true
          item.djCostEmpty = true
        }
        if (this.membraneTypeList.includes(this.goodsInfoData.goodsType)) { // 膜类
          item.warrantyPeriodEmpty = true
        }
        return item
      })
      this.goodsInfoData.goodsSpecificationList = arr
      this.goodsInfoData.goodsSpecificationSingleList = arr
      let specialList = []
      if (this.goodsInfoData.goodsType == 1) { // 太阳膜 位置 质保 采购价 必填
        specialList = ['position', 'purchasePrice', 'warrantyPeriod']
      } else if (this.extendedPosiType.includes(this.goodsInfoData.goodsType)) { // 延保类 采购价必填
        specialList = ['purchasePrice']
      } else if (this.membraneTypeList.includes(this.goodsInfoData.goodsType)) { // 膜类 质保必填 采购价必填
        specialList = ['purchasePrice', 'warrantyPeriod']
      } else if (this.equitySceneType.includes(this.goodsInfoData.goodsType)) { // 权益服务 服务项目必填
        specialList = !this.baseConfig.supplierCode.includes(`${this.goodsInfoData.supplierCode}`) ? ['serviceItemArr', 'djCost', 'purchasePrice'] : ['purchasePrice']
      } else { // 其余商品类型 采购价必填
        specialList = ['purchasePrice']
      }
      // 仅分发至单店时,隐藏采购价/卷,无需填写
      if (this.goodsInfoData.shoppingMallFlag == '0' && specialList.indexOf('purchasePrice') > -1) specialList.splice(specialList.indexOf('purchasePrice'), 1)
      const requiredList = ['specificationData', ...specialList]
      // 将禁用的排除掉
      let requiredConfirmShopData = deepClone(confirmShopData)?.filter(v => v.statusFlag != 2)
      for (var i = 0; i < requiredConfirmShopData.length; i++) {
        const item = requiredConfirmShopData[i]
        if (this.goodsInfoData.specificationType == '2') item.specificationData = item.specsValueList.join(';~;')
        try {
          requiredList.map(it => {
            if (this.filterEmpty(item[it])) {
              throw it
            }
          })
        } catch (error) {
          return document.getElementById('specificationDetailList').scrollIntoView()
        }
      }
      callback()
    }
  },
  beforeDestroy() {
    this.setUpdateGoodsInfo(this.resetData)
  }
}

</script>
<style scoped>
.edit-productManage {
  position: relative;
}
.d2-form-block {
  border-bottom: 1px solid #e7eaec;
  padding: 20px 0px;
}
.width_100{
  display: inline-block;
  width: 100px;
}
</style>