| | |
| | | <a-row :gutter="24"> |
| | | <a-col :span="24"> |
| | | <a-form-item |
| | | label="产线编号" |
| | | label="工段编号" |
| | | :labelCol="{span:4}" |
| | | :wrapperCol="{span:18}" |
| | | > |
| | | <a-input |
| | | :readOnly="disableSubmit" |
| | | :readOnly="codeDisable" |
| | | allow-clear |
| | | placeholder="请输入产线编号" |
| | | placeholder="将由系统自动生成" |
| | | v-decorator="['num', validatorRules.num ]" |
| | | /> |
| | | </a-form-item> |
| | |
| | | <a-row :gutter="24"> |
| | | <a-col :span="24"> |
| | | <a-form-item |
| | | label="产线名称" |
| | | label="工段名称" |
| | | :labelCol="{span:4}" |
| | | :wrapperCol="{span:18}" |
| | | > |
| | | <a-input |
| | | :readOnly="disableSubmit" |
| | | allow-clear |
| | | placeholder="请输入产线名称" |
| | | placeholder="请输入工段名称" |
| | | v-decorator="['name', validatorRules.name ]" |
| | | /> |
| | | </a-form-item> |
| | |
| | | |
| | | <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 { |
| | |
| | | validatorRules: { |
| | | num: { |
| | | rules: [ |
| | | { required: true, message: '请输入产线编号!' }, |
| | | { required: true, message: '请输入工段编号!' }, |
| | | { min: 2, max: 30, message: '长度在 2 到 30 个字符', trigger: 'blur' }, |
| | | { validator: this.validateNum }, |
| | | ] |
| | | }, |
| | | name: { |
| | | rules: [ |
| | | { required: true, message: '请输入产线名称!' }, |
| | | { required: true, message: '请输入工段名称!' }, |
| | | { min: 0, max: 30, message: '长度不超过 30 个字符', trigger: 'blur' }, |
| | | { validator: this.validateName }, |
| | | ] |
| | |
| | | }, |
| | | url: { |
| | | add: "/base/productionLine/add", |
| | | edit: "/base/productionLine/edit" |
| | | edit: "/base/productionLine/edit", |
| | | getNum: '/eam/sysIdentity/getNumNew', |
| | | }, |
| | | disableSubmit: false, |
| | | codeDisable: false, |
| | | //新增、编辑、删除、批量删除操作改变数据后刷新关联的组件的监听属性 |
| | | alterFlag: "" |
| | | } |
| | |
| | | this.$nextTick(() => { |
| | | this.form.setFieldsValue(pick(this.model, 'num', 'name', 'shiftCategoryId', 'remark')) |
| | | }); |
| | | if (!record.id) { |
| | | this.$nextTick(() => { |
| | | getAction(this.url.getNum, { type: 'ProductionLine', length: '4' }).then((res) => { |
| | | if (res.success) { |
| | | this.form.setFieldsValue({ num: res.message }); |
| | | } |
| | | }) |
| | | }); |
| | | this.codeDisable = false; |
| | | } else { |
| | | this.codeDisable = true; |
| | | } |
| | | }, |
| | | close() { |
| | | this.$emit('close'); |