| | |
| | | :value="item.value"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="车间:" prop="objectType" v-if="editForm.objectType == '原辅料' || editForm.objectType == '包材'"> |
| | | <el-select v-model="editForm.workShopId" placeholder="请选择" size="small"> |
| | | <el-option v-for="item in workshopList" :key="item.id" :label="item.name" :value="item.id"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-form> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="closeDia">取 消</el-button> |
| | |
| | | |
| | | import { obtainItemParameterList } from "@/api/structural/laboratoryScope"; |
| | | import { addTestObject, upTestObject } from "@/api/structural/capability"; |
| | | import { selectWorkShop } from "@/api/structural/workshop.js" |
| | | |
| | | export default { |
| | | name: "EditForm", |
| | |
| | | specimenNameEn: '', // 检验对象EN |
| | | // code: '', // 对象代号 |
| | | objectType: '', // 对象类型 |
| | | workShopId: '',//车间 |
| | | }, |
| | | laboratoryList: [], |
| | | editFormRules: { |
| | |
| | | objectType: [ |
| | | { required: true, message: '请输入对象类型', trigger: 'change' } |
| | | ], |
| | | workShopId: [ |
| | | { required: true, message: '请选择车间', trigger: 'change' } |
| | | ], |
| | | }, |
| | | operationType: '' |
| | | operationType: '', |
| | | workshopList: [] |
| | | } |
| | | }, |
| | | // 方法集合 |
| | | methods: { |
| | | selectWorkShop() { |
| | | selectWorkShop({ size: -1, current: -1 }).then(res => { |
| | | this.workshopList = res.data.records |
| | | }) |
| | | }, |
| | | openDia(type, row) { |
| | | this.operationType = type |
| | | this.obtainItemParameterList() |
| | | this.selectWorkShop() |
| | | this.editFormDia = true |
| | | if (type === 'add') { |
| | | this.resetForm("editForm"); |
| | | this.editForm = {} |
| | | } else { |
| | | this.editForm = { ...row } |
| | | } |
| | |
| | | this.$refs.editForm.validate(valid => { |
| | | if (valid) { |
| | | this.editLoad = true |
| | | if (this.editForm.objectType != '原辅料' && this.editForm.objectType != '包材') { |
| | | this.editForm.workShopId = '' |
| | | } |
| | | this.editForm.workShopName = this.editForm.workShopId ? this.workshopList.find(m => m.id == this.editForm.workShopId).name : '' |
| | | if (this.editForm.id) { |
| | | // 修改 |
| | | upTestObject(this.editForm).then(res => { |