|
@@ -6,10 +6,6 @@
|
|
|
<SplitArea :size="leftSplitWidth" :minSize="240">
|
|
<SplitArea :size="leftSplitWidth" :minSize="240">
|
|
|
<div>
|
|
<div>
|
|
|
<div>
|
|
<div>
|
|
|
- <!-- <el-checkbox v-model="containsSubDeptChecked"
|
|
|
|
|
- >包含下级机构</el-checkbox
|
|
|
|
|
- > -->
|
|
|
|
|
-
|
|
|
|
|
<kt-button style="
|
|
<kt-button style="
|
|
|
background-color: #ffc000;
|
|
background-color: #ffc000;
|
|
|
border: #ffc000;
|
|
border: #ffc000;
|
|
@@ -36,10 +32,9 @@
|
|
|
<!-- 新增修改界面 -->
|
|
<!-- 新增修改界面 -->
|
|
|
<el-dialog :title="dialogTitle" width="60%" :visible.sync="dialogVisible" :close-on-click-modal="false"
|
|
<el-dialog :title="dialogTitle" width="60%" :visible.sync="dialogVisible" :close-on-click-modal="false"
|
|
|
:before-close="handleDialogBefore" @close="closeDialog" v-dialogDrag>
|
|
:before-close="handleDialogBefore" @close="closeDialog" v-dialogDrag>
|
|
|
- <el-tabs v-model="activeName" :before-leave="beforeTabLeave" >
|
|
|
|
|
|
|
+ <el-tabs v-model="activeName">
|
|
|
<el-tab-pane label="基本信息" name="1">
|
|
<el-tab-pane label="基本信息" name="1">
|
|
|
- <el-form :model="formData" :rules="formDataRules" ref="formData" :inline="true" @keyup.enter.native="nextStep()"
|
|
|
|
|
- label-width="130px" size="small">
|
|
|
|
|
|
|
+ <el-form :model="formData" :rules="formDataRules" ref="formData" :inline="true" label-width="130px" size="small">
|
|
|
<el-row>
|
|
<el-row>
|
|
|
<el-col :span="8">
|
|
<el-col :span="8">
|
|
|
<el-form-item label="机构名称" prop="deptId">
|
|
<el-form-item label="机构名称" prop="deptId">
|
|
@@ -79,7 +74,7 @@
|
|
|
|
|
|
|
|
<el-col :span="8">
|
|
<el-col :span="8">
|
|
|
<el-form-item label="状态" prop="status">
|
|
<el-form-item label="状态" prop="status">
|
|
|
- <el-select style="width:200px" v-model="formData.status" placeholder="请选择">
|
|
|
|
|
|
|
+ <el-select :disabled="dialogTitle == '新增出单员'" style="width:200px" v-model="formData.status" placeholder="请选择">
|
|
|
<el-option v-for="val in user_statusoptions" :label="val.label" :value="val.value"
|
|
<el-option v-for="val in user_statusoptions" :label="val.label" :value="val.value"
|
|
|
:key="val.id"></el-option>
|
|
:key="val.id"></el-option>
|
|
|
</el-select>
|
|
</el-select>
|
|
@@ -124,7 +119,6 @@
|
|
|
import tree from "@/components/ztree.vue"; // 机构树组件
|
|
import tree from "@/components/ztree.vue"; // 机构树组件
|
|
|
import templateTable from '../../../components/TemplateTable/index.vue'
|
|
import templateTable from '../../../components/TemplateTable/index.vue'
|
|
|
import peopleImage from '@/components/PeopleImage/index.vue'
|
|
import peopleImage from '@/components/PeopleImage/index.vue'
|
|
|
- import { validateSfz } from "../../../utils/validate.js";
|
|
|
|
|
export default {
|
|
export default {
|
|
|
components: {
|
|
components: {
|
|
|
KtButton,
|
|
KtButton,
|
|
@@ -134,67 +128,8 @@
|
|
|
},
|
|
},
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
- activeName: '1',
|
|
|
|
|
|
|
+ activeName: '1', //弹框tab索引
|
|
|
isShow:true,
|
|
isShow:true,
|
|
|
- //56个民族
|
|
|
|
|
- nationalList: [
|
|
|
|
|
- "汉族",
|
|
|
|
|
- "壮族",
|
|
|
|
|
- "满族",
|
|
|
|
|
- "回族",
|
|
|
|
|
- "苗族",
|
|
|
|
|
- "维吾尔族",
|
|
|
|
|
- "土家族",
|
|
|
|
|
- "彝族",
|
|
|
|
|
- "蒙古族",
|
|
|
|
|
- "藏族",
|
|
|
|
|
- "布依族",
|
|
|
|
|
- "侗族",
|
|
|
|
|
- "瑶族",
|
|
|
|
|
- "朝鲜族",
|
|
|
|
|
- "白族",
|
|
|
|
|
- "哈尼族",
|
|
|
|
|
- "哈萨克族",
|
|
|
|
|
- "黎族",
|
|
|
|
|
- "傣族",
|
|
|
|
|
- "畲族",
|
|
|
|
|
- "傈僳族",
|
|
|
|
|
- "仡佬族",
|
|
|
|
|
- "东乡族",
|
|
|
|
|
- "高山族",
|
|
|
|
|
- "拉祜族",
|
|
|
|
|
- "水族",
|
|
|
|
|
- "佤族",
|
|
|
|
|
- "纳西族",
|
|
|
|
|
- "羌族",
|
|
|
|
|
- "土族",
|
|
|
|
|
- "仫佬族",
|
|
|
|
|
- "锡伯族",
|
|
|
|
|
- "柯尔克孜族",
|
|
|
|
|
- "达斡尔族",
|
|
|
|
|
- "景颇族",
|
|
|
|
|
- "毛南族",
|
|
|
|
|
- "撒拉族",
|
|
|
|
|
- "布朗族",
|
|
|
|
|
- "塔吉克族",
|
|
|
|
|
- "阿昌族",
|
|
|
|
|
- "普米族",
|
|
|
|
|
- "鄂温克族",
|
|
|
|
|
- "怒族",
|
|
|
|
|
- "京族",
|
|
|
|
|
- "基诺族",
|
|
|
|
|
- "德昂族",
|
|
|
|
|
- "保安族",
|
|
|
|
|
- "俄罗斯族",
|
|
|
|
|
- "裕固族",
|
|
|
|
|
- "乌兹别克族",
|
|
|
|
|
- "门巴族",
|
|
|
|
|
- "鄂伦春族",
|
|
|
|
|
- "独龙族",
|
|
|
|
|
- "塔塔尔族",
|
|
|
|
|
- "赫哲族",
|
|
|
|
|
- "珞巴族",
|
|
|
|
|
- ],
|
|
|
|
|
formList: [
|
|
formList: [
|
|
|
{
|
|
{
|
|
|
label: "工号",
|
|
label: "工号",
|
|
@@ -265,20 +200,6 @@
|
|
|
formData: {
|
|
formData: {
|
|
|
roleId: '19',
|
|
roleId: '19',
|
|
|
},
|
|
},
|
|
|
- formDataDetail: {},
|
|
|
|
|
- formDataRulesDetail: {
|
|
|
|
|
- // accountno: [{ required: true, message: "请填写开户账号", trigger: "blur" }],
|
|
|
|
|
- // address: [{ required: true, message: "请填写居住地址", trigger: "blur" }],
|
|
|
|
|
- // bankName: [{ required: true, message: "请填写开户行", trigger: "blur" }],
|
|
|
|
|
- // birthday: [{ required: true, message: "请填写出生日期", trigger: "blur" }],
|
|
|
|
|
- // identity:
|
|
|
|
|
- // [{ required: true, message: "请填写身份证号" },
|
|
|
|
|
- // { validator: validateSfz }],
|
|
|
|
|
-
|
|
|
|
|
- // koseki: [{ required: true, message: "请填写户籍", trigger: "blur" }],
|
|
|
|
|
- // maritalStatus: [{ required: true, message: "请选择婚姻状况", trigger: "change" }],
|
|
|
|
|
- // nations: [{ required: true, message: "请选择民族", trigger: "change" }],
|
|
|
|
|
- },
|
|
|
|
|
formDataRules: {
|
|
formDataRules: {
|
|
|
deptId: [{ required: true, message: "请选择机构", trigger: "change" }],
|
|
deptId: [{ required: true, message: "请选择机构", trigger: "change" }],
|
|
|
mobile: [
|
|
mobile: [
|
|
@@ -320,15 +241,11 @@
|
|
|
},
|
|
},
|
|
|
ztreeNodes: [],
|
|
ztreeNodes: [],
|
|
|
currentTreeNode: null,
|
|
currentTreeNode: null,
|
|
|
- // 右侧列表查询数据Start
|
|
|
|
|
- queryFrom: {},
|
|
|
|
|
|
|
+ queryFrom: {},// 右侧列表查询数据Start
|
|
|
pageResult: [],
|
|
pageResult: [],
|
|
|
containsSubDeptChecked: true, //是否包含下级机构
|
|
containsSubDeptChecked: true, //是否包含下级机构
|
|
|
- dialogTitle: "",
|
|
|
|
|
|
|
+ dialogTitle: "", //弹框title
|
|
|
dialogVisible: false, // 新增编辑界面是否显示
|
|
dialogVisible: false, // 新增编辑界面是否显示
|
|
|
- departmentList: [], // 选中公司的所有部门的集合
|
|
|
|
|
- deptInfo: {}, //选中机构的基本信息
|
|
|
|
|
- sexoptions: JSON.parse(localStorage.getItem('sexOptions')),
|
|
|
|
|
user_statusoptions: JSON.parse(localStorage.getItem('user_statusoptions')),
|
|
user_statusoptions: JSON.parse(localStorage.getItem('user_statusoptions')),
|
|
|
roles: JSON.parse(localStorage.getItem('find_all')),
|
|
roles: JSON.parse(localStorage.getItem('find_all')),
|
|
|
option: [], //机构列表
|
|
option: [], //机构列表
|
|
@@ -336,12 +253,6 @@
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
created() {
|
|
created() {
|
|
|
- // this.$api.role.findAll().then((res) => {
|
|
|
|
|
- // this.roles = res.data
|
|
|
|
|
- // })
|
|
|
|
|
- //获取所有下拉框数据(字典)
|
|
|
|
|
- // this.getDictItems("sex");
|
|
|
|
|
- // this.getDictItems("user_status");
|
|
|
|
|
this.findLeftTreeData(); // 获取机构树的数据
|
|
this.findLeftTreeData(); // 获取机构树的数据
|
|
|
this.findPage()
|
|
this.findPage()
|
|
|
},
|
|
},
|
|
@@ -351,87 +262,30 @@
|
|
|
},
|
|
},
|
|
|
watch: {
|
|
watch: {
|
|
|
containsSubDeptChecked() {
|
|
containsSubDeptChecked() {
|
|
|
- // 监听是否包含下级
|
|
|
|
|
- // this.pageData.containsSubDept.value = this
|
|
|
|
|
- // .containsSubDeptChecked
|
|
|
|
|
- // ? "1"
|
|
|
|
|
- // : "0";
|
|
|
|
|
this.findPage();
|
|
this.findPage();
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
- // excel导入
|
|
|
|
|
- carfrontChange(file) {
|
|
|
|
|
- const params = new FormData(); // 声明formData数据类型
|
|
|
|
|
- params.append("file", file.file);
|
|
|
|
|
- params.append("deptId", this.deptId);
|
|
|
|
|
- this.$api.dept.newUserImport(params).then(res => {
|
|
|
|
|
- if (res.code == 200) {
|
|
|
|
|
- this.$message({
|
|
|
|
|
- message: res.msg,
|
|
|
|
|
- type: "success"
|
|
|
|
|
- });
|
|
|
|
|
- this.findPage();
|
|
|
|
|
- } else {
|
|
|
|
|
- this.$message.error(res.msg);
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- },
|
|
|
|
|
- identityChange(iden){
|
|
|
|
|
- let sex = null;
|
|
|
|
|
- let birth = null;
|
|
|
|
|
- let myDate = new Date();
|
|
|
|
|
- let month = myDate.getMonth() + 1;
|
|
|
|
|
- let day = myDate.getDate();
|
|
|
|
|
- sex = iden.substring(16,17);
|
|
|
|
|
- birth = iden.substring(6,10)+"-"+iden.substring(10,12)+"-"+iden.substring(12,14);
|
|
|
|
|
- if (iden.substring(10, 12) < month || iden.substring(10, 12) == month && iden.substring(12, 14) <= day) age++;
|
|
|
|
|
- if(sex%2 === 0)
|
|
|
|
|
- sex = '女';
|
|
|
|
|
- else
|
|
|
|
|
- sex = '男';
|
|
|
|
|
- this.formDataDetail.birthday=birth
|
|
|
|
|
- this.formDataDetail.sex=this.sexoptions.find(val=>sex==val.label).value
|
|
|
|
|
- },
|
|
|
|
|
- // 查询Start
|
|
|
|
|
- queryStaffInfo() {
|
|
|
|
|
- this.findPage();
|
|
|
|
|
- },
|
|
|
|
|
- sexFormatter(row) {
|
|
|
|
|
- // return this.sexoptions[row.sex]
|
|
|
|
|
- // return row.sex+'1'
|
|
|
|
|
- // console.log(val,1)
|
|
|
|
|
- // console.log(val,1)
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ // 初始化树的宽度
|
|
|
changeTreeWidth(widthVal) {
|
|
changeTreeWidth(widthVal) {
|
|
|
- // 初始化树的宽度
|
|
|
|
|
this.leftSplitWidth = Math.ceil(
|
|
this.leftSplitWidth = Math.ceil(
|
|
|
(widthVal / this.$refs.elMain.$el.clientWidth) * 100
|
|
(widthVal / this.$refs.elMain.$el.clientWidth) * 100
|
|
|
);
|
|
);
|
|
|
this.rightSplitWidth = 100 - this.leftSplitWidth;
|
|
this.rightSplitWidth = 100 - this.leftSplitWidth;
|
|
|
},
|
|
},
|
|
|
|
|
+ // 获取机构树的数据
|
|
|
findLeftTreeData() {
|
|
findLeftTreeData() {
|
|
|
this.$api.dept.findDeptTree().then((res) => {
|
|
this.$api.dept.findDeptTree().then((res) => {
|
|
|
this.ztreeNodes = res.data;
|
|
this.ztreeNodes = res.data;
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
- onZTreeClick: function (evt, treeId, treeNode) {
|
|
|
|
|
- // 点击事件
|
|
|
|
|
|
|
+ // 点击事件
|
|
|
|
|
+ onZTreeClick(evt, treeId, treeNode) {
|
|
|
this.currentTreeNode = evt;
|
|
this.currentTreeNode = evt;
|
|
|
this.deptId = this.currentTreeNode.id;
|
|
this.deptId = this.currentTreeNode.id;
|
|
|
this.pageData.pageNum = 1;
|
|
this.pageData.pageNum = 1;
|
|
|
this.findPage();
|
|
this.findPage();
|
|
|
- // this.formData.deptId = [];
|
|
|
|
|
- // this.platform(treeId);
|
|
|
|
|
- },
|
|
|
|
|
- platform(array) {
|
|
|
|
|
- if (!array.parent) {
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
- this.formData.deptId.unshift(array.data.id);
|
|
|
|
|
- this.platform(array.parent);
|
|
|
|
|
},
|
|
},
|
|
|
-
|
|
|
|
|
//联级选择器触发事件
|
|
//联级选择器触发事件
|
|
|
handleChange(val) {
|
|
handleChange(val) {
|
|
|
if (val && val.length !== 0) {
|
|
if (val && val.length !== 0) {
|
|
@@ -446,14 +300,10 @@
|
|
|
findPage(data) {
|
|
findPage(data) {
|
|
|
this.tableConfig.loading = true;
|
|
this.tableConfig.loading = true;
|
|
|
this.$api.user
|
|
this.$api.user
|
|
|
- // .findPage({dto,pageNum:this.pageData.pageNum,pageSize:this.pageData.pageSize})
|
|
|
|
|
.findPage({ ...this.pageData, dto: { ...data, roleId: '19', deptId: this.deptId } })
|
|
.findPage({ ...this.pageData, dto: { ...data, roleId: '19', deptId: this.deptId } })
|
|
|
.then((res) => {
|
|
.then((res) => {
|
|
|
if (res.code == 200 && res.data.content.length > 0) {
|
|
if (res.code == 200 && res.data.content.length > 0) {
|
|
|
res.data.content.forEach(val => {
|
|
res.data.content.forEach(val => {
|
|
|
- if (val.sex && val.sex !== '' && val.sex !== null ) {
|
|
|
|
|
- val.sex = this.sexoptions.find(ele => ele.value == val.sex).label
|
|
|
|
|
- }
|
|
|
|
|
if (val.status && val.status !== '' && val.status !== null) {
|
|
if (val.status && val.status !== '' && val.status !== null) {
|
|
|
val.status = this.user_statusoptions.find(ele => ele.value == val.status).label
|
|
val.status = this.user_statusoptions.find(ele => ele.value == val.status).label
|
|
|
}
|
|
}
|
|
@@ -502,25 +352,6 @@
|
|
|
this.$message.error(res.msg);
|
|
this.$message.error(res.msg);
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- // 删除单个人员
|
|
|
|
|
- handleTableDeleteFlag(data) {
|
|
|
|
|
- this.$confirm("确认删除?")
|
|
|
|
|
- .then(() => {
|
|
|
|
|
- this.$api.user.getDeleteBatch([data.row.userId]).then((res) => {
|
|
|
|
|
- if (res.code == 200) {
|
|
|
|
|
- this.$message({
|
|
|
|
|
- message: "删除成功",
|
|
|
|
|
- type: "success",
|
|
|
|
|
- });
|
|
|
|
|
- this.findPage();
|
|
|
|
|
- }
|
|
|
|
|
- else {
|
|
|
|
|
- this.$message.error(res.msg);
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- })
|
|
|
|
|
- .catch(() => { });
|
|
|
|
|
- },
|
|
|
|
|
//添加人员
|
|
//添加人员
|
|
|
handleAddButton() {
|
|
handleAddButton() {
|
|
|
//级联渲染部门列表
|
|
//级联渲染部门列表
|
|
@@ -531,6 +362,7 @@
|
|
|
this.$message.info("请选择所属公司或部门");
|
|
this.$message.info("请选择所属公司或部门");
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
+ let statusArr = this.user_statusoptions.filter(item=>item.label=='正常')
|
|
|
this.dialogPassword = true
|
|
this.dialogPassword = true
|
|
|
this.formData = {
|
|
this.formData = {
|
|
|
roleId: '19',
|
|
roleId: '19',
|
|
@@ -538,35 +370,22 @@
|
|
|
referrerId:'',
|
|
referrerId:'',
|
|
|
deptId: this.deptId
|
|
deptId: this.deptId
|
|
|
}
|
|
}
|
|
|
- this.formDataDetail = {}
|
|
|
|
|
|
|
+ this.formData.status = statusArr.length > 0 ? statusArr[0].value : ''
|
|
|
this.activeName = '1'
|
|
this.activeName = '1'
|
|
|
this.dialogTitle = "新增出单员";
|
|
this.dialogTitle = "新增出单员";
|
|
|
this.dialogVisible = true;
|
|
this.dialogVisible = true;
|
|
|
|
|
|
|
|
},
|
|
},
|
|
|
- // 新增或修改的弹出框Start
|
|
|
|
|
- getDictItems(typeName) {
|
|
|
|
|
- //--数据字典--
|
|
|
|
|
- this.$api.dict
|
|
|
|
|
- .findByLableName(typeName)
|
|
|
|
|
- .then((response) => {
|
|
|
|
|
- this[typeName + "options"] = response.data; // 把获取到的数据赋给this.data
|
|
|
|
|
- })
|
|
|
|
|
- .catch((error) => {
|
|
|
|
|
- this[typeName + "options"] = [];
|
|
|
|
|
- });
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ // 退出对话框之前确认提示
|
|
|
handleDialogBefore(done) {
|
|
handleDialogBefore(done) {
|
|
|
- // 退出对话框之前确认提示
|
|
|
|
|
this.$confirm("确认关闭?")
|
|
this.$confirm("确认关闭?")
|
|
|
.then((_) => {
|
|
.then((_) => {
|
|
|
done();
|
|
done();
|
|
|
})
|
|
})
|
|
|
.catch((_) => { });
|
|
.catch((_) => { });
|
|
|
},
|
|
},
|
|
|
|
|
+ // 清空数据
|
|
|
closeDialog() {
|
|
closeDialog() {
|
|
|
- // 清空数据
|
|
|
|
|
- this.deptInfo = {};
|
|
|
|
|
this.dialogVisible = false;
|
|
this.dialogVisible = false;
|
|
|
},
|
|
},
|
|
|
// 提交
|
|
// 提交
|
|
@@ -576,9 +395,6 @@
|
|
|
this.$confirm("确认提交吗?", "提示", {})
|
|
this.$confirm("确认提交吗?", "提示", {})
|
|
|
.then(() => {
|
|
.then(() => {
|
|
|
if (this.dialogTitle == '新增出单员') {
|
|
if (this.dialogTitle == '新增出单员') {
|
|
|
- if(!this.formDataDetail.password){
|
|
|
|
|
- this.formDataDetail.password=this.formDataDetail.mobile+'@2023'
|
|
|
|
|
- }
|
|
|
|
|
this.$api.user.saveUserInfo({sysUser: this.formData}).then((res) => {
|
|
this.$api.user.saveUserInfo({sysUser: this.formData}).then((res) => {
|
|
|
if (res.code == 200) {
|
|
if (res.code == 200) {
|
|
|
this.$message({
|
|
this.$message({
|
|
@@ -621,27 +437,7 @@
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
- beforeTabLeave(){
|
|
|
|
|
- // let p = new Promise((resolve, reject) => {
|
|
|
|
|
- // this.$refs.formData.validate(async (valid) => {
|
|
|
|
|
- // valid ? resolve() : reject();
|
|
|
|
|
- // if (valid !== resolve()) {
|
|
|
|
|
- // // this.$message.error("请完善基本信息!");
|
|
|
|
|
- // }
|
|
|
|
|
-
|
|
|
|
|
- // });
|
|
|
|
|
- // });
|
|
|
|
|
- // return p;
|
|
|
|
|
- },
|
|
|
|
|
- // 下一步
|
|
|
|
|
- nextStep() {
|
|
|
|
|
- this.$refs.formData.validate((valid) => {
|
|
|
|
|
- if (valid) {
|
|
|
|
|
- this.activeName = '2'
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- },
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ }
|
|
|
};
|
|
};
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|