装备台账-编辑

This commit is contained in:
bb_pan 2026-01-04 13:15:24 +08:00
parent 754df57e0f
commit 19c82534be
5 changed files with 205 additions and 80 deletions

View File

@ -2,15 +2,15 @@ import request from '@/utils/request'
// 登录方法
export function login(data) {
// return request({
// url: '/auth/login',
// headers: {
// isToken: false,
// repeatSubmit: false
// },
// method: 'post',
// data: data
// })
return request({
url: '/auth/login',
headers: {
isToken: false,
repeatSubmit: false
},
method: 'post',
data: data
})
}
// iws登录

View File

@ -12,8 +12,8 @@
<el-dropdown trigger="click" :hide-on-click="false" style="padding-left: 12px" v-if="showColumnsType == 'checkbox'">
<el-button size="mini" circle icon="el-icon-menu" />
<el-dropdown-menu slot="dropdown" style="max-height: 880px; overflow-y: auto;">
<template v-for="item in columns">
<el-dropdown-item :key="item.key">
<template>
<el-dropdown-item v-for="(item, index) in columns" :key="index">
<el-checkbox :checked="item.visible" @change="checkboxChange($event, item.label)" :label="item.label" />
</el-dropdown-item>
</template>

View File

@ -147,6 +147,12 @@
/>
</div>
</div>
<img
v-else
src="@/assets/images/no-img.png"
alt=""
style="width: 120px; height: 120px; margin-right: 10px"
/>
</el-form-item>
</el-col>
</el-row>
@ -194,6 +200,12 @@
/>
</div>
</div>
<img
v-else
src="@/assets/images/no-img.png"
alt=""
style="width: 120px; height: 120px; margin-right: 10px"
/>
</el-form-item>
<el-form-item label="检测证书" prop="inspectionReports">
@ -233,6 +245,12 @@
/>
</div>
</div>
<img
v-else
src="@/assets/images/no-img.png"
alt=""
style="width: 120px; height: 120px; margin-right: 10px"
/>
</el-form-item>
<el-form-item label="采购发票" prop="purchaseInvoices">
@ -272,6 +290,12 @@
/>
</div>
</div>
<img
v-else
src="@/assets/images/no-img.png"
alt=""
style="width: 120px; height: 120px; margin-right: 10px"
/>
</el-form-item>
</el-col>
</el-row>

View File

