| | |
| | | @search="deviceSearch" enter-button/> |
| | | </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"> |
| | |
| | | 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.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() |
| | | }) |
| | | } |
| | | // 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() |
| | | }) |
| | | |
| | | } |
| | | // } |
| | | |