Merge remote-tracking branch 'origin/material-ui' into material-ui

This commit is contained in:
syruan 2025-08-24 19:12:37 +08:00
commit 2c8f2dfa30
5 changed files with 374 additions and 32 deletions

View File

@ -149,19 +149,23 @@ export function getOutRecordListApi(query) {
})
}
// 供应统计表-列表
export function getStatisticsListApi(query) {
return request({
url: '/material/complex_query/getStatisticsList',
method: 'get',
params: query
})
}
// 供应统计表-详情
export function getAllUsDetailsApi(query) {
return request({
url: '/material/complex_query/getAllUsDetails',
method: 'get',
params: query
})
}

View File

@ -86,7 +86,7 @@
<div style="margin: 40px 75px 15px; text-align: end">公章</div>
<div style="text-align: end;margin-right: 50px;">{{ formatDate(exitForm.addDate) }}</div>
<div>此证盖章有效</div>
<div v-if="exitPermitDialogVisible" style="position: absolute; top: 126px; left: 460px">
<div v-if="exitPermitDialogVisible" style="position: absolute; bottom: 39px; left: 460px">
<canvas id="canvas" width="200" height="200"></canvas>
</div>
<!-- <div v-if="showImg" style="position: absolute; top: 126px; left: 460px">

View File

@ -447,7 +447,7 @@
<div style="margin: 40px 75px 15px; text-align: end">公章</div>
<div style="text-align: end; margin-right: 50px">{{ passTime }}</div>
<div>此证盖章有效</div>
<div v-if="showPass" style="position: absolute; top: 126px; left: 460px">
<div v-if="showPass" style="position: absolute; bottom: 39px; left: 460px">
<canvas id="canvas" width="200" height="200"></canvas>
</div>
<!-- <div v-if="showImg" style="position: absolute; top: 126px; left: 490px">

View File

@ -0,0 +1,338 @@
<template>
<div class="app-container" id="">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80px">
<el-form-item prop="time">
<el-date-picker
v-model="queryParams.time"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
type="daterange"
value-format="yyyy-MM-dd"
style="width: 240px"
:unlink-panels="true"
></el-date-picker>
</el-form-item>
<el-form-item prop="keyWord">
<el-input
v-model="queryParams.keyWord"
placeholder="请输入关键字"
clearable
:maxlength="20"
style="width: 240px"
/>
</el-form-item>
<el-form-item prop="proName">
<el-input
v-model="queryParams.proName"
placeholder="请输入工程名称"
clearable
:maxlength="20"
style="width: 240px"
/>
</el-form-item>
<el-form-item prop="typeName">
<el-input
v-model="queryParams.typeName"
placeholder="请输入物资名称"
clearable
:maxlength="20"
style="width: 240px"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">查询</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport">导出</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<div style="font-weight: bolder">
统计日期
<span v-if="queryParams.time">{{ queryParams.time[0] || '' }} {{ queryParams.time[1] || '' }}</span>
</div>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="tableList" :max-height="650">
<el-table-column
label="序号"
align="center"
width="80"
type="index"
:index="indexContinuation(queryParams.pageNum, queryParams.pageSize)"
/>
<el-table-column label="工程名称" align="center" prop="proName" min-width="160"/>
<el-table-column label="物资名称" align="center" prop="typeName" />
<el-table-column label="规格型号" align="center" prop="typeModelName" :show-overflow-tooltip="true" />
<el-table-column label="计量单位" align="center" prop="unit" :show-overflow-tooltip="true" />
<el-table-column label="需求数量" align="center" prop="needNum" :show-overflow-tooltip="true" />
<el-table-column label="已供数量(累计)" align="center" prop="supplyNum" :show-overflow-tooltip="true" />
<el-table-column label="差值需求F-已供G" align="center" prop="diffNum" :show-overflow-tooltip="true" />
<el-table-column label="在用数量" align="center" prop="usNum" :show-overflow-tooltip="true" />
<el-table-column label="库存数量" align="center" prop="storeNum" :show-overflow-tooltip="true" />
<el-table-column label="在修数量" align="center" prop="repairNum" :show-overflow-tooltip="true" />
<el-table-column label="待入库数量" align="center" prop="inputNum" :show-overflow-tooltip="true" />
<el-table-column label="总保有量" align="center" prop="allNum" :show-overflow-tooltip="true" />
<el-table-column label="总在用工程明细" align="center" prop="allUsNum" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span v-if="scope.row.usNum > 0" class="clickText" @click="openUserRecords(scope.row)">
{{ scope.row.usNum }}
</span>
<!-- 否则直接显示数字 -->
<span v-else>
{{ scope.row.usNum }}
</span>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
:page-sizes="[10, 20, 50, 100]"
@pagination="getList"
/>
<!-- 在用编码设备弹窗-->
<el-dialog :title="title" :visible.sync="openUseRecord" width="1200px" append-to-body>
<el-form :model="dialogUseQuery" ref="dialogUseQuery" size="small" :inline="true" label-width="80px">
<el-form-item label="关键字" prop="keyWord">
<el-input
v-model="dialogUseQuery.keyWord"
placeholder="请输入关键字"
clearable
:maxlength="20"
style="width: 240px"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleDialogUseQuery">查询</el-button>
</el-form-item>
<el-form-item>
<el-button icon="el-icon-download" size="mini" @click="handleDialogUserExport">导出</el-button>
</el-form-item>
</el-form>
<el-table v-loading="loading2" :data="useRecordList" :max-height="650">
<el-table-column
label="序号"
align="center"
width="80"
type="index"
:index="indexContinuation(dialogUseQuery.pageNum, dialogUseQuery.pageSize)"
></el-table-column>
<el-table-column label="工程名称" align="center" prop="proName" width="200" />
<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="usNum" :show-overflow-tooltip="true" />
</el-table>
<pagination
v-show="dialogUserTotal > 0"
:total="dialogUserTotal"
:page.sync="dialogUseQuery.pageNum"
:limit.sync="dialogUseQuery.pageSize"
@pagination="getUserRecords"
/>
</el-dialog>
</div>
</template>
<script>
import { getStatisticsListApi, getAllUsDetailsApi } from '@/api/stquery/stquery'
export default {
name: 'DeviceStatusRecord',
dicts: [],
data() {
return {
//
loading: false,
loading2: false,
//
ids: [],
//
title: '查看',
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
tableList: [],
//
queryParams: {
time: [],
pageNum: 1,
pageSize: 10,
keyWord: null,
typeName: null, //
proName: null
},
//
openUseRecord: false,
dialogUseQuery: {
pageNum: 1,
pageSize: 10,
keyWord: undefined,
typeId: undefined
},
useRecordList: [], //
dialogUserTotal: 0
}
},
created() {
const end = new Date()
let start = new Date()
start.setMonth(start.getMonth() - 1)
this.queryParams.time = [this.format(start), this.format(end)]
this.getList()
},
methods: {
format(date) {
const y = date.getFullYear()
const m = String(date.getMonth() + 1).padStart(2, '0')
const day = String(date.getDate()).padStart(2, '0')
return `${y}-${m}-${day}`
},
//
async getList() {
try {
this.loading = true
const params = {
keyWord: this.queryParams.keyWord,
typeName: this.queryParams.typeName,
typeModelName: this.queryParams.typeModelName,
pageSize: this.queryParams.pageSize,
pageNum: this.queryParams.pageNum,
startTime: this.queryParams.time ? this.queryParams.time[0] : '',
endTime: this.queryParams.time ? this.queryParams.time[1] : ''
}
const res = await getStatisticsListApi(params)
if (res.data.rows.length > 0) {
this.tableList = res.data.rows
} else {
this.tableList = []
}
this.total = res.data.total
} catch (error) {
console.log('🚀 ~ getList ~ error:', error)
} finally {
this.loading = false
}
},
indexContinuationForTable(num, size) {
let number = (num - 1) * size
console.log(number)
if (number == 0) {
return '合计'
} else {
return number
}
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm('queryForm')
const end = new Date()
let start = new Date()
start.setMonth(start.getMonth() - 1)
this.queryParams.time = [this.format(start), this.format(end)]
this.handleQuery()
},
/** 导出按钮操作 */
handleExport() {
const formatTime = date => {
const year = date.getFullYear()
const month = String(date.getMonth() + 1).padStart(2, '0')
const day = String(date.getDate()).padStart(2, '0')
const hours = String(date.getHours()).padStart(2, '0')
const minutes = String(date.getMinutes()).padStart(2, '0')
const seconds = String(date.getSeconds()).padStart(2, '0')
return `${year}${month}${day}_${hours}${minutes}${seconds}`
}
const currentTime = formatTime(new Date())
this.download(
'material/complex_query/exportStatisticsList',
{
...this.queryParams,
startTime: this.queryParams.time ? this.queryParams.time[0] : '',
endTime: this.queryParams.time ? this.queryParams.time[1] : '',
},
`供应统计报表_${currentTime}.xlsx`
)
},
// ------------------
//
openUserRecords(row) {
this.openUseRecord = true
this.dialogUseQuery.typeId = row.typeId
this.dialogUseQuery.keyWord = ''
this.getUserRecords()
},
/** 查询在用设备列表 */
getUserRecords() {
this.loading2 = true
getAllUsDetailsApi(this.dialogUseQuery)
.then(response => {
this.useRecordList = response.data.rows
this.dialogUserTotal = response.data.total
})
.catch(() => {
this.useRecordList = []
this.dialogUserTotal = 0
})
.finally(() => {
this.loading2 = false
})
},
/** 搜索在用按钮操作 */
handleDialogUseQuery() {
this.dialogUseQuery.pageNum = 1
this.getUserRecords()
},
handleDialogUserExport() {
const formatTime = date => {
const year = date.getFullYear()
const month = String(date.getMonth() + 1).padStart(2, '0')
const day = String(date.getDate()).padStart(2, '0')
const hours = String(date.getHours()).padStart(2, '0')
const minutes = String(date.getMinutes()).padStart(2, '0')
const seconds = String(date.getSeconds()).padStart(2, '0')
return `${year}${month}${day}_${hours}${minutes}${seconds}`
}
const currentTime = formatTime(new Date())
this.download(
'material/complex_query/exportAllUsDetails',
{ ...this.dialogUseQuery },
`供应统计报表_在用设备_${currentTime}.xlsx`
)
}
// ------------------
}
}
</script>
<style lang="scss" scoped>
::v-deep.el-table .fixed-width .el-button--mini {
width: 60px !important;
margin-bottom: 10px;
}
.clickText {
color: #02a7f0;
cursor: pointer;
}
</style>

View File

@ -81,47 +81,47 @@
</el-table-column>
<el-table-column label="在用数量" align="center" prop="usNum" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span class="clickText" @click="openUserRecords(scope.row)">
<span v-if="scope.$index !== 0" class="clickText" @click="openUserRecords(scope.row)">
{{ scope.row.usNum }}
</span>
<!-- 否则直接显示数字 -->
<!-- <span v-else>
<span v-else>
{{ scope.row.usNum }}
</span> -->
</span>
</template>
</el-table-column>
<el-table-column label="在修数量" align="center" prop="repairNum" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span class="clickText" @click="openRepairRecords(scope.row)">
<span v-if="scope.$index !== 0" class="clickText" @click="openRepairRecords(scope.row)">
{{ scope.row.repairNum }}
</span>
<!-- 否则直接显示数字 -->
<!-- <span v-else>
<span v-else>
{{ scope.row.repairNum }}
</span> -->
</span>
</template>
</el-table-column>
<el-table-column label="新购待入库数量" align="center" prop="inputNum" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span class="clickText" @click="openPurchaseRecords(scope.row)">
<span v-if="scope.$index !== 0" class="clickText" @click="openPurchaseRecords(scope.row)">
{{ scope.row.inputNum }}
</span>
<!-- 否则直接显示数字 -->
<!-- <span v-else>
<span v-else>
{{ scope.row.inputNum }}
</span> -->
</span>
<!-- <span class="clickText" @click="openPurchaseRecords(scope.row)">{{ scope.row.inputNum }}</span> -->
</template>
</el-table-column>
<el-table-column label="修试后待入库数量" align="center" prop="repairInputNum" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span class="clickText" @click="openTestedRecords(scope.row)">
<span v-if="scope.$index !== 0" class="clickText" @click="openTestedRecords(scope.row)">
{{ scope.row.repairInputNum }}
</span>
<!-- 否则直接显示数字 -->
<!-- <span v-else>
<span v-else>
{{ scope.row.repairInputNum }}
</span> -->
</span>
<!-- <span class="clickText" @click="openTestedRecords(scope.row)">{{ scope.row.repairInputNum }}</span> -->
</template>
</el-table-column>
@ -134,7 +134,7 @@
</el-table-column> -->
<el-table-column label="已审核报废数量" align="center" prop="scrapNum" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span class="clickText" @click="openAuditedRecords(scope.row)">
<span v-if="scope.$index !== 0" class="clickText" @click="openAuditedRecords(scope.row)">
{{ scope.row.scrapNum }}
</span>
<!-- 否则直接显示数字 -->