@ -346,8 +346,8 @@
<template v-slot="{ row }" v-else-if="item.prop == 'devType'">
<span>
{{ row.mainCategory ? row.mainCategory + '>' : '' }}
{{ row.branch ? row.subCategory : row.subCategory }}
<!-- {{ row.branch }}-->
{{ row.branch ? row.subCategory : row.subCategory }}
<!-- {{ row.branch }}-->
</span>
</template>
<template v-slot="{ row }" v-else-if="item.prop == 'upDownStatus'">
@ -373,6 +373,9 @@
<template v-slot="{ row }" v-else-if="item.prop == 'purchaseInvoices'">
<span style="color: #00a288; cursor: pointer" @click="handleView(row, 4)">查看</span>
</template>
<template v-slot="{ row }" v-else-if="item.prop == 'fileImgList'">
<span style="color: #00a288; cursor: pointer" @click="handleFileListUpload(row)">报告管理</span>
</template>
<template v-slot="{ row }" v-else-if="/^feature(Item|Value)\d+$/.test(item.prop)">
<span>
{{ getFeatureValue(row, item.prop) }}
@ -385,6 +388,7 @@
<el-button type="text" @click="onHandlePreview(scope.row)">
<i class="el-icon-view"></i> 查看
</el-button>
<el-button type="text" icon="el-icon-edit" @click="onHandleEdit(scope.row)"> 编辑 </el-button>
</template>
</el-table-column>
</el-table>
@ -718,6 +722,43 @@
<el-button @click="dialogVisible = false"> </el-button>
</span>
</el-dialog>
<!-- 报告管理 -->
<el-dialog title="报告管理" :visible.sync="openReport" width="900px" append-to-body>
<el-table :data="fileDataList" width="100%" height="350px">
<el-table-column label="序号" type="index" width="55" align="center" />
<el-table-column label="报告类型" align="center" prop="dictLabel" :show-overflow-tooltip="true">
<template v-slot="{ row }">
<span v-if="row.type == 1 || row.type == 2 || row.type == 3">
<span style="color: red">*</span>
{{ row.dictLabel }}
</span>
<span v-else>{{ row.dictLabel }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="100">
<template slot-scope="{ row, $index }">
<div style="display: flex; align-items: center; justify-content: center">
<el-button
v-if="
(row.type == 1 && currentRow.appearanceImages.length > 0) ||
(row.type == 2 && currentRow.certificates.length > 0) ||
(row.type == 3 && currentRow.inspectionReports.length > 0) ||
(row.type == 4 && currentRow.purchaseInvoices.length > 0)
"
size="mini"
type="text"
@click="handleView(currentRow, row.type)"
>
查看
</el-button>
</div>
</template>
</el-table-column>
</el-table>
</el-dialog>
<AddEquip ref="addEquipRef" @getList="getDeviceList" />
</div>
</template>
@ -735,9 +776,11 @@ import {
import { firstLevel, secondAndThirdLevel } from '@/api/EquipmentEntryApply'
import { getMaxFeatureAPI, getProvinceListAPI } from '@/api/EquipmentLedger/equ-out.js'
import { deptTreeSelect } from '@/api/system/user'
import AddEquip from '@/views/stockManagement/entryApply/components/AddEquip'
export default {
name: 'EquipmentLedger',
components: { AddEquip },
data() {
return {
treeSearchKey: '', //
@ -808,10 +851,11 @@ export default {
{ key: 19, label: `资产净值(万元)`, prop: 'value', visible: true },
{ key: 20, label: `最大使用年限(年)`, prop: 'maxServiceLifeYears', visible: true },
{ key: 21, label: `下次维保日期`, prop: 'nextMaintenanceDate', visible: true },
{ key: 22, label: `装备外观`, prop: 'appearanceImages', visible: true },
{ key: 23, label: `合格证`, prop: 'certificates', visible: true },
{ key: 24, label: `定期检验报告`, prop: 'inspectionReports', visible: true },
{ key: 25, label: `采购发票`, prop: 'purchaseInvoices', visible: true },
{ key: 22, label: `相关配套资料`, prop: 'fileImgList', visible: true },
// { key: 22, label: ``, prop: 'appearanceImages', visible: true },
// { key: 23, label: ``, prop: 'certificates', visible: true },
// { key: 24, label: ``, prop: 'inspectionReports', visible: true },
// { key: 25, label: ``, prop: 'purchaseInvoices', visible: true },
{ key: 26, label: `特征项1`, prop: 'featureItem1', visible: true },
{ key: 27, label: `特征值1`, prop: 'featureValue1', visible: true },
{ key: 28, label: `特征项2`, prop: 'featureItem2', visible: true },
@ -885,6 +929,14 @@ export default {
dialogVisible: false,
dialogTitle: '',
dialogList: [],
currentRow: {},
openReport: false,
fileDataList: [
{ dictLabel: '装备外观', type: '1' },
{ dictLabel: '合格证', type: '2' },
{ dictLabel: '检测证书', type: '3' },
{ dictLabel: '采购发票', type: '4' },
],
}
},
methods: {
@ -1338,8 +1390,8 @@ export default {
* 编辑按钮
*/
async onHandleEdit(row) {
this.formData = row
this.editDialogVisible = true
console.log('🚀 ~ row:', row)
this.$refs.addEquipRef.openDialog(row.maId, 'edit')
},
/**
* 关闭编辑弹窗
@ -1577,6 +1629,10 @@ export default {
//
window.open(row.fileUrl, '_blank')
},
handleFileListUpload(row) {
this.currentRow = row
this.openReport = true
},
},
async created() {

View File

@ -1,7 +1,7 @@
<template>
<!-- 弹窗内容区域 -->
<el-dialog
title="新增装备"
:title="pageTitle"
:visible.sync="dialogVisible"
width="90%"
:destroy-on-close="true"
@ -46,7 +46,13 @@
<el-row :gutter="24" style="padding-top: 10px">
<el-col :span="6">
<el-form-item label="专业" prop="major">
<el-select v-model="form.major" placeholder="请选择专业" @change="majorChange" style="width: 100%">
<el-select
v-model="form.major"
placeholder="请选择专业"
@change="majorChange"
:disabled="isEdit"
style="width: 100%"
>
<el-option v-for="item in majorList" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
@ -61,6 +67,7 @@
clearable
filterable
:options="processList"
:disabled="isEdit"
@change="processChange"
></el-cascader>
</el-form-item>
@ -71,6 +78,7 @@
style="width: 100%"
v-model="form.category"
:options="categoryList"
:disabled="isEdit"
clearable
filterable
placeholder="请选择装备类目"
@ -80,7 +88,14 @@
</el-col>
<el-col :span="6">
<el-form-item label="装备名称" prop="name">
<el-input autocomplete="off" maxlength="30" placeholder="请输入装备名称" v-model="form.name" clearable/>
<el-input
autocomplete="off"
maxlength="30"
placeholder="请输入装备名称"
v-model="form.name"
clearable
:disabled="isEdit"
/>
</el-form-item>
</el-col>
</el-row>
@ -116,12 +131,17 @@
style="color: #13ce66; margin-right: 5px; cursor: pointer"
@click="openAddress"
/>
<el-select v-model="form.manufacturerId" placeholder="请选择生产厂家" clearable style="flex: 1; width: 100%">
<el-option v-for="item in manufacturerList" :key="item.id" :label="item.label" :value="item.id"/>
<el-select
v-model="form.manufacturerId"
placeholder="请选择生产厂家"
clearable
filterable
style="flex: 1; width: 100%"
>
<el-option v-for="item in manufacturerList" :key="item.id" :label="item.label" :value="item.id" />
</el-select>
</div>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="出厂日期" prop="productionDate">
@ -161,7 +181,7 @@
</el-col>
<el-col :span="6">
<el-form-item label="装备原始编码" prop="originalCode">
<el-input clearable maxlength="20" placeholder="请输入装备原始编码" v-model="form.originalCode"/>
<el-input clearable maxlength="20" placeholder="请输入装备原始编码" v-model="form.originalCode" />
</el-form-item>
</el-col>
<el-col :span="6">
@ -221,11 +241,17 @@
<!-- propertyVoList -->
<el-col :span="6" v-for="(item, index) in propertyVoList" :key="index">
<el-form-item v-if="item.inputType == 1" :label="item.propertyName">
<el-input autocomplete="off" maxlength="30" v-model="item.propertyValue" clearable/>
<el-input autocomplete="off" maxlength="30" v-model="item.propertyValue" clearable :disabled="isEdit" />
</el-form-item>
<!-- 单选 -->
<el-form-item v-if="item.inputType == 2" :label="item.propertyName">
<el-select v-model="item.propertyValue" placeholder="请选择" clearable style="width: 100%">
<el-select
v-model="item.propertyValue"
placeholder="请选择"
clearable
:disabled="isEdit"
style="width: 100%"
>
<el-option
v-for="(item, index) in handleData(item.value)"
:key="index"
@ -236,7 +262,14 @@
</el-form-item>
<!-- 多选 -->
<el-form-item v-if="item.inputType == 3" :label="item.propertyName">
<el-select v-model="item.propertyValue" multiple placeholder="请选择" clearable style="width: 100%">
<el-select
v-model="item.propertyValue"
multiple
placeholder="请选择"
clearable
:disabled="isEdit"
style="width: 100%"
>
<el-option
v-for="(item, index) in handleData(item.value)"
:key="index"
@ -274,7 +307,7 @@
v-model="form.mainFileList"
:value="form.mainFileList"
:limit="6"
@change="handleImageChange"
@input="handleImageChange"
/>
</el-form-item>
</el-col>
@ -293,7 +326,7 @@
:limit="3"
:fileSize="10"
:fileType="['jpg', 'png', 'pdf']"
@change="handleCertificateChange"
@input="handleCertificateChange"
/>
</el-form-item>
@ -304,7 +337,7 @@
:limit="3"
:fileSize="10"
:fileType="['jpg', 'png', 'pdf']"
@change="handleInspectionChange"
@input="handleInspectionChange"
/>
</el-form-item>
@ -315,7 +348,7 @@
:limit="3"
:fileSize="10"
:fileType="['jpg', 'png', 'pdf']"
@change="handlePurchaseInvoicesChange"
@input="handlePurchaseInvoicesChange"
/>
</el-form-item>
</el-col>
@ -329,12 +362,12 @@
<el-row>
<el-col :span="12">
<el-form-item label="统一社会信用代码" prop="supplierCode">
<el-input v-model="supFrom.supplierCode" placeholder="请输入统一社会信用代码" maxlength="64"/>
<el-input v-model="supFrom.supplierCode" placeholder="请输入统一社会信用代码" maxlength="64" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="厂家名称" prop="supplierName">
<el-input v-model="supFrom.supplierName" placeholder="请输入厂家名称" maxlength="128"/>
<el-input v-model="supFrom.supplierName" placeholder="请输入厂家名称" maxlength="128" />
</el-form-item>
</el-col>
</el-row>
@ -342,12 +375,12 @@
<el-row>
<el-col :span="12">
<el-form-item label="联系人" prop="contactPerson">
<el-input v-model="supFrom.contactPerson" placeholder="请输入联系人" maxlength="64"/>
<el-input v-model="supFrom.contactPerson" placeholder="请输入联系人" maxlength="64" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="联系电话" prop="contactPhone">
<el-input v-model="supFrom.contactPhone" placeholder="请输入联系电话" maxlength="11"/>
<el-input v-model="supFrom.contactPhone" placeholder="请输入联系电话" maxlength="11" />
</el-form-item>
</el-col>
</el-row>
@ -355,12 +388,12 @@
<el-row>
<el-col :span="12">
<el-form-item label="厂家地址" prop="address">
<el-input v-model="supFrom.address" placeholder="请输入厂家地址" maxlength="255"/>
<el-input v-model="supFrom.address" placeholder="请输入厂家地址" maxlength="255" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="资质/执照编号" prop="qualification">
<el-input v-model="supFrom.qualification" placeholder="请输入资质信息或执照编号" maxlength="255"/>
<el-input v-model="supFrom.qualification" placeholder="请输入资质信息或执照编号" maxlength="255" />
</el-form-item>
</el-col>
</el-row>
@ -368,8 +401,8 @@
<el-col :span="12">
<el-form-item label="状态" prop="status">
<el-select v-model="supFrom.status" placeholder="请选择状态" style="width: 100%">
<el-option label="启用" :value="1"/>
<el-option label="停用" :value="0"/>
<el-option label="启用" :value="1" />
<el-option label="停用" :value="0" />
</el-select>
</el-form-item>
</el-col>
@ -406,7 +439,7 @@ import {
fourthToSixthLevel,
getDeviceApi,
equipmentEditApiNew,
getEquipmentPropertyTypeApi
getEquipmentPropertyTypeApi,
} from '@/api/EquipmentEntryApply'
import { getManufacturerSelectApi } from '@/api/EquipmentLedger/index.js'
import ImageUpload from '@/components/ImageUpload'
@ -426,6 +459,8 @@ export default {
query: {},
showHouse: false,
pageTitle: '新增装备',
isEdit: false,
maId: null,
//
majorList: [],
processList: [],
@ -437,9 +472,9 @@ export default {
supplierName: [{ required: true, message: '厂家名称不能为空', trigger: 'blur' }],
contactPhone: [
{ required: false, message: '请输入联系电话', trigger: 'blur' },
{ pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/, message: '请输入正确的手机号码', trigger: 'blur' }
{ pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/, message: '请输入正确的手机号码', trigger: 'blur' },
],
status: [{ required: true, message: '请选择状态', trigger: 'change' }]
status: [{ required: true, message: '请选择状态', trigger: 'change' }],
},
form: {
major: '', //
@ -461,9 +496,10 @@ export default {
processFeature: '', //
categoryFeature: '', //
// deviceTypeList: [], //
mainFileList: [], //
certificateList: [], //
inspectionList: [] //
mainFileList: '', //
certificateList: '', //
inspectionList: '', //
purchaseInvoices: '', //
},
//
equipRules: {
@ -484,9 +520,9 @@ export default {
purchaseDate: [{ required: true, message: '请选择采购日期', trigger: 'change' }],
certificateList: [{ required: true, message: '请上传合格证', trigger: 'change' }],
inspectionList: [{ required: true, message: '请上传检测证书', trigger: 'change' }],
mainFileList: [{ required: true, message: '请上传图片', trigger: 'change' }]
mainFileList: [{ required: true, message: '请上传图片', trigger: 'change' }],
},
propertyVoList: [] //
propertyVoList: [], //
}
},
created() {
@ -501,37 +537,46 @@ export default {
// }
},
methods: {
openDialog(orderId) {
openDialog(id, type) {
if (type === 'edit') {
this.pageTitle = '编辑装备'
this.isEdit = true
this.maId = id
this.getInfo()
} else {
this.pageTitle = '新增装备'
this.isEdit = false
this.form.orderId = id
}
this.dialogVisible = true
this.firstLevel()
this.getManufacturerSelectList()
this.form.orderId = orderId
},
//
async getInfo() {
try {
const res = await getDeviceApi(this.query.maId)
const res = await getDeviceApi(this.maId)
console.log('🚀 ~ getInfo ~ res:', res)
this.form = res.data
Object.assign(this.form, res.data)
this.form.mainFileList = res.data.appearanceImages
? res.data.appearanceImages.map((item) => item.fileUrl).join(',')
: []
: ''
this.form.certificateList = res.data.certificates
? res.data.certificates.map((item) => item.fileUrl).join(',')
: []
: ''
this.form.inspectionList = res.data.inspectionReports
? res.data.inspectionReports.map((item) => item.fileUrl).join(',')
: []
: ''
this.form.purchaseInvoices = res.data.purchaseInvoices
? res.data.purchaseInvoices.map((item) => item.fileUrl).join(',')
: []
: ''
this.form.process = [String(res.data.mainProcessId), String(res.data.subProcessId)].filter(Boolean)
console.log('🚀 ~ getInfo ~ this.form.process:', this.form.process)
if (res.data.branchId) {
this.form.category = [
String(res.data.mainCategoryId),
String(res.data.subCategoryId),
String(res.data.branchId)
String(res.data.branchId),
].filter(Boolean)
} else {
this.form.category = [String(res.data.mainCategoryId), String(res.data.subCategoryId)].filter(Boolean)
@ -614,8 +659,8 @@ export default {
query: {
orderId: this.orderId,
isAddVisible: false,
isApprovalVisible: false
}
isApprovalVisible: false,
},
})
},
close() {
@ -625,8 +670,8 @@ export default {
query: {
orderId: this.orderId,
isAddVisible: false,
isApprovalVisible: false
}
isApprovalVisible: false,
},
})
})
},
@ -668,13 +713,13 @@ export default {
*/
async handleSubmit() {
console.log('🚀 ~ handleSubmit ~ this.form:', this.form, this.propertyVoList)
this.$refs['formRef'].validate(async(valid) => {
this.$refs['formRef'].validate(async (valid) => {
if (valid) {
if (this.isSubmit) return
this.isSubmit = true
const loading = this.$loading()
try {
if (!this.form.orderId) {
if (!this.form.orderId && !this.isEdit) {
const result = await getEquipmentAddIdApi()
this.orderId = result.data.id
this.form.orderId = this.orderId
@ -695,7 +740,7 @@ export default {
const parts = item.split('/')
return {
fileName: parts[parts.length - 1],
fileUrl: item
fileUrl: item,
}
})
console.log('🚀 ~ handleSubmit ~ appearanceImages:', appearanceImages)
@ -706,7 +751,7 @@ export default {
const parts = item.split('/')
return {
fileName: parts[parts.length - 1],
fileUrl: item
fileUrl: item,
}
})
console.log('🚀 ~ handleSubmit ~ certificates:', certificates)
@ -721,7 +766,7 @@ export default {
const parts = item.split('/')
return {
fileName: parts[parts.length - 1],
fileUrl: item
fileUrl: item,
}
})
console.log('🚀 ~ handleSubmit ~ inspectionReports:', inspectionReports)
@ -736,7 +781,7 @@ export default {
const parts = item.split('/')
return {
fileName: parts[parts.length - 1],
fileUrl: item
fileUrl: item,
}
})
console.log('🚀 ~ handleSubmit ~ purchaseInvoices:', purchaseInvoices)
@ -744,7 +789,7 @@ export default {
// propertyVoList propertyValue
if (this.propertyVoList && this.propertyVoList.length > 0) {
const unfilledIndex = this.propertyVoList.findIndex(
(item) => (!item.propertyValue || item.propertyValue === '') && item.mustHave != '0'
(item) => (!item.propertyValue || item.propertyValue === '') && item.mustHave != '0',
)
if (unfilledIndex !== -1) {
this.$message.warning(`${unfilledIndex + 1} 个特征项为必填项,请填写完整`)
@ -765,17 +810,17 @@ export default {
certificates,
inspectionReports,
purchaseInvoices,
propertyVoList: this.propertyVoList
propertyVoList: this.propertyVoList,
}
if (this.query && this.query.maId) {
params.maId = this.query.maId
if (this.maId) {
params.maId = this.maId
res = await equipmentEditApiNew(params)
} else {
res = await addInterDevice(params)
}
if (res.code === 200) {
this.dialogVisible = false
this.$emit('getList')
this.dialogVisible = false
this.$emit('getList')
if (!this.isEdit) {
this.$emit('handleSubmit')
}
} catch (error) {
@ -798,7 +843,7 @@ export default {
list.forEach((item) => {
map[item.value] = {
value: item.value.toString(),
label: item.label
label: item.label,
}
})
@ -836,7 +881,7 @@ export default {
return data.split(',').map((item) => {
return {
label: item,
value: item
value: item,
}
})
},
@ -844,7 +889,7 @@ export default {
this.showHouse = true
},
submitForm() {
this.$refs['supFrom'].validate(async(valid) => {
this.$refs['supFrom'].validate(async (valid) => {
if (valid) {
addFacturer(this.supFrom).then((response) => {
this.$modal.msgSuccess('新增成功')
@ -853,8 +898,8 @@ export default {
})
}
})
}
}
},
},
}
</script>