| | |
| | | :table-list="tableList" |
| | | @selCommonClick="selCommonClick" |
| | | @selTableCol="selTableCol" |
| | | @tableRowClick="tableRowClick" |
| | | :selectClassRow="selectRow" |
| | | > |
| | | <template slot="tableButton"> |
| | | <el-table-column label="状态" width="120"> |
| | |
| | | |
| | | <script> |
| | | import pageMixin from "@/components/makepager/pager/mixin/pageMixin" |
| | | import { getPurchaseList, getPurchaseInfo, submitPurchase, deletePurchase } from "@/api/purchaseManage/purchase" |
| | | import { |
| | | getPurchaseList, |
| | | getPurchaseInfo, |
| | | submitPurchase, |
| | | deletePurchase, |
| | | getOperationInfo |
| | | } from "@/api/purchaseManage/purchase" |
| | | import DetailSupplier from "@/views/purchaseManage/purchase/DetailSupplier" |
| | | import AddPurchase from "@/views/purchaseManage/purchase/components/AddPurchase" |
| | | import { getSupplierList } from "@/api/supplierManage/supplier" |
| | |
| | | data() { |
| | | // 产品信息 |
| | | const productColumn = [ |
| | | { label: "产品编号", prop: "number", default: true }, |
| | | { label: "产品名称", prop: "name" }, |
| | | { label: "规格型号", prop: "desc" }, |
| | | { label: "采购数量", prop: "purchaseAmount" }, |
| | | { label: "已发货数量", prop: "margin" }, |
| | | { label: "已入库数量", prop: "amount" }, |
| | | { label: "产品编号", prop: "productId", default: true }, |
| | | { label: "产品名称", prop: "productName" }, |
| | | { label: "规格", prop: "specifications" }, |
| | | { label: "型号", prop: "modelNumber" }, |
| | | { label: "采购数量", prop: "amount" }, |
| | | { label: "已发货数量", prop: "sendAmount" }, |
| | | { label: "已入库数量", prop: "overAmount" }, |
| | | { label: "单位", prop: "unit" }, |
| | | { label: "采购单价", prop: "price", price: true }, |
| | | { label: "价税合计", prop: "total", price: true } |
| | |
| | | // 收货信息 |
| | | const recriveColumn = [ |
| | | { label: "入库单号", prop: "number", default: true }, |
| | | { label: "收货仓库", prop: "name" }, |
| | | { label: "产品名称", prop: "orderAmount" }, |
| | | { label: "产品编码", prop: "invoice" }, |
| | | { label: "数量", prop: "carrier" }, |
| | | { label: "入库时间", prop: "waybill" }, |
| | | { label: "收货人", prop: "warehouse" }, |
| | | { label: "状态", prop: "amount" } |
| | | { label: "收货仓库", prop: "warehouseName" }, |
| | | { label: "产品名称", prop: "productName" }, |
| | | { label: "产品编码", prop: "productId" }, |
| | | { label: "数量", prop: "amount" }, |
| | | { label: "入库时间", prop: "overTime" }, |
| | | { label: "收货人", prop: "principal" }, |
| | | { label: "状态", prop: "status" } |
| | | ] |
| | | return { |
| | | purchaseStatusList: getDataByType("purchaseStatus"), |
| | |
| | | showProductCol: [ |
| | | "产品编号", |
| | | "产品名称", |
| | | "规格型号", |
| | | "规格", |
| | | "型号", |
| | | "采购数量", |
| | | "已发货数量", |
| | | "已入库数量", |
| | |
| | | ], |
| | | // 收货信息 |
| | | recriveColumn: recriveColumn, |
| | | showReceiveCol: ["入库单号", "收货仓库", "产品名称", "产品编号", "数量", "入库时间", "收货人", "状态"], |
| | | loading: false |
| | | showReceiveCol: ["入库单号", "收货仓库", "产品名称", "产品编码", "数量", "入库时间", "收货人", "状态"], |
| | | loading: false, |
| | | selectRow: {} |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | }) |
| | | this.tableList.tableInfomation = list || [] |
| | | this.pagerOptions.totalCount = res.data.total |
| | | if (res.data.total > 0) { |
| | | this.selectRow = this.tableList.tableInfomation.length > 0 ? this.tableList.tableInfomation[0] : {} |
| | | this.tableRowClick(this.selectRow) |
| | | } |
| | | } |
| | | }) |
| | | .catch((err) => { |
| | |
| | | this.tableLoading = false |
| | | }, 3000) |
| | | }, |
| | | // top 行点击 |
| | | tableRowClick(row) { |
| | | this.selectRow = row |
| | | if (row.status == 1 && this.TabsIndex == 0) { |
| | | getPurchaseInfo({ id: row.id }).then((res) => { |
| | | if (res.code == 200) { |
| | | this.productTableList.tableInfomation = res.data.productList |
| | | } else { |
| | | this.$message.error(res.msg ? res.msg + "," : "" + "获取信息失败!") |
| | | } |
| | | }) |
| | | } else if (this.TabsIndex == 1 && row.status == 1) { |
| | | this.productTableList.tableInfomation = [] |
| | | } else { |
| | | getOperationInfo({ id: row.id }).then((res) => { |
| | | if (res.code == 200) { |
| | | this.productTableList.tableInfomation = res.data |
| | | } else { |
| | | this.$message.error(res.msg ? res.msg + "," : "" + "获取信息失败!") |
| | | } |
| | | }) |
| | | } |
| | | }, |
| | | // bom 列表 |
| | | setBottomList() { |
| | | this.productTableList = { |
| | |
| | | this.tableBottomColumn = this.recriveColumn |
| | | this.showBottomCol = this.showReceiveCol |
| | | this.setBottomList() |
| | | // if (this.selectRow.status == 1) { |
| | | // this.productTableList.tableInfomation = [] |
| | | // } else { |
| | | this.getProductInventoryInfo(this.selectRow) |
| | | // } |
| | | } |
| | | }, |
| | | // 状态 |
| | |
| | | // 获取产品/收货信息 |
| | | async getProductInventoryInfo(row) { |
| | | console.log(row) |
| | | // if (this.TabsIndex == 0 || row.status == 1) { |
| | | // this.productTableList.tableInfomation = row.products || [] |
| | | // } else { |
| | | // if (row.number) { |
| | | // this.loading = true |
| | | // await getProductInventoryInfo(row.number) |
| | | // .then((res) => { |
| | | // this.productTableList.tableInfomation = res.data?.length > 0 ? res.data : [] |
| | | // this.loading = false |
| | | // }) |
| | | // .catch(() => { |
| | | // this.productTableList.tableInfomation = [] |
| | | // this.loading = false |
| | | // }) |
| | | // } |
| | | // } |
| | | if (this.TabsIndex == 0 && row.status == 1) { |
| | | getPurchaseInfo({ id: row.id }).then((res) => { |
| | | if (res.code == 200) { |
| | | this.productTableList.tableInfomation = res.data.productList |
| | | } else { |
| | | this.$message.error(res.msg ? res.msg + "," : "" + "获取信息失败!") |
| | | } |
| | | }) |
| | | } else if (this.TabsIndex == 1 && row.status == 1) { |
| | | this.productTableList.tableInfomation = [] |
| | | } else { |
| | | getOperationInfo({ id: row.id }).then((res) => { |
| | | if (res.code == 200) { |
| | | this.productTableList.tableInfomation = res.data |
| | | } else { |
| | | this.$message.error(res.msg ? res.msg + "," : "" + "获取信息失败!") |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | } |