<template>
  <div class="app-container" style="padding-top: 15px;padding-left: 5px">
    <el-row style="margin-bottom: 5px;">
      <el-card class="box-card">
        <div slot="header" class="clearfix">
          <span>待排产施工单</span>
        </div>
        <div style="margin-top: 8px">
          <el-col :span="24" class="text-center">
            <div class="filter-container">
              <el-input size="mini" v-model.trim="search.keyWord" placeholder="施工单号" style="width: 200px;"
                        class="filter-item"/>
              <el-button size="mini" class="filter-item" type="primary" icon="el-icon-search" @click="searchData">
                搜索
              </el-button>

              <el-button type="primary" size="mini" icon="el-icon-refresh" @click="refreshTableInfo">刷新</el-button>
              <el-button type="primary" size="mini" icon="el-icon-copy-document" @click="stampBtn">打印已分配施工单</el-button>


              <!--            <div class="top-right-btn">-->
              <!--              <pagination style="margin-bottom: 20px;" v-show="listData.total>0" :total="listData.total"-->
              <!--                          :page.sync="listData.page"-->
              <!--                          :limit.sync="listData.pageSize" @pagination="getTableInfo"/>-->
              <!--            </div>-->
            </div>
            <div style="position: relative;" class="rowHoverNone">
              <!--              <div style="position: absolute;left: 65px;top: 13px;z-index: 99;">-->
              <!--                <el-dropdown @command="handleCommand" size="mini" split-button>-->
              <!--                  分配机台-->
              <!--                  <el-dropdown-menu slot="dropdown">-->
              <!--                    <el-dropdown-item-->
              <!--                      v-for="item in machineInfList"-->
              <!--                      :key="item.id"-->
              <!--                      :command="item"-->
              <!--                    >{{ item.machineName }}-->
              <!--                    </el-dropdown-item>-->
              <!--                  </el-dropdown-menu>-->
              <!--                </el-dropdown>-->
              <!--              </div>-->
              <el-table
                size="mini"
                class="elTble"
                :data="tableData"
                v-loading="listLoading"
                ref="multipleTable"
                @row-contextmenu="rowContextmenu"
                :row-class-name="rowClass"
                @row-click="handleClickTableRow"
                @selection-change="handleSelectionChange"
                max-height="320"
                row-key="index"
                border
                :default-sort="{prop: 'printBreed.machineTypeName', order: 'descending'}"
                default-expand-all>
                <el-table-column
                  type="selection"
                  width="55">
                </el-table-column>
                <el-table-column
                  label="#"
                  width="50px"
                  align="center"
                  type="index"
                  :index="indexMethod">
                </el-table-column>
                <el-table-column
                  label="施工单号"
                  width="110px"
                >
                  <template slot-scope="{row}">
                    <span @click.stop="getOrderStep(row.idPrintBill)"
                          style="color: #409EFF;cursor: pointer" v-html="showBillCode(row.printBill.billCode)"></span>
                    <el-image v-if="row.printBill.importantBill == 1" :src="new_badge"></el-image>
                  </template>
                </el-table-column>
                <el-table-column
                  label="版名称"
                  show-overflow-tooltip
                  width="140px"
                >
                  <template slot-scope="{row}">
                    <span @click.stop="handleDetail(row.idPrintBill)"
                          style="color: #409EFF;cursor: pointer"> {{ row.printBreed.breedName }}</span>
                  </template>
                </el-table-column>
                <el-table-column
                  width="150"
                  show-overflow-tooltip
                  label="客户名称">
                  <template slot-scope="{row}">
                    <span> {{ row.printBill.clientName }}</span>
                  </template>
                </el-table-column>
                <el-table-column
                  width="150px"
                  show-overflow-tooltip
                  label="印品名称">
                  <template slot-scope="{row}">
                    <span> {{ row.printBill.billName }}</span>
                  </template>
                </el-table-column>
                <el-table-column
                  width="120px"
                  show-overflow-tooltip
                  sortable
                  :sort-by="['printBreed.machineTypeName']"
                  label="机型">
                  <template slot-scope="{row}">
                    <span class="ellipsis"> {{ row.printBreed.machineTypeName }}</span>
                  </template>
                </el-table-column>
                <el-table-column
                  width="140"
                  show-overflow-tooltip
                  label="工单下纸">
                  <template slot-scope="{row}">
                    {{ row.printBreed.paperName }}
                  </template>
                </el-table-column>
                <el-table-column
                  width="170"
                  show-overflow-tooltip
                  label="实际用纸">
                  <template slot-scope="{row}">
                    {{ row.printBreed.actualPaperName }}
                  </template>
                </el-table-column>
                <el-table-column
                  width="60"
                  label="纸张开数">
                  <template slot-scope="{row}">
                    {{ row.printBreed.cutName }}
                  </template>
                </el-table-column>
                <el-table-column
                  width="80"
                  show-overflow-tooltip
                  label="开纸尺寸">
                  <template slot-scope="{row}">
                    {{ row.printBreed.cutSize }}
                  </template>
                </el-table-column>
                <el-table-column
                  label="开单日期"
                  width="120px"
                >
                  <template slot-scope="scope">
                    <span v-if="scope.row.printBill.createTime">{{ scope.row.printBill.createTime | getTime }}</span>
                  </template>
                </el-table-column>
                <el-table-column
                  width="120px"
                  label="产品名称">
                  <template slot-scope="{row}">
                    {{ row.printBill.productName }}
                  </template>
                </el-table-column>
                <el-table-column
                  width="120"
                  label="发货方式">
                  <template slot-scope="{row}">
                    <span v-if="row.printBill.orderSendKind">{{ row.printBill.orderSendKind}}</span>
                  </template>
                </el-table-column>
                <el-table-column
                  width="120px"
                  label="交货日期">
                  <template slot-scope="{row}">
                    <span v-if="row.printBill.deliveryDate">{{ row.printBill.deliveryDate | getTime }}</span>
                  </template>
                </el-table-column>
                <el-table-column
                  width="60"
                  label="翻版方式">
                  <template slot-scope="{row}">
                    <span v-if="row.printBreed.breedFlipType==1">正反</span>
                    <span v-if="row.printBreed.breedFlipType==2">滚翻</span>
                    <span v-if="row.printBreed.breedFlipType==3">自翻</span>
                    <span v-if="row.printBreed.breedFlipType==4">单面</span>
                  </template>
                </el-table-column>
                <el-table-column
                  width="60"
                  label="ps版套数">
                  <template slot-scope="{row}">
                    {{ row.printBreed.psGroupCount }}
                  </template>
                </el-table-column>
                <el-table-column
                  width="60"
                  label="千印数">
                  <template slot-scope="{row}">
                    {{ row.printBreed.printCount1000.toFixed(3) }}
                  </template>
                </el-table-column>
                <el-table-column
                  width="120"
                  label="印工放数+后工放数">
                  <template slot-scope="{row}">
                    {{ row.printBreed.printFlowCount }}+{{ row.printBreed.craftFlowCount }}
                  </template>
                </el-table-column>
              </el-table>

            </div>

          </el-col>
        </div>
      </el-card>

    </el-row>
    <el-row>
      <el-card class="box-card">
        <div slot="header" class="clearfix">
          <span>机台任务</span>
          <el-button
            size="mini"
            class="filter-item"
            style="margin-left: 10px;display: inline-block"
            type="primary"
            @click="handleSort">
            工单排序
          </el-button>
          <el-button class="filter-item" size="mini" type="warning" icon="el-icon-s-operation" @click="diyColumn">
            自定义列
          </el-button>
        </div>
        <div style="position: relative;padding: 8px !important;" class="sortTable-con">

          <!--          <el-tabs size="mini" v-model="activeName" type="card" @tab-click="handleClick">-->
          <!--            <el-tab-pane-->
          <!--              size="mini"-->
          <!--              v-for="(item,index) in machineInfList"-->
          <!--              :key="item.id"-->
          <!--              :name="item.machineName"-->
          <!--              :label="item.machineName"-->
          <!--            >-->
          <!--            </el-tab-pane>-->
          <!--          </el-tabs>-->
          <el-badge
            size="mini"
            v-for="(item,index) in machineInfList"
            :key="item.id"
            class="item-badge">
            <el-button @click="handleClick(index)" v-if="activeName==item.machineName" type="primary" size="mini"
                       class="share-button">
              {{ item.machineName }}
              <span
                style="line-height: 14px;display:block">({{ item.psGroupCount }}/{{ item.printCount1000.toFixed(3) }})</span>
            </el-button>
            <el-button @click="handleClick(index)" v-else size="mini" class="share-button">
              {{ item.machineName }}
              <span
                style="line-height: 14px;display:block">({{ item.psGroupCount }}/{{ item.printCount1000.toFixed(3) }})</span>
            </el-button>
          </el-badge>
          <div style="height: auto" class="elTbleTask rowHoverNone elTble">
            <el-table
              size="mini"
              :data="activeMachineInfList"
              v-loading="listLoadingSort"
              ref="multipleTable2"
              tooltip-effect="dark"
              @row-contextmenu="rowContextmenu2"
              :row-class-name="tableRowClassName"
              @row-click="handleClickTableRow2"
              style="width: 100%;"
              row-key="index"
              max-height="320"
              show-summary
              :summary-method="getSummaries"
              border
              default-expand-all>
              <el-table-column
                fixed
                label="序号"
                width="50px"
                align="center"
                type="index"
                :index="indexMethod">
              </el-table-column>

              <el-table-column
                fixed
                label="施工单号"
                width="120px"
              >
                <template slot-scope="{row}">
                      <span @click="getOrderStep(row.idPrintBill)"
                            style="color: #409EFF;cursor: pointer"
                            v-html="showBillCodeTask(row.printBill.billCode)"></span>
                  <el-image v-if="row.printBill.importantBill == 1" :src="new_badge"></el-image>
                </template>
              </el-table-column>
              <el-table-column
                fixed
                label="版名称"
                show-overflow-tooltip
                width="150px"
              >
                <template slot-scope="{row}">
                    <span @click="handleDetail(row.idPrintBill)"
                          style="color: #409EFF;cursor: pointer">{{ row.printBreed.breedName }}</span>
                </template>
              </el-table-column>
              <el-table-column label="生产状态" fixed width="110px" class-name="small-padding fixed-width">
                <template slot-scope="{row}">
                  <div style="display: inline-block;width: 55px" v-if="row.pauseStatus==0">
                    <el-tag style="display: inline-block" size="mini" type="info" v-if="row.taskStatus==0">未开始</el-tag>
                    <!--            <el-tag type="warning" type="info" v-if="row.taskStatus==0 && row.pauseStatus==1">暂停</el-tag>-->
                    <el-tag style="display: inline-block" size="mini" type="primary" v-if="row.taskStatus==1">生产中</el-tag>
                    <el-tag style="display: inline-block" size="mini" type="danger" v-if="row.taskStatus==2">终止</el-tag>
                    <el-tag style="display: inline-block" size="mini" type="success" v-if="row.taskStatus==5">完成</el-tag>
                    <el-tag style="display: inline-block" size="mini" type="success" v-if="row.taskStatus==10">已完成</el-tag>
                  </div>
                  <div style="display: inline-block;width: 55px" v-if="row.pauseStatus==1">
                    <el-tag style="display: inline-block" size="mini" type="warning" v-if="row.taskStatus==0 || row.taskStatus==1">暂停</el-tag>
                  </div>
                  <span v-if="row.printBreed.breedProcess">
                    <el-image :title="row.printBreed.breedProcess" v-if="row.printBreed.breedProcess.indexOf('UV')!=-1 || row.printBreed.breedProcess.indexOf('烫金')!=-1  || row.printBreed.breedProcess.indexOf('击凸')!=-1 || row.printBreed.breedProcess.indexOf('打铆钉')!=-1 || row.printBreed.breedProcess.indexOf('打气眼')!=-1 || row.printBreed.breedProcess.indexOf('压纹')!=-1 || row.printBreed.breedProcess.indexOf('浮雕烫金')!=-1 || row.printBreed.breedProcess.indexOf('丝网印金')!=-1 || row.printBreed.breedProcess.indexOf('冷烫')!=-1"  style="width: 20px; height: 20px;display: inline-block;vertical-align: middle;" :src="tagging_img"></el-image>
                  </span>
                </template>
              </el-table-column>
              <template v-for="column in columnTable">
                <el-table-column
                  label="施工单消息"
                  v-if="column.columnTitle == 'breedMsg'"
                  :width="column.columnWidth"
                  show-overflow-tooltip
                >
                  <template slot-scope="{row}">
                    <template v-if="row.breedMsg">
                      <el-button size="mini" icon="el-icon-plus" @click="openMessage(row)"></el-button>
                      <span
                        style="color: #20a0ff; cursor: pointer"
                        @click="openMessage(row)"> {{ row.breedMsg }}
                      </span>
                    </template>
                    <template v-else>
                      <el-button size="mini" icon="el-icon-plus" @click="openMessage(row)"></el-button>
                    </template>
                  </template>
                </el-table-column>
                <el-table-column
                  v-else-if="column.columnTitle == 'machineTypeName'"
                  :width="column.columnWidth"
                  show-overflow-tooltip
                  label="印刷机型">
                  <template slot-scope="{row}">
                    <span> {{ row.printBreed.machineTypeName }}</span>
                  </template>
                </el-table-column>
                <el-table-column
                  v-else-if="column.columnTitle == 'clientName'"
                  :width="column.columnWidth"
                  show-overflow-tooltip
                  label="客户名称">
                  <template slot-scope="{row}">
                    <span> {{ row.printBill.clientName }}</span>
                  </template>
                </el-table-column>
                <el-table-column
                  v-else-if="column.columnTitle == 'billName'"
                  :width="column.columnWidth"
                  show-overflow-tooltip
                  label="印品名称">
                  <template slot-scope="{row}">
                    <span> {{ row.printBill.billName }}</span>
                  </template>
                </el-table-column>
                <el-table-column
                  label="拼版要求"
                  show-overflow-tooltip
                  v-else-if="column.columnTitle == 'assembleBreedRequire'"
                  :width="column.columnWidth"
                >
                  <template slot-scope="{row}">
                      <span>
                        {{ row.printBill.assembleBreedRequire }}
                      </span>
                  </template>
                </el-table-column>
                <el-table-column
                  label="印刷要求"
                  show-overflow-tooltip
                  v-else-if="column.columnTitle == 'orderPrintRequire'"
                  :width="column.columnWidth"
                >
                  <template slot-scope="{row}">
                      <span>
                        {{ row.printBill.orderPrintRequire }}
                      </span>
                  </template>
                </el-table-column>
                <el-table-column
                  label="多机台"
                  show-overflow-tooltip
                  v-else-if="column.columnTitle == 'otherBreedStatus'"
                  :width="column.columnWidth"
                >
                  <template slot-scope="{row}">
                      <span>
                        {{ row.otherBreedStatus }}
                      </span>
                  </template>
                </el-table-column>
                <el-table-column
                  v-else-if="column.columnTitle == 'paperName'"
                  :width="column.columnWidth"
                  show-overflow-tooltip
                  label="工单下纸">
                  <template slot-scope="{row}">
                    {{ row.printBreed.paperName }}
                  </template>
                </el-table-column>
                <el-table-column
                  v-else-if="column.columnTitle == 'actualPaperName'"
                  :width="column.columnWidth"
                  show-overflow-tooltip
                  label="实际用纸">
                  <template slot-scope="{row}">
                    {{ row.printBreed.actualPaperName }}
                  </template>
                </el-table-column>
                <el-table-column
                  v-else-if="column.columnTitle == 'cutName'"
                  :width="column.columnWidth"
                  label="纸张开数">
                  <template slot-scope="{row}">
                    {{ row.printBreed.cutName }}
                  </template>
                </el-table-column>
                <el-table-column
                  v-else-if="column.columnTitle == 'cutSize'"
                  :width="column.columnWidth"
                  show-overflow-tooltip
                  label="开纸尺寸">
                  <template slot-scope="{row}">
                    {{ row.printBreed.cutSize }}
                  </template>
                </el-table-column>
                <el-table-column
                  label="开单日期"
                  v-else-if="column.columnTitle == 'createTime'"
                  :width="column.columnWidth"
                >
                  <template slot-scope="scope">
                    <span v-if="scope.row.printBill.createTime">{{ scope.row.printBill.createTime | getTime }}</span>
                  </template>
                </el-table-column>
                <el-table-column
                  v-else-if="column.columnTitle == 'productName'"
                  :width="column.columnWidth"
                  label="产品名称">
                  <template slot-scope="{row}">
                    {{ row.printBill.productName }}
                  </template>
                </el-table-column>
                <el-table-column
                  v-else-if="column.columnTitle == 'breedProcess'"
                  :width="column.columnWidth"
                  show-overflow-tooltip
                  label="特殊工艺">
                  <template slot-scope="{row}">
                    {{ row.printBreed.breedProcess }}
                  </template>
                </el-table-column>
                <el-table-column
                  v-else-if="column.columnTitle == 'orderSendKind'"
                  :width="column.columnWidth"
                  label="发货方式">
                  <template slot-scope="{row}">
                    <span v-if="row.printBill.orderSendKind">{{ row.printBill.orderSendKind}}</span>
                  </template>
                </el-table-column>
                <el-table-column
                  v-else-if="column.columnTitle == 'deliveryDate'"
                  :width="column.columnWidth"
                  label="交货日期">
                  <template slot-scope="{row}">
                    <span v-if="row.printBill.deliveryDate">{{ row.printBill.deliveryDate | getTime }}</span>
                  </template>
                </el-table-column>
                <el-table-column
                  v-else-if="column.columnTitle == 'breedFlipType'"
                  :width="column.columnWidth"
                  label="翻版方式">
                  <template slot-scope="{row}">
                    <span v-if="row.printBreed.breedFlipType==1">正反</span>
                    <span v-if="row.printBreed.breedFlipType==2">滚翻</span>
                    <span v-if="row.printBreed.breedFlipType==3">自翻</span>
                    <span v-if="row.printBreed.breedFlipType==4">单面</span>
                  </template>
                </el-table-column>
                <el-table-column
                  v-else-if="column.columnTitle == 'psGroupCount'"
                  :width="column.columnWidth"
                  label="ps版套数">
                  <template slot-scope="{row}">
                    {{ row.printBreed.psGroupCount }}
                  </template>
                </el-table-column>
                <el-table-column
                  v-else-if="column.columnTitle == 'printCount1000'"
                  :width="column.columnWidth"
                  label="千印数">
                  <template slot-scope="{row}">
                    {{ row.printBreed.printCount1000.toFixed(3) }}
                  </template>
                </el-table-column>
                <el-table-column
                  v-else-if="column.columnTitle == 'printFlowCount'"
                  :width="column.columnWidth"
                  label="印工放数+后工放数">
                  <template slot-scope="{row}">
                    {{ row.printBreed.printFlowCount }}+{{ row.printBreed.craftFlowCount }}
                  </template>
                </el-table-column>
                <el-table-column
                  v-else-if="column.columnTitle == 'assembleMan'"
                  :width="column.columnWidth"
                  label="拼版人">
                  <template slot-scope="{row}">
                    <span v-if="row.assembleStatusInt==10"> {{ row.assembleMan }}</span>
                  </template>
                </el-table-column>
                <!--                  <el-table-column-->
                <!--                    width="100"-->
                <!--                    label="拼版人确认人">-->
                <!--                    <template slot-scope="{row}">-->
                <!--                      {{ row.assembleMan }}-->
                <!--                    </template>-->
                <!--                  </el-table-column>-->
                <el-table-column
                  v-else-if="column.columnTitle == 'madeBreedMan'"
                  :width="column.columnWidth"
                  label="制版人">
                  <template slot-scope="{row}">
                    <span v-if="row.madeBreedStatusInt==10"> {{ row.madeBreedMan }}</span>

                  </template>
                </el-table-column>
                <el-table-column
                  v-else-if="column.columnTitle == 'cutPaperMan'"
                  :width="column.columnWidth"
                  label="白料裁切人">
                  <template slot-scope="{row}">
                    <span v-if="row.cutPaperStatusInt==10"> {{ row.cutPaperMan }}</span>
                  </template>
                </el-table-column>
                <el-table-column
                  v-else-if="column.columnTitle == 'wholePaperCount'"
                  :width="column.columnWidth"
                  label="大纸张数">
                  <template slot-scope="{row}">
                    {{ row.printBreed.wholePaperCount }}
                  </template>
                </el-table-column>
                <el-table-column
                  v-else-if="column.columnTitle == 'printCount'"
                  :width="column.columnWidth"
                  label="印量">
                  <template slot-scope="{row}">
                    {{ row.printBreed.printCount }}
                  </template>
                </el-table-column>
                <el-table-column
                  v-else-if="column.columnTitle == 'expectedWorkTime'"
                  :width="column.columnWidth"
                  label="印刷耗时（分钟）">
                  <template slot-scope="{row}">
                    {{ row.expectedWorkTime }}
                  </template>
                </el-table-column>
              </template>
            </el-table>
          </div>
          <!--            <div v-else>-->
          <!--              <span class="text-task">该机台暂无排产任务</span>-->
          <!--            </div>-->


        </div>
      </el-card>

    </el-row>
    <!--    <servicedialog @tableRefresh="tableRefresh" ref="menuDialog" :dialogStatus="dialogStatus" :menuId="menuId" :titleDialog="titleDialog" :dialogVisible="dialogVisible"/>-->
    <printbill-detail ref="printbillDetail"></printbill-detail>


    <el-dialog title="反馈设置" :visible.sync="dialogFormVisible" width="750px">
      <el-table
        border
        :fit="false"
        ref="multipleTable3"
        @selection-change="handleSelectionChange3"
        :data="printBreedTasks"
        style="width: 100%">
        <el-table-column
          align="right"
          label="选择"
          :selectable="selectable"
          type="selection"
          width="40">
        </el-table-column>
        <el-table-column
          label="操作"
          width="180px"
          align="left"
        >

          <template slot-scope="scope">
            重新反馈{{ scope.row.processName }}
          </template>
        </el-table-column>
        <el-table-column
          prop="processName"
          label="工序"
          width="180">
        </el-table-column>
        <el-table-column
          prop="lastOperateManName"
          label="最后操作人名字"
          width="180">
        </el-table-column>
        <el-table-column label="状态" align="center" width="110px" class-name="small-padding fixed-width">
          <template slot-scope="{row}">
            <el-tag size="mini" type="info" v-if="row.taskStatus==0">未开始</el-tag>
            <el-tag size="mini" v-if="row.taskStatus==1">生产中</el-tag>
            <el-tag size="mini" type="danger" v-if="row.taskStatus==2">终止</el-tag>
            <el-tag size="mini" type="success" v-if="row.taskStatus==10">已完成</el-tag>
          </template>
        </el-table-column>
      </el-table>
      <div slot="footer" class="dialog-footer">
        <el-button @click="dialogFormVisible = false">取 消</el-button>
        <el-button :disabled="btnClick" type="primary" @click="backBreedTaskBtn">确 定</el-button>
      </div>
    </el-dialog>
    <el-dialog title="反馈设置" :visible.sync="dialogFormVisible2" width="750px">

      <div>
        <el-checkbox-group v-model="checkList">
          <div
            v-for="(item,index) in printBreedTasks2.breedTasksAssortedList"
            :key="index"
          >
            <div style="width: 380px;height: 30px;"><span
              style="color: #3c3c3c;font-size: 16px;line-height: 30px">{{ item.breedName }}</span></div>
            <div
              style="margin-left: 25px;"
              v-for="(item,index) in item.taskList"
              :key="item.id"
            >
              <el-checkbox :disabled="item.processName=='拼版'" style="line-height: 30px;color: #7c7c7c" :label="item"><span
                style="color: #7c7c7c;font-size: 13px;line-height: 30px;padding-left: 18px;">重新反馈{{ item.processName }}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 最后操作人名字:&nbsp;&nbsp;{{
                  item.lastOperateManName
                }}</span>
              </el-checkbox>


            </div>

          </div>
        </el-checkbox-group>
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button @click="dialogFormVisible2 = false">取 消</el-button>
        <el-button type="primary" @click="backBreedTaskBtn2">确 定</el-button>
      </div>
    </el-dialog>
    <el-dialog title="重新分配机台反馈设置" :visible.sync="dialogFormVisible3" width="750px">

      <div v-if="row">
        <el-checkbox-group v-model="checkListRow">
          <div>
            <div v-if="row.printBreed" style="width: 380px;height: 30px;margin-left: 10px;"><span
              style="color: #3c3c3c;font-size: 16px;line-height: 30px">{{ row.printBreed.breedName }}</span></div>
            <div style="margin-left: 35px;">
              <el-checkbox disabled style="line-height: 30px;color: #7c7c7c" label="拼版">
                <span style="font-size: 13px;line-height: 30px;width: 100px;display: inline-block">重新反馈拼版</span>
                <span style="color: #7c7c7c;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 状态:&nbsp;&nbsp;{{
                    row.assembleStatus
                  }}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 最后操作人名字:&nbsp;&nbsp;{{ row.assembleMan }}</span>
              </el-checkbox>
              <el-checkbox style="line-height: 30px;color: #7c7c7c" label="白料裁切">
                <span style="font-size: 13px;line-height: 30px;width: 100px;display: inline-block">重新反馈白料裁切</span>
                <span style="color: #7c7c7c;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 状态:&nbsp;&nbsp;{{
                    row.cutPaperStatus
                  }}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 最后操作人名字:&nbsp;&nbsp;{{ row.cutPaperMan }}</span>
              </el-checkbox>
              <el-checkbox style="line-height: 30px;color: #7c7c7c" label="制版">
                <span style="font-size: 13px;line-height: 30px;width: 100px;display: inline-block">重新反馈制版</span>
                <span style="color: #7c7c7c;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 状态:&nbsp;&nbsp;{{
                    row.madeBreedStatus
                  }}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 最后操作人名字:&nbsp;&nbsp;{{ row.madeBreedMan }}</span>
              </el-checkbox>
            </div>

          </div>
        </el-checkbox-group>
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button @click="dialogFormVisible3 = false">取 消</el-button>
        <el-button type="primary" @click="backBreedTaskBtn3">确 定</el-button>
      </div>
    </el-dialog>
    <!--待排产表格右键开始-->
    <allot-button :machineInfList="machineInfList" v-if="menuVisible" @foo="foo" ref="contextbutton"
                  @handleOne="handleOne" @handleTwo="handleTwo" @handleThree="handleThree"></allot-button>
    <!--待排产表格右键结束-->

    <!--机台任务表格右键开始-->
    <task-button :activeIndex="activeIndex" :machineInfList="machineInfList" v-if="menuVisible1" @foo1="foo1"
                 ref="taskbutton" :btnList="btnList" @handlestart="handlestart" @handleThree2="handleThree2"
                 @handleTwo2="handleTwo2"></task-button>
    <!--机台任务表格右键结束-->
    <!--待排产表格右键开始-->
    <div id="contextmenuSort">
      <sort-button v-if="menuVisibleSort" @foo2="foo2" ref="sortbutton"
                   @handleTopping="handleTopping"></sort-button>
    </div>

    <!--待排产表格右键结束-->
    <print-step ref="printStep"></print-step>

    <el-dialog title="工单排序" top="10" :fullscreen="true" :visible.sync="dialogSort" style="" width="95%">
      <div style="width: 100%;">
        <el-input size="small" v-model="search.keyWord" placeholder="施工单号" style="width: 200px;"
                  class="filter-item"/>
        <el-button size="small" class="filter-item" type="primary" icon="el-icon-search" @click="searchData">
          搜索
        </el-button>
        <el-button
          class="filter-item"
          style="margin-left: 10px;margin-bottom: 15px;"
          type="primary"
          size="small"
          :disabled="disabledSave"
          @click="handleSave">
          排序保存
        </el-button>
        <span>(<span style="color: #E6A23C">只保存当前展示机台任务</span>)</span>
        <el-button type="primary" plain size="small" @click="handleClose">关 闭</el-button>
      </div>
      <div class="sortTable-con">
        <el-badge
          size="mini"

          v-for="(item,index) in machineInfList"
          :key="item.id"
          class="item-badge">
          <el-button @click="handleClick(index)" v-if="activeName==item.machineName" type="primary" size="mini"
                     class="share-button">
            {{ item.machineName }}

            <span
              style="line-height: 14px;display:block">({{ item.psGroupCount }}/{{ item.printCount1000.toFixed(3) }})</span>
          </el-button>
          <el-button @click="handleClick(index)" v-else size="mini" class="share-button">
            {{ item.machineName }}
            <span
              style="line-height: 14px;display:block">({{ item.psGroupCount }}/{{ item.printCount1000.toFixed(3) }})</span>
          </el-button>
        </el-badge>
      </div>
      <div class="elTbleSort dropTableList">
        <el-table
          class="tb-edit"
          size="mini"
          ref="multipleTableSort"
          max-height="650"
          v-loading="listLoadingSort"
          highlight-current-row
          :row-class-name="tableRowClassName2"
          :data="activeMachineInfList"
          @row-contextmenu="rowContextmenuSort"
          @row-click="handleClickTableSort"
          @selection-change="handleSelectionChangeSort"
          show-summary
          :summary-method="getSummaries2"
          tooltip-effect="dark"
          style="width: 100%;"
          row-key="index"
          border
          default-expand-all>
          <el-table-column fixed label="操作" width="70px" class-name="small-padding fixed-width">
            <template slot-scope="scope">
              <el-button @click.stop="handleSortFirst(scope.row,scope.$index)" type="primary" size="mini">
                <span style="color: #fff !important;">置顶</span>
              </el-button>
              <!--            <el-popover-->
              <!--              :ref="`popover-${scope.row.id}`"-->
              <!--              size="mini"-->
              <!--              placement="top"-->
              <!--              width="150px"-->
              <!--              trigger="click">-->
              <!--              <el-input style="width: 140px" size="mini" v-model="inputNum">-->
              <!--                <el-button @click="handleSortNum(scope.row,scope.$index)" slot="append">确定</el-button>-->
              <!--              </el-input>-->
              <!--              <el-button type="primary" size="mini"  slot="reference">数字排序</el-button>-->
              <!--            </el-popover>-->

            </template>
          </el-table-column>
          <el-table-column
            width="60px"
            fixed
            align="center"
            label="排序">
            <template slot-scope="scope">
              <div
                @click.stop="handleInput"
                v-show="scope.$index==scopeIndex"
              >
                <el-input
                  size="mini"
                  style="padding: 0px !important;"
                  v-model="scope.row.sortIndex"
                  placeholder="请输入内容"
                  @change="handleEdit(scope.$index, scope.row.sortIndex,scope.row)"></el-input>
              </div>

              <!--                      <span>{{ scope.row.breedName }}</span>-->
              <span v-show="scope.$index!=scopeIndex"  style="width: 60px;display: inline-block" @click.stop="handleTemplate(scope.$index)">{{ scope.row.sortIndex }}</span>
            </template>
          </el-table-column>
          <el-table-column
            type="selection"
            fixed
            width="55">
          </el-table-column>
          <el-table-column
            fixed
            label="施工单号"
            width="120px"
          >
            <template slot-scope="{row}">
                      <span @click.stop="getOrderStep(row.idPrintBill)"
                            style="color: #409EFF;cursor: pointer"
                            v-html="showBillCodeSort(row.printBill.billCode)"></span>
              <el-image v-if="row.printBill.importantBill == 1" :src="new_badge"></el-image>
            </template>
          </el-table-column>

          <el-table-column
            label="版名称"
            fixed
            show-overflow-tooltip
            width="150px"
          >
            <template slot-scope="{row}">
                    <span @click.stop="handleDetail(row.idPrintBill)"
                          style="color: #409EFF;cursor: pointer">{{ row.printBreed.breedName }}</span>
            </template>
          </el-table-column>
          <el-table-column label="生产状态" align="left" fixed width="110px" class-name="small-padding fixed-width">
            <template slot-scope="{row}">
              <div style="display: inline-block;width: 55px" v-if="row.pauseStatus==0">
                <el-tag size="mini" type="info" v-if="row.taskStatus==0">未开始</el-tag>
                <!--            <el-tag type="warning" type="info" v-if="row.taskStatus==0 && row.pauseStatus==1">暂停</el-tag>-->
                <el-tag size="mini" type="primary" v-if="row.taskStatus==1">生产中</el-tag>
                <el-tag size="mini" type="danger" v-if="row.taskStatus==2">终止</el-tag>
                <el-tag size="mini" type="success" v-if="row.taskStatus==5">完成</el-tag>
                <el-tag size="mini" type="success" v-if="row.taskStatus==10">已完成</el-tag>
              </div>
              <div style="display: inline-block;width: 55px" v-if="row.pauseStatus==1">
                <el-tag size="mini" type="warning" v-if="row.taskStatus==0 || row.taskStatus==1">暂停</el-tag>
              </div>
              <span v-if="row.printBreed.breedProcess">
                <el-image :title="row.printBreed.breedProcess" v-if="row.printBreed.breedProcess.indexOf('UV')!=-1 || row.printBreed.breedProcess.indexOf('烫金')!=-1  || row.printBreed.breedProcess.indexOf('击凸')!=-1 || row.printBreed.breedProcess.indexOf('打铆钉')!=-1 || row.printBreed.breedProcess.indexOf('打气眼')!=-1 || row.printBreed.breedProcess.indexOf('压纹')!=-1 || row.printBreed.breedProcess.indexOf('浮雕烫金')!=-1 || row.printBreed.breedProcess.indexOf('丝网印金')!=-1 || row.printBreed.breedProcess.indexOf('冷烫')!=-1"  style="width: 20px; height: 20px;display: inline-block;vertical-align: middle;" :src="tagging_img"></el-image>
              </span>
            </template>
          </el-table-column>
          <template v-for="column in columnTable">
            <el-table-column
              label="施工单消息"
              v-if="column.columnTitle == 'breedMsg'"
              :width="column.columnWidth"
              show-overflow-tooltip
            >
              <template slot-scope="{row}">
                <template v-if="row.breedMsg">
                  <el-button size="mini" icon="el-icon-plus" @click="openMessage(row)"></el-button>
                  <span
                    style="color: #20a0ff; cursor: pointer"
                    @click="openMessage(row)"> {{ row.breedMsg }}</span>
                </template>
                <template v-else>
                  <el-button size="mini" icon="el-icon-plus" @click="openMessage(row)"></el-button>
                </template>
              </template>
            </el-table-column>
            <el-table-column
              v-else-if="column.columnTitle == 'machineTypeName'"
              :width="column.columnWidth"
              show-overflow-tooltip
              label="印刷机型">
              <template slot-scope="{row}">
                <span> {{ row.printBreed.machineTypeName }}</span>
              </template>
            </el-table-column>
            <el-table-column
              v-else-if="column.columnTitle == 'clientName'"
              :width="column.columnWidth"
              show-overflow-tooltip
              label="客户名称">
              <template slot-scope="{row}">
                <span> {{ row.printBill.clientName }}</span>
              </template>
            </el-table-column>
            <el-table-column
              v-else-if="column.columnTitle == 'billName'"
              :width="column.columnWidth"
              show-overflow-tooltip
              label="印品名称">
              <template slot-scope="{row}">
                <span> {{ row.printBill.billName }}</span>
              </template>
            </el-table-column>
            <el-table-column
              label="拼版要求"
              show-overflow-tooltip
              v-else-if="column.columnTitle == 'assembleBreedRequire'"
              :width="column.columnWidth"
            >
              <template slot-scope="{row}">
                      <span>
                        {{ row.printBill.assembleBreedRequire }}
                      </span>
              </template>
            </el-table-column>
            <el-table-column
              label="印刷要求"
              show-overflow-tooltip
              v-else-if="column.columnTitle == 'orderPrintRequire'"
              :width="column.columnWidth"
            >
              <template slot-scope="{row}">
                      <span>
                        {{ row.printBill.orderPrintRequire }}
                      </span>
              </template>
            </el-table-column>
            <el-table-column
              label="多机台"
              show-overflow-tooltip
              v-else-if="column.columnTitle == 'otherBreedStatus'"
              :width="column.columnWidth"
            >
              <template slot-scope="{row}">
                      <span>
                        {{ row.otherBreedStatus }}
                      </span>
              </template>
            </el-table-column>
            <el-table-column
              v-else-if="column.columnTitle == 'paperName'"
              :width="column.columnWidth"
              show-overflow-tooltip
              label="工单下纸">
              <template slot-scope="{row}">
                {{ row.printBreed.paperName }}
              </template>
            </el-table-column>
            <el-table-column
              v-else-if="column.columnTitle == 'actualPaperName'"
              :width="column.columnWidth"
              show-overflow-tooltip
              label="实际用纸">
              <template slot-scope="{row}">
                {{ row.printBreed.actualPaperName }}
              </template>
            </el-table-column>
            <el-table-column
              v-else-if="column.columnTitle == 'cutName'"
              :width="column.columnWidth"
              label="纸张开数">
              <template slot-scope="{row}">
                {{ row.printBreed.cutName }}
              </template>
            </el-table-column>
            <el-table-column
              v-else-if="column.columnTitle == 'cutSize'"
              :width="column.columnWidth"
              show-overflow-tooltip
              label="开纸尺寸">
              <template slot-scope="{row}">
                {{ row.printBreed.cutSize }}
              </template>
            </el-table-column>
            <el-table-column
              label="开单日期"
              v-else-if="column.columnTitle == 'createTime'"
              :width="column.columnWidth"
            >
              <template slot-scope="scope">
                <span v-if="scope.row.printBill.createTime">{{ scope.row.printBill.createTime | getTime }}</span>
              </template>
            </el-table-column>
            <el-table-column
              v-else-if="column.columnTitle == 'productName'"
              :width="column.columnWidth"
              label="产品名称">
              <template slot-scope="{row}">
                {{ row.printBill.productName }}
              </template>
            </el-table-column>
            <el-table-column
              v-else-if="column.columnTitle == 'breedProcess'"
              :width="column.columnWidth"
              show-overflow-tooltip
              label="特殊工艺">
              <template slot-scope="{row}">
                {{ row.printBreed.breedProcess }}
              </template>
            </el-table-column>
            <el-table-column
              v-else-if="column.columnTitle == 'orderSendKind'"
              :width="column.columnWidth"
              label="发货方式">
              <template slot-scope="{row}">
                <span v-if="row.printBill.orderSendKind">{{ row.printBill.orderSendKind}}</span>
              </template>
            </el-table-column>
            <el-table-column
              v-else-if="column.columnTitle == 'deliveryDate'"
              :width="column.columnWidth"
              label="交货日期">
              <template slot-scope="{row}">
                <span v-if="row.printBill.deliveryDate">{{ row.printBill.deliveryDate | getTime }}</span>
              </template>
            </el-table-column>
            <el-table-column
              v-else-if="column.columnTitle == 'breedFlipType'"
              :width="column.columnWidth"
              label="翻版方式">
              <template slot-scope="{row}">
                <span v-if="row.printBreed.breedFlipType==1">正反</span>
                <span v-if="row.printBreed.breedFlipType==2">滚翻</span>
                <span v-if="row.printBreed.breedFlipType==3">自翻</span>
                <span v-if="row.printBreed.breedFlipType==4">单面</span>
              </template>
            </el-table-column>
            <el-table-column
              v-else-if="column.columnTitle == 'psGroupCount'"
              :width="column.columnWidth"
              label="ps版套数">
              <template slot-scope="{row}">
                {{ row.printBreed.psGroupCount }}
              </template>
            </el-table-column>
            <el-table-column
              v-else-if="column.columnTitle == 'printCount1000'"
              :width="column.columnWidth"
              label="千印数">
              <template slot-scope="{row}">
                {{ row.printBreed.printCount1000.toFixed(3) }}
              </template>
            </el-table-column>
            <el-table-column
              v-else-if="column.columnTitle == 'printFlowCount'"
              :width="column.columnWidth"
              label="印工放数+后工放数">
              <template slot-scope="{row}">
                {{ row.printBreed.printFlowCount }}+{{ row.printBreed.craftFlowCount }}
              </template>
            </el-table-column>
            <el-table-column
              v-else-if="column.columnTitle == 'assembleMan'"
              :width="column.columnWidth"
              label="拼版人">
              <template slot-scope="{row}">
                <span v-if="row.assembleStatusInt==10"> {{ row.assembleMan }}</span>
              </template>
            </el-table-column>
            <!--                  <el-table-column-->
            <!--                    width="100"-->
            <!--                    label="拼版人确认人">-->
            <!--                    <template slot-scope="{row}">-->
            <!--                      {{ row.assembleMan }}-->
            <!--                    </template>-->
            <!--                  </el-table-column>-->
            <el-table-column
              v-else-if="column.columnTitle == 'madeBreedMan'"
              :width="column.columnWidth"
              label="制版人">
              <template slot-scope="{row}">
                <span v-if="row.madeBreedStatusInt==10"> {{ row.madeBreedMan }}</span>

              </template>
            </el-table-column>
            <el-table-column
              v-else-if="column.columnTitle == 'cutPaperMan'"
              :width="column.columnWidth"
              label="白料裁切人">
              <template slot-scope="{row}">
                <span v-if="row.cutPaperStatusInt==10"> {{ row.cutPaperMan }}</span>
              </template>
            </el-table-column>
            <el-table-column
              v-else-if="column.columnTitle == 'wholePaperCount'"
              :width="column.columnWidth"
              label="大纸张数">
              <template slot-scope="{row}">
                {{ row.printBreed.wholePaperCount }}
              </template>
            </el-table-column>
            <el-table-column
              v-else-if="column.columnTitle == 'printCount'"
              :width="column.columnWidth"
              label="印量">
              <template slot-scope="{row}">
                {{ row.printBreed.printCount }}
              </template>
            </el-table-column>
            <el-table-column
              v-else-if="column.columnTitle == 'expectedWorkTime'"
              :width="column.columnWidth"
              label="印刷耗时（分钟）">
              <template slot-scope="{row}">
                {{ row.expectedWorkTime }}
              </template>
            </el-table-column>
          </template>

        </el-table>
      </div>


    </el-dialog>
    <el-drawer
      title="施工单消息"
      :reverse="true"
      :visible.sync="memoDrawer"
      size="600px">
      <order-message @handleAddBreed="handleAddBreed" ref="orderMessage"></order-message>
    </el-drawer>
    <el-dialog :title="printbilTitle" :visible.sync="printbilVisible" width="500px">
      <el-form :model="printForm" label-width="50px" ref="ruleForm" label-position="right">
        <el-form-item prop="taskMemo" label="备注">
          <el-input type="textarea" v-model="printForm.taskMemo"></el-input>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="printbilVisible = false">取 消</el-button>
        <el-button :disabled="disabledBtn" type="primary" @click="printBtn">确 定</el-button>
      </div>
    </el-dialog>
    <el-drawer
      title="选择打印的施工单"
      :visible.sync="table"
      direction="rtl"
      size="350">
      <el-button style="margin-left: 10px;margin-bottom: 10px" size="small" @click="removeItemBtn()">清 空</el-button>
      <el-button style="margin-left: 10px;margin-bottom: 10px" size="small" type="warning" @click="printData()">打 印
      </el-button>

      <el-table
        ref="multipleDrawe"
        @selection-change="handleDraweChange"
        border
        size="mini"
        :data="localTableData"
      >
        <el-table-column
          label="#"
          width="50px"
          align="center"
          type="index"
          :index="indexMethod">
        </el-table-column>
        <el-table-column
          type="selection"
          width="55">
        </el-table-column>
        <el-table-column
          label="施工单号"
          width="110px"
        >
          <template slot-scope="{row}">
            <span v-html="row.billCode"></span>
          </template>
        </el-table-column>
        <el-table-column
          label="产品名称"
          width="180px"
        >
          <template slot-scope="{row}">
            <el-tooltip :content="row.productName" placement="top-start" effect="light">
              <span class="ellipsis"> {{ row.productName }}</span>
            </el-tooltip>
          </template>
        </el-table-column>
      </el-table>
    </el-drawer>
    <column-edit @saveColum="saveColum" ref="columnEdit"></column-edit>

  </div>
