| | |
| | | <a-col :span="12"> |
| | | <a-form-item label="标准加工时间" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-input-search :readOnly="true" v-decorator="['duration', validatorRules.duration]" |
| | | @search="deviceSearch" enter-button/> |
| | | @search="deviceSearch1" enter-button placeholder="请选择标准加工时间"/> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-item label="设备组" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-input-search :readOnly="true" v-decorator="['equipmentIds', validatorRules.equipmentIds]" |
| | | @search="deviceSearch2" enter-button placeholder="请选择设备"/> |
| | | </a-form-item> |
| | | </a-col> |
| | | </a-row> |
| | | <a-row :gutter="24"> |
| | | <a-col :span="12"> |
| | | <a-form-item label="零件号" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-input :disabled="true" placeholder="请输入零件号" v-decorator="['partsCode', validatorRules.partsCode]"></a-input> |
| | | <a-input :disabled="true" placeholder="请输入零件号" |
| | | v-decorator="['partsCode', validatorRules.partsCode]"></a-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-item label="程序号" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-input :disabled="true" placeholder="请输入程序号" |
| | | v-decorator="['sequenceNumber', validatorRules.sequenceNumber]"></a-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | </a-row> |
| | | <!--<a-row :gutter="24">--> |
| | | <!--<a-col :span="12">--> |
| | | <!--<a-form-item label="设备编号" :labelCol="labelCol" :wrapperCol="wrapperCol">--> |
| | | <!--<a-input :disabled="true" placeholder="请输入设备编号" v-decorator="['equipmentId', validatorRules.equipmentId]"></a-input>--> |
| | | <!--</a-form-item>--> |
| | | <!--</a-col>--> |
| | | <!--<a-col :span="12">--> |
| | | <!--<a-form-item label="设备名称" :labelCol="labelCol" :wrapperCol="wrapperCol">--> |
| | | <!--<a-input :disabled="true" placeholder="请输入设备名称" v-decorator="['equipmentName', validatorRules.equipmentName]"></a-input>--> |
| | | <!--</a-form-item>--> |
| | | <!--</a-col>--> |
| | | <!--</a-row>--> |
| | | <a-row :gutter="24"> |
| | | <a-col :span="12"> |
| | | <a-form-item label="程序号" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-input :disabled="true" placeholder="请输入程序号" v-decorator="['sequenceNumber', validatorRules.sequenceNumber]"></a-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-item label="批次号" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-input :disabled="true" placeholder="请输入批次号" v-decorator="['batchCode', validatorRules.batchCode]"></a-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | </a-row> |
| | | <a-row :gutter="24"> |
| | | <a-col :span="12"> |
| | | <a-form-item label="设备编号" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-input :disabled="true" placeholder="请输入设备编号" v-decorator="['equipmentId', validatorRules.equipmentId]"></a-input> |
| | | <a-input :disabled="true" placeholder="请输入批次号" |
| | | v-decorator="['batchCode', validatorRules.batchCode]"></a-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-item label="设备名称" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-input :disabled="true" placeholder="请输入设备名称" v-decorator="['equipmentName', validatorRules.equipmentName]"></a-input> |
| | | <a-form-item label='加工数量' :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-input-number :min="0" placeholder="请输入加工数量" |
| | | v-decorator="['processQuantity', validatorRules.processQuantity]"></a-input-number> |
| | | </a-form-item> |
| | | </a-col> |
| | | </a-row> |
| | |
| | | <j-date date-format="YYYY-MM-DD" placeholder="请选择日期" |
| | | v-decorator="['efficientDate', validatorRules.efficientDate]"></j-date> |
| | | </a-form-item> |
| | | |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-item label='加工数量' :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-input-number :min="0" placeholder="请输入加工数量" v-decorator="['processQuantity', validatorRules.processQuantity]"></a-input-number> |
| | | </a-form-item> |
| | | </a-col> |
| | | </a-row> |
| | | <a-row :gutter="24"> |
| | | <a-col :span="24"> |
| | | <a-form-item label="备注" :labelCol="labelColLong1" :wrapperCol="wrapperColLong1"> |
| | | <a-textarea :maxLength="20" v-decorator="['remark', validatorRules.remark]" placeholder="请输入备注" ></a-textarea> |
| | | </a-form-item> |
| | | <a-form-item label="备注" :labelCol="labelColLong1" :wrapperCol="wrapperColLong1"> |
| | | <a-textarea :maxLength="20" v-decorator="['remark', validatorRules.remark]" |
| | | placeholder="请输入备注"></a-textarea> |
| | | </a-form-item> |
| | | </a-col> |
| | | </a-row> |
| | | </a-form> |
| | | </a-spin> |
| | | <mdc-process-quantity-modal-list ref="deviceRepairListModel" @sendSelectionRows="getDeviceRows"></mdc-process-quantity-modal-list> |
| | | |
| | | <select-device-drawer ref="selectDeviceDrawer" @selectFinished="selectOK" :title="'选择设备'"/> |
| | | |
| | | <mdc-process-quantity-modal-list ref="deviceRepairListModel" |
| | | @sendSelectionRows="getDeviceRows"></mdc-process-quantity-modal-list> |
| | | </a-modal> |
| | | </template> |
| | | |
| | | <script> |
| | | import moment from 'moment' |
| | | import pick from 'lodash.pick' |
| | | import SelectDeviceDrawer from '../../../../system/modules/SelectDeviceDrawer' |
| | | import mdcProcessQuantityModalList from './mdcProcessQuantityModalList' |
| | | // import JDate from './JDate' |
| | | |
| | | import { |
| | | getAction, |
| | | postAction, |
| | |
| | | |
| | | export default { |
| | | name: 'mdcProcessQuantityModal', |
| | | components: {mdcProcessQuantityModalList}, |
| | | components: { SelectDeviceDrawer, mdcProcessQuantityModalList }, |
| | | props: {}, |
| | | data() { |
| | | return { |
| | | mesag:21, |
| | | readOnly:true, |
| | | mesag: 21, |
| | | readOnly: true, |
| | | title: '', |
| | | visible: false, |
| | | show: false, |
| | | model: {}, |
| | | checked: false, |
| | | startData:"", |
| | | endData:"", |
| | | startData: '', |
| | | endData: '', |
| | | labelCol: { |
| | | xs: { |
| | | span: 24 |
| | |
| | | confirmLoading: false, |
| | | form: this.$form.createForm(this), |
| | | validatorRules: { |
| | | duration:{ |
| | | rules:[ |
| | | {required:true,message:'请选择标准加工时间'} |
| | | equipmentIds: { |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: '请选择设备' |
| | | } |
| | | ] |
| | | }, |
| | | efficientDate:{ |
| | | rules:[ |
| | | {required:true,message:'请选择日期'} |
| | | duration: { |
| | | rules: [ |
| | | { required: true, message: '请选择标准加工时间' } |
| | | ] |
| | | }, |
| | | processQuantity:{ |
| | | rules:[ |
| | | {required:true,message:'请选择加工数量'} |
| | | efficientDate: { |
| | | rules: [ |
| | | { required: true, message: '请选择日期' } |
| | | ] |
| | | }, |
| | | processQuantity: { |
| | | rules: [ |
| | | { required: true, message: '请选择加工数量' } |
| | | ] |
| | | } |
| | | }, |
| | | url: { |
| | | add: '/mdc/mdcProcessQuantity/add', |
| | |
| | | disableSubmit: true, |
| | | partCategoryCascade: [], |
| | | cascadeDefaultValue: [], |
| | | standardId:"" |
| | | standardId: '' |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | // // this.endData = dateStrings[1]; |
| | | // // console.log(this.startData,this.endData); |
| | | // }, |
| | | onChangeEnd(dates, dateStrings){ |
| | | this.endTime = dateStrings[0]; |
| | | onChangeEnd(dates, dateStrings) { |
| | | this.endTime = dateStrings[0] |
| | | }, |
| | | getDeviceRows(val) { |
| | | this.standardId = val[0].id |
| | | this.form.setFieldsValue({ |
| | | equipmentId: val[0].equipmentId, |
| | | equipmentName: val[0].equipmentName, |
| | | duration: val[0].duration, |
| | | partsCode: val[0].partsCode, |
| | | batchCode: val[0].batchCode, |
| | | sequenceNumber: val[0].sequenceNumber, |
| | | this.standardId = val[0].id |
| | | this.form.setFieldsValue({ |
| | | equipmentId: val[0].equipmentId, |
| | | equipmentName: val[0].equipmentName, |
| | | duration: val[0].duration, |
| | | partsCode: val[0].partsCode, |
| | | batchCode: val[0].batchCode, |
| | | sequenceNumber: val[0].sequenceNumber |
| | | }) |
| | | console.log(this.standardId) |
| | | }, |
| | | deviceSearch() { |
| | | deviceSearch1() { |
| | | this.$refs.deviceRepairListModel.openPage() |
| | | this.$refs.deviceRepairListModel.title = '选择设备' |
| | | this.$refs.deviceRepairListModel.title = '选择标准加工时间' |
| | | this.$refs.deviceRepairListModel.disableSubmit = false |
| | | }, |
| | | deviceSearch2() { |
| | | this.$refs.selectDeviceDrawer.visible = true |
| | | this.$refs.selectDeviceDrawer.selectedRowKeys = [] |
| | | this.$refs.selectDeviceDrawer.selectedRows = [] |
| | | this.$refs.selectDeviceDrawer.checkedKeys = this.form.getFieldValue('equipmentIds') ? this.form.getFieldValue('equipmentIds').split(',') : [] |
| | | }, |
| | | //级联框onChange事件 |
| | | // onChange(value) { |
| | |
| | | this.model = Object.assign({}, record) |
| | | this.visible = true |
| | | this.$nextTick(() => { |
| | | this.form.setFieldsValue(pick(this.model, 'equipmentId', 'equipmentName', 'vacationDate', 'vacationType', 'notes', |
| | | this.form.setFieldsValue(pick(this.model, 'equipmentId', 'equipmentName', 'vacationDate', 'vacationType', 'notes' |
| | | )) |
| | | }) |
| | | }, |
| | |
| | | // // this.endTime = '' |
| | | // that.confirmLoading = false |
| | | // }else{ |
| | | let obj |
| | | if (!this.model.id) { |
| | | formData.standardId = this.standardId |
| | | obj = postAction(this.url.add, formData) |
| | | } else { |
| | | obj = requestPut(this.url.edit, formData, { |
| | | id: this.model.id |
| | | }) |
| | | } |
| | | obj.then((res) => { |
| | | if (res.success) { |
| | | // that.$message.success("添加成功") |
| | | that.$notification.success({ |
| | | message:'消息', |
| | | description:"添加成功" |
| | | }); |
| | | // that.$message.success(res.message) |
| | | that.$emit('ok', res.result) |
| | | } else { |
| | | // that.$message.warning(res.message) |
| | | that.$notification.warning({ |
| | | message:'消息', |
| | | description:res.message |
| | | }); |
| | | } |
| | | }).finally(() => { |
| | | that.confirmLoading = false |
| | | that.close() |
| | | let obj |
| | | if (!this.model.id) { |
| | | formData.standardId = this.standardId |
| | | obj = postAction(this.url.add, formData) |
| | | } else { |
| | | obj = requestPut(this.url.edit, formData, { |
| | | id: this.model.id |
| | | }) |
| | | } |
| | | obj.then((res) => { |
| | | if (res.success) { |
| | | // that.$message.success("添加成功") |
| | | that.$notification.success({ |
| | | message: '消息', |
| | | description: '添加成功' |
| | | }) |
| | | // that.$message.success(res.message) |
| | | that.$emit('ok', res.result) |
| | | } else { |
| | | // that.$message.warning(res.message) |
| | | that.$notification.warning({ |
| | | message: '消息', |
| | | description: res.message |
| | | }) |
| | | } |
| | | // } |
| | | }).finally(() => { |
| | | that.confirmLoading = false |
| | | that.close() |
| | | }) |
| | | } |
| | | // } |
| | | |
| | | // } |
| | | }) |
| | |
| | | }, |
| | | checkboxChange(e) { |
| | | this.checked = e.target.checked |
| | | }, |
| | | |
| | | /** |
| | | * 选择已有设备后点击确定时触发 |
| | | * @param data 已选择的设备 |
| | | */ |
| | | selectOK(data) { |
| | | console.log('data=', data) |
| | | this.form.setFieldsValue({ |
| | | equipmentIds: data.join(',') |
| | | }) |
| | | } |
| | | } |
| | | } |
| | |
| | | .ant-tabs-content .ant-form-item { |
| | | margin-bottom: 0px; |
| | | } |
| | | /deep/ .ant-input-number{ |
| | | width: 100%!important; |
| | | |
| | | /deep/ .ant-input-number { |
| | | width: 100% !important; |
| | | } |
| | | </style> |