|
@@ -65,7 +65,7 @@
|
|
</Dialog>
|
|
</Dialog>
|
|
</template>
|
|
</template>
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
-import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
|
|
|
|
|
+import {DICT_TYPE, getIntDictOptions, getStrDictOptions} from '@/utils/dict'
|
|
import { defaultProps, handleTree } from '@/utils/tree'
|
|
import { defaultProps, handleTree } from '@/utils/tree'
|
|
import * as BomApi from '@/api/pms/bom'
|
|
import * as BomApi from '@/api/pms/bom'
|
|
import { CommonStatusEnum } from '@/utils/constants'
|
|
import { CommonStatusEnum } from '@/utils/constants'
|
|
@@ -73,6 +73,10 @@ import { useTreeStore } from '@/store/modules/treeStore';
|
|
import * as DeviceCategoryApi from '@/api/pms/productclassify'
|
|
import * as DeviceCategoryApi from '@/api/pms/productclassify'
|
|
import { FormRules } from 'element-plus'
|
|
import { FormRules } from 'element-plus'
|
|
import { defineEmits, ref } from 'vue';
|
|
import { defineEmits, ref } from 'vue';
|
|
|
|
+import { cloneDeep } from 'lodash-es'
|
|
|
|
+import { PropType } from 'vue'
|
|
|
|
+import { propTypes } from '@/utils/propTypes'
|
|
|
|
+import {copyValueToTarget} from "@/utils";
|
|
|
|
|
|
defineOptions({ name: 'BomForm' })
|
|
defineOptions({ name: 'BomForm' })
|
|
|
|
|
|
@@ -125,6 +129,11 @@ const open = async (type: string, id?: number) => {
|
|
dialogTitle.value = t('action.' + type)
|
|
dialogTitle.value = t('action.' + type)
|
|
formType.value = type
|
|
formType.value = type
|
|
resetForm()
|
|
resetForm()
|
|
|
|
+ // 获得 设备分类树
|
|
|
|
+ await getDeviceCategoryTree()
|
|
|
|
+ // 获得 bom 树
|
|
|
|
+ await getTree()
|
|
|
|
+ console.log('open方法执行了!')
|
|
// 修改时,设置数据
|
|
// 修改时,设置数据
|
|
if (id) {
|
|
if (id) {
|
|
formLoading.value = true
|
|
formLoading.value = true
|
|
@@ -134,10 +143,6 @@ const open = async (type: string, id?: number) => {
|
|
formLoading.value = false
|
|
formLoading.value = false
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- // 获得 设备分类树
|
|
|
|
- await getDeviceCategoryTree()
|
|
|
|
- // 获得 bom 树
|
|
|
|
- await getTree()
|
|
|
|
}
|
|
}
|
|
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
|
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
|
|
|
|
|
@@ -146,7 +151,6 @@ const emit = defineEmits(['success', 'node-click']) // 定义 success 树点击
|
|
/** 处理 设备分类 树 被点击 */
|
|
/** 处理 设备分类 树 被点击 */
|
|
const handleDeviceCategoryTreeNodeClick = async (row: { [key: string]: any }) => {
|
|
const handleDeviceCategoryTreeNodeClick = async (row: { [key: string]: any }) => {
|
|
emit('node-click', row)
|
|
emit('node-click', row)
|
|
- // treeStore.setSelectedId(row.id);
|
|
|
|
// 清空设备分类bom树的选择,重新查询筛选bom树
|
|
// 清空设备分类bom树的选择,重新查询筛选bom树
|
|
selfDeviceCategoryId.value = row.id
|
|
selfDeviceCategoryId.value = row.id
|
|
await getTree()
|
|
await getTree()
|