</template>

<script>
import {
  getInfo,
  getAllEnableMachineInfo,
  scheduleBreedTask,
  backBreedTask,
  sortBreedTask,
  backPrintBill,
  queryAssorted,
  queryPrintBreedTasksAssorted, calcAllMachineTaskCollection,
  findMachineByKeyWord
} from '@/api/printbill/breedTasks/breedTasks.js'
import Sortable from "sortablejs"
import PrintbillDetail from "@/components/printbillDetail/printbillDetail";
import allotButton from '../allotButton/index.vue'
import taskButton from '../taskButton/index.vue'
import sortButton from '../sortButton/index.vue'
import OrderMessage from '@/views/feedBack/orderMessage/orderMessage'
import printStep from "@/components/printbillDetail/printStep";
// import {lockWorkParts} from "@/api/printbill/editionList";
import elTableInfiniteScroll from 'el-table-infinite-scroll';
import {getPageTableColumn, savePageTableColumn, taskFeedbackPause, taskFeedbackStart} from "@/api/feedBack/feedBack";
import {printBillDoPrint} from "@/api/printbill/printbill";
import axios from "axios";
import {doLocalPrint} from "@/utils";
import {getMachineInfoByID} from "@/api/baseInfo/machineInfo";
import columnEdit from "@/components/columnEdit/list.vue";
import new_badge from '@/assets/new_badge.gif'
import tagging_img from '@/assets/gongyichayiyujing.png'

const defaultItems = [
  {
    columnName: '施工单消息', id: 1, columnTitle: 'breedMsg', columnWidth: '180'
  },
  {
    columnName: '印刷机型', id: 2, columnTitle: 'machineTypeName', columnWidth: '120'
  },
  {
    columnName: '客户名称', id: 3, columnTitle: 'clientName', columnWidth: '150'
  },
  {
    columnName: '印品名称', id: 4, columnTitle: 'billName', columnWidth: '150'
  },
  {
    columnName: '拼版要求', id: 5, columnTitle: 'assembleBreedRequire', columnWidth: '110'
  },
  {
    columnName: '印刷要求', id: 6, columnTitle: 'orderPrintRequire', columnWidth: '110'
  },
  {
    columnName: '多机台', id: 7, columnTitle: 'otherBreedStatus', columnWidth: '120'
  },
  {
    columnName: '工单下纸', id: 8, columnTitle: 'paperName', columnWidth: '120'
  },
  {
    columnName: '实际用纸', id: 9, columnTitle: 'actualPaperName', columnWidth: '170'
  },
  {
    columnName: '纸张开数', id: 10, columnTitle: 'cutName', columnWidth: '60'
  },
  {
    columnName: '开纸尺寸', id: 11, columnTitle: 'cutSize', columnWidth: '100'
  },
  {
    columnName: '开单日期', id: 12, columnTitle: 'createTime', columnWidth: '120'
  },
  {
    columnName: '产品名称', id: 13, columnTitle: 'productName', columnWidth: '120'
  },
  {
    columnName: '特殊工艺', id: 14, columnTitle: 'breedProcess', columnWidth: '140'
  },
  {
    columnName: '发货方式', id: 15, columnTitle: 'orderSendKind', columnWidth: '120'
  },
  {
    columnName: '交货日期', id: 16, columnTitle: 'deliveryDate', columnWidth: '120'
  },
  {
    columnName: '翻版方式', id: 17, columnTitle: 'breedFlipType', columnWidth: '60'
  },
  {
    columnName: 'ps版套数', id: 18, columnTitle: 'psGroupCount', columnWidth: '60'
  }, {
    columnName: '千印数', id: 19, columnTitle: 'printCount1000', columnWidth: '60'
  },
  {
    columnName: '印刷放数+后工放数', id: 20, columnTitle: 'printFlowCount', columnWidth: '120'
  },
  {
    columnName: '拼版人', id: 21, columnTitle: 'assembleMan', columnWidth: '80'
  },
  {
    columnName: '制版人', id: 22, columnTitle: 'madeBreedMan', columnWidth: '80'
  },
  {
    columnName: '白料裁切人', id: 23, columnTitle: 'cutPaperMan', columnWidth: '80'
  },
  {
    columnName: '大纸张数', id: 24, columnTitle: 'wholePaperCount', columnWidth: '60'
  },
  {
    columnName: '印量', id: 25, columnTitle: 'printCount', columnWidth: '60'
  },
  {
    columnName: '印刷耗时（分钟）', id: 26, columnTitle: 'expectedWorkTime', columnWidth: '120'
  }
]


