| | |
| | | <el-image |
| | | v-for="(url, index) in scope.row.pictures.split(',')" |
| | | :key="index" |
| | | src="https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg" |
| | | :preview-src-list="[url]" |
| | | :src="getFullUrl(url)" |
| | | :preview-src-list="[getFullUrl(url)]" |
| | | style="width: 50px; height: 50px;" |
| | | /> |
| | | </template> |
| | |
| | | import addTime from "./components/addTime.vue"; |
| | | import ReceiveConfirmDialog from "./components/receiveConfirmDialog.vue"; |
| | | import { add, getDetail, update, batchCollectSamples } from "./service"; |
| | | import {getFullUrl} from '@/utils/utils.js' |
| | | |
| | | export default { |
| | | name: "AddSample", |
| | |
| | | }, |
| | | }, |
| | | methods: { |
| | | getFullUrl, |
| | | // 获取详情数据 |
| | | async getDetailData(id) { |
| | | try { |
| | | const res = await getDetail({ id }); |
| | | if (res) { |
| | | const detail = res; |
| | | console.log('获取到的详情数据:', detail); |
| | | |
| | | // 设置表单数据 |
| | | this.form = { |
| | | ...this.form, |
| | |
| | | } |
| | | |
| | | // 如果是详情模式,禁用所有输入 |
| | | if (this.pageType == 'detail') { |
| | | this.$nextTick(() => { |
| | | const inputs = document.querySelectorAll('input, textarea, select'); |
| | | inputs.forEach(input => { |
| | | input.disabled = true; |
| | | }); |
| | | }); |
| | | } |
| | | // if (this.pageType == 'detail') { |
| | | // this.$nextTick(() => { |
| | | // const inputs = document.querySelectorAll('input, textarea, select'); |
| | | // inputs.forEach(input => { |
| | | // input.disabled = true; |
| | | // }); |
| | | // }); |
| | | // } |
| | | } |
| | | } catch (error) { |
| | | console.error('获取详情失败:', error); |
| | |
| | | }; |
| | | |
| | | // 打印提交数据 |
| | | console.log('草稿提交数据:', submitData); |
| | | |
| | | let res; |
| | | if (this.pageType == 'edit') { |
| | | // 编辑模式调用update接口 |
| | |
| | | } |
| | | }, |
| | | handlePendingSelectionChange(selection) { |
| | | console.log("pending selection change:", selection); |
| | | console.log("pending samples data:", this.pendingSamples); |
| | | this.selectedSamples = selection; |
| | | // 强制更新视图 |
| | |
| | | }, |
| | | confirmReceive(signature) { |
| | | // 获取选中样品的ID并拼接 |
| | | const recordOperationIds = this.selectedSamples.map(item => item.id).join(','); |
| | | const recordOperationIds = this.selectedSamples.map(item => item.id); |
| | | |
| | | // 调用批量收样接口 |
| | | batchCollectSamples({ |
| | |
| | | |
| | | }, |
| | | isSelectable(row) { |
| | | console.log('isSelectable row:', row); |
| | | console.log('row status:', row.status, typeof row.status); |
| | | const result = String(row.status) == '2'; |
| | | console.log('isSelectable result:', result); |
| | | return result; |
| | | }, |
| | | }, |