<template>
  <div style="height: 99%; overflow: auto; background: #ffffff">
      <div style="width: 100%; padding-bottom: 5px; border-bottom: 1px solid #dddddd">
         <a-button @click="emit('cancel')">返回</a-button>         <span
        style=" font-size: 16px;  font-weight: 700"
        >工单详情</span
      >
            </div
    >
    <div class="padding">
      <div style="font-weight: bold; font-size: 16px">工单信息</div>
      <div v-if="baseData1">
        <div class="back_color padding marginTop">
          <a-descriptions title="" :column="4">
            <a-descriptions-item label="工单编号">{{ baseData1.id }}</a-descriptions-item>
            <a-descriptions-item label="优先级">
              <span v-if="baseData1.priority">
                <span v-for="(re, i) in baseData1.priority.split(',')" :key="i">
                  <span v-for="item in priorityOptions" :key="item.key">
                    <span v-if="item.value == re">{{ i > 0 ? ',' : '' }}{{ item.label }}</span>
                  </span>
                </span>
              </span>
            </a-descriptions-item>
            <a-descriptions-item label="计划开工日期">{{
              baseData1.planStartDate
            }}</a-descriptions-item>
            <a-descriptions-item label="计划完工日期">{{
              baseData1.planEndDate
            }}</a-descriptions-item>

            <a-descriptions-item label="物料编码">{{ baseData1.materialNo }}</a-descriptions-item>
            <a-descriptions-item label="物料名称">{{ baseData1.materialName }}</a-descriptions-item>

            <a-descriptions-item label="计划产量">{{ baseData1.planNum }}</a-descriptions-item>
            <a-descriptions-item label="单位">{{ baseData1.unity }} </a-descriptions-item>

            <a-descriptions-item label="生产订单号">{{ baseData1.orderNo }}</a-descriptions-item>
            <a-descriptions-item label="生产计划编号">{{ baseData1.planId }}</a-descriptions-item>
            <a-descriptions-item label="上线日期">{{ baseData1.onlineDate }}</a-descriptions-item>
            <a-descriptions-item label="销售单号">{{ baseData1.saleOrderNo }}</a-descriptions-item>

            <a-descriptions-item label="创建人">{{ baseData1.createUserName }}</a-descriptions-item>

            <a-descriptions-item label="创建时间">{{ baseData1.createDate }}</a-descriptions-item>
            <a-descriptions-item label="备注">{{ baseData1.remark }}</a-descriptions-item>
          </a-descriptions>
        </div>
      </div>
    </div>

    <a-tabs v-model:activeKey="activeKey" destroyInactiveTabPane>
      <a-tab-pane key="1" tab="指派信息">
        <div class="padding" v-if="baseData1.sendType == '1'">
          <div style="font-weight: bold; font-size: 16px">指派记录</div>
          <div>
            <div class="back_color padding marginTop">
              <a-descriptions title="" :column="4">
                <a-descriptions-item label="班组编号">{{ baseData1.groupNo }}</a-descriptions-item>
                <a-descriptions-item label="班组名称">{{
                  baseData1.groupName
                }}</a-descriptions-item>
                <a-descriptions-item label="所属车间"
                  ><span v-if="baseData1.carId">
                    <span v-for="(re, i) in baseData1.carId.split(',')" :key="i">
                      <span v-for="item in carIdOptions" :key="item.key">
                        <span v-if="item.value == re">{{ i > 0 ? ',' : '' }}{{ item.label }}</span>
                      </span>
                    </span>
                  </span></a-descriptions-item
                >
                <a-descriptions-item label="所属产线">
                  <span v-if="baseData1.lineId">
                    <span v-for="(re, i) in baseData1.lineId.split(',')" :key="i">
                      <span v-for="item in lineIdOptions" :key="item.key">
                        <span v-if="item.value == re">{{ i > 0 ? ',' : '' }}{{ item.label }}</span>
                      </span>
                    </span>
                  </span></a-descriptions-item
                >
                <a-descriptions-item label="备注">{{ baseData1.sendRemark }}</a-descriptions-item>
              </a-descriptions>
            </div>
          </div>
        </div>
        <div v-if="baseData1.sendType == '2'">
          <div style="font-weight: bold; font-size: 16px">派工记录</div>
          <div style="display: flex; justify-content: space-between">
            <div style="font-weight: bold; font-size: 16px"
              >工艺路线：
              <span v-if="baseData1 && baseData1.craftId">
                <span v-for="(re, i) in baseData1.craftId.split(',')" :key="i">
                  <span v-for="item in stepOptions" :key="item.key">
                    <span v-if="item.value == re">{{ i > 0 ? ',' : '' }}{{ item.label }}</span>
                  </span>
                </span>
              </span></div
            >
          </div>
          <a-table
            :columns="filterColum(columnsProp.columns)"
            :bordered="true"
            :pagination="true"
            :data-source="detailList"
            :scroll="{ x: 'max-content' }"
          >
            <template #bodyCell="{ column, record, index }">
              <template v-if="column.key !== 'action'">
                <template v-if="column.dataIndex === 'index'">
                  {{ index + 1 }}
                </template>
              </template>
              <template v-if="column.key == 'action'">
                <a @click="handleStepuserView(record)"> 详情 </a>
              </template>

              <template v-if="column.dataIndex === 'state'">
                {{ !record.state || record.state == '0' ? '未派工' : '' }}
                {{ record.state == '1' ? '部分派工' : '' }}
                {{ record.state == '2' ? '派工完成' : '' }}
              </template>
            </template>
          </a-table>
        </div>
      </a-tab-pane>
      <a-tab-pane key="2" tab="批次信息">
        <div style="font-weight: bold; font-size: 16px">批次信息</div>
        <a-table
          :columns="filterColum(columnsPropBatch.columns)"
          :bordered="true"
          :pagination="true"
          :data-source="batchList"
          :scroll="{ x: 'max-content' }"
        >
          <template #bodyCell="{ column, record, index }">
            <template v-if="column.key !== 'action'">
              <template v-if="column.dataIndex === 'index'">
                {{ index + 1 }}
              </template>
            </template>
          </template>
        </a-table>
      </a-tab-pane>
      <a-tab-pane key="3" tab="物料信息">
        <div style="font-weight: bold; font-size: 16px">物料信息</div>
        <a-table
          :columns="filterColum(columnsPropMaterial.columns)"
          :bordered="true"
          :pagination="true"
          :data-source="materailList"
          :scroll="{ x: 'max-content' }"
        >
          <template #bodyCell="{ column, record, index }">
            <template v-if="column.key !== 'action'">
              <template v-if="column.dataIndex === 'index'">
                {{ index + 1 }}
              </template>
            </template>
          </template>
        </a-table>
      </a-tab-pane>
      <a-tab-pane key="4" tab="报工记录">
        <div style="font-weight: bold; font-size: 16px"
          >报工记录<span style="color: blue">{{
            baseData1.state == '8' ? '(已完工)' : ''
          }}</span></div
        >
        <div style="display: flex; justify-content: space-between">
          <div>
            <a-descriptions title="" :column="2">
              <a-descriptions-item v-if="baseData1.realStartDate" label="开工日期">{{
                baseData1.realStartDate
              }}</a-descriptions-item>
              <a-descriptions-item v-if="baseData1.realEndDate" label="完工日期">{{
                baseData1.realEndDate
              }}</a-descriptions-item>
            </a-descriptions>
          </div>
          <div style="display: flex">
            <a-button
              v-if="baseData1.state == '1'"
              @click="visibleModaWorkStart = true"
              type="primary"
              style="margin-left: 12px"
              >开工</a-button
            >
            <a-button
              v-if="baseData1.state == '2'"
              @click="visibleModaWorkEnd = true"
              type="primary"
              style="margin-left: 12px"
              >完工</a-button
            >
            <a-button
              :disabled="baseData1.state != '2'"
              @click="visibleModaWorkAdd = true"
              type="primary"
              style="margin-left: 12px"
              >报工</a-button
            >
          </div>
        </div>

        <a-table
          :columns="filterColum(columnsPropWork.columns)"
          :bordered="true"
          :pagination="true"
          :data-source="workList"
          :scroll="{ x: 'max-content' }"
        >
          <template #bodyCell="{ column, record, index }">
            <template v-if="column.key !== 'action'">
              <template v-if="column.dataIndex === 'index'">
                {{ index + 1 }}
              </template>
            </template>
          </template>
        </a-table>
      </a-tab-pane>
      <a-tab-pane key="5" tab="质检记录">
        <checkModal v-if="checkIdData" :rowData="checkIdData"></checkModal>
      </a-tab-pane>
    </a-tabs>

    <a-divider />
    <!-- <div class='modelfooter'
      v-if="rowData.isUpdate"
    >
      <a-button @click="handleClose">取消</a-button>
      <a-button @click="handleSubmit" type="primary" style="margin-left: 12px">确认</a-button>
    </div> -->

    <a-modal
      :maskClosable="false"
      title="派工操作"
      v-model:visible="visibleModa"
      :confirm-loading="confirmLoading"
      width="90%"
      :body-style="{
        height: '700px',
        overflow: 'hidden',
        overflowY: 'scroll',
      }"
      :style="{
        left: '5%',
        top: '120px',
      }"
      :footer="null"
    >
      <stepuserPropsModal
        v-if="visibleModa"
        :rowData="rowDatauser"
        @cancel="visibleModa = false"
        @success="handleSuccessUser"
      ></stepuserPropsModal>
    </a-modal>

    <a-modal
      :maskClosable="false"
      title="开工操作"
      v-model:visible="visibleModaWorkStart"
      :confirm-loading="confirmLoading"
      width="500px"
      :footer="null"
    >
      <div style="height: 300px; padding-top: 20px">
        <a-form ref="formRef1" :model="baseData1" :labelCol="{ span: 6 }">
          <a-form-item label="开工日期" name="planStartDate" required>
            <XjrDatePicker
              v-model:value="baseData1.realStartDate"
              placeholder="请选择"
              :allowClear="true"
              :format="'YYYY-MM-DD'"
              style="width: 90%"
              :disabled-date="disabledRealStartDate"
            />
          </a-form-item>
        </a-form>
      </div>
      <div class="modelfooter">
        <a-button @click="visibleModaWorkStart = false">取消</a-button>
        <a-button @click="workStart" type="primary" style="margin-left: 12px">确认</a-button>
      </div>
    </a-modal>
    <a-modal
      :maskClosable="false"
      title="完工操作"
      v-model:visible="visibleModaWorkEnd"
      :confirm-loading="confirmLoading"
      width="500px"
      :footer="null"
    >
      <div style="height: 300px">
        <div class="back_color padding marginTop">
          <a-descriptions title="" :column="2">
            <a-descriptions-item label="计划产量">{{ baseData1.planNum }}</a-descriptions-item>
            <a-descriptions-item label="报工数量">{{ baseData1.workNum }}</a-descriptions-item>
          </a-descriptions>
        </div>
        <a-form ref="formRef2" :model="baseData1" :labelCol="{ span: 5 }">
          <a-col :span="24">
            <a-form-item label="完工日期" name="planStartDate" required>
              <XjrDatePicker
                v-model:value="baseData1.realEndDate"
                placeholder="请选择"
                :allowClear="true"
                :format="'YYYY-MM-DD'"
                :disabled-date="disabledRealEndDate"
                style="width: 90%"
              />
            </a-form-item>
          </a-col>
          <a-col :span="24">
            <a-form-item label="备注" name="remark">
              <a-textarea
                v-model:value="baseData1.remark"
                placeholder="请输入"
                :auto-size="{ minRows: 2, maxRows: 5 }"
                style="width: 90%"
              />
            </a-form-item>
          </a-col>
        </a-form>
      </div>
      <div class="modelfooter">
        <a-button @click="visibleModaWorkEnd = false">取消</a-button>
        <a-button
          v-if="baseData1.planNum <= baseData1.workNum"
          @click="workEnd"
          type="primary"
          style="margin-left: 12px"
          >确认</a-button
        >
        <div v-else style="color: red">注意：报工数少于计划产量</div>
      </div>
    </a-modal>

    <a-modal
      :maskClosable="false"
      title="报工操作"
      v-model:visible="visibleModaWorkAdd"
      :confirm-loading="confirmLoading"
      width="500px"
      :footer="null"
    >
      <div style="height: 300px">
        <a-form ref="formRef" :model="workData" :labelCol="{ span: 5 }">
          <a-col :span="24">
            <a-form-item label="可报数量">
              {{ baseData1.workNum ? baseData1.planNum - baseData1.workNum : baseData1.planNum }}
            </a-form-item>
          </a-col>
          <a-col :span="24">
            <a-form-item label="报工数量" name="workNum" required>
              <a-input-number
                :min="0"
                :step="1"
                :max="baseData1.workNum ? baseData1.planNum - baseData1.workNum : baseData1.planNum"
                v-model:value="workData.workNum"
                style="width: 90%"
                placeholder="请输入"
              />
            </a-form-item>
          </a-col>
          <a-col :span="24">
            <a-form-item label="设备" name="workDev">
              <a-select
                :options="devOptions"
                placeholder="请选择"
                style="width: 90%"
                v-model:value="workData.workDev"
                allowClear
              >
              </a-select>
            </a-form-item>
          </a-col>
          <a-col :span="24">
            <a-form-item label="工位" name="userStation">
              <a-select
                :options="stationOptions"
                placeholder="请选择"
                style="width: 90%"
                v-model:value="workData.userStation"
                allowClear
              >
              </a-select>
            </a-form-item>
          </a-col>
        </a-form>
      </div>
      <div class="modelfooter">
        <a-button @click="visibleModaWorkAdd = false">取消</a-button>
        <a-button @click="workAddSubmit" type="primary" style="margin-left: 12px">确认</a-button>
      </div>
    </a-modal>
  </div>
