绩效问题修改及外协新功能添加

dev-scheduling
jinna 1 month ago
parent cb841c3136
commit babc35eea1
  1. 28
      src/api/oem/standardProcedure.js
  2. 272
      src/views/oem/standardProcedure/index.vue
  3. 232
      src/views/oem/standardProcedure/maintainDailog.vue
  4. 8
      src/views/personnelEfficiencyManagement/performanceManagement/components/prefDetail.vue
  5. 26
      src/views/personnelEfficiencyManagement/performanceManagement/components/reportingPerf.vue
  6. 4
      src/views/personnelEfficiencyManagement/performanceManagement/dataReporting.vue
  7. 11
      src/views/personnelEfficiencyManagement/performanceManagement/performanceDisclosure.vue

@ -0,0 +1,28 @@
import request from '@/axios';
// 获取列表
export const getList = (params) => {
return request({
url: '/api/blade-desk/mesOemStandardProcess/page',
method: 'get',
params,
});
};
// 删除
export const removeItem = params => {
return request({
url: '/api/blade-desk/mesOemStandardProcess/remove',
method: 'post',
params
});
};
// 提交
export const saveData = data => {
return request({
url: '/api/blade-desk/mesOemStandardProcess/submit',
method: 'post',
data
});
};

@ -0,0 +1,272 @@
<template>
<basic-container>
<!-- 标准工序代码 -->
<avue-crud
:option="option"
:table-loading="loading"
:data="data"
v-model="form"
v-model:page="page"
ref="crud"
@search-change="searchChange"
@search-reset="searchReset"
@current-change="currentChange"
@size-change="sizeChange"
@refresh-change="refreshChange"
@selection-change="selectionChange"
@on-load="onLoad"
@cell-click="cellClick"
@sort-change="sortChange"
>
<template #menu-right>
<el-button type="primary" @click="handleImport">导入</el-button>
</template>
<template #menu-left>
<el-button type="primary" @click="handleMaintain">维护</el-button>
<el-button type="danger" @click="handleDelete">删除</el-button>
</template>
</avue-crud>
<basic-import v-if="isShowImport" title="导入" :isShow="isShowImport"
templateUrl="/blade-desk/mesOemStandardProcess/download-excel-template"
templateName="标准工序代码.xls"
importUrl="/blade-desk/mesOemStandardProcess/import-excel"
@closeDialog="closeDialog">
</basic-import>
<maintainDailog
v-if="showDialog"
:showDialog="showDialog"
@closeDialog="closeDialog"
:selectData="selectionList"
>
</maintainDailog>
</basic-container>
</template>
<script>
import basicImport from '@/components/basic-import/main.vue'
import maintainDailog from "./maintainDailog.vue"
import {getList,removeItem} from "@/api/oem/standardProcedure"
export default {
components:{
basicImport,
maintainDailog
},
data() {
return {
loading:false,
isShowImport:false,
showDialog:false,
data:[],
selectionList:[],
form:{},
query:{},
page:{
pageSize: 10,
currentPage: 1,
total: 0,
},
selectionList:[],
option: {
height: 'auto',
align: 'center',
calcHeight: 32,
rowKey: 'id',
rowParentKey: 'parentId',
tip: false,
simplePage: true,
searchShow: true,
searchMenuSpan: 6,
searchIcon: true,
searchIndex: 3,
tree: false,
border: true,
index: false,
selection: true,
viewBtn: false,
delBtn: false,
addBtn: false,
editBtn: false,
editBtnText: '修改',
addBtnIcon: ' ',
viewBtnIcon: ' ',
delBtnIcon: ' ',
editBtnIcon: ' ',
viewBtnText: '详情',
// labelWidth: 120,
searchLabelWidth: 'auto',
menu: false,
menuWidth: 120,
dialogWidth: 1200,
dialogClickModal: false,
searchEnter: true,
excelBtn: false,
filterBtn: true,
searchShowBtn: false,
columnSort: true,
excelBtn: true,
columnSort: true,
showOverflowTooltip: true,
searchLabelPosition: 'left',
searchGutter: 24,
searchSpan: 6,
menuAlign: 'left',
gridBtn: false,
searchMenuPosition: 'right',
column: [
{
label: '工序',
prop:'processName',
search:true,
sortable:'custom',
searchOrder:4
},
{
label:"镀种",
prop:"plate",
search:true,
sortable:'custom',
searchOrder: 3
},
{
label:"镀层厚度",
prop:"plateThickness",
search:true,
sortable:'custom',
searchOrder: 2
},
{
label:"零件名称",
prop:"partName",
search:true,
sortable:'custom',
searchOrder: 1
},
{
label:"标准工序代码",
prop:"standardProcessCode",
search:true,
sortable:'custom',
searchOrder: 5,
},
{
label:"维护人",
sortable:'custom',
prop:"updateUserName"
},
{
label:"维护时间",
sortable:'custom',
prop:"updateTime"
}
]
}
}
},
created(){
},
methods:{
//
sortChange({ prop, order }) {
if (!prop) {
//
this.query.orderByField = undefined;
// this.query.isAsc = undefined;
this.query.asc = undefined;
} else {
const orderByField = prop.replace(/([a-z])([A-Z0-9])/g, '$1_$2').toUpperCase();
this.query.orderByField = orderByField;
// this.query.isAsc = order === 'ascending' ? true : false;
this.query.asc = order === 'ascending' ? true : false;
}
// //
this.onLoad(this.page, this.query);
},
searchChange(params, done){
this.page.currentPage = 1;
this.query = params;
this.onLoad();
done();
},
searchReset(){
this.query = {}
this.onLoad()
},
currentChange(currentPage){
this.page.currentPage = currentPage
},
sizeChange(pageSize){
this.page.pageSize = pageSize
},
refreshChange(){
this.onLoad()
},
handleImport(){
this.isShowImport = true
},
closeDialog(val){
this.isShowImport = false
this.showDialog = false
if(val){
this.onLoad()
}
},
selectionChange(list){
this.selectionList = list
},
handleDelete(){
if (this.selectionList.length === 0) {
this.$message.error('请选择至少一条数据');
return;
}
this.$confirm('确定将选择数据删除?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}).then(() => {
removeItem({
ids:this.selectionList.map(item => item.id).join(',')
}).then(res =>{
if(res.data.code == 200){
this.$message.success('删除成功')
this.onLoad()
}
})
})
},
handleMaintain(){
if (this.selectionList.length === 0) {
this.$message.error('请选择至少一条数据');
return;
}
this.showDialog = true
},
onLoad(){
this.loading = true
getList({
current:this.page.currentPage,
size:this.page.pageSize,
...this.query
}).then(res =>{
this.data = res.data.data.records
this.page.total = res.data.data.total
this.loading = false
})
// this.data = [
// {
// id:'001',
// processName:"",
// plate:"Au",
// plateThickness:'3.2',
// }
// ]
// this.page.total = this.data.length
// this.loading = false
}
}
}
</script>
<style>
</style>

