flat: 暂存

This commit is contained in:
Apcallover
2024-03-18 11:34:50 +08:00
parent 0a91d8d9d8
commit fbc380bfff
5 changed files with 91 additions and 47 deletions

View File

@@ -98,7 +98,9 @@
</tag-select>
</template>
<!--自定义按钮-->
<template slot="menuLeft">
<template slot="menuRight">
<el-button type="primary" size="small" icon="el-icon-delete" @click="() => { $refs.crud.rowAdd(); selectPolicyTree = []}">
新增</el-button>
<el-button type="danger" size="small" icon="el-icon-delete" @click="handleDelete"
:disabled="!selectionList.length" plain v-show="vaildData(permission.tenant_talents_groupdelete, false)">
删除</el-button>
@@ -106,7 +108,14 @@
<template slot="name" slot-scope="{row}">
<span>{{ row.name }}</span>
<!-- <span v-else>{{ row.name }}<span style="color: red;">未实名</span></span> -->
</template>
<template slot="policyIdsForm" slot-scope="{row}">
<el-cascader
v-model="selectPolicyTree"
:options="listAllPolicyTree"
:props="{ expandTrigger: 'hover', multiple: true, label: 'name', value: 'value', children: 'child'}"
@change="handleChange"
></el-cascader>
</template>
<!--/自定义按钮-->
<template slot-scope="{row,index}" slot="menu">
@@ -315,7 +324,8 @@ import {
getServeListTalents,
getMatchWorkStation,
getMatchPolicy,
getMatchServeList
getMatchServeList,
getListAllPolicy
} from "@/api/tenant/serve";
import { detail as missionDetail } from "@/api/tenant/mission";
import { detail as workDetail } from "@/api/tenant/postzp";
@@ -332,6 +342,7 @@ import missionView from "../../mission/Table/missionView.vue";
import workView from "../../works/Table/missionView.vue"
import {serviceType} from "@/common/dic";
import Tinymce from "@/components/Tinymce";
import {forEach} from "lodash";
const page = {
pageSize: 10,
currentPage: 1,
@@ -429,6 +440,8 @@ export default {
logPage: Object.assign({} ,page),
obj: {},
excelForm: { isCovered: 1 },
listAllPolicyTree: [],
selectPolicyTree: [],
};
},
components: { addGroups, transferGroups, Resume, ied, missionView, workView, Tinymce},
@@ -485,7 +498,7 @@ export default {
};
return {
height: "auto",
dialogWidth: "30%",
dialogWidth: "60%",
calcHeight: 180,
align: "center",
menuAlign: "center",
@@ -493,13 +506,14 @@ export default {
columnBtn: false,
searchBtn: true,
searchShow: true,
addBtn: false,
viewBtn: true,
searchMenuSpan: 6,
border: true,
index: false,
indexLabel: "序号",
selection: true,
dialogType: "dialog",
dialogType: "drawer",
dialogClickModal: false,
column: [
{
@@ -507,6 +521,15 @@ export default {
prop: "companyName",
addDisplay: false,
},
{
label: "政策",
prop: "policyIds",
// search: true,
span: 24,
hide: true,
// display: false,
formslot: true,
},
{
label: "服务名称",
prop: "name",
@@ -870,8 +893,18 @@ export default {
this.initDept();
// this.getWorkTypes();
this.getLabelList();
this.getListAllPolicyTree()
},
methods: {
handleChange(item) {
console.log(item)
},
async getListAllPolicyTree() {
let resData = await getListAllPolicy({})
if(resData.data.code === 200) {
this.listAllPolicyTree = resData.data.data
}
},
toPolicyDetail(row) {
console.log(row)
console.log()
@@ -1073,6 +1106,7 @@ export default {
},
/*获取人才详情 */
beforeOpen(done, type) {
const self = this
if (["edit", "view", "add"].includes(type)) {
if (type === "edit" || type === "view") {
setTimeout(() => {
@@ -1080,6 +1114,8 @@ export default {
(res) => {
this.obj = res.data.data;
this.tempWorkType = this.obj.serveLabels.split(",");
const policyIds = self.treeIteration(this.listAllPolicyTree, res.data.data.policyIds.split(','))
self.selectPolicyTree = policyIds
done();
},
(error) => {
@@ -1093,23 +1129,39 @@ export default {
}
}
},
treeIteration(tree, ids) {
if( !(tree.length && ids.length) ) return;
let arr = []
tree.forEach((treeItem) => {
treeItem.child.forEach((item) => {
if(ids.some((id) => item.value === id)) {
arr.push([treeItem.value, item.value])
}
})
})
return arr;
},
/*新增人才*/
rowSave(row, done) {
add({
groupId: row.groupId,
name: row.name,
serveLabels: row.serveLabels,
remarks: row.remarks,
}).then(
let params = {
groupId: row.groupId,
name: row.name,
serveLabels: row.serveLabels,
remarks: row.remarks,
policyIds: this.selectPolicyTree.map((item) => item[1]).join(','),
}
add(params).then(
() => {
this.$message({
type: "success",
message: "操作成功!",
});
done();
this.selectPolicyTree = []
this.refresh();
},
(error) => {
this.selectPolicyTree = []
window.console.log(error);
done();
}