<template>
  <div class="app-container">
    <div>
      <div class="tab-header webtop">
        <div>{{title}}</div>
        <div>
          <el-button type="primary" size="small" :disabled="submitdisabled" @click="saveOrUpdate">保存</el-button>
          <el-button type="info" size="small" icon="el-icon-close" @click="handleReturn()">关闭</el-button>
        </div>
      </div>
      <div class="listconadd" style="padding-bottom: 50px;">
        <el-form ref="dataForm" :model="formobj" label-position="top" label-width="190px" class="formadd">
          <div class="titwu">项目信息表</div>
          <div class="title" style="display: flex;align-items: center;justify-content: space-between;height:40px">
            <div>主体信息</div>
          </div>
          <el-row>
            <el-col :span="4" class="trightb">
              <el-form-item class="trightb_item">
                <span slot="label">项目名称</span>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item class="trightb_item">
                <el-input v-model="formobj.entryName" placeholder="请输入项目名称" style="width:100%" class="addinputw"
                  clearable />
              </el-form-item>
            </el-col>
            <el-col :span="4" class="trightb">
              <el-form-item class="trightb_item">
                <span slot="label">所属行业</span>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item class="trightb_item">
                <el-select v-model="formobj.industryName" class="addinputw" placeholder="请选择所属行业" style="width:100%"
                  @change="getHangYe">
                  <el-option v-for="item in industryList" :key="item.dictKey" :label="item.dictValue"
                    :value="item.dictKey" />
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="4" class="trightb">
              <el-form-item class="trightb_item">
                <span slot="label">项目类型</span>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item class="trightb_item">
                <el-select v-model="formobj.typeName" class="addinputw" placeholder="请选择项目类型" style="width:100%"
                  @change="getType">
                  <el-option v-for="item in typeList" :key="item.dictKey" :label="item.dictValue"
                    :value="item.dictKey" />
                </el-select>
              </el-form-item>
            </el-col>

            <el-col :span="4" class="trightb">
              <el-form-item class="trightb_item">
                <span slot="label">质押率(%)</span>
              </el-form-item>
            </el-col>
            <el-col :span="8">
             <el-form-item class="trightb_item">
               <el-input v-model="formobj.bankPledgeRate" placeholder="请输入标准质押率" style="width:100%" class="addinputw"
                 clearable />
             </el-form-item>
            </el-col>

          </el-row>
          <el-row>
            <el-col :span="4" class="trightb">
              <el-form-item class="trightb_item">
                <span slot="label">贷款行</span>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item class="trightb_item">
                <el-select v-model="formobj.bankName" class="addinputw" placeholder="请选择贷款行" style="width:100%"
                  @change="getBank">
                  <el-option v-for="item in bankList" :key="item.dictKey" :label="item.dictValue"
                    :value="item.dictKey" />
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="4" class="trightbs">
              <el-form-item class="trightb_item">
                <span slot="label">客户经理</span>
              </el-form-item>
            </el-col>
            <el-col :span="8" class="trightb_items">
              <el-form-item class="trightb_item">
                <el-select v-model="formobj.bmanagerName" class="addinputw" placeholder="请选择客户经理" style="width:100%"
                  @change="getBManager">
                  <el-option v-for="item in bManagerList" :key="item.dictKey" :label="item.dictValue"
                    :value="item.dictKey" />
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row>
            <el-col :span="4" class="trightb">
              <el-form-item class="trightb_item">
                <span slot="label">项目单位</span>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item class="trightb_item">
                <el-select v-model="formobj.enterpriseName" class="addinputw" placeholder="请选择项目单位" style="width:100%"
                  @change="getEnterpriseName">
                  <el-option v-for="item in enterpriseList" :key="item.dictKey" :label="item.dictValue"
                    :value="item.dictKey" />
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="4" class="trightb">
              <el-form-item class="trightb_item">
                <span slot="label">项目联系人</span>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item class="trightb_item">
                <el-input v-model="formobj.econtacts" placeholder="请输入项目联系人" :readonly="true" style="width:100%"
                  class="addinputw" clearable />
              </el-form-item>
            </el-col>
          </el-row>

          <el-row>
            <el-col :span="4" class="trightb">
              <el-form-item class="trightb_item">
                <span slot="label">授信额度</span>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item class="trightb_item">
                <el-input v-model="formobj.creditLimit" placeholder="请输入授信额度" style="width:100%" class="addinputw"
                  clearable />
              </el-form-item>
            </el-col>
            <el-col :span="4" class="trightb">
              <el-form-item class="trightb_item">
                <span slot="label">授信日期</span>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item class="trightb_item">
                <el-date-picker v-model="formobj.engaDate" type="date" style="width:100%" value-format="yyyy-MM-dd"
                  placeholder="选择日期">
                </el-date-picker>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row>
            <el-col :span="4" class="trightb">
              <el-form-item class="trightb_item">
                <span slot="label">用信总额</span>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item class="trightb_item">
                <el-input v-model="formobj.useLimit" placeholder="请输入用信额度" style="width:100%" class="addinputw"
                  clearable />
              </el-form-item>
            </el-col>
            <el-col :span="4" class="trightb">
              <el-form-item class="trightb_item">
                <span slot="label">用信日期</span>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item class="trightb_item">
                <el-date-picker v-model="formobj.useDate" type="date" style="width:100%" value-format="yyyy-MM-dd"
                  placeholder="选择日期">
                </el-date-picker>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row>
            <el-col :span="4" class="trightb">
              <el-form-item class="trightb_item">
                <span slot="label">签约日期</span>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item class="trightb_item">
                <el-date-picker v-model="formobj.signingDate" type="date" style="width:100%" value-format="yyyy-MM-dd"
                  placeholder="选择日期">
                </el-date-picker>
              </el-form-item>
            </el-col>
            <el-col :span="4" class="trightb">
              <el-form-item class="trightb_item">
                <span slot="label">放款日期</span>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item class="trightb_item">
                <el-date-picker v-model="formobj.loanDate" type="date" style="width:100%" value-format="yyyy-MM-dd"
                  placeholder="选择日期">
                </el-date-picker>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="4" class="trightb">
              <el-form-item class="trightb_item">
                <span slot="label">项目说明</span>
              </el-form-item>
            </el-col>
            <el-col :span="20">
              <el-form-item class="trightb_item">
                <el-input v-model="formobj.remarks" placeholder="请输入项目说明" style="width:100%;margin-bottom: 5px;"
                  type="textarea" :rows="7" class="addinputw" clearable />
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="4" class="trightb">
              <el-form-item class="trightb_item">
                <span slot="label">监管负责人</span>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item class="trightb_item">
                <el-input v-model="formobj.regulatoryLeader" placeholder="请输入监管负责人" style="width:100%" class="addinputw"
                  clearable />
              </el-form-item>
            </el-col>
            <el-col :span="4" class="trightb">
              <el-form-item class="trightb_item">
                <span slot="label">事业部经理</span>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item class="trightb_item">
                <el-input v-model="formobj.generalManager" placeholder="请输入事业部经理" style="width:100%" class="addinputw"
                  clearable />
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="4" class="trightb">
              <el-form-item class="trightb_item">
                <span slot="label">结束日期</span>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item class="trightb_item">
                <el-date-picker v-model="formobj.endDate" type="date" style="width:100%" value-format="yyyy-MM-dd"
                  placeholder="选择日期">
                </el-date-picker>
              </el-form-item>
            </el-col>
            <el-col :span="4" class="trightb">
              <el-form-item class="trightb_item">
                <span slot="label">填表日期</span>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item class="trightb_item">
                <el-date-picker v-model="formobj.fillInDate" type="date" style="width:100%" value-format="yyyy-MM-dd"
                  placeholder="选择日期">
                </el-date-picker>
              </el-form-item>
            </el-col>

          </el-row>

          <el-row>
            <el-col :span="4" class="trightb">
              <el-form-item class="trightb_item">
                <span slot="label">项目状态</span>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item class="trightb_item">
                <el-select v-model="formobj.enterpriseName" class="addinputw" placeholder="请选择项目状态" style="width:100%"
                  @change="getEnterpriseName">
                  <el-option v-for="item in enterpriseList" :key="item.dictKey" :label="item.dictValue"
                    :value="item.dictKey" />
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="4" class="trightb">
              <el-form-item class="trightb_item">
                <span slot="label">项目状态说明</span>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item class="trightb_item">
                <el-input v-model="formobj.econtacts" placeholder="请输入项目联系人" :readonly="true" style="width:100%"
                  class="addinputw" clearable />
              </el-form-item>
            </el-col>
          </el-row>

          <el-row>
            <el-col :span="4" class="trightb">
              <el-form-item class="trightb_item">
                <span slot="label">关联仓库</span>
              </el-form-item>
            </el-col>
            <el-col :span="20">
              <el-form-item class="trightb_item">
                <div class="Image" v-for="(item,i) in ImgSid"  :key="i" v-show="item.name">
                     <div class="ImageX">
                      <i class="el-icon-close" @click="delSid(item)"></i>
                      <img v-if="item.picUrl" :src="item.picUrl" alt="">
                      <img v-else src="../../assets/images/notAvailable.jpg" alt="" />
                      <p><u class="Atext">{{ item.name }}</u></p>
                     </div>
                </div>
                <div class="Images" @click="addCangku">
                  <img src="../../assets//images//addImg.png" alt="">
                  <p>添 加 关 联 仓 库</p>
                </div>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row>
            <el-col :span="4" class="trightb">
              <el-form-item class="trightb_item">
                <span slot="label">关联企业</span>
              </el-form-item>
            </el-col>
            <el-col :span="20">
              <el-form-item class="trightb_item">
                <el-select v-model="enterSids.enterpriseSid" multiple  class="addinputw" placeholder="请选择企业单位" style="width:100%"
                  @change="getEnterName">
                  <el-option v-for="(item,i) in enterpriseLists" :key="i" :label="item.enterpriseName"
                    :value="item.enterpriseSid" />
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>
        </el-form>

      </div>
    </div>
    <el-drawer
     title="关联仓库"
     :visible.sync="drawer"
     size="800px"
     >
     <el-button style="margin-left: 700px;" type="primary"   @click="guanlianSid">关联</el-button>
     <div class="main-content">
       <el-table
         ref="multipleTable"
         :data="tableData"
         tooltip-effect="dark"
         style="width: 100%"
         @selection-change="handleSelectionChange">
         <el-table-column
           type="selection"
           width="55">
         </el-table-column>

         <el-table-column
           prop="name"
           label="仓库名称"
           align="center"
           >
         </el-table-column>
         <el-table-column
           prop="picUrl"
           label="仓库图片"
           align="center"
           >
           <template slot-scope="scope">
            <div class="xxx">
              <img v-if="scope.row.picUrl" :src="scope.row.picUrl" alt="">
            <img v-else src="../../assets/images/notAvailable.jpg" alt="" />
            </div>
              </template>
         </el-table-column>
       </el-table>
      </div>
    </el-drawer>
  </div>
