forked from integrated_whb/integrated_whb_vue
326 lines
11 KiB
Vue
326 lines
11 KiB
Vue
<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">
|
||
<el-input
|
||
v-model="searchForm.PLATE_NUMBER"
|
||
placeholder="请输入车牌号"
|
||
/>
|
||
</el-form-item>
|
||
</el-col>
|
||
<el-col :span="6">
|
||
<el-form-item label="车主业户" prop="CAR_OWNERS">
|
||
<el-input
|
||
v-model="searchForm.CAR_OWNERS"
|
||
placeholder="请输入车主业户"
|
||
/>
|
||
</el-form-item>
|
||
</el-col>
|
||
<el-col :span="6">
|
||
<el-form-item label="登记人" prop="REGISTRANT">
|
||
<el-input
|
||
v-model="searchForm.REGISTRANT"
|
||
placeholder="请输入登记人"
|
||
/>
|
||
</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"
|
||
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>
|
||
<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">
|
||
<el-button type="primary" native-type="submit">搜索</el-button>
|
||
<el-button native-type="reset" @click="fnResetPaginationTransfer">
|
||
重置
|
||
</el-button>
|
||
</el-form-item>
|
||
</el-col>
|
||
<!-- <el-col :span="4">
|
||
<el-form-item label-width="10px" class="end">
|
||
<el-button type="primary" @click="fnImportDialogChangeShow"
|
||
>导入</el-button
|
||
>
|
||
<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 }">
|
||
<el-tag v-if="row.DUE_DATE_TYPE === 1" type="success"
|
||
>未到期
|
||
</el-tag>
|
||
<el-tag v-else-if="row.DUE_DATE_TYPE === 0" type="error"
|
||
>已到期
|
||
</el-tag>
|
||
<el-tag v-else-if="row.DUE_DATE_TYPE === 2" type="info"
|
||
>即将到期
|
||
</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>
|
||
<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"
|
||
text
|
||
link
|
||
@click="
|
||
router.push({
|
||
path: '/mechanical_files/inspect_annually/view',
|
||
query: { INSPECTANNUALLY_ID: row.INSPECTANNUALLY_ID },
|
||
})
|
||
"
|
||
>查看</el-button
|
||
>
|
||
<el-button
|
||
type="primary"
|
||
text
|
||
link
|
||
@click="
|
||
router.push({
|
||
path: '/mechanical_files/inspect_annually/edit',
|
||
query: { INSPECTANNUALLY_ID: row.INSPECTANNUALLY_ID },
|
||
})
|
||
"
|
||
>编辑
|
||
</el-button>
|
||
<el-button
|
||
v-if="buttonJurisdiction.del"
|
||
type="danger"
|
||
text
|
||
link
|
||
@click="fnDelete(row.INSPECTANNUALLY_ID)"
|
||
>
|
||
删除
|
||
</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>
|
||
<layout-import-file
|
||
v-model:visible="data.importDialogVisible"
|
||
template-url="/template/truckExcelTemplate.xls"
|
||
@submit="fnSubmitImport"
|
||
/>
|
||
</div>
|
||
</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";
|
||
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: [],
|
||
},
|
||
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");
|
||
|
||
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();
|
||
};
|
||
|
||
// eslint-disable-next-line no-unused-vars
|
||
const fnExport = async () => {
|
||
const selectionData = tableRef.value.getSelectionRows();
|
||
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"] +
|
||
"/inspectAnnually/excel?" +
|
||
"&KEYWORDS=" +
|
||
(searchForm.value.KEYWORDS || "") +
|
||
"&DATA_IDS=" +
|
||
DATA_IDS;
|
||
};
|
||
</script>
|
||
|
||
<style scoped></style>
|