| | |
| | | <template> |
| | | <div class="sales-opportunity"> |
| | | <SearchCommonView ref="searchCommonView" :query-class-options="queryClassOptions" :search-options="searchOptions" /> |
| | | <div class="btn-pager"> |
| | | <PublicFunctionBtnView |
| | | :duplicate-check="true" |
| | | :statistics="true" |
| | | :custom-funnel="true" |
| | | :operates-list="operatesList" |
| | | /> |
| | | <PagerView class="page" /> |
| | | <div v-if="isDetail" class="detail-top"> |
| | | <DetailListCommonBtn :query-class-options="queryClassOptions" /> |
| | | <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" /> |
| | | </div> |
| | | <TableCommonView ref="tableListRef" :table-list="tableList"> |
| | | <div v-else class="top"> |
| | | <SearchCommonView |
| | | ref="searchCommonView" |
| | | :query-class-options="queryClassOptions" |
| | | :search-options="searchOptions" |
| | | /> |
| | | <div class="btn-pager"> |
| | | <PublicFunctionBtnView |
| | | :duplicate-check="true" |
| | | :statistics="true" |
| | | :custom-funnel="true" |
| | | :operates-list="operatesList" |
| | | /> |
| | | <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" /> |
| | | </div> |
| | | </div> |
| | | <TableCommonView |
| | | ref="tableListRef" |
| | | :table-list="tableList" |
| | | @selClientClick="selClientClick" |
| | | @selContactsClick="selContactsClick" |
| | | @selCommonClick="selCommonClick" |
| | | > |
| | | <template slot="tableButton"> |
| | | <el-table-column label="操作" width="120"> |
| | | <template slot-scope="scope"> |
| | |
| | | </TableCommonView> |
| | | <!-- 新建/编辑 --> |
| | | <AddSalesOpportunityDialog v-if="editConfig.visible" :edit-common-config="editConfig" /> |
| | | <!-- 机会详情 --> |
| | | <DetailOpportunity v-if="opportunityDeail.visible" :opportunity-detail="opportunityDeail" /> |
| | | <!-- 客户详情 --> |
| | | <DetailClientManage v-if="clientDeail.visible" :client-manage-detail="clientDeail" /> |
| | | <!-- 联系人详情 --> |
| | | <DetailContacts v-if="contactsDeail.visible" :contacts-detail="contactsDeail" /> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import AddSalesOpportunityDialog from "@/views/sales/salesOpportunity/AddSalesOpportunityDialog" |
| | | import { getSaleChanceList, getDelSaleChance } from "@/api/sales/salesOpportunity" |
| | | import pageMixin from "@/components/makepager/pager/mixin/pageMixin" |
| | | import DetailOpportunity from "@/views/sales/salesOpportunity/DetailOpportunity" |
| | | |
| | | export default { |
| | | name: "SalesOpportunity", |
| | | props: {}, |
| | | props: { |
| | | isDetail: { |
| | | type: Boolean, |
| | | default: false |
| | | } |
| | | }, |
| | | mixins: [pageMixin], |
| | | components: { |
| | | AddSalesOpportunityDialog |
| | | AddSalesOpportunityDialog, |
| | | DetailOpportunity, |
| | | DetailContacts: () => import("@/views/client/contacts/DetailContacts"), |
| | | DetailClientManage: () => import("@/views/client/client/DetailClientManage") |
| | | }, |
| | | computed: { |
| | | searchCommonHeight() { |
| | |
| | | visible: false, |
| | | title: "新建", |
| | | infomation: {} |
| | | }, |
| | | opportunityDeail: { |
| | | visible: false, |
| | | infomation: {} |
| | | }, |
| | | contactsDeail: { |
| | | visible: false, |
| | | infomation: {} |
| | | }, |
| | | clientDeail: { |
| | | visible: false, |
| | | infomation: {} |
| | | } |
| | | } |
| | | }, |
| | |
| | | this.tableList = { |
| | | tableInfomation: [], |
| | | tableColumn: [ |
| | | { label: "机会名称", prop: "name", min: 120 }, // 机会名称 |
| | | { label: "客户名称", prop: "client_name", min: 90 }, // 客户名称 |
| | | { label: "机会名称", prop: "name", min: 120, isCommonClick: true }, // 机会名称 |
| | | { label: "客户名称", prop: "client_name", min: 90, isClientClick: true }, // 客户名称 |
| | | { label: "销售机会编号", prop: "number" }, // 销售机会编号 |
| | | { label: "联系人姓名", prop: "contact_name", min: 100 }, // 联系人姓名 |
| | | { label: "联系人姓名", prop: "contact_name", min: 100, isContactClick: true }, // 联系人姓名 |
| | | { label: "销售阶段", prop: "sale_stage_id" }, // 销售阶段 |
| | | { label: "可能性(%)", prop: "possibilities_id" }, // 可能性 |
| | | { label: "预计成交日期", prop: "expected_time", isTime: true, min: 130 }, // 预计成交日期 |
| | |
| | | // 请求数据 |
| | | async getData() { |
| | | this.loading = true |
| | | await getSaleChanceList() |
| | | await getSaleChanceList({ |
| | | keyword: "", |
| | | page: this.pagerOptions.currPage, |
| | | pageSize: this.pagerOptions.pageSize |
| | | }) |
| | | .then((res) => { |
| | | console.log(res) |
| | | if (res.code === 200) { |
| | |
| | | } |
| | | }) |
| | | this.tableList.tableInfomation = list || [] |
| | | this.pagerOptions.totalCount = res.data.count |
| | | } else { |
| | | this.tableList.tableInfomation = [] |
| | | } |
| | |
| | | .then((response) => { |
| | | if (response.code === 200) { |
| | | this.$message.success("删除成功") |
| | | this.getUserList() |
| | | this.getData() |
| | | } else { |
| | | this.$message.warning("删除失败") |
| | | } |
| | |
| | | }, |
| | | getSelectArray(val) { |
| | | console.log(val) |
| | | }, |
| | | // 客户名称详情 |
| | | selClientClick(row) { |
| | | console.log(row) |
| | | this.clientDeail.visible = true |
| | | this.clientDeail.infomation = { ...row, client_name: row.name } |
| | | }, |
| | | // 联系人详情 |
| | | selContactsClick(row) { |
| | | console.log(row) |
| | | this.contactsDeail.visible = true |
| | | this.contactsDeail.infomation = { ...row } |
| | | }, |
| | | // 机会名称详情 |
| | | selCommonClick(row) { |
| | | console.log(row) |
| | | this.opportunityDeail.visible = true |
| | | this.opportunityDeail.infomation = { ...row } |
| | | } |
| | | } |
| | | } |
| | |
| | | <!-- Add "scoped" attribute to limit CSS to this component only --> |
| | | <style lang="scss" scoped> |
| | | .sales-opportunity { |
| | | .btn-pager { |
| | | .top { |
| | | margin-bottom: 20px; |
| | | .btn-pager { |
| | | display: flex; |
| | | .page { |
| | | margin-left: auto; |
| | | } |
| | | } |
| | | } |
| | | .detail-top { |
| | | display: flex; |
| | | .page { |
| | | margin-left: auto; |