| | |
| | | @keyup.enter.native="refreshTable()"> |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="检验对象" prop="specimenName"> |
| | | <el-input size="small" placeholder="请输入" clearable v-model="itemParameterForm.specimenName" |
| | | <el-form-item label="检验对象" prop="sample"> |
| | | <el-input size="small" placeholder="请输入" clearable v-model="itemParameterForm.sample" |
| | | @keyup.enter.native="refreshTable()"> |
| | | </el-input> |
| | | </el-form-item> |
| | |
| | | { label: '检验对象EN', prop: 'specimenNameEn' }, |
| | | { label: '产品', prop: 'product' }, |
| | | { label: '对象代号', prop: 'code' }, |
| | | { |
| | | label: '对象类型', prop: 'objectType', |
| | | dataType: 'tag', |
| | | formatData: (params) => { |
| | | if (params == 1) { |
| | | return '原材料' |
| | | } else if (params == 2) { |
| | | return '成品' |
| | | } else { |
| | | return '辅材' |
| | | } |
| | | }, |
| | | formatType: (params) => { |
| | | if (params == 1) { |
| | | return 'success' |
| | | } else if (params == 2) { |
| | | return 'info' |
| | | } else { |
| | | return 'warning' |
| | | } |
| | | } |
| | | }, |
| | | { label: '创建人', prop: 'createUserName' }, |
| | | { label: '更新人', prop: 'updateUserName' }, |
| | | { label: '创建时间', prop: 'createTime' }, |
| | |
| | | <template> |
| | | <div> |
| | | <el-dialog :title="operationType === 'add' ? '新增' : '编辑'" :visible.sync="editFormDia" width="500px" @close="closeDia"> |
| | | <el-dialog :title="operationType === 'add' ? '新增' : '编辑'" :visible.sync="editFormDia" width="500px" |
| | | @close="closeDia"> |
| | | <el-form ref="editForm" :model="editForm" :rules="editFormRules" label-width="120px" label-position="right"> |
| | | <el-form-item label="场所:" prop="laboratoryId"> |
| | | <el-select v-model="editForm.laboratoryId" clearable placeholder="请选择" size="small" style="width: 100%"> |
| | | <el-option v-for="item in laboratoryList" :key="item.value" :label="item.label" :value="item.value"></el-option> |
| | | <el-option v-for="item in laboratoryList" :key="item.value" :label="item.label" |
| | | :value="item.value"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="检验对象:" prop="specimenName"> |
| | |
| | | </el-form-item> |
| | | <el-form-item label="对象代号:" prop="code"> |
| | | <el-input v-model="editForm.code" clearable size="small"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="对象类型:" prop="objectType"> |
| | | <el-select v-model="editForm.objectType" clearable placeholder="请选择" size="small" style="width: 100%"> |
| | | <el-option v-for="item in dict.type.object_type" :key="item.value" :label="item.label" :value="item.value"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-form> |
| | | <span slot="footer" class="dialog-footer"> |
| | |
| | | |
| | | <script> |
| | | |
| | | import {obtainItemParameterList} from "@/api/structural/laboratoryScope"; |
| | | import {addTestObject, upTestObject} from "@/api/structural/capability"; |
| | | import { obtainItemParameterList } from "@/api/structural/laboratoryScope"; |
| | | import { addTestObject, upTestObject } from "@/api/structural/capability"; |
| | | |
| | | export default { |
| | | name: "EditForm", |
| | |
| | | specimenName: '', // 检验对象 |
| | | specimenNameEn: '', // 检验对象EN |
| | | code: '', // 对象代号 |
| | | objectType: '', // 对象类型 |
| | | }, |
| | | laboratoryList: [], |
| | | editFormRules: { |
| | |
| | | }, |
| | | // 方法集合 |
| | | methods: { |
| | | openDia (type, row) { |
| | | openDia(type, row) { |
| | | this.operationType = type |
| | | this.obtainItemParameterList() |
| | | this.editFormDia = true |
| | | if (type === 'add') { |
| | | this.resetForm("editForm"); |
| | | } else { |
| | | this.editForm = {...row} |
| | | this.editForm = { ...row } |
| | | } |
| | | }, |
| | | // 提交编辑 |
| | | handleEdit () { |
| | | handleEdit() { |
| | | this.$refs.editForm.validate(valid => { |
| | | if (valid) { |
| | | this.editLoad = true |
| | | if(this.editForm.id){ |
| | | if (this.editForm.id) { |
| | | // 修改 |
| | | upTestObject(this.editForm).then(res => { |
| | | this.editLoad = false |
| | |
| | | }).catch(e => { |
| | | this.editLoad = false |
| | | }) |
| | | }else{ |
| | | } else { |
| | | // 新增 |
| | | addTestObject(this.editForm).then(res => { |
| | | this.editLoad = false |
| | |
| | | }) |
| | | }, |
| | | // 关闭弹框 |
| | | closeDia () { |
| | | closeDia() { |
| | | this.editFormDia = false |
| | | this.resetForm("editForm"); |
| | | }, |
| | |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | |
| | | </style> |
| | | <style scoped></style> |
| | |
| | | proxy: { |
| | | // detail: https://cli.vuejs.org/config/#devserver-proxy |
| | | [process.env.VUE_APP_BASE_API]: { |
| | | target: `http://192.168.1.124:8002`, |
| | | target: `http://192.168.0.104:8002`, |
| | | // target: `http://127.0.0.1:8002`, |
| | | changeOrigin: true, |
| | | pathRewrite: { |