diff --git a/src/views/EquipmentLedger/index.vue b/src/views/EquipmentLedger/index.vue
index 1867998d..05335b95 100644
--- a/src/views/EquipmentLedger/index.vue
+++ b/src/views/EquipmentLedger/index.vue
@@ -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"
/>
diff --git a/src/views/stockManagement/entryApply/components/AddEquip.vue b/src/views/stockManagement/entryApply/components/AddEquip.vue
index 50f0fe66..1f0d9545 100644
--- a/src/views/stockManagement/entryApply/components/AddEquip.vue
+++ b/src/views/stockManagement/entryApply/components/AddEquip.vue
@@ -230,6 +230,20 @@
+
+
@@ -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;
}
}
diff --git a/src/views/toolsManage/codeToolsLedger/index.vue b/src/views/toolsManage/codeToolsLedger/index.vue
index 1e2b9e99..0a2f7d46 100644
--- a/src/views/toolsManage/codeToolsLedger/index.vue
+++ b/src/views/toolsManage/codeToolsLedger/index.vue
@@ -3,6 +3,17 @@
+
+
+
{
+ 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
diff --git a/src/views/toolsManage/toolsLedger/index.vue b/src/views/toolsManage/toolsLedger/index.vue
index df227ccc..d61d0743 100644
--- a/src/views/toolsManage/toolsLedger/index.vue
+++ b/src/views/toolsManage/toolsLedger/index.vue
@@ -9,6 +9,17 @@
-->
+
+
+
{
+ 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