<template>
|
<div>
|
<!-- 检验项分配 -->
|
<el-dialog :visible.sync="issuedDialog" title="分配检验项" top="5vh" width="80%" :loading="tableLoading">
|
<el-table :data="tableData" style="width: 100%" height="70vh">
|
<el-table-column label="样品编号" prop="sampleCode" width="160px">
|
</el-table-column>
|
<el-table-column label="样品名称" prop="sample">
|
</el-table-column>
|
<el-table-column label="样品型号" prop="model" width="190px">
|
</el-table-column>
|
<el-table-column label="检验项分类" prop="inspectionItemClass">
|
</el-table-column>
|
<el-table-column label="检验项" prop="inspectionItem">
|
</el-table-column>
|
<el-table-column label="检验子项" prop="inspectionItemSubclass">
|
</el-table-column>
|
<el-table-column label="分配人员" prop="checkUserId">
|
<template slot-scope="scope">
|
<el-select v-model="scope.row.checkUserId" clearable filterable placeholder="请选择" size="small"
|
style="width: 100%;" :disabled="scope.row.insResult !== null">
|
<el-option v-for="(item, i) in personList" :key="i + 'gbnm.'" :label="item.label" :value="item.value">
|
</el-option>
|
</el-select>
|
</template>
|
</el-table-column>
|
<el-table-column label="试验室" prop="sonLaboratory">
|
</el-table-column>
|
</el-table>
|
<span slot="footer" class="dialog-footer">
|
<el-button @click="issuedDialog = false">取 消</el-button>
|
<el-button :loading="submitLoading" type="primary" @click="submit">确 定</el-button>
|
</span>
|
</el-dialog>
|
</div>
|
</template>
|
|
<script>
|
import { selectSampleAndProductByOrderId, batchUpdateInsProductCheckUser } from "@/api/business/rawMaterialOrder";
|
import { selectUserCondition } from "@/api/performance/class";
|
export default {
|
data() {
|
return {
|
issuedDialog: false,
|
tableData: [],
|
tableLoading: false,
|
submitLoading: false,
|
personList: []
|
}
|
},
|
mounted() {
|
|
},
|
methods: {
|
init(row) {
|
this.issuedDialog = true;
|
this.getList(row.id)
|
this.getAuthorizedPerson()
|
},
|
getList(id) {
|
this.tableLoading = true
|
selectSampleAndProductByOrderId({ page: -1, size: -1, id }).then(res => {
|
this.tableLoading = false
|
if (res.code === 200) {
|
this.tableData = res.data.records
|
}
|
}).catch(err => {
|
this.tableLoading = false
|
})
|
},
|
// 获取指派人员下拉列表
|
getAuthorizedPerson() {
|
selectUserCondition({ type: 1 }).then(res => {
|
let data = []
|
res.data.forEach(a => {
|
data.push({
|
label: a.name,
|
value: a.id
|
})
|
})
|
this.personList = data
|
})
|
},
|
submit() {
|
this.submitLoading = true;
|
batchUpdateInsProductCheckUser({ insProductDtoList: this.tableData }).then(res => {
|
this.submitLoading = false;
|
if (res.code == 200) {
|
this.$message.success('分配成功')
|
this.issuedDialog = false
|
}
|
}).catch(err => {
|
this.submitLoading = false;
|
})
|
}
|
}
|
}
|
</script>
|
|
<style></style>
|