<template>
  <div class="testdiv">
    <div class="divborder newSearchDiv" style="margin:0px;">
      <div>
        <div class="filter">
          <label >{{$t('1950491')}}：</label>
          <Cascader :data="datalevel" :value="leveldata" v-model="sectionid" trigger="click" @on-change="handlelevelchange" change-on-select class="searchSelect"></Cascader>
        </div>
        <div class="filter">
          <label >{{$t('920165')}}：</label>
          <Select v-model="materialid" label-in-value clearable filterable class="searchSelect" @on-change="initsuppliers()">
              <Option v-for="item in materials" :value="item.id" :key="item.id">{{ item.name+"【"+ item.pn +"】" + "【" + item.spec + "】" }}</Option>
          </Select>
        </div>
        <div class="filter">
          <label >{{$t('600011')}}：</label>
          <Select v-model="supplierid" label-in-value clearable filterable @on-change="supplierChange()" class="searchSelect">
              <Option v-for="item in suppliers" :value="item.id" :key="item.id">{{ item.name }}</Option>
          </Select>
        </div>
         <div class="filter">
                <label >{{$t('800195')}}：</label>
                <Select v-model="result" label-in-value clearable class="searchSelect" >
                  <Option value="1" key="1">{{$t('1950546')}}</Option>
                  <!--<Option value="2" key="2">{{$t('900942')}}</Option>-->
                  <Option value="3" key="3">{{$t('1950547')}}</Option>
                  <Option value="4" key="4">{{$t('1950548')}}</Option>
                </Select>
            </div>
         <!-- 次级搜索条件--隐藏 -->
      <div v-show="!morecondition">
        <div>

            <div class="filter">
              <label >{{$t('1950514')}}：</label>
              <Input class="searchInput"  type="text" id="input1" v-model="batchnumber" />
            </div>
            <div class="filter">
              <label>{{$t('1046')}}：</label>
              <DatePicker
                id="日期"
                type="datetimerange"
                v-model="daterange"
                confirm
                placeholder=""
                class="searchInput MaxWidth "
                format="yyyy-MM-dd HH:mm:ss"
                @on-change="selectdate"
              ></DatePicker>
            </div>
      </div>
      </div>

      </div>
      <div class="searchBtn">
        <Button type="primary" class="twoWord" icon="ios-search" @click="search(1,pagesize)">{{$t('1001')}}</Button>
        <Button type="warning" class="twoWord" icon="ios-create-outline" @click="edit()">{{$t('1003')}}</Button>
        <Button type="error" class="twoWord intervalRight" icon="md-close-circle" @click="dele()">{{$t('1004')}}</Button>
        <Button type="primary" class="fourWord" icon="ios-cloud-download" @click="downexcel()">{{$t('1007')}}</Button>
      </div>
      <!-- 更多条件 按钮 -->
      <MoreConbtn @getCon="morecondition = !morecondition" :morecondition="morecondition"></MoreConbtn>

    </div>
    <div class="divborder newTableDiv">
      <Table
        class="tableClass"
        width='100%'
        @on-current-change="handleRowChange"
        highlight-row
        :data="tableData1"
        :columns="tableColumns1"
      ></Table>
      <div class="pageDiv">
        <div class="pageDirection">
          <Page
            :total="total"
            :current="page"
            @on-change="changePage"
            show-elevator
            show-sizer
            show-total
            @on-page-size-change="handlePageSize"
            :page-size-opts="[10,20,30,40,100]"
          ></Page>
        </div>
      </div>
    </div>

    <div class="divborder" v-show="detailshow">
      <label>{{$t('950253') + ':'}}</label>
      <template>
          <Table :columns="columns1" :data="tableData2">
          </Table>
      </template>
    </div>

    <Modal :title="$t('1950515')" v-model="carousel" :styles="{top: '40px',width:'900px',height:'400px'}">
      <div class="modal_body" style="width:100% !important;height: 400px !important; padding:0 10px;overflow: hidden;">
        <Carousel v-if="carousel" v-model="carouselValue">
          <CarouselItem v-for="(item,index) in carouselData" :key="index">
            <span style="font-size: 0;width: 848px;height: 400px;display: table-cell;text-align: center;vertical-align: middle;">
              <img alt="" :src="host + item.url" style="max-width: 100%;max-height: 100%;" />
            </span>
            <span v-show="false">{{index}}</span>
          </CarouselItem>
        </Carousel>
      </div>
    </Modal>

    <Modal :title="$t('1950516')" v-model="carousel_file" :styles="{top: '40px',width:'500px',height:'300px'}">
      <div class="modal_body" style="width:100% !important;height: 300px !important; padding:0 10px;">
        <div v-for="(item,index) in carouselData_file" :key="index">
            <div class="divborder">
                <a :href="host + item.url" target="_blank" style="max-width: 100%;max-height: 100%;padding-right:10px" >{{item.name}}</a>
                <Button type="primary" icon="ios-cloud-download" @click="downfile(item.url, item.name)">{{$t('900758')}}</Button>
            </div>
        </div>
      </div>
    </Modal>

    <Modal class="newModalClass" :title='title2' v-model="testmodal" :styles="{width:'1200px'}">
      <div class="modal_body" style="width:1150px!important;padding-right:40px;height:600px!important;">
        <div class="divboder">
          <label style="font-size:14px;font-weight:700;">{{this.$t('300018')}}</label>
          <div style="width:1200px;float:left;height:20%;padding-left:5px;">
            <div class="filter">
              <label><i>*</i>{{this.$t('1132')}}：</label>
              <Input class="searchInput" type="text" v-model="editobj.section" :disabled="true"/>
            </div>
            <div class="filter">
              <label >{{$t('920165')}}：</label>
              <Input class="searchInput" type="text" v-model="editobj.material" :disabled="true"/>
            </div>
            <div class="filter">
              <label >{{$t('600011')}}：</label>
              <Input class="searchInput" type="text" v-model="editobj.supplier"  :disabled="true"/>
            </div>
            <div class="filter">
              <label >{{$t('1950522')}}：</label>
              <Input class="searchInput" type="text" v-model="editobj.batchnumber" :disabled="true"/>
            </div>
            <div class="filter">
              <label ><i>*</i>{{$t('1950517')}}：</label>
              <Input class="searchInput" type="text" v-model="editobj.totalquantity" :disabled="true"/>
            </div>
            <div class="filter">
              <label ><i>*</i>{{$t('1950523')}}：</label>
              <Input class="searchInput" type="text" v-model="editobj.randomchecknumber" :disabled="true"/>
            </div>
            <div class="filter">
              <label ><i>*</i>{{$t('1950499')}}：</label>
              <Select v-model="editobj.result" label-in-value clearable class="searchSelect" :disabled="true">
                  <Option :value="1" :key="1">{{$t('1950546')}}</Option>
                  <Option :value="2" :key="2">{{$t('900942')}}</Option>
                  <Option :value="3" :key="3">{{$t('1950547')}}</Option>
                  <Option :value="4" :key="4">{{$t('1950548')}}</Option>
              </Select>
            </div>
            <div class="filter">
              <label >PO：</label>
              <Input class="searchInput" type="text" v-model="editobj.po" :disabled="true"/>
            </div>
            <div class="filter">
              <label >{{$t('1950644')}}：</label>
              <Input class="searchInput" type="text" v-model="editobj.date" :disabled="true"/>
            </div>
            <div class="filter">
              <label >{{$t('1030')}}：</label>
              <Input class="searchInput" type="text" v-model="editobj.remark" :disabled="true"/>
            </div>
          </div>
        </div>
        <div class="divboder">
          <label style="font-size:14px;font-weight:700;">{{$t('1950508')}}</label>
          <div :class='table_scrollx?"checkdatasearch_table":""' style="width:1170px;float:left;padding-left:5px;">
            <template>
              <Table :columns="columns" :data="tableData" v-show="detailshow" ref="detailTable"  :max-height="300">
                <template slot-scope="{ row, index }" slot="xuhao">
                    <span>{{ row.xuhao }}</span>
                </template>
                <template slot-scope="{ row, index }" slot="item">
                    <span>{{ row.item }}</span>
                </template>
                <template slot-scope="{ row, index }" slot="samplequantity">
                    <span>{{ row.samplequantity }}</span>
                </template>
                <template slot-scope="{ row, index }" slot="standard">
                    <span>{{ row.standard }}</span>
                </template>
                <template slot-scope="{ row, index }" slot="min_value">
                    <span>{{ row.min_value }}</span>
                </template>
                <template slot-scope="{ row, index }" slot="max_value">
                    <span>{{ row.max_value }}</span>
                </template>
                <template slot-scope="{ row, index }" slot="range">
                    <span>{{ row.range }}</span>
                </template>

                <template v-for="(item, i) in editobj.randomchecknumber" slot-scope="{ row, index }" :slot="'min_value'+(i+1)">
                  <span v-show="tableData[index].checktype === 2 && tableData[index].valuecategory === 2">
                    <inputNumber class="publicinput" type="text" v-model="tableData[index]['min_value'+(i+1)]" :class="{active_class:((tableData[index]['min_value'+(i+1)])?(tableData[index]['min_value'+(i+1)]<row.min_value || tableData[index]['min_value'+(i+1)]>row.max_value):false)}" style="width:100px" @blur.native.capture="getrange(index, i+1)"/>
                  </span>
                </template>
                <template v-for="(item, i) in editobj.randomchecknumber" slot-scope="{ row, index }" :slot="'max_value'+(i+1)">
                  <span v-show="tableData[index].checktype === 2 && tableData[index].valuecategory === 2">
                    <inputNumber class="publicinput" type="text" v-model="tableData[index]['max_value'+(i+1)]" style="width:100px" :class="{active_class:((tableData[index]['max_value'+(i+1)])?(tableData[index]['max_value'+(i+1)]<row.min_value || tableData[index]['max_value'+(i+1)]>row.max_value):false)}" @blur.native.capture="getrange(index, i+1)"/>
                  </span>
                </template>
                <template v-for="(item, i) in editobj.randomchecknumber" slot-scope="{ row, index }" :slot="'value'+(i+1)">
                  <span v-if="tableData[index].checktype === 1">
                    <RadioGroup v-model="tableData[index]['value'+(i+1)]">
                      <Radio label="OK" style="width:30px">OK</Radio>
                      <Radio label="NG" style="width:30px">NG</Radio>
                    </RadioGroup>
                  </span>
                  <span v-else-if="tableData[index].checktype === 2">
                    <inputNumber :disabled="tableData[index].checktype === 2 && tableData[index].valuecategory === 2" class="publicinput" type="text" :class="{active_class:((tableData[index]['value'+(i+1)])?(tableData[index]['value'+(i+1)]<row.min_value || tableData[index]['value'+(i+1)]>row.max_value):false)}" v-model="tableData[index]['value'+(i+1)]" style="width:100px;"/>
                  </span>
                  <span v-else-if="tableData[index].checktype === 0">
                    <input class="publicinput" type="text" v-model="tableData[index]['value'+(i+1)]" style="width:100px"/>
                  </span>
                </template>
                <template v-for="(item, i) in editobj.randomchecknumber" slot-scope="{ row, index }" :slot="'range'+(i+1)">
                  <span v-show="tableData[index].checktype === 2 && tableData[index].valuecategory === 2">
                    <Input :disabled="true"  type="text" v-model="tableData[index]['range'+(i+1)]" :class="{active_class:((tableData[index]['range'+(i+1)]) ? tableData[index]['range'+(i+1)] > tableData[index]['range'] : false)}" style="width:100px;font-color:black;"/>
                  </span>
                </template>

              </Table>
            </template>
          </div>
        </div>
        <div class="divboder">
          <label style="font-size:14px;font-weight:700;width:100px">{{$t('1950524')}}</label>
          <div style="width:1170px;">
            <div class="core1">
              <label>{{$t('600528')}}：</label>
            </div>
            <div class="core2">
              <div class="demo-upload-list" v-for="item in uploadList" style="margin-left:5px;vertical-align:top">
                <template v-if="item.status === 'finished'">
                    <img :src="host+item.url">
                    <div class="demo-upload-list-cover">
                        <Icon type="ios-eye-outline" @click.native="handleView(item.url)"></Icon>
                        <Icon type="ios-trash-outline" @click.native="handleRemove(item)"></Icon>
                    </div>
                </template>
                <template v-else>
                    <Progress v-if="item.showProgress" :percent="item.percentage" hide-info></Progress>
                </template>
              </div>
              <Upload
                ref="upload"
                :action="host+'qms/Upload/NewUploadImage'"
                :show-upload-list="false"
                :default-file-list="defaultList"
                :on-success="handleSuccess_image"
                :format="['jpg','jpeg','png','gif']"
                :on-format-error="handleFormatError_image"
                :on-exceeded-size="handleMaxSize"
                :before-upload="handleBeforeUpload"
                multiple
                type="drag"
                style="display: inline-block;width:80px;vertical-align:top;margin-left:5px;">
                <div style="width: 80px;height:80px;line-height: 80px;">
                    <Icon type="ios-camera" size="30"></Icon>
                </div>
              </Upload>
            </div>
            <div class="chartdiv1">
              <label>{{$t('600276')}}：</label>
            </div>
            <div class="chartdiv2">
              <template>
                <Upload
                    ref="uploadfile"
                    :action="host+'qms/Upload/NewUploadImage'"
                    :on-success="handleSuccess_file"
                    :on-format-error="handleFormatError_file"
                    :on-exceeded-size="handleMaxSize_file"
                    :before-upload="handleBeforeUpload_file"
                    style="display: inline-block;vertical-align:top;margin-left:5px"
                    multiple
                    type="drag">
                    <div style="padding: 5px 0;width:200px">
                        <Icon type="ios-cloud-upload" size="20" style="color: #3399ff"></Icon>
                        <p>{{$t('1950525')}}</p>
                    </div>
                </Upload>
              </template>
            </div>
          </div>
        </div>
      </div>
      <div slot="footer">
        <Button type="text" size="large" @click="cancle">{{$t('1033')}}</Button>
        <Button type="primary" :loading="loading1" @click="checkdata">
            <span v-if="!loading1">{{$t('1003')}}</span>
            <span v-else>Loading...</span>
        </Button>
        <!--<Button type="primary" size="large" @click="adddata">{{$t('1950509')}}</Button>-->
      </div>
    </Modal>

    <Modal v-model="ngmodal" :styles="{top: '40px',width:'900px'}">
      <div class="modal_body" style="width:900px!important;padding:0 0px;height:400px!important;">
        <div class="divboder">
          <label style="width:100px">{{$t('1950601')}}<i style="color:red;margin-left: 5px!important;margin-top: -5px!important" >*</i>:</label>
          <div style="width:870px;float:left;height:100%;padding-left:5px;overflow-y:scroll">
              <Table :columns="ngcolumns" :data="ngtableData"></Table>
          </div>
        </div>
      </div>
      <div slot="footer">
        <!--<Button type="primary" :loading="loading1" @click="updatedata1">
          <span v-if="!loading2">{{$t('900942')}}</span>
          <span v-else>{{$t('900942')}}</span>
        </Button>-->
        <Button type="primary" :loading="loading2" @click="updatedata2">
          <span v-if="!loading3">{{$t('1950547')}}</span>
          <span v-else>{{$t('1950547')}}</span>
        </Button>
        <Button type="primary" :loading="loading3" @click="updatedata3">
          <span v-if="!loading4">{{$t('1950548')}}</span>
          <span v-else>{{$t('1950548')}}</span>
        </Button>
      </div>
    </Modal>

  </div>
