| | |
| | | <template> |
| | | <a-modal title="新增物料信息" :width="900" :visible="visible" :confirmLoading="confirmLoading" @ok="handleSubmit" |
| | | <a-modal title="新增基础物料信息" :width="900" :visible="visible" :confirmLoading="confirmLoading" @ok="handleSubmit" |
| | | @cancel="handleCancel"> |
| | | <a-spin :spinning="confirmLoading"> |
| | | <!-- tab --> |
| | |
| | | <a-form-item label="物料类型" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> |
| | | <a-input-number placeholder="请输入物料类型" style="width: 100%" v-decorator="['materialType']" /> |
| | | </a-form-item> |
| | | |
| | | |
| | | <a-form-item label="物料类型" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-select style="width: 100%" placeholder="请选择物料类型" v-decorator="['materialType']"> |
| | | <a-select-option v-for="(item, index) in materialTypeData" :key="index" |
| | | :value="Number(item.materialTypeCode)">{{ item.materialTypeName }}</a-select-option> |
| | | </a-select> |
| | | </a-form-item> |
| | | |
| | | <!-- <a-col :md="8" :sm="24"> |
| | | |
| | | </a-col> --> |
| | | |
| | | |
| | | |
| | | <a-form-item label="物料组" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> |
| | | <a-input placeholder="请输入物料组" v-decorator="['materialGroup']" /> |
| | | </a-form-item> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { WmsMaterialAdd, GetAreas, GetStations } from '@/api/modular/main/WmsMaterialManage' |
| | | import { WmsMaterialAdd, GetAreas, GetStations, materialTypeDataList } from '@/api/modular/main/WmsMaterialManage' |
| | | import addForm from './tabItem/addForm.vue' |
| | | import addFormBaseCustomer from './tabItem/addFormBaseCustomer/addFormBaseCustomer.vue' |
| | | import addFormContainerPackaging from './tabItem/WmsContainerPackaging/addFormContainerPackaging.vue' |
| | |
| | | addFormContainerPackaging, |
| | | addFormSub, |
| | | addControlRule |
| | | }, |
| | | created() { |
| | | this.materialTypeDataList() |
| | | }, |
| | | data() { |
| | | return { |
| | |
| | | } |
| | | }, |
| | | methods: { |
| | | materialTypeDataList() { |
| | | materialTypeDataList().then((d) => { |
| | | this.materialTypeData = d.data || [] |
| | | }).catch(() => { |
| | | |
| | | }) |
| | | }, |
| | | callbacktab(e) { |
| | | |
| | | const { |
| | | form: { validateFields } |
| | | } = this |
| | | // this.confirmLoading = true |
| | | |
| | | //包装关系 |
| | | if (e == 6) { |
| | | this.$nextTick(() => { |
| | | let materialType = this.form.getFieldValue('materialType'); |
| | | // 调接口 传物料类型 |
| | | const { |
| | | form: { validateFields } |
| | | } = this |
| | | this.confirmLoading = true |
| | | validateFields((errors, values) => { |
| | | if (!errors) { |
| | | for (const key in values) { |
| | | if (typeof values[key] === 'object') { |
| | | values[key] = JSON.stringify(values[key]) |
| | | } |
| | | } |
| | | console.log(values) |
| | | this.confirmLoading = false |
| | | this.$refs.addFormContainerPackagingRef.initShow(values.materialType) |
| | | |
| | | } else { |
| | | this.confirmLoading = false |
| | | } |
| | | }) |
| | | this.$refs.addFormContainerPackagingRef.initShow(materialType) |
| | | |
| | | }) |
| | | } |
| | | // 替代品 |
| | | if (e == 4) { |
| | | const { |
| | | form: { validateFields } |
| | | } = this |
| | | this.confirmLoading = true |
| | | validateFields((errors, values) => { |
| | | if (!errors) { |
| | | for (const key in values) { |
| | | if (typeof values[key] === 'object') { |
| | | values[key] = JSON.stringify(values[key]) |
| | | } |
| | | } |
| | | console.log(66666666666) |
| | | console.log(values) |
| | | this.confirmLoading = false |
| | | debugger |
| | | // materialName materialCode |
| | | this.$refs.addFormWmsSubstituteGoodRef.initShow(values.materialCode,values.materialName) |
| | | |
| | | } else { |
| | | this.confirmLoading = false |
| | | } |
| | | }) |
| | | let materialCode = this.form.getFieldValue('materialCode'); |
| | | let materialName = this.form.getFieldValue('materialName'); |
| | | this.$refs.addFormWmsSubstituteGoodRef.initShow(materialCode, materialName) |
| | | } |
| | | }, |
| | | handleOk() { }, |
| | |
| | | this.$nextTick(() => { |
| | | this.getSelects() |
| | | }) |
| | | const materialTypeOption = this.$options |
| | | this.materialTypeData = materialTypeOption.filters['dictData']('material_type') |
| | | // const materialTypeOption = this.$options |
| | | // this.materialTypeData = materialTypeOption.filters['dictData']('material_type') |
| | | const inspectionMethodOption = this.$options |
| | | this.inspectionMethodData = inspectionMethodOption.filters['dictData']('material_inspection') |
| | | }, |