Commit b10ec09f authored by 赵啸非's avatar 赵啸非

Merge remote-tracking branch 'origin/master'

parents cbc2d2c5 215234b9
<template> <template>
<div> <div>
<!-- 弹出框表单 --> <!-- 弹出框表单 -->
<el-drawer <el-drawer :title="title" :visible.sync="open" :direction="direction" size="50%">
:title="title"
:visible.sync="open"
:direction="direction"
size="50%">
<div class="tips">此功能为快速添加员工入口,如需为员工办理完整的入职手续,请使用[员工关系-入职管理]功能</div> <div class="tips">此功能为快速添加员工入口,如需为员工办理完整的入职手续,请使用[员工关系-入职管理]功能</div>
<el-form ref="form" :model="form" :rules="rules" label-width="120px"> <el-form ref="form" :model="form" :rules="rules" label-width="120px">
...@@ -18,19 +14,50 @@ ...@@ -18,19 +14,50 @@
<!-- <Field label="政治面貌 " prop="politicalstatus" v-model="form.politicalstatus" type="select" :enumData="dict.politicalstatus" placeholder="请选择政治面貌 "/> --> <!-- <Field label="政治面貌 " prop="politicalstatus" v-model="form.politicalstatus" type="select" :enumData="dict.politicalstatus" placeholder="请选择政治面貌 "/> -->
<!-- <Field label="所属部门名称" prop="deptName" v-model="form.deptName" placeholder="请输入所属部门名称"/> --> <!-- <Field label="所属部门名称" prop="deptName" v-model="form.deptName" placeholder="请输入所属部门名称"/> -->
<Field label="员工姓名" :maxLength="10" prop="name" v-model="form.name" placeholder="请输入员工姓名"/> <Field
label="员工姓名"
:maxLength="10"
prop="name"
v-model="form.name"
placeholder="请输入员工姓名"
/>
<Field label="手机号码" :maxLength="11" prop="phoneNumber" v-model="form.phoneNumber" placeholder="请输入联系电话"/> <Field
label="手机号码"
:maxLength="11"
prop="phoneNumber"
v-model="form.phoneNumber"
placeholder="请输入联系电话"
/>
<!-- <Field label="所属部门" :maxLength="10" prop="deptName" v-model="form.deptName" placeholder="请选择所属部门" @focus="ishowBumen = true"/> <!-- <Field label="所属部门" :maxLength="10" prop="deptName" v-model="form.deptName" placeholder="请选择所属部门" @focus="ishowBumen = true"/>
--> -->
<Field label="所属部门" prop="deptId" v-model="form.deptId" :enumData="dict.deptId" type="select" placeholder="请选择所属部门" /> <Field
label="所属部门"
prop="deptId"
v-model="form.deptId"
:enumData="dict.deptId"
type="select"
placeholder="请选择所属部门"
/>
<Field
label="职位"
prop="positionId"
v-model="form.positionId"
:enumData="dict.positionId"
type="select"
placeholder="请选择职位"
/>
<Field label="职位" prop="positionId" v-model="form.positionId" :enumData="dict.positionId" type="select" placeholder="请选择职位" /> <Field
label="工号"
<Field label="工号" :maxLength="15" prop="workNum" v-model="form.workNum" placeholder="请输入工号"/> :maxLength="15"
prop="workNum"
v-model="form.workNum"
placeholder="请输入工号"
/>
<!-- <Field label="是否在政务大厅" prop="positionId" v-model="form.positionId" placeholder="请选择" type="select"/> --> <!-- <Field label="是否在政务大厅" prop="positionId" v-model="form.positionId" placeholder="请选择" type="select"/> -->
<!-- <Field label="职位名称" prop="positionName" v-model="form.positionName" placeholder="请输入职位名称"/> --> <!-- <Field label="职位名称" prop="positionName" v-model="form.positionName" placeholder="请输入职位名称"/> -->
...@@ -43,7 +70,7 @@ ...@@ -43,7 +70,7 @@
<!-- <Field label="备注" prop="remark" v-model="form.remark" type="textarea" placeholder="请输入备注"/> --> <!-- <Field label="备注" prop="remark" v-model="form.remark" type="textarea" placeholder="请输入备注"/> -->
</el-row> </el-row>
<form-buttons @submit='submitForm' noCancelBtn /> <form-buttons @submit="submitForm" noCancelBtn />
</el-form> </el-form>
</el-drawer> </el-drawer>
<!-- 部门选择 --> <!-- 部门选择 -->
...@@ -65,19 +92,21 @@ ...@@ -65,19 +92,21 @@
:expand-on-click-node="false" :expand-on-click-node="false"
:render-content="renderContent" :render-content="renderContent"
@node-click="handleNodeClick" @node-click="handleNodeClick"
> ></el-tree>
</el-tree>
</el-scrollbar> </el-scrollbar>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<div class="titles">已选部门</div> <div class="titles">已选部门</div>
<div class="el-tag flex flex-pack-justify mt10" v-if="deptnode.label" style="max-width:80%"> <div
class="el-tag flex flex-pack-justify mt10"
v-if="deptnode.label"
style="max-width:80%"
>
<div>{{deptnode.label}}</div> <div>{{deptnode.label}}</div>
<div @click="cancledept()"> <div @click="cancledept()">
<i class="el-icon-close"></i> <i class="el-icon-close"></i>
</div> </div>
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
<div class="mt20"> <div class="mt20">
...@@ -86,25 +115,39 @@ ...@@ -86,25 +115,39 @@
</div> </div>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import form from "@/assets/mixins/formdialog"; import form from "@/assets/mixins/formdialog";
export default { export default {
name: "StaffDetail", name: "StaffDetail",
mixins: [form], mixins: [form],
props:{ props: {
bumentree:{ bumentree: {
type:Array, type: Array,
default:[] default: []
},
currentNode:{
type:Object,
default:{}
} }
}, },
components: { components: {},
watch: {
open(newval) {
if (newval) {
console.log(newval, this.currentNode, this.form.deptId,this.dict.deptId);
if(this.currentNode && this.currentNode.id){
this.form.deptId = JSON.stringify(this.currentNode.id)
this.form.deptName = this.currentNode.label
}
console.log(newval, this.currentNode, this.form.deptId);
}
}
}, },
created() { created() {
this.changePath("staff") this.changePath("staff");
}, },
data() { data() {
return { return {
...@@ -114,61 +157,49 @@ ...@@ -114,61 +157,49 @@
title: "个人主页", title: "个人主页",
// 是否显示弹出层 // 是否显示弹出层
open: false, open: false,
direction:"rtl", direction: "rtl",
toString:[ toString: ["gender", "politicalstatus", "staffType", "status"],
"gender", toDate: ["birthday", "entryDate", "regularDate", "leaveDate"],
"politicalstatus",
"staffType",
"status",
],
toDate:[
"birthday",
"entryDate",
"regularDate",
"leaveDate",
],
// 表单校验 // 表单校验
rules: { rules: {
name: [ name: [
{required: true,message: "请输入员工姓名", trigger: "blur" }, { required: true, message: "请输入员工姓名", trigger: "blur" },
{max: 64,message: "最多只能录入64个字符",trigger: "blur",}, { max: 64, message: "最多只能录入64个字符", trigger: "blur" }
], ],
phoneNumber: [ phoneNumber: [
{required: true,message: "请输入员工手机号码", trigger: "blur" }, { required: true, message: "请输入员工手机号码", trigger: "blur" },
{max: 11,message: "最多只能录入11个字符",trigger: "blur",}, { max: 11, message: "最多只能录入11个字符", trigger: "blur" }
], ],
deptName: [ deptName: [
{required: true,message: "请选择所属部门", trigger: "change" }, { required: true, message: "请选择所属部门", trigger: "change" }
], ],
positionId: [ positionId: [
{required: true,message: "请选择职位", trigger: "blur" } { required: true, message: "请选择职位", trigger: "blur" }
],
workNum: [
{required: true,message: "请输入工号" },
], ],
workNum: [{ required: true, message: "请输入工号" }]
}, },
treeProps: { treeProps: {
id: "id", id: "id",
label: "label", label: "label",
areaCode:"areaCode", areaCode: "areaCode",
type: "type", type: "type",
isLeaf: "isLeaf", isLeaf: "isLeaf",
children: "children", children: "children",
icon: "icon", icon: "icon"
}, },
ishowBumen:false, ishowBumen: false,
deptnode:{} deptnode: {}
} };
}, },
methods: { methods: {
renderContent: function (h, { node, data, store }) { renderContent: function(h, { node, data, store }) {
return ( return (
<span> <span>
<i style="font-size:16px;color:#409EFF" class={data.icon}></i> <i style="font-size:16px;color:#409EFF" class={data.icon}></i>
<span style="padding-left: 2px;font-size:14px">{node.label}</span> <span style="padding-left: 2px;font-size:14px">{node.label}</span>
</span> </span>
) );
}, },
async loadNode(node, resolve) { async loadNode(node, resolve) {
if (node.level === 0) { if (node.level === 0) {
...@@ -178,37 +209,37 @@ ...@@ -178,37 +209,37 @@
}, },
// 点击 // 点击
handleNodeClick(node) { handleNodeClick(node) {
this.deptnode = node this.deptnode = node;
}, },
comfirmbument(){ comfirmbument() {
this.form.deptId = this.deptnode.id this.form.deptId = this.deptnode.id;
this.form.deptName = this.deptnode.label this.form.deptName = this.deptnode.label;
this.ishowBumen = false this.ishowBumen = false;
}, },
/** 编辑 */ /** 编辑 */
edit(row) { edit(row) {
this.reset() this.reset();
this.query = { id: row.id }; this.query = { id: row.id };
this.urls.currUrl ="staff/edit"; this.urls.currUrl = "staff/edit";
this.getData(); this.getData();
this.pageInfo.type="edit" this.pageInfo.type = "edit";
this.title = "修改员工基本信息"; this.title = "修改员工基本信息";
}, },
/** 新增 */ /** 新增 */
add(row) { add(row) {
this.reset() this.reset();
this.urls.currUrl = "staff/add"; this.urls.currUrl = "staff/add";
this.getData(); this.getData();
this.pageInfo.type="add" this.pageInfo.type = "add";
this.title = "新增员工基本信息"; this.title = "新增员工基本信息";
}, },
/** 查看*/ /** 查看*/
view(row) { view(row) {
this.reset() this.reset();
this.query = { id: row.id }; this.query = { id: row.id };
this.urls.currUrl ="staff/view"; this.urls.currUrl = "staff/view";
this.getData(); this.getData();
this.pageInfo.type="view" this.pageInfo.type = "view";
this.title = "员工基本信息详细"; this.title = "员工基本信息详细";
}, },
/**取消按钮 */ /**取消按钮 */
...@@ -228,25 +259,25 @@ ...@@ -228,25 +259,25 @@
// 表单重置 // 表单重置
reset() { reset() {
this.form = { this.form = {
name : "", name: "",
gender : 1, gender: 1,
birthday : null, birthday: null,
photoPath : "", photoPath: "",
phoneNumber : "", phoneNumber: "",
idCard : "", idCard: "",
workNum : "", workNum: "",
politicalstatus : 1, politicalstatus: 1,
deptId : null, deptId: null,
deptName : "", deptName: "",
positionId : null, positionId: null,
positionName : "", positionName: "",
staffType : 1, staffType: 1,
status : 1, status: 1,
registerPath : "", registerPath: "",
entryDate : null, entryDate: null,
regularDate : null, regularDate: null,
leaveDate : null, leaveDate: null,
remark : "", remark: ""
}; };
this.resetForm("form"); this.resetForm("form");
}, },
...@@ -255,30 +286,30 @@ ...@@ -255,30 +286,30 @@
this.$refs[refName].resetFields(); this.$refs[refName].resetFields();
} }
}, },
cancledept(){ cancledept() {
this.deptnode = {} this.deptnode = {};
}
} }
} }
};
</script> </script>
<style scoped> <style scoped>
.tips{ .tips {
margin-left: 120px; margin-left: 120px;
margin-bottom: 20px; margin-bottom: 20px;
color: #999; color: #999;
font-size: 15px; font-size: 15px;
} }
.titles{ .titles {
color: #409EFF; color: #409eff;
font-size: 16px; font-size: 16px;
display: flex; display: flex;
align-items: center; align-items: center;
} }
.titles::before{ .titles::before {
content: ''; content: "";
width:6px; width: 6px;
height: 16px; height: 16px;
background-color: #409EFF; background-color: #409eff;
display: inline-block; display: inline-block;
margin-right: 10px; margin-right: 10px;
} }
......
...@@ -182,7 +182,7 @@ ...@@ -182,7 +182,7 @@
</div> </div>
</el-dialog> </el-dialog>
<drawer-show ref="drawerform" @ok="getData" :bumentree="areaData" /> <drawer-show ref="drawerform" @ok="getData" :bumentree="areaData" :currentNode="currentNode"/>
</div> </div>
</template> </template>
...@@ -248,6 +248,7 @@ export default { ...@@ -248,6 +248,7 @@ export default {
}, },
handleNodeClick(node) { handleNodeClick(node) {
console.log(node,123123);
this.currentNode = node; this.currentNode = node;
this.query = { deptId: node.id }; this.query = { deptId: node.id };
this.getData(); this.getData();
......
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