diff --git a/src/views/duty/edit.vue b/src/views/duty/edit.vue index 8f1f303..6e3a8c9 100644 --- a/src/views/duty/edit.vue +++ b/src/views/duty/edit.vue @@ -114,7 +114,7 @@ const popupTitle = computed(() => { }) const formData = reactive({ - + id:'', departId: '', departName: '', policeName: '', @@ -166,7 +166,7 @@ const formRules = { reportDate:[ { type:'array',required: true, message: '请选择时间', fields:{ - 0:{type:'string',required:true,message:'请选择开始日期'}, + 0:{type:'string',required:true,message:'请选择开始日期'}, 1:{type:'string',required:true,message:'请选择结束日期'} }} ], @@ -217,8 +217,6 @@ const setFormData = async (data: Record) => { formData[key] = data[key] } - - } } diff --git a/src/views/duty/index.vue b/src/views/duty/index.vue index 3622e16..44be160 100644 --- a/src/views/duty/index.vue +++ b/src/views/duty/index.vue @@ -3,8 +3,26 @@ - + + ({ @@ -134,6 +153,9 @@ const { optionsData } = useDictOptions<{ dictType: 'dept_type' } }, + dept: { + api: deptLists + }, }) const handleAdd = async () => { @@ -142,9 +164,10 @@ const handleAdd = async () => { editRef.value?.open('add') } -const handleEdit = async (data: any) => { +const handleEdit = async (data: any,id:number) => { showEdit.value = true await nextTick() + console.log(data); editRef.value?.open('edit') editRef.value?.getDetail(data) }