Refactor form filters in Type3.vue
This commit is contained in:
		@@ -10,13 +10,13 @@ import {
 | 
			
		||||
  itemsUp3,
 | 
			
		||||
  itemsUlp
 | 
			
		||||
} from './reference'
 | 
			
		||||
import { onMounted, ref, watch } from 'vue'
 | 
			
		||||
import { onMounted, ref } from 'vue'
 | 
			
		||||
const uidPlaceholder = 'Semua Unit Induk Distribusi/Wilayah'
 | 
			
		||||
const up3Placeholder = 'Semua Unit Pelaksanaan Pelayanan Pelanggan'
 | 
			
		||||
const ulpPlaceholder = 'Semua Unit Layanan Pelanggan'
 | 
			
		||||
const up3 = ref({ id: 0, name: up3Placeholder })
 | 
			
		||||
const uppp = ref({ id: 0, name: up3Placeholder })
 | 
			
		||||
const uid = ref({ id: 0, name: uidPlaceholder })
 | 
			
		||||
const ulp = ref({ id: 0, name: ulpPlaceholder })
 | 
			
		||||
const ulp = ref({ id: '', name: ulpPlaceholder })
 | 
			
		||||
const emit = defineEmits(['update:filters'])
 | 
			
		||||
 | 
			
		||||
const data = ref({
 | 
			
		||||
@@ -32,21 +32,21 @@ watch(data.value, (value) => {
 | 
			
		||||
const setUid = (value: any) => {
 | 
			
		||||
  uid.value = value
 | 
			
		||||
  selectedUid(value)
 | 
			
		||||
  up3.value = { id: 0, name: up3Placeholder }
 | 
			
		||||
  uppp.value = { id: 0, name: up3Placeholder }
 | 
			
		||||
  data.value.uid = value
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
const setUp3 = (value: any) => {
 | 
			
		||||
  up3.value = value
 | 
			
		||||
  uppp.value = value
 | 
			
		||||
  selectedUp3Ulp(value)
 | 
			
		||||
  ulp.value = { id: 0, name: ulpPlaceholder }
 | 
			
		||||
  ulp.value = { id: '', name: ulpPlaceholder }
 | 
			
		||||
  data.value.up3 = value
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
const setUlp = (value: any) => {
 | 
			
		||||
  ulp.value = value
 | 
			
		||||
  selectedUlp(value)
 | 
			
		||||
  data.value.ulp = value
 | 
			
		||||
  data.value.posko = value
 | 
			
		||||
}
 | 
			
		||||
onMounted(() => {
 | 
			
		||||
  fetchUid()
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user