<template>
  <div class="customer-css">
    <!--  查询时间和产品  -->
    <el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 0px;">
      <el-row style="width: 780px;">
        <el-col :span="4">
          <el-form-item :label=labels.orderNo>
            <el-input v-model="pageData.orderNo" class="customer-input-color-red" readonly="readonly" style="width: 100px"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="2" style="margin-left: -15px;">
          <el-form-item :label=labels.itemNo>
            <el-input v-model="pageData.itemNo" class="customer-input-color-red" readonly="readonly" style="width: 80px"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="4" style="margin-left: 20px;">
          <el-form-item :label=labels.itemDesc>
            <el-input v-model="pageData.itemDesc" class="customer-input-color-red" readonly="readonly" style="width: 100px"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="4" style="margin-left: -15px;">
          <el-form-item :label=labels.workCenterNo>
            <el-input v-model="pageData.workCenterNo" class="customer-input-color-red" readonly="readonly" style="width: 90px"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span=4 style="margin-left: -25px;">
          <el-form-item :label=labels.workCenterName>
            <el-input v-model="pageData.workCenterDesc" class="customer-input-color-red" readonly="readonly" style="width: 120px"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row style="width: 780px;">
        <el-col :span="4">
          <el-form-item :label=labels.partNo>
            <el-input v-model="pageData.partNo" class="customer-input-color-red" readonly="readonly" style="width: 100px"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="6" style="margin-left: -15px;">
          <el-form-item :label=labels.partDesc>
            <el-input v-model="pageData.partDesc" class="customer-input-color-red" readonly="readonly" style="width: 185px"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="3" style="margin-left: 5px;">
          <el-form-item :label=labels.requiredQty>
            <el-input v-model="pageData.qtyRequired" class="customer-input-color-red" readonly="readonly" style="width: 70px"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="3" style="margin-left: -20px;">
          <el-form-item :label=labels.scheduledQty>
            <el-input v-model="pageData.qtyScheduled" class="customer-input-color-red" readonly="readonly" style="width: 70px"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="3" style="margin-left: -20px;">
          <el-form-item :label=labels.waitScheduledQty>
            <el-input v-model="pageData.qtyToSchedule" class="customer-input-color-red" readonly="readonly" style="width: 70px"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>

    <!-- 排产信息   -->
    <fieldset class="customer-field" style="margin-top: -85px; width: 140px; height: 95px; padding: 0.125em;">
      <legend>{{labels.scheduledDate}}</legend>
      <el-form style="margin-left: 10px; height: 60px;">
        <el-row style="margin-top: 10px; width: 120px; height: 20px;">
          <el-col :span="18">
            <el-form-item>
              <el-date-picker class="el-time-width"
                              style=""
                              v-model="pageData.scheduleDate"
                              value-format="yyyy-MM-dd">
              </el-date-picker>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row style="margin-top: 20px; padding-bottom: 20px; width: 120px; height: 60px;">
          <el-col :span="24" style="margin-left: 5px;">
            <el-form-item :label="''">
              <el-checkbox v-model="pageData.specifiedTime" true-label="Y" false-label="N"
                           style="margin-top: 0px; margin-right: -20px;"></el-checkbox>
              <el-time-picker
                format="HH:mm"
                arrow-control
                style="margin-top: -50px; width: 110px; height: 60px;"
                v-model="pageData.scheduleTime"
                value-format="HH:mm">
              </el-time-picker>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
    </fieldset>
    <!--  记录示意图  -->
    <fieldset style="margin-left: 730px; margin-top: -95px; width: 180px;">
      <legend>{{labels.recordDiagram}}</legend>
      <el-form :inline="true" label-position="top" label-width="100px" class="customer-card">
        <el-form-item :label=labels.closedAndQtyReached>
          <el-card class="customer-el-card customer-el-card-pink"></el-card>
        </el-form-item>
        <el-form-item :label=labels.closedAndQtyNotReached>
          <el-card class="customer-el-card customer-el-card-orange"></el-card>
        </el-form-item>
        <el-form-item :label=labels.notClosedAndQtyNotReached>
          <el-card class="customer-el-card customer-el-card-blue"></el-card>
        </el-form-item>
      </el-form>
    </fieldset>
    <!--  下面的页面  -->
    <fieldset class="customer-fieldset" style="margin-bottom: 0px; width: 100%;">
      <el-tabs v-model="activeTable" style="margin-top: 0px;"
               type="border-card" @tab-click="tabClick" class="customer-tab">
        <el-tab-pane :label=labels.scheduleOrder name="scheduling">
          <!--    左边的边框    -->
          <fieldset class="customer-left-fieldset" style="width: 46%; margin-left: 0px; margin-top: 2px;">
            <legend>{{labels.availableOperator}}</legend>
            <el-row>
              <el-col :span="6">
                <el-dropdown trigger="click" class="customer-dropdown" size="mini" @command="operatorHandleCommand">
                  <el-button type="primary" :disabled = "authEdit"  @click="controlOperatorMenuBun">
                    {{buttons.menuButton}}<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="operatorMenuButton.workCalendarOutFlag">{{buttons.workCalendar}}</el-dropdown-item>
                    <hr width="95%" />
                    <el-dropdown-item class="customer-li" command="批量维护工作日历"
                                      :disabled="operatorMenuButton.batchWorkCalendarFlag">{{buttons.batchWorkCalendar}}</el-dropdown-item>
                    <hr width="95%" />
                    <el-dropdown-item class="customer-li" command="重新排产"
                                      :disabled="operatorMenuButton.reScheduleOrderFlag">{{buttons.reScheduleOrder}}</el-dropdown-item>
                  </el-dropdown-menu>
                </el-dropdown>
              </el-col>
              <el-col :span="6">
                <el-button class="customer-bun-mid" type="primary" :disabled = "authAdd" @click="scheduleOperatorsBun(true)"
                           style="margin-left: 10px; margin-bottom: 5px;">
                  {{buttons.scheduleOrder}}
                </el-button>
              </el-col>
              <el-col :span="6">
                <el-button class="customer-bun-mid" type="primary" @click="getOperatorList"
                           style="margin-left: 10px; margin-bottom: 5px;">
                  {{buttons.refreshData}}
                </el-button>
              </el-col>
              <el-col :span="6">
                <el-button class="customer-bun-max" :disabled = "authAdd" type="primary" @click="scheduleVirtualOperatorsBun(true)"
                           style="margin-left: 10px; margin-bottom: 5px;">
                  {{buttons.virtualResourceSchedule}}
                </el-button>
              </el-col>
            </el-row>
            <el-container>
              <el-main class="customer-left-main">
                <el-table class="customer-left-table"
                          :height="tableHeight" :width="tableLeftWidth"
                          :data="operatorList"
                          border
                          :cell-style="customerCellStyle" :cell-class-name="customerCellClassName"
                          @row-click="setCurrentOperatorRow"
                          @current-change="changeCurrentOperatorRow"
                          highlight-current-row
                          ref="operatorTable"
                          v-loading="dataListLoading"
                          style="margin-left: -15px; margin-top: -5px;">
                  <el-table-column
                    v-for="(item,index) in columnOperatorArray" :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">
                      <!--<el-input type="number" class="table-input" align="right" @blur="checkValidQty(scope.row)"-->
                      <el-input type="number" class="table-input" align="right" v-if="item.columnHidden"
                                v-model="scope.row[item.columnProp]"></el-input>
                      <span v-else>{{scope.row[item.columnProp]}}</span>
                      <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
                                                         style="width: 100px; height: 80px"/></span>
                    </template>
                  </el-table-column>
                </el-table>
              </el-main>
            </el-container>
          </fieldset>
          <!--    右边的边框    -->
          <fieldset class="customer-right-field">
            <legend>{{buttons.scheduledHist}}</legend>
            <el-row>
              <el-col :span="4">
                <el-button class="customer-bun-mid" :disabled = "authEdit" type="primary" @click="moveUpScheduleBun"
                           style="margin-left: 10px; margin-bottom: 5px;">
                  {{buttons.moveUp}}
                </el-button>
              </el-col>
              <el-col :span="4">
                <el-button class="customer-bun-mid" :disabled = "authEdit" type="primary" @click="moveDownScheduleBun"
                           style="margin-left: 10px; margin-bottom: 5px;">
                  {{buttons.moveDown}}
                </el-button>
              </el-col>
              <el-col :span="4">
                <el-button class="customer-bun-mid" :disabled = "authEdit" type="primary" @click="warnReScheduleConfirm"
                           style="margin-left: 10px; margin-bottom: 5px;">
                  {{buttons.reScheduleOrder}}
                </el-button>
              </el-col>
              <el-col :span="8">
                <el-button class="customer-bun-mid" :disabled="shopOrderFlag" type="primary" @click="openSchedledOrderPage"
                           style="margin-left: 10px; margin-bottom: 5px;">
                  {{buttons.shopOrder}}
                </el-button>
                <el-button @click="userSetting('5304Schedule')" type="primary">{{ buttons.settingTable }}</el-button>
                <el-button v-if="showDefault" @click="saveColumnList('5304Schedule')" type="primary">{{ buttons.defaultTable }}</el-button>
                <el-button v-if="showDefault" @click="saveMultiLanguage()" type="primary">多语言设置</el-button>
              </el-col>
            </el-row>
            <el-container>
              <el-main class="customer-right-main">
                <el-table class="customer-left-table schedule-table"
                          :height="tableHeight" :width="tableRightWidth"
                          :data="orderScheduleList"
                          border
                          ref="scheduleTable"
                          highlight-current-row
                          :row-style="controlRowStyle"
                          :row-class-name="scheduleRowClassName"
                          @row-click="setCurrentScheduleRow"
                          @current-change="changeScheduleRow"
                          @row-dblclick="warnCancelScheduleConfirm"
                          v-loading="dataListLoading"
                          style="margin-left: -15px; margin-top: -5px;">
                  <el-table-column
                    v-for="(item,index) in columnOrderScheduleArray" :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>
                      <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
                                                         style="width: 100px; height: 80px"/></span>
                    </template>
                  </el-table-column>
                </el-table>
              </el-main>
            </el-container>
          </fieldset>
        </el-tab-pane>
        <el-tab-pane :label=labels.waitScheduleList name="shop_order">
          <fieldset style="margin-left: 0px; margin-top: 2px;">
            <el-form :inline="true" label-position="top" style="margin-top: 5px;">
              <el-form-item :label=labels.enterDate style="margin-top: 0px;">
                <el-date-picker class="el-time-width"
                                style=""
                                v-model="searchData.enterTime1"
                                value-format="yyyy-MM-dd">
                </el-date-picker>
              </el-form-item>
              <el-form-item :label="' '" style="margin-left: -8px;">
                <el-date-picker class="el-time-width"
                                style=""
                                v-model="searchData.enterTime2"
                                value-format="yyyy-MM-dd">
                </el-date-picker>
              </el-form-item>
              <el-form-item :label=labels.needDate style="margin-left: -8px;">
                <el-date-picker class="el-time-width"
                                style=""
                                v-model="searchData.needTime1"
                                value-format="yyyy-MM-dd">
                </el-date-picker>
              </el-form-item>
              <el-form-item :label="' '" style="margin-left: -8px;">
                <el-date-picker class="el-time-width"
                                style=""
                                v-model="searchData.needTime2"
                                value-format="yyyy-MM-dd">
                </el-date-picker>
              </el-form-item>
              <el-form-item :label=labels.partNo style="margin-left: -8px;">
                <el-input v-model="searchData.partNo" style="width: 80px"></el-input>
              </el-form-item>
              <el-form-item :label=labels.shopOrder style="margin-left: -8px;">
                <el-input v-model="searchData.orderNo" style="width: 80px"></el-input>
              </el-form-item>
              <el-form-item :label="''" style="margin-left: 5px;">
                <el-row>
                  <el-col :span="24">
                    <el-checkbox v-model="searchData.fulledItemFlag" class="customer-checkbox" true-label="Y" false-label="N" style=""
                                 :label=labels.viewFullItem></el-checkbox>
                  </el-col>
                  <el-col :span="24" style="margin-top: 0px; ">
                    <el-checkbox v-model="searchData.preScheduledFlag" class="customer-checkbox" true-label="Y" false-label="N" style="margin-top: 5px;"
                                 :label=labels.onlyViewPreItemScheduled></el-checkbox>
                  </el-col>
                </el-row>
              </el-form-item>
              <el-form-item :label="''" style="margin-left: -110px; margin-top: 5px;">
                <el-button class="customer-bun-max" @click="getShopOrderList" type="primary">{{ buttons.refreshScheduleList }}
                </el-button>
              </el-form-item>
              <el-form-item :label="''" style="margin-left: 0px; margin-top: 5px;">
                <el-button class="customer-bun-mid" @click="openOrderPage" :disabled="shopOrderFlag" type="primary">{{buttons.shopOrder}}
                </el-button>
                <el-button @click="userSetting('5304Order')" type="primary">{{ buttons.settingTable }}</el-button>
                <el-button v-if="showDefault" @click="saveColumnList('5304Order')" type="primary">{{ buttons.defaultTable }}</el-button>
                <el-button v-if="showDefault" @click="saveMultiLanguage()" type="primary">多语言设置</el-button>
              </el-form-item>

              <el-container>
                <el-main class="customer-left-main">
                  <el-table class="customer-left-table"
                            :height="tableHeight" :width="tableLeftWidth"
                            :data="shopOrderList"
                            border
                            highlight-current-row
                            v-loading="dataListLoading"
                            @row-dblclick="startScheduleBun"
                            @row-click="setCurrentRoutingRow"
                            style="margin-left: -15px; margin-top: -5px;">
                    <el-table-column
                      v-for="(item,index) in columnOrderArray" :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>
                        <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
                                                           style="width: 100px; height: 80px"/></span>
                      </template>
                    </el-table-column>
                  </el-table>
                </el-main>
              </el-container>

            </el-form>
          </fieldset>

        </el-tab-pane>
      </el-tabs>
    </fieldset>

    <!-- 工作日历外的组件 -->
    <comWorkCalendarOut ref="comWorkCalendarOut" :close-on-click-modal="false"
                        :visible.sync="showWorkCalendarOut">

    </comWorkCalendarOut>

    <!-- 批量工作日历的组件 -->
    <comBatchWorkCalendar ref="comBatchWorkCalendar" :close-on-click-modal="false"
                          :visible.sync="showBatchWorkCalendar">

    </comBatchWorkCalendar>

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

