Merge branch 'develop' of https://github.com/Frappet/bma-ehr-frontend into develop
This commit is contained in:
commit
d1f0d753ba
4 changed files with 15 additions and 18 deletions
|
|
@ -21,7 +21,7 @@ interface typeOp {
|
||||||
}
|
}
|
||||||
|
|
||||||
interface tableType {
|
interface tableType {
|
||||||
id: string;
|
personId: string;
|
||||||
idcard: string;
|
idcard: string;
|
||||||
prefix: string;
|
prefix: string;
|
||||||
firstName: string;
|
firstName: string;
|
||||||
|
|
@ -46,10 +46,6 @@ const typeOps = ref<typeOp[]>([
|
||||||
|
|
||||||
/** รับค่ามาจาก หน้าหลัก */
|
/** รับค่ามาจาก หน้าหลัก */
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
mainData: {
|
|
||||||
type: Array,
|
|
||||||
default: [],
|
|
||||||
},
|
|
||||||
modal: {
|
modal: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false,
|
default: false,
|
||||||
|
|
@ -67,6 +63,10 @@ const props = defineProps({
|
||||||
type: String,
|
type: String,
|
||||||
default: "",
|
default: "",
|
||||||
},
|
},
|
||||||
|
selectedData: {
|
||||||
|
type: Array,
|
||||||
|
default: [],
|
||||||
|
},
|
||||||
close: {
|
close: {
|
||||||
type: Function,
|
type: Function,
|
||||||
default: () => console.log("not function"),
|
default: () => console.log("not function"),
|
||||||
|
|
@ -118,9 +118,8 @@ async function searchInput() {
|
||||||
.post(config.API.searchPersonal(), body)
|
.post(config.API.searchPersonal(), body)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
const data = res.data.result;
|
const data = res.data.result;
|
||||||
console.log(data)
|
|
||||||
const list = data.map((e: ResponsePreson) => ({
|
const list = data.map((e: ResponsePreson) => ({
|
||||||
id: e.personId,
|
personId: e.personId,
|
||||||
idcard: e.idcard,
|
idcard: e.idcard,
|
||||||
prefix: e.prefix,
|
prefix: e.prefix,
|
||||||
firstName: e.firstName,
|
firstName: e.firstName,
|
||||||
|
|
@ -151,10 +150,9 @@ async function searchInput() {
|
||||||
function updateSelect() {
|
function updateSelect() {
|
||||||
search.value = "";
|
search.value = "";
|
||||||
}
|
}
|
||||||
watch(()=>props.mainData,()=>{
|
watch(()=>props.selectedData,()=>{
|
||||||
if(props.mainData){
|
if(props.selectedData){
|
||||||
console.log('mainData',props.mainData)
|
selected.value = props.selectedData
|
||||||
selected.value = props.mainData
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -207,6 +207,7 @@ async function onSubmit(data: any) {
|
||||||
messageError($q, e);
|
messageError($q, e);
|
||||||
})
|
})
|
||||||
.finally(async () => {
|
.finally(async () => {
|
||||||
|
getData();
|
||||||
hideLoader();
|
hideLoader();
|
||||||
});
|
});
|
||||||
// router.push(`/discipline/complaints`);
|
// router.push(`/discipline/complaints`);
|
||||||
|
|
|
||||||
|
|
@ -184,10 +184,9 @@ function onSubmit() {
|
||||||
$q,
|
$q,
|
||||||
async () => {
|
async () => {
|
||||||
if (mainStore.rowsAdd) {
|
if (mainStore.rowsAdd) {
|
||||||
formData.persons = mainStore.rowsAdd;
|
formData.persons = await mainStore.rowsAdd;
|
||||||
props.onSubmit(formData);
|
}
|
||||||
} else props.onSubmit(formData);
|
await props.onSubmit(formData);
|
||||||
// props.onSubmit(formData);
|
|
||||||
isSave.value = false;
|
isSave.value = false;
|
||||||
},
|
},
|
||||||
"ยืนยันการบันทึกข้อมูล",
|
"ยืนยันการบันทึกข้อมูล",
|
||||||
|
|
@ -321,10 +320,10 @@ function getOc() {
|
||||||
*/
|
*/
|
||||||
function deletePerson(id: string) {
|
function deletePerson(id: string) {
|
||||||
// dialogRemove($q, () => {
|
// dialogRemove($q, () => {
|
||||||
changeFormData();
|
|
||||||
const dataRow = mainStore.rowsAdd;
|
const dataRow = mainStore.rowsAdd;
|
||||||
const updatedRows = dataRow.filter((item: any) => item.personId !== id);
|
const updatedRows = dataRow.filter((item: any) => item.personId !== id);
|
||||||
mainStore.rowsAdd = updatedRows;
|
mainStore.rowsAdd = updatedRows;
|
||||||
|
changeFormData();
|
||||||
// });
|
// });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -984,11 +983,11 @@ onMounted(() => {
|
||||||
<!-- Popup ผู้ถูกร้องเรียน -->
|
<!-- Popup ผู้ถูกร้องเรียน -->
|
||||||
<DialogAddPersonal
|
<DialogAddPersonal
|
||||||
title="ผู้ถูกร้องเรียน"
|
title="ผู้ถูกร้องเรียน"
|
||||||
:mainData="mainStore.rowsAdd"
|
|
||||||
:modal="modal"
|
:modal="modal"
|
||||||
btn-title="เพิ่มรายชื่อผู้ถูกร้องเรียน"
|
btn-title="เพิ่มรายชื่อผู้ถูกร้องเรียน"
|
||||||
:close="toggleModal"
|
:close="toggleModal"
|
||||||
:save="addPerson"
|
:save="addPerson"
|
||||||
|
:selected-data="mainStore.rowsAdd"
|
||||||
@returnData="handleSave"
|
@returnData="handleSave"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,6 @@ import { useComplainstDataStore } from "@/modules/11_discipline/store/Complaints
|
||||||
import TableComplaint from "@/modules/11_discipline/components/1_Complaint/TableComplaint.vue";
|
import TableComplaint from "@/modules/11_discipline/components/1_Complaint/TableComplaint.vue";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
import { max } from "moment";
|
|
||||||
|
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue