| | |
| | | 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 |
| | |
| | | </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="请先选择物资大类"> |
| | |
| | | <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="请选择部门" |
| | |
| | | </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> |
| | |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | <add-goods-dialog ref="addGoodsDialogRef"></add-goods-dialog> |
| | | <add-goods-dialog ref="addGoodsDialogRef" @refreshClassify="getAllSafetyEquipmentList"></add-goods-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | 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: { |
| | |
| | | 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: '', |
| | |
| | | |
| | | },); |
| | | |
| | | const openAddGoods = () => { |
| | | addGoodsDialogRef.value.openAddGoodsDialog(dialogState.goodsBigClassifyList) |
| | | } |
| | | // const openAddGoods = () => { |
| | | // addGoodsDialogRef.value.openAddGoodsDialog(dialogState.goodsBigClassifyList) |
| | | // } |
| | | |
| | | const openSafetyGoodsAndEquipmentDialog = |
| | | (title: string, value: safetyGoodsAndEquipmentFormType, goodsBigClassifyList: BigClassifyType [], departmentList : DepartmentType []) => { |
| | |
| | | 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 { |
| | |
| | | }) |
| | | }; |
| | | |
| | | 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({ |