<template>
  <div class="mainContentBox">
    <el-row :gutter="20">
      <el-col :span="6" class="elColClasss">
        <Orders @getindex="setSelectOrderIndex" />
      </el-col>
      <el-col :span="6" class="elColClasss">
        <div class="grid-content ep-bg-purple">
          <Processes />
        </div>
      </el-col>
      <CurrentProduction />
    </el-row>
    <Transition>
      <CheckPop v-model="checkPop" />
    </Transition>
  </div>
</template>

<script lang="ts" setup>
import Orders from "@/views/process/orders.vue";
import Processes from "@/views/process/processes.vue";
import CurrentProduction from "@/views/process/currentProduction.vue";
import CheckPop from "./popUpView/checkPop.vue";
import { ElLoading } from "element-plus";
defineOptions({ name: "ProcessMain" });
const checkPop = ref(false);
//未完成订单数组
const ordersDataArray = ref([]);
//未完成任务总数
const ordersSum = ref(0);
// 获取选中订单的Index
const selectOrderIndex = ref(null);
// 获取选中订单对应流转卡号的Data
const selectSeqArray = ref([]);
// 获取选中订单对应流转卡号的index
const selectSeqIndex = ref(null);
// 扫码变量确认工序
const scanStatus = ref(false);
// 是否选中订单
const selectedOderStatus = ref(false);
//当前选择的订单对应订单的工序data
const opsArray = ref([]);
const setSelectOrderIndex = (value: number) => {
  selectOrderIndex.value = value;
  opsArray.value = ordersDataArray.value[value].ops;
  selectedOderStatus.value = true;
};
provide("selectSeqIndex", selectSeqIndex);
provide("ordersDataArray", ordersDataArray);
provide("selectOrderIndex", selectOrderIndex);
provide("selectSeqArray", selectSeqArray);
provide("scanStatus", scanStatus);
provide("selectedOderStatus", selectedOderStatus);
provide("opsArray", opsArray);
</script>

<style lang="scss" scoped>
.elColClasss {
  height: calc(100vh - 130px);
}
</style>
