转岗管理问题修改

dev-scheduling
zhangdi 3 months ago
parent 0cfc0fe72e
commit ee72d3e2d7
  1. 10
      src/api/workLicense/jobTransferManagement.js
  2. 46
      src/views/workLicense/personnelEquipment.vue
  3. 91
      src/views/workLicense/workLicense.vue

@ -95,3 +95,13 @@ export const layoffPlan = row => {
params:row
});
};
// 获取人员信息 /blade-desk/BA/TeamSet/getOneByUserId?userId=1297
export const getOneByUserId = params => {
return request({
url: '/blade-desk/BA/TeamSet/getOneByUserId',
method: 'get',
params:params
});
};

@ -16,9 +16,10 @@
@size-change="sizeChange"
@refresh-change="refreshChange"
@on-load="onLoad"
:span-method="spanMethod"
:row-class-name="rowClassName"
>
<!-- :span-method="spanMethod" -->
<template #menu-left>
<el-button type="danger" @click="handleDeletes">批量删除</el-button>
<el-button type="primary" @click="handleMaintain">设备维护</el-button>
@ -387,26 +388,41 @@ export default {
if (this.selectionList.length == 0) {
this.$message.error('请至少选择一条数据');
} else {
let ids = [];
this.selectionList.forEach(item => {
ids.push(item.id);
});
remove({ ids: ids.join(',') }).then(res => {
this.$message.success('操作成功');
this.onLoad(this.page, this.query);
// certificateTypeId
const invalidItem = this.selectionList.find(
item => !item.certificateTypeId || item.certificateTypeId === ''
);
if (invalidItem) {
this.$message.error('存在未分配设备的数据,无法删除');
return;
}
this.$confirm('确定删除数据吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}).then(() => {
let ids = [];
this.selectionList.forEach(item => {
ids.push(item.id);
});
remove(ids.join(',')).then(res => {
this.$message.success('操作成功');
this.onLoad(this.page, this.query);
});
});
}
},
//
handleMaintain() {
if (this.selectionList.length > 0) {
let tmp = this.data.filter(item1 =>
this.selectionList.some(item2 => item2.name === item1.name)
);
let tmp1 = Array.from(new Set(tmp.map(item => item.equipmentId))).map(wlCode => {
return tmp.find(item => item.equipmentId === wlCode);
});
this.maintainList = tmp1;
// let tmp = this.data.filter(item1 =>
// this.selectionList.some(item2 => item2.name === item1.name)
// );
// let tmp1 = Array.from(new Set(tmp.map(item => item.equipmentId))).map(wlCode => {
// return tmp.find(item => item.equipmentId === wlCode);
// });
this.maintainList = this.selectionList;
} else {
this.maintainList = [];
}

@ -15,9 +15,10 @@
@size-change="sizeChange"
@refresh-change="refreshChange"
@on-load="onLoad"
:span-method="spanMethod"
:row-class-name="rowClassName"
>
<!-- :span-method="spanMethod" -->
<template #menu-left>
<el-button type="danger" @click="handleDeletes">批量删除</el-button>
<el-button type="primary" @click="handleMaintain">证书维护</el-button>
@ -25,7 +26,9 @@
<template #menu-right>
<!-- <el-button type="primary" @click="handleImport"> </el-button> -->
</template>
<template #menu="{ row }"> </template>
<template #menu="{ row }">
<!-- <el-button type="text" @click="handleDeletes(row)">删除</el-button> -->
</template>
<template #heatTreat="scope"> </template>
</avue-crud>
@ -428,13 +431,13 @@ export default {
//
handleMaintain() {
if (this.selectionList.length > 0) {
let tmp = this.data.filter(item1 =>
this.selectionList.some(item2 => item2.name === item1.name)
);
let tmp1 = Array.from(new Set(tmp.map(item => item.certificateCode))).map(wlCode => {
return tmp.find(item => item.certificateCode === wlCode);
});
this.maintainList = tmp1;
// let tmp = this.data.filter(item1 =>
// this.selectionList.some(item2 => item2.name === item1.name)
// );
// let tmp1 = Array.from(new Set(tmp.map(item => item.certificateCode))).map(wlCode => {
// return tmp.find(item => item.certificateCode === wlCode);
// });
this.maintainList = this.selectionList;
} else {
this.maintainList = [];
}
@ -486,44 +489,44 @@ export default {
},
//
spanMethod({ row, column, rowIndex, columnIndex }) {
if (columnIndex === 0 || columnIndex === 1) {
// prop: 'name' 0
const rows = this.data;
const currentName = row.name;
let rowspan = 1;
let isTopRow = true;
// if (columnIndex === 0 || columnIndex === 1) {
// // prop: 'name' 0
// const rows = this.data;
// const currentName = row.name;
// let rowspan = 1;
// let isTopRow = true;
// name
for (let i = rowIndex - 1; i >= 0; i--) {
if (rows[i].name === currentName) {
isTopRow = false;
break;
} else {
break;
}
}
// // name
// for (let i = rowIndex - 1; i >= 0; i--) {
// if (rows[i].name === currentName) {
// isTopRow = false;
// break;
// } else {
// break;
// }
// }
// rowspan=0
if (!isTopRow) {
return {
rowspan: 0,
colspan: 0,
};
}
// name
for (let i = rowIndex + 1; i < rows.length; i++) {
if (rows[i].name === currentName) {
rowspan++;
} else {
break;
}
}
// // rowspan=0
// if (!isTopRow) {
// return {
// rowspan: 0,
// colspan: 0,
// };
// }
// // name
// for (let i = rowIndex + 1; i < rows.length; i++) {
// if (rows[i].name === currentName) {
// rowspan++;
// } else {
// break;
// }
// }
return {
rowspan: rowspan,
colspan: 1,
};
}
// return {
// rowspan: rowspan,
// colspan: 1,
// };
// }
},
searchReset() {

Loading…
Cancel
Save