| | |
| | | border @selection-change="selectSample" highlight-current-row @row-click="rowClick" style="margin-top: 10px;"> |
| | | <el-table-column type="selection" width="60"></el-table-column> |
| | | <el-table-column type="index" label="序号" width="65" align="center"></el-table-column> |
| | | <el-table-column prop="sample" label="样品名称" align="center" show-overflow-tooltip min-width="100"> |
| | | <el-table-column prop="sample" label="样品名称" align="center" min-width="100"> |
| | | <template slot-scope="scope"> |
| | | <el-input size="small" v-model="scope.row.sample" clearable></el-input> |
| | | </template> |
| | |
| | | <el-input size="small" v-model="scope.row.sampleCode" clearable placeholder="不填写则系统自动生成"></el-input> |
| | | </template> |
| | | </el-table-column> |
| | | <!-- <el-table-column prop="factory" label="工厂" align="center" show-overflow-tooltip min-width="100"> |
| | | <!-- <el-table-column prop="factory" label="工厂" align="center" min-width="100"> |
| | | </el-table-column> |
| | | <el-table-column prop="laboratory" label="实验室" align="center" show-overflow-tooltip min-width="100"> |
| | | <el-table-column prop="laboratory" label="实验室" align="center" min-width="100"> |
| | | </el-table-column> |
| | | <el-table-column prop="sampleType" label="样品类型" align="center" show-overflow-tooltip min-width="100"> |
| | | <el-table-column prop="sampleType" label="样品类型" align="center" min-width="100"> |
| | | </el-table-column> --> |
| | | <el-table-column prop="model" label="样品型号" align="center" show-overflow-tooltip min-width="100"> |
| | | <el-table-column prop="model" label="样品型号" align="center" min-width="100"> |
| | | <template slot-scope="scope"> |
| | | <el-select v-model="scope.row.model" filterable allow-create default-first-option placeholder="样品型号" |
| | | size="small"> |
| | | size="small" @change="handleChangeModel"> |
| | | <el-option v-for="item in models" :key="item.value" :label="item.label" :value="item.value"> |
| | | </el-option> |
| | | </el-select> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="standardMethodListId" label="检验标准" align="center" show-overflow-tooltip min-width="100"> |
| | | <el-table-column prop="standardMethodListId" label="检验标准" align="center" min-width="100"> |
| | | <template slot-scope="scope"> |
| | | <el-select v-model="scope.row.method" :disabled="scope.row.model==null" filterable placeholder="检验标准" size="small" |
| | | :loading="methodLoad" @change="(value)=>methodChange(value, scope.row)" @focus="methodFocus"> |
| | |
| | | </el-select> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="unit" label="单位" align="center" show-overflow-tooltip min-width="100"> |
| | | <el-table-column prop="unit" label="单位" align="center" min-width="100"> |
| | | <template slot-scope="scope"> |
| | | <el-select v-model="scope.row.unit" clearable size="small" style="width: 100%;"> |
| | | <el-option v-for="(a, i) in units" :key="i" :label="a.label" :value="a.value"></el-option> |
| | | </el-select> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="isLeave" label="是否留样" align="center" show-overflow-tooltip min-width="100"> |
| | | <el-table-column prop="isLeave" label="是否留样" align="center" min-width="100"> |
| | | <template slot-scope="scope"> |
| | | <el-select v-model="scope.row.isLeave" size="small"> |
| | | <el-option label="留样" :value="1"></el-option> |
| | |
| | | <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}"></el-input> |
| | | :autosize="{ minRows: 1, maxRows: 3}" @change="e=>requestChange(e,scope.row)"></el-input> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | this.$message.error('请添加一个样品') |
| | | } else if (!this.sampleList.every(m => m.sampleCode)) { |
| | | this.$message.error('输入样品编号') |
| | | }else if (!this.sampleList.every(m => m.sample)) { |
| | | this.$message.error('输入样品名称') |
| | | }else if (!this.sampleList.every(m => m.model)) { |
| | | this.$message.error('输入样品型号') |
| | | }else if (!this.sampleList.every(m => m.standardMethodListId)) { |
| | | this.$message.error('选择检验标准') |
| | | }else if (!this.sampleList.every(m => m.unit)) { |
| | | this.$message.error('输入单位') |
| | | }else if (!this.sampleList.every(m => m.isLeave)) { |
| | | this.$message.error('是否留样') |
| | | } else { |
| | | this.saveLoad = true |
| | | this.$axios.post(this.$api.insOrder.addInsOrder, { |
| | |
| | | this.saveLoad = false |
| | | if (res.code == 201) return |
| | | this.$message.success('已提交') |
| | | // 如果紧急程度为紧急,需要直接下发人员 |
| | | if (this.addObj.type == 2) { |
| | | this.issuedDialogVisible = true; |
| | | this.$axios.post(this.$api.insOrder.selectOrderManDay, { |
| | | id: res.data |
| | | }).then(ress => { |
| | | // TODO 需要再确认一下返回值 |
| | | this.distributeData.orderId = res.data |
| | | // this.distributeData.sampleId = res.data.sampleId |
| | | this.distributeData.appointed = ress.data |
| | | }) |
| | | } else { |
| | | this.$parent.playOrder(0) |
| | | } |
| | | this.$parent.playOrder(0) |
| | | }) |
| | | } |
| | | }, |
| | |
| | | this.saveLoad = false |
| | | if (res.code == 201) return |
| | | this.$message.success('提交成功') |
| | | this.$parent.playOrder(0) |
| | | // 如果紧急程度为紧急,需要直接下发人员 |
| | | if (this.addObj.type == 2) { |
| | | this.issuedDialogVisible = true; |
| | | this.$axios.post(this.$api.insOrder.selectOrderManDay, { |
| | | id: this.currentId |
| | | }).then(ress => { |
| | | this.distributeData.orderId = this.currentId |
| | | this.distributeData.appointed = ress.data |
| | | }) |
| | | } else { |
| | | this.$parent.playOrder(0) |
| | | } |
| | | }) |
| | | }, |
| | | // 下发 |
| | |
| | | this.upLoad = true; |
| | | this.$axios.post(this.$api.insOrder.upInsOrder, { |
| | | orderId: this.distributeData.orderId, |
| | | sampleId: this.distributeData.sampleId, |
| | | appointed: this.distributeData.appointed, |
| | | userId: this.distributeData.userId |
| | | }).then(res => { |
| | |
| | | this.count++ |
| | | } |
| | | this.$refs.sampleTable.doLayout() |
| | | this.selectsStandardMethodByFLSSM() |
| | | // this.selectsStandardMethodByFLSSM() |
| | | }, |
| | | selectsStandardMethodByFLSSM() { |
| | | this.methodLoad = true |
| | |
| | | tree: this.selectTree |
| | | }).then(res => { |
| | | this.methodLoad = false |
| | | this.methods = res.data.standardMethodList |
| | | if(res.data.standardMethodList.length==0&&this.selectTree.split('-').length==5){ |
| | | let arr = this.selectTree.split('-') |
| | | let arr0 = arr.slice(0,arr.length-1) |
| | | let selectTree = arr0.join('-').substring(0, arr0.join('-').length - 1) |
| | | this.$axios.post(this.$api.standardTree.selectsStandardMethodByFLSSM, { |
| | | tree: selectTree |
| | | }).then(ress => { |
| | | this.methods = ress.data.standardMethodList |
| | | }) |
| | | }else{ |
| | | this.methods = res.data.standardMethodList |
| | | } |
| | | }) |
| | | }, |
| | | addStandardTree() { |
| | |
| | | }, |
| | | upProductSelect(selection, row) { |
| | | row.state = row.state == 1 ? 0 : 1 |
| | | this.sampleList.map(item=>{ |
| | | if(this.sampleIds.indexOf(item.id)>-1){ |
| | | item.insProduct.map(m=>{ |
| | | if(m.id==row.id){ |
| | | m.state = row.state; |
| | | } |
| | | return m; |
| | | }) |
| | | } |
| | | return item |
| | | }) |
| | | }, |
| | | tableRowClassName({ |
| | | row, |
| | |
| | | }, |
| | | methodFocus(){ |
| | | this.selectsStandardMethodByFLSSM() |
| | | } |
| | | }, |
| | | handleChangeModel(e){ |
| | | let num = this.selectTree.split('-').length; |
| | | if(num==4){ |
| | | this.selectTree = this.selectTree + ' - '+ e |
| | | }else{ |
| | | let arr = this.selectTree.split('-') |
| | | let arr0 = arr.slice(0,arr.length-1) |
| | | this.selectTree = arr0.join('-')+ '- '+ e |
| | | } |
| | | }, |
| | | // 要求值变化时 |
| | | requestChange(e,row){ |
| | | this.sampleList.map(item=>{ |
| | | if(this.sampleIds.indexOf(item.id)>-1){ |
| | | item.insProduct.map(m=>{ |
| | | if(m.id==row.id){ |
| | | m.ask = e; |
| | | } |
| | | return m; |
| | | }) |
| | | } |
| | | return item |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | </script> |