|
@@ -1,7 +1,7 @@
|
|
|
import request from '@/utils/request';
|
|
import request from '@/utils/request';
|
|
|
|
|
|
|
|
// 保存/修改编码信息
|
|
// 保存/修改编码信息
|
|
|
-export async function saveNew (data) {
|
|
|
|
|
|
|
+export async function saveNew(data) {
|
|
|
const res = await request.post('/main/codemanage/saveNew', data);
|
|
const res = await request.post('/main/codemanage/saveNew', data);
|
|
|
if (res.data.code == 0) {
|
|
if (res.data.code == 0) {
|
|
|
return res.data.data;
|
|
return res.data.data;
|
|
@@ -10,7 +10,7 @@ export async function saveNew (data) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 获取编码列表
|
|
// 获取编码列表
|
|
|
-export async function getCodeList (data) {
|
|
|
|
|
|
|
+export async function getCodeList(data) {
|
|
|
let par = new URLSearchParams(data);
|
|
let par = new URLSearchParams(data);
|
|
|
const res = await request.get(`/main/codemanage/page?` + par, {});
|
|
const res = await request.get(`/main/codemanage/page?` + par, {});
|
|
|
if (res.data.code == 0) {
|
|
if (res.data.code == 0) {
|
|
@@ -18,11 +18,23 @@ export async function getCodeList (data) {
|
|
|
}
|
|
}
|
|
|
return Promise.reject(new Error(res.data.message));
|
|
return Promise.reject(new Error(res.data.message));
|
|
|
}
|
|
}
|
|
|
|
|
+// 查询未被绑定的单据编码
|
|
|
|
|
+export async function queryNotBoundDocumentCode(data) {
|
|
|
|
|
+ let par = new URLSearchParams(data);
|
|
|
|
|
+ const res = await request.get(
|
|
|
|
|
+ `/main/form/number/config/queryNotBoundDocumentCode?` + par,
|
|
|
|
|
+ {}
|
|
|
|
|
+ );
|
|
|
|
|
+ if (res.data.code == 0) {
|
|
|
|
|
+ return res.data.data;
|
|
|
|
|
+ }
|
|
|
|
|
+ return Promise.reject(new Error(res.data.message));
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 删除编码
|
|
* 删除编码
|
|
|
*/
|
|
*/
|
|
|
-export async function removeCodeInfo (params) {
|
|
|
|
|
|
|
+export async function removeCodeInfo(params) {
|
|
|
const res = await request.post('/main/codemanage/delete', params);
|
|
const res = await request.post('/main/codemanage/delete', params);
|
|
|
if (res.data.code == 0) {
|
|
if (res.data.code == 0) {
|
|
|
return res.data.message;
|
|
return res.data.message;
|
|
@@ -31,7 +43,7 @@ export async function removeCodeInfo (params) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 获取编码详情
|
|
// 获取编码详情
|
|
|
-export async function getCodeDetail (id) {
|
|
|
|
|
|
|
+export async function getCodeDetail(id) {
|
|
|
const res = await request.get(`/main/codemanage/getById/` + id, {});
|
|
const res = await request.get(`/main/codemanage/getById/` + id, {});
|
|
|
if (res.data.code == 0) {
|
|
if (res.data.code == 0) {
|
|
|
return res.data.data;
|
|
return res.data.data;
|
|
@@ -39,8 +51,8 @@ export async function getCodeDetail (id) {
|
|
|
return Promise.reject(new Error(res.data.message));
|
|
return Promise.reject(new Error(res.data.message));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-export async function checkExist (params) {
|
|
|
|
|
- const res = await request.get(`/main/category/checkExist` , {params});
|
|
|
|
|
|
|
+export async function checkExist(params) {
|
|
|
|
|
+ const res = await request.get(`/main/category/checkExist`, { params });
|
|
|
if (res.data.code == 0) {
|
|
if (res.data.code == 0) {
|
|
|
return res.data.data;
|
|
return res.data.data;
|
|
|
}
|
|
}
|
|
@@ -48,7 +60,7 @@ export async function checkExist (params) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 生成编码
|
|
// 生成编码
|
|
|
-export async function getCode (code) {
|
|
|
|
|
|
|
+export async function getCode(code) {
|
|
|
const res = await request.get(`/main/codemanage/getCode/` + code, {});
|
|
const res = await request.get(`/main/codemanage/getCode/` + code, {});
|
|
|
if (res.data.code == 0) {
|
|
if (res.data.code == 0) {
|
|
|
return res.data.data;
|
|
return res.data.data;
|
|
@@ -60,7 +72,7 @@ export async function getCode (code) {
|
|
|
* 检查编码是否存在
|
|
* 检查编码是否存在
|
|
|
* @param code 编码
|
|
* @param code 编码
|
|
|
*/
|
|
*/
|
|
|
-export async function checkCode (code) {
|
|
|
|
|
|
|
+export async function checkCode(code) {
|
|
|
const res = await request.get('/main/codemanage/getByCode/' + code);
|
|
const res = await request.get('/main/codemanage/getByCode/' + code);
|
|
|
if (res.data.code == 0) {
|
|
if (res.data.code == 0) {
|
|
|
return res.data.data;
|
|
return res.data.data;
|
|
@@ -69,24 +81,21 @@ export async function checkCode (code) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 根据根级物品id升级物品编码
|
|
// 根据根级物品id升级物品编码
|
|
|
-export async function rootCategoryCode (rootCategoryLevelId) {
|
|
|
|
|
- const res = await request.get(`/main/category/copyInfo/${rootCategoryLevelId}`);
|
|
|
|
|
|
|
+export async function rootCategoryCode(rootCategoryLevelId) {
|
|
|
|
|
+ const res = await request.get(
|
|
|
|
|
+ `/main/category/copyInfo/${rootCategoryLevelId}`
|
|
|
|
|
+ );
|
|
|
if (res.data.code == 0) {
|
|
if (res.data.code == 0) {
|
|
|
return res.data.data;
|
|
return res.data.data;
|
|
|
}
|
|
}
|
|
|
return Promise.reject(new Error(res.data.message));
|
|
return Promise.reject(new Error(res.data.message));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
// 动态表头
|
|
// 动态表头
|
|
|
export async function fieldModel(params) {
|
|
export async function fieldModel(params) {
|
|
|
- const res = await request.get(
|
|
|
|
|
- `/main/fieldmodel/list`, { params }
|
|
|
|
|
- );
|
|
|
|
|
|
|
+ const res = await request.get(`/main/fieldmodel/list`, { params });
|
|
|
if (res.data.code == 0) {
|
|
if (res.data.code == 0) {
|
|
|
return res.data.data;
|
|
return res.data.data;
|
|
|
}
|
|
}
|
|
|
return Promise.reject(new Error(res.data.message));
|
|
return Promise.reject(new Error(res.data.message));
|
|
|
-}
|
|
|
|
|
|
|
+}
|