| | |
| | | title="添加检验项" |
| | | width="90%"> |
| | | <el-table ref="productTable" v-loading="getProductLoad" :data="productList" :row-class-name="tableRowClassName" border class="el-table" |
| | | max-height="700px" style="margin-bottom: 10px;" tooltip-effect="dark" |
| | | max-height="580px" tooltip-effect="dark" |
| | | @selection-change="selectProduct"> |
| | | <el-table-column type="selection" width="65"></el-table-column> |
| | | <el-table-column label="检验项分类" min-width="140" prop="inspectionItemClass" show-overflow-tooltip></el-table-column> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import {addOmitOrderProduct, getProductTreeBySampleId, getSampleByOrderId} from "@/api/business/productOrder"; |
| | | |
| | | export default { |
| | | name: "addInspectionDia", |
| | | // import 引入的组件需要注入到对象中才能使用 |
| | |
| | | methods: { |
| | | getDataList(row) { |
| | | this.dialogVisible = true |
| | | this.$axios.get(this.$api.insOrder.getSampleByOrderId + '?insOrderId=' + row.id).then(res => { |
| | | if (res.code === 201) { |
| | | return |
| | | } |
| | | getSampleByOrderId({insOrderId: row.id}).then(res => { |
| | | this.sampleList = res.data |
| | | }) |
| | | }, |
| | |
| | | this.itemDialogVisible = true |
| | | this.getProductLoad = true |
| | | this.id=row.id |
| | | this.$axios.get(this.$api.insOrder.getProductTreeBySampleId + '?insSampleId=' + row.id).then(res => { |
| | | getProductTreeBySampleId({insSampleId: row.id}).then(res => { |
| | | this.getProductLoad = false |
| | | if (res.code === 201) { |
| | | return |
| | | } |
| | | this.productList = res.data |
| | | }).catch(err => { |
| | | this.getProductLoad = false |
| | |
| | | type: 'warning' |
| | | }).then(() => { |
| | | this.upLoad = true |
| | | this.$axios.post(this.$api.insOrder.addOmitOrderProduct,{insProductBindingList:this.productListSelected,insSampleId:this.id}, { |
| | | headers: { |
| | | "Content-Type": "application/json" |
| | | }, |
| | | noQs: true |
| | | } ).then(res => { |
| | | addOmitOrderProduct({insProductBindingList:this.productListSelected,insSampleId:this.id}).then(res => { |
| | | this.upLoad = false |
| | | if (res.code === 201) { |
| | | return |
| | | } |
| | | this.$message.success('添加成功!') |
| | | this.itemDialogVisible = false |
| | | }).catch(err => { |
| | |
| | | }).catch(() => { |
| | | this.$message({ |
| | | type: 'info', |
| | | message: '已取消删除' |
| | | message: '已取消添加' |
| | | }); |
| | | }); |
| | | }, |