| | |
| | | <a-col :span="12"> |
| | | <a-form-item label="设备组" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-input-search :readOnly="true" v-decorator="['equipmentIds', validatorRules.equipmentIds]" |
| | | @search="deviceSearch" enter-button/> |
| | | @search="deviceSearch" enter-button placeholder="请选择设备"/> |
| | | </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="['unqualifiedQuantity', validatorRules.unqualifiedQuantity,]"></a-input-number> |
| | | <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-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 label="不合格数量" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-input-number :min="0" placeholder="请输入不合格数量" v-decorator="['unqualifiedQuantity', validatorRules.unqualifiedQuantity,]"></a-input-number> |
| | | </a-form-item> |
| | | </a-col> |
| | | |
| | | |
| | | </a-row> |
| | | <a-row :gutter="24"> |
| | | <a-col :span="24"> |
| | | <a-form-item label="备注" :labelCol="labelColLong" :wrapperCol="wrapperColLong"> |
| | | <a-textarea v-decorator="['remark', validatorRules.remark]" placeholder="请输入备注" ></a-textarea> |
| | | <a-textarea v-decorator="['remark', validatorRules.remark]" placeholder="请输入备注" :maxLength ="20" ></a-textarea> |
| | | </a-form-item> |
| | | </a-col> |
| | | </a-row> |
| | | </a-form> |
| | | </a-spin> |
| | | <mdc-pass-rate-modal-list ref="deviceRepairListModel" @sendSelectionRows="getDeviceRows"></mdc-pass-rate-modal-list> |
| | | |
| | | <select-device-modal ref="selectDeviceModal" @selectFinished="selectOK" :title="'选择设备'"/> |
| | | </a-modal> |
| | | </template> |
| | | |
| | | <script> |
| | | import moment from 'moment' |
| | | import pick from 'lodash.pick' |
| | | import mdcPassRateModalList from './mdcPassRateModalList' |
| | | // import JDate from './JDate' |
| | | import { |
| | | getAction, |
| | |
| | | import { |
| | | duplicateCheck |
| | | } from '@/api/api' |
| | | import SelectDeviceModal from '../../../../system/modules/SelectDeviceModal' |
| | | |
| | | export default { |
| | | name: 'mdcPassRateModal', |
| | | components: {mdcPassRateModalList}, |
| | | components: { SelectDeviceModal}, |
| | | props: {}, |
| | | data() { |
| | | return { |
| | |
| | | { |
| | | required:true, |
| | | message: "请选择设备" |
| | | }, |
| | | ], |
| | | }, |
| | | processQuantity:{ |
| | | rules:[ |
| | | { |
| | | required:true, |
| | | message: "请输入加工数量" |
| | | }, |
| | | ], |
| | | }, |
| | | unqualifiedQuantity:{ |
| | | rules:[ |
| | | { |
| | | required:true, |
| | | message: "请输入不合格数量" |
| | | }, |
| | | ], |
| | | }, |
| | | efficientDate:{ |
| | | rules:[ |
| | | { |
| | | required:true, |
| | | message: "请选择日期" |
| | | }, |
| | | ], |
| | | }, |
| | |
| | | // }) |
| | | }, |
| | | deviceSearch() { |
| | | this.$refs.deviceRepairListModel.openPage() |
| | | this.$refs.deviceRepairListModel.title = '选择设备' |
| | | this.$refs.deviceRepairListModel.disableSubmit = false |
| | | this.$refs.selectDeviceModal.visible = true |
| | | this.$refs.selectDeviceModal.selectedRowKeys = [] |
| | | this.$refs.selectDeviceModal.selectedRows = [] |
| | | this.$refs.selectDeviceModal.checkedKeys = this.form.getFieldValue('equipmentIds') ? this.form.getFieldValue('equipmentIds').split(',') : [] |
| | | }, |
| | | //级联框onChange事件 |
| | | // onChange(value) { |
| | |
| | | if (!err) { |
| | | that.confirmLoading = true |
| | | let formData = Object.assign(this.model, values) |
| | | let stat = formData.processQuantity |
| | | let end = formData.unqualifiedQuantity |
| | | if(end>stat){ |
| | | // that.$message.warning("不合格数量必须小于等于加工数量"); |
| | | that.$notification.warning({ |
| | | message:'消息', |
| | | description:"不合格数量必须小于等于加工数量" |
| | | }); |
| | | that.confirmLoading = false |
| | | }else{ |
| | | let obj |
| | | if (!this.model.id) { |
| | | 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 start = moment(formData.startTime).format('YYYY-MM-DD HH:mm:ss'); |
| | | // let end = moment(formData.endTime).format('YYYY-MM-DD HH:mm:ss'); |
| | | // let startOne = start.replace(/:/g,''); |
| | |
| | | // // this.endTime = '' |
| | | // that.confirmLoading = false |
| | | // }else{ |
| | | let obj |
| | | if (!this.model.id) { |
| | | 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.$message.success(res.message) |
| | | that.$emit('ok', res.result) |
| | | } else { |
| | | that.$message.warning(res.message) |
| | | } |
| | | }).finally(() => { |
| | | that.confirmLoading = false |
| | | that.close() |
| | | }) |
| | | |
| | | } |
| | | // } |
| | | |
| | |
| | | }, |
| | | checkboxChange(e) { |
| | | this.checked = e.target.checked |
| | | }, |
| | | |
| | | /** |
| | | * 选择已有设备后点击确定时触发 |
| | | * @param data 已选择的设备 |
| | | */ |
| | | selectOK(data) { |
| | | // let params = {} |
| | | // params.equipmentIdList = [] |
| | | // for (var a = 0; a < data.length; a++) { |
| | | // params.equipmentIdList.push(data[a]) |
| | | // } |
| | | console.log('data=', data) |
| | | this.form.setFieldsValue({ |
| | | equipmentIds: data.join(',') |
| | | }) |
| | | } |
| | | } |
| | | } |