|
@@ -55,21 +55,21 @@
|
|
|
</div>
|
|
|
<el-dialog :title="modalType == 'add' ? $t('common.add') : $t('common.edit')" v-if="dialogVisible" v-model="dialogVisible" width="500" v-loading="loading">
|
|
|
<byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="byform">
|
|
|
- <template #account>pleaseEnterTheUsername
|
|
|
+ <template #account>
|
|
|
<el-input style="width: 150px; margin-right: 10px" v-model="formData.data.userName" :placeholder="$t('dept.pleaseEnterTheUsername')"></el-input>
|
|
|
<el-input style="width: 150px; margin-right: 10px" v-model="formData.data.password" :placeholder="$t('dept.pleaseEnterThePassword')"></el-input>
|
|
|
- <span style="color: #409eff; cursor: pointer" @click="newPassword">随机生成</span>
|
|
|
+ <span style="color: #409eff; cursor: pointer" @click="newPassword">{{$t('dept.randomGeneration')}}</span>
|
|
|
</template>
|
|
|
</byForm>
|
|
|
<template #footer>
|
|
|
- <el-button @click="dialogVisible = false" size="large">取 消</el-button>
|
|
|
- <el-button type="primary" @click="submitForm('byform')" size="large" :loading="submitLoading">确 定</el-button>
|
|
|
+ <el-button @click="dialogVisible = false" size="large">{{$t('dept.cancel')}}</el-button>
|
|
|
+ <el-button type="primary" @click="submitForm('byform')" size="large" :loading="submitLoading">{{$t('dept.confirm')}}</el-button>
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
<el-dialog title="修改密码" v-model="roomDialogVisible" width="500" :before-close="handleClose" v-loading="loading">
|
|
|
<template #footer>
|
|
|
- <el-button @click="roomDialogVisible = false" size="large">取 消</el-button>
|
|
|
- <el-button type="primary" @click="submitTree('byform')" size="large" :loading="submitLoading">确 定</el-button>
|
|
|
+ <el-button @click="roomDialogVisible = false" size="large">{{$t('dept.cancel')}}</el-button>
|
|
|
+ <el-button type="primary" @click="submitTree('byform')" size="large" :loading="submitLoading">{{$t('dept.confirm')}}</el-button>
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
@@ -92,15 +92,16 @@ const sourceList = ref({
|
|
|
pageSize: 10,
|
|
|
},
|
|
|
});
|
|
|
+const { proxy } = getCurrentInstance();
|
|
|
let dialogVisible = ref(false);
|
|
|
let modalType = ref("add");
|
|
|
let rules = ref({
|
|
|
- parentId: [{ required: true, message: "请选择上级机构", trigger: "blur" }],
|
|
|
- orderNum: [{ required: true, message: "排序不能为空", trigger: "blur" }],
|
|
|
- deptName: [{ required: true, message: "机构名称不能为空", trigger: "blur" }],
|
|
|
- type: [{ required: true, message: "机构类型不能为空", trigger: "change" }],
|
|
|
+ parentId: [{ required: true, message: proxy.t('dept.pleaseSelectTheParentDept'), trigger: "blur" }],
|
|
|
+ orderNum: [{ required: true, message: proxy.t('dept.serialNumberCannotBeEmpty'), trigger: "blur" }],
|
|
|
+ deptName: [{ required: true, message: proxy.t('dept.deptNameCannotBeEmpty'), trigger: "blur" }],
|
|
|
+ type: [{ required: true, message: proxy.t('dept.deptTypeCannotBeEmpty'), trigger: "change" }],
|
|
|
});
|
|
|
-const { proxy } = getCurrentInstance();
|
|
|
+
|
|
|
const selectConfig = computed(() => {
|
|
|
return [];
|
|
|
});
|
|
@@ -108,13 +109,13 @@ const config = computed(() => {
|
|
|
return [
|
|
|
{
|
|
|
attrs: {
|
|
|
- label: "机构名称",
|
|
|
+ label: proxy.t('dept.deptName'),
|
|
|
prop: "deptName",
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
attrs: {
|
|
|
- label: "机构类型",
|
|
|
+ label: proxy.t('dept.deptType'),
|
|
|
prop: "type",
|
|
|
align: "left",
|
|
|
},
|
|
@@ -125,19 +126,19 @@ const config = computed(() => {
|
|
|
},
|
|
|
{
|
|
|
attrs: {
|
|
|
- label: "排序",
|
|
|
+ label: proxy.t('common.serialNumber'),
|
|
|
prop: "nickName",
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
attrs: {
|
|
|
- label: "创建时间",
|
|
|
+ label: proxy.t('common.createTime'),
|
|
|
prop: "createTime",
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
attrs: {
|
|
|
- label: "操作",
|
|
|
+ label: proxy.t('common.operation'),
|
|
|
width: "200",
|
|
|
align: "right",
|
|
|
},
|
|
@@ -146,7 +147,7 @@ const config = computed(() => {
|
|
|
return [
|
|
|
{
|
|
|
attrs: {
|
|
|
- label: "修改",
|
|
|
+ label: proxy.t('common.edit'),
|
|
|
type: "primary",
|
|
|
text: true,
|
|
|
},
|
|
@@ -157,7 +158,7 @@ const config = computed(() => {
|
|
|
},
|
|
|
{
|
|
|
attrs: {
|
|
|
- label: "删除",
|
|
|
+ label: proxy.t('common.delete'),
|
|
|
type: "danger",
|
|
|
text: true,
|
|
|
},
|
|
@@ -188,13 +189,13 @@ const formConfig = computed(() => {
|
|
|
{
|
|
|
type: "treeSelect",
|
|
|
prop: "parentId",
|
|
|
- label: "上级机构",
|
|
|
+ label: proxy.t('dept.parentDept'),
|
|
|
data: [],
|
|
|
},
|
|
|
{
|
|
|
type: "input",
|
|
|
prop: "deptName",
|
|
|
- label: "机构名称",
|
|
|
+ label: proxy.t('dept.deptName'),
|
|
|
required: true,
|
|
|
itemWidth: 50,
|
|
|
//disabled:true,
|
|
@@ -203,37 +204,37 @@ const formConfig = computed(() => {
|
|
|
{
|
|
|
type: "select",
|
|
|
prop: "type",
|
|
|
- label: "机构类型",
|
|
|
+ label: proxy.t('dept.deptType'),
|
|
|
required: true,
|
|
|
data: [
|
|
|
{
|
|
|
- label: "公司",
|
|
|
+ label: proxy.t('dept.company'),
|
|
|
value: 0,
|
|
|
},
|
|
|
{
|
|
|
- label: "业务中心",
|
|
|
+ label: proxy.t('dept.businessCenter'),
|
|
|
value: 1,
|
|
|
},
|
|
|
{
|
|
|
- label: "部门",
|
|
|
+ label: proxy.t('dept.department'),
|
|
|
value: 2,
|
|
|
},
|
|
|
{
|
|
|
- label: "组",
|
|
|
+ label: proxy.t('dept.组'),
|
|
|
value: 3,
|
|
|
},
|
|
|
],
|
|
|
},
|
|
|
{
|
|
|
type: "select",
|
|
|
- label: "负责人",
|
|
|
+ label: proxy.t('dept.deptManager'),
|
|
|
prop: "leaderId",
|
|
|
itemWidth: 50,
|
|
|
data: [],
|
|
|
},
|
|
|
{
|
|
|
type: "select",
|
|
|
- label: "总监",
|
|
|
+ label: proxy.t('dept.deptDirector'),
|
|
|
prop: "directorId",
|
|
|
itemWidth: 50,
|
|
|
data: [],
|
|
@@ -241,7 +242,7 @@ const formConfig = computed(() => {
|
|
|
{
|
|
|
type: "input",
|
|
|
prop: "orderNum",
|
|
|
- label: "排序",
|
|
|
+ label: proxy.t('common.serialNumber'),
|
|
|
required: true,
|
|
|
itemWidth: 50,
|
|
|
//disabled:true,
|
|
@@ -342,7 +343,7 @@ const submitForm = () => {
|
|
|
)
|
|
|
.then((res) => {
|
|
|
ElMessage({
|
|
|
- message: modalType.value == "add" ? "添加成功" : "编辑成功",
|
|
|
+ message: modalType.value == "add" ? proxy.t('common.addSuccess') : proxy.t('common.editSuccess'),
|
|
|
type: "success",
|
|
|
});
|
|
|
dialogVisible.value = false;
|
|
@@ -365,15 +366,15 @@ const recursive = (data) => {
|
|
|
|
|
|
const listDelete = (row) => {
|
|
|
// 弹窗提示是否删除
|
|
|
- ElMessageBox.confirm("此操作将永久删除该数据, 是否继续?", "提示", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
+ ElMessageBox.confirm(proxy.t('common.thisOperationWillPermanentlyDeleteTheData'),proxy.t('common.prompt'), {
|
|
|
+ confirmButtonText: proxy.t('common.confirm'),
|
|
|
+ cancelButtonText: proxy.t('common.cancel'),
|
|
|
type: "warning",
|
|
|
}).then(() => {
|
|
|
// 删除
|
|
|
proxy.post("/tenantDept/" + row.deptId, {}, "delete").then((res) => {
|
|
|
ElMessage({
|
|
|
- message: "删除成功",
|
|
|
+ message: proxy.t('common.deleteSuccess'),
|
|
|
type: "success",
|
|
|
});
|
|
|
getList();
|
|
@@ -381,7 +382,11 @@ const listDelete = (row) => {
|
|
|
});
|
|
|
};
|
|
|
const showType = (type) => {
|
|
|
- return type == 0 ? "公司" : type == 1 ? "业务中心" : type == 2 ? "部门" : "组";
|
|
|
+ return type == 0 ?
|
|
|
+ proxy.t('dept.company') : type == 1 ?
|
|
|
+ proxy.t('dept.businessCenter') : type == 2 ?
|
|
|
+ proxy.t('dept.department') :
|
|
|
+ proxy.t('dept.group');
|
|
|
};
|
|
|
const getDtl = (row) => {
|
|
|
formData.data = { ...row };
|