Quellcode durchsuchen

机构合并调整

zhengnaiwen_citu vor 3 Monaten
Ursprung
Commit
fac5de446c

+ 6 - 1
src/views/humanResources/organizationStructure/organizationMerge.vue

@@ -31,6 +31,7 @@ export default {
           prop: 'slaveOrganizationNos',
           type: 'select',
           options: {
+            filterable: true,
             placeholder: '请选择被合并的机构',
             multiple: true,
             items: this.items,
@@ -45,6 +46,7 @@ export default {
     async open (item) {
       this.formValues.organizationName = item.name
       this.formValues.masterOrganizationNo = item.value
+      this.formValues.slaveOrganizationNos = []
       this.$refs.dialog.open()
       try {
         const { data } = await getOrganizationByType({
@@ -56,7 +58,7 @@ export default {
             size: 1000
           }
         })
-        this.items = data.records
+        this.items = data.records.filter(e => e.organizationNo !== item.value)
       } catch (error) {
         this.$message.error(error)
       } finally {
@@ -64,6 +66,7 @@ export default {
       }
     },
     async onSure () {
+      this.loading = true
       const { masterOrganizationNo, slaveOrganizationNos } = this.formValues
       try {
         await margeOrganization({
@@ -75,6 +78,8 @@ export default {
         this.$emit('refresh')
       } catch (error) {
         this.$message.error(error)
+      } finally {
+        this.loading = false
       }
     }
   }