This commit is contained in:
weipengfei 2023-08-17 10:00:38 +08:00
parent 04e538496b
commit fcb647928c
5 changed files with 117 additions and 80 deletions

View File

@ -61,7 +61,7 @@
</el-form>
</popup>
<el-dialog v-model="isShow" title="选择任务模板" width="60%">
<DialogIndex @customEvent="customEvent" />
<DialogIndex @customEvent="customEvent" :company_id="props.company_id" />
</el-dialog>
</div>
</template>
@ -131,6 +131,10 @@ const props = defineProps({
null;
},
},
company_id: {
type: String,
default: "",
},
});
const isDisabled = ref(false);

View File

@ -50,6 +50,7 @@
ref="editTowRef"
:task="task"
:type="popupType"
:company_id="company_id"
@success="loadTask"
@close="showEditTow = false"
/>
@ -108,6 +109,8 @@ const queryParams = reactive({
if (route.query.id) {
queryParams.scheduling_id = route.query.id.toString();
}
const company_id = ref("");
if (route.query.company_id) company_id.value = route.query.company_id;
const taskList = ref<any>([]);
//

View File

@ -120,6 +120,7 @@
path: getRoutePath('task.task_calendar'),
query: {
id: row.id,
company_id: row.company_id,
},
}"
>任务日程</router-link

View File

@ -95,6 +95,7 @@
v-model="formData.type"
clearable
placeholder="请输入任务类型"
@change="changeTaskType"
>
<el-option
v-for="item in datalist"
@ -221,6 +222,11 @@ const getDetail = async (row: Record<string, any>) => {
setFormData(data);
};
//
const changeTaskType = (e: any) => {
console.log(e);
};
//
const handleSubmit = async () => {
await formRef.value?.validate();

View File

@ -1,111 +1,134 @@
<template>
<div>
<el-card class="!border-none mb-4" shadow="never">
<el-form class="mb-[-16px] formtabel" :model="queryParams" inline>
<el-form-item label-width="100px" label="主题" prop="title">
<el-input
class="w-[280px]"
v-model="queryParams.title"
clearable
placeholder="请输入主题"
/>
</el-form-item>
<el-form-item label-width="100px" label="">
<el-button class="el-btn" type="primary" @click="resetPage">查询</el-button>
<el-button @click="resetParams">重置</el-button>
</el-form-item>
</el-form>
</el-card>
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
<div class="mt-4">
<el-table :data="pager.lists" @cell-click="handleSelectionChange">
<el-table-column label="主题" prop="title" show-overflow-tooltip />
<el-table-column label="创建人" prop="admin_name" show-overflow-tooltip />
<el-table-column label="金额" prop="money" show-overflow-tooltip />
<el-table-column label="任务类型" prop="type_name" show-overflow-tooltip />
<el-table-column label="状态" show-overflow-tooltip>
<template #default="{ row }">
<span>{{ row.status == 1 ? '显示' : '隐藏' }}</span>
</template>
</el-table-column>
<el-table-column label="任务描述" prop="content" show-overflow-tooltip />
</el-table>
</div>
<div class="flex mt-4 justify-end">
<pagination v-model="pager" @change="getLists" />
</div>
</el-card>
<edit-popup
v-if="showEdit"
ref="editRef"
:dict-data="dictData"
@success="getLists"
@close="showEdit = false"
/>
</div>
<div>
<el-card class="!border-none mb-4" shadow="never">
<el-form class="mb-[-16px] formtabel" :model="queryParams" inline>
<el-form-item label-width="100px" label="主题" prop="title">
<el-input
class="w-[280px]"
v-model="queryParams.title"
clearable
placeholder="请输入主题"
/>
</el-form-item>
<el-form-item label-width="100px" label="">
<el-button class="el-btn" type="primary" @click="resetPage"
>查询</el-button
>
<el-button @click="resetParams">重置</el-button>
</el-form-item>
</el-form>
</el-card>
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
<div class="mt-4">
<el-table :data="pager.lists" @cell-click="handleSelectionChange">
<el-table-column label="主题" prop="title" show-overflow-tooltip />
<el-table-column
label="创建人"
prop="admin_name"
show-overflow-tooltip
/>
<el-table-column label="金额" prop="money" show-overflow-tooltip />
<el-table-column
label="任务类型"
prop="type_name"
show-overflow-tooltip
/>
<el-table-column label="状态" show-overflow-tooltip>
<template #default="{ row }">
<span>{{ row.status == 1 ? "显示" : "隐藏" }}</span>
</template>
</el-table-column>
<el-table-column
label="任务描述"
prop="content"
show-overflow-tooltip
/>
</el-table>
</div>
<div class="flex mt-4 justify-end">
<pagination v-model="pager" @change="getLists" />
</div>
</el-card>
<edit-popup
v-if="showEdit"
ref="editRef"
:dict-data="dictData"
@success="getLists"
@close="showEdit = false"
/>
</div>
</template>
<script lang="ts" setup name="taskTemplateLists">
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { apiTaskTemplateLists, apiTaskTemplateDelete } from '@/api/task_template'
import { timeFormat } from '@/utils/util'
import feedback from '@/utils/feedback'
import EditPopup from './edit.vue'
import { dictDataLists } from '@/api/setting/dict'
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
const datalist = ref([])
import { usePaging } from "@/hooks/usePaging";
import { useDictData } from "@/hooks/useDictOptions";
import {
apiTaskTemplateLists,
apiTaskTemplateDelete,
} from "@/api/task_template";
import { timeFormat } from "@/utils/util";
import feedback from "@/utils/feedback";
import EditPopup from "./edit.vue";
import { dictDataLists } from "@/api/setting/dict";
const editRef = shallowRef<InstanceType<typeof EditPopup>>();
const datalist = ref([]);
//
const showEdit = ref(false)
const showEdit = ref(false);
//
const queryParams = reactive({
title: '',
admin_id: '',
money: '',
type: '',
status: '',
content: ''
})
title: "",
admin_id: "",
money: "",
type: "",
status: "",
content: "",
company_id: "",
});
const props = defineProps(["company_id"]);
if (props.company_id) queryParams.company_id = props.company_id;
const statusdata = reactive([
{ id: 1, name: '显示' },
{ id: 2, name: '隐藏' }
])
{ id: 1, name: "显示" },
{ id: 2, name: "隐藏" },
]);
//
const selectData = ref<any[]>([])
const selectData = ref<any[]>([]);
const emits = defineEmits(['customEvent'])
const emits = defineEmits(["customEvent"]);
//
const handleSelectionChange = (value: any) => {
emits('customEvent', value)
emits("customEvent", value);
// selectData.value = val.map(({ id }) => id)
}
// selectData.value = val.map(({ id }) => id)
};
//
const { dictData } = useDictData('')
const { dictData } = useDictData("");
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiTaskTemplateLists,
params: queryParams
})
fetchFun: apiTaskTemplateLists,
params: queryParams,
});
//
// dictDataLists({ type_id: 10 }).then((res) => {
// datalist.value = res.lists
// })
getLists()
getLists();
</script>
<style lang="scss" scoped>
.formtabel {
.el-form-item {
width: 20%;
.el-btn {
margin-left: 60px;
}
.el-form-item {
width: 20%;
.el-btn {
margin-left: 60px;
}
}
}
</style>