<style>
  .procurementMange .template_comheader {
    padding: 13px 20px;
    border-bottom: 1px solid #EBEEF5;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    background: #fff;
  }

  .procurementMange .template_comheader>div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-direction: row;
  }

  .procurementMange .temp_content {
    margin-top: 10px;
    background: #fff;
    padding: 20px;
  }

  .procurementMange .temp_imgStyle {
    display: inline-block;
    margin-right: 10px;
  }

  .procurementMange .app-add-cat .el-checkbox-group {
    font-size: 14px !important;
  }

  .procurementMange .app-add-cat .el-checkbox {
    margin-right: 0;
  }

  .procurementMange .app-add-cat .el-dialog__body {
    padding: 10px 20px !important;
  }

  .procurementMange .app-add-cat .tag-box .tag-item {
    margin-right: 5px;
  }

  .procurementMange .app-add-cat .tag-box {
    margin: 20px 0;
  }

  .procurementMange .app-add-cat .app-goods-cat-list .active {
    background: #FAFAFA;
  }

  .procurementMange .app-add-cat .app-goods-cat-list .cat-item {
    cursor: pointer;
    padding: 5px 10px;
  }

  .procurementMange .app-add-cat .app-goods-cat-list {
    border: 1px solid #E8EAEE;
    border-radius: 5px;
    margin-top: -5px;
    padding: 10px 0;
    overflow: scroll;
    height: 400px;
  }

  .procurementMange .el-table td,
  .el-table th {
    padding: 5px 0;
    font-size: 14px;
  }

  .procurementMange .el-form-item {
    margin-bottom: 15px;
  }

  .procurementMange .flDig_choose {
    display: flex;
    flex-direction: row;
    align-items: center;
  }

  .procurementMange .flDig_choose_item {
    color: #089bab;
    padding: 6px 12px;
    border: 1px solid #089bab;
    border-radius: 20px;
    cursor: pointer;
  }
  .procurementMange  .el-tag{
    color: #000;
  }
  .procurementMange  .AttrList{
    margin-top: 10px; position: relative; margin-right: 15px;
           overflow: hidden; white-space: nowrap; text-overflow: ellipsis; cursor: pointer;
  }
  .procurementMange .AttrList2{
    width: 100%;
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
  }
  .procurementMange .Attrlist_item{
    display: inline-block;
    width: 50%;
  }
   .procurementMange .Attrlist_item .el-input__inner{
    width: 100px;
    height: 28px;
  }
  .procurementMange .Detaildata_box{
    margin-top: 50px;
    width: 100%;
  }
  .procurementMange .Detaildata_box .Detaildata_item{
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f5f5f5;
  }
   .procurementMange  .Detaildata_item_r{
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    height: 100px;
    padding: 10px 0;
  }
  
