增加进销存
This commit is contained in:
+196
@@ -0,0 +1,196 @@
|
||||
import { getAction, deleteAction, putAction, postAction, httpAction } from '@/api/manage'
|
||||
|
||||
//首页统计
|
||||
const getBuyAndSaleStatistics = (params)=>getAction("/erp/depotHead/getBuyAndSaleStatistics",params);
|
||||
const buyOrSalePrice = (params)=>getAction("/erp/depotItem/buyOrSalePrice",params);
|
||||
//租户管理
|
||||
const checkTenant = (params)=>getAction("/erp/tenant/checkIsNameExist",params);
|
||||
const editTenant = (params)=>putAction("/erp/tenant/update",params);
|
||||
//角色管理
|
||||
const addRole = (params)=>postAction("/erp/role/add",params);
|
||||
const editRole = (params)=>putAction("/erp/role/update",params);
|
||||
const checkRole = (params)=>getAction("/erp/role/checkIsNameExist",params);
|
||||
const roleAllList = (params)=>getAction("/erp/role/allList",params);
|
||||
//用户管理
|
||||
const registerUser = (params)=>postAction("/erp/user/registerUser",params);
|
||||
const addUser = (params)=>postAction("/erp/user/addUser",params);
|
||||
const editUser = (params)=>putAction("/erp/user/updateUser",params);
|
||||
const getUserList = (params)=>getAction("/erp/user/getUserList",params);
|
||||
const queryPermissionsByUser = (params)=>postAction("/erp/function/findMenuByPNumber",params);
|
||||
//机构管理
|
||||
const queryOrganizationTreeList = (params)=>getAction("/erp/organization/getOrganizationTree",params);
|
||||
const queryOrganizationById = (params)=>getAction("/erp/organization/findById",params);
|
||||
const checkOrganization = (params)=>getAction("/erp/organization/checkIsNameExist",params);
|
||||
//经手人管理
|
||||
const addPerson = (params)=>postAction("/erp/person/add",params);
|
||||
const editPerson = (params)=>putAction("/erp/person/update",params);
|
||||
const checkPerson = (params)=>getAction("/erp/person/checkIsNameExist",params);
|
||||
const getPersonByType = (params)=>getAction("/erp/person/getPersonByType",params);
|
||||
const getPersonByNumType = (params)=>getAction("/erp/person/getPersonByNumType",params);
|
||||
//账户管理
|
||||
const addAccount = (params)=>postAction("/erp/account/add",params);
|
||||
const editAccount = (params)=>putAction("/erp/account/update",params);
|
||||
const checkAccount = (params)=>getAction("/erp/account/checkIsNameExist",params);
|
||||
const getAccount = (params)=>getAction("/erp/account/getAccount",params);
|
||||
//收支项目
|
||||
const addInOutItem = (params)=>postAction("/erp/inOutItem/add",params);
|
||||
const editInOutItem = (params)=>putAction("/erp/inOutItem/update",params);
|
||||
const checkInOutItem = (params)=>getAction("/erp/inOutItem/checkIsNameExist",params);
|
||||
const findInOutItemByParam = (params)=>getAction("/erp/inOutItem/findBySelect",params);
|
||||
//仓库信息
|
||||
const addDepot = (params)=>postAction("/erp/depot/add",params);
|
||||
const editDepot = (params)=>putAction("/erp/depot/update",params);
|
||||
const checkDepot = (params)=>getAction("/erp/depot/checkIsNameExist",params);
|
||||
//商品属性
|
||||
const editMaterialProperty = (params)=>putAction("/erp/materialProperty/update",params);
|
||||
//商品类型
|
||||
const queryMaterialCategoryTreeList = (params)=>getAction("/erp/materialCategory/getMaterialCategoryTree",params);
|
||||
const queryMaterialCategoryById = (params)=>getAction("/erp/materialCategory/findById",params);
|
||||
const checkMaterialCategory = (params)=>getAction("/erp/materialCategory/checkIsNameExist",params);
|
||||
//商品管理
|
||||
const addMaterial = (params)=>postAction("/erp/material/add",params);
|
||||
const editMaterial = (params)=>putAction("/erp/material/update",params);
|
||||
const checkMaterial = (params)=>getAction("/erp/material/checkIsExist",params);
|
||||
const getMaterialBySelect = (params)=>getAction("/erp/material/findBySelect",params);
|
||||
const getSerialMaterialBySelect = (params)=>getAction("/erp/material/getMaterialEnableSerialNumberList",params);
|
||||
const getMaterialByBarCode = (params)=>getAction("/erp/material/getMaterialByBarCode",params);
|
||||
const getMaxBarCode = (params)=>getAction("/erp/material/getMaxBarCode",params);
|
||||
const checkMaterialBarCode = (params)=>getAction("/erp/materialsExtend/checkIsBarCodeExist",params);
|
||||
//序列号
|
||||
const addSerialNumber = (params)=>postAction("/erp/serialNumber/add",params);
|
||||
const editSerialNumber = (params)=>putAction("/erp/serialNumber/update",params);
|
||||
const checkSerialNumber = (params)=>getAction("/erp/serialNumber/checkIsNameExist",params);
|
||||
const batAddSerialNumber = (params)=>postAction("/erp/serialNumber/batAddSerialNumber",params);
|
||||
const getEnableSerialNumberList = (params)=>getAction("/erp/serialNumber/getEnableSerialNumberList",params);
|
||||
//多属性
|
||||
const addMaterialAttribute = (params)=>postAction("/erp/materialAttribute/add",params);
|
||||
const editMaterialAttribute = (params)=>putAction("/erp/materialAttribute/update",params);
|
||||
const checkMaterialAttribute = (params)=>getAction("/erp/materialAttribute/checkIsNameExist",params);
|
||||
const getAllMaterialAttribute = (params)=>getAction("/erp/materialAttribute/getAll",params);
|
||||
//功能管理
|
||||
const addFunction = (params)=>postAction("/erp/function/add",params);
|
||||
const editFunction = (params)=>putAction("/erp/function/update",params);
|
||||
const checkFunction = (params)=>getAction("/erp/function/checkIsNameExist",params);
|
||||
//系统配置
|
||||
const addSystemConfig = (params)=>postAction("/erp/systemConfig/add",params);
|
||||
const editSystemConfig = (params)=>putAction("/erp/systemConfig/update",params);
|
||||
const checkSystemConfig = (params)=>getAction("/erp/systemConfig/checkIsNameExist",params);
|
||||
const getCurrentSystemConfig = (params)=>getAction("/erp/systemConfig/getCurrentInfo",params);
|
||||
const fileSizeLimit = (params)=>getAction("/erp/systemConfig/fileSizeLimit",params);
|
||||
//平台参数
|
||||
const addPlatformConfig = (params)=>postAction("/erp/platformConfig/add",params);
|
||||
const editPlatformConfig = (params)=>putAction("/erp/platformConfig/update",params);
|
||||
const getPlatformConfigByKey = (params)=>getAction("/erp/platformConfig/getPlatformConfigByKey",params);
|
||||
//用户|角色|模块关系
|
||||
const addUserBusiness = (params)=>postAction("/erp/userBusiness/add",params);
|
||||
const editUserBusiness = (params)=>putAction("/erp/userBusiness/update",params);
|
||||
const checkUserBusiness = (params)=>getAction("/erp/userBusiness/checkIsValueExist",params);
|
||||
const updateBtnStrByRoleId = (params)=>postAction("/erp/userBusiness/updateBtnStr",params);
|
||||
//计量单位
|
||||
const addUnit = (params)=>postAction("/erp/unit/add",params);
|
||||
const editUnit = (params)=>putAction("/erp/unit/update",params);
|
||||
const checkUnit = (params)=>getAction("/erp/unit/checkIsNameExist",params);
|
||||
//供应商|客户|会员
|
||||
const addSupplier = (params)=>postAction("/erp/supplier/add",params);
|
||||
const editSupplier = (params)=>putAction("/erp/supplier/update",params);
|
||||
const checkSupplier = (params)=>getAction("/erp/supplier/checkIsNameAndTypeExist",params);
|
||||
const findBySelectSup = (params)=>postAction("/erp/supplier/findBySelect_sup",params);
|
||||
const findBySelectCus = (params)=>postAction("/erp/supplier/findBySelect_cus",params);
|
||||
const findBySelectRetail = (params)=>postAction("/erp/supplier/findBySelect_retail",params);
|
||||
const findBySelectOrgan = (params)=>postAction("/erp/supplier/findBySelect_organ",params);
|
||||
//单据相关
|
||||
const findBillDetailByNumber = (params)=>getAction("/erp/depotHead/getDetailByNumber",params);
|
||||
const findStockByDepotAndBarCode = (params)=>getAction("/erp/depotItem/findStockByDepotAndBarCode",params);
|
||||
const getBatchNumberList = (params)=>getAction("/erp/depotItem/getBatchNumberList",params);
|
||||
const findFinancialDetailByNumber = (params)=>getAction("/erp/accountHead/getDetailByNumber",params);
|
||||
|
||||
//租户信息
|
||||
const getAlltenantInfo = (params)=>getAction("/erp/tenant/listAllTenant",params);
|
||||
export {
|
||||
getBuyAndSaleStatistics,
|
||||
buyOrSalePrice,
|
||||
checkTenant,
|
||||
editTenant,
|
||||
addRole,
|
||||
editRole,
|
||||
checkRole,
|
||||
roleAllList,
|
||||
registerUser,
|
||||
addUser,
|
||||
editUser,
|
||||
getUserList,
|
||||
queryPermissionsByUser,
|
||||
queryOrganizationTreeList,
|
||||
queryOrganizationById,
|
||||
checkOrganization,
|
||||
addPerson,
|
||||
editPerson,
|
||||
checkPerson,
|
||||
getPersonByType,
|
||||
getPersonByNumType,
|
||||
addAccount,
|
||||
editAccount,
|
||||
checkAccount,
|
||||
getAccount,
|
||||
addInOutItem,
|
||||
editInOutItem,
|
||||
checkInOutItem,
|
||||
findInOutItemByParam,
|
||||
addDepot,
|
||||
editDepot,
|
||||
checkDepot,
|
||||
editMaterialProperty,
|
||||
queryMaterialCategoryTreeList,
|
||||
queryMaterialCategoryById,
|
||||
checkMaterialCategory,
|
||||
addMaterial,
|
||||
editMaterial,
|
||||
checkMaterial,
|
||||
getMaterialBySelect,
|
||||
getSerialMaterialBySelect,
|
||||
getMaterialByBarCode,
|
||||
getMaxBarCode,
|
||||
checkMaterialBarCode,
|
||||
addSerialNumber,
|
||||
editSerialNumber,
|
||||
checkSerialNumber,
|
||||
batAddSerialNumber,
|
||||
getEnableSerialNumberList,
|
||||
addMaterialAttribute,
|
||||
editMaterialAttribute,
|
||||
checkMaterialAttribute,
|
||||
getAllMaterialAttribute,
|
||||
addFunction,
|
||||
editFunction,
|
||||
checkFunction,
|
||||
addSystemConfig,
|
||||
editSystemConfig,
|
||||
checkSystemConfig,
|
||||
getCurrentSystemConfig,
|
||||
fileSizeLimit,
|
||||
addPlatformConfig,
|
||||
editPlatformConfig,
|
||||
getPlatformConfigByKey,
|
||||
addUserBusiness,
|
||||
editUserBusiness,
|
||||
checkUserBusiness,
|
||||
updateBtnStrByRoleId,
|
||||
addUnit,
|
||||
editUnit,
|
||||
checkUnit,
|
||||
addSupplier,
|
||||
editSupplier,
|
||||
checkSupplier,
|
||||
findBySelectSup,
|
||||
findBySelectCus,
|
||||
findBySelectRetail,
|
||||
findBySelectOrgan,
|
||||
findBillDetailByNumber,
|
||||
findStockByDepotAndBarCode,
|
||||
getBatchNumberList,
|
||||
findFinancialDetailByNumber,
|
||||
getAlltenantInfo
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,189 @@
|
||||
import Vue from 'vue'
|
||||
import request from '@/utils/request'
|
||||
import { typeOf } from 'mathjs'
|
||||
import Cookies from 'js-cookie'
|
||||
|
||||
const api = {
|
||||
user: '/erp/api/user',
|
||||
role: '/erp/api/role',
|
||||
service: '/erp/api/service',
|
||||
permission: '/erp/api/permission',
|
||||
permissionNoPager: '/erp/api/permission/no-pager'
|
||||
}
|
||||
|
||||
export default api
|
||||
let startTime = Cookies.get('SEASON')?Cookies.get('SEASON').startTime:"2020-01-01 00:00:00";
|
||||
//post
|
||||
export function postAction(url,parameter) {
|
||||
parameter = {startTime:startTime,...parameter}
|
||||
return request({
|
||||
url: url,
|
||||
method:'post' ,
|
||||
data: parameter
|
||||
})
|
||||
}
|
||||
|
||||
//post method= {post | put}
|
||||
export function httpAction(url,parameter,method) {
|
||||
parameter = {startTime:startTime,...parameter}
|
||||
return request({
|
||||
url: url,
|
||||
method:method ,
|
||||
data: parameter
|
||||
})
|
||||
}
|
||||
|
||||
//put
|
||||
export function putAction(url,parameter) {
|
||||
parameter = {startTime:startTime,...parameter}
|
||||
return request({
|
||||
url: url,
|
||||
method:'put',
|
||||
data: parameter
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
//get
|
||||
export function getAction(url,parameter) {
|
||||
parameter = {startTime:startTime,...parameter}
|
||||
return request({
|
||||
url: url,
|
||||
method: 'get',
|
||||
params: parameter
|
||||
})
|
||||
}
|
||||
|
||||
//deleteAction
|
||||
export function deleteAction(url,parameter) {
|
||||
parameter = {startTime:startTime,...parameter}
|
||||
return request({
|
||||
url: url,
|
||||
method: 'delete',
|
||||
params: parameter
|
||||
})
|
||||
}
|
||||
|
||||
export function getUserList(parameter) {
|
||||
parameter = {startTime:startTime,...parameter}
|
||||
return request({
|
||||
url: api.user,
|
||||
method: 'get',
|
||||
params: parameter
|
||||
})
|
||||
}
|
||||
|
||||
export function getRoleList(parameter) {
|
||||
parameter = {startTime:startTime,...parameter}
|
||||
return request({
|
||||
url: api.role,
|
||||
method: 'get',
|
||||
params: parameter
|
||||
})
|
||||
}
|
||||
|
||||
export function getServiceList(parameter) {
|
||||
parameter = {startTime:startTime,...parameter}
|
||||
return request({
|
||||
url: api.service,
|
||||
method: 'get',
|
||||
params: parameter
|
||||
})
|
||||
}
|
||||
|
||||
export function getPermissions(parameter) {
|
||||
parameter = {startTime:startTime,...parameter}
|
||||
return request({
|
||||
url: api.permissionNoPager,
|
||||
method: 'get',
|
||||
params: parameter
|
||||
})
|
||||
}
|
||||
|
||||
// id == 0 add post
|
||||
// id != 0 update put
|
||||
export function saveService(parameter) {
|
||||
return request({
|
||||
url: api.service,
|
||||
method: parameter.id == 0 ? 'post' : 'put',
|
||||
data: parameter
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 下载文件 用于excel导出
|
||||
* @param url
|
||||
* @param parameter
|
||||
* @returns {*}
|
||||
*/
|
||||
export function downFile(url,parameter){
|
||||
return request({
|
||||
url: url,
|
||||
params: parameter,
|
||||
method:'get' ,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 下载文件
|
||||
* @param url 文件路径
|
||||
* @param fileName 文件名
|
||||
* @param parameter
|
||||
* @returns {*}
|
||||
*/
|
||||
export function downloadFile(url, fileName, parameter) {
|
||||
return downFile(url, parameter).then((data) => {
|
||||
if (!data || data.size === 0) {
|
||||
Vue.prototype['$message'].warning('文件下载失败')
|
||||
return
|
||||
}
|
||||
if (typeof window.navigator.msSaveBlob !== 'undefined') {
|
||||
window.navigator.msSaveBlob(new Blob([data]), fileName)
|
||||
} else {
|
||||
let url = window.URL.createObjectURL(new Blob([data]))
|
||||
let link = document.createElement('a')
|
||||
link.style.display = 'none'
|
||||
link.href = url
|
||||
link.setAttribute('download', fileName)
|
||||
document.body.appendChild(link)
|
||||
link.click()
|
||||
document.body.removeChild(link) //下载完成移除元素
|
||||
window.URL.revokeObjectURL(url) //释放掉blob对象
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 文件上传 用于富文本上传图片
|
||||
* @param url
|
||||
* @param parameter
|
||||
* @returns {*}
|
||||
*/
|
||||
export function uploadAction(url,parameter){
|
||||
return request({
|
||||
url: url,
|
||||
data: parameter,
|
||||
method:'post' ,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data', // 文件上传
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取文件服务访问路径
|
||||
* @param avatar
|
||||
* @param subStr
|
||||
* @returns {*}
|
||||
*/
|
||||
export function getFileAccessHttpUrl(avatar,subStr) {
|
||||
if(!subStr) subStr = 'http'
|
||||
if(avatar && avatar.startsWith(subStr)){
|
||||
return avatar;
|
||||
}else{
|
||||
if(avatar && avatar.length>0 && avatar.indexOf('[')==-1){
|
||||
return window._CONFIG['domianURL'] + "/" + avatar;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user