141 lines
2.7 KiB
JavaScript
141 lines
2.7 KiB
JavaScript
/*
|
|
* @Author: zwq
|
|
* @Date: 2020-12-29 16:00:14
|
|
* @LastEditors: lb
|
|
* @LastEditTime: 2022-04-14 13:03:31
|
|
* @Description:
|
|
*/
|
|
import request from '@/utils/request'
|
|
|
|
/**
|
|
* 获取分页物料信息列表
|
|
* @param {object} data
|
|
* @param {string} [data.code]
|
|
* @param {number} data.current
|
|
* @param {number} [data.enabled]
|
|
* @param {string} [data.name]
|
|
* @param {number} data.size
|
|
*/
|
|
export function list(data) {
|
|
return request({
|
|
url: '/basic/material/page',
|
|
method: 'post',
|
|
data
|
|
})
|
|
}
|
|
|
|
/**
|
|
* 获取物料信息单条数据
|
|
* @param {number} id
|
|
*/
|
|
export function detail(id) {
|
|
return request({
|
|
url: '/basic/material/get',
|
|
method: 'post',
|
|
data: { id }
|
|
})
|
|
}
|
|
|
|
/**
|
|
* 更新物料信息单条数据
|
|
* @param {object} data
|
|
* @param {string} [data.abbr]
|
|
* @param {string} data.code
|
|
* @param {string} [data.description]
|
|
* @param {string} [data.enName]
|
|
* @param {number} data.id
|
|
* @param {number} [data.materialTypeId]
|
|
* @param {string} data.name
|
|
* @param {string} [data.remark]
|
|
*/
|
|
export function update(data) {
|
|
return request({
|
|
url: '/basic/material/update',
|
|
method: 'post',
|
|
data
|
|
})
|
|
}
|
|
|
|
/**
|
|
* 新增物料信息单条数据
|
|
* @param {object} data
|
|
* @param {string} [data.abbr]
|
|
* @param {string} data.code
|
|
* @param {string} [data.description]
|
|
* @param {string} [data.enName]
|
|
* @param {number} [data.id]
|
|
* @param {number} [data.materialTypeId]
|
|
* @param {string} data.name
|
|
* @param {string} [data.remark]
|
|
*/
|
|
export function add(data) {
|
|
return request({
|
|
url: '/basic/material/add',
|
|
method: 'post',
|
|
data
|
|
})
|
|
}
|
|
|
|
export function getCode() { // 获取物料信息code
|
|
return request({
|
|
url: '/basic/material/get-code',
|
|
method: 'post'
|
|
})
|
|
}
|
|
|
|
/**
|
|
* 获取物料信息单条数据
|
|
* @param {number} id
|
|
*/
|
|
export function del(id) {
|
|
return request({
|
|
url: '/basic/material/delete',
|
|
method: 'post',
|
|
data: { id }
|
|
})
|
|
}
|
|
|
|
/**
|
|
* 获取物料的属性列表
|
|
* @param {object} data
|
|
* @param {number} data.current
|
|
* @param {number} [data.enabled]
|
|
* @param {number} [data.materialId]
|
|
* @param {number} data.size
|
|
*/
|
|
export function getAttributeList(data) {
|
|
return request({
|
|
url: '/basic/material-attr/page',
|
|
method: 'post',
|
|
data
|
|
})
|
|
}
|
|
|
|
/**
|
|
* 删除物料的属性数据
|
|
* @param {number} id
|
|
*/
|
|
export function deleteAttribute(id) {
|
|
return request({
|
|
url: '/basic/material-attr/delete',
|
|
method: 'post',
|
|
data: { id }
|
|
})
|
|
}
|
|
|
|
/**
|
|
* 获取分页的物料类型列表
|
|
* @param {object} data
|
|
* @param {number} data.current
|
|
* @param {number} [data.enabled]
|
|
* @param {string} [data.name]
|
|
* @param {number} data.size
|
|
*/
|
|
export function getTypeList(data) {
|
|
return request({
|
|
url: '/basic/material-type/page',
|
|
method: 'post',
|
|
data
|
|
})
|
|
}
|