From e93d241d51765e701d89cd7f6f4088c6cb22949b Mon Sep 17 00:00:00 2001
From: 马宇豪 <978517621@qq.com>
Date: 星期五, 21 四月 2023 16:51:47 +0800
Subject: [PATCH] 修改
---
src/views/facilityManagement/goodsDetailManage/components/goodsDetailEdit.vue | 45 +++++++++++++++++++++++----------------------
1 files changed, 23 insertions(+), 22 deletions(-)
diff --git a/src/views/facilityManagement/goodsDetailManage/components/goodsDetailEdit.vue b/src/views/facilityManagement/goodsDetailManage/components/goodsDetailEdit.vue
index 3fe4fd8..49b87ce 100644
--- a/src/views/facilityManagement/goodsDetailManage/components/goodsDetailEdit.vue
+++ b/src/views/facilityManagement/goodsDetailManage/components/goodsDetailEdit.vue
@@ -13,22 +13,22 @@
<el-col :span="24" class="mb20">
<el-form-item label="选择物资" prop="smId">
<el-row :gutter="6">
- <el-col :span="8">
- <el-select
- filterable
- placeholder="请选择部门"
- clearable
- @change="changeDepartment"
- v-model="goodsDetailEditState.depId">
- <el-option
- v-for="item in goodsDetailEditState.departmentList"
- :key="item.depId"
- :value="item.depId"
- :label="item.depName"
- ></el-option>
- </el-select>
- </el-col>
- <el-col :span="8">
+<!-- <el-col :span="8">-->
+<!-- <el-select-->
+<!-- filterable-->
+<!-- placeholder="请选择部门"-->
+<!-- clearable-->
+<!-- @change="changeDepartment"-->
+<!-- v-model="goodsDetailEditState.depId">-->
+<!-- <el-option-->
+<!-- v-for="item in goodsDetailEditState.departmentList"-->
+<!-- :key="item.depId"-->
+<!-- :value="item.depId"-->
+<!-- :label="item.depName"-->
+<!-- ></el-option>-->
+<!-- </el-select>-->
+<!-- </el-col>-->
+ <el-col :span="12">
<el-select v-model="goodsDetailEditState.classifyId" placeholder="选择分类" @change="changeClassify" filterable clearable>
<el-option
v-for="item in goodsDetailEditState.classifyList"
@@ -38,7 +38,7 @@
></el-option>
</el-select>
</el-col>
- <el-col :span="8">
+ <el-col :span="12">
<el-select v-model="goodsDetailEditState.goodsDetailForm.smId" placeholder="选择物资" filterable clearable>
<el-option
v-for="item in goodsDetailEditState.goodsList"
@@ -101,8 +101,10 @@
import {isValidKey} from "/@/views/facilityManagement/safetyGoodsAndEquipment/index";
import {ElMessage} from "element-plus/es";
import {goodsDetailApi} from "/@/api/facilityManagement/goodsDetailManage";
+import {useUserInfo} from "/@/stores/userInfo";
const goodsDetailFormRef = ref()
+const userInfo = useUserInfo()
const goodsDetailEditState = reactive<GoodsDetailEditType>({
title: '编辑',
@@ -128,7 +130,6 @@
})
// watch(() => goodsDetailEditState.depId ,(newVal, oldVal) => {
-// debugger
// goodsDetailEditState.classify = null
// goodsDetailEditState.goodsDetailForm.smId = null
// goodsDetailEditState.classifyList = goodsDetailEditState.departmentList.find(item => item.depId === newVal)?.classificationList as Array<ClassificationListType>
@@ -140,7 +141,7 @@
setTimeout(() => {
goodsDetailFormRef.value.clearValidate();
});
- await changeDepartment(value.depId)
+ await changeDepartment(userInfo.userInfos.depId)
await changeClassify(value.bigClassifyId)
goodsDetailEditState.depId = value.depId
goodsDetailEditState.classifyId = value.bigClassifyId
@@ -149,14 +150,14 @@
goodsDetailEditState.goodsDetailForm[i] = value[i];
}
}
-
-
}
const changeDepartment = (value: number | null) => {
goodsDetailEditState.classifyId = null
goodsDetailEditState.goodsDetailForm.smId = null
- goodsDetailEditState.classifyList = goodsDetailEditState.departmentList.find(item => item.depId === value)?.classificationList as Array<ClassificationListType>
+ goodsDetailEditState.classifyList = JSON.parse(JSON.stringify(
+ (goodsDetailEditState.departmentList.find(item => item.depId === value) ?? {classificationList:[]})?.classificationList as Array<ClassificationListType>
+ ))
}
const changeClassify = (value: number | null) => {
--
Gitblit v1.9.2