中航光电热表web
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

257 lines
6.4 KiB

<template>
<basic-container>
5 months ago
<avue-crud
:option="option"
:table-loading="loading"
:data="data"
v-model="form"
v-model:page="page"
v-model:search="query"
5 months ago
ref="crud"
@row-del="rowDel"
@search-change="searchChange"
@search-reset="searchReset"
@selection-change="selectionChange"
@current-change="currentChange"
@size-change="sizeChange"
@refresh-change="refreshChange"
@on-load="onLoad"
>
<template #menu-left> </template>
<template #menu-right> </template>
</avue-crud>
</basic-container>
</template>
<script>
import { getList, add, remove, update } from '@/api/safetyManagement/safetyInspectionTask';
export default {
data() {
return {
page: {
pageSize: 10,
currentPage: 1,
total: 0,
},
loading:false,
data: [],
query: {
taskStatus: "2" // 初始查询条件
},
option: {
5 months ago
height: "auto",
calcHeight: 32,
tip: false,
simplePage: true,
searchShow: true,
searchMenuSpan: 6,
searchIcon: true,
searchIndex: 3,
tree: false,
border: true,
index: true,
selection: true,
viewBtn: false,
delBtn: false,
editBtn: true,
5 months ago
editBtnText: "修改",
addBtnIcon: " ",
viewBtnIcon: " ",
delBtnIcon: " ",
editBtnIcon: " ",
labelWidth: 120,
menuWidth: 150,
dialogWidth: 600,
dialogClickModal: false,
searchEnter: true,
filterBtn: true,
searchShowBtn: false,
columnSort: true,
excelBtn: true,
columnSort: true,
index: false,
showOverflowTooltip: true,
5 months ago
menu: false,
header: false,
searchLabelPosition: "left",
searchGutter: 24,
searchSpan: 6,
menuAlign: "left",
gridBtn: false,
searchMenuPosition: "right",
align: "center",
column: [
{
5 months ago
label: "巡检点编号",
prop: "insNum",
sortable: true,
filter: true,
search: true,
3 months ago
searchLabelWidth: 90,
},
{
5 months ago
label: "巡检点位置",
prop: "insSite",
sortable: true,
filter: true,
5 months ago
search: true,
3 months ago
searchLabelWidth: 90,
},
{
5 months ago
label: "等待周期",
prop: "waitCycle",
sortable: true,
filter: true,
search: false,
display: false,
},
{
5 months ago
label: "巡检点备注",
prop: "insMemo",
sortable: true,
filter: true,
search: false,
display: false,
5 months ago
searchLabelWidth: 110,
},
{
5 months ago
label: "发起时间",
prop: "queryLaunchTime",
search: true,
display: false,
hide:true,
type: 'datetime',
format: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'YYYY-MM-DD HH:mm:ss',
searchRange: true,
},
{
label: "发起时间",
prop: "launchTime",
sortable: true,
filter: true,
type: 'datetime',
format: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'YYYY-MM-DD HH:mm:ss',
searchRange: true,
},
{
5 months ago
label: "巡检人",
prop: "insMan",
sortable: true,
filter: true,
search: true,
},
{
5 months ago
label: "检验时间",
prop: "queryTestTime",
sortable: true,
filter: true,
search: true,
hide:true,
type: "datetime",
format: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'YYYY-MM-DD HH:mm:ss',
searchRange: true,
},
{
label: "检验时间",
prop: "testTime",
sortable: true,
filter: true,
type: "datetime",
format: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'YYYY-MM-DD HH:mm:ss',
// searchRange: true,
},
{
label: "任务状态",
prop: "taskStatus",
sortable: true,
filter: true,
search: true,
type: "select",
// value: "2",
searchLabelWidth: 80,
dicData: [
{
label: "已检",
value: "1",
},
{
label: "待检",
value: "2",
},
{
label: "未准时完成",
value: "3",
}
],
},
{
5 months ago
label: "备注",
prop: "memo",
sortable: true,
filter: true,
search: false,
},
5 months ago
],
},
5 months ago
};
},
methods: {
// 加载页面数据
onLoad(page, params = {}) {
5 months ago
this.loading = true;
const requestParams = Object.assign({}, params, this.query);
// 后端要字符串类型
if (requestParams.queryLaunchTime && Array.isArray(requestParams.queryLaunchTime)) {
requestParams.queryLaunchTime = requestParams.queryLaunchTime.join(',');
}
if (requestParams.queryTestTime && Array.isArray(requestParams.queryTestTime)) {
requestParams.queryTestTime = requestParams.queryTestTime.join(',');
}
getList(page.currentPage, page.pageSize, requestParams).then(
(res) => {
this.data = res.data.data.records;
this.loading = false;
this.page.total = res.data.data.total;
// this.selectionClear();
}
);
},
//选择行
selectionChange(list) {
this.selectionList = list;
5 months ago
},
3 months ago
currentChange(val) {
this.page.currentPage = val;
this.onLoad(this.page);
},
// 搜索重置
searchReset() {
this.query = {taskStatus:'2'}
this.onLoad(this.page)
},
//刷新
refreshChange() {
this.onLoad(this.page, this.query);
},
//搜索
searchChange(params, done) {
this.query = params;
this.page.currentPage = 1;
this.onLoad(this.page, params)
done()
}
5 months ago
},
};
</script>
5 months ago
<style></style>