integrated_traffic_vue/src/views/mechanical_files/inspect_annually/index.vue

325 lines
11 KiB
Vue
Raw Normal View History

2024-03-07 09:33:21 +08:00
<template>
<div>
<el-card>
<el-form
:model="searchForm"
label-width="100px"
@submit.prevent="fnResetPaginationTransfer"
>
<el-row>
<el-col :span="6">
<el-form-item label="车牌号" prop="PLATE_NUMBER">
2024-04-09 10:27:59 +08:00
<el-input
v-model="searchForm.PLATE_NUMBER"
placeholder="请输入车牌号"
2024-04-03 17:57:47 +08:00
/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="车主业户" prop="CAR_OWNERS">
2024-04-09 10:27:59 +08:00
<el-input
v-model="searchForm.CAR_OWNERS"
placeholder="请输入车主业户"
2024-04-03 17:57:47 +08:00
/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="登记人" prop="REGISTRANT">
2024-04-09 10:27:59 +08:00
<el-input
v-model="searchForm.REGISTRANT"
placeholder="请输入登记人"
2024-04-03 17:57:47 +08:00
/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="到期日期" prop="DUE_DATE">
<el-date-picker
v-model="searchForm.DUE_DATE"
value-format="YYYY-MM-DD"
format="YYYY-MM-DD"
type="date"
2024-04-03 17:57:47 +08:00
placeholder="请选择到期日期"
/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="运营车型" prop="VEHICLE_MODEL">
<el-select v-model="searchForm.VEHICLE_MODEL">
<el-option
v-for="item in OPERATING_VEHICLE_TYPE_LIST"
:key="item.ID"
:label="item.NAME"
:value="item.ID"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="到期状态" prop="DUE_DATE_TYPE">
<el-select v-model="searchForm.DUE_DATE_TYPE">
<el-option
v-for="item in DUE_STATUS_LIST"
:key="item.ID"
:label="item.NAME"
:value="item.ID"
/>
</el-select>
</el-form-item>
</el-col>
2024-04-01 10:37:47 +08:00
<el-col :span="4">
<el-form-item label="提醒状态" prop="REMINDER_STATUS">
<el-select v-model="searchForm.REMINDER_STATUS">
<el-option
v-for="item in REMINDER_STATUS_LIST"
:key="item.ID"
:label="item.NAME"
:value="item.ID"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label-width="10px">
2024-04-03 17:57:47 +08:00
<el-button type="primary" native-type="submit">搜索</el-button>
<el-button native-type="reset" @click="fnResetPaginationTransfer">
重置
</el-button>
</el-form-item>
</el-col>
2024-04-01 10:37:47 +08:00
<el-col :span="4">
<el-form-item label-width="10px" class="end">
<el-button type="primary" @click="fnImportDialogChangeShow"
>导入</el-button
>
2024-04-01 10:37:47 +08:00
<el-button type="primary" @click="fnExport"></el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-card>
<layout-card>
<layout-table
ref="tableRef"
v-model:pagination="pagination"
:data="list"
row-key="INSPECTANNUALLY_ID"
@get-data="fnGetDataTransfer"
>
<el-table-column reserve-selection type="selection" width="55" />
<el-table-column label="序号" width="60">
<template #default="{ $index }">
{{ serialNumber(pagination, $index) }}
</template>
</el-table-column>
<el-table-column prop="NUM" label="编号" width="100" />
<el-table-column prop="VEHICLE_MODEL" label="运营车型" width="100">
<template #default="{ row }">
{{
translationStatus(row.VEHICLE_MODEL, OPERATING_VEHICLE_TYPE_LIST)
}}
</template>
</el-table-column>
<el-table-column prop="PLATE_NUMBER" label="车牌号" width="100" />
<el-table-column prop="CAR_OWNERS" label="车主业户" width="100" />
<el-table-column prop="TELEPHONE" label="联系电话" width="100" />
<el-table-column prop="PROCESSING_DATE" label="办理日期" width="100" />
<el-table-column prop="NAME" label="年检周期" width="100" />
<el-table-column prop="DUE_DATE" label="到期日期" width="100" />
<el-table-column prop="REGISTRANT" label="登记人" width="100" />
<!--<el-table-column prop="CONTACTS" label="经营企业" width="150"/>-->
<el-table-column prop="REMINDER_STATUS" label="提醒状态" width="100">
<template #default="{ row }">
<el-tag v-if="row.REMINDER_STATUS === '1'" type="success"
>开启</el-tag
>
<el-tag v-else-if="row.REMINDER_STATUS === '0'" type="info"
>关闭</el-tag
>
</template>
</el-table-column>
<el-table-column prop="DUE_DATE_TYPE" label="到期状态" width="100">
<template #default="{ row }">
2024-04-03 17:57:47 +08:00
<el-tag v-if="row.DUE_DATE_TYPE === 1" type="success"
2024-04-09 10:27:59 +08:00
>未到期
2024-04-03 17:57:47 +08:00
</el-tag>
<el-tag v-else-if="row.DUE_DATE_TYPE === 0" type="error"
2024-04-09 10:27:59 +08:00
>已到期
2024-04-03 17:57:47 +08:00
</el-tag>
<el-tag v-else-if="row.DUE_DATE_TYPE === 2" type="info"
2024-04-09 10:27:59 +08:00
>即将到期
2024-04-03 17:57:47 +08:00
</el-tag>
</template>
</el-table-column>
<el-table-column prop="ARCHIVES_TYPE" label="车辆状态" width="100">
<template #default="{ row }">
<el-tag v-if="row.ARCHIVES_TYPE === '2'" type="error"></el-tag>
2024-04-09 10:27:59 +08:00
<el-tag v-else-if="row.ARCHIVES_TYPE === '0'" type="success"
>正常</el-tag
>
<el-tag v-else-if="row.ARCHIVES_TYPE === '1'" type="warning"
>过户</el-tag
>
</template>
</el-table-column>
<el-table-column prop="CREATTIME" label="创建时间" width="100" />
<el-table-column prop="OPERATTIME" label="修改时间" width="100" />
<el-table-column label="操作" width="100">
<template #default="{ row }">
<el-button
type="primary"
2024-03-30 17:42:01 +08:00
text
link
@click="
router.push({
path: '/mechanical_files/inspect_annually/view',
query: { INSPECTANNUALLY_ID: row.INSPECTANNUALLY_ID },
})
"
>查看</el-button
2024-03-07 09:33:21 +08:00
>
<el-button
type="primary"
2024-03-30 17:42:01 +08:00
text
link
@click="
router.push({
path: '/mechanical_files/inspect_annually/edit',
query: { INSPECTANNUALLY_ID: row.INSPECTANNUALLY_ID },
})
"
>编辑
</el-button>
<el-button
2024-04-01 18:55:28 +08:00
v-if="buttonJurisdiction.del"
2024-03-26 18:02:32 +08:00
type="danger"
2024-03-30 17:42:01 +08:00
text
link
@click="fnDelete(row.INSPECTANNUALLY_ID)"
>
2024-04-01 18:55:28 +08:00
删除
</el-button>
</template>
</el-table-column>
<template #button>
<el-button
v-if="buttonJurisdiction.add"
type="primary"
@click="
router.push({ path: '/mechanical_files/inspect_annually/add' })
"
>
新增
</el-button>
</template>
</layout-table>
</layout-card>
2024-04-01 10:37:47 +08:00
<layout-import-file
v-model:visible="data.importDialogVisible"
template-url="/template/truckExcelTemplate.xls"
@submit="fnSubmitImport"
/>
</div>
2024-03-07 09:33:21 +08:00
</template>
<script setup>
import { useRouter } from "vue-router";
import { serialNumber, translationStatus } from "@/assets/js/utils";
import useButtonJurisdiction from "@/assets/js/useButtonJurisdiction.js";
import useListData from "@/assets/js/useListData.js";
import {
getInspectAnnuallyList,
setInspectAnnuallyDelete,
} from "@/request/mechanical_files.js";
import { reactive } from "vue";
import { debounce } from "throttle-debounce";
import { ElMessageBox, ElMessage } from "element-plus";
import {
OPERATING_VEHICLE_TYPE_LIST,
DUE_STATUS_LIST,
REMINDER_STATUS_LIST,
} from "@/assets/js/constant.js";
2024-04-01 10:37:47 +08:00
import { setFreightTrailerImport } from "@/request/enterprise_management.js";
import LayoutImportFile from "@/components/import_file/index.vue";
const router = useRouter();
const data = reactive({
exportExcelDialog: {
visible: false,
ids: [],
},
2024-04-01 10:37:47 +08:00
importDialogVisible: false,
});
const { list, pagination, searchForm, fnGetData, fnResetPagination, tableRef } =
useListData(getInspectAnnuallyList);
const fnGetDataTransfer = () => {
fnGetData({
PLATE_NUMBER: searchForm.value.PLATE_NUMBER,
CAR_OWNERS: searchForm.value.CAR_OWNERS,
REGISTRANT: searchForm.value.REGISTRANT,
DUE_DATE: searchForm.value.DUE_DATE,
VEHICLE_MODEL: searchForm.value.VEHICLE_MODEL,
DUE_DATE_TYPE: searchForm.value.DUE_DATE_TYPE,
REMINDER_STATUS: searchForm.value.REMINDER_STATUS,
});
};
const fnResetPaginationTransfer = () => {
fnResetPagination({
PLATE_NUMBER: searchForm.value.PLATE_NUMBER,
CAR_OWNERS: searchForm.value.CAR_OWNERS,
REGISTRANT: searchForm.value.REGISTRANT,
DUE_DATE: searchForm.value.DUE_DATE,
VEHICLE_MODEL: searchForm.value.VEHICLE_MODEL,
DUE_DATE_TYPE: searchForm.value.DUE_DATE_TYPE,
REMINDER_STATUS: searchForm.value.REMINDER_STATUS,
});
};
const fnDelete = debounce(
1000,
async (INSPECTANNUALLY_ID) => {
await ElMessageBox.confirm("确定要删除吗?", { type: "warning" });
await setInspectAnnuallyDelete({ INSPECTANNUALLY_ID });
ElMessage.success("删除成功");
fnResetPaginationTransfer();
},
{ atBegin: true }
);
const buttonJurisdiction = await useButtonJurisdiction("hidden");
2024-03-29 13:38:39 +08:00
2024-04-01 10:37:47 +08:00
const fnImportDialogChangeShow = () => {
data.importDialogVisible = !data.importDialogVisible;
};
const fnSubmitImport = async (formData) => {
const resData = await setFreightTrailerImport(formData);
if (resData.resultStr) {
ElMessage({
dangerouslyUseHTMLString: true,
message: resData.resultStr,
type: resData.resultType,
});
}
fnImportDialogChangeShow();
fnResetPaginationTransfer();
};
2024-03-29 13:38:39 +08:00
const fnExport = async () => {
const selectionData = tableRef.value.getSelectionRows();
2024-03-29 13:38:39 +08:00
if (selectionData.length === 0) {
ElMessage.warning("请选择需要导出至excel报表的记录信息");
return;
}
await ElMessageBox.confirm("确定要导出到excel吗", { type: "warning" });
const DATA_IDS = selectionData
.map((item) => item.INSPECTANNUALLY_ID)
.join(",");
window.location.href =
import.meta.env[import.meta.env.DEV ? "VITE_PROXY" : "VITE_BASE_URL"] +
2024-04-01 10:37:47 +08:00
"/inspectAnnually/excel?" +
2024-03-29 13:38:39 +08:00
"&KEYWORDS=" +
(searchForm.value.KEYWORDS || "") +
"&DATA_IDS=" +
DATA_IDS;
};
2024-03-07 09:33:21 +08:00
</script>
<style scoped></style>