You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
crm-project/src/views/CompanyList.vue

125 lines
3.7 KiB

<!--
* @Author: your name
* @Date: 2021-09-27 20:52:38
* @LastEditTime: 2021-10-17 21:30:34
* @LastEditors: Lone
* @Description: In User Settings Edit
* @FilePath: \crm\src\views\CustList.vue
-->
<template>
<div class="custList">
<a-row>
<a-col :span="3">
<CustMenu msg="客戶檢視索引" @custMenuData="treeFunc" :tagsData="companyTagsData" @getTagsData="getTagsData" />
</a-col>
<a-col :span="21" class="customerGrp">
<Company msg="全部檢索" @showDrawer="clickDrawerShow" :tagsData="companyTagsData" @getTagsData="getTagsData" />
</a-col>
</a-row>
<!-- //用戶詳情抽屜 -->
<myDrawer
:show="isDrawerShow"
@close="isDrawerShow = false"
:currentData="currentData"
/>
</div>
</template>
<script>
import CustMenu from "@/components/Customer/CustMenu.vue";
import Company from "@/components/Customer/Company.vue";
import myDrawer from "@/components/Common/myDrawer";
import Api from "@/services/api";
export default {
name: "CompanyList",
components: {
CustMenu,
Company,
myDrawer,
},
data() {
return {
isDrawerShow: false,
currentData: {},
companyTagsData:[],
};
},
created() {
//this.companyData();
setTimeout(() => {
this.getCompanyTagsData()
}, 1000);
},
methods: {
getTagsData(){  //Store更新頁次讀取資料
let tempCompanyTagsData = [...this.$store.state.main.tagsData]
this.companyTagsData = tempCompanyTagsData
},
getCompanyTagsData(){  //Store更新頁次讀取資料
let tempCompanyTagsData = [...this.$store.state.main.companyTagsData]
this.companyTagsData = tempCompanyTagsData
},
// companyData () {
// let params = {
// page: {
// currentPage: 1,
// pageSize: 20
// }
// };
// //this.$store.dispatch('main/getCompanyList', params);
// return new Promise((resolve,reject) => {
// Api.customer.queryComPageList(params).then(res => {
// console.log('queryComPageList请求回来的数据为:', res);
// if (res.success != true) {
// resolve(false);
// this.$message.error('请求取得公司資料失败');
// } else {
// this.$message.success('请求取得公司資料成功');
// console.log('res.data.list', res.data);
// let tempList = res.data
// tempList.list.forEach(item=>{
// item.key = item.id
// })
// this.$store.dispatch('main/getCompanyList',tempList).then(res => {
// if (res) {
// this.$message.success('存入Store取得公司資料成功!');
// // setTimeout(()=>{
// // //this.isLoggingIn = false
// // setTimeout(() => this.getCustomerTimelinePageList(),1000)
// // },1000)
// //resolve(true);
// }
// })
// resolve(true);
// };
// })
// });
// },
treeFunc(isHidden) {
//console.log("Hellow")
//this.custIsHidden = isHidden;
},
clickDrawerShow(drawerCurrentData) {
console.log("drawerCurrentData", drawerCurrentData);
this.isDrawerShow = drawerCurrentData.isDrawerShow;
this.currentData = drawerCurrentData;
},
},
};
</script>
<style>
.custList {
height: 100%;
padding: 15px;
/* background: pink; */
}
.customerGrp {
height: 100%;
/* background: red; */
flex: 1;
}
</style>