| | |
| | | <div class="app-container"> |
| | | <div style="display: flex;justify-content: space-between;"> |
| | | <el-form :model="entitySearch" ref="entitySearch" size="small" :inline="true"> |
| | | <el-form-item label="委托单号" prop="inspectionOrderCode"> |
| | | <el-input size="small" placeholder="请输入" clearable v-model="entitySearch.inspectionOrderCode" |
| | | @keyup.enter.native="refreshTable"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="试样名称" prop="sampleName"> |
| | | <el-input size="small" placeholder="请输入" clearable v-model="entitySearch.sampleName" |
| | | @keyup.enter.native="refreshTable"></el-input> |
| | |
| | | @keyup.enter.native="refreshTable()"></el-input> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button icon="el-icon-refresh" size="mini" @click="refresh">重 置</el-button> |
| | | <el-button type="primary" icon="el-icon-search" size="mini" @click="refreshTable">查 询</el-button> |
| | | <el-button type="primary" size="mini" @click="refreshTable">查询</el-button> |
| | | <el-button size="mini" @click="refresh">重置</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | <div style="text-align: right; margin-bottom: 20px"> |
| | | <div style="text-align: right; margin-bottom: 10px"> |
| | | <el-button size="small" type="primary" @click="goAdd">新增</el-button> |
| | | </div> |
| | | <div class="table"> |
| | | <el-table v-loading="tableListLoading" :data="tableList" height="530" style="width: 100%"> |
| | | <el-table-column align="center" label="序号" type="index" width="60"></el-table-column> |
| | | <el-table-column label="试样名称" prop="sampleName" show-overflow-tooltip width="120"></el-table-column> |
| | | <el-table-column label="委托编号" prop="entrustCode" show-overflow-tooltip width="120"></el-table-column> |
| | | <el-table-column label="委托时间" prop="commissionDate" width="120"></el-table-column> |
| | | <el-table-column label="型号" prop="modelNo"></el-table-column> |
| | | <el-table-column label="委托单位" prop="commissionUnit" show-overflow-tooltip width="120"></el-table-column> |
| | | <el-table-column label="生产单位" prop="production" show-overflow-tooltip width="120"></el-table-column> |
| | | <el-table v-loading="tableListLoading" :data="tableList" |
| | | height="630" border :header-cell-style="{ background: '#f8f8f9', color: '#515a6e' }"> |
| | | <el-table-column align="center" label="序号" type="index"></el-table-column> |
| | | <el-table-column label="委托单号" prop="inspectionOrderCode" min-width="160" show-overflow-tooltip></el-table-column> |
| | | <el-table-column label="试样名称" prop="sampleName" show-overflow-tooltip></el-table-column> |
| | | <el-table-column label="委托编号" prop="entrustCode" show-overflow-tooltip> |
| | | <template slot-scope="scope">{{ scope.row.entrustCode || '待生成' }}</template> |
| | | </el-table-column> |
| | | <el-table-column label="关联状态" min-width="90"> |
| | | <template slot-scope="scope">{{ scope.row.bindingStatus === 1 ? '已绑定' : '未绑定' }}</template> |
| | | </el-table-column> |
| | | <el-table-column label="下单状态" min-width="90"> |
| | | <template slot-scope="scope">{{ orderStateText(scope.row.orderState) }}</template> |
| | | </el-table-column> |
| | | <el-table-column label="检验进度" prop="insProgress" min-width="90"> |
| | | <template slot-scope="scope">{{ scope.row.insProgress || '--' }}</template> |
| | | </el-table-column> |
| | | <el-table-column label="检验结果" min-width="90"> |
| | | <template slot-scope="scope">{{ insResultText(scope.row.insResult) }}</template> |
| | | </el-table-column> |
| | | <el-table-column label="报告状态" min-width="90"> |
| | | <template slot-scope="scope">{{ reportStatusText(scope.row.reportStatus) }}</template> |
| | | </el-table-column> |
| | | <el-table-column label="委托时间" prop="commissionDate" show-overflow-tooltip></el-table-column> |
| | | <el-table-column label="型号" prop="modelNo" show-overflow-tooltip></el-table-column> |
| | | <el-table-column label="委托单位" prop="commissionUnit" show-overflow-tooltip></el-table-column> |
| | | <el-table-column label="生产单位" prop="production" show-overflow-tooltip></el-table-column> |
| | | <el-table-column label="委托人" prop="commissionUser"></el-table-column> |
| | | <el-table-column label="样品数量" prop="quantity"></el-table-column> |
| | | <el-table-column label="样品状态" prop="sampleStatus"></el-table-column> |
| | |
| | | <span v-if="scope.row.isLeave === 0">否</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="样品处理方式" prop="processing"> |
| | | <el-table-column label="样品处理方式" prop="processing" width="150"> |
| | | <template slot-scope="scope"> |
| | | <span v-if="scope.row.processing === 1">实验室处理</span> |
| | | <span v-if="scope.row.processing === 0">委托单位取回</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column align="center" label="操作" width="240" fixed="right"> |
| | | <el-table-column align="center" label="操作" width="320"> |
| | | <template slot-scope="scope"> |
| | | <el-button size="mini" type="text" @click="goUpdate(scope.row)">编辑</el-button> |
| | | <el-button size="mini" type="text" @click="handleLook(scope.row)">查看</el-button> |
| | | <el-button size="mini" style="color:#F56C6C" type="text" @click="deleteOrder(scope.row)">删除</el-button> |
| | | <el-button size="mini" type="text" @click="openDownloadDia(scope.row)">下载</el-button> |
| | | <el-button :disabled="!scope.row.fileUrl" size="mini" type="text" @click="openDownloadDia(scope.row)">下载</el-button> |
| | | <el-button v-if="canChangeBinding(scope.row)" size="mini" type="text" @click="openChangeBinding(scope.row)">变更关联</el-button> |
| | | <el-upload ref='upload' :action="action" :data="{ inspectionOrderId: scope.row.inspectionOrderId }" |
| | | :headers="uploadHeader" :on-error="onError" :on-success="handleSuccessUp" :show-file-list="false" |
| | | accept='image/jpg,image/jpeg,image/png,application/pdf,.doc,.docx,.xlsx' name="file" |
| | |
| | | @current-change="handleCurrentChange1"> |
| | | </el-pagination> |
| | | </div> |
| | | <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :visible.sync="orderRowsVisible" |
| | | title="新增检验任务单" width="1000px"> |
| | | <div style="display: flex; align-items: center;margin-bottom: 10px"> |
| | | <span style="width: 80px">委托编号:</span> |
| | | <el-input v-model="entity.entrustCode" clearable size="small" |
| | | style="width: 300px;margin-right: 10px"></el-input> |
| | | <el-button size="small" type="primary" @click="searchTableData">查询</el-button> |
| | | <el-button size="small" @click="refreshTableData">重 置</el-button> |
| | | </div> |
| | | <el-table v-loading="tableLoading" :data="tableData" height="550" style="width: 100%"> |
| | | <el-table-column align="center" label="序号" type="index" width="60"></el-table-column> |
| | | <el-table-column label="委托编号" prop="entrustCode"></el-table-column> |
| | | <el-table-column label="样品名称" prop="sample"></el-table-column> |
| | | <el-table-column align="center" label="操作"> |
| | | <template slot-scope="scope"> |
| | | <el-button align="center" size="mini" type="text" @click="goAddOrder(scope.row)">新增委托单</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <el-pagination :current-page="1" :page-size="tableSearch.size" :page-sizes="[10, 20, 30, 50, 100]" :total="total" |
| | | layout="->,total, sizes, prev, pager, next" style="margin-top: 10px" background @size-change="handleSizeChange" |
| | | @current-change="handleCurrentChange"> |
| | | </el-pagination> |
| | | </el-dialog> |
| | | <el-dialog :class="{ downPdf: title == '下载' }" :close-on-click-modal="false" :close-on-press-escape="false" |
| | | :modal="title != '下载'" :title="title" :visible.sync="detailDialogVisible" top="20px" width="1200px"> |
| | | <div style="max-height: 75vh;overflow-y: auto;"> |
| | | <div id="dialogBody"> |
| | | <table border="1" cellpadding="10" class="tables heads" style="border: 1px dashed black;"> |
| | | <table border="1" cellpadding="10" class="tables heads" style="border: 1px dashed black;width: 100%"> |
| | | <tr> |
| | | <td rowspan="2"> |
| | | <img alt="" src="@/assets/logo/ZTTlogo.png" style="width: 80%;"> |
| | |
| | | <p>记录编号: ZTT/QR-16-04-a</p> |
| | | </td> |
| | | <td> |
| | | <p>归档部门:综合室</p> |
| | | <p>归档部门:质量部</p> |
| | | </td> |
| | | </tr> |
| | | </table> |
| | | <h4 style="display: flex;align-items: center;flex-direction: column;justify-content: center;"> |
| | | <span style="font-size: 28px;">检 验 委 托 单</span> |
| | | </h4> |
| | | <p v-if="operationType !== 'view'" style="margin-left: 560px;display: flex;align-items: center"> |
| | | <span style="width: 100px">委托编号:</span> |
| | | <el-input v-model="currentInfo.entrustCode" clearable size="small"></el-input> |
| | | <p style="margin-left: 560px;display: flex;align-items: center"> |
| | | <span style="width: 100px">委托单号:</span> |
| | | <el-input v-model="currentInfo.inspectionOrderCode" disabled placeholder="保存后系统生成" size="small"></el-input> |
| | | </p> |
| | | <p v-if="operationType === 'view'" style="margin-top: 16px;margin-left: 600px;">委托编号:{{ |
| | | currentInfo.entrustCode }} |
| | | <p style="margin-top: 16px;margin-left: 600px;">委托编号:{{ |
| | | currentInfo.entrustCode || '待生成' }} |
| | | </p> |
| | | <table border="1" cellpadding="10" class="tables"> |
| | | <table border="1" cellpadding="10" class="tables" style="width: 100%"> |
| | | <tr> |
| | | <td colspan="2"> |
| | | <p>试样名称</p> |
| | |
| | | <td> |
| | | <p>委托单位</p> |
| | | </td> |
| | | <td v-if="operationType !== 'view'"><el-input v-model="currentInfo.commissionUnit" clearable |
| | | size="small"></el-input></td> |
| | | <td v-if="operationType !== 'view'"><el-input v-model="currentInfo.commissionUnit" disabled |
| | | placeholder="请选择委托单位" size="small"> |
| | | <template slot="append"><el-button icon="el-icon-search" @click="openCommissionUnitDialog"></el-button></template> |
| | | </el-input></td> |
| | | <td v-if="operationType === 'view'">{{ currentInfo.commissionUnit }}</td> |
| | | </tr> |
| | | <tr> |
| | |
| | | <td> |
| | | <p>委托人</p> |
| | | </td> |
| | | <td v-if="operationType !== 'view'"><el-input v-model="currentInfo.commissionUser" clearable |
| | | size="small"></el-input></td> |
| | | <td v-if="operationType !== 'view'"><el-input v-model="currentInfo.commissionUser" disabled |
| | | placeholder="请选择委托人" size="small"> |
| | | <template slot="append"><el-button icon="el-icon-search" @click="openCommissionUserDialog"></el-button></template> |
| | | </el-input></td> |
| | | <td v-if="operationType === 'view'">{{ currentInfo.commissionUser }}</td> |
| | | </tr> |
| | | <tr> |
| | |
| | | <td colspan="2"> |
| | | <p>委托人联系电话</p> |
| | | </td> |
| | | <td v-if="operationType !== 'view'" colspan="3"><el-input v-model="currentInfo.commissionPhone" clearable |
| | | size="small"></el-input></td> |
| | | <td v-if="operationType !== 'view'" colspan="3"><el-input v-model="currentInfo.commissionPhone" disabled |
| | | placeholder="选择委托人后自动带出" size="small"></el-input></td> |
| | | <td v-if="operationType === 'view'" colspan="3">{{ currentInfo.commissionPhone }}</td> |
| | | </tr> |
| | | <tr> |
| | |
| | | <td colspan="2"> |
| | | <p>领样员签名</p> |
| | | </td> |
| | | <td v-if="operationType !== 'view'"><el-input v-model="currentInfo.sampleTakerUser" clearable |
| | | size="small"></el-input></td> |
| | | <td v-if="operationType !== 'view'"><el-input v-model="currentInfo.sampleTakerUser" disabled |
| | | placeholder="下单关联后自动记录当前登录人" size="small"></el-input></td> |
| | | <td v-if="operationType === 'view'">{{ currentInfo.sampleTakerUser }}</td> |
| | | <td> |
| | | <p>领样日期</p> |
| | |
| | | <p>检测机构信息</p> |
| | | </td> |
| | | <td colspan="3"> |
| | | <p>江苏中天科技股份有限公司检测中心</p> |
| | | <p>江苏中天科技股份有限公司(软电缆检测室)</p> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td colspan="3"> |
| | | <p>地址:江苏省南通市经济技术开发区新开南路 19 号</p> |
| | | <p>地址:江苏省南通市如东县河口镇中天村五组168号</p> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td colspan="3"> |
| | | <p>电话:0513-89059043</p> |
| | | <p>电话:0513-84882686</p> |
| | | </td> |
| | | </tr> |
| | | </table> |
| | |
| | | <el-button @click="downloadDialog = false">取 消</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | <el-dialog :visible.sync="changeBindingVisible" title="变更关联委托单" width="500px" append-to-body> |
| | | <el-form ref="bindingForm" :model="bindingForm" :rules="bindingRules" label-width="100px"> |
| | | <el-form-item label="新的委托单" prop="inspectionOrderId"> |
| | | <el-select v-model="bindingForm.inspectionOrderId" filterable remote reserve-keyword |
| | | :remote-method="searchUnboundInspectionOrders" :loading="bindingLoading" placeholder="请选择未绑定委托单" |
| | | style="width: 100%" @focus="loadUnboundInspectionOrders"> |
| | | <el-option v-for="item in unboundInspectionOrders" :key="item.inspectionOrderId" |
| | | :label="`${item.inspectionOrderCode} / ${item.sampleName || ''}`" :value="item.inspectionOrderId" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="变更原因" prop="reason"> |
| | | <el-input v-model="bindingForm.reason" type="textarea" :rows="3" maxlength="200" show-word-limit /> |
| | | </el-form-item> |
| | | </el-form> |
| | | <span slot="footer"> |
| | | <el-button @click="changeBindingVisible = false">取 消</el-button> |
| | | <el-button type="primary" :loading="bindingSubmitting" @click="submitChangeBinding">确 定</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | <el-dialog :visible.sync="commissionUnitDialogVisible" title="选择委托单位" width="70%" append-to-body> |
| | | <lims-table :tableData="commissionUnitList" :column="commissionUnitColumns" :isSelection="true" |
| | | :handleSelectionChange="selectCommissionUnit" @pagination="changeCommissionUnitPage" :height="400" |
| | | :page="commissionUnitPage" :tableLoading="commissionUnitLoading" /> |
| | | <span slot="footer"><el-button @click="commissionUnitDialogVisible = false">取 消</el-button> |
| | | <el-button type="primary" @click="confirmCommissionUnit">确 定</el-button></span> |
| | | </el-dialog> |
| | | <el-dialog :visible.sync="commissionUserDialogVisible" title="选择委托人" width="70%" append-to-body> |
| | | <lims-table :tableData="commissionUserList" :column="commissionUserColumns" :isSelection="true" |
| | | :handleSelectionChange="selectCommissionUser" :height="400" :page="{ total: commissionUserList.length, size: 100, current: 1 }" /> |
| | | <span slot="footer"><el-button @click="commissionUserDialogVisible = false">取 消</el-button> |
| | | <el-button type="primary" @click="confirmCommissionUser">确 定</el-button></span> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { |
| | | addInspectionOrder, delInspectionOrder, exportInspectionOrder, |
| | | getInsOrderOnInspection, getInspectionOrderByInsOderId, getInspectionOrderOne, |
| | | changeInspectionOrderBinding, |
| | | getInspectionOrderOne, |
| | | pageUnboundInspectionOrder, |
| | | pageInspectionOrder, |
| | | updateInspectionOrder |
| | | } from "@/api/cnas/process/demand/demand"; |
| | | import limsTable from "@/components/Table/lims-table.vue"; |
| | | import { selectUserCondition } from "@/api/business/inspectionTask"; |
| | | import { selectCustomPageList } from "@/api/system/customer"; |
| | | |
| | | export default { |
| | | name: "a7-Inspection-Order-Form", |
| | | name: "Demand", |
| | | components: { limsTable }, |
| | | data() { |
| | | return { |
| | |
| | | }, |
| | | ], |
| | | operationType: '', |
| | | orderRowsVisible: false, |
| | | tableList: [], |
| | | tableListLoading: false, |
| | | pages: { |
| | | current: 1, |
| | | size: 20, |
| | | }, |
| | | tableData: [], |
| | | tableLoading: false, |
| | | tableSearch: { |
| | | current: 1, |
| | | size: 20, |
| | | }, |
| | | total: 0, |
| | | total1: 0, |
| | | entity: { |
| | | entrustCode: '' |
| | | }, |
| | | entitySearch: { |
| | | inspectionOrderCode: '', |
| | | sampleName: '', |
| | | commissionUnit: '', |
| | | production: '', |
| | |
| | | buttonLoading: false, |
| | | downloadDialog: false, |
| | | download: {}, |
| | | changeBindingVisible: false, |
| | | bindingLoading: false, |
| | | bindingSubmitting: false, |
| | | unboundInspectionOrders: [], |
| | | bindingForm: { |
| | | insOrderId: null, |
| | | inspectionOrderId: null, |
| | | reason: '' |
| | | }, |
| | | bindingRules: { |
| | | inspectionOrderId: [{ required: true, message: '请选择新的委托单', trigger: 'change' }], |
| | | reason: [{ required: true, message: '请输入变更原因', trigger: 'blur' }] |
| | | }, |
| | | commissionUnitDialogVisible: false, |
| | | commissionUnitLoading: false, |
| | | commissionUnitList: [], |
| | | commissionUnitSelection: [], |
| | | commissionUnitPage: { total: 0, size: 10, current: 1 }, |
| | | commissionUnitColumns: [ |
| | | { label: '客户名称', prop: 'company' }, |
| | | { label: '客户单位EN', prop: 'companyEn' }, |
| | | { label: '单位地址', prop: 'address' }, |
| | | { label: '单位电话', prop: 'phone' } |
| | | ], |
| | | commissionUserDialogVisible: false, |
| | | commissionUserList: [], |
| | | commissionUserSelection: [], |
| | | commissionUserColumns: [ |
| | | { label: '姓名', prop: 'name' }, |
| | | { label: '账号', prop: 'account' }, |
| | | { label: '联系电话', prop: 'phone' } |
| | | ], |
| | | }; |
| | | }, |
| | | mounted() { |
| | | // this.getPower() |
| | | this.getAuthorizedPerson() |
| | | this.refreshTable() |
| | | }, |
| | |
| | | } |
| | | }, |
| | | methods: { |
| | | openCommissionUnitDialog() { |
| | | this.commissionUnitSelection = [] |
| | | this.commissionUnitDialogVisible = true |
| | | this.loadCommissionUnitList() |
| | | }, |
| | | loadCommissionUnitList() { |
| | | this.commissionUnitLoading = true |
| | | selectCustomPageList({ ...this.commissionUnitPage }).then(res => { |
| | | this.commissionUnitList = res.data.records || [] |
| | | this.commissionUnitPage.total = res.data.total || 0 |
| | | }).finally(() => { this.commissionUnitLoading = false }) |
| | | }, |
| | | changeCommissionUnitPage({ page, limit }) { |
| | | this.commissionUnitPage.current = page |
| | | this.commissionUnitPage.size = limit |
| | | this.loadCommissionUnitList() |
| | | }, |
| | | selectCommissionUnit(rows) { this.commissionUnitSelection = rows }, |
| | | confirmCommissionUnit() { |
| | | if (this.commissionUnitSelection.length !== 1) { |
| | | this.$message.error('请选择一条委托单位') |
| | | return |
| | | } |
| | | const custom = this.commissionUnitSelection[0] |
| | | this.currentInfo.commissionUnitId = custom.id |
| | | this.currentInfo.commissionUnit = custom.company |
| | | this.commissionUnitDialogVisible = false |
| | | }, |
| | | openCommissionUserDialog() { |
| | | this.commissionUserSelection = [] |
| | | this.commissionUserDialogVisible = true |
| | | selectUserCondition().then(res => { this.commissionUserList = res.data || [] }) |
| | | }, |
| | | selectCommissionUser(rows) { this.commissionUserSelection = rows }, |
| | | confirmCommissionUser() { |
| | | if (this.commissionUserSelection.length !== 1) { |
| | | this.$message.error('请选择一位委托人') |
| | | return |
| | | } |
| | | const user = this.commissionUserSelection[0] |
| | | this.currentInfo.commissionUserId = user.id |
| | | this.currentInfo.commissionUser = user.name |
| | | this.currentInfo.commissionPhone = user.phone || '' |
| | | this.commissionUserDialogVisible = false |
| | | }, |
| | | loadDefaultCommissionUnit() { |
| | | selectCustomPageList({ current: 1, size: 10, company: '中天科技装备电缆有限公司' }).then(res => { |
| | | const custom = (res.data.records || []).find(item => item.company === '中天科技装备电缆有限公司') |
| | | if (custom) { |
| | | this.currentInfo.commissionUnitId = custom.id |
| | | this.currentInfo.commissionUnit = custom.company |
| | | } else { |
| | | this.$message.warning('未找到默认委托单位,请手动选择') |
| | | } |
| | | }) |
| | | }, |
| | | orderStateText(state) { |
| | | const states = { |
| | | 0: '待审核', |
| | | 1: '检验中', |
| | | 2: '退回', |
| | | 3: '撤销', |
| | | 4: '已检验' |
| | | } |
| | | return state === null || state === undefined ? '未下单' : (states[state] || '--') |
| | | }, |
| | | insResultText(result) { |
| | | const results = { |
| | | 0: '不合格', |
| | | 1: '合格', |
| | | 3: '不判定' |
| | | } |
| | | return result === null || result === undefined ? '待检验' : (results[result] || '--') |
| | | }, |
| | | reportStatusText(status) { |
| | | const statuses = { |
| | | 0: '未生成', |
| | | 1: '待同步', |
| | | 2: '可下载' |
| | | } |
| | | return statuses[status] || '未生成' |
| | | }, |
| | | canChangeBinding(row) { |
| | | return row.insOrderId && (row.orderState === 0 || row.orderState === 2) && !row.entrustCode |
| | | }, |
| | | openChangeBinding(row) { |
| | | this.bindingForm = { insOrderId: row.insOrderId, inspectionOrderId: null, reason: '' } |
| | | this.unboundInspectionOrders = [] |
| | | this.changeBindingVisible = true |
| | | this.loadUnboundInspectionOrders() |
| | | this.$nextTick(() => this.$refs.bindingForm && this.$refs.bindingForm.clearValidate()) |
| | | }, |
| | | loadUnboundInspectionOrders() { |
| | | this.searchUnboundInspectionOrders('') |
| | | }, |
| | | searchUnboundInspectionOrders(keyword) { |
| | | this.bindingLoading = true |
| | | pageUnboundInspectionOrder({ current: 1, size: 20, inspectionOrderCode: keyword }).then(res => { |
| | | this.unboundInspectionOrders = res.data.records || [] |
| | | }).finally(() => { |
| | | this.bindingLoading = false |
| | | }) |
| | | }, |
| | | submitChangeBinding() { |
| | | this.$refs.bindingForm.validate(valid => { |
| | | if (!valid) return |
| | | this.bindingSubmitting = true |
| | | changeInspectionOrderBinding(this.bindingForm).then(() => { |
| | | this.$message.success('关联已变更') |
| | | this.changeBindingVisible = false |
| | | this.refreshTable() |
| | | }).finally(() => { |
| | | this.bindingSubmitting = false |
| | | }) |
| | | }) |
| | | }, |
| | | addOrderDetailList() { |
| | | if (this.currentInfo.orderDetailList == null) { |
| | | this.currentInfo.orderDetailList = [] |
| | |
| | | // 重置 |
| | | refresh() { |
| | | this.entitySearch = { |
| | | inspectionOrderCode: '', |
| | | sampleName: '', |
| | | commissionUnit: '', |
| | | production: '', |
| | |
| | | goAdd() { |
| | | this.operationType = 'add' |
| | | this.title = '新增检验委托单'; |
| | | this.orderRowsVisible = true |
| | | this.searchTableData() |
| | | }, |
| | | // 查询可新增的检验单 |
| | | searchTableData() { |
| | | this.tableLoading = true |
| | | getInsOrderOnInspection({ |
| | | ...this.tableSearch, |
| | | ...this.entity |
| | | }).then(res => { |
| | | this.tableLoading = false |
| | | this.tableData = res.data.records |
| | | this.total = res.data.total |
| | | }).catch(err => { |
| | | this.tableLoading = false |
| | | }) |
| | | }, |
| | | // 重置检验单列表 |
| | | refreshTableData() { |
| | | this.entity = { |
| | | entrustCode: '' |
| | | this.currentInfo = { |
| | | isLeave: 1, |
| | | processing: 0, |
| | | send: 1, |
| | | criterionRule: 0, |
| | | orderDetailList: [] |
| | | } |
| | | this.tableSearch = { |
| | | current: 1, |
| | | size: 20, |
| | | } |
| | | this.searchTableData() |
| | | }, |
| | | // 检验单列表分页 |
| | | handleSizeChange(val) { |
| | | this.tableSearch.size = val |
| | | this.searchTableData(); |
| | | }, |
| | | handleCurrentChange(val) { |
| | | this.tableSearch.current = val |
| | | this.searchTableData(); |
| | | this.detailDialogVisible = true |
| | | this.loadDefaultCommissionUnit() |
| | | }, |
| | | // 列表分页 |
| | | handleSizeChange1(val) { |
| | |
| | | this.buttonLoading = true |
| | | addInspectionOrder(this.currentInfo).then(res => { |
| | | this.buttonLoading = false |
| | | this.$message.success('新增成功') |
| | | this.$message.success(`新增成功,委托单号:${res.data.inspectionOrderCode}`) |
| | | this.detailDialogVisible = false |
| | | this.orderRowsVisible = false |
| | | this.refreshTable() |
| | | }).catch(err => { |
| | | this.buttonLoading = false |
| | |
| | | this.buttonLoading = true |
| | | updateInspectionOrder(this.currentInfo).then(res => { |
| | | this.buttonLoading = false |
| | | if (res.code === 201) return |
| | | this.$message.success('新增成功') |
| | | this.$message.success('修改成功') |
| | | this.detailDialogVisible = false |
| | | this.orderRowsVisible = false |
| | | this.refreshTable() |
| | | }).catch(err => { |
| | | this.buttonLoading = false |
| | | }) |
| | | }, |
| | | // 查询需要新增的委托单详情 |
| | | goAddOrder(row) { |
| | | getInspectionOrderByInsOderId({ insOrderId: row.id }).then(res => { |
| | | this.currentInfo = res.data |
| | | this.title = '新增检验委托单'; |
| | | this.detailDialogVisible = true |
| | | }).catch(err => { |
| | | console.log('err----', err) |
| | | }) |
| | | }, |
| | | // 打开编辑弹框 |