优化启动时控制台warning
This commit is contained in:
parent
69a5603954
commit
3c6b7cb806
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Reference in New Issue