| | |
| | | <el-input v-model="addObj.entrustCode" clearable disabled placeholder="系统生成" size="small"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col v-if="active == 1" :span="6"> |
| | | <el-form-item label="检验委托单:" prop="inspectionOrderId"> |
| | | <el-input v-model="addObj.inspectionOrderCode" disabled placeholder="请选择检验委托单" size="small" style="width: 208px"> |
| | | <template slot="append"> |
| | | <el-button slot="append" icon="el-icon-search" @click="openInspectionOrderList"></el-button> |
| | | </template> |
| | | </el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <el-form-item label="检验类别:" prop="orderType"> |
| | | <el-select v-model="addObj.orderType" :disabled="active>1&&tabIndex!=4" clearable size="small" style="width: 100%;"> |
| | |
| | | <el-input v-model="addObj.custom" disabled size="small" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="6"> |
| | | <el-form-item label="委托单位:" prop="company"> |
| | | <el-input v-model="addObj.company" disabled placeholder="选择委托单位" size="small" style="width: 208px"> |
| | |
| | | </el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="6"> |
| | | <el-form-item label="IFS域:" prop="contract"> |
| | | <el-select v-model="addObj.contract" clearable placeholder="请选择" size="small"> |
| | |
| | | </el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="6"> |
| | | <el-form-item label="零件描述:" prop="partDesc"> |
| | | <el-input v-model="addObj.partDesc" clearable placeholder="请输入零件描述" size="small"> |
| | | </el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="6"> |
| | | <el-form-item label="联系方式:" prop="phone"> |
| | | <el-input v-model="addObj.phone" :disabled="active>1&&tabIndex!=4" clearable placeholder="选择委托客户" size="small"></el-input> |
| | |
| | | <el-button type="primary" @click="selectUser">确 定</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | <el-dialog :visible.sync="inspectionOrderDialogVisible" title="选择检验委托单" width="70%"> |
| | | <div v-if="inspectionOrderDialogVisible" class="body"> |
| | | <el-form :inline="true" :model="inspectionOrderQuery" size="small"> |
| | | <el-form-item label="委托单号"> |
| | | <el-input v-model="inspectionOrderQuery.inspectionOrderCode" clearable placeholder="请输入委托单号" |
| | | @keyup.enter.native="queryInspectionOrders"></el-input> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" @click="queryInspectionOrders">查询</el-button> |
| | | <el-button @click="resetInspectionOrderQuery">重置</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | <lims-table :tableData="inspectionOrderTableData" :column="inspectionOrderColumns" |
| | | :isSelection="true" :handleSelectionChange="selectInspectionOrderRows" |
| | | @pagination="inspectionOrderPagination" :height="450" key="inspectionOrderTableData" |
| | | :page="inspectionOrderPage" :tableLoading="inspectionOrderLoading"></lims-table> |
| | | </div> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="inspectionOrderDialogVisible = false">取 消</el-button> |
| | | <el-button type="primary" @click="confirmInspectionOrder">确 定</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | <el-dialog :visible.sync="selectStandardTree" title="选择样品" width="500px"> |
| | | <div v-if="selectStandardTree" v-loading="selectStandardTreeLoading" class="body" style="height: 60vh;overflow-y: auto;user-select: none;"> |
| | | <el-row> |
| | |
| | | import { bigEval } from "@/utils/bigEval"; |
| | | import {mapGetters} from "vuex"; |
| | | import {addQuarter, updateQuarterOnOrder} from "@/api/business/finishedProductSampling"; |
| | | import { |
| | | addInsOrderWithInspectionOrder, |
| | | getInspectionOrderForPlaceOrder, |
| | | pageUnboundInspectionOrder |
| | | } from "@/api/cnas/process/demand/demand"; |
| | | |
| | | export default { |
| | | name: 'AddOrder', |
| | |
| | | templates: [], |
| | | addObj: { |
| | | entrustCode: null, |
| | | inspectionOrderId: null, |
| | | inspectionOrderCode: null, |
| | | contract:null, |
| | | updateBatchNo: null, |
| | | partDesc: null, |
| | |
| | | unit: null |
| | | }, |
| | | type: [], |
| | | inspectionOrderLoading: false, |
| | | inspectionOrderDialogVisible: false, |
| | | inspectionOrderTableData: [], |
| | | inspectionOrderSelection: [], |
| | | inspectionOrderQuery: { |
| | | inspectionOrderCode: '' |
| | | }, |
| | | inspectionOrderPage: { |
| | | total: 0, |
| | | size: 10, |
| | | current: 1 |
| | | }, |
| | | inspectionOrderColumns: [ |
| | | {label: '委托单号', prop: 'inspectionOrderCode'}, |
| | | {label: '试样名称', prop: 'sampleName'}, |
| | | {label: '委托单位', prop: 'commissionUnit'}, |
| | | {label: '生产单位', prop: 'production'}, |
| | | {label: '委托人', prop: 'commissionUser'}, |
| | | {label: '委托时间', prop: 'commissionDate'} |
| | | ], |
| | | selectUserDia: false, |
| | | tableData1: [], |
| | | tableLoading1: false, |
| | |
| | | this.getInfo(); |
| | | }, |
| | | methods: { |
| | | openInspectionOrderList() { |
| | | this.inspectionOrderSelection = [] |
| | | this.inspectionOrderQuery.inspectionOrderCode = '' |
| | | this.inspectionOrderPage.current = 1 |
| | | this.inspectionOrderDialogVisible = true |
| | | this.getInspectionOrderList() |
| | | }, |
| | | getInspectionOrderList() { |
| | | this.inspectionOrderLoading = true |
| | | pageUnboundInspectionOrder({ |
| | | ...this.inspectionOrderPage, |
| | | ...this.inspectionOrderQuery |
| | | }).then(res => { |
| | | this.inspectionOrderTableData = res.data.records || [] |
| | | this.inspectionOrderPage.total = res.data.total || 0 |
| | | }).finally(() => { |
| | | this.inspectionOrderLoading = false |
| | | }) |
| | | }, |
| | | queryInspectionOrders() { |
| | | this.inspectionOrderPage.current = 1 |
| | | this.getInspectionOrderList() |
| | | }, |
| | | resetInspectionOrderQuery() { |
| | | this.inspectionOrderQuery.inspectionOrderCode = '' |
| | | this.queryInspectionOrders() |
| | | }, |
| | | inspectionOrderPagination({ page, limit }) { |
| | | this.inspectionOrderPage.current = page |
| | | this.inspectionOrderPage.size = limit |
| | | this.getInspectionOrderList() |
| | | }, |
| | | selectInspectionOrderRows(rows) { |
| | | this.inspectionOrderSelection = rows |
| | | }, |
| | | confirmInspectionOrder() { |
| | | if (this.inspectionOrderSelection.length !== 1) { |
| | | this.$message.error(this.inspectionOrderSelection.length === 0 ? '请选择一条检验委托单' : '只能选择一条检验委托单') |
| | | return |
| | | } |
| | | const inspectionOrder = this.inspectionOrderSelection[0] |
| | | this.addObj.inspectionOrderId = inspectionOrder.inspectionOrderId |
| | | this.addObj.inspectionOrderCode = inspectionOrder.inspectionOrderCode |
| | | this.inspectionOrderDialogVisible = false |
| | | this.handleInspectionOrderChange(inspectionOrder.inspectionOrderId) |
| | | }, |
| | | handleInspectionOrderChange(inspectionOrderId) { |
| | | if (!inspectionOrderId) { |
| | | this.addObj.inspectionOrderCode = null |
| | | return |
| | | } |
| | | getInspectionOrderForPlaceOrder({ inspectionOrderId }).then(res => { |
| | | const inspectionOrder = res.data |
| | | this.addObj.inspectionOrderCode = inspectionOrder.inspectionOrderCode |
| | | this.addObj.sample = inspectionOrder.sampleName || this.addObj.sample |
| | | this.addObj.company = inspectionOrder.commissionUnit || this.addObj.company |
| | | this.addObj.companyId = inspectionOrder.commissionUnitId || this.addObj.companyId |
| | | this.addObj.production = inspectionOrder.production || this.addObj.production |
| | | this.addObj.prepareUser = inspectionOrder.commissionUser || this.addObj.prepareUser |
| | | this.addObj.phone = inspectionOrder.commissionPhone || this.addObj.phone |
| | | this.addObj.sampleStatus = inspectionOrder.sampleStatus || this.addObj.sampleStatus |
| | | this.addObj.isLeave = inspectionOrder.isLeave === null || inspectionOrder.isLeave === undefined |
| | | ? this.addObj.isLeave : inspectionOrder.isLeave |
| | | this.addObj.processing = inspectionOrder.processing === null || inspectionOrder.processing === undefined |
| | | ? this.addObj.processing : inspectionOrder.processing |
| | | this.addObj.appointed = inspectionOrder.appointed || this.addObj.appointed |
| | | this.addObj.send = inspectionOrder.send === null || inspectionOrder.send === undefined |
| | | ? this.addObj.send : inspectionOrder.send |
| | | if (/^\d+$/.test(inspectionOrder.quantity || '')) { |
| | | this.addObj.sampleNum = Number(inspectionOrder.quantity) |
| | | } |
| | | this.sample.sample = inspectionOrder.sampleName || this.sample.sample |
| | | this.sample.model = inspectionOrder.modelNo || this.sample.model |
| | | this.$message.success('已带入检验委托单信息') |
| | | }).catch(() => { |
| | | this.addObj.inspectionOrderId = null |
| | | this.addObj.inspectionOrderCode = null |
| | | }) |
| | | }, |
| | | getInfo() { |
| | | this.selectStandardTreeList() |
| | | this.getAuthorizedPerson(); |
| | |
| | | }) |
| | | }else{ |
| | | // 常规提交 |
| | | addInsOrder({insOrder: {...this.addObj,typeSource:-1}, sampleList: sampleList}).then(res => { |
| | | const { inspectionOrderId, inspectionOrderCode, ...insOrder } = this.addObj |
| | | const submitRequest = inspectionOrderId |
| | | ? addInsOrderWithInspectionOrder({ |
| | | inspectionOrderId, |
| | | insOrder: {...insOrder, typeSource: -1}, |
| | | sampleList: sampleList |
| | | }) |
| | | : addInsOrder({ |
| | | insOrder: {...insOrder, typeSource: -1}, |
| | | sampleList: sampleList |
| | | }) |
| | | submitRequest.then(res => { |
| | | this.saveLoad = false |
| | | this.$message.success('已提交') |
| | | this.bsm3Dia = false; |
| | |
| | | this.addObj.phone = selects.phone |
| | | this.addObj.companyId = selects.departId |
| | | this.addObj.production = '中天耐丝有限公司' |
| | | this.addObj.productionEn = 'Zhongtian Naisi Co., Ltd.' |
| | | this.addObj.productionEn = 'Zhongtian intelligent cable Co.,Ltd.' |
| | | if(this.active==1){ |
| | | this.selectInsOrderTemplate() |
| | | } |