</style>
<template>
  <div class="procurementMange">
    <div class="template_comheader">
      <div>
        <span>采购列表</span>
        <el-button type="primary" size="small" @click="flDig=true">新增采购单</el-button>
      </div>
    </div>
    <div class="temp_content">
      <div>
        <div class="searchInput" style="width:250px;margin-right: 0px;">
          <el-input @keyup.enter.native="msg.pageIndex=1,getList()" style="display:inline-block;width:225px;height:30px"
            placeholder="请输入商品名称" v-model="msg.GoodsName" @clear="msg.pageIndex=1,getList()" size="small" clearable>
          </el-input>
          <span @click="msg.pageIndex=1,getList()" class="el-icon-search"
            style="color:#979dad;font-size:14px;position:relative;top:1px"></span>
        </div>
        <el-date-picker v-model="dateList" @change="msg.pageIndex=1,getList()" size="small" type="datetimerange"
          range-separator="至" value-format="yyyy-MM-dd HH:mm:ss" start-placeholder="开始日期" end-placeholder="结束日期">
        </el-date-picker>
       <span style='margin-left:10px;margin-right:5px'>入库状态</span>
          <el-select v-model="msg.StockInStatus" placeholder="请选择" size="small" filterable @change="msg.pageIndex=1,getList()">
            <el-option label="全部" :value="0"></el-option>
            <el-option :label="item.Name" :value="item.ID" v-for="(item,index) in options2" :key="index"></el-option>
          </el-select>
        

      </div>
      <el-table :data="dataList" border style="width: 100%;margin-Top:10px">
        <el-table-column prop="Id" label="ID" width="100"></el-table-column>

        <el-table-column prop="WareHouseName" label="仓库名称"></el-table-column>
        <el-table-column prop="TotalCostMoney" label="总价格"></el-table-column>
        <el-table-column prop="TotalNumber" label="总数量"  width="150"></el-table-column>
        <!-- <el-table-column prop="FinanceId" label="绑定财务单据id" width="150"></el-table-column> -->
        <el-table-column prop="Remark" label="备注" width="260"></el-table-column>
        <el-table-column prop="StockInStatus" label="入库状态" width="150">
          <template slot-scope="scope">
             <span v-if="scope.row.StockInStatus==1">未入库</span>
             <span v-if="scope.row.StockInStatus==2">部分入库</span>
             <span v-if="scope.row.StockInStatus==3">已入库</span>
          </template>
        </el-table-column>
        <el-table-column prop="CreateDate" label="创建时间" width="120"></el-table-column>
        <el-table-column label="操作"  width="150">
            <template slot-scope="scope">
              <el-tooltip class="item" effect="dark" content="打印" placement="top">
                  <img src="../../assets/img/userman/print2.png" alt="" class="temp_imgStyle" @click="goprint(scope.row)" style="width:20px;height:20px"  >
                </el-tooltip>
              <el-tooltip class="item" effect="dark" content="入库" placement="top" v-if="scope.row.StockInStatus==1 || scope.row.StockInStatus==2 ">
                  <img src="../../assets/img/userman/status_4_active.png" alt="" class="temp_imgStyle" @click="putstorage(scope.row)" style="width:20px;height:20px"  >
                </el-tooltip>
                <el-tooltip class="item" effect="dark" content="详情" placement="top" >
                    <img src="../../assets/img/userman/s_3_active.png" alt="" class="temp_imgStyle" style="width:20px;height:20px" @click="EditeTemplate(scope.row)">
                </el-tooltip>
                
            </template>
        </el-table-column>
      </el-table>
      <el-pagination style="text-align:right" background @current-change="handleCurrentChange"
        :current-page.sync="msg.pageIndex" :page-size="msg.pageSize" layout="prev, pager, next" :total="total">
      </el-pagination>
    </div>
    <!-- 生成采购单 -->
    <el-dialog custom-class="app-add-cat" title="新增采购单" :visible.sync="flDig" width="1100px">
      <el-form :model="addMsg" :rules="rules" ref="addMsg" label-width="90px" style="width:50%">
        <el-form-item label="账户类型" prop="IsPublic">
          <el-select v-model="addMsg.IsPublic" placeholder="请选择" size="small" filterable>
            <el-option :label="item.Name" :value="item.ID" v-for="(item,index) in AccountList" :key="index"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="供应商" prop="SupplierId">
          <el-select v-model="addMsg.SupplierId" placeholder="请选择" size="small" filterable @change="gyings">
            <el-option :label="item.Name" :value="item.ID" v-for="(item,index) in options" :key="index"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="仓库" prop="WareHouseId">
          <el-select v-model="addMsg.WareHouseId" placeholder="请选择" size="small" filterable>
            <el-option :label="item.Name" :value="item.Id" v-for="(item,index) in getWareHouseList" :key="index"></el-option>
          </el-select>
        </el-form-item>
        <div class="flDig_choose">
          <div class="flDig_choose_item" @click="addGoods">
            <span>+选择商品</span>
          </div>
          <div class="flDig_choose_item" style="margin-left: 20px;" @click="btndelete">
            <span>-移除商品</span>
          </div>
        </div>

      </el-form>
      <div v-for="(x,i) in selectGoods" :key="i">
        <el-table :data="[x]" border style="width: 100%;margin-Top:10px">
            <el-table-column
            width="55">
             <template slot-scope="scope">
                <el-checkbox-group v-model="scope.row.ChooseD" @change="handleCheckedCitiesChange2(scope.row)">
                  <el-checkbox></el-checkbox>
                </el-checkbox-group>
            </template>
          </el-table-column>
          <el-table-column prop="Id" label="ID" width="100"></el-table-column>

          <el-table-column prop="Name" label="商品名称"></el-table-column>
           <el-table-column label="封面图" width="100">
            <template slot-scope="scope">
              <img :src="scope.row.CoverImage" alt="" style="width: 50px; height: 50px;">
            </template>
          </el-table-column>
          <el-table-column prop="CostPrice" label="成本价格" width="130">
              <template slot-scope="scope">
                   <el-input placeholder="请输入内容" size='small' v-model="scope.row.CostPrice" :min="0 " type="number" style="width:100px"></el-input>
              </template>
              
          </el-table-column>
        </el-table>
        <div class="Attrlist2">
            <span  v-for="(item,index) in x.SpecificationList" :key="index"  class="Attrlist_item" v-if="item.IScheck==true" :style="{height:item.IScheck==true?'32px':'0',' margin-top':item.IScheck==true?'20px':'0'}">
              
                  <span v-if="item.IScheck==true" class="el-tag el-tag--medium el-tag--light" style="top: 10px; position: relative; margin-right: 5px;max-width:300px;
                   overflow: hidden; white-space: nowrap; text-overflow: ellipsis;margin-left:20px">
                        <span v-for="(x,y) in item.AttrList" :key="y">{{x}} <span v-if="item.AttrList.length !== y+1"> , </span></span>
                </span>
                <!-- <span>数量：
                  <el-input size='small' v-model="item.Number" :min="0 " type="number" placeholder="请输入内容" ></el-input>
                </span> -->
                <el-input placeholder="请输入内容" size='small' v-model="item.Number" :min="0 " type="number" style="width:150px">
                  <template slot="prepend">数量</template>
                </el-input>
            </span>
        </div>
        <el-button type="text" @click="AtterDigbtn(i)" v-if='selectGoods.length>0'>+规格选择</el-button>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button size="small" @click="flDig = false">取 消</el-button>
        <el-button @click="chooseFl('addMsg')" size="small" type="primary" >新 增</el-button>
      </span>
    </el-dialog>
    <!-- 商品列表 -->
    <el-dialog custom-class="app-add-cat" title="商品选择" :visible.sync="goodsDig" width="1100px">
      <div class="temp_content attr">
         <div>
              <el-tabs v-model="activeName" @tab-click="handleClick">
                  <el-tab-pane :dataId="0" label="全部" name="first"></el-tab-pane>
                  <el-tab-pane :dataId="1" label="上架中" name="second"></el-tab-pane>
                  <el-tab-pane :dataId="2" label="下架中" name="third"></el-tab-pane>
                  <el-tab-pane :dataId="3" label="售罄" name="fourth"></el-tab-pane>
              </el-tabs>
          </div>
        <div style="display: flex;flex-direction: row;align-items: center;">
         
          <div class="searchInput" style="width:250px;margin-right: 20px;">
            <el-input @keyup.enter.native="goodsMsg.pageIndex=1,getgoodslist()"
              style="display:inline-block;width:225px;height:30px" placeholder="请输入商品名称" v-model="goodsMsg.Name"
              @clear="goodsMsg.pageIndex=1,getgoodslist()" size="small" clearable>
            </el-input>
            <span @click="goodsMsg.pageIndex=1,getgoodslist()" class="el-icon-search"
              style="color:#979dad;font-size:14px;position:relative;top:1px"></span>
          </div>
           <div  style="width:600px;margin-right: 0px;"><span>供应商：{{gyinsName}}</span></div>

        </div>
        <el-table :data="goodList" border style="width: 100%;margin-Top:10px" v-loading="loading">
         
          <el-table-column
            width="55">
             <template slot-scope="scope">
                <el-checkbox-group v-model="scope.row.Chooseg" @change="handleCheckedCitiesChange(scope.row)">
                  <el-checkbox></el-checkbox>
                </el-checkbox-group>
            </template>
           
          </el-table-column>
          <el-table-column prop="Id" label="ID" width="100"></el-table-column>

          <el-table-column prop="Name" label="商品名称"></el-table-column>
          <el-table-column label="封面图" width="100">
            <template slot-scope="scope">
              <img :src="scope.row.CoverImage" alt="" style="width: 50px; height: 50px;">
            </template>
          </el-table-column>
          <el-table-column prop="CostPrice" label="成本价格" width="100"></el-table-column>

        </el-table>
        <el-pagination style="text-align:right" background @current-change="handleCurrentChange2"
          :current-page.sync="goodsMsg.pageIndex" :page-size="goodsMsg.pageSize" layout="prev, pager, next"
          :total="total2">
        </el-pagination>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button size="small" @click="goodsDig = false">取 消</el-button>
        <el-button @click="choosegoods" size="small" type="primary">确 定</el-button>
      </span>
    </el-dialog>
     <!-- 规格选择 -->
    <el-dialog custom-class="app-add-cat" title="规格选择" :visible.sync="AtterDig" width="1100px">
      <div class="temp_content" v-if="SpecList.length>0">
          
          <span class="el-tag el-tag--small el-tag--light AttrList" :style="{color: item.IScheck == true?'#409eff':'#000'}" 
            v-for="(item,index) in SpecList" :key="index"
            @click="chooseAttr(index)"
          >
              <span v-for="(x,y) in item.AttrList" :key="y">{{x}}<span v-if="item.AttrList.length !== y+1"> , </span></span>
          </span>
      </div>
      <!-- <span slot="footer" class="dialog-footer">
        <el-button size="small" @click="AtterDig = false">取 消</el-button>
        <el-button @click="chooseA" size="small" type="primary">确 定</el-button>
      </span> -->
    </el-dialog>
    <!-- 详情 -->
    <el-dialog custom-class="app-add-cat" title="采购详情" :visible.sync="DetailDig" width="1100px">
      <div class="temp_content">
        <span >仓库名称：{{Detaildata.WareHouseName}}</span>
        <span style="margin-left:30px">总价格：￥{{Detaildata.TotalCostMoney}}</span>
        <span style="margin-left:30px">总数量：{{Detaildata.TotalNumber}}</span>
        <!-- <span style="margin-left:30px">绑定财务单据id：{{Detaildata.FinanceId}}</span> -->
        <div style="margin-top:10px">
            
          <span >创建时间:{{Detaildata.CreateDate}}</span>
          <span style="margin-left:30px">备注：{{Detaildata.Remark}}</span>
        </div>
        <div class="Detaildata_box">
            <div class="Detaildata_item" v-for="(item,index) in Detaildata.DetailList" :key="index">
                <img :src="item.MaterialModel.ImageList[0]" alt="" style="width: 100px; height: 100px;">
                <div style="margin-left:20px" class="Detaildata_item_r">
                  <div>{{item.MaterialModel.Name}}</div>
                  <div style="color:'#409eff'">
                        <span class="el-tag el-tag--small el-tag--light" style="top: 5px; position: relative; margin-right: 5px;max-width:300px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; ">
                        <span v-for="(x,y) in item.MaterialModel.GoodsSpecificationList" :key="y">{{x}} <span v-if="item.MaterialModel.GoodsSpecificationList.length !== y+1"> , </span></span>
                </span>
                  </div>
                  
                  <div>成本价格：￥{{item.CostMoney}} <span style="margin-left:30px">采购数量：{{item.Number}}{{item.MaterialModel.Units}}</span><span style="margin-left:30px">入库数量：{{item.StockInNum}}{{item.MaterialModel.Units}}</span></div>

                </div>
            </div>
        </div>
      </div>
     
    </el-dialog>
  </div>
