feature: serah terima & print barcode
This commit is contained in:
@@ -131,9 +131,9 @@ export default {
|
||||
context.commit("roasset/update_snackbar", snac, { root: true });
|
||||
}
|
||||
},
|
||||
async listingStaff(context) {
|
||||
async listingStaff(context, params) {
|
||||
try {
|
||||
const params = { token: one_token() };
|
||||
params.token = one_token();
|
||||
const resp = await api.getListStaff(params);
|
||||
if (resp.status != 'OK') {
|
||||
throw new Error(resp.message);
|
||||
|
||||
@@ -33,7 +33,14 @@ export default {
|
||||
dialog_delete: false,
|
||||
|
||||
/* confirm */
|
||||
dialog_confirm: false
|
||||
dialog_confirm: false,
|
||||
|
||||
/* barcode */
|
||||
dialog_barcode: false,
|
||||
list_barcode: [],
|
||||
dialog_handover_asset: false,
|
||||
list_item_not_handed: [],
|
||||
list_lokasi: []
|
||||
},
|
||||
mutations: {
|
||||
/* common */
|
||||
@@ -74,8 +81,26 @@ export default {
|
||||
state.dialog_delete = val
|
||||
},
|
||||
|
||||
/* delete */
|
||||
update_dialog_confirm(state, val) {
|
||||
state.dialog_confirm = val
|
||||
},
|
||||
|
||||
/* barcode */
|
||||
update_dialog_barcode(state, val) {
|
||||
state.dialog_barcode = val
|
||||
},
|
||||
update_list_barcode(state, val) {
|
||||
state.list_barcode = val
|
||||
},
|
||||
update_dialog_handover_asset(state, val) {
|
||||
state.dialog_handover_asset = val
|
||||
},
|
||||
update_list_item_not_handed(state, val) {
|
||||
state.list_item_not_handed = val
|
||||
},
|
||||
update_list_lokasi(state, val) {
|
||||
state.list_lokasi = val
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
@@ -209,6 +234,75 @@ export default {
|
||||
const snac = { color: 'error', msg: e.message, state: false };
|
||||
context.commit("update_snackbar", snac);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
async lookupRuangan(context) {
|
||||
try {
|
||||
const params = {
|
||||
token: one_token(),
|
||||
search: ''
|
||||
};
|
||||
const resp = await api.getRuangan(params);
|
||||
if (resp.status != 'OK') {
|
||||
throw new Error(resp.message);
|
||||
}
|
||||
|
||||
context.commit("update_list_lokasi", resp.data);
|
||||
} catch (e) {
|
||||
const snac = { color: 'error', msg: e.message, state: true };
|
||||
context.commit("update_snackbar", snac);
|
||||
}
|
||||
},
|
||||
async lookupAssetNotHanded(context, id) {
|
||||
try {
|
||||
const params = {
|
||||
token: one_token(),
|
||||
ROID: id
|
||||
};
|
||||
const resp = await api.getAssetBelumSerahTerima(params);
|
||||
if (resp.status != 'OK') {
|
||||
throw new Error(resp.message);
|
||||
}
|
||||
|
||||
context.commit("update_list_item_not_handed", resp.data);
|
||||
} catch (e) {
|
||||
const snac = { color: 'error', msg: e.message, state: true };
|
||||
context.commit("update_snackbar", snac);
|
||||
}
|
||||
},
|
||||
async saveHandoverAsset(context, params) {
|
||||
try {
|
||||
params.token = one_token();
|
||||
const resp = await api.saveHandover(params);
|
||||
if (resp.status != 'OK') {
|
||||
throw new Error(resp.message);
|
||||
}
|
||||
|
||||
const snac = { color: 'success', msg: resp.data, state: true };
|
||||
context.commit("update_snackbar", snac);
|
||||
context.dispatch("lookupOrderAssetReceived");
|
||||
context.commit("update_dialog_handover_asset", false);
|
||||
} catch (e) {
|
||||
const snac = { color: 'error', msg: e.message, state: true };
|
||||
context.commit("update_snackbar", snac);
|
||||
}
|
||||
},
|
||||
async lookupBarcodes(context, id) {
|
||||
try {
|
||||
const params = {
|
||||
token: one_token(),
|
||||
ROID: id
|
||||
};
|
||||
const resp = await api.getBarcodes(params);
|
||||
if (resp.status != 'OK') {
|
||||
throw new Error(resp.message);
|
||||
}
|
||||
|
||||
context.commit('update_list_barcode', resp.data);
|
||||
} catch (e) {
|
||||
const snac = { color: 'error', msg: e.message, state: true };
|
||||
context.commit("update_snackbar", snac);
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user