| | |
| | | <el-input v-model="specialStandardMethod" :disabled="!isSpecial" clearable size="small"></el-input> |
| | | <el-button v-show="active==1" size="small" style="margin-left: 10px" |
| | | type="primary" @click="editSpecial">编辑</el-button> |
| | | <el-button v-show="active==1" size="small" type="primary" @click="handleSplitCountNum">拆分</el-button> |
| | | <el-button v-show="active==1" :disabled="sampleList.length<=1" size="small" type="danger" @click="handleDeleteSplitCountNum">删除拆分</el-button> |
| | | </div> |
| | | </div> |
| | | <el-table ref="sampleTable" :data="sampleList" border class="el-table sampleTable" highlight-current-row |
| | |
| | | <el-table-column align="center" label="序号" type="index" width="65"></el-table-column> |
| | | <el-table-column align="center" label="样品名称" min-width="100" prop="sample"> |
| | | <template slot-scope="scope"> |
| | | <el-input v-model="scope.row.sample" :disabled="active>1 || scope.$index !== 0" clearable size="small"></el-input> |
| | | <el-input v-model="scope.row.sample" :disabled="active>1" clearable size="small"></el-input> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column align="center" label="样品编号" min-width="100" prop="sampleCode"> |
| | | <template slot-scope="scope"> |
| | | <el-input v-model="scope.row.sampleCode" :disabled="active>1 || scope.$index !== 0" clearable placeholder="不填写则系统自动生成" |
| | | <el-input v-model="scope.row.sampleCode" :disabled="active>1" clearable placeholder="不填写则系统自动生成" |
| | | size="small"></el-input> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column align="center" label="样品型号" min-width="60" prop="model"> |
| | | <template slot-scope="scope"> |
| | | <el-select v-model="scope.row.model" :disabled="active>1 || scope.$index !== 0" allow-create default-first-option filterable |
| | | <el-select v-model="scope.row.model" :disabled="active>1" allow-create default-first-option filterable |
| | | placeholder="样品型号" size="small" style="width: 100%;" @change="handleChangeModel"> |
| | | <el-option v-for="item in models" :key="item.value" :label="item.label" :value="item.value"> |
| | | </el-option> |
| | |
| | | <el-table-column align="center" label="检验标准" min-width="100" prop="standardMethodListId"> |
| | | <template slot-scope="scope"> |
| | | <el-select v-model="scope.row.standardMethodListId" :disabled="scope.row.model==null||active>1" |
| | | :loading="methodLoad" :readonly="active>1 || scope.$index !== 0" clearable placeholder="检验标准" |
| | | :loading="methodLoad" :readonly="active>1" clearable placeholder="检验标准" |
| | | size="small" style="width: 100%;" @change="(value)=>methodChange(value, scope.row)" @clear="productList = []" @focus="methodFocus"> |
| | | <el-option v-for="item in methods" :key="item.id" :label="item.code" :value="item.id"> |
| | | </el-option> |
| | |
| | | <el-table-column label="区间" min-width="120" prop="section" show-overflow-tooltip></el-table-column> |
| | | <el-table-column :filter-method="filterHandler" :filters="filters" label="子实验室" min-width="130" prop="sonLaboratory" |
| | | show-overflow-tooltip></el-table-column> |
| | | <!-- <el-table-column v-if="isSpecial&&active==1" label="操作" width="100">--> |
| | | <!-- <template slot-scope="scope">--> |
| | | <!-- <el-button v-if="!scope.row.repetitionTag" size="small" type="text" @click="addProductList(productList,scope.row,scope.$index)">插入行</el-button>--> |
| | | <!-- <el-button v-if="!!scope.row.repetitionTag&&scope.row.delete" size="small" type="text" @click="deleteProductList(scope.$index,productList)">删除</el-button>--> |
| | | <!-- </template>--> |
| | | <!-- </el-table-column>--> |
| | | <el-table-column v-if="isSpecial&&active==1" label="操作" width="100"> |
| | | <template slot-scope="scope"> |
| | | <el-button v-if="!scope.row.repetitionTag" size="small" type="text" @click="addProductList(productList,scope.row,scope.$index)">插入行</el-button> |
| | | <el-button style="color:#ff4949" v-if="!!scope.row.repetitionTag&&scope.row.delete" size="small" type="text" @click="deleteProductList(scope.$index,productList)">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | </div> |
| | |
| | | this.getInfo(); |
| | | }, |
| | | methods: { |
| | | // 拆分 |
| | | handleSplitCountNum () { |
| | | if(!this.sampleList || this.sampleList.length===0){ |
| | | this.$message.error("请先选择样品") |
| | | return |
| | | } |
| | | this.sample.joinName = null |
| | | this.sample.joinModel = null |
| | | this.sample.joinNum = 1 |
| | | // 两条数据保持一致 |
| | | this.sample.sample = this.sampleList[0].sample |
| | | this.sample.model = this.sampleList[0].model |
| | | this.sample.unit = this.sampleList[0].unit |
| | | this.sample.modelNum = this.sampleList[0].modelNum |
| | | this.sample.standardMethodListId = this.sampleList[0].standardMethodListId |
| | | this.sample.insProduct = this.sampleList[0].insProduct |
| | | this.sample.id = this.count |
| | | this.sample.childSampleList = this.sampleList[0].childSampleList |
| | | this.sample.insulating = null |
| | | this.sample.sheath = null |
| | | this.sampleList.push(this.HaveJson(this.sample)) |
| | | this.sampleList.forEach(item => { |
| | | item.quantity = 1 |
| | | }) |
| | | this.count++ |
| | | }, |
| | | //删除拆分行 |
| | | handleDeleteSplitCountNum(){ |
| | | this.count--; |
| | | this.sampleList.pop() |
| | | }, |
| | | getInfo() { |
| | | this.selectStandardTreeList() |
| | | this.getAuthorizedPerson(); |
| | |
| | | }, |
| | | changeProductList0(){ |
| | | this.productList0.forEach(a=>{ |
| | | // let obj = this.productList.find(m => { |
| | | // if(a.repetitionTag){ |
| | | // return m.id === a.id&&m.repetitionTag == a.repetitionTag |
| | | // }else{ |
| | | // return m.id === a.id&&!m.repetitionTag |
| | | // } |
| | | // }) |
| | | let obj = this.productList.find(m => m.id == a.id) |
| | | let obj = this.productList.find(m => { |
| | | if(a.repetitionTag){ |
| | | return m.id === a.id&&m.repetitionTag == a.repetitionTag |
| | | }else{ |
| | | return m.id === a.id&&!m.repetitionTag |
| | | } |
| | | }) |
| | | if(obj){ |
| | | a.state = obj.state |
| | | a.section = obj.section |
| | |
| | | }, |
| | | // 要求值变化时 |
| | | requestChange(e, row,type) { |
| | | this.sampleList.map(item => { |
| | | if (this.sampleIds.indexOf(item.id) > -1) { |
| | | item.insProduct.map(m => { |
| | | if (m.id == row.id) { |
| | | m[type] = e; |
| | | //this.currentMethod 当前样品id |
| | | this.sampleList.forEach(item=>{ |
| | | if(item.id == this.currentMethod.id){ |
| | | item.insProduct.forEach(i=>{ |
| | | if(i.id == row.id){ |
| | | if(row.repetitionTag){ |
| | | if(row.repetitionTag==i.repetitionTag){ |
| | | i[type] = e |
| | | } |
| | | }else{ |
| | | if(!i.repetitionTag){ |
| | | i[type] = e |
| | | } |
| | | } |
| | | } |
| | | return m; |
| | | }) |
| | | } |
| | | return item |
| | | }) |
| | | //this.currentMethod 当前样品id |
| | | // this.sampleList.forEach(item=>{ |
| | | // if(item.id == this.currentMethod.id){ |
| | | // item.insProduct.forEach(i=>{ |
| | | // if(i.id == row.id){ |
| | | // if(row.repetitionTag){ |
| | | // if(row.repetitionTag==i.repetitionTag){ |
| | | // i[type] = e |
| | | // } |
| | | // }else{ |
| | | // if(!i.repetitionTag){ |
| | | // i[type] = e |
| | | // } |
| | | // } |
| | | // } |
| | | // }) |
| | | // } |
| | | // }) |
| | | }, |
| | | selectStandardMethods() { |
| | | selectStandardMethodEnum().then(res => { |
| | |
| | | } |
| | | }, |
| | | selectable0(row,index) { |
| | | // if (this.active > 1||row.repetitionTag) { |
| | | // return false |
| | | // } else { |
| | | // return true |
| | | // } |
| | | if (this.active > 1) { |
| | | if (this.active > 1||row.repetitionTag) { |
| | | return false |
| | | } else { |
| | | return true |