| | |
| | | <el-col :span="6"><el-form-item label="委托单位"><el-input v-model="addObj.company" disabled size="small"><template slot="append"><el-button :disabled="active>1" icon="el-icon-search" @click="openCompanyList" /></template></el-input></el-form-item></el-col> |
| | | <el-col :span="6"><el-form-item label="检验类别"><el-select v-model="addObj.orderType" :disabled="active>1" size="small"><el-option v-for="item in dict.type.check_type1" :key="item.value" :label="item.label" :value="item.value" /></el-select></el-form-item></el-col> |
| | | </el-row> |
| | | <el-row v-if="addObj.standardTreeId || boundTemplateList.length"> |
| | | <el-col :span="24"> |
| | | <el-form-item label="原始记录模板"> |
| | | <div v-loading="templateBindingLoading" class="template-tag-list"> |
| | | <el-tag v-for="item in boundTemplateList" :key="item.templateId" size="small" effect="plain">{{ item.name }}</el-tag> |
| | | <span v-if="!templateBindingLoading && boundTemplateList.length === 0" class="empty-template-text">暂未绑定原始记录模板</span> |
| | | </div> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="6"><el-form-item label="样品数量"><el-input v-model="addObj.testQuantity" :disabled="active>1" placeholder="如:2桶、500mL" size="small" /></el-form-item></el-col> |
| | | <el-col :span="6"><el-form-item label="样品编号"><el-input v-model="sampleCode" :disabled="active>1" size="small" /></el-form-item></el-col> |
| | |
| | | <el-col :span="6"><el-form-item label="送样日期"><el-date-picker v-model="addObj.sampleDate" type="date" value-format="yyyy-MM-dd" :disabled="active>1" size="small" /></el-form-item></el-col> |
| | | <el-col :span="6"><el-form-item label="联系方式"><el-input v-model="addObj.phone" :disabled="active>1" size="small" /></el-form-item></el-col> |
| | | </el-row> |
| | | <el-row><el-col :span="6"><el-form-item label="环境条件"><el-input v-model="addObj.temperature" :disabled="active>1" placeholder="温度" size="small" /></el-form-item></el-col><el-col :span="6"><el-form-item label="湿度"><el-input v-model="addObj.humidity" :disabled="active>1" size="small" /></el-form-item></el-col><el-col :span="6"><el-form-item label="备注"><el-input v-model="addObj.remark" :disabled="active>1" size="small" /></el-form-item></el-col></el-row> |
| | | <el-row><el-col :span="12"><el-form-item label="备注"><el-input v-model="addObj.remark" :disabled="active>1" size="small" /></el-form-item></el-col></el-row> |
| | | </el-form> |
| | | <el-form v-if="false" ref="addObj" :inline="true" :model="addObj" :rules="addObjRules" label-width="108px" label-position="right"> |
| | | <el-row> |
| | |
| | | upInsOrderOfState |
| | | } from "@/api/business/add"; |
| | | import {selectUserCondition} from "@/api/performance/class"; |
| | | import {selectsStandardMethodByFLSSM} from "@/api/standard/standardLibrary"; |
| | | import {selectTemplateBindings, selectsStandardMethodByFLSSM} from "@/api/standard/standardLibrary"; |
| | | import limsTable from "@/components/Table/lims-table.vue"; |
| | | import {selectCustomPageList} from "@/api/system/customer"; |
| | | import {mapGetters} from "vuex"; |
| | |
| | | tabIndex: '', |
| | | currentId: '', |
| | | sampleCode: '', |
| | | boundTemplateList: [], |
| | | templateBindingLoading: false, |
| | | sampleSelectionList: [],//样品表格选中数据 |
| | | editTable:[], |
| | | template: null, |
| | |
| | | }; |
| | | this.addObj.type = String(this.addObj.type) |
| | | const samples = this.HaveJson(res.data.sampleProduct) |
| | | this.sampleCode = samples.length ? samples[0].sampleCode || '' : '' |
| | | this.boundTemplateList = this.sortTemplateList(res.data.templateList) |
| | | const loadSamples = this.canSelectProduct |
| | | ? Promise.all(samples.map(sample => this.loadSelectableProducts(sample))) |
| | | : Promise.resolve(samples) |
| | |
| | | }) |
| | | }else{ |
| | | // 常规提交 |
| | | const newJuOrder = {...this.addObj,typeSource:-1} |
| | | delete newJuOrder.temperature |
| | | delete newJuOrder.humidity |
| | | const payload = this.addObj.standardTreeId |
| | | ? { insOrder: {...this.addObj,typeSource:-1}, standardTreeId: this.addObj.standardTreeId, sampleCode: this.sampleCode } |
| | | ? { insOrder: newJuOrder, standardTreeId: this.addObj.standardTreeId, sampleCode: this.sampleCode } |
| | | : { insOrder: {...this.addObj,typeSource:-1}, sampleList: sampleList } |
| | | addInsOrder(payload).then(res => { |
| | | this.saveLoad = false |
| | |
| | | const productName = this.selectTreeNode.data.label |
| | | this.addObj.sample = productName |
| | | this.addObj.standardTreeId = this.selectTreeNode.data.id |
| | | this.loadTemplateBindings(this.addObj.standardTreeId) |
| | | this.selectStandardTree = false |
| | | this.sampleList = [] |
| | | }, |
| | | sortTemplateList(list) { |
| | | return (list || []).slice().sort((a, b) => (a.sort || 0) - (b.sort || 0)) |
| | | }, |
| | | async loadTemplateBindings(standardTreeId) { |
| | | this.boundTemplateList = [] |
| | | if (!standardTreeId) return |
| | | this.templateBindingLoading = true |
| | | try { |
| | | const res = await selectTemplateBindings({standardTreeId}) |
| | | this.boundTemplateList = this.sortTemplateList(res.data) |
| | | } finally { |
| | | this.templateBindingLoading = false |
| | | } |
| | | }, |
| | | // 用指定型号替换树路径末段(末段即标准/型号) |
| | | buildFactoryPath(model) { |
| | |
| | | color: orange; |
| | | font-size: 18px; |
| | | } |
| | | .template-tag-list { |
| | | min-height: 32px; |
| | | display: flex; |
| | | align-items: center; |
| | | flex-wrap: wrap; |
| | | gap: 8px; |
| | | } |
| | | .empty-template-text { |
| | | color: #909399; |
| | | } |
| | | </style> |