แก้ API
This commit is contained in:
parent
c01031c687
commit
cfd79ee40b
11 changed files with 18 additions and 17 deletions
|
|
@ -65,7 +65,7 @@ const roundOp = ref<DataOption[]>([
|
|||
function fetchspecialByid(id: string) {
|
||||
showLoader();
|
||||
http
|
||||
.get(config.API.kpiSpecial + `/${id}`)
|
||||
.get(config.API.kpiSpecial + `/edit/${id}`)
|
||||
.then((res) => {
|
||||
console.log(res);
|
||||
const data = res.data.result;
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ function selectAgency() {
|
|||
/** บันทึกข้อมูล */
|
||||
function onSubmit() {
|
||||
const url = id.value
|
||||
? config.API.kpiRoleMainList + `/${id.value}`
|
||||
? config.API.kpiRoleMainEdit + `/${id.value}`
|
||||
: config.API.kpiRoleMainList;
|
||||
|
||||
const body = {
|
||||
|
|
@ -177,7 +177,7 @@ function onSubmit() {
|
|||
function getDetail() {
|
||||
showLoader();
|
||||
http
|
||||
.get(config.API.kpiRoleMainList + `/${id.value}`)
|
||||
.get(config.API.kpiRoleMainEdit + `/${id.value}`)
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
form.position = data.position;
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ async function fetchList() {
|
|||
await http
|
||||
.get(
|
||||
config.API.kpiCapacity +
|
||||
`?page=${formQuery.page}&pageSize=${formQuery.pageSize}&keyword=${formQuery.keyword}&type=${store.competencyTypeVal}`
|
||||
`/edit?page=${formQuery.page}&pageSize=${formQuery.pageSize}&keyword=${formQuery.keyword}&type=${store.competencyTypeVal}`
|
||||
)
|
||||
.then(async (res) => {
|
||||
total.value = res.data.result.total;
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ const formData = reactive({
|
|||
function fetchDetail() {
|
||||
showLoader();
|
||||
http
|
||||
.get(config.API.kpiCapacity + `/${competencyId.value}`)
|
||||
.get(config.API.kpiCapacity + `/edit/${competencyId.value}`)
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
formData.competencyType = data.type;
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ function fetchList() {
|
|||
showLoader();
|
||||
formFilter.year = formFilter.year ? formFilter.year.toString() : null;
|
||||
http
|
||||
.post(config.API.kpiSpecial + `/search`, formFilter)
|
||||
.post(config.API.kpiSpecial + `/search-edit`, formFilter)
|
||||
.then((res: ResAssignment) => {
|
||||
maxPage.value = Math.ceil(res.data.result.total / formFilter.pageSize);
|
||||
totalList.value = res.data.result.total;
|
||||
|
|
@ -115,7 +115,7 @@ function onClickDelete(id: string) {
|
|||
dialogRemove($q, () => {
|
||||
showLoader();
|
||||
http
|
||||
.delete(config.API.kpiSpecial + `/${id}`)
|
||||
.delete(config.API.kpiSpecial + `/edit/${id}`)
|
||||
.then(() => {
|
||||
fetchList();
|
||||
success($q, "ลบข้อมูลสำเร็จ");
|
||||
|
|
|
|||
|
|
@ -154,7 +154,7 @@ function onSubmit() {
|
|||
};
|
||||
try {
|
||||
const method = isStatusEdit.value ? "patch" : "post";
|
||||
await http[method](config.API.devStrategy, formData);
|
||||
await http[method](config.API.devStrategy+`/edit`, formData);
|
||||
fetchDataTree();
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
} catch (err) {
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ function fetchList() {
|
|||
if (nodeData.nodeId) {
|
||||
showLoader();
|
||||
http
|
||||
.post(config.API.kpiPlan + `/search`, {
|
||||
.post(config.API.kpiPlan + `/search-edit`, {
|
||||
isAll: isAll.value,
|
||||
keyword: nodeData.keyword,
|
||||
node: nodeData.node ? nodeData.node : 0,
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ const roundOp = ref<DataOption[]>([
|
|||
|
||||
function fetchList() {
|
||||
http
|
||||
.post(config.API.kpiRoleMainList + `/search`, {
|
||||
.post(config.API.kpiRoleMainList + `/search-edit`, {
|
||||
// ?page=${formFilter.page}&pageSize=${formFilter.pageSize}&period=${formFilter.round}&position=${formFilter.position}&keyword=${formFilter.keyword}&year=${formFilter.year}
|
||||
keyword: formFilter.keyword,
|
||||
position: formFilter.position,
|
||||
|
|
@ -141,7 +141,7 @@ function onClickDelete(id: number) {
|
|||
dialogRemove($q, () => {
|
||||
showLoader();
|
||||
http
|
||||
.delete(config.API.kpiRoleMainList + `/${id}`)
|
||||
.delete(config.API.kpiRoleMainEdit + `/${id}`)
|
||||
.then(() => {
|
||||
success($q, "ลบข้อมูลสำเร็จ");
|
||||
fetchList();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue