<template>
  <div>
    <el-card>
      <div class="main">
        <div class="process" @click.stop="chaxun">
          <div id="son" :class="[isActive ? color[22] : 'weikaishi']" class="module" style="position: relative;left: 1543px;top:188px; width: 80px;height: 48px;">
            <el-tooltip :open-delay="600" placement="top">
              <div slot="content">单击查看发货详情</div>
              <el-button :disabled="disabled" :class="[isActive ? color[22] : 'weikaishi']" type="text" @click.stop="searchDiv23">发货</el-button>
            </el-tooltip>
          </div>
          <div id="son1" :class="[isActive ? color[21] : 'weikaishi']" class="module" style="position: relative;left: 1355px;top:185px; width: 80px;height: 48px;">
            <el-tooltip :open-delay="600" placement="top">
              <div slot="content">总装开始时间：{{ `${data2[0].总装调试}` }}<br>总装结束时间：{{ `${data2[0].机床装配实际完成时间}` }}</div>
              <el-button v-if="data2[0].总装调试状态===2" :disabled="disabled" :class="[isActive ? color[21] : 'weikaishi']" type="text" @click.stop="searchDiv22">总装调试<br>{{ `${data2[0].机床装配实际完成时间}` }}</el-button>
              <el-button v-else :disabled="disabled" :class="[isActive ? color[21] : 'weikaishi']" type="text" @click.stop="searchDiv22">总装调试<br>{{ `${data2[0].总装调试}` }}</el-button>
            </el-tooltip>
          </div>
          <div id="son2" :class="[isActive ? color[20] : 'weikaishi']" class="module" style="position: relative;left: 1168px;top:185px; width: 80px;height: 48px;">
            <el-tooltip :open-delay="600" placement="top">
              <div slot="content">装配质检合格率：{{ `${data2[0].装配质检 === 11111111 ? '-' : data2[0].装配质检}%` }}</div>
              <el-button :disabled="disabled" :class="[isActive ? color[20] : 'weikaishi']" type="text" @click.stop="searchDiv21">装配质检<br>{{ `${data2[0].装配质检 === 11111111 ? '-' : data2[0].装配质检}%` }}</el-button>
            </el-tooltip>
          </div>
          <div id="son3" :class="[isActive ? color[19] : 'weikaishi']" class="module" style="position: relative;left: 963px;top:135px; width: 80px;height: 48px;">
            <el-tooltip :open-delay="600" placement="top">
              <div slot="content">电气装配计划完成率：{{ `${data2[0].电气装配}%` }}</div>
              <el-button :disabled="disabled" :class="[isActive ? color[19] : 'weikaishi']" type="text" @click.stop="searchDiv6">电气装配<br>{{ `${data2[0].电气装配}%` }}</el-button>
            </el-tooltip>
          </div>
          <div id="son4" :class="[isActive ? color[18] : 'weikaishi']" class="module" style="position: relative;left: 878px;top:215px; width: 80px;height: 48px;">
            <el-tooltip :open-delay="600" placement="top">
              <div slot="content">机械装配计划完成率：{{ `${data2[0].机械装配}%` }}</div>
              <el-button :disabled="disabled" :class="[isActive ? color[18] : 'weikaishi']" type="text" @click.stop="searchDiv5">机械装配<br>{{ `${data2[0].机械装配}%` }}</el-button>
            </el-tooltip>
          </div>
          <!--<div id="son5" :class="[isActive ? color[17] : 'weikaishi']" class="module" style="position: relative;left: 795px;top:220px; width: 80px;height: 48px;">-->
          <!--<el-tooltip :open-delay="600" placement="top">-->
          <!--<div slot="content">冷作计划完成率：{{ `${data2[0].冷作}%` }}</div>-->
          <!--<el-button :disabled="disabled" :class="[isActive ? color[17] : 'weikaishi']" type="text" @click.stop="searchDiv7">冷作<br>{{ `${data2[0].冷作}%` }}</el-button>-->
          <!--</el-tooltip>-->
          <!--</div>-->
          <!--<div id="son6" :class="[isActive ? color[16] : 'weikaishi']" class="module" style="position: relative;left: 710px;top:300px; width: 80px;height: 48px;">-->
          <!--<el-tooltip :open-delay="600" placement="top">-->
          <!--<div slot="content">油漆计划完成率：{{ `${data2[0].油漆}%` }}</div>-->
          <!--<el-button :disabled="disabled" :class="[isActive ? color[16] : 'weikaishi']" type="text" @click.stop="searchDiv8">油漆<br>{{ `${data2[0].油漆}%` }}</el-button>-->
          <!--</el-tooltip>-->
          <!--</div>-->
          <div id="son7" :class="[isActive ? color[15] : 'weikaishi']" class="module" style="position: relative;left: 670px;top:185px; width: 80px;height: 48px;">
            <el-tooltip :open-delay="600" placement="top">
              <div slot="content">成组配套率：{{ `${data2[0].成组配套}%` }}</div>
              <el-button :disabled="disabled" :class="[isActive ? color[15] : 'weikaishi']" type="text" @click.stop="searchDiv9">成组配套<br>{{ `${data2[0].成组配套}%` }}</el-button>
            </el-tooltip>
          </div>
          <div id="son8" :class="[isActive ? color[14] : 'weikaishi']" class="module" style="position: relative;left: 448px;top:92px; width: 80px;height: 48px;">
            <el-tooltip :open-delay="600" placement="top">
              <div slot="content">自制质检合格率：{{ `${data2[0].自制质检 === 11111111 ? '-' : data2[0].自制质检}%` }}</div>
              <el-button :disabled="disabled" :class="[isActive ? color[14] : 'weikaishi']" type="text" @click.stop="searchDiv12">自制质检<br>{{ `${data2[0].自制质检 === 11111111 ? '-' : data2[0].自制质检}%` }}</el-button>
            </el-tooltip>
          </div>
          <div id="son9" :class="[isActive ? color[13] : 'weikaishi']" class="module" style="position: relative;left: 367px;top:279px; width: 80px;height: 48px;">
            <el-tooltip :open-delay="600" placement="top">
              <div slot="content">采购质检合格率：{{ `${data2[0].采购质检 === 11111111 ? '-' : data2[0].采购质检}%` }}</div>
              <el-button :disabled="disabled" :class="[isActive ? color[13] : 'weikaishi']" type="text" @click.stop="searchDiv19">采购质检<br>{{ `${data2[0].采购质检 === 11111111 ? '-' : data2[0].采购质检}%` }}</el-button>
            </el-tooltip>
          </div>
          <div id="son10" :class="[isActive ? color[12] : 'weikaishi']" class="module" style="position: relative;left: 157px;top:153px; width: 80px;height: 48px;">
            <el-tooltip :open-delay="600" placement="top">
              <div slot="content">车间加工计划完成率：{{ `${data2[0].车间加工}%` }}</div>
              <el-button :disabled="disabled" :class="[isActive ? color[12] : 'weikaishi']" type="text" @click.stop="searchDiv10">车间加工<br>{{ `${data2[0].车间加工}%` }}</el-button>
            </el-tooltip>
          </div>
          <div id="son11" :class="[isActive ? color[11] : 'weikaishi']" class="module" style="position: relative;left: -6px;top:33px; width: 80px;height: 48px;">
            <el-tooltip :open-delay="600" placement="top">
              <div slot="content">外协计划完成率：{{ `${data2[0].外协}%` }}</div>
              <el-button :disabled="disabled" :class="[isActive ? color[11] : 'weikaishi']" type="text" @click.stop="searchDiv18">工序外协<br>{{ `${data2[0].外协}%` }}</el-button>
            </el-tooltip>
          </div>
          <div id="son12" :class="[isActive ? color[10] : 'weikaishi']" class="module" style="position: relative;left: -208px;top:92px; width: 80px;height: 48px;">
            <el-tooltip :open-delay="600" placement="top">
              <div slot="content">能力平衡计划完成率：{{ `${data2[0].能力平衡}%` }}</div>
              <el-button :disabled="disabled" :class="[isActive ? color[10] : 'weikaishi']" type="text" @click.stop="searchDiv15">能力平衡<br>{{ `${data2[0].能力平衡}%` }}</el-button>
            </el-tooltip>
          </div>
          <div id="son14" :class="[isActive ? color[8] : 'weikaishi']" class="module" style="position: relative;left: -390px;top:92px; width: 80px;height: 48px;">
            <el-tooltip :open-delay="600" placement="top">
              <div slot="content">工艺定额计划完成率：{{ `${data2[0].工艺定额}%` }}</div>
              <el-button :disabled="disabled" :class="[isActive ? color[8] : 'weikaishi']" type="text" @click.stop="searchDiv13">工艺定额<br>{{ `${data2[0].工艺定额}%` }}</el-button>
            </el-tooltip>
          </div>
          <div id="son15" :class="[isActive ? color[7] : 'weikaishi']" class="module" style="position: relative;left: -598px;top:33px; width: 80px;height: 48px;">
            <el-tooltip :open-delay="600" placement="top">
              <div slot="content">自家备料计划完成率：{{ `${data2[0].自家备料}%` }}</div>
              <el-button :disabled="disabled" :class="[isActive ? color[7] : 'weikaishi']" type="text" @click.stop="searchDiv11">自家备料<br>{{ `${data2[0].自家备料}%` }}</el-button>
            </el-tooltip>
          </div>
          <div id="son16" :class="[isActive ? color[0] : 'weikaishi']" class="module" style="position: relative;left: -1125px;top:236px; width: 80px;height: 48px;">
            <el-tooltip :open-delay="600" placement="top">
              <div slot="content">回款进度：{{ parseInt(`${data2[0].签订合同}`) + '%' }}</div>
              <el-button :disabled="disabled" :class="[isActive ? color[0] : 'weikaishi']" type="text" @click.stop="searchDiv1">签订合同</el-button>
              <!--<br>{{ parseInt(`${data2[0].签订合同}`) + '%' }}-->
            </el-tooltip>
          </div>
          <div id="son17" :class="[isActive ? color[1] : 'weikaishi']" class="module" style="position: relative;left: -1111px;top:236px; width: 80px;height: 48px;">
            <el-tooltip :open-delay="600" placement="top">
              <div slot="content">产品设计计划完成率：{{ `${data2[0].产品设计}%` }}</div>
              <el-button :disabled="disabled" :class="[isActive ? color[1] : 'weikaishi']" type="text" @click.stop="searchDiv2">产品设计<br>{{ `${data2[0].产品设计}%` }}</el-button>
            </el-tooltip>
          </div>
          <div id="son18" :class="[isActive ? color[6] : 'weikaishi']" class="module" style="position: relative;left: -850px;top:155px; width: 80px;height: 48px;">
            <el-tooltip :open-delay="600" placement="top">
              <div slot="content">外购备料计划完成率：{{ `${data2[0].外购备料}%` }}</div>
              <el-button :disabled="disabled" :class="[isActive ? color[6] : 'weikaishi']" type="text" @click.stop="searchDiv20">外购备料<br>{{ `${data2[0].外购备料}%` }}</el-button>
            </el-tooltip>
          </div>
          <div id="son19" :class="[isActive ? color[2] : 'weikaishi']" class="module" style="position: relative;left: -1182px;top:236px; width: 80px;height: 48px;">
            <el-tooltip :open-delay="600" placement="top">
              <div slot="content">零件分配计划完成率：{{ `${data2[0].零件分配}%` }}</div>
              <el-button :disabled="disabled" :class="[isActive ? color[2] : 'weikaishi']" type="text" @click.stop="searchDiv3">零件分配<br>{{ `${data2[0].零件分配}%` }}</el-button>
            </el-tooltip>
          </div>
          <div id="son20" :class="[isActive ? color[3] : 'weikaishi']" class="module" style="position: relative;left: -1142px;top:100px; width: 80px;height: 48px;">
            <el-tooltip :open-delay="600" placement="top">
              <div slot="content">自制投产计划完成率：{{ `${data2[0].自制件}%` }}</div>
              <el-button :disabled="disabled" :class="[isActive ? color[3] : 'weikaishi']" type="text" @click.stop="searchDiv4">自制投产<br>{{ `${data2[0].自制件}%` }}</el-button>
            </el-tooltip>
          </div>
          <div id="son21" :class="[isActive ? color[5] : 'weikaishi']" class="module" style="position: relative;left: -1225px;top:235px; width: 80px;height: 48px;">
            <el-tooltip :open-delay="600" placement="top">
              <div slot="content">采购计划完成率：{{ `${data2[0].车间采购}%` }}</div>
              <el-button :disabled="disabled" :class="[isActive ? color[5] : 'weikaishi']" type="text" @click.stop="searchDiv17">制造部采购<br>{{ `${data2[0].车间采购}%` }}</el-button>
            </el-tooltip>
          </div>
          <div id="son22" :class="[isActive ? color[4] : 'weikaishi']" class="module" style="position: relative;left: -465px;top:278px; width: 80px;height: 48px;">
            <el-tooltip :open-delay="600" placement="top">
              <div slot="content">采购计划完成率：{{ `${data2[0].采购部采购}%` }}</div>
              <el-button :disabled="disabled" :class="[isActive ? color[4] : 'weikaishi']" type="text" @click.stop="searchDiv16">采购部采购<br>{{ `${data2[0].采购部采购}%` }}</el-button>
            </el-tooltip>
          </div>
        </div>
      </div>
    </el-card>
    <!--初始化-->
    <div v-show="showDiv0">
      <el-card class="showDiv">
        <span>请选择机床：</span>
        <el-autocomplete
          v-model="searchCriteria"
          :fetch-suggestions="querySearch"
          :disabled="loading0"
          clearable
          style="width: 200px;margin-left: 10px"
          size="small"
          class="inline-input"
          placeholder="请输入内容"
          @clear="clearMachine"
          @select="SearchMachine"/>
        <el-table
          v-loading="loading0"
          :data="tableDataDiv0"
          height="340"
          style="width: 100%;min-height: 300px;"
          size="mini"
          stripe
          highlight-current-row
          border
          @row-click="handleSelect">
          <el-table-column
            label="序号"
            align="center"
            type="index"
            width="50"/>
          <el-table-column align="center" label="机床图号">
            <template slot-scope="scope">
              {{ scope.row.机床图号 }}
            </template>
          </el-table-column>
          <el-table-column align="center" label="机床名称" min-width="150px">
            <template slot-scope="scope">
              {{ scope.row.机床名称 }}
            </template>
          </el-table-column>
          <el-table-column align="center" label="数量">
            <template slot-scope="scope">
              {{ scope.row.机床数量 }}
            </template>
          </el-table-column>
          <el-table-column label="签订日期" align="center">
            <template slot-scope="scope">
              {{ scope.row.合同签订日期&&scope.row.合同签订日期!=='1900-01-01 00:00:00' ? scope.row.合同签订日期.substring(0, 11) : '-' }}
            </template>
          </el-table-column>
          <el-table-column label="交货期" align="center">
            <template slot-scope="scope">
              {{ scope.row.发货节点&&scope.row.发货节点!=='1900-01-01 00:00:00' ? scope.row.发货节点.substring(0, 11) : '-' }}
            </template>
          </el-table-column>
          <el-table-column align="center" label="理论工时">
            <template slot-scope="scope">
              {{ scope.row.理论加工时间段 }}
            </template>
          </el-table-column>
          <el-table-column align="center" label="实际工时">
            <template slot-scope="scope">
              {{ scope.row.实际加工时间段 }}
            </template>
          </el-table-column>
          <el-table-column align="center" label="外协工时">
            <template slot-scope="scope">
              {{ scope.row.外协工时总数 }}
            </template>
          </el-table-column>
          <el-table-column align="center" label="采购总价">
            <template slot-scope="scope">
              {{ scope.row.零件金额 }}
            </template>
          </el-table-column>
        </el-table>
      </el-card>
    </div>
    <!--签订合同-->
    <div v-show="showDiv1">
      <el-card class="showDiv">
        <h3 style="align-content: center">{{ Machine }} : 签订合同</h3>
        <el-row style="margin-top: 10px">
          <el-col :span="8">
            <div class="grid-content bg-purple" style="width: 99%; height: 340px; border: 1px solid #DCDFE6">
              <div style="margin:0 auto; width:400px; height:100px;margin-top: 70px">
                <div>
                  <span class="tag-group__title">合同编号：</span>
                  <el-tag
                    size="small"
                    effect="dark">
                    {{ dataDiv1.合同编号 }}
                  </el-tag>
                </div>
                <div style="margin-top: 17px">
                  <span class="tag-group__title">项目名称：</span>
                  {{ dataDiv1.项目名称 }}
                </div>
                <div style="margin-top: 17px">
                  <span class="tag-group__title">签订日期：</span>
                  {{ dataDiv1.合同签订日期.substring(0, 11) }}
                </div>
                <div style="margin-top: 17px">
                  <span class="tag-group__title">交货节点：</span>
                  {{ dataDiv1.发货节点.substring(0, 11) }}
                </div>
              </div>
            </div>
          </el-col>
          <el-col v-if="false" :span="8">
            <div class="grid-content bg-purple" style="width: 99%; height: 340px; border: 1px solid #DCDFE6">
              <div style="margin:0 auto; width:400px; height:100px;margin-top: 70px">
                <div style="margin-top: 17px">
                  <span class="tag-group__title">营销经理：</span>
                  <el-tag
                    size="small"
                    effect="dark">
                    {{ dataDiv1.姓名 }}
                  </el-tag>
                </div>
                <div style="margin-top: 17px">
                  合同总金额：{{ dataDiv1.合同总金额 }}
                </div>
                <div style="margin-top: 17px">
                  已收款金额：{{ dataDiv1.已支付 }}
                </div>
                <div style="margin-top: 17px">
                  <span class="tag-group__title">付款方式：</span>
                  {{ dataDiv1.付款方式 }}
                </div>
                <div style="margin-top: 17px">
                  <span>回款进度：</span>
                  <div style="width: 200px;display: inline-block">
                    <el-progress :text-inside="true" :stroke-width="15" :percentage="parseInt(dataDiv1.付款百分比)"/>
                  </div>
                </div>
              </div>
            </div>
          </el-col>
          <el-col :span="8">
            <div class="grid-content bg-purple-light" style="width: 99%; height: 340px; border: 1px solid #DCDFE6">
              <div style="margin:0 auto; width:400px; height:100px;margin-top: 70px">
                <div style="margin-top: 17px">
                  <span class="tag-group__title">客户名称：</span>
                  {{ dataDiv1.客户名称 }}
                </div>
                <div style="margin-top: 17px">
                  <span class="tag-group__title">联系人：</span>
                  {{ dataDiv1.联系人 }}
                </div>
                <div style="margin-top: 17px">
                  <span class="tag-group__title">联系方式：</span>
                  {{ dataDiv1.电话 }}
                </div>
                <div style="margin-top: 17px">
                  <span>客户评级：</span>
                  <el-rate
                    :max="maxDiv1"
                    v-model="valueDiv1"
                    style="display: inline-block"
                    disabled
                    show-score
                    text-color="#ff9900"
                    score-template="{value}"/>
                </div>
              </div>
            </div>
          </el-col>
        </el-row>
      </el-card>
    </div>
    <!--产品设计-->
    <div v-show="showDiv2">
      <el-card class="showDiv">
        <h3 style="align-content: center">{{ Machine }} : 产品设计</h3>
        <el-row style="margin-top: 10px">
          <el-col :span="8">
            <div class="grid-content bg-purple" style="width: 99%; height: 340px; border: 1px solid #DCDFE6;text-align: center">
              <el-row>
                <div style="margin-top: 17px">
                  <span>机床设计者：</span><el-tag size="mini">{{ dataDiv2.负责人 }}</el-tag>
                  <span style="margin-left: 10px">组件总数：</span><el-tag size="mini">{{ dataDiv2.组件总数 }}</el-tag>
                  <span style="margin-left: 10px">整改组数：</span><el-tag size="mini">{{ dataDiv2.整改组数 }}</el-tag>
                </div>
              </el-row>
              <el-row>
                <div id="barDiv1" style="width:600px;height:400px; display: block; float: left"/>
              </el-row>
            </div>
          </el-col>
          <el-col :span="16">
            <div class="grid-content bg-purple" style="width: 99%; height: 340px; color: #DCDFE6">
              <el-table
                :data="tableDataDiv2"
                height="340"
                style="width: 100%;min-height: 300px;"
                size="mini"
                stripe
                highlight-current-row
                border>
                <el-table-column
                  label="序号"
                  align="center"
                  type="index"
                  width="50"/>
                <el-table-column align="center" label="是否完成">
                  <template slot-scope="scope">
                    <el-tag v-if="scope.row.实际完成时间" type="success" size="mini" style="width: 80px">完成</el-tag>
                    <el-tag v-else type="danger" size="mini" style="width: 80px">未完成</el-tag>
                  </template>
                </el-table-column>
                <el-table-column align="center" label="组号">
                  <template slot-scope="scope">
                    {{ scope.row.组号 ? scope.row.组号 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="组件名称">
                  <template slot-scope="scope">
                    {{ scope.row.任务名称 ? scope.row.任务名称 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="设计计划开始时间">
                  <template slot-scope="scope">
                    {{ scope.row.任务开始时间.substring(0, 11) }}
                  </template>
                </el-table-column>
                <el-table-column label="设计计划完成时间" align="center">
                  <template slot-scope="scope">
                    {{ scope.row.计划完成时间.substring(0, 11) }}
                  </template>
                </el-table-column>
                <el-table-column label="设计实际完成时间" align="center">
                  <template slot-scope="scope">
                    {{ scope.row.实际完成时间 ? scope.row.实际完成时间 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="延期时间">
                  <template slot-scope="scope">
                    {{ scope.row.时间差 > 0 ? '延迟' + Math.abs(scope.row.时间差) + '天' : '提前' + Math.abs(scope.row.时间差) + '天' }}
                  </template>
                </el-table-column>
              </el-table>
            </div>
          </el-col>
        </el-row>
      </el-card>
    </div>
    <!--零件分配-->
    <div v-show="showDiv3">
      <el-card class="showDiv">
        <h3 style="align-content: center">{{ Machine }} : 零件分配</h3>
        <el-row style="margin-top: 10px">
          <el-col :span="8">
            <div class="grid-content bg-purple" style="width: 99%; height: 340px; border: 1px solid #DCDFE6;text-align: center">
              <el-row>
                <div id="barDiv3" style="width:600px;height:350px; display: block; float: left;margin-top: 15px"/>
              </el-row>
            </div>
          </el-col>
          <el-col :span="16">
            <div class="grid-content bg-purple" style="width: 99%; height: 340px; color: #DCDFE6">
              <el-table
                :data="tableDataDiv3"
                height="340"
                style="width: 100%;min-height: 300px;"
                stripe
                size="mini"
                highlight-current-row
                border
                @row-click="turnToPartAs">
                <el-table-column
                  label="序号"
                  align="center"
                  type="index"
                  width="50"/>
                <el-table-column align="center" label="是否完成">
                  <template slot-scope="scope">
                    <el-tag v-if="parseInt(scope.row.总未分配个数) <= 0 && parseInt(scope.row.总个数) !== 0" type="success" size="mini" style="width: 80px">完成</el-tag>
                    <el-tag v-else-if="parseInt(scope.row.总个数) === 0" type="danger" size="mini" style="width: 80px">三表未导入</el-tag>
                    <el-tag v-else type="warning" size="mini" style="width: 80px">未完成</el-tag>
                  </template>
                </el-table-column>
                <el-table-column align="center" label="分配进度">
                  <template slot-scope="scope">
                    <el-progress :text-inside="true" :stroke-width="15" :percentage="parseInt(percent(scope.row))"/>
                  </template>
                </el-table-column>
                <el-table-column align="center" label="组号">
                  <template slot-scope="scope">
                    {{ scope.row.组号 ? scope.row.组号 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="组件名称">
                  <template slot-scope="scope">
                    {{ scope.row.组件名称 ? scope.row.组件名称 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="基本件条数">
                  <template slot-scope="scope">
                    {{ scope.row.基本件个数 }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="外购件/标准件条数">
                  <template slot-scope="scope">
                    {{ scope.row.外购件个数 }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="零件总条数">
                  <template slot-scope="scope">
                    {{ scope.row.总个数 }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="未分配条数">
                  <template slot-scope="scope">
                    <el-tag v-if="parseInt(scope.row.总未分配个数) <= 0 && parseInt(scope.row.总个数) !== 0" type="success" size="mini" style="width: 80px">{{ scope.row.总未分配个数 }}</el-tag>
                    <el-tag v-else-if="parseInt(scope.row.总个数) === 0" type="danger" size="mini" style="width: 80px">{{ scope.row.总未分配个数 }}</el-tag>
                    <el-tag v-else type="warning" size="mini" style="width: 80px">{{ scope.row.总未分配个数 }}</el-tag>
                  </template>
                </el-table-column>
              </el-table>
            </div>
          </el-col>
        </el-row>
      </el-card>
    </div>
    <!--自制件-->
    <div v-show="showDiv4">
      <el-card class="showDiv">
        <h3 style="align-content: center">{{ Machine }} : 自制投产</h3>
        <el-row style="margin-top: 10px">
          <el-col :span="8">
            <div class="grid-content bg-purple" style="width: 99%; height: 340px; border: 1px solid #DCDFE6;text-align: center">
              <el-row>
                <div id="barDiv4" style="width:600px;height:320px; display: block; float: left;margin-top: 15px;margin-left: 10px"/>
              </el-row>
            </div>
          </el-col>
          <el-col :span="16">
            <div class="grid-content bg-purple" style="width: 99%; height: 340px; color: #DCDFE6">
              <el-table
                :data="tableDataDiv4"
                height="340"
                style="width: 100%;min-height: 300px;"
                size="mini"
                stripe
                highlight-current-row
                border
                @row-click="turnIniPro">
                <el-table-column
                  label="序号"
                  align="center"
                  type="index"
                  width="50"/>
                <el-table-column align="center" label="是否完成">
                  <template slot-scope="scope">
                    <el-tag v-if="(parseInt(scope.row.自家加工件总条数) - parseInt(scope.row.已传递条数)) <= 0 && parseInt(scope.row.自家加工件总条数) !== 0" type="success" size="mini" style="width: 80px">投产完成</el-tag>
                    <el-tag v-else-if="parseInt(scope.row.自家加工件总条数) === 0" type="danger" size="mini" style="width: 80px">未分配/导入</el-tag>
                    <el-tag v-else type="warning" size="mini" style="width: 80px">未完成</el-tag>
                  </template>
                </el-table-column>
                <el-table-column align="center" label="未投产条数">
                  <template slot-scope="scope">
                    {{ (parseInt(scope.row.自家加工件总条数) - parseInt(scope.row.已传递条数)) }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="组号">
                  <template slot-scope="scope">
                    {{ scope.row.组号 ? scope.row.组号 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="组件名称">
                  <template slot-scope="scope">
                    {{ scope.row.组件名称 ? scope.row.组件名称 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="自家加工件总条数">
                  <template slot-scope="scope">
                    {{ scope.row.自家加工件总条数 }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="已投产条数">
                  <template slot-scope="scope">
                    {{ scope.row.已传递条数 }}
                  </template>
                </el-table-column>
              </el-table>
            </div>
          </el-col>
        </el-row>
      </el-card>
    </div>
    <!--机械装配-->
    <div v-show="showDiv5">
      <el-card class="showDiv">
        <h3 style="align-content: center">{{ Machine }} : 机械装配</h3>
        <el-row style="margin-top: 10px">
          <el-col :span="8">
            <div class="grid-content bg-purple" style="width: 99%; height: 340px; border: 1px solid #DCDFE6;text-align: center">
              <el-row>
                <div id="barDiv5" style="width:600px;height:400px; display: block; float: left"/>
              </el-row>
            </div>
          </el-col>
          <el-col :span="16">
            <div class="grid-content bg-purple" style="width: 99%; height: 340px; color: #DCDFE6">
              <el-table
                :data="tableDataDiv5"
                height="340"
                style="width: 100%;min-height: 300px;"
                size="mini"
                stripe
                highlight-current-row
                border>
                <el-table-column
                  label="序号"
                  align="center"
                  type="index"
                  width="50"/>
                <el-table-column align="center" label="是否完成">
                  <template slot-scope="scope">
                    <el-tag v-if="(scope.row.开始时间 !== null && scope.row.开始时间 !== '') && (scope.row.结束时间 !== null && scope.row.结束时间 !== '')" type="success" size="mini" style="width: 80px">装配完成</el-tag>
                    <el-tag v-else-if="(scope.row.开始时间 !== null && scope.row.开始时间 !== '') && (scope.row.结束时间 === null || scope.row.结束时间 === '')" type="warning" size="mini" style="width: 80px">装配进行中</el-tag>
                    <el-tag v-else type="danger" size="mini" style="width: 80px">装配未开始</el-tag>
                  </template>
                </el-table-column>
                <el-table-column align="center" label="组号">
                  <template slot-scope="scope">
                    {{ scope.row.组号 ? scope.row.组号 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="组件名称">
                  <template slot-scope="scope">
                    {{ scope.row.任务名称 ? scope.row.任务名称 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="计划工时">
                  <template slot-scope="scope">
                    {{ scope.row.计划工时 ? scope.row.计划工时 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="实际开始时间">
                  <template slot-scope="scope">
                    {{ scope.row.开始时间 ? scope.row.开始时间 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="实际结束时间">
                  <template slot-scope="scope">
                    {{ scope.row.结束时间 ? scope.row.结束时间 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="实际总工时">
                  <template slot-scope="scope">
                    {{ scope.row.结束时间 ? parseInt(scope.row.实际工时) + parseInt(scope.row.修补工时) : '--' }}
                  </template>
                </el-table-column>
              </el-table>
            </div>
          </el-col>
        </el-row>
      </el-card>
    </div>
    <!--电气装配-->
    <div v-show="showDiv6">
      <el-card class="showDiv">
        <h3 style="align-content: center">{{ Machine }} : 电气装配</h3>
        <el-row style="margin-top: 10px">
          <el-col :span="8">
            <div class="grid-content bg-purple" style="width: 99%; height: 340px; border: 1px solid #DCDFE6;text-align: center">
              <el-row>
                <div id="barDiv6" style="width:600px;height:400px; display: block; float: left"/>
              </el-row>
            </div>
          </el-col>
          <el-col :span="16">
            <div class="grid-content bg-purple" style="width: 99%; height: 340px; color: #DCDFE6">
              <el-table
                :data="tableDataDiv6"
                height="340"
                style="width: 100%;min-height: 300px;"
                size="mini"
                stripe
                highlight-current-row
                border>
                <el-table-column
                  label="序号"
                  align="center"
                  type="index"
                  width="50"/>
                <el-table-column align="center" label="是否完成">
                  <template slot-scope="scope">
                    <el-tag v-if="(scope.row.开始时间 !== null && scope.row.开始时间 !== '') && (scope.row.结束时间 !== null && scope.row.结束时间 !== '')" type="success" size="mini" style="width: 80px">装配完成</el-tag>
                    <el-tag v-else-if="(scope.row.开始时间 !== null && scope.row.开始时间 !== '') && (scope.row.结束时间 === null || scope.row.结束时间 === '')" type="warning" size="mini" style="width: 80px">装配进行中</el-tag>
                    <el-tag v-else type="danger" size="mini" style="width: 80px">装配未开始</el-tag>
                  </template>
                </el-table-column>
                <el-table-column align="center" label="组号">
                  <template slot-scope="scope">
                    {{ scope.row.组号 ? scope.row.组号 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="组件名称">
                  <template slot-scope="scope">
                    {{ scope.row.任务名称 ? scope.row.任务名称 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="计划工时">
                  <template slot-scope="scope">
                    {{ scope.row.计划工时 ? scope.row.计划工时 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="实际开始时间">
                  <template slot-scope="scope">
                    {{ scope.row.开始时间 ? scope.row.开始时间 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="实际结束时间">
                  <template slot-scope="scope">
                    {{ scope.row.结束时间 ? scope.row.结束时间 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="实际总工时">
                  <template slot-scope="scope">
                    {{ scope.row.实际工时 ? parseInt(scope.row.实际工时) + parseInt(scope.row.修补工时) : '--' }}
                  </template>
                </el-table-column>
              </el-table>
            </div>
          </el-col>
        </el-row>
      </el-card>
    </div>
    <!--冷作计划-->
    <div v-show="showDiv7">
      <el-card class="showDiv">
        <h3 style="align-content: center">{{ Machine }} : 冷作</h3>
        <el-row style="margin-top: 10px">
          <el-col :span="8">
            <div class="grid-content bg-purple" style="width: 99%; height: 340px; border: 1px solid #DCDFE6;text-align: center">
              <el-row>
                <div id="barDiv7" style="width:600px;height:400px; display: block; float: left"/>
              </el-row>
            </div>
          </el-col>
          <el-col :span="16">
            <div class="grid-content bg-purple" style="width: 99%; height: 340px; color: #DCDFE6">
              <el-table
                :data="tableDataDiv7"
                height="340"
                style="width: 100%;min-height: 300px;"
                size="mini"
                stripe
                highlight-current-row
                border>
                <el-table-column
                  label="序号"
                  align="center"
                  type="index"
                  width="50"/>
                <el-table-column align="center" label="是否完成">
                  <template slot-scope="scope">
                    <el-tag v-if="(scope.row.开始时间 !== null && scope.row.开始时间 !== '') && (scope.row.结束时间 !== null && scope.row.结束时间 !== '')" type="success" size="mini" style="width: 80px">冷作完成</el-tag>
                    <el-tag v-else-if="(scope.row.开始时间 !== null && scope.row.开始时间 !== '') && (scope.row.结束时间 === null || scope.row.结束时间 === '')" type="warning" size="mini" style="width: 80px">冷作进行中</el-tag>
                    <el-tag v-else type="danger" size="mini" style="width: 80px">无计划</el-tag>
                  </template>
                </el-table-column>
                <el-table-column align="center" label="组号">
                  <template slot-scope="scope">
                    {{ scope.row.组号 ? scope.row.组号 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="组件名称">
                  <template slot-scope="scope">
                    {{ scope.row.任务名称 ? scope.row.任务名称 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="计划工时">
                  <template slot-scope="scope">
                    {{ scope.row.计划工时 ? scope.row.计划工时 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="实际开始时间">
                  <template slot-scope="scope">
                    {{ scope.row.开始时间 ? scope.row.开始时间 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="实际结束时间">
                  <template slot-scope="scope">
                    {{ scope.row.结束时间 ? scope.row.结束时间 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="实际总工时">
                  <template slot-scope="scope">
                    {{ scope.row.结束时间 ? parseInt(scope.row.实际工时) + parseInt(scope.row.修补工时) : '--' }}
                  </template>
                </el-table-column>
              </el-table>
            </div>
          </el-col>
        </el-row>
      </el-card>
    </div>
    <!--油漆计划-->
    <div v-show="showDiv8">
      <el-card class="showDiv">
        <h3 style="align-content: center">{{ Machine }} : 油漆</h3>
        <el-row style="margin-top: 10px">
          <el-col :span="8">
            <div class="grid-content bg-purple" style="width: 99%; height: 340px; border: 1px solid #DCDFE6;text-align: center">
              <el-row>
                <div id="barDiv8" style="width:600px;height:400px; display: block; float: left"/>
              </el-row>
            </div>
          </el-col>
          <el-col :span="16">
            <div class="grid-content bg-purple" style="width: 99%; height: 340px; color: #DCDFE6">
              <el-table
                :data="tableDataDiv8"
                height="340"
                style="width: 100%;min-height: 300px;"
                size="mini"
                stripe
                highlight-current-row
                border>
                <el-table-column
                  label="序号"
                  align="center"
                  type="index"
                  width="50"/>
                <el-table-column align="center" label="是否完成">
                  <template slot-scope="scope">
                    <el-tag v-if="(scope.row.开始时间 !== null && scope.row.开始时间 !== '') && (scope.row.结束时间 !== null && scope.row.结束时间 !== '')" type="success" size="mini" style="width: 80px">油漆完成</el-tag>
                    <el-tag v-else-if="(scope.row.开始时间 !== null && scope.row.开始时间 !== '') && (scope.row.结束时间 === null || scope.row.结束时间 === '')" type="warning" size="mini" style="width: 80px">油漆进行中</el-tag>
                    <el-tag v-else type="danger" size="mini" style="width: 80px">无计划</el-tag>
                  </template>
                </el-table-column>
                <el-table-column align="center" label="组号">
                  <template slot-scope="scope">
                    {{ scope.row.组号 ? scope.row.组号 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="组件名称">
                  <template slot-scope="scope">
                    {{ scope.row.任务名称 ? scope.row.任务名称 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="计划工时">
                  <template slot-scope="scope">
                    {{ scope.row.计划工时 ? scope.row.计划工时 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="实际开始时间">
                  <template slot-scope="scope">
                    {{ scope.row.开始时间 ? scope.row.开始时间 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="实际结束时间">
                  <template slot-scope="scope">
                    {{ scope.row.结束时间 ? scope.row.结束时间 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="实际总工时">
                  <template slot-scope="scope">
                    {{ scope.row.结束时间 ? parseInt(scope.row.实际工时) + parseInt(scope.row.修补工时) : '--' }}
                  </template>
                </el-table-column>
              </el-table>
            </div>
          </el-col>
        </el-row>
      </el-card>
    </div>
    <!--成组配套-->
    <div v-show="showDiv9">
      <el-card class="showDiv">
        <h3 style="align-content: center">{{ Machine }} : 成组配套</h3>
        <el-row style="margin-top: 10px">
          <el-col :span="8">
            <div class="grid-content bg-purple" style="width: 99%; height: 340px; border: 1px solid #DCDFE6;text-align: center">
              <h3>加工完成</h3>
              <el-table
                id="div1"
                ref="div1"
                :data="tableDataDiv9A"
                style="width: 100%;height: 340px;overflow-y: auto;"
                size="mini"
                stripe
                height="340px"
                highlight-current-row
                border
                @mouseenter.native="changeScroll1">
                <el-table-column
                  label="序号"
                  align="center"
                  type="index"
                  width="50"/>
                <el-table-column align="center" label="组号" width="55px">
                  <template slot-scope="scope">
                    {{ scope.row.组号 ? scope.row.组号 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="组件名称" min-width="95px">
                  <template slot-scope="scope">
                    {{ scope.row.组件名称 ? scope.row.组件名称 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="投产数量" width="60px">
                  <template slot-scope="scope">
                    {{ scope.row.投产数量 ? scope.row.投产数量 : '0' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="加工完成数量" width="60px">
                  <template slot-scope="scope">
                    {{ scope.row.入库数量 ? scope.row.入库数量 : 0 }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="完成时间" min-width="70px">
                  <template slot-scope="scope">
                    {{ scope.row.完成时间 ? scope.row.完成时间.substring(0, 11) : 0 }}
                  </template>
                </el-table-column>
              </el-table>
            </div>
          </el-col>
          <el-col :span="8">
            <div class="grid-content bg-purple" style="width: 99%; height: 340px; border: 1px solid #DCDFE6;text-align: center">
              <h3>采购到货</h3>
              <el-table
                id="div2"
                ref="div2"
                :data="tableDataDiv9B"
                style="width: 100%;height: 340px;overflow-y: scroll;"
                size="mini"
                stripe
                height="340px"
                highlight-current-row
                border
                @mouseenter.native="changeScroll2">
                <el-table-column
                  label="序号"
                  align="center"
                  type="index"
                  width="50"/>
                <el-table-column align="center" label="组号" width="55px">
                  <template slot-scope="scope">
                    {{ scope.row.组号 ? scope.row.组号 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="组件名称" min-width="95px">
                  <template slot-scope="scope">
                    {{ scope.row.组件名称 ? scope.row.组件名称 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="投产数量" width="60px">
                  <template slot-scope="scope">
                    {{ scope.row.总零件数量 ? scope.row.总零件数量 : '0' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="采购到货数量" width="60px">
                  <template slot-scope="scope">
                    {{ scope.row.总到货数量 ? scope.row.总到货数量 : 0 }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="完成时间" min-width="70px">
                  <template slot-scope="scope">
                    {{ scope.row.完成时间 !== '1900-01-01 00:00:00' ? scope.row.完成时间 : '未完成' }}
                  </template>
                </el-table-column>
              </el-table>
            </div>
          </el-col>
          <el-col :span="8">
            <div class="grid-content bg-purple" style="width: 99%; height: 340px; border: 1px solid #DCDFE6;text-align: center">
              <h3>制造部采购</h3>
              <el-table
                id="div3"
                ref="div3"
                :data="tableDataDiv9C"
                style="width: 100%;height: 340px;overflow-y: scroll;"
                stripe
                size="mini"
                height="340px"
                highlight-current-row
                border
                @mouseenter.native="changeScroll3">
                <el-table-column
                  label="序号"
                  align="center"
                  type="index"
                  width="50"/>
                <el-table-column align="center" label="组号" width="55px">
                  <template slot-scope="scope">
                    {{ scope.row.组号 ? scope.row.组号 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="组件名称" min-width="95px">
                  <template slot-scope="scope">
                    {{ scope.row.组件名称 ? scope.row.组件名称 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="投产数量" width="60px">
                  <template slot-scope="scope">
                    {{ scope.row.总零件数量 ? scope.row.总零件数量 : '0' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="采购到货" width="60px">
                  <template slot-scope="scope">
                    {{ scope.row.到货数量 ? scope.row.到货数量 : 0 }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="完成时间" min-width="70px">
                  <template slot-scope="scope">
                    {{ scope.row.完成时间 !== '1900-01-01 00:00:00' ? scope.row.完成时间 : '未完成' }}
                  </template>
                </el-table-column>
              </el-table>
            </div>
          </el-col>
        </el-row>
      </el-card>
    </div>
    <!--车间加工-->
    <div v-show="showDiv10">
      <el-card class="showDiv">
        <h3 style="align-content: center">{{ Machine }} : 车间加工</h3>
        <el-row style="margin-top: 10px">
          <el-col :span="24">
            <div class="grid-content bg-purple" style="width: 99%; height: 340px; border: 1px solid #DCDFE6;text-align: center">
              <el-table
                :data="tableDataDiv10"
                height="340"
                style="width: 100%"
                size="mini"
                stripe
                highlight-current-row
                border
                @row-click="turnToProStatus">
                <el-table-column
                  label="序号"
                  align="center"
                  type="index"
                  width="50"/>
                <el-table-column align="center" label="组号">
                  <template slot-scope="scope">
                    {{ scope.row.组号 ? scope.row.组号 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="组件名称">
                  <template slot-scope="scope">
                    {{ scope.row.组件名称 ? scope.row.组件名称 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="组别进度">
                  <template slot-scope="scope">
                    {{ scope.row.进度 ? scope.row.进度 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="负责人">
                  <template slot-scope="scope">
                    {{ scope.row.负责人 ? scope.row.负责人 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="计划开始时间">
                  <template slot-scope="scope">
                    {{ scope.row.任务开始时间 ? scope.row.任务开始时间.substring(0, 11) : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="计划完成时间">
                  <template slot-scope="scope">
                    {{ scope.row.计划完成时间 ? scope.row.计划完成时间.substring(0, 11) : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="实际完成时间">
                  <template slot-scope="scope">
                    {{ scope.row.实际完成时间 ? scope.row.实际完成时间.substring(0, 11) : '--' }}
                  </template>
                </el-table-column>
              </el-table>
            </div>
          </el-col>
        </el-row>
      </el-card>
    </div>
    <!--自家备料-->
    <div v-show="showDiv11">
      <el-card class="showDiv">
        <h3 style="align-content: center">{{ Machine }} : 自家备料</h3>
        <el-row style="margin-top: 10px">
          <el-col :span="8">
            <div class="grid-content bg-purple" style="width: 99%; height: 340px; border: 1px solid #DCDFE6;text-align: center">
              <div id="barDiv11" style="width:600px;height:350px; display: block; float: left"/>
            </div>
          </el-col>
          <el-col :span="16">
            <div class="grid-content bg-purple" style="width: 99%; height: 340px; border: 1px solid #DCDFE6;text-align: center">
              <el-table
                :data="tableDataDiv11"
                height="340"
                style="width: 100%"
                size="mini"
                stripe
                highlight-current-row
                border
                @row-click="turnMaterArrMan">
                <el-table-column
                  label="序号"
                  align="center"
                  type="index"
                  width="50"/>
                <el-table-column align="center" label="是否完成">
                  <template slot-scope="scope">
                    <el-tag v-if="scope.row.状态 === '完成'" type="success" size="mini" style="width: 80px">完成</el-tag>
                    <el-tag v-else type="danger" size="mini" style="width: 80px">未完成</el-tag>
                  </template>
                </el-table-column>
                <el-table-column align="center" label="组号" width="80px">
                  <template slot-scope="scope">
                    {{ scope.row.组号 ? scope.row.组号 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="组件名称">
                  <template slot-scope="scope">
                    {{ scope.row.组件名称 ? scope.row.组件名称 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="零件总条数">
                  <template slot-scope="scope">
                    {{ scope.row.零件条数 ? scope.row.零件条数 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="已备料">
                  <template slot-scope="scope">
                    {{ scope.row.已备料条数 ? scope.row.已备料条数 : '--' }}
                  </template>
                </el-table-column>
              </el-table>
            </div>
          </el-col>
        </el-row>
      </el-card>
    </div>
    <!--自制件质检-->
    <div v-show="showDiv12">
      <el-card class="showDiv">
        <h3 style="align-content: center">{{ Machine }} : 自制件质检</h3>
        <el-row style="margin-top: 10px">
          <el-col :span="24">
            <div class="grid-content bg-purple" style="width: 99%; height: 340px; border: 1px solid #DCDFE6;text-align: center">
              <el-table
                :data="tableDataDiv12"
                height="340"
                style="width: 100%"
                size="mini"
                stripe
                highlight-current-row
                border>
                <el-table-column
                  label="序号"
                  align="center"
                  type="index"
                  width="50"/>
                <el-table-column align="center" label="组号" width="80px">
                  <template slot-scope="scope">
                    {{ scope.row.组号 ? scope.row.组号 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="组件名称">
                  <template slot-scope="scope">
                    {{ scope.row.组件名称 ? scope.row.组件名称 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="零件总数量">
                  <template slot-scope="scope">
                    {{ scope.row.零件总数量 ? scope.row.零件总数量 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="检测数量">
                  <template slot-scope="scope">
                    {{ scope.row.检测总数量 ? scope.row.检测总数量 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="不合格数">
                  <template slot-scope="scope">
                    {{ scope.row.不合格总数量 ? scope.row.不合格总数量 : '0' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="合格率">
                  <template slot-scope="scope">
                    <el-tag size="mini" style="width: 80px">{{ scope.row.合格率 ? scope.row.合格率 + '%' : '--' }}</el-tag>
                  </template>
                </el-table-column>
              </el-table>
            </div>
          </el-col>
        </el-row>
      </el-card>
    </div>
    <!--工艺定额-->
    <div v-show="showDiv13">
      <el-card class="showDiv">
        <h3 style="align-content: center">{{ Machine }} : 工艺定额</h3>
        <el-row style="margin-top: 10px">
          <el-col :span="8">
            <div class="grid-content bg-purple" style="width: 99%; height: 340px; border: 1px solid #DCDFE6;text-align: center">
              <div id="barDiv13" style="width:600px;height:350px; display: block; float: left"/>
            </div>
          </el-col>
          <el-col :span="16">
            <div class="grid-content bg-purple" style="width: 99%; height: 340px; border: 1px solid #DCDFE6;text-align: center">
              <el-table
                :data="tableDataDiv13"
                height="340"
                style="width: 100%"
                size="mini"
                stripe
                highlight-current-row
                border>
                <el-table-column
                  label="序号"
                  align="center"
                  type="index"
                  width="50"/>
                <el-table-column align="center" label="组号" width="80px">
                  <template slot-scope="scope">
                    {{ scope.row.组号 ? scope.row.组号 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="组件名称">
                  <template slot-scope="scope">
                    {{ scope.row.组件名称 ? scope.row.组件名称 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="零件总条数">
                  <template slot-scope="scope">
                    {{ scope.row.零件总数 ? scope.row.零件总数 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="已制定条数">
                  <template slot-scope="scope">
                    {{ scope.row.已制定零件数 ? scope.row.已制定零件数 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="未制定条数">
                  <template slot-scope="scope">
                    {{ scope.row.未制定零件数 ? scope.row.未制定零件数 : '0' }}
                  </template>
                </el-table-column>
              </el-table>
            </div>
          </el-col>
        </el-row>
      </el-card>
    </div>
    <!--定额-->
    <div v-show="showDiv14">
      <el-card class="showDiv">
        <el-row>
          <el-col :span="8">
            <div class="grid-content bg-purple" style="width: 99%; height: 340px; border: 1px solid #DCDFE6;text-align: center">
              <div id="barDiv14" style="width:600px;height:350px; display: block; float: left"/>
            </div>
          </el-col>
          <el-col :span="16">
            <div class="grid-content bg-purple" style="width: 99%; height: 340px; border: 1px solid #DCDFE6;text-align: center">
              <el-table
                :data="tableDataDiv14"
                height="340"
                style="width: 100%"
                size="mini"
                stripe
                highlight-current-row
                border>
                <el-table-column
                  label="序号"
                  align="center"
                  type="index"
                  width="50"/>
                <el-table-column align="center" label="组号" width="80px">
                  <template slot-scope="scope">
                    {{ scope.row.组号 ? scope.row.组号 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="组件名称">
                  <template slot-scope="scope">
                    {{ scope.row.组件名称 ? scope.row.组件名称 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="零件总条数">
                  <template slot-scope="scope">
                    {{ scope.row.零件总数 ? scope.row.零件总数 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="已制定条数">
                  <template slot-scope="scope">
                    {{ scope.row.已制定零件数 ? scope.row.已制定零件数 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="未制定条数">
                  <template slot-scope="scope">
                    {{ scope.row.未制定零件数 ? scope.row.未制定零件数 : '0' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="理论工时">
                  <template slot-scope="scope">
                    {{ scope.row.理论总工时 ? scope.row.理论总工时 : '0' }}
                  </template>
                </el-table-column>
              </el-table>
            </div>
          </el-col>
        </el-row>
      </el-card>
    </div>
    <!--能力平衡-->
    <div v-show="showDiv15">
      <el-card class="showDiv">
        <h3 style="align-content: center">{{ Machine }} : 能力平衡</h3>
        <el-row style="margin-top: 10px">
          <el-col :span="8">
            <div class="grid-content bg-purple" style="width: 99%; height: 340px; border: 1px solid #DCDFE6;text-align: center">
              <div id="barDiv15" style="width:600px;height:350px; display: block; float: left"/>
            </div>
          </el-col>
          <el-col :span="16">
            <div class="grid-content bg-purple" style="width: 99%; height: 340px; border: 1px solid #DCDFE6;text-align: center">
              <el-table
                :data="tableDataDiv15"
                height="340"
                style="width: 100%"
                size="mini"
                stripe
                highlight-current-row
                border
                @row-click="turnToPCB">
                <el-table-column
                  label="序号"
                  align="center"
                  type="index"
                  width="50"/>
                <el-table-column align="center" label="是否完成" width="120px">
                  <template slot-scope="scope">
                    <el-tag v-if="scope.row.完成状态 === '已完成'" type="success" size="mini" style="width: 80px">完成</el-tag>
                    <el-tag v-else type="danger" size="mini" style="width: 80px">未完成</el-tag>
                  </template>
                </el-table-column>
                <el-table-column align="center" label="组号" width="80px">
                  <template slot-scope="scope">
                    {{ scope.row.组号 ? scope.row.组号 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="组件名称">
                  <template slot-scope="scope">
                    {{ scope.row.组件名称 ? scope.row.组件名称 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="零件总条数">
                  <template slot-scope="scope">
                    {{ scope.row.零件总条数 ? scope.row.零件总条数 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="已平衡条数">
                  <template slot-scope="scope">
                    {{ scope.row.已完成数量 ? scope.row.已完成数量 : '--' }}
                  </template>
                </el-table-column>
              </el-table>
            </div>
          </el-col>
        </el-row>
      </el-card>
    </div>
    <!--发货-->
    <div v-show="showDiv23">
      <el-card class="showDiv">
        <h3 style="align-content: center">{{ Machine }} : 发货</h3>
        <div class="grid-content bg-purple" style="width: 99%; height: 340px; border: 1px solid #DCDFE6;text-align: center;margin-top: 10px">
          <el-table
            :data="tableDataDiv23"
            height="340"
            style="width: 100%"
            size="mini"
            stripe
            highlight-current-row
            border>
            <el-table-column
              label="序号"
              align="center"
              type="index"
              width="50"/>
            <el-table-column align="center" label="发货状态">
              <template slot-scope="scope">
                <el-tag v-if="scope.row.是否发出 === 1" type="success" size="mini" style="width: 80px">已发货</el-tag>
                <el-tag v-if="scope.row.是否发出 === 0" type="success" size="mini" style="width: 80px">未发货</el-tag>
              </template>
            </el-table-column>
            <el-table-column align="center" label="发货单编号">
              <template slot-scope="scope">
                {{ scope.row.发货单编号 ? scope.row.发货单编号 : '--' }}
              </template>
            </el-table-column>
            <el-table-column align="center" label="发货单名称">
              <template slot-scope="scope">
                {{ scope.row.发货单名称 ? scope.row.发货单名称 : '--' }}
              </template>
            </el-table-column>
            <el-table-column align="center" label="货品编号">
              <template slot-scope="scope">
                {{ scope.row.货品编号 ? scope.row.货品编号 : '--' }}
              </template>
            </el-table-column>
            <el-table-column align="center" label="货品名称">
              <template slot-scope="scope">
                {{ scope.row.货品名称 ? scope.row.货品名称 : '--' }}
              </template>
            </el-table-column>
            <el-table-column align="center" label="货品类别">
              <template slot-scope="scope">
                {{ scope.row.货品类别 ? scope.row.货品类别 : '--' }}
              </template>
            </el-table-column>
            <el-table-column align="center" label="收货单位">
              <template slot-scope="scope">
                {{ scope.row.收货单位 ? scope.row.收货单位 : '--' }}
              </template>
            </el-table-column>
            <el-table-column align="center" label="发出时间">
              <template slot-scope="scope">
                {{ scope.row.发出时间 ? scope.row.发出时间 : '--' }}
              </template>
            </el-table-column>
          </el-table>
        </div>
      </el-card>
    </div>
    <!--采购部采购-->
    <div v-show="showDiv16">
      <el-card class="showDiv">
        <h3 style="align-content: center">{{ Machine }} : 采购部采购</h3>
        <el-row style="margin-top: 10px">
          <el-col :span="8">
            <div class="grid-content bg-purple" style="width: 99%; height: 340px; border: 1px solid #DCDFE6;text-align: center">
              <h3>外购件</h3>
              <el-table
                :data="tableDataDiv16A"
                style="width: 100%;height: 340px;overflow-y: auto;"
                size="mini"
                stripe
                height="340px"
                highlight-current-row
                border>
                <el-table-column align="center" label="组号" width="55px">
                  <template slot-scope="scope">
                    {{ scope.row.组号 ? scope.row.组号 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="组件名称" min-width="95px">
                  <template slot-scope="scope">
                    {{ scope.row.组件名称 ? scope.row.组件名称 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="总数" width="60px">
                  <template slot-scope="scope">
                    {{ scope.row.总外购件数 ? scope.row.总外购件数 : '0' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="已采购数" width="60px">
                  <template slot-scope="scope">
                    {{ scope.row.已采购外购件数 ? scope.row.已采购外购件数 : 0 }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="部分采购数" width="60px">
                  <template slot-scope="scope">
                    {{ scope.row.部分采购外购件数 ? scope.row.部分采购外购件数 : 0 }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="总到货数数" width="60px">
                  <template slot-scope="scope">
                    {{ scope.row.总到货数外购件数 ? scope.row.总到货数外购件数 : 0 }}
                  </template>
                </el-table-column>
              </el-table>
            </div>
          </el-col>
          <el-col :span="8">
            <div class="grid-content bg-purple" style="width: 99%; height: 340px; border: 1px solid #DCDFE6;text-align: center">
              <h3>标准件</h3>
              <el-table
                :data="tableDataDiv16B"
                style="width: 100%;height: 340px;overflow-y: scroll;"
                size="mini"
                stripe
                height="340px"
                highlight-current-row
                border>
                <el-table-column align="center" label="组号" width="55px">
                  <template slot-scope="scope">
                    {{ scope.row.组号 ? scope.row.组号 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="组件名称" min-width="95px">
                  <template slot-scope="scope">
                    {{ scope.row.组件名称 ? scope.row.组件名称 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="总数" width="60px">
                  <template slot-scope="scope">
                    {{ scope.row.总标准件数 ? scope.row.总标准件数: '0' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="已采购数" width="60px">
                  <template slot-scope="scope">
                    {{ scope.row.已采购标准件数 ? scope.row.已采购标准件数 : 0 }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="部分采购数" width="60px">
                  <template slot-scope="scope">
                    {{ scope.row.部分采购标准件数 ? scope.row.部分采购标准件数 : 0 }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="总到货数" width="60px">
                  <template slot-scope="scope">
                    {{ scope.row.总到货数标准件数 ? scope.row.总到货数标准件数 : 0 }}
                  </template>
                </el-table-column>
              </el-table>
            </div>
          </el-col>
          <el-col :span="8">
            <div class="grid-content bg-purple" style="width: 99%; height: 340px; border: 1px solid #DCDFE6;text-align: center">
              <h3>基本件</h3>
              <el-table
                :data="tableDataDiv16C"
                style="width: 100%;height: 340px;overflow-y: scroll;"
                height="340px"
                size="mini"
                stripe
                highlight-current-row
                border>
                <el-table-column align="center" label="组号" width="55px">
                  <template slot-scope="scope">
                    {{ scope.row.组号 ? scope.row.组号 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="组件名称" min-width="95px">
                  <template slot-scope="scope">
                    {{ scope.row.组件名称 ? scope.row.组件名称 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="总数" width="60px">
                  <template slot-scope="scope">
                    {{ scope.row.总基本件数 ? scope.row.总基本件数: '0' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="已采购数" width="60px">
                  <template slot-scope="scope">
                    {{ scope.row.已采购基本件数 ? scope.row.已采购基本件数 : 0 }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="部分采购数" width="60px">
                  <template slot-scope="scope">
                    {{ scope.row.部分采购基本件数 ? scope.row.部分采购基本件数 : 0 }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="总到货数" width="60px">
                  <template slot-scope="scope">
                    {{ scope.row.总到货数基本件数 ? scope.row.总到货数基本件数 : 0 }}
                  </template>
                </el-table-column>
              </el-table>
            </div>
          </el-col>
        </el-row>
      </el-card>
    </div>
    <!--制造部采购-->
    <div v-show="showDiv17">
      <el-card class="showDiv">
        <h3 style="align-content: center">{{ Machine }} : 制造部采购</h3>
        <el-row style="margin-top: 10px">
          <el-col :span="12">
            <div class="grid-content bg-purple" style="width: 99%; height: 340px; border: 1px solid #DCDFE6;text-align: center">
              <el-table
                :data="tableDataDiv17A"
                style="width: 100%;overflow-y: auto;"
                height="340px"
                size="mini"
                stripe
                highlight-current-row
                border>
                <el-table-column
                  label="序号"
                  align="center"
                  type="index"
                  width="55"/>
                <el-table-column align="center" label="组号" width="120px">
                  <template slot-scope="scope">
                    {{ scope.row.组号 ? scope.row.组号 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="组件名称">
                  <template slot-scope="scope">
                    {{ scope.row.组件名称 ? scope.row.组件名称 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="总基本件数" width="120px">
                  <template slot-scope="scope">
                    {{ scope.row.总基本件数 ? scope.row.总基本件数 : '0' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="已采购基本件数" width="120px">
                  <template slot-scope="scope">
                    {{ scope.row.已采购基本件数? scope.row.已采购基本件数 : 0 }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="总到货数基本件数" width="120px">
                  <template slot-scope="scope">
                    {{ scope.row.总到货数基本件数 ? scope.row.总到货数基本件数 : 0 }}
                  </template>
                </el-table-column>
              </el-table>
            </div>
          </el-col>
          <el-col :span="12">
            <div class="grid-content bg-purple" style="width: 99%; height: 340px; border: 1px solid #DCDFE6;text-align: center">
              <el-table
                :data="tableDataDiv17B"
                style="width: 100%;overflow-y: scroll;"
                height="340px"
                size="mini"
                stripe
                highlight-current-row
                border>
                <el-table-column
                  label="序号"
                  align="center"
                  type="index"
                  width="55"/>
                <el-table-column align="center" label="组号" width="120px">
                  <template slot-scope="scope">
                    {{ scope.row.组号 ? scope.row.组号 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="组件名称">
                  <template slot-scope="scope">
                    {{ scope.row.组件名称 ? scope.row.组件名称 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="总基本件数" width="120px">
                  <template slot-scope="scope">
                    {{ scope.row.总基本件数 ? scope.row.总基本件数: '0' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="已采购基本件数" width="120px">
                  <template slot-scope="scope">
                    {{ scope.row.已采购基本件数 ? scope.row.已采购基本件数 : 0 }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="总到货数基本件数" width="120px">
                  <template slot-scope="scope">
                    {{ scope.row.总到货数基本件数 ? scope.row.总到货数基本件数 : 0 }}
                  </template>
                </el-table-column>
              </el-table>
            </div>
          </el-col>
        </el-row>
      </el-card>
    </div>
    <!--工序外协-->
    <div v-show="showDiv18">
      <el-card class="showDiv">
        <h3 style="align-content: center">{{ Machine }} : 工序外协</h3>
        <el-row style="margin-top: 10px">
          <el-col :span="8">
            <div class="grid-content bg-purple" style="width: 99%; height: 340px; border: 1px solid #DCDFE6;text-align: center">
              <el-row>
                <div id="barDiv18" style="width:600px;height:350px; display: block; float: left;margin-top: 15px"/>
              </el-row>
            </div>
          </el-col>
          <el-col :span="16">
            <div class="grid-content bg-purple" style="width: 99%; height: 340px; color: #DCDFE6">
              <el-table
                :data="tableDataDiv18"
                height="340"
                style="width: 100%;min-height: 300px;"
                size="mini"
                stripe
                highlight-current-row
                border>
                <el-table-column
                  label="序号"
                  align="center"
                  type="index"
                  width="50"/>
                <el-table-column align="center" label="完成状态">
                  <template slot-scope="scope">
                    <el-tag v-if="scope.row.完成状态 ==='已完成'" type="success" size="mini" style="width: 80px">已完成</el-tag>
                    <el-tag v-else-if="scope.row.完成状态 === '未外协'" type="danger" size="mini" style="width: 80px">未外协</el-tag>
                    <el-tag v-else type="warning" size="mini" style="width: 80px">未完成</el-tag>
                  </template>
                </el-table-column>
                <el-table-column align="center" label="组号">
                  <template slot-scope="scope">
                    {{ scope.row.组号 ? scope.row.组号 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="组件名称">
                  <template slot-scope="scope">
                    {{ scope.row.组件名称 ? scope.row.组件名称 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="外协总数">
                  <template slot-scope="scope">
                    {{ scope.row.外协总数 }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="已完成数量">
                  <template slot-scope="scope">
                    {{ scope.row.已完成数量 }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="工时总数">
                  <template slot-scope="scope">
                    {{ scope.row.工时总数? scope.row.工时总数 : '--' }}
                  </template>
                </el-table-column>
              </el-table>
            </div>
          </el-col>
        </el-row>
      </el-card>
    </div>
    <!--采购质检-->
    <div v-show="showDiv19">
      <el-card class="showDiv">
        <h3 style="align-content: center">{{ Machine }} : 采购质检</h3>
        <el-row style="margin-top: 10px">
          <el-col :span="24">
            <div class="grid-content bg-purple" style="width: 99%; height: 340px; border: 1px solid #DCDFE6;text-align: center">
              <el-table
                :data="tableDataDiv19"
                height="340"
                style="width: 100%"
                size="mini"
                stripe
                highlight-current-row
                border>
                <el-table-column
                  label="序号"
                  align="center"
                  type="index"
                  width="50"/>
                <el-table-column align="center" label="组号" width="80px">
                  <template slot-scope="scope">
                    {{ scope.row.组号 ? scope.row.组号 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="组件名称">
                  <template slot-scope="scope">
                    {{ scope.row.组件名称 ? scope.row.组件名称 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="零件总数量">
                  <template slot-scope="scope">
                    {{ scope.row.零件总数量 ? scope.row.零件总数量 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="检测数量">
                  <template slot-scope="scope">
                    {{ scope.row.检测总数量 ? scope.row.检测总数量 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="不合格数">
                  <template slot-scope="scope">
                    {{ scope.row.不合格总数量 ? scope.row.不合格总数量 : '0' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="合格率">
                  <template slot-scope="scope">
                    <el-tag size="mini" style="width: 80px">{{ scope.row.合格率 ? scope.row.合格率 + '%' : '--' }}</el-tag>
                  </template>
                </el-table-column>
              </el-table>
            </div>
          </el-col>
        </el-row>
      </el-card>
    </div>
    <!--外购备料-->
    <div v-show="showDiv20">
      <el-card class="showDiv">
        <h3 style="align-content: center">{{ Machine }} : 外购备料</h3>
        <el-row style="margin-top: 10px">
          <el-col :span="24">
            <div class="grid-content bg-purple" style="width: 99%; height: 340px; border: 1px solid #DCDFE6;text-align: center">
              <el-table
                :data="tableDataDiv20"
                height="340"
                style="width: 100%"
                size="mini"
                stripe
                highlight-current-row
                border>
                <el-table-column
                  label="序号"
                  align="center"
                  type="index"
                  width="50"/>
                <el-table-column align="center" label="是否完成">
                  <template slot-scope="scope">
                    <el-tag v-if="parseInt(scope.row.外购备料到货总数)=== parseInt(scope.row.外购备料总数)" type="success" size="mini" style="width: 80px">完成</el-tag>
                    <el-tag v-else type="danger" size="mini" style="width: 80px">未完成</el-tag>
                  </template>
                </el-table-column>
                <el-table-column align="center" label="组号" width="80px">
                  <template slot-scope="scope">
                    {{ scope.row.组号 ? scope.row.组号 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="组件名称">
                  <template slot-scope="scope">
                    {{ scope.row.组件名称 ? scope.row.组件名称 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="外购备料总数">
                  <template slot-scope="scope">
                    {{ scope.row.外购备料总数 ? scope.row.外购备料总数 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="外购备料到货总数">
                  <template slot-scope="scope">
                    {{ scope.row.外购备料到货总数 ? scope.row.外购备料到货总数 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="外购备料出库总数">
                  <template slot-scope="scope">
                    {{ scope.row.外购备料出库总数 ? scope.row.外购备料出库总数 : '--' }}
                  </template>
                </el-table-column>
              </el-table>
            </div>
          </el-col>
        </el-row>
      </el-card>
    </div>
    <!--装配质检-->
    <div v-show="showDiv21">
      <el-card class="showDiv">
        <h3 style="align-content: center">{{ Machine }} : 装配质检</h3>
        <el-row style="margin-top: 10px">
          <!--<el-col :span="8">-->
          <!--<div class="grid-content bg-purple" style="width: 99%; height: 340px; border: 1px solid #DCDFE6;text-align: center">-->
          <!--<div id="barDiv11" style="width:600px;height:350px; display: block; float: left"/>-->
          <!--</div>-->
          <!--</el-col>-->
          <el-col :span="24">
            <div class="grid-content bg-purple" style="width: 99%; height: 340px; border: 1px solid #DCDFE6;text-align: center">
              <el-table
                :data="tableDataDiv21"
                height="340"
                style="width: 100%"
                size="mini"
                stripe
                highlight-current-row
                border>
                <el-table-column
                  label="序号"
                  align="center"
                  type="index"
                  width="50"/>
                <el-table-column align="center" label="是否完成" width="105">
                  <template slot-scope="scope">
                    <el-tag v-if="parseInt(scope.row.是否合格)=== 1" type="success" size="mini" style="width: 80px">合格</el-tag>
                    <el-tag v-else type="danger" size="mini" style="width: 80px">不合格</el-tag>
                  </template>
                </el-table-column>
                <el-table-column align="center" label="机床图号" width="110">
                  <template slot-scope="scope">
                    {{ scope.row.机床图号 ? scope.row.机床图号 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="机床名称" min-width="210">
                  <template slot-scope="scope">
                    {{ scope.row.机床名称 ? scope.row.机床名称 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="组号" width="70px">
                  <template slot-scope="scope">
                    {{ scope.row.组号 ? scope.row.组号 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="组件名称" width="110">
                  <template slot-scope="scope">
                    {{ scope.row.组件名称 ? scope.row.组件名称 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="检测项" width="110">
                  <template slot-scope="scope">
                    {{ scope.row.检测项 ? scope.row.检测项 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="检测项明细" min-width="310">
                  <template slot-scope="scope">
                    {{ scope.row.检测项明细 ? scope.row.检测项明细 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="备注">
                  <template slot-scope="scope">
                    {{ scope.row.备注 ? scope.row.备注 : '--' }}
                  </template>
                </el-table-column>
              </el-table>
            </div>
          </el-col>
        </el-row>
      </el-card>
    </div>
    <!--总装调试-->
    <div v-show="showDiv22">
      <el-card class="showDiv">
        <h3 style="align-content: center">{{ Machine }} : 总装调试</h3>
        <el-row style="margin-top: 10px">
          <!--<el-col :span="8">-->
          <!--<div class="grid-content bg-purple" style="width: 99%; height: 340px; border: 1px solid #DCDFE6;text-align: center">-->
          <!--<div id="barDiv11" style="width:600px;height:350px; display: block; float: left"/>-->
          <!--</div>-->
          <!--</el-col>-->
          <el-col :span="24">
            <div class="grid-content bg-purple" style="width: 99%; height: 340px; border: 1px solid #DCDFE6;text-align: center">
              <el-table
                :data="tableDataDiv22"
                height="340"
                style="width: 100%"
                size="mini"
                stripe
                highlight-current-row
                border>
                <el-table-column
                  label="序号"
                  align="center"
                  type="index"
                  width="50"/>
                <el-table-column align="center" label="机床图号">
                  <template slot-scope="scope">
                    {{ scope.row.机床图号 ? scope.row.机床图号 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="机床名称">1
                  <template slot-scope="scope">
                    {{ scope.row.机床名称 ? scope.row.机床名称 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="总装开始时间">
                  <template slot-scope="scope">
                    {{ scope.row.机床装配实际开始时间 ? scope.row.机床装配实际开始时间 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="总装完成时间">
                  <template slot-scope="scope">
                    {{ scope.row.机床装配实际完成时间 ? scope.row.机床装配实际完成时间 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="调试开始时间">
                  <template slot-scope="scope">
                    {{ scope.row.调试开始时间 ? scope.row.调试开始时间 : '--' }}
                  </template>
                </el-table-column>
                <el-table-column align="center" label="调试完成时间">
                  <template slot-scope="scope">
                    {{ scope.row.调试结束时间 ? scope.row.调试结束时间 : '--' }}
                  </template>
                </el-table-column>
              </el-table>
            </div>
          </el-col>
        </el-row>
      </el-card>
    </div>
  </div>
</template>

<script>
import { SelectMachine, ProcessOutsourcing, ProcessProportion, searchMachine, searchAll } from '@/api/ManufacturingCenter/ParseQuery'
import request from '@/utils/request'
import echarts from 'echarts'
import Cookie from 'js-cookie'
export default {
  data() {
    return {
      Purchase: '',
      Machine: '',
      WorkPurchase: '',
      Outsourcing: '',
      Home: '',
      check: 0,
      color: [],
      disabled: true,
      machineValue: '', // 机床流水号
      machineValue1: '',
      searchCriteria: '', // 机床名称 V-model
      restaurants: [], // 机床名称数组
      showDiv0: true,
      showDiv1: false,
      showDiv2: false,
      showDiv3: false,
      showDiv4: false,
      showDiv5: false,
      showDiv6: false,
      showDiv7: false,
      showDiv8: false,
      showDiv9: false,
      showDiv10: false,
      showDiv11: false,
      showDiv12: false,
      showDiv13: false,
      showDiv14: false,
      showDiv15: false,
      showDiv23: false,
      showDiv16: false,
      showDiv17: false,
      showDiv18: false,
      showDiv19: false,
      showDiv20: false,
      showDiv21: false,
      showDiv22: false,
      valueDiv1: null, // div1 客户评级
      maxDiv1: 6, // div1 客户评级最大值
      loading0: false,
      tableDataDiv0: [],
      tableDataDiv2: [],
      tableDataDiv3: [],
      tableDataDiv4: [],
      tableDataDiv5: [],
      tableDataDiv6: [],
      tableDataDiv7: [],
      tableDataDiv8: [],
      tableDataDiv9A: [],
      tableDataDiv9B: [],
      tableDataDiv9C: [],
      tableDataDiv10: [],
      tableDataDiv11: [],
      tableDataDiv12: [],
      tableDataDiv13: [],
      tableDataDiv14: [],
      tableDataDiv15: [],
      tableDataDiv16A: [],
      tableDataDiv16B: [],
      tableDataDiv16C: [],
      tableDataDiv17A: [],
      tableDataDiv17B: [],
      tableDataDiv18: [],
      tableDataDiv19: [],
      tableDataDiv20: [],
      tableDataDiv21: [],
      tableDataDiv22: [],
      tableDataDiv23: [],
      dataDiv1: {
        付款方式: '无数据',
        付款方式代码: '无数据',
        价值评估: '无数据',
        价值评估流水号: '无数据',
        发货节点: '无数据',
        合同总金额: '无数据',
        合同签订日期: '无数据',
        合同编号: '无数据',
        姓名: '无数据',
        客户名称: '无数据',
        已支付: '无数据',
        电话: '无数据',
        联系人: '无数据',
        营销经理流水号: '无数据',
        项目名称: '无数据',
        项目流水号: '无数据',
        付款百分比: 0
      },
      data: [{
        签订合同百分比: 0,
        产品设计百分比: 0,
        零件分配百分比: 0,
        自制件百分比: 0,
        车间采购百分比: 0,
        采购部采购百分比: 0,
        自家备料百分比: 0,
        外购备料百分比: 0,
        工艺百分比: 0,
        定额百分比: 0,
        能力平衡百分比: 0,
        工序外协百分比: 0,
        车间加工百分比: 0,
        自制质检百分比: 0,
        采购质检百分比: 0,
        成组配套百分比: 0,
        电气装配百分比: 0,
        机械装配百分比: 0,
        冷作百分比: 0,
        油漆百分比: 0,
        装配质检百分比: 0,
        总装调试百分比: 0,
        发货百分比: 0
      }],
      data2: [{
        签订合同: 0,
        产品设计: 0,
        零件分配: 0,
        自制件: 0,
        车间采购: 0,
        采购部采购: 0,
        自家备料: 0,
        外购备料: 0,
        工艺定额: 0,
        能力平衡: 0,
        外协: 0,
        车间加工: 0,
        自制质检: '-',
        采购质检: '-',
        成组配套: 0,
        电气装配: 0,
        机械装配: 0,
        冷作: 0,
        油漆: 0,
        装配质检: '-',
        总装调试: '-',
        发货: 0
      }],
      isActive: false,
      dataDiv2: {
        组件总数: '',
        整改组数: '',
        负责人: '',
        data: []
      },
      dataDiv3: {
        xData: [],
        yDataA: [],
        yDataB: []
      },
      dataDiv4: {
        xData: [],
        yDataA: [],
        yDataB: []
      },
      dataDiv5: {
        data1: null,
        data2: null,
        data3: null,
        data4: [],
        length: null
      },
      dataDiv6: {
        data1: null,
        data2: null,
        data3: null,
        data4: [],
        length: null
      },
      dataDiv7: {
        data1: null,
        data2: null,
        data3: null,
        data4: [],
        length: null
      },
      dataDiv8: {
        data1: null,
        data2: null,
        data3: null,
        data4: [],
        length: null
      },
      dataDiv10: {
        data: []
      },
      dataDiv11: {
        xData: [],
        yDataA: [],
        yDataB: []
      },
      dataDiv13: {
        xData: [],
        yDataA: [],
        yDataB: []
      },
      dataDiv14: {
        xData: [],
        yDataA: [],
        yDataB: []
      },
      dataDiv15: {
        xData: [],
        yDataA: [],
        yDataB: []
      },
      dataDiv18: {
        xData: [],
        yDataA: []
      }
    }
  },
  created() {
    this.SearchMachine1()
  },
  methods: {
    // 跳转到零件分配
    turnToPartAs(row) {
      if (row.总未分配个数 > 0 && row.总个数 > 0) {
        Cookie.set('machineValue', this.machineValue1)
        Cookie.set('group', row.组件流水号)
        this.$router.push('/ManufacturingCenter/PartAssignment')
      }
    },
    // 跳转到生产能力平衡
    turnToPCB(row) {
      if (row.完成状态 !== '已完成') {
        this.$router.push('/ManufacturingCenter/ProductionCapacityBalance')
      }
    },
    // 跳转到加工进度查询
    turnToProStatus(row) {
      if (!row.实际完成时间) {
        Cookie.set('machineValue', this.machineValue1)
        Cookie.set('group', row.组件流水号)
        this.$router.push('/ManufacturingCenter/ProcessingStatus')
      }
    },
    // 跳转到生产计划下达
    turnIniPro(row) {
      if ((parseInt(row.自家加工件总条数) - parseInt(row.已传递条数)) > 0 && parseInt(row.自家加工件总条数) !== 0) {
        Cookie.set('machineValue', this.machineValue1)
        Cookie.set('group', row.组件流水号)
        this.$router.push('/ManufacturingCenter/InitialProduction')
      }
    },
    // 跳转到备料完成
    turnMaterArrMan(row) {
      if (row.状态 !== '完成') {
        Cookie.set('machineValue', this.machineValue1)
        Cookie.set('group', row.组件流水号)
        this.$router.push('/ManufacturingCenter/MaterialArrivalManagement')
      }
    },
    chaxun() {
      this.showDiv0 = true
      this.showDiv1 = false
      this.showDiv2 = false
      this.showDiv3 = false
      this.showDiv4 = false
      this.showDiv5 = false
      this.showDiv6 = false
      this.showDiv7 = false
      this.showDiv8 = false
      this.showDiv9 = false
      this.showDiv10 = false
      this.showDiv11 = false
      this.showDiv12 = false
      this.showDiv13 = false
      this.showDiv14 = false
      this.showDiv15 = false
      this.showDiv16 = false
      this.showDiv17 = false
      this.showDiv18 = false
      this.showDiv19 = false
      this.showDiv20 = false
      this.showDiv21 = false
      this.showDiv22 = false
      this.showDiv23 = false
    },
    changeScroll1() {
      const div1 = document.getElementById('div1')
      const div2 = document.getElementById('div2')
      const div3 = document.getElementById('div3')
      div2.removeAttribute('onscroll')
      div3.removeAttribute('onscroll')
      div1.setAttribute('onscroll', 'document.getElementById(\'div2\').scrollTop = scrollTop;document.getElementById(\'div3\').scrollTop = scrollTop')
    },
    changeScroll2() {
      const div1 = document.getElementById('div1')
      const div2 = document.getElementById('div2')
      const div3 = document.getElementById('div3')
      div1.removeAttribute('onscroll')
      div3.removeAttribute('onscroll')
      div2.setAttribute('onscroll', 'document.getElementById(\'div1\').scrollTop = scrollTop;document.getElementById(\'div3\').scrollTop = scrollTop')
    },
    changeScroll3() {
      const div1 = document.getElementById('div1')
      const div2 = document.getElementById('div2')
      const div3 = document.getElementById('div3')
      div2.removeAttribute('onscroll')
      div1.removeAttribute('onscroll')
      div3.setAttribute('onscroll', 'document.getElementById(\'div2\').scrollTop = scrollTop;document.getElementById(\'div1\').scrollTop = scrollTop')
    },
    // 百分数转换
    percent(row) {
      const a = parseInt(row.总个数) - parseInt(row.总未分配个数)
      const b = parseInt(row.总个数)
      return b !== 0 ? (a / b * 100).toFixed(2) : 0
    },
    // 清空查询条件
    clearMachine() {
      this.machineValue = ''
      this.machineValue1 = ''
      this.disabled = true
      this.showDiv0 = true
      this.showDiv1 = false
      this.showDiv2 = false
      this.showDiv3 = false
      this.showDiv4 = false
      this.showDiv5 = false
      this.showDiv6 = false
      this.showDiv7 = false
      this.showDiv8 = false
      this.showDiv9 = false
      this.showDiv10 = false
      this.showDiv11 = false
      this.showDiv12 = false
      this.showDiv13 = false
      this.showDiv14 = false
      this.showDiv15 = false
      this.showDiv23 = false
      this.showDiv16 = false
      this.showDiv17 = false
      this.showDiv18 = false
      this.showDiv19 = false
      this.showDiv20 = false
      this.showDiv21 = false
      this.showDiv22 = false
      this.isActive = false
      this.data2[0].签订合同 = 0
      this.data2[0].产品设计 = 0
      this.data2[0].零件分配 = 0
      this.data2[0].自制件 = 0
      this.data2[0].车间采购 = 0
      this.data2[0].采购部采购 = 0
      this.data2[0].自家备料 = 0
      this.data2[0].外购备料 = 0
      this.data2[0].工艺定额 = 0
      this.data2[0].能力平衡 = 0
      this.data2[0].外协 = 0
      this.data2[0].车间加工 = 0
      this.data2[0].自制质检 = 0
      this.data2[0].采购质检 = 0
      this.data2[0].成组配套 = 0
      this.data2[0].电气装配 = 0
      this.data2[0].机械装配 = 0
      this.data2[0].冷作 = 0
      this.data2[0].油漆 = 0
      this.data2[0].装配质检 = 0
      this.SearchMachine1()
      // this.machineValue ? this.check = 1 : this.check = 0
      // searchMachine(this.check, this.machineValue).then(response => {
      //   this.tableDataDiv0 = response.data
      // })
    },
    // 机床名称查询函数
    querySearch(queryString, cb) {
      this.restaurants = []
      if (this.searchCriteria !== '' && this.searchCriteria !== null) {
        SelectMachine(this.searchCriteria).then(response => {
          const res = response.data
          res.forEach(item => {
            this.restaurants.push({
              value: item.货品编号,
              num: item.机床流水号
            })
          })
          return this.restaurants
        }).then(data => {
          var restaurants = data
          var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants
          return results
        }).then(data => {
          // 调用 callback 返回建议列表的数据
          cb(data)
        })
      }
    },
    // 机床名称实时请求查询匹配函数
    createFilter(queryString) {
      return (restaurant) => {
        return (restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) !== -1)
        // !== -1为全字匹配  === 0为首字匹配
      }
    },
    SearchMachine1() {
      this.machineValue ? this.check = 1 : this.check = 0
      this.loading0 = true
      searchMachine(this.check, this.machineValue).then(response => {
        this.tableDataDiv0 = response.data
        this.loading0 = false
      })
    },
    SearchMachine(item) {
      this.machineValue = item.num
      this.machineValue ? this.check = 1 : this.check = 0
      searchMachine(this.check, this.machineValue).then(response => {
        this.tableDataDiv0 = response.data
      })
    },
    // 选择机床名称后的赋值函数
    async handleSelect(row) {
      // 在此方法中可以把下拉框选中值中的内容赋值给其他变量使用
      this.machineValue1 = row.机床流水号
      this.Machine = row.机床图号
      this.machineValue1 ? this.disabled = false : this.disabled = true
      this.showDiv1 = false
      this.showDiv2 = false
      this.showDiv3 = false
      this.showDiv4 = false
      this.showDiv5 = false
      this.showDiv6 = false
      this.showDiv7 = false
      this.showDiv8 = false
      this.showDiv9 = false
      this.showDiv10 = false
      this.showDiv11 = false
      this.showDiv12 = false
      this.showDiv13 = false
      this.showDiv14 = false
      this.showDiv15 = false
      this.showDiv23 = false
      this.showDiv16 = false
      this.showDiv17 = false
      this.showDiv18 = false
      this.showDiv19 = false
      this.showDiv20 = false
      this.showDiv0 = true
      await searchAll(this.machineValue1).then(response => {
        this.isActive = true
        if (response.data[0].自制质检 === '') {
          response.data[0].自制质检 = '-'
        }
        if (response.data[0].采购质检 === '') {
          response.data[0].采购质检 = '-'
        }
        if (response.data[0].装配质检 === '') {
          response.data[0].装配质检 = '-'
        }
        if (response.data[0].总装调试 === '1900-01-01 00:00:00') {
          response.data[0].总装调试 = '-'
        } else {
          response.data[0].总装调试 = response.data[0].总装调试.substring(5, 10)
        }
        if (response.data[0].机床装配实际完成时间 === '1900-01-01 00:00:00') {
          response.data[0].机床装配实际完成时间 = '-'
        } else {
          response.data[0].机床装配实际完成时间 = response.data[0].机床装配实际完成时间.substring(5, 10)
        }
        this.data2 = response.data
        if (response.data[0].签订合同 === 0) { this.color[0] = 'weikaishi' } else if (response.data[0].签订合同 !== 0 && response.data[0].签订合同 !== 100) { this.color[0] = 'jixingzhong' } else if (response.data[0].签订合同 === 100) { this.color[0] = 'yiwancheng' }
        if (response.data[0].产品设计 === 0) { this.color[1] = 'weikaishi' } else if (response.data[0].产品设计 !== 0 && response.data[0].产品设计 !== 100) { this.color[1] = 'jixingzhong' } else if (response.data[0].产品设计 === 100) { this.color[1] = 'yiwancheng' }
        if (response.data[0].零件分配 === 0) { this.color[2] = 'weikaishi' } else if (response.data[0].零件分配 !== 0 && response.data[0].零件分配 !== 100) { this.color[2] = 'jixingzhong' } else if (response.data[0].零件分配 === 100) { this.color[2] = 'yiwancheng' }
        if (response.data[0].自制件 === 0) { this.color[3] = 'weikaishi' } else if (response.data[0].自制件 !== 0 && response.data[0].自制件 !== 100) { this.color[3] = 'jixingzhong' } else if (response.data[0].自制件 === 100) { this.color[3] = 'yiwancheng' }
        if (response.data[0].采购部采购 === 0) { this.color[4] = 'weikaishi' } else if (response.data[0].采购部采购 !== 0 && response.data[0].采购部采购 !== 100) { this.color[4] = 'jixingzhong' } else if (response.data[0].采购部采购 === 100) { this.color[4] = 'yiwancheng' }
        if (response.data[0].车间采购 === 0) { this.color[5] = 'weikaishi' } else if (response.data[0].车间采购 !== 0 && response.data[0].车间采购 !== 100) { this.color[5] = 'jixingzhong' } else if (response.data[0].车间采购 === 100) { this.color[5] = 'yiwancheng' }
        if (response.data[0].外购备料 === 0) { this.color[6] = 'weikaishi' } else if (response.data[0].外购备料 !== 0 && response.data[0].外购备料 !== 100) { this.color[6] = 'jixingzhong' } else if (response.data[0].外购备料 === 100) { this.color[6] = 'yiwancheng' }
        if (response.data[0].自家备料 === 0) { this.color[7] = 'weikaishi' } else if (response.data[0].自家备料 !== 0 && response.data[0].自家备料 !== 100) { this.color[7] = 'jixingzhong' } else if (response.data[0].自家备料 === 100) { this.color[7] = 'yiwancheng' }
        if (response.data[0].工艺定额 === 0) { this.color[8] = 'weikaishi' } else if (response.data[0].工艺定额 !== 0 && response.data[0].工艺定额 !== 100) { this.color[8] = 'jixingzhong' } else if (response.data[0].工艺定额 === 100) { this.color[8] = 'yiwancheng' }
        if (response.data[0].能力平衡 === 0) { this.color[10] = 'weikaishi' } else if (response.data[0].能力平衡 !== 0 && response.data[0].能力平衡 !== 100) { this.color[10] = 'jixingzhong' } else if (response.data[0].能力平衡 === 100) { this.color[10] = 'yiwancheng' }
        if (response.data[0].外协 === 0) { this.color[11] = 'weikaishi' } else if (response.data[0].外协 !== 0 && response.data[0].外协 !== 100) { this.color[11] = 'jixingzhong' } else if (response.data[0].外协 === 100) { this.color[11] = 'yiwancheng' }
        if (response.data[0].车间加工 === 0) { this.color[12] = 'weikaishi' } else if (response.data[0].车间加工 !== 0 && response.data[0].车间加工 !== 100) { this.color[12] = 'jixingzhong' } else if (response.data[0].车间加工 === 100) { this.color[12] = 'yiwancheng' }
        if (response.data[0].采购质检 === 11111111) { this.color[13] = 'weikaishi' } else { this.color[13] = 'jixingzhong' }
        if (response.data[0].自制质检 === 11111111) { this.color[14] = 'weikaishi' } else { this.color[14] = 'jixingzhong' }
        if (response.data[0].成组配套 === 0) { this.color[15] = 'weikaishi' } else if (response.data[0].成组配套 !== 0 && response.data[0].成组配套 !== 100) { this.color[15] = 'jixingzhong' } else if (response.data[0].成组配套 === 100) { this.color[15] = 'yiwancheng' }
        if (response.data[0].油漆 === 0) { this.color[16] = 'weikaishi' } else if (response.data[0].油漆 !== 0 && response.data[0].油漆 !== 100) { this.color[16] = 'jixingzhong' } else if (response.data[0].油漆 === 100) { this.color[16] = 'yiwancheng' }
        if (response.data[0].冷作 === 0) { this.color[17] = 'weikaishi' } else if (response.data[0].冷作 !== 0 && response.data[0].冷作 !== 100) { this.color[17] = 'jixingzhong' } else if (response.data[0].冷作 === 100) { this.color[17] = 'yiwancheng' }
        if (response.data[0].机械装配 === 0) { this.color[18] = 'weikaishi' } else if (response.data[0].机械装配 !== 0 && response.data[0].机械装配 !== 100) { this.color[18] = 'jixingzhong' } else if (response.data[0].机械装配 === 100) { this.color[18] = 'yiwancheng' }
        if (response.data[0].电气装配 === 0) { this.color[19] = 'weikaishi' } else if (response.data[0].电气装配 !== 0 && response.data[0].电气装配 !== 100) { this.color[19] = 'jixingzhong' } else if (response.data[0].电气装配 === 100) { this.color[19] = 'yiwancheng' }
        if (response.data[0].装配质检 === 11111111) { this.color[20] = 'weikaishi' } else { this.color[20] = 'jixingzhong' }
        if (response.data[0].总装调试状态 === 0) { this.color[21] = 'weikaishi' } else if (response.data[0].总装调试状态 === 1) { this.color[21] = 'jixingzhong' } else if (response.data[0].总装调试状态 === 2) { this.color[21] = 'yiwancheng' }
        if (response.data[0].发货状态 === 0) { this.color[22] = 'weikaishi' } else if (response.data[0].发货状态 === 1) { this.color[22] = 'jixingzhong' } else if (response.data[0].发货状态 === 2) { this.color[22] = 'yiwancheng' }
      })
    },
    // 查询签订合同div数据
    async searchDiv1() {
      this.showDiv0 = false
      this.showDiv1 = true
      this.showDiv2 = false
      this.showDiv3 = false
      this.showDiv4 = false
      this.showDiv5 = false
      this.showDiv6 = false
      this.showDiv7 = false
      this.showDiv8 = false
      this.showDiv9 = false
      this.showDiv10 = false
      this.showDiv11 = false
      this.showDiv12 = false
      this.showDiv13 = false
      this.showDiv14 = false
      this.showDiv15 = false
      this.showDiv23 = false
      this.showDiv16 = false
      this.showDiv17 = false
      this.showDiv18 = false
      this.showDiv19 = false
      this.showDiv20 = false
      this.showDiv21 = false
      this.showDiv22 = false
      await request({
        url: '',
        method: 'post',
        data: {
          type: '3',
          name: `select 项目流水号 from PDM_机床名称 where 机床流水号 = ${this.machineValue1}`
        }
      }).then(res => {
        request({
          url: '',
          method: 'post',
          data: {
            type: '3',
            name: `select * from 综合查询_签订合同模块信息视图 where 项目流水号 = ${res.data[0].项目流水号}`
          }
        }).then(res => {
          this.dataDiv1.付款方式 = res.data[0].付款方式
          this.dataDiv1.付款方式代码 = res.data[0].付款方式代码
          this.dataDiv1.价值评估 = res.data[0].价值评估
          this.dataDiv1.价值评估流水号 = res.data[0].价值评估流水号
          this.dataDiv1.发货节点 = res.data[0].发货节点
          res.data[0].合同总金额 !== '' && res.data[0].合同总金额 !== null ? this.dataDiv1.合同总金额 = res.data[0].合同总金额 + '万元' : this.dataDiv1.合同总金额 = '无数据'
          this.dataDiv1.合同签订日期 = res.data[0].合同签订日期
          this.dataDiv1.合同编号 = res.data[0].合同编号
          this.dataDiv1.姓名 = res.data[0].姓名
          this.dataDiv1.客户名称 = res.data[0].客户名称
          res.data[0].已支付 !== '' && res.data[0].已支付 !== null ? this.dataDiv1.已支付 = res.data[0].已支付 + '万元' : this.dataDiv1.已支付 = '无数据'
          res.data[0].电话 !== '' && res.data[0].电话 !== null ? this.dataDiv1.电话 = res.data[0].电话 : this.dataDiv1.电话 = '无数据'
          this.dataDiv1.联系人 = res.data[0].联系人
          this.dataDiv1.营销经理流水号 = res.data[0].营销经理流水号
          this.dataDiv1.项目名称 = res.data[0].项目名称
          this.dataDiv1.项目流水号 = res.data[0].项目流水号
          res.data[0].付款百分比 !== '' && res.data[0].付款百分比 !== null ? this.dataDiv1.付款百分比 = res.data[0].付款百分比 : this.dataDiv1.付款百分比 = 0
          if (res.data[0].价值评估 === '高') {
            this.valueDiv1 = 6
          } else if (res.data[0].价值评估 === '中') {
            this.valueDiv1 = 3
          } else {
            this.valueDiv1 = 1
          }
        })
      })
    },
    // 查询产品设计div数据
    async searchDiv2() {
      this.dataDiv2.data = []
      this.showDiv0 = false
      this.showDiv1 = false
      this.showDiv2 = true
      this.showDiv3 = false
      this.showDiv4 = false
      this.showDiv5 = false
      this.showDiv6 = false
      this.showDiv7 = false
      this.showDiv8 = false
      this.showDiv9 = false
      this.showDiv10 = false
      this.showDiv11 = false
      this.showDiv12 = false
      this.showDiv13 = false
      this.showDiv14 = false
      this.showDiv15 = false
      this.showDiv23 = false
      this.showDiv16 = false
      this.showDiv17 = false
      this.showDiv18 = false
      this.showDiv19 = false
      this.showDiv20 = false
      this.showDiv21 = false
      this.showDiv22 = false
      await request({
        url: '',
        method: 'post',
        data: {
          type: '3',
          name: `exec 项目计划管理_项目详细计划_查询数据 @机床流水号=${this.machineValue1},@计划类型 = 1`
        }
      }).then(res => {
        this.tableDataDiv2 = res.data
        if (this.tableDataDiv2.length !== 0) {
          this.dataDiv2.负责人 = res.data[0].负责人
        }
        request({
          url: '',
          method: 'post',
          data: {
            type: '3',
            name: `select count(*) from PDM_组件名称 where 机床流水号=${this.machineValue1} and 组号 <> '00组'`
          }
        }).then(res => {
          this.dataDiv2.组件总数 = res.data[0].Column1
          request({
            url: '',
            method: 'post',
            data: {
              type: '3',
              name: `select count(*) from PDM_组件名称 where 机床流水号=${this.machineValue1} and 组号 like '9%'`
            }
          }).then(res => {
            this.dataDiv2.整改组数 = res.data[0].Column1
            request({
              url: '',
              method: 'post',
              data: {
                type: '3',
                name: `select count(*) from 项目计划管理_组件计划_视图 where 机床流水号 = ${this.machineValue1} and 计划类型 = 1 and 实际完成时间 is not null`
              }
            }).then(res => {
              if (parseInt(this.dataDiv2.整改组数) !== 0) {
                this.dataDiv2.data.push({
                  value: this.dataDiv2.整改组数,
                  name: '整改组件'
                })
              }
              if (parseInt(res.data[0].Column1) !== 0) {
                this.dataDiv2.data.push({
                  value: res.data[0].Column1,
                  name: '已完成组件'
                })
              }
              if (parseInt(this.dataDiv2.组件总数) - parseInt(this.dataDiv2.整改组数) - parseInt(res.data[0].Column1) !== 0) {
                this.dataDiv2.data.push({
                  value: parseInt(this.dataDiv2.组件总数) - parseInt(this.dataDiv2.整改组数) - parseInt(res.data[0].Column1),
                  name: '未完成组件'
                })
              }
            }).then(() => {
              this.drawLineDiv2()
            })
          })
        })
      })
    },
    // 绘制品设计饼状图
    drawLineDiv2() {
      const bar = echarts.init(document.getElementById('barDiv1'))
      // 指定图表的配置项和数据
      bar.setOption({
        // title : {
        //   text: '某站点用户访问来源',
        //   subtext: '纯属虚构',
        //   x:'center'
        // },
        tooltip: {
          trigger: 'item',
          formatter: '{a} <br/>{b} : {c} ({d}%)'
        },
        // legend: {
        //   orient: 'vertical',
        //   left: 'left',
        //   data: ['直接访问','邮件营销','联盟广告','视频广告','搜索引擎']
        // },
        series: [
          {
            name: '组件类型比例',
            type: 'pie',
            radius: '55%',
            center: ['50%', '40%'],
            data: this.dataDiv2.data,
            itemStyle: {
              emphasis: {
                shadowBlur: 10,
                shadowOffsetX: 0,
                shadowColor: 'rgba(0, 0, 0, 0.5)'
              },
              normal: {
                color: function(params) {
                  var colorList = [
                    'gray', '#ff9759', '#7eaced'
                  ]
                  return colorList[params.dataIndex]
                }
              }
            }
          }
        ]
      })
    },
    // 查询零件分配div数据
    async searchDiv3() {
      this.showDiv0 = false
      this.showDiv1 = false
      this.showDiv2 = false
      this.showDiv3 = true
      this.showDiv4 = false
      this.showDiv5 = false
      this.showDiv6 = false
      this.showDiv7 = false
      this.showDiv8 = false
      this.showDiv9 = false
      this.showDiv10 = false
      this.showDiv11 = false
      this.showDiv12 = false
      this.showDiv13 = false
      this.showDiv14 = false
      this.showDiv15 = false
      this.showDiv23 = false
      this.showDiv16 = false
      this.showDiv17 = false
      this.showDiv18 = false
      this.showDiv19 = false
      this.showDiv20 = false
      this.showDiv21 = false
      this.showDiv22 = false
      this.dataDiv3.yDataB = []
      this.dataDiv3.yDataA = []
      this.dataDiv3.xData = []
      await request({
        url: '',
        method: 'post',
        data: {
          type: '3',
          name: `select 综合查询_零件分配模块信息视图.*
                ,isnull(基本件个数,0) as 基本件个数
                ,isnull(外购件个数,0) as 外购件个数
                ,(isnull(基本件个数,0) + isnull(外购件个数,0)) as 总个数
                ,isnull(基本件未分配个数,0) as 基本件未分配个数
                ,isnull(外购件未分配个数,0) as 外购件未分配个数
                ,(isnull(基本件未分配个数,0) + isnull(外购件未分配个数,0)) as 总未分配个数
                from 综合查询_零件分配模块信息视图
                left join (select 组件流水号,count(*) as 基本件个数
                from PDM_零件明细表_基本件 group by 组件流水号) as a on 综合查询_零件分配模块信息视图.组件流水号 = a.组件流水号
                left join (select 组件流水号,count(*) as 外购件个数
                from PDM_零件明细表_标准件和外购件 group by 组件流水号) as b on 综合查询_零件分配模块信息视图.组件流水号 = b.组件流水号
                left join (select 组件流水号,count(*) as 基本件未分配个数
                from PDM_零件明细表_基本件 where 是否采购 = 0 and 是否传递 = 0 and 是否启用 = 0 group by 组件流水号) as c on 综合查询_零件分配模块信息视图.组件流水号 = c.组件流水号
                left join (select 组件流水号,count(*) as 外购件未分配个数
                from PDM_零件明细表_标准件和外购件 where 是否车间采购 = 0 group by 组件流水号) as d on 综合查询_零件分配模块信息视图.组件流水号 = d.组件流水号
                where 机床流水号 = ${this.machineValue1} and 组号 <> '00组' order by 组号`
        }
      }).then(res => {
        this.tableDataDiv3 = res.data
        for (let i = 0; i < res.data.length; i++) {
          this.dataDiv3.xData.push(res.data[i].组号)
          this.dataDiv3.yDataA.push(res.data[i].总个数)
          this.dataDiv3.yDataB.push(parseInt(res.data[i].总个数) - parseInt(res.data[i].总未分配个数))
        }
        this.drawLineDiv3()
      })
    },
    // 绘制零件分配条形图
    drawLineDiv3() {
      const bar = echarts.init(document.getElementById('barDiv3'))
      // 指定图表的配置项和数据
      bar.setOption({
        tooltip: {},
        legend: {
          data: ['零件总条数', '已分配条数']
        },
        xAxis: {
          data: this.dataDiv3.xData,
          show: true
        },
        yAxis: {},
        series: [{
          name: '零件总条数',
          type: 'bar',
          data: this.dataDiv3.yDataA
        },
        {
          name: '已分配条数',
          type: 'bar',
          data: this.dataDiv3.yDataB
        }]
      })
    },
    // 查询自制件div数据
    async searchDiv4() {
      this.showDiv0 = false
      this.showDiv1 = false
      this.showDiv2 = false
      this.showDiv3 = false
      this.showDiv4 = true
      this.showDiv5 = false
      this.showDiv6 = false
      this.showDiv7 = false
      this.showDiv8 = false
      this.showDiv9 = false
      this.showDiv10 = false
      this.showDiv11 = false
      this.showDiv12 = false
      this.showDiv13 = false
      this.showDiv14 = false
      this.showDiv15 = false
      this.showDiv23 = false
      this.showDiv16 = false
      this.showDiv17 = false
      this.showDiv18 = false
      this.showDiv19 = false
      this.showDiv20 = false
      this.showDiv21 = false
      this.showDiv22 = false
      this.tableDataDiv4 = []
      this.dataDiv4.xData = []
      this.dataDiv4.yDataB = []
      this.dataDiv4.yDataA = []
      await request({
        url: '',
        method: 'post',
        data: {
          type: '3',
          name: `select 综合查询_零件分配模块信息视图.*,
                  isnull(自家加工件总条数,0) as 自家加工件总条数
                  ,isnull(已传递条数,0) as 已传递条数
                  from 综合查询_零件分配模块信息视图
                  left join (select 组件流水号,COUNT(*) as 自家加工件总条数
                  from 车间生产管理工艺_零件工序_投产信息_查询视图 group by 组件流水号) as a
                  on 综合查询_零件分配模块信息视图.组件流水号 = a.组件流水号
                  left join (select 组件流水号,count(*) as 已传递条数
                  from 车间生产管理工艺_零件工序_投产信息_查询视图 where 是否传递 = 2 group by 组件流水号) as b
                  on 综合查询_零件分配模块信息视图.组件流水号 = b.组件流水号
                  where 机床流水号 = ${this.machineValue1} and 组号 <> '00组' order by 组号`
        }
      }).then(res => {
        this.tableDataDiv4 = res.data
        for (let i = 0; i < res.data.length; i++) {
          this.dataDiv4.xData.push(res.data[i].组号)
          this.dataDiv4.yDataA.push(res.data[i].自家加工件总条数)
          this.dataDiv4.yDataB.push(res.data[i].已传递条数)
        }
        this.drawLineDiv4Bar()
      })
    },
    // 绘制自制件div条形图
    drawLineDiv4Bar() {
      const bar = echarts.init(document.getElementById('barDiv4'))
      this.tableData = [50, 15, 20, 30, 45, 46]
      // 指定图表的配置项和数据
      bar.setOption({
        tooltip: {
          trigger: 'axis',
          axisPointer: {
            type: 'shadow'
          }
        },
        legend: {
          data: ['总条数', '已投产']
        },
        grid: {
          left: '3%',
          right: '4%',
          bottom: '3%',
          containLabel: true
        },
        yAxis: {
          type: 'value',
          boundaryGap: [0, 0.01]
        },
        xAxis: {
          type: 'category',
          data: this.dataDiv4.xData
        },
        series: [
          {
            name: '总条数',
            type: 'bar',
            data: this.dataDiv4.yDataA
          },
          {
            name: '已投产',
            type: 'bar',
            data: this.dataDiv4.yDataB
          }
        ]
      })
    },
    // 查询自制件div数据
    async searchDiv5() {
      this.showDiv0 = false
      this.showDiv1 = false
      this.showDiv2 = false
      this.showDiv3 = false
      this.showDiv4 = false
      this.showDiv5 = true
      this.showDiv6 = false
      this.showDiv7 = false
      this.showDiv8 = false
      this.showDiv9 = false
      this.showDiv10 = false
      this.showDiv11 = false
      this.showDiv12 = false
      this.showDiv13 = false
      this.showDiv14 = false
      this.showDiv15 = false
      this.showDiv23 = false
      this.showDiv16 = false
      this.showDiv17 = false
      this.showDiv18 = false
      this.showDiv19 = false
      this.showDiv20 = false
      this.showDiv21 = false
      this.showDiv22 = false
      this.dataDiv5.data4 = []
      await request({
        url: '',
        method: 'post',
        data: {
          type: '3',
          name: ` select * from 车间管理_工作计划 where 机床流水号 = ${this.machineValue1} and 计划类型 = 1 `
        }
      }).then(res => {
        this.tableDataDiv5 = res.data
        this.dataDiv5.length = res.data.length
        request({
          url: '',
          method: 'post',
          data: {
            type: '3',
            name: `select COUNT(*) as 进行中 from  车间管理_工作计划 where 计划类型 = 1 and (开始时间 is not null and 开始时间 <> '') and (结束时间 is null or 结束时间 = '') and 机床流水号 = ${this.machineValue1}`
          }
        }).then(res => {
          this.dataDiv5.data1 = res.data[0].进行中
          if (res.data[0].进行中 !== 0) {
            this.dataDiv5.data4.push({
              value: res.data[0].进行中,
              name: '装配进行中'
            })
          }
        }).then(() => {
          request({
            url: '',
            method: 'post',
            data: {
              type: '3',
              name: ` select COUNT(*) as 已完成 from  车间管理_工作计划 where 计划类型 = 1 and 开始时间 is not null and 开始时间 <> '' and 结束时间 is not null and 结束时间 <> '' and 机床流水号 = ${this.machineValue1}`
            }
          }).then(res => {
            this.dataDiv5.data2 = res.data[0].已完成
            if (res.data[0].已完成 !== 0) {
              this.dataDiv5.data4.push({
                value: res.data[0].已完成,
                name: '装配已完成'
              })
            }
          }).then(() => {
            this.dataDiv5.data3 = parseInt(this.dataDiv5.length - this.dataDiv5.data1 - this.dataDiv5.data2)
          }).then(() => {
            if (parseInt(this.dataDiv5.data3) !== 0) {
              this.dataDiv5.data4.push({
                value: this.dataDiv5.data3,
                name: '无计划/未开始'
              })
            }
            this.drawLineDiv5()
          })
        })
      })
    },
    // 绘制机械装配div饼图
    drawLineDiv5() {
      const bar = echarts.init(document.getElementById('barDiv5'))
      this.tableData = [50, 15, 20, 30, 45, 46]
      // 指定图表的配置项和数据
      bar.setOption({
        tooltip: {
          trigger: 'item',
          formatter: '{a} <br/>{b} : {c} ({d}%)'
        },
        legend: {
          orient: 'vertical',
          left: 'left',
          data: ['装配已完成', '装配进行中', '无计划/未开始']
        },
        series: [
          {
            name: '状态比例',
            type: 'pie',
            radius: '55%',
            center: ['50%', '45%'],
            data: this.dataDiv5.data4,
            itemStyle: {
              emphasis: {
                shadowBlur: 10,
                shadowOffsetX: 0,
                shadowColor: 'rgba(0, 0, 0, 0.5)'
              }
            }
          }
        ]
      })
    },
    // 查询电气装配div数据
    async searchDiv6() {
      this.showDiv0 = false
      this.showDiv1 = false
      this.showDiv2 = false
      this.showDiv3 = false
      this.showDiv4 = false
      this.showDiv5 = false
      this.showDiv6 = true
      this.showDiv7 = false
      this.showDiv8 = false
      this.showDiv9 = false
      this.showDiv10 = false
      this.showDiv11 = false
      this.showDiv12 = false
      this.showDiv13 = false
      this.showDiv14 = false
      this.showDiv15 = false
      this.showDiv23 = false
      this.showDiv16 = false
      this.showDiv17 = false
      this.showDiv18 = false
      this.showDiv19 = false
      this.showDiv20 = false
      this.showDiv21 = false
      this.showDiv22 = false
      this.dataDiv6.data4 = []
      await request({
        url: '',
        method: 'post',
        data: {
          type: '3',
          name: ` select * from 车间管理_工作计划 where 机床流水号 = ${this.machineValue1} and 计划类型 = 2 `
        }
      }).then(res => {
        this.tableDataDiv6 = res.data
        this.dataDiv6.length = res.data.length
        request({
          url: '',
          method: 'post',
          data: {
            type: '3',
            name: `select COUNT(*) as 进行中 from  车间管理_工作计划 where 计划类型 = 2 and (开始时间 is not null and 开始时间 <> '') and (结束时间 is null or 结束时间 = '') and 机床流水号 = ${this.machineValue1}`
          }
        }).then(res => {
          this.dataDiv6.data1 = res.data[0].进行中
          if (res.data[0].进行中 !== 0) {
            this.dataDiv6.data4.push({
              value: res.data[0].进行中,
              name: '装配进行中'
            })
          }
        }).then(() => {
          request({
            url: '',
            method: 'post',
            data: {
              type: '3',
              name: ` select COUNT(*) as 已完成 from  车间管理_工作计划 where 计划类型 = 2 and 开始时间 is not null and 开始时间 <> '' and 结束时间 is not null and 结束时间 <> '' and 机床流水号 = ${this.machineValue1}`
            }
          }).then(res => {
            this.dataDiv6.data2 = res.data[0].已完成
            if (res.data[0].已完成 !== 0) {
              this.dataDiv6.data4.push({
                value: res.data[0].已完成,
                name: '装配已完成'
              })
            }
          }).then(() => {
            this.dataDiv6.data3 = parseInt(this.dataDiv6.length - this.dataDiv6.data1 - this.dataDiv6.data2)
          }).then(() => {
            if (parseInt(this.dataDiv6.data3) !== 0) {
              this.dataDiv6.data4.push({
                value: this.dataDiv6.data3,
                name: '无计划/未开始'
              })
            }
            this.drawLineDiv6()
          })
        })
      })
    },
    // 绘制电气装配div饼图
    drawLineDiv6() {
      const bar = echarts.init(document.getElementById('barDiv6'))
      // 指定图表的配置项和数据
      bar.setOption({
        tooltip: {
          trigger: 'item',
          formatter: '{a} <br/>{b} : {c} ({d}%)'
        },
        legend: {
          orient: 'vertical',
          left: 'left',
          data: ['装配已完成', '装配进行中', '无计划/未开始']
        },
        series: [
          {
            name: '状态比例',
            type: 'pie',
            radius: '55%',
            center: ['50%', '45%'],
            data: this.dataDiv6.data4,
            itemStyle: {
              emphasis: {
                shadowBlur: 10,
                shadowOffsetX: 0,
                shadowColor: 'rgba(0, 0, 0, 0.5)'
              }
            }
          }
        ]
      })
    },
    // 查询冷作计划div数据
    async searchDiv7() {
      this.showDiv0 = false
      this.showDiv1 = false
      this.showDiv2 = false
      this.showDiv3 = false
      this.showDiv4 = false
      this.showDiv5 = false
      this.showDiv6 = false
      this.showDiv7 = true
      this.showDiv8 = false
      this.showDiv9 = false
      this.showDiv10 = false
      this.showDiv11 = false
      this.showDiv12 = false
      this.showDiv13 = false
      this.showDiv14 = false
      this.showDiv15 = false
      this.showDiv23 = false
      this.showDiv16 = false
      this.showDiv17 = false
      this.showDiv18 = false
      this.showDiv19 = false
      this.showDiv20 = false
      this.showDiv21 = false
      this.showDiv22 = false
      this.dataDiv7.data4 = []
      await request({
        url: '',
        method: 'post',
        data: {
          type: '3',
          name: ` select * from 车间管理_工作计划 where 机床流水号 = ${this.machineValue1} and 计划类型 = 3 `
        }
      }).then(res => {
        this.tableDataDiv7 = res.data
        this.dataDiv7.length = res.data.length
        request({
          url: '',
          method: 'post',
          data: {
            type: '3',
            name: `select COUNT(*) as 进行中 from  车间管理_工作计划 where 计划类型 = 3 and (开始时间 is not null and 开始时间 <> '') and (结束时间 is null or 结束时间 = '') and 机床流水号 = ${this.machineValue1}`
          }
        }).then(res => {
          this.dataDiv7.data1 = res.data[0].进行中
          if (res.data[0].进行中 !== 0) {
            this.dataDiv7.data4.push({
              value: res.data[0].进行中,
              name: '冷作进行中'
            })
          }
        }).then(() => {
          request({
            url: '',
            method: 'post',
            data: {
              type: '3',
              name: ` select COUNT(*) as 已完成 from  车间管理_工作计划 where 计划类型 = 3 and 开始时间 is not null and 开始时间 <> '' and 结束时间 is not null and 结束时间 <> '' and 机床流水号 = ${this.machineValue1}`
            }
          }).then(res => {
            this.dataDiv7.data2 = res.data[0].已完成
            if (res.data[0].已完成 !== 0) {
              this.dataDiv7.data4.push({
                value: res.data[0].已完成,
                name: '冷作已完成'
              })
            }
          }).then(() => {
            this.dataDiv7.data3 = parseInt(this.dataDiv7.length - this.dataDiv7.data1 - this.dataDiv7.data2)
          }).then(() => {
            if (parseInt(this.dataDiv7.data3) !== 0) {
              this.dataDiv7.data4.push({
                value: this.dataDiv7.data3,
                name: '无计划/未开始'
              })
            }
            this.drawLineDiv7()
          })
        })
      })
    },
    // 绘制冷作div饼图
    drawLineDiv7() {
      const bar = echarts.init(document.getElementById('barDiv7'))
      // 指定图表的配置项和数据
      bar.setOption({
        tooltip: {
          trigger: 'item',
          formatter: '{a} <br/>{b} : {c} ({d}%)'
        },
        legend: {
          orient: 'vertical',
          left: 'left',
          data: ['冷作已完成', '冷作进行中', '无计划/未开始']
        },
        series: [
          {
            name: '状态比例',
            type: 'pie',
            radius: '55%',
            center: ['50%', '45%'],
            data: this.dataDiv7.data4,
            itemStyle: {
              emphasis: {
                shadowBlur: 10,
                shadowOffsetX: 0,
                shadowColor: 'rgba(0, 0, 0, 0.5)'
              }
            }
          }
        ]
      })
    },
    // 查询油漆div数据
    async searchDiv8() {
      this.showDiv0 = false
      this.showDiv1 = false
      this.showDiv2 = false
      this.showDiv3 = false
      this.showDiv4 = false
      this.showDiv5 = false
      this.showDiv6 = false
      this.showDiv7 = false
      this.showDiv8 = true
      this.showDiv9 = false
      this.showDiv10 = false
      this.showDiv11 = false
      this.showDiv12 = false
      this.showDiv13 = false
      this.showDiv14 = false
      this.showDiv15 = false
      this.showDiv23 = false
      this.showDiv16 = false
      this.showDiv17 = false
      this.showDiv18 = false
      this.showDiv19 = false
      this.showDiv20 = false
      this.showDiv21 = false
      this.showDiv22 = false
      this.dataDiv8.data4 = []
      await request({
        url: '',
        method: 'post',
        data: {
          type: '3',
          name: ` select * from 车间管理_工作计划 where 机床流水号 = ${this.machineValue1} and 计划类型 = 4 `
        }
      }).then(res => {
        this.tableDataDiv8 = res.data
        this.dataDiv8.length = res.data.length
        request({
          url: '',
          method: 'post',
          data: {
            type: '3',
            name: `select COUNT(*) as 进行中 from  车间管理_工作计划 where 计划类型 = 4 and (开始时间 is not null and 开始时间 <> '') and (结束时间 is null or 结束时间 = '') and 机床流水号 = ${this.machineValue1}`
          }
        }).then(res => {
          this.dataDiv8.data1 = res.data[0].进行中
          if (res.data[0].进行中 !== 0) {
            this.dataDiv8.data4.push({
              value: res.data[0].进行中,
              name: '油漆进行中'
            })
          }
        }).then(() => {
          request({
            url: '',
            method: 'post',
            data: {
              type: '3',
              name: ` select COUNT(*) as 已完成 from  车间管理_工作计划 where 计划类型 = 4 and 开始时间 is not null and 开始时间 <> '' and 结束时间 is not null and 结束时间 <> '' and 机床流水号 = ${this.machineValue1}`
            }
          }).then(res => {
            this.dataDiv8.data2 = res.data[0].已完成
            if (res.data[0].已完成 !== 0) {
              this.dataDiv8.data4.push({
                value: res.data[0].已完成,
                name: '油漆已完成'
              })
            }
          }).then(() => {
            this.dataDiv8.data3 = parseInt(this.dataDiv8.length - this.dataDiv8.data1 - this.dataDiv8.data2)
          }).then(() => {
            if (parseInt(this.dataDiv8.data3) !== 0) {
              this.dataDiv8.data4.push({
                value: this.dataDiv8.data3,
                name: '无计划/未开始'
              })
            }
            this.drawLineDiv8()
          })
        })
      })
    },
    // 绘制油漆div饼图
    drawLineDiv8() {
      const bar = echarts.init(document.getElementById('barDiv8'))
      // 指定图表的配置项和数据
      bar.setOption({
        tooltip: {
          trigger: 'item',
          formatter: '{a} <br/>{b} : {c} ({d}%)'
        },
        legend: {
          orient: 'vertical',
          left: 'left',
          data: ['油漆已完成', '油漆进行中', '无计划/未开始']
        },
        series: [
          {
            name: '状态比例',
            type: 'pie',
            radius: '55%',
            center: ['50%', '45%'],
            data: this.dataDiv8.data4,
            itemStyle: {
              emphasis: {
                shadowBlur: 10,
                shadowOffsetX: 0,
                shadowColor: 'rgba(0, 0, 0, 0.5)'
              }
            }
          }
        ]
      })
    },
    // 查询成组配套div数据
    async searchDiv9() {
      this.showDiv0 = false
      this.showDiv1 = false
      this.showDiv2 = false
      this.showDiv3 = false
      this.showDiv4 = false
      this.showDiv5 = false
      this.showDiv6 = false
      this.showDiv7 = false
      this.showDiv8 = false
      this.showDiv9 = true
      this.showDiv10 = false
      this.showDiv11 = false
      this.showDiv12 = false
      this.showDiv13 = false
      this.showDiv14 = false
      this.showDiv15 = false
      this.showDiv23 = false
      this.showDiv16 = false
      this.showDiv17 = false
      this.showDiv18 = false
      this.showDiv19 = false
      this.showDiv20 = false
      this.showDiv21 = false
      this.showDiv22 = false
      await request({
        url: '',
        method: 'post',
        data: {
          type: '3',
          name: `select 前几列.*,case when 完成时间 = '未完成' then '未完成' else convert(nvarchar(50),入库时间,21) end as 完成时间
                from (SELECT 组号 ,组件名称,SUM(isnull(批次数量,0))as 投产数量,SUM(isnull(入库数量,0))as 入库数量,MAX(入库时间) as 入库时间
                from 车间生产管理工艺_零件工艺计划_传递后_视图
                where 机床流水号 = 89
                group by 组号,组件名称) as 前几列
                left join (SELECT 组号,'未完成' as 完成时间
                from 车间生产管理工艺_零件工艺计划_传递后_视图
                where 机床流水号 = ${this.machineValue1} and isnull(入库数量,0) <> isnull(批次数量,0)
                group by 组号) as 未完成组
                on 前几列.组号 = 未完成组.组号`
        }
      }).then(res => {
        this.tableDataDiv9A = res.data
        request({
          url: '',
          method: 'post',
          data: {
            type: '3',
            name: `select 组号,组件名称,sum(零件数量) as 总零件数量,SUM(已到货数量) as 总到货数量, (case when sum(零件数量) = SUM(已到货数量) then GETDATE() ELSE '' END)完成时间 from (
                    SELECT [机床图号],[机床流水号],[组号] ,[组件名称] ,[组件流水号] ,[物料名称] as 零件名称 ,[物料型号] as 零件图号 ,[物料规格] ,[零件数量] ,通过的合同.已到货数量
                     FROM MRP_计划订单_组件零件清单_标准件和外购件_视图
                      left join (
                      select 采购管理_采购合同_采购部.*,组件零件流水号,数量,已到货数量 from 采购管理_采购合同明细_采购部
                     inner join 采购管理_采购合同_采购部 on 采购管理_采购合同明细_采购部.采购合同流水号 = 采购管理_采购合同_采购部.采购合同流水号
                     where 采购管理_采购合同_采购部.是否未通过 = 0
                     ) as 通过的合同 on 通过的合同.组件零件流水号 = MRP_计划订单_组件零件清单_标准件和外购件_视图.组件零件流水号
                     left join 采购管理_供应商 on 通过的合同.供应商流水号 = 采购管理_供应商.供应商流水号
                     WHERE  机床流水号 = N'${this.machineValue1}'
                     union
                     SELECT [机床图号] ,[机床流水号] ,[组号] ,[组件名称] ,[组件流水号] ,[零件名称] ,[零件图号] ,规格 ,[零件数量] ,通过的合同.已到货数量
                     FROM MRP_计划订单_组件零件清单_基本件_视图
                     left join (
                     select 采购管理_采购合同_采购部.*,组件零件基本件流水号,数量,已到货数量 from 采购管理_采购合同明细_采购部
                    inner join 采购管理_采购合同_采购部 on 采购管理_采购合同明细_采购部.采购合同流水号 = 采购管理_采购合同_采购部.采购合同流水号
                    where 采购管理_采购合同_采购部.是否未通过 = 0
                    ) as 通过的合同 on 通过的合同.组件零件基本件流水号 = MRP_计划订单_组件零件清单_基本件_视图.组件零件基本件流水号
                    left join 采购管理_供应商 on 通过的合同.供应商流水号 = 采购管理_供应商.供应商流水号
                    where 机床流水号 = '${this.machineValue1}'
                    ) as a
                    where a.机床流水号 = '${this.machineValue1}'
                    group by a.组号,a.组件名称
                    order by a.组号`
          }
        }).then(res => {
          this.tableDataDiv9B = res.data
          request({
            url: '',
            method: 'post',
            data: {
              type: '3',
              name: `SELECT [组号] ,组件名称 ,sum(convert(int,零件数量)) as 总零件数量
                    ,sum(已到货数量) as 总到货数量
                    , (case when sum(convert(int,零件数量)) = SUM(已到货数量) then GETDATE() ELSE '' END)完成时间
                    FROM (
                    SELECT     dbo.车间管理_车间采购_请购单明细.机床流水号, dbo.车间管理_车间采购_请购单明细.组号, dbo.PDM_组件名称.组件名称, dbo.车间管理_车间采购_请购单明细.零件数量,
                    dbo.车间管理_车间采购_请购单明细.已到货数量
                    FROM         dbo.PDM_组件名称 RIGHT OUTER JOIN
                    dbo.车间管理_车间采购_请购单明细 ON dbo.PDM_组件名称.组件流水号 = dbo.车间管理_车间采购_请购单明细.组件流水号
                    ) as a where a.机床流水号 = ${this.machineValue1}
                    group by a.[组号],a.组件名称`
            }
          }).then(res => {
            this.tableDataDiv9C = res.data
          })
        })
      })
    },
    // 查询车间加工div数据
    async searchDiv10() {
      this.showDiv0 = false
      this.showDiv1 = false
      this.showDiv2 = false
      this.showDiv3 = false
      this.showDiv4 = false
      this.showDiv5 = false
      this.showDiv6 = false
      this.showDiv7 = false
      this.showDiv8 = false
      this.showDiv9 = false
      this.showDiv10 = true
      this.showDiv11 = false
      this.showDiv12 = false
      this.showDiv13 = false
      this.showDiv14 = false
      this.showDiv15 = false
      this.showDiv23 = false
      this.showDiv16 = false
      this.showDiv17 = false
      this.showDiv18 = false
      this.showDiv19 = false
      this.showDiv20 = false
      this.showDiv21 = false
      this.showDiv22 = false
      this.dataDiv10.data = []
      await request({
        url: '',
        method: 'post',
        data: {
          type: '3',
          name: `exec 项目计划管理_项目详细计划_查询数据 @机床流水号=${this.machineValue1}, @计划类型=4`
        }
      }).then(res => {
        this.tableDataDiv10 = res.data
        request({
          url: '',
          method: 'post',
          data: {
            type: '3',
            name: `select CONVERT(nvarchar(50),round(CONVERT(float,sum(case when [机加工实际完成时间] is not null then [投产总数量] else 0 end ))/CONVERT(float,sum([投产总数量]))*100,2) ) as 进度
             from 综合查询_车间加工_新
             where 机床流水号 = ${this.machineValue1}`
          }
        })
      })
    },
    // 查询自家备料div数据
    async searchDiv11() {
      this.showDiv0 = false
      this.showDiv1 = false
      this.showDiv2 = false
      this.showDiv3 = false
      this.showDiv4 = false
      this.showDiv5 = false
      this.showDiv6 = false
      this.showDiv7 = false
      this.showDiv8 = false
      this.showDiv9 = false
      this.showDiv10 = false
      this.showDiv11 = true
      this.showDiv12 = false
      this.showDiv13 = false
      this.showDiv14 = false
      this.showDiv15 = false
      this.showDiv23 = false
      this.showDiv16 = false
      this.showDiv17 = false
      this.showDiv18 = false
      this.showDiv19 = false
      this.showDiv20 = false
      this.showDiv21 = false
      this.showDiv22 = false
      this.dataDiv11.yDataB = []
      this.dataDiv11.yDataA = []
      this.dataDiv11.xData = []
      await request({
        url: '',
        method: 'post',
        /* 原
        declare @机床流水号 int = 89
                  select *,(case when 100 * 已备料条数/零件条数 = 100 then '' else '——' end) as 完成时间 from (
                  select case when 已备料条数 = 零件条数 then '完成' else '未完成' end as 状态
                  ,所有.*,已备料条数
                  ,100*已备料条数/零件条数 as 备料进度
                  from (
                  select PDM_组件名称.组号,PDM_组件名称.组件名称,PDM_机床名称.机床流水号
                  ,COUNT(*) as 零件条数
                  from (SELECT  [工艺计划流水号],[零件图号], [零件名称], [备料打印] , [备料到货]
                  from [车间生产管理工艺_零件工艺计划_传递后_视图]
                  WHERE   考核状态 >= 3 and 考核状态 <8 and 工艺任务分配状态 =2 and 批次零件状态=1 and 备料打印 = 1 and 机床流水号 = @机床流水号
                  and 工艺计划流水号 in ( select  工艺计划流水号 from 车间生产管理工艺_零件工序 where 工艺编号 = 29 )) as 自制备料
                  inner join 车间生产管理工艺_零件工艺计划 on 自制备料.工艺计划流水号 = 车间生产管理工艺_零件工艺计划.工艺计划流水号
                  inner join MRP_计划订单_组件零件清单_基本件 on 车间生产管理工艺_零件工艺计划.组件零件基本件流水号 = MRP_计划订单_组件零件清单_基本件.组件零件基本件流水号
                  inner join MRP_计划订单_机床组件清单 on MRP_计划订单_机床组件清单.机床组件流水号 = MRP_计划订单_组件零件清单_基本件.机床组件流水号
                  inner join PDM_组件名称 on PDM_组件名称.组件流水号 = MRP_计划订单_机床组件清单.组件流水号
                  inner join PDM_机床名称 on PDM_组件名称.机床流水号 = PDM_机床名称.机床流水号
                  group by PDM_组件名称.组号,PDM_组件名称.组件名称,PDM_机床名称.机床流水号,PDM_机床名称.机床图号
                  ) as 所有
                  left join
                  (select 自制备料.备料到货
                  ,PDM_组件名称.组号,PDM_组件名称.组件名称,PDM_机床名称.机床流水号
                  ,COUNT(*) as 已备料条数
                  from (SELECT  [工艺计划流水号],[零件图号], [零件名称], [备料打印] , [备料到货]
                  from [车间生产管理工艺_零件工艺计划_传递后_视图]
                  WHERE   考核状态 >= 3 and 考核状态 <8 and 工艺任务分配状态 =2 and 批次零件状态=1 and 备料打印 = 1 and 备料到货 = 1 and 机床流水号 = @机床流水号
                  and 工艺计划流水号 in ( select  工艺计划流水号 from 车间生产管理工艺_零件工序 where 工艺编号 = 29 )) as 自制备料
                  inner join 车间生产管理工艺_零件工艺计划 on 自制备料.工艺计划流水号 = 车间生产管理工艺_零件工艺计划.工艺计划流水号
                  inner join MRP_计划订单_组件零件清单_基本件 on 车间生产管理工艺_零件工艺计划.组件零件基本件流水号 = MRP_计划订单_组件零件清单_基本件.组件零件基本件流水号
                  inner join MRP_计划订单_机床组件清单 on MRP_计划订单_机床组件清单.机床组件流水号 = MRP_计划订单_组件零件清单_基本件.机床组件流水号
                  inner join PDM_组件名称 on PDM_组件名称.组件流水号 = MRP_计划订单_机床组件清单.组件流水号
                  inner join PDM_机床名称 on PDM_组件名称.机床流水号 = PDM_机床名称.机床流水号
                  inner join 车间生产管理工艺_备料出库记录 on 车间生产管理工艺_零件工艺计划.工艺计划流水号 = 车间生产管理工艺_备料出库记录.工艺计划流水号
                  group by PDM_组件名称.组号,PDM_组件名称.组件名称,PDM_机床名称.机床流水号,PDM_机床名称.机床图号,自制备料.备料到货) as 完成
                  on 所有.组号 = 完成.组号 and 所有.机床流水号 = 完成.机床流水号
                  ) as 头
        */
        data: {
          type: '3',
          name: `declare @机床流水号 int = ${this.machineValue1}
                  select *,(case when 100 * 已备料条数/零件条数 = 100 then '' else '——' end) as 完成时间 from (
                  select case when 已备料条数 = 零件条数 then '完成' else '未完成' end as 状态
                  ,所有.*,已备料条数
                  ,100*已备料条数/零件条数 as 备料进度
                  from (
                  select PDM_组件名称.组号,PDM_组件名称.组件名称,PDM_组件名称.组件流水号,PDM_机床名称.机床流水号
                  ,COUNT(*) as 零件条数
                  from (SELECT  [工艺计划流水号],[零件图号], [零件名称], [备料打印] , [备料到货]
                  from [车间生产管理工艺_零件工艺计划_传递后_视图]
                  WHERE   考核状态 >= 3 and 考核状态 <8 and 工艺任务分配状态 =2 and 批次零件状态=1 and 备料打印 = 1 and 机床流水号 = @机床流水号
                  and 工艺计划流水号 in ( select  工艺计划流水号 from 车间生产管理工艺_零件工序 where 工艺编号 = 29 )) as 自制备料
                  inner join 车间生产管理工艺_零件工艺计划 on 自制备料.工艺计划流水号 = 车间生产管理工艺_零件工艺计划.工艺计划流水号
                  inner join MRP_计划订单_组件零件清单_基本件 on 车间生产管理工艺_零件工艺计划.组件零件基本件流水号 = MRP_计划订单_组件零件清单_基本件.组件零件基本件流水号
                  inner join MRP_计划订单_机床组件清单 on MRP_计划订单_机床组件清单.机床组件流水号 = MRP_计划订单_组件零件清单_基本件.机床组件流水号
                  inner join PDM_组件名称 on PDM_组件名称.组件流水号 = MRP_计划订单_机床组件清单.组件流水号
                  inner join PDM_机床名称 on PDM_组件名称.机床流水号 = PDM_机床名称.机床流水号
                  group by PDM_组件名称.组号,PDM_组件名称.组件名称,PDM_组件名称.组件流水号,PDM_机床名称.机床流水号,PDM_机床名称.机床图号
                  ) as 所有
                  left join
                  (select 自制备料.备料到货
                  ,PDM_组件名称.组号,PDM_组件名称.组件名称,PDM_组件名称.组件流水号,PDM_机床名称.机床流水号
                  ,COUNT(*) as 已备料条数
                  from (SELECT  [工艺计划流水号],[零件图号], [零件名称], [备料打印] , [备料到货]
                  from [车间生产管理工艺_零件工艺计划_传递后_视图]
                  WHERE   考核状态 >= 3 and 考核状态 <8 and 工艺任务分配状态 =2 and 批次零件状态=1 and 备料打印 = 1 and 备料到货 = 1 and 机床流水号 = @机床流水号
                  and 工艺计划流水号 in ( select  工艺计划流水号 from 车间生产管理工艺_零件工序 where 工艺编号 = 29 )) as 自制备料
                  inner join 车间生产管理工艺_零件工艺计划 on 自制备料.工艺计划流水号 = 车间生产管理工艺_零件工艺计划.工艺计划流水号
                  inner join MRP_计划订单_组件零件清单_基本件 on 车间生产管理工艺_零件工艺计划.组件零件基本件流水号 = MRP_计划订单_组件零件清单_基本件.组件零件基本件流水号
                  inner join MRP_计划订单_机床组件清单 on MRP_计划订单_机床组件清单.机床组件流水号 = MRP_计划订单_组件零件清单_基本件.机床组件流水号
                  inner join PDM_组件名称 on PDM_组件名称.组件流水号 = MRP_计划订单_机床组件清单.组件流水号
                  inner join PDM_机床名称 on PDM_组件名称.机床流水号 = PDM_机床名称.机床流水号
                  inner join 车间生产管理工艺_备料出库记录 on 车间生产管理工艺_零件工艺计划.工艺计划流水号 = 车间生产管理工艺_备料出库记录.工艺计划流水号
                  group by PDM_组件名称.组号,PDM_组件名称.组件名称,PDM_组件名称.组件流水号,PDM_机床名称.机床流水号,PDM_机床名称.机床图号,自制备料.备料到货) as 完成
                  on 所有.组号 = 完成.组号 and 所有.机床流水号 = 完成.机床流水号
                  ) as 头 order by 组号`
        }
      }).then(res => {
        this.tableDataDiv11 = res.data
        for (let i = 0; i < res.data.length; i++) {
          this.dataDiv11.xData.push(res.data[i].组号)
          this.dataDiv11.yDataA.push(res.data[i].零件条数)
          this.dataDiv11.yDataB.push(res.data[i].已备料条数)
        }
        this.drawLineDiv11()
      })
    },
    // 绘制自家备料条形图
    drawLineDiv11() {
      const bar = echarts.init(document.getElementById('barDiv11'))
      // 指定图表的配置项和数据
      bar.setOption({
        tooltip: {},
        legend: {
          data: ['零件条数', '已备料条数']
        },
        xAxis: {
          data: this.dataDiv11.xData,
          show: true
        },
        yAxis: {},
        series: [{
          name: '零件条数',
          type: 'bar',
          data: this.dataDiv11.yDataA
        },
        {
          name: '已备料条数',
          type: 'bar',
          data: this.dataDiv11.yDataB
        }]
      })
    },
    // 查询自制件质检数据
    async searchDiv12() {
      this.showDiv0 = false
      this.showDiv1 = false
      this.showDiv2 = false
      this.showDiv3 = false
      this.showDiv4 = false
      this.showDiv5 = false
      this.showDiv6 = false
      this.showDiv7 = false
      this.showDiv8 = false
      this.showDiv9 = false
      this.showDiv10 = false
      this.showDiv11 = false
      this.showDiv12 = true
      this.showDiv13 = false
      this.showDiv14 = false
      this.showDiv15 = false
      this.showDiv23 = false
      this.showDiv16 = false
      this.showDiv17 = false
      this.showDiv18 = false
      this.showDiv19 = false
      this.showDiv20 = false
      this.showDiv21 = false
      this.showDiv22 = false
      await request({
        url: '',
        method: 'post',
        data: {
          type: '3',
          name: `SELECT
                  [组号]
                  ,[组件名称]
                  ,sum([数量]) as 检测总数量
                  ,sum([不合格数量]) as 不合格总数量
                  ,sum([批次数量]) as 零件总数量
                 ,Convert(decimal(18,2),100 * (sum(isNull([数量],0))-sum(isNull([不合格数量],0)))/sum(isNull([数量],0))) as 合格率
              FROM [质检管理_基本件数据_查询视图] where 机床流水号 = ${this.machineValue1}
              group by 组号, 组件名称 order by 组号`
        }
      }).then(res => {
        this.tableDataDiv12 = res.data
      })
    },
    // 查询采购部采购div数据
    async searchDiv16() {
      this.showDiv0 = false
      this.showDiv1 = false
      this.showDiv2 = false
      this.showDiv3 = false
      this.showDiv4 = false
      this.showDiv5 = false
      this.showDiv6 = false
      this.showDiv7 = false
      this.showDiv8 = false
      this.showDiv9 = false
      this.showDiv10 = false
      this.showDiv11 = false
      this.showDiv12 = false
      this.showDiv13 = false
      this.showDiv14 = false
      this.showDiv15 = false
      this.showDiv23 = false
      this.showDiv16 = true
      this.showDiv17 = false
      this.showDiv18 = false
      this.showDiv19 = false
      this.showDiv20 = false
      this.showDiv21 = false
      this.showDiv22 = false
      await request({
        url: '',
        method: 'post',
        data: {
          type: '3',
          name: `
            --外购件
            select 机床流水号,组号,组件名称

            ,SUM(外购件数) as 总外购件数
            ,SUM(已采购外购件数) as 已采购外购件数
            ,SUM(部分采购外购件数) as 部分采购外购件数
            ,SUM(总到货数外购件数 ) as 总到货数外购件数
            from (
            SELECT 机床流水号,组号,组件名称

            ,(select COUNT(*) where 机床流水号 = ${this.machineValue1}) as 外购件数
            ,(select COUNT(*) where 机床流水号 = ${this.machineValue1} and isnull(数量,0) = isnull(零件数量,0)) as 已采购外购件数
            ,(select COUNT(*) where 机床流水号 = ${this.machineValue1} and isnull(数量,0) <> 0 and isnull(数量,0) <> isnull(零件数量,0)) as 部分采购外购件数
            ,(select COUNT(*) where 机床流水号 = ${this.machineValue1} and isnull(数量,0) <> 0 and isnull(数量,0) = isnull(已到货数量,0)) as 总到货数外购件数
            FROM MRP_计划订单_组件零件清单_标准件和外购件_视图
            left join (
            select 采购管理_采购合同_采购部.*,组件零件流水号,数量,已到货数量 from 采购管理_采购合同明细_采购部
            inner join 采购管理_采购合同_采购部 on 采购管理_采购合同明细_采购部.采购合同流水号 = 采购管理_采购合同_采购部.采购合同流水号
            where 采购管理_采购合同_采购部.是否未通过 = 0
            ) as 通过的合同 on 通过的合同.组件零件流水号 = MRP_计划订单_组件零件清单_标准件和外购件_视图.组件零件流水号
            left join 采购管理_供应商 on 通过的合同.供应商流水号 = 采购管理_供应商.供应商流水号
            where 机床流水号 is not null and 零件类型 = 2 and 机床流水号 = ${this.machineValue1}
            ) as a
            group by 机床流水号,组号,组件名称 order by 组号
            `
        }
      }).then(res => {
        this.tableDataDiv16A = res.data
        request({
          url: '',
          method: 'post',
          data: {
            type: '3',
            name: `
              select 机床流水号,组号
               ,组件名称
              ,SUM(标准件数) as 总标准件数
              ,SUM(已采购标准件数) as 已采购标准件数
              ,SUM(部分采购标准件数) as 部分采购标准件数
              ,SUM(总到货数标准件数 ) as 总到货数标准件数
              from (
              SELECT 机床流水号,组号
              ,组件名称
              ,(select COUNT(*) where 机床流水号 = ${this.machineValue1}) as 标准件数
              ,(select COUNT(*) where 机床流水号 = ${this.machineValue1} and isnull(数量,0) = isnull(零件数量,0)) as 已采购标准件数
              ,(select COUNT(*) where 机床流水号 = ${this.machineValue1} and isnull(数量,0) <> 0 and isnull(数量,0) <> isnull(零件数量,0)) as 部分采购标准件数
              ,(select COUNT(*) where 机床流水号 = ${this.machineValue1} and isnull(数量,0) <> 0 and isnull(数量,0) = isnull(已到货数量,0)) as 总到货数标准件数
              FROM MRP_计划订单_组件零件清单_标准件和外购件_视图
              left join (
               select 采购管理_采购合同_采购部.*,组件零件流水号,数量,已到货数量 from 采购管理_采购合同明细_采购部
              inner join 采购管理_采购合同_采购部 on 采购管理_采购合同明细_采购部.采购合同流水号 = 采购管理_采购合同_采购部.采购合同流水号
              where 采购管理_采购合同_采购部.是否未通过 = 0
              ) as 通过的合同 on 通过的合同.组件零件流水号 = MRP_计划订单_组件零件清单_标准件和外购件_视图.组件零件流水号
              left join 采购管理_供应商 on 通过的合同.供应商流水号 = 采购管理_供应商.供应商流水号
              where 机床流水号 is not null and 零件类型 = 1 and 机床流水号 = ${this.machineValue1}
              ) as a
              group by 机床流水号,组号
              ,组件名称 order by 组号`
          }
        }).then(res => {
          this.tableDataDiv16B = res.data
          request({
            url: '',
            method: 'post',
            data: {
              type: '3',
              name: `
                select 机床流水号,组号,组件名称
                ,SUM(基本件数) as 总基本件数
                ,SUM(已采购基本件数) as 已采购基本件数
                ,SUM(部分采购基本件数) as 部分采购基本件数
                ,SUM(总到货数基本件数 ) as 总到货数基本件数
                from (
                SELECT 机床流水号,组号,组件名称
                ,(select COUNT(*) where 机床流水号 = ${this.machineValue1}) as 基本件数
                ,(select COUNT(*) where 机床流水号 = ${this.machineValue1} and isnull(数量,0) = isnull(零件数量,0)) as 已采购基本件数
                ,(select COUNT(*) where 机床流水号 = ${this.machineValue1} and isnull(数量,0) <> 0 and isnull(数量,0) <> isnull(零件数量,0)) as 部分采购基本件数
                ,(select COUNT(*) where 机床流水号 = ${this.machineValue1} and isnull(数量,0) <> 0 and isnull(数量,0) = isnull(已到货数量,0)) as 总到货数基本件数
                FROM MRP_计划订单_组件零件清单_基本件_视图
                left join (
                 select 采购管理_采购合同_采购部.*,组件零件基本件流水号,数量,已到货数量 from 采购管理_采购合同明细_采购部
                inner join 采购管理_采购合同_采购部 on 采购管理_采购合同明细_采购部.采购合同流水号 = 采购管理_采购合同_采购部.采购合同流水号
                where 采购管理_采购合同_采购部.是否未通过 = 0
                ) as 通过的合同 on 通过的合同.组件零件基本件流水号 = MRP_计划订单_组件零件清单_基本件_视图.组件零件基本件流水号
                left join 采购管理_供应商 on 通过的合同.供应商流水号 = 采购管理_供应商.供应商流水号
                where 机床流水号 is not null  and 机床流水号 = ${this.machineValue1}
                ) as a
                group by 机床流水号,组号,组件名称 order by 组号`
            }
          }).then(res => {
            this.tableDataDiv16C = res.data
          })
        })
      })
    },
    // 查询车间采购div数据
    async searchDiv17() {
      this.showDiv0 = false
      this.showDiv1 = false
      this.showDiv2 = false
      this.showDiv3 = false
      this.showDiv4 = false
      this.showDiv5 = false
      this.showDiv6 = false
      this.showDiv7 = false
      this.showDiv8 = false
      this.showDiv9 = false
      this.showDiv10 = false
      this.showDiv11 = false
      this.showDiv12 = false
      this.showDiv13 = false
      this.showDiv14 = false
      this.showDiv15 = false
      this.showDiv23 = false
      this.showDiv16 = false
      this.showDiv17 = true
      this.showDiv18 = false
      this.showDiv19 = false
      this.showDiv20 = false
      this.showDiv21 = false
      this.showDiv22 = false
      await request({
        url: '',
        method: 'post',
        data: {
          type: '3',
          name: `
            select 组号,组件名称
            ,SUM(基本件数) as 总基本件数
            ,SUM(已采购基本件数) as 已采购基本件数
            ,SUM(已到货基本件数 ) as 总到货数基本件数
            from (
            select 组号,组件名称,
            (select COUNT(*) where 机床流水号 =${this.machineValue1} and 基本件流水号 is not null) as 基本件数,
            (select COUNT(*) where 机床流水号 =${this.machineValue1} and 基本件流水号 is not null and 采购合同明细流水号 is not null) as 已采购基本件数,
            (select COUNT(*) where 机床流水号 =${this.machineValue1} and 基本件流水号 is not null and isnull(零件数量,0) = isnull(已到货数量,0)) as 已到货基本件数
            from 车间采购_综合查询视图 where 机床流水号 = ${this.machineValue1}
            ) as a
            group by a.组号,a.组件名称 order by 组号`
        }
      }).then(res => {
        this.tableDataDiv17A = res.data
        request({
          url: '',
          method: 'post',
          data: {
            type: '3',
            name: `
              select 组号,组件名称
              ,SUM(基本件数) as 总基本件数
              ,SUM(已采购基本件数) as 已采购基本件数
              ,SUM(已到货基本件数 ) as 总到货数基本件数
              from (
              select 组号,组件名称,
              (select COUNT(*) where 机床流水号 =${this.machineValue1} and 标准件和外购件流水号 is not null) as 基本件数,
              (select COUNT(*) where 机床流水号 =${this.machineValue1} and 标准件和外购件流水号 is not null and 采购合同明细流水号 is not null) as 已采购基本件数,
              (select COUNT(*) where 机床流水号 =${this.machineValue1} and 标准件和外购件流水号 is not null and isnull(零件数量,0) = isnull(已到货数量,0)) as 已到货基本件数
              from 车间采购_综合查询视图 where 机床流水号 =${this.machineValue1}
              ) as a
              group by a.组号,a.组件名称 order by 组号`
          }
        }).then(res => {
          this.tableDataDiv17B = res.data
        })
      })
    },
    // 查询工序外协div数据
    searchDiv18() {
      this.showDiv0 = false
      this.showDiv1 = false
      this.showDiv2 = false
      this.showDiv3 = false
      this.showDiv4 = false
      this.showDiv5 = false
      this.showDiv6 = false
      this.showDiv7 = false
      this.showDiv8 = false
      this.showDiv9 = false
      this.showDiv10 = false
      this.showDiv11 = false
      this.showDiv12 = false
      this.showDiv13 = false
      this.showDiv14 = false
      this.showDiv15 = false
      this.showDiv23 = false
      this.showDiv16 = false
      this.showDiv17 = false
      this.showDiv18 = true
      this.showDiv19 = false
      this.showDiv20 = false
      this.showDiv21 = false
      this.showDiv22 = false
      this.dataDiv18.yDataA = []
      this.dataDiv18.xData = []
      ProcessOutsourcing(this.machineValue1).then(response => {
        this.tableDataDiv18 = response.data
      })
      ProcessProportion(this.machineValue1).then(response => {
        for (let i = 0; i < response.data.length; i++) {
          this.dataDiv18.xData.push(response.data[i].工艺名称)
          this.dataDiv18.yDataA.push(response.data[i].零件数量)
        }
      }).then(() => {
        this.drawLineDiv18()
      })
    },
    // 绘制工序外协条形图
    drawLineDiv18() {
      const bar = echarts.init(document.getElementById('barDiv18'))
      // 指定图表的配置项和数据
      bar.setOption({
        tooltip: {},
        legend: {
          data: this.dataDiv18.xData
        },
        xAxis: {
          data: this.dataDiv18.xData,
          show: true
        },
        yAxis: {},
        series: [{
          name: '外协数量',
          type: 'bar',
          data: this.dataDiv18.yDataA
        }]
      })
    },
    // 查询自制件质检数据
    async searchDiv19() {
      this.showDiv0 = false
      this.showDiv1 = false
      this.showDiv2 = false
      this.showDiv3 = false
      this.showDiv4 = false
      this.showDiv5 = false
      this.showDiv6 = false
      this.showDiv7 = false
      this.showDiv8 = false
      this.showDiv9 = false
      this.showDiv10 = false
      this.showDiv11 = false
      this.showDiv12 = false
      this.showDiv13 = false
      this.showDiv14 = false
      this.showDiv15 = false
      this.showDiv23 = false
      this.showDiv16 = false
      this.showDiv17 = false
      this.showDiv18 = false
      this.showDiv19 = true
      this.showDiv20 = false
      this.showDiv21 = false
      this.showDiv22 = false
      await request({
        url: '',
        method: 'post',
        data: {
          type: '3',
          name: `SELECT
            [组号]
            ,[组件名称]
            ,sum([数量]) as 检测总数量
            ,sum([不合格数量]) as 不合格总数量
            ,sum([零件数量]) as 零件总数量
            ,Convert(decimal(18,2),100*(sum(isNull([数量],0))-sum(isNull([不合格数量],0)))/sum(isNull([数量],0))) as 合格率
            FROM (
            select 组号,组件名称,数量,不合格数量,零件数量 from 质检管理_外购件制造部数据_查询视图 where 机床流水号 = ${this.machineValue1}
            union
            select 组号,组件名称,数量,不合格数量,零件数量 from 质检管理_外购件采购部基本件数据_查询视图 where 机床流水号 = ${this.machineValue1}
            union
            select 组号,组件名称,数量,不合格数量,零件数量 from 质检管理_外购件采购部外购件数据_查询视图 where 机床流水号 = ${this.machineValue1}) as a
            group by a.组号, a.组件名称 order by 组号`
        }
      }).then(res => {
        this.tableDataDiv19 = res.data
      })
    },
    // 查询外购备料div数据
    async searchDiv20() {
      this.showDiv0 = false
      this.showDiv1 = false
      this.showDiv2 = false
      this.showDiv3 = false
      this.showDiv4 = false
      this.showDiv5 = false
      this.showDiv6 = false
      this.showDiv7 = false
      this.showDiv8 = false
      this.showDiv9 = false
      this.showDiv10 = false
      this.showDiv11 = false
      this.showDiv12 = false
      this.showDiv13 = false
      this.showDiv14 = false
      this.showDiv15 = false
      this.showDiv23 = false
      this.showDiv16 = false
      this.showDiv17 = false
      this.showDiv18 = false
      this.showDiv19 = false
      this.showDiv20 = true
      this.showDiv21 = false
      this.showDiv22 = false
      // this.dataDiv11.yDataB = []
      // this.dataDiv11.yDataA = []
      // this.dataDiv11.xData = []
      await request({
        url: '',
        method: 'post',
        data: {
          type: '3',
          name: `select 组号,组件名称,
            SUM(外购备料总数) as 外购备料总数,
            SUM(外购备料到货总数) as 外购备料到货总数,
            SUM(外购备料出库总数) as 外购备料出库总数 from
            (select 组号,组件名称,
            (select COUNT(*) where 机床流水号 = ${this.machineValue1}) as 外购备料总数,
             (select COUNT(*) where 机床流水号 = ${this.machineValue1} and 是否到货 = 1) as 外购备料到货总数,
              (select COUNT(*) where 机床流水号 = ${this.machineValue1} and 是否出库 = 1) as 外购备料出库总数
              from [dbo].[备料管理_采购计划明细_查询数据_视图] where 机床流水号 = ${this.machineValue1}) as a
              group by 组号,组件名称`
        }
      }).then(res => {
        this.tableDataDiv20 = res.data
        // for (let i = 0; i < res.data.length; i++) {
        //   this.dataDiv11.xData.push(res.data[i].组号)
        //   this.dataDiv11.yDataA.push(res.data[i].零件条数)
        //   this.dataDiv11.yDataB.push(res.data[i].已备料条数)
        // }
        // this.drawLineDiv11()
      })
    },
    // 装配质检
    async searchDiv21() {
      this.showDiv0 = false
      this.showDiv1 = false
      this.showDiv2 = false
      this.showDiv3 = false
      this.showDiv4 = false
      this.showDiv5 = false
      this.showDiv6 = false
      this.showDiv7 = false
      this.showDiv8 = false
      this.showDiv9 = false
      this.showDiv10 = false
      this.showDiv11 = false
      this.showDiv12 = false
      this.showDiv13 = false
      this.showDiv14 = false
      this.showDiv15 = false
      this.showDiv23 = false
      this.showDiv16 = false
      this.showDiv17 = false
      this.showDiv18 = false
      this.showDiv19 = false
      this.showDiv20 = false
      this.showDiv21 = true
      this.showDiv22 = false
      // this.dataDiv11.yDataB = []
      // this.dataDiv11.yDataA = []
      // this.dataDiv11.xData = []
      await request({
        url: '',
        method: 'post',
        data: {
          type: '3',
          name: `SELECT *
  FROM [质检管理_装配质检_查询视图] where 机床流水号 = ${this.machineValue1} and 组件流水号 is not null`
        }
      }).then(res => {
        this.tableDataDiv21 = res.data
        // for (let i = 0; i < res.data.length; i++) {
        //   this.dataDiv11.xData.push(res.data[i].组号)
        //   this.dataDiv11.yDataA.push(res.data[i].零件条数)
        //   this.dataDiv11.yDataB.push(res.data[i].已备料条数)
        // }
        // this.drawLineDiv11()
      })
    },
    // 总装调试
    async searchDiv22() {
      this.showDiv0 = false
      this.showDiv1 = false
      this.showDiv2 = false
      this.showDiv3 = false
      this.showDiv4 = false
      this.showDiv5 = false
      this.showDiv6 = false
      this.showDiv7 = false
      this.showDiv8 = false
      this.showDiv9 = false
      this.showDiv10 = false
      this.showDiv11 = false
      this.showDiv12 = false
      this.showDiv13 = false
      this.showDiv14 = false
      this.showDiv15 = false
      this.showDiv23 = false
      this.showDiv16 = false
      this.showDiv17 = false
      this.showDiv18 = false
      this.showDiv19 = false
      this.showDiv20 = false
      this.showDiv21 = false
      this.showDiv22 = true
      // this.dataDiv11.yDataB = []
      // this.dataDiv11.yDataA = []
      // this.dataDiv11.xData = []
      await request({
        url: '',
        method: 'post',
        data: {
          type: '3',
          name: `select 机床图号,机床名称,机床装配实际开始时间,机床装配实际完成时间,调试开始时间,调试结束时间 from PDM_机床名称 where  机床流水号 = ${this.machineValue1}`
        }
      }).then(res => {
        this.tableDataDiv22 = res.data
        // for (let i = 0; i < res.data.length; i++) {
        //   this.dataDiv11.xData.push(res.data[i].组号)
        //   this.dataDiv11.yDataA.push(res.data[i].零件条数)
        //   this.dataDiv11.yDataB.push(res.data[i].已备料条数)
        // }
        // this.drawLineDiv11()
      })
    },
    // 查询工艺数据
    async searchDiv13() {
      this.dataDiv13.xData = []
      this.dataDiv13.yDataA = []
      this.dataDiv13.yDataB = []
      this.showDiv0 = false
      this.showDiv1 = false
      this.showDiv2 = false
      this.showDiv3 = false
      this.showDiv4 = false
      this.showDiv5 = false
      this.showDiv6 = false
      this.showDiv7 = false
      this.showDiv8 = false
      this.showDiv9 = false
      this.showDiv10 = false
      this.showDiv11 = false
      this.showDiv12 = false
      this.showDiv13 = true
      this.showDiv14 = false
      this.showDiv15 = false
      this.showDiv16 = false
      this.showDiv17 = false
      this.showDiv18 = false
      this.showDiv19 = false
      this.showDiv20 = false
      this.showDiv21 = false
      this.showDiv22 = false
      this.showDiv23 = false
      await request({
        url: '',
        method: 'post',
        data: {
          type: '3',
          name: `declare @机床流水号 int = ${this.machineValue1}
                  select 机床流水号,组号,组件名称,SUM(零件总数) as 零件总数,SUM(未制定零件数) as 未制定零件数,SUM(已制定零件数) as 已制定零件数 from (
                  --总
                  select 机床流水号,组号,组件名称
                  ,COUNT(*) as 零件总数
                  ,0 as 未制定零件数
                  ,0 as 已制定零件数
                  from 车间生产管理工艺_零件工艺计划_传递后_视图
                  where 机床流水号 = @机床流水号
                  group by 机床流水号,组号,组件名称
                  union all
                  --未
                  select 机床流水号,组号,组件名称
                  ,0 as 零件总数
                  ,COUNT(*) as 未制定零件数
                  ,0 as 已制定零件数
                  from 车间生产管理工艺_零件工艺计划_传递后_视图
                  where 机床流水号 = @机床流水号 and 考核状态 = 3 and 工艺任务分配状态 =2 and 批次零件状态=1
                  group by 机床流水号,组号,组件名称
                  union all
                  --已
                  select 机床流水号,组号,组件名称
                  ,0 as 零件总数
                  ,0 as 未制定零件数
                  ,COUNT(*) as 已制定零件数
                  from 车间生产管理工艺_零件工艺计划_传递后_视图
                  where 机床流水号 = @机床流水号 and 考核状态 >= 4 and 工艺任务分配状态 =2 and 批次零件状态=1
                  group by 机床流水号,组号,组件名称
                  ) as a
                  group by 机床流水号,组号,组件名称`
        }
      }).then(res => {
        this.tableDataDiv13 = res.data
        for (let i = 0; i < res.data.length; i++) {
          this.dataDiv13.xData.push(res.data[i].组号)
          this.dataDiv13.yDataA.push(res.data[i].零件总数)
          this.dataDiv13.yDataB.push(res.data[i].已制定零件数)
        }
        this.drawLineDiv13()
      })
    },
    // 绘制工艺条形图
    drawLineDiv13() {
      const bar = echarts.init(document.getElementById('barDiv13'))
      // 指定图表的配置项和数据
      bar.setOption({
        tooltip: {},
        legend: {
          data: ['零件总数', '已编制条数']
        },
        xAxis: {
          data: this.dataDiv13.xData,
          show: true
        },
        yAxis: {},
        series: [{
          name: '零件总数',
          type: 'bar',
          data: this.dataDiv13.yDataA
        }, {
          name: '已编制条数',
          type: 'bar',
          data: this.dataDiv13.yDataB
        }]
      })
    },
    // 查询定额数据
    async searchDiv14() {
      this.dataDiv14.xData = []
      this.dataDiv14.yDataA = []
      this.dataDiv14.yDataB = []
      this.showDiv0 = false
      this.showDiv1 = false
      this.showDiv2 = false
      this.showDiv3 = false
      this.showDiv4 = false
      this.showDiv5 = false
      this.showDiv6 = false
      this.showDiv7 = false
      this.showDiv8 = false
      this.showDiv9 = false
      this.showDiv10 = false
      this.showDiv11 = false
      this.showDiv12 = false
      this.showDiv13 = false
      this.showDiv14 = true
      this.showDiv15 = false
      this.showDiv16 = false
      this.showDiv17 = false
      this.showDiv18 = false
      this.showDiv19 = false
      this.showDiv20 = false
      this.showDiv21 = false
      this.showDiv22 = false
      this.showDiv23 = false
      await request({
        url: '',
        method: 'post',
        data: {
          type: '3',
          name: `declare @机床流水号 int = ${this.machineValue1}
                  select 机床流水号
                  ,a.组件流水号
                  ,组号
                  ,组件名称
                  ,SUM(零件总数) as 零件总数
                  ,SUM(未制定零件数) as 未制定零件数
                  ,SUM(已制定零件数) as 已制定零件数
                  ,理论总工时
                  from (
                  --总
                  select 机床流水号,组件流水号,组号,组件名称
                  ,COUNT(*) as 零件总数
                  ,0 as 未制定零件数
                  ,0 as 已制定零件数
                  from 车间生产管理工艺_零件工艺计划_传递后_视图
                  where 机床流水号 = @机床流水号
                  group by 机床流水号,组件流水号,组号,组件名称
                  union all
                  --未
                  select 机床流水号,组件流水号,组号,组件名称
                  ,0 as 零件总数
                  ,COUNT(*) as 未制定零件数
                  ,0 as 已制定零件数
                  from 车间生产管理工艺_零件工艺计划_传递后_视图
                  where 机床流水号 = @机床流水号 and 考核状态 = 3 and 工艺任务分配状态 =2 and 批次零件状态=1
                  group by 机床流水号,组件流水号,组号,组件名称
                  union all
                  --已
                  select 机床流水号,组件流水号,组号,组件名称
                  ,0 as 零件总数
                  ,0 as 未制定零件数
                  ,COUNT(*) as 已制定零件数
                  from 车间生产管理工艺_零件工艺计划_传递后_视图
                  where 机床流水号 = @机床流水号 and 考核状态 >= 4 and 工艺任务分配状态 =2 and 批次零件状态=1
                  group by 机床流水号,组件流水号,组号,组件名称
                  ) as a
                  inner join (
                  select 组件流水号
                  ,sum(isnull(单件定额工时,0)*isnull(批次数量,0) + isnull(准结定额工时,0)) as 理论总工时
                  from 车间生产管理工艺_零件工艺计划_传递后_视图
                  inner join 车间生产管理工艺_零件工序 on 车间生产管理工艺_零件工艺计划_传递后_视图.工艺计划流水号 = 车间生产管理工艺_零件工序.工艺计划流水号
                  left JOIN 车间生产管理工艺_基础表_工艺名称 on 车间生产管理工艺_零件工序.工艺编号 = dbo.车间生产管理工艺_基础表_工艺名称.工艺编号
                  where 机床流水号 = @机床流水号 and (isnull(单件定额工时,0) <> 0 or isnull(准结定额工时,0) <> 0)
                  group by 组件流水号
                  ) as b
                  on a.组件流水号 = b.组件流水号
                  group by 机床流水号,a.组件流水号,组号,组件名称,理论总工时
                  order by 组号`
        }
      }).then(res => {
        this.tableDataDiv14 = res.data
        for (let i = 0; i < res.data.length; i++) {
          this.dataDiv14.xData.push(res.data[i].组号)
          this.dataDiv14.yDataA.push(res.data[i].零件总数)
          this.dataDiv14.yDataB.push(res.data[i].已制定零件数)
        }
        this.drawLineDiv14()
      })
    },
    // 绘制定额条形图
    drawLineDiv14() {
      const bar = echarts.init(document.getElementById('barDiv14'))
      // 指定图表的配置项和数据
      bar.setOption({
        tooltip: {},
        legend: {
          data: ['零件总数', '已编制条数']
        },
        xAxis: {
          data: this.dataDiv14.xData,
          show: true
        },
        yAxis: {},
        series: [{
          name: '零件总数',
          type: 'bar',
          data: this.dataDiv14.yDataA
        }, {
          name: '已编制条数',
          type: 'bar',
          data: this.dataDiv14.yDataB
        }]
      })
    },
    // 查询能力平衡数据
    async searchDiv15() {
      this.dataDiv15.xData = []
      this.dataDiv15.yDataA = []
      this.dataDiv15.yDataB = []
      this.showDiv0 = false
      this.showDiv1 = false
      this.showDiv2 = false
      this.showDiv3 = false
      this.showDiv4 = false
      this.showDiv5 = false
      this.showDiv6 = false
      this.showDiv7 = false
      this.showDiv8 = false
      this.showDiv9 = false
      this.showDiv10 = false
      this.showDiv11 = false
      this.showDiv12 = false
      this.showDiv13 = false
      this.showDiv14 = false
      this.showDiv15 = true
      this.showDiv16 = false
      this.showDiv17 = false
      this.showDiv18 = false
      this.showDiv19 = false
      this.showDiv20 = false
      this.showDiv21 = false
      this.showDiv22 = false
      this.showDiv23 = false
      await request({
        url: '',
        method: 'post',
        data: {
          type: '3',
          name: `declare @机床流水号 int = ${this.machineValue1}
                  create table #临时表1
                  (
                      id   int IDENTITY (1,1)     not null,
                      组件流水号 nvarchar(50),
                      primary key (id)
                  );
                  create table #临时表2
                  (
                      id   int IDENTITY (1,1)     not null,
                      组号 nvarchar(50),
                      组件名称 nvarchar(50),
                      完成状态 nvarchar(50),
                      已完成数量 nvarchar(50),
                      零件总条数 nvarchar(50),
                      primary key (id)
                  );
                  insert into #临时表1 select distinct 组件流水号 from dbo.车间生产管理工艺_零件工序_工艺卡报表_视图
                  where 机床流水号=@机床流水号 and 考核状态 > 3
                  declare @id int =1
                  declare @id2 int
                  declare @组号 nvarchar(50)
                  declare @组件名称 nvarchar(50)
                  declare @完成状态 nvarchar(50)
                  declare @已完成数量 int
                  declare @零件总条数 int
                  while (@id<=(select COUNT (id) from #临时表1 ))
                  begin
                   select @已完成数量 = COUNT(工艺计划流水号) from 车间生产管理工艺_零件工序_工艺卡报表_视图
                   where 机床流水号=@机床流水号 and 考核状态 >= 6
                   and 组件流水号=(select 组件流水号 from #临时表1 where id=@id)
                   insert into #临时表2 (已完成数量) values (@已完成数量)
                   set @id2 = @@IDENTITY
                   select @零件总条数 = COUNT(工艺计划流水号) from 车间生产管理工艺_零件工序_工艺卡报表_视图
                   where 机床流水号=@机床流水号 and 考核状态 > 3
                   and 组件流水号=(select 组件流水号 from #临时表1 where id=@id)
                   update #临时表2 set 零件总条数 = @零件总条数
                   where id=@id2
                   select @组件名称 = 组件名称,@组号 = 组号 from 车间生产管理工艺_零件工序_工艺卡报表_视图
                   where 机床流水号=@机床流水号 and 考核状态 > 3
                   and 组件流水号=(select 组件流水号 from #临时表1 where id=@id)
                   update #临时表2 set 组件名称 = @组件名称,组号 = @组号
                   where id=@id2
                   if @已完成数量 <> @零件总条数
                    begin
                     set @完成状态 = '未完成'
                     update #临时表2 set 完成状态 = @完成状态
                     where id=@id2
                    end
                   else
                    begin
                     set @完成状态 = '已完成'
                     update #临时表2 set 完成状态 = @完成状态
                     where id=@id2
                    end
                   set @id = @id + 1
                  end
                  select * from #临时表2 order by 组号
                  drop table #临时表1
                  drop table #临时表2`
        }
      }).then(res => {
        this.tableDataDiv15 = res.data
        for (let i = 0; i < res.data.length; i++) {
          this.dataDiv15.xData.push(res.data[i].组号)
          this.dataDiv15.yDataA.push(res.data[i].零件总条数)
          this.dataDiv15.yDataB.push(res.data[i].已完成数量)
        }
        this.drawLineDiv15()
      })
    },
    // 绘制能力平衡条形图
    drawLineDiv15() {
      const bar = echarts.init(document.getElementById('barDiv15'))
      // 指定图表的配置项和数据
      bar.setOption({
        tooltip: {},
        legend: {
          data: ['零件总数', '已编制条数']
        },
        xAxis: {
          data: this.dataDiv15.xData,
          show: true
        },
        yAxis: {},
        series: [{
          name: '零件总数',
          type: 'bar',
          data: this.dataDiv15.yDataA
        }, {
          name: '已编制条数',
          type: 'bar',
          data: this.dataDiv15.yDataB
        }]
      })
    },
    // 查询发货数据
    async searchDiv23() {
      this.showDiv0 = false
      this.showDiv1 = false
      this.showDiv2 = false
      this.showDiv3 = false
      this.showDiv4 = false
      this.showDiv5 = false
      this.showDiv6 = false
      this.showDiv7 = false
      this.showDiv8 = false
      this.showDiv9 = false
      this.showDiv10 = false
      this.showDiv11 = false
      this.showDiv12 = false
      this.showDiv13 = false
      this.showDiv14 = false
      this.showDiv15 = false
      this.showDiv16 = false
      this.showDiv17 = false
      this.showDiv18 = false
      this.showDiv19 = false
      this.showDiv20 = false
      this.showDiv21 = false
      this.showDiv22 = false
      this.showDiv23 = true
      await request({
        url: '',
        method: 'post',
        data: {
          type: '3',
          name: `select * from 综合查询_发货_查询视图 where 机床流水号 = ${this.machineValue1}`
        }
      }).then(res => {
        this.tableDataDiv23 = res.data
        console.log(this.tableDataDiv23)
      })
    }
  }
}
</script>

<style scoped>
  .red{
    background: red;
  }
  .jixingzhong{
    width: 80px;
    height: 40px;
    background: #7eaced;
    color: black;
    font-weight: bold;
  }
  .yiwancheng{
    width: 80px;
    height: 40px;
    background: #ff9759;
    color: black;
    font-weight: bold;
  }
  .weikaishi{
    width: 80px;
    height: 40px;
    background: #EAEAEA;
    color: black;
    font-weight: bold;
  }
  .el-card{
    margin: 0;
  }
  .showDiv{
    height: 420px;
  }
  .el-button{
    padding-top: 5px;
  }
  .module{
    border-radius: 6px;
    /*background-color: white;*/
    display: inline-block;
  }
  .module:hover{
    box-shadow: 5px 5px 5px #888888;/*设置阴影,可以自定义参数*/
  }
  .process{
    text-align: center;
    margin-left: 0px;
    margin-top: 0px;
    width: 1680px;
    height: 400px;
    /*border: 1px solid red;*/
    background: url('../../../assets/img/img28.png') repeat;
    background-repeat:no-repeat;
    background-size:100% 100%;-moz-background-size:100% 100%;
  }
  .main{
    border: 1px solid  #DCDFE6;
    width:100%;
    overflow-y: hidden;
    overflow-x: auto;
    color: #000;
    font-size: 16px;
    height: 400px;
  }
  .main p{height:300px;}
  /*-------滚动条整体样式----*/
  .main::-webkit-scrollbar {
    width:8px;
    height:8px;
  }
  /*滚动条里面小方块样式*/
  .main::-webkit-scrollbar-thumb {
    border-radius:100px;
    -webkit-box-shadow:inset 0 0 5px rgba(0,0,0,0.2);
    background:#DCDFE6;
  }
  /*滚动条里面轨道样式*/
  .main::-webkit-scrollbar-track {
    -webkit-box-shadow:inset 0 0 5px rgba(0,0,0,0.2);
    border-radius:0;
    background:white;
  }
</style>
