| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { httpAction, getAction } from '@/api/manage' |
| | | import { httpAction } from '@/api/manage' |
| | | |
| | | export default { |
| | | name: 'ProductModalForm', |
| | |
| | | ], |
| | | productNo: [ |
| | | { required: true, message: '请输入产品代号!' } |
| | | ], |
| | | ] |
| | | }, |
| | | url: { |
| | | add: '/mdc/mdcPartProcessInfo/add', |
| | | edit: '/mdc/mdcPartProcessInfo/edit' |
| | | add: '/nc/product/add', |
| | | edit: '/nc/product/edit' |
| | | } |
| | | } |
| | | }, |
| | | computed: { |
| | | formDisabled() { |
| | | return this.disabled |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | edit(record) { |
| | | this.model = Object.assign({}, record) |
| | | console.log('model', this.model) |
| | | this.visible = true |
| | | }, |
| | | |
| | | submitForm() { |
| | |
| | | if (valid) { |
| | | that.confirmLoading = true |
| | | let httpUrl = '' |
| | | let method = 'post' |
| | | let method = '' |
| | | if (!this.model.id) { |
| | | httpUrl += this.url.add |
| | | method = 'post' |
| | | } else { |
| | | httpUrl += this.url.edit |
| | | method = 'put' |
| | | httpUrl += this.url.edit + `/${this.model.id}` |
| | | } |
| | | httpAction(httpUrl, this.model, method).then((res) => { |
| | | if (res.success) { |