| | |
| | | <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="24"> |
| | | <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" :hidden=true> |
| | | <a-form-model-item label="变动方式" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="changeMethod"> |
| | | <a-input v-model="model.changeMethod" placeholder="请输入变动方式" defaultValue="seal"></a-input> |
| | | <a-col |
| | | :span="12" |
| | | :hidden=true |
| | | > |
| | | <a-form-model-item |
| | | label="变动方式" |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | prop="changeMethod" |
| | | > |
| | | <a-input |
| | | v-model="model.changeMethod" |
| | | placeholder="请输入变动方式" |
| | | defaultValue="seal" |
| | | ></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="24"> |
| | | <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-row> |
| | | </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="equipmentSealDetailTable.loading" |
| | | :columns="equipmentSealDetailTable.columns" :dataSource="equipmentSealDetailTable.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="equipmentSealDetailTable.loading" |
| | | :columns="equipmentSealDetailTable.columns" |
| | | :dataSource="equipmentSealDetailTable.dataSource" |
| | | :maxHeight="300" |
| | | :disabled="formDisabled" |
| | | :alwaysEdit="true" |
| | | :bordered="true" |
| | | :rowNumber="true" |
| | | :rowSelection="true" |
| | | :toolbar="true" |
| | | :toolbarConfig="toolbarConfig" |
| | | :linkage-config="linkageConfig" |
| | | :addDefaultRowNum="0" |
| | | > |
| | | <template slot="toolbarPrefix"> |
| | | <a-button type="primary" @click="selectEquipmentList" :disabled="formDisabled">选择设备 |
| | | <a-button |
| | | type="primary" |
| | | @click="selectEquipmentList" |
| | | :disabled="formDisabled" |
| | | >选择设备 |
| | | </a-button> |
| | | </template> |
| | | |
| | | <!-- state.address.regionName --> |
| | | <template v-slot:maintenanceStandardId="props"> |
| | | <a-form-model ref="form" :model="props.row"> |
| | | <a-form-model-item style="margin-bottom: 0;" v-if="props.row.maintenanceAfterUnseal == 'Y'" label="" |
| | | :labelCol="labelCol" :wrapperCol="wrapperCol" prop="maintenanceStandardId" |
| | | :rules="[{ required: true, message: '必填项',trigger: 'change' }]"> |
| | | <a-select v-model="props.row.maintenanceStandardId" @change="(e) => handleChange(e, props.row)" |
| | | :options="manageList" /> |
| | | </a-form-model-item> |
| | | <a-form-model-item style="margin-bottom: 0;" v-else label="" :labelCol="labelCol" :wrapperCol="wrapperCol" |
| | | prop="maintenanceStandardId"> |
| | | <a-select v-model="props.row.maintenanceStandardId" :options="manageList" |
| | | @change="(e) => handleChange(e, props.row.maintenanceAfterUnseal)" /> |
| | | </a-form-model-item> |
| | | </a-form-model> |
| | | </template> |
| | | <!-- 设备图片插槽 --> |
| | | <template v-slot:equipmentPhoto='props'> |
| | | <Tooltip |
| | | placement="top" |
| | | title="预览图片" |
| | | > |
| | | <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span> |
| | | <img v-else :src="getImgView(text)" :preview="props.rowId" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/> |
| | | </Tooltip> |
| | | </template> |
| | | <template v-slot:action="props"> |
| | | <a-popconfirm title="确定删除吗?" @confirm="handleDL(props)"> |
| | | <a-popconfirm |
| | | title="确定删除吗?" |
| | | @confirm="handleDL(props)" |
| | | > |
| | | <a>删除</a> |
| | | </a-popconfirm> |
| | | </template> |
| | |
| | | </a-tab-pane> |
| | | </a-tabs> |
| | | <equipment-select-modal ref="EquipmentSelectModal"></equipment-select-modal> |
| | | <!-- <equipment-selection @selectionRows="selectionRows" :equipmentStatus="['2', '3']" |
| | | ref="EquipmentSelection"></equipment-selection> --> |
| | | </a-spin> |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | |
| | | import { JEditableTableModelMixin } from '@/mixins/JEditableTableModelMixin' |
| | | import { randomUUID, randomNumber } from '@/utils/util' |
| | | |
| | | import { validateDuplicateValue } from '@/utils/util' |
| | | import pick from 'lodash.pick' |
| | | import { getAction, postAction, requestPut } from '@api/manage' |
| | | // import EquipmentSelection from '@/components/tools/EquipmentSelection.vue' |
| | | import EquipmentSelectModal from './EquipmentSelectModal.vue' |
| | | |
| | | 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' |
| | | |
| | | export default { |
| | |
| | | xs: { span: 24 }, |
| | | sm: { span: 16 } |
| | | }, |
| | | manageList: [ |
| | | { label: '空', value: '' }, |
| | | { label: '保养标准一', value: '1001' }, |
| | | { label: '保养标准二', value: '1002' } |
| | | ], |
| | | // 新增时子表默认添加几行空数据 |
| | | addDefaultRowNum: 0, |
| | | model: {}, |
| | | validatorRules: { |
| | | |
| | | num: [ |
| | | { required: true, message: '请输入单据号!' }, |
| | | { validator: (rule, value, callback) => validateDuplicateValue('mom_eam_equipment_change', 'num', value, this.model.id, callback) } |
| | | ], |
| | | |
| | | remark: [ |
| | | { required: false, message: '请输入备注!' } |
| | | ] |
| | |
| | | title: '设备封存明细id', |
| | | key: 'id', |
| | | type: JVXETypes.hidden, |
| | | width: '100px', |
| | | fixed: 'left' |
| | | width: '100px' |
| | | }, |
| | | // fixed: 'left' |
| | | { |
| | | title: '设备变动单id', |
| | | key: 'equipmentChangeId', |
| | | type: JVXETypes.hidden, |
| | | |
| | | placeholder: '请输入${title}', |
| | | defaultValue: '' |
| | | }, |
| | |
| | | title: '设备编码', |
| | | key: 'equipmentNum', |
| | | type: JVXETypes.normal, |
| | | width: '120px', |
| | | width: '150px', |
| | | align: 'center' |
| | | // placeholder: '请输入${title}', |
| | | fixed: 'left' |
| | | }, |
| | | { |
| | | title: '设备资产编码', |
| | | key: 'assetNumber', |
| | | type: JVXETypes.normal, |
| | | width: '120px', |
| | | fixed: 'left', |
| | | defaultValue: '' |
| | | }, |
| | | { |
| | | title: '封存原因', |
| | | key: 'sealReason', |
| | | type: JVXETypes.input, |
| | | width: '200px', |
| | | placeholder: '请输入${title}', |
| | | defaultValue: '', |
| | | validateRules: [ |
| | | { |
| | | required: true, // 必填 |
| | | message: '请输入${title}' // 显示的文本 |
| | | }] |
| | | }, |
| | | { |
| | | title: '封存日期', |
| | | key: 'sealDate', |
| | | type: JVXETypes.datetime, |
| | | width: '100px', |
| | | placeholder: '请选择${title}', |
| | | defaultValue: '', |
| | | validateRules: [ |
| | | { |
| | | required: true, // 必填 |
| | | message: '请输入${title}' // 显示的文本 |
| | | }] |
| | | |
| | | }, |
| | | { |
| | | title: '预计启封日期', |
| | | key: 'planUnsealDate', |
| | | type: JVXETypes.date, |
| | | width: '120px', |
| | | placeholder: '请输入${title}', |
| | | defaultValue: '' |
| | | }, |
| | | // { |
| | | // title: '强制启封', |
| | | // key: 'isForceUnseal', |
| | | // type: JVXETypes.checkbox, |
| | | // customValue: ['Y', 'N'], |
| | | // width: '120px', |
| | | // placeholder: '请输入${title}', |
| | | // defaultValue: '' |
| | | // }, |
| | | // { |
| | | // title: '强制启封日期', |
| | | // key: 'forceUnsealDate', |
| | | // type: JVXETypes.date, |
| | | // width: '120px', |
| | | // placeholder: '请输入${title}', |
| | | // defaultValue: '' |
| | | // }, |
| | | // { |
| | | // title: '强制启封后保养', |
| | | // key: 'maintenanceAfterUnseal', |
| | | // type: JVXETypes.checkbox, |
| | | // customValue: ['Y', 'N'], |
| | | // width: '150px', |
| | | // placeholder: '请输入${title}', |
| | | // defaultValue: 'N', |
| | | |
| | | // }, |
| | | // { |
| | | // title: '保养标准', |
| | | // key: 'maintenanceStandardId', |
| | | // type: JVXETypes.slot, |
| | | // width: '260px', |
| | | // slotName: 'maintenanceStandardId' |
| | | // }, |
| | | |
| | | { |
| | | title: '特种设备', |
| | | key: 'specificEquipment', |
| | | type: JVXETypes.hidden, |
| | | disabled: true, |
| | | |
| | | placeholder: '请输入${title}', |
| | | defaultValue: '' |
| | | }, |
| | | { |
| | | title: '特种设备', |
| | | key: 'specificEquipment_dictText', |
| | | type: JVXETypes.normal, |
| | | disabled: true, |
| | | width: '100px', |
| | | defaultValue: '' |
| | | }, |
| | | // fixed: 'left' |
| | | { |
| | | title: '设备名称', |
| | | key: 'equipmentName', |
| | | type: JVXETypes.normal, |
| | | disabled: true, |
| | | width: '200px', |
| | | |
| | | width: '150px', |
| | | align: 'center', |
| | | defaultValue: '' |
| | | }, |
| | | { |
| | |
| | | key: 'model', |
| | | type: JVXETypes.normal, |
| | | disabled: true, |
| | | width: '120px', |
| | | width: '150px', |
| | | align: 'center', |
| | | defaultValue: '' |
| | | }, |
| | | { |
| | |
| | | key: 'specification', |
| | | type: JVXETypes.normal, |
| | | disabled: true, |
| | | width: '120px', |
| | | width: '150px', |
| | | align: 'center', |
| | | placeholder: '请输入${title}', |
| | | defaultValue: '' |
| | | }, |
| | | { |
| | | title: '设备资产编码', |
| | | key: 'assetNumber', |
| | | type: JVXETypes.normal, |
| | | width: '150px', |
| | | align: 'center', |
| | | defaultValue: '' |
| | | }, |
| | | { |
| | | title: '封存原因', |
| | | key: 'sealReason', |
| | | type: JVXETypes.input, |
| | | width: '200px', |
| | | align: 'center', |
| | | placeholder: '请输入${title}', |
| | | defaultValue: '', |
| | | validateRules: [{ |
| | | required: true, // 必填 |
| | | message: '请输入${title}' // 显示的文本 |
| | | }] |
| | | }, |
| | | { |
| | | title: '封存日期', |
| | | key: 'sealDate', |
| | | type: JVXETypes.datetime, |
| | | width: '150px', |
| | | align: 'center', |
| | | placeholder: '请选择${title}', |
| | | defaultValue: '', |
| | | validateRules: [{ |
| | | required: true, // 必填 |
| | | message: '请输入${title}' // 显示的文本 |
| | | }] |
| | | |
| | | }, |
| | | { |
| | | title: '预计启封日期', |
| | | key: 'planUnsealDate', |
| | | type: JVXETypes.date, |
| | | width: '150px', |
| | | align: 'center', |
| | | placeholder: '请输入${title}', |
| | | defaultValue: '' |
| | | }, |
| | | { |
| | | title: '特种设备', |
| | | key: 'specificEquipment', |
| | | type: JVXETypes.hidden, |
| | | disabled: true, |
| | | placeholder: '请输入${title}', |
| | | defaultValue: '', |
| | | width: '150px' |
| | | }, |
| | | { |
| | | title: '特种设备', |
| | | key: 'specificEquipment_dictText', |
| | | type: JVXETypes.normal, |
| | | disabled: true, |
| | | width: '150px', |
| | | align: 'center', |
| | | defaultValue: '' |
| | | }, |
| | | |
| | | { |
| | | title: '设备状态', |
| | | key: 'equipmentStatus_dictText', |
| | | type: JVXETypes.normal, |
| | | disabled: true, |
| | | width: '100px', |
| | | // placeholder: '请输入${title}', |
| | | width: '150px', |
| | | align: 'center', |
| | | defaultValue: '' |
| | | }, |
| | | // { |
| | | // title: '设备状态', |
| | | // key: 'equipmentStatus', |
| | | // type: JVXETypes.select, |
| | | // options: [], |
| | | // dictCode: 'equipment_status', |
| | | // disabled: true, |
| | | // width: '200px', |
| | | // // placeholder: '请输入${title}', |
| | | // defaultValue: '' |
| | | // }, |
| | | { |
| | | title: '技术状态', |
| | | key: 'technologyStatus_dictText', |
| | | type: JVXETypes.normal, |
| | | disabled: true, |
| | | width: '100px', |
| | | width: '150px', |
| | | align: 'center', |
| | | defaultValue: '' |
| | | }, |
| | | { |
| | |
| | | key: 'location', |
| | | type: JVXETypes.normal, |
| | | disabled: true, |
| | | width: '120px' |
| | | |
| | | width: '200px', |
| | | align: 'center' |
| | | }, |
| | | { |
| | | title: '重要度', |
| | | key: 'equipmentImportanceId_dictText', |
| | | type: JVXETypes.normal, |
| | | disabled: true, |
| | | width: '100px', |
| | | // placeholder: '请输入${title}', |
| | | width: '150px', |
| | | align: 'center', |
| | | defaultValue: '' |
| | | }, |
| | | { |
| | | title: '重要度', |
| | | key: 'equipmentImportanceId', |
| | | type: JVXETypes.hidden |
| | | }, |
| | | { |
| | | title: '设备图片', |
| | | key: 'equipmentPhoto', |
| | | type: JVXETypes.slot, |
| | | disabled: true, |
| | | width: '120px', |
| | | slotName:'equipmentPhoto' |
| | | |
| | | }, |
| | | { |
| | | title: '操作', |
| | | key: 'action', |
| | | type: JVXETypes.slot, |
| | | disabled: true, |
| | | width: '100px', |
| | | slotName: 'action', |
| | | }, |
| | | } |
| | | // { |
| | | // title: '设备图片', |
| | | // key: 'equipmentPhoto', |
| | | // type: JVXETypes.slot, |
| | | // disabled: true, |
| | | // width: '150px', |
| | | // slotName: 'equipmentPhoto' |
| | | // }, |
| | | // { |
| | | // title: '操作', |
| | | // key: 'action', |
| | | // type: JVXETypes.slot, |
| | | // disabled: true, |
| | | // width: '150px', |
| | | // align: "center", |
| | | // slotName: 'action', |
| | | // }, |
| | | |
| | | ] |
| | | }, |
| | |
| | | add: '/eam/equipmentSeal/add', |
| | | edit: '/eam/equipmentSeal/edit', |
| | | queryById: '/eam/equipmentSeal/queryById', |
| | | getNum: '/eam/sysIdentity/getNumNew', |
| | | equipmentSealDetail: { |
| | | list: '/eam/equipmentSeal/listEquipmentSealDetailByMainId' |
| | | } |
| | |
| | | } |
| | | }, |
| | | created() { |
| | | this.initNum() |
| | | }, |
| | | mounted() { |
| | | this.$bus.$on('selectionRows', (data) => { |
| | |
| | | }) |
| | | }, |
| | | methods: { |
| | | |
| | | initNum() { |
| | | getAction(this.url.getNum, { type: 'EquipmentSeal', length: '4' }).then((res) => { |
| | | if (res.success) { |
| | | this.model.num = res.message |
| | | } |
| | | }) |
| | | }, |
| | | handleChange(value, data) { |
| | | this.$nextTick(() => { |
| | | this.$set(data, 'maintenanceAfterUnseal', data.maintenanceAfterUnseal) |
| | |
| | | this.addSelectedEquipments(data) |
| | | }, |
| | | handleDL(props) { |
| | | // 调用删除方法 |
| | | props.target.removeRows(props.row) |
| | | }, |
| | | // 调用删除方法 |
| | | props.target.removeRows(props.row) |
| | | }, |
| | | |
| | | //选择设备 |
| | | selectEquipmentList() { |
| | |
| | | </script> |
| | | |
| | | <style scoped> |
| | | /** tab panel 中有下拉框/日期 这类带下拉效果的,需要加此样式 */ |
| | | |
| | | ::v-deep .jeecg-tabs-top { |
| | | /deep/ .jeecg-tabs-top { |
| | | overflow: visible; |
| | | } |
| | | |
| | | ::v-deep .ant-form-explain { |
| | | position: absolute; |
| | | right: -50px; |
| | | top: 12px; |
| | | } |
| | | </style> |