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