Forráskód Böngészése

Merge branch 'master' of https://git.7in6.com/Minong/mes-admin-backend-ui

liuhairui 1 éve
szülő
commit
4df245e748

+ 19 - 454
src/view/DecisionSupport/operation/operation.vue

@@ -8,6 +8,7 @@
             <el-form-item>
               <el-button  type="primary" icon="Download" @click="exportToExcel" style="margin: 5px;float: right;">导出到Excel(汇总)</el-button>
               <el-button  type="primary" icon="Download" @click="exportToExcel2" style="margin: 5px;float: right;">月度明细</el-button>
+              <el-button  type="primary" icon="Download" @click="exportToExcel3" style="margin: 5px;float: right;">导出到Excel(明细)</el-button>
             </el-form-item>
           </el-form>
         </div>
@@ -142,449 +143,6 @@ import { useUserStore } from '@/pinia/modules/user'
 const userStore = useUserStore()
 const _username = ref('')
 _username.value = userStore.userInfo.userName + '/' + userStore.userInfo.nickName
-const fields = ref({
-    '姓名':'name',
-    '年龄':'age',
-    '编号':'num',
-  });
-const json_data = ref([
-  {
-    name:'张三',
-    age:17,
-    num:'~00013', //能解决丢0问题
-  },{
-    name:'李四',
-    age:33,
-    num:'00014',//会出现丢失0
-  },
-]);
-
-const printPageRef = ref()
-const addGongYiRef = ref()
-// =========== 修正核算参数 ===========
-const xzhstableColumns = ref(
-    [
-      { label: '方案', prop: '方案', width: '65' },
-      { label: '印件号及工序名称', prop: '印件号及工序名称', width: '300' },
-      { label: '参照设备', prop: '参照设备', width: '90' },
-      { label: '难度系数', prop: 'sxzhscsold_难度系数', width: '90' },
-      { label: '新难度系数', prop: '难度系数', width: '100' },
-      { label: '原损耗代号', prop: 'sxzhscsold_损耗代号', width: '150' },
-      { label: '基础损耗', prop: '基础损耗', width: '90' },
-      { label: '新损耗代号', prop: '损耗代号', width: '150' },
-      { label: '原印刷方式', prop: 'sxzhscsold_印刷方式', width: '150' },
-      { label: '原来版距', prop: 'sxzhscsold_版距', width: '100' },
-      { label: '新印刷方式', prop: '印刷方式', width: '100' },
-      { label: '新来版距', prop: '版距', width: '90' },
-      { label: '原计损色数', prop: 'sxzhscsold_计损色数', width: '100' },
-      { label: '新计损色数', prop: '计损色数', width: '100' },
-      { label: '原损耗系数', prop: 'sxzhscsold_损耗系数', width: '100' },
-      { label: '新损耗系数', prop: '损耗系数', width: '100' },
-    ]
-)
-const handleKeyDown = (event, x, y, prop) => {
-  const currentElement = document.getElementById(`input${x}${y}`);
-  if (currentElement === null && currentElement === undefined) return
-  let move = 0
-  switch (event.keyCode) {
-    case 13: // Enter
-    case 40: // 向下箭头
-      if (y < sxzhscstableData.value.length )
-        document.getElementById(`input${x}${y + 1}`).focus();
-      break;
-    case 38: // 向上箭头
-      if ( y > 0) {
-        document.getElementById(`input${x}${y - 1}`).focus();
-      }
-      break;
-    case 39: // 向左箭头
-      if ( x === 4) {
-        move = x + 3
-      } else if(x === 7){
-        move = x + 3
-      } else if( x === 10){
-        move = x + 1
-      }else if( x === 11){
-        move = x + 2
-      }else if( x === 13){
-        move = x + 2
-      }
-      document.getElementById(`input${move}${y}`).focus();
-      break;
-    case 37: // 向右箭头
-      if ( x === 15) {
-        move = x -  2
-      } else if (x=== 13) {
-        move = x - 2
-      }else if (x=== 11) {
-        move = x - 1
-      }else if (x=== 10) {
-        move = x - 3
-      }else if (x=== 7) {
-        move = x - 3
-      }
-      document.getElementById(`input${move}${y}`).focus();
-      break;
-    default:
-      break;
-  }
-}
-const xzhscslist = ref(false);
-const xzhscsformData = reactive({
-  gdbh: '',
-  cpdh: '',
-  gdmc: '',
-});
-const sxzhscstableData = ref([]);
-//修正核算参数按钮
-const onxzhscsclick = () => {
-  if(_Gd_gdbh.value == null){
-    xzhscslist.value = false;
-    ElMessage({type: 'warning',message: '请选择具体的工单后,再操作此功能' })
-  }else{
-    xzhscsformData['gdbh'] = _Gd_gdbh.value;
-    xzhscsformData['cpdh'] = _Gd_cpdh.value;
-    xzhscsformData['gdmc'] = _Gd_cpmc.value;
-    _AccountingParameterdata();
-    xzhscslist.value = true;
-  }
-};
-//修正核算参数回车
-const xzhscsgetProductValue = () => {
-  _AccountingParameterdata()
-};
-// 修正工单核算参数表格数据
-const _AccountingParameterdata = async ()=>{
-  let workOrder = xzhscsformData['gdbh'];
-  console.log(workOrder)
-  try {
-    const AccountingParameterdata = await AccountingParameter({workOrder:workOrder});
-    console.log(AccountingParameterdata);
-    sxzhscstableData.value = AccountingParameterdata.data;
-    const formattedData = AccountingParameterdata.data.map(item=>{
-      item.sxzhscsold_难度系数 = item.难度系数;
-      item.sxzhscsold_损耗代号 = item.损耗代号;
-      item.sxzhscsold_印刷方式 = item.印刷方式;
-      item.sxzhscsold_版距 = item.版距;
-      item.sxzhscsold_计损色数 = item.计损色数;
-      item.sxzhscsold_损耗系数 = item.损耗系数;
-      return item
-    });
-  } catch (error) {
-    console.error(error);
-  }
-}
-//修正核算参数更新
-const xzhscsConfirm = async () => {
-  const firstCharValid = sxzhscstableData.value.map(item => {
-    const firstChar = item["损耗代号"] ? item["损耗代号"].charAt(0) : '';
-    return firstChar === '0' || firstChar === '';
-  });
-  if(firstCharValid.includes(false)){
-    ElMessage({type: 'warning',message: '损耗代号开头必须是 0' })
-    return false;
-  }
-  if (sxzhscstableData.value) {
-    const formattedData = sxzhscstableData.value.map(item => {
-      return {
-        Uniqid: parseInt(item.UniqId),
-        chromatic: parseFloat(item.计损色数) ?? '',
-        difficulty: parseFloat(item.难度系数) ?? '',
-        loss: item.损耗代号 ??'',
-        plate: parseInt(item.版距) ?? '',
-        printMode: item.印刷方式 ?? '',
-        wastage: parseFloat(item.损耗系数),
-      }
-    });
-    const AccountingParameterEditdata = await AccountingParameterEdit(formattedData);
-    if (AccountingParameterEditdata.code === 0) {
-      xzhscslist.value = false;
-      ElMessage({ type: 'success', message: '更新成功' });
-    } else {
-      ElMessage({ type: 'error', message: '更新失败' });
-    }
-  } else {
-    console.error("数据错误");
-  }
-};
-//修正核算参数退出
-const sxzhscsCancel = () => {
-  xzhscslist.value = false;
-};
-
-// =========== 质检废品系数 ===========
-const zjfpxs_tableColumns = ref(
-    [
-      { label: '产品编号', prop: '产品编号', width: '95' },
-      { label: '产品名称', prop: '产品名称', width: '200' },
-      { label: '印件工序及工艺', prop: '印件工序及工艺', width: '220' },
-      { label: '新人工正品板', prop: 'scfjfpxsold_人工正品板', width: '110' },
-      { label: '新人工次品板', prop: 'scfjfpxsold_人工次品板', width: '110' },
-      { label: '新人工废检', prop: 'scfjfpxsold_人工废检', width: '110' },
-      { label: '新机检正品板', prop: 'scfjfpxsold_机检正品板', width: '110' },
-      { label: '新机检次品板', prop: 'scfjfpxsold_机检次品板', width: '110' },
-      { label: '新机检废检', prop: 'scfjfpxsold_机检废检', width: '110' },
-      { label: '人工正品板', prop: '人工正品板', width: '110' },
-      { label: '人工次品板', prop: '人工次品板', width: '110' },
-      { label: '人工废检', prop: '人工废检', width: '110' },
-      { label: '机检正品板', prop: '机检正品板', width: '110' },
-      { label: '机检次品板', prop: '机检次品板', width: '110' },
-      { label: '机检废检', prop: '机检废检', width: '110' },
-      { label: '设备编号', prop: '设备编号', width: '100' },
-      { label: '客户名称', prop: '客户名称', width: '200' },
-    ]
-)
-const zjfpxs_handleKeyDown = (event, x, y, prop) => {
-  const currentElement = document.getElementById(`input${x}${y}`);
-  if (currentElement === null && currentElement === undefined) return
-  let move = 0
-  switch (event.keyCode) {
-    case 13: // Enter
-    case 40: // 向下箭头
-      if (y < scfjfpxstableData.value.length )
-        document.getElementById(`input${x}${y + 1}`).focus();
-      break;
-    case 38: // 向上箭头
-      if ( y > 0) {
-        document.getElementById(`input${x}${y - 1}`).focus();
-      }
-      break;
-    case 39: // 向左箭头
-      if (x >= 9 && x <=14) {
-        move = x + 1
-      }
-      document.getElementById(`input${move}${y}`).focus();
-      break;
-    case 37: // 向右箭头
-      if (x >= 9 && x <=14) {
-        move = x - 1
-      }
-      document.getElementById(`input${move}${y}`).focus();
-      break;
-    default:
-      break;
-  }
-}
-const scfjfpxslist = ref(false);
-const scfjfpxsformData = reactive({
-  cpdh: '',
-});
-const scfjfpxstableData = ref([]);
-//质检废品系数【按钮】
-const onzjfpxsclick = () => {
-  if(_Gd_gdbh.value == null){
-    scfjfpxslist.value = false;
-    ElMessage({type: 'warning',message: '请选择具体的工单后,再操作此功能'});
-  }else{
-    scfjfpxsformData['cpdh'] = _Gd_gdbh.value;
-    _TestCoefficient();
-    scfjfpxslist.value = true;
-  }
-};
-
-const cp_gdprintonClick = () => {
-  printPageRef.value.open(_Gd_gdbh.value)
-}
-
-//质检废品系数【回车】
-const scfjfpxsgetProductValue = () => {
-  if(scfjfpxsformData['cpdh'] === ''){
-    scfjfpxstableData.value = [];
-    ElMessage({type: 'warning',message: '输入框为空'});
-    return false;
-  }
-  _TestCoefficient();
-};
-//修正工单核算参数->数据获取
-const _TestCoefficient = async ()=>{
-  let workOrder = scfjfpxsformData['cpdh'];
-  try {
-    const TestCoefficientdata = await TestCoefficient({workOrder:workOrder});
-    scfjfpxstableData.value = TestCoefficientdata.data;
-    const formattedData = TestCoefficientdata.data.map(item=>{
-      item.scfjfpxsold_人工正品板 = item.人工正品板;
-      item.scfjfpxsold_人工次品板 = item.人工次品板;
-      item.scfjfpxsold_人工废检 = item.人工废检;
-      item.scfjfpxsold_机检正品板 = item.机检正品板;
-      item.scfjfpxsold_机检次品板 = item.机检次品板;
-      item.scfjfpxsold_机检废检 = item.机检废检;
-      return item
-    });
-  } catch (error) {
-    console.error(error);
-  }
-}
-
-//质检废品系数【更新】
-const scfjfpxsConfirm = async () => {
-  const rawValueArray = scfjfpxstableData._rawValue;
-  const formattedData = rawValueArray.map(item => {
-    return {
-      UniqID: item.Uniqid,
-      artificial_zp: item.人工正品板 !== null ? item.人工正品板 : "",
-      artificial_cp: item.人工次品板 !== null ? item.人工次品板 : "",
-      artificial_fj: item.人工废检 !== null ? item.人工废检 : "",
-      machine_zp: item.机检正品板 !== null ? item.机检正品板 : "",
-      machine_cp: item.机检次品板 !== null ? item.机检次品板 : "",
-      machine_fj: item.机检废检 !== null ? item.机检废检 : ""
-    }
-  });
-  const editGyWastes = await editGyWaste(formattedData);
-  if (editGyWastes.code === 0) {
-    scfjfpxslist.value = false;
-    ElMessage({type: 'success',message: '更新成功'})
-  } else {
-    ElMessage({type: 'error',message: '更新失败'})
-  }
-};
-
-//质检废品系数【退出】
-const scfjfpxsCancel = () => {
-  scfjfpxslist.value = false;
-};
-
-//=========工序产量核查===========
-const gd_gxclhclist = ref(false);
-const gxclhc_Data = ref([]);
-const gxclhc_Columns = ref(
-    [
-      { label: '印件及工序名称', prop: 'concatenatedData', width: '380' },
-      // { label: '印件', prop: 'Gy0_yjno', width: '130' },
-      // { label: '工序', prop: 'Gy0_gxh', width: '130' },
-      // { label: '名称', prop: 'Gy0_gxmc', width: '130' },
-      { label: '工序计划产量', prop: 'Gy0_计划接货数', width: '120' },
-      { label: '联数', prop: 'Gy0_ls', width: '70' },
-      { label: '折算车头产量', prop: '折算车头产量', width: '120' },
-      { label: '实际上报产量', prop: 'sczl_cl', width: '120' },
-      { label: '制程废品', prop: 'sczl_zcfp', width: '120' },
-      { label: '制程废品率', prop: '制程废品率', width: '120' },
-      { label: '来料异常', prop: '来料异常', width: '90' },
-      { label: '流程单数', prop: 'process_num', width: '90' },
-      { label: '当前设备', prop: 'Gy0_sbbh', width: '120' },
-      { label: '工序状态', prop: 'PD_WG', width: '90'},
-      { label: '首板生产日期', prop: 'sczl_rq', width: '160' },
-    ]
-)
-const gxclhcformData = reactive({
-  gdbh: '',
-  gdmc: '',
-});
-// 工序产量核查按钮
-const gd_gxclhconClick = async () => {
-  if(_Gd_gdbh.value === '' || _Gd_gdbh.value === null){
-    ElMessage({type: 'warning',message: '请选择具体的工单,在进行操作'})
-    return false;
-  }
-  gxclhcformData['gdbh'] = _Gd_gdbh.value;
-  gd_gxclhclist.value = true;
-  _getOrderProcessCount();
-};
-//工序产量核查回车
-const gxclhcProductValue = async () => {
-  _getOrderProcessCount();
-}
-//工序产量核查退出
-const gxclhcCancel = async () => {
-  gd_gxclhclist.value = false;
-};
-//工序产量核查方法接口
-const _getOrderProcessCount = async () => {
-  const order = gxclhcformData['gdbh'];
-  const getOrderProcessCount_list = await getOrderProcessCount({order:order});
-  const concatenatedData = getOrderProcessCount_list.data.map(item => {
-    // 优化后的代码,使用模板字符串连接字段值并在单个数字前添加零
-    const formattedYjno = item.Gy0_yjno.length === 1 ? `0${item.Gy0_yjno}` : item.Gy0_yjno;
-    const formattedGxh = item.Gy0_gxh.length === 1 ? `0${item.Gy0_gxh}` : item.Gy0_gxh;
-    const concatenatedValue = `${formattedYjno}-${formattedGxh} ${item.Gy0_gxmc} 【${item.Add_gxmc} 】`;
-    return {
-      ...item,
-      concatenatedData: concatenatedValue, // 使用新属性名
-    };
-  });
-  gxclhc_Data.value = concatenatedData;
-};
-
-//工序产量核查
-const gxclhcCellClass = ({row, column, rowIndex, columnIndex}) =>{
-  if (column.label === '实际上报产量' ||column.label === '制程废品'  || column.label === '制程废品率' ||
-      column.label === '来料异常' || column.label === '流程单数' || column.label === '当前设备') {
-    return 'lan-plan-usage-lows';
-  }
-  if (column.label === '折算车头产量') {
-    return 'gxclhc—color-column-red';
-  }
-  // 如果不是 'PD_WG' 列,返回空字符串或其他样式类
-  if (column.label === '工序状态'){
-    if(row['PD_WG'] === '完工'){
-      return 'lan-plan-usage-lowshui';
-    }else{
-      return 'pczccolor-column-lan';
-    }
-  }
-}
-
-// =========== 流程单查询 ===========
-const gd_lcdlist = ref(false);
-const gd_lcdformData = reactive({
-  gdbh: '',
-  code: '',
-  name: '',
-});
-// 流程单查询按钮
-const processList = ref([]);
-const gdlcdcxconlick = async () => {
-  if(_Gd_gdbh.value === '' || _Gd_gdbh.value === null){
-    ElMessage({type: 'warning',message: '请选择具体的工单,在进行操作'})
-    return false;
-  }else{
-    gd_lcdformData['gdbh'] = _Gd_gdbh.value;
-    _getOrderProcessLeft_list();
-    gd_lcdlist.value = true;
-    processList.value = []
-  }
-}
-//流程单查询回车
-const gd_lcdProductValue = async () => {
-  if(gd_lcdformData['gdbh'] == '' || gd_lcdformData['gdbh'] === null){
-    ElMessage({type: 'warning',message: '工单编号为空'})
-    return false;
-  }
-  _getOrderProcessLeft_list();
-}
-const lcd_treeData = ref([]);
-const _getOrderProcessLeft_list = async () => {
-  const order = gd_lcdformData['gdbh'];
-  try {
-    //5.1流程单查询-工单工序生产进程菜单栏
-    const getOrderProcessLeft_list = await getOrderProcessLeft({ order:order});
-    // console.log(getOrderProcessLeft_list)
-    if(getOrderProcessLeft_list.data.Gd_info === null || getOrderProcessLeft_list.data.Gd_info === ''){
-      ElMessage({type: 'warning',message: '未查询到具体工单信息'})
-      lcd_treeData.value = [];
-      return false;
-    }
-    gd_lcdformData['code'] = getOrderProcessLeft_list.data.Gd_info['code'];
-    gd_lcdformData['name'] = getOrderProcessLeft_list.data.Gd_info['name'];
-    lcd_treeData.value = [{
-      label: order + '-' + getOrderProcessLeft_list.data.Gd_info['name'],
-      // label: getOrderProcessLeft_list.data.Gd_info['code'] + '-' + getOrderProcessLeft_list.data.Gd_info['name'],
-      value: undefined,
-      children: []
-    }]
-    const newData = [];
-    for (let key in getOrderProcessLeft_list.data.Gy_info) {
-      let temp = getOrderProcessLeft_list.data.Gy_info[key];
-      let concatenatedValue = `${temp.Gy0_yjno}-${temp.Gy0_gxh} ---> ${temp.Gy0_gxmc}`;
-      newData.push({ label: concatenatedValue,value: temp.Gy0_gxh });
-    }
-    lcd_treeData.value[0].children = newData;
-    //5.2流程单查询-获取工单工序生产进程右侧【接口】【进入页面默认显示第一个数据】
-    const getOrderProcessRight_list = await getOrderProcessRight({order: order, gxNo:newData[0].value});
-    processList.value = getOrderProcessRight_list.data
-  } catch (error) {
-    console.error(error);
-  }
-};
 //点击左侧获取工序显示右侧数据
 const lcd_handleNodeClick = async (node) => {
   if (node.value === undefined || node.value === null){
@@ -1913,12 +1471,22 @@ console.log(tabledate2.value);
   }
   }
 //导出按钮(汇总)
