Commit defbf877 authored by 姬鋆屾's avatar 姬鋆屾

推更新

parent 18785865
......@@ -113,8 +113,6 @@ export default {
},
},
mounted() {
console.log(this.tableData);
console.log(this.loading);
},
watch: {
tableData(val) {
......
......@@ -22,9 +22,11 @@
<span>&nbsp;</span>
<el-switch
v-if="switchBtn"
v-model="row.check"
@change="$emit('view', row)"
title="核查"
v-model="row.check"
:active-value="true"
:inactive-value="false"
></el-switch>
<span>&nbsp;</span>
<el-button
......
......@@ -66,6 +66,7 @@
notAdd
notDel
notSearch
notPagination
:config="tableConfig"
>
</LayoutTable>
......@@ -107,6 +108,7 @@
notAdd
notDel
notSearch
notPagination
:config="tableConfig"
>
</LayoutTable>
......@@ -148,6 +150,7 @@
notAdd
notDel
notSearch
notPagination
:config="tableConfig"
>
</LayoutTable>
......@@ -189,6 +192,7 @@
notAdd
notDel
notSearch
notPagination
:config="tableConfig"
>
</LayoutTable>
......@@ -230,6 +234,7 @@
notAdd
notDel
notSearch
notPagination
:config="tableConfig"
>
</LayoutTable>
......@@ -310,7 +315,7 @@ export default {
mixins: [form, table],
components: {},
created() {
this.changePath("perform/dept/conf");
this.changePath("perform//staff/conf");
// 获取部门列表
this.$post("/dept/list", { page: 1, size: -1 }).then((res) => {
if (res.code == 1) {
......@@ -319,6 +324,7 @@ export default {
this.deptArr = [];
}
});
this.checkArr = [];
// this.getKaoQin();
},
data() {
......@@ -333,30 +339,17 @@ export default {
direction: "rtl",
toString: [],
toDate: [],
tableData: [
{
core: "-0.5",
name: "迟到",
simple: "迟到5分钟以内(包含5分钟)",
check: false,
},
],
tableData: [],
// 表单校验
rules: {},
activeName: "1",
options: [
{
value: "1",
label: "工作纪律",
},
{
value: "2",
label: "工作效能",
},
],
options: [],
type: "",
keywords: "",
deptArr: [],
urls: {
saveUrl: "/perform/dept/conf/save",
},
config: {
isshowTabPane: false,
search: [],
......@@ -373,36 +366,39 @@ export default {
label: "操作",
width: 100,
formatter: (row) => {
return (
<table-buttons
noAdd
noView
noEdit
noDel
switchBtn
row={row}
onEdit={this.eddRules}
onDel={this.toDelRules}
onView={this.switchChange}
/>
);
if (row.check) {
return <span>不选择</span>;
} else {
return <span style="cursor:pointer">选择</span>;
}
},
},
],
},
cateObj: {},
dataArr: [],
checkArr: [],
};
},
// watch: {
// query: {
// deep,
// handler(val) {
// console.log(val);
// },
// },
// },
methods: {
handleRowClick(val) {
val.check = !val.check;
val.check
? this.checkArr.push(val)
: (this.checkArr = this.checkArr.filter((v) => v.id !== val.id));
this.checkArr.length > 0
? this.checkArr.forEach((val) => {
val.ruleId = val.id;
val.ruleName = val.name;
this.tableData.data.forEach((v) => {
val.id == v.id ? (v.check = val.check) : "";
});
})
: "";
this.form.deptConfDetail = this.checkArr;
this.tableData.data = [...this.tableData.data];
this.$forceUpdate(this.tableData.data);
},
typeSelect(val) {
this.getKaoQin(val);
},
......@@ -423,29 +419,56 @@ export default {
categoryId,
type: this.activeName,
page: this.query.page,
size: -1,
orderColList: this.typeArr,
name: this.searchValue,
}).then((res) => {
if (res.code == 1) {
this.tableData = res.data;
this.checkArr.length > 0
? this.checkArr.forEach((val) => {
this.tableData.data.forEach((v) => {
val.id == v.id ? (v.check = val.check) : "";
});
})
: this.tableData.data.forEach((v) => {
v.check = false;
});
this.tableData.data = [...this.tableData.data];
this.$forceUpdate(this.tableData);
} else {
this.tableData = {};
}
});
},
switchChange(val) {},
handleClick(val) {
this.getData();
this.cateObj = {};
this.type = "";
},
/** 编辑 */
edit(row) {
this.reset();
this.query = { id: row.id };
// this.urls.currUrl = "perform/dept/conf/edit";
this.checkArr = [];
this.type = "";
this.activeName = "1";
this.$get("/perform/dept/conf/info", { id: row.id }).then((res) => {
if (res.code == 1) {
this.form = res.data;
this.checkArr = res.data.deptConfDetail;
res.data.deptConfDetail.length > 0
? res.data.deptConfDetail.forEach((val) => {
val.check = true;
val.id = val.ruleId;
this.tableData.data.forEach((v) => {
v.check = false;
val.ruleId == v.id ? (v.check = true) : "";
});
})
: "";
this.tableData.data = [...this.tableData.data];
this.$forceUpdate(this.tableData);
} else {
this.form = {};
}
......@@ -459,14 +482,18 @@ export default {
/** 新增 */
add(row) {
this.reset();
// this.urls.currUrl = "perform/dept/conf/add";
this.getData();
this.open = true;
this.checkArr = [];
this.type = "";
this.activeName = "1";
this.pageInfo.type = "add";
this.title = "新增部门自动考核信息";
},
/** 查看*/
view(row) {
console.log(123);
return;
this.reset();
this.query = { id: row.id };
this.urls.currUrl = "perform/dept/conf/view";
......
......@@ -17,7 +17,7 @@
<el-row style="width: 100%;margin-bottom: 10px;">
<el-col style="width: 100%;margin-left: 20px;" :span="24">
<span>选择人员:</span>
<el-button type="primary" @click="() => (dialog = true)">{{
<el-button type="primary" @click="handleDialog">{{
selectArr && selectArr.length > 0
? `已选择(${selectArr.length})`
: "点击选择人员"
......@@ -33,12 +33,16 @@
请选择自动考核指标:
</div>
<div class="search_box">
<el-select v-model="type" placeholder="请选择分类">
<el-select
v-model="type"
placeholder="请选择分类"
@change="typeSelect"
>
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
v-for="item in dataArr"
:key="item.id"
:label="item.name"
:value="item.id"
style="width: 200px;"
>
</el-option>
......@@ -52,29 +56,15 @@
</div>
</div>
<div class="mid_table">
<el-table :data="tableData" border style="width: 100%">
<el-table-column type="index" label="序号" width="50">
</el-table-column>
<el-table-column
prop="name"
label="考核内容简称"
width="180"
>
</el-table-column>
<el-table-column prop="simple" label="评分标准">
</el-table-column>
<el-table-column prop="core" label="扣分分值">
</el-table-column>
<el-table-column fixed="right" label="操作" width="120">
<template slot-scope="scope">
<el-switch
v-model="scope.row.check"
@change="handleChange(scope.row)"
>
</el-switch>
</template>
</el-table-column>
</el-table>
<LayoutTable
:data="tableData"
notAdd
notDel
notSearch
notPagination
:config="tableConfig"
>
</LayoutTable>
</div>
</div>
</el-tab-pane>
......@@ -85,12 +75,16 @@
请选择自动考核指标:
</div>
<div class="search_box">
<el-select v-model="type" placeholder="请选择分类">
<el-select
v-model="type"
placeholder="请选择分类"
@change="typeSelect"
>
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
v-for="item in dataArr"
:key="item.id"
:label="item.name"
:value="item.id"
style="width: 200px;"
>
</el-option>
......@@ -104,29 +98,15 @@
</div>
</div>
<div class="mid_table">
<el-table :data="tableData" border style="width: 100%">
<el-table-column type="index" label="序号" width="50">
</el-table-column>
<el-table-column
prop="name"
label="考核内容简称"
width="180"
>
</el-table-column>
<el-table-column prop="simple" label="评分标准">
</el-table-column>
<el-table-column prop="core" label="扣分分值">
</el-table-column>
<el-table-column fixed="right" label="操作" width="120">
<template slot-scope="scope">
<el-switch
v-model="scope.row.check"
@change="handleChange(scope.row)"
>
</el-switch>
</template>
</el-table-column>
</el-table>
<LayoutTable
:data="tableData"
notAdd
notDel
notSearch
notPagination
:config="tableConfig"
>
</LayoutTable>
</div>
</div>
</el-tab-pane>
......@@ -137,12 +117,16 @@
请选择自动考核指标:
</div>
<div class="search_box">
<el-select v-model="type" placeholder="请选择分类">
<el-select
v-model="type"
placeholder="请选择分类"
@change="typeSelect"
>
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
v-for="item in dataArr"
:key="item.id"
:label="item.name"
:value="item.id"
style="width: 200px;"
>
</el-option>
......@@ -156,29 +140,15 @@
</div>
</div>
<div class="mid_table">
<el-table :data="tableData" border style="width: 100%">
<el-table-column type="index" label="序号" width="50">
</el-table-column>
<el-table-column
prop="name"
label="考核内容简称"
width="180"
>
</el-table-column>
<el-table-column prop="simple" label="评分标准">
</el-table-column>
<el-table-column prop="core" label="扣分分值">
</el-table-column>
<el-table-column fixed="right" label="操作" width="120">
<template slot-scope="scope">
<el-switch
v-model="scope.row.check"
@change="handleChange(scope.row)"
>
</el-switch>
</template>
</el-table-column>
</el-table>
<LayoutTable
:data="tableData"
notAdd
notDel
notSearch
notPagination
:config="tableConfig"
>
</LayoutTable>
</div>
</div>
</el-tab-pane>
......@@ -189,12 +159,16 @@
请选择自动考核指标:
</div>
<div class="search_box">
<el-select v-model="type" placeholder="请选择分类">
<el-select
v-model="type"
placeholder="请选择分类"
@change="typeSelect"
>
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
v-for="item in dataArr"
:key="item.id"
:label="item.name"
:value="item.id"
style="width: 200px;"
>
</el-option>
......@@ -208,29 +182,57 @@
</div>
</div>
<div class="mid_table">
<el-table :data="tableData" border style="width: 100%">
<el-table-column type="index" label="序号" width="50">
</el-table-column>
<el-table-column
prop="name"
label="考核内容简称"
width="180"
<LayoutTable
:data="tableData"
notAdd
notDel
notSearch
notPagination
:config="tableConfig"
>
</LayoutTable>
</div>
</div>
</el-tab-pane>
<el-tab-pane label="其他绩效指标" name="5">
<div class="content">
<div class="top">
<div>
请选择自动考核指标:
</div>
<div class="search_box">
<el-select
v-model="type"
placeholder="请选择分类"
@change="typeSelect"
>
</el-table-column>
<el-table-column prop="simple" label="评分标准">
</el-table-column>
<el-table-column prop="core" label="扣分分值">
</el-table-column>
<el-table-column fixed="right" label="操作" width="120">
<template slot-scope="scope">
<el-switch
v-model="scope.row.check"
@change="handleChange(scope.row)"
>
</el-switch>
</template>
</el-table-column>
</el-table>
<el-option
v-for="item in dataArr"
:key="item.id"
:label="item.name"
:value="item.id"
style="width: 200px;"
>
</el-option>
</el-select>
<el-input
v-model="keywords"
placeholder="请输入评分标准关键字搜索"
style="width: 200px;margin: 0 10px;"
></el-input>
<el-button type="primary"> 搜索 </el-button>
</div>
</div>
<div class="mid_table">
<LayoutTable
:data="tableData"
notAdd
notDel
notSearch
notPagination
:config="tableConfig"
>
</LayoutTable>
</div>
</div>
</el-tab-pane>
......@@ -310,7 +312,8 @@
:data="treeData"
:props="defaultProps"
show-checkbox
node-key="label"
style="height: 240px; overflow-y: auto;"
node-key="name"
@check="handleCheckChange"
ref="tree"
></el-tree>
......@@ -322,12 +325,12 @@
<div class="select_content">
<el-tag
v-for="tag in selectArr"
:key="tag.label"
:key="tag.id"
closable
@close="hanleTagClose(tag)"
style="margin-right: 10px;"
style="margin-right: 10px;margin-bottom: 10px;"
>
{{ tag.label }}
{{ tag.name }}
</el-tag>
</div>
</div>
......@@ -342,12 +345,22 @@
<script>
import form from "@/assets/mixins/formdialog";
import table from "@/assets/mixins/table";
export default {
name: "PerformStaffConfDetail",
mixins: [form],
mixins: [form, table],
components: {},
created() {
this.changePath("perform/staff/conf");
// 获取工作人员列表
this.$post("/staff/list", { page: 1, size: -1 }).then((res) => {
if (res.code == 1) {
this.treeData = res.data.data;
} else {
this.treeData = [];
}
});
},
data() {
return {
......@@ -362,103 +375,177 @@ export default {
toString: [],
toDate: [],
selectArr: [],
tableData: [
{
core: "-0.5",
name: "迟到",
simple: "迟到5分钟以内(包含5分钟)",
check: false,
},
],
tableData: [],
// 表单校验
rules: {},
activeName: "1",
options: [
{
value: "1",
label: "工作纪律",
},
{
value: "2",
label: "工作效能",
},
],
options: [],
type: "",
keywords: "",
treeData: [
{
label: "市民中心",
children: [
{
label: "部门1",
children: [
{
label: "人员1",
},
{
label: "人员2",
},
{
label: "人员3",
},
],
},
{
label: "部门2",
children: [
{
label: "人员4",
},
{
label: "人员5",
},
{
label: "人员6",
},
],
},
{
label: "部门3",
children: [
{
label: "人员7",
label: "人员8",
label: "人员9",
label: "人员10",
},
],
},
],
},
],
treeData: [],
defaultProps: {
children: "children",
label: "label",
label: "name",
},
urls: {
saveUrl: "/perform/staff/conf/save",
},
config: {
isshowTabPane: false,
search: [],
columns: [
{ type: "index", label: "序号", width: 50 },
{ label: "考核内容简称", prop: "name" },
{ label: "评分标准", prop: "content" },
{ label: "分值", prop: "score" },
{
label: "操作",
width: 100,
formatter: (row) => {
if (row.check) {
return <span>不选择</span>;
} else {
return <span style="cursor:pointer">选择</span>;
}
},
},
],
},
cateObj: {},
dataArr: [],
checkArr: [],
};
},
methods: {
handleDialog() {
this.dialog = true;
this.$nextTick(() => {
this.$refs.tree.setCheckedNodes(this.selectArr);
});
},
handleRowClick(val) {
val.check = !val.check;
val.check
? this.checkArr.push(val)
: (this.checkArr = this.checkArr.filter((v) => v.id !== val.id));
this.checkArr.length > 0
? this.checkArr.forEach((val) => {
val.ruleId = val.id;
val.ruleName = val.name;
this.tableData.data.forEach((v) => {
val.id == v.id ? (v.check = val.check) : "";
});
})
: "";
this.form.staffConfDetail = this.checkArr;
this.tableData.data = [...this.tableData.data];
this.$forceUpdate(this.tableData.data);
},
typeSelect(val) {
this.getKaoQin(val);
},
async getData() {
await this.$post("/perform/rules/category/list", {
type: this.activeName,
}).then((res) => {
this.getKaoQin(this.cateObj ? this.cateObj.id : "");
if (res.code == 1) {
this.dataArr = res.data.data;
} else {
this.dataArr = [];
}
});
},
async getKaoQin(categoryId) {
await this.$post("/perform/rules/list", {
categoryId,
type: this.activeName,
page: this.query.page,
size: -1,
orderColList: this.typeArr,
name: this.searchValue,
}).then((res) => {
if (res.code == 1) {
this.tableData = res.data;
this.checkArr.length > 0
? this.checkArr.forEach((val) => {
this.tableData.data.forEach((v) => {
val.id == v.id ? (v.check = val.check) : "";
});
})
: this.tableData.data.forEach((v) => {
v.check = false;
});
this.tableData.data = [...this.tableData.data];
this.$forceUpdate(this.tableData);
} else {
this.tableData = {};
}
});
},
hanleTagClose(val) {
this.selectArr = this.selectArr.filter((v) => v.label !== val.label);
this.selectArr = this.selectArr.filter((v) => v.name != val.name);
this.$refs.tree.setCheckedNodes(this.selectArr);
this.form.staffIds = this.selectArr.map((v) => v.id).join(",");
},
handleCheckChange(checkedNodes, checkedKeys) {
console.log(checkedNodes);
console.log(checkedKeys);
checkedKeys.checkedNodes.forEach((v) => {
v.children ? "" : (this.selectArr = [...this.selectArr, v]);
});
// checkedKeys.checkedNodes.forEach((v) => {
// v.children ? "" : (this.selectArr = [...this.selectArr, v]);
// });
this.selectArr = checkedKeys.checkedNodes;
this.form.staffIds = this.selectArr.map((v) => v.id).join(",");
},
handleChange(val) {
console.log(val);
},
handleClick() {},
handleClick(val) {
this.getData();
this.cateObj = {};
this.type = "";
},
/** 编辑 */
edit(row) {
this.reset();
this.query = { id: row.id };
this.urls.currUrl = "perform/staff/conf/edit";
// this.urls.currUrl = "perform/staff/conf/edit";
this.checkArr = [];
this.selectArr = [];
this.type = "";
this.activeName = "1";
this.$get("/perform/staff/conf/info", { id: row.id }).then((res) => {
if (res.code == 1) {
this.form = res.data;
console.log(this.treeData);
let arr = res.data.staffIds.split(",");
this.selectArr = [];
arr.forEach((v) => {
this.treeData.forEach((val) => {
v == val.id ? this.selectArr.push(val) : "";
});
});
this.checkArr = res.data.staffConfDetail;
res.data.staffConfDetail.length > 0
? res.data.staffConfDetail.forEach((val) => {
val.check = true;
val.id = val.ruleId;
this.tableData.data.forEach((v) => {
v.check = false;
val.ruleId == v.id ? (v.check = true) : "";
});
})
: "";
this.tableData.data = [...this.tableData.data];
this.$forceUpdate(this.tableData);
} else {
this.form = {};
}
this.open = true;
});
this.getData();
this.pageInfo.type = "edit";
this.title = "修改人员自动考核信息";
......@@ -466,8 +553,13 @@ export default {
/** 新增 */
add(row) {
this.reset();
this.urls.currUrl = "perform/staff/conf/add";
// this.urls.currUrl = "perform/staff/conf/add";
this.checkArr = [];
this.selectArr = [];
this.type = "";
this.activeName = "1";
this.getData();
this.open = true;
this.pageInfo.type = "add";
this.title = "新增人员自动考核信息";
},
......@@ -519,15 +611,18 @@ export default {
</script>
<style lang="less" scoped>
.form_content {
overflow-x: hidden;
/deep/.el-col-12 {
width: 98% !important;
}
.content {
width: 100%;
height: 500px;
height: 720px;
border: 1px solid #e4e7ed;
border-top: 0;
padding: 20px;
overflow-x: hidden;
.top {
display: flex;
justify-content: space-between;
......
......@@ -17,7 +17,7 @@
<div class="goal_title">
<img src="../../../../assets/images/u17641.svg" alt="" />
<span>
{{ val.deptName ? val.deptName : "--" }}
{{ val.deptName ? val.deptName : val.staffNames }}
</span>
</div>
<p class="goal_txt">
......@@ -25,19 +25,19 @@
</p>
<p>
<el-tag style="margin: 0 5px 5px 0"
>考勤绩效指标/工作纪律{{ val.attendCount }}</el-tag
>考勤绩效指标:{{ val.attendCount }}</el-tag
>
<el-tag style="margin: 0 5px 5px 0"
>评价绩效指标/工作纪律{{ val.assessCount }}</el-tag
>评价绩效指标:{{ val.assessCount }}</el-tag
>
<el-tag style="margin: 0 5px 5px 0"
>办件绩效指标/工作效能{{ val.workCount }}</el-tag
>办件绩效指标:{{ val.workCount }}</el-tag
>
<el-tag style="margin: 0 5px 5px 0"
>效能绩效指标/工作纪律{{ val.effectCount }}</el-tag
>效能绩效指标:{{ val.effectCount }}</el-tag
>
<el-tag style="margin: 0 5px 5px 0"
>其他绩效指标/工作纪律{{ val.otherCount }}</el-tag
>其他绩效指标:{{ val.otherCount }}</el-tag
>
</p>
<p class="goal_txt">
......@@ -68,7 +68,7 @@
</el-tab-pane>
<el-tab-pane label="窗口负责人管理" name="2">
<div class="content">
<LayoutTable :data="tableData" notSearch :config="tableConfig">
<LayoutTable :data="tableData" notSearch notDel :config="tableConfig">
</LayoutTable>
</div>
</el-tab-pane>
......@@ -99,7 +99,6 @@ export default {
},
mixins: [table],
created() {
console.log(this.tableData);
sessionStorage.removeItem("type");
sessionStorage.setItem("type", this.type);
},
......@@ -168,6 +167,13 @@ export default {
})
: "";
},
// 窗口负责人删除方法
toDel(row) {
this.$get("/window/owner/delete", { id: row }).then((res) => {
this.$message.success(res.msg);
this.getData();
});
},
},
data() {
return {
......@@ -182,13 +188,11 @@ export default {
{ type: "selection", width: 60 },
{ type: "index", label: "序号", width: 50 },
{ label: "部门名称", prop: "deptName" },
{ label: "姓名", prop: "name" },
{ label: "负责人姓名", prop: "name" },
{ label: "工号", prop: "number" },
{ label: "所属部门", prop: "deptName" },
{ label: "电话号码", prop: "phone" },
{ label: "联系电话", prop: "phone" },
{
label: "负责窗口数量",
......@@ -197,10 +201,17 @@ export default {
},
{
label: "创建时间",
prop: "createTime",
label: "更新时间",
prop: "updateTime",
formatter: this.formatterDate,
},
{
label: "更新人员",
prop: "updateUserId",
formatter: this.formatter,
},
{
label: "操作",
width: 240,
......@@ -208,6 +219,7 @@ export default {
return (
<table-buttons
noAdd
noView
row={row}
onEdit={this.toEdit}
onView={this.toView}
......@@ -319,6 +331,9 @@ export default {
margin-right: 10px;
}
}
/deep/.el-tag {
width: 114px !important;
}
.goal_txt {
font-family: "微软雅黑", sans-serif;
font-weight: 400;
......
......@@ -23,18 +23,22 @@
<Field
label="联系电话:"
prop="phone"
maxLength="11"
v-model="form.phone"
placeholder="请输入联系电话"
/>
<el-col style="width: 100%;" :span="24">
<Field
label="选择部门:"
prop="deptId"
v-model="form.deptId"
placeholder="选择部门"
:enumData="deptGroup"
type="select"
/>
<el-col style="width: 100%;" :span="12">
<el-form-item label="选择部门">
<el-select v-model="form.deptId" style="width: 100%;">
<el-option
v-for="item in deptArr"
:key="item.id"
:label="item.deptName"
:value="item.id"
>
</el-option
></el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
......@@ -42,48 +46,33 @@
<div class="content_top">
<span>请选择窗口工作人员:</span>
<div class="search_box">
<el-select v-model="type" placeholder="请选择部门">
<el-select v-model="deptValue" style="width: 100%;">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
style="width: 200px;"
v-for="item in deptArr"
:key="item.id"
:label="item.deptName"
:value="item.id"
>
</el-option>
</el-select>
</el-option
></el-select>
<el-input
v-model="keywords"
placeholder="请输入姓名关键字搜索"
style="width: 200px;margin: 0 10px;"
></el-input>
<el-button type="primary"> 搜索 </el-button>
<el-button type="primary" @click="handleSearch"> 搜索 </el-button>
</div>
</div>
<div class="table_box">
<el-table
<LayoutTable
:data="tableData"
border
style="width: 100%"
height="520"
@selection-change="handleSelectionChange"
notAdd
notDel
notSearch
notPagination
:config="tableConfig"
>
<el-table-column type="selection" width="55"> </el-table-column>
<el-table-column type="index" label="序号" width="50">
</el-table-column>
<el-table-column prop="name" label="姓名" width="180">
</el-table-column>
<el-table-column prop="id" label="工号"> </el-table-column>
<el-table-column prop="deptaName" label="部门"> </el-table-column>
<el-table-column prop="zhiwei" label="职位"> </el-table-column>
<el-table-column prop="status" label="状态"> </el-table-column>
<el-table-column prop="phone" label="手机号"> </el-table-column>
<el-table-column fixed="right" label="操作" width="120">
<template slot-scope="scope">
<span>{{ scope.row.check ? "已选择" : "选择" }}</span>
</template>
</el-table-column>
</el-table>
</LayoutTable>
</div>
</div>
</el-row>
......@@ -143,12 +132,23 @@
<script>
import form from "@/assets/mixins/formdialog";
import table from "@/assets/mixins/table";
export default {
name: "WindowOwnerDetail",
mixins: [form],
mixins: [form, table],
components: {},
created() {
this.changePath("window/owner");
// 获取部门列表
this.$post("/dept/list", { page: 1, size: -1 }).then((res) => {
if (res.code == 1) {
this.deptArr = res.data.data;
} else {
this.deptArr = [];
}
});
// this.getData();
},
data() {
return {
......@@ -159,68 +159,144 @@ export default {
// 是否显示弹出层
open: false,
direction: "rtl",
deptValue: "",
toString: [],
toDate: [],
deptArr: [],
// 表单校验
rules: {},
deptGroup: { 1: "部门1", 2: "部门2", 3: "部门3", 4: "部门4", 5: "部门5" },
options: [
{
value: "1",
label: "部门1",
},
{
value: "2",
label: "部门2",
},
],
type: "",
keywords: "",
tableData: [
{
id: "123456",
name: "xxx",
deptName: "部门1",
zhiwei: "工作人员",
status: "正式",
phone: "130****8888",
check: false,
},
{
id: "123456",
name: "xxx",
deptName: "部门1",
zhiwei: "工作人员",
status: "正式",
phone: "130****8888",
check: false,
},
],
checkArr: [],
urls: {
saveUrl: "/window/owner/save",
},
config: {
isshowTabPane: false,
search: [],
columns: [
{ type: "index", label: "序号", width: 50 },
{ label: "姓名", prop: "name" },
{ label: "工号", prop: "workNum" },
{ label: "部门", prop: "deptName" },
{ label: "职位", prop: "positionName" },
{ label: "员工状态", prop: "status", formatter: this.formatter },
{ label: "手机号码", prop: "phoneNumber" },
{
label: "操作",
width: 100,
formatter: (row) => {
if (row.check) {
return <span>不选择</span>;
} else {
return <span style="cursor:pointer">选择</span>;
}
},
},
],
},
};
},
methods: {
handleSelectionChange(val) {
console.log(val);
this.tableData.forEach((v) => (v.check = false));
val.forEach((v) => {
v.check = true;
handleSearch() {
this.getData();
},
getData() {
this.$post("/staff/list", {
page: 1,
size: -1,
deptId: this.deptValue,
name: this.keywords,
}).then((res) => {
if (res.code == 1) {
this.tableData = res.data;
this.checkArr.length > 0
? this.checkArr.forEach((val) => {
this.tableData.data.forEach((v) => {
val.id == v.id ? (v.check = val.check) : "";
});
})
: this.tableData.data.forEach((v) => {
v.check = false;
});
this.tableData.data = [...this.tableData.data];
this.$forceUpdate(this.tableData);
} else {
this.deptArr = [];
}
});
},
handleRowClick(val) {
val.check = !val.check;
val.check
? this.checkArr.push(val)
: (this.checkArr = this.checkArr.filter((v) => v.id !== val.id));
this.checkArr.length > 0
? this.checkArr.forEach((val) => {
val.staffId = val.id;
this.tableData.data.forEach((v) => {
val.id == v.id ? (v.check = val.check) : "";
});
})
: "";
this.tableData.data = [...this.tableData.data];
this.form.windowOwnerDetailList = this.checkArr;
this.$forceUpdate(this.tableData.data);
},
/** 编辑 */
edit(row) {
this.reset();
this.query = { id: row.id };
this.urls.currUrl = "window/owner/edit";
this.deptValue = "";
this.keywords = "";
this.checkArr = [];
this.$get("/window/owner/info", { id: row.id }).then((res) => {
if (res.code == 1) {
this.form = res.data;
this.checkArr = res.data.windowOwnerDetailList;
res.data.windowOwnerDetailList.length > 0
? res.data.windowOwnerDetailList.forEach((val) => {
val.check = true;
val.id = val.staffId;
this.tableData.data.forEach((v) => {
v.check = false;
val.staffId == v.id ? (v.check = true) : "";
});
})
: "";
this.tableData.data = [...this.tableData.data];
this.$forceUpdate(this.tableData);
} else {
this.form = {};
}
this.open = true;
});
this.getData();
// this.urls.currUrl = "window/owner/edit";
// this.getData();
this.pageInfo.type = "edit";
this.title = "修改窗口负责人";
},
/** 新增 */
add(row) {
this.reset();
this.urls.currUrl = "window/owner/add";
// this.urls.currUrl = "window/owner/add";
// this.getData();
this.deptValue = "";
this.checkArr = [];
this.keywords = "";
this.getData();
this.open = true;
this.pageInfo.type = "add";
this.title = "新增窗口负责人";
},
......@@ -228,8 +304,8 @@ export default {
view(row) {
this.reset();
this.query = { id: row.id };
this.urls.currUrl = "window/owner/view";
this.getData();
// this.urls.currUrl = "window/owner/view";
// this.getData();
this.pageInfo.type = "view";
this.title = "窗口负责人详细";
},
......@@ -250,7 +326,7 @@ export default {
// 表单重置
reset() {
this.form = {
deptId: 0,
deptId: "",
deptName: "",
name: "",
number: "",
......@@ -275,7 +351,7 @@ export default {
padding: 0 20px;
.bottom_content {
width: 100%;
height: 600px;
height: 680px;
background-color: rgba(242, 246, 252, 1);
box-sizing: border-box;
border-width: 1px;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment