| | |
| | | import axios from "axios" |
| | | |
| | | // 产品列表 |
| | | export const getProductList = async (data) => { |
| | | return await axios.get(`/api/p/getProductList`, { |
| | | params: data |
| | | // export const getProductList = async (data) => { |
| | | // return await axios.get(`/api/p/getProductList`, { |
| | | // params: data |
| | | // }) |
| | | // } |
| | | export function getProductList(data) { |
| | | return request({ |
| | | url: "/api/p/getProductList", |
| | | method: "get", |
| | | data |
| | | }) |
| | | } |
| | | // 创建产品 |
| | |
| | | }) |
| | | } |
| | | // 采购单列表 |
| | | export const getPurchaseList = async (data) => { |
| | | return await axios.get(`/api/purchase/purchaseList`, { |
| | | params: data |
| | | }) |
| | | } |
| | | // export const getPurchaseList = async (data) => { |
| | | // return await axios.get(`/api/purchase/purchaseList`, { |
| | | // params: data |
| | | // }) |
| | | // } |
| | | export function getPurchaseList(data) { |
| | | return request({ |
| | | url: "/api/purchase/purchaseList", |
| | | method: "get", |
| | | params: data |
| | | }) |
| | | } |
| | | // 创建采购单 |
| | | export function addPurchase(data) { |
| | | return request({ |
| | | url: "/api/purchase/purchase", |
| | | method: "post", |
| | | data |
| | | }) |
| | | } |
| | | return request({ |
| | | url: "/api/purchase/purchase", |
| | | method: "post", |
| | | data |
| | | }) |
| | | } |
| | | // 更新采购单 |
| | | export function updatePurchase(data) { |
| | | return request({ |
| | |
| | | }, |
| | | actions:{ |
| | | getSupplier(context){ |
| | | getSupplierList({page:1,pageSize:100}).then((res) => { |
| | | getSupplierList({page:1,pageSize:100,status:1}).then((res) => { |
| | | if (res.code == 200) { |
| | | context.commit("supplierNameList", res.data.list) |
| | | } else { |
| | |
| | | { label: "经办人", prop: "handledBy", min: 130 }, |
| | | { label: "制单人", prop: "creator", min: 130 } |
| | | ], |
| | | showCol: ['采购单号', '采购单名称', '单据类型', '供应商名称', '采购数量', '收货仓库','经办人','制单人'] |
| | | showCol: ['采购单号', '采购单名称', '单据类型', '供应商名称', '采购数量', '收货仓库','经办人','制单人'], |
| | | pagerOptions:{ |
| | | pageSize:15, |
| | | currPage:1, |
| | | } |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | // 请求数据 |
| | | async getData() { |
| | | await getPurchaseList({ |
| | | keyword: this.search, |
| | | keyword: this.search||'', |
| | | page: this.pagerOptions.currPage, |
| | | pageSize: this.pagerOptions.pageSize |
| | | }) |
| | | .then((res) => { |
| | | if (res.data.code === 200) { |
| | | let list = res.data.data.list |
| | | if (res.code === 200) { |
| | | let list = res.data.list |
| | | list.map((item)=>{ |
| | | item.supplierName=item.supplier.name |
| | | }) |
| | | this.tableList.tableInfomation = list || [] |
| | | this.pagerOptions.totalCount = res.data.data.total |
| | | this.pagerOptions.totalCount = res.data.total |
| | | } |
| | | }) |
| | | .catch((err) => { |
| | |
| | | name: data.name || "", |
| | | number: data.number || "", |
| | | phone: data.phone || "", |
| | | responsiblePersonName: data.responsiblePersonName || "admin", |
| | | responsiblePersonName: data.responsiblePersonName || document.cookie.replace(/(?:(?:^|.*;\s*)username\s*=\s*([^;]*).*$)|^.*$/, "$1"), |
| | | status: data.status || 0, |
| | | supplierType: data.supplierType || "", |
| | | url: data.url || "" |
| | |
| | | name: this.searchSupplierName, |
| | | page: this.pagerOptions.currPage, |
| | | pageSize: this.pagerOptions.pageSize, |
| | | status:1, |
| | | }).then((res) => { |
| | | console.log(res) |
| | | if (res.code === 200) { |
| | |
| | | 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 |
| | | }) |
| | | }, |
| | | // 搜索供应商 |