董国庆
昨天 c85d2427b749c5e7236f0474f9215e5936cdfa7c
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
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
<template>
  <el-dialog
    title="提交确认"
    :visible.sync="visible"
    width="80%"
    :close-on-click-modal="false"
    @close="handleClose"
  >
    <div class="approval-dialog">
      <div class="approval-content">
        <Card class="approval-content-card">
          <template>
            <div class="sample-info">
              <div class="info-item">
                <span class="label">项目课题方案名称:</span>
                <span class="value">{{ detailData.experimentDispatch?.projectName || '-' }}</span>
              </div>
              <div class="info-item">
                <span class="label">申请项目执行方案编号:</span>
                <span class="value">{{ detailData.experimentDispatch?.experimentCode || '-' }}</span>
              </div>
              <div class="info-item">
                <span class="label">实验编号:</span>
                <span class="value">{{ detailData.experimentDispatch?.experimentCode || '-' }}</span>
              </div>
              <div class="info-item">
                <span class="label">实验名称:</span>
                <span class="value">{{ detailData.experimentDispatch?.experimentName || '-' }}</span>
              </div>
              <div class="info-item">
                <span class="label">取样单编号:</span>
                <span class="value">{{ detailData.samplingCode || '-' }}</span>
              </div>
            </div>
 
            <div class="header-title" >
              <div class="header-title-left">
                <el-button
                  type="primary"
                  class="el-icon-plus"
                  @click="showAdditives = !showAdditives"
                >
                  {{ showAdditives ? "收起辅料详情" : "展开辅料详情" }}
                </el-button>
              </div>
            </div>
            <Table :data="sampleData" :total="0" :height="null">
              <template>
                <el-table-column
                  prop="index"
                  label="序号"
                  width="80"
                ></el-table-column>
                <el-table-column
                  prop="processTime"
                  label="工艺时间"
                  width="150"
                ></el-table-column>
                <el-table-column
                  prop="samplingName"
                  label="取样名称"
                  width="150"
                ></el-table-column>
                <el-table-column
                  prop="sampleCode"
                  label="取样样品编号"
                  width="150"
                ></el-table-column>
                <el-table-column
                  prop="temperature"
                  label="温度"
                  width="150"
                ></el-table-column>
                <el-table-column
                  prop="samplePh"
                  label="PH"
                  width="150"
                ></el-table-column>
                <el-table-column
                  prop="waterAddition"
                  label="加水量"
                  width="150"
                ></el-table-column>
                <template v-if="showAdditives">
                  <el-table-column
                    prop="addAuxiliaryOne"
                    label="加辅1"
                    width="150"
                  ></el-table-column>
                  <el-table-column
                    prop="addAuxiliaryTwo"
                    label="加辅2"
                    width="150"
                  ></el-table-column>
                  <el-table-column
                    prop="addAuxiliaryThree"
                    label="加辅3"
                    width="150"
                  ></el-table-column>
                  <el-table-column
                    prop="addAuxiliaryFour"
                    label="加辅4"
                    width="150"
                  ></el-table-column>
                  <el-table-column
                    prop="addAuxiliaryFive"
                    label="加辅5"
                    width="150"
                  ></el-table-column>
                  <el-table-column
                    prop="addAuxiliarySix"
                    label="加辅6"
                    width="150"
                  ></el-table-column>
                  <el-table-column
                    prop="addAuxiliarySeven"
                    label="加辅7"
                    width="150"
                  ></el-table-column>
                  <el-table-column
                    prop="addAuxiliaryEight"
                    label="加辅8"
                    width="150"
                  ></el-table-column>
                  <el-table-column
                    prop="addAuxiliaryNine"
                    label="加辅9"
                    width="150"
                  ></el-table-column>
                  <el-table-column
                    prop="addAuxiliaryTen"
                    label="加辅10"
                    width="150"
                  ></el-table-column>
                </template>
                <el-table-column
                  prop="sampleAmount"
                  label="取样量"
                  width="150"
                ></el-table-column>
                <el-table-column
                  prop="pictures"
                  label="拍照"
                  width="150"
                >
                  <template slot-scope="scope">
                    <el-image
                      v-for="(url, index) in scope.row.pictures.split(',')" 
                      :key="index"
                      :src="url"
                      :preview-src-list="[url]"
                      style="width: 50px; height: 50px;"
                    />
                  </template>
                </el-table-column>
                <el-table-column
                  prop="handlePersonName"
                  fixed="right"
                  label="操作人员"
                  width="150"
                ></el-table-column>
              </template>
            </Table>
          </template>
        </Card>
      </div>
    </div>
 
    <div class="approval-dialog-approve">
      <div class="add-group">
        <div>*</div>
        <span>签字确认</span>
        <el-button type="primary" class="el-icon-plus" @click="openSignature"
          >签名</el-button
        >
      </div>
      <img
        v-if="imgSrc"
        style="width: 200px; height: 100px; margin-left: 25px"
        :src="imgSrc"
        fit="fit"
      />
    </div>
 
    <div slot="footer" class="dialog-footer select-member-footer">
      <el-button @click="handleClose">取 消</el-button>
      <el-button type="primary" @click="handleConfirm">确 认</el-button>
    </div>
 
    <SignatureCanvas
      :visible="signatureDialogVisible"
      @confirm="handleSignatureConfirm"
    />
  </el-dialog>
</template>
 
<script>
import SignatureCanvas from "@/components/SignatureCanvas.vue";
import moment from 'moment';
 
export default {
  name: "ConfirmDialog",
  components: {
    SignatureCanvas,
  },
  props: {
    visible: {
      type: Boolean,
      default: false,
    },
    formData: {
      type: Object,
      default: () => ({}),
    },
    sampleData: {
      type: Array,
      default: () => [],
    },
    detailData: {
      type: Object,
      default: () => ({}),
    },
  },
  data() {
    return {
      signatureDialogVisible: false,
      imgSrc: "https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg",
      showAdditives: true,
    };
  },
  methods: {
    handleClose() {
      this.$emit("update:visible", false);
      this.imgSrc = "https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg";
    },
    openSignature() {
      this.signatureDialogVisible = true;
    },
    handleSignatureConfirm(imageData) {
      this.signatureDialogVisible = false;
      this.imgSrc = imageData;
    },
    handleConfirm() {
      if (!this.imgSrc) {
        this.$message.warning("请先完成签名确认");
        return;
      }
      const now = new Date().toISOString();
      const params = {
        id: this.detailData.id,
        commitPersonId: this.detailData.commitPersonId,
        commitSign: this.imgSrc,
        commitTime: moment().format('YYYY-MM-DD HH:mm:ss'),
        dispatchId: this.detailData.experimentDispatch?.id,
        samplingCode: this.detailData.samplingCode,
        remark: this.formData.remark,
        samplingRecordOperations: this.sampleData,
        status: 2 // 已提交状态
      };
      this.$emit("confirm", params);
      this.handleClose();
    },
  },
};
</script>
 
<style lang="less" scoped>
::v-deep .el-dialog__header {
  border-bottom: 1px solid #e4e7ed;
}
 
.approval-dialog {
  display: flex;
  max-height: 60vh;
  overflow-y: auto;
 
  .approval-content {
    width: 100%;
    flex: 1;
    background: #ffffff;
    box-shadow: 0px 4px 12px 4px rgba(0, 0, 0, 0.08);
    border-radius: 10px;
  }
}
 
.approval-content-card {
  box-shadow: none !important;
  padding-top: 0px !important;
  padding-bottom: 0px !important;
  height: calc(100% - 10px) !important;
  // overflow: unset !important;
}
 
.header-title {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 20px;
 
  .header-title-left {
    display: flex;
    align-items: center;
    gap: 13px;
 
    img {
      width: 12px;
      height: 19px;
    }
 
    span {
      flex-shrink: 0;
      font-weight: bold;
      font-size: 18px;
      color: #222222;
      line-height: 27px;
      font-family: "Source Han Sans CN Bold Bold";
    }
  }
}
 
.sample-info {
  padding: 0 25px;
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
 
  .info-item {
    width: calc(50% - 7.5px);
    display: flex;
    align-items: center;
 
    .label {
      color: #606266;
      margin-right: 10px;
      white-space: nowrap;
    }
 
    .value {
      color: #303133;
      font-weight: 500;
    }
  }
}
 
.approval-dialog-approve {
  margin-top: 26px;
 
  img {
    border: 2px dashed #049c9a;
  }
}
 
.add-group {
  padding-left: 25px;
  margin-top: 14px;
  display: flex;
  align-items: center;
  margin-bottom: 19px;
 
  div {
    color: #f56c6c;
  }
 
  span {
    font-weight: 500;
    font-size: 14px;
    color: #222222;
    line-height: 21px;
    margin: 0 32px 0 8px;
  }
}
 
.dialog-footer {
  align-items: center;
  display: flex;
  justify-content: center;
 
  button {
    width: 150px;
  }
}
</style>