21819 2 years ago
parent
commit
f1e6f595dc
  1. 4
      src/views/duty/edit.vue
  2. 27
      src/views/duty/index.vue

4
src/views/duty/edit.vue

@ -114,7 +114,7 @@ const popupTitle = computed(() => {
})
const formData = reactive({
id:'',
departId: '',
departName: '',
policeName: '',
@ -217,8 +217,6 @@ const setFormData = async (data: Record<string, any>) => {
formData[key] = data[key]
}
}
}

27
src/views/duty/index.vue

@ -3,8 +3,26 @@
<el-card class="!border-none" shadow="never">
<el-form ref="formRef" class="mb-[-16px]" :model="queryParams" :inline="true">
<el-form-item label="机构名称" prop="holidayName">
<el-input class="w-[280px]" v-model="queryParams.departName" />
<el-tree-select
class="flex-1"
v-model="queryParams.departName"
:data="optionsData.dept"
clearable
filterable
node-key="id"
:props="{
value: 'id',
label: 'name',
disabled(data: any) {
return !!data.isStop
}
}"
check-strictly
placeholder="请选择机构名称"
style="width: 180px;"
/>
</el-form-item>
<el-form-item label="机构类型" prop="holidayName">
<el-select
class="flex-1"
@ -125,6 +143,7 @@ const { pager, getLists, resetPage, resetParams } = usePaging({
const { optionsData } = useDictOptions<{
deptTypes: any[],
dept: any[]
}>({
@ -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)
}

Loading…
Cancel
Save