Merge remote-tracking branch 'origin/0.8.X' into 0.8.X
This commit is contained in:
@@ -202,6 +202,7 @@
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="info" @click="copyFromSourceCoil" icon="el-icon-document-copy">复制源卷信息</el-button>
|
||||
<el-button :loading="buttonLoading" type="primary" @click="addSplit">提交分条</el-button>
|
||||
<el-button :loading="buttonLoading" @click="resetSplitForm">重置</el-button>
|
||||
</el-form-item>
|
||||
@@ -813,6 +814,52 @@ export default {
|
||||
if (!dict) return code;
|
||||
const item = dict.find(item => item.value === code);
|
||||
return item ? item.label : code;
|
||||
},
|
||||
|
||||
// 复制源卷信息到分条表单
|
||||
copyFromSourceCoil() {
|
||||
// 复制除了指定字段之外的其他字段
|
||||
const excludeFields = ['enterCoilNo', 'currentCoilNo', 'coilId', 'createTime', 'createBy'];
|
||||
|
||||
// 构建要复制的字段
|
||||
const copiedFields = {
|
||||
supplierCoilNo: this.coilInfo.supplierCoilNo,
|
||||
warehouseId: this.coilInfo.warehouseId,
|
||||
actualWarehouseId: this.coilInfo.actualWarehouseId,
|
||||
team: this.coilInfo.team,
|
||||
materialType: this.coilInfo.materialType,
|
||||
itemType: this.coilInfo.itemType,
|
||||
itemId: this.coilInfo.itemId,
|
||||
qualityStatus: this.coilInfo.qualityStatus,
|
||||
trimmingRequirement: this.coilInfo.trimmingRequirement,
|
||||
packingStatus: this.coilInfo.packingStatus,
|
||||
packagingRequirement: this.coilInfo.packagingRequirement,
|
||||
grossWeight: parseFloat(this.coilInfo.grossWeight) || null,
|
||||
netWeight: parseFloat(this.coilInfo.netWeight) || null,
|
||||
length: parseFloat(this.coilInfo.length) || null,
|
||||
actualLength: parseFloat(this.coilInfo.actualLength) || null,
|
||||
actualWidth: parseFloat(this.coilInfo.actualWidth) || null,
|
||||
temperGrade: this.coilInfo.temperGrade,
|
||||
coatingType: this.coilInfo.coatingType,
|
||||
remark: this.coilInfo.remark,
|
||||
productionStartTime: this.coilInfo.productionStartTime,
|
||||
productionEndTime: this.coilInfo.productionEndTime,
|
||||
productionDuration: this.coilInfo.productionDuration,
|
||||
formattedDuration: this.coilInfo.productionDuration ? this.formatDuration(this.coilInfo.productionDuration * 60 * 1000) : ''
|
||||
};
|
||||
|
||||
// 合并到分条表单
|
||||
this.splitForm = {
|
||||
...this.splitForm,
|
||||
...copiedFields
|
||||
};
|
||||
|
||||
// 同步材料类型和长度显示状态
|
||||
if (this.splitForm.materialType) {
|
||||
this.handleMaterialTypeChange(this.splitForm.materialType);
|
||||
}
|
||||
|
||||
this.$message.success('已复制源卷信息,请根据需要修改');
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
@@ -85,9 +85,9 @@
|
||||
<el-card class="form-card">
|
||||
<div slot="header" class="card-header">
|
||||
<span><i class="el-icon-edit-outline"></i> {{ '更新信息' }}</span>
|
||||
<!-- <el-button type="text" size="mini" @click="copyFromCurrent" icon="el-icon-document-copy">
|
||||
复制当前信息
|
||||
</el-button> -->
|
||||
<el-button type="text" size="mini" @click="copyFromCurrent" icon="el-icon-document-copy">
|
||||
复制源卷信息
|
||||
</el-button>
|
||||
</div>
|
||||
|
||||
<el-form ref="updateForm" :model="updateForm" :rules="rules" label-width="80px" size="small">
|
||||
@@ -820,23 +820,43 @@ export default {
|
||||
|
||||
// 复制当前信息到更新表单
|
||||
copyFromCurrent() {
|
||||
const itemType = this.currentInfo.materialType === '原料' ? 'raw_material' : 'product';
|
||||
this.updateForm = {
|
||||
currentCoilNo: this.currentInfo.currentCoilNo,
|
||||
// 复制除了指定字段之外的其他字段
|
||||
const excludeFields = ['enterCoilNo', 'currentCoilNo', 'coilId', 'createTime', 'createBy'];
|
||||
|
||||
// 构建要复制的字段
|
||||
const copiedFields = {
|
||||
team: this.currentInfo.team,
|
||||
materialType: this.currentInfo.materialType,
|
||||
// 不复制 itemType 和 itemId,让它们由 materialType 自动决定
|
||||
itemType,
|
||||
itemType: this.currentInfo.itemType,
|
||||
itemId: this.currentInfo.itemId,
|
||||
grossWeight: parseFloat(this.currentInfo.grossWeight) || null,
|
||||
netWeight: parseFloat(this.currentInfo.netWeight) || null,
|
||||
warehouseId: this.currentInfo.warehouseId,
|
||||
actualWarehouseId: this.currentInfo.actualWarehouseId,
|
||||
length: parseFloat(this.currentInfo.length) || null,
|
||||
remark: this.currentInfo.remark
|
||||
actualLength: parseFloat(this.currentInfo.actualLength) || null,
|
||||
actualWidth: parseFloat(this.currentInfo.actualWidth) || null,
|
||||
temperGrade: this.currentInfo.temperGrade,
|
||||
coatingType: this.currentInfo.coatingType,
|
||||
qualityStatus: this.currentInfo.qualityStatus,
|
||||
packagingRequirement: this.currentInfo.packagingRequirement,
|
||||
packingStatus: this.currentInfo.packingStatus,
|
||||
trimmingRequirement: this.currentInfo.trimmingRequirement,
|
||||
remark: this.currentInfo.remark,
|
||||
productionStartTime: this.currentInfo.productionStartTime,
|
||||
productionEndTime: this.currentInfo.productionEndTime,
|
||||
productionDuration: this.currentInfo.productionDuration,
|
||||
formattedDuration: this.currentInfo.productionDuration ? this.formatDuration(this.currentInfo.productionDuration * 60 * 1000) : ''
|
||||
};
|
||||
|
||||
// 合并到更新表单
|
||||
this.updateForm = {
|
||||
...this.updateForm,
|
||||
...copiedFields
|
||||
};
|
||||
|
||||
// materialType 会触发 watch,自动设置 itemType 并加载物品列表
|
||||
this.$message.success('已复制当前信息,包含' + this.currentInfo.materialType + '类型的相关信息, 请根据需要修改');
|
||||
this.$message.success('已复制源卷信息,请根据需要修改');
|
||||
},
|
||||
|
||||
// 保存更新
|
||||
|
||||
@@ -106,6 +106,7 @@
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">删除</el-button>
|
||||
<el-button v-if="scope.row.isLeave === 0 && scope.row.isRegular === 0" size="mini" type="text" icon="el-icon-check"
|
||||
@click="handleResignation(scope.row)">转正</el-button>
|
||||
<el-button v-if="scope.row.isRegular === 1" size="mini" type="text" icon="el-icon-view" @click="handleViewRegular(scope.row)">转正记录</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -232,22 +233,6 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
|
||||
<!-- 备注和附件 -->
|
||||
<el-card class="mb-4" shadow="hover">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" v-if="!form.infoId">
|
||||
<el-form-item label="附件" prop="attachment">
|
||||
<file-upload v-model="attachment"></file-upload>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
@@ -286,13 +271,34 @@
|
||||
<el-button @click="cancelResignation">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 查看转正记录对话框 -->
|
||||
<el-dialog title="转正记录" :visible.sync="regularRecordOpen" width="500px" append-to-body>
|
||||
<el-descriptions :column="1" border>
|
||||
<el-descriptions-item label="转正时间">
|
||||
{{ regularRecord.changeTime }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="转正原因">
|
||||
{{ regularRecord.changeReason }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="负责人">
|
||||
{{ regularRecord.changeHandler }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="附件">
|
||||
<file-upload v-model="regularRecord.attachment"></file-upload>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="备注">
|
||||
{{ regularRecord.remark }}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listEmployeeInfo, getEmployeeInfo, delEmployeeInfo, updateEmployeeInfo } from "@/api/wms/employeeInfo";
|
||||
import { listDept } from "@/api/wms/dept";
|
||||
import { employeeEntry, employeeLeave, employeeRegular } from '@/api/wms/employeeChange'
|
||||
import { employeeEntry, employeeRegular, listEmployeeChange } from '@/api/wms/employeeChange'
|
||||
|
||||
export default {
|
||||
name: "EmployeeInfo",
|
||||
@@ -360,7 +366,17 @@ export default {
|
||||
}
|
||||
],
|
||||
},
|
||||
resignationAttachment: undefined
|
||||
resignationAttachment: undefined,
|
||||
// 转正记录相关
|
||||
regularRecordOpen: false,
|
||||
regularRecord: {
|
||||
name: undefined,
|
||||
changeTime: undefined,
|
||||
changeReason: undefined,
|
||||
changeHandler: undefined,
|
||||
attachment: undefined,
|
||||
remark: undefined
|
||||
}
|
||||
};
|
||||
},
|
||||
dicts: ['hrm_employee_education'],
|
||||
@@ -383,6 +399,17 @@ export default {
|
||||
this.deptList = response.data;
|
||||
});
|
||||
},
|
||||
|
||||
/** 查询转正记录 */
|
||||
getRegularRecords() {
|
||||
listEmployeeChange({
|
||||
infoId: this.form.infoId,
|
||||
changeType: "2"
|
||||
}).then(response => {
|
||||
this.regularRecord = response.rows[0];
|
||||
});
|
||||
},
|
||||
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
@@ -462,20 +489,6 @@ export default {
|
||||
}).finally(() => {
|
||||
this.buttonLoading = false;
|
||||
});
|
||||
} else {
|
||||
employeeEntry({
|
||||
changeType: 0,
|
||||
changeTime: this.form.entryTime,
|
||||
changeHandler: this.$store.getters.nickName,
|
||||
attachment: this.attachment,
|
||||
...this.form
|
||||
}).then(response => {
|
||||
this.$modal.msgSuccess("员工入职成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}).finally(() => {
|
||||
this.buttonLoading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -581,7 +594,7 @@ export default {
|
||||
type = 'info';
|
||||
} else if (diffDays >= 90) {
|
||||
// 3个月以上未转正
|
||||
type = 'warning';
|
||||
type = 'danger';
|
||||
}
|
||||
} else {
|
||||
// 已转正
|
||||
@@ -589,6 +602,20 @@ export default {
|
||||
}
|
||||
|
||||
return { days: diffDays, type, status };
|
||||
},
|
||||
|
||||
/** 查看转正记录 */
|
||||
handleViewRegular(row) {
|
||||
this.form = row;
|
||||
this.getRegularRecords();
|
||||
this.regularRecordOpen = true;
|
||||
},
|
||||
|
||||
/** 下载附件 */
|
||||
downloadAttachment(attachment) {
|
||||
if (attachment) {
|
||||
window.open(attachment);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -587,7 +587,7 @@ export default {
|
||||
type = 'info';
|
||||
} else if (diffDays >= 90) {
|
||||
// 3个月以上未转正
|
||||
type = 'warning';
|
||||
type = 'danger';
|
||||
}
|
||||
} else {
|
||||
// 已转正
|
||||
|
||||
@@ -1,8 +1,34 @@
|
||||
<template>
|
||||
<div class="coil-table">
|
||||
<!-- 其他props -->
|
||||
<div class="table-controls">
|
||||
<div class="filter-section">
|
||||
<el-input v-model="filterKeyword" placeholder="输入关键词筛选" clearable @input="handleFilterChange"
|
||||
style="width: 200px; margin-right: 10px" />
|
||||
<el-select v-model="filterColumn" placeholder="选择筛选字段" @change="handleFilterChange"
|
||||
style="width: 200px; margin-right: 10px"
|
||||
multiple
|
||||
collapse-tags>
|
||||
<el-option v-for="column in columns" :key="column.prop" :label="column.title" :value="column.prop" />
|
||||
</el-select>
|
||||
</div>
|
||||
<div class="sort-section">
|
||||
<el-select v-model="sortField" placeholder="选择排序字段" @change="handleSortChange"
|
||||
style="width: 150px; margin-right: 10px">
|
||||
<el-option v-for="column in columns" :key="column.prop" :label="column.title" :value="column.prop" />
|
||||
</el-select>
|
||||
<el-select v-model="sortDirection" placeholder="选择排序方向" @change="handleSortChange" style="width: 100px">
|
||||
<el-option label="升序" value="asc" />
|
||||
<el-option label="降序" value="desc" />
|
||||
</el-select>
|
||||
</div>
|
||||
<el-pagination layout="total, sizes, prev, pager, next, jumper" :total="total" :page-size.sync="pageSize"
|
||||
:page-sizes="[10, 20, 50, 100, 200, 500, 1000]" @size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange" />
|
||||
</div>
|
||||
|
||||
<el-table :data="tableData" style="width: 100%" height="calc(100vh - 320px)" border>
|
||||
<el-table-column v-for="column in columns" :key="column.prop" :prop="column.prop" :label="column.title" :width="column.width" :align="column.align">
|
||||
<el-table-column v-for="column in columns" :key="column.prop" :prop="column.prop" :label="column.title"
|
||||
:width="column.width" :align="column.align">
|
||||
<template slot-scope="scope">
|
||||
<!-- 特殊 prop 渲染逻辑 -->
|
||||
<template v-if="column.prop === 'enterCoilNo'">
|
||||
@@ -29,15 +55,6 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
v-if="showPagination"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="total"
|
||||
:page-size.sync="pageSize"
|
||||
:page-sizes="[10, 20, 50, 100, 200, 500, 1000]"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -67,20 +84,80 @@ export default {
|
||||
return {
|
||||
pageNum: 1,
|
||||
pageSize: 1000,
|
||||
// 排序相关
|
||||
sortField: '',
|
||||
sortDirection: 'asc',
|
||||
// 筛选相关
|
||||
filterKeyword: '',
|
||||
filterColumn: [],
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
// 默认选中所有列
|
||||
this.filterColumn = this.columns.map(column => column.prop)
|
||||
},
|
||||
computed: {
|
||||
// 处理排序和筛选后的数据
|
||||
processedData() {
|
||||
let result = [...this.data]
|
||||
|
||||
// 筛选逻辑
|
||||
if (this.filterColumn.length > 0 && this.filterKeyword) {
|
||||
const keyword = this.filterKeyword.toLowerCase()
|
||||
result = result.filter(item => {
|
||||
// 只要有一个字段匹配,就保留该记录
|
||||
return this.filterColumn.some(column => {
|
||||
const value = item[column]
|
||||
if (value === null || value === undefined) return false
|
||||
return String(value).toLowerCase().includes(keyword)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
// 排序逻辑
|
||||
if (this.sortField) {
|
||||
result.sort((a, b) => {
|
||||
const aValue = a[this.sortField]
|
||||
const bValue = b[this.sortField]
|
||||
|
||||
// 处理null和undefined
|
||||
if (aValue === null || aValue === undefined) return 1
|
||||
if (bValue === null || bValue === undefined) return -1
|
||||
|
||||
// 字符串比较
|
||||
if (typeof aValue === 'string' && typeof bValue === 'string') {
|
||||
return this.sortDirection === 'asc'
|
||||
? aValue.localeCompare(bValue)
|
||||
: bValue.localeCompare(aValue)
|
||||
}
|
||||
|
||||
// 数字比较
|
||||
if (typeof aValue === 'number' && typeof bValue === 'number') {
|
||||
return this.sortDirection === 'asc'
|
||||
? aValue - bValue
|
||||
: bValue - aValue
|
||||
}
|
||||
|
||||
// 其他类型比较
|
||||
return this.sortDirection === 'asc'
|
||||
? String(aValue).localeCompare(String(bValue))
|
||||
: String(bValue).localeCompare(String(aValue))
|
||||
})
|
||||
}
|
||||
|
||||
return result
|
||||
},
|
||||
// 内部实现前端分页逻辑
|
||||
tableData() {
|
||||
return this.data.slice((this.pageNum - 1) * this.pageSize, this.pageNum * this.pageSize)
|
||||
return this.processedData.slice((this.pageNum - 1) * this.pageSize, this.pageNum * this.pageSize)
|
||||
},
|
||||
// 计算总页数
|
||||
totalPage() {
|
||||
return Math.ceil(this.data.length / this.pageSize)
|
||||
return Math.ceil(this.processedData.length / this.pageSize)
|
||||
},
|
||||
// 计算总条数
|
||||
total() {
|
||||
return this.data.length
|
||||
return this.processedData.length
|
||||
},
|
||||
// 是否展示分页组件
|
||||
showPagination() {
|
||||
@@ -116,7 +193,53 @@ export default {
|
||||
result += `${minutes}分钟`
|
||||
}
|
||||
return result
|
||||
},
|
||||
// 处理筛选条件变化
|
||||
handleFilterChange() {
|
||||
this.pageNum = 1
|
||||
},
|
||||
// 处理排序规则变化
|
||||
handleSortChange() {
|
||||
this.pageNum = 1
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.coil-table {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.table-controls {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
margin-bottom: 15px;
|
||||
flex-wrap: wrap;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.filter-section,
|
||||
.sort-section {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.el-pagination {
|
||||
margin-top: 0px !important;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 768px) {
|
||||
.table-controls {
|
||||
flex-direction: column;
|
||||
align-items: flex-end;
|
||||
}
|
||||
|
||||
.filter-section,
|
||||
.sort-section {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -3,11 +3,11 @@
|
||||
<el-row>
|
||||
<el-form label-width="80px" inline>
|
||||
<el-form-item label="开始时间" prop="startDate">
|
||||
<el-date-picker style="width: 200px;" v-model="queryParams.startDate" type="date" value-format="yyyy-MM-dd"
|
||||
<el-date-picker style="width: 200px;" v-model="queryParams.byCreateTimeStart" type="date" value-format="yyyy-MM-dd"
|
||||
placeholder="选择开始日期" @change="handleDateChange"></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="结束时间" prop="endDate">
|
||||
<el-date-picker style="width: 200px;" v-model="queryParams.endDate" type="date" value-format="yyyy-MM-dd"
|
||||
<el-date-picker style="width: 200px;" v-model="queryParams.byCreateTimeEnd" type="date" value-format="yyyy-MM-dd"
|
||||
placeholder="选择结束日期" @change="handleDateChange"></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="入场钢卷号" prop="enterCoilNo">
|
||||
|
||||
Reference in New Issue
Block a user