| | |
| | | <script> |
| | | import pageMixin from "@/components/makepager/pager/mixin/pageMixin" |
| | | import { getSupplierList, changeSupplierStatus } from "@/api/supplierManage/supplier" |
| | | import {getPurchaseList} from "@/api/purchaseManage/purchase" |
| | | import { getPurchaseList } from "@/api/purchaseManage/purchase" |
| | | import DetailSupplier from "@/views/supplierManage/supplier/DetailSupplier" |
| | | import AddSupplier from "@/views/supplierManage/supplier/AddSupplier" |
| | | import RaleteSupplierList from "@/views/supplierManage/supplier/RaleteSupplierList" |
| | |
| | | commonDetail: { |
| | | visible: false, |
| | | infomation: {}, |
| | | productListInfo:[] |
| | | productListInfo: [] |
| | | }, |
| | | editConfig: { |
| | | visible: false, |
| | |
| | | await getSupplierList({ |
| | | name: this.searchSupplierName, |
| | | page: this.pagerOptions.currPage, |
| | | pageSize: this.pagerOptions.pageSize, |
| | | status:1, |
| | | pageSize: this.pagerOptions.pageSize |
| | | }).then((res) => { |
| | | console.log(res) |
| | | if (res.code === 200) { |
| | | const list = res.data.list.map((item) => { |
| | | return { |
| | | ...item, |
| | | id: item.ID, |
| | | id: item.id, |
| | | status_name: item.status === 0 ? "未启用" : "启用" |
| | | } |
| | | }) |
| | |
| | | this.tableList.tableInfomation = list || [] |
| | | this.pagerOptions.totalCount = res.data.total |
| | | if (list && list.length > 0) { |
| | | this.supplierId = this.tableList.tableInfomation[0].ID |
| | | this.supplierId = this.tableList.tableInfomation[0].id |
| | | this.selectRow = this.tableList.tableInfomation.length > 0 ? this.tableList.tableInfomation[0] : {} |
| | | } else { |
| | | this.supplierId = 0 |
| | |
| | | page: this.productPagerOptions.currPage, |
| | | pageSize: this.productPagerOptions.pageSize |
| | | }).then((res) => { |
| | | console.log(res.data) |
| | | const list = res.data.data.list.map((item) => { |
| | | let list = res.data.list.map((item) => { |
| | | return { |
| | | ...item |
| | | } |
| | | }) |
| | | this.productTableList.tableInfomation = list || [] |
| | | this.productPagerOptions.totalCount = res.data.data.total |
| | | this.productPagerOptions.totalCount = res.data.total |
| | | }) |
| | | }, |
| | | // 搜索供应商 |
| | |
| | | addBtnClick() { |
| | | this.editConfig.visible = true |
| | | this.editConfig.title = "新建" |
| | | this.editConfig.infomation = { fileId: 0,responsiblePersonName:'admin'} |
| | | this.editConfig.infomation = { |
| | | fileId: 0, |
| | | responsiblePersonName: document.cookie.replace(/(?:(?:^|.*;\s*)username\s*=\s*([^;]*).*$)|^.*$/, "$1") |
| | | } |
| | | }, |
| | | // 启用供应商 |
| | | async enableClick(row, value) { |
| | | let status = value === "启用" ? 1 : 0 |
| | | await changeSupplierStatus({ |
| | | id: row.ID, |
| | | id:Number(row.id), |
| | | status: status |
| | | }).then((res) => { |
| | | if (res.code === 200) { |
| | |
| | | }, |
| | | // 修改产品 |
| | | editClick(row) { |
| | | console.log(row) |
| | | this.newProductConfig.visible = true |
| | | this.newProductConfig.title = "修改" |
| | | this.newProductConfig.infomation = { ...row } |
| | |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | deleteProduct({ id: row.ID }).then((response) => { |
| | | deleteProduct({ id: row.id }).then((response) => { |
| | | if (response.code === 200) { |
| | | this.$message.success("删除成功") |
| | | this.getProductList() |
| | |
| | | this.selValueList = list |
| | | }, |
| | | tableRowClick(row) { |
| | | console.log(row) |
| | | this.productPagerOptions.currPage = 1 |
| | | this.selectRow = row |
| | | this.supplierId = row.ID |
| | | this.supplierId = row.id |
| | | this.getProductList() |
| | | }, |
| | | // 详情 |
| | | selCommonClick(row) { |
| | | getPurchaseList({pageSize:10,page:1,supplierId:row.ID}).then((res)=>{ |
| | | this.commonDetail.productListInfo=res.data.data.list |
| | | async selCommonClick(row) { |
| | | await getPurchaseList({ pageSize: 10, page: 1, supplierId: Number(row.id) }).then((res) => { |
| | | this.commonDetail.productListInfo = res.data.list |
| | | }) |
| | | this.commonDetail.visible = true |
| | | this.commonDetail.infomation = { ...row } |
| | |
| | | // 创建采购单 |
| | | creatPurchase() { |
| | | this.editPurchaseConfig.visible = true |
| | | this.editPurchaseConfig.title = "创建" |
| | | this.editPurchaseConfig.title = "新建" |
| | | this.editPurchaseConfig.infomation = { |
| | | supplierId: this.selectRow.ID, |
| | | supplierId: this.selectRow.id, |
| | | purchaseTypeId:"2", |
| | | supplierName: this.selectRow.name |
| | | } |
| | | } |