hejianhao
2025-04-24 c76e6648647e6174f4070313887d353a36e6d17c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
<template>
  <Card>
    <div class="header-title-left">
      <img src="@/assets/public/headercard.png" />
      <div>所属实验调度</div>
    </div>
    <Table :data="schedulingData" :total="schedulingTotal" :height="null">
      <template>
        <el-table-column prop="planCode" label="所属项目课题方案" width="150"></el-table-column>
        <el-table-column prop="experimentCode" label="实验编号" width="150"></el-table-column>
        <el-table-column prop="experimentName" label="实验名称" width="150"></el-table-column>
        <el-table-column prop="notifyTime" label="通知时间" width="150"></el-table-column>
        <el-table-column prop="startTime" label="实验开始时间" width="150"></el-table-column>
        <el-table-column prop="endTime" label="实验结束时间" width="150"></el-table-column>
        <el-table-column prop="participants" label="参加人员" width="150"></el-table-column>
        <el-table-column prop="status" label="状态" width="100"></el-table-column>
      </template>
    </Table>
 
    <!-- 送样-收样记录部分 -->
    <div class="sample-record-section">
      <div class="header-title-left" style="margin-top: 38px">
        <img src="@/assets/public/headercard.png" />
        <span>送样-收样记录</span>
        <el-button
          type="primary"
          class="el-icon-plus"
          @click="showAdditives = !showAdditives"
        >
          {{ showAdditives ? "收起辅料详情" : "展开辅料详情" }}
        </el-button>
      </div>
      <div class="sample-code">取样单编号:{{ form.sampleCode || 'DD-25010BS01' }}</div>
      
      <div class="sample-table">
        <div class="table-header">
          <el-button type="primary" class="batch-send" @click="handleBatchSend">批量发送</el-button>
        </div>
        <Table :data="sampleList" :total="sampleTotal" :height="null" @selection-change="handleSelectionChange">
          <template>
            <el-table-column type="selection" width="55"></el-table-column>
            <el-table-column prop="index" label="序号" width="80"></el-table-column>
            <el-table-column prop="processTime" label="工艺时间间/h" width="120"></el-table-column>
            <el-table-column prop="sampleName" label="取样名称" width="150"></el-table-column>
            <el-table-column prop="sampleCode" label="取样样品编号" width="150"></el-table-column>
            <el-table-column prop="temperature" label="温度" width="100"></el-table-column>
            <el-table-column prop="ph" label="PH" width="100"></el-table-column>
            <el-table-column prop="waterAmount" label="加水量" width="100"></el-table-column>
            <template v-if="showAdditives">
              <el-table-column prop="additive1" label="加辅1" width="150"></el-table-column>
              <el-table-column prop="additive2" label="加辅2" width="150"></el-table-column>
              <el-table-column prop="additive3" label="加辅3" width="150"></el-table-column>
              <el-table-column prop="additive4" label="加辅4" width="150"></el-table-column>
              <el-table-column prop="additive5" label="加辅5" width="150"></el-table-column>
              <el-table-column prop="additive6" label="加辅6" width="150"></el-table-column>
              <el-table-column prop="additive7" label="加辅7" width="150"></el-table-column>
              <el-table-column prop="additive8" label="加辅8" width="150"></el-table-column>
              <el-table-column prop="additive9" label="加辅9" width="150"></el-table-column>
              <el-table-column prop="additive10" label="加辅10" width="150"></el-table-column>
            </template>
            <el-table-column prop="sampleAmount" label="取样量" width="100"></el-table-column>
            <el-table-column prop="sampleTime" label="取样时间" width="150"></el-table-column>
            <el-table-column prop="photo" label="拍照" width="100">
              <template slot-scope="scope">
                <img v-if="scope.row.photo" :src="scope.row.photo" class="sample-photo" />
              </template>
            </el-table-column>
            <el-table-column prop="operator" label="操作人" width="100"></el-table-column>
            <el-table-column prop="status" label="状态" width="100"></el-table-column>
            <el-table-column label="操作" width="100" fixed="right">
              <template slot-scope="scope">
                <el-button type="text" @click="handleSend(scope.row)" v-if="scope.row.status === '待发送'">发送</el-button>
              </template>
            </el-table-column>
          </template>
        </Table>
      </div>
    </div>
 
    <receive-confirm-dialog
      :visible.sync="showReceiveConfirm"
      :sample-count="selectedSamples.length"
      @confirm="confirmSend"
    />
  </Card>
</template>
 
<script>
import ReceiveConfirmDialog from './components/receiveConfirmDialog.vue'
 
export default {
  name: "SampleSubmission",
  components: {
    ReceiveConfirmDialog
  },
  data() {
    return {
      showReceiveConfirm: false,
      showAdditives: true,
      schedulingData: [{
        planCode: 'DD-EX001',
        experimentCode: 'DD-EX001',
        experimentName: '名称名称名称',
        notifyTime: '2025-1-2 14:50:19',
        startTime: '2025-02-27',
        endTime: '2025-06-06',
        participants: '张弘, 李天浩, 陈三, 李四',
        status: '已确认'
      }],
      schedulingTotal: 1,
      form: {
        sampleCode: "DD-25010BS01",
      },
      sampleList: [
        {
          index: 1,
          processTime: "2",
          sampleName: "名称名称名称",
          sampleCode: "314234321",
          temperature: "34",
          ph: "34",
          waterAmount: "34",
          additive1: "10g",
          additive2: "5g",
          additive3: "3g",
          additive4: "",
          additive5: "",
          additive6: "",
          additive7: "",
          additive8: "",
          additive9: "",
          additive10: "",
          sampleAmount: "34",
          sampleTime: "2025-1-9 15:26:08",
          photo: "@/assets/sample-photos/photo1.jpg",
          operator: "张三",
          status: "待发送"
        },
        {
          index: 2,
          processTime: "4",
          sampleName: "名称名称名称",
          sampleCode: "314234321",
          temperature: "23",
          ph: "23",
          waterAmount: "23",
          additive1: "8g",
          additive2: "4g",
          additive3: "",
          additive4: "",
          additive5: "",
          additive6: "",
          additive7: "",
          additive8: "",
          additive9: "",
          additive10: "",
          sampleAmount: "23",
          sampleTime: "2025-1-9 15:26:08",
          photo: "@/assets/sample-photos/photo2.jpg",
          operator: "李四",
          status: "待接收"
        },
        {
          index: 3,
          processTime: "8",
          sampleName: "名称名称名称",
          sampleCode: "314234321",
          temperature: "23",
          ph: "23",
          waterAmount: "23",
          additive1: "",
          additive2: "",
          additive3: "",
          additive4: "",
          additive5: "",
          additive6: "",
          additive7: "",
          additive8: "",
          additive9: "",
          additive10: "",
          sampleAmount: "23",
          sampleTime: "2025-1-9 15:26:08",
          photo: "@/assets/sample-photos/photo3.jpg",
          operator: "王五",
          status: "已接收"
        }
      ],
      sampleTotal: 3,
      selectedSamples: []
    };
  },
  methods: {
    handleSelectionChange(selection) {
      this.selectedSamples = selection;
    },
    handleSend(row) {
      this.selectedSamples = [row];
      this.showReceiveConfirm = true;
    },
    handleBatchSend() {
      if (this.selectedSamples.length === 0) {
        this.$message.warning('请先选择要发送的样品');
        return;
      }
      this.showReceiveConfirm = true;
    },
    confirmSend(signature) {
      // 处理发送确认逻辑
      const sampleIds = this.selectedSamples.map(item => item.id);
      console.log('发送样品', { sampleIds, signature });
      
      // 更新状态
      this.selectedSamples.forEach(sample => {
        const index = this.sampleList.findIndex(item => item.id === sample.id);
        if (index > -1) {
          this.sampleList[index].status = '待接收';
        }
      });
      
      this.$message.success(`成功发送 ${this.selectedSamples.length} 个样品`);
      this.selectedSamples = [];
    }
  }
};
</script>
 
<style lang="less" scoped>
.header-title-left {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 20px;
 
  img {
    width: 12px;
    height: 19px;
  }
 
  div, span {
    flex-shrink: 0;
    font-weight: bold;
    font-size: 18px;
    color: #222222;
    line-height: 27px;
    font-family: "Source Han Sans CN Bold Bold";
  }
 
  div:before {
    content: "*";
    color: #f56c6c;
    margin-right: 4px;
  }
 
  .el-button {
    margin-left: 16px;
  }
}
 
.sample-record-section {
  .sample-code {
    font-family: PingFangSC, PingFang SC;
    font-weight: 400;
    font-size: 14px;
    color: rgba(0,0,0,0.88);
    margin: 20px 0;
  }
 
  .table-header {
    margin-bottom: 16px;
    text-align: left;
  }
 
  .sample-photo {
    width: 60px;
    height: 60px;
    object-fit: cover;
  }
}
</style>