| | |
| | | rules: { |
| | | strainCode: [{ |
| | | validator: (rule, value, callback) => { |
| | | if (this.currentAction === 'submit' && !value.trim()) { |
| | | if (this.currentAction === 'submit' && !value) { |
| | | callback(new Error('请输入菌种编号')); |
| | | } else { |
| | | callback(); |
| | |
| | | this.currentAction = 'submit' |
| | | this.$refs.strainForm.validate((valid) => { |
| | | if (valid) { |
| | | this.signatureVisible = true |
| | | this.form.isDraft = isDraft |
| | | if (isDraft == 1) { |
| | | //存草稿 |
| | | this.handleSignatureConfirm('') |
| | | } else { |
| | | this.signatureVisible = true |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | |
| | | requestData.id = this.$route.query.id; |
| | | await edit(requestData); |
| | | } else if (this.currentAction === 'batchAdd') { |
| | | console.log(requestData); |
| | | |
| | | await addBatch(requestData); |
| | | } else { |
| | | await add(requestData); |