Compare commits
2 Commits
4c8a3b31f1
...
53f61e4dfa
| Author | SHA1 | Date |
|---|---|---|
|
|
53f61e4dfa | |
|
|
d13067b353 |
|
|
@ -296,7 +296,15 @@
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="使用年限" prop="serviceLife">
|
<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-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
|
|
@ -311,7 +319,7 @@
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<!-- <el-col :span="8">
|
||||||
<el-form-item label="特征项" prop="featureItem">
|
<el-form-item label="特征项" prop="featureItem">
|
||||||
<el-input v-model="queryParams.featureItem" placeholder="请输入特征项" clearable/>
|
<el-input v-model="queryParams.featureItem" placeholder="请输入特征项" clearable/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
@ -320,7 +328,7 @@
|
||||||
<el-form-item label="特征值" prop="featureValue">
|
<el-form-item label="特征值" prop="featureValue">
|
||||||
<el-input v-model="queryParams.featureValue" placeholder="请输入特征值" clearable/>
|
<el-input v-model="queryParams.featureValue" placeholder="请输入特征值" clearable/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col> -->
|
||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
@ -895,6 +903,7 @@ import AddEquip from '@/views/stockManagement/entryApply/components/AddEquip'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'EquipmentLedger',
|
name: 'EquipmentLedger',
|
||||||
|
dicts: ['user_year_type'],
|
||||||
components: { AddEquip, QrcodeGenerator },
|
components: { AddEquip, QrcodeGenerator },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|
@ -1230,10 +1239,10 @@ export default {
|
||||||
* 重置查询条件
|
* 重置查询条件
|
||||||
*/
|
*/
|
||||||
resetQuery() {
|
resetQuery() {
|
||||||
this.$refs.queryForm.resetFields()
|
this.queryParams.minOriginalValue = undefined
|
||||||
this.queryParams.minOriginalValue = ''
|
this.queryParams.maxOriginalValue = undefined
|
||||||
this.queryParams.maxOriginalValue = ''
|
|
||||||
this.queryParams.propertyUnitId = undefined
|
this.queryParams.propertyUnitId = undefined
|
||||||
|
this.$refs.queryForm.resetFields()
|
||||||
this.queryParams.pageNum = 1
|
this.queryParams.pageNum = 1
|
||||||
this.getDeviceList()
|
this.getDeviceList()
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -856,15 +856,7 @@ 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 = []
|
this.form.propertyUnitIds = this.findParentsTailRecursive(this.propertyUnitList,res.data.propertyUnitId)
|
||||||
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),
|
||||||
|
|
@ -895,6 +887,24 @@ export default {
|
||||||
console.log('🚀 ~ getInfo ~ error:', error)
|
console.log('🚀 ~ getInfo ~ error:', error)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
//根据树形数据中的id获取所有父级id
|
||||||
|
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) {
|
handleUnitChange(value) {
|
||||||
if (value.length === 0) {
|
if (value.length === 0) {
|
||||||
this.form.propertyUnitId = undefined
|
this.form.propertyUnitId = undefined
|
||||||
|
|
|
||||||
|
|
@ -260,6 +260,18 @@
|
||||||
style="width: 240px"
|
style="width: 240px"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</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-form-item label="原始编码" prop="identifyCode">
|
||||||
<el-input v-model="dialogForm.identifyCode" maxlength="999" style="width: 240px" />
|
<el-input v-model="dialogForm.identifyCode" maxlength="999" style="width: 240px" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
@ -500,6 +512,7 @@ export default {
|
||||||
identifyCode: '',
|
identifyCode: '',
|
||||||
nextCheckDate: '',
|
nextCheckDate: '',
|
||||||
statusName: '',
|
statusName: '',
|
||||||
|
propertyUnitIds:[],
|
||||||
propertyVoList: [],
|
propertyVoList: [],
|
||||||
// fileList: [], // 初始化文件列表为数组
|
// fileList: [], // 初始化文件列表为数组
|
||||||
certificateList: '',
|
certificateList: '',
|
||||||
|
|
@ -532,20 +545,46 @@ export default {
|
||||||
await this.getDeptTreeSelect().catch(() => {})
|
await this.getDeptTreeSelect().catch(() => {})
|
||||||
const params = this.$route.query
|
const params = this.$route.query
|
||||||
this.queryParams.propertyUnitId = params?.deptId || ''
|
this.queryParams.propertyUnitId = params?.deptId || ''
|
||||||
const ids = []
|
// const ids = []
|
||||||
if (params?.parentId) {
|
// if (params?.parentId) {
|
||||||
ids.push(params.parentId)
|
// ids.push(params.parentId)
|
||||||
}
|
// }
|
||||||
if (params?.deptId) {
|
// if (params?.deptId) {
|
||||||
ids.push(params.deptId)
|
// ids.push(params.deptId)
|
||||||
}
|
// }
|
||||||
this.queryParams.propertyUnitIds = [...ids.map(Number)]
|
// this.queryParams.propertyUnitIds = [...ids.map(Number)]
|
||||||
|
this.queryParams.propertyUnitIds = this.findParentsTailRecursive(this.propertyUnitList,params.deptId)
|
||||||
this.getList()
|
this.getList()
|
||||||
this.getSelectList()
|
this.getSelectList()
|
||||||
|
|
||||||
this.columns2 = [...this.tableColumns];
|
this.columns2 = [...this.tableColumns];
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
//根据树形数据中的id获取所有父级id
|
||||||
|
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) {
|
handleUnitChange(value) {
|
||||||
if (value.length === 0) {
|
if (value.length === 0) {
|
||||||
this.queryParams.propertyUnitId = undefined
|
this.queryParams.propertyUnitId = undefined
|
||||||
|
|
@ -600,6 +639,8 @@ export default {
|
||||||
this.queryParams.pageSize = 10
|
this.queryParams.pageSize = 10
|
||||||
this.queryParams.parentId = '0'
|
this.queryParams.parentId = '0'
|
||||||
this.queryParams.level = '1'
|
this.queryParams.level = '1'
|
||||||
|
this.queryParams.propertyUnitIds = null;
|
||||||
|
this.queryParams.propertyUnitId = null;
|
||||||
this.$refs.queryForm.resetFields()
|
this.$refs.queryForm.resetFields()
|
||||||
this.getList()
|
this.getList()
|
||||||
},
|
},
|
||||||
|
|
@ -737,6 +778,7 @@ export default {
|
||||||
propertyValue: '',
|
propertyValue: '',
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
this.dialogForm.propertyUnitIds = this.findParentsTailRecursive(this.propertyUnitList,row.propertyUnitId)
|
||||||
|
|
||||||
if (this.dialogForm.certificates && this.dialogForm.certificates.length > 0) {
|
if (this.dialogForm.certificates && this.dialogForm.certificates.length > 0) {
|
||||||
this.dialogForm.certificateList = this.dialogForm.certificates.map((item) => item.fileUrl).join(',')
|
this.dialogForm.certificateList = this.dialogForm.certificates.map((item) => item.fileUrl).join(',')
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue