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-form-item>
</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>
<div style="display: flex; padding-bottom: 10px">

View File

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

View File

@ -230,6 +230,20 @@
</el-date-picker>
</el-form-item>
</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>
<div style="display: flex; padding-bottom: 10px">
@ -445,6 +459,7 @@ import ImageUpload from '@/components/ImageUpload'
import FileUpload from '@/components/FileImageUpload'
import { handlePositiveNumberInput } from '@/utils/bonus.js'
import { addFacturer } from '@/api/ma/supplier'
import { deptTreeSelect } from '@/api/system/user'
export default {
name: 'EquipmentEntryEditDialog', //
@ -499,7 +514,10 @@ export default {
certificateList: '', //
inspectionList: '', //
purchaseInvoices: '', //
propertyUnitIds: [], //
propertyUnitId: null, //
},
propertyUnitList: [], //
//
equipRules: {
major: [{ required: true, message: '请选择专业', trigger: 'change' }],
@ -536,7 +554,8 @@ export default {
// }
},
methods: {
openDialog(id, type) {
async openDialog(id, type) {
await this.getDeptTreeSelect()
if (type === 'edit') {
this.pageTitle = '编辑装备'
this.isEdit = true
@ -571,6 +590,15 @@ export default {
: ''
this.form.process = [String(res.data.mainProcessId), String(res.data.subProcessId)].filter(Boolean)
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) {
this.form.category = [
String(res.data.mainCategoryId),
@ -601,6 +629,28 @@ export default {
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() {
getManufacturerSelectApi().then((res) => {
@ -875,7 +925,7 @@ export default {
},
//
handleData(data) {
console.log('处理数据:', data)
// console.log(':', data)
if (!data) return []
return data.split(',').map((item) => {
return {
@ -964,7 +1014,7 @@ export default {
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
text-align: center;
color: #C0C4CC;
color: #c0c4cc;
}
}
</style>

View File

@ -3,6 +3,17 @@
<div class="app-container">
<el-card v-show="showSearch" style="margin-bottom: 20px">
<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-select
v-model="queryParams.fourthParentId"
@ -411,6 +422,7 @@ import { getListCodeApi, getToolSelectApi, updateByIdApi } from '@/api/toolsMana
import { getManufacturerSelectApi } from '@/api/EquipmentLedger'
import { getToken } from '@/utils/auth'
import FileUpload from '@/components/FileImageUpload'
import { deptTreeSelect } from '@/api/system/user'
export default {
name: 'CodeToolsLedger',
@ -431,7 +443,10 @@ export default {
parentTypeId: null, //
typeName: null, //
toolCode: null,
propertyUnitIds: null,
propertyUnitId: null,
},
propertyUnitList: [],
fourthParentList: [],
greatGrandparentList: [],
grandparentTypeList: [],
@ -439,10 +454,10 @@ export default {
total: 0, //
//
tableColumns: [
{ label: '产权单位', prop: 'companyName' ,width: 100},
{ label: '产权单位', prop: 'companyName', width: 100 },
{ label: '工具专业', prop: 'fourthParentName', width: 100 },
{ label: '施工类型', prop: 'greatGrandparentName', width: 100 },
{ label: '工具类型', prop: 'grandparentTypeName' , width: 100},
{ label: '工具类型', prop: 'grandparentTypeName', width: 100 },
{ label: '工具名称', prop: 'parentTypeName', width: 100 },
{ label: '规格型号', prop: 'typeName', width: 100 },
{ label: '计量单位', prop: 'unitName', width: 100 },
@ -452,7 +467,7 @@ export default {
{ label: '生产厂家', prop: 'supplierName', width: 100 },
{ label: '出厂日期', prop: 'productionDate', width: 100 },
{ label: '资产原值', prop: 'originCost', width: 100 },
{ label: '原始编码', prop: 'identifyCode' , width: 100},
{ label: '原始编码', prop: 'identifyCode', width: 100 },
],
//
tableList: [],
@ -501,10 +516,34 @@ export default {
}
},
created() {
this.getDeptTreeSelect()
this.getList()
this.getSelectList()
},
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) {
this.form.mainFileList = files

View File

@ -9,6 +9,17 @@
<el-option label="数量工具" value="1"/>
</el-select>
</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
label="工具类目"
prop="typeIds"
@ -222,6 +233,7 @@ import {
getToolByOrderApi
} from '@/api/toolsManage'
import { getTreeSelectApi } from '@/api/toolsManage/index.js'
import { deptTreeSelect } from '@/api/system/user'
export default {
name: 'ToolsLedger',
@ -246,8 +258,11 @@ export default {
typeName: null, //
manageMode: '1',
typeId: null,
typeIds: null
typeIds: null,
propertyUnitIds: null,
propertyUnitId: null,
},
propertyUnitList: [],
toolCascaderProps: {
value: 'typeId',
label: 'typeName',
@ -381,11 +396,35 @@ export default {
}
},
created() {
this.getDeptTreeSelect()
this.getList()
this.getSelectList()
this.getToolTree()
},
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() {
this.queryParams.pageNum = 1