| | |
| | | <el-table-column label="操作" width="90" fixed="right"> |
| | | <template slot-scope="scope"> |
| | | <el-button @click="handleClick(scope.row)" type="text" size="small">编辑</el-button> |
| | | <el-button @click="delClick(scope.row.id)" type="text" size="small">删除</el-button> |
| | | <el-button @click="delClick(scope.row)" type="text" size="small">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </template> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { getFollowRecordList, getDeleteFollowRecord } from "@/api/employeeManage/employeeInfo.js" |
| | | import { getWorkerList, getDeleteWorkerInfo } from "@/api/employeeManage/employeeInfo.js" |
| | | import pageMixin from "@/components/makepager/pager/mixin/pageMixin" |
| | | import AddEmployee from "@/views/employeeManage/employeeInfo/components/AddEmployee" |
| | | export default { |
| | |
| | | editRow: { |
| | | title: "新建", |
| | | }, |
| | | search_map: {}, |
| | | search_map: '', |
| | | tableColumn: [ |
| | | { label: "员工编码", prop: "topic", min: 120, default: true }, // 主题 |
| | | { label: "姓名", prop: "client_name", min: 190, }, // 客户名称 |
| | | { label: "手机号", prop: "contact_name", min: 130, }, // 联系人姓名 |
| | | { label: "车间", prop: "client_status", min: 100 }, // 客户状态 |
| | | { label: "组别", prop: "contact_information_name", min: 100 }, // 联系方式 |
| | | { label: "工种", prop: "follow_time", min: 130 }, // 联系人日期 |
| | | { label: "添加时间", prop: "next_follow_time", min: 130 }, // 下次回访日期 |
| | | { label: "添加人", prop: "member_name", min: 110 }, // 负责人 |
| | | { label: "员工编码", prop: "id", min: 120, default: true }, // 主题 |
| | | { label: "姓名", prop: "name", min: 190, }, // 客户名称 |
| | | { label: "手机号", prop: "phoneNum", min: 130, }, // 联系人姓名 |
| | | { label: "车间", prop: "shopName", min: 100 }, // 客户状态 |
| | | { label: "组别", prop: "groupNumber", min: 100 }, // 联系方式 |
| | | { label: "工种", prop: "workType", min: 130 }, // 联系人日期 |
| | | { label: "添加时间", prop: "createdAt", min: 150 }, // 下次回访日期 |
| | | { label: "添加人", prop: "addPeople", min: 110 }, // 负责人 |
| | | ], |
| | | showCol: [ |
| | | "员工编码", |
| | |
| | | // 请求数据 |
| | | async getData() { |
| | | this.loading = true |
| | | await getFollowRecordList({ |
| | | search_map: this.search_map, |
| | | await getWorkerList({ |
| | | keyWord: this.search_map, |
| | | page: this.pagerOptions.currPage, |
| | | pageSize: this.pagerOptions.pageSize |
| | | }) |
| | | .then((res) => { |
| | | console.log(res) |
| | | if (res.code === 200) { |
| | | if (res.data.list && res.data.list.length > 0) { |
| | | const list = res.data.list.map((item) => { |
| | | return { |
| | | ...item, |
| | | client_name: item.client.name, |
| | | contact_name: item.contact.name, |
| | | client_status: item.client_status.name, |
| | | phone: item.contact.phone, |
| | | member_name: item.member.username, |
| | | contact_information_name: item.contact_information.name |
| | | } |
| | | }) |
| | | if (res.data) { |
| | | const list = res.data |
| | | this.tableList.tableInfomation = list || [] |
| | | this.pagerOptions.totalCount = res.data.count |
| | | this.pagerOptions.totalCount = res.count |
| | | } else { |
| | | this.tableList.tableInfomation = [] |
| | | } |
| | |
| | | }, |
| | | // 搜索 |
| | | onFilterSearch(searchText) { |
| | | this.search_map.client_name = searchText ?? "" |
| | | this.search_map = searchText ?? "" |
| | | this.pagerOptions.currPage = 1 |
| | | this.getData() |
| | | }, |
| | |
| | | this.$refs.addEmployee.islook = true; |
| | | }, |
| | | // 删除 |
| | | delClick(id) { |
| | | delClick(row) { |
| | | this.$confirm("是否确认删除?", "警告", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | getDeleteFollowRecord({ ids: [id] }).then((response) => { |
| | | getDeleteWorkerInfo({ id: row.id }).then((response) => { |
| | | if (response.code === 200) { |
| | | this.$message.success("删除成功") |
| | | this.getData() |
| | | } else { |
| | | this.$message.warning("删除失败") |
| | | } |
| | | }) |
| | | }) |