优化启动时控制台warning

This commit is contained in:
BianLzhaoMin 2025-03-21 09:09:43 +08:00
parent 69a5603954
commit 3c6b7cb806
1 changed files with 164 additions and 155 deletions

View File

@ -1,6 +1,14 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px" @submit.native.prevent>
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="68px"
@submit.native.prevent
>
<el-form-item prop="dateRange">
<el-date-picker
v-model="dateRange"
@ -8,8 +16,8 @@
value-format="yyyy-MM-dd"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期">
</el-date-picker>
end-placeholder="结束日期"
></el-date-picker>
</el-form-item>
<el-form-item prop="keyWord">
<el-input
@ -29,7 +37,7 @@
<el-table v-loading="loading" :data="tableList" ref="multipleTable" border :span-method="objectSpanMethod">
<el-table-column label="序号" align="center" width="80" type="index">
<template scope="scope">
<template slot-scope="scope">
<span v-if="scope.$index == 0">合计</span>
<span v-else>{{ (queryParams.pageNum - 1) * 10 + scope.$index }}</span>
</template>
@ -38,7 +46,7 @@
<el-table-column label="规格型号" align="center" prop="typeModelName" show-overflow-tooltip />
<el-table-column label="计量单位" align="center" prop="unitName" show-overflow-tooltip />
<el-table-column label="报废数量" align="center" prop="scrapNum" show-overflow-tooltip>
<template scope="scope">
<template slot-scope="scope">
<!-- manageType '编码' 使用可点击的 span -->
<span class="clickText" v-if="scope.row.manageType == '0'" @click="openRecords(scope.row)">
{{ scope.row.scrapNum }}
@ -70,35 +78,34 @@
<el-input
v-model="dialogQuery.keyWord"
placeholder="请输入关键字"
clearable :maxlength="30"
style="width: 240px"/>
clearable
:maxlength="30"
style="width: 240px"
/>
</el-form-item>
<el-form-item>
<el-button type="primary"
icon="el-icon-search" size="mini"
@click="handleDialogQuery"
>查询</el-button>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleDialogQuery">
查询
</el-button>
</el-form-item>
<el-form-item>
<el-button
icon="el-icon-refresh"
size="mini"
@click="resetDialogQuery"
>重置</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetDialogQuery">重置</el-button>
</el-form-item>
<el-form-item>
<el-button
type="warning"
icon="el-icon-download"
size="mini"
@click="handleDialogExport"
>导出</el-button>
<el-button type="warning" icon="el-icon-download" size="mini" @click="handleDialogExport">
导出
</el-button>
</el-form-item>
</el-form>
<el-table v-loading="loading" :data="dialogList" height="500px">
<el-table-column label="序号" align="center" width="80" type="index" :index="indexContinuation(dialogQuery.pageNum, dialogQuery.pageSize)">
</el-table-column>
<el-table-column
label="序号"
align="center"
width="80"
type="index"
:index="indexContinuation(dialogQuery.pageNum, dialogQuery.pageSize)"
></el-table-column>
<el-table-column label="机具名称" align="center" prop="typeName" :show-overflow-tooltip="true" />
<el-table-column label="规格型号" align="center" prop="typeModelName" :show-overflow-tooltip="true" />
<el-table-column label="购置价(元)" align="center" prop="buyPrice" :show-overflow-tooltip="true" />
@ -116,9 +123,9 @@
</template>
<script>
import { getScrapListApi,getScrapListNoPageApi,getScrapDetailsListApi } from "@/api/report/report";
import { getScrapListApi, getScrapListNoPageApi, getScrapDetailsListApi } from '@/api/report/report'
export default {
name: "Report",
name: 'Report',
data() {
return {
//
@ -136,27 +143,27 @@
queryParams: {
pageNum: 1,
pageSize: 10,
keyWord:undefined,
keyWord: undefined
},
//
total: 0,
//
tableList: [],
//
title: "",
title: '',
//
openRecord: false,
dialogList: [], //
dialogQuery: {
pageNum: 1,
pageSize: 10,
keyWord: undefined,
keyWord: undefined
},
dialogTotal: 0,
};
dialogTotal: 0
}
},
created() {
this.getList();
this.getList()
},
methods: {
// rowIndex= columnIndex=
@ -190,54 +197,57 @@
}
const res = await getScrapListApi(params)
if (res.data.rows.length > 0) {
this.tableList = res.data.rows;
this.tableList = res.data.rows
} else {
this.tableList = []
}
this.total = res.data.total;
this.total = res.data.total
let param = {
keyWord: this.queryParams.keyWord,
startTime: this.dateRange && this.dateRange[0],
endTime: this.dateRange && this.dateRange[1],
endTime: this.dateRange && this.dateRange[1]
}
const response = await getScrapListNoPageApi(param)
let obj = {
scrapNum: response.data.scrapNum,
scrapNum: response.data.scrapNum
}
this.tableList.unshift(obj)
this.loading = false
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.resetForm('queryForm')
this.dateRange = []
this.queryParams.keyWord=null;
this.handleQuery();
this.queryParams.keyWord = null
this.handleQuery()
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
this.queryParams.pageNum = 1
this.getList()
},
handleExport() {
this.download(
"/material/bm_report/exportScrapList",
{keyWord: this.queryParams.keyWord,startTime: this.dateRange && this.dateRange[0],endTime: this.dateRange && this.dateRange[1]},
'/material/bm_report/exportScrapList',
{
keyWord: this.queryParams.keyWord,
startTime: this.dateRange && this.dateRange[0],
endTime: this.dateRange && this.dateRange[1]
},
`报废报表_${new Date().getTime()}.xlsx`
);
)
},
//
openRecords(row) {
this.openRecord = true
this.dialogQuery.keyWord = ""
this.dialogQuery.taskId = row.taskId;
this.dialogQuery.typeId = row.typeId;
this.dialogQuery.keyWord = ''
this.dialogQuery.taskId = row.taskId
this.dialogQuery.typeId = row.typeId
this.getDialogDataList()
},
/** 查询弹框列表 */
getDialogDataList() {
getScrapDetailsListApi(this.dialogQuery).then((response) => {
getScrapDetailsListApi(this.dialogQuery).then(response => {
this.dialogList = response.data.rows
this.dialogTotal = response.data.total
})
@ -249,7 +259,7 @@
},
/** 弹框重置操作 */
resetDialogQuery() {
this.dialogQuery.keyWord = "";
this.dialogQuery.keyWord = ''
this.handleDialogQuery()
},
/** 弹框导出操作 */
@ -257,12 +267,11 @@
this.download(
'material/bm_report/exportScrapDetailsList',
{ ...this.dialogQuery },
`报废报表_维修合格设备_${new Date().getTime()}.xlsx`,
`报废报表_维修合格设备_${new Date().getTime()}.xlsx`
)
},
}
};
}
}
</script>
<style lang="scss" scoped>