| | |
| | | <template slot="tableButton"> |
| | | <el-table-column label="操作" width="180"> |
| | | <template slot-scope="scope"> |
| | | <el-button @click="viewClick(scope.row)" type="text" size="small">查看</el-button> |
| | | <el-button @click="editClick(scope.row)" type="text" size="small">编辑</el-button> |
| | | <el-button @click="delClick(scope.row.id)" type="text" size="small">删除</el-button> |
| | | </template> |
| | |
| | | |
| | | <script> |
| | | import pageMixin from "@/components/makepager/pager/mixin/pageMixin" |
| | | import { getRegisterList,getDeleteRegister } from "@/api/productManage/productRegisterForm.js" |
| | | export default { |
| | | name: "productRegisterForm", |
| | | props: {}, |
| | |
| | | return { |
| | | loading: false, |
| | | tableList: {}, |
| | | keyword: '', |
| | | tableColumn: [ |
| | | { label: "编号", prop: "name", min: 100, default: true }, |
| | | { label: "编号", prop: "number", min: 100, default: true }, |
| | | { label: "生产时间", prop: "member_name" }, |
| | | { label: "车组", prop: "client_level" }, |
| | | { label: "规格", prop: "next_visit_time", min: 90 }, |
| | | { label: "车间", prop: "detail_address", min: 200 }, |
| | | { label: "庄口", prop: "client_status" }, |
| | | { label: "车组", prop: "workshopGroup" }, |
| | | { label: "规格", prop: "spec", min: 90 }, |
| | | { label: "车间", prop: "name", min: 200 }, |
| | | { label: "庄口", prop: "market" }, |
| | | { label: "回数", prop: "contact_name", isContactClick: true }, |
| | | { label: "车组总产量", prop: "contact_phone" } |
| | | ], |
| | |
| | | }, |
| | | created() { |
| | | this.setTable() |
| | | this.getData(this.keyword) |
| | | }, |
| | | methods: { |
| | | setTable() { |
| | | this.tableList = { |
| | | selectIndex: true, |
| | | selectIndex: false, |
| | | tableInfomation: [], |
| | | allcol: [], |
| | | showcol: this.showCol, |
| | |
| | | this.showcol = val |
| | | this.tableList.tableColumn = this.setColumnVisible(val) |
| | | }, |
| | | // 请求数据 |
| | | async getData() { |
| | | this.loading = true |
| | | await getRegisterList({ |
| | | keyword: this.keyword, |
| | | page: this.pagerOptions.currPage, |
| | | pageSize: this.pagerOptions.pageSize |
| | | }) |
| | | .then((res) => { |
| | | console.log(res) |
| | | if (res.code === 200) { |
| | | if (res.data && res.data.length > 0) { |
| | | // const list = res.data.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 |
| | | // } |
| | | // }) |
| | | this.tableList.tableInfomation = res.data || [] |
| | | this.pagerOptions.totalCount = res.count |
| | | } else { |
| | | this.tableList.tableInfomation = [] |
| | | } |
| | | } else { |
| | | this.tableList.tableInfomation = [] |
| | | } |
| | | this.loading = false |
| | | }) |
| | | .catch((err) => { |
| | | console.log(err) |
| | | this.tableList.tableInfomation = [] |
| | | this.loading = false |
| | | }) |
| | | }, |
| | | // 搜索 |
| | | onFilterSearch(searchText) { |
| | | console.log(searchText) |
| | | this.keyword = searchText ?? "" |
| | | this.pagerOptions.currPage = 1 |
| | | this.getData() |
| | | }, |
| | | // 新增 |
| | | addBtnClick() { |
| | | this.$router.push({ name: "addProductRegisterPage" }) |
| | | }, |
| | | // 查看 |
| | | viewClick(row) { |
| | | console.log(row) |
| | | }, |
| | | // 编辑 |
| | | editClick(row) { |
| | | console.log(row) |
| | | this.$router.push({ |
| | | name:'addProductRegisterPage', |
| | | query:{ |
| | | id:row.ID, |
| | | inspectID:row.finenessCheckID, |
| | | } |
| | | }); |
| | | }, |
| | | // 删除 |
| | | delClick(row) { |
| | | console.log(row) |
| | | } |
| | | delClick(id) { |
| | | this.$confirm("请确认是否删除,删除操作不可撤销?", "警告", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | getDeleteRegister({ id: id }).then((response) => { |
| | | if (response.code === 200) { |
| | | this.$message.success("删除成功") |
| | | this.getData() |
| | | } else { |
| | | this.$message.warning("删除失败") |
| | | } |
| | | }) |
| | | }) |
| | | .catch(() => {}) |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | |
| | | margin: 0 30px; |
| | | background-color: #fff; |
| | | padding: 10px 15px; |
| | | height: calc(100% - 180px); |
| | | height: calc(100% - 160px); |
| | | border-radius: 12px; |
| | | } |
| | | .list-view { |
| | | height: calc(100% - 60px); |
| | | overflow: hidden; |
| | | } |
| | | .btn-pager { |
| | | display: flex; |
| | | margin-top: 10px; |
| | | .page { |
| | | margin-left: auto; |
| | | } |
| | | } |
| | | } |
| | | </style> |