| | |
| | | this.resetForm() |
| | | if (this.cacheForm) { |
| | | this.form = this.cacheForm; |
| | | |
| | | if (this.cacheForm.displayStrainSeq) { |
| | | this.displayStrainSeq = this.cacheForm.displayStrainSeq; |
| | | } |
| | | } |
| | | if (this.$route.query.id && !this.cacheForm) { |
| | | getDetail({ id: this.$route.query.id }).then(res => { |
| | |
| | | }, |
| | | 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/main-cell-library' }); |
| | | this.$message.success('操作成功'); |
| | |
| | | |
| | | 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.$message.success('操作成功'); |
| | |
| | | |
| | | <script> |
| | | import SignatureCanvas from '@/components/SignatureCanvas.vue' |
| | | import { add, edit, getDetail, addBatch } from './service' |
| | | import {add, addBatch, edit, getDetail} from './service' |
| | | import {myTeamPageList} from "@/components/chooseProject/servce"; |
| | | |
| | | export default { |
| | |
| | | }, |
| | | deactivated() { |
| | | this.cacheForm = JSON.parse(JSON.stringify(this.form)); |
| | | this.cacheForm.displayStrainSeq = this.displayStrainSeq |
| | | }, |
| | | async activated() { |
| | | await this.fetchTeamList(); |
| | |
| | | |
| | | if (this.cacheForm) { |
| | | this.form = this.cacheForm; |
| | | |
| | | if (this.cacheForm.displayStrainSeq) { |
| | | this.displayStrainSeq = this.cacheForm.displayStrainSeq; |
| | | } |
| | | } |
| | | |
| | | if (this.$route.query.id && !this.cacheForm) { |
| | |
| | | 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-library' }); |
| | | this.$message.success('操作成功'); |
| | |
| | | }, |
| | | deactivated() { |
| | | this.cacheForm = JSON.parse(JSON.stringify(this.form)); |
| | | this.cacheForm.displayStrainSeq = this.displayStrainSeq |
| | | }, |
| | | async activated() { |
| | | console.log('mounted') |
| | |
| | | preservationMethod: '', |
| | | remark: '' |
| | | } |
| | | this.displayStrainSeq = 0 |
| | | |
| | | console.log('this.cacheForm', this.cacheForm) |
| | | if (this.cacheForm) { |
| | | this.form = this.cacheForm; |
| | | if (this.cacheForm.displayStrainSeq) { |
| | | this.displayStrainSeq = this.cacheForm.displayStrainSeq; |
| | | } |
| | | return |
| | | } |
| | | |
| | | console.log('this.$route.query.id', this.$route.query.id) |
| | | if (this.$route.query.id && !this.cacheForm) { |
| | | getDetail({id: this.$route.query.id}).then(res => { |
| | | this.form = {...res} |
| | | const res = await getDetail({id: this.$route.query.id}); |
| | | this.form = {...res} |
| | | |
| | | console.log('projectId =', this.form.projectId, typeof this.form.projectId) |
| | | console.log('projectId =', this.form.projectId, typeof this.form.projectId) |
| | | |
| | | if (res.strainCode) { |
| | | const parts = res.strainCode.split('-'); |
| | | if (parts.length > 1) { |
| | | const seq = parts.pop(); |
| | | this.displayStrainSeq = seq.replace(/^0+/, ''); |
| | | this.form.strainCode = parts.join('-'); |
| | | } else { |
| | | this.form.strainCode = res.strainCode; |
| | | } |
| | | if (res.strainCode) { |
| | | const parts = res.strainCode.split('-'); |
| | | if (parts.length > 1) { |
| | | const seq = parts.pop(); |
| | | this.displayStrainSeq = seq.replace(/^0+/, ''); |
| | | this.form.strainCode = parts.join('-'); |
| | | } else { |
| | | this.form.strainCode = res.strainCode; |
| | | } |
| | | }) |
| | | } |
| | | |
| | | this.$forceUpdate(); |
| | | } |
| | | }, |
| | | watch: { |
| | |
| | | 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/strain-library-manage' }); |
| | | this.$message.success('操作成功'); |
| | |
| | | if (id) { |
| | | // 编辑 |
| | | edit({ ...submitData, id }).then(() => { |
| | | this.cacheForm = null |
| | | this.$router.back(); |
| | | }); |
| | | } else { |
| | | // 新增 |
| | | add(submitData).then(() => { |
| | | this.cacheForm = null |
| | | this.$router.back(); |
| | | }); |
| | | } |
| | | } else { |
| | | // 存草稿 |
| | | add(submitData).then(() => { |
| | | this.cacheForm = null |
| | | this.$router.back(); |
| | | }); |
| | | } |
| | |
| | | }, |
| | | mounted() { |
| | | this.getLists() |
| | | },activated() { |
| | | }, |
| | | activated() { |
| | | this.getLists() |
| | | }, |
| | | methods: { |
| | |
| | | params.id = this.$route.query.id |
| | | update(params).then(res => { |
| | | if (res.code == 200) { |
| | | this.cacheData = null |
| | | this.$message.success('编辑成功'); |
| | | this.$router.back() |
| | | } else { |
| | |
| | | update(params).then(res => { |
| | | this.submitLoading = false; |
| | | if (res.code == 200) { |
| | | this.cacheData = null |
| | | this.$message.success('编辑成功'); |
| | | this.$router.back() |
| | | this.cacheData = null; |
| | |
| | | |
| | | add(params).then(res => { |
| | | if (res.code == 200) { |
| | | this.cacheData = null |
| | | this.$message.success('发送成功'); |
| | | this.$router.push('/strainReportLibrary/reportLibraryThree'); |
| | | this.cacheData = null; |
| | |
| | | add(params).then(res => { |
| | | console.log('8', res); |
| | | if (res.code == 200) { |
| | | this.cacheData = null |
| | | this.$message.success('保存成功'); |
| | | this.$router.back() |
| | | } else { |