export default {
  name: "breedTasks",
  components: {
    Sortable,
    PrintbillDetail,
    allotButton,
    taskButton,
    printStep,
    OrderMessage,
    columnEdit,
    sortButton
  },
  directives: {
    'el-table-infinite-scroll': elTableInfiniteScroll
  },
  filters: {
    statusFilter(status) {
      const statusMap = {
        1: 'success',
        0: 'danger'
      }
      return statusMap[status]
    }
  },
  data() {
    return {
      disabledBtn:false,
      new_badge: new_badge,
      tagging_img: tagging_img,
      scopeIndex:9999,
      defaultItemCopyData:[],
      columnTable: [],
      clickCheckId: "",

      machineIndex: "",
      machineItem: {},
      dialogFormVisible3: false,
      checkListRow: [],
      btnClick: false,
      rowIndex: 999,
      multipleSelectionDrawe: [],
      localTableData: [],
      table: false,
      printForm: {},
      printbilTitle: "",
      printbilVisible: false,
      btnList: [
        {name: '暂停'},
        {name: '反馈'}
      ],
      rowData: {},
      memoDrawer: false,
      disabledSave: false,
      getIndex1: "",
      inputNum: '',
      dialogSort: false,
      variableId: "",
      taskListStr: false,
      copyMachineInfList: [],
      copyTableData: [],
      printBreedTasks2: [],
      multipleTable4: [],
      dialogFormVisible2: false,
      finished: false,
      menuVisible1: false,
      menuVisibleSort:false,
      selectRow: [],//选中的行
      selectData: [],//选中的数据
      getIndex: "",
      row: {},
      printBreedTasks: [],
      menuVisible: false,
      checkList: [],
      dialogFormVisible: false,
      form: {},
      activeMachineInfList: [],
      activeIndex: 0,
      activeIndex2: 0,
      activeName: '',
      activeName2: '',
      machineInfList: [],
      multipleSelection: [],
      multipleSelection2: [],
      multipleSelection3: [],
      multipleSelectionSort:[],
      multipleSelectionSortCopy:[],
      dialogStatus: 1,//1增加，2修改
      dialogTitle: '',
      dialogVisible: false,
      search: {
        keyWord: ''
      },
      billNewData: [],
      ruleForm: {},
      rules: {
        companyName: [
          {required: true, message: '请填写待排产任务名称', trigger: 'blur'}
        ],
        address: [
          {required: true, message: '请填写待排产任务地址', trigger: 'blur'}
        ],
        linkMan: [
          {required: true, message: '请填写联系人', trigger: 'blur'}
        ],
        linkPhone: [
          {required: true, message: '请填写联系电话', trigger: 'blur'}
        ]
      },
      listData: {
        total: 0,
        page: 1,
        pageSize: 100
      },
      confirmdialog: false,
      listLoading: false,
      listLoadingSort: false,
      tableData: [],
      menuId: '',
      testData: []
    }
  },
  // computed: {
  //   noMore() {
  //     //当起始页数大于总页数时停止加载
  //     return this.tableData.length >= this.listData.total;
  //   },
  //   disabled() {
  //     return this.noMore;
  //   }
  // },
  mounted() {
    var url = window.location.href.split(":id");
    this.variableId = url[1];
    this.activeIndex = 0;
    this.getTableInfo();
    // this.getMachine();
    this.getMachineStatus();
    this.getColum()

  },
  methods: {
    selectable(row, index) {
      if (row.processName == "拼版") {
        return false
      } else {
        return true
      }
    },
    handleInput(){
      // console.log(66666);
      // this.multipleSelectionSort= [];
      // this.$refs.multipleTableSort.clearSelection();
    },
    handleTemplate(index){
      this.scopeIndex =index;
    },
    handleTopping(value,typeValue){
      Array.prototype.insert = function(index, value){
        this.splice(index,0, value);
      }
      //批量置顶
      const _that = this;
      // console.log(value);

      if(_that.multipleSelectionSort.length<=0){
        _that.$message("请选择需要排序的工单")
        return
      }
      if(!typeValue && !value){
        _that.$message("请输入排产顺序的数字");
        return
      }
      // _that.activeMachineInfList.splice(parseInt(sortIndex) - 1, 0, row);
      for (let j = 0; j < _that.activeMachineInfList.length; j++) {
        for (let i = 0; i < _that.multipleSelectionSort.length; i++) {
          if (_that.activeMachineInfList[j].id == _that.multipleSelectionSort[i].id) {
            _that.activeMachineInfList.splice(j, 1)
          }
        }
      }
      _that.multipleSelectionSortCopy = JSON.parse(JSON.stringify(_that.multipleSelectionSort)).reverse();
      for (let i = 0; i < _that.multipleSelectionSortCopy.length; i++) {
        var datas = _that.multipleSelectionSortCopy[i];
        if(!typeValue){
          if(parseInt(value)==0){
            _that.activeMachineInfList.insert(0, datas);
          }else {
            _that.activeMachineInfList.insert(parseInt(value) - 1, datas)
          }
        }else {
          _that.activeMachineInfList.insert(0, datas)
        }

      }
      _that.multipleSelectionSort= [];
      _that.$refs.multipleTableSort.clearSelection();
      for (let i = 0; i < _that.activeMachineInfList.length; i++) {
        var datas = _that.activeMachineInfList[i];
        datas.sortIndex = i + 1;
      }
      _that.menuVisibleSort = false;
    },
    handleClickTableSort(row, event, column){
      const _that = this;
      _that.$refs.multipleTableSort.toggleRowSelection(row);
    },
    handleSelectionChangeSort(rows) {
      var _that = this;
      // console.log(rows);
      _that.multipleSelectionSort = rows;
      // console.log("_that.multipleSelection111",_that.multipleSelection);
    },
    getColum() {
      const _that = this;
      var Infos = {};
      _that.defaultItemCopyData = JSON.parse(JSON.stringify(defaultItems));
      getPageTableColumn(Infos, "调度排产").then(response => {
        _that.$refs.columnEdit.tableItem = response.data;
        if (response.data.length <= 0) {
          _that.columnTable = defaultItems;
          _that.$refs.columnEdit.defaultItem = defaultItems;
        } else {
          _that.columnTable = response.data;
          for (let i = 0; i < response.data.length; i++) {
            var datai = response.data[i];
            for (let j = 0; j < _that.defaultItemCopyData.length; j++) {
              var dataj = _that.defaultItemCopyData[j];
              if(datai.columnTitle == dataj.columnTitle){
                _that.defaultItemCopyData.splice(j,1);
              }
            }
          }
          _that.$refs.columnEdit.defaultItem = _that.defaultItemCopyData
        }
      }).catch(err => {
        _that.$message.error(err);
      })
    },
    saveColum(data, pageName) {
      // console.log("1123", data);
      const _that = this;
      for (let i = 0; i < data.length; i++) {
        var item = data[i];
        _that.$set(item, 'pageName', "调度排产");
        _that.$set(item, 'columnIndex', i);
      }

      var Infos = JSON.stringify(data);
      savePageTableColumn(Infos, "调度排产").then(response => {
        _that.$message("保存成功");
        _that.$refs.columnEdit.columnVisible = false;


        _that.activeIndex = 0;
        _that.activeMachineInfList = [];
        _that.activeName = this.machineInfList[0].machineName;
        _that.getTableInfo();
        // this.getMachine();
        _that.getMachineStatus();
        _that.getColum();

      }).catch(err => {
        _that.$message.error(err);
      })
    },
    diyColumn() {
      const _that = this;
      _that.$refs.columnEdit.columnVisible = true;
      _that.$refs.columnEdit.defaultItem = defaultItems;
      _that.$refs.columnEdit.form.pageName = "调度排产";
      _that.getColum();
    },
    showBillCode(val) {
      //搜索施工单号限时变黄
      if (val.indexOf(this.search.keyWord) !== -1 && this.search.keyWord !== '') {
        return val.replace(this.search.keyWord, '<font class="selector" style="background:yellow;color: #333">' + this.search.keyWord + '</font>')
      } else {
        return val
      }
    },
    showBillCodeTask(val) {
      //搜索施工单号限时变黄
      if (val.indexOf(this.search.keyWord) !== -1 && this.search.keyWord !== '') {
        return val.replace(this.search.keyWord, '<font class="selectorTask" style="background:yellow;color: #333">' + this.search.keyWord + '</font>')
      } else {
        return val
      }
    },
    showBillCodeSort(val) {
      //搜索施工单号限时变黄
      if (val.indexOf(this.search.keyWord) !== -1 && this.search.keyWord !== '') {
        return val.replace(this.search.keyWord, '<font class="selectorSort" style="background:yellow;color: #333">' + this.search.keyWord + '</font>')
      } else {
        return val
      }
    },
    backBreedTaskBtn3() {
      //重新分配机台反馈设置 拼版  白料裁切 制版
      const _that = this;
      var assortedTaskState = {};
      if (_that.checkListRow.indexOf("拼版") != -1) {
        assortedTaskState["assembleBreed"] = 1;
      } else {
        assortedTaskState["assembleBreed"] = 0;
      }
      if (_that.checkListRow.indexOf("白料裁切") != -1) {
        assortedTaskState["cutPaper"] = 1;
      } else {
        assortedTaskState["cutPaper"] = 0;
      }
      if (_that.checkListRow.indexOf("制版") != -1) {
        assortedTaskState["madeBreed"] = 1;
      } else {
        assortedTaskState["madeBreed"] = 0;
      }
      var taskList = [];
      // datas.idMachineInfo = item.id;
      // datas.idProcess = "16";
      var dataMachine = {
        id: "",
        idPrintBill: "",
        idMachineInfo: "",
        idProcess: ""
      }

      dataMachine.idMachineInfo = _that.machineItem.idMachine;
      dataMachine.idProcess = _that.row.idProcess;
      dataMachine.id = _that.row.id;
      dataMachine.idPrintBreed = _that.row.idPrintBreed;
      dataMachine.idPrintBill = _that.row.idPrintBill;
      taskList.push(dataMachine)
      // console.log(_that.multipleSelection2);
      var data = {
        "taskList": JSON.stringify(taskList),
        "assortedTaskState": assortedTaskState
      }
      scheduleBreedTask(data).then(response => {
        // console.log("getAllEnableMachineInfo", response)
        // _that.getMachine(item.machineName,index);
        _that.getMachineStatus(_that.machineItem.machineName, _that.machineIndex);
        // _that.rowDrop();
        _that.dialogFormVisible3 = false;
        _that.$message.success("重新分配成功");
        // return new Promise(function (resolve, reject) {
        //   setTimeout(() => {
        //     _that.activeName = item.machineName;
        //     _that.activeIndex = index;
        //     _that.activeMachineInfList = _that.machineInfList[_that.activeIndex].taskList;
        //     resolve(0)
        //   }, 500)
        // })
      }).catch(err => {
        _that.$message.error(err)
      })
    },
    printData() {
      const _that = this;
      var ids = [];
      if (_that.multipleSelectionDrawe.length <= 0) {
        _that.$message("请选择施工单");
        return
      }
      for (var i = 0; i < _that.multipleSelectionDrawe.length; i++) {
        var datas = _that.multipleSelectionDrawe[i];
        ids.push(datas.id)

      }
      // console.log(ids);
      var datas = {
        "ids": ids.join(',')
      }

      printBillDoPrint(datas).then(response => {
        // console.log("printBillDoPrint", response);
        var PrintData = {
          '_rootData': response.data
        }
        var data = {
          PrintTemplate: 'printBill.fr3',
          NeedPreview: 1,
          PrintData: JSON.stringify(PrintData)
        }
        // 以后打印调这个通用接口
        doLocalPrint(data)
        for (let j = 0; j < _that.localTableData.length; j++) {

          for (let i = 0; i < _that.multipleSelectionDrawe.length; i++) {
            var dataItem = _that.multipleSelectionDrawe[i];
            // console.log(_that.localTableData[j].id == dataItem.id);
            if (_that.localTableData[j].billCode == dataItem.billCode) {
              _that.localTableData.splice(j, 1)
            }

          }
        }
        localStorage.setItem("localDataArray", JSON.stringify(_that.localTableData));

      }).catch(err => {
        _that.$message.error(err)
      })
    },
    handleDraweChange(val) {
      this.multipleSelectionDrawe = val;
    },
    removeItemBtn() {
      window.localStorage.removeItem("localDataArray");
      this.table = false;
    },
    // load() {
    //   //滑到底部时进行加载
    //   this.listLoading = true;
    //   setTimeout(() => {
    //     this.listData.page += 1; //页数+1
    //     this.getTableInfo(); //调用接口，此时页数+1，查询下一页数据
    //   }, 1000);
    // },
    stampBtn() {
      const _that = this;
      _that.localTableData = JSON.parse(localStorage.getItem('localDataArray'))
      // window.localStorage.removeItem("localDataArray");
      // console.log(_that.localTableData);
      _that.table = true;
    },
    getSummaries(param) {
      const {
        columns,
        data
      } = param
      const sums = []
      columns.forEach((column, index) => {
        // console.log("11111", column);
        if (index === 0) {
          sums[index] = '合计'
          //只计算最后一列
          // console.log(columns.length - 8);
        } else if (column.label == "印刷耗时（分钟）") {
          // console.log("data", data);
          var num = 0;
          for (let i = 0; i < data.length; i++) {
            num += data[i].expectedWorkTime
          }
          sums[index] = num;
        } else if (column.label === "千印数") {
          // console.log("data", data);
          var num = 0;
          for (let i = 0; i < data.length; i++) {
            num += data[i].printBreed.printCount1000;
            // console.log(num);
          }
          sums[index] = num.toFixed(3);
        } else if (column.label === "ps版套数") {
          // console.log("data", data);
          var num = 0;
          for (let i = 0; i < data.length; i++) {
            num += data[i].printBreed.psGroupCount
            // console.log(num);
          }
          sums[index] = num;
        }
      })
      return sums
    },
    getSummaries2(param) {
      const {
        columns,
        data
      } = param
      const sums = []
      columns.forEach((column, index) => {
        if (index === 0) {
          sums[index] = '合计'
          //只计算最后一列
        }else if (column.label == "印刷耗时（分钟）") {
          // console.log("data", data);
          var num = 0;
          for (let i = 0; i < data.length; i++) {
            num += data[i].expectedWorkTime
          }
          sums[index] = num;
        } else if (column.label === "千印数") {
          // console.log("data", data);
          var num = 0;
          for (let i = 0; i < data.length; i++) {
            num += data[i].printBreed.printCount1000
            // console.log(num);
          }
          sums[index] = num.toFixed(3);
        } else if (column.label === "ps版套数") {
          // console.log("data", data);
          var num = 0;
          for (let i = 0; i < data.length; i++) {
            num += data[i].printBreed.psGroupCount
            // console.log(num);
          }
          sums[index] = num;
        }
      })
      return sums
    },
    // 施工单消息
    openMessage(row) {
      var _that = this
      _that.memoDrawer = true;
      _that.rowData = row;
      _that.$nextTick(function () {
        // console.log(_that.$refs.orderMemo);
        _that.$refs.orderMessage.idOrder = row.idPrintBreed;
        _that.$refs.orderMessage.idPrint = row.idPrintBreed;
        _that.$refs.orderMessage.idPrintBill = row.idPrintBill;
        _that.$refs.orderMessage.sMessage = "";
        _that.$refs.orderMessage.getList()
      })
    },
    printBtn() {
      const _that = this;

      // console.log(_that.printForm);
      if (!_that.printForm.taskMemo && _that.rowData.pauseStatus == 0) {
        _that.$message.warning("备注信息不能为空");
        return
      }
      _that.disabledBtn = true;
      _that.printbilVisible = false;
      if (_that.rowData.pauseStatus == 0) {
        var Infos = {
          "task": JSON.stringify(_that.printForm),
        }
        taskFeedbackPause(Infos).then(response => {
          // console.log("taskFeedbackPause", response);
          _that.$message("暂停成功");
          _that.rowData.pauseStatus = 1;
          _that.disabledBtn = false;
          _that.rowData.breedMsg = response.data.breedMsg;
          _that.clickCheckId = "";


        }).catch(err => {
          _that.$message.error(err);
          _that.disabledBtn = false;
          _that.btnClick = false;
        })
      } else if (_that.rowData.pauseStatus == 1) {
        var Infos = {
          "task": JSON.stringify(_that.printForm),
        }
        taskFeedbackStart(Infos).then(response => {
          // console.log("taskFeedbackPause", response);
          _that.$message("启动成功");
          _that.rowData.pauseStatus = 0;
          _that.disabledBtn = false;
          _that.rowData.breedMsg = response.data.breedMsg;
          _that.clickCheckId = "";
        }).catch(err => {
          _that.$message.error(err);
          _that.disabledBtn = false;
          _that.btnClick = false;
        })
      }
    },
    getOrderStep(id) {
      const _that = this;
      _that.$refs.printStep.idOrder = id;
      _that.$refs.printStep.drawer = true;
      _that.$refs.printStep.getStep();
    },
    handleAddBreed(breedMsg) {
      this.memoDrawer = false;
      this.rowData.breedMsg = breedMsg;
    },
    handleEdit(index, sortIndex, row) {
      const _that = this;
      var regexp = /^[1-9]\d*$/;
      if (sortIndex == "") {
        return
      }
      if (!regexp.test(parseInt(sortIndex))) {
        _that.$message("请输入大于0的正整数");
        return
      }
      _that.activeMachineInfList.splice(index, 1);
      _that.activeMachineInfList.splice(parseInt(sortIndex) - 1, 0, row);

      // console.log(_that.machineInfList[_that.activeIndex2].taskList);
      for (let i = 0; i < _that.activeMachineInfList.length; i++) {
        var datas = _that.activeMachineInfList[i];
        datas.sortIndex = i + 1;
      }
      _that.$refs.multipleTableSort.clearSelection();

    },
    handleSortNum(row, index) {

      const _that = this;
      // console.log(_that.machineInfList[_that.activeIndex2].taskList);
      var regexp = /^[1-9]\d*$/;
      if (!regexp.test(parseInt(_that.inputNum))) {
        _that.$message("请输入大于0的正整数");
        return
      }
      // console.log(parseInt(_that.inputNum));

      _that.machineInfList[_that.activeIndex2].taskList.splice(index, 1);
      _that.machineInfList[_that.activeIndex2].taskList.splice(parseInt(_that.inputNum) - 1, 0, row);

      // console.log(_that.machineInfList[_that.activeIndex2].taskList);
      for (let i = 0; i < _that.machineInfList[_that.activeIndex2].taskList.length; i++) {
        var datas = _that.machineInfList[_that.activeIndex2].taskList[i];
        datas.sortIndex = i + 1;
      }

      _that.$refs['popover-' + row.id].showPopper = false;
      _that.inputNum = "";


    },
    handleSortFirst(row, index) {
      const _that = this;
      _that.activeMachineInfList.splice(index, 1);
      _that.activeMachineInfList.splice(0, 0, row);

      for (let i = 0; i < _that.activeMachineInfList.length; i++) {
        var datas = _that.activeMachineInfList[i];
        datas.sortIndex = i + 1;
      }
      _that.$refs.multipleTableSort.clearSelection();
      return
      // console.log(_that.machineInfList[_that.activeIndex2].taskList);

      for (let i = 0; i < _that.machineInfList[_that.activeIndex2].taskList.length; i++) {

        var datas = _that.machineInfList[_that.activeIndex2].taskList[i];
        datas.sortIndex = i + 1;
        datas.sortIndex += 1;
      }
      row.sortIndex = 1;
      _that.$nextTick(() => {
        _that.machineInfList[_that.activeIndex2].taskList.sort(_that.compare('sortIndex'));
      })


    },
    handleSort() {
      const _that = this;
      _that.dialogSort = true;
      // _that.search.keyWord = "";
    },
    backBreedTaskBtn2() {
      const _that = this;
      // console.log(_that.checkList);
      var testOld = [];
      _that.checkList.forEach(el => {
        var oldObj = {id: el.idPrintBreed, taskList: []}
        var txtObj = {id: el.id};
        oldObj.taskList.push(txtObj);
        testOld.push(oldObj);
      });
      var newData = []; // 目标数组
      var newObj = {};
      testOld.forEach((el, i) => {
        if (!newObj[el.id]) {
          newData.push(el);
          newObj[el.id] = true;
        } else {
          newData.forEach(el => {
            if (el.id === testOld[i].id) {
              el.taskList = el.taskList.concat(testOld[i].taskList);
              // el.txtArr = [...el.txtArr, ...testOld[i].txtArr]; // es6语法
            }
          })
        }
      });
      // console.log(newData);
      _that.billNewData = newData;
      var printbill = {
        printbill: {
          id: _that.printBreedTasks2.id,
          currentVersion: _that.printBreedTasks2.currentVersion,
          breedTasksAssortedList: newData
        }
      }
      // console.log(printbill);
      // return
      backPrintBill(printbill).then(response => {
        // console.log("getAllEnableMachineInfo", response)
        _that.$message.success("退回成功");
        _that.tableData = [];
        _that.dialogFormVisible2 = false;
        _that.getTableInfo();


      }).catch(err => {
        _that.$message.error(err)
      })
    },
    //获取列表
    getTableInfo() {
      const _that = this
      _that.tableData = [];
      _that.listLoading = true;
      var params = {
        idProcess: _that.variableId
      };
      var page = {
        pageIndex: _that.listData.page,
        pageSize: _that.listData.pageSize,
      }
      var data = {
        "params": JSON.stringify(params),
        "page": JSON.stringify(page),
      }
      // console.log(data);
      getInfo(data).then(response => {
        const data = response.data;
        if (response.data.length > 0) {
          // console.log("tableData1111", _that.tableData);
          // console.log("1313123123", this.$route.params);
          _that.listData.total = response.total;
          _that.copyTableData = response.data;
          _that.tableData = JSON.parse(JSON.stringify(_that.copyTableData));
          // for (let i = 0; i < _that.tableData.length; i++) {
          //   var itemData = _that.tableData[i];
          //   _that.$set(itemData, 'checkIndex', i);
          // }
        }
        // console.log(_that.tableData)
        _that.listLoading = false;
      }).catch(err => {
        // _that.listLoading = false
      })
    },
    // load() {
    //   //滑到底部时进行加载
    //   this.listLoading = true;
    //   setTimeout(() => {
    //     this.listData.page += 1; //页数+1
    //     // if(this.tableData.length >= this.listData.total){
    //     //   return
    //     // }
    //     // console.log(this.listData.page);
    //     this.getTableInfo(); //调用接口，此时页数+1，查询下一页数据
    //   }, 1000);
    //
    // },
    handlestart(row) {
      const _that = this;
      _that.rowData = row;
      if (row.pauseStatus == 1) {
        _that.printbilTitle = "确定启动？";
        _that.printForm = {
          id: row.id,
          taskStatus: row.taskStatus,
          taskMemo: ""
        }
      } else if (row.pauseStatus == 0) {
        _that.printbilTitle = "确定暂停？";
        _that.printForm = {
          id: row.id,
          taskStatus: row.taskStatus,
          taskMemo: ""
        }
      }

      _that.printbilVisible = true;
      _that.disabledBtn = false;


    },

    handleThree1() {
      const _that = this;
    },
    handleOne() {
      const _that = this;
      _that.getTableInfo();
    },
    handleOne3() {
      const _that = this;
    },

    checkListChanged(event, data) {
      // console.log(data);
    },
    backBreedTaskBtn() {
      const _that = this;
      _that.btnClick = true;
      // if (_that.multipleSelection3.length <= 0) {
      //   _that.$message("请选择需要反馈的工序");
      //   return
      // }
      // var taskList = [];
      // console.log(_that.row);
      // console.log(_that.multipleSelection3);
      var dataMachine = {
        id: "",
        idPrintBill: "",
        taskStatus: "",
        idProcess: ""
      }
      dataMachine.id = _that.row.id;
      dataMachine.idPrintBill = _that.row.idPrintBill;
      dataMachine.idProcess = _that.row.idProcess;
      dataMachine.taskStatus = _that.row.taskStatus;

      // taskList.push(dataMachine)
      // console.log(_that.multipleSelection3);

      var ids1 = []
      _that.multipleSelection3.forEach(item => {
        ids1.push(item.id)
      })
      var backOptions = ids1.join(',')
      // console.log(backOptions);
      var data = {
        "task": dataMachine,
        "backOptions": backOptions
      }
      // alert("111")
      backBreedTask(data).then(response => {
        // console.log("getAllEnableMachineInfo", response)
        _that.btnClick = false;
        _that.$message({
          type: 'success',
          message: '退回成功!'
        });
        _that.dialogFormVisible = false;
        _that.getTableInfo();

        _that.getMachineStatus(_that.activeName, _that.activeIndex);
        // _that.getMachine(_that.activeName, _that.activeIndex);
        // _that.rowDrop();
        _that.$forceUpdate();//重绘
      }).catch(err => {
        _that.btnClick = false;
        _that.$message.error(err)
      })
    },
    handleTwo(row) {
      // console.log(row);
      const _that = this;
      if (_that.selectData.length <= 0) {
        _that.$message("请选择退回的任务");
        return
      }
      if (_that.selectData.length > 1) {
        _that.$message("每次只能退回一个任务！");
        return
      }
      // console.log(_that.selectData);
      // return
      _that.dialogFormVisible2 = true;

      _that.checkList = []
      var printbill = {
        idBill: row.idPrintBill
      }
      queryAssorted(printbill).then(response => {
        // console.log("printBreedTasks2", response)
        _that.printBreedTasks2 = response.data;
      }).catch(err => {
        _that.$message.error(err)
      })
      // if (_that.selectData.length <= 0) {
      //   _that.$message("请选择退回的任务");
      //   return
      // }
      // if (_that.selectData.length > 1) {
      //   _that.$message("每次退回的施工单只能选择一个");
      //   return
      // }

    },
    handleThree2(item, index, row) {
      //重新分配机台
      const _that = this;
      _that.dialogFormVisible3 = true;
      _that.checkListRow = [];
      // this.$message('click on item ' + command);
      // console.log("command", command);
      // console.log(_that.multipleSelection2);
      _that.row = row;
      _that.machineItem = item;
      _that.machineIndex = index;
      // console.log(_that.machineItem);

    },
    handleThree(row, index) {
      const _that = this;
      // localStorage.removeItem("localDataArray");
      // console.log(row);
      // // console.log(_that.selectRow);
      // // console.log(_that.selectData);
      // // console.log("_that.row",row);
      // return
      if (_that.selectData.length <= 0) {
        _that.$message("请选择待排产的施工单");
        return
      }
      var taskList = [];
      var selectLocalDataArray = [];
      console.log("333",_that.selectData);
      for (var i = 0; i < _that.selectData.length; i++) {
        var datas = _that.selectData[i];
        var dataMachine = {
          id: "",
          idPrintBill: "",
          idMachineInfo: "",
          idProcess: ""
        }
        var localData = {
          id: "",
          billCode: "",
          breedName: ""
        }
        localData.id = datas.printBill.id;
        localData.billCode = datas.printBill.billCode;
        localData.productName = datas.printBill.productName;
        //2
        dataMachine.idMachineInfo = row.idMachine;
        dataMachine.idProcess = datas.idProcess;
        dataMachine.id = datas.id;
        dataMachine.idPrintBreed = datas.idPrintBreed;
        dataMachine.idPrintBill = datas.idPrintBill;
        taskList.push(dataMachine);
        selectLocalDataArray.push(localData)
      }

      var dataArray = [];
      for(var i=0; i<selectLocalDataArray.length; i++){
        for(var j=i+1; j<selectLocalDataArray.length; j++){
          if(selectLocalDataArray[i].billCode==selectLocalDataArray[j].billCode){         //第一个等同于第二个，splice方法删除第二个
            selectLocalDataArray.splice(j,1);
            j--;
          }
        }
      }
      if (localStorage.getItem('localDataArray') == undefined || localStorage.getItem('localDataArray') == null || localStorage.getItem('localDataArray') == "") {
        dataArray = selectLocalDataArray;
      } else {
        var storageArrayData = JSON.parse(localStorage.getItem('localDataArray'));
        // console.log("111",selectLocalDataArray);
        // console.log("2222",storageArrayData);
        // for (let j = 0; j < selectLocalDataArray.length; j++) {
        //     for (let i = 0; i < storageArrayData.length; i++) {
        //       var dataItem = storageArrayData[i];
        //       if(selectLocalDataArray.length>0){
        //         if (selectLocalDataArray[j].billCode == dataItem.billCode) {
        //           selectLocalDataArray.splice(j, 1)
        //           continue
        //         }
        //       }
        //
        //
        //     }
        //   }
        //
        //
        //
        // // console.log("3",selectLocalDataArray);
        // return
        dataArray = storageArrayData.concat(selectLocalDataArray);
        // console.log("4",dataArray);

      }
      localStorage.setItem("localDataArray", JSON.stringify(dataArray));
      // console.log("21212121",taskList);
      // console.log("1",localDataArray);
      // console.log("2",JSON.parse(localStorage.getItem('localDataArray')));
      var data = {
        "taskList": JSON.stringify(taskList)
      }
      scheduleBreedTask(data).then(response => {
        //console.log("getAllEnableMachineInfo", response)
        if (response.httpCode == 200) {
          _that.$message.success("分配成功");
          _that.selectData = [];
          _that.selectRow = [];

          // _that.getMachine(row.machineName,index);
          return new Promise(function (resolve, reject) {
            setTimeout(() => {
              _that.getTableInfo();
              _that.getMachineStatus(row.machineName, index);

              resolve(0)
            }, 1000)
          })
        }


      }).catch(err => {
        // _that.$message.error(err)
      })
    },
    handleTwo2(row) {
      const _that = this;
      _that.row = row;
      var data = {
        "idBreed": row.idPrintBreed
      }
      queryPrintBreedTasksAssorted(data).then(response => {
        _that.dialogFormVisible = true;
        // console.log("queryPrintBreedTasksAssorted", response.data);
        _that.printBreedTasks = response.data;
      }).catch(err => {
        _that.$message.error(err);
      })
    },

    rowContextmenu(row, column, event) {
      const _that = this;
      _that.row = row;
      // console.log("1",row);
      // console.log("2",this.selectRow);
      if (this.selectRow.includes(row.id)) {

      } else {
        _that.$nextTick(() => {
          _that.$refs.multipleTable.toggleRowSelection(row);
        })
      }
      // if (this.selectRow.includes(rowIndex)) {
      //   return 'slecleRowColor ';
      // }

      _that.menuVisible1 = false;
      _that.menuVisibleSort = false;
      _that.menuVisible = true;

      // _that.$refs.multipleTable.toggleRowSelection(row);
      // 阻止右键默认行为
      event.preventDefault()
      _that.$nextTick(() => {
        _that.$refs.contextbutton.init(row, column, event);
      })
    },
    rowContextmenu2(row, column, event) {
      const _that = this;
      _that.row = row;
      _that.clickCheckId = row.id;
      if (row.pauseStatus == 1) {
        _that.btnList[0].name = "启动";
        _that.btnShow = true;
      }
      if (row.pauseStatus == 0) {
        _that.btnList[0].name = "暂停";
        _that.btnShow = false;
      }
      _that.menuVisible = false;
      _that.menuVisibleSort = false;
      _that.menuVisible1 = true;
      // _that.$refs.multipleTable.toggleRowSelection(row);
      // 阻止右键默认行为
      event.preventDefault()
      _that.$nextTick(() => {
        _that.$refs.taskbutton.init1(row, column, event);
      })
    },
    rowContextmenuSort(row, column, event) {
      const _that = this;
      _that.row = row;
      _that.menuVisible = false;
      _that.menuVisible1 = false;
      _that.menuVisibleSort = true;
      // _that.$refs.multipleTable.toggleRowSelection(row);
      // 阻止右键默认行为
      event.preventDefault()
      _that.$nextTick(() => {
        _that.$refs.sortbutton.init(row, column, event);
      })
    },
    foo() { // 取消鼠标监听事件 菜单栏
      this.menuVisible = false;
      this.menuVisible1 = false;
      this.menuVisibleSort = false;

      document.removeEventListener('click', this.foo)
    },
    foo1() { // 取消鼠标监听事件 菜单栏
      this.menuVisible = false;
      this.menuVisible1 = false;
      this.menuVisibleSort = false;
      document.removeEventListener('click', this.foo1)
    },
    foo2() { // 取消鼠标监听事件 菜单栏
      const _that = this;
      _that.menuVisible = false;
      _that.menuVisible1 = false;
      document.addEventListener('click', e => {
        var box = document.getElementById("contextmenuSort");
        if(box.contains(e.target)){

        }else {
          _that.menuVisibleSort = false;
        }
      }) // 给整个document添加监听鼠标事件，点击任何位置执行foo方法

    },
    handleBack(row) {
      //退回到待审核
      const _that = this;
      // console.log(row);
      _that.$confirm('确认退回到待审核', '退回到待审核', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        var printbill = {
          printbill: {
            id: row.id,
            currentVersion: row.currentVersion
          }
        }
        backPrintBill(printbill).then(response => {
          // console.log("getAllEnableMachineInfo", response)
          _that.$message.success("退回成功");
          _that.getTableInfo();

        }).catch(err => {
          _that.$message.error(err)
        })
      }).catch(() => {
      });


    },
    handleDetail(id) {
      const _that = this;
      _that.menuVisibleSort = false;
      _that.$refs.printbillDetail.idOrder = id;
      _that.$refs.printbillDetail.getDetail()
    },
    handleSave() {
      const _that = this;
      var taskListArray = [];
      _that.disabledSave = true;
      for (let j = 0; j < _that.activeMachineInfList.length; j++) {
        var taskLists = {
          sortIndex: "",
          id: "",
          taskStatus: "",
          idMachineInfo: "",
        };
        var datas = _that.activeMachineInfList[j];
        taskLists.sortIndex = j + 1;
        taskLists.id = datas.id;
        taskLists.taskStatus = datas.taskStatus;
        taskLists.idMachineInfo = datas.idMachineInfo;
        taskListArray.push(taskLists);
      }

      var data = JSON.stringify(taskListArray)
      sortBreedTask(data).then(response => {
        // console.log("getAllEnableMachineInfo", response)
        _that.$message.success("保存排序成功")
        _that.getMachineStatus(_that.machineInfList[_that.activeIndex].machineName, _that.activeIndex);
        _that.disabledSave = false;
      }).catch(err => {
        _that.disabledSave = false;
        _that.$message.error(err)
      })
    },
    //拖拽
    // rowDrop() {
    //   const _that = this;
    //   return new Promise(function (resolve, reject) {
    //     setTimeout(() => {
    //       // console.log("index",index);
    //       // console.log(_that.machineInfList);
    //       const tbody = document.querySelector(".dropTable .el-table__body-wrapper tbody");
    //       Sortable.create(tbody, {
    //         onEnd({newIndex, oldIndex}) {
    //           // alert("222222")
    //           let tData = JSON.parse(JSON.stringify(_that.machineInfList[_that.activeIndex2].taskList));
    //           const currRow = tData.splice(oldIndex, 1)[0];
    //           tData.splice(newIndex, 0, currRow);
    //           _that.machineInfList[_that.activeIndex2].taskList = [];
    //           setTimeout(() => {
    //             _that.machineInfList[_that.activeIndex2].taskList = tData;
    //             _that.rowDrop();
    //           }, 50);
    //
    //
    //         }
    //       });
    //
    //       resolve(0)
    //     }, 500)
    //   })
    //
    //
    //   // const selft = this;
    //   // Sortable.create(tbody, {
    //   //   onEnd({ newIndex, oldIndex }) {
    //   //     let tData = JSON.parse(JSON.stringify(selft.activeMachineInfList));
    //   //     const currRow = tData.splice(oldIndex, 1)[0];
    //   //     tData.splice(newIndex, 0, currRow);
    //   //     selft.activeMachineInfList = [];
    //   //     setTimeout(() => {
    //   //       selft.activeMachineInfList = tData;
    //   //     }, 5);
    //   //   }
    //   // });
    //   //     for (let i = 0; i < tbody.length; i++) {
    //   //       var tbodyItem = tbody[i];
    //   //       // Sortable.create(tbodyItem);
    //   //       Sortable.create(tbodyItem, {
    //   //         onEnd({newIndex, oldIndex}) {
    //   //           // console.log(oldIndex);
    //   //           // console.log(newIndex);
    //   //           const currRow = _that.activeMachineInfList.splice(oldIndex, 1)[0];
    //   //           // console.log(currRow.printBill.billCode);
    //   //           // console.log(_that.activeMachineInfList);
    //   //
    //   //           _that.activeMachineInfList.splice(newIndex, 0, currRow)
    //   //           // JSON.stringify(_that.copyMachineInfList)
    //   //           // var oldData = JSON.parse(JSON.stringify(_that.activeMachineInfList[oldIndex]));
    //   //           // var newData = JSON.parse(JSON.stringify(_that.activeMachineInfList[newIndex]));
    //   //           // _that.activeMachineInfList.splice(oldIndex,1,newData);
    //   //           // _that.$nextTick(() => {
    //   //           //   _that.activeMachineInfList.splice(newIndex,1,oldData);
    //   //           // })
    //   //           //
    //   //           // // _that.activeMachineInfList[newIndex]=_that.activeMachineInfList[oldIndex];
    //   //           //               console.log(_that.activeMachineInfList);
    //   //         }
    //   //       })
    //   //     }
    //
    // },
    handleCommand2(command) {

    },
    handleBackBreedTask(row) {

      // _that.$confirm('退回机台任务, 是否继续?', '提示', {
      //   confirmButtonText: '确定',
      //   cancelButtonText: '取消',
      //   type: 'warning'
      // }).then(() => {
      //   // console.log("row",row);
      //   var taskList = [];
      //   taskList.push(row);

      //
      // }).catch(() => {
      // });
    },

    handleSelectionChange3(val) {
      this.multipleSelection3 = val;
    },
    handleSelectionChange4(val) {
      this.multipleSelection4 = val;
    },
    handleClick(tabIndex) {
      const _that = this;
      _that.activeIndex = tabIndex;
      // console.log(_that.machineInfList[tabIndex].idMachine);
      _that.activeMachineInfList = [];
      _that.getMachineInfo(_that.machineInfList[tabIndex].idMachine);
      // _that.activeMachineInfList = _that.machineInfList[_that.activeIndex].taskList;
      _that.activeName = _that.machineInfList[tabIndex].machineName;
      _that.activeName2 = _that.machineInfList[tabIndex].machineName;
      _that.activeIndex2 = tabIndex;
      // if (_that.search.keyWord != "") {
      //   for (let i = 0; i < _that.activeMachineInfList.taskList.length; i++) {
      //     var key = _that.search.keyWord.toUpperCase()
      //     //string.replace(new RegExp(key,'g'),"<span class='hsp' >"+_that.search.keyWord+"</span>");
      //     _that.activeMachineInfList.taskList[i].printBill.billCode = _that.activeMachineInfList.taskList[i].printBill.billCode.replace(new RegExp(key, 'g'), "<span class='hsp' >" + key + "</span>");
      //   }
      // }
    },
    // handleClick2(tabIndex) {
    //   const _that = this;
    //   _that.activeName2 = _that.machineInfList[tabIndex].machineName;
    //   _that.activeIndex2 = tabIndex;
    //   _that.getMachineInfo(_that.machineInfList[tabIndex].idMachine);
    //
    // },
    handleCommand(command) {
    },
    //获取机台任务
    getMachine(activeName, activeIndex) {
      const _that = this;
      _that.listLoadingSort = true;
      var datas = {
        getDetail: 1
      }
      var Infos = {
        "params": JSON.stringify(datas)
      }
      getAllEnableMachineInfo(Infos).then(response => {
        // console.log("getAllEnableMachineInfo", response)
        _that.listLoadingSort = false;
        _that.copyMachineInfList = response.data;
        _that.machineInfList = JSON.parse(JSON.stringify(_that.copyMachineInfList));

        // console.log("_that.machineInfList",_that.machineInfList);
        if (activeName) {
          _that.activeIndex = activeIndex;
          _that.activeName = activeName;
        } else {
          _that.activeIndex = 0;
          _that.activeName = _that.machineInfList[0].machineName;
        }


        for (let i = 0; i < _that.machineInfList.length; i++) {
          var machineInfLists = _that.machineInfList[i];
          var taskListNew = machineInfLists.taskList.sort(_that.compare('sortIndex'));
          machineInfLists.taskList = taskListNew;
          _that.$set(machineInfLists.taskList, 'machineName', machineInfLists.machineName);
          var numPsGroupCount = 0;
          var numPrintCount1000 = 0;
          for (let j = 0; j < machineInfLists.taskList.length; j++) {
            var itemData = machineInfLists.taskList[j];
            // console.log(itemData);
            itemData.sortIndex = parseInt(j + 1)
            numPsGroupCount += itemData.printBreed.psGroupCount;
            numPrintCount1000 += itemData.printBreed.printCount1000
          }
          _that.$set(_that.machineInfList[i], 'psGroupCountTotal', numPsGroupCount);
          _that.$set(_that.machineInfList[i], 'printCount1000Total', numPrintCount1000.toFixed(3));
        }
        // var num = 0;
        // for (let i = 0; i < data.length; i++) {
        //   num += data[i].printBreed.psGroupCount
        //   // console.log(num);
        // }
        _that.activeMachineInfList = _that.machineInfList[_that.activeIndex].taskList;

      }).catch(err => {
        _that.$message.error(err)
      })
    },

    getMachineStatus(activeName = '', activeIndex = 0) {
      const _that = this;
      calcAllMachineTaskCollection({}).then(response => {
        // console.log("calcAllMachineTaskCollection", response)
        _that.machineInfList = response.data;
        if (activeIndex) {
          _that.activeIndex = activeIndex;
          _that.activeName = _that.machineInfList[activeIndex].machineName;
          _that.getMachineInfo(_that.machineInfList[activeIndex].idMachine)
        } else {
          _that.activeIndex = 0;
          _that.activeName = _that.machineInfList[0].machineName;
          _that.getMachineInfo(_that.machineInfList[0].idMachine)
        }


      }).catch(err => {
        _that.$message.error(err)
      })
    },
    getMachineInfo(id) {
      const _that = this;
      _that.listLoadingSort = true;
      const params = {
        idMachineInfo: id,
        getDetail: 1
      }
      getMachineInfoByID(params).then(res => {
        _that.listLoadingSort = false;
        _that.$nextTick(() => {
          _that.activeMachineInfList = res.data.taskList;
          _that.$tableScrollMoveTask("multipleTable2");
          _that.$tableScrollMoveSort("multipleTableSort");
        })
      })
    },
    compare(propertyName) {
      return function (object1, object2) {
        var value1 = object1[propertyName];
        var value2 = object2[propertyName];
        if (value2 < value1) {
          return 1;
        } else if (value2 > value1) {
          return -1;
        } else {
          return 0;
        }
      }
    },
    //刷新表格
    refreshTableInfo() {
      // this.getTableInfo();
      this.activeIndex = 0;
      this.activeMachineInfList = [];
      this.activeName = this.machineInfList[0].machineName;
      this.getTableInfo();
      // this.getMachine();
      this.getMachineStatus();
      // this.rowDrop();
    },
    $tableScrollMove(refName) {
      if (!refName || !this.$refs[refName]) return//不存在表格的ref vm 则返回
      let vmEl = this.$refs[refName].$el
      if (!vmEl) return
      if (vmEl.querySelectorAll('.elTble .el-table__body .selector').length <= 0) return
      const targetTop = vmEl.querySelectorAll('.elTble .el-table__body .selector')[0].getBoundingClientRect().top
      const containerTop = vmEl.querySelector('.elTble .el-table__body').getBoundingClientRect().top
      const scrollParent = vmEl.querySelector('.elTble .el-table__body-wrapper')
      scrollParent.scrollTop = targetTop - containerTop;
    },
    $tableScrollMoveTask(refName) {
      if (!refName || !this.$refs[refName]) return//不存在表格的ref vm 则返回
      let vmEl = this.$refs[refName].$el
      if (!vmEl) return
      if (vmEl.querySelectorAll('.elTbleTask .el-table__body .selectorTask').length <= 0) return
      const targetTop = vmEl.querySelectorAll('.elTbleTask .el-table__body .selectorTask')[0].getBoundingClientRect().top
      const containerTop = vmEl.querySelector('.elTbleTask .el-table__body').getBoundingClientRect().top
      const scrollParent = vmEl.querySelector('.elTbleTask .el-table__body-wrapper')
      scrollParent.scrollTop = targetTop - containerTop;
    },
    $tableScrollMoveSort(refName) {
      if (!refName || !this.$refs[refName]) return//不存在表格的ref vm 则返回
      let vmEl = this.$refs[refName].$el
      if (!vmEl) return
      // console.log(vmEl.querySelectorAll('.elTbleSort .el-table__body .selectorSort'));
      if (vmEl.querySelectorAll('.elTbleSort .el-table__body .selectorSort').length <= 0) return
      const targetTop = vmEl.querySelectorAll('.elTbleSort .el-table__body .selectorSort')[0].getBoundingClientRect().top
      const containerTop = vmEl.querySelector('.elTbleSort .el-table__body').getBoundingClientRect().top
      const scrollParent = vmEl.querySelector('.elTbleSort .el-table__body-wrapper')
      scrollParent.scrollTop = targetTop - containerTop;
    },
    //搜索
    searchData() {
      const _that = this;
      _that.$tableScrollMove("multipleTable");
      const params = {
        keyWord: _that.search.keyWord
      }
      findMachineByKeyWord(params).then(res => {
        // console.log(res);
        if (res.data.length <= 0) {
          _that.$message("无搜索结果");
          return
        }
        var data = res.data[0];
        _that.activeMachineInfList = [];
        _that.getMachineInfo(data.id);
        // _that.activeMachineInfList = _that.machineInfList[_that.activeIndex].taskList;
        _that.activeName = data.machineName;
        _that.activeName2 = data.machineName;
      })
      return

      // this.$refs.multipleTable.bodyWrapper.scrollTop =this.$refs.multipleTable.bodyWrapper. scrollHeight;
      _that.tableData = JSON.parse(JSON.stringify(_that.copyTableData));
      _that.machineInfList = JSON.parse(JSON.stringify(_that.copyMachineInfList));
      for (let i = 0; i < _that.machineInfList.length; i++) {
        var machineInfLists = _that.machineInfList[i];
        var taskListNew = machineInfLists.taskList.sort(_that.compare('sortIndex'));
        machineInfLists.taskList = taskListNew;
        _that.$set(machineInfLists.taskList, 'machineName', machineInfLists.machineName);
        var numPsGroupCount = 0;
        var numPrintCount1000 = 0;
        for (let j = 0; j < machineInfLists.taskList.length; j++) {
          var itemData = machineInfLists.taskList[j];
          numPsGroupCount += itemData.printBreed.psGroupCount;
          numPrintCount1000 += itemData.printBreed.printCount1000
        }
        _that.$set(_that.machineInfList[i], 'psGroupCountTotal', numPsGroupCount);
        _that.$set(_that.machineInfList[i], 'printCount1000Total', numPrintCount1000);
      }
      if (!_that.search.keyWord) {
        _that.$message("请输入订单编号");
        return
      }

      for (let i = 0; i < _that.tableData.length; i++) {
        var key = _that.search.keyWord.toUpperCase()
        if (_that.tableData[i].printBill.billCode.indexOf(key) != -1) {

          _that.tableData[i].printBill.billCode = _that.tableData[i].printBill.billCode.replace(new RegExp(key, 'g'), "<span class='hsp' >" + key + "</span>");
          _that.$tableScrollMove("multipleTable", i);
          break;
        }
        //string.replace(new RegExp(key,'g'),"<span class='hsp' >"+_that.search.keyWord+"</span>");

      }
      for (let i = 0; i < _that.machineInfList.length; i++) {

        for (let j = 0; j < _that.machineInfList[i].taskList.length; j++) {
          var key = _that.search.keyWord.toUpperCase();
          var datas = _that.machineInfList[i].taskList[j];
          if (datas.printBill.billCode.indexOf(key) != -1) {
            _that.activeIndex = i;
            _that.activeName = _that.machineInfList[i].machineName;
            _that.activeMachineInfList = _that.machineInfList[_that.activeIndex].taskList;

            datas.printBill.billCode = datas.printBill.billCode.replace(new RegExp(key, 'g'), "<span class='hsp' >" + key + "</span>");
            _that.$tableScrollMove1("multipleTable2", i);
            // _that.activeMachineInfList = _that.machineInfList[i].taskList;

            break;

          }
        }
      }


      // if(_that.search.keyWord!=""){
      //
      //   for (let i = 0; i < _that.machineInfList[activeIndex].taskList.length; i++) {
      //     var key = _that.search.keyWord.toUpperCase()
      //     //string.replace(new RegExp(key,'g'),"<span class='hsp' >"+_that.search.keyWord+"</span>");
      //   }
      // }

    },
    //勾选数据行的 Checkbox 时触发的事件
    rowClass({row, rowIndex}) {
      if (this.selectRow.includes(row.id)) {
        return 'slecleRowColor';
      }
    },
    handleClickTableRow(row, event, column) {

      const _that = this;
      _that.$nextTick(() => {
        _that.$refs.multipleTable.toggleRowSelection(row);
      })

    },
    handleClickTableRow2(row, event, column) {
      const _that = this;
      _that.clickCheckId = row.id;
    },
    tableRowClassName({row, rowIndex}) {
      var _that = this;
      if (row.id == _that.clickCheckId) {
        return 'primary-row';
      }
      if (row.madeBreedStatusInt == 10 && row.cutPaperStatusInt == 10) {
        return 'complete-text';
      }
      //pauseStatus
      if (row.pauseStatus == 1) {
        return 'warning-row';
      }
    },
    tableRowClassName2({row, rowIndex}) {
      var _that = this;
      if (row.madeBreedStatusInt == 10 && row.cutPaperStatusInt == 10) {
        return 'complete-text';
      }
      //pauseStatus
      if (row.pauseStatus == 1) {
        return 'warning-row';
      }
    },
    // 选中的信息
    handleSelectionChange(val) {
      const _that = this
      this.selectData = val
      _that.$nextTick(() => {

        // _that.$refs.multipleTable2.clearSelection();
      })
    },
    handleSelectionChange2(val) {
      const _that = this
      _that.selectData = [];
      _that.selectRow = [];
      _that.$nextTick(() => {
        _that.$refs.multipleTable.clearSelection();
      })
    },
    handleClose() {
      this.dialogSort = false;
    },
    //序号
    indexMethod(index) {
      return index + 1;
    }
  },
  watch: {
    //监听多选的选择状态、数据
    selectData(data) {
      this.selectRow = [];
      // console.log("1111111",data);
      if (data.length > 0) {
        data.forEach((item, index) => {
          for (let i = 0; i < this.tableData.length; i++) {
            if(item.id==this.tableData[i].id){
              this.selectRow.push(this.tableData[i].id)
            }
          }

        })
        // console.log("2222",this.selectRow);
      }
    },
  },
}
</script>
<style>

.el-table--scrollable-x .el-table__body-wrapper {
  overflow-x: auto;
}

/*.tb-edit .el-input {*/
/*  display: none*/
/*}*/

/*.tb-edit .current-row .el-input {*/
/*  display: block*/
/*}*/

/*.tb-edit .current-row .el-input + span {*/
/*  display: none*/
/*}*/

/*.tb-edit .el-input {*/
/*  display: none*/
/*}*/

/*.tb-edit .current-row .el-input {*/
/*  display: block*/
/*}*/

/*.tb-edit .current-row .el-input + span {*/
/*  display: none !important;*/
/*}*/

.hsp {
  background: yellow;
}

.el-table--mini td, .el-table--mini th {
  padding: 3px 0;
}

.top-right-btn .el-pagination__sizes {
  display: none !important;
}
</style>

<style lang="scss" scoped>
::v-deep .el-table {
  .el-table__body-wrapper {
    z-index: 2;
  }
}

//// 解决滚动条被遮挡的问题
//// ------------------ start ------------ //
::v-deep .elTble .el-table {
  .el-table__fixed {
    height: auto !important; // 此处的important表示优先于element.style
    bottom: 13px; // 改为自动高度后，设置与父容器的底部距离，则高度会动态改变
  }
}

//::v-deep .el-table__body-wrapper {
//  z-index: 2
//}
//// 当没有滚动条的时候
//::v-deep .el-table__body-wrapper.is-scrolling-none~.el-table__fixed-right{
//  right: 0 !important;
//}
//// 当有滚动条的时候 默认偏移距离
//::v-deep .el-table--scrollable-y .el-table__fixed-right{
//  height: auto !important; // 此处的important表示优先于element.style
//  right: 10px !important;
//  bottom: 13px;
//}
//.container ::v-deep ::-webkit-scrollbar {
//  width: 10px;
//  height: 13px;
//}
//// ------------------ end ------------ //warning-row
::v-deep .el-table .cell {

}

