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

6
src/views/duty/edit.vue

@ -114,7 +114,7 @@ const popupTitle = computed(() => {
}) })
const formData = reactive({ const formData = reactive({
id:'',
departId: '', departId: '',
departName: '', departName: '',
policeName: '', policeName: '',
@ -166,7 +166,7 @@ const formRules = {
reportDate:[ reportDate:[
{ type:'array',required: true, message: '请选择时间', { type:'array',required: true, message: '请选择时间',
fields:{ fields:{
0:{type:'string',required:true,message:'请选择开始日期'}, 0:{type:'string',required:true,message:'请选择开始日期'},
1:{type:'string',required:true,message:'请选择结束日期'} 1:{type:'string',required:true,message:'请选择结束日期'}
}} }}
], ],
@ -217,8 +217,6 @@ const setFormData = async (data: Record<string, any>) => {
formData[key] = data[key] formData[key] = data[key]
} }
} }
} }

27
src/views/duty/index.vue

@ -3,8 +3,26 @@
<el-card class="!border-none" shadow="never"> <el-card class="!border-none" shadow="never">
<el-form ref="formRef" class="mb-[-16px]" :model="queryParams" :inline="true"> <el-form ref="formRef" class="mb-[-16px]" :model="queryParams" :inline="true">
<el-form-item label="机构名称" prop="holidayName"> <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>
<el-form-item label="机构类型" prop="holidayName"> <el-form-item label="机构类型" prop="holidayName">
<el-select <el-select
class="flex-1" class="flex-1"
@ -125,6 +143,7 @@ const { pager, getLists, resetPage, resetParams } = usePaging({
const { optionsData } = useDictOptions<{ const { optionsData } = useDictOptions<{
deptTypes: any[], deptTypes: any[],
dept: any[]
}>({ }>({
@ -134,6 +153,9 @@ const { optionsData } = useDictOptions<{
dictType: 'dept_type' dictType: 'dept_type'
} }
}, },
dept: {
api: deptLists
},
}) })
const handleAdd = async () => { const handleAdd = async () => {
@ -142,9 +164,10 @@ const handleAdd = async () => {
editRef.value?.open('add') editRef.value?.open('add')
} }
const handleEdit = async (data: any) => { const handleEdit = async (data: any,id:number) => {
showEdit.value = true showEdit.value = true
await nextTick() await nextTick()
console.log(data);
editRef.value?.open('edit') editRef.value?.open('edit')
editRef.value?.getDetail(data) editRef.value?.getDetail(data)
} }

Loading…
Cancel
Save