This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-10-07 11:45:27 +07:00
parent 990681e240
commit 22ebbc6366
5 changed files with 9 additions and 6 deletions

View file

@ -131,7 +131,8 @@ const columns = ref<QTableProps["columns"]>([
*/
function createCommand(isRedirect: boolean) {
dialogConfirm($q, async () => {
const data = props?.persons?.map((e: any) => ({
showLoader();
const data = await props?.persons?.map((e: any) => ({
refId: e.id,
prefix: e.prefix,
firstName: e.firstName,
@ -144,16 +145,15 @@ function createCommand(isRedirect: boolean) {
commandTypeId: commandType.value,
persons: data,
};
showLoader();
await http
.post(config.API.command + `/person`, body)
.then(async (res) => {
const id = await res.data.result;
modal.value = false;
if (isRedirect) {
router.push(`/command/edit/${id}`);
} else {
modal.value = false;
// modal.value = false;
clearValue();
}
})

View file

@ -242,9 +242,9 @@ async function getPersonList() {
}
onMounted(async () => {
await getPersonList();
if (props.commandSysId) {
await getCommandSalaryList(props.commandSysId);
await getPersonList();
}
});

View file

@ -19,6 +19,8 @@ export const useCommandDetail = defineStore("commandDetailStore", () => {
return 3;
case "REPORTED":
return 5;
case "NEW":
return 1;
default:
return 0;
}