Compare commits

..

2 Commits

3 changed files with 84 additions and 23 deletions

View File

@ -296,7 +296,15 @@
</el-col>
<el-col :span="8">
<el-form-item label="使用年限" prop="serviceLife">
<el-input v-model="queryParams.serviceLife" placeholder="请输入使用年限" clearable/>
<!-- <el-input v-model="queryParams.serviceLife" placeholder="请输入使用年限" clearable/> -->
<el-select v-model="queryParams.serviceLife" placeholder="请选择使用年限" clearable style="width: 100%;">
<el-option
v-for="dict in dict.type.user_year_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
@ -311,7 +319,7 @@
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<!-- <el-col :span="8">
<el-form-item label="特征项" prop="featureItem">
<el-input v-model="queryParams.featureItem" placeholder="请输入特征项" clearable/>
</el-form-item>
@ -320,7 +328,7 @@
<el-form-item label="特征值" prop="featureValue">
<el-input v-model="queryParams.featureValue" placeholder="请输入特征值" clearable/>
</el-form-item>
</el-col>
</el-col> -->
</el-row>
</div>
</el-form>
@ -895,6 +903,7 @@ import AddEquip from '@/views/stockManagement/entryApply/components/AddEquip'
export default {
name: 'EquipmentLedger',
dicts: ['user_year_type'],
components: { AddEquip, QrcodeGenerator },
data() {
return {
@ -1230,10 +1239,10 @@ export default {
* 重置查询条件
*/
resetQuery() {
this.$refs.queryForm.resetFields()
this.queryParams.minOriginalValue = ''
this.queryParams.maxOriginalValue = ''
this.queryParams.minOriginalValue = undefined
this.queryParams.maxOriginalValue = undefined
this.queryParams.propertyUnitId = undefined
this.$refs.queryForm.resetFields()
this.queryParams.pageNum = 1
this.getDeviceList()
},

View File

@ -856,15 +856,7 @@ 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)]
this.form.propertyUnitIds = this.findParentsTailRecursive(this.propertyUnitList,res.data.propertyUnitId)
if (res.data.branchId) {
this.form.category = [
String(res.data.mainCategoryId),
@ -895,6 +887,24 @@ export default {
console.log('🚀 ~ getInfo ~ error:', error)
}
},
//idid
findParentsTailRecursive(tree, id, parents = [], index = 0) {
if (index >= tree.length) {
return null;
}
const currentNode = tree[index];
const updatedParents = parents.concat(currentNode.id);
if (currentNode.id=== id) {
return updatedParents;
}
if (currentNode.children) {
const result =this.findParentsTailRecursive(currentNode.children, id, updatedParents);
if (result) {
return result; //
}
}
return this.findParentsTailRecursive(tree, id, parents, index + 1);
},
handleUnitChange(value) {
if (value.length === 0) {
this.form.propertyUnitId = undefined

View File

@ -260,6 +260,18 @@
style="width: 240px"
/>
</el-form-item>
<el-form-item label="产权单位" prop="propertyUnitIds">
<el-cascader
clearable
v-model="dialogForm.propertyUnitIds"
placeholder="请选择产权单位"
:options="propertyUnitList"
:props="{ label: 'label', value: 'id', children: 'children', checkStrictly: true }"
style="width: 100%"
@change="handleUnitChange2"
/>
</el-form-item>
<el-form-item label="原始编码" prop="identifyCode">
<el-input v-model="dialogForm.identifyCode" maxlength="999" style="width: 240px" />
</el-form-item>
@ -500,6 +512,7 @@ export default {
identifyCode: '',
nextCheckDate: '',
statusName: '',
propertyUnitIds:[],
propertyVoList: [],
// fileList: [], //
certificateList: '',
@ -532,20 +545,46 @@ export default {
await this.getDeptTreeSelect().catch(() => {})
const params = this.$route.query
this.queryParams.propertyUnitId = params?.deptId || ''
const ids = []
if (params?.parentId) {
ids.push(params.parentId)
}
if (params?.deptId) {
ids.push(params.deptId)
}
this.queryParams.propertyUnitIds = [...ids.map(Number)]
// const ids = []
// if (params?.parentId) {
// ids.push(params.parentId)
// }
// if (params?.deptId) {
// ids.push(params.deptId)
// }
// this.queryParams.propertyUnitIds = [...ids.map(Number)]
this.queryParams.propertyUnitIds = this.findParentsTailRecursive(this.propertyUnitList,params.deptId)
this.getList()
this.getSelectList()
this.columns2 = [...this.tableColumns];
},
methods: {
//idid
findParentsTailRecursive(tree, id, parents = [], index = 0) {
if (index >= tree.length) {
return null;
}
const currentNode = tree[index];
const updatedParents = parents.concat(currentNode.id);
if (currentNode.id== id) {
return updatedParents;
}
if (currentNode.children) {
const result =this.findParentsTailRecursive(currentNode.children, id, updatedParents);
if (result) {
return result; //
}
}
return this.findParentsTailRecursive(tree, id, parents, index + 1);
},
handleUnitChange2(value) {
if (value.length === 0) {
this.dialogForm.propertyUnitId = undefined
return
}
this.dialogForm.propertyUnitId = value[value.length - 1]
},
handleUnitChange(value) {
if (value.length === 0) {
this.queryParams.propertyUnitId = undefined
@ -600,6 +639,8 @@ export default {
this.queryParams.pageSize = 10
this.queryParams.parentId = '0'
this.queryParams.level = '1'
this.queryParams.propertyUnitIds = null;
this.queryParams.propertyUnitId = null;
this.$refs.queryForm.resetFields()
this.getList()
},
@ -737,6 +778,7 @@ export default {
propertyValue: '',
})
}
this.dialogForm.propertyUnitIds = this.findParentsTailRecursive(this.propertyUnitList,row.propertyUnitId)
if (this.dialogForm.certificates && this.dialogForm.certificates.length > 0) {
this.dialogForm.certificateList = this.dialogForm.certificates.map((item) => item.fileUrl).join(',')