<template>
  <div class="customer-css">
    <!--  查询时间和产品  -->
    <el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 0px;">
      <el-row>
        <el-form-item :label=labels.enterDate>
          <el-date-picker class="el-time-width" style="" v-model="pageData.enterTime1" value-format="yyyy-MM-dd"></el-date-picker>
        </el-form-item>
        <el-form-item :label="''" style="margin-top: -10px;">
          <el-date-picker class="el-time-width" style="margin-top: 30px;" v-model="pageData.enterTime2" value-format="yyyy-MM-dd" placeholder=""></el-date-picker>
        </el-form-item>
        <el-form-item :label=labels.orderNo>
          <el-input v-model="pageData.orderNo" style="width: 120px"></el-input>
        </el-form-item>
        <el-form-item :label=labels.siteNo>
          <el-input v-model="pageData.site" style="width: 120px"></el-input>
        </el-form-item>
      </el-row>
      <el-row>
        <el-form-item :label=labels.needDate>
          <el-date-picker class="el-time-width" style="" v-model="pageData.needTime1" value-format="yyyy-MM-dd" placeholder=""></el-date-picker>
        </el-form-item>
        <el-form-item :label="''" style="margin-top: -10px;">
          <el-date-picker class="el-time-width" style="margin-top: 30px;" v-model="pageData.needTime2" value-format="yyyy-MM-dd" placeholder=""></el-date-picker>
        </el-form-item>
        <el-form-item>
          <span slot="label" style="" @click="getBaseList(88)"><a herf="#">{{ labels.resourceId }}</a></span>
          <el-input v-model="pageData.resourceId" style="width: 120px"></el-input>
        </el-form-item>
        <el-form-item>
          <span slot="label" style="" @click="getBaseList(24)"><a herf="#">{{ labels.workCenterNo }}</a></span>
          <el-input v-model="pageData.workCenterNo" style="width: 120px"></el-input>
        </el-form-item>
      </el-row>
    </el-form>

    <!--  排序规则  -->
    <fieldset class="customer-field" style="margin-left: 520px; margin-top: -75px; width: 135px;">
      <legend>{{ labels.sortNo }}</legend>
      <br>
      <el-form :inline="true" style="margin-top: -10px; margin-bottom: 10px;" label-position="top" label-width="100px">
        <el-form-item :label="''" style="margin-bottom: 10px;">
          <el-radio-group v-model="pageData.sortField">
            <el-radio label="needDate">{{ labels.sortNeedDate }}</el-radio>
            <el-radio label="orderNo">{{ labels.sortOrderNo }}</el-radio>
            <el-radio label="partNo">{{ labels.sortPartNo }}</el-radio>
          </el-radio-group>
        </el-form-item>
      </el-form>
    </fieldset>

    <!--  菜单  -->
    <el-form :inline="true" label-position="top" label-width="100px" style="margin-left: 660px; margin-top: -40px;">
      <el-row>
        <el-col :span="24">
          <el-form-item :label="''">
            <el-form-item :label="''" style="margin-left: 30px;">
              <el-button class="customer-bun-min" type="primary" @click="refreshPageTables" style="margin-left: 10px; margin-bottom: 5px;">{{ buttons.refreshButton }}
              </el-button>
              <el-button :disabled="dataListSelections.length <= 0" type="primary" @click="scheduleBatchDialog()" style="margin-left: 10px; margin-bottom: 5px;">
                {{ buttons.scheduleBatch ? buttons.scheduleBatch : '批量排产' }}
              </el-button>
            </el-form-item>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>

    <!--  工单主表信息  -->
    <el-main style="margin-top: 25px; padding: 0px; width: 100%;">
      <el-form :inline="true" label-position="top" label-width="100px">
        <el-form-item :label=labels.primaryRecord>
        </el-form-item>
        <el-dropdown trigger="click" class="customer-dropdown" size="small" @command="orderHandleCommand">
          <el-button type="primary" :disabled="authEdit" @click="controlPrimaryMenuBun">
            {{ buttons.primaryMenu }}<i class="el-icon-arrow-down el-icon--right"></i>
          </el-button>
          <el-dropdown-menu slot="dropdown">
            <el-dropdown-item class="customer-li" command="生产工单" :disabled="primaryMenuButton.shopOrderFlag">{{ buttons.shopOrder }}</el-dropdown-item>
            <hr width="95%"/>
            <el-dropdown-item class="customer-li" command="查看物料库存" :disabled="primaryMenuButton.partStockFlag">{{ buttons.viewPartStock }}</el-dropdown-item>
          </el-dropdown-menu>
        </el-dropdown>
<!--        <el-button @click="userSetting" type="primary">{{ buttons.settingTable }}</el-button>-->
      </el-form>
      <el-table
        :height="height"
        :data="shopOrderList"
        border
        ref="routingTable"
        highlight-current-row
        @selection-change="handleSelectionChange"
        @row-click="setCurrentRoutingRow"
        :row-class-name="routingRowClassName"
        @row-dblclick="startScheduleOperation"
        v-loading="dataListLoading"
        style="margin-top: -20px; width: 100%;">
        <el-table-column
          type="selection"
          header-align="center"
          fixed="left"
          align="center"
          width="55">
        </el-table-column>
        <el-table-column
          v-for="(item,index) in columnList" :key="index"
          :sortable="item.columnSortable"
          :prop="item.columnProp"
          :header-align="item.headerAlign"
          :show-overflow-tooltip="item.showOverflowTooltip"
          :align="item.align"
          :fixed="item.fixed==''?false:item.fixed"
          :width="item.columnWidth"
          :label="item.columnLabel">
          <template slot-scope="scope">
            <span v-if="!item.columnHidden && item.columnProp == 'resourceList'">
              <el-select class="table-select-input" v-model="scope.row.resourceId">
                <el-option
                  v-for="(item,index) in scope.row.resourceList"
                  :key="index"
                  :value="item.resourceId"
                  :label="item.resourceDesc">
                </el-option>
              </el-select>
            </span>
            <span v-if="!item.columnHidden && item.columnProp == 'qtyToSchedule'">
              <el-input v-model="scope.row.qtyToSchedule" type="number"></el-input>
            </span>
            <span v-else> {{ scope.row[item.columnProp] }}</span>
          </template>
        </el-table-column>
      </el-table>
      <!-- 分页栏 -->
      <el-pagination
        style="margin-top: 0px"
        @size-change="sizeChangeHandle"
        @current-change="currentChangeHandle"
        :current-page="pageIndex"
        :page-sizes="[20, 50, 100, 200, 500]"
        :page-size="pageSize"
        :total="totalPage"
        layout="total, sizes, prev, pager, next, jumper">
      </el-pagination>
    </el-main>

    <!--列表的组件-->
    <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>

    <!-- 物料库存查询 -->
    <comPartStock ref="comPartStock" :close-on-click-modal="false"
                  :visible.sync="showPartStockFlag">
    </comPartStock>

    <!-- 物料库存查询 -->
    <comScheduleOrderExpand ref="comScheduleOrderExpand" :close-on-click-modal="false"
                            :visible.sync="showScheduleOrderFlag"
                            @refreshPageTables="refreshPageTables">
    </comScheduleOrderExpand>

    <!-- 动态列    -->
    <column v-if="visible" ref="column" @refreshData="getTableUserColumn" v-drag></column>

    <el-dialog
      width="702px"
      :title="'已选工单'"
      :close-on-click-modal="false"
      :visible.sync="scheduleVisible">
      <el-row>
        <el-col :span="24">
          <el-form :inline="true" label-position="top" style="height: 60px;"
                   label-width="80px">
            <el-form-item :label=labels.scheduledDate>
              <el-date-picker class="el-time-width"
                              style=""
                              v-model="scheduleDate"
                              value-format="yyyy-MM-dd">
              </el-date-picker>
            </el-form-item>
            <el-form-item :label="''" style="margin-top: -5px;">
              <el-checkbox v-model="specifiedTime" true-label="Y" false-label="N"
                           style="margin-top: 28px; margin-right: -20px;"></el-checkbox>
              <el-time-picker
                format="HH:mm"
                style="margin-top: 30px; width: 65px"
                v-model="scheduleTime"
                value-format="HH:mm">
              </el-time-picker>
            </el-form-item>
          </el-form>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="24">
          <el-table
            :height="300"
            :data="dataListSelections"
            border
            style="margin-top: -15px; width: 100%;">
            <el-table-column
              v-for="(item,index) in scheduleColumnList" :key="index"
              :sortable="item.columnSortable"
              :prop="item.columnProp"
              :header-align="item.headerAlign"
              :show-overflow-tooltip="item.showOverflowTooltip"
              :align="item.align"
              :fixed="item.fixed==''?false:item.fixed"
              :width="item.columnWidth"
              :label="item.columnLabel">
              <template slot-scope="scope">
            <span v-if="!item.columnHidden">
             {{ scope.row[item.columnProp] }}
            </span>
              </template>
            </el-table-column>
          </el-table>
        </el-col>
      </el-row>

      <span slot="footer" class="dialog-footer">
      <el-button type="primary" @click="batchScheduleOrderWithExpandStart()">确定</el-button>
      <el-button type="primary" @click="scheduleVisible = false">取消</el-button>
    </span>
    </el-dialog>
  </div>
</template>

<script>
import Chooselist from '@/views/modules/common/Chooselist';/*列表组件*/
import comPartStock from "../common/com_part_stock";/*展示物料库存的组件*/
import comScheduleOrderExpand from '@/views/modules/schedule/com_schedule_order_expand';/*排产扩展  排产单个工单*/
import column from '@/views/modules/common/column';/*动态表头*/

import {
  getShopOrderList,
  getCurrentWorkCenterNoByResourceId,
  batchScheduleOrderWithExpand
} from '@/api/schedule/order_schedule_expand.js';

/*动态表头*/
import {
  saveTableDefaultList,
  getTableDefaultListLanguage,
  getTableUserListLanguage,
  removerDefault,
  removerUser
} from "@/api/table.js";

import {
  searchSysLanguagePackList,
  searchSysLanguageParam,
  searchFunctionButtonList,
  saveButtonList,
  searchSysLanguage,
  searchLanguageListByLanguageCode,
  saveSysLanguageOne,
  searchPageLanguageData,
  removerLanguage,
  saveSysLanguageList
} from "@/api/sysLanguage.js";

var functionId = '104002004';

export default {
  data() {
    return {
      height: 200,
      pageIndex: 1,
      pageSize: 20,
      totalPage: 0,
      tagNo: '',
      authEdit: false,
      authAdd: false,
      authDelete: false,
      scheduleVisible: false,
      scheduleDate: this.dayjs().format('YYYY-MM-DD'),
      specifiedTime: 'N',
      scheduleTime: '08:30',
      dataListSelections: [],
      scheduleColumnList: [
        {
          userId: this.$store.state.user.name,
          functionId: 5301,
          serialNumber: '5301OrderOrderNo',
          tableId: "5301Order",
          tableName: "工单表",
          columnProp: "orderNo",
          headerAlign: "center",
          align: "center",
          columnLabel: "订单号",
          columnWidth: 80,
          columnHidden: false,
          columnImage: false,
          columnSortable: true,
          sortLv: 0,
          status: true,
          fixed: false
        },
        {
          userId: this.$store.state.user.name,
          functionId: 5301,
          serialNumber: '5301OrderItemNo',
          tableId: "5301Order",
          tableName: "工单表",
          columnProp: "itemNo",
          headerAlign: "center",
          align: "center",
          columnLabel: "工序号",
          columnWidth: 80,
          columnHidden: false,
          columnImage: false,
          columnSortable: true,
          sortLv: 0,
          status: true,
          fixed: false
        },
        {
          userId: this.$store.state.user.name,
          functionId: 5301,
          serialNumber: '5301OrderItemDesc',
          tableId: "5301Order",
          tableName: "工单表",
          columnProp: "itemDesc",
          headerAlign: "center",
          align: "center",
          columnLabel: "工序名称",
          columnWidth: 100,
          columnHidden: false,
          columnImage: false,
          columnSortable: true,
          sortLv: 0,
          status: true,
          fixed: false
        },
        {
          userId: this.$store.state.user.name,
          functionId: 5301,
          serialNumber: '5301OrderPartNo',
          tableId: "5301Order",
          tableName: "工单表",
          columnProp: "partNo",
          headerAlign: "center",
          align: "center",
          columnLabel: "产品编码",
          columnWidth: 100,
          columnHidden: false,
          columnImage: false,
          columnSortable: true,
          sortLv: 0,
          status: true,
          fixed: false
        },

        {
          userId: this.$store.state.user.name,
          functionId: 5301,
          serialNumber: '5301OrderQtyToSchedule',
          tableId: "5301Order",
          tableName: "工单表",
          columnProp: "qtyToSchedule",
          headerAlign: "center",
          align: "center",
          columnLabel: "待排产数量",
          columnWidth: 120,
          columnHidden: false,
          columnImage: false,
          columnSortable: true,
          sortLv: 0,
          status: true,
          fixed: false
        },
        {
          userId: this.$store.state.user.name,
          functionId: 5301,
          serialNumber: '5301OrderWorkCenterNo',
          tableId: "5301Order",
          tableName: "工单表",
          columnProp: "workCenterNo",
          headerAlign: "center",
          align: "center",
          columnLabel: "加工中心",
          columnWidth: 100,
          columnHidden: false,
          columnImage: false,
          columnSortable: true,
          sortLv: 0,
          status: true,
          fixed: false
        },
        {
          userId: this.$store.state.user.name,
          functionId: 5301,
          serialNumber: '5301OrderWorkCenterNo',
          tableId: "5301Order",
          tableName: "工单表",
          columnProp: "resourceId",
          headerAlign: "center",
          align: "center",
          columnLabel: "机台",
          columnWidth: 100,
          columnHidden: false,
          columnImage: false,
          columnSortable: true,
          sortLv: 0,
          status: true,
          fixed: false
        },
      ],
      menuId: this.$route.meta.menuId,
      showDefault: false,
      visible: false,
      showPartStockFlag: false,
      showScheduleOrderFlag: false,
      currentRoutingRow: {},
      pageData: {
        site: this.$store.state.user.site,
        username: this.$store.state.user.name,
        orderNo: '',
        itemNo: '',
        seqNo: 0,
        resourceId: '',
        workCenterNo: '',
        enterTime1: '',
        enterTime2: '',
        needTime1: '',
        needTime2: '',
        scheduleDate: this.dayjs(new Date()).format('YYYY-MM-DD'),
        scheduleTime: '08:30',
        specifiedTime: 'N',
        scheduledQty: 0,
        waitTimes: 0,
        scheduleSeqNo: 0,
        planStartTime: '',
        calendarId: '',
        calendarDesc: '',
        status: 1,
        sortField: 'needDate',
        page: 1,
        limit: 10,
      },
      shopOrderList: [],
      dataListLoading: false,
      columnList: [
        {
          userId: this.$store.state.user.name,
          functionId: 5301,
          serialNumber: '5301OrderOrderNo',
          tableId: "5301Order",
          tableName: "工单表",
          columnProp: "orderNo",
          headerAlign: "center",
          align: "center",
          columnLabel: "订单号",
          columnWidth: 80,
          columnHidden: false,
          columnImage: false,
          columnSortable: true,
          sortLv: 0,
          status: true,
          fixed: false
        },
        {
          userId: this.$store.state.user.name,
          functionId: 5301,
          serialNumber: '5301OrderItemNo',
          tableId: "5301Order",
          tableName: "工单表",
          columnProp: "itemNo",
          headerAlign: "center",
          align: "center",
          columnLabel: "工序号",
          columnWidth: 80,
          columnHidden: false,
          columnImage: false,
          columnSortable: true,
          sortLv: 0,
          status: true,
          fixed: false
        },
        {
          userId: this.$store.state.user.name,
          functionId: 5301,
          serialNumber: '5301OrderItemDesc',
          tableId: "5301Order",
          tableName: "工单表",
          columnProp: "itemDesc",
          headerAlign: "center",
          align: "center",
          columnLabel: "工序名称",
          columnWidth: 100,
          columnHidden: false,
          columnImage: false,
          columnSortable: true,
          sortLv: 0,
          status: true,
          fixed: false
        },
        {
          userId: this.$store.state.user.name,
          functionId: 5301,
          serialNumber: '5301OrderNeedDate',
          tableId: "5301Order",
          tableName: "工单表",
          columnProp: "needDate",
          headerAlign: "center",
          align: "center",
          columnLabel: "要求完工日期",
          columnWidth: 100,
          columnHidden: false,
          columnImage: false,
          columnSortable: true,
          sortLv: 0,
          status: true,
          fixed: false
        },
        {
          userId: this.$store.state.user.name,
          functionId: 5301,
          serialNumber: '5301OrderPartNo',
          tableId: "5301Order",
          tableName: "工单表",
          columnProp: "partNo",
          headerAlign: "center",
          align: "center",
          columnLabel: "产品编码",
          columnWidth: 100,
          columnHidden: false,
          columnImage: false,
          columnSortable: true,
          sortLv: 0,
          status: true,
          fixed: false
        },
        {
          userId: this.$store.state.user.name,
          functionId: 5301,
          serialNumber: '5301OrderCustomerName',
          tableId: "5301Order",
          tableName: "工单表",
          columnProp: "customerName",
          headerAlign: "center",
          align: "center",
          columnLabel: "客户名称",
          columnWidth: 80,
          columnHidden: false,
          columnImage: false,
          columnSortable: true,
          sortLv: 0,
          status: true,
          fixed: false
        },
        {
          userId: this.$store.state.user.name,
          functionId: 5301,
          serialNumber: '5301OrderCustPartNo',
          tableId: "5301Order",
          tableName: "工单表",
          columnProp: "custPartNo",
          headerAlign: "center",
          align: "center",
          columnLabel: "客户产品料号",
          columnWidth: 120,
          columnHidden: false,
          columnImage: false,
          columnSortable: true,
          sortLv: 0,
          status: true,
          fixed: false
        },
        {
          userId: this.$store.state.user.name,
          functionId: 5301,
          serialNumber: '5301OrderPartDesc',
          tableId: "5301Order",
          tableName: "工单表",
          columnProp: "partDesc",
          headerAlign: "center",
          align: "center",
          columnLabel: "产成品名称",
          columnWidth: 80,
          columnHidden: false,
          columnImage: false,
          columnSortable: false,
          sortLv: 0,
          status: true,
          fixed: false
        },
        {
          userId: this.$store.state.user.name,
          functionId: 5301,
          serialNumber: '5301OrderLotSize',
          tableId: "5301Order",
          tableName: "工单表",
          columnProp: "lotSize",
          headerAlign: "center",
          align: "center",
          columnLabel: "订单量",
          columnWidth: 80,
          columnHidden: false,
          columnImage: false,
          columnSortable: true,
          sortLv: 0,
          status: true,
          fixed: false
        },
        {
          userId: this.$store.state.user.name,
          functionId: 5301,
          serialNumber: '5301OrderQtyToSchedule',
          tableId: "5301Order",
          tableName: "工单表",
          columnProp: "qtyToSchedule",
          headerAlign: "center",
          align: "center",
          columnLabel: "待排产数量",
          columnWidth: 120,
          columnHidden: false,
          columnImage: false,
          columnSortable: true,
          sortLv: 0,
          status: true,
          fixed: false
        },
        {
          userId: this.$store.state.user.name,
          functionId: 5301,
          serialNumber: '5301OrderQtyScheduled',
          tableId: "5301Order",
          tableName: "工单表",
          columnProp: "qtyScheduled",
          headerAlign: "center",
          align: "center",
          columnLabel: "已排产数量",
          columnWidth: 120,
          columnHidden: false,
          columnImage: false,
          columnSortable: true,
          sortLv: 0,
          status: true,
          fixed: false
        },
        {
          userId: this.$store.state.user.name,
          functionId: 5301,
          serialNumber: '5301OrderQtyReported',
          tableId: "5301Order",
          tableName: "工单表",
          columnProp: "qtyReported",
          headerAlign: "center",
          align: "center",
          columnLabel: "已报工数量",
          columnWidth: 120,
          columnHidden: false,
          columnImage: false,
          columnSortable: true,
          sortLv: 0,
          status: true,
          fixed: false
        },
        {
          userId: this.$store.state.user.name,
          functionId: 5301,
          serialNumber: '5301OrderSpec',
          tableId: "5301Order",
          tableName: "工单表",
          columnProp: "spec",
          headerAlign: "center",
          align: "center",
          columnLabel: "规格型号",
          columnWidth: 80,
          columnHidden: false,
          columnImage: false,
          columnSortable: false,
          sortLv: 0,
          status: true,
          fixed: false
        },
        {
          userId: this.$store.state.user.name,
          functionId: 5301,
          serialNumber: '5301OrderSite',
          tableId: "5301Order",
          tableName: "工单表",
          columnProp: "site",
          headerAlign: "center",
          align: "center",
          columnLabel: "工厂编号",
          columnWidth: 80,
          columnHidden: false,
          columnImage: false,
          columnSortable: false,
          sortLv: 0,
          status: true,
          fixed: false
        },
        {
          userId: this.$store.state.user.name,
          functionId: 5301,
          serialNumber: '5301OrderWorkCenterNo',
          tableId: "5301Order",
          tableName: "工单表",
          columnProp: "workCenterNo",
          headerAlign: "center",
          align: "center",
          columnLabel: "加工中心",
          columnWidth: 100,
          columnHidden: false,
          columnImage: false,
          columnSortable: true,
          sortLv: 0,
          status: true,
          fixed: false
        },
        {
          userId: this.$store.state.user.name,
          functionId: 5301,
          serialNumber: '5301OrderNextItemNo',
          tableId: "5301Order",
          tableName: "工单表",
          columnProp: "nextItemNo",
          headerAlign: "center",
          align: "center",
          columnLabel: "下道工序",
          columnWidth: 100,
          columnHidden: false,
          columnImage: false,
          columnSortable: true,
          sortLv: 0,
          status: true,
          fixed: false
        },
        {
          userId: this.$store.state.user.name,
          functionId: 5301,
          serialNumber: '5301OrderNextItemDesc',
          tableId: "5301Order",
          tableName: "工单表",
          columnProp: "nextItemDesc",
          headerAlign: "center",
          align: "center",
          columnLabel: "下道工序名称",
          columnWidth: 80,
          columnHidden: false,
          columnImage: false,
          columnSortable: false,
          sortLv: 0,
          status: true,
          fixed: false
        },
        {
          userId: this.$store.state.user.name,
          functionId: 5301,
          serialNumber: '5301OrderNextScheduledFlag',
          tableId: "5301Order",
          tableName: "工单表",
          columnProp: "nextScheduledFlag",
          headerAlign: "center",
          align: "center",
          columnLabel: "下道工序已排产",
          columnWidth: 150,
          columnHidden: false,
          columnImage: false,
          columnSortable: true,
          sortLv: 0,
          status: true,
          fixed: false
        },
        {
          userId: this.$store.state.user.name,
          functionId: 5301,
          serialNumber: '5301OrderPreItemNo',
          tableId: "5301Order",
          tableName: "工单表",
          columnProp: "preItemNo",
          headerAlign: "center",
          align: "center",
          columnLabel: "上道工序",
          columnWidth: 80,
          columnHidden: false,
          columnImage: false,
          columnSortable: true,
          sortLv: 0,
          status: true,
          fixed: false
        },
        {
          userId: this.$store.state.user.name,
          functionId: 5301,
          serialNumber: '5301OrderPreItemDesc',
          tableId: "5301Order",
          tableName: "工单表",
          columnProp: "preItemDesc",
          headerAlign: "center",
          align: "center",
          columnLabel: "上道工序名称",
          columnWidth: 80,
          columnHidden: false,
          columnImage: false,
          columnSortable: false,
          sortLv: 0,
          status: true,
          fixed: false
        },
        {
          userId: this.$store.state.user.name,
          functionId: 5301,
          serialNumber: '5301OrderPreScheduledFlag',
          tableId: "5301Order",
          tableName: "工单表",
          columnProp: "preScheduledFlag",
          headerAlign: "center",
          align: "center",
          columnLabel: "上道工序已排产",
          columnWidth: 80,
          columnHidden: false,
          columnImage: false,
          columnSortable: false,
          sortLv: 0,
          status: true,
          fixed: false
        },
        {
          userId: this.$store.state.user.name,
          functionId: 5301,
          serialNumber: '5301OrderScheduledFlag',
          tableId: "5301Order",
          tableName: "工单表",
          columnProp: "scheduledFlag",
          headerAlign: "center",
          align: "center",
          columnLabel: "是否排产",
          columnWidth: 80,
          columnHidden: false,
          columnImage: false,
          columnSortable: true,
          sortLv: 0,
          status: true,
          fixed: false
        },
        {
          userId: this.$store.state.user.name,
          functionId: 5301,
          serialNumber: '5301OrderAvailResource',
          tableId: "5301Order",
          tableName: "工单表",
          columnProp: "availResource",
          headerAlign: "center",
          align: "center",
          columnLabel: "可用机台",
          columnWidth: 80,
          columnHidden: false,
          columnImage: false,
          columnSortable: false,
          sortLv: 0,
          status: true,
          fixed: false
        },
        {
          userId: this.$store.state.user.name,
          functionId: 5301,
          serialNumber: '5301OrderEnterDate',
          tableId: "5301Order",
          tableName: "工单表",
          columnProp: "enterDate",
          headerAlign: "center",
          align: "center",
          columnLabel: "录入日期",
          columnWidth: 125,
          columnHidden: false,
          columnImage: false,
          columnSortable: false,
          sortLv: 0,
          status: true,
          fixed: false
        },
        {
          userId: this.$store.state.user.name,
          functionId: 5301,
          serialNumber: '5301OrderScheduleToPlanTime',
          tableId: "5301Order",
          tableName: "工单表",
          columnProp: "scheduleToPlanTime",
          headerAlign: "center",
          align: "center",
          columnLabel: "计划时间",
          columnWidth: 80,
          columnHidden: false,
          columnImage: false,
          columnSortable: false,
          sortLv: 0,
          status: true,
          fixed: false
        },
        {
          userId: this.$store.state.user.name,
          functionId: 5301,
          serialNumber: '5301OrderMachRunFactor',
          tableId: "5301Order",
          tableName: "工单表",
          columnProp: "machRunFactor",
          headerAlign: "center",
          align: "center",
          columnLabel: "单位产出",
          columnWidth: 80,
          columnHidden: false,
          columnImage: false,
          columnSortable: false,
          sortLv: 0,
          status: true,
          fixed: false
        },
        {
          userId: this.$store.state.user.name,
          functionId: 5301,
          serialNumber: '5301OrderMachSetupTime',
          tableId: "5301Order",
          tableName: "工单表",
          columnProp: "machSetupTime",
          headerAlign: "center",
          align: "center",
          columnLabel: "调机时间",
          columnWidth: 80,
          columnHidden: false,
          columnImage: false,
          columnSortable: false,
          sortLv: 0,
          status: true,
          fixed: false
        },
        {
          userId: this.$store.state.user.name,
          functionId: 5301,
          serialNumber: '5301OrderFactorUnit',
          tableId: "5301Order",
          tableName: "工单表",
          columnProp: "factorUnit",
          headerAlign: "center",
          align: "center",
          columnLabel: "产出单位",
          columnWidth: 80,
          columnHidden: false,
          columnImage: false,
          columnSortable: false,
          sortLv: 0,
          status: true,
          fixed: false
        },
        {
          userId: this.$store.state.user.name,
          functionId: 5301,
          serialNumber: '5301OrderQtyScheduledPreOps',
          tableId: "5301Order",
          tableName: "工单表",
          columnProp: "qtyScheduledPreOps",
          headerAlign: "center",
          align: "center",
          columnLabel: "前道工序已排产数量",
          columnWidth: 80,
          columnHidden: false,
          columnImage: false,
          columnSortable: false,
          sortLv: 0,
          status: true,
          fixed: false
        },
        {
          userId: this.$store.state.user.name,
          functionId: 5301,
          serialNumber: '5301OrderQtyApprovedPreOps',
          tableId: "5301Order",
          tableName: "工单表",
          columnProp: "qtyApprovedPreOps",
          headerAlign: "center",
          align: "center",
          columnLabel: "前道工序已报合格数",
          columnWidth: 80,
          columnHidden: false,
          columnImage: false,
          columnSortable: false,
          sortLv: 0,
          status: true,
          fixed: false
        },
        // {
        //   userId: this.$store.state.user.name,
        //   functionId: 5301,
        //   serialNumber: '5301OrderOriSOOrderNo',
        //   tableId: "5301Order",
        //   tableName: "工单表",
        //   columnProp: "oriSOOrderNo",
        //   headerAlign: "center",
        //   align: "center",
        //   columnLabel: "SAP参考号",
        //   columnWidth: 80,
        //   columnHidden: false,
        //   columnImage: false,
        //   columnSortable: false,
        //   sortLv: 0,
        //   status: true,
        //   fixed: false
        // },
        {
          userId: this.$store.state.user.name,
          functionId: 5301,
          serialNumber: '5301OrderEficiency',
          tableId: "5301Order",
          tableName: "工单表",
          columnProp: "efficiency",
          headerAlign: "center",
          align: "center",
          columnLabel: "效率",
          columnWidth: 80,
          columnHidden: false,
          columnImage: false,
          columnSortable: false,
          sortLv: 0,
          status: true,
          fixed: false
        },
        // {
        //   userId: this.$store.state.user.name,
        //   functionId: 5301,
        //   serialNumber: '5301OrderCostRollUpFlag',
        //   tableId: "5301Order",
        //   tableName: "工单表",
        //   columnProp: "costRollUpFlag",
        //   headerAlign: "center",
        //   align: "center",
        //   columnLabel: "已排料",
        //   columnWidth: 80,
        //   columnHidden: false,
        //   columnImage: false,
        //   columnSortable: false,
        //   sortLv: 0,
        //   status: true,
        //   fixed: false
        // },
        // {
        //   userId: this.$store.state.user.name,
        //   functionId: 5301,
        //   serialNumber: '5301OrderManualFlag',
        //   tableId: "5301Order",
        //   tableName: "工单表",
        //   columnProp: "manualFlag",
        //   headerAlign: "center",
        //   align: "center",
        //   columnLabel: "刀模已发",
        //   columnWidth: 80,
        //   columnHidden: false,
        //   columnImage: false,
        //   columnSortable: false,
        //   sortLv: 0,
        //   status: true,
        //   fixed: false
        // },
        // {
        //   userId: this.$store.state.user.name,
        //   functionId: 5301,
        //   serialNumber: '5301OrderRepairSOFlag',
        //   tableId: "5301Order",
        //   tableName: "工单表",
        //   columnProp: "repairSOFlag",
        //   headerAlign: "center",
        //   align: "center",
        //   columnLabel: "印版已发",
        //   columnWidth: 80,
        //   columnHidden: false,
        //   columnImage: false,
        //   columnSortable: false,
        //   sortLv: 0,
        //   status: true,
        //   fixed: false
        // },
      ],
      calendarOutList: [],
      primaryMenuButton: {
        shopOrderFlag: true,
        partStockFlag: true,
      },
      queryTable: {
        userId: this.$store.state.user.name,
        functionId: this.$route.meta.menuId,
        tableId: "5301Order",
        languageCode: this.$i18n.locale
      },
      // 用户table 查询参数
      queryTableUser: {
        userId: this.$store.state.user.name,
        functionId: this.$route.meta.menuId,
        tableId: "5301Order",
        status: true,
        languageCode: this.$i18n.locale
      },
      // 用户table 配置集合
      userColumnList: [],
      buttons: {
        refreshButton: '刷新',
        primaryMenu: '主菜单',
        shopOrder: '生产订单',
        viewPartStock: '查看物料库存',
        settingTable: '设置列表',
        defaultTable: '设置默认配置',
        scheduleBatch: '批量排产',
      },
      buttonList: [
        {
          functionId: functionId,
          languageValue: '刷新',
          objectId: 'refreshButton',
          objectType: 'button',
          tableId: '*'
        }, {
          functionId: functionId,
          languageValue: '主菜单',
          objectId: 'primaryMenu',
          objectType: 'button',
          tableId: '*'
        }, {
          functionId: functionId,
          languageValue: '生产订单',
          objectId: 'shopOrder',
          objectType: 'button',
          tableId: '*'
        }, {
          functionId: functionId,
          languageValue: '查看物料库存',
          objectId: 'viewPartStock',
          objectType: 'button',
          tableId: '*'
        }, {
          functionId: functionId,
          languageValue: '设置列表',
          objectId: 'settingTable',
          objectType: 'button',
          tableId: '*'
        }, {
          functionId: functionId,
          languageValue: '设置默认配置',
          objectId: 'defaultTable',
          objectType: 'button',
          tableId: '*'
        },
      ],
      queryButton: {
        functionId: functionId,
        table_id: '*',
        languageCode: this.$i18n.locale,
        objectType: 'button'
      },
      labels: {
        enterDate: '录入日期:',
        needDate: '要求完工日期:',
        orderNo: '生产订单号:',
        siteNo: '工厂编号:',
        resourceId: '机台编号:',
        workCenterNo: '加工中心编码:',
        sortNo: '排序',
        sortNeedDate: '要求完工日期',
        sortOrderNo: '订单号',
        sortPartNo: '产品编码',
        primaryRecord: '主记录',
        pleaseSelectOrder: '请选择工单!',
        scheduleBatchWarning: '选中的工单中,包含未选择的机台的工单!',
        scheduledDate: '排产日期',
        pleaseEnterThisScheduleQty: '请输入本次排产数量!',
        thisScheduleQtyMustMoreThanZero: '本次排产数量必须大于零!',
        pleaseSelectAvailableResourceId: '请选择可用机台!',
        scheduleQtyMoreThanZeroWaitScheduleQty: '排产数量超过本次待排产数量!',
      },
      labelsList: [
        {
          functionId: functionId,
          languageValue: '录入日期:',
          objectId: 'enterDate',
          objectType: 'label',
          tableId: '*'
        }, {
          functionId: functionId,
          languageValue: '要求完工日期:',
          objectId: 'needDate',
          objectType: 'label',
          tableId: '*'
        }, {
          functionId: functionId,
          languageValue: '生产订单号:',
          objectId: 'orderNo',
          objectType: 'label',
          tableId: '*'
        }, {
          functionId: functionId,
          languageValue: '工厂编号:',
          objectId: 'siteNo',
          objectType: 'label',
          tableId: '*'
        }, {
          functionId: functionId,
          languageValue: '机台编码:',
          objectId: 'resourceId',
          objectType: 'label',
          tableId: '*'
        }, {
          functionId: functionId,
          languageValue: '加工中心编码:',
          objectId: 'workCenterNo',
          objectType: 'label',
          tableId: '*'
        }, {
          functionId: functionId,
          languageValue: '排序',
          objectId: 'sortNo',
          objectType: 'label',
          tableId: '*'
        }, {
          functionId: functionId,
          languageValue: '要求完工日期',
          objectId: 'sortNeedDate',
          objectType: 'label',
          tableId: '*'
        }, {
          functionId: functionId,
          languageValue: '订单号',
          objectId: 'sortOrderNo',
          objectType: 'label',
          tableId: '*'
        }, {
          functionId: functionId,
          languageValue: '产品编码',
          objectId: 'sortPartNo',
          objectType: 'label',
          tableId: '*'
        }, {
          functionId: functionId,
          languageValue: '主记录',
          objectId: 'primaryRecord',
          objectType: 'label',
          tableId: '*'
        }, {
          functionId: functionId,
          languageValue: '请选择工单!',
          objectId: 'pleaseSelectOrder',
          objectType: 'label',
          tableId: '*'
        },
      ],
      queryLabel: {
        functionId: functionId,
        table_id: '*',
        languageCode: this.$i18n.locale,
        objectType: 'label'
      },
    }
  },

  /*组件*/
  components: {
    Chooselist,/*列表的组件*/
    comPartStock,/*展示物料库存的组件*/
    comScheduleOrderExpand,/*扩展排产 处理多加工中心排产*/
    column,/*动态列*/
  },

  mounted() {
    this.$nextTick(() => {
      this.height = window.innerHeight - 235;
    })
  },
  methods: {
    // 开始排产
    batchScheduleOrderWithExpandStart() {
      let newItemList = []
      for (let i = 0; i < this.dataListSelections.length; i++) {
        let item = this.dataListSelections[i]
        let qtyToSchedule = item.qtyToSchedule;
        if (qtyToSchedule == null || qtyToSchedule == '') {
          this.$message.error(this.labels.pleaseEnterThisScheduleQty)
          return false;
        }
        //判断数量是否超限
        if (item.scheduledQty <= 0) {
          this.$message.error(this.labels.thisScheduleQtyMustMoreThanZero)
          return false;
        }
        //验证可用机台
        let resourceId = item.resourceId;
        if (resourceId == null || resourceId == '' || resourceId == '请选择') {
          this.$message.error(this.labels.pleaseSelectAvailableResourceId)
          return false;
        }
        let scheduledQty = parseFloat(item.scheduledQty);
        if (qtyToSchedule > scheduledQty) {
          this.$message.error(this.labels.scheduleQtyMoreThanZeroWaitScheduleQty)
          return false;
        }
        let newItem = {
          checkFlag: true,
          itemNo: item.itemNo,
          orderNo: item.orderNo,
          qtyToSchedule: item.scheduledQty,
          resourceId: item.resourceId,
          scheduleDate: this.scheduleDate,
          scheduleTime: this.scheduleTime,
          scheduledQty: item.qtyToSchedule,
          site: item.site,
          specifiedTime: this.specifiedTime,
          username: this.$store.state.user.name,
          workCenterNo: item.workCenterNo
        }
        newItemList.push(newItem)
      }
      batchScheduleOrderWithExpand(newItemList).then(({data}) => {
        if (data.code == 200) {
          this.$message.success(data.msg)
          this.scheduleVisible = false
          this.getShopOrderList()
        } else if (data.code == 201) {
          this.$message.warning(data.msg.substring(0, data.msg.indexOf(',')) + "!")
        } else if (data.code == 500) {
          this.$message.error(data.msg)
        }
      })
    },

    // scheduleBatchDialog
    scheduleBatchDialog() {
      if (this.dataListSelections.find(item => item.resourceId == '' || item.resourceId == null)) {
        this.$message.warning(this.labels.scheduleBatchWarning)
        return
      }
      this.scheduleVisible = true
    },

    // 选中记录
    handleSelectionChange(val) {
      this.dataListSelections = val
    },

    /*刷新页面table*/
    refreshPageTables() {
      this.getShopOrderList();
    },

    // 每页数
    sizeChangeHandle (val) {
      this.pageSize = val
      this.pageIndex = 1
      this.getShopOrderList()
    },

    // 当前页
    currentChangeHandle (val) {
      this.pageIndex = val
      this.getShopOrderList()
    },

    /*获取工单信息*/
    getShopOrderList() {
      this.pageData.limit = this.pageSize
      this.pageData.page = this.pageIndex
      getShopOrderList(this.pageData).then(({data}) => {
        if (this.pageData.resourceId) {
          this.shopOrderList = data.page.list.map(item => {
            item.resourceId = this.pageData.resourceId
            item.resourceList = item.resourceList.split(';').map(resItem => {
              let newItem = {
                resourceId: resItem.split(':')[0],
                resourceDesc: resItem.split(':')[1]
              }
              return newItem;
            })
            return item;
          })
        } else {
          this.shopOrderList = data.page.list.map(item => {
            item.resourceList = item.resourceList.split(';').map(resItem => {
              let newItem = {
                resourceId: resItem.split(':')[0],
                resourceDesc: resItem.split(':')[1]
              }
              return newItem;
            })
            return item;
          })
        }
        this.pageIndex = data.page.currPage
        this.pageSize = data.page.pageSize
        this.totalPage = data.page.totalCount
        //清空已经选好的行数据
        this.currentRoutingRow = null;
      })
    },


    /*列表方法的回调*/
    getBaseData(val) {
      if (this.tagNo === 88) {
        this.pageData.resourceId = val.ResourceID;
      } else if (this.tagNo == 24) {
        this.pageData.workCenterNo = val.WorkCenterNo;
      }
    },

    // 获取基础数据列表
    getBaseList(val) {
      this.tagNo = val
      this.$nextTick(() => {
        let strVal = "";
        if (val === 88) {
          strVal = this.pageData.resourceId;
        } else if (val === 24) {
          strVal = this.pageData.workCenterNo;
        }
        this.$refs.baseList.init(val, strVal, " AND WorkCenterNo <> 'FQC'")
      })
    },

    /*区分不同的菜单  调用不同的方法  调用不同的方法*/
    orderHandleCommand(menuName) {
      //区分是哪一个方法调用
      if ('生产工单' === menuName) {
        //判断是否选择好了工单
        if (this.currentRoutingRow == null || this.currentRoutingRow == {}) {
          //重置按钮
          this.primaryMenuButton.shopOrderFlag = true;
          //返回错误
          this.$message.error(this.labels.pleaseSelectOrder);
          return false;
        }
        this.$router.push({
          path: '/shopOrder-shopOrder/shopOrder',
          query: {
            site: this.$store.state.user.site,
            order: this.currentRoutingRow.orderNo,
            user: this.$store.state.user.name
          }
        })
      } else if ('查看物料库存' === menuName) {
        //判断是否选择好了工单
        if (this.currentRoutingRow == null || this.currentRoutingRow == {}) {
          //重置按钮
          this.primaryMenuButton.partStockFlag = true;
          //返回错误
          this.$message.error(this.labels.pleaseSelectOrder);
          return false;
        }
        let tempData = {'site': this.pageData.site, 'orderNo': this.currentRoutingRow.orderNo};
        //打开组件  需要的数据 展示需要的数据
        this.$nextTick(() => {
          this.showPartStockFlag = true;
          this.$refs.comPartStock.init(tempData);
        })
      }
    },

    /*获取当前的机台对应的加工中心*/
    getCurrentWorkCenterNoByResourceId() {
      getCurrentWorkCenterNoByResourceId(this.pageData).then(({data}) => {
        //区分是否成功
        if (data.code == 500) {
          //this.$message.error(data.msg);
        } else {
          this.pageData.workCenterNo = data.workCenterNo;
        }
        this.pageData.workCenterNo = data.workCenterNo;
      });
    },

    /*设置当前行的下标*/
    routingRowClassName({row, rowIndex}) {
      row.index = rowIndex;
      //判断当前行颜色参数
      if (row.qtyScheduled > 0) {
        return 'customer-row-gray';
      }
    },

    /*设置工艺的行*/
    setCurrentRoutingRow(row, column, event) {
      this.currentRoutingRow = row;
    },


    /*开始排产的操作*/
    startScheduleOperation(row, $event, column) {
      //刷新当前派工单的数据 打开当前工单+工序的排产的
      this.startScheduleOrderModal(row);
    },

    /*刷新当前的页面的显示数据*/
    startScheduleOrderModal(orderRow) {
      //刷新排产的数量
      this.$nextTick(() => {
        this.showScheduleOrderFlag = true;
        this.$refs.comScheduleOrderExpand.init(orderRow);
      });
    },


    /*判断主菜单的样式*/
    controlPrimaryMenuBun() {
      //没有选择行 所有的按钮都是灰色
      if (this.currentRoutingRow == null || this.currentRoutingRow == {}) {
        this.primaryMenuButton.shopOrderFlag = true;
        this.primaryMenuButton.partStockFlag = true;
      } else {
        // 判断是否具有该页面权限
        let menList = JSON.parse(sessionStorage.getItem('dynamicMenuRoutes') || '[]')
          .filter(item => item.path == 'shopOrder-shopOrder/shopOrder')
        if (menList.length > 0) {
          this.primaryMenuButton.shopOrderFlag = false;
        }
        this.primaryMenuButton.partStockFlag = false;
      }
    },

    // 打开页面设置
    userSetting() {
      this.visible = true;
      let queryTable = {
        userId: this.$store.state.user.name,
        functionId: this.$route.meta.menuId,
        tableId: "5301Order",
        languageCode: this.$i18n.locale
      }
      this.$nextTick(() => {
        this.$refs.column.init(queryTable);
      });
    },
    // 获取 用户保存的 格式列
    getTableUserColumn() {
      getTableUserListLanguage(this.queryTableUser).then(({data}) => {
        if (data.rows.length > 0) {
          //this.columnList = []
          this.columnList = data.rows
        } else {
          this.getColumnList()
        }

      })
    },
    // 保存 默认配置 列
    async saveColumnList() {
      // 删除所有的该页面下保存的数据
      if (this.userColumnList) {
        //删除 user自定义的数据
        await removerUser(this.queryTable)
      }
      // 删除默认配置
      await removerDefault(this.queryTable)
      // 保存页面 table属性
      let sumColumnList = this.columnList;//concat(this.columnList1);
      sumColumnList = sumColumnList.map(item => {
        return item = {
          tableId: item.tableId,
          tableName: item.tableName,
          columnProp: item.columnProp,
          columnLabel: item.columnLabel,
          columnHidden: false,
          columnImage: false,
          columnSortable: item.columnSortable,
          columnWidth: item.columnWidth,
          format: item.format,
          functionId: this.$route.meta.menuId,
          sortLv: item.sortLv,
          status: true,
          fixed: item.fixed,
          serialNumber: item.serialNumber,
          columnType: item.columnType,
          align: item.align
        }
      })

      await saveTableDefaultList(sumColumnList)
      // 保存页面 button label title 属性
      /* let buttons = this.buttonList.map(item => {
         return item = {
           functionId: this.$route.meta.menuId,
           languageValue: item.languageValue,
           objectId: item.objectId,
           objectType: item.objectType,
           tableId: item.tableId
         }
       })
       await saveButtonList(buttons)*/
      this.getFunctionButtonList()
      this.getColumnList()
    },
    // 获取 tableDefault 列
    getColumnList() {
      getTableDefaultListLanguage(this.queryTable).then(({data}) => {
        if (!data.rows.length == 0) {
          // this.showDefault = false
          this.columnList = data.rows
        } else {
          // this.showDefault = true
        }
      })
    },


    //获取按钮的权限数据
    getButtonAuthData() {
      let updateFlag = this.isAuth(this.menuId + ":revise");
      let fullControFlag = this.isAuth(this.menuId + ":fullContro");
      let deleteFlag = this.isAuth(this.menuId + ":remove");
      //处理页面的权限数据
      this.authEdit = !updateFlag || !fullControFlag;
      this.authAdd = !fullControFlag;
      this.authDelete = !deleteFlag;
    },

    // 保存 默认配置 列
    async saveMultiLanguage() {
      // 保存页面 button label title 属性
      let buttons = this.buttonList;
      let labels = this.labelsList;
      await saveButtonList(buttons)
      await saveButtonList(labels)
    },

    //获取多语言的信息
    getMultiLanguageList() {
      //首先查询当前按钮的多语言
      searchFunctionButtonList(this.queryButton).then(({data}) => {
        if (data && data.code == 0) {
          this.buttons = data.data
        } else {
          // saveButtonList(this.buttonList).then(({data}) => {
          // })
        }
      });
      //其次查询当前标签的多语言
      searchFunctionButtonList(this.queryLabel).then(({data}) => {
        if (data && data.code == 0) {
          this.labels = data.data
        } else {
          // saveButtonList(this.buttonList).then(({data}) => {
          // })
        }
      });
    },


  },
  created() {
    //查询工单的数据
    this.getShopOrderList();
    //初始化动态的表头
    // this.getTableUserColumn();

    //获取按钮的权限
    this.getButtonAuthData();

    // //判断是否启用多语言
    // this.getMultiLanguageList();  //刷新多语言的信息
  },

  /*利用监听器处理大小写*/
  watch: {
    pageData: {
      deep: true,
      handler: function (newV, oldV) {
        this.pageData.resourceId = this.pageData.resourceId.toUpperCase();
        this.pageData.workCenterNo = this.pageData.workCenterNo.toUpperCase();
      }
    }
  },
}
</script>

<!--当前页面的标签样式-->
<style scoped lang="scss">

/*针对el-card*/
.customer-card .el-form-item__content {
  margin-top: -15px;
}

.customer-card .el-form-item {
  height: 22px;
}

.customer-border .el-form-item__content {
  margin-top: -30px;
}

/*全局年与日类型  宽度*/
div.el-time-width {
  width: 110px !important;
}

/* 全局时间右边框*/
.customer-css input.el-input__inner {
  height: 22px !important;
  padding-right: 0px !important;
}

/* 控制el-card标签的数据*/
div.customer-el-card {
  margin-left: 110px;
  margin-top: -15px;
  height: 20px;
  width: 60px;
}

/* 颜色控制 */
div.customer-el-card-pink {
  background: #FF00FF;
}

div.customer-el-card-orange {
  background: #FFD700;
}

div.customer-el-card-blue {
  background: #0000CD;
}

/*清掉样式*/
.el-radio + .el-radio {
  margin-left: 0px;
}


/*当前按钮的通用样式*/
.customer-css .customer-bun-mid {
  width: 60px;
  text-align: center;
}

.customer-css .customer-bun-min {
  width: 50px;
  text-align: center;
}

.customer-css .customer-bun-max {
  width: 80px;
  text-align: center;
}

/*当前按钮的通用样式*/
.customer-css .el-button--medium {
  padding: 5px 5px;
}

/*灰色的表格行背景颜色*/
.customer-css /deep/ tr.customer-row-gray:hover {
  background: #7e819e;
}

/*灰色的表格行背景颜色*/
.customer-css /deep/ tr.customer-row-gray > td {
  background: #7e819e;
}

/*去掉悬浮的样式*/
/*.customer-css /deep/ tr:hover > td{
  background-color: transparent !important;
}

.customer-css /deep/ tr.hover-row.current-row > td{
  background-color: transparent !important;
}

.customer-css /deep/ tr.hover-row > td{
  background-color: transparent !important;
}*/

/*添加主菜单和明细菜单的样式*/
.customer-css .customer-dropdown .el-button--primary {
  padding: 2px;
  font-size: 12px;
}

/*设置间距*/
.el-dropdown-menu /deep/ li.customer-li {
  font-size: 12px;
  line-height: 16px;
  padding: 4px 8px;
}

.el-input /deep/ .el-icon-time {
  display: none;
}

/*控制上下间距*/
hr {
  margin-top: 0px;
}

/deep/ .el-table .cell {
  line-height: 20px;
  font-size: 12px;
  height: 20px;
}
</style>
