| | |
| | | |
| | | if (this.cacheForm) { |
| | | this.form = this.cacheForm; |
| | | |
| | | if (this.cacheForm.displayStrainSeq) { |
| | | this.displayStrainSeq = this.cacheForm.displayStrainSeq; |
| | | } |
| | | } |
| | | |
| | | if (this.$route.query.id && !this.cacheForm) { |
| | |
| | | }, |
| | | deactivated() { |
| | | this.cacheForm = JSON.parse(JSON.stringify(this.form)); |
| | | this.cacheForm.displayStrainSeq = this.displayStrainSeq |
| | | }, |
| | | watch: { |
| | | '$route.query.id'() { |
| | |
| | | this.form.strainSeq = String(num); |
| | | // 显示时补零到3位 |
| | | this.displayStrainSeq = String(num).padStart(3, '0'); |
| | | } else { |
| | | this.form.strainSeq = ''; |
| | | this.displayStrainSeq = ''; |
| | | } |
| | | } else { |
| | | this.displayStrainSeq = ''; |
| | | } |
| | | |
| | | console.log('格式化后存储值:', this.form.strainSeq); |
| | |
| | | if (this.form.strainSeq) { |
| | | // 显示原始数字,去除前导零 |
| | | this.displayStrainSeq = this.form.strainSeq; |
| | | } else { |
| | | this.displayStrainSeq = ''; |
| | | } |
| | | }, |
| | | getFullStrainCode() { |
| | |
| | | } else { |
| | | await add(requestData); |
| | | } |
| | | |
| | | this.cacheForm = null |
| | | this.displayStrainSeq = null |
| | | |
| | | this.signatureVisible = false; |
| | | this.$router.push({ path: '/strain-library/production-cell-grandson' }); |
| | | this.$closeCurrentView('/strain-library/production-cell-grandson'); |
| | | this.$message.success('操作成功'); |
| | | } catch (error) { |
| | | this.$message.error('操作失败'); |