曹睿
2025-02-25 e8fba4e48cf0ab5444b6e1c1fdae9f4e4cbc0af3
feat: 完成7.1页面接口没测
已修改4个文件
155 ■■■■ 文件已修改
src/api/cnas/process/demand/demand.js 49 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/process/demand/AddContracts.vue 69 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/process/demand/Edit.vue 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/process/demand/index.vue 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/cnas/process/demand/demand.js
@@ -1,3 +1,7 @@
/**
 * @description 检验委托单
 */
// 实验室的检测能力档案相关接口
import request from "@/utils/request";
@@ -8,4 +12,49 @@
        method: "get",
        params: params
    })
}
// 新增时根据成品订单查询委托单详情
export const getInspectionOrderByInsOderId = (params) => {
    return request({
        url: "/inspectionOrder/getInspectionOrderByInsOderId",
        method: "get",
        params: params
    })
}
// 查询可新增的检验单
export const getInsOrderOnInspection = (data) => {
    return request({
        url: "/inspectionOrder/getInsOrderOnInspection",
        method: "post",
        data: data
    })
}
// 查看委托单详情
export const getInspectionOrderOne = (params) => {
    return request({
        url: "/inspectionOrder/getInspectionOrderOne",
        method: "get",
        params: params
    })
}
// 新增检验单
export const addInspectionOrder = (data) => {
    return request({
        url: "/inspectionOrder/addInspectionOrder",
        method: "post",
        data: data
    })
}
// 编辑检验单
export const editInspectionOrder = (data) => {
    return request({
        url: "/inspectionOrder/editInspectionOrder",
        method: "post",
        data: data
    })
}
src/views/CNAS/process/demand/AddContracts.vue
@@ -1,5 +1,5 @@
<template>
    <el-dialog title="新增检验委托单" :visible.sync="visible" width="1200px">
    <el-dialog :title="title" :visible.sync="visible" width="1200px">
        <div id="dialogBody">
            <div style="max-height: 75vh;overflow-y: auto;">
                <div id="dialogBody">
@@ -119,7 +119,6 @@
                                <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>
@@ -133,7 +132,7 @@
                                <p>样品处理方式</p>
                            </td>
                            <td v-if="operationType !== 'view'">
                                <el-radio-group v-model="currentInfo.processing" v-removeAriaHidden>
                                <el-radio-group v-model="currentInfo.processing">
                                    <el-radio :label="0">委托单位取回</el-radio>
                                    <el-radio :label="1">实验室处理</el-radio>
                                </el-radio-group>
@@ -169,7 +168,7 @@
                            <td >
                                <el-radio-group 
                                    v-if="operationType !== 'view'"
                                    v-model="currentInfo.send" v-removeAriaHidden
                                    v-model="currentInfo.send"
                                >
                                    <el-radio :label="1">自取</el-radio>
                                    <el-radio :label="0">其他</el-radio>
@@ -222,7 +221,7 @@
                                <p>判定规则</p>
                            </td>
                            <td v-if="operationType !== 'view'" colspan="3">
                                <el-radio-group v-model="currentInfo.criterionRule" v-removeAriaHidden>
                                <el-radio-group v-model="currentInfo.criterionRule">
                                    <el-radio :label="0">不考虑不确定度</el-radio>
                                    <el-radio :label="1">考虑不确定度</el-radio>
                                </el-radio-group>
@@ -348,10 +347,7 @@
        </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 :loading="buttonLoading" type="primary" @click="handleSubmit">
                确 定
            </el-button>
        </span>
@@ -359,21 +355,72 @@
</template>
<script>
import ZTTLogo from "@/assets/logo/ZTTlogo.png"
import { getInspectionOrderByInsOderId, getInspectionOrderOne, addInspectionOrder, editInspectionOrder } from "@/api/cnas/process/demand/demand.js"
export default {
    name: 'AddContracts',
    props: {
        operationType: {
            type: String,
            default: ''
        },
    },
    data() {
        return {
            title: '',
            ZTTLogo,
            visible: false,
            operationType: '',
            currentInfo:{
                orderDetailList: []
            },
            buttonLoading: false
        }
    },
    methods: {
        open() {
        open(row) {
            this.visible = true
            if(operationType == 'add') {
                this.goAddOrder(row)
            } else {
            }
        },
        // 打开弹窗的时候,查询需要新增的委托单详情
        async goAddOrder(row) {
            this.title = '新增检验委托单';
            const { code, data } = await getInspectionOrderByInsOderId({
                insOrderId: row.id
            })
            if(code == 200) {
                this.currentInfo = res.data
                this.detailDialogVisible = true
            }
        },
        async goUpdateOrder(row) {
            this.title = '编辑检验委托单';
            const { code, data } = await getInspectionOrderOne({
                insOrderId: row.inspectionOrderId
            })
            if(code == 200) {
                this.currentInfo = res.data
                this.detailDialogVisible = true
            }
        },
        addOrderDetailList() {
            if (this.currentInfo.orderDetailList == null) {
                this.currentInfo.orderDetailList = []
            }
            this.currentInfo.orderDetailList.push({
                sampleNumber: '',
                testItem: '',
                testStandard: '',
                standardMethodList: '',
                remark: '',
            })
        },
        async handleSubmit() {
            this.operationType == 'add' ? await addInspectionOrder(this.currentInfo) : await editInspectionOrder(this.currentInfo)
        }
    }
}
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
               }
            }
        }
    }
src/views/CNAS/process/demand/index.vue
@@ -75,7 +75,7 @@
            </el-form-item>
        </el-form>
        <div style="margin-bottom: 10px">
            <el-button size="small" type="primary" icon="el-icon-plus" @click="openDialog">
            <el-button size="small" type="primary" icon="el-icon-plus" @click="openDialog('add')">
                新 增
            </el-button>
        </div>
@@ -126,7 +126,10 @@
                    operation: [
                        {
                            name: "编 辑",
                            type: "text"
                            type: "text",
                            clickFun: (row) => {
                                this.$refs.editRef.openAddContracts(row)
                            }
                        }
                    ],
                },
@@ -152,8 +155,8 @@
        /**
         * @desc 打开模态框
         */
        openDialog() {
            this.$refs.editRef.open()
        openDialog(type) {
            this.$refs.editRef.open(type)
        }
    }
}