Merge branch 'material-ui' of http://14.103.246.124:16000/bonus/bonus-ui into material-ui

This commit is contained in:
hongchao 2025-08-31 21:02:42 +08:00
commit 7b12d50686
9 changed files with 388 additions and 18 deletions

View File

@ -8,4 +8,9 @@ export const getUseMaintenanceWarningApi = data => {
// 获取4级类型内容
export const getMaTypeApi = data => {
return request.post('/material/select/getMaType', data)
}
// 安全工器具到期预警
export const getOverTimeListApi = data => {
return request.get('/material/useMaintenanceWarning/getOverTimeList', { params: data })
}

View File

@ -543,6 +543,7 @@ export default {
this.reset()
this.open = true
this.title = '新增工程'
this.getType()
this.getI8ProType()
},
//
@ -562,6 +563,7 @@ export default {
},
/** 修改按钮操作 */
handleUpdate(row) {
this.getType()
this.getI8ProType()
this.reset()
getProjectListDetail(row.proId).then(response => {

View File

@ -336,7 +336,7 @@ export default {
methods: {
//
getType() {
unitTypeList({ dictType: 'bm_unit_type'}).then((response) => {
unitTypeList({ dictType: 'bm_unit_type', pageSize: 9999}).then((response) => {
let unitList = response.rows
this.typeList = unitList.map((item) => {
return {
@ -433,6 +433,8 @@ export default {
this.reset()
this.open = true
this.title = '新建'
this.getType()
this.getTypeDept()
},
handlePeople(row) {
this.$router.push({
@ -448,6 +450,8 @@ export default {
},
/** 修改按钮操作 */
handleUpdate(row) {
this.getType()
this.getTypeDept()
this.reset()
unitInfoAll(row.unitId).then((response) => {
this.form = response.data

View File

@ -264,7 +264,7 @@
</el-row>
<el-row>
<el-col :span="12">
<el-col :span="24">
<el-form-item label="附件">
<el-upload
action="#"
@ -1205,7 +1205,9 @@ export default {
this.download(
'/material/bm_agreement_info/export',
{
...this.queryParams
...this.queryParams,
startTime: this.queryParams.time ? this.queryParams.time[0] : '',
endTime: this.queryParams.time ? this.queryParams.time[1] : ''
},
`协议管理 _${currentTime}.xlsx`
)
@ -1337,6 +1339,7 @@ export default {
}
::v-deep .el-upload-list--picture-card {
display: flex;
flex-wrap: wrap;
align-items: center;
}
</style>

View File

@ -201,6 +201,7 @@
编辑
</el-button>
<el-button
v-if="scope.row.manageType == 1"
size="mini"
type="text"
icon="el-icon-edit"
@ -312,7 +313,7 @@
v-model="form.typeName"
type="text"
placeholder="请输入规格型号"
maxlength="10"
maxlength="20"
/>
</el-form-item>
</el-col>
@ -454,11 +455,12 @@
prop="leasePrice"
label-width="140px"
>
<el-input
<el-input-number
v-model="form.leasePrice"
placeholder="请输入"
maxlength="20"
type="number" :min="0"
controls-position="right"
:min="0" :max="99999"
style="width: 100%"
/>
</el-form-item>
@ -470,10 +472,11 @@
prop="buyPrice"
label-width="140px"
>
<el-input
<el-input-number
v-model="form.buyPrice"
placeholder="请输入"
type="number" :min="0"
controls-position="right"
:min="0" :max="99999"
maxlength="20"
style="width: 100%"
/>
@ -499,11 +502,12 @@
prop="rentPrice"
label-width="140px"
>
<el-input
<el-input-number
v-model="form.rentPrice"
placeholder="请输入"
maxlength="20"
type="number" :min="0"
controls-position="right"
:min="0" :max="99999"
style="width: 100%"
/>
</el-form-item>
@ -538,9 +542,10 @@
<el-col :span="12">
<el-form-item label="检验周期(月)" prop="testCycle">
<el-input
<el-input-number
v-model="form.testCycle"
type="number" :min="0"
controls-position="right"
:min="0" :max="99999"
placeholder="请输入"
maxlength="20"
style="width: 100%"
@ -552,9 +557,10 @@
<el-row>
<el-col :span="12">
<el-form-item label="抽检比例(%)" prop="samplingRatio">
<el-input
<el-input-number
v-model="form.samplingRatio"
type="number" :min="0"
controls-position="right"
:min="0" :max="100"
placeholder="请输入"
maxlength="20"
style="width: 100%"
@ -593,9 +599,10 @@
</el-col>
<el-col :span="12">
<el-form-item label="持荷时间(分)" prop="holdingTime">
<el-input
<el-input-number
v-model="form.holdingTime"
type="number" :min="0"
controls-position="right"
:min="0" :max="99999"
placeholder="请输入"
maxlength="20"
style="width: 100%"
@ -1665,4 +1672,8 @@ export default {
}
}
}
::v-deep .el-dialog .el-input__inner {
text-align: start !important;
}
</style>

View File

@ -353,7 +353,7 @@ export default {
return {
...item,
deptName: index == 0 ? '供应科' : item.deptName || '',
auditStatus: 1
auditStatus: index == 0 ? 1 : item.auditStatus || 0
}
})
const list = [

View File

@ -375,7 +375,7 @@ export default {
return {
...item,
deptName: index == 0 ? '供应科' : item.deptName || '',
auditStatus: 1
auditStatus: index == 0 ? 1 : item.auditStatus || 0
}
})
const list = [

View File

@ -101,6 +101,7 @@
查看
</el-button>
<el-button
v-if="scope.row.taskStatusName == '未完成'"
size="mini"
type="primary"
@click="handleEdit(scope.row)"

View File

@ -0,0 +1,344 @@
<template>
<!-- 工程在用检修预警 -->
<div class="app-container">
<el-form v-show="showSearch" :model="queryParams" ref="queryForm" size="small" inline>
<el-form-item label="时间范围" prop="timeRange">
<el-date-picker
clearable
type="daterange"
format="yyyy-MM-dd"
style="width: 240px"
range-separator="至"
value-format="yyyy-MM-dd"
end-placeholder="结束日期"
start-placeholder="开始日期"
v-model="queryParams.timeRange"
/>
</el-form-item>
<el-form-item label="关键字" prop="keyWord">
<el-input
clearable
style="width: 240px"
placeholder="请输入关键字"
v-model="queryParams.keyWord"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="机具类型" prop="">
<el-cascader
v-model="typeIds"
:options="typeList"
:props="{ label: 'typeName', value: 'typeId' }"
filterable
clearable
@change="handleChangeType"
style="width: 240px"
></el-cascader>
</el-form-item>
<el-form-item label="规格型号" prop="typeId">
<el-select v-model="queryParams.typeId" placeholder="请选择机规格型号" style="width: 240px">
<el-option
v-for="item in typeIdList"
:key="item.typeId"
:label="item.name"
:value="item.typeId"
filterable
clearable
></el-option>
</el-select>
</el-form-item>
<!-- 表单按钮 -->
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">查询</el-button>
<el-button icon="el-icon-refresh" @click="handleReset">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<!-- 通知暂未开发 -->
<!-- <el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-chat-dot-round" size="mini" @click="onHandleNotice">
通知
</el-button>
</el-col> -->
<el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport">
导出数据
</el-button>
</el-col>
<el-col :span="1.5">
<div style="color: red; font-size: 20px; font-weight: 800">总计{{ total }}</div>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table :data="tableList" fit highlight-current-row style="width: 100%" :max-height="650">
<!-- 多选 -->
<el-table-column type="selection" width="55" align="center" @selection-change="selectionChange" />
<el-table-column
type="index"
width="55"
label="序号"
align="center"
:index="indexContinuation(queryParams.pageNum, queryParams.pageSize)"
/>
<el-table-column
v-for="column in tableColumns"
:show-overflow-tooltip="column.showTooltip"
:key="column.prop"
:label="column.label"
:prop="column.prop"
:width="column.width"
align="center"
/>
</el-table>
<!-- 分页 -->
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
</template>
<script>
import printJS from 'print-js'
import { getLeaseTaskList, deleteLeaseTask, getLeaseTask, getCodePDF } from '@/api/business/index'
import { getOverTimeListApi, getMaTypeApi } from '@/api/warning-analysis/engineering-in-use.js'
import { equipmentTypeTree } from '@/api/purchase/goodsArrived'
export default {
data() {
return {
showSearch: true,
queryParams: {
pageNum: 1,
pageSize: 10,
keyWord: '', //
thirdTypeId: '',
typeId: '',
timeRange: [] //
},
typeIds: [],
total: 0, //
//
tableColumns: [
{ label: '下次检修时间', prop: 'nextCheckTime', width: '100' },
{ label: '物资类型', prop: 'materialType', showTooltip: true },
{ label: '机具类型', prop: 'typeName', showTooltip: true },
{ label: '规格型号', prop: 'typeModelName', showTooltip: true },
{ label: '设备编码', prop: 'maCode', showTooltip: true },
{ label: '单位名称', prop: 'unitName', width: '200' },
{ label: '工程名称', prop: 'projectName', width: '200' },
{ label: '分公司', prop: 'impUnit', width: '200' },
{ label: '协议号', prop: 'agreementCode', width: '140' },
{ label: '临检天数', prop: 'overDays', width: '100' }
],
//
tableList: [],
dialogTitle: '', //
dialogVisible: false, //
dialogForm: {
proName: '', //
code: '' //
},
dialogColumns: [
{ label: '名称', prop: 'maTypeName', width: '150px' },
{ label: '规格', prop: 'typeName', width: '150px' },
{ label: '单位', prop: 'unitName', width: '60px' },
{ label: '数量', prop: 'preNum', width: '60px' },
{ label: '备注', prop: 'remark', width: '' }
],
dialogList: [],
typeList: [],
typeIdList: []
}
},
created() {
this.getList()
this.getTreeList()
},
methods: {
//
handleQuery() {
this.getList()
},
//
handleReset() {
this.queryParams.pageNum = 1
this.queryParams.pageSize = 10
this.typeIds = []
this.queryParams.thirdTypeId = ''
this.$refs.queryForm.resetFields()
this.getList()
},
//
async getList() {
console.log('列表-查询', this.queryParams)
try {
const params = {
...this.queryParams,
startTime: this.queryParams.timeRange[0] || '',
endTime: this.queryParams.timeRange[1] || ''
}
const res = await getOverTimeListApi(params)
console.log('🚀 ~ 获取列表 ~ res:', res)
this.tableList = res.rows
this.total = res.total
} catch (error) {
console.log('🚀 ~ 获取列表 ~ error:', error)
this.tableList = []
this.total = 0
}
},
//
async getTreeList() {
try {
const res = await equipmentTypeTree()
console.log('🚀 ~ getTreeList ~ res:', res)
if (res.data && res.data.length > 0) {
this.typeList = this.removeChildrenFromLevel3(res.data)
}
} catch (error) {
console.log('🚀 ~ getTreeList ~ error:', error)
}
},
removeChildrenFromLevel3(tree) {
return tree.map(node => {
const newNode = { ...node }
if (newNode.level === '3') {
// children
delete newNode.children
} else if (newNode.children && newNode.children.length > 0) {
//
newNode.children = this.removeChildrenFromLevel3(newNode.children)
}
return newNode
})
},
handleChangeType(e) {
this.typeIdList = []
this.queryParams.typeId = ''
this.queryParams.thirdTypeId = e[e.length - 1]
console.log('🚀 ~ handleChangeType ~ :', this.queryParams.thirdTypeId)
this.getMaTypeList()
},
async getMaTypeList() {
try {
const res = await getMaTypeApi({ typeId: this.queryParams.thirdTypeId })
this.typeIdList = res.data || []
} catch (error) {
console.log('🚀 ~ getMaTypeList ~ error:', error)
}
},
//
selectionChange(val) {
console.log('selectionChange', val)
},
handleAdd() {
console.log('领料申请')
this.$router.push({ path: '/business/businessHandling/index' })
},
//
handleEdit(row, type) {
console.log('编辑', row)
let params = {}
if (type === 1) {
params = { type: 'detail', id: row.id }
} else {
params = { type: 'edit', id: row.id }
}
this.$router.push({ path: '/business/businessHandling/index', query: params })
},
//
handleDelete(row) {
console.log('删除', row)
this.$confirm('是否删除该数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
const res = await deleteLeaseTask(row.id)
console.log('🚀 ~ 删除 ~ res:', res)
this.getList()
this.$message({
type: 'success',
message: '删除成功!'
})
})
},
//
handleExport() {
try {
let fileName = `安全工器具到期预警数据_${new Date().getTime()}.xLsx`
let url = '/material/useMaintenanceWarning/exportOverTimeList'
const params = { ...this.queryParams }
this.download(url, params, fileName)
} catch (error) {
console.log('导出数据失败', error)
}
},
//
print() {
printJS({
printable: 'print-content',
type: 'html', //
// targetStyles: ['*'], //
scanStyles: false, //
// css: [
// 'https://unpkg.com/element-ui/lib/theme-chalk/index.css' // Element UI
// ],
maxWidth: '1400'
//
})
},
//
async getDialogContent(row) {
console.log('🚀 ~ getDialogContent ~ row:', row.taskId)
const loading = this.$loading({
lock: true,
text: '加载中...'
})
try {
//
const res = await getLeaseTask(row.id)
console.log('🚀 ~ getDialogContent ~ res:', res)
// PDF
// const PDFres = await getCodePDF(row.taskId)
// console.log('🚀 ~ getDialogContent ~ res:', PDFres)
this.dialogVisible = true
this.dialogForm = {
...res.data.leaseApplyInfo
// pdfUrl: PDFres.data.url
}
this.dialogList = res.data.leaseApplyDetailsList
loading.close()
} catch (error) {
console.log('🚀 ~ 获取弹框内容 ~ error:', error)
loading.close()
}
},
// 2021-09-01 20210901
handleTimeFormat(time) {
if (time) {
return time.replace(/-/g, '年').replace(/-/g, '月') + '日'
}
return ''
},
//
onHandleNotice() {
console.log('通知--')
}
}
}
</script>
<style lang="scss" scoped></style>