|
|
|
@ -529,17 +529,22 @@
|
|
|
|
|
|
|
|
|
|
<el-form :model="filterQueryDrugLevel" class="query-form" label-width="100px">
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
<el-col :span="6">
|
|
|
|
|
<el-form-item label="层级标识:">
|
|
|
|
|
<el-input v-model="filterQueryDrugLevel.nameCode" placeholder="请输入层级标识" clearable></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
<el-col :span="6">
|
|
|
|
|
<el-form-item label="通用名称:">
|
|
|
|
|
<el-input v-model="filterQueryDrugLevel.cpmctymc" placeholder="请输入通用名称" clearable></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
<el-col :span="6">
|
|
|
|
|
<el-form-item label="批准文号:">
|
|
|
|
|
<el-input v-model="filterQueryDrugLevel.approvalNum" placeholder="请输入批准文号" clearable></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="6">
|
|
|
|
|
<div style=" float: right;
|
|
|
|
|
text-align: right;
|
|
|
|
|
margin-bottom: 8px;
|
|
|
|
@ -596,7 +601,7 @@ import {
|
|
|
|
|
updatetDrug,
|
|
|
|
|
delDrugLevel,
|
|
|
|
|
updateLevelDrug, calculateDistCount, calculateUseCount,
|
|
|
|
|
getDrugLevelList,getDrugLevelListBycode
|
|
|
|
|
getDrugLevelList,getDrugLevelListBycode,updateLevelDrugAli
|
|
|
|
|
} from '@/api/basic/product/drugUdiinfos'
|
|
|
|
|
import {getCodeRelDetail} from '@/api/basic/product/udiRelevance'
|
|
|
|
|
import {isBlank} from "@/utils/strUtil";
|
|
|
|
@ -999,7 +1004,7 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
selectDrugLevel(){
|
|
|
|
|
//获取分页列表
|
|
|
|
|
this.filterQueryDrugLevel.approvalNum = this.newProductData.zczbhhzbapzbh
|
|
|
|
|
// this.filterQueryDrugLevel.approvalNum = this.newProductData.zczbhhzbapzbh
|
|
|
|
|
getDrugLevelList(this.filterQueryDrugLevel).then((response) => {
|
|
|
|
|
if (response.code == 20000) {
|
|
|
|
|
this.selectDrugLevelList = response.data.list || []
|
|
|
|
@ -1010,71 +1015,25 @@ export default {
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
selectDrugLevelItem(row){
|
|
|
|
|
getDrugLevelListBycode({nameCode:row.nameCode}).then((response) => {
|
|
|
|
|
var drug = {
|
|
|
|
|
"nameCode":row.nameCode,
|
|
|
|
|
"uuid":this.newProductData.uuid,
|
|
|
|
|
"ybbm":this.newProductData.ybbm,
|
|
|
|
|
}
|
|
|
|
|
// console.log('drug',drug)
|
|
|
|
|
updateLevelDrugAli(drug).then((response) => {
|
|
|
|
|
if (response.code == 20000) {
|
|
|
|
|
if (response.data.length > 0) {
|
|
|
|
|
response.data.forEach(item => {
|
|
|
|
|
let parts = item.bzgg.split('/');
|
|
|
|
|
const levels = item.packRatio.split(":").map(Number);
|
|
|
|
|
const calculatedLevels = [levels[0]];
|
|
|
|
|
for (let i = levels.length - 1; i > 0; i--) {
|
|
|
|
|
const ratio = levels[i] / levels[i - 1];
|
|
|
|
|
calculatedLevels.unshift(ratio);
|
|
|
|
|
}
|
|
|
|
|
calculatedLevels.reverse();
|
|
|
|
|
let selectedValue = calculatedLevels[item.packLevel - 1];
|
|
|
|
|
console.log(item)
|
|
|
|
|
if (item.packLevel == 1) {
|
|
|
|
|
selectedValue = this.extractNumber(this.newProductData.bzgg)
|
|
|
|
|
item.xjdw = this.extractUnitAfterNumber(this.newProductData.bzgg)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// const ratioParts = item.packRatio.split(':');
|
|
|
|
|
// let selectedValue;
|
|
|
|
|
// if (item.packLevel >= 0 && item.packLevel < ratioParts.length) {
|
|
|
|
|
// selectedValue = ratioParts[item.packLevel];
|
|
|
|
|
// } else {
|
|
|
|
|
// selectedValue = 1; // 或者你可以设置一个默认值
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
let editQuery = {
|
|
|
|
|
nameCode: item.nameCode,
|
|
|
|
|
packLevel: item.packLevel,
|
|
|
|
|
packUnit: parts[1] || '',
|
|
|
|
|
bhxjsl: selectedValue,
|
|
|
|
|
relId: this.newProductData.id,
|
|
|
|
|
uuid: this.newProductData.uuid,
|
|
|
|
|
productId: item.productId,
|
|
|
|
|
diType: item.packLevel == 1 ? 1 : 4,
|
|
|
|
|
xjdw: item.xjdw
|
|
|
|
|
}
|
|
|
|
|
updateLevelDrug(editQuery).then(res => {
|
|
|
|
|
this.saveLoading = false
|
|
|
|
|
if (res.code == 20000) {
|
|
|
|
|
this.detailList.push({
|
|
|
|
|
nameCode: item.nameCode,
|
|
|
|
|
packLevel: item.packLevel,
|
|
|
|
|
packUnit: parts[1] || '',
|
|
|
|
|
bhxjsl: selectedValue,
|
|
|
|
|
diType: item.packLevel == 1 ? 1 : 4,
|
|
|
|
|
isDisabled: false,
|
|
|
|
|
rowDisabled: false,
|
|
|
|
|
isUpDisabled: true
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
// this.selectedIndex = this.detailList.length - 1
|
|
|
|
|
// this.isSave = false
|
|
|
|
|
this.selectDrugLevelVisible = false
|
|
|
|
|
this.getDiLevel()
|
|
|
|
|
this.getDetailList()
|
|
|
|
|
this.getThirdSysDetail()
|
|
|
|
|
}
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
this.newProductData.productId = null
|
|
|
|
|
this.selectedIndex = this.detailList.length - 1
|
|
|
|
|
this.isSave = false
|
|
|
|
|
this.selectDrugLevelVisible = false
|
|
|
|
|
this.getDetailList()
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
,
|
|
|
|
|
|
|
|
|
|