曹睿
2025-02-25 e8fba4e48cf0ab5444b6e1c1fdae9f4e4cbc0af3
src/views/CNAS/process/demand/Edit.vue
@@ -16,13 +16,15 @@
                :page="page"
            />
        </el-dialog>
        <AddContracts ref="addContractsRef" />
        <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: {
@@ -33,6 +35,7 @@
            return {
                visible: false,
                search: {},
                operationType: '',
                column: [
                    { label: '序号', minWidth: '100px' },
                    { label: '委托编号', minWidth: '100px' },
@@ -46,7 +49,8 @@
                                name: "新增委托单",
                                type: "text",
                                clickFun: (row) => {
                                    this.$refs.addContractsRef.open()
                                    this.operationType = 'add'
                                    this.$refs.addContractsRef.open(row)
                                }
                            }
                        ],
@@ -60,9 +64,25 @@
                },
            }
        },
        // 打开弹窗
        methods: {
            open() {
            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
               }
            }
        }
    }