| | |
| | | <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" |
| | |
| | | ></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" |
| | |
| | | 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: '新增入库', |
| | |
| | | setTimeout(() => { |
| | | goodsDetailFormRef.value.clearValidate(); |
| | | }); |
| | | goodsDetailAddState.startRfid = '' |
| | | goodsDetailAddState.endRfid = '' |
| | | goodsDetailAddState.startRfid = ''; |
| | | goodsDetailAddState.endRfid = ''; |
| | | goodsDetailAddState.goodsDetailForm = { |
| | | id: null, |
| | | smId: null, |
| | |
| | | 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 = () => { |