| | |
| | | <a-spin :spinning='confirmLoading'> |
| | | <j-form-container :disabled='formDisabled'> |
| | | <!-- 主表单区域 --> |
| | | <a-form-model ref='form' :model='model' :rules='validatorRules' slot='detail'> |
| | | <a-form-model |
| | | ref='form' |
| | | :model='model' |
| | | :rules='validatorRules' |
| | | slot='detail' |
| | | > |
| | | <a-row> |
| | | <a-col :span='12'> |
| | | <a-form-model-item label='计划单编号' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='num'> |
| | | <a-input v-model='model.num' placeholder='请输入计划单编号'></a-input> |
| | | <a-form-model-item |
| | | label='计划单编号' |
| | | :labelCol='labelCol' |
| | | :wrapperCol='wrapperCol' |
| | | prop='num' |
| | | > |
| | | <a-input |
| | | v-model='model.num' |
| | | placeholder='请输入计划单编号' |
| | | ></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span='12'> |
| | | <a-form-model-item label='计划名称' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='计划名称'> |
| | | <a-input v-model='model.name' rows='4' placeholder='请输入计划名称' /> |
| | | <a-form-model-item |
| | | label='计划名称' |
| | | :labelCol='labelCol' |
| | | :wrapperCol='wrapperCol' |
| | | prop='计划名称' |
| | | > |
| | | <a-input |
| | | v-model='model.name' |
| | | rows='4' |
| | | placeholder='请输入计划名称' |
| | | /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span='12'> |
| | | <a-form-model-item label='计划开始日期' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='planStartTime'> |
| | | <a-form-model-item |
| | | label='计划开始日期' |
| | | :labelCol='labelCol' |
| | | :wrapperCol='wrapperCol' |
| | | prop='planStartTime' |
| | | > |
| | | <j-date |
| | | placeholder='请选择计划开始日期' |
| | | v-model='model.planStartTime' |
| | |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span='12'> |
| | | <a-form-model-item label='计划结束日期' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='planEndTime'> |
| | | <a-form-model-item |
| | | label='计划结束日期' |
| | | :labelCol='labelCol' |
| | | :wrapperCol='wrapperCol' |
| | | prop='planEndTime' |
| | | > |
| | | <j-date |
| | | placeholder='请选择计划结束日期' |
| | | v-model='model.planEndTime' |
| | |
| | | </a-form-model-item> |
| | | </a-col> --> |
| | | <a-col :span='12'> |
| | | <a-form-model-item label='附件' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='annex'> |
| | | <j-image-upload |
| | | :isMultiple="false" |
| | | v-model="model.annex" |
| | | ></j-image-upload> |
| | | <a-form-model-item |
| | | label='附件' |
| | | :labelCol='labelCol' |
| | | :wrapperCol='wrapperCol' |
| | | prop='annex' |
| | | > |
| | | <j-upload :returnUrl= "false" :isMultiple="false" v-model="model.file" ></j-upload> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span='12'> |
| | | <a-form-model-item label='备注' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='remark'> |
| | | <a-textarea v-model='model.remark' rows='4' placeholder='请输入备注' /> |
| | | <a-form-model-item |
| | | label='备注' |
| | | :labelCol='labelCol' |
| | | :wrapperCol='wrapperCol' |
| | | prop='remark' |
| | | > |
| | | <a-textarea |
| | | v-model='model.remark' |
| | | rows='4' |
| | | placeholder='请输入备注' |
| | | /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | |
| | |
| | | </a-form-model> |
| | | </j-form-container> |
| | | <!-- 子表单区域 --> |
| | | <a-tabs v-model='activeKey' @change='handleChangeTabs'> |
| | | <a-tab-pane tab='项目性维修明细' :key='refKeys[0]' :forceRender='true'> |
| | | <j-vxe-table keep-source :ref='refKeys[0]' :loading='projectMaintenanceOrderDetailTable.loading' |
| | | :columns='projectMaintenanceOrderDetailTable.columns' |
| | | :dataSource='projectMaintenanceOrderDetailTable.dataSource' |
| | | :maxHeight='300' |
| | | :disabled='formDisabled' :rowNumber='true' :rowSelection='true' :toolbar='true' |
| | | :toolbarConfig='toolbarConfig' |
| | | :linkage-config='linkageConfig'> |
| | | <a-tabs |
| | | v-model='activeKey' |
| | | @change='handleChangeTabs' |
| | | > |
| | | <a-tab-pane |
| | | tab='项目性维修明细' |
| | | :key='refKeys[0]' |
| | | :forceRender='true' |
| | | > |
| | | <j-vxe-table |
| | | keep-source |
| | | :ref='refKeys[0]' |
| | | :loading='projectMaintenanceOrderDetailTable.loading' |
| | | :columns='projectMaintenanceOrderDetailTable.columns' |
| | | :dataSource='projectMaintenanceOrderDetailTable.dataSource' |
| | | :maxHeight='400' |
| | | :disabled='formDisabled' |
| | | :rowNumber='true' |
| | | :rowSelection='true' |
| | | :alwaysEdit='true' |
| | | :toolbar='true' |
| | | :bordered='true' |
| | | :toolbarConfig='toolbarConfig' |
| | | :linkage-config='linkageConfig' |
| | | > |
| | | <template slot='toolbarPrefix'> |
| | | <a-button type='primary' @click='selectEquipmentList' :disabled='formDisabled'>选择设备 |
| | | <a-button |
| | | type='primary' |
| | | @click='selectEquipmentList' |
| | | :disabled='formDisabled' |
| | | >选择设备 |
| | | </a-button> |
| | | </template> |
| | | |
| | | <template v-slot:supplierId='props'> |
| | | <a-select v-model='props.row.supplierId' :options='supplierVoList' |
| | | style='width: 100%' |
| | | placeholder='请选择' |
| | | @change='(e) => handleChange(e, props.row)' /> |
| | | <a-select |
| | | v-model='props.row.supplierId' |
| | | :options='supplierVoList' |
| | | style='width: 100%' |
| | | placeholder='请选择' |
| | | @change='(e) => handleChange(e, props.row)' |
| | | /> |
| | | |
| | | </template> |
| | | <template v-slot:teamId='props'> |
| | | <a-select v-model='props.row.teamId' :options='teamVoList' |
| | | style='width: 100%' |
| | | placeholder='请选择' |
| | | @change='(e) => handleChange(e, props.row)' /> |
| | | <a-select |
| | | v-model='props.row.teamId' |
| | | :options='teamVoList' |
| | | style='width: 100%' |
| | | placeholder='请选择' |
| | | @change='(e) => handleChange(e, props.row)' |
| | | /> |
| | | |
| | | </template> |
| | | <template v-slot:userId='props'> |
| | | <a-select v-model='props.row.userId' :options='userVoList' |
| | | style='width: 100%' |
| | | placeholder='请选择' |
| | | @change='(e) => handleChange(e, props.row)' /> |
| | | <a-select |
| | | v-model='props.row.userId' |
| | | :options='userVoList' |
| | | style='width: 100%' |
| | | placeholder='请选择' |
| | | @change='(e) => handleChange(e, props.row)' |
| | | /> |
| | | <!-- <a-select |
| | | placeholder="请选择责任人" |
| | | allowClear |
| | |
| | | </j-vxe-table> |
| | | </a-tab-pane> |
| | | </a-tabs> |
| | | <equipment-select-modal @selectionRows='selectionRows' :equipmentStatus="['2', '3']" |
| | | ref='EquipmentSelectModal'></equipment-select-modal> |
| | | <equipment-select-modal |
| | | @selectionRows='selectionRows' |
| | | :equipmentStatus="['2', '3']" |
| | | ref='EquipmentSelectModal' |
| | | ></equipment-select-modal> |
| | | </a-spin> |
| | | </template> |
| | | |
| | |
| | | |
| | | 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: '任务编码', |
| | | key: 'taskNum', |
| | | type: JVXETypes.input, |
| | | width: '120px', |
| | | width: '180px', |
| | | align: "center", |
| | | fixed: 'left', |
| | | validateRules: [ |
| | | { |
| | |
| | | }] |
| | | }, |
| | | { |
| | | title: '设备编码', |
| | | title: '统一编码', |
| | | key: 'equipmentNum', |
| | | type: JVXETypes.normal, |
| | | width: '120px', |
| | | // placeholder: '请输入${title}', |
| | | width: '140px', |
| | | align: "center", |
| | | fixed: 'left' |
| | | }, |
| | | { |
| | | title: '资产编码', |
| | | key: 'assetNumber', |
| | | type: JVXETypes.normal, |
| | | width: '120px', |
| | | fixed: 'left', |
| | | defaultValue: '' |
| | | }, |
| | | { |
| | | title: '委外单位', |
| | | title: '外委单位', |
| | | key: 'supplierId', |
| | | type: JVXETypes.slot, |
| | | disabled: true, |
| | | width: '100px', |
| | | width: '140px', |
| | | align: "center", |
| | | slotName: 'supplierId', |
| | | defaultValue: '' |
| | | }, |
| | | { |
| | | title: '委外单位', |
| | | title: '外委单位', |
| | | key: 'supplierId', |
| | | type: JVXETypes.hidden |
| | | }, |
| | |
| | | required: true, // 必填 |
| | | message: '请输入${title}' // 显示的文本 |
| | | }], |
| | | width: '100px', |
| | | width: '140px', |
| | | align: "center", |
| | | defaultValue: '' |
| | | }, |
| | | // { |
| | |
| | | key: 'equipmentName', |
| | | type: JVXETypes.normal, |
| | | disabled: true, |
| | | width: '120px', |
| | | |
| | | width: '140px', |
| | | align: "center", |
| | | defaultValue: '' |
| | | }, |
| | | { |
| | |
| | | key: 'model', |
| | | type: JVXETypes.normal, |
| | | disabled: true, |
| | | width: '120px', |
| | | width: '140px', |
| | | align: "center", |
| | | defaultValue: '' |
| | | }, |
| | | { |
| | |
| | | key: 'specification', |
| | | type: JVXETypes.normal, |
| | | disabled: true, |
| | | width: '120px', |
| | | width: '140px', |
| | | align: "center", |
| | | placeholder: '请输入${title}', |
| | | defaultValue: '' |
| | | }, |
| | |
| | | key: 'equipmentStatus_dictText', |
| | | type: JVXETypes.normal, |
| | | disabled: true, |
| | | width: '100px', |
| | | width: '140px', |
| | | align: "center", |
| | | // placeholder: '请输入${title}', |
| | | defaultValue: '' |
| | | }, |
| | |
| | | key: 'technologyStatus_dictText', |
| | | type: JVXETypes.normal, |
| | | disabled: true, |
| | | width: '100px', |
| | | width: '140px', |
| | | align: "center", |
| | | defaultValue: '' |
| | | }, |
| | | { |
| | |
| | | key: 'itemName', |
| | | type: JVXETypes.input, |
| | | placeholder: '请输入${title}', |
| | | width: '100px', |
| | | validateRules: [ |
| | | { |
| | | required: true, // 必填 |
| | | message: '请输入${title}' // 显示的文本 |
| | | }], |
| | | width: '240px', |
| | | validateRules: [{ |
| | | required: true, // 必填 |
| | | message: '请输入${title}' // 显示的文本 |
| | | }], |
| | | align: "center", |
| | | defaultValue: '' |
| | | }, |
| | | { |
| | |
| | | type: JVXETypes.select, |
| | | dictCode: 'urgency', |
| | | placeholder: '请输入${title}', |
| | | width: '100px', |
| | | width: '140px', |
| | | align: "center", |
| | | defaultValue: '' |
| | | }, |
| | | { |
| | |
| | | width: '150px', |
| | | placeholder: '请输入${title}', |
| | | defaultValue: '', |
| | | align: "center", |
| | | slotName: 'teamId' |
| | | }, |
| | | { |
| | |
| | | key: 'teamId', |
| | | type: JVXETypes.hidden |
| | | }, |
| | | |
| | | { |
| | | title: '责任人', |
| | | key: 'userId', |
| | | type: JVXETypes.slot, |
| | | disabled: true, |
| | | width: '100px', |
| | | width: '160px', |
| | | placeholder: '请输入${title}', |
| | | defaultValue: '', |
| | | align: "center", |
| | | slotName: 'userId' |
| | | }, |
| | | |
| | | { |
| | | title: '责任人', |
| | | key: 'userId', |
| | | type: JVXETypes.hidden |
| | | }, |
| | | |
| | | { |
| | | title: '计划开始时间', |
| | | key: 'planStartTime', |
| | | type: JVXETypes.datetime, |
| | | width: '120px', |
| | | width: '140px', |
| | | align: "center", |
| | | placeholder: '请输入${title}', |
| | | defaultValue: '' |
| | | }, { |
| | | title: '计划完成时间', |
| | | key: 'planEndTime', |
| | | type: JVXETypes.datetime, |
| | | width: '120px', |
| | | width: '140px', |
| | | align: "center", |
| | | placeholder: '请输入${title}', |
| | | defaultValue: '' |
| | | }, |
| | |
| | | projectMaintenanceOrderDetail: { |
| | | list: '/eam/projectMaintenanceOrder/queryProjectMaintenanceOrderDetailByMainId' |
| | | }, |
| | | queryUserByTeamId:'/base/team/queryUserByTeamId' |
| | | queryUserByTeamId: '/base/team/queryUserByTeamId' |
| | | } |
| | | } |
| | | }, |
| | |
| | | this.getUser(); |
| | | }, |
| | | 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) => { |
| | |
| | | this.$set(data, 'userId', data.userId) |
| | | }) |
| | | }, |
| | | getUserVoList(val){ |
| | | getAction(this.url.queryUserByTeamId,{teamId:val}).then(res=>{ |
| | | if(res.success){ |
| | | getUserVoList(val) { |
| | | getAction(this.url.queryUserByTeamId, { teamId: val }).then(res => { |
| | | if (res.success) { |
| | | this.userVoList = res.result |
| | | } |
| | | else{ |
| | | else { |
| | | this.$message.error(res.message); |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | handleVerify(parent) { |
| | |
| | | supplierVoList: this.supplierVoList, |
| | | userVoList: this.userVoList, |
| | | teamVoList: this.teamVoList, |
| | | userId:data[i].userId |
| | | userId: data[i].userId |
| | | |
| | | } |
| | | } |
| | |
| | | /** 调用完edit()方法之后会自动调用此方法 */ |
| | | editAfter() { |
| | | this.$nextTick(() => { |
| | | this.model.file = this.model.annex; |
| | | }) |
| | | // 加载子表数据 |
| | | if (this.model.id) { |
| | |
| | | }, |
| | | //校验所有一对一子表表单 |
| | | validateSubForm(allValues) { |
| | | if(this.$refs.projectMaintenanceOrderDetail.getTableData().length == 0){ |
| | | if (this.$refs.projectMaintenanceOrderDetail.getTableData().length == 0) { |
| | | this.$message.warning("请添加维修明细!") |
| | | return |
| | | } |