doum
19 小时以前 6f846284806e47fac7c2a4a9658473f7f8e9945b
admin/src/components/business/OperaGoodsWindow.vue
@@ -2,11 +2,12 @@
  <GlobalWindow
    v-loading="isUploading"
    :title="title"
    width="60%"
    :visible.sync="visible"
    :confirm-working="isWorking"
    @confirm="confirm"
  >
    <el-form :model="form" ref="form" :rules="rules" label-width="110px" label-suffix=":" inline>
    <el-form :model="form" ref="form" :rules="rules"   label-width="110px"  label-suffix=":"  >
      <el-form-item label="商品名称" prop="name">
        <el-input v-model="form.name" placeholder="请输入商品名称" v-trim/>
      </el-form-item>
@@ -31,7 +32,7 @@
        </el-select>
      </el-form-item>
      <el-form-item label="商品主图" prop="imgurl">
        <div  style="display: flex; align-items: center;justify-content: center;  height: 100%; width: 100%">
        <div  style="display: flex; align-items: center;   height: 100%; width: 100%">
          <UploadAvatarImage
              :file="{ 'imgurlfull': form.imgurlfull, 'imgurl': form.imgurl}"
              :uploadData="{folder:'goods'}"
@@ -92,7 +93,7 @@
          <el-radio :value="0" :label="0" >下架</el-radio>
        </el-radio-group>
      </el-form-item>
      <el-form-item label="使用商品品牌" prop="brandIdList">
      <el-form-item label="适用商品品牌" prop="brandIdList">
        <el-select v-model="form.brandIdList"   placeholder="请选择商品品牌" clearable multiple @change="changeBrand">
          <el-option
              v-for="item in applyBrands"
@@ -106,7 +107,7 @@
<!--
        <span style="line-height: 32px;font-size: 14px;"><b style="color: #F56C6C;margin-right: 4px;font-size: 11px;">*</b>{{'【'+(item.name)+'】系列:'}}</span>
-->
        <el-form-item  v-for="(item,index) in applyBrands" v-if="item.show" :key="'warning_'+index" style="display: block;width: 100%;"  :label="'【'+(item.name)+'】系列'"  >
        <el-form-item  v-for="(item,index) in applyBrands.filter(item=>item.show)"   :key="'warning_'+index" style="display: block;width: 100%;"  :label="'【'+(item.name)+'】系列'"  >
          <el-select v-model="item.childIdList" filterable  multiple   style=" width: 500px;"  clearable  placeholder="请选择品牌系列" >
            <el-option v-for="item in item.childList"   :label="item.name" :value="item.id" :key="'brand_'+index+item.id">  </el-option>
          </el-select>
@@ -210,6 +211,13 @@
          this.applyBrands = res
          this.applyBrands.forEach(item => {
            item.show = this.isSeletedBrand(item)
            if(this.form.id && this.form.brandList && this.form.brandList.length){
              this.form.brandList.forEach(item1 => {
                if (item1.id === item.id) {
                  item.childIdList = item1.childIdList
                }
              })
            }
          })
        })
    },
@@ -221,8 +229,8 @@
      this.visible = true
      this.form.brandIdList = []
      this.form.fileList = []
      this.form.imgurl=''
      this.form.imgurlfull=''
      this.form.imgurl = ''
      this.form.imgurlfull = ''
      // debugger
      // 新建
      if (target == null) {
@@ -247,8 +255,8 @@
      })
    },
    loadInfo () {
      this.form.brandIdList =[]
      this.form.fileList =[]
      this.form.brandIdList = []
      this.form.fileList = []
      this.api.detail(this.form.id).then(res => {
        if (res && res.brandList) {
          this.form.brandList = res.brandList
@@ -294,16 +302,10 @@
<style lang="scss" scoped>
@import "@/assets/style/alertstyle.scss";
::v-deep .el-form-item__content {
  flex: 0.6;
}
::v-deep .el-select {
  width: 100%;
  .el-input__inner {
    width: 100%;
  }
}
::v-deep  .el-form-item__label{
  width: 150px !important;
}
</style>