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/goodsDetailAdd.vue | 58 ++++++++++++++++++++++++++++++++--------------------------
1 files changed, 32 insertions(+), 26 deletions(-)
diff --git a/src/views/facilityManagement/goodsDetailManage/components/goodsDetailAdd.vue b/src/views/facilityManagement/goodsDetailManage/components/goodsDetailAdd.vue
index 8004175..aa1b3f2 100644
--- a/src/views/facilityManagement/goodsDetailManage/components/goodsDetailAdd.vue
+++ b/src/views/facilityManagement/goodsDetailManage/components/goodsDetailAdd.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="goodsDetailAddState.depId">
- <el-option
- v-for="item in goodsDetailAddState.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="goodsDetailAddState.depId">-->
+<!-- <el-option-->
+<!-- v-for="item in goodsDetailAddState.departmentList"-->
+<!-- :key="item.depId"-->
+<!-- :value="item.depId"-->
+<!-- :label="item.depName"-->
+<!-- ></el-option>-->
+<!-- </el-select>-->
+<!-- </el-col>-->
+ <el-col :span="12">
<el-select v-model="goodsDetailAddState.classifyId" placeholder="选择分类" @change="changeClassify" filterable clearable>
<el-option
v-for="item in goodsDetailAddState.classifyList"
@@ -38,7 +38,7 @@
></el-option>
</el-select>
</el-col>
- <el-col :span="8">
+ <el-col :span="12">
<el-select v-model="goodsDetailAddState.goodsDetailForm.smId" placeholder="选择物资" filterable clearable>
<el-option
v-for="item in goodsDetailAddState.goodsList"
@@ -130,8 +130,10 @@
import {ElMessage} from "element-plus/es";
import {goodsDetailApi} from "/@/api/facilityManagement/goodsDetailManage";
import {verifiyNumberInteger, verifyString} from "/@/utils/toolsValidate";
+import {useUserInfo} from "/@/stores/userInfo";
const goodsDetailFormRef = ref()
+const userInfo = useUserInfo()
const goodsDetailAddState = reactive<GoodsDetailAddType>({
title: '新增入库',
@@ -174,8 +176,8 @@
setTimeout(() => {
goodsDetailFormRef.value.clearValidate();
});
- goodsDetailAddState.startRfid = ''
- goodsDetailAddState.endRfid = ''
+ goodsDetailAddState.startRfid = '';
+ goodsDetailAddState.endRfid = '';
goodsDetailAddState.goodsDetailForm = {
id: null,
smId: null,
@@ -184,18 +186,22 @@
startRfid: null,
endRfid: null ,
wareHousingCount: null,
- }
+ };
+ goodsDetailAddState.classifyList = goodsDetailAddState.departmentList.find(item => item.depId === userInfo.userInfos.depId)
+ ?.classificationList as Array<ClassificationListType>
}
-const changeDepartment = (value: number | null) => {
- goodsDetailAddState.classifyId = null
- goodsDetailAddState.goodsDetailForm.smId = null
- goodsDetailAddState.classifyList = goodsDetailAddState.departmentList.find(item => item.depId === value)?.classificationList as Array<ClassificationListType>
-}
+// const changeDepartment = (value: number | null) => {
+// goodsDetailAddState.classifyId = null
+// goodsDetailAddState.goodsDetailForm.smId = null
+// goodsDetailAddState.classifyList = goodsDetailAddState.departmentList.find(item => item.depId === value)?.classificationList as Array<ClassificationListType>
+// }
const changeClassify = (value: number | null) => {
goodsDetailAddState.goodsDetailForm.smId = null
- goodsDetailAddState.goodsList = goodsDetailAddState.classifyList.find(item => item.materialClassifyId === value)?.baseMaterialList as Array<BaseMaterialListType>
+ goodsDetailAddState.goodsList = JSON.parse(JSON.stringify(
+ (goodsDetailAddState.classifyList.find(item => item.materialClassifyId === value) ?? {baseMaterialList:[]})?.baseMaterialList as Array<BaseMaterialListType>
+ ))
}
const submitGoodsDetail = () => {
--
Gitblit v1.9.2