| | |
| | | /** |
| | | * @description 检验委托单 |
| | | */ |
| | | |
| | | // 实验室的检测能力档案相关接口 |
| | | import request from "@/utils/request"; |
| | | |
| | |
| | | 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 |
| | | }) |
| | | } |
| | |
| | | <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"> |
| | |
| | | <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> |
| | |
| | | <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> |
| | |
| | | <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> |
| | |
| | | <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> |
| | |
| | | </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> |
| | |
| | | </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) |
| | | } |
| | | } |
| | | } |
| | |
| | | :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: { |
| | |
| | | return { |
| | | visible: false, |
| | | search: {}, |
| | | operationType: '', |
| | | column: [ |
| | | { label: '序号', minWidth: '100px' }, |
| | | { label: '委托编号', minWidth: '100px' }, |
| | |
| | | name: "新增委托单", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | this.$refs.addContractsRef.open() |
| | | this.operationType = 'add' |
| | | this.$refs.addContractsRef.open(row) |
| | | } |
| | | } |
| | | ], |
| | |
| | | }, |
| | | } |
| | | }, |
| | | // 打开弹窗 |
| | | 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 |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | </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> |
| | |
| | | operation: [ |
| | | { |
| | | name: "编 辑", |
| | | type: "text" |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | this.$refs.editRef.openAddContracts(row) |
| | | } |
| | | } |
| | | ], |
| | | }, |
| | |
| | | /** |
| | | * @desc 打开模态框 |
| | | */ |
| | | openDialog() { |
| | | this.$refs.editRef.open() |
| | | openDialog(type) { |
| | | this.$refs.editRef.open(type) |
| | | } |
| | | } |
| | | } |