Flatten nested repos
This commit is contained in:
184
test/vuex/one-md-packet/api/packet.js
Normal file
184
test/vuex/one-md-packet/api/packet.js
Normal file
@@ -0,0 +1,184 @@
|
||||
const URL = "/one-api/mockup/masterdata/";
|
||||
|
||||
export async function search_company(token, query) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'packet/search_company', {
|
||||
token:token,
|
||||
search: query
|
||||
});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function search_mou(token, company, query) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'packet/search_mou', {
|
||||
token:token,
|
||||
company_id: company,
|
||||
search: query
|
||||
});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function search_packet(token, mou, type, query, withPxs) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'packet/search_packet' + (withPxs?'/1':''), {
|
||||
token:token,
|
||||
mou: mou,
|
||||
search: query,
|
||||
type: type
|
||||
});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function del_packet(token, id) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'packet/del_packet', {
|
||||
token:token,
|
||||
id: id
|
||||
});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function save(token, datax, edit) {
|
||||
try {
|
||||
let URLx = 'packet/save'
|
||||
if (edit) URLx = 'packet/save_edit'
|
||||
|
||||
var resp = await axios.post(URL + URLx, {
|
||||
token:token,
|
||||
data: datax
|
||||
});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function search_test(mou_id, packet_id, search, exclude, include) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'packet/search_test', {
|
||||
mou_id: mou_id,
|
||||
packet_id: packet_id,
|
||||
search: search,
|
||||
exclude: exclude,
|
||||
include: include
|
||||
});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function search_default_mou() {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'packet/search_mou_default', {});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function save_copy(token, source_id, target_id) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'packet/save_copy', {
|
||||
token:token,
|
||||
source_id: source_id,
|
||||
target_id: target_id
|
||||
});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
49
test/vuex/one-md-packet/api/px.js
Normal file
49
test/vuex/one-md-packet/api/px.js
Normal file
@@ -0,0 +1,49 @@
|
||||
const URL = "/one-api/mockup/masterdata/";
|
||||
|
||||
export async function search(token, packet_id, query) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'packet/search_px', {
|
||||
token:token,
|
||||
packet_id: packet_id,
|
||||
search: query
|
||||
});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function save(token, packet_id, packet_price, packet_original_price, json_px) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'packet/save_px', {
|
||||
token:token,
|
||||
packet_id: packet_id,
|
||||
packet_price: packet_price,
|
||||
packet_original_price: packet_original_price,
|
||||
json_px: json_px
|
||||
});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user