曹睿
2025-02-25 e8fba4e48cf0ab5444b6e1c1fdae9f4e4cbc0af3
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
<template>
    <div>
        <el-dialog title="新增检验任务单" :visible.sync="visible">
            <el-form :model="search" :inline="true">
                <el-form-item label="委托编号:">
                    <el-input placeholder="请输入委托编号"></el-input>
                </el-form-item>
                <el-form-item>
                    <el-button type="primary">查 询</el-button>
                    <el-button>重 置</el-button>
                </el-form-item>
            </el-form>
            <lims-table
                :column="column"
                :tableData="tableData"
                :page="page"
            />
        </el-dialog>
        <AddContracts ref="addContractsRef" :operationType="operationType" />
    </div>
</template>
 
<script>
    import limsTable from "@/components/Table/lims-table.vue";
    import AddContracts from "./AddContracts.vue";
    import { getInsOrderOnInspection } from "@/api/cnas/process/demand/demand.js"
 
    export default {
        name: 'EditDemand',
        components: {
            limsTable,
            AddContracts
        },
        data() {
            return {
                visible: false,
                search: {},
                operationType: '',
                column: [
                    { label: '序号', minWidth: '100px' },
                    { label: '委托编号', minWidth: '100px' },
                    { label: '样品名称', minWidth: '100px' },
                    {
                        dataType: "action",
                        fixed: "right",
                        label: "操作",
                        operation: [
                            {
                                name: "新增委托单",
                                type: "text",
                                clickFun: (row) => {
                                    this.operationType = 'add'
                                    this.$refs.addContractsRef.open(row)
                                }
                            }
                        ],
                    },
                ],
                tableData: [{}],
                page: {
                    total: 0,
                    size: 10,
                    current: 1,
                },
            }
        },
        // 打开弹窗
        methods: {
            open(type) {
                this.visible = true
                this.operationType = type
                this.getTableData()
            },
            openAddContracts(row) {
                this.operationType = 'edit'
                this.$refs.addContractsRef.open(row)
            },
            async getTableData() {
                // 查询当前弹窗表数据
               const { code, data } = await getInsOrderOnInspection({
                    ...this.search, ...this.page
               })
               if (code === 200) {
                   this.tableData = data
               }
            }
        }
    }
</script>