</template>

<script>
  import req from '@/api/project/project'

  export default {
    data() {
      return {
        title: "【新增】项目信息",
        submitdisabled: false,
        drawer: false,
        formobj: {
          sid: "",
          entryName: "", // 项目名称
          industryName: "", // 行业名称
          industrySid: "",
          typeName: "", // 项目类型
          typeSid: "",
          bankPledgeRate:"", // 质押率
          creditLimit: "", // 授信额度
          bankName: "", // 贷款行
          bankSid: "",
          bmanagerName: '', // 客户经理
          managerSid: "",
          engaDate: "", // 授信日期
          useLimit: "", // 用信总额
          loanDate: "", // 放款日期
          useDate: "", // 用信日期
          signingDate: "", // 签约日期
          enterpriseName: "", // 项目单位
          enterpriseSid: "",
          econtacts: "", // 项目联系人
          remarks: "", // 项目说明
          regulatoryLeader: "", // 监管负责人
          generalManager: "", // 事业部经理
          endDate: "", // 结束日期
          fillInDate: "", // 填表日期
          storeHouseProjectDto :{
            shSids:[]
          },
          enterpriseProjectDto:{
            enterpriseSids:[]
          }
        },
        industryAllList: [],
        industryList: [],
        typeAllList: [],
        typeList: [],
        bankAllList: [],
        bankList: [],
        bManagerAllList: [],
        bManagerList: [],
        enterpriseAllList: [],
        enterpriseList: [],
        enterpriseLists: [],
        temps: [],
        tableData: [],
        ValSid:[],
        ARRSid:[],
        ImgSid:[],
        getImgsid:[],
        Sidlists:[],
        enterSids:{
          enterpriseName:'',
          enterpriseSid:''
        },
      }
    },
    created() {
      this.loanbankinformation() // 贷款行
      this.enterpriseinformation() // 项目单位
      this.industrydictionary() // 行业字典信息
      this.projtypedictionary() // 类型字典信息
    },
    methods: {
      addImg(){
        console.log(6);
      },
      loanbankinformation() {
        req.getLoanbankinformation().then((res) => {
          if (res.success) {
            console.log(">>>>>>>>>11111111", res.data)
            this.bankAllList = res.data
            this.bankList = []
            for (var i = 0; i < this.bankAllList.length; i++) {

              let bank = {
                dictValue: this.bankAllList[i].bankName,
                dictKey: this.bankAllList[i].sid,

              }
              this.bankList.push(bank)
            }

          }
        })
      },
      enterpriseinformation() {
        req.getEnterpriseinformation().then((res) => {
          if (res.success) {
            console.log(">>>>>>>>>2222222", res.data)
            this.enterpriseAllList = res.data
            this.enterpriseLists = []
            this.enterpriseList = []
            for (var i = 0; i < this.enterpriseAllList.length; i++) {

              let enterprise = {
                dictValue: this.enterpriseAllList[i].enterpriseName,
                dictKey: this.enterpriseAllList[i].sid,

              }
              let enterprises = {
                enterpriseName: this.enterpriseAllList[i].enterpriseName,
                enterpriseSid: this.enterpriseAllList[i].sid,

              }
              this.enterpriseList.push(enterprise)
              this.enterpriseLists.push(enterprises)
            }

          }
        })
      },
      industrydictionary() {
        req.getIndustrydictionary().then((res) => {
          if (res.success) {
            console.log(">>>>>>>>>3333333", res.data)
            this.industryAllList = res.data
            this.industryList = []
            for (var i = 0; i < this.industryAllList.length; i++) {

              let industry = {
                dictValue: this.industryAllList[i].industryName,
                dictKey: this.industryAllList[i].sid,

              }
              this.industryList.push(industry)
            }

          }
        })
      },
      projtypedictionary() {
        req.getProjtypedictionary().then((res) => {
          if (res.success) {
            console.log(">>>>>>>>>444444", res.data)
            this.typeAllList = res.data
            this.typeList = []
            for (var i = 0; i < this.typeAllList.length; i++) {

              let type = {
                dictValue: this.typeAllList[i].typeName,
                dictKey: this.typeAllList[i].sid,

              }
              this.typeList.push(type)
            }

          }
        })
      },

      getHangYe(value) {
        console.log(">>>>>>>>>getHangYe", value)
        const choose = this.industryList.filter((item) => item.dictKey === value)
        this.formobj.industryName = choose[0].dictValue
        this.formobj.industrySid = choose[0].dictKey
      },
      getType(value) {
        console.log(">>>>>>>>>getType", value)
        const choose = this.typeList.filter((item) => item.dictKey === value)
        this.formobj.typeName = choose[0].dictValue
        this.formobj.typeSid = choose[0].dictKey
      },
      getBank(value) {
        console.log(">>>>>>>>>getBank", value)
        const choose = this.bankList.filter((item) => item.dictKey === value)
        this.formobj.bankName = choose[0].dictValue
        this.formobj.bankSid = choose[0].dictKey

        let items = this.bankAllList.filter(
          // function(item) {
          // 	return item.id == val.id;
          item => {
            console.log('item: ' + JSON.parse(JSON.stringify(item)).sid)
            console.log('val: ' + value)
            if (JSON.parse(JSON.stringify(item)).sid == value) {
              return true
            }
          })
        console.log(">>>>>>>>>getBank", items)
        this.bManagerAllList = items[0].managerList
        this.bManagerList = []
        for (var i = 0; i < this.bManagerAllList.length; i++) {

          let bManager = {
            dictValue: this.bManagerAllList[i].name,
            dictKey: this.bManagerAllList[i].sid,

          }
          this.bManagerList.push(bManager)
        }

      },
      getBManager(value) {
        console.log(">>>>>>>>>getBManager", value)
        const choose = this.bManagerList.filter((item) => item.dictKey === value)
        this.formobj.bManagerName = choose[0].dictValue
        this.formobj.managerSid = choose[0].dictKey

      },
      getEnterName(value) {
        var EnterSidss=[]
        for(let i=0;i<value.length;i++){
          EnterSidss.push(value[i])
        }
        this.formobj.enterpriseProjectDto.enterpriseSids=EnterSidss
      },
      getEnterpriseName(value) {
        console.log(">>>>>>>>>getBManager", value)
        const choose = this.enterpriseList.filter((item) => item.dictKey === value)
        this.formobj.enterpriseName = choose[0].dictValue
        this.formobj.enterpriseSid = choose[0].dictKey
        let items = this.enterpriseAllList.filter(
          // function(item) {
          // 	return item.id == val.id;
          item => {
            console.log('item: ' + JSON.parse(JSON.stringify(item)).sid)
            console.log('val: ' + value)
            if (JSON.parse(JSON.stringify(item)).sid == value) {
              return true
            }
          })
        console.log(">>>>>>>>>getBManager", items)
        this.formobj.econtacts = items[0].contacts
      },

      saveOrUpdate() {
        console.log(">>>>>>>>>saveOrUpdate", this.formobj)
        if (this.formobj.sid) {
          if(this.formobj.enterpriseProjectDto.enterpriseSids.length==0){
            let EnterSidss=[]
            for(let i=0;i<this.Sidlists.length;i++){
             EnterSidss.push(this.Sidlists[i].enterpriseSid)
            }
            this.formobj.enterpriseProjectDto.enterpriseSids=EnterSidss
          }
          req.updateData(this.formobj)
            .then(resp => {
              if (resp.success) {
                this.$message({
                  showClose: true,
                  type: 'success',
                  message: resp.msg
                })
                this.handleReturn("true")
                this.$refs.multipleTable.clearSelection();
              } else {
                // 根据resp.code进行异常情况处理
              }
            })
            .catch(() => {})
        } else {
          req.addInfo(this.formobj)
            .then(resp => {
              if (resp.success) {
                this.$message({
                  showClose: true,
                  type: 'success',
                  message: resp.msg
                })
                this.handleReturn("true")
                this.$refs.multipleTable.clearSelection();
              } else {
                // 根据resp.code进行异常情况处理
              }
            })
            .catch(() => {})
        }

      },
      selectStoreHouses(){
        req.selectStoreHouse().then((res) => {
        if (res.success) {
          this.tableData=res.data
        }
       })
      },
      delSid(delSid){
        let newVarImg=[]
        let newImgss=[]
        this.ImgSid.forEach(function check(value) {
         if(value.shSid != delSid.shSid ) {
           newVarImg.push(value);
         }
         if(value.sid != delSid.sid){
           newImgss.push(value);
         }
        })
        let newImg=newVarImg.concat(newImgss);
        this.ImgSid=[...new Set(newImg)];
        var ARRSid=[]
        var aRRsid=[]
        if(this.ImgSid.length>0){
          for(var i=0;i<this.ImgSid.length;i++){
            if(this.ImgSid[i].simpleName){
              aRRsid.push(this.ImgSid[i].sid)
            }else{
              ARRSid.push(this.ImgSid[i].shSid)
            }
          let newSid=ARRSid.concat(aRRsid);
          this.formobj.storeHouseProjectDto.shSids=[...new Set(newSid)];
         }
        }else{
          this.formobj.storeHouseProjectDto.shSids=[]
        }
      },
      handleReturn(isreload) {
        if (isreload === 'true') this.$emit('reloadlist')

        this.formobj = {
          sid: "",
          entryName: "", // 项目名称
          industryName: "", // 行业名称
          industrySid: "",
          typeName: "", // 项目类型
          typeSid: "",
          creditLimit: "", // 授信额度
          bankName: "", // 贷款行
          bankSid: "",
          bmanagerName: '', // 客户经理
          managerSid: "",
          engaDate: "",
          useLimit: "",
          loanDate: "",
          useDate: "",
          signingDate: "", // 签约日期
          enterpriseName: "", // 项目单位
          enterpriseSid: "",
          econtacts: "", // 项目联系人
          remarks: "", // 项目说明
          regulatoryLeader: "", // 监管负责人
          generalManager: "", // 事业部经理
          endDate: "", // 结束日期
          fillInDate: "", // 填表日期
          storeHouseProjectDto :{
            shSids:[]
          },
          enterpriseProjectDto:{
            enterpriseSids:[]
          }
        }
        this.ImgSid=[]
        this.ValSid=[]
        this.ARRSid=[]
        this.getImgsid=[]
        this.enterSids=[]
        this.Sidlists=[]
        this.enterSids={
          enterpriseName:'',
          enterpriseSid:''
        },
        this.title= "【新增】项目信息",
        this.$emit('doback')
      },
      showAdd(){
        this.title= "【新增】项目信息"
        this.selectStoreHouses() // 选择可用的仓库信息
      },
      showEdit(row) {
         this.title= "【修改】项目信息",
         req.fetchBySid(row.sid)
          .then(resp => {
            if (resp.success) {
                this.formobj.entryName=resp.data.entryName
                this.formobj.sid=resp.data.sid
                this.formobj.industryName=resp.data.industryName
                this.formobj.industrySid=resp.data.industrySid
                this.formobj.bankPledgeRate=resp.data.bankPledgeRate
                this.formobj.typeName=resp.data.typeName
                this.formobj.typeSid=resp.data.typeSid
                this.formobj.creditLimit=resp.data.creditLimit
                this.formobj.bankName=resp.data.bankName
                this.formobj.bankSid=resp.data.bankSid
                this.formobj.bmanagerName=resp.data.bmanagerName
                this.formobj.managerSid=resp.data.managerSid
                this.formobj.engaDate=resp.data.engaDate
                this.formobj.useLimit=resp.data.useLimit
                this.formobj.loanDate=resp.data.loanDate
                this.formobj.useDate=resp.data.useDate
                this.formobj.signingDate=resp.data.signingDate
                this.formobj.enterpriseName=resp.data.enterpriseName
                this.formobj.enterpriseSid=resp.data.enterpriseSid
                this.formobj.econtacts=resp.data.econtacts
                this.formobj.remarks=resp.data.remarks
                this.formobj.regulatoryLeader=resp.data.regulatoryLeader
                this.formobj.generalManager=resp.data.generalManager
                this.formobj.endDate=resp.data.endDate
                this.formobj.fillInDate=resp.data.fillInDate
                this.Sidlists=resp.data.enterpriseProjectVoList
                this.enterSids.enterpriseSid = []
                for (let i = 0; i < this.Sidlists.length; i++) {
                  this.enterSids.enterpriseSid.push(this.Sidlists[i].enterpriseSid)
                }
            }

          })
          .catch(e => {
            this.formobj = row
          })
      this.selectStoreHouses() // 选择可用的仓库信息
       req.selectStoreHouseSid(row.sid).then((res) => {
        if (res.success) {
          this.ImgSid=res.data
          for(let i=0;i<this.ImgSid.length;i++){
            this.getImgsid.push(this.ImgSid[i].shSid)
          }
        }
       })
      },
      addCangku(){
        this.drawer = true
      },
      handleSelectionChange(val) {
        this.ValSid=val
      },
      guanlianSid(){
        let val=this.ValSid
        for(let i=0;i<val.length;i++){
         this.ARRSid.push(val[i].sid)
        }
        var oldArr = [...new Set(this.ARRSid)];
        if(this.ImgSid.length>0){
          let newArr =this.getImgsid.concat(oldArr);
          let newImg=this.ImgSid.concat(this.ValSid);
          this.ImgSid=[...new Set(newImg)];
          this.formobj.storeHouseProjectDto.shSids=newArr
        }else{
          this.ImgSid=[...new Set(this.ValSid )]
          this.formobj.storeHouseProjectDto.shSids=oldArr
        }
        this.drawer=false
        this.$refs.multipleTable.clearSelection();
      },

    }
  }
