| | |
| | | :show-add="false" |
| | | :show-download="false" |
| | | :amount-view="false" |
| | | :show-action-btn="false" |
| | | placeholder="请输入客户名称" |
| | | placeholder="请输入机会名称" |
| | | @searchClick="onFilterSearch" |
| | | > |
| | | <template slot="leftButton"> |
| | | <el-button size="small" type="primary" @click="addBtnClick">新建</el-button> |
| | | <el-button size="small" @click="delClick">删除</el-button> |
| | | <!-- <el-button size="small" @click="delClick">删除</el-button>--> |
| | | </template> |
| | | </CommonSearch> |
| | | </div> |
| | |
| | | <TableCommonView |
| | | ref="tableListRef" |
| | | :table-list="tableList" |
| | | :select-box="false" |
| | | @selClientClick="selClientClick" |
| | | @selContactsClick="selContactsClick" |
| | | @selCommonClick="selCommonClick" |
| | | @getSelectArray="getSelectArray" |
| | | @selTableCol="selTableCol" |
| | | > |
| | | <template slot="tableButton"> |
| | | <el-table-column label="操作" width="100"> |
| | | <el-table-column label="操作" width="120"> |
| | | <template slot-scope="scope"> |
| | | <el-button @click="handleClick(scope.row)" type="text" size="small">编辑</el-button> |
| | | <el-button @click="followupClick(scope.row)" type="text" size="small">跟进</el-button> |
| | | <!-- <el-button @click="delClick(scope.row.id)" type="text" size="small">删除</el-button> --> |
| | | <el-button @click="deleteItem(scope.row.id)" type="text" size="small">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </template> |
| | |
| | | visible: false, |
| | | title: "新建", |
| | | infomation: {} |
| | | } |
| | | }, |
| | | tableColumn: [ |
| | | { label: "机会名称", prop: "name", min: 120, isCommonClick: true ,default:true}, // 机会名称 |
| | | { label: "客户名称", prop: "client_name", min: 90, isClientClick: true }, // 客户名称 |
| | | { label: "销售机会编号", prop: "number" }, // 销售机会编号 |
| | | { label: "联系人姓名", prop: "contact_name", min: 100, isContactClick: true }, // 联系人姓名 |
| | | { label: "销售阶段", prop: "sale_stage_name" }, // 销售阶段 |
| | | { label: "可能性(%)", prop: "possibility_name" }, // 可能性 |
| | | { label: "预计成交日期", prop: "expected_time", min: 130 }, // 预计成交日期 |
| | | { label: "预计合同金额", prop: "projected_amount" }, // 预计合同金额 |
| | | { label: "预算绝对值", prop: "budget" }, // 预算绝对值 |
| | | { label: "销售负责人", prop: "member_name" } // 销售负责人 |
| | | ], |
| | | showCol:["机会名称", "客户名称", "销售机会编号", "联系人姓名", "销售阶段", "可能性(%)", "预计成交日期", "预计合同金额", "预算绝对值", "销售负责人"] |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | methods: { |
| | | setTable() { |
| | | this.tableList = { |
| | | selectIndex:true, |
| | | tableInfomation: [], |
| | | tableColumn: [ |
| | | { label: "机会名称", prop: "name", min: 120, isCommonClick: true }, // 机会名称 |
| | | { label: "客户名称", prop: "client_name", min: 90, isClientClick: true }, // 客户名称 |
| | | { label: "销售机会编号", prop: "number" }, // 销售机会编号 |
| | | { label: "联系人姓名", prop: "contact_name", min: 100, isContactClick: true }, // 联系人姓名 |
| | | { label: "销售阶段", prop: "sale_stage_name" }, // 销售阶段 |
| | | { label: "可能性(%)", prop: "possibility_name" }, // 可能性 |
| | | { label: "预计成交日期", prop: "expected_time", min: 130 }, // 预计成交日期 |
| | | { label: "预计合同金额", prop: "projected_amount" }, // 预计合同金额 |
| | | { label: "预算绝对值", prop: "budget" }, // 预算绝对值 |
| | | { label: "销售负责人", prop: "member_name" } // 销售负责人 |
| | | ] |
| | | allcol: [], |
| | | showcol: this.showCol, |
| | | tableColumn:this.setColumnVisible(this.showCol) |
| | | } |
| | | this.tableList.allcol = this.tableList.tableColumn.filter(ele=>!ele.default).map(ele=>ele.label); |
| | | this.searchOptions = [] |
| | | for (let i = 0; i < this.tableList.tableColumn.length; i++) { |
| | | const label = this.tableList.tableColumn[i].label |
| | | const value = this.tableList.tableColumn[i].prop |
| | | this.searchOptions.push({ value: value, label: label }) |
| | | } |
| | | }, |
| | | setColumnVisible(showCol){ |
| | | return this.tableColumn.map(ele=>{ |
| | | return { |
| | | ...ele, |
| | | isShowColumn:showCol.includes(ele.label) |
| | | } |
| | | }) |
| | | }, |
| | | selTableCol(val) { |
| | | this.showcol = val; |
| | | this.tableList.tableColumn = this.setColumnVisible(val); |
| | | }, |
| | | // 请求数据 |
| | | async getData() { |
| | |
| | | this.editConfig.title = "编辑" |
| | | this.editConfig.infomation = { ...row } |
| | | }, |
| | | // 删除 |
| | | // 批量删除 |
| | | delClick() { |
| | | if (this.selValueList && this.selValueList.length > 0) { |
| | | this.$confirm("是否确认删除?", "警告", { |
| | |
| | | } else { |
| | | this.$message.warning("请至少选择一条记录") |
| | | } |
| | | }, |
| | | /** |
| | | * 单个删除 |
| | | * @param id 销售机会id |
| | | */ |
| | | deleteItem(id) { |
| | | this.$confirm("是否确认删除?", "警告", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | getDelSaleChance({ids: [id]}).then((response) => { |
| | | if (response.code === 200) { |
| | | this.$message.success("删除成功") |
| | | this.getData() |
| | | } else { |
| | | this.$message.warning("删除失败") |
| | | } |
| | | }) |
| | | }) |
| | | .catch((err) => { |
| | | if (err!== 'cancel'){ |
| | | console.error(err) |
| | | this.$message.warning("删除失败") |
| | | } |
| | | }) |
| | | }, |
| | | getSelectArray(val) { |
| | | console.log(val) |
| | |
| | | // 跟进 |
| | | followupClick(row) { |
| | | console.log(row) |
| | | this.editFollowupConfig.visible = true |
| | | this.editFollowupConfig.title = "新建" |
| | | this.editFollowupConfig.infomation = { |
| | | ...row, |
| | |
| | | sale_chance_name: row.name, |
| | | sale_chance_id: row.id |
| | | } |
| | | this.editFollowupConfig.infomation.codeStandID='' |
| | | this.editFollowupConfig.visible = true |
| | | } |
| | | } |
| | | } |
| | |
| | | border-radius: 12px; |
| | | height: 100%; |
| | | overflow: hidden; |
| | | } |
| | | |
| | | .supplier-search { |
| | | display: flex; |
| | | align-items: center; |
| | | .add-view { |
| | | margin-left: auto; |
| | | margin-right: 20px; |
| | | } |
| | | } |
| | | .list-view { |
| | | height: calc(100% - 60px); |