</template>

<script>
import axios from '@/libs/api.request'
import moment from 'moment'
export default{
    data () {
        return {
            headers: {
                token: localStorage.getItem('token'),
                timestamp: localStorage.getItem('timestamp'),
                nonce: localStorage.getItem('nonce'),
                sign: localStorage.getItem('sign')
            },
            table_scrollx: false,
            morecondition: false,
            title1: this.$t('1002'),
            tableData1: [],
            tableData2: [],
            tableData: [],
            editmodal: false,
            page: 1,
            pagesize: 10,
            total: 0,
            loading: false,
            loading1: false,
            loading2: false,
            loading3: false,
            loading4: false,
            carouselValue: 0,
            columns: [
                {
                    type: 'index',
                    title: this.$t('1008'),
                    slot: 'xuhao',
                    width: 70
                },
                {
                    title: this.$t('901048'),
                    slot: 'item'
                },
                {
                    title: this.$t('950245'),
                    slot: 'standard'
                },
                {
                    title: this.$t('200060'),
                    slot: 'min_value'
                },
                {
                    title: this.$t('200059'),
                    slot: 'max_value'
                }
            ],
            columns1: [
                {
                    type: 'index',
                    title: this.$t('1008'),
                    key: 'xuhao',
                    width: 70
                },
                {
                    title: this.$t('800008'),
                    key: 'sn'
                },
                {
                    title: this.$t('901048'),
                    key: 'item'
                },
                {
                    title: this.$t('950245'),
                    key: 'standard'
                },
                {
                    title: this.$t('200060'),
                    key: 'min_value'
                },
                {
                    title: this.$t('200059'),
                    key: 'max_value'
                },
                {
                    title: this.$t('1950621'),
                    key: 'item_range'
                },
                {
                    title: this.$t('800195'),
                    key: 'result'
                },
                {
                    title: this.$t('8000030'), // 实际最小值
                    key: 'lowerlimit'
                },
                {
                    title: this.$t('8000031'), // 实际最大值
                    key: 'upperlimit'
                },
                {
                    title: this.$t('1950610'), // 单值
                    key: 'value'
                },
                {
                    title: this.$t('1950620'), // 极差
                    key: 'range'
                }
            ],
            tableColumns1: [
                {
                    title: this.$t('1008'),
                    key: 'xuhao',
                    slot: 'xuhao',
                    render: (h, params) => {
                        return h(
                            'span',
                            params.index + (this.page - 1) * this.pagesize + 1
                        )
                    },
                    width: 70
                },
                {
                    title: this.$t('100390'),
                    key: 'materialpn',
                    minWidth: 100
                },
                {
                    title: this.$t('100391'),
                    key: 'materialname',
                    minWidth: 150
                },
                {
                    title: this.$t('100392'),
                    key: 'materialspec',
                    minWidth: 150
                },
                {
                    title: this.$t('1950491'),
                    key: 'sectionname',
                    minWidth: 150
                },
                {
                    title: this.$t('600011'),
                    key: 'suppliername',
                    minWidth: 150
                },
                {
                    title: this.$t('1950514'),
                    key: 'batchnumber',
                    minWidth: 150
                },
                {
                    title: this.$t('1950517'),
                    key: 'totalquantity',
                    minWidth: 100
                },
                {
                    title: this.$t('1950518'),
                    key: 'randomchecknumber',
                    minWidth: 100
                },
                {
                    title: this.$t('800195'),
                    key: 'result',
                    minWidth: 100
                },
                {
                    title: this.$t('1045'),
                    key: 'images',
                    align: 'center',
                    minWidth: 120,
                    render: (h, params) => {
                        if (params.row.images.length > 0) {
                            return h('div', [
                                h('A', {
                                    props: {
                                        // type: 'primary',
                                        // size: 'small'
                                    },
                                    style: {
                                        // marginRight: '5px'
                                    },
                                    on: {
                                        click: () => {
                                            this.showImages(params.index, params.row.images)
                                        }
                                    }
                                }, this.$t('1950519'))
                            ])
                        } else {
                            return h('span', {
                            }, this.$t('1950519'))
                        }
                    }
                },
                {
                    title: this.$t('1950521'),
                    key: 'files',
                    align: 'center',
                    minWidth: 120,
                    render: (h, params) => {
                        if (params.row.files.length > 0) {
                            return h('div', [
                                h('A', {
                                    props: {
                                        // type: 'primary',
                                        // size: 'small'
                                    },
                                    style: {
                                        // marginRight: '5px'
                                    },
                                    on: {
                                        click: () => {
                                            this.showFiles(params.index, params.row.files)
                                        }
                                    }
                                }, this.$t('1950520'))
                            ])
                        } else {
                            return h('span', {
                            }, this.$t('1950520'))
                        }
                    }
                },
                {
                    title: this.$t('1950492'),
                    key: 'check_user',
                    minWidth: 100
                },
                {
                    title: this.$t('1950493'),
                    key: 'check_time',
                    minWidth: 150
                },
                {
                    title: 'po',
                    key: 'po',
                    minWidth: 100
                },
                {
                    title: this.$t('1030'),
                    key: 'remark',
                    minWidth: 100
                },
                {
                    title: this.$t('1950644'),
                    key: 'date',
                    minWidth: 100
                }
            ],
            sectionid: [],
            dtStart: '',
            dtEnd: '',
            daterange: '',
            detailshow: false,
            host: axios.publicPath,
            materialid: 0,
            materials: [],
            leveldata: [],
            datalevel: [],
            result: '',
            batchnumber: '',
            suppliers: [],
            supplierid: 0,
            carousel: false,
            carouselData: [],
            carousel_file: false,
            carouselData_file: [],
            title2: this.$t('1003'),
            testmodal: false,
            editobj: {},
            uploadList: [],
            defaultList: [],
            resultData: {},
            ngmodal: false,
            ngtableData: [],
            ngcolumns: [
                {
                    title: this.$t('1008'),
                    key: 'xuhao',
                    render: (h, params) => {
                        return h(
                            'span',
                            params.index + 1
                        )
                    },
                    width: 70
                },
                {
                    title: this.$t('901048'),
                    key: 'item'
                },
                {
                    title: this.$t('950245'),
                    key: 'standard'
                },
                {
                    title: this.$t('200060'),
                    key: 'min_value'
                },
                {
                    title: this.$t('200059'),
                    key: 'max_value'
                },
                {
                    title: this.$t('1950619'),
                    key: 'range'
                },
                {
                    title: this.$t('800195'),
                    key: 'result'
                },
                {
                    title: this.$t('8000030'),
                    key: 'lowerlimit'
                },
                {
                    title: this.$t('8000031'),
                    key: 'upperlimit'
                },
                {
                    title: this.$t('1950620'),
                    key: 'actual_range'
                },
                {
                    title: this.$t('1950610'),
                    key: 'value'
                }
            ]
        }
    },
    created () {
        var nowtime = Date.parse(new Date()) / 1000
        var oldtime = nowtime - 86400 * 7
        this.daterange = [this.datetrans(oldtime) + '00:00:00', this.datetrans(nowtime) + '23:59:59']
        this.selectdate(this.daterange)
        this.search(1, 10)
        this.initlevel()
        this.initsuppliers()
        this.supplierChange()
        // 格式化表格样式
        this.tableColumns1 = this.$time.initTableTitle(this.tableColumns1)
    },
    methods: {
        supplierChange (sectionid) {
            axios.request({
                url: '/qms/IncomingMaterial/GetCheckMaterials?supplierid=' + this.supplierid + '&sectionid=' + sectionid,
                method: 'get'
            }).then(res => {
                this.materials = res.data.data
            })
        },
        getrange (index, i) {
            var maxValue = this.tableData[index]['max_value' + i]
            var minValue = this.tableData[index]['min_value' + i]
            if (maxValue !== '' && maxValue !== null && maxValue !== undefined && minValue !== '' && minValue !== null && minValue !== undefined) {
                this.tableData[index]['range' + i] = Math.round((this.tableData[index]['max_value' + i] - this.tableData[index]['min_value' + i]) * 10000) / 10000
                this.tableData[index]['value' + i] = Math.round((this.tableData[index]['max_value' + i] + this.tableData[index]['min_value' + i]) / 2 * 10000) / 10000
            } else {
                this.tableData[index]['range' + i] = ''
            }
        },
        dele () {
            if (this.obj === undefined || this.obj.id === undefined || this.obj.id === null || this.obj.id === 0) {
                this.$Message.error((this.$t('1017')))
                return false
            } else {
                this.$Modal.confirm({
                    title: this.$t('1018'),
                    content: '',
                    width: '290px',
                    closable: true,
                    okText: this.$t('1004'),
                    onOk: () => {
                        axios.request({
                            url: '/qms/IncomingMaterial/Delete?id=' + this.obj.id,
                            method: 'get'
                        }).then(res => {
                            if (res.data.ret === 1) {
                                this.page = 1
                                this.search(this.page, this.pagesize)
                                this.$Message.success(this.$t('1058'))
                            } else {
                                this.$Message.error(this.$t(res.data.msg))
                            }
                        })
                    }
                })
            }
        },
        edit () {
            if (this.obj === undefined || this.obj.id === undefined || this.obj.id === null || this.obj.id === 0) {
                this.$Message.error((this.$t('1017')))
                return false
            }

            this.editobj = {}
            axios.request({
                url: '/qms/IncomingMaterial/GetUpdateDetails?id=' + this.obj.id,
                method: 'get'
            }).then(res => {
                if (res.data.ret === 1) {
                    var data = res.data.data
                    this.testmodal = true
                    this.editobj.section = this.obj.sectionname
                    this.editobj.material = this.obj.materialname + '【' + this.obj.materialpn + '】' + '【' + this.obj.materialspec + '】'
                    this.editobj.supplier = this.obj.suppliername
                    this.editobj.batchnumber = this.obj.batchnumber
                    this.editobj.totalquantity = this.obj.totalquantity
                    this.editobj.randomchecknumber = this.obj.randomchecknumber
                    this.editobj.po = this.obj.po
                    this.editobj.date = this.obj.date
                    this.editobj.remark = this.obj.remark
                    this.editobj.result = data.result
                    this.GetValueColums(data.details)
                    this.$refs.upload.fileList = data.images
                    this.uploadList = data.images
                    this.$refs.uploadfile.fileList = data.files
                } else {
                    this.$Message.error(this.$t(res.data.msg))
                }
            })
        },
        GetValueColums (details) {
            this.columns = [
                {
                    type: 'index',
                    title: this.$t('1008'),
                    slot: 'xuhao',
                    width: 70,
                    fixed: 'left'
                },
                {
                    title: this.$t('901048'),
                    slot: 'item',
                    minWidth: 120,
                    fixed: 'left'
                },
                {
                    title: this.$t('1950523'),
                    slot: 'samplequantity',
                    minWidth: 80,
                    fixed: 'left'
                },
                {
                    title: this.$t('950245'),
                    slot: 'standard',
                    minWidth: 120,
                    fixed: 'left'
                },
                {
                    title: this.$t('200060'),
                    slot: 'min_value',
                    minWidth: 80,
                    fixed: 'left'
                },
                {
                    title: this.$t('200059'),
                    slot: 'max_value',
                    minWidth: 80,
                    fixed: 'left'
                },
                {
                    title: this.$t('8000032'),
                    slot: 'range',
                    minWidth: 70,
                    fixed: 'left'
                }
            ]
            this.tableData = []
            axios.request({
                url: '/qms/InspectStandardMaterial/GetDetails?materialid=' + this.obj.materialid + '&sectionid=' + this.obj.sectionid + '&number=' + this.editobj.totalquantity,
                method: 'get'
            }).then(res => {
                var tablelist = res.data.data.details

                var isMaxMin = false
                tablelist.forEach(element => {
                    if (element.checktype === 2 && element.valuecategory === 2) {
                        isMaxMin = true
                    }
                });

                var cloumnLength = res.data.data.quantity
                this.editobj.randomchecknumber = cloumnLength
                var snColumn = {
                    itemid: 0,
                    item: this.$t('800008'),
                    standard: '',
                    min_value: '',
                    max_value: '',
                    checktype: 0,
                    result: '',
                    value: null
                }
                for (var i = 1; i <= cloumnLength; i++) {
                    this.columns.push({
                        title: 'NO.' + i,
                        key: 'NO.' + i,
                        slot: 'NO.' + i,
                        align: 'center',
                        children: isMaxMin ? [
                            {
                                title: this.$t('500082'), // 最小值
                                key: 'min_value' + i,
                                slot: 'min_value' + i,
                                align: 'center',
                                minWidth: 120
                            },
                            {
                                title: this.$t('500081'), // 最大值
                                key: 'max_value' + i,
                                slot: 'max_value' + i,
                                align: 'center',
                                minWidth: 120
                            },
                            {
                                title: this.$t('1950610'), // 单值
                                key: 'value' + i,
                                slot: 'value' + i,
                                align: 'center',
                                minWidth: 120
                            },
                            {
                                title: this.$t('8000032'), // 极差
                                key: 'range' + i,
                                slot: 'range' + i,
                                align: 'center',
                                minWidth: 120
                            }
                        ] : [
                            {
                                title: this.$t('1950610'), // 单值
                                key: 'value' + i,
                                slot: 'value' + i,
                                align: 'center',
                                minWidth: 120
                            }
                        ]
                    })
                    snColumn['value' + i] = ''
                    details.forEach(detail => {
                        if (detail.index === i) {
                            snColumn['value' + i] = detail.sn
                        }
                    })
                }

                this.tableData.push(snColumn)
                tablelist.forEach((item, index) => {
                    let data = {
                        itemid: item.itemid,
                        item: item.item,
                        standard: item.standard,
                        min_value: item.checktype === 2 ? (item.min_value === -999999999 ? '' : item.min_value) : '',
                        max_value: item.checktype === 2 ? (item.max_value === 999999999 ? '' : item.max_value) : '',
                        checktype: item.checktype,
                        result: item.result,
                        value: item.value,
                        range: (item.checktype === 2 && item.valuecategory === 2) ? item.range : '',
                        upperlimit: item.upperlimit,
                        lowerlimit: item.lowerlimit,
                        valuecategory: item.valuecategory,
                        samplequantity: item.samplequantity
                    }
                    if (item.checktype === 2) {
                        for (var i = 1; i <= cloumnLength; i++) {
                            data['value' + i] = null
                            data['max_value' + i] = null
                            data['min_value' + i] = null
                            data['range' + i] = null
                            details.forEach(detail => {
                                if (detail.index === i && detail.itemid === item.itemid) {
                                    data['value' + i] = detail.value
                                    data['max_value' + i] = detail.upperlimit
                                    data['min_value' + i] = detail.lowerlimit
                                    data['range' + i] = detail.range
                                }
                            })
                        }
                    } else if (item.checktype === 1) {
                        for (var i = 1; i <= cloumnLength; i++) {
                            data['value' + i] = 'OK'
                            details.forEach(detail => {
                                if (detail.index === i && detail.itemid === item.itemid) {
                                    data['value' + i] = detail.result
                                }
                            })
                        }
                    }
                    this.tableData.push(data)
                })
                this.detailshow = false
                this.detailshow = true
                // 处理滚动条样式bug
                setTimeout(() => {
                    var scrollx = this.$refs.detailTable.$refs.body.classList.contains('ivu-table-overflowX'); // 100px
                    if (scrollx) {
                        this.table_scrollx = true
                    } else {
                        this.table_scrollx = false
                    }
                }, 500)
            })
        },
        checkdata () {
            let data = {}
            data.result = this.editobj.result
            data.id = this.obj.id
            data.details = []
            data.images = []
            data.files = []
            var details = this.$refs.detailTable.data
            var total = this.editobj.randomchecknumber

            var isMaxMin = false
            var ngList = []
            for (var i = 1; i <= total; i++) {
                details.forEach((ele, index) => {
                    if (index > 0) {
                        var sn = details[0]['value' + i]
                        var detail = {
                            index: i,
                            sn: (sn === null || sn === undefined) ? '' : sn,
                            itemid: ele.itemid,
                            checktype: ele.checktype
                        }
                        if (ele.checktype === 2) {
                            detail.value = ele['value' + i]
                            detail.lowerlimit = ele['min_value' + i]
                            detail.upperlimit = ele['max_value' + i]
                            detail.result = ''
                            if (ele.valuecategory === 1) {
                                if ((detail.value > ele.max_value && ele.max_value !== '') || (detail.value < ele.min_value && ele.min_value !== '')) {
                                    if (detail.value !== null && detail.value !== undefined && detail.value !== '') {
                                        ngList.push({
                                            item: ele.item,
                                            standard: ele.standard,
                                            checktype: ele.checktype,
                                            min_value: ele.min_value,
                                            max_value: ele.max_value,
                                            result: 'NG',
                                            value: detail.value,
                                            upperlimit: '',
                                            lowerlimit: '',
                                            range: '',
                                            actual_range: ''
                                        })
                                    }
                                }
                            } else if (ele.valuecategory === 2) {
                                isMaxMin = true
                                if ((detail.upperlimit > ele.max_value || detail.lowerlimit < ele.min_value || (detail.upperlimit - detail.lowerlimit) > ele.range ||
                  detail.upperlimit < ele.min_value || detail.lowerlimit > ele.max_value ||
                  (detail.value > ele.max_value && ele.max_value !== '') || (detail.value < ele.min_value && ele.min_value !== '')) &&
                  detail.upperlimit !== null && detail.upperlimit !== undefined && detail.upperlimit !== '' &&
                  detail.lowerlimit !== null && detail.lowerlimit !== undefined && detail.lowerlimit !== '') {
                                    ngList.push({
                                        item: ele.item,
                                        standard: ele.standard,
                                        checktype: ele.checktype,
                                        min_value: ele.min_value,
                                        max_value: ele.max_value,
                                        result: 'NG',
                                        value: detail.value,
                                        upperlimit: detail.upperlimit,
                                        lowerlimit: detail.lowerlimit,
                                        range: Number(detail.upperlimit - detail.lowerlimit).toFixed(4),
                                        range: ele.range,
                                        actual_range: ele['range' + i]
                                    })
                                }
                            }
                        } else if (ele.checktype === 1) {
                            detail.value = null
                            detail.result = ele['value' + i]
                            if (detail.result !== null && detail.result !== undefined && detail.result !== '') {
                                if (detail.result.toUpperCase() === 'NG') {
                                    ngList.push({
                                        item: ele.item,
                                        standard: ele.standard,
                                        checktype: ele.checktype,
                                        min_value: ele.min_value,
                                        max_value: ele.max_value,
                                        result: 'NG',
                                        value: detail.value,
                                        upperlimit: '',
                                        lowerlimit: '',
                                        range: '',
                                        actual_range: ''
                                    })
                                }
                            }
                        }
                        data.details.push(detail)
                    } else {
                        var sn = details[0]['value' + i]
                        var detail = {
                            index: i,
                            sn: (sn === null || sn === undefined) ? '' : sn,
                            itemid: 0,
                            checktype: ele.checktype
                        }
                        data.details.push(detail)
                    }
                })
            }
            this.$refs.upload.fileList.forEach(ele => {
                var image = {
                    size: ele.size,
                    name: ele.name,
                    url: ele.url
                }
                data.images.push(image)
            })
            this.$refs.uploadfile.fileList.forEach(ele => {
                var file = {
                    size: ele.size,
                    name: ele.name,
                    url: ele.url
                }
                data.files.push(file)
            })

            this.resultData = data
            if (ngList.length > 0) {
                if (isMaxMin) {
                    this.ngcolumns = [
                        {
                            title: this.$t('1008'),
                            key: 'xuhao',
                            render: (h, params) => {
                                return h(
                                    'span',
                                    params.index + 1
                                )
                            },
                            width: 70
                        },
                        {
                            title: this.$t('901048'),
                            key: 'item'
                        },
                        {
                            title: this.$t('950245'),
                            key: 'standard'
                        },
                        {
                            title: this.$t('200060'),
                            key: 'min_value'
                        },
                        {
                            title: this.$t('200059'),
                            key: 'max_value'
                        },
                        {
                            title: this.$t('1950619'),
                            key: 'range'
                        },
                        {
                            title: this.$t('800195'),
                            key: 'result'
                        },
                        {
                            title: this.$t('8000030'),
                            key: 'lowerlimit'
                        },
                        {
                            title: this.$t('8000031'),
                            key: 'upperlimit'
                        },
                        {
                            title: this.$t('1950620'),
                            key: 'actual_range'
                        },
                        {
                            title: this.$t('1950610'),
                            key: 'value'
                        }
                    ]
                } else {
                    this.ngcolumns = [
                        {
                            title: this.$t('1008'),
                            key: 'xuhao',
                            render: (h, params) => {
                                return h(
                                    'span',
                                    params.index + 1
                                )
                            },
                            width: 70
                        },
                        {
                            title: this.$t('901048'),
                            key: 'item'
                        },
                        {
                            title: this.$t('950245'),
                            key: 'standard'
                        },
                        {
                            title: this.$t('200060'),
                            key: 'min_value'
                        },
                        {
                            title: this.$t('200059'),
                            key: 'max_value'
                        },
                        {
                            title: this.$t('1950610'),
                            key: 'value'
                        },
                        {
                            title: this.$t('800195'),
                            key: 'result'
                        }
                    ]
                }
                this.showNg(ngList)
                return
            }
            this.updatedata()
        },
        showNg (ngList) {
            this.ngmodal = true
            this.ngtableData = []
            ngList.forEach(item => {
                this.ngtableData.push({
                    item: item.item,
                    standard: item.standard,
                    min_value: item.checktype === 2 ? (item.min_value === -999999999 ? '' : item.min_value) : '',
                    max_value: item.checktype === 2 ? (item.max_value === 999999999 ? '' : item.max_value) : '',
                    result: 'NG',
                    value: item.value,
                    upperlimit: item.upperlimit,
                    lowerlimit: item.lowerlimit,
                    range: item.range,
                    actual_range: item.actual_range
                })
            })
        },
        updatedata () {
            var data = this.resultData
            this.loading1 = true
            this.loading2 = true
            this.loading3 = true
            this.loading4 = true
            axios.request({
                url: '/qms/IncomingMaterial/Update',
                data,
                method: 'post'
            }).then(res => {
                if (res.data.ret === 1) {
                    this.$Message.success(this.$t('800223'))
                    this.editobj = {}
                    this.obj = {}
                    this.tableData = []
                    this.$refs.upload.fileList = []
                    this.$refs.uploadfile.fileList = []
                    this.uploadList = []
                    this.columns = [
                        {
                            type: 'index',
                            title: this.$t('1008'),
                            slot: 'xuhao',
                            width: 70
                        },
                        {
                            title: this.$t('901048'),
                            slot: 'item'
                        },
                        {
                            title: this.$t('950245'),
                            slot: 'standard'
                        },
                        {
                            title: this.$t('200060'),
                            slot: 'min_value'
                        },
                        {
                            title: this.$t('200059'),
                            slot: 'max_value'
                        }
                    ]
                    this.testmodal = false
                    this.ngmodal = false
                    this.search(this.page, this.pagesize)
                } else {
                    this.$Message.error(this.$t(res.data.msg))
                }
                this.resultData = {}
                this.loading1 = false
                this.loading2 = false
                this.loading3 = false
                this.loading4 = false
            }).catch(() => {
                this.resultData = {}
                this.loading1 = false
                this.loading2 = false
                this.loading3 = false
                this.loading4 = false
            })
        },
        updatedata1 () {
            this.resultData.result = '2'
            this.updatedata()
        },
        updatedata2 () {
            this.resultData.result = '3'
            this.updatedata()
        },
        updatedata3 () {
            this.resultData.result = '4'
            this.updatedata()
        },
        cancle () {
            this.testmodal = false
            this.columns = [
                {
                    type: 'index',
                    title: this.$t('1008'),
                    slot: 'xuhao'
                },
                {
                    title: this.$t('901048'),
                    slot: 'item'
                },
                {
                    title: this.$t('950245'),
                    slot: 'standard'
                },
                {
                    title: this.$t('200060'),
                    slot: 'min_value'
                },
                {
                    title: this.$t('200059'),
                    slot: 'max_value'
                }
            ]
            this.tableData = []
            this.uploadList = []
            this.defaultList = []
            this.editobj = {}
            this.obj = {}
            this.search(this.page, this.pagesize)
        },
        handlelevelchange (value) {
            this.leveldata = value
            var sectionid = value[value.length - 1]
            this.supplierChange(sectionid)
        },
        showImages (index, imageurls) {
            this.carouselData = imageurls
            this.carousel = true
        },
        showFiles (index, files) {
            this.carouselData_file = files
            this.carousel_file = true
        },
        initlevel () {
            axios.request({
                url: '/qms/InspectStandardMaterial/GetSectionTree',
                method: 'get'
            }).then(res => {
                const arr = []
                this.datalevel = res.data.data
                arr.push(res.data.data[0].value)
                this.leveldata = arr
            })
        },
        initsuppliers () {
            axios.request({
                url: '/qms/IncomingMaterial/GetCheckSuppliers?materialid=' + this.materialid,
                method: 'get'
            }).then(res => {
                this.suppliers = res.data.data
            })
        },
        datetrans (date) {
            if (date === '' || date === undefined || date === 0 || date === null) {
                return ''
            }
            date = new Date(date * 1000)
            var Y = date.getFullYear() + '-'
            var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-'
            var D = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate()) + ' '
            return Y + M + D
        },
        searchdetail () {
            this.tableData2 = []
            if (this.obj.id === undefined || this.obj.id === null || this.obj.id === 0) {
                return false
            } else {
                axios
                    .request({
                        url: '/qms/IncomingMaterial/GetDetails?id=' + this.obj.id,
                        method: 'get'
                    })
                    .then(res => {
                        this.mockTableData2(res.data.data)
                    })
            }
        },
        mockTableData2 (tablelist) {
            let data = []
            tablelist.forEach(item => {
                if (item) {
                    data.push({
                        sn: item.sn,
                        index: item.index,
                        itemid: item.itemid,
                        item: item.itmename,
                        standard: item.standard,
                        min_value: item.checktype === 2 ? (item.min_value === -999999999 ? '' : item.min_value) : '',
                        max_value: item.checktype === 2 ? (item.max_value === 999999999 ? '' : item.max_value) : '',
                        checktype: item.checktype,
                        result: item.result,
                        value: item.value,
                        lowerlimit: (item.checktype === 2 && item.valuecategory === 2) ? item.lowerlimit : '',
                        upperlimit: (item.checktype === 2 && item.valuecategory === 2) ? item.upperlimit : '',
                        range: (item.checktype === 2 && item.valuecategory === 2) ? item.range : '',
                        item_range: (item.checktype === 2 && item.valuecategory === 2) ? item.item_range : ''
                    })
                }
            })
            this.tableData2 = data
        },
        selectdate (e) {
            this.dtStart = e[0]
            this.dtEnd = e[1]

            let last_str = this.dtEnd.split(' ')[1]
            if (last_str === '00:00:00') {
                this.dtEnd = moment(this.dtEnd).format('YYYY-MM-DD') + ' 23:59:59'
                this.daterange = [this.dtStart, this.dtEnd]
            }
        },
        search (page, pagesize) {
            var params = {
                page: page,
                pagesize: pagesize,
                sectionid: this.sectionid[this.sectionid.length - 1],
                materialid: this.materialid,
                supplierid: this.supplierid,
                starttime: this.dtStart,
                endtime: this.dtEnd,
                batchnumber: this.batchnumber,
                result: this.result
            }
            console.log(params)
            axios.request({
                url: '/qms/IncomingMaterial/GetPageList',
                params,
                method: 'get'
            })
                .then(res => {
                    this.page = page
                    this.pagesize = pagesize
                    this.total = res.data.total
                    this.mockTableData1(res.data.data)
                })
            this.tableData2 = []
            this.detailshow = false
        },
        mockTableData1 (tablelist) {
            let data = []
            tablelist.forEach(item => {
                if (item) {
                    data.push({
                        id: item.id,
                        materialid: item.materialid,
                        materialpn: item.materialpn,
                        materialname: item.materialname,
                        materialspec: item.materialspec,
                        sectionid: item.sectionid,
                        sectionname: item.sectionname,
                        supplierid: item.supplierid,
                        suppliername: item.suppliername,
                        batchnumber: item.batchnumber,
                        result: item.result === '1' ? this.$t('1950546') : (item.result === '2' ? this.$t('900942') : (item.result === '3' ? this.$t('1950547') : (item.result === '4' ? this.$t('1950548') : ''))),
                        totalquantity: item.totalquantity,
                        randomchecknumber: item.randomchecknumber,
                        check_mid: item.check_mid,
                        check_user: item.check_user,
                        check_time: item.check_time,
                        images: item.images,
                        files: item.files,
                        po: item.po,
                        remark: item.remark,
                        date: item.date
                    })
                }
            })
            this.tableData1 = data
        },
        downexcel () {
            var params = {
                sectionid: this.sectionid[this.sectionid.length - 1],
                materialid: this.materialid,
                supplierid: this.supplierid,
                starttime: this.dtStart,
                endtime: this.dtEnd,
                batchnumber: this.batchnumber,
                result: this.result,
                toexcel: '1'
            }
            axios.request({
                url: '/qms/IncomingMaterial/GetPageList',
                params,
                method: 'get'
            }).then(res => {
                if (res.data.ret === 1) {
                    window.location.href = axios.publicPath + '' + res.data.data
                } else {
                    this.$Message.error(this.$t(res.data.msg));
                }
            })
        },
        getExtension (file) {
            var filename = file
            var index1 = filename.lastIndexOf('.')
            var index2 = filename.length
            var type = filename.substring(index1, index2)
            return type
        },
        funDownload (filename, content, extension) {
            // 创建隐藏的可下载链接
            var eleLink = document.createElement('a')
            eleLink.target = '_blank'
            eleLink.download = filename
            eleLink.style.display = 'none'
            // 字符内容转变成blob地址
            if (extension.toUpperCase() === '.TXT') {
                var blob = new Blob([content])
                eleLink.href = URL.createObjectURL(blob)
            } else {
                eleLink.href = content
            }
            // 触发点击
            document.body.appendChild(eleLink)
            eleLink.click()
            // 然后移除
            document.body.removeChild(eleLink)
        },
        downfile (fileurl, name) {
            var extension = this.getExtension(name)
            if (extension.toUpperCase() === '.TXT') {
                axios.request({
                    url: '/qms/IncomingMaterial/GetCheckFile?url=' + fileurl,
                    method: 'get'
                }).then(res => {
                    if (res.data.ret === 1) {
                        var info = res.data.data
                        var content = info.content.replace(/\n/g, '\r\n')
                        this.funDownload(name, content, extension)
                    }
                })
            } else {
                this.funDownload(name, this.host + fileurl, extension)
            }
        },
        changecondition () {
            this.morecondition = !this.morecondition
        },
        handlePageSize (value) {
            this.pagesize = value
            this.tableData1 = this.search(this.page, this.pagesize)
        },
        changePage (value) {
            this.page = value
            this.tableData1 = this.search(this.page, this.pagesize)
        },
        handleRowChange (currentRow, oldCurrentRow) {
            this.obj = currentRow
            this.detailshow = true
            this.searchdetail()
        },
        handleView (name) {
            this.imgName = this.host + name
            this.visible = true
        },
        handleRemove (file) {
            const fileList = this.$refs.upload.fileList
            const flist = this.uploadList
            this.$refs.upload.fileList.splice(fileList.indexOf(file), 1)
            this.uploadList.splice(flist.indexOf(file), 1)
        },
        handleSuccess_image (res, file) {
            file.url = res.url
            file.name = res.name
            // var uploadfile = file
            // uploadfile.url = res.url
            // this.uploadList.push(uploadfile)
        },
        handleFormatError_image (file) {
            this.$Message.error(file.name + ' ' + this.$t('950395'))
        },
        handleMaxSize (file) {
            this.$Message.error('File  ' + file.name + ' is too large, no more than 2M.')
        },
        handleBeforeUpload () {
            return true
        },
        handleSuccess_file (res, file) {
            file.url = res.url
            file.name = res.name
        },
        handleFormatError_file (file) {
            this.$Message.error(file.name + ' ' + this.$t('950395'))
        },
        handleMaxSize_file (file) {
            this.$Message.error('File  ' + file.name + ' is too large, no more than 2M.')
        },
        handleBeforeUpload_file () {
            return true
        }
    }
}