@ -0,0 +1,232 @@
<template>
<el-dialog title="维护" append-to-body :modelValue="openShow" width="70%" @close="closeDialog()">
<!-- 单个 Form 包裹整个表格 -->
<el-form
ref="tableForm"
:model="form"
:rules="formRules"
label-width="0px"
>
<!-- 全局错误提示 -->
<div v-if="formError" class="error-message" style="color: #f56c6c; margin-bottom: 10px;">
{{ formError }}
</div>
<el-table :data="form.tableData" @select="selectChange" border>
<el-table-column type="index" width="55"></el-table-column>
<!-- 工序 -->
<el-table-column align="center" label="工序" prop="processName">
<template #header>
<span><i style="color: red">*</i>工序</span>
</template>
</el-table-column>
<!-- 镀种 -->
<el-table-column align="center" label="镀种" prop="plate">
<template #default="scope">
<el-form-item :prop="`tableData[${scope.$index}].plate`" :rules="formRules.plate">
<el-input v-model="scope.row.plate" placeholder="请输入"></el-input>
</el-form-item>
</template>
</el-table-column>
<!-- 镀层厚度 -->
<el-table-column align="center" label="镀层厚度" prop="plateThickness">
<template #default="scope">
<el-form-item :prop="`tableData[${scope.$index}].plateThickness`" :rules="formRules.plateThickness">
<el-input v-model="scope.row.plateThickness" placeholder="请输入"></el-input>
</el-form-item>
</template>
</el-table-column>
<!-- 零件名称 -->
<el-table-column align="center" label="零件名称" prop="partName">
<template #default="scope">
<el-form-item :prop="`tableData[${scope.$index}].partName`" :rules="formRules.partName">
<el-input v-model="scope.row.partName" placeholder="请输入"></el-input>
</el-form-item>
</template>
</el-table-column>
<!-- 标准工序代码 -->
<el-table-column align="center" label="标准工序代码" prop="standardProcessCode">
<template #header>
<span><i style="color: red">*</i>标准工序代码</span>
</template>
<template #default="scope">
<el-form-item :prop="`tableData[${scope.$index}].standardProcessCode`" :rules="formRules.standardProcessCode">
<el-input v-model="scope.row.standardProcessCode" placeholder="请输入"></el-input>
</el-form-item>
</template>
</el-table-column>
</el-table>
</el-form>
<template #footer>
<span class="dialog-footer">
<el-button @click="closeDialog()"> </el-button>
<el-button type="primary" @click="submitForm"> </el-button>
</span>
</template>
</el-dialog>
</template>
<script>
import {saveData} from "@/api/oem/standardProcedure"
export default {
props:{
showDialog:{
type:Boolean,
default:false
},
selectData:{
type:Array,
default:[]
}
},
data(){
return{
openShow:false,
form:{
tableData:[]
},
formRules:{
// 1
tableData: [
{
required: true,
message: '请至少添加一行数据',
trigger: 'submit',
type: 'array' //
},
{
validator: (rule, value, callback) => {
if (value.length === 0) {
callback(new Error('请至少添加一行数据'));
} else {
callback();
}
},
trigger: 'submit'
}
],
processName:[
{ required: true, message: '请填写工序', trigger: ['change', 'submit'] }
],
standardProcessCode:[
{ required: true, message: '请填写标准工序代码', trigger: ['change', 'submit'] }
]
},
formError:''
}
},
mounted(){
console.log('showDialog=========',this.showDialog)
this.openShow = this.showDialog
this.form.tableData = this.selectData
},
methods:{
closeDialog(val){
this.openShow = false
this.$emit('closeDialog',val);
},
checkDuplicate(arr) {
const map = new Map(); // "name_value"
for (let i = 0; i < arr.length; i++) {
const item = arr[i];
// 1. name value
// id age
const key = `${item.processName}_${item.plate}_${item.plateThickness}_${item.partName}`;
// 2. Map
if (map.has(key)) {
//
return {
success: false,
rowIndex: i + 1, // 1
message: `${i + 1} 行错误:数据已存在`
};
} else {
// Mapi+1
map.set(key, i + 1);
}
}
return { success: true };
},
//
submitForm() {
this.formError = '';
// Form
this.$refs.tableForm.validate((isValid, invalidFields) => {
if (!isValid) {
//
this.formError = '存在未完善的字段,请检查表格中的红色提示';
this.$nextTick(() => {
//
const firstError = document.querySelector('.el-form-item.is-error');
if (firstError) {
firstError.scrollIntoView({ behavior: 'smooth', block: 'center' });
}
});
return;
}
//
const submitData = this.form.tableData.map(row => {
const { _select, ...validData } = row; //
return validData;
});
console.log('submit----------',submitData)
// --- ---
const result = this.checkDuplicate(submitData);
console.log('res==========',result)
if(!result.success){
this.$message.error(result.message)
return
}
saveData(submitData).then(res => {
if(res.data.code === 200){
this.$message.success('维护成功')
this.closeDialog(true)
}
})
})
}
}
}
</script>
<style lang="scss" scoped>
//
:deep(.el-table .el-form-item) {
margin-bottom: 0; //
}
//
:deep(.el-form-item__error) {
font-size: 12px;
white-space: nowrap;
z-index: 10;
background: #fff;
padding: 2px 4px;
border: 1px solid #f56c6c;
border-radius: 4px;
}
// textarea
.el-table__row {
height: 80px !important;
}
.el-table__cell {
vertical-align: middle !important;
}
.error-message {
font-size: 14px;
line-height: 1.5;
}
:deep(.el-table .el-table__cell) {
height: 50px !important;
padding: 0 !important;
line-height: 50px !important;
}
</style>