-const exportToExcel = () => {
-  if (tabledate2.value){
-  const el = document.getElementById('tab');
+const exportToExcel = async () => {
+  const data =  await MachineOperation({mouth:params.value.mouth})
+  const data2 = data.data
+  const de = Object.values(data2)
+  const worksheet = XLSX.utils.json_to_sheet(de);
+  const workbook = XLSX.utils.book_new();
+  XLSX.utils.book_append_sheet(workbook, worksheet, 'Sheet1');
+  XLSX.writeFile(workbook, '设备数据.xlsx');
+    }
+//月度明细
+const exportToExcel2 = () => {
+  if (jqtabledata.value){
+  const el = document.getElementById('tab2');
   console.log(el);
   // 文件名
-  const filename = '导出到EXCEL(汇总).xlsx';
+  const filename = '月度明细.xlsx';
   const wb = XLSX.utils.table_to_book(el, { raw: true });
   const wbout = XLSX.write(wb, { bookType: 'xlsx', bookSST: true, type: 'array' });
   try {
@@ -1929,13 +1497,11 @@ const exportToExcel = () => {
   return wbout;
 }
     }
-//月度明细
-const exportToExcel2 = () => {
-  if (jqtabledata.value){
-  const el = document.getElementById('tab2');
-  console.log(el);
+//导出到EXCEL(明细)
+const exportToExcel3 = ()=>{
+  const el = document.getElementById('tab');
   // 文件名
-  const filename = '月度明细.xlsx';
+  const filename = '导出到EXCEL(汇总).xlsx';
   const wb = XLSX.utils.table_to_book(el, { raw: true });
   const wbout = XLSX.write(wb, { bookType: 'xlsx', bookSST: true, type: 'array' });
   try {
@@ -1945,7 +1511,6 @@ const exportToExcel2 = () => {
   }
   return wbout;
 }
-    }
 
 //查询
 const searchInfo = ref('')

+ 43 - 387
src/view/DecisionSupport/outputsum/index.vue

@@ -6,11 +6,8 @@
           <!--          按钮部分-->
           <el-form ref="elSearchFormRef"   class="demo-form-inline" :rules="searchRule" @keyup.enter="onSubmit">
             <el-form-item>
-
-
-              <el-button disabled type="primary" icon="Download" @click="exportToExcel" style="margin: 5px;float: right;">导出到Excel</el-button>
-              <el-dialog v-model="dialogexportToExcel" disabled title="员工基本资料导出" width="50%">
-              </el-dialog>
+              <el-button  type="primary" icon="Download" @click="exportToExcel3" style="margin: 5px;float: right;">导出到Excel(明细)</el-button>
+              <el-button  type="primary" icon="Download" @click="exportToExcel2" style="margin: 5px;float: right;">月度明细</el-button>
             </el-form-item>
           </el-form>
         </div>
@@ -32,10 +29,11 @@
             <div class="gva-table-box">
               <el-table ref="multipleTable"
                         style="width: 100%;height: 28vh"
+                        id="tab"
+                        border
                         :row-style="{ height: '20px' }"
                         :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
                         :header-cell-style="{ padding: '0px' }"
-                        border
                         tooltip-effect="dark"
                         :data="tabledate2" row-key="ID"
                         @row-click="tableRowClick"
@@ -44,12 +42,13 @@
                         @row-dblclick="updateCompanyFunc"
                         @selection-change="handleSelectionChange"
                         :show-overflow-tooltip="true">
-                <el-table-column align="center" type="selection" width="30"/>
+                        <!-- 多选框 -->
+                        <!-- <el-table-column type="selection" width="30" /> -->
                 <el-table-column align="left" label="设备编号"   prop="sczl_jtbh"  width="81" />
                 <el-table-column align="left" sortable label="班组编号"   prop="sczl_bzdh" width="110" />
                 <el-table-column align="left" sortable label="产量合计"   prop="total_cl" width="110" />
 
-                <el-table-column :label="item" align="center" v-for="item in datelist" :key="item.label" :prop= "item" >
+                <el-table-column :label="item.slice(5,10)" align="center" v-for="item in datelist" :key="item.label" :prop= "item" >
                 </el-table-column>
 
               </el-table>
@@ -69,6 +68,7 @@
             <!-- 月度设备运行统计->机台生产工单数据详情列表  -->
             <el-tabs v-model="activeName" @tab-click="handleClick">
                 <el-table ref="multipleTable"
+                          id="tab2"
                           :row-style="{ height: '20px' }"
                           :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
                           :header-cell-style="{ padding: '0px' }"
@@ -76,7 +76,8 @@
                           highlight-current-row="true"
                           @selection-change="selectionChange($event, '印件资料')"
                           style="width: 100%;height: 36vh" border tooltip-effect="dark" :data="jqtabledata" row-key="ID">
-                  <el-table-column type="selection" width="30" />
+                          <!-- 多选框 -->
+                  <!-- <el-table-column type="selection" width="30" /> -->
                   <el-table-column align="left" sortable label="工单编号" prop="工单编号"  width="110"/>
                   <el-table-column align="left" sortable label="印件名称" prop="印件名称"  width="600"/>
                   <el-table-column align="left" sortable label="工序名称" prop="工序名称"  width="110"/>
@@ -123,23 +124,12 @@ export default {
 // 全量引入格式化工具 请按需保留
 import $script from 'scriptjs'
 import $ from 'jquery';
+import * as XLSX from 'xlsx'
+import FileSaver from 'file-saver'
 import LuckyExcel from 'luckyexcel';
 import { Layout, LayoutSider, LayoutContent } from '@arco-design/web-vue';
 import { ElMessage, ElMessageBox } from 'element-plus'
-import { ref, reactive, computed, nextTick, watch } from 'vue'
-// import {
-//   DataList,WorkList, gdzl_MachineList,PrintCodeList,getProductYjList, getProductZzList,
-//   U8workOrder, ProcessDetailEdit, PrintedEdit, PrintJobOrder,WorkOrderAdd,PrintDetailAdd,
-//   WorkOrderEdit, ReferenceWorkOrder,getOrderProcessLeft,ClientList,ProductCodeList,
-//   editGyWaste, U8DataCorrection, AccountingParameterEdit,ProcessCopy,
-//   ProductInformation, TestCoefficient, capacityList,getOrderProcessRight,
-//   DataCorrection, U8Trial, ProcessFlow, AccountingParameter,setProductStatus,
-//   getProduct, getProductGy, ProductInformationEdit, workOrderListDetail, editProduct, getOrderProcessCount, StatusEdit,
-//   PrintDetailDel, ProcessDetailDel,WorkOrderDetailCope,
-//   getGdAnnexTable,WorkOrderData,WorkOrderDel,
-//   gdAnnexAdd,ProductCopeDetail,WorkOrderDetailListCope,
-//   gdAnnexDel,getLossCode,getDepartName,WastageList,getCouplet,PrintDetailList
-// } from "@/api/yunyin/yunying";
+import { ref, reactive, computed, nextTick, watch,onMounted } from 'vue'
 import {OutputSstatisticsMenu,MachineProductDetail,MachineProduction} from "@/api/DecisionSupport/decision.js"
 defineOptions({name: 'Company'})
 import { useUserStore } from '@/pinia/modules/user'
@@ -148,259 +138,42 @@ const _username = ref('')
 _username.value = userStore.userInfo.userName + '/' + userStore.userInfo.nickName
 const printPageRef = ref()
 const addGongYiRef = ref()
-// =========== 修正核算参数 ===========
-const xzhstableColumns = ref(
-    [
-      { label: '方案', prop: '方案', width: '65' },
-      { label: '印件号及工序名称', prop: '印件号及工序名称', width: '300' },
-      { label: '参照设备', prop: '参照设备', width: '90' },
-      { label: '难度系数', prop: 'sxzhscsold_难度系数', width: '90' },
-      { label: '新难度系数', prop: '难度系数', width: '100' },
-      { label: '原损耗代号', prop: 'sxzhscsold_损耗代号', width: '150' },
-      { label: '基础损耗', prop: '基础损耗', width: '90' },
-      { label: '新损耗代号', prop: '损耗代号', width: '150' },
-      { label: '原印刷方式', prop: 'sxzhscsold_印刷方式', width: '150' },
-      { label: '原来版距', prop: 'sxzhscsold_版距', width: '100' },
-      { label: '新印刷方式', prop: '印刷方式', width: '100' },
-      { label: '新来版距', prop: '版距', width: '90' },
-      { label: '原计损色数', prop: 'sxzhscsold_计损色数', width: '100' },
-      { label: '新计损色数', prop: '计损色数', width: '100' },
-      { label: '原损耗系数', prop: 'sxzhscsold_损耗系数', width: '100' },
-      { label: '新损耗系数', prop: '损耗系数', width: '100' },
-    ]
-)
-const handleKeyDown = (event, x, y, prop) => {
-  const currentElement = document.getElementById(`input${x}${y}`);
-  if (currentElement === null && currentElement === undefined) return
-  let move = 0
-  switch (event.keyCode) {
-    case 13: // Enter
-    case 40: // 向下箭头
-      if (y < sxzhscstableData.value.length )
-        document.getElementById(`input${x}${y + 1}`).focus();
-      break;
-    case 38: // 向上箭头
-      if ( y > 0) {
-        document.getElementById(`input${x}${y - 1}`).focus();
-      }
-      break;
-    case 39: // 向左箭头
-      if ( x === 4) {
-        move = x + 3
-      } else if(x === 7){
-        move = x + 3
-      } else if( x === 10){
-        move = x + 1
-      }else if( x === 11){
-        move = x + 2
-      }else if( x === 13){
-        move = x + 2
-      }
-      document.getElementById(`input${move}${y}`).focus();
-      break;
-    case 37: // 向右箭头
-      if ( x === 15) {
-        move = x -  2
-      } else if (x=== 13) {
-        move = x - 2
-      }else if (x=== 11) {
-        move = x - 1
-      }else if (x=== 10) {
-        move = x - 3
-      }else if (x=== 7) {
-        move = x - 3
-      }
-      document.getElementById(`input${move}${y}`).focus();
-      break;
-    default:
-      break;
-  }
-}
-const xzhscslist = ref(false);
-const xzhscsformData = reactive({
-  gdbh: '',
-  cpdh: '',
-  gdmc: '',
-});
-const sxzhscstableData = ref([]);
-//修正核算参数按钮
-const onxzhscsclick = () => {
-  if(_Gd_gdbh.value == null){
-    xzhscslist.value = false;
-    ElMessage({type: 'warning',message: '请选择具体的工单后,再操作此功能' })
-  }else{
-    xzhscsformData['gdbh'] = _Gd_gdbh.value;
-    xzhscsformData['cpdh'] = _Gd_cpdh.value;
-    xzhscsformData['gdmc'] = _Gd_cpmc.value;
-    _AccountingParameterdata();
-    xzhscslist.value = true;
-  }
-};
-//修正核算参数回车
-const xzhscsgetProductValue = () => {
-  _AccountingParameterdata()
-};
-// 修正工单核算参数表格数据
-const _AccountingParameterdata = async ()=>{
-  let workOrder = xzhscsformData['gdbh'];
-  console.log(workOrder)
+onMounted(()=>{
+ 		})
+//导出到EXCEL(明细)
+const exportToExcel3 = ()=>{
+  const el = document.getElementById('tab');
+  // 文件名
+  const filename = '导出到EXCEL(汇总).xlsx';
+  const wb = XLSX.utils.table_to_book(el, { raw: true });
+  const wbout = XLSX.write(wb, { bookType: 'xlsx', bookSST: true, type: 'array' });
   try {
-    const AccountingParameterdata = await AccountingParameter({workOrder:workOrder});
-    console.log(AccountingParameterdata);
-    sxzhscstableData.value = AccountingParameterdata.data;
-    const formattedData = AccountingParameterdata.data.map(item=>{
-      item.sxzhscsold_难度系数 = item.难度系数;
-      item.sxzhscsold_损耗代号 = item.损耗代号;
-      item.sxzhscsold_印刷方式 = item.印刷方式;
-      item.sxzhscsold_版距 = item.版距;
-      item.sxzhscsold_计损色数 = item.计损色数;
-      item.sxzhscsold_损耗系数 = item.损耗系数;
-      return item
-    });
-  } catch (error) {
-    console.error(error);
-  }
-}
-//修正核算参数更新
-const xzhscsConfirm = async () => {
-  const firstCharValid = sxzhscstableData.value.map(item => {
-    const firstChar = item["损耗代号"] ? item["损耗代号"].charAt(0) : '';
-    return firstChar === '0' || firstChar === '';
-  });
-  if(firstCharValid.includes(false)){
-    ElMessage({type: 'warning',message: '损耗代号开头必须是 0' })
-    return false;
-  }
-  if (sxzhscstableData.value) {
-    const formattedData = sxzhscstableData.value.map(item => {
-      return {
-        Uniqid: parseInt(item.UniqId),
-        chromatic: parseFloat(item.计损色数) ?? '',
-        difficulty: parseFloat(item.难度系数) ?? '',
-        loss: item.损耗代号 ??'',
-        plate: parseInt(item.版距) ?? '',
-        printMode: item.印刷方式 ?? '',
-        wastage: parseFloat(item.损耗系数),
-      }
-    });
-    const AccountingParameterEditdata = await AccountingParameterEdit(formattedData);
-    if (AccountingParameterEditdata.code === 0) {
-      xzhscslist.value = false;
-      ElMessage({ type: 'success', message: '更新成功' });
-    } else {
-      ElMessage({ type: 'error', message: '更新失败' });
-    }
-  } else {
-    console.error("数据错误");
-  }
-};
-//修正核算参数退出
-const sxzhscsCancel = () => {
-  xzhscslist.value = false;
-};
-
-// =========== 质检废品系数 ===========
-const zjfpxs_tableColumns = ref(
-    [
-      { label: '产品编号', prop: '产品编号', width: '95' },
-      { label: '产品名称', prop: '产品名称', width: '200' },
-      { label: '印件工序及工艺', prop: '印件工序及工艺', width: '220' },
-      { label: '新人工正品板', prop: 'scfjfpxsold_人工正品板', width: '110' },
-      { label: '新人工次品板', prop: 'scfjfpxsold_人工次品板', width: '110' },
-      { label: '新人工废检', prop: 'scfjfpxsold_人工废检', width: '110' },
-      { label: '新机检正品板', prop: 'scfjfpxsold_机检正品板', width: '110' },
-      { label: '新机检次品板', prop: 'scfjfpxsold_机检次品板', width: '110' },
-      { label: '新机检废检', prop: 'scfjfpxsold_机检废检', width: '110' },
-      { label: '人工正品板', prop: '人工正品板', width: '110' },
-      { label: '人工次品板', prop: '人工次品板', width: '110' },
-      { label: '人工废检', prop: '人工废检', width: '110' },
-      { label: '机检正品板', prop: '机检正品板', width: '110' },
-      { label: '机检次品板', prop: '机检次品板', width: '110' },
-      { label: '机检废检', prop: '机检废检', width: '110' },
-      { label: '设备编号', prop: '设备编号', width: '100' },
-      { label: '客户名称', prop: '客户名称', width: '200' },
-    ]
-)
-const zjfpxs_handleKeyDown = (event, x, y, prop) => {
-  const currentElement = document.getElementById(`input${x}${y}`);
-  if (currentElement === null && currentElement === undefined) return
-  let move = 0
-  switch (event.keyCode) {
-    case 13: // Enter
-    case 40: // 向下箭头
-      if (y < scfjfpxstableData.value.length )
-        document.getElementById(`input${x}${y + 1}`).focus();
-      break;
-    case 38: // 向上箭头
-      if ( y > 0) {
-        document.getElementById(`input${x}${y - 1}`).focus();
-      }
-      break;
-    case 39: // 向左箭头
-      if (x >= 9 && x <=14) {
-        move = x + 1
-      }
-      document.getElementById(`input${move}${y}`).focus();
-      break;
-    case 37: // 向右箭头
-      if (x >= 9 && x <=14) {
-        move = x - 1
-      }
-      document.getElementById(`input${move}${y}`).focus();
-      break;
-    default:
-      break;
+    FileSaver.saveAs(new Blob([wbout], { type: 'application/octet-stream' }), filename);
+  } catch (e) {
+    console.log(e);
+  }
+  return wbout;
+}
+//导出到EXCEL(明细)
+const exportToExcel2 = ()=>{
+  const el = document.getElementById('tab2');
+  // 文件名
+  const filename = '导出到EXCEL(明细).xlsx';
+  const wb = XLSX.utils.table_to_book(el, { raw: true });
+  const wbout = XLSX.write(wb, { bookType: 'xlsx', bookSST: true, type: 'array' });
+  try {
+    FileSaver.saveAs(new Blob([wbout], { type: 'application/octet-stream' }), filename);
+  } catch (e) {
+    console.log(e);
   }
+  return wbout;
 }
 const scfjfpxslist = ref(false);
 const scfjfpxsformData = reactive({
   cpdh: '',
 });
 const scfjfpxstableData = ref([]);
-//质检废品系数【按钮】
-const onzjfpxsclick = () => {
-  if(_Gd_gdbh.value == null){
-    scfjfpxslist.value = false;
-    ElMessage({type: 'warning',message: '请选择具体的工单后,再操作此功能'});
-  }else{
-    scfjfpxsformData['cpdh'] = _Gd_gdbh.value;
-    _TestCoefficient();
-    scfjfpxslist.value = true;
-  }
-};
 
-const cp_gdprintonClick = () => {
-  printPageRef.value.open(_Gd_gdbh.value)
-}
-
-//质检废品系数【回车】
-const scfjfpxsgetProductValue = () => {
-  if(scfjfpxsformData['cpdh'] === ''){
-    scfjfpxstableData.value = [];
-    ElMessage({type: 'warning',message: '输入框为空'});
-    return false;
-  }
-  _TestCoefficient();
-};
-//修正工单核算参数->数据获取
-const _TestCoefficient = async ()=>{
-  let workOrder = scfjfpxsformData['cpdh'];
-  try {
-    const TestCoefficientdata = await TestCoefficient({workOrder:workOrder});
-    scfjfpxstableData.value = TestCoefficientdata.data;
-    const formattedData = TestCoefficientdata.data.map(item=>{
-      item.scfjfpxsold_人工正品板 = item.人工正品板;
-      item.scfjfpxsold_人工次品板 = item.人工次品板;
-      item.scfjfpxsold_人工废检 = item.人工废检;
-      item.scfjfpxsold_机检正品板 = item.机检正品板;
-      item.scfjfpxsold_机检次品板 = item.机检次品板;
-      item.scfjfpxsold_机检废检 = item.机检废检;
-      return item
-    });
-  } catch (error) {
-    console.error(error);
-  }
-}
 
 //质检废品系数【更新】
 const scfjfpxsConfirm = async () => {
@@ -433,47 +206,6 @@ const scfjfpxsCancel = () => {
 //=========工序产量核查===========
 const gd_gxclhclist = ref(false);
 const gxclhc_Data = ref([]);
-const gxclhc_Columns = ref(
-    [
-      { label: '印件及工序名称', prop: 'concatenatedData', width: '380' },
-      // { label: '印件', prop: 'Gy0_yjno', width: '130' },
-      // { label: '工序', prop: 'Gy0_gxh', width: '130' },
-      // { label: '名称', prop: 'Gy0_gxmc', width: '130' },
-      { label: '工序计划产量', prop: 'Gy0_计划接货数', width: '120' },
-      { label: '联数', prop: 'Gy0_ls', width: '70' },
-      { label: '折算车头产量', prop: '折算车头产量', width: '120' },
-      { label: '实际上报产量', prop: 'sczl_cl', width: '120' },
-      { label: '制程废品', prop: 'sczl_zcfp', width: '120' },
-      { label: '制程废品率', prop: '制程废品率', width: '120' },
-      { label: '来料异常', prop: '来料异常', width: '90' },
-      { label: '流程单数', prop: 'process_num', width: '90' },
-      { label: '当前设备', prop: 'Gy0_sbbh', width: '120' },
-      { label: '工序状态', prop: 'PD_WG', width: '90'},
-      { label: '首板生产日期', prop: 'sczl_rq', width: '160' },
-    ]
-)
-const gxclhcformData = reactive({
-  gdbh: '',
-  gdmc: '',
-});
-// 工序产量核查按钮
-const gd_gxclhconClick = async () => {
-  if(_Gd_gdbh.value === '' || _Gd_gdbh.value === null){
-    ElMessage({type: 'warning',message: '请选择具体的工单,在进行操作'})
-    return false;
-  }
-  gxclhcformData['gdbh'] = _Gd_gdbh.value;
-  gd_gxclhclist.value = true;
-  _getOrderProcessCount();
-};
-//工序产量核查回车
-const gxclhcProductValue = async () => {
-  _getOrderProcessCount();
-}
-//工序产量核查退出
-const gxclhcCancel = async () => {
-  gd_gxclhclist.value = false;
-};
 //工序产量核查方法接口
 const _getOrderProcessCount = async () => {
   const order = gxclhcformData['gdbh'];
@@ -652,73 +384,6 @@ const addgd_onclick = () => {
 const handleDoubleClick = async ()=>{
   console.log(123)
 }
-//新增工单资料确定
-const add_gdenterDialog = async ()=>{
-  console.log(add_gdscgdformData)
-  if(add_gdscgdformData['工单编号'] === ''){
-    ElMessage({type: 'warning',message: '工单编号为空'})
-    return false;
-  }
-  if(add_gdscgdformData['交货日期'] === ''){
-    ElMessage({type: 'warning',message: '交货日期为空'})
-    return false;
-  }
-  const startdeliveryDate = new Date(add_gdscgdformData['开单日期']);
-  const start = startdeliveryDate.getFullYear() + '-' +
-      (startdeliveryDate.getMonth() + 1).toString().padStart(2, '0') + '-' +
-      startdeliveryDate.getDate().toString().padStart(2, '0') + ' ' +
-      startdeliveryDate.getHours().toString().padStart(2, '0') + ':' +
-      startdeliveryDate.getMinutes().toString().padStart(2, '0') + ':' +
-      startdeliveryDate.getSeconds().toString().padStart(2, '0');
-
-  const deliveryDate = new Date(add_gdscgdformData['交货日期']);
-  const jhriqi = deliveryDate.getFullYear() + '-' +
-      (deliveryDate.getMonth() + 1).toString().padStart(2, '0') + '-' +
-      deliveryDate.getDate().toString().padStart(2, '0') + ' ' +
-      deliveryDate.getHours().toString().padStart(2, '0') + ':' +
-      deliveryDate.getMinutes().toString().padStart(2, '0') + ':' +
-      deliveryDate.getSeconds().toString().padStart(2, '0');
-  const formattedData = {
-    zdgd: add_gdscgdformData['重点工单'],
-    start: start,
-    gdbh: add_gdscgdformData['工单编号'],
-    sclx: add_gdscgdformData['生产类型'],
-    khdh: add_gdscgdformData['客户代号'],
-    khmc: add_gdscgdformData['客户名称'],
-    cpdh: add_gdscgdformData['产品代号'],
-    cpmc: add_gdscgdformData['产品名称'],
-    yjno: add_gdscgdformData['印件代号'],
-    yjmc: add_gdscgdformData['印件名称'],
-    number: add_gdscgdformData['订单数量'],
-    end: jhriqi,
-    tll: add_gdscgdformData['投料率'],
-    hgl: add_gdscgdformData['平均合格率'],
-    pztl: add_gdscgdformData['平张投料'],
-    wxz: add_gdscgdformData['万小张'],
-    tldw: add_gdscgdformData['单位'],
-    tldx: add_gdscgdformData['投料大箱'],
-    kcdx: add_gdscgdformData['库存大箱'],
-    xsddh: add_gdscgdformData['销售订单号'],
-    jybm: add_gdscgdformData['警语版面'],
-    bbh: add_gdscgdformData['版本号'],
-    erp: add_gdscgdformData['客户ERP编码'],
-    mysl: add_gdscgdformData['码源数量'],
-    jcbz: add_gdscgdformData['进程备注'],
-    remark: add_gdscgdformData['备注'],
-    Sys_id: _username.value,
-  };
-  const WorkOrderAdd_add = await WorkOrderAdd(formattedData);
-  if (WorkOrderAdd_add.code === 0) {
-    ElMessage({type: 'success',message: '添加成功'})
-  } else {
-    ElMessage({type: 'error',message: '添加失败'})
-  }
-  add_gddialogFormVisible.value = false
-}
-//新增工单资料取消
-const add_gdcloseDialog = () => {
-  add_gddialogFormVisible.value = false
-}
 //获取客户代号,客户名称
 const khdhModal = ref(false)
 const cpdhModal = ref(false)
@@ -727,14 +392,6 @@ const cpdhDataList = ref([])
 const khdh_keyword = ref('')
 const cpdh_keyword = ref('')
 
-//新增工单资料客户代号【回车】
-const khdh_ProductValue = async (v) => {
-  await _gClientList(khdh_keyword.value)
-};
-//新增工单资料产品代号【回车】
-const cpdh_ProductValue = async (v) => {
-  await _ProductCodeList(cpdh_keyword.value)
-};
 //新增工单->客户列表
 const _gClientList = async (v = '')=>{
   try {
@@ -1025,8 +682,6 @@ const add_gdyjenterDialog =  async  () => {
     ElMessage({type: 'error',message: '添加失败' })
   }
 }
-//印件新增取消
-const add_dyjcloseDialog = () => {add_gdyjdialogFormVisible.value = false}
 
 //印件新增【印件代码】树状图
 const handleTreeData = (treeData) => {
@@ -1884,8 +1539,10 @@ const handleNodeClick = async (node) => {
   const ProductList = async(params)=>{
   try {
     const ProductListData = await MachineProduction(params);
-    let data = ProductListData.data.total
     datelist.value = ProductListData.data.head
+
+    let data = ProductListData.data.total
+
     data.forEach(item => {
        item.forEach(element => {
         tabledate2.value.push(element)
@@ -1903,7 +1560,6 @@ const handleNodeClick = async (node) => {
     return item;  
 });  
   
-    console.log(tabledate2.value);
 
   } catch (error) {
     console.error(error);