曹睿
2025-02-25 20cf1938a8aa04a3f911d6d3729e8aec08a7d658
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
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
<template>
    <el-dialog title="新增检验委托单" :visible.sync="visible" width="1200px">
        <div id="dialogBody">
            <div style="max-height: 75vh;overflow-y: auto;">
                <div id="dialogBody">
                    <table border="1" cellpadding="10" class="tables heads">
                        <tr>
                            <td rowspan="2">
                                <img alt="" :src="ZTTLogo" style="width: 80%;">
                            </td>
                            <td>
                                <p>记录名称:检验委托单</p>
                            </td>
                            <td>
                                <p>保存期限:6年</p>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <p>记录编号: ZTT/QR-16-04-a</p>
                            </td>
                            <td>
                                <p>归档部门:综合室</p>
                            </td>
                        </tr>
                    </table>
                    <h4 class="table_h4">
                        检 验 委 托 单
                    </h4>
                    <p 
                        v-if="operationType !== 'view'" 
                        style="margin-left: 560px;display: flex;align-items: center">
                        <span style="width: 100px">委托编号:</span>
                        <el-input clearable size="small"></el-input>
                    </p>
                    <p v-else  style="margin-top: 16px;margin-left: 600px;">
                        委托编号:{{ currentInfo.entrustCode }}
                    </p>
                    <table border="1" cellpadding="10" class="tables">
                        <tr>
                            <td colspan="2">
                                <p>试样名称</p>
                            </td>
                            <td >
                                <el-input v-if="operationType !== 'view'" v-model="currentInfo.sampleName" clearable size="small"></el-input>
                                <span v-else>{{ currentInfo.sampleName }}</span>
                            </td>
                            <td>
                                <p>委托时间</p>
                            </td>
                            <td>
                                <el-date-picker
                                    v-if="operationType !== 'view'"
                                    v-model="currentInfo.commissionDate"
                                    clearable
                                    format="yyyy-MM-dd"
                                    placeholder="选择日期"
                                    size="small"
                                    style="width: 100%"
                                    type="date"
                                    value-format="yyyy-MM-dd">
                                </el-date-picker>
                                <span v-else>{{ currentInfo.commissionDate }}</span>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                <p>型 号</p>
                            </td>
                            <td>
                                <el-input v-if="operationType !== 'view'" v-model="currentInfo.modelNo" clearable size="small"></el-input>
                                <span v-else>{{ currentInfo.modelNo }}</span>
                            </td>
                            <td>
                                <p>委托单位</p>
                            </td>
                            <td>
                                <el-input  v-if="operationType !== 'view'" v-model="currentInfo.commissionUnit" clearable size="small"></el-input>
                                <span v-else>{{ currentInfo.commissionUnit }}</span>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                <p>生产单位</p>
                            </td>
                            <td>
                                <el-input v-if="operationType !== 'view'" v-model="currentInfo.production" clearable size="small"></el-input>
                                <span v-else>{{ currentInfo.production }}</span>
                            </td>
                            <td>
                                <p>委托人</p>
                            </td>
                            <td>
                                <el-input v-if="operationType !== 'view'" v-model="currentInfo.commissionUser" clearable size="small"></el-input>
                                <span v-else>{{ currentInfo.commissionUser }}</span>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                <p>样品数量</p>
                            </td>
                            <td>
                                <el-input v-if="operationType !== 'view'" v-model="currentInfo.quantity" clearable size="small"></el-input>
                                <span v-else>{{ currentInfo.quantity }}</span>
                            </td>
                            <td>
                                <p>样品状态</p>
                            </td>
                            <td>
                                <el-input v-if="operationType !== 'view'" v-model="currentInfo.sampleStatus" clearable size="small"></el-input>
                                <span v-else>{{ insStateList.find(m=>m.value==currentInfo.sampleStatus)?insStateList.find(m=>m.value==currentInfo.sampleStatus).label:'/' }}</span>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                <p>是否留样</p>
                            </td>
                            <td>
                                <el-radio-group 
                                    v-if="operationType !== 'view'"
                                    v-model="currentInfo.isLeave" 
                                    v-removeAriaHidden
                                >
                                    <el-radio :label="1">是</el-radio>
                                    <el-radio :label="0">否</el-radio>
                                </el-radio-group>
                                <div v-else>
                                    <span v-if="currentInfo.isLeave==1">是</span>
                                    <span v-else>否</span>
                                </div>
                            </td>
                            <td>
                                <p>样品处理方式</p>
                            </td>
                            <td v-if="operationType !== 'view'">
                                <el-radio-group v-model="currentInfo.processing" v-removeAriaHidden>
                                    <el-radio :label="0">委托单位取回</el-radio>
                                    <el-radio :label="1">实验室处理</el-radio>
                                </el-radio-group>
                            </td>
                            <td v-else>
                                <span v-if="currentInfo.processing==0">委托单位取回</span>
                                <span v-else>实验室处理</span>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                <p>约定完成时间(报告日期)</p>
                            </td>
                            <td>
                                <el-date-picker
                                    v-if="operationType !== 'view'"
                                    v-model="currentInfo.appointed"
                                    clearable
                                    format="yyyy-MM-dd"
                                    placeholder="选择日期"
                                    size="small"
                                    style="width: 100%"
                                    type="date"
                                    value-format="yyyy-MM-dd">
                                </el-date-picker>
                                <span v-else>
                                    {{ currentInfo.appointed }}
                                </span>
                            </td>
                            <td>
                                <p>报告发送方式</p>
                            </td>
                            <td >
                                <el-radio-group 
                                    v-if="operationType !== 'view'"
                                    v-model="currentInfo.send" v-removeAriaHidden
                                >
                                    <el-radio :label="1">自取</el-radio>
                                    <el-radio :label="0">其他</el-radio>
                                </el-radio-group>
                                <div v-else>
                                    <span v-if="currentInfo.send==1">自取</span>
                                    <span v-else>其他</span>
                                </div>
                            </td>
                        </tr>
                        <el-button class="add_btn" size="small" type="primary" @click="addOrderDetailList">添加</el-button>
                        <tr>
                            <td>
                                <p>序号</p>
                            </td>
                            <td>
                                <p>样品编号</p>
                            </td>
                            <td>
                                <p>试验项目</p>
                            </td>
                            <td>
                                <p>检验依据</p>
                            </td>
                            <td>
                                <p>备注</p>
                            </td>
                        </tr>
                        <tr v-for="(item,index) in currentInfo.orderDetailList" :key="index" >
                            <td>{{ index+1 }}</td>
                            <td>
                                <el-input  v-if="operationType !== 'view'" v-model="item.sampleNumber" clearable size="small"></el-input>
                                <span v-else>{{ item.sampleNumber }}</span>
                            </td>
                            <td>
                                <el-input v-if="operationType !== 'view'"v-model="item.testItem" clearable size="small"></el-input>
                                <span v-else>{{ item.testItem }}</span>
                            </td>
                            <td>
                                <el-input v-if="operationType !== 'view'" v-model="item.testStandard" clearable size="small"></el-input>
                                <span v-else>{{ item.testStandard }}</span>
                            </td>
                            <td>
                                <el-input v-if="operationType !== 'view'" v-model="item.remark" clearable size="small"></el-input>
                                <span v-else>{{ item.remark }}</span>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                <p>判定规则</p>
                            </td>
                            <td v-if="operationType !== 'view'" colspan="3">
                                <el-radio-group v-model="currentInfo.criterionRule" v-removeAriaHidden>
                                    <el-radio :label="0">不考虑不确定度</el-radio>
                                    <el-radio :label="1">考虑不确定度</el-radio>
                                </el-radio-group>
                                <span v-if="currentInfo.criterionRule === 1">
                                    <el-input v-model="currentInfo.criterionRuleRemark" clearable size="small" style="width: 60px"></el-input>
                                    %
                                </span>
                            </td>
                            <td v-else colspan="3">
                                <span v-if="currentInfo.criterionRule===0">不考虑不确定度</span>
                                <span v-if="currentInfo.criterionRule===1">考虑不确定度</span>
                                <span v-if="currentInfo.criterionRule===1">{{ currentInfo.criterionRuleRemark + '%' }}</span>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                <p>委托人签名</p>
                            </td>
                            <td>
                                <el-input v-if="operationType !== 'view'" v-model="currentInfo.commissionUser" clearable size="small"></el-input>
                                <span v-else>{{currentInfo.commissionUser}}</span>
                            </td>
                            <td>
                                <p>委托日期</p>
                            </td>
                            <td>
                                <el-date-picker
                                    v-if="operationType !== 'view'"
                                    v-model="currentInfo.commissionDate"
                                    clearable
                                    format="yyyy-MM-dd"
                                    placeholder="选择日期"
                                    size="small"
                                    style="width: 100%"
                                    type="date"
                                    value-format="yyyy-MM-dd">
                                </el-date-picker>
                                <span v-else>{{ currentInfo.commissionDate }}</span>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                <p>委托人联系电话</p>
                            </td>
                            <td colspan="3">
                                <el-input v-if="operationType !== 'view'" v-model="currentInfo.commissionPhone" clearable size="small"></el-input>
                                <span v-else>{{ currentInfo.commissionPhone }}</span>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                <p>综合室签名</p>
                            </td>
                            <td>
                                <el-input v-if="operationType !== 'view'" v-model="currentInfo.generalOfficeUser" clearable size="small"></el-input>
                                <span v-else>{{currentInfo.generalOfficeUser}}</span>
                            </td>
                            <td>
                                <p>接收日期</p>
                            </td>
                            <td>
                                <el-date-picker
                                    v-if="operationType !== 'view'"
                                    v-model="currentInfo.receiptData"
                                    clearable
                                    format="yyyy-MM-dd"
                                    placeholder="选择日期"
                                    size="small"
                                    style="width: 100%"
                                    type="date"
                                    value-format="yyyy-MM-dd">
                                </el-date-picker>
                                <span v-else>{{ currentInfo.receiptData }}</span>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                <p>领样员签名</p>
                            </td>
                            <td>
                                <el-input v-if="operationType !== 'view'" v-model="currentInfo.sampleTakerUser" clearable size="small"></el-input>
                                <span v-else>{{ currentInfo.sampleTakerUser }}</span>
                            </td>
                            <td>
                                <p>领样日期</p>
                            </td>
                            <td v-if="operationType !== 'view'">
                                <el-date-picker
                                v-model="currentInfo.sampleData"
                                clearable
                                format="yyyy-MM-dd"
                                placeholder="选择日期"
                                size="small"
                                style="width: 100%"
                                type="date"
                                value-format="yyyy-MM-dd">
                                </el-date-picker>
                            </td>
                            <td v-else>{{ currentInfo.sampleData }}</td>
                        </tr>
                        <tr>
                            <td colspan="2" rowspan="3">
                                <p>检测机构信息</p>
                            </td>
                            <td colspan="3">
                                <p>江苏中天科技股份有限公司检测中心</p>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="3">
                                <p>地址:江苏省南通市经济技术开发区新开南路 19 号</p>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="3">
                                <p>电话:0513-89059043</p>
                            </td>
                        </tr>
                    </table>
                    <p style="margin-top: 10px;margin-left: 20px;">注:本检验委托单一式二份,一份综合室归档,一份委托单位留存。</p>
                </div>
            </div>
        </div>
        <span v-if="operationType !== 'view'" slot="footer" class="dialog-footer">
            <el-button @click="detailDialogVisible = false">取 消</el-button>
            <el-button v-if="operationType === 'add'" :loading="buttonLoading" type="primary" @click="handleAdd">
                确 定
            </el-button>
            <el-button v-if="operationType === 'edit'" :loading="buttonLoading" type="primary" @click="handleEdit">
                确 定
            </el-button>
        </span>
    </el-dialog>
</template>
<script>
import ZTTLogo from "@/assets/logo/ZTTlogo.png"
export default {
    name: 'AddContracts',
    data() {
        return {
            ZTTLogo,
            visible: false,
            operationType: '',
            currentInfo:{
                orderDetailList: []
            },
        }
    },
    methods: {
        open() {
            this.visible = true
        }
    }
}
</script>
<style lang="scss" scoped>
.tables {
  table-layout: fixed;
  width: 100%;
  margin-top: 10px;
  border-collapse: collapse; /* 关键属性:合并边框 */
  td {
    height: 40px;
    width: 100px;
    text-align: center;
    font-size: 14px;
    word-wrap: break-word;
    white-space: normal;
    p {
        margin: unset
    }
  }
}
.heads {
    td {
        border: 1px dashed black; /* 单元格的虚线 */
        padding: 8px;
        text-align: left;
    }
}
.table_h4 {
    display: flex;
    align-items: center;
    flex-direction: column;
    justify-content: center;
    font-size: 28px;
    font-weight: bold;
    margin: 10px 0 10px 0;
}
.add_btn {
    margin: 10px 0 10px 10px;
}
</style>