| | |
| | | <el-input size="small" placeholder="选择委托客户" clearable :readonly="active>1" v-model="addObj.phone"></el-input> |
| | | </div> |
| | | </el-col> |
| | | <el-col class="search_thing" :span="6" v-if="addObj.orderType=='C'"> |
| | | <div class="search_label"><span class="required-span">* </span>下单至:</div> |
| | | <div class="search_input"> |
| | | <el-select size="small" style="width: 100%;" clearable v-model="addObj.departmentLimsId" :disabled="active>1" placeholder="部门"> |
| | | <el-option v-for="(a, ai) in deaprtEnum" :key="ai" :value="a.id" :label="a.name"></el-option> |
| | | </el-select> |
| | | </div> |
| | | </el-col> |
| | | <el-col class="search_thing" :span="6"> |
| | | <div class="search_label"><span class="required-span">* </span>紧急程度:</div> |
| | | <div class="search_input"> |
| | |
| | | <template slot-scope="scope"> |
| | | <el-input size="small" placeholder="要求描述" v-model="scope.row.tell" clearable type="textarea" |
| | | :autosize="{ minRows: 1, maxRows: 3}" @change="e=>requestChange(e,scope.row,'tell')" |
| | | v-if="active==1&&isAskOnlyRead"></el-input> |
| | | v-if="active==1"></el-input> |
| | | <span v-else> |
| | | <template >{{ scope.row.tell }}</template> |
| | | </span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="ask" label="要求值" min-width="220px" v-if="isAskOnlyRead"> |
| | | <el-table-column prop="ask" label="要求值" min-width="220px" > |
| | | <template slot-scope="scope"> |
| | | <el-input size="small" placeholder="要求值" v-model="scope.row.ask" clearable type="textarea" |
| | | :autosize="{ minRows: 1, maxRows: 3}" @change="e=>requestChange(e,scope.row,'ask')" |
| | | v-if="active==1&&isAskOnlyRead&&scope.row.inspectionValueType!='5'"></el-input> |
| | | v-if="active==1&&scope.row.inspectionValueType!='5'"></el-input> |
| | | <span v-else> |
| | | <!-- <template v-if="(scope.row.ask.indexOf('D')>-1 |
| | | ||scope.row.ask.indexOf('W')>-1 |
| | |
| | | <el-button type="primary" @click="selectUser">确 定</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | <el-dialog title="选择样品" :visible.sync="selectStandardTree" width="400px"> |
| | | <el-dialog title="选择样品" :visible.sync="selectStandardTree" width="500px"> |
| | | <div class="body" style="height: 60vh;overflow-y: auto;user-select: none;" v-if="selectStandardTree"> |
| | | <el-row> |
| | | <el-col :span="24"> |
| | |
| | | import equipConfig from './equip-config.vue' |
| | | import cableConfig from './cable-config.vue' |
| | | import Vue from 'vue' |
| | | import {iuCharts} from "../../../util/echarts"; |
| | | |
| | | export default { |
| | | components: { |
| | |
| | | production: null, |
| | | productionEn: null, |
| | | companyId: null, |
| | | prepareUser:null |
| | | prepareUser:null, |
| | | departmentLimsId:null, |
| | | departmentLims:null |
| | | }, |
| | | sample: { |
| | | sampleCode: null, |
| | |
| | | temId: '', |
| | | sonLaboratoryList:[], |
| | | selectiveEcho: [], // 检验下单的时候勾选检验项目,如果使用筛选提交显示检验项目为空 回显列表 |
| | | deaprtEnum:[] |
| | | } |
| | | }, |
| | | watch: { |
| | |
| | | this.selectEnumByCategoryForUnit() |
| | | this.selectStandardMethods() |
| | | this.selectEnumByCategoryForOrderType() |
| | | this.selectDepartmentEnum() |
| | | // this.selectEnumByCategoryForSonLaboratory() |
| | | this.selectEnumByCategoryForSampleForm() |
| | | if (this.active != 1) { |
| | |
| | | return str.replace(find, value); |
| | | }, |
| | | save() { |
| | | if(this.addObj.orderType=='C'&&this.addObj.departmentLimsId){ |
| | | this.addObj.departmentLims = this.deaprtEnum.find(m=>m.id==this.addObj.departmentLimsId).name |
| | | }else if(this.addObj.orderType&&this.addObj.orderType!='C'&&!this.addObj.departmentLimsId){ |
| | | this.addObj.departmentLims = '检测中心' |
| | | this.addObj.departmentLimsId = this.deaprtEnum.find(m=>m.name=='检测中心').id |
| | | }else{ |
| | | this.$message.error('请选择检验类别') |
| | | return |
| | | } |
| | | if (!this.addObj.companyId) { |
| | | this.$message.error('未选择客户单位') |
| | | return |
| | |
| | | this.$message.error('请输入生产单位') |
| | | } else if (!this.addObj.productionEn) { |
| | | this.$message.error('请输入生产单位EN') |
| | | }else if (!this.addObj.departmentLimsId) { |
| | | this.$message.error('选择下单到哪个部门') |
| | | } else if (this.sampleList.length < 1) { |
| | | this.$message.error('请添加一个样品') |
| | | } else if (!this.sampleList.every(m => m.sample)) { |
| | |
| | | } else if (!this.sampleList.every(m => m.standardMethodListId)) { |
| | | this.$message.error('请选择检验标准') |
| | | } else { |
| | | const select = this.selectTree.split(' - ') |
| | | const productListSelected = this.productListSelected.some(item => item.inspectionItem === '温度循环') |
| | | let isHaveBushing = '' |
| | | this.sampleList.forEach(item => { |
| | | if (!item.bushing || item.bushing.length === 0) { |
| | | isHaveBushing = false |
| | | } |
| | | }) |
| | | //过滤检测项:去除特殊项 |
| | | let filterProductList = this.productListSelected.filter(ele=>ele.bsm==0&&/[0-9]/.test(ele.ask)).filter(ele=>{ |
| | | if(select[1].indexOf('通信')>=0 && ['光缆','光纤'].includes(select[2])){ |
| | | return !['温度循环','光纤接头损耗'].includes(ele.inspectionItem) |
| | | } |
| | | return true |
| | | }).filter(ele=>{ |
| | | if(select[1].indexOf('电力')>=0){ |
| | | return !['温升试验','热循环'].includes(ele.inspectionItem) |
| | | } |
| | | return true |
| | | }) |
| | | //校验检验项的要求值和要求描述,仅委托要求 |
| | | if(this.active==1&&this.isAskOnlyRead){ |
| | | const isTrue = this.checkRequiredValueAndRemark(filterProductList) |
| | | if(!isTrue){ |
| | | this.$message.error('检验项的要求值与要求描述不匹配, 请检查') |
| | | return |
| | | } |
| | | } |
| | | |
| | | // console.log('isHaveBushing===', this.totalArr) |
| | | let spcialItem = this.totalArr.filter(a => a.state == 1 && a.inspectionItem.includes('松套管')) |
| | | if (productListSelected && select[2] === '光缆' && isHaveBushing === false&&spcialItem.length==0) { |
| | | this.$message.error('光缆温度循环项目必须进行光纤配置') |
| | | this.$refs.sampleTable.setCurrentRow(this.currentMethod, true) |
| | | this.rowClick(this.currentMethod) |
| | | this.sampleIds = [this.currentMethod.id] |
| | | this.openConfig() |
| | | return |
| | | }else if(spcialItem.length>0&& isHaveBushing === false){ |
| | | this.$message.error('松套管项目必须进行光纤配置') |
| | | // this.$refs.sampleTable.setCurrentRow(this.currentMethod, true) |
| | | // this.rowClick(this.currentMethod) |
| | | spcialItem.forEach(item=>{ |
| | | this.sampleIds.push(item.id) |
| | | }) |
| | | this.openConfig() |
| | | return |
| | | } |
| | | // if(this.active==1&&this.isAskOnlyRead){ |
| | | // const isTrue = this.checkRequiredValueAndRemark(filterProductList) |
| | | // if(!isTrue){ |
| | | // this.$message.error('检验项的要求值与要求描述不匹配, 请检查') |
| | | // return |
| | | // } |
| | | // } |
| | | let sampleList = this.HaveJson(this.sampleList) |
| | | let projectNum = this.totalArr.filter(a => a.state == 1).length |
| | | if(projectNum==0){ |
| | |
| | | } |
| | | } |
| | | }else{ |
| | | this.$message.error('要求值为空,需要去标准库维护!') |
| | | // this.$message.error('要求值为空,需要去标准库维护!') |
| | | } |
| | | } |
| | | // arr.forEach(f => { |
| | |
| | | } |
| | | }, |
| | | saveMethod(sampleList){ |
| | | let isHaveAsk = this.totalArr.filter(a => (a.ask === null||a.ask=='')&&a.state==1) |
| | | if (isHaveAsk.length > 0) { |
| | | this.$message({ |
| | | type: 'error', |
| | | message: '请填写要求值后再提交' |
| | | }) |
| | | return false; |
| | | } |
| | | let isHaveTell = this.totalArr.filter(a => (a.tell == null||a.tell=='')&&a.state==1) |
| | | if (isHaveTell.length > 0) { |
| | | this.$message({ |
| | | type: 'error', |
| | | message: '请填写要求描述后再提交' |
| | | }) |
| | | return false; |
| | | } |
| | | this.saveLoad = true |
| | | this.$axios.post(this.$api.insOrder.addInsOrder, { |
| | | str: JSON.stringify({ |
| | |
| | | if(this.sonLaboratoryList.length>0){ |
| | | this.distributeData.sonLaboratory = this.sonLaboratoryList[0].value |
| | | } |
| | | }, |
| | | selectDepartmentEnum(){ |
| | | this.$axios.get(this.$api.department.selectDepartmentLimsEnum).then(res=>{ |
| | | this.deaprtEnum = res.data |
| | | }) |
| | | } |
| | | } |
| | | } |