| | |
| | | :wrapperCol='wrapperCol' |
| | | prop='annex' |
| | | > |
| | | <j-image-upload |
| | | :isMultiple="false" |
| | | v-model="model.annex" |
| | | ></j-image-upload> |
| | | <j-upload :returnUrl= "false" :isMultiple="false" v-model="model.file" ></j-upload> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span='12'> |
| | |
| | | |
| | | import { JVxeTableModelMixin } from '@/mixins/JVxeTableModelMixin.js' |
| | | import { JVXETypes } from '@comp/jeecg/JVxeTable' |
| | | import { getRefPromise, VALIDATE_FAILED } from '@/components/jeecg/JVxeTable/utils/vxeUtils.js' |
| | | |
| | | import JFormContainer from '@/components/jeecg/JFormContainer' |
| | | import { getAction } from '@api/manage' |
| | | import { VALIDATE_FAILED, getRefPromise, validateFormAndTables,validateFormModelAndTables} from '@/components/jeecg/JVxeTable/utils/vxeUtils.js' |
| | | |
| | | export default { |
| | | name: 'ProjectMaintenanceOrderForm', |
| | |
| | | }] |
| | | }, |
| | | { |
| | | title: '设备编码', |
| | | title: '统一编码', |
| | | key: 'equipmentNum', |
| | | type: JVXETypes.normal, |
| | | width: '140px', |
| | |
| | | fixed: 'left' |
| | | }, |
| | | { |
| | | title: '资产编码', |
| | | key: 'assetNumber', |
| | | type: JVXETypes.normal, |
| | | width: '140px', |
| | | align: "center", |
| | | fixed: 'left', |
| | | defaultValue: '' |
| | | }, |
| | | { |
| | | title: '委外单位', |
| | | title: '外委单位', |
| | | key: 'supplierId', |
| | | type: JVXETypes.slot, |
| | | disabled: true, |
| | |
| | | defaultValue: '' |
| | | }, |
| | | { |
| | | title: '委外单位', |
| | | title: '外委单位', |
| | | key: 'supplierId', |
| | | type: JVXETypes.hidden |
| | | }, |
| | |
| | | }, |
| | | methods: { |
| | | |
| | | handleOk() { |
| | | this.model['annex'] = this.model.file[0].filePath; |
| | | /** 触发表单验证 */ |
| | | this.getAllTable().then(tables => { |
| | | /** 一次性验证主表和所有的次表 */ |
| | | return validateFormModelAndTables(this.$refs.form,this.model, tables) |
| | | }).then(allValues => { |
| | | /** 一次性验证一对一的所有子表 */ |
| | | return this.validateSubForm(allValues) |
| | | }).then(allValues => { |
| | | if (typeof this.classifyIntoFormData !== 'function') { |
| | | throw this.throwNotFunction('classifyIntoFormData') |
| | | } |
| | | let formData = this.classifyIntoFormData(allValues) |
| | | // 发起请求 |
| | | return this.request(formData) |
| | | }).catch(e => { |
| | | if (e.error === VALIDATE_FAILED) { |
| | | // 如果有未通过表单验证的子表,就自动跳转到它所在的tab |
| | | this.activeKey = e.index == null ? this.activeKey : this.refKeys[e.index] |
| | | } else { |
| | | console.error(e) |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | getSuppler() { |
| | | getAction(this.url.supplierVoList).then((res) => { |
| | | if (res.success) { |
| | |
| | | /** 调用完edit()方法之后会自动调用此方法 */ |
| | | editAfter() { |
| | | this.$nextTick(() => { |
| | | this.model.file = this.model.annex; |
| | | }) |
| | | // 加载子表数据 |
| | | if (this.model.id) { |