</template>
<script lang="ts" setup>
  // import { uploadApi } from '/@/api/sys/upload';
  // import { PlusOutlined, MinusCircleOutlined } from '@ant-design/icons-vue';
  import { ref, reactive, watch, onMounted, createVNode } from 'vue';
  // import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
  import {
    getDicItem,
    getMesFactoryListByType,
    getMesGoupList,
    getProcessTechList,
    getMesProWorkReportList,
    getWorkOrderStepList,
    getMesDevList,
    getProduceOrderCheckId,
    getBomListByProduct,
  } from '/@/api/mes/common';

  import { getMesProOrderwork, updateMesProOrderwork } from '/@/api/mes/proorderwork';
  import { addMesProOrderworkReportwork } from '/@/api/mes/proworkreport';
  // import SelectUser from '/@/components/Form/src/components/SelectUser.vue';
  import stepuserPropsModal from './stepuserPropsModal.vue';
  import checkModal from './checkModal.vue';

  // import AutoCodeRule from '/@/components/Form/src/components/AutoCodeRule.vue';
  import { XjrDatePicker } from '/@/components/DatePicker';
  // import { MultipleSelect } from '/@/components/MultiplePopup';
  // import Upload from '/@/components/Form/src/components/Upload.vue';
  // import { useModal } from '/@/components/Modal';
  import { useMessage } from '/@/hooks/web/useMessage';
  import { useI18n } from '/@/hooks/web/useI18n';

  const activeKey = ref('1');
  const checkIdData = ref<any>({});
  // import { Modal } from 'ant-design-vue';
  const selectedKeys = ref<string[]>([]);
  const selectedRowsData = ref<any[]>([]);

  const selectedKeysStep = ref<string[]>([]);
  const selectedRowsDataStep = ref<any[]>([]);
  const { notification } = useMessage();
  const { t } = useI18n();
  let props = defineProps(['rowData']);
  const rowData: {
    id: string;
    isUpdate: boolean;
    flag: string;
  } = reactive({
    id: '',
    isUpdate: false,
    flag: '',
  });

  const detailList = ref<any[]>([]);
  const batchList = ref<any[]>([]);
  const materailList = ref<any[]>([]);
  const workList = ref<any[]>([]);
  // const format = ref('YYYY-MM-DD HH:mm:ss');
  const multipleDialog = ref<boolean>(false);
  function filterColum(column) {
    return column.filter((o) => {
      return o.show == false ? false : true;
    });
  }
  // const removeList = (index) => {
  //   detailList.value.splice(index, 1);
  // };
  const baseData1 = ref<any>({});
  const formData = ref<any>({
    groupId: '',
    groupNo: '',
    groupName: '',
    remark: '',
    sendType: '1', //派单类型1-工单指派，2-工序派单
  });

  const emit = defineEmits(['cancel', 'success']);

  onMounted(async () => {
    rowData.id = props.rowData.id;
    rowData.isUpdate = props.rowData.isUpdate;
    rowData.flag = props.rowData.flag;
    console.log('row===', rowData);

    getDetailData();
    getWrokList();
    getMaterialListByProduct();
    priorityOptions.value = await getDicItem('1689840965516009473');
    unityOptions.value = await getDicItem('1688808244736008194');

    carIdOptions.value = await getMesFactoryListByType(1, '');
    lineIdOptions.value = await getMesFactoryListByType(2, '');
    stepOptions.value = await getProcessTechList('');
    groupOptions.value = await getMesGoupList();

    devOptions.value = await getMesDevList();
    stationOptions.value = await getMesFactoryListByType(3, '');
  });

  watch(
    () => props.rowData,
    async (val) => {
      console.log('监听', val);
      if (val) {
        activeKey.value = '1';
        rowData.id = props.rowData.id;
        rowData.isUpdate = props.rowData.isUpdate;
        rowData.flag = props.rowData.flag;
        formData.value = {};
        await getDetailData();
        getWrokList();
        getMaterialListByProduct();
      }
    },
  );
  const confirmLoading = ref<boolean>(false);
  const visibleModa = ref<boolean>(false);
  const rowDatauser = ref({});
  function handleStepuserView(record: Recordable) {
    rowDatauser.value.id = '';
    console.log('record===', record);
    rowDatauser.value = record;
    rowDatauser.value.isUpdate = false;
    visibleModa.value = true;
  }
  const priorityOptions = ref<any[]>([]);
  const unityOptions = ref<any[]>([]);
  const carIdOptions = ref<any[]>([]);
  const lineIdOptions = ref<any[]>([]);
  const stepOptions = ref<any[]>([]);
  const groupOptions = ref<any[]>([]);
  // const workIdList = ref<any[]>([]);
  // const baseDataList = ref<any[]>([]);
  const craftDataList = ref<any[]>([]);
  const devOptions = ref<any[]>([]);
  const stationOptions = ref<any[]>([]);

  const getDetailData = async () => {
    // baseDataList.value = [];
    const data = await getMesProOrderwork(rowData.id);
    // baseDataList.value.push(data);
    baseData1.value = data;

    // console.log('craftTemp', craftTemp);
    // craftTemp?.then((result) => {
    //   craftDataList.value = result;
    // });
    if (craftDataList.value && craftDataList.value.length == 1)
      baseData1.value.craftId = craftDataList.value[0].id;

    let stepList = await getWorkOrderStepList(baseData1.value?.id);
    detailList.value = stepList?.list;

    //查询质检记录
    let checkIdList = await getProduceOrderCheckId(baseData1.value?.workNo);
    checkIdData.value = checkIdList[0];
  };
  async function getMaterialListByProduct() {
    materailList.value = await getBomListByProduct(baseData1.value.materialId, 'sub');
  }
  function handleClose() {
    emit('cancel');
  }

  //报工---------------
  const visibleModaWorkStart = ref<boolean>(false);
  const visibleModaWorkEnd = ref<boolean>(false);
  const visibleModaWorkAdd = ref<boolean>(false);
  const workData = ref<any>({});
  function workAdd() {
    //新增报工
    visibleModaWorkAdd.value = true;
  }
  const formRef1 = ref();
  async function workStart() {
    if (!baseData1.value.realStartDate || baseData1.value.realStartDate.length == 0) {
      notification.error({
        message: 'Tip',
        description: t('请选择开工日期'),
      });
      return;
    }
    //开工：
    baseData1.value.state = 2; //状态;0-待下发、1-待生产、2-生产中，8-已完成、9已关闭、7已暂停
    await updateMesProOrderwork(baseData1.value);
    notification.success({
      message: 'Tip',
      description: t('开工成功！'),
    }); //提示消息
    const data = await getMesProOrderwork(rowData.id);
    baseData1.value = data;
    visibleModaWorkStart.value = false;
  }
  const formRef2 = ref();
  async function workFinishShow() {
    if (baseData1.value.planNum > baseData1.value.workNum) {
      notification.error({
        message: 'Tip',
        description: t('报工数不能少于计划产量'),
      });
      return;
    }
    visibleModaWorkEnd.value = true;
  }
  async function workEnd() {
    if (!baseData1.value.realEndDate || baseData1.value.realEndDate.length == 0) {
      notification.error({
        message: 'Tip',
        description: t('请选择完工日期'),
      });
      return;
    }
    //完工：
    baseData1.value.state = 8; //状态;0-待下发、1-待生产、2-生产中，8-已完成、9已关闭、7已暂停
    await updateMesProOrderwork(baseData1.value);
    notification.success({
      message: 'Tip',
      description: t('完工成功！'),
    }); //提示消息
    const data = await getMesProOrderwork(rowData.id);
    baseData1.value = data;
    visibleModaWorkEnd.value = false;
  }
  const disabledRealStartDate = (current: Moment) => {
    // Can not select days before today and today

    return current && current > new Date();
  };
  const disabledRealEndDate = (current: Moment) => {
    // Can not select days before today and today
    return current && current > new Date();
  };
  const formRef = ref();
  async function getWrokList() {
    if (!rowData.id) return;
    const data = await getMesProWorkReportList(rowData.id);
    workList.value = data;
    chgWorkNum();
  }
  function chgWorkNum() {
    let workNum = 0;
    workList.value.forEach((ele) => {
      workNum += parseInt(ele.work_num);
    });
    console.log('workNum', workNum);
    baseData1.value.workNum = workNum;
  }
  async function workAddSubmit() {
    try {
      const values = await formRef.value?.validate();
      if (!values.workNum || values.workNum.length == 0) {
        notification.error({
          message: 'Tip',
          description: t('请输入报工数量'),
        });
        return;
      }
      values.workId = baseData1.value.id;
      values.materialId = baseData1.value.materialId;
      values.materialNo = baseData1.value.materialNo;
      values.materialName = baseData1.value.materialName;
      // values.model = baseData1.value.materialName;
      values.unity = baseData1.value.unity;
      values.groupId = baseData1.value.groupId;
      // TODO custom api
      // if (!state.isUpdate) {
      //false 新增
      await addMesProOrderworkReportwork(values);

      notification.success({
        message: 'Tip',
        description: t('新增报工成功！'),
      }); //提示消息
      // } else {
      //   values.id = state.rowId;
      //   await updateMesProOrderworkReportwork(values);
      //   notification.success({
      //     message: 'Tip',
      //     description: t('修改报工成功！'),
      //   }); //提示消息
      // }
      await getWrokList();
      visibleModaWorkAdd.value = false;

      formRef.value.resetFields();
    } finally {
      confirmLoading.value = false;
    }
  }

  const columnsProp = {
    columns: [
      {
        title: '工单编号',
        dataIndex: 'workNo',
      },
      {
        title: '工序编码',
        dataIndex: 'stepNo',
      },
      {
        title: '工序名称',
        dataIndex: 'stepName',
      },
      {
        title: '任务总量',
        dataIndex: 'taskNum',
      },
      {
        title: '工序单价',
        dataIndex: 'stepPrice',
      },
      {
        title: '状态',
        dataIndex: 'state',
      },
      {
        title: '已派数量',
        dataIndex: 'sendNum',
      },
      { title: '操作', key: 'action', fixed: 'left', width: '150px' },
    ],
  };

  const columnsPropBatch = {
    columns: [
      {
        title: '批次号',
        dataIndex: 'batchNo',
      },
      {
        title: '物料编码',
        dataIndex: 'materialNo',
      },
      {
        title: '物料名称',
        dataIndex: 'materialName',
      },
      {
        title: '单位',
        dataIndex: 'unity',
      },

      {
        title: '已生产数量',
        dataIndex: 'produceNum',
      },
    ],
  };

  const columnsPropMaterial = {
    columns: [
      {
        title: '物料编码',
        dataIndex: 'code',
      },
      {
        title: '物料名称',
        dataIndex: 'name',
      },
      {
        title: '规格型号',
        dataIndex: 'model',
      },
      {
        title: '单位',
        dataIndex: 'unit_name',
      },

      {
        title: '物料类别',
        dataIndex: 'type_name',
      },
      {
        title: '物料属性',
        dataIndex: 'property_name',
      },
      {
        title: '需求数量',
        dataIndex: 'count',
      },
      {
        title: '已领数量',
        dataIndex: 'receive_num',
      },
      {
        title: '缺料量',
        dataIndex: 'less_num',
      },
    ],
  };
  const columnsPropWork = {
    columns: [
      {
        title: '物料编码',
        dataIndex: 'material_no',
      },
      {
        title: '物料名称',
        dataIndex: 'material_name',
      },
      // {
      //   title: '规格型号',
      //   dataIndex: 'model',
      // },
      {
        title: '单位',
        dataIndex: 'unity',
      },

      {
        title: '报工数量',
        dataIndex: 'work_num',
      },
      {
        title: '设备',
        dataIndex: 'dev_name',
      },
      {
        title: '工位',
        dataIndex: 'station_name',
      },
      {
        title: '班组',
        dataIndex: 'group_name',
      },
    ],
  };
</script>

<style lang="less" scoped>
  .padding {
    padding: 12px;
  }

  .back_color {
    background-color: hsl(0, 0%, 98%);
    position: relative;
  }

  .marginTop {
    margin-top: 12px;
  }
  .modelfooter {
    padding: 10px 16px;
    text-align: right;
    background: white;
    border-top: 1px solid rgb(240, 240, 240);
    border-radius: 0px 0px 2px 2px;
    position: absolute;
    bottom: 1px;
    width: 98%;
  }
</style>
