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