|
|
@@ -132,81 +132,47 @@
|
|
|
|
|
|
|
|
|
<el-dialog v-model="positioningVisibleshow" :before-close="closepositioningVisible"
|
|
|
- :title="type==='create'?'添加':'修改'" destroy-on-close>
|
|
|
-
|
|
|
- <el-row :gutter="20">
|
|
|
-
|
|
|
- <el-col :span="6">
|
|
|
+ :title="type==='create'?'添加':'修改'" destroy-on-close width="700px" style="height: 350px;">
|
|
|
+ <el-row :gutter="24">
|
|
|
+ <el-col :span="8">
|
|
|
<el-form-item label="员工编号" prop="name">
|
|
|
- <el-row :gutter="20">
|
|
|
- <el-col :span="12">
|
|
|
- <el-input v-model="formData.员工编号" :clearable="true" />
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
+ <el-input v-model="formData.员工编号" disabled style="width:120px" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="6">
|
|
|
+ <el-col :span="8">
|
|
|
<el-form-item label="姓名" prop="name">
|
|
|
- <el-row :gutter="20">
|
|
|
- <el-col :span="12">
|
|
|
- <el-input v-model="formData.姓名" :clearable="true" />
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
+ <el-input v-model="formData.姓名" disabled style="width:120px" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
-
|
|
|
- <el-row :gutter="20">
|
|
|
-
|
|
|
- <el-col :span="6">
|
|
|
+ <el-row :gutter="24">
|
|
|
+ <el-col :span="8">
|
|
|
<el-form-item label="部门名称" prop="name">
|
|
|
- <el-row :gutter="20">
|
|
|
- <el-col :span="12">
|
|
|
- <el-input v-model="formData.部门名称" :clearable="true" />
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
+ <el-input v-model="formData.部门名称" disabled style="width:120px" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="6">
|
|
|
+ <el-col :span="8">
|
|
|
<el-form-item label="职务" prop="name">
|
|
|
- <el-row :gutter="20">
|
|
|
- <el-col :span="12">
|
|
|
- <el-input v-model="formData.职务" :clearable="true" />
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
+ <el-input v-model="formData.职务" disabled style="width:120px" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
-
|
|
|
-
|
|
|
- <el-row :gutter="20">
|
|
|
-
|
|
|
- <el-col :span="6">
|
|
|
+ <el-row :gutter="24">
|
|
|
+ <el-col :span="8">
|
|
|
<el-form-item label="入职日期" prop="name">
|
|
|
- <el-row :gutter="20">
|
|
|
- <el-col :span="12">
|
|
|
- <el-input v-model="formData.入职日期" :clearable="true" />
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
+ <el-input v-model="formData.入职日期" disabled style="width:150px" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
-
|
|
|
-
|
|
|
- <el-row :gutter="20">
|
|
|
- <el-col :span="6">
|
|
|
+ <el-row :gutter="24">
|
|
|
+ <el-col :span="8">
|
|
|
<el-form-item label="关联权重" prop="name">
|
|
|
- <el-row :gutter="20">
|
|
|
- <el-col :span="12">
|
|
|
- <el-input v-model="formData.关联权重" :clearable="true" />
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
+ <el-input v-model="formData.关联权重" :clearable="true" disabled style="width:150px" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</el-dialog>
|
|
|
|
|
|
-
|
|
|
<el-dialog v-model="batchaddshow" :before-close="closepositioningVisible" :title="批量附加"
|
|
|
destroy-on-close width="900px">
|
|
|
<el-row :gutter="24">
|
|
|
@@ -568,6 +534,8 @@
|
|
|
|
|
|
}
|
|
|
});
|
|
|
+ //插入最后一个员工的合计
|
|
|
+ combinedData.push(summaryData[0]);
|
|
|
// 更新表格数据
|
|
|
tableData.splice(0, tableData.length, ...combinedData);
|
|
|
|
|
|
@@ -581,46 +549,51 @@
|
|
|
|
|
|
data.forEach((item, index) => {
|
|
|
const name = item['员工姓名'].trim(); // 获取员工姓名并去除空格
|
|
|
- const nextItem = data[index + 1];
|
|
|
-
|
|
|
- // 更新合计数据
|
|
|
- if (currentName === name) {
|
|
|
- currentSummary['日期']++;
|
|
|
- currentSummary['计件工资'] += parseFloat(item['计件工资']);
|
|
|
- currentSummary['加班工资'] += parseFloat(item['加班工资']);
|
|
|
- currentSummary['日工资合计'] += parseFloat(item['日工资合计']);
|
|
|
- } else {
|
|
|
- // 如果员工姓名发生改变,或者已经到达数据结尾,将上一个员工的合计数据插入到数组中
|
|
|
+ if (name !== currentName) {
|
|
|
+ // 如果员工姓名发生改变,说明需要插入合计数据
|
|
|
if (currentSummary) {
|
|
|
- currentSummary['员工姓名'] = '合计(' + currentSummary['日期'] + '天)';
|
|
|
- currentSummary['计件工资'] = currentSummary['计件工资'].toFixed(2); // 保留两位小数
|
|
|
- currentSummary['加班工资'] = currentSummary['加班工资'].toFixed(2);
|
|
|
- currentSummary['日工资合计'] = currentSummary['日工资合计'].toFixed(2);
|
|
|
+ // 将上一个员工的合计数据插入到数组中
|
|
|
summaryData.push(currentSummary);
|
|
|
}
|
|
|
-
|
|
|
// 创建新的合计数据
|
|
|
currentSummary = {
|
|
|
'员工姓名': name,
|
|
|
- '日期': 1,
|
|
|
- '计件工资': parseFloat(item['计件工资']),
|
|
|
- '加班工资': parseFloat(item['加班工资']),
|
|
|
- '日工资合计': parseFloat(item['日工资合计'])
|
|
|
+ '日期': 0,
|
|
|
+ '关联计件工资': 0,
|
|
|
+ '关联加班工资': 0,
|
|
|
+ '关联定额补差': 0,
|
|
|
+ '关联计时工资': 0,
|
|
|
+ '关联工资合计': 0
|
|
|
};
|
|
|
currentName = name;
|
|
|
}
|
|
|
|
|
|
- // 如果已经到达数据结尾,将最后一个员工的合计数据插入到数组中
|
|
|
- if (!nextItem) {
|
|
|
- currentSummary['员工姓名'] = '合计(' + currentSummary['日期'] + '天)';
|
|
|
- currentSummary['计件工资'] = currentSummary['计件工资'].toFixed(2); // 保留两位小数
|
|
|
- currentSummary['加班工资'] = currentSummary['加班工资'].toFixed(2);
|
|
|
- currentSummary['日工资合计'] = currentSummary['日工资合计'].toFixed(2);
|
|
|
- summaryData.push(currentSummary);
|
|
|
- }
|
|
|
+ // 更新合计数据
|
|
|
+ currentSummary['日期']++;
|
|
|
+ currentSummary['关联计件工资'] += parseFloat(item['关联计件工资']);
|
|
|
+ currentSummary['关联加班工资'] += parseFloat(item['关联加班工资']);
|
|
|
+ currentSummary['关联定额补差'] += parseFloat(item['关联定额补差']);
|
|
|
+ currentSummary['关联计时工资'] += parseFloat(item['关联计时工资']);
|
|
|
+ currentSummary['关联工资合计'] += parseFloat(item['关联工资合计']);
|
|
|
+ currentSummary['员工姓名'] = '合计(' + currentSummary['日期'] + '天)';
|
|
|
+ });
|
|
|
+
|
|
|
+ // 将最后一个员工的合计数据插入到数组中
|
|
|
+ if (currentSummary) {
|
|
|
+ summaryData.push(currentSummary);
|
|
|
+ }
|
|
|
+
|
|
|
+ // 将日期填充到表格中
|
|
|
+ summaryData.forEach((summary) => {
|
|
|
+ summary['关联计件工资'] = summary['关联计件工资'].toFixed(2); // 保留两位小数
|
|
|
+ summary['关联加班工资'] = summary['关联加班工资'].toFixed(2);
|
|
|
+ summary['关联定额补差'] = summary['关联定额补差'].toFixed(2);
|
|
|
+ summary['关联计时工资'] = summary['关联计时工资'].toFixed(2);
|
|
|
+ summary['关联工资合计'] = summary['关联工资合计'].toFixed(2);
|
|
|
});
|
|
|
|
|
|
return summaryData;
|
|
|
+
|
|
|
};
|
|
|
let date = ref()
|
|
|
const handleNodeClick = (node, check) => {
|
|
|
@@ -649,6 +622,8 @@
|
|
|
|
|
|
}
|
|
|
});
|
|
|
+ //插入最后一个员工的合计
|
|
|
+ combinedData.push(summaryData[0]);
|
|
|
// 更新表格数据
|
|
|
tableData.splice(0, tableData.length, ...combinedData);
|
|
|
//选中第一条记录
|
|
|
@@ -847,8 +822,6 @@
|
|
|
}
|
|
|
//关联表格双击事件
|
|
|
const relevancySelectClick = (row, column, event) => {
|
|
|
- console.log(row.日期)
|
|
|
- console.log(row.班组员工编号)
|
|
|
WeightDetail(row.日期, row.班组员工编号)
|
|
|
}
|
|
|
//获取关联员工信息
|
|
|
@@ -857,7 +830,6 @@
|
|
|
date: date,
|
|
|
code: code.split("(")[0]
|
|
|
});
|
|
|
- console.log(response.data[0].员工编号)
|
|
|
if (response.code === 0) {
|
|
|
formData.value.员工编号 = response.data[0].员工编号
|
|
|
formData.value.姓名 = response.data[0].姓名
|
|
|
@@ -865,7 +837,6 @@
|
|
|
formData.value.职务 = response.data[0].职务
|
|
|
formData.value.入职日期 = response.data[0].入职日期
|
|
|
formData.value.关联权重 = response.data[0].关联权重
|
|
|
- console.log(formData)
|
|
|
positioningVisibleshow.value = true
|
|
|
}
|
|
|
}
|