|
@@ -8,9 +8,11 @@
|
|
|
idname="sys_phonebookid"
|
|
idname="sys_phonebookid"
|
|
|
:pageChange="true"
|
|
:pageChange="true"
|
|
|
:tabs="['详细信息','关联客户','关联项目']"
|
|
:tabs="['详细信息','关联客户','关联项目']"
|
|
|
|
|
+ @teamList="teamList"
|
|
|
>
|
|
>
|
|
|
<template slot="customOperation">
|
|
<template slot="customOperation">
|
|
|
- <edit :data="mainData" :group="group" :tagList="tagList"></edit>
|
|
|
|
|
|
|
+ <edit class="inline-16" v-if="tool.checkAuth($route.name,'update')" :data="mainData" :group="group" :tagList="tagList" :disabled="mainData.disabled" @onEditSuccess="queryMainData();$refs.detailsRef.$refs.tag.queryTag()"></edit>
|
|
|
|
|
+ <el-button class="inline-16" v-if="tool.checkAuth($route.name,'delete')" :type="!mainData.disabled?'':'primary'" size="mini" @click="onDel" :disabled="!mainData.disabled">删 除</el-button>
|
|
|
</template>
|
|
</template>
|
|
|
<div slot="slot0" >
|
|
<div slot="slot0" >
|
|
|
<detailed :detailData="mainData"></detailed>
|
|
<detailed :detailData="mainData"></detailed>
|
|
@@ -29,6 +31,7 @@ import detailed from '../modules/detailsData'
|
|
|
import customerData from '../modules/customerData'
|
|
import customerData from '../modules/customerData'
|
|
|
import projectData from '../modules/projectData'
|
|
import projectData from '../modules/projectData'
|
|
|
import edit from '../modules/edit'
|
|
import edit from '../modules/edit'
|
|
|
|
|
+import {mapGetters} from "vuex";
|
|
|
export default {
|
|
export default {
|
|
|
name: "index",
|
|
name: "index",
|
|
|
components:{detailed,customerData,projectData,edit},
|
|
components:{detailed,customerData,projectData,edit},
|
|
@@ -50,10 +53,72 @@ export default {
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
group:[],
|
|
group:[],
|
|
|
- tagList:[]
|
|
|
|
|
|
|
+ tagList:[],
|
|
|
|
|
+ teamData:[],
|
|
|
|
|
+ userInfo:JSON.parse(window.sessionStorage.getItem('active_account')),
|
|
|
|
|
+ agentData:[]
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ watch:{
|
|
|
|
|
+ async teamData(val){
|
|
|
|
|
+ if (this.mainData.groupname == '客户联系人'){
|
|
|
|
|
+ const agent = await this.$api.requested({
|
|
|
|
|
+ "id":20230329122604,
|
|
|
|
|
+ "content": {
|
|
|
|
|
+ "ownertable":"sys_enterprise_contacts",
|
|
|
|
|
+ "ownerid":this.mainData.contactsid
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ this.agentData = agent.data
|
|
|
|
|
+ }else if (this.mainData.groupname == '项目联系人'){
|
|
|
|
|
+ const agent = await this.$api.requested({
|
|
|
|
|
+ "id":20230329122604,
|
|
|
|
|
+ "content": {
|
|
|
|
|
+ "ownertable":"sa_project_contacts",
|
|
|
|
|
+ "ownerid":this.mainData.sa_project_contactsid
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ this.agentData = agent.data
|
|
|
|
|
+ }else {
|
|
|
|
|
+ const agent = await this.$api.requested({
|
|
|
|
|
+ "id":20230329122604,
|
|
|
|
|
+ "content": {
|
|
|
|
|
+ "ownertable":"sys_phonebook",
|
|
|
|
|
+ "ownerid":this.$route.query.id
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ this.agentData = agent.data
|
|
|
|
|
+ }
|
|
|
|
|
+ if (this.mainData.leader.length !== 0){
|
|
|
|
|
+ if (JSON.parse(window.sessionStorage.getItem('active_account')).userid === this.mainData.leader[0].userid){
|
|
|
|
|
+
|
|
|
|
|
+ this.mainData.disabled = true
|
|
|
|
|
+ }else {
|
|
|
|
|
+ let flag = 0
|
|
|
|
|
+ for (var i=0;i<val[0].team.length;i++){
|
|
|
|
|
+ if (val[0].team[i].userid === JSON.parse(window.sessionStorage.getItem('active_account')).userid){
|
|
|
|
|
+ if (val[0].team[i].editable === 1){
|
|
|
|
|
+ this.mainData.disabled = true
|
|
|
|
|
+ flag =1
|
|
|
|
|
+ break
|
|
|
|
|
+ }else {
|
|
|
|
|
+ flag = 0
|
|
|
|
|
+ break
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ flag === 0?this.agentData.editable === 0?this.mainData.disabled = false:this.mainData.disabled = true:this.mainData.disabled = true
|
|
|
|
|
+ this.$refs.detailsRef.$refs.group.editdataleader = this.agentData.editdataleader
|
|
|
|
|
+ }
|
|
|
|
|
+ console.log(this.mainData.disabled,'权限结果')
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
methods:{
|
|
methods:{
|
|
|
|
|
+ async teamList(val){
|
|
|
|
|
+ this.teamData = val
|
|
|
|
|
+ },
|
|
|
async queryMainData(){
|
|
async queryMainData(){
|
|
|
const res = await this.$api.requested({
|
|
const res = await this.$api.requested({
|
|
|
"id": "20220914135203",
|
|
"id": "20220914135203",
|
|
@@ -128,6 +193,88 @@ export default {
|
|
|
})
|
|
})
|
|
|
this.tagList = res.data.option
|
|
this.tagList = res.data.option
|
|
|
},
|
|
},
|
|
|
|
|
+ onDel(){
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ if (this.mainData.groupname === '客户联系人'){
|
|
|
|
|
+ this.$confirm('是否确认删除当前客户的联系人?', '提示', {
|
|
|
|
|
+ confirmButtonText: '确定',
|
|
|
|
|
+ cancelButtonText: '取消',
|
|
|
|
|
+ closeOnClickModal:false,
|
|
|
|
|
+ type: 'warning'
|
|
|
|
|
+ }).then(async () => {
|
|
|
|
|
+ const res = await this.$api.requested({
|
|
|
|
|
+ "id": "20221018145502",
|
|
|
|
|
+ "content": {
|
|
|
|
|
+ "contactsid":this.mainData.contactsid,
|
|
|
|
|
+ "ownerid":this.mainData.sa_customersid,
|
|
|
|
|
+ "ownertable":"sa_customers",
|
|
|
|
|
+ "sys_enterpriseid":this.mainData.sys_enterpriseid
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ this.tool.showMessage(res,()=>{
|
|
|
|
|
+ this.$store.dispatch('changeDetailDrawer',false)
|
|
|
|
|
+ this.$emit('delSuccess')
|
|
|
|
|
+ })
|
|
|
|
|
+ }).catch(() => {
|
|
|
|
|
+ this.$message({
|
|
|
|
|
+ type: 'info',
|
|
|
|
|
+ message: '已取消删除'
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+ }else if (this.mainData.groupname === '项目联系人') {
|
|
|
|
|
+ this.$confirm('是否确认删除当前项目的联系人?', '提示', {
|
|
|
|
|
+ confirmButtonText: '确定',
|
|
|
|
|
+ cancelButtonText: '取消',
|
|
|
|
|
+ closeOnClickModal:false,
|
|
|
|
|
+ type: 'warning'
|
|
|
|
|
+ }).then(async () => {
|
|
|
|
|
+
|
|
|
|
|
+ const res = await this.$api.requested({
|
|
|
|
|
+ "id": "20221111130904",
|
|
|
|
|
+ "content": {
|
|
|
|
|
+ "ownerid":this.mainData.sa_projectid,
|
|
|
|
|
+ "ownertable":"sa_project",
|
|
|
|
|
+ "sa_project_contactsids":[this.mainData.sa_project_contactsid]
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ this.tool.showMessage(res,()=>{
|
|
|
|
|
+ this.$store.dispatch('changeDetailDrawer',false)
|
|
|
|
|
+ this.$emit('delSuccess')
|
|
|
|
|
+ })
|
|
|
|
|
+ }).catch(() => {
|
|
|
|
|
+ this.$message({
|
|
|
|
|
+ type: 'info',
|
|
|
|
|
+ message: '已取消删除'
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+ }else {
|
|
|
|
|
+ this.$confirm('是否确认删除当前联系人?', '提示', {
|
|
|
|
|
+ confirmButtonText: '确定',
|
|
|
|
|
+ cancelButtonText: '取消',
|
|
|
|
|
+ closeOnClickModal:false,
|
|
|
|
|
+ type: 'warning'
|
|
|
|
|
+ }).then(async () => {
|
|
|
|
|
+
|
|
|
|
|
+ const res = await this.$api.requested({
|
|
|
|
|
+ "id": "20220831164703",
|
|
|
|
|
+ "content": {
|
|
|
|
|
+ "sys_phonebookid":this.mainData.sys_phonebookid
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ this.tool.showMessage(res,()=>{
|
|
|
|
|
+ this.$store.dispatch('changeDetailDrawer',false)
|
|
|
|
|
+ this.$emit('delSuccess')
|
|
|
|
|
+ })
|
|
|
|
|
+ }).catch(() => {
|
|
|
|
|
+ this.$message({
|
|
|
|
|
+ type: 'info',
|
|
|
|
|
+ message: '已取消删除'
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
mounted() {
|
|
mounted() {
|
|
|
this.groupList()
|
|
this.groupList()
|