<template>
  <avue-crud
    :option="option"
    :table-loading="loading"
    :data="data"
    v-model="form"
    v-model:page="page"
    ref="crud"
    @row-del="rowDel"
    @search-change="searchChange"
    @search-reset="searchReset"
    @selection-change="selectionChange"
    @current-change="currentChange"
    @size-change="sizeChange"
    @refresh-change="refreshChange"
    @on-load="onLoad"
    @row-update="save"
  >
    <template #menu-left>
      <el-button type="primary" @click="claseOrder()" plain>关闭订单</el-button>
    </template>
    <template #menu-right> </template>

    <template #poCode="{ row }">
      <el-text type="primary">{{ row.poCode }}</el-text>
    </template>
    <template #prodIdent="{ row }">
      <el-tag>{{ row.prodIdent }}</el-tag>
    </template>
    <template #curStatusText="{ row }">
      <el-tag v-if="row.curStatusText == '已派工'">{{ row.curStatusText }}</el-tag>
      <el-tag class="ml-2" type="success" v-if="row.curStatusText == '已完工'">
        {{ row.curStatusText }}</el-tag
      >
      <el-tag class="ml-2" type="info" v-if="row.curStatusText == '已关闭'">{{
        row.curStatusText
      }}</el-tag>
      <el-tag class="ml-2" type="warning" v-if="row.curStatusText == '加工中'">{{
        row.curStatusText
      }}</el-tag>
      <el-tag class="ml-2" type="danger" v-if="row.curStatusText == '已退回'">{{
        row.curStatusText
      }}</el-tag>
      <el-tag class="ml-2" type="danger" v-if="row.curStatusText == '无工艺'">{{
        row.curStatusText
      }}</el-tag>
    </template>
    <template #menu="{ row }">
      <!-- <el-button type="primary" text plain style="border: 0; background-color: transparent !important"
                @click="lookProcessRoute(row)">查看工艺路线
            </el-button> -->
    </template>
  </avue-crud>
</template>

