|
@@ -0,0 +1,233 @@
|
|
|
+<template>
|
|
|
+ <div class="card-search">
|
|
|
+ <a-form ref="formRef" name="advanced_search" class="ant-advanced-search-form" :model="searchParams">
|
|
|
+ <a-row :gutter="24">
|
|
|
+ <a-col :span="6">
|
|
|
+ <a-form-item label="姓名" :label-col="{span:6}" name="name">
|
|
|
+ <a-input v-model:value="searchParams.name" placeholder=""/>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="6">
|
|
|
+ <a-form-item label="工作日期" :label-col="{span:6}" name="name">
|
|
|
+ <a-range-picker format="YYYY-MM-DD" :placeholder="['开始日期', '结束日期']" @change="onRangeChange"/>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="6">
|
|
|
+ <a-form-item label="日志类型" :label-col="{span:6}" name="name">
|
|
|
+ <a-input v-model:value="searchParams.name" placeholder="" />
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="5" style="text-align: right">
|
|
|
+ <a-button type="primary" html-type="submit" @click="onSearch">查询</a-button>
|
|
|
+ </a-col>
|
|
|
+ </a-row>
|
|
|
+ <a-row>
|
|
|
+ <a-col :span="6">
|
|
|
+ <a-form-item label="所属县区" :label-col="{span:6}" name="regionCode">
|
|
|
+ <a-select
|
|
|
+ ref="select"
|
|
|
+ v-model:value="searchParams.regionCode"
|
|
|
+ :options="regionList"
|
|
|
+ :field-names="{ label: 'name', value: 'code' }"
|
|
|
+ :allow-clear="true"
|
|
|
+ @change="loadData"
|
|
|
+ >
|
|
|
+ </a-select>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="6">
|
|
|
+ <a-form-item label="所属街道" :label-col="{span:6}" name="streetCode">
|
|
|
+ <a-select
|
|
|
+ ref="select"
|
|
|
+ v-model:value="searchParams.streetCode"
|
|
|
+ :options="streetList"
|
|
|
+ :field-names="{ label: 'name', value: 'code' }"
|
|
|
+ :allow-clear="true"
|
|
|
+ @change="loadData"
|
|
|
+ >
|
|
|
+ </a-select>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="6">
|
|
|
+ </a-col>
|
|
|
+ </a-row>
|
|
|
+ <a-row class="edit-operation">
|
|
|
+ <a-col :span="24" style="text-align: right">
|
|
|
+ <a-button type="primary" html-type="submit" @click='onOperates(null,"新增",false)'>新增</a-button>
|
|
|
+ <a-button type="primary" html-type="submit" @click='exportPost()'>导出</a-button>
|
|
|
+ </a-col>
|
|
|
+ </a-row>
|
|
|
+ </a-form>
|
|
|
+ <div class="search-result-list">
|
|
|
+ <a-table :columns="columns" :data-source="dataList" :scroll="{ x:'100%', y: 500 }" :pagination="pagination"
|
|
|
+ :loading="formState.loading"
|
|
|
+ @change="handleTableChange"
|
|
|
+ :row-selection="{ selectedRowKeys: formState.selectedRowKeys, onChange: onSelectChange}"
|
|
|
+ :row-key="record=>record.institutionID"
|
|
|
+ bordered>
|
|
|
+ <template #bodyCell="{ column, text, record }">
|
|
|
+ <template v-if="column.key === 'operation'">
|
|
|
+ <div class="table-operation">
|
|
|
+ <a-button type="link" size="small" @click='onOperates(record.institutionID,"修改",false)'>编辑</a-button>
|
|
|
+ <a-button type="link" size="small" @click="onDel(record)">删除</a-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </template>
|
|
|
+ </a-table>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script lang="ts">
|
|
|
+import {get} from '@/api/common';
|
|
|
+import {reactive, ref, computed, defineComponent} from 'vue';
|
|
|
+import {DownOutlined, UpOutlined} from '@ant-design/icons-vue';
|
|
|
+import type {FormInstance,SelectProps} from 'ant-design-vue';
|
|
|
+import type {TableColumnsType, TableProps} from 'ant-design-vue';
|
|
|
+import {getList} from '@/api/taskAndLog/dowork';
|
|
|
+import BExportExcel from "@/components/basic/excel/exportExcel/exportExcel.vue";
|
|
|
+import {getPaginationTotalTitle} from "@/utils/common";
|
|
|
+import {message} from "ant-design-vue";
|
|
|
+import dayjs from 'dayjs';
|
|
|
+export default defineComponent({
|
|
|
+ name: 'doTaskList',
|
|
|
+ components: { DownOutlined, UpOutlined, BExportExcel},
|
|
|
+ setup() {
|
|
|
+ const formRef = ref<FormInstance>();
|
|
|
+ const searchParams = reactive({
|
|
|
+ pageIndex: 1,
|
|
|
+ pageSize: 20,
|
|
|
+ primaryKey: '',
|
|
|
+ userName:'',
|
|
|
+ workStartDate:null,
|
|
|
+ workEndDate:null,
|
|
|
+ doTypeID:1,
|
|
|
+ regionCode:'',
|
|
|
+ streetCode:''
|
|
|
+ });
|
|
|
+ const formState = reactive({
|
|
|
+ total: 0,
|
|
|
+ selectedRowKeys: [],
|
|
|
+ loading: false
|
|
|
+ });
|
|
|
+ const columns: TableColumnsType = [
|
|
|
+ {
|
|
|
+ title: '序号',
|
|
|
+ align: "center",
|
|
|
+ key: 'LogId',
|
|
|
+ customRender: item => `${searchParams.pageSize * (searchParams.pageIndex - 1) + item.index + 1}`
|
|
|
+ },
|
|
|
+ {title: '姓名', dataIndex: 'pageName', key: 'pageName', align: "center"},
|
|
|
+ {title: '工作日期', dataIndex: 'logTime', key: 'logTime', width: 120, align: "center"},
|
|
|
+ {
|
|
|
+ title: '日志类型', dataIndex: 'actionName', key: 'actionName', align: "center", customRender: (item) => {
|
|
|
+ return item.record.finishTime==null?"": (dayjs(item.record.finishTime).format('YYYY-MM-DD'))
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {title: '工作情况', dataIndex: 'workName', key: 'workName', align: "center"},
|
|
|
+ {title: '所属县区', dataIndex: 'regionName', key: 'regionName', align: "center"},
|
|
|
+ {title: '所属街道', dataIndex: 'streetName', key: 'streetName', align: "center"},
|
|
|
+ {title: '操作', key: 'operation', fixed: 'right', width: 170, align: "center"},
|
|
|
+ ];
|
|
|
+ const pagination = computed(() => ({
|
|
|
+ total: formState.total,
|
|
|
+ current: searchParams.pageIndex,
|
|
|
+ pageSize: searchParams.pageSize,
|
|
|
+ showSizeChanger: true,
|
|
|
+ showTotal: total => getPaginationTotalTitle(total)
|
|
|
+ }));
|
|
|
+
|
|
|
+ const regionList = ref<SelectProps['options']>();
|
|
|
+ const streetList = ref<SelectProps['options']>();
|
|
|
+ const taskTypeList = ref<SelectProps['options']>();
|
|
|
+ const dataList = ref([]);
|
|
|
+
|
|
|
+ get('system/area/getCityList',{}).then(data=>{
|
|
|
+ console.log(data);
|
|
|
+ regionList.value=data;
|
|
|
+ console.log(regionList.value);
|
|
|
+ });
|
|
|
+
|
|
|
+ const loadData = async function () {
|
|
|
+ formState.loading = true;
|
|
|
+ const result: any = await getList(searchParams);
|
|
|
+ dataList.value = result.list;
|
|
|
+ console.log(dataList.value);
|
|
|
+ formState.total = result.total;
|
|
|
+ formState.loading = false;
|
|
|
+ }
|
|
|
+
|
|
|
+ const handleTableChange: TableProps['onChange'] = (pag: { pageSize: number; current: number },) => {
|
|
|
+ searchParams.pageIndex = pag.current;
|
|
|
+ searchParams.pageSize = pag.pageSize;
|
|
|
+ loadData();
|
|
|
+ };
|
|
|
+
|
|
|
+ const onSelectChange = (selectedRowKeys: any) => {
|
|
|
+ formState.selectedRowKeys = selectedRowKeys;
|
|
|
+ };
|
|
|
+
|
|
|
+ const onRangeChange=(dateString)=>{
|
|
|
+ searchParams.workStartDate = dateString ? dateString[0].format("YYYY-MM-DD") : '';
|
|
|
+ searchParams.workEndDate = dateString ? dateString[1].format("YYYY-MM-DD") : '';
|
|
|
+ loadData();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ const onSearch = () => {
|
|
|
+ loadData();
|
|
|
+ }
|
|
|
+
|
|
|
+ const onDel = (item: any) => {
|
|
|
+ if (item) {
|
|
|
+ formState.selectedRowKeys.push(item.InstitutionID as never)
|
|
|
+ }
|
|
|
+
|
|
|
+ if (formState.selectedRowKeys.length <= 0) {
|
|
|
+ message.warning('请选择需要删除的数据!');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ };
|
|
|
+
|
|
|
+ const importPost = () => {
|
|
|
+ console.log('导入');
|
|
|
+ }
|
|
|
+ const exportPost = () => {
|
|
|
+ console.log('导出');
|
|
|
+ }
|
|
|
+ const onOperates = () => {
|
|
|
+ console.log('新增');
|
|
|
+ };
|
|
|
+
|
|
|
+ return {
|
|
|
+ regionList,
|
|
|
+ streetList,
|
|
|
+ taskTypeList,
|
|
|
+ formRef,
|
|
|
+ searchParams,
|
|
|
+ formState,
|
|
|
+ columns,
|
|
|
+ pagination,
|
|
|
+ dataList,
|
|
|
+ handleTableChange,
|
|
|
+ onSelectChange,
|
|
|
+ onSearch,
|
|
|
+ onOperates,
|
|
|
+ importPost,
|
|
|
+ exportPost,
|
|
|
+ onDel,
|
|
|
+ onRangeChange,
|
|
|
+ loadData
|
|
|
+ };
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.loadData();
|
|
|
+ },
|
|
|
+ activated() {
|
|
|
+ if (history.state.params?.reload)
|
|
|
+ this.loadData();
|
|
|
+ }
|
|
|
+});
|
|
|
+</script>
|
|
|
+<style lang="less" scoped></style>
|