pengjun 2 years ago
parent
commit
b156fc465e
  1. 10
      src/components/customerOrg/ContactPerson.vue
  2. 15
      src/components/customerOrg/customerOrgTree.vue

10
src/components/customerOrg/ContactPerson.vue

@ -262,7 +262,11 @@ export default {
this.customerOrg.contactMethodList.splice(index, 1); this.customerOrg.contactMethodList.splice(index, 1);
this.submit('form'); this.submit('form');
}).catch((err) => { }).catch((err) => {
console.log(`deletapi:/api/app/contact-person/${this.personId}`,err);
if(err == 'cancel'){
this.$message.info("已取消删除");
}else{
this.$message.error("操作失败,原因:" + err);
}
}); });
}, },
@ -297,7 +301,7 @@ export default {
contactPersonId: this.personId, contactPersonId: this.personId,
}); });
}); });
return postapi("/api/app/contact-method/many", contactMethod);
if(contactMethod.length > 0) return postapi("/api/app/contact-method/many", contactMethod);
}) })
.then((res) => { .then((res) => {
//console.log('api/app/contact-method/many') //console.log('api/app/contact-method/many')
@ -320,7 +324,7 @@ export default {
contactPersonId: this.personId, contactPersonId: this.personId,
}); });
}); });
return postapi("/api/app/contact-method/many", contactMethod);
if(contactMethod.length > 0) return postapi("/api/app/contact-method/many", contactMethod);
}) })
.then((res) => { .then((res) => {
//console.log('api/app/contact-method/many') //console.log('api/app/contact-method/many')

15
src/components/customerOrg/customerOrgTree.vue

@ -1,10 +1,12 @@
<template> <template>
<el-tree :data="customerOrg.customerOrgTree" :props="customerOrg.treeprops" @node-click="treeclick" />
<el-tree :data="customerOrg.customerOrgTree" :props="customerOrg.treeprops" @node-click="treeclick" highlight-current/>
</template> </template>
<script> <script>
import { mapState, mapMutations } from "vuex"; import { mapState, mapMutations } from "vuex";
import { getapi, postapi, putapi, deletapi } from "@/api/api"; import { getapi, postapi, putapi, deletapi } from "@/api/api";
import { tcdate, deepCopy } from "../../utlis/proFunc"; import { tcdate, deepCopy } from "../../utlis/proFunc";
import { getTreePids} from "../../utlis/tree";
export default { export default {
components: {}, components: {},
data() { data() {
@ -105,10 +107,17 @@ export default {
//this.$message.success(data.id + " " + data.displayName);// api/app/customer-org/3a0c0439-a5ca-8a63-b2b9-e0eb24cb58b1 //this.$message.success(data.id + " " + data.displayName);// api/app/customer-org/3a0c0439-a5ca-8a63-b2b9-e0eb24cb58b1
this.customerOrg.customerOrgId = data.id; this.customerOrg.customerOrgId = data.id;
this.getCustomerOrgRd(data.id); this.getCustomerOrgRd(data.id);
// //
if(!data.parentId){
this.getCustomerOrgRegisterList(data.id);
let firstId = data.id //ID
if(data.parentId){
let pids = getTreePids(this.customerOrg.customerOrgTree,"treeChildren", 'parentId', 'id', data.id)
console.log('pids',pids)
firstId = pids[pids.length - 2]
} }
this.getCustomerOrgRegisterList(firstId);
//
this.getContactPersonList(data.id); this.getContactPersonList(data.id);
}, },
}, },

Loading…
Cancel
Save