@ -70,7 +70,7 @@ export default {
tip: false,
simplePage: true,
searchShow: true,
searchMenuSpan: 18,
searchMenuSpan: 12,
searchIcon: true,
searchIndex: 3,
tree: false,
@ -118,6 +118,8 @@ export default {
},
created() {
this.openShow = this.showDetail;
this.option.searchMenuSpan = this.type === '2' ? 18 : 12
console.log('option==============',this.option)
if (this.type === '2') {
this.query = { yearMonth: this.row.yearMonth || '' };
}
@ -143,11 +145,9 @@ export default {
},
currentChange(currentPage) {
this.page.currentPage = currentPage;
this.onLoad();
},
sizeChange(pageSize) {
this.page.pageSize = pageSize;
this.onLoad();
},
refreshChange() {
this.onLoad();
@ -165,7 +165,7 @@ export default {
detailBsEfficiencyTask({ ...query, ...this.query })
.then(res => {
if (res.data.code === 200) {
this.data = res.data.data.table.tableDataList || [];
this.data = res.data.data.table.tableData || [];
const arr = res.data.data.table.tableColumn;
if (this.type === '1') {
arr.push({ ...arr[0], prop: arr[0].prop + 'Exact', hide: true, search: true });

@ -16,7 +16,7 @@
:upload-error="uploadError"
>
<template #readExcel>
<el-button type="primary" @click="readExcel" v-if="!isDetail">
<el-button type="primary" @click="readExcel" v-if="!isDetail" :disabled="isRead || uploadDisabled || isDisabled">
读取文件<i class="el-icon-download el-icon--right"></i>
</el-button>
</template>
@ -33,8 +33,8 @@
</el-table>
<template #footer>
<span class="dialog-footer">
<el-button @click="closeDialog"> </el-button>
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="closeDialog" :disabled="isDisabled || uploadDisabled"> </el-button>
<el-button type="primary" @click="submitForm" :disabled="isDisabled || uploadDisabled"> </el-button>
</span>
</template>
</el-dialog>
@ -89,6 +89,8 @@ export default {
attachId: null,
formData: null,
isUploading: false,
isDisabled:false,
uploadDisabled:false,
};
},
watch: {
@ -104,6 +106,7 @@ export default {
setUploadDisabled(disabled) {
const uploadColumn = this.excelOption.column.find(item => item.prop === 'excelFile');
console.log('uploadColumn', uploadColumn);
this.uploadDisabled = disabled
if (uploadColumn) {
// this.$set(uploadColumn, 'disabled', disabled);
uploadColumn.disabled = disabled;
@ -176,6 +179,8 @@ export default {
this.$message.warning('请先上传文件');
return;
}
this.setUploadDisabled(true)
this.isDisabled = true;
readExcelBsEfficiencyTask({ file: this.formData })
.then(res => {
if (res.data.code === 200) {
@ -183,21 +188,30 @@ export default {
this.tableColumn = res.data.data.tableColumn || [];
this.isRead = true;
this.$message.success(res.data.msg || '文件读取成功');
this.isDisabled = false;
this.setUploadDisabled(false)
} else {
this.$message.error(res.data.msg || '读取失败');
this.isDisabled = false;
this.setUploadDisabled(false)
}
})
.catch(error => {
console.error('读取文件失败:', error);
this.isDisabled = false;
this.setUploadDisabled(false)
// this.$message.error('');
});
},
submitForm() {
console.log('table----------',this.tableData)
console.log('isRead----------',this.isRead)
console.log('isDetail----------',this.isDetail)
if (!this.attachId) {
this.$message.error('请先上传文件');
return;
}
if (!this.tableData || this.tableData.length === 0) {
if (!this.isDetail && (!this.tableData || this.tableData.length === 0)) {
this.$message.error('文件内容为空');
return;
}
@ -215,6 +229,7 @@ export default {
} else {
msg = '确认提交绩效数据?';
}
this.isDisabled = true;
this.$confirm(msg, '', {
confirmButtonText: '确定',
cancelButtonText: '取消',
@ -238,13 +253,16 @@ export default {
if (res.data.code === 200) {
this.$message.success('提交成功');
this.closeDialog(true);
this.isDisabled = false;
} else {
this.$message.error('提交失败');
this.isDisabled = false;
}
})
.catch(error => {
console.error('提交失败:', error);
this.$message.error('提交失败,请检查网络或稍后重试');
this.isDisabled = false;
});
})
.catch(() => {

@ -563,8 +563,8 @@ export default {
onLoad() {
this.loading = true;
const params = {
pageSize: this.page.pageSize,
currentPage: this.page.currentPage,
size: this.page.pageSize,
current: this.page.currentPage,
...this.query,
};
console.log(params);

@ -258,8 +258,11 @@ export default {
yearMonth: `${row.year}-${monthMap[column.property]}`,
status: 4,
};
console.log('row----------',row)
if(row[column.property]){
this.showDetail = true;
}
}
},
closeDetail(val) {
this.showDetail = false;
@ -267,11 +270,11 @@ export default {
// //
currentChange(currentPage) {
this.page.currentPage = currentPage;
this.onLoad();
// this.onLoad();
},
sizeChange(pageSize) {
this.page.pageSize = pageSize;
this.onLoad();
// this.onLoad();
},
refreshChange() {
this.page.currentPage = 1;
@ -307,8 +310,8 @@ export default {
this.loading = true;
try {
const params = {
pageNum: this.page.currentPage,
pageSize: this.page.pageSize,
current: this.page.currentPage,
size: this.page.pageSize,
...this.query,
};
const res = await pageBsEfficiencyTaskReport(params);

Loading…
Cancel
Save