From e3d63f84a43db07fa5992de2937ee23fc67bad38 Mon Sep 17 00:00:00 2001 From: Your Name <123456> Date: 星期五, 06 一月 2023 16:43:58 +0800 Subject: [PATCH] 物资 --- src/views/facilityManagement/safetyGoodsAndEquipment/components/safetyGoodsAndEquipmentDialog.vue | 73 ++++++++++++++++++++++-------------- 1 files changed, 45 insertions(+), 28 deletions(-) diff --git a/src/views/facilityManagement/safetyGoodsAndEquipment/components/safetyGoodsAndEquipmentDialog.vue b/src/views/facilityManagement/safetyGoodsAndEquipment/components/safetyGoodsAndEquipmentDialog.vue index 4ace281..54fc08e 100644 --- a/src/views/facilityManagement/safetyGoodsAndEquipment/components/safetyGoodsAndEquipmentDialog.vue +++ b/src/views/facilityManagement/safetyGoodsAndEquipment/components/safetyGoodsAndEquipmentDialog.vue @@ -10,7 +10,7 @@ element-loading-text="Loading..." label-width="120px"> <el-row> - <el-col :span="18" class="mb20"> + <el-col :span="24" class="mb20"> <el-form-item label="物资大类" prop="bigClassifyId"> <el-select v-model="dialogState.safetyGoodsAndEquipmentForm.bigClassifyId" @change="changeSmallClassify(null)" placeholder="物资大类" class="input-add"> <el-option @@ -22,10 +22,9 @@ </el-select> </el-form-item> </el-col> - <el-col :span="5"> - <el-button type="primary" @click="openAddGoods">添加物资</el-button> - </el-col> - +<!-- <el-col :span="5">--> +<!-- <el-button type="primary" @click="openAddGoods">添加物资</el-button>--> +<!-- </el-col>--> <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> <el-form-item label="物资小类" prop="smallClassifyId"> <el-select class="input-add" v-model="dialogState.safetyGoodsAndEquipmentForm.smallClassifyId" placeholder="请先选择物资大类"> @@ -42,6 +41,7 @@ <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> <el-form-item label="部门" prop="depId"> <el-cascader + :disabled="true" :options="dialogState.departmentList" :props="{ emitPath: false, checkStrictly: true, value: 'depId', label: 'depName' }" placeholder="请选择部门" @@ -51,19 +51,19 @@ </el-cascader> </el-form-item> </el-col> - <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> - <el-form-item label="是否耗材" prop="consumable"> - <el-select class="input-add" v-model="dialogState.safetyGoodsAndEquipmentForm.consumable" placeholder="是否耗材" clearable filterable> - <el-option - v-for="item in dialogState.consumableList" - :key="item.id" - :value="item.id" - :label="item.name" - > - </el-option> - </el-select> - </el-form-item> - </el-col> +<!-- <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">--> +<!-- <el-form-item label="是否耗材" prop="consumable">--> +<!-- <el-select class="input-add" v-model="dialogState.safetyGoodsAndEquipmentForm.consumable" placeholder="是否耗材" clearable filterable>--> +<!-- <el-option--> +<!-- v-for="item in dialogState.consumableList"--> +<!-- :key="item.id"--> +<!-- :value="item.id"--> +<!-- :label="item.name"--> +<!-- >--> +<!-- </el-option>--> +<!-- </el-select>--> +<!-- </el-form-item>--> +<!-- </el-col>--> </el-row> </el-form> <template #footer> @@ -73,7 +73,7 @@ </span> </template> </el-dialog> - <add-goods-dialog ref="addGoodsDialogRef"></add-goods-dialog> + <add-goods-dialog ref="addGoodsDialogRef" @refreshClassify="getAllSafetyEquipmentList"></add-goods-dialog> </div> </template> @@ -88,9 +88,11 @@ import { goodsAndEquipmentApi } from "/@/api/facilityManagement/safetyGoodsAndEquipment"; import {ElMessage} from "element-plus"; import AddGoodsDialog from "./addGoodsDialog.vue"; +import {useUserInfo} from "/@/stores/userInfo"; const safetyGoodsAndEquipmentRef = ref(); -const addGoodsDialogRef = ref() +const addGoodsDialogRef = ref(); +const userInfo = useUserInfo() const dialogState = reactive<SafetyGoodsAndEquipmentDialogStateType>({ safetyGoodsAndEquipmentForm: { @@ -98,13 +100,13 @@ bigClassifyId: null, smallClassifyId: null, depId: null, - consumable: null, + // consumable: null, }, safetyGoodsAndEquipmentRules: { bigClassifyId: [{ required: true, message: '请选择物资大类', trigger: 'change' }], smallClassifyId: [{ required: true, message: '请选择物资小类', trigger: 'change' }], - depId: [{ required: true, message: '请选择部门', trigger: 'change' }], - consumable: [{ required: true, message: '请选择是否耗材', trigger: 'change' }], + // depId: [{ required: true, message: '请选择部门', trigger: 'change' }], + // consumable: [{ required: true, message: '请选择是否耗材', trigger: 'change' }], }, showSafetyGoodsAndEquipmentDialog: false, title: '', @@ -123,9 +125,9 @@ },); -const openAddGoods = () => { - addGoodsDialogRef.value.openAddGoodsDialog(dialogState.goodsBigClassifyList) -} +// const openAddGoods = () => { +// addGoodsDialogRef.value.openAddGoodsDialog(dialogState.goodsBigClassifyList) +// } const openSafetyGoodsAndEquipmentDialog = (title: string, value: safetyGoodsAndEquipmentFormType, goodsBigClassifyList: BigClassifyType [], departmentList : DepartmentType []) => { @@ -137,9 +139,12 @@ id: null, bigClassifyId: null, smallClassifyId: null, - depId: null, - consumable: null, + depId: userInfo.userInfos.depId, + // consumable: null, }; + nextTick( () => { + safetyGoodsAndEquipmentRef.value.clearValidate(); + }) if(title === '新增') { dialogState.title = '新增' }else { @@ -206,6 +211,18 @@ }) }; +const getAllSafetyEquipmentList = async () => { + let res = await goodsAndEquipmentApi().getAllSafetyEquipment(); + if(res.data.code === '200'){ + dialogState.goodsBigClassifyList = res.data.data + }else{ + ElMessage({ + message:res.data.msg, + type:'warning' + }) + } +}; + const emit = defineEmits(['refreshData',]) defineExpose({ -- Gitblit v1.9.2