转岗管理问题修改

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

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

Loading…
Cancel
Save