فهرست منبع

通讯录暂存

qymljy 1 سال پیش
والد
کامیت
af8e6063a5

+ 4 - 3
src/HManagement/addressList/addressBook/detail/index.vue

@@ -16,7 +16,7 @@
       <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>
-    <div slot="slot0" >
+    <div slot="slot0">
       <detailed :detailData="mainData"></detailed>
     </div>
     <div slot="slot1">
@@ -139,8 +139,9 @@ export default {
         "id": "20220914135203",
         "content": {
           "sys_phonebookid": this.$route.query.id,
-          "sa_project_contactsid": this.$route.query.sa_project_contactsid,
-          "contactsid":this.$route.query.contactsid
+          /*"sa_project_contactsid": this.$route.query.sa_project_contactsid,*/
+          /*"contactsid":this.$route.query.contactsid*/
+          "groupname":''
         },
       })
       console.log(res.data,'res返回数据')

+ 310 - 0
src/HManagement/addressList/addressBook/detail/indexCopy.vue

@@ -0,0 +1,310 @@
+<template>
+  <basicDetails
+      ref="detailsRef"
+      :titleText="mainData.name"
+      :editData="mainData"
+      :mainAreaData="mainAreaData"
+      :isGroup="false"
+      :ownertable="mainData.groupname == '客户联系人'?'sys_enterprise_contacts':mainData.groupname == '项目联系人'?'sa_project_contacts':'sys_phonebook'"
+      :idname="mainData.groupname == '客户联系人'?'contactsid':mainData.groupname == '项目联系人'?'sa_project_contactsid':'sys_phonebookid'"
+      :ownerid="mainData.groupname == '客户联系人'?mainData.contactsid:mainData.groupname == '项目联系人'?mainData.sa_project_contactsid:$route.query.id"
+      :pageChange="true"
+      :tabs="['详细信息','关联客户','关联项目']"
+      @teamList="teamList"
+      >
+    <template slot="customOperation">
+      <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>
+    <div slot="slot0" >
+      <detailed :detailData="mainData"></detailed>
+    </div>
+    <div slot="slot1">
+      <customerData :data="mainData"></customerData>
+    </div>
+    <div slot="slot2">
+      <projectData :data="mainData"></projectData>
+    </div>
+  </basicDetails>
+</template>
+
+<script>
+import detailed from '../modules/detailsData'
+import customerData from '../modules/customerData'
+import projectData from '../modules/projectData'
+import basicDetails from '@/components/normal-basic-layout-new/details/index'
+import edit from '../modules/edit'
+import {mapGetters} from "vuex";
+export default {
+  name: "index",
+  components:{detailed,customerData,projectData,edit,basicDetails},
+  data(){
+    return {
+      mainData: {
+        disabled:false,
+      },
+      mainAreaData:'',
+      groupParam:{
+        "id": "20220831164303",
+        "content": {
+          "nocache":true,
+          "where":{
+            "condition":"",
+            "groupname":"",
+            "tag":[]
+          }
+        }
+      },
+      group:[],
+      tagList:[],
+      teamData:[],
+      userInfo:JSON.parse(window.sessionStorage.getItem('active_account')),
+      agentData:[],
+      ownertable:'',
+      idname:''
+    }
+  },
+  watch:{
+    async teamData(val){
+      /*if (this.mainData.groupname == '客户联系人'){
+        this.ownertable = 'sys_enterprise_contacts'
+        this.idname = "contactsid"
+      }else if (this.mainData.groupname == '客户联系人'){
+        this.ownertable = 'sa_project_contacts'
+        this.idname = "sa_project_contactsid"
+      }else {
+        this.ownertable = 'sys_phonebook'
+        this.idname = "sys_phonebookid"
+      }*/
+      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:{
+    async teamList(val){
+      this.teamData = val
+    },
+    async queryMainData(){
+      const res = await this.$api.requested({
+        "id": "20220914135203",
+        "content": {
+          "sys_phonebookid": this.$route.query.id,
+          "sa_project_contactsid": this.$route.query.sa_project_contactsid,
+          "contactsid":this.$route.query.contactsid
+        },
+      })
+      console.log(res.data,'res返回数据')
+      this.mainData = Object.assign({},this.mainData,res.data)
+      console.log(res.data.groupname,'groupname')
+      if (res.data.groupname == '客户联系人'){
+        this.$refs.detailsRef.$refs.group.queryGroupNew('sys_enterprise_contacts',res.data.contactsid)
+        this.$refs.detailsRef.$refs.task.listDataNew('sys_enterprise_contacts',res.data.contactsid)
+        this.$refs.detailsRef.$refs.follow.queryLogsNew('sys_enterprise_contacts',res.data.contactsid)
+      }else if (res.data.groupname == '项目联系人'){
+        this.$refs.detailsRef.$refs.group.queryGroupNew('sa_project_contacts',res.data.sa_project_contactsid)
+        this.$refs.detailsRef.$refs.task.listDataNew('sa_project_contacts',res.data.sa_project_contactsid)
+        this.$refs.detailsRef.$refs.follow.queryLogsNew('sa_project_contacts',res.data.sa_project_contactsid)
+      }else {
+        this.$refs.detailsRef.$refs.group.queryGroupNew('sys_phonebook',res.data.sys_phonebookid)
+        this.$refs.detailsRef.$refs.task.listDataNew('sys_phonebook',res.data.sys_phonebookid)
+        this.$refs.detailsRef.$refs.follow.queryLogsNew('sys_phonebook',res.data.sys_phonebookid)
+      }
+      this.changeDataStructure()
+    },
+    changeDataStructure () {
+      this.mainAreaData = [
+        {
+          label:'姓名',
+          value: this.mainData.name
+        },
+        {
+          label:'联系方式',
+          value: this.mainData.phonenumber
+        },
+        {
+          label:'单位',
+          value: this.mainData.company
+        },
+        {
+          label:'部门',
+          value: this.mainData.depname
+        },
+        {
+          label:'职位',
+          value: this.mainData.position
+        },
+        {
+          label:'群组',
+          value: this.mainData.groupname
+        },
+        {
+          label:'负责人',
+          value: this.mainData.leader
+        }
+      ]
+    },
+    async groupList(){
+      const res = await this.$api.requested(this.groupParam)
+      let k = 0
+      for (var i=0;i<res.data.length;i++){
+        if (res.data[i].groupname !== '项目联系人' && res.data[i].groupname !== '客户联系人' ){
+          this.group[k] = res.data[i]
+          k++
+        }
+      }
+      console.log(this.group,'groupList')
+    },
+    async getTagList () {
+      let res = await this.$api.requested({
+        "id": 20220929085401,
+        "content": {
+          "ownertable":"sys_phonebook",
+          "ownerid":102
+        }
+      })
+      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() {
+    this.groupList()
+    this.getTagList()
+    this.queryMainData()
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 8 - 3
src/HManagement/addressList/addressBook/index.vue

@@ -7,7 +7,9 @@
         :apiId="{query:20231220085804,del:''}"
         :autoQuery="false"
         @onSuccess="selectChange"
-        :detailPath="{path:'/phonebookDetail'}"
+        :detailPath="{
+          path:'/phonebookDetail',
+        }"
     >
       <template #titleLight>
         <addContact :tagList="tagList" v-if="tool.checkAuth($route.name,'addContact')" slot="addContact" :group="group" @onAddSuccess="selectChange"></addContact>
@@ -81,6 +83,7 @@
         </div>
       </template>
       <template v-slot:tbOpreation="scope">
+        <drawerDetail :data="scope.data.data" :groupname="scope.data.data.groupname" detailPath="/phonebookDetail" idName="sys_phonebookid"></drawerDetail>
 <!--        <el-button size="text" @click="onGoto(scope.data.data)" >详 情</el-button>-->
       </template>
     </normalBook>
@@ -91,9 +94,10 @@
 import normalBook from "@/components/normal-basic-layout-new/normalBook";
 import myGroup from '../mycontact/index';
 import addContact from '../mycontact/modules/addContact'
+import drawerDetail from '@/components/normal-basic-layout-new/drawerDetail/index2'
 export default {
   name: "index",
-  components:{normalBook,myGroup,addContact},
+  components:{normalBook,myGroup,addContact,drawerDetail},
   data(){
     return {
       tabIndex:"1",
@@ -164,7 +168,8 @@ export default {
             "tag":[]
           }
         }
-      }
+      },
+      groupname:''
     }
   },
   methods:{

+ 46 - 0
src/components/normal-basic-layout-new/drawerDetail/index2.vue

@@ -0,0 +1,46 @@
+<template>
+  <div>
+    <el-button size="small" type="text" @click="onShow" >详 情</el-button>
+  </div>
+</template>
+
+<script>
+export default {
+  props:['data','detailPath','idName','groupname'],
+  components:{
+  },
+  computed:{
+	},
+  data () {
+    return {
+    }
+  },
+  methods:{
+    onShow () {
+      let key = ''
+      if (this.idName instanceof Array) {
+        key = this.idName[1]
+      } else {
+        key = this.idName
+      }
+      let query = {id:this.data[key],rowindex:this.data.rowindex - 1,groupname:this.groupname}
+      this.$router.push({path:this.detailPath.path,query:Object.assign({},query,this.detailPath.param)})
+      this.$store.dispatch('changeDetailDrawer',true)
+    },
+  },
+  watch:{
+  }
+}
+
+</script>
+<style>
+</style>
+<style scoped>
+.detail__panel{
+  background:#f1f2f3;
+  overflow-y: scroll;
+  font-size: 14px;
+  color:#666;
+  height:100vh;
+}
+</style>