::v-deep .elTble .el-table .primary-row {
  background: #8cc5ff !important;
  color: #fff;
}

::v-deep .elTble .el-table .warning-row {
  background: rgb(250, 236, 216) !important;
}

::v-deep .elTble .el-table .complete-text span {
  color: #67C23A !important;
}

::v-deep .elTble .el-table .complete-text .cell {
  color: #67C23A !important;
}

::v-deep .dropTableList .el-table .warning-row {
  background: rgb(250, 236, 216) !important;
}

::v-deep .dropTableList .el-table .complete-text span {
  color: #67C23A !important;
}

::v-deep .dropTableList .el-table .complete-text .cell {
  color: #67C23A !important;
}

::v-deep .el-card__body {
  padding-top: 0px !important;
}

::v-deep .el-dialog__body {
  padding-top: 0px !important;
}

.app-container {
  ::v-deep .el-card__header {
    padding: 5px 15px !important;
    font-size: 14px !important;
  }

}

::v-deep .sortTable-con .el-button--mini {
  padding: 3px 3px !important;
}

//table选中高亮
::v-deep .el-table .slecleRowColor {
  background: #8cc5ff !important;
  color: #fff !important;
}


.el-button--mini {
  padding: 4px 15px;
  margin: 0px;
}

.dropTable .el-button--mini {
  padding: 4px 15px;
  margin: 0px;
}

.app-container {
  background-color: #f0f2f5;
  padding: 30px;
  min-height: calc(100vh - 84px);
}

.filter-container {
  margin-bottom: 15px;
}

.text-task {
  font-size: 14px;
  text-align: center;
  color: #7c7c7c;
  margin-left: 15px;
}

.el-table__fixed {
  padding-bottom: -5px !important;
}

.item-badge {
  margin-right: 10px;
  margin-bottom: 10px;
}
</style>
