This commit is contained in:
bb_pan 2026-01-13 14:10:12 +08:00
parent 3c2ab029b2
commit 71b66ac8c5
5 changed files with 141 additions and 8 deletions

View File

@ -113,6 +113,11 @@
<el-input v-model="form.purchaseDate" placeholder="采购日期" readonly /> <el-input v-model="form.purchaseDate" placeholder="采购日期" readonly />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6">
<el-form-item label="产权单位" prop="propertyUnit">
<el-input v-model="form.propertyUnit" placeholder="产权单位" readonly />
</el-form-item>
</el-col>
</el-row> </el-row>
<div style="display: flex; padding-bottom: 10px"> <div style="display: flex; padding-bottom: 10px">

View File

@ -129,7 +129,7 @@
v-model="queryParams.propertyUnitIds" v-model="queryParams.propertyUnitIds"
placeholder="请选择产权单位" placeholder="请选择产权单位"
:options="propertyUnitList" :options="propertyUnitList"
:props="{ label: 'label', value: 'id', children: 'children' }" :props="{ label: 'label', value: 'id', children: 'children', checkStrictly: true }"
style="width: 100%" style="width: 100%"
@change="handleUnitChange" @change="handleUnitChange"
/> />

View File

@ -230,6 +230,20 @@
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6">
<el-form-item label="产权单位" prop="propertyUnitIds">
<el-cascader
clearable
v-model="form.propertyUnitIds"
placeholder="请选择产权单位"
:options="propertyUnitList"
:props="{ label: 'label', value: 'id', children: 'children', checkStrictly: true }"
style="width: 100%"
@change="handleUnitChange"
/>
</el-form-item>
</el-col>
</el-row> </el-row>
<div style="display: flex; padding-bottom: 10px"> <div style="display: flex; padding-bottom: 10px">
@ -445,6 +459,7 @@ import ImageUpload from '@/components/ImageUpload'
import FileUpload from '@/components/FileImageUpload' import FileUpload from '@/components/FileImageUpload'
import { handlePositiveNumberInput } from '@/utils/bonus.js' import { handlePositiveNumberInput } from '@/utils/bonus.js'
import { addFacturer } from '@/api/ma/supplier' import { addFacturer } from '@/api/ma/supplier'
import { deptTreeSelect } from '@/api/system/user'
export default { export default {
name: 'EquipmentEntryEditDialog', // name: 'EquipmentEntryEditDialog', //
@ -499,7 +514,10 @@ export default {
certificateList: '', // certificateList: '', //
inspectionList: '', // inspectionList: '', //
purchaseInvoices: '', // purchaseInvoices: '', //
propertyUnitIds: [], //
propertyUnitId: null, //
}, },
propertyUnitList: [], //
// //
equipRules: { equipRules: {
major: [{ required: true, message: '请选择专业', trigger: 'change' }], major: [{ required: true, message: '请选择专业', trigger: 'change' }],
@ -536,7 +554,8 @@ export default {
// } // }
}, },
methods: { methods: {
openDialog(id, type) { async openDialog(id, type) {
await this.getDeptTreeSelect()
if (type === 'edit') { if (type === 'edit') {
this.pageTitle = '编辑装备' this.pageTitle = '编辑装备'
this.isEdit = true this.isEdit = true
@ -571,6 +590,15 @@ export default {
: '' : ''
this.form.process = [String(res.data.mainProcessId), String(res.data.subProcessId)].filter(Boolean) this.form.process = [String(res.data.mainProcessId), String(res.data.subProcessId)].filter(Boolean)
console.log('🚀 ~ getInfo ~ this.form.process:', this.form.process) console.log('🚀 ~ getInfo ~ this.form.process:', this.form.process)
const ids = []
if (res.data?.parentId) {
ids.push(res.data.parentId)
}
if (res.data?.propertyUnitId) {
ids.push(res.data.propertyUnitId)
}
this.form.propertyUnitIds = [...ids.map(Number)]
if (res.data.branchId) { if (res.data.branchId) {
this.form.category = [ this.form.category = [
String(res.data.mainCategoryId), String(res.data.mainCategoryId),
@ -601,6 +629,28 @@ export default {
console.log('🚀 ~ getInfo ~ error:', error) console.log('🚀 ~ getInfo ~ error:', error)
} }
}, },
handleUnitChange(value) {
if (value.length === 0) {
this.form.propertyUnitId = undefined
return
}
this.form.propertyUnitId = value[value.length - 1]
},
//
async getDeptTreeSelect() {
const res = await deptTreeSelect()
this.propertyUnitList = this.filterTree(res.data)
},
filterTree(nodes) {
return nodes
.map((node) => {
if (node.children) {
node.children = this.filterTree(node.children)
}
return node
})
.filter((node) => node.status !== '1')
},
// //
getManufacturerSelectList() { getManufacturerSelectList() {
getManufacturerSelectApi().then((res) => { getManufacturerSelectApi().then((res) => {
@ -875,7 +925,7 @@ export default {
}, },
// //
handleData(data) { handleData(data) {
console.log('处理数据:', data) // console.log(':', data)
if (!data) return [] if (!data) return []
return data.split(',').map((item) => { return data.split(',').map((item) => {
return { return {
@ -964,7 +1014,7 @@ export default {
-webkit-transform: translate(-50%, -50%); -webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%); transform: translate(-50%, -50%);
text-align: center; text-align: center;
color: #C0C4CC; color: #c0c4cc;
} }
} }
</style> </style>

View File

@ -3,6 +3,17 @@
<div class="app-container"> <div class="app-container">
<el-card v-show="showSearch" style="margin-bottom: 20px"> <el-card v-show="showSearch" style="margin-bottom: 20px">
<el-form :model="queryParams" ref="queryForm" size="small" inline @submit.native.prevent> <el-form :model="queryParams" ref="queryForm" size="small" inline @submit.native.prevent>
<el-form-item label="产权单位" prop="propertyUnitIds">
<el-cascader
clearable
v-model="queryParams.propertyUnitIds"
placeholder="请选择产权单位"
:options="propertyUnitList"
:props="{ label: 'label', value: 'id', children: 'children', checkStrictly: true }"
style="width: 240px"
@change="handleUnitChange"
/>
</el-form-item>
<el-form-item label="工具专业" prop="fourthParentId"> <el-form-item label="工具专业" prop="fourthParentId">
<el-select <el-select
v-model="queryParams.fourthParentId" v-model="queryParams.fourthParentId"
@ -411,6 +422,7 @@ import { getListCodeApi, getToolSelectApi, updateByIdApi } from '@/api/toolsMana
import { getManufacturerSelectApi } from '@/api/EquipmentLedger' import { getManufacturerSelectApi } from '@/api/EquipmentLedger'
import { getToken } from '@/utils/auth' import { getToken } from '@/utils/auth'
import FileUpload from '@/components/FileImageUpload' import FileUpload from '@/components/FileImageUpload'
import { deptTreeSelect } from '@/api/system/user'
export default { export default {
name: 'CodeToolsLedger', name: 'CodeToolsLedger',
@ -431,7 +443,10 @@ export default {
parentTypeId: null, // parentTypeId: null, //
typeName: null, // typeName: null, //
toolCode: null, toolCode: null,
propertyUnitIds: null,
propertyUnitId: null,
}, },
propertyUnitList: [],
fourthParentList: [], fourthParentList: [],
greatGrandparentList: [], greatGrandparentList: [],
grandparentTypeList: [], grandparentTypeList: [],
@ -439,10 +454,10 @@ export default {
total: 0, // total: 0, //
// //
tableColumns: [ tableColumns: [
{ label: '产权单位', prop: 'companyName' ,width: 100}, { label: '产权单位', prop: 'companyName', width: 100 },
{ label: '工具专业', prop: 'fourthParentName', width: 100 }, { label: '工具专业', prop: 'fourthParentName', width: 100 },
{ label: '施工类型', prop: 'greatGrandparentName', width: 100 }, { label: '施工类型', prop: 'greatGrandparentName', width: 100 },
{ label: '工具类型', prop: 'grandparentTypeName' , width: 100}, { label: '工具类型', prop: 'grandparentTypeName', width: 100 },
{ label: '工具名称', prop: 'parentTypeName', width: 100 }, { label: '工具名称', prop: 'parentTypeName', width: 100 },
{ label: '规格型号', prop: 'typeName', width: 100 }, { label: '规格型号', prop: 'typeName', width: 100 },
{ label: '计量单位', prop: 'unitName', width: 100 }, { label: '计量单位', prop: 'unitName', width: 100 },
@ -452,7 +467,7 @@ export default {
{ label: '生产厂家', prop: 'supplierName', width: 100 }, { label: '生产厂家', prop: 'supplierName', width: 100 },
{ label: '出厂日期', prop: 'productionDate', width: 100 }, { label: '出厂日期', prop: 'productionDate', width: 100 },
{ label: '资产原值', prop: 'originCost', width: 100 }, { label: '资产原值', prop: 'originCost', width: 100 },
{ label: '原始编码', prop: 'identifyCode' , width: 100}, { label: '原始编码', prop: 'identifyCode', width: 100 },
], ],
// //
tableList: [], tableList: [],
@ -501,10 +516,34 @@ export default {
} }
}, },
created() { created() {
this.getDeptTreeSelect()
this.getList() this.getList()
this.getSelectList() this.getSelectList()
}, },
methods: { methods: {
handleUnitChange(value) {
if (value.length === 0) {
this.queryParams.propertyUnitId = undefined
return
}
this.queryParams.propertyUnitId = value[value.length - 1]
},
//
getDeptTreeSelect() {
deptTreeSelect().then((res) => {
this.propertyUnitList = this.filterTree(res.data)
})
},
filterTree(nodes) {
return nodes
.map((node) => {
if (node.children) {
node.children = this.filterTree(node.children)
}
return node
})
.filter((node) => node.status !== '1')
},
// //
handleImageChange(files) { handleImageChange(files) {
this.form.mainFileList = files this.form.mainFileList = files

View File

@ -9,6 +9,17 @@
<el-option label="数量工具" value="1"/> <el-option label="数量工具" value="1"/>
</el-select> </el-select>
</el-form-item> --> </el-form-item> -->
<el-form-item label="产权单位" prop="propertyUnitIds">
<el-cascader
clearable
v-model="queryParams.propertyUnitIds"
placeholder="请选择产权单位"
:options="propertyUnitList"
:props="{ label: 'label', value: 'id', children: 'children', checkStrictly: true }"
style="width: 240px"
@change="handleUnitChange"
/>
</el-form-item>
<el-form-item <el-form-item
label="工具类目" label="工具类目"
prop="typeIds" prop="typeIds"
@ -222,6 +233,7 @@ import {
getToolByOrderApi getToolByOrderApi
} from '@/api/toolsManage' } from '@/api/toolsManage'
import { getTreeSelectApi } from '@/api/toolsManage/index.js' import { getTreeSelectApi } from '@/api/toolsManage/index.js'
import { deptTreeSelect } from '@/api/system/user'
export default { export default {
name: 'ToolsLedger', name: 'ToolsLedger',
@ -246,8 +258,11 @@ export default {
typeName: null, // typeName: null, //
manageMode: '1', manageMode: '1',
typeId: null, typeId: null,
typeIds: null typeIds: null,
propertyUnitIds: null,
propertyUnitId: null,
}, },
propertyUnitList: [],
toolCascaderProps: { toolCascaderProps: {
value: 'typeId', value: 'typeId',
label: 'typeName', label: 'typeName',
@ -381,11 +396,35 @@ export default {
} }
}, },
created() { created() {
this.getDeptTreeSelect()
this.getList() this.getList()
this.getSelectList() this.getSelectList()
this.getToolTree() this.getToolTree()
}, },
methods: { methods: {
handleUnitChange(value) {
if (value.length === 0) {
this.queryParams.propertyUnitId = undefined
return
}
this.queryParams.propertyUnitId = value[value.length - 1]
},
//
getDeptTreeSelect() {
deptTreeSelect().then((res) => {
this.propertyUnitList = this.filterTree(res.data)
})
},
filterTree(nodes) {
return nodes
.map((node) => {
if (node.children) {
node.children = this.filterTree(node.children)
}
return node
})
.filter((node) => node.status !== '1')
},
// //
handleQuery() { handleQuery() {
this.queryParams.pageNum = 1 this.queryParams.pageNum = 1