</script>
<style scoped>
  .trightb {
    display: flex;
    align-items: center;
    text-align: ;
    justify-content: center;
  }

  .trightb_item {
    padding-top: 5px;
  }
  .trightbs {
    display: flex;
    align-items: center;
    text-align: ;
    justify-content: center;
  }

  .span {
    margin-left: 50px;
    font-size: 15px;
    font-weight: 400;
  }

  /deep/ .el-collapse-item__header {
    height: 40px;
    padding: 10px;
    font-weight: bold;
    font-size: 20px;
    text-align: left;
    color: #ffffff;
    background-color: #0294d7;
  }

  /deep/ .el-collapse-item__content {
    padding-bottom: 0;
  }
  /deep/ .formadd .el-row .trightbs{
    border-top: 1px solid #e0e3eb;
  }
  /deep/ .formadd .el-row .trightb_items{
    border-top: 1px solid #e0e3eb;
  }
  .Images{
    width: 150px;
    height: 100px;
    margin: 10px 10px 30px 10px;
    float: left;
  }
  .Images img{
    width: 100px;
    height: 100px;
    margin-left: 24px;
  }
  .Images p{
    color: #B8B8B8;
    font-weight: 600;
    font-size: 14px;
    text-align: center;
    margin-top: -30px;
  }
  .Images:hover p{
    color: #b8b8b8b0;
  }



 .ImageX{
    width: 150px;
    height: 100px;
    float: left;
    margin: 10px 20px 40px 10px;
  }
 .ImageX img{
    width: 100%;
    height: 100%;
  }
.ImageX p{
    color: #000;
    text-align: center;
    margin-top: -15px;
  }
  .ImageX p .Atext{
    text-decoration: none;
  }
  .ImageX{
    position: relative;
  }
 .ImageX i{
    font-size: 30px;
    color: #fff;
    position: absolute;
    top: 0;
    left: 120px;
  }
.xxx{
    width: 150px;
    height: 100px;
}
.xxx img{
  width: 100%;
    height: 100%;
}
</style>
