zck 10 mesiacov pred
rodič
commit
2d7d8d4aec

+ 55 - 0
src/api/mes/job.js

@@ -498,6 +498,61 @@ export const PowerMachineDetail = (params) => {
   })
 }
 
+//设备维修保养记录->左侧菜单
+export const getMaintenanceTab = (params) => {
+  return service({
+    url: '/mes_server/Machine_List/getTab',
+    method: 'get',
+    params
+  })  
+}
+
+//设备维修保养记录->年度维修记录上方机台列表
+export const YearMaintenanceList = (params) => {
+  return service({
+    url: '/mes_server/Machine_List/YearMaintenanceList',
+    method: 'get',
+    params
+  })  
+}
+
+//设备维修保养记录->设备维修记录配件详情
+export const YearAccessoriesList = (params) => {
+  return service({
+    url: '/mes_server/Machine_List/YearAccessoriesList',
+    method: 'get',
+    params
+  })  
+}
+
+//设备维修保养记录->年度保养统计上方几台列表
+export const YearMaintainList = (params) => {
+  return service({
+    url: '/mes_server/Machine_List/YearMaintainList',
+    method: 'get',
+    params
+  })  
+}
+
+//设备维修保养记录->月度维修记录上方机台列表
+export const MonthAccessoriesList = (params) => {
+  return service({
+    url: '/mes_server/Machine_List/MonthAccessoriesList',
+    method: 'get',
+    params
+  })  
+}
+//设备维修保养记录->月度保养统计上方几台列表
+export const MouthMaintainList = (params) => {
+  return service({
+    url: '/mes_server/Machine_List/MouthMaintainList',
+    method: 'get',
+    params
+  })
+}
+
+
+
 
 /*
 	印版管理

+ 1 - 0
src/view/DecisionSupport/operation/operation.vue

@@ -80,6 +80,7 @@
                   <el-table-column align="left" sortable label="保养工时" prop="保养工时"  width="110"/>
                   <el-table-column align="left" sortable label="打样总工时" prop="打样总工时"  width="140"/>
                   <el-table-column align="left" sortable label="打样补产工时" prop="打样补产工时"  width="140"/>
+                  <el-table-column align="left" sortable label="装版总工时" prop="装板总工时"  width="140"/>
                   <el-table-column align="left" sortable label="装版补产工时" prop="装板补产工时"  width="160"/>
                   <el-table-column align="left" sortable label="异常停机工时" prop="异常停机工时"  width="160"/>
                   <el-table-column align="left" sortable label="墨色数" prop="墨色数"  width="160"/>

+ 234 - 36
src/view/equipment/maintenance.vue

@@ -7,7 +7,10 @@
             <el-form ref="elSearchFormRef"   class="demo-form-inline" :rules="searchRule" >
               <el-form-item>
                 <el-input v-model="searchInfo" placeholder="搜索工单编号" clearable style="width: 200px;margin: 5px"></el-input>
-                <el-button type="primary" class="bt" icon="download" @click="hzToExcel" >导出到Excel(汇总)</el-button>
+                <el-button type="primary" class="bt" icon="download" @click="search">维修工时统计</el-button>
+                <el-button type="primary" class="bt" icon="download" @click="hzToExcel" >设备运行时间统计</el-button>
+                <el-button type="primary" class="bt" icon="download" @click="hzToExcel" >导出到Excel</el-button>
+                <el-button type="primary" class="bt" icon="search" @click="search">搜索</el-button>
               </el-form-item>
             </el-form>
   
@@ -20,7 +23,7 @@
           <!--    左侧树侧形结构-->
           <layout-sider :resize-directions="['right']" :width="190" style="margin-right: 10px;">
             <div class="JKWTree-tree" style="height: 200px">
-              <h3>生产进程查询</h3>
+              <h3>设备维修保养记录</h3>
               <el-tree :data="treeData"  :props="defaultProps" @node-click="handleNodeClick" @node-expand="handleNodeExpand">
               </el-tree>
             </div>
@@ -31,38 +34,113 @@
           <el-main>
             <div class="gva-table-box">
               <!-- 表格数据 -->
-              <el-table ref="multipleTable" style="width: 100%;height: 75vh" tooltip-effect="dark"
-                        :row-style="{ height: '25px' }"  :header-cell-style="{ padding: '0px' }"
-                        :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
-                        :data="hztableData"  border row-key="ID"
-                        size="small"
-                        :cell-class-name="gxbgCellClass"
-                        highlight-current-row="true" @row-dblclick="updateCompanyFunc"
-                        @row-click="tableRowClick" :show-overflow-tooltip="true"
-                        @selection-change="handleSelectionChange">
-               <el-table-column  sortable align="center" label="工单编号" prop="工单编号"  width="120" />
-               <el-table-column  sortable align="center" label="领用日期" prop="领用日期"  width="130" />
-               <el-table-column   align="center" label="卷宽" prop="卷宽"  width="60" />
-               <el-table-column   align="center" label="卷长" prop="卷长"  width="70" />
-               <el-table-column   align="center" label="领用宽度" prop="领用宽度"  width="90" />
-               <el-table-column   align="center" label="领用数量" prop="领用数量"  width="90" />
-               <el-table-column   align="center" label="机台" prop="机台"  width="90" />
-               <el-table-column   align="center" label="采购单号" prop="采购单号"  width="110" />
-               <el-table-column   align="center" label="供方批次" prop="供方批次"  width="110" />
-               <el-table-column   align="center" label="物料代码" prop="物料代码"  width="140" />
-               <el-table-column   align="center" label="物料名称" prop="物料名称"  width="200" />
-               <el-table-column   align="center" label="备注" prop="备注"  width="110" />
-               <el-table-column   align="center" label="成品代号" prop="成品代号"  width="200" />
-               <el-table-column   align="center" label="成品名称" prop="成品名称"  width="200" />
-               <el-table-column   align="center" label="创建用户" prop="创建用户"  width="200" />
-               <el-table-column   align="center" label="创建时间" prop="创建时间"  width="200" />
-              </el-table>
-  
-              <!-- 分页 -->
-              <div class="gva-pagination">
-                <el-pagination layout="total" :current-page="page" :page-size="pageSize"
-                 :total="total" @current-change="handleCurrentChange" @size-change="handleSizeChange" />
-              </div>
+                <el-table ref="multipleTable"
+						v-if="isyear"
+						:show-overflow-tooltip="true"
+						@selection-change="selectionChange($event)"
+						:row-style="{ height: '20px' }" :selectable="checkboxT"
+						:cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
+						:header-cell-style="{ padding: '0px' }" @row-click="pchzRowClick"
+            :row-class-name="pchzrowClassStyle"
+						highlight-current-row="true" @row-dblclick="gytableDatadoubleClick"  id="pchztable"
+						style="width: 100%;height: 30vh" border tooltip-effect="dark" :data="yeartableData" row-key="ID" >
+            <el-table-column  sortable align="center" label="使用部门" prop="使用部门"  width="120" />
+               <el-table-column  sortable align="center" label="设备编号" prop="设备编号"  width="130" />
+               <el-table-column   align="center" label="设备名称" prop="设备名称"  width="60" />
+               <el-table-column  v-if="yearcode === 1" align="center" label="维修次数" prop="维修次数" width="70" />
+               <el-table-column  v-else-if="yearcode === 2" align="center" label="保养次数" prop="保养次数" width="70" />
+               <el-table-column   align="center" label="1月" prop="1月"  width="90" />
+               <el-table-column   align="center" label="2月" prop="2月"  width="90" />
+               <el-table-column   align="center" label="3月" prop="3月"  width="90" />
+               <el-table-column   align="center" label="4月" prop="4月"  width="110" />
+               <el-table-column   align="center" label="5月" prop="5月"  width="110" />
+               <el-table-column   align="center" label="6月" prop="6月"  width="140" />
+               <el-table-column   align="center" label="7月" prop="7月"  width="200" />
+               <el-table-column   align="center" label="8月" prop="8月"  width="110" />
+               <el-table-column   align="center" label="9月" prop="9月"  width="200" />
+               <el-table-column   align="center" label="10月" prop="10月"  width="200" />
+               <el-table-column   align="center" label="11月" prop="11月"  width="200" />
+               <el-table-column   align="center" label="12月" prop="12月"  width="200" />
+			  </el-table>
+			  
+			  <el-table ref="JPmultipleTable"
+						:show-overflow-tooltip="true"
+						@selection-change="selectionChange($event)"
+						:row-style="{ height: '20px' }" :row-class-name="totalClassName" :cell-class-name="tableDataCellClass"
+						:cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
+						:header-cell-style="{ padding: '0px' }" @row-click="getUid" 
+						highlight-current-row="true" @row-dblclick="JPgytableDatadoubleClick" id="pcmxtable"
+						style="width: 100%;height: 45vh" border tooltip-effect="dark" :data="pcmxtableData" row-key="ID" >
+					<el-table-column  align="left" fixed label="日期" prop="日期"  width="110"/>
+					  <el-table-column  align="left" fixed label="交易类别" prop="交易类别"  width="90"/>
+					<el-table-column  align="left" fixed label="领用部门" prop="领用部门"  width="70"/>
+					<el-table-column  align="left" label="机台编号" prop="机台编号"  width="90"/>
+					<el-table-column  align="left" label="仓库编号" prop="仓库编号"  width="70"/>
+					<el-table-column  align="left" label="仓库名称" prop="仓库名称"  width="120"/>
+					<el-table-column  align="left" label="物料编号"  prop="物料编号"  width="70"/>
+					<el-table-column  align="left" label="物料名称" prop="物料名称"  width="120"/>
+					<el-table-column  align="left" label="领用数量" prop="领用数量"  width="90"/>
+					<el-table-column  align="left" label="领用单位" prop="领用单位"  width="110"/>
+					<el-table-column  align="left" label="领用单价" prop="领用单价"  width="90"/>
+					<el-table-column  align="left" label="金额" prop="金额"  width="110"/>
+					<el-table-column  align="left" label="备注" prop="备注"  width="110"/>
+			  </el-table>
+
+
+              <el-table ref="multipleTable"
+						v-if="!isyear && iscode"
+						:show-overflow-tooltip="true"
+						@selection-change="selectionChange($event)"
+						:row-style="{ height: '20px' }" :selectable="checkboxT"
+						:cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
+						:header-cell-style="{ padding: '0px' }" @row-click="sbhzRowClick" 
+						highlight-current-row="true" @row-dblclick="gytableDatadoubleClick"  id="sbhztable"
+						style="width: 100%;height: 30vh" border tooltip-effect="dark" :data="sbhztableData" row-key="ID" >
+				<el-table-column fixed align="left" label="设备编号" prop="设备编号"  width="90"/>
+				<el-table-column fixed align="left" label="设备名称" prop="设备名称"  width="70"/>
+				<el-table-column align="left" label="报障时间" prop="报障时间"  width="85"/>
+				<el-table-column align="left" label="维修受理时间" prop="维修受理时间"  width="85"/>
+				<el-table-column align="left" label="修复时间"  prop="修复时间"  width="85"/>
+				<el-table-column align="left" label="故障维修工时" prop="故障维修工时"  width="85"/>
+				<el-table-column align="left" label="非故障微信工时" prop="非故障微信工时"  width="95"/>
+        <el-table-column align="left" label="计划维修工时" prop="计划维修工时"  width="110"/>
+        <el-table-column align="left" label="专项维修工时" prop="专项维修工时"  width="110"/>
+        <el-table-column align="left" label="验收情况" prop="验收情况"  width="110"/>
+        <el-table-column align="left" label="维修姓名1" prop="维修姓名1"  width="110"/>
+        <el-table-column align="left" label="故障现象" prop="故障现象"  width="110"/>
+        <el-table-column align="left" label="处理方法" prop="处理方法"  width="110"/>
+        <el-table-column align="left" label="使用部门" prop="使用部门"  width="110"/>
+        <el-table-column align="left" label="创建用户" prop="创建用户"  width="110"/>
+        <el-table-column align="left" label="创建时间" prop="创建时间"  width="110"/>
+        <el-table-column align="left" label="修改时间" prop="修改时间"  width="110"/>
+			  </el-table>
+			  
+			  <el-table ref="JPmultipleTable"
+            v-if="!isyear && !iscode"
+						:show-overflow-tooltip="true"
+						@selection-change="selectionChange($event)"
+						:row-style="{ height: '20px' }"  :cell-class-name="tableDataCellClass"
+						:cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
+						:header-cell-style="{ padding: '0px' }" @row-click="sbmxRowClick" 
+            :row-class-name="sbmxrowClassStyle"
+						highlight-current-row="true" @row-dblclick="JPgytableDatadoubleClick" id="sbmxtable"
+						style="width: 100%;height: 45vh" border tooltip-effect="dark" :data="sbmxtableData" row-key="ID" >
+            <el-table-column align="left" label="设备编号" prop="设备编号" width="100" />
+            <el-table-column align="left" label="设备名称" prop="设备名称" width="200" />
+            <el-table-column align="left" label="使用部门" prop="使用部门" width="100" />
+            <el-table-column align="left" label="保养日期" prop="保养日期" width="120" />
+            <el-table-column align="left" label="保养开始时间" prop="保养开始时间" width="120" />
+            <el-table-column align="left" label="保养结束时间" prop="保养结束时间" width="120" />
+            <el-table-column align="left" label="保养工时" prop="保养工时" width="100" />
+            <el-table-column align="left" label="执行机修" prop="执行机修" width="100" />
+            <el-table-column align="left" label="执行机长" prop="保养人员" width="100" />
+            <el-table-column align="left" label="保养备注" prop="保养备注" width="150" />
+            <el-table-column align="left" label="验收人员" prop="验收人员" width="100" />
+            <el-table-column align="left" label="验收备注" prop="验收备注" width="150" />
+            <el-table-column align="left" label="验收情况" prop="验收情况" width="100" />
+            <el-table-column align="left" label="创建用户" prop="创建用户" width="100" />
+            <el-table-column align="left" label="创建时间" prop="创建时间" width="150" />
+			  </el-table>
             </div>
 
 
@@ -81,16 +159,136 @@
   import {ref, reactive} from 'vue'
   import { exportExcelFile } from '@/utils/excel'
   import {ElMessage} from "element-plus";
+  import {getMaintenanceTab,YearMaintenanceList,YearAccessoriesList,YearMaintainList,MonthAccessoriesList,MouthMaintainList} from "@/api/mes/job.js"
+  
   defineOptions({name: 'Company'})
   // =========== 获取左侧树侧形结构 ===========
-  
+  const treeData = ref([])
 
+  const getTreeData = async () => {
+  try {
+    const res = await getMaintenanceTab();
+    
+    if (res.code === 0 && res.data) {
+      treeData.value = Object.entries(res.data).map(([label, childrenData]) => {
+        // 根据父节点label确定code值
+        let parentCode = '';
+        if (label.includes('年度维修统计')) {
+          parentCode = '年度维修';
+        } else if (label.includes('月度维修记录')) {
+          parentCode = '月度维修';
+        } else if (label.includes('年度保养统计')) {
+          parentCode = '年度保养';
+        } else if (label.includes('月度保养记录')) {
+          parentCode = '月度保养';
+        }
+
+        const children = [];
+        // 获取所有 keys
+        const keys = Object.keys(childrenData);
+        // 按时间降序排序
+        const sortedKeys = keys.sort((a, b) => b.localeCompare(a));
+        
+        sortedKeys.forEach(key => {
+          children.push({
+            label: key,
+            code: parentCode,
+            rq: key, 
+            children: childrenData[key].map(item => ({
+              label: item,
+              code: parentCode,
+              rq: key 
+            }))
+          });
+        });
+        
+        return {
+          label,
+          code: parentCode,
+          children
+        };
+      });
+    } else {
+      console.error('获取数据失败:', res.msg);
+      treeData.value = [];
+    }
+  } catch (error) {
+    console.error('请求出错:', error);
+    treeData.value = [];
+  }
+};
   
   
-
+getTreeData()
   
+const yearcode = ref(0)//判断年度维修or年度保养
+const isyear = ref(false)//判断年度
+const iscode = ref(false)//判断月度
+const wxmonthtableData = ref([]) // 月度维修
+const bymonthtableData = ref([]) // 月度保养
+const yeartableData = ref([]);
 
+// 定义不同 code 对应的处理函数
+const actionMap = {
+  '年度维修': async (nodeData) => {
+    console.log('获取年度维修数据:', nodeData.rq); // 比如 nodeData.rq = "2025"
+    try {
+      const res = await YearMaintenanceList({ sist: nodeData.label.split('(')[0], year: nodeData.rq });
+      isyear.value = true;
+      yearcode = 1;
+      yeartableData.value = res.data;
+    } catch (error) {
+      console.error('年度维修数据获取失败:', error);
+    } 
+  },
+  '月度维修': async (nodeData) => {
+    console.log('获取月度维修数据:', nodeData.rq); // 比如 nodeData.rq = "2024-12"
+    try {
+      const res = await MonthAccessoriesList({ sist: nodeData.label.split('(')[0], month: nodeData.rq });
+      isyear.value = false;
+      iscode.value = true;
+      wxmonthtableData.value = res.data;
+    } catch (error) {
+      console.error('月度维修数据获取失败:', error);
+    } 
+  },
+  '年度保养': async (nodeData) => {
+    console.log('获取年度保养数据:', nodeData.rq);
+    try {
+      const res = await YearMaintainList({ sist: nodeData.label.split('(')[0], year: nodeData.rq });
+      isyear.value = true;
+      yearcode = 2;
+      yeartableData.value = res.data;
+    } catch (error) {
+      console.error('年度保养数据获取失败:', error);
+    } 
+  },
+  '月度保养': async (nodeData) => {
+    console.log('获取月度保养数据:', nodeData.rq);
+    try {
+      const res = await MouthMaintainList({ sist: nodeData.label.split('(')[0], month: nodeData.rq });
+      isyear.value = false;
+      iscode.value = false;
+      bymonthtableData.value = res.data;
+    } catch (error) {
+      console.error('月度保养数据获取失败:', error);
+    } 
+  },
+};
+
+// 点击节点时的处理函数
+const handleNodeClick = async (nodeData) => {
+  console.log('当前点击节点:', nodeData);
   
+  if (!nodeData.children) { // 确保是叶子节点(如"检验车间(10台次)")
+    const action = actionMap[nodeData.code];
+    if (action) {
+      await action(nodeData); // 执行对应的函数,并传入 nodeData
+    } else {
+      console.warn('未知节点类型:', nodeData.code);
+    }
+  }
+};
 
   
 

+ 15 - 6
src/view/performance/09-workOrderVerification/index.vue

@@ -184,7 +184,7 @@
 						<template #footer>
 							<div class="dialog-footer">
 								<el-button @click="closeDialog">取 消</el-button>
-								<el-button type="primary" @click="enterDialog">确 定
+								<el-button type="primary" :loading="loading" @click="enterDialog">确 定
 								</el-button>
 							</div>
 						</template>
@@ -1247,12 +1247,21 @@ const ontuicclicks = async () => {
 	    }
 	};
 	// 弹窗确定
+	const loading = ref(false)
 	const enterDialog = async () => {
-		console.log(type.value)
-		if (type.value === '修改工单核验单维护') {
-			updateDetailData()
-		} else if (type.value === '新增工单核验单维护') {
-			addDetailData()
+		loading.value = true // 开始加载
+		try {
+			console.log(type.value)
+				if (type.value === '修改工单核验单维护') {
+					await updateDetailData()
+				} else if (type.value === '新增工单核验单维护') {
+					await addDetailData()
+				}
+
+			// 确保至少显示1秒加载状态
+				await new Promise(resolve => setTimeout(resolve, 500))
+			} finally {
+				loading.value = false // 结束加载
 		}
 	}
 	const addDetailData = async () => {

+ 13 - 13
src/view/performance/12-orderAccounting/index.vue

@@ -63,7 +63,7 @@
             <!--              <el-table-column type="selection" width="55" />-->
             <el-table-column align="left" sortable   label="车间" prop="cj"  width="150"/>
             <el-table-column align="left" sortable  label="员工编号" prop="bh" width="150" />
-            <!-- <el-table-column align="left" sortable  label="班组" prop="bz"  width="80"/> -->
+            <el-table-column align="left" sortable  label="班组" prop="bz"  width="80"/>
             <el-table-column align="left" sortable  label="员工姓名" prop="xm"  width="150"/>
             <el-table-column align="left" sortable  label="超节损金额" prop="je" width="150" >
             <template v-slot="{ row }">
@@ -511,23 +511,23 @@ getSideData()
 // 表格数据
 const tableCols1 = [
   // { label: '超损工单', prop: 'csgd', width: '110' ,sortable:'sortable'},
-  { label: '工单编号', prop: 'Gd_gdbh', width: '110',sortable:'sortable',fixed:'fixed',align:'left'},
-  { label: '参与考核', prop: '考核', width: '110' ,sortable:'sortable'},
+  { label: '工单编号', prop: 'Gd_gdbh', width: '110',fixed:'fixed',align:'left'},
+  { label: '参与考核', prop: '考核', width: '110' ,},
   { label: '印件号', prop: 'jjcp_yjno', width: '70'},
   { label: '联数', prop: 'yj_ls', width: '70'},
-  { label: '产品代号', prop: '成品编码', width: '110' ,sortable:'sortable'},
-  { label: '印件代号', prop: 'yjdh', width: '110' ,sortable:'sortable'},
-  { label: '产品名称', prop: '成品名称', width: '250' ,sortable:'sortable'},
+  { label: '产品代号', prop: '成品编码', width: '110' ,},
+  { label: '印件代号', prop: 'yjdh', width: '110' ,},
+  { label: '产品名称', prop: '成品名称', width: '250' ,},
   { label: '实际投料', prop: '实际投料', width: '90'},
   { label: '计量单位', prop: '计量单位', width: '85'},
-  { label: '入仓日期', prop: 'warehousing_date', width: '110' ,sortable:'sortable'},
+  { label: '入仓日期', prop: 'warehousing_date', width: '110' ,},
   { label: '入仓数量', prop: 'warehousing_num', width: '90'},
-  { label: '目标合格率', prop: 'target_rate', width: '120' ,sortable:'sortable'},
-  { label: '实际合格率', prop: 'real_rate', width: '120' ,sortable:'sortable'},
-  { label: '奖惩系数', prop: 'reward_rate', width: '110' ,sortable:'sortable'},
-  { label: '奖罚金额合计', prop: 'reward_money', width: '140',sortable:'sortable' },
-  { label: '废品合计', prop: '废品合计', width: '120' ,sortable:'sortable'},
-  { label: '工单无形损', prop: '工单无形损', width: '120',sortable:'sortable' },
+  { label: '目标合格率', prop: 'target_rate', width: '120' ,},
+  { label: '实际合格率', prop: 'real_rate', width: '120' ,},
+  { label: '奖惩系数', prop: 'reward_rate', width: '110' ,},
+  { label: '奖罚金额合计', prop: 'reward_money', width: '140', },
+  { label: '废品合计', prop: '废品合计', width: '120' ,},
+  { label: '工单无形损', prop: '工单无形损', width: '120', },
   { label: '材料废', prop: '材料废', width: '80' },
   { label: '零头处理', prop: '零头处理', width: '90'},
   { label: '处发废', prop: '外发废', width: '80' },

+ 10 - 5
src/view/yunyin/chanpinziliao/chanpinziliao.vue

@@ -3235,11 +3235,16 @@ const addcpgy_onclick =  async () => {
 		 isDisabled.value = true; // 禁用输入框
 	 }
 	 
-	if(_gyrow.value){
-		//3.6工艺资料-获取产品工艺资料
-		const getProductGyInfo_edit = await getProductGyInfo({UniqID:_gyrow.value.UniqID})
-		Object.assign(add_gyformData,getProductGyInfo_edit.data);
-	}
+   if (_gyrow.value) {
+  const getProductGyInfo_edit = await getProductGyInfo({ UniqID: _gyrow.value.UniqID });
+  Object.assign(add_gyformData, getProductGyInfo_edit.data);
+  
+  // 单独修改字段
+  add_gyformData.Gy0_方案 = 'A';
+  add_gyformData.Gy0_gxh = String(Number(add_gyformData.Gy0_gxh) + 1); // +1
+  add_gyformData.Gy0_site = '';  // 清空
+  add_gyformData.gy0_gxmc = '';  // 清空
+}
 	add_gyformData.Gy0_方案 = 'A';
 	//新增
 	typeGy.value = 'create'