</template>
<script>
  export default {
    data() {
      return {
        fullscreenLoading: false,
        loading: false,
        dataList: [],
        goodList: [],
        dateList: [],
        selectGoods: [],
        
        staginggoods:[],//暂存选中的商品
        stagingDelete:[],//暂存删除数组
        SpecList:[],//规格数组
        ggindex:0,//规格的索引
        gyinsName:'',

        flDig: false,
        goodsDig: false,
        AtterDig:false,
        DetailDig:false,
        Detaildata:{},
        AttrArray:[],
        activeName:'first',
        msg: {
          pageIndex: 1,
          pageSize: 15,
          GoodsName: '',
          StartTime: '',
          EndTime: '',
          StockInStatus:0,
        },
        addMsg: {
          IsPublic: '',
          SupplierId: '',
          WareHouseId: '',
          DetailList: [],
        },
        goodsMsg: {
          pageIndex: 1,
          pageSize: 10,
          Name: '',
          GoodsStatus: 0,
          CategoryIds: '',
          SupplierId: 0,
        },
        goodsId: 0,
        total: 0,
        total2: 0,
        AccountList: [ {'ID':0,'Name':'私帐'},{'ID':1,'Name':'公帐'},{'ID':2,'Name':'人民币现金'},{'ID':3,'Name':'外币现金'},{'ID':4,'Name':'资金池'},],
        options: [],
        options2:[
          {'ID':1,'Name':'未入库'}, {'ID':2,'Name':'部分入库'}, {'ID':3,'Name':'已入库'}
        ],
        getWareHouseList:[],
        rules: {
          IsPublic: [{
            required: true,
            message: '请选择账户类型',
            trigger: 'change'
          }],
          SupplierId: [{
            required: true,
            message: '请选择供应',
            trigger: 'change'
          }],
          WareHouseId: [{
            required: true,
            message: '请选择仓库',
            trigger: 'change'
          }],

        },
      };
    },
    created() {

    },
    methods: {
      changeMsg(e) {
        console.log(e);
        this.$forceUpdate();
      },
      handleCurrentChange(val) {
        this.msg.pageIndex = val;
        this.getList();
      },
      handleCurrentChange2(val) {
        this.goodsMsg.pageIndex = val;
        this.getgoodslist();
      },
      getList() {
        if (this.dateList && this.dateList.length > 0) {
          this.msg.StartTime = this.dateList[0];
          this.msg.EndTime = this.dateList[1];
        } else {
          this.msg.StartTime = '';
          this.msg.EndTime = '';
        }
        this.assetsApipost("/api/property/GetProcurementPageList", this.msg, res => {
          if (res.data.resultCode == 1) {
            this.dataList = res.data.data.pageData;
            this.total = res.data.data.count;
          } else {
            this.Info(res.data.message);
          }
        })
      },
      // 账户类型
      // getAccount() {
      //   this.apipost("/api/finance/GetAccountTypeList", {}, res => {
      //     this.AccountList = res.data.data;
      //   })
      // },
      //供应商
      getSupplierList() {
        this.apipost("/api/Supplier/GetSupplierAllList", {}, res => {
          this.loading = false;
          if (res.data.resultCode == 1) {
            this.options = res.data.data;
          }
        });
      },
       // 仓库列表  
    getWareHouse(){
        this.apiJavaPost("/api/Supplies/GetWareHouseList",{Name:''},
            res => {
            if (res.data.resultCode === 1) {
                this.getWareHouseList=res.data.data;
            } else {
                this.Error(res.data.message);
            }
            },
            null
        );
    },
      //商品列表
      getgoodslist() {
        this.loading = true
        this.assetsApipost("/api/property/GetGoodsToProcurementPageList", this.goodsMsg, res => {
          this.loading = false
          if (res.data.resultCode == 1) {
            var tempArray = res.data.data.pageData;
            tempArray.forEach(x=>{
              x.Chooseg = false;
              if( this.staginggoods.length>0){
                 this.staginggoods.forEach(j=>{
                   if(x.Id == j.Id){
                     x.Chooseg = true;
                   }
                 })
              }
            })
            this.goodList = tempArray;
            this.total2 = res.data.data.count;
          } else {
            this.Info(res.data.message);
          }
        })
      },
      handleCheckedCitiesChange(row){//选择商品
        if(row.Chooseg==true){
          this.staginggoods.push(row)
        }else{
          this.staginggoods.forEach((x,i)=>{
            if(x.Id==row.Id){
              this.staginggoods.splice(i,1)
            }
          })
        }
      },
      handleCheckedCitiesChange2(row){//选择删除的商品
          if(row.ChooseD==true){
              this.stagingDelete.push(row)
            }else{
              this.stagingDelete.forEach((x,i)=>{
                if(x.Id==row.Id){
                  this.stagingDelete.splice(i,1)
                }
              })
            }
           
      },
      btndelete(){ //删除商品
        this.stagingDelete.forEach(x=>{
          this.selectGoods.forEach((j,i)=>{
            if(x.Id == j.Id){
                this.selectGoods.splice(i,1)
            }
          })
          this.staginggoods.forEach((j,i)=>{
            if(x.Id == j.Id){
                this.staginggoods.splice(i,1)
            }
          })
        })
        this.stagingDelete=[]

      },
      
      choosegoods() { //确实的选择商品时的确认
        
        this.staginggoods.forEach(x=>{
          x.ChooseD =false;//删除的对象
          x.SpecificationList.forEach(j=>{
            j.IScheck=false;
            j.Number= 0
          })
        })
        this.selectGoods= JSON.parse(JSON.stringify(this.staginggoods));
        this.goodsMsg.pageIndex = 1;
        this.goodsDig = false
      },
      addGoods() {
        if (this.addMsg.SupplierId == '') {
          this.Error('请选择供应商！');
          return
        }
        this.goodsDig = true;
        this.goodsMsg.SupplierId = this.addMsg.SupplierId;
        this.getgoodslist()
      },
      gyings(val){
        this.options.forEach(x=>{
          if(x.ID == val){
            this.gyinsName = x.Name
          }
        })
      },
      //生成采购单
      chooseFl(msg) {
          // console.log(this.addMsg)
          this.$refs[msg].validate(valid => {
          if (valid) {
            if(this.selectGoods.length==0){
                this.Error('请选择商品');
                return
            }
            let selectGoods = this.selectGoods;
            let datalList = [];
            for(let i = 0;i< selectGoods.length ; i++){
              let Isguige= false;
              let cainum = false;
              for(let j = 0;j<selectGoods[i].SpecificationList.length;j++){
                
                  if(selectGoods[i].SpecificationList[j].IScheck==true){
                     Isguige=true;
                      if(selectGoods[i].SpecificationList[j].Number==0){
                          cainum=true
                        }else{//组装addMsg.DetailList数据
                          let obj = {};
                          obj.GoodsId = selectGoods[i].Id;
                          obj.CostMoney = selectGoods[i].CostPrice;
                          obj.Number = selectGoods[i].SpecificationList[j].Number;
                          obj.SpecificationKey = selectGoods[i].SpecificationList[j].SpecificationSort;
                          datalList.push(obj)
                        }
                  }
              }
              if(Isguige == false){
                 this.Error('请选择规格');
                 return
                  break
              }else if(cainum == true){
                 this.Error('采购数量大于等于1');
                 return
                  break
              }
             
            }
           
            this.addMsg.DetailList = datalList;
            
            const loading = this.$loading({
              lock: true,
              text: '生成采购单中...',
              spinner: 'el-icon-loading',
            });
           
            this.assetsApipost(
              "/api/property/SetProcurementInfo",
              this.addMsg,
              res => {
                loading.close();
                if (res.data.resultCode == 1) {
                    this.Success(res.data.message);
                    this.flDig=false;
                    this.getList();
                    this.addMsg.IsPublic = '';
                    this.addMsg.SupplierId = '';
                    this.addMsg.WareHouseId = '';
                    this.addMsg.DetailList = [];
                    this.staginggoods=[];
                    this.selectGoods=[];

                } else {
                  this.Info(res.data.message);
                }
              }
            );
          } else {
            return false;
          }
        });
      },
      handleClick(val){
        let dataId=val.$attrs.dataId;
            if(dataId==0){
                this.goodsMsg.GoodsStatus=0;
            }
            if(dataId==1){
                this.goodsMsg.GoodsStatus=1;
            }
            if(dataId==2){
                this.goodsMsg.GoodsStatus=2;
            }
            if(dataId==3){
                this.goodsMsg.GoodsStatus=3;
            }
            this.goodsMsg.pageIndex=1
            this.getgoodslist();
      },
      AtterDigbtn(i){ // 点击规格选择的处理
         this.AtterDig =true;
         let a = [];
         let data = this.selectGoods[i].SpecificationList
          for(let i=0;i<data.length;i++){
            a.push(data[i])
          }
         this.SpecList = a
          this.ggindex = i
      },
      chooseAttr(index){//没改变原数组但是还是 生效了 这里有疑问
         this.SpecList[index].IScheck = !this.SpecList[index].IScheck;
      },
      chooseA(){
        this.AtterDig =false
       
      },
      EditeTemplate(row){
          this.DetailDig=true;
          this.Detaildata=row;
      },
      putstorage(row){
          this.CommonJump('putinStorage', {
          ID: row.Id,
          WareHouseId:row.WareHouseId,
        });
      },
      goprint(row){
         this.CommonJump('printManage', {
          ID: row.Id,
        });
      }



    },
    mounted() {
      this.getList();
      // this.getAccount()
      this.getSupplierList();
      this.getWareHouse()
    }
  };

</script>