<script> 
import { getList, closeBatchs,edit } from '@/api/orderManagement/exceptionOrder';
import {
  add,
  getRole,
  getRoleAlias,
  getRoleTreeById,
  grant,
  grantTree,
  remove,
  update,
} from '@/api/system/role';
import { mapGetters } from 'vuex';
import website from '@/config/website';
import { validatenull } from '@/utils/validate';
// import { getList } from '@/api/base/region';
import { templateDic } from '@/const/tool/model';
// import orderCol from './orderCol.js'
export default {
  components: {
    // lookProcess
  },
  data() {
    return {
      isOpen: false,
      rowItem: {},
      poId: null,
      form: {},
      box: false,
      props: {
        label: 'title',
        value: 'key',
      },
      menuGrantList: [],
      dataScopeGrantList: [],
      apiScopeGrantList: [],
      apiGrantList: [],
      menuTreeObj: [],
      dataScopeTreeObj: [],
      apiScopeTreeObj: [],
      selectionList: [],
      query: {},
      loading: true,
      page: {
        pageSize: 10,
        currentPage: 1,
        total: 0,
      },
      option: {
        columnSort: true,
        tip: false,
        height: 'auto',
        calcHeight: 32,
        simplePage: false,
        searchShow: true,
        searchMenuSpan: 12,
        searchIcon: true,
        searchIndex: 3,
        tree: false,
        border: true,
        index: false,
        selection: true,
        viewBtn: false,
        delBtn: false,
        addBtn: false,
        editBtn: true,
        editBtnText: '修改',
        labelWidth: 120,
        // searchLabelWidth: 120,
        menuWidth: 100,
        dialogWidth: 900,
        dialogClickModal: false,
        searchEnter: true,
        excelBtn: false,
        filterBtn: true,
        searchShowBtn: false,
        excelBtn: true,
        showOverflowTooltip: true,
        addBtnIcon: ' ',
        viewBtnIcon: ' ',
        delBtnIcon: ' ',
        editBtnIcon: ' ',
        menuAlign: 'left',
        gridBtn: false,
        searchLabelPosition: 'left',
        searchLabelPosition: 'left',
        searchGutter: 24,
        searchSpan: 6,
        menuAlign: 'left',
        gridBtn: false,
        searchMenuPosition: 'right',
        align: 'center',

        column: [
          {
            label: '计划单号',
            prop: 'poCode',
            search: true,
            sortable: true,
            width: 150,
            span: 12,
            headerAlign: 'center',
            align: 'center',
            rules: [
              {
                required: true,
                message: '请输入角色名称',
                trigger: 'blur',
              },
            ],
          },
          {
            label: '零件号',
            prop: 'partCode',
            search: true,
            sortable: true,
            width: 150,
            span: 12,
            headerAlign: 'center',
            align: 'center',
            rules: [
              {
                required: true,
                message: '请输入角色名称',
                trigger: 'blur',
              },
            ],
          },
          {
            label: '产品型号',
            prop: 'productType',
            search: false,
            sortable: true,
            disabled: true,
            width: 150,
            span: 12,
            headerAlign: 'center',
            align: 'center',
            rules: [
              {
                required: false,
                message: '请输入角色名称',
                trigger: 'blur',
              },
            ],
          },
          {
            label: '产品名称',
            prop: 'partName',
            search: false,
            sortable: true,
            disabled: true,
            span: 12,
            width: 150,
            headerAlign: 'center',
            align: 'left',
            rules: [
              {
                required: false,
                message: '请输入角色名称',
                trigger: 'blur',
              },
            ],
          },
          {
            label: '镀种',
            prop: 'plate',
            search: false,
            sortable: true,
            disabled: true,
            span: 12,
            headerAlign: 'center',
            align: 'center',
            rules: [
              {
                required: false,
                message: '请输入角色名称',
                trigger: 'blur',
              },
            ],
          },
          {
            label: '镀种小类',
            prop: 'plate1',
            search: false,
            sortable: true,
            width: 120,
            display: false,
            span: 12,
            headerAlign: 'center',
            align: 'center',
            rules: [
              {
                required: true,
                message: '请输入角色名称',
                trigger: 'blur',
              },
            ],
          },
          {
            label: '面积(d㎡)',
            prop: 'ypArea',
            search: false,
            sortable: true,
            width: 120,
            span: 12,
            disabled: true,
            headerAlign: 'center',
            align: 'center',
            rules: [
              {
                required: false,
                message: '请输入角色名称',
                trigger: 'blur',
              },
            ],
          },
          {
            label: '生产标识',
            prop: 'productIdent',
            search: false,
            sortable: true,
            width: 120,
            span: 12,
            headerAlign: 'center',
            align: 'center',
            rules: [
              {
                required: true,
                message: '请输入角色名称',
                trigger: 'blur',
              },
            ],
          },
          {
            label: '使用部门',
            prop: 'useDept',
            search: false,
            sortable: true,
            disabled: true,
            width: 120,
            span: 12,
            headerAlign: 'center',
            align: 'center',
            rules: [
              {
                required: true,
                message: '请输入角色名称',
                trigger: 'blur',
              },
            ],
          },
          {
            label: '生产数量',
            prop: 'poQty',
            search: false,
            sortable: true,
            width: 120,
            span: 12,
            headerAlign: 'center',
            align: 'center',
            rules: [
              {
                required: true,
                message: '请输入角色名称',
                trigger: 'blur',
              },
            ],
          },

          {
            label: '需求交期',
            prop: 'demandDate',
            search: false,
            sortable: true,
            width: 180,
            span: 12,
            headerAlign: 'center',
            align: 'center',
            type: 'datetime', // 改成 datetime
            valueFormat: 'YYYY-MM-DD HH:mm:ss', // 输出格式
            rules: [
              {
                required: true,
                message: '请输入角色名称',
                trigger: 'blur',
              },
            ],
          },
          {
            label: '计划员',
            prop: 'planUser',
            search: false,
            sortable: true,
            width: 120,
            span: 12,
            headerAlign: 'center',
            align: 'center',
            rules: [
              {
                required: true,
                message: '请输入角色名称',
                trigger: 'blur',
              },
            ],
          },
          {
            label: '计划下达时间',
            prop: 'releaseDate',
            search: false,
            sortable: true,
            searchLabelWidth: 100,
            width: 180,
            span: 12,
            type: 'datetime', // 改成 datetime
            valueFormat: 'YYYY-MM-DD HH:mm:ss', // 输出格式
            headerAlign: 'center',
            align: 'center',
            rules: [
              {
                required: true,
                message: '请输入角色名称',
                trigger: 'blur',
              },
            ],
          },

          {
            label: '备注',
            prop: 'memo',
            search: false,
            sortable: true,
            span: 24,
            type: 'textarea',
            width: 150,
            headerAlign: 'center',
            align: 'left',
            rules: [
              {
                required: true,
                message: '请输入角色名称',
                trigger: 'blur',
              },
            ],
          },
        ],
      },

      data: [],
      
    };
  },

  methods: {
    // 关闭订单
    claseOrder() {
      // 检查是否选择了数据
      if (this.selectionList.length === 0) {
        this.$message.error('请选择至少一条数据');
        return;
      }
      
      this.$confirm('确定将选择数据批量关闭?', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'error',
      })

        .then(() => {
          const ids = this.selectionList.map(item => item.id).join(',');
          closeBatchs({ ...{ ids } }).then(res => {
            if (res.code === 200) {
              this.$message.success('审核成功');
            }
          });
          this.$refs.crud.toggleSelection();
          this.onLoad(this.page); // return remove(row.id);
          // return remove(row.id);
        })
        .catch(() => {
          // this.onLoad(this.page);
          // this.$message({
          //     type: 'success',
          //     message: '操作成功!',
          // });
        });
    },
    searchReset() {
      this.query = {};
      this.onLoad(this.page);
    },
    searchChange(params, done) {
      this.query = params;
      this.page.currentPage = 1;
      this.onLoad(this.page, params);
      done();
    },
    selectionChange(list) {
      this.selectionList = list;
    },
    selectionClear() {
      this.selectionList = [];
      this.$refs.crud.toggleSelection();
    },

    currentChange(currentPage) {
      this.page.currentPage = currentPage;
    },
    sizeChange(pageSize) {
      this.page.pageSize = pageSize;
    },
    refreshChange() {
      this.onLoad(this.page, this.query);
    },
    handleChange(file, fileList) {
      // proxy.$Export.xlsx(file.raw).then((data) => {
      //     data.value = data.results;
      // });
      this.$message({
        type: 'success',
        message: '操作成功!',
      });
    },

    async onLoad(page, params = {}) {
      this.loading = true;
      this.data = [
        {
          id: 1,
          alreadyBranchQty: 500.0,
          bsPlatingSmall: {
            bpsId: 5,
            bpsName: '小类05',
            bsWorkCenter: {
              area: 0.0,
              batchNo: null,
              bigBatch: false,
              bsJfCenter: {
                createMan: {
                  accountId: null,
                  card: null,
                  createTime: '2022-08-31',
                  curStatus: 1,
                  deleted: false,
                  deptName: null,
                  dimissionTime: null,
                  factoryId: 41,
                  head: 0,
                  jobName: '总工',
                  keyValue: 1,
                  ldapName: 'admin',
                  mail: '13699999999@136.com',
                  mobile: '13699999999',
                  pfDepartment: {
                    appLink: null,
                    createTime: '2022-08-31',
                    deleted: false,
                    deptCode: '001',
                    deptId: 1,
                    deptName: 'MES开发部',
                    deptType: 1,
                    deptTypeTitle: '厂',
                    keyValue: 1,
                    memo: null,
                    orders: '00',
                    parentDeptId: null,
                    parentPath: null,
                    ucDeptId: null,
                    updateTime: '2022-08-31 16:32:46',
                  },
                  pinyinIndex: 'ADMIN,ADMIN',
                  ucUserId: null,
                  updateTime: '2022-08-31 16:32:46',
                  userCode: '00',
                  userId: 1,
                  userName: 'admin',
                  userSex: 1,
                  userSources: 'admin',
                  userString: '1:A:admin',
                  userType: 'A',
                },
                createTime: '2024-12-09 00:00:00',
                deleted: false,
                jcCode: 'RBZX',
                jcId: 1,
                jcName: '热表中心',
                keyValue: 1,
                updateTime: '2024-12-09 00:00:00',
              },
              checkout: false,
              craftAbility:
                '真空退火、固溶、局部退火、整体退火、淬火、时效、热处理、淬火时效、真空释氢',
              createMan: {
                accountId: 90,
                card: null,
                createTime: '2023-02-08',
                curStatus: 1,
                deleted: false,
                deptName: null,
                dimissionTime: null,
                factoryId: 41,
                head: 1,
                jobName: '生产调度员',
                keyValue: 90,
                ldapName: '03891',
                mail: null,
                mobile: null,
                pfDepartment: {
                  appLink: null,
                  createTime: '2023-02-08',
                  deleted: false,
                  deptCode: '06',
                  deptId: 47,
                  deptName: '经营管理室',
                  deptType: 1,
                  deptTypeTitle: '厂',
                  keyValue: 47,
                  memo: null,
                  orders: '6',
                  parentDeptId: 41,
                  parentPath: null,
                  ucDeptId: null,
                  updateTime: '2023-02-08 13:23:30',
                },
                pinyinIndex: '03891,03891',
                ucUserId: null,
                updateTime: '2023-02-08 13:20:39',
                userCode: '03891',
                userId: 90,
                userName: '03891',
                userSex: 1,
                userSources: '03891',
                userString: '90:A:03891',
                userType: 'A',
              },
              createTime: '2023-04-08 18:35:43',
              deleted: false,
              describe: null,
              endPoint: null,
              keyValue: 142,
              leaderUser: {
                accountId: 541,
                card: null,
                createTime: '2023-05-04',
                curStatus: 1,
                deleted: false,
                deptName: null,
                dimissionTime: null,
                factoryId: 102,
                head: 0,
                jobName: 'MES开发',
                keyValue: 541,
                ldapName: 'cdl',
                mail: null,
                mobile: null,
                pfDepartment: {
                  appLink: null,
                  createTime: '2022-08-31',
                  deleted: false,
                  deptCode: '001',
                  deptId: 1,
                  deptName: 'MES开发部',
                  deptType: 1,
                  deptTypeTitle: '厂',
                  keyValue: 1,
                  memo: null,
                  orders: '00',
                  parentDeptId: null,
                  parentPath: null,
                  ucDeptId: null,
                  updateTime: '2022-08-31 16:32:46',
                },
                pinyinIndex: 'CUIDIANLONG,CDL',
                ucUserId: null,
                updateTime: '2023-05-04 09:16:54',
                userCode: 'cdl',
                userId: 541,
                userName: '崔殿龙',
                userSex: 1,
                userSources: '崔殿龙',
                userString: '541:A:崔殿龙',
                userType: 'A',
              },
              limitType: 0,
              processes: ' ',
              quantity: 0,
              roundCycle: null,
              saturation: 0.0,
              sign: '4',
              startPoint: null,
              team: '热处理班',
              updateTime: '2023-04-08 18:35:43',
              wcCode: '003',
              wcId: 142,
              wcName: '热处理作业中心',
              whetherPlate: false,
            },
            capacity: 1.0,
            keyValue: 5,
            updateMan: {
              accountId: 541,
              card: null,
              createTime: '2023-05-04',
              curStatus: 1,
              deleted: false,
              deptName: null,
              dimissionTime: null,
              factoryId: 102,
              head: 0,
              jobName: 'MES开发',
              keyValue: 541,
              ldapName: 'cdl',
              mail: null,
              mobile: null,
              pfDepartment: {
                appLink: null,
                createTime: '2022-08-31',
                deleted: false,
                deptCode: '001',
                deptId: 1,
                deptName: 'MES开发部',
                deptType: 1,
                deptTypeTitle: '厂',
                keyValue: 1,
                memo: null,
                orders: '00',
                parentDeptId: null,
                parentPath: null,
                ucDeptId: null,
                updateTime: '2022-08-31 16:32:46',
              },
              pinyinIndex: 'CUIDIANLONG,CDL',
              ucUserId: null,
              updateTime: '2023-05-04 09:16:54',
              userCode: 'cdl',
              userId: 541,
              userName: '崔殿龙',
              userSex: 1,
              userSources: '崔殿龙',
              userString: '541:A:崔殿龙',
              userType: 'A',
            },
            updateTime: '2024-04-10 16:22:22',
          },
          bsProcedureQua: null,
          closeMan: null,
          closeTime: null,
          curStatus: 3,
          curStatusText: '无工艺',
          custodian: null,
          deliveryQty: 420.0,
          demandDate: '2025-02-28 00:00:00',
          dominantDept: '1000',
          dsPart: null,
          keyValue: 58382,
          memo: '年底集中备货,可提前交件',
          partCode: '21E8-050-221-H1',
          partName: '压板',
          planType: 1,
          planUser: '3500371',
          plate: 'Ct.P',
          plate1: 'Ct',
          poArea: 0.0,
          poCode: 'WO-P22120483',
          poId: 58382,
          poQty: 500,
          primaryCraft: '库1- 冲压-4（表）-库2',
          priority: 1,
          prodIdent: 'JHT',
          prodLine: null,
          productType: 'YM-22',
          releaseDate: '2022-12-21 22:19:13',
          roamNo: '无二级工艺信息!!',
          routeNo: 'LX01-01-017',
          sureType: null,
          sureTypeTitle: '未确认',
          syncTime: '2023-02-20 14:42:13',
          undeliveredQty: 80.0,
          useDept: '3500',
          wcName: null,
        },
        {
          alreadyBranchQty: 6150.0,
          bsPlatingSmall: {
            bpsId: 5,
            bpsName: '小类05',
            bsWorkCenter: {
              area: 0.0,
              batchNo: null,
              bigBatch: false,
              bsJfCenter: {
                createMan: {
                  accountId: null,
                  card: null,
                  createTime: '2022-08-31',
                  curStatus: 1,
                  deleted: false,
                  deptName: null,
                  dimissionTime: null,
                  factoryId: 41,
                  head: 0,
                  jobName: '总工',
                  keyValue: 1,
                  ldapName: 'admin',
                  mail: '13699999999@136.com',
                  mobile: '13699999999',
                  pfDepartment: {
                    appLink: null,
                    createTime: '2022-08-31',
                    deleted: false,
                    deptCode: '001',
                    deptId: 1,
                    deptName: 'MES开发部',
                    deptType: 1,
                    deptTypeTitle: '厂',
                    keyValue: 1,
                    memo: null,
                    orders: '00',
                    parentDeptId: null,
                    parentPath: null,
                    ucDeptId: null,
                    updateTime: '2022-08-31 16:32:46',
                  },
                  pinyinIndex: 'ADMIN,ADMIN',
                  ucUserId: null,
                  updateTime: '2022-08-31 16:32:46',
                  userCode: '00',
                  userId: 1,
                  userName: 'admin',
                  userSex: 1,
                  userSources: 'admin',
                  userString: '1:A:admin',
                  userType: 'A',
                },
                createTime: '2024-12-09 00:00:00',
                deleted: false,
                jcCode: 'RBZX',
                jcId: 1,
                jcName: '热表中心',
                keyValue: 1,
                updateTime: '2024-12-09 00:00:00',
              },
              checkout: false,
              craftAbility:
                '真空退火、固溶、局部退火、整体退火、淬火、时效、热处理、淬火时效、真空释氢',
              createMan: {
                accountId: 90,
                card: null,
                createTime: '2023-02-08',
                curStatus: 1,
                deleted: false,
                deptName: null,
                dimissionTime: null,
                factoryId: 41,
                head: 1,
                jobName: '生产调度员',
                keyValue: 90,
                ldapName: '03891',
                mail: null,
                mobile: null,
                pfDepartment: {
                  appLink: null,
                  createTime: '2023-02-08',
                  deleted: false,
                  deptCode: '06',
                  deptId: 47,
                  deptName: '经营管理室',
                  deptType: 1,
                  deptTypeTitle: '厂',
                  keyValue: 47,
                  memo: null,
                  orders: '6',
                  parentDeptId: 41,
                  parentPath: null,
                  ucDeptId: null,
                  updateTime: '2023-02-08 13:23:30',
                },
                pinyinIndex: '03891,03891',
                ucUserId: null,
                updateTime: '2023-02-08 13:20:39',
                userCode: '03891',
                userId: 90,
                userName: '03891',
                userSex: 1,
                userSources: '03891',
                userString: '90:A:03891',
                userType: 'A',
              },
              createTime: '2023-04-08 18:35:43',
              deleted: false,
              describe: null,
              endPoint: null,
              keyValue: 142,
              leaderUser: {
                accountId: 541,
                card: null,
                createTime: '2023-05-04',
                curStatus: 1,
                deleted: false,
                deptName: null,
                dimissionTime: null,
                factoryId: 102,
                head: 0,
                jobName: 'MES开发',
                keyValue: 541,
                ldapName: 'cdl',
                mail: null,
                mobile: null,
                pfDepartment: {
                  appLink: null,
                  createTime: '2022-08-31',
                  deleted: false,
                  deptCode: '001',
                  deptId: 1,
                  deptName: 'MES开发部',
                  deptType: 1,
                  deptTypeTitle: '厂',
                  keyValue: 1,
                  memo: null,
                  orders: '00',
                  parentDeptId: null,
                  parentPath: null,
                  ucDeptId: null,
                  updateTime: '2022-08-31 16:32:46',
                },
                pinyinIndex: 'CUIDIANLONG,CDL',
                ucUserId: null,
                updateTime: '2023-05-04 09:16:54',
                userCode: 'cdl',
                userId: 541,
                userName: '崔殿龙',
                userSex: 1,
                userSources: '崔殿龙',
                userString: '541:A:崔殿龙',
                userType: 'A',
              },
              limitType: 0,
              processes: ' ',
              quantity: 0,
              roundCycle: null,
              saturation: 0.0,
              sign: '4',
              startPoint: null,
              team: '热处理班',
              updateTime: '2023-04-08 18:35:43',
              wcCode: '003',
              wcId: 142,
              wcName: '热处理作业中心',
              whetherPlate: false,
            },
            capacity: 1.0,
            keyValue: 5,
            updateMan: {
              accountId: 541,
              card: null,
              createTime: '2023-05-04',
              curStatus: 1,
              deleted: false,
              deptName: null,
              dimissionTime: null,
              factoryId: 102,
              head: 0,
              jobName: 'MES开发',
              keyValue: 541,
              ldapName: 'cdl',
              mail: null,
              mobile: null,
              pfDepartment: {
                appLink: null,
                createTime: '2022-08-31',
                deleted: false,
                deptCode: '001',
                deptId: 1,
                deptName: 'MES开发部',
                deptType: 1,
                deptTypeTitle: '厂',
                keyValue: 1,
                memo: null,
                orders: '00',
                parentDeptId: null,
                parentPath: null,
                ucDeptId: null,
                updateTime: '2022-08-31 16:32:46',
              },
              pinyinIndex: 'CUIDIANLONG,CDL',
              ucUserId: null,
              updateTime: '2023-05-04 09:16:54',
              userCode: 'cdl',
              userId: 541,
              userName: '崔殿龙',
              userSex: 1,
              userSources: '崔殿龙',
              userString: '541:A:崔殿龙',
              userType: 'A',
            },
            updateTime: '2024-04-10 16:22:22',
          },
          bsProcedureQua: null,
          closeMan: null,
          closeTime: null,
          curStatus: 3,
          curStatusText: '无工艺',
          custodian: null,
          deliveryQty: 0.0,
          demandDate: '2022-09-30 00:00:00',
          dominantDept: '3511',
          dsPart: null,
          keyValue: 58383,
          memo: '可提前交件',
          partCode: '21E8-510-8118-A1',
          partName: 'GF3AP-4PAIR屏蔽片A2',
          planType: 1,
          planUser: '50001610',
          plate: null,
          poArea: 0.0405905672,
          poCode: 'WO-211041920',
          poId: 58383,
          poQty: 6150,
          primaryCraft: '库1-冲压、表-库2',
          priority: 1,
          prodIdent: 'M',
          prodLine: null,
          productType: 'GF3AP',
          releaseDate: '2021-10-13 14:41:49',
          roamNo: '无二级工艺信息!!',
          routeNo: 'LX01-01-024',
          sureType: null,
          sureTypeTitle: '未确认',
          syncTime: '2023-02-20 14:42:13',
          undeliveredQty: 6150.0,
          useDept: '3511',
          wcName: null,
        },
        {
          alreadyBranchQty: 28000.0,
          bsPlatingSmall: {
            bpsId: 5,
            bpsName: '小类05',
            bsWorkCenter: {
              area: 0.0,
              batchNo: null,
              bigBatch: false,
              bsJfCenter: {
                createMan: {
                  accountId: null,
                  card: null,
                  createTime: '2022-08-31',
                  curStatus: 1,
                  deleted: false,
                  deptName: null,
                  dimissionTime: null,
                  factoryId: 41,
                  head: 0,
                  jobName: '总工',
                  keyValue: 1,
                  ldapName: 'admin',
                  mail: '13699999999@136.com',
                  mobile: '13699999999',
                  pfDepartment: {
                    appLink: null,
                    createTime: '2022-08-31',
                    deleted: false,
                    deptCode: '001',
                    deptId: 1,
                    deptName: 'MES开发部',
                    deptType: 1,
                    deptTypeTitle: '厂',
                    keyValue: 1,
                    memo: null,
                    orders: '00',
                    parentDeptId: null,
                    parentPath: null,
                    ucDeptId: null,
                    updateTime: '2022-08-31 16:32:46',
                  },
                  pinyinIndex: 'ADMIN,ADMIN',
                  ucUserId: null,
                  updateTime: '2022-08-31 16:32:46',
                  userCode: '00',
                  userId: 1,
                  userName: 'admin',
                  userSex: 1,
                  userSources: 'admin',
                  userString: '1:A:admin',
                  userType: 'A',
                },
                createTime: '2024-12-09 00:00:00',
                deleted: false,
                jcCode: 'RBZX',
                jcId: 1,
                jcName: '热表中心',
                keyValue: 1,
                updateTime: '2024-12-09 00:00:00',
              },
              checkout: false,
              craftAbility:
                '真空退火、固溶、局部退火、整体退火、淬火、时效、热处理、淬火时效、真空释氢',
              createMan: {
                accountId: 90,
                card: null,
                createTime: '2023-02-08',
                curStatus: 1,
                deleted: false,
                deptName: null,
                dimissionTime: null,
                factoryId: 41,
                head: 1,
                jobName: '生产调度员',
                keyValue: 90,
                ldapName: '03891',
                mail: null,
                mobile: null,
                pfDepartment: {
                  appLink: null,
                  createTime: '2023-02-08',
                  deleted: false,
                  deptCode: '06',
                  deptId: 47,
                  deptName: '经营管理室',
                  deptType: 1,
                  deptTypeTitle: '厂',
                  keyValue: 47,
                  memo: null,
                  orders: '6',
                  parentDeptId: 41,
                  parentPath: null,
                  ucDeptId: null,
                  updateTime: '2023-02-08 13:23:30',
                },
                pinyinIndex: '03891,03891',
                ucUserId: null,
                updateTime: '2023-02-08 13:20:39',
                userCode: '03891',
                userId: 90,
                userName: '03891',
                userSex: 1,
                userSources: '03891',
                userString: '90:A:03891',
                userType: 'A',
              },
              createTime: '2023-04-08 18:35:43',
              deleted: false,
              describe: null,
              endPoint: null,
              keyValue: 142,
              leaderUser: {
                accountId: 541,
                card: null,
                createTime: '2023-05-04',
                curStatus: 1,
                deleted: false,
                deptName: null,
                dimissionTime: null,
                factoryId: 102,
                head: 0,
                jobName: 'MES开发',
                keyValue: 541,
                ldapName: 'cdl',
                mail: null,
                mobile: null,
                pfDepartment: {
                  appLink: null,
                  createTime: '2022-08-31',
                  deleted: false,
                  deptCode: '001',
                  deptId: 1,
                  deptName: 'MES开发部',
                  deptType: 1,
                  deptTypeTitle: '厂',
                  keyValue: 1,
                  memo: null,
                  orders: '00',
                  parentDeptId: null,
                  parentPath: null,
                  ucDeptId: null,
                  updateTime: '2022-08-31 16:32:46',
                },
                pinyinIndex: 'CUIDIANLONG,CDL',
                ucUserId: null,
                updateTime: '2023-05-04 09:16:54',
                userCode: 'cdl',
                userId: 541,
                userName: '崔殿龙',
                userSex: 1,
                userSources: '崔殿龙',
                userString: '541:A:崔殿龙',
                userType: 'A',
              },
              limitType: 0,
              processes: ' ',
              quantity: 0,
              roundCycle: null,
              saturation: 0.0,
              sign: '4',
              startPoint: null,
              team: '热处理班',
              updateTime: '2023-04-08 18:35:43',
              wcCode: '003',
              wcId: 142,
              wcName: '热处理作业中心',
              whetherPlate: false,
            },
            capacity: 1.0,
            keyValue: 5,
            updateMan: {
              accountId: 541,
              card: null,
              createTime: '2023-05-04',
              curStatus: 1,
              deleted: false,
              deptName: null,
              dimissionTime: null,
              factoryId: 102,
              head: 0,
              jobName: 'MES开发',
              keyValue: 541,
              ldapName: 'cdl',
              mail: null,
              mobile: null,
              pfDepartment: {
                appLink: null,
                createTime: '2022-08-31',
                deleted: false,
                deptCode: '001',
                deptId: 1,
                deptName: 'MES开发部',
                deptType: 1,
                deptTypeTitle: '厂',
                keyValue: 1,
                memo: null,
                orders: '00',
                parentDeptId: null,
                parentPath: null,
                ucDeptId: null,
                updateTime: '2022-08-31 16:32:46',
              },
              pinyinIndex: 'CUIDIANLONG,CDL',
              ucUserId: null,
              updateTime: '2023-05-04 09:16:54',
              userCode: 'cdl',
              userId: 541,
              userName: '崔殿龙',
              userSex: 1,
              userSources: '崔殿龙',
              userString: '541:A:崔殿龙',
              userType: 'A',
            },
            updateTime: '2024-04-10 16:22:22',
          },
          bsProcedureQua: null,
          closeMan: null,
          closeTime: null,
          curStatus: 3,
          curStatusText: '无工艺',
          custodian: null,
          deliveryQty: 5021.0,
          demandDate: '2023-03-06 00:00:00',
          dominantDept: '1000',
          dsPart: null,
          keyValue: 58385,
          memo: '瓶颈零件，市场三星康健正走预测流程，宋斌确认,可提前交件22',
          partCode: '21E8-003-7854-E51',
          partName: '方盘壳体',
          planType: 1,
          planUser: '35011348',
          plate: 'Et.A(S)10.Cl(BK)',
          poArea: 0.3552907284,
          poCode: 'WO-S2301959',
          poId: 58385,
          poQty: 28000,
          primaryCraft: '库1-机加-4（表、涂色带）-库2',
          priority: 1,
          prodIdent: 'MR',
          prodLine: null,
          productType: 'PDLC03',
          releaseDate: '2023-01-06 15:25:48',
          roamNo: '无二级工艺信息!!',
          routeNo: 'LX01-03-064',
          sureType: null,
          sureTypeTitle: '未确认',
          syncTime: '2023-02-20 14:42:13',
          undeliveredQty: 22979.0,
          useDept: '3501',
          wcName: null,
        },
        {
          id: 2,
          alreadyBranchQty: 200.0,
          bsPlatingSmall: {
            bpsId: 5,
            bpsName: '小类05',
            bsWorkCenter: {
              area: 0.0,
              batchNo: null,
              bigBatch: false,
              bsJfCenter: {
                createMan: {
                  accountId: null,
                  card: null,
                  createTime: '2022-08-31',
                  curStatus: 1,
                  deleted: false,
                  deptName: null,
                  dimissionTime: null,
                  factoryId: 41,
                  head: 0,
                  jobName: '总工',
                  keyValue: 1,
                  ldapName: 'admin',
                  mail: '13699999999@136.com',
                  mobile: '13699999999',
                  pfDepartment: {
                    appLink: null,
                    createTime: '2022-08-31',
                    deleted: false,
                    deptCode: '001',
                    deptId: 1,
                    deptName: 'MES开发部',
                    deptType: 1,
                    deptTypeTitle: '厂',
                    keyValue: 1,
                    memo: null,
                    orders: '00',
                    parentDeptId: null,
                    parentPath: null,
                    ucDeptId: null,
                    updateTime: '2022-08-31 16:32:46',
                  },
                  pinyinIndex: 'ADMIN,ADMIN',
                  ucUserId: null,
                  updateTime: '2022-08-31 16:32:46',
                  userCode: '00',
                  userId: 1,
                  userName: 'admin',
                  userSex: 1,
                  userSources: 'admin',
                  userString: '1:A:admin',
                  userType: 'A',
                },
                createTime: '2024-12-09 00:00:00',
                deleted: false,
                jcCode: 'RBZX',
                jcId: 1,
                jcName: '热表中心',
                keyValue: 1,
                updateTime: '2024-12-09 00:00:00',
              },
              checkout: false,
              craftAbility:
                '真空退火、固溶、局部退火、整体退火、淬火、时效、热处理、淬火时效、真空释氢',
              createMan: {
                accountId: 90,
                card: null,
                createTime: '2023-02-08',
                curStatus: 1,
                deleted: false,
                deptName: null,
                dimissionTime: null,
                factoryId: 41,
                head: 1,
                jobName: '生产调度员',
                keyValue: 90,
                ldapName: '03891',
                mail: null,
                mobile: null,
                pfDepartment: {
                  appLink: null,
                  createTime: '2023-02-08',
                  deleted: false,
                  deptCode: '06',
                  deptId: 47,
                  deptName: '经营管理室',
                  deptType: 1,
                  deptTypeTitle: '厂',
                  keyValue: 47,
                  memo: null,
                  orders: '6',
                  parentDeptId: 41,
                  parentPath: null,
                  ucDeptId: null,
                  updateTime: '2023-02-08 13:23:30',
                },
                pinyinIndex: '03891,03891',
                ucUserId: null,
                updateTime: '2023-02-08 13:20:39',
                userCode: '03891',
                userId: 90,
                userName: '03891',
                userSex: 1,
                userSources: '03891',
                userString: '90:A:03891',
                userType: 'A',
              },
              createTime: '2023-04-08 18:35:43',
              deleted: false,
              describe: null,
              endPoint: null,
              keyValue: 142,
              leaderUser: {
                accountId: 541,
                card: null,
                createTime: '2023-05-04',
                curStatus: 1,
                deleted: false,
                deptName: null,
                dimissionTime: null,
                factoryId: 102,
                head: 0,
                jobName: 'MES开发',
                keyValue: 541,
                ldapName: 'cdl',
                mail: null,
                mobile: null,
                pfDepartment: {
                  appLink: null,
                  createTime: '2022-08-31',
                  deleted: false,
                  deptCode: '001',
                  deptId: 1,
                  deptName: 'MES开发部',
                  deptType: 1,
                  deptTypeTitle: '厂',
                  keyValue: 1,
                  memo: null,
                  orders: '00',
                  parentDeptId: null,
                  parentPath: null,
                  ucDeptId: null,
                  updateTime: '2022-08-31 16:32:46',
                },
                pinyinIndex: 'CUIDIANLONG,CDL',
                ucUserId: null,
                updateTime: '2023-05-04 09:16:54',
                userCode: 'cdl',
                userId: 541,
                userName: '崔殿龙',
                userSex: 1,
                userSources: '崔殿龙',
                userString: '541:A:崔殿龙',
                userType: 'A',
              },
              limitType: 0,
              processes: ' ',
              quantity: 0,
              roundCycle: null,
              saturation: 0.0,
              sign: '4',
              startPoint: null,
              team: '热处理班',
              updateTime: '2023-04-08 18:35:43',
              wcCode: '003',
              wcId: 142,
              wcName: '热处理作业中心',
              whetherPlate: false,
            },
            capacity: 1.0,
            keyValue: 5,
            updateMan: {
              accountId: 541,
              card: null,
              createTime: '2023-05-04',
              curStatus: 1,
              deleted: false,
              deptName: null,
              dimissionTime: null,
              factoryId: 102,
              head: 0,
              jobName: 'MES开发',
              keyValue: 541,
              ldapName: 'cdl',
              mail: null,
              mobile: null,
              pfDepartment: {
                appLink: null,
                createTime: '2022-08-31',
                deleted: false,
                deptCode: '001',
                deptId: 1,
                deptName: 'MES开发部',
                deptType: 1,
                deptTypeTitle: '厂',
                keyValue: 1,
                memo: null,
                orders: '00',
                parentDeptId: null,
                parentPath: null,
                ucDeptId: null,
                updateTime: '2022-08-31 16:32:46',
              },
              pinyinIndex: 'CUIDIANLONG,CDL',
              ucUserId: null,
              updateTime: '2023-05-04 09:16:54',
              userCode: 'cdl',
              userId: 541,
              userName: '崔殿龙',
              userSex: 1,
              userSources: '崔殿龙',
              userString: '541:A:崔殿龙',
              userType: 'A',
            },
            updateTime: '2024-04-10 16:22:22',
          },
          bsProcedureQua: null,
          closeMan: null,
          closeTime: null,
          curStatus: 3,
          curStatusText: '无工艺',
          custodian: null,
          deliveryQty: 0.0,
          demandDate: '2023-02-28 00:00:00',
          dominantDept: '1000',
          dsPart: null,
          keyValue: 58387,
          memo: '年底集中备货,可提前交件11',
          partCode: '21E8-142-428-E5',
          partName: '14垫圈',
          planType: 1,
          planUser: '3500371',
          plate: 'Et.A(S)10.Cl(BK)喷黑色醇酸磁漆',
          poArea: 0.0,
          poCode: 'WO-P22120431',
          poId: 58387,
          poQty: 200,
          primaryCraft: '库1-2（机加）-4（表）-库2',
          priority: 1,
          prodIdent: 'JII',
          prodLine: null,
          productType: 'Y50通用件',
          releaseDate: '2022-12-21 22:17:33',
          roamNo: '无二级工艺信息!!',
          routeNo: 'LX01-01-007',
          sureType: null,
          sureTypeTitle: '未确认',
          syncTime: '2023-02-20 14:42:13',
          undeliveredQty: 200.0,
          useDept: '3500',
          wcName: null,
        },
      ];
      try {
        const res = await getList(
          page.currentPage,
          page.pageSize,

          Object.assign(params, this.query, { validationResult: '16002' })
        );
        if (res.code) {
          this.data = res.data.data.records;
          this.page.total = res.data.data.total;
          this.selectionClear();
        }
      } catch (err) {
        console.log(err);
      }
      this.loading = false;
    },
    save( row, index, done, loading) {
        edit(row).then(
        () => {
          this.onLoad(this.page);
          this.$message({
            type: 'success',
            message: '操作成功!',
          });
          done();
        },
        error => {
          window.console.log(error);
          loading();
        }
      );
    },
  },
  mounted() {
    // this.option.column = orderCol['exceptionOrder']
  },
};
</script>