</script>
<style lang="less" scoped>
.demo-upload-list{
    display: inline-block;
    width: 80px;
    height: 80px;
    text-align: center;
    line-height: 80px;
    border: 1px solid transparent;
    border-radius: 4px;
    overflow: hidden;
    background: #fff;
    position: relative;
    box-shadow: 0 1px 1px rgba(0,0,0,.2);
    margin-right: 4px;
}
.demo-upload-list img{
    width: 100%;
    height: 100%;
}
.demo-upload-list-cover{
    display: none;
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,.6);
}
.demo-upload-list:hover .demo-upload-list-cover{
    display: block;
}
.demo-upload-list-cover i{
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    margin: 0 2px;
}

.core1{
    width: 15%;
    height: 100%;
    border:0px solid #979797;
    border-radius: 5px;
    padding: 0px;
    margin: 0px;
    overflow-y: auto;
    overflow-x: hidden;
    float:left;
    background: #ffffff;
}
.core2{
    width: 35%;
    height: 100%;
    border:0px solid #979797;
    border-radius: 5px;
    padding: 0px;
    overflow-y: auto;
    overflow-x: hidden;
    float:left;
    background: #ffffff;
}
.chartdiv1{
    width: 15%;
    height: 100%;
    border:0px solid #979797;
    border-radius: 5px;
    padding: 0px;
    overflow-y: auto;
    overflow-x: hidden;
    float:left;
    background: #ffffff;
}
.chartdiv2{
    width: 35%;
    height: 100%;
    border:0px solid #979797;
    border-radius: 5px;
    padding: 0px;
    overflow-y: auto;
    overflow-x: hidden;
    float:right;
    // background: #ffffff;
}
.active_class{
  border:red 1px solid;
}
</style>

<style lang="less">
    .checkdatasearch_table{
        .ivu-table-fixed-body{
          height:auto!important;
          max-height:211px!important;
      }
    }
</style>
