|
|
@@ -40,7 +40,14 @@
|
|
|
}}</a>
|
|
|
</span>
|
|
|
<span>
|
|
|
- <a style="color: red" @click="deleteOrganization(record.key)">删除</a>
|
|
|
+ <a-popconfirm
|
|
|
+ title="确定删除吗!"
|
|
|
+ ok-text="确定"
|
|
|
+ cancel-text="取消"
|
|
|
+ @confirm="deleteOrganization(record.key)"
|
|
|
+ >
|
|
|
+ <a style="color: red">删除</a>
|
|
|
+ </a-popconfirm>
|
|
|
</span>
|
|
|
</div>
|
|
|
</template>
|
|
|
@@ -151,6 +158,7 @@ const dataSource = ref([]); // 表格部门
|
|
|
const drawerTitle = ref(''); //抽屉标题
|
|
|
const organization = ref({}); // 部门详情
|
|
|
const editVisible = ref(false); // 抽屉开关
|
|
|
+const organizationId = ref(''); // 所选部门ID
|
|
|
// const clientAdditionHql = ref({});
|
|
|
const clientNameStr = ref('');
|
|
|
const { proxy } = getCurrentInstance(); //访问this
|
|
|
@@ -190,7 +198,6 @@ const getClientId = (value, client) => {
|
|
|
|
|
|
// 新建部门
|
|
|
const createOrganization = () => {
|
|
|
- console.log(clientNameStr.value, '6666');
|
|
|
organization.value = {};
|
|
|
organization.value.clientName = clientNameStr.value;
|
|
|
organization.value.clientName = clientNameStr.value;
|
|
|
@@ -250,6 +257,7 @@ const getOrganization = () => {
|
|
|
|
|
|
// 编辑部门
|
|
|
const editOrganization = (flag, id) => {
|
|
|
+ organizationId.value = id;
|
|
|
if (flag) {
|
|
|
if (clientNameStr.value !== '') {
|
|
|
editVisible.value = true;
|
|
|
@@ -367,7 +375,7 @@ const deleteOrganization = id => {
|
|
|
);
|
|
|
organization.value = undefined;
|
|
|
getOrganization();
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
message.error(success.errorMessage);
|
|
|
}
|
|
|
},
|
|
|
@@ -419,10 +427,18 @@ const clientValueChanged = newFieldValue => {
|
|
|
|
|
|
// 上级部门change事件
|
|
|
const parentOrganizationValueChanged = newFieldValue => {
|
|
|
- console.log(newFieldValue, '555555555555555555');
|
|
|
- parentOrganizationFieldValue.value = newFieldValue;
|
|
|
- organization.value.parentId = newFieldValue.id;
|
|
|
- organization.value.parentName = newFieldValue.displayValue[0];
|
|
|
+ if (organizationId.value == newFieldValue.id) {
|
|
|
+ message.warning('不能将自己作为上级部门!');
|
|
|
+ parentOrganizationFieldValue.value = {
|
|
|
+ displayValue: [],
|
|
|
+ fieldType: 'Key',
|
|
|
+ id: null,
|
|
|
+ };
|
|
|
+ } else {
|
|
|
+ parentOrganizationFieldValue.value = newFieldValue;
|
|
|
+ organization.value.parentId = newFieldValue.id;
|
|
|
+ organization.value.parentName = newFieldValue.displayValue[0];
|
|
|
+ }
|
|
|
};
|
|
|
|
|
|
// 递归将childrenOrganizations赋值给children
|