<script>
/*组件*/
import comWorkCalendarOut from "../common/com_work_calendar_out";/*工作日历外组件*/
import comBatchWorkCalendar from "../common/com_batch_work_calendar";/*批量维护工作日历外组件*/
import column from '@/views/modules/common/column';/*动态表头*/

import {
  getShopOrderListWithFqc,
  getOperatorListWithFqc,
  getOrderScheduleListWithFqc,
  scheduleFqcOperators,
  cancelSoSchedule,
  reScheduleWorkOrders,
  moveUpSchedule,
  moveDownSchedule,
  getCalendarMapByResourceId,/*获取人员的班次*/
  getShopOrderByCon,/*刷新工单数据使用*/
} from '@/api/schedule/order_schedule_fqc.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 = '104002003';

export default {
  data() {
    return {
      showDefault: false,
      visible: false,
      authEdit: false,
      authAdd: false,
      authDelete: false,
      menuId: this.$route.meta.menuId,
      tableHeight: 0,
      tableLeftWidth: 0,
      tableRightWidth: 0,
      operatorIndex: 0,
      scheduleIndex: -1,
      activeTable: 'shop_order',
      modelFlag: false,
      modelInputFlag: true,
      showWorkCalendarOut: false,
      showBatchWorkCalendar: false,
      shopOrderFlag: true,
      currentRoutingRow: null,
      currentOperatorRow: {},
      currentScheduleRow: {},
      pageData: {
        site: this.$store.state.user.site,
        username: this.$store.state.user.name,
        orderNo: '',
        itemNo: '',
        itemDesc: '',
        workCenterNo: 'FQC',
        workCenterDesc: '',
        resourceId: '',
        qtyRequired: '',
        qtyScheduled: '',
        qtyToSchedule: '',
        scheduleDate: this.dayjs(new Date()).format('YYYY-MM-DD'),
        scheduleTime: '08:30',
        specifiedTime: 'Y',
        scheduleSeqNo: -1,
        planStartTime: '',
        virtualFlag: 'N',
        calendarId: '',
        calendarDesc: '',
      },
      searchData: {
        site: this.$store.state.user.site,
        username: this.$store.state.user.name,
        orderNo: '',
        itemNo: '',
        workCenterNo: '',
        resourceId: '',
        enterTime1: '',
        enterTime2: '',
        needTime1: '',
        needTime2: '',
        waitTimes: 0,
        fulledItemFlag: 'N',
        preScheduledFlag: 'Y'
      },
      operatorList: [],
      shopOrderList: [],
      orderScheduleList: [],
      dataListLoading: false,
      columnOrderArray: [
        {
          userId: this.$store.state.user.name,
          functionId: 5304,
          serialNumber: '5304OrderOrderNo',
          tableId: "5304Order",
          tableName: "工单表",
          columnProp: "orderNo",
          headerAlign: "center",
          align: "center",
          columnLabel: "订单号",
          columnWidth: 90,
          columnHidden: false,
          columnImage: false,
          columnSortable: true,
          sortLv: 0,
          status: true,
          fixed: ''
        },
        {
          userId: this.$store.state.user.name,
          functionId: 5304,
          serialNumber: '5304OrderItemNo',
          tableId: "5304Order",
          tableName: "工单表",
          columnProp: "itemNo",
          headerAlign: "center",
          align: "center",
          columnLabel: "工序号",
          columnWidth: 90,
          columnHidden: false,
          columnImage: false,
          columnSortable: true,
          sortLv: 0,
          status: true,
          fixed: ''
        },
        {
          userId: this.$store.state.user.name,
          functionId: 5304,
          serialNumber: '5304OrderItemDesc',
          tableId: "5304Order",
          tableName: "工单表",
          columnProp: "itemDesc",
          headerAlign: "center",
          align: "center",
          columnLabel: "工序名称",
          columnWidth: 80,
          columnHidden: false,
          columnImage: false,
          columnSortable: false,
          sortLv: 0,
          status: true,
          fixed: ''
        },
        {
          userId: this.$store.state.user.name,
          functionId: 5304,
          serialNumber: '5304OrderNeedDate',
          tableId: "5304Order",
          tableName: "工单表",
          columnProp: "needDate",
          headerAlign: "center",
          align: "center",
          columnLabel: "要求完工日期",
          columnWidth: 120,
          columnHidden: false,
          columnImage: false,
          columnSortable: true,
          sortLv: 0,
          status: true,
          fixed: ''
        },
        {
          userId: this.$store.state.user.name,
          functionId: 5304,
          serialNumber: '5304OrderPartNo',
          tableId: "5304Order",
          tableName: "工单表",
          columnProp: "partNo",
          headerAlign: "center",
          align: "center",
          columnLabel: "产成品编码",
          columnWidth: 120,
          columnHidden: false,
          columnImage: false,
          columnSortable: true,
          sortLv: 0,
          status: true,
          fixed: ''
        },
        {
          userId: this.$store.state.user.name,
          functionId: 5304,
          serialNumber: '5304OrderPartDesc',
          tableId: "5304Order",
          tableName: "工单表",
          columnProp: "partDesc",
          headerAlign: "center",
          align: "center",
          columnLabel: "产成品名称/规格",
          columnWidth: 185,
          columnHidden: false,
          columnImage: false,
          columnSortable: false,
          sortLv: 0,
          status: true,
          fixed: ''
        },
        {
          userId: this.$store.state.user.name,
          functionId: 5304,
          serialNumber: '5304OrderSpec',
          tableId: "5304Order",
          tableName: "工单表",
          columnProp: "spec",
          headerAlign: "center",
          align: "center",
          columnLabel: "规格",
          columnWidth: 60,
          columnHidden: false,
          columnImage: false,
          columnSortable: false,
          sortLv: 0,
          status: true,
          fixed: ''
        },
        {
          userId: this.$store.state.user.name,
          functionId: 5304,
          serialNumber: '5304OrderSite',
          tableId: "5304Order",
          tableName: "工单表",
          columnProp: "site",
          headerAlign: "center",
          align: "center",
          columnLabel: "规格",
          columnWidth: 60,
          columnHidden: false,
          columnImage: false,
          columnSortable: false,
          sortLv: 0,
          status: true,
          fixed: ''
        },
        {
          userId: this.$store.state.user.name,
          functionId: 5304,
          serialNumber: '5304OrderWorkCenterNo',
          tableId: "5304Order",
          tableName: "工单表",
          columnProp: "workCenterNo",
          headerAlign: "center",
          align: "center",
          columnLabel: "加工中心",
          columnWidth: 100,
          columnHidden: false,
          columnImage: false,
          columnSortable: true,
          sortLv: 0,
          status: true,
          fixed: ''
        },
        {
          userId: this.$store.state.user.name,
          functionId: 5304,
          serialNumber: '5304OrderNextItemNo',
          tableId: "5304Order",
          tableName: "工单表",
          columnProp: "nextItemNo",
          headerAlign: "center",
          align: "center",
          columnLabel: "下道工序",
          columnWidth: 100,
          columnHidden: false,
          columnImage: false,
          columnSortable: true,
          sortLv: 0,
          status: true,
          fixed: ''
        },
        {
          userId: this.$store.state.user.name,
          functionId: 5304,
          serialNumber: '5304OrderNextItemDesc',
          tableId: "5304Order",
          tableName: "工单表",
          columnProp: "nextItemDesc",
          headerAlign: "center",
          align: "center",
          columnLabel: "下道工序名称",
          columnWidth: 80,
          columnHidden: false,
          columnImage: false,
          columnSortable: false,
          sortLv: 0,
          status: true,
          fixed: ''
        },
        {
          userId: this.$store.state.user.name,
          functionId: 5304,
          serialNumber: '5304OrderNextScheduledFlag',
          tableId: "5304Order",
          tableName: "工单表",
          columnProp: "nextScheduledFlag",
          headerAlign: "center",
          align: "center",
          columnLabel: "下道工序已排产",
          columnWidth: 150,
          columnHidden: false,
          columnImage: false,
          columnSortable: true,
          sortLv: 0,
          status: true,
          fixed: ''
        },
        {
          userId: this.$store.state.user.name,
          functionId: 5304,
          serialNumber: '5304OrderPreItemNo',
          tableId: "5304Order",
          tableName: "工单表",
          columnProp: "preItemNo",
          headerAlign: "center",
          align: "center",
          columnLabel: "上道工序",
          columnWidth: 100,
          columnHidden: false,
          columnImage: false,
          columnSortable: true,
          sortLv: 0,
          status: true,
          fixed: ''
        },
        {
          userId: this.$store.state.user.name,
          functionId: 5304,
          serialNumber: '5304OrderPreItemDesc',
          tableId: "5304Order",
          tableName: "工单表",
          columnProp: "preItemDesc",
          headerAlign: "center",
          align: "center",
          columnLabel: "上道工序名称",
          columnWidth: 80,
          columnHidden: false,
          columnImage: false,
          columnSortable: false,
          sortLv: 0,
          status: true,
          fixed: ''
        },
        {
          userId: this.$store.state.user.name,
          functionId: 5304,
          serialNumber: '5304OrderPreScheduledFlag',
          tableId: "5304Order",
          tableName: "工单表",
          columnProp: "preScheduledFlag",
          headerAlign: "center",
          align: "center",
          columnLabel: "上道工序已排产",
          columnWidth: 150,
          columnHidden: false,
          columnImage: false,
          columnSortable: true,
          sortLv: 0,
          status: true,
          fixed: ''
        },
        {
          userId: this.$store.state.user.name,
          functionId: 5304,
          serialNumber: '5304OrderQtyReported',
          tableId: "5304Order",
          tableName: "工单表",
          columnProp: "qtyReported",
          headerAlign: "center",
          align: "center",
          columnLabel: "已报工数量",
          columnWidth: 80,
          columnHidden: false,
          columnImage: false,
          columnSortable: false,
          sortLv: 0,
          status: true,
          fixed: ''
        },
        {
          userId: this.$store.state.user.name,
          functionId: 5304,
          serialNumber: '5304OrderScheduledFlag',
          tableId: "5304Order",
          tableName: "工单表",
          columnProp: "scheduledFlag",
          headerAlign: "center",
          align: "center",
          columnLabel: "是否排产",
          columnWidth: 80,
          columnHidden: false,
          columnImage: false,
          columnSortable: false,
          sortLv: 0,
          status: true,
          fixed: ''
        },
        {
          userId: this.$store.state.user.name,
          functionId: 5304,
          serialNumber: '5304OrderLotSize',
          tableId: "5304Order",
          tableName: "工单表",
          columnProp: "lotSize",
          headerAlign: "center",
          align: "center",
          columnLabel: "订单量",
          columnWidth: 80,
          columnHidden: false,
          columnImage: false,
          columnSortable: false,
          sortLv: 0,
          status: true,
          fixed: ''
        },
        {
          userId: this.$store.state.user.name,
          functionId: 5304,
          serialNumber: '5304OrderAvailResource',
          tableId: "5304Order",
          tableName: "工单表",
          columnProp: "availResource",
          headerAlign: "center",
          align: "center",
          columnLabel: "可用机台",
          columnWidth: 80,
          columnHidden: false,
          columnImage: false,
          columnSortable: false,
          sortLv: 0,
          status: true,
          fixed: ''
        },
        {
          userId: this.$store.state.user.name,
          functionId: 5304,
          serialNumber: '5304OrderEnterDate',
          tableId: "5304Order",
          tableName: "工单表",
          columnProp: "enterDate",
          headerAlign: "center",
          align: "center",
          columnLabel: "录入日期",
          columnWidth: 80,
          columnHidden: false,
          columnImage: false,
          columnSortable: false,
          sortLv: 0,
          status: true,
          fixed: ''
        },
        {
          userId: this.$store.state.user.name,
          functionId: 5304,
          serialNumber: '5304OrderScheduleToPlanTime',
          tableId: "5304Order",
          tableName: "工单表",
          columnProp: "scheduleToPlanTime",
          headerAlign: "center",
          align: "center",
          columnLabel: "计划时间",
          columnWidth: 80,
          columnHidden: false,
          columnImage: false,
          columnSortable: false,
          sortLv: 0,
          status: true,
          fixed: ''
        },
        {
          userId: this.$store.state.user.name,
          functionId: 5304,
          serialNumber: '5304OrderCustomerName',
          tableId: "5304Order",
          tableName: "工单表",
          columnProp: "customerName",
          headerAlign: "center",
          align: "center",
          columnLabel: "客户名称",
          columnWidth: 80,
          columnHidden: false,
          columnImage: false,
          columnSortable: false,
          sortLv: 0,
          status: true,
          fixed: ''
        },
        {
          userId: this.$store.state.user.name,
          functionId: 5304,
          serialNumber: '5304OrderMachRunFactor',
          tableId: "5304Order",
          tableName: "工单表",
          columnProp: "machRunFactor",
          headerAlign: "center",
          align: "center",
          columnLabel: "单位产出",
          columnWidth: 80,
          columnHidden: false,
          columnImage: false,
          columnSortable: false,
          sortLv: 0,
          status: true,
          fixed: ''
        },
        {
          userId: this.$store.state.user.name,
          functionId: 5304,
          serialNumber: '5304OrderMachSetupTime',
          tableId: "5304Order",
          tableName: "工单表",
          columnProp: "machSetupTime",
          headerAlign: "center",
          align: "center",
          columnLabel: "调机时间",
          columnWidth: 80,
          columnHidden: false,
          columnImage: false,
          columnSortable: false,
          sortLv: 0,
          status: true,
          fixed: ''
        },
        {
          userId: this.$store.state.user.name,
          functionId: 5304,
          serialNumber: '5304OrderFactorUnit',
          tableId: "5304Order",
          tableName: "工单表",
          columnProp: "factorUnit",
          headerAlign: "center",
          align: "center",
          columnLabel: "产出单位",
          columnWidth: 80,
          columnHidden: false,
          columnImage: false,
          columnSortable: false,
          sortLv: 0,
          status: true,
          fixed: ''
        },
        {
          userId: this.$store.state.user.name,
          functionId: 5304,
          serialNumber: '5304OrderQtyScheduled',
          tableId: "5304Order",
          tableName: "工单表",
          columnProp: "qtyScheduled",
          headerAlign: "center",
          align: "center",
          columnLabel: "已排产数量",
          columnWidth: 80,
          columnHidden: false,
          columnImage: false,
          columnSortable: false,
          sortLv: 0,
          status: true,
          fixed: ''
        },
        {
          userId: this.$store.state.user.name,
          functionId: 5304,
          serialNumber: '5304OrderQtyToSchedule',
          tableId: "5304Order",
          tableName: "工单表",
          columnProp: "qtyToSchedule",
          headerAlign: "center",
          align: "center",
          columnLabel: "待排产数量",
          columnWidth: 80,
          columnHidden: false,
          columnImage: false,
          columnSortable: false,
          sortLv: 0,
          status: true,
          fixed: ''
        },
        {
          userId: this.$store.state.user.name,
          functionId: 5304,
          serialNumber: '5304OrderQtyScheduledPreOps',
          tableId: "5304Order",
          tableName: "工单表",
          columnProp: "qtyScheduledPreOps",
          headerAlign: "center",
          align: "center",
          columnLabel: "前道工序已排产数量",
          columnWidth: 80,
          columnHidden: false,
          columnImage: false,
          columnSortable: false,
          sortLv: 0,
          status: true,
          fixed: ''
        },
        {
          userId: this.$store.state.user.name,
          functionId: 5304,
          serialNumber: '5304OrderCustPartNo',
          tableId: "5304Order",
          tableName: "工单表",
          columnProp: "custPartNo",
          headerAlign: "center",
          align: "center",
          columnLabel: "客户产品料号",
          columnWidth: 80,
          columnHidden: false,
          columnImage: false,
          columnSortable: false,
          sortLv: 0,
          status: true,
          fixed: ''
        },
        {
          userId: this.$store.state.user.name,
          functionId: 5304,
          serialNumber: '5304OrderTimeRequired',
          tableId: "5304Order",
          tableName: "工单表",
          columnProp: "timeRequired",
          headerAlign: "center",
          align: "center",
          columnLabel: "待排产时间",
          columnWidth: 80,
          columnHidden: false,
          columnImage: false,
          columnSortable: false,
          sortLv: 0,
          status: true,
          fixed: ''
        },
        {
          userId: this.$store.state.user.name,
          functionId: 5304,
          serialNumber: '5304OrderQtyApprovedPreOps',
          tableId: "5304Order",
          tableName: "工单表",
          columnProp: "qtyApprovedPreOps",
          headerAlign: "center",
          align: "center",
          columnLabel: "前道工序已报合格数",
          columnWidth: 80,
          columnHidden: false,
          columnImage: false,
          columnSortable: false,
          sortLv: 0,
          status: true,
          fixed: ''
        },
        {
          userId: this.$store.state.user.name,
          functionId: 5304,
          serialNumber: '5304OrderPrePlanStartTime',
          tableId: "5304Order",
          tableName: "工单表",
          columnProp: "prePlanStartTime",
          headerAlign: "center",
          align: "center",
          columnLabel: "上道工序计划开工日期",
          columnWidth: 80,
          columnHidden: false,
          columnImage: false,
          columnSortable: false,
          sortLv: 0,
          status: true,
          fixed: ''
        },
        {
          userId: this.$store.state.user.name,
          functionId: 5304,
          serialNumber: '5304OrderPrePlanFinishTime',
          tableId: "5304Order",
          tableName: "工单表",
          columnProp: "prePlanFinishTime",
          headerAlign: "center",
          align: "center",
          columnLabel: "上道工序计划完工日期",
          columnWidth: 80,
          columnHidden: false,
          columnImage: false,
          columnSortable: false,
          sortLv: 0,
          status: true,
          fixed: ''
        },
        {
          userId: this.$store.state.user.name,
          functionId: 5304,
          serialNumber: '5304OrderEfficiency',
          tableId: "5304Order",
          tableName: "工单表",
          columnProp: "efficiency",
          headerAlign: "center",
          align: "center",
          columnLabel: "效率",
          columnWidth: 80,
          columnHidden: false,
          columnImage: false,
          columnSortable: false,
          sortLv: 0,
          status: true,
          fixed: ''
        }
      ],
      columnOperatorArray: [
        {
          userId: this.$store.state.user.name,
          functionId: 5304,
          serialNumber: '5304OperatorOperatorId',
          tableId: "5304Operator",
          tableName: "操作员表",
          columnProp: "operatorId",
          headerAlign: "center",
          align: "center",
          columnLabel: "员工编号",
          columnWidth: 100,
          columnHidden: false,
          columnImage: false,
          columnSortable: true,
          sortLv: 0,
          status: true,
          fixed: ''
        },
        {
          userId: this.$store.state.user.name,
          functionId: 5304,
          serialNumber: '5304OperatorOperatorName',
          tableId: "5304Operator",
          tableName: "操作员表",
          columnProp: "operatorName",
          headerAlign: "center",
          align: "center",
          columnLabel: "员工姓名",
          columnWidth: 120,
          columnHidden: false,
          columnImage: false,
          columnSortable: true,
          sortLv: 0,
          status: true,
          fixed: ''
        },
        {
          userId: this.$store.state.user.name,
          functionId: 5304,
          serialNumber: '5304OperatorLastScheduledTime',
          tableId: "5304Operator",
          tableName: "操作员表",
          columnProp: "lastScheduledTime",
          headerAlign: "center",
          align: "center",
          columnLabel: "最后排产时间",
          columnWidth: 125,
          columnHidden: false,
          columnImage: false,
          columnSortable: true,
          sortLv: 0,
          status: true,
          fixed: ''
        },
        {
          userId: this.$store.state.user.name,
          functionId: 5304,
          serialNumber: '5304OperatorEfficiency',
          tableId: "5304Operator",
          tableName: "操作员表",
          columnProp: "efficiency",
          headerAlign: "center",
          align: "center",
          columnLabel: "效率",
          columnWidth: 80,
          columnHidden: false,
          columnImage: false,
          columnSortable: true,
          sortLv: 0,
          status: true,
          fixed: ''
        },
        {
          userId: this.$store.state.user.name,
          functionId: 5304,
          serialNumber: '5304OperatorQtyToSchedule',
          tableId: "5304Operator",
          tableName: "操作员表",
          columnProp: "qtyToSchedule",
          headerAlign: "center",
          align: "center",
          columnLabel: "排产数量",
          columnWidth: 100,
          columnHidden: true,
          columnImage: false,
          columnSortable: true,
          sortLv: 0,
          status: true,
          fixed: ''
        },
        {
          userId: this.$store.state.user.name,
          functionId: 5304,
          serialNumber: '5304OperatorCalendarId',
          tableId: "5304Operator",
          tableName: "操作员表",
          columnProp: "calendarId",
          headerAlign: "center",
          align: "center",
          columnLabel: "工作日历",
          columnWidth: 80,
          columnHidden: false,
          columnImage: false,
          columnSortable: false,
          sortLv: 0,
          status: true,
          fixed: ''
        },
        {
          userId: this.$store.state.user.name,
          functionId: 5304,
          serialNumber: '5304OperatorVirturlFlag',
          tableId: "5304Operator",
          tableName: "操作员表",
          columnProp: "virturlFlag",
          headerAlign: "center",
          align: "center",
          columnLabel: "虚拟机台",
          columnWidth: 80,
          columnHidden: false,
          columnImage: false,
          columnSortable: false,
          sortLv: 0,
          status: true,
          fixed: ''
        }
      ],
      columnOrderScheduleArray: [
        {
          userId: this.$store.state.user.name,
          functionId: 5304,
          serialNumber: '5304ScheduleScheduledSeqNo',
          tableId: "5304Schedule",
          tableName: "排产明细表",
          columnProp: "scheduledSeqNo",
          headerAlign: "center",
          align: "center",
          columnLabel: "排产序号",
          columnWidth: 100,
          columnHidden: false,
          columnImage: false,
          columnSortable: true,
          sortLv: 0,
          status: true,
          fixed: ''
        },
        {
          userId: this.$store.state.user.name,
          functionId: 5304,
          serialNumber: '5304ScheduleQtyRequired',
          tableId: "5304Schedule",
          tableName: "排产明细表",
          columnProp: "qtyRequired",
          headerAlign: "center",
          align: "center",
          columnLabel: "待生产数量",
          columnWidth: 120,
          columnHidden: false,
          columnImage: false,
          columnSortable: true,
          sortLv: 0,
          status: true,
          fixed: ''
        },
        {
          userId: this.$store.state.user.name,
          functionId: 5304,
          serialNumber: '5304SchedulePlanStartTime',
          tableId: "5304Schedule",
          tableName: "排产明细表",
          columnProp: "planStartTime",
          headerAlign: "center",
          align: "center",
          columnLabel: "计划开工时间",
          columnWidth: 125,
          columnHidden: false,
          columnImage: false,
          columnSortable: true,
          sortLv: 0,
          status: true,
          fixed: ''
        },
        {
          userId: this.$store.state.user.name,
          functionId: 5304,
          serialNumber: '5304SchedulePlanFinishTime',
          tableId: "5304Schedule",
          tableName: "排产明细表",
          columnProp: "planFinishTime",
          headerAlign: "center",
          align: "center",
          columnLabel: "计划完工时间",
          columnWidth: 125,
          columnHidden: false,
          columnImage: false,
          columnSortable: true,
          sortLv: 0,
          status: true,
          fixed: ''
        },
        {
          userId: this.$store.state.user.name,
          functionId: 5304,
          serialNumber: '5304ScheduleOrderNo',
          tableId: "5304Schedule",
          tableName: "排产明细表",
          columnProp: "orderNo",
          headerAlign: "center",
          align: "center",
          columnLabel: "订单号",
          columnWidth: 90,
          columnHidden: false,
          columnImage: false,
          columnSortable: true,
          sortLv: 0,
          status: true,
          fixed: ''
        },
        {
          userId: this.$store.state.user.name,
          functionId: 5304,
          serialNumber: '5304ScheduleItemNo',
          tableId: "5304Schedule",
          tableName: "排产明细表",
          columnProp: "itemNo",
          headerAlign: "center",
          align: "center",
          columnLabel: "工序号",
          columnWidth: 90,
          columnHidden: false,
          columnImage: false,
          columnSortable: true,
          sortLv: 0,
          status: true,
          fixed: ''
        },
        {
          userId: this.$store.state.user.name,
          functionId: 5304,
          serialNumber: '5304ScheduleRemark',
          tableId: "5304Schedule",
          tableName: "排产明细表",
          columnProp: "remark",
          headerAlign: "center",
          align: "center",
          columnLabel: "备注",
          columnWidth: 80,
          columnHidden: false,
          columnImage: false,
          columnSortable: false,
          sortLv: 0,
          status: true,
          fixed: ''
        },
        {
          userId: this.$store.state.user.name,
          functionId: 5304,
          serialNumber: '5304SchedulePartNo',
          tableId: "5304Schedule",
          tableName: "排产明细表",
          columnProp: "partNo",
          headerAlign: "center",
          align: "center",
          columnLabel: "产品编码",
          columnWidth: 100,
          columnHidden: false,
          columnImage: false,
          columnSortable: true,
          sortLv: 0,
          status: true,
          fixed: ''
        },
        {
          userId: this.$store.state.user.name,
          functionId: 5304,
          serialNumber: '5304ScheduleCustomerName',
          tableId: "5304Schedule",
          tableName: "排产明细表",
          columnProp: "customerName",
          headerAlign: "center",
          align: "center",
          columnLabel: "客户名称",
          columnWidth: 80,
          columnHidden: false,
          columnImage: false,
          columnSortable: false,
          sortLv: 0,
          status: true,
          fixed: ''
        },
        {
          userId: this.$store.state.user.name,
          functionId: 5304,
          serialNumber: '5304ScheduleCustPartNo',
          tableId: "5304Schedule",
          tableName: "排产明细表",
          columnProp: "custPartNo",
          headerAlign: "center",
          align: "center",
          columnLabel: "客户产品料号",
          columnWidth: 140,
          columnHidden: false,
          columnImage: false,
          columnSortable: true,
          sortLv: 0,
          status: true,
          fixed: ''
        },
        {
          userId: this.$store.state.user.name,
          functionId: 5304,
          serialNumber: '5304SchedulePartDesc',
          tableId: "5304Schedule",
          tableName: "排产明细表",
          columnProp: "partDesc",
          headerAlign: "center",
          align: "center",
          columnLabel: "产品名称",
          columnWidth: 80,
          columnHidden: false,
          columnImage: false,
          columnSortable: false,
          sortLv: 0,
          status: true,
          fixed: ''
        },
        {
          userId: this.$store.state.user.name,
          functionId: 5304,
          serialNumber: '5304OrderSpec',
          tableId: "5304Schedule",
          tableName: "排产明细表",
          columnProp: "spec",
          headerAlign: "center",
          align: "center",
          columnLabel: "规格型号",
          columnWidth: 80,
          columnHidden: false,
          columnImage: false,
          columnSortable: false,
          sortLv: 0,
          status: true,
          fixed: ''
        }
      ],
      operatorMenuButton: {
        workCalendarOutFlag: true,
        batchWorkCalendarFlag: true,
        reScheduleOrderFlag: true,
        partStockFlag: true,
      },
      queryTable:{
        userId: this.$store.state.user.name,
        functionId: this.$route.meta.menuId,
        tableId: "5304Order",
        languageCode: this.$i18n.locale
      },
      // 用户table 查询参数
      queryTableUser: {
        userId: this.$store.state.user.name,
        functionId: this.$route.meta.menuId,
        tableId: "5304Order",
        status: true,
        languageCode: this.$i18n.locale
      },
      // 用户table 配置集合
      userColumnList: [],
      buttons: {
        menuButton: '菜单',
        workCalendar: '工作日历',
        batchWorkCalendar: '批量维护工作日历',
        reScheduleOrder: '重新排产',
        scheduleOrder: '排产',
        refreshData: '刷新数据',
        virtualResourceSchedule: '虚拟机台排产',
        scheduledHist: '已排产记录',
        moveUp: '上移',
        moveDown: '下移',
        shopOrder: '生产订单',
        settingTable: '设置列表',
        defaultTable: '设置默认配置',
        refreshScheduleList: '刷新排产清单',
      },
      buttonList: [
        {
          functionId: functionId,
          languageValue: '菜单',
          objectId: 'menuButton',
          objectType: 'button',
          tableId: '*'
        }, {
          functionId: functionId,
          languageValue: '工作日历',
          objectId: 'workCalendar',
          objectType: 'button',
          tableId: '*'
        }, {
          functionId: functionId,
          languageValue: '关闭',
          objectId: 'closeButton',
          objectType: 'button',
          tableId: '*'
        }, {
          functionId: functionId,
          languageValue: '批量维护工作日历',
          objectId: 'batchWorkCalendar',
          objectType: 'button',
          tableId: '*'
        }, {
          functionId: functionId,
          languageValue: '重新排产',
          objectId: 'reScheduleOrder',
          objectType: 'button',
          tableId: '*'
        }, {
          functionId: functionId,
          languageValue: '排产',
          objectId: 'scheduleOrder',
          objectType: 'button',
          tableId: '*'
        }, {
          functionId: functionId,
          languageValue: '刷新数据',
          objectId: 'refreshData',
          objectType: 'button',
          tableId: '*'
        }, {
          functionId: functionId,
          languageValue: '虚拟机台排产',
          objectId: 'virtualResourceSchedule',
          objectType: 'button',
          tableId: '*'
        }, {
          functionId: functionId,
          languageValue: '已排产记录',
          objectId: 'scheduledHist',
          objectType: 'button',
          tableId: '*'
        }, {
          functionId: functionId,
          languageValue: '上移',
          objectId: 'moveUp',
          objectType: 'button',
          tableId: '*'
        }, {
          functionId: functionId,
          languageValue: '下移',
          objectId: 'moveDown',
          objectType: 'button',
          tableId: '*'
        }, {
          functionId: functionId,
          languageValue: '生产订单',
          objectId: 'shopOrder',
          objectType: 'button',
          tableId: '*'
        }, {
          functionId: functionId,
          languageValue: '设置列表',
          objectId: 'settingTable',
          objectType: 'button',
          tableId: '*'
        }, {
          functionId: functionId,
          languageValue: '设置默认配置',
          objectId: 'defaultTable',
          objectType: 'button',
          tableId: '*'
        }, {
          functionId: functionId,
          languageValue: '刷新排产清单',
          objectId: 'refreshScheduleList',
          objectType: 'button',
          tableId: '*'
        },
      ],
      queryButton: {
        functionId: functionId,
        table_id: '*',
        languageCode: this.$i18n.locale,
        objectType: 'button'
      },
      labels: {
        orderNo: '生产订单号:',
        itemNo: '工序号:',
        itemDesc: '工序名称:',
        workCenterNo: '加工中心编码:',
        workCenterName: '加工中心名称:',
        partNo: '产品编码:',
        partDesc: '产品名称:',
        requiredQty: '需求数量:',
        scheduledQty: '已排产数量:',
        waitScheduledQty: '待排产数量:',
        scheduledDate: '排产日期:',
        recordDiagram: '记录示意图',
        closedAndQtyReached: '已关闭,已达数量',
        closedAndQtyNotReached: '已关闭,未达数量',
        notClosedAndQtyNotReached: '未关闭,未达数量',
        scheduleOrder: '排产',
        availableOperator: '可用操作员',
        waitScheduleList: '待排产清单',
        enterDate: '录入日期',
        needDate: '要求完工日期',
        shopOrder: '生产订单',
        viewFullItem: '查看已排满的工序',
        onlyViewPreItemScheduled: '仅查看前道工序已排产的工序',
        fullInspection: '全检',
        noScheduleOperator: '暂无可排产的操作员!',
        confirmLabel: '确认',
        cancelLabel: '取消',
        sureCancelSchedule: '确实要取消该派工单吗?',
        sureNoFinishOrderToSchedule: '确实要对排产清单中的未完成派工单进行排产吗?',
        pleaseSelectRow: '请先选择处理的行!',
        thisIsFirstRowCantMoveUp: '已经是首行,无法继续上行!',
        thisIsEndRowCantMoveDown: '已经是末行,无法继续下行!',
        pleaseSelectOperator: '请选择人员! ',
        pleaseSelectSchedule: '请选择派工单! ',
      },
      labelsList: [
        {
          functionId: functionId,
          languageValue: '生产订单号:',
          objectId: 'orderNo',
          objectType: 'label',
          tableId: '*'
        }, {
          functionId: functionId,
          languageValue: '工序号:',
          objectId: 'itemNo',
          objectType: 'label',
          tableId: '*'
        }, {
          functionId: functionId,
          languageValue: '工序名称:',
          objectId: 'itemDesc',
          objectType: 'label',
          tableId: '*'
        },  {
          functionId: functionId,
          languageValue: '加工中心编码:',
          objectId: 'workCenterNo',
          objectType: 'label',
          tableId: '*'
        }, {
          functionId: functionId,
          languageValue: '加工中心名称:',
          objectId: 'workCenterName',
          objectType: 'label',
          tableId: '*'
        }, {
          functionId: functionId,
          languageValue: '产品编码:',
          objectId: 'partNo',
          objectType: 'label',
          tableId: '*'
        }, {
          functionId: functionId,
          languageValue: '产品名称:',
          objectId: 'partDesc',
          objectType: 'label',
          tableId: '*'
        }, {
          functionId: functionId,
          languageValue: '需求数量:',
          objectId: 'requiredQty',
          objectType: 'label',
          tableId: '*'
        }, {
          functionId: functionId,
          languageValue: '已排产数量:',
          objectId: 'scheduledQty',
          objectType: 'label',
          tableId: '*'
        }, {
          functionId: functionId,
          languageValue: '待排产数量:',
          objectId: 'waitScheduledQty',
          objectType: 'label',
          tableId: '*'
        }, {
          functionId: functionId,
          languageValue: '排产日期:',
          objectId: 'scheduledDate',
          objectType: 'label',
          tableId: '*'
        },  {
          functionId: functionId,
          languageValue: '记录示意图',
          objectId: 'recordDiagram',
          objectType: 'label',
          tableId: '*'
        }, {
          functionId: functionId,
          languageValue: '已关闭,已达数量',
          objectId: 'closedAndQtyReached',
          objectType: 'label',
          tableId: '*'
        }, {
          functionId: functionId,
          languageValue: '已关闭,未达数量',
          objectId: 'closedAndQtyNotReached',
          objectType: 'label',
          tableId: '*'
        },  {
          functionId: functionId,
          languageValue: '未关闭,未达数量',
          objectId: 'notClosedAndQtyNotReached',
          objectType: 'label',
          tableId: '*'
        }, {
          functionId: functionId,
          languageValue: '排产',
          objectId: 'scheduleOrder',
          objectType: 'label',
          tableId: '*'
        }, {
          functionId: functionId,
          languageValue: '可用操作员',
          objectId: 'availableOperator',
          objectType: 'label',
          tableId: '*'
        }, {
          functionId: functionId,
          languageValue: '待排产清单',
          objectId: 'waitScheduleList',
          objectType: 'label',
          tableId: '*'
        }, {
          functionId: functionId,
          languageValue: '录入日期',
          objectId: 'enterDate',
          objectType: 'label',
          tableId: '*'
        }, {
          functionId: functionId,
          languageValue: '要求完工日期',
          objectId: 'needDate',
          objectType: 'label',
          tableId: '*'
        }, {
          functionId: functionId,
          languageValue: '生产订单',
          objectId: 'shopOrder',
          objectType: 'label',
          tableId: '*'
        }, {
          functionId: functionId,
          languageValue: '查看已排满的工序',
          objectId: 'viewFullItem',
          objectType: 'label',
          tableId: '*'
        }, {
          functionId: functionId,
          languageValue: '仅查看前道工序已排产的工序',
          objectId: 'onlyViewPreItemScheduled',
          objectType: 'label',
          tableId: '*'
        }, {
          functionId: functionId,
          languageValue: '全检',
          objectId: 'fullInspection',
          objectType: 'label',
          tableId: '*'
        }, {
          functionId: functionId,
          languageValue: '暂无可排产的操作员!',
          objectId: 'noScheduleOperator',
          objectType: 'label',
          tableId: '*'
        }, {
          functionId: functionId,
          languageValue: '确认',
          objectId: 'confirmLabel',
          objectType: 'label',
          tableId: '*'
        }, {
          functionId: functionId,
          languageValue: '取消',
          objectId: 'cancelLabel',
          objectType: 'label',
          tableId: '*'
        }, {
          functionId: functionId,
          languageValue: '确实要取消该派工单吗?',
          objectId: 'sureCancelSchedule',
          objectType: 'label',
          tableId: '*'
        }, {
          functionId: functionId,
          languageValue: '确实要对排产清单中的未完成派工单进行排产吗?',
          objectId: 'sureNoFinishOrderToSchedule',
          objectType: 'label',
          tableId: '*'
        }, {
          functionId: functionId,
          languageValue: '请先选择处理的行!',
          objectId: 'pleaseSelectRow',
          objectType: 'label',
          tableId: '*'
        }, {
          functionId: functionId,
          languageValue: '已经是首行,无法继续上行!',
          objectId: 'thisIsFirstRowCantMoveUp',
          objectType: 'label',
          tableId: '*'
        }, {
          functionId: functionId,
          languageValue: '已经是末行,无法继续下行!',
          objectId: 'thisIsEndRowCantMoveDown',
          objectType: 'label',
          tableId: '*'
        }, {
          functionId: functionId,
          languageValue: '请选择人员!',
          objectId: 'pleaseSelectOperator',
          objectType: 'label',
          tableId: '*'
        }, {
          functionId: functionId,
          languageValue: '请选择派工单!',
          objectId: 'pleaseSelectSchedule',
          objectType: 'label',
          tableId: '*'
        },
      ],
      queryLabel: {
        functionId: functionId,
        table_id: '*',
        languageCode: this.$i18n.locale,
        objectType: 'label'
      },
    }
  },
  /*注册组件*/
  components: {
    comWorkCalendarOut,/*工作日历外*/
    comBatchWorkCalendar,/*批量维护工作日历外组件*/
    column,/*动态列*/
  },
  mounted() {
    this.$nextTick(() => {
      this.tableHeight = (window.innerHeight - 270);
      this.tableLeftWidth = ((window.innerWidth - 100) / 2) - 60;
      this.tableRightWidth = ((window.innerWidth - 100) / 2) + 60;
    });
    //设置当前的动态高度

  },
  methods: {

    //列表表格选择替换
    tabClick(tab, event) {
      let tabName = tab.name;
      //区分两个页签
      if(tabName == 'shop_order'){
        //刷新当前的table
        //this.getShopOrderList();
      }else if(tabName == 'scheduling'){
        //刷新刷新FQC员工
        this.getOperatorList();
      }
    },

    /*获取FQC工单信息*/
    getShopOrderList() {
      getShopOrderListWithFqc(this.searchData).then(({data}) => {
        this.shopOrderList = data.rows;
      })
    },

    /*刷新当前的页面的显示数据*/
    refreshShopOrderByCon(orderRow){
      //请求的参数
      getShopOrderByCon(this.pageData).then(({data}) => {
        //刷新排产的数量
        this.pageData.qtyRequired = data.row.lotSize;
        this.pageData.qtyScheduled = data.row.qtyScheduled;
        this.pageData.qtyToSchedule = data.row.qtyToSchedule;
      });
    },

    /*获取FQC操作员信息*/
    getOperatorList() {
      getOperatorListWithFqc(this.searchData).then(({data}) => {
        //设置列表
        this.operatorList = data.rows;
        //判断是否选中行
        if(this.operatorIndex >= 0){
          //设置选中行
          this.$refs.operatorTable.setCurrentRow(this.operatorList[this.operatorIndex]);
          //选中当前是的行
          setTimeout(() =>{
            //设置默认选中的人员
            this.searchData.resourceId = this.operatorList[this.operatorIndex].operatorId;
            this.pageData.resourceId = this.operatorList[this.operatorIndex].operatorId;
            //刷新当前的派工单记录
            this.getOrderScheduleList();
          },500);

        }
      });
    },

    /*获取派工单的信息*/
    getOrderScheduleList() {
      getOrderScheduleListWithFqc(this.searchData).then(({data}) => {
        this.orderScheduleList = data.rows;
        //清空已经选好的行数据
        this.currentSchedeRow = null;
        //判断是否需要选中当前行
        if (this.scheduleIndex >= 0) {
          //选中当前是的行
          this.$refs.scheduleTable.setCurrentRow(this.orderScheduleList[this.scheduleIndex]);
        }
      })
    },

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

    /*开始排产*/
    startScheduleBun(row, column, event){
      //设置页面参数
      setTimeout(() =>{
        this.pageData.orderNo = row.orderNo;
        this.pageData.itemNo = row.itemNo;
        this.pageData.itemDesc = row.itemDesc;
        this.pageData.workCenterNo = row.workCenterNo;
        this.pageData.workCenterDesc = this.labels.fullInspection;
        this.pageData.partNo = row.partNo;
        this.pageData.partDesc = row.partDesc;
        //this.pageData.qtyRequired = row.lotSize;
        //this.pageData.qtyScheduled = row.qtyScheduled;
        //this.pageData.qtyToSchedule = row.qtyToSchedule;
        //设置页签
        this.activeTable = 'scheduling';
        //刷新页签的参数
        this.getOperatorList();
        //刷新页面的数据
        this.refreshShopOrderByCon();
      }, 500)
    },

    /*设置当前的操作员行*/
    setCurrentOperatorRow(row, column, event) {
      this.currentOperatorRow = JSON.parse(JSON.stringify(row));
      //设置查询的条件
      this.searchData.resourceId = row.operatorId;
      this.pageData.resourceId = row.operatorId;
      //刷新table
      this.getOrderScheduleList();
    },

    /*当前值发生变化的时候修改*/
    changeCurrentOperatorRow(row, oldRow){
      //判断是否是获取焦点的事件
      if(row){
        this.currentOperatorRow = JSON.parse(JSON.stringify(row));
        //设置日历编码和日历描述
        this.refreshCalendarMapByResourceId();
      }
    },

    /*刷新日历编码和日历的描述*/
    refreshCalendarMapByResourceId(){
      let requestData = {'site': this.pageData.site,
        'workCenterNo': 'FQC', 'resourceId': this.currentOperatorRow.operatorId};
     getCalendarMapByResourceId(requestData).then(({data}) => {
       this.pageData.calendarId = data.row.calendarId;
       this.pageData.calendarDesc = data.row.calendarDesc;
     });
    },

    /*设置当前派工单行的下标*/
    scheduleRowClassName({row, rowIndex}){
      row.index = rowIndex;
    },

    /*添加定制的css类*/
    customerCellClassName({row, column, rowIndex, columnIndex}) {
      if(column.property == 'qtyToSchedule'){
        return 'customer-number-cell';
      }
    },
    /*添加定制的cess样式*/
    customerCellStyle({row, column, rowIndex, columnIndex}) {
      if(column.property == 'qtyToSchedule'){
        return 'padding: 0px 0px;';
      }
    },


    /*设置当前的派工单行*/
    setCurrentScheduleRow(row, column, event) {
      this.currentSchedeRow = JSON.parse(JSON.stringify(row));
      //设置当前的序号
      this.scheduleIndex = row.index;
    },

    /*当前值发生变化的时候修改*/
    changeScheduleRow(row, oldRow){
      //判断是否是获取焦点的事件
      if(row){
        this.currentScheduleRow = JSON.parse(JSON.stringify(row));
      }
    },

    /*开始排产的操作*/
    scheduleOperatorsBun(checkFlag) {
      //循环判断是否存在需要排产
      let scheduleOperators = [];
      this.pageData.virtualFlag = 'N';
      //处理需要排产的数据
      for(let i = 0; i < this.operatorList.length; i++){
        let tempOperator = this.operatorList[i];
        if(parseFloat(tempOperator.qtyToSchedule) > 0){
          scheduleOperators.push(tempOperator);
        }
      }
      //判断是否存在需要排产的操作员
      if(scheduleOperators.length == 0){
        this.$message.error(this.labels.noScheduleOperator);
        return false;
      }
      //处理参数
      let postData = {'pageData': JSON.stringify(this.pageData),
        'operatorList': JSON.stringify(scheduleOperators),
      'checkFlag': checkFlag}
      //提交后台的数据
      scheduleFqcOperators(postData).then(({data}) => {
        if (data.code == 500) {
          this.$message.error(data.msg);
        } else if (data.code == 201) {
          this.$confirm(data.msg, '提示', {
            confirmButtonText: this.labels.confirmLabel,
            celButtonText: this.labels.cancelLabel,
            type: 'warning'
          }).then(() => {
            //重新掉用排产
            this.scheduleOperatorsBun(false);
          });
        }else {
          this.$message.success(data.msg);
          //刷新页面的数据
          this.refreshShopOrderByCon();
          //刷新明FQC操作员
          this.getOperatorList();
          this.pageData.virtualFlag = 'N';
          this.pageData.checkFlag = true;
        }
      });
    },


    /*虚拟排产的操作*/
    scheduleVirtualOperatorsBun(checkFlag) {
      //循环判断是否存在需要排产
      let scheduleOperators = [];
      this.pageData.virtualFlag = 'Y';
      //处理需要排产的数据
      for(let i = 0; i < this.operatorList.length; i++){
        let tempOperator = this.operatorList[i];
        if(parseFloat(tempOperator.qtyToSchedule) > 0){
          scheduleOperators.push(tempOperator);
        }
      }
      //判断是否存在需要排产的操作员
      if(scheduleOperators.length == 0){
        this.$message.error(this.labels.noScheduleOperator);
        return false;
      }
      //处理参数
      let postData = {'pageData': JSON.stringify(this.pageData),
        'operatorList': JSON.stringify(scheduleOperators),
        'checkFlag': checkFlag}
      //提交后台的数据
      scheduleFqcOperators(postData).then(({data}) => {
        if (data.code == 500) {
          this.$message.error(data.msg);
        } else if (data.code == 201) {
          this.$confirm(data.msg, '提示', {
            confirmButtonText: this.labels.confirmLabel,
            celButtonText: this.labels.cancelLabel,
            type: 'warning'
          }).then(() => {
            //重新掉用排产
            this.scheduleVirtualOperatorsBun(false);
          });
        }else {
          this.$message.success(data.msg);
          //刷新页面的数据
          this.refreshShopOrderByCon();
          //刷新明FQC操作员
          this.getOperatorList();
          this.pageData.virtualFlag = 'N';
          this.pageData.checkFlag = true;
        }
      });
    },

    /*提示取消派工单*/
    warnCancelScheduleConfirm(row, $event, column) {
      //提示操作
      this.$confirm(this.labels.sureCancelSchedule, '提示', {
        confirmButtonText: this.labels.confirmLabel,
        celButtonText: this.labels.cancelLabel,
        type: 'warning'
      }).then(() => {
        //执行创建新卷的操作
        this.cancelScheduleBun(row);
      });
    },

    /*取消派工单的操作*/
    cancelScheduleBun(scheduleRow) {
      //设置参数
      this.pageData.orderNo = scheduleRow.orderNo;
      this.pageData.itemNo = scheduleRow.itemNo;
      this.pageData.seqNo = scheduleRow.seqNo;
      this.pageData.scheduledQty = scheduleRow.qtyRequired;
      this.pageData.workCenterNo = scheduleRow.workCenterNo;
      this.pageData.resourceId = scheduleRow.resourceId;
      this.pageData.scheduleSeqNo = scheduleRow.scheduledSeqNo;
      this.pageData.planStartTime = scheduleRow.planStartTime;
      //取消排产
      cancelSoSchedule(this.pageData).then(({data}) => {
        if (data.code == 500) {
          this.$message.error(data.msg);
        } else {
          this.$message.success(data.msg);
          //刷新页面的数据
          this.refreshShopOrderByCon();
          //刷新明细的报工页面
          this.getOrderScheduleList();
        }
      });
    },

    /*提示是否重新排产*/
    warnReScheduleConfirm() {
      //提示操作
      this.$confirm(this.labels.sureNoFinishOrderToSchedule, '提示', {
        confirmButtonText: this.labels.confirmLabel,
        celButtonText: this.labels.cancelLabel,
        type: 'warning'
      }).then(() => {
        //执行创建新卷的操作
        this.reScheduleFqcOperator();
      });
    },

    /*重新排产的方法*/
    reScheduleFqcOperator() {
      //设置重新排产的人员
      this.pageData.resourceId = this.currentOperatorRow.operatorId;
      reScheduleWorkOrders(this.pageData).then(({data}) => {
        if (data.code == 500) {
          this.$message.error(data.msg);
        } else {
          this.$message.success(data.msg);
          //刷新明细的报工页面
          this.getOrderScheduleList();
        }
      });
    },

    /*上移派工单*/
    moveUpScheduleBun(){
      //判断是否选择好了移动的行
      let scheduleRow = this.currentScheduleRow;
      if(null == scheduleRow || scheduleRow == ''){
        this.$message.error(this.labels.pleaseSelectSchedule);
        return false;
      }
      //判断是否是第一行
      if(scheduleRow.index == 0){
        this.$message.error(this.labels.thisIsFirstRowCantMoveUp);
        return false;
      }
      //请求的参数
      let requestData = {'site': this.pageData.site,
        'workCenterNo': this.pageData.workCenterNo,
        'resourceId': this.pageData.resourceId,
        'scheduleSeqNo': scheduleRow.scheduledSeqNo};
      //请求处理当前的参数
      moveUpSchedule(requestData).then(({data}) => {
        if(data.code == 500){
          this.$message.error(data.msg);
        }else{
          this.$message.success(data.msg);
          //重置当前行
          this.scheduleIndex = this.scheduleIndex - 1;
          //刷新派工单的数据
          this.getOrderScheduleList();
        }
      });
    },

    /*上移派工单*/
    moveDownScheduleBun(){
      //判断是否选择好了移动的行
      let scheduleRow = this.currentScheduleRow;
      if(null == scheduleRow || scheduleRow == ''){
        this.$message.error(this.labels.pleaseSelectSchedule);
        return false;
      }
      let countNums = this.orderScheduleList.length;
      //判断是否是第一行
      if(scheduleRow.index == countNums - 1){
        this.$message.error(this.labels.thisIsEndRowCantMoveDown);
        return false;
      }
      //请求的参数
      let requestData = {'site': this.pageData.site,
        'workCenterNo': this.pageData.workCenterNo,
        'resourceId': this.pageData.resourceId,
        'scheduleSeqNo': scheduleRow.scheduledSeqNo};
      //请求处理当前的参数
      moveDownSchedule(requestData).then(({data}) => {
        if(data.code == 500){
          this.$message.error(data.msg);
        }else{
          this.$message.success(data.msg);
          //重置当前行
          this.scheduleIndex = this.scheduleIndex + 1;
          //刷新派工单的数据
          this.getOrderScheduleList();
        }
      });
    },

    /*区分不同的菜单  调用不同的方法  调用不同的方法*/
    operatorHandleCommand(menuName){
      //区分是哪一个方法调用
     if('工作日历' === menuName){
        //判断是否选择好了工单
        if(this.currentOperatorRow == null || this.currentOperatorRow == {}){
          //重置按钮
          this.operatorMenuButton.workCalendarOutFlag = true;
          //返回错误
          this.$message.error(this.labels.pleaseSelectOperator);
          return false;
        }
        let tempData = {'site': this.pageData.site, 'calendarId': this.pageData.calendarId,
          'calendarDesc': this.pageData.calendarDesc, 'scheduledDate': this.pageData.scheduleDate};
        //打开组件  需要的数据 展示需要的数据
        this.$nextTick(() => {
          this.showWorkCalendarOut = true;
          this.$refs.comWorkCalendarOut.init(tempData);
        })

      }else if('批量维护工作日历' === menuName){
        //判断是否选择好了工单
        if(this.currentOperatorRow == null || this.currentOperatorRow == {}){
          //重置按钮
          this.operatorMenuButton.batchWorkCalendarFlag = true;
          //返回错误
          this.$message.error(this.labels.pleaseSelectRow);
          return false;
        }
       let tempData = {'site': this.pageData.site, 'calendarId': this.pageData.calendarId,
         'calendarDesc': this.pageData.calendarDesc, 'scheduledDate': this.pageData.scheduleDate};
        //打开组件  需要的数据 展示需要的数据
        this.$nextTick(() => {
          this.showBatchWorkCalendar = true;
          this.$refs.comBatchWorkCalendar.init(tempData);
        })
      }else if('重新排产' === menuName){
        //判断是否选择好了工单
        if(this.currentOperatorRow == null || this.currentOperatorRow == {}){
          //重置按钮
          this.operatorMenuButton.reScheduleOrderFlag = true;
          //返回错误
          this.$message.error(this.labels.pleaseSelectOperator);
          return false;
        }
       //调用提示的方法
       this.warnReScheduleConfirm();
      }
    },

    //控制菜单的按钮
    /*控制明细菜单是否显示*/
    controlOperatorMenuBun(){
      //没有选择行 所有的按钮都是灰色
      if(this.currentOperatorRow == null || this.currentOperatorRow == {}){
        this.operatorMenuButton.workCalendarOutFlag = true;
        this.operatorMenuButton.batchWorkCalendarFlag = true;
        this.operatorMenuButton.reScheduleOrderFlag = true;
        this.operatorMenuButton.changeScheduleByCalendarFlag = true;
        this.operatorMenuButton.partStockFlag = true;
      }else{
        this.operatorMenuButton.workCalendarOutFlag = false;
        this.operatorMenuButton.batchWorkCalendarFlag = false;
        this.operatorMenuButton.reScheduleOrderFlag = false;
        this.operatorMenuButton.changeScheduleByCalendarFlag = false;
        this.operatorMenuButton.partStockFlag = false;
      }
    },

    /*打开已经排产工单的页面*/
    openSchedledOrderPage(){
      //判断是否选择好了工单
      if(this.currentScheduleRow == null || this.currentScheduleRow == {}){
        //返回错误
        this.$message.error(this.labels.pleaseSelectSchedule);
        return false;
      }
      //跳转页面
      this.$router.push({
        path: '/shopOrder-shopOrder/shopOrder',
        query: {
          site: this.$store.state.user.site,
          user: this.$store.state.user.name,
          order: this.currentScheduleRow.orderNo,
        }
      });
    },

    /*打开工单的页面*/
    openOrderPage(){
      //判断是否选择好了工单
      if(!this.currentRoutingRow){
        //返回错误
        this.$message.error(this.labels.pleaseSelectRow);
        return false;
      }
      //跳转页面
      this.$router.push({
        path: '/shopOrder-shopOrder/shopOrder',
        query: {
          site: this.$store.state.user.site,
          user: this.$store.state.user.name,
          order: this.currentRoutingRow.orderNo,
        }
      });
    },

    /*控制单行的背景颜色*/
    controlRowStyle({row, rowIndex}){
      let colorStyle = row.colorStyle;
      //区分不同的样式对应不同的颜色
      if(colorStyle == 'firstColor'){
        return "background-color: #2fff00";
      }else if(colorStyle == 'secondColor'){
        return "background-color: #fff200";
      }else if(colorStyle == 'thirdColor'){
        return "background-color: #00aecd";
      }
    },

    // 打开页面设置
    userSetting(tableId) {
      this.visible = true;
      let queryTable = {
        userId: this.$store.state.user.name,
        functionId: this.$route.meta.menuId,
        tableId: tableId,
        languageCode: this.$i18n.locale
      }
      this.$nextTick(() => {
        this.$refs.column.init(queryTable);
      });
    },
    // 获取 用户保存的 格式列
    getTableUserColumn(tableId) {
      //判断是否是null
      if(!(null === tableId || "" === tableId)){
        this.queryTableUser.tableId = tableId;
      }
      getTableUserListLanguage(this.queryTableUser).then(({data}) => {
        if (data.rows.length > 0) {
          //this.columnList = []
          //如果是订单表
          if('5304Order' === tableId){
            this.columnOrderArray = data.rows;
          }else if('5304Schedule' === tableId){
            this.columnOrderScheduleArray = data.rows;
          }
        } else {
          this.getColumnList(tableId);
        }

      })
    },
    // 保存 默认配置 列
    async saveColumnList(tableId) {
      //重置tableId
      this.queryTable.tableId = tableId;
      this.queryTableUser.tableId = tableId;
      // 删除所有的该页面下保存的数据
      if (this.userColumnList) {
        //删除 user自定义的数据
        await removerUser(this.queryTable)
      }
      // 删除默认配置
      await removerDefault(this.queryTable)
      // 保存页面 table属性
      let sumColumnList = this.columnOrderScheduleArray.concat(this.columnOrderArray);
      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(tableId) {
      //判断是否是null
      if(!(null === tableId || "" === tableId)){
        this.queryTable.tableId = tableId;
      }
      getTableDefaultListLanguage(this.queryTable).then(({data}) => {
        if (!data.rows.length == 0) {
          // this.showDefault = false
          //如果是订单表
          if('5304Order' === tableId){
            this.columnOrderArray = data.rows;
          }else if('5304Schedule' === tableId){
            this.columnOrderScheduleArray = 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.getTableUserColumn('5304Order');
    //查询工单的数据
    //this.getShopOrderList();
    //查询派工的数据
    //this.getOrderScheduleList();
    // 判断是否具有该页面权限
    let menList = JSON.parse(sessionStorage.getItem('dynamicMenuRoutes') || '[]')
      .filter(item => item.path == 'shopOrder-shopOrder/shopOrder')
    //如果存在权限
    if (menList.length > 0){
      this.shopOrderFlag = false;
    }
    //延迟操作
    setTimeout(item =>{
      //分布执行
      this.getTableUserColumn('5304Schedule');
    },3000);

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

    //判断是否启用多语言
    this.getMultiLanguageList();  //刷新多语言的信息
  }
}
</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: 100px !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: #2fff00;
}

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

div.customer-el-card-blue {
  background: #00aecd;
}

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

/*清掉样式*/
.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: 85px;
  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 .customer-dropdown .el-button--primary {
  padding: 5px;
  font-size: 12px;
}

.el-dropdown-menu /deep/ li.customer-li {
  font-size: 10px;
}

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

/*左边的样式*/
.customer-css .customer-left-main {
  width: calc(50vw - 360px) !important;
  padding: 0px;
  margin-left: -5px;
  margin-right: -20px;
  margin-bottom: -5px;
}

/* el-main的样式 */
.customer-css .customer-right-main {
  width: calc(50vw - 240px) !important;
  padding: 0px;
  margin-left: -5px;
  margin-right: -20px;
  margin-bottom: -5px;
}

.customer-css .customer-left-table {
  margin-top: -20px;
}

/*调整右边field的样式*/
.customer-css .customer-right-field {
  margin-left: 46.2%;
  margin-top: calc(-100vh + 223px);
  width: 53.8%;
}

.customer-css /deep/ .el-tabs__content {
  padding: 0px;
}

/*两个checkbox的样式*/
.customer-checkbox + .customer-checkbox {
  margin-top: 20px;
}

/*统一的input内容颜色样式*/
.customer-input-color-red /deep/ .el-input__inner {
  color: red;
}

/deep/ .customer-tab .el-tabs__content{
  padding: 0px !important;
}

/*table中input*/
div.table-input /deep/ input.el-input__inner{
  text-align: right;
}

hr {
  margin-top: 0px;
  margin-bottom: 2px;
}

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


//el-table 取消鼠标悬浮时行高亮效果
/deep/ .schedule-table tbody tr:hover:not(.current-row) >td  {
  background-color: unset !important;
}
</style>
