zck 2 gün önce
ebeveyn
işleme
6aa1d92df3

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

@@ -1526,6 +1526,15 @@ export const workorderprocessCopy = (params) => {
   })
 }
 
+//工单工艺导入
+export const importProcess = (data) => {
+  return service({
+    url: '/mes_server/work_order_process/importProcess',
+    method: 'post',
+    data
+  })
+}
+
 //工单大工序列表
 export const MajorprocessList = (params) => {
   return service({
@@ -1625,6 +1634,14 @@ export const DeleteProcess = (params) => {
   })
 }
 
+//工单工艺排序
+export const sortProcess = (data) => {
+  return service({
+    url: '/mes_server/work_order_process/sortProcess',
+    method: 'post',
+    data
+  })
+}
 
 /*设备工分报工产量跟踪*/
 

+ 78 - 0
src/view/SalaryManage/SalaryList.vue

@@ -66,6 +66,7 @@
                 style="width: 100%; height: 72vh"
                 :row-style="{ height: '30px' }"
                 :header-row-style="{ height: '20px' }"
+                show-summary  :summary-method="getSummaries"
                 :header-cell-style="pivotHeaderCellStyle"
                 :cell-style="pivotCellStyle"
                 :show-overflow-tooltip="true"
@@ -112,6 +113,15 @@
                     >{{ row['day' + d] || '' }}</span>
                   </template>
                 </el-table-column>
+                <!-- 月计列 -->
+                <el-table-column
+                  label="月计"
+                  prop="月计"
+                  width="80"
+                  align="right"
+                  :header-cell-style="pivotHeaderCellStyle"
+                  :cell-style="pivotCellStyle"
+                />
                 <template #empty>
                   <el-empty
                     v-if="!listLoading"
@@ -164,6 +174,8 @@
           class="salary-detail-table"
           :height="SALARY_DETAIL_TABLE_FIXED_PX"
           style="width: 100%"
+          show-summary
+          :summary-method="getDetailSummaries"
         >
         <el-table-column label="订单编号" prop="订单编号" min-width="110" show-overflow-tooltip />
         <el-table-column label="日期" prop="日期" width="110" align="center" />
@@ -357,6 +369,8 @@ function buildPivotRows(list, monthYm) {
       rowKey: `pv-${i++}-${baseNo}`,
       员工编号: baseNo || '—',
       员工姓名: baseName || '—',
+      // 添加月计列,使用接口返回的total_salary数据
+      月计: item.total_salary ? Number(item.total_salary).toFixed(2) : '0.00'
     }
     for (let d = 1; d <= 31; d++) {
       const keyH = '_has' + d
@@ -598,6 +612,70 @@ function onDetailClosed() {
   detailContext.value = { staff_no: '', date: '', big_process: '' }
 }
 
+//总数量合计
+  const getSummaries = (param) => {  
+    const { columns, data } = param;  
+    const sums = {};  
+    const summableLabels = [...DAY_INDEXES.map(d => String(d)), "月计"];
+    columns.forEach((column, index) => {  
+        if (index === 1) {  
+            sums[index] = '总数量合计';  
+            return;  
+        }  
+        if (summableLabels.includes(column.label)) {  
+            const values = data.map(item => Number(item[column.property]));  
+            // 检查数组中是否所有值都是 NaN  
+            if (!values.every(value => isNaN(value))) {  
+                sums[index] = values.reduce((prev, curr) => {  
+                    const value = Number(curr);  
+                    if (!isNaN(value)) {  
+                        return prev + value; 
+                    }  
+                    return prev;  
+                }, 0);  
+                // 格式化合计值为两位小数
+                sums[index] = sums[index].toFixed(2);
+            } else {  
+                 sums[index] = '';  
+            }  
+        }  
+    });  
+    return sums;  
+};  
+
+//工资明细合计
+const getDetailSummaries = (param) => {
+  const { columns, data } = param;
+  const sums = {};
+  const summableProps = ['工资', '数量', '生产工时', '生产分数'];
+  
+  columns.forEach((column, index) => {
+    if (index === 0) {
+      sums[index] = '合计';
+      return;
+    }
+    
+    if (summableProps.includes(column.label)) {
+      const values = data.map(item => Number(item[column.property]));
+      if (!values.every(value => isNaN(value))) {
+        sums[index] = values.reduce((prev, curr) => {
+          const value = Number(curr);
+          if (!isNaN(value)) {
+            return prev + value;
+          }
+          return prev;
+        }, 0);
+        // 格式化合计值为两位小数
+        sums[index] = sums[index].toFixed(2);
+      } else {
+        sums[index] = '';
+      }
+    }
+  });
+  
+  return sums;
+};
+
 onMounted(() => {
   loadLeftMenu()
 })

+ 16 - 4
src/view/performance/WorkScoreReporting/gongfenbaogong.vue

@@ -721,6 +721,7 @@ let draggedEmployee = null;
 // 开始拖拽
 const onDragStart = (event, employee) => {
   draggedEmployee = employee;
+  console.log('拖拽的员工:', employee);
   event.dataTransfer.effectAllowed = 'copy';
 };
 
@@ -738,15 +739,18 @@ const onDrop = (event, partIndex, processIndex, staffIndex = null) => {
     if (staffIndex !== null && reportingDataItem.staffList) {
       // 拖拽到已有人员列表中的某个位置
       reportingDataItem.staffList[staffIndex].staff_name = draggedEmployee.员工姓名;
+      reportingDataItem.staffList[staffIndex].staff_no = draggedEmployee.员工编号;
     } else if (reportingDataItem.staffList) {
       // 拖拽到人员列表区域,添加新人员
       reportingDataItem.staffList.push({
         staff_name: draggedEmployee.员工姓名,
+        staff_no: draggedEmployee.员工编号,
         number: ''
       });
     } else {
       // 拖拽到单个人员输入框
       reportingDataItem.staff_name = draggedEmployee.员工姓名;
+      reportingDataItem.staff_no = draggedEmployee.员工编号;
     }
     draggedEmployee = null;
   }
@@ -762,6 +766,7 @@ const addPerson = (partIndex, processIndex) => {
     if (reportingDataItem.staff_name) {
       reportingDataItem.staffList.push({
         staff_name: reportingDataItem.staff_name,
+        staff_no: reportingDataItem.staff_no,
         number: reportingDataItem.number || ''
       });
     }
@@ -769,6 +774,7 @@ const addPerson = (partIndex, processIndex) => {
   // 添加新的人员输入框
   reportingDataItem.staffList.push({
     staff_name: '',
+    staff_no: '',
     number: ''
   });
 };
@@ -791,6 +797,7 @@ const submitWorkScore = async () => {
     
     // 构建上报数据
     const reportData = [];
+    console.log('员工列表:', employees.value);
     
     // 检查是否是车缝工序
     if (add_formData['工序'] === '车缝') {
@@ -806,8 +813,13 @@ const submitWorkScore = async () => {
               // 多个人员的情况
               for (const staff of reportItem.staffList) {
                 if (staff.number) {
+                  console.log('处理员工:', staff);
+                  const foundEmp = employees.value.find(emp => emp['员工姓名'] === staff.staff_name);
+                  console.log('查找员工:', foundEmp);
+                  const staffNo = staff.staff_no || foundEmp?.['员工编号'] || selectedEmp['员工编号'];
+                  console.log('员工编号:', staffNo);
                   reportData.push({
-                    staff_no: employees.value.find(emp => emp['员工姓名'] === staff.staff_name)?.['员工编号'] || selectedEmp['员工编号'],
+                    staff_no: staffNo,
                     staff_name: staff.staff_name || selectedEmp['员工姓名'],
                     work_order: add_searchInfo.value,
                     majorprocess: add_formData['工序'],
@@ -827,7 +839,7 @@ const submitWorkScore = async () => {
             } else if (reportItem.number) {
               // 单个人员的情况
               reportData.push({
-                staff_no: selectedEmp['员工编号'],
+                staff_no: reportItem.staff_no || selectedEmp['员工编号'],
                 staff_name: reportItem.staff_name || selectedEmp['员工姓名'],
                 work_order: add_searchInfo.value,
                 majorprocess: add_formData['工序'],
@@ -858,7 +870,7 @@ const submitWorkScore = async () => {
             for (const staff of reportItem.staffList) {
               if (staff.number) {
                 reportData.push({
-                  staff_no: employees.value.find(emp => emp['员工姓名'] === staff.staff_name)?.['员工编号'] || selectedEmp['员工编号'],
+                  staff_no: staff.staff_no || employees.value.find(emp => emp['员工姓名'] === staff.staff_name)?.['员工编号'] || selectedEmp['员工编号'],
                   staff_name: staff.staff_name || selectedEmp['员工姓名'],
                   work_order: add_searchInfo.value,
                   majorprocess: add_formData['工序'],
@@ -878,7 +890,7 @@ const submitWorkScore = async () => {
           } else if (reportItem.number) {
             // 单个人员的情况
             reportData.push({
-              staff_no: selectedEmp['员工编号'],
+              staff_no: reportItem.staff_no || selectedEmp['员工编号'],
               staff_name: reportItem.staff_name || selectedEmp['员工姓名'],
               work_order: add_searchInfo.value,
               majorprocess: add_formData['工序'],

+ 1 - 0
src/view/performance/datangbaogong.vue

@@ -486,6 +486,7 @@ const add_onSubmit = async ()=>{
 	 const ddOrderAttachments = await OrderAttachments({order:searchValue,desc:'订单资料附件'})
 	 jstableData.splice(0,jsOrderAttachments.data.list.length,...jsOrderAttachments.data.list);
 	 ddtableData.splice(0,ddOrderAttachments.data.list.length,...ddOrderAttachments.data.list);
+	 baogongslpd();
 	 
 }
 

+ 44 - 52
src/view/yunyin/shengchanguanli/dahuobaobiao.vue

@@ -12,7 +12,7 @@
         <layout-sider :resize-directions="['right']" :width="190" style="margin-right: 10px;">
           <div class="JKWTree-tree treecolor">
             <h3>出货月份选择</h3>
-            <el-tree :data="treeData" :props="defaultProps" @node-click="handleNodeClick"></el-tree>
+            <el-tree class="treecolor" :data="treeData" :props="defaultProps" node-key="id" highlight-current @node-click="handleNodeClick"></el-tree>
           </div>
         </layout-sider>
 
@@ -21,7 +21,7 @@
           <el-main>
             <div class="gva-table-box">
               <!-- 表格数据 -->
-              <el-table ref="multipleTable" style="width: 100%; height: 40vh" tooltip-effect="dark",
+              <el-table ref="multipleTable" style="width: 100%; height: 40vh" tooltip-effect="dark"
                         :row-style="{ height: '25px' }" :header-cell-style="{ padding: '0px' }"
                         :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
                         :data="tableData" border row-key="ID"
@@ -48,7 +48,7 @@
                     />
                   </template>
                 </el-table-column>
-                <el-table-column sortable align="center" label="核批日期" prop="核批日期" width="140">
+                <el-table-column sortable align="center" label="产前样核批" prop="核批日期" width="140">
                   <template #default="{ row }">
                     <el-date-picker
                       v-model="row.核批日期"
@@ -170,6 +170,7 @@
             yearMap[year] = [];
           }
           yearMap[year].push({
+            id: dateStr,
             label: `${month}月`,
             value: dateStr
           });
@@ -204,22 +205,6 @@
   
   // 处理节点点击
   const handleNodeClick = async (node) => {
-    // 重置所有节点颜色
-    document.querySelectorAll('.treecolor .el-tree-node').forEach(treeNode => {
-      const label = treeNode.querySelector('.el-tree-node__label');
-      if (label) {
-        label.style.color = '';
-      }
-    });
-
-    // 获取当前点击的节点并设置颜色
-    const clickedNode = document.querySelector(`.treecolor .el-tree-node[data-key="${node['$treeNodeId']}"]`);
-    if (clickedNode) {
-      const label = clickedNode.querySelector('.el-tree-node__label');
-      if (label) {
-        label.style.color = 'red';
-      }
-    }
 
     // 只有叶子节点(包含value属性)才触发数据加载
     if (node.value) {
@@ -229,40 +214,44 @@
   }
   
   // 获取工单数据
-  const getWorkOrderData = async (rq) => {
-    try {
-      const response = await getWorkOrdersByMonth({ rq: rq });
-      if (response.code === 0) {
-        // 格式化日期为月日格式
-        const formatDate = (dateStr) => {
-          if (!dateStr) return '';
-          const date = new Date(dateStr);
-          return `${date.getMonth() + 1}月${date.getDate()}日`;
-        };
-        
-        // 处理数据
-        const formattedData = response.data.map((item, index) => ({
-          ID: index + 1,
-          ...item,
-          '下单日期': formatDate(item['下单日期']),
-          '货期': formatDate(item['货期']),
-          '面料入库时间': formatDate(item['面料入库时间']),
-          '开裁日期': formatDate(item['开裁日期']),
-          '上车位日期': formatDate(item['上车位日期']),
-          '车位完成日期': formatDate(item['车位完成日期']),
-          '后道完成日期': formatDate(item['后道完成日期'])
-        }));
-        
-        tableData.splice(0, tableData.length, ...formattedData);
-        total.value = formattedData.length;
-      } else {
-        ElMessage.error('获取工单数据失败');
-      }
-    } catch (error) {
-      console.error('获取工单数据失败:', error);
+const getWorkOrderData = async (rq) => {
+  try {
+    const response = await getWorkOrdersByMonth({ rq: rq });
+    if (response.code === 0) {
+      const formatDate = (dateStr) => {
+        if (!dateStr) return '';
+        const date = new Date(dateStr);
+        return `${date.getMonth() + 1}月${date.getDate()}日`;
+      };
+      
+      // 按货期字符串排序(YYYY-MM-DD格式可以直接字符串排序)
+      const sortedData = [...response.data].sort((a, b) => {
+        return a['货期'].localeCompare(b['货期']);
+      });
+      
+      // 处理数据
+      const formattedData = sortedData.map((item, index) => ({
+        ID: index + 1,
+        ...item,
+        '下单日期': formatDate(item['下单日期']),
+        '货期': formatDate(item['货期']),
+        '面料入库时间': formatDate(item['面料入库时间']),
+        '开裁日期': formatDate(item['开裁日期']),
+        '上车位日期': formatDate(item['上车位日期']),
+        '车位完成日期': formatDate(item['车位完成日期']),
+        '后道完成日期': formatDate(item['后道完成日期'])
+      }));
+      
+      tableData.splice(0, tableData.length, ...formattedData);
+      total.value = formattedData.length;
+    } else {
       ElMessage.error('获取工单数据失败');
     }
+  } catch (error) {
+    console.error('获取工单数据失败:', error);
+    ElMessage.error('获取工单数据失败');
   }
+}
   
   // 表格行点击
   const tableRowClick = async (row) => {
@@ -498,7 +487,7 @@
         return;
       }
 
-      const formattedDate = row.辅料入库时间 ? row.辅料入库时间 : getTodayYmd();
+      const formattedDate = row.辅料计划入库时间 ? row.辅料计划入库时间 : getTodayYmd();
       const operator = userStore.userInfo.nickName;
 
       const response = await AccessoriesInboundTime({ 
@@ -752,7 +741,10 @@
   :deep(.el-table td .cell) {
     line-height: 20px !important;
   }
-
+/* 点击的树节点变红*/
+.treecolor :deep(.el-tree-node.is-current > .el-tree-node__content .el-tree-node__label) {
+  color: red !important;
+}
   /* 响应式设计 */
   @media (max-width: 1200px) {
     .cert-wrapper {

Dosya farkı çok büyük olduğundan ihmal edildi
+ 1862 - 45
src/view/yunyin/shengchanguanli/gongdanziliao.vue


Bu fark içinde çok fazla dosya değişikliği olduğu için bazı dosyalar gösterilmiyor