| | |
| | | <a-row> |
| | | <a-col :span='24'> |
| | | <a-form-item label='危险源编码' :labelCol='labelCol' :wrapperCol='wrapperCol'> |
| | | <a-input placeholder='请输入危险源编码' v-decorator="['num', validatorRules.num]"></a-input> |
| | | <a-input placeholder='将由系统自动生成' v-decorator="['num', validatorRules.num]" disabled></a-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :span='24'> |
| | |
| | | |
| | | <script> |
| | | import pick from 'lodash.pick' |
| | | import { postAction, requestPut } from '@/api/manage' |
| | | import { getAction,postAction, requestPut } from '@/api/manage' |
| | | import { duplicateCheck } from '@/api/api' |
| | | |
| | | export default { |
| | |
| | | url: { |
| | | add: '/eam/riskPrevention/add', |
| | | edit: '/eam/riskPrevention/edit', |
| | | queryById: '/eam/riskPrevention/queryById' |
| | | queryById: '/eam/riskPrevention/queryById', |
| | | getNum: '/eam/sysIdentity/getNumNew', |
| | | }, |
| | | //新增、编辑、删除、批量删除操作改变数据后刷新关联的组件的监听属性 |
| | | alterFlag: '' |
| | |
| | | this.$nextTick(() => { |
| | | this.form.setFieldsValue(pick(this.model, 'num', 'name', 'remark','description','measure')) |
| | | }) |
| | | if (record.id) { |
| | | if (this.model.id) { |
| | | this.codeDisable = true |
| | | } else { |
| | | this.codeDisable = false |
| | | this.$nextTick(() => { |
| | | getAction(this.url.getNum, { type: 'RiskPrevention', length: '4' }).then((res) => { |
| | | if (res.success) { |
| | | this.form.setFieldsValue({ num: res.message }); |
| | | } |
| | | }) |
| | | }); |
| | | } |
| | | }, |
| | | |