bug修改

dev_unify
yewj 8 months ago
parent 031bd0cd51
commit d3778a11d9

@ -542,7 +542,7 @@
<el-table-column label="包装规格" prop="bzgg" show-overflow-tooltip></el-table-column>
<el-table-column label="包装比例" prop="packRatio" show-overflow-tooltip></el-table-column>
<el-table-column label="包装级别" prop="packLevel" show-overflow-tooltip></el-table-column>
<el-table-column label="操作">
<el-table-column label="操作" fixed="right">
<template slot-scope="scope">
<el-button type="text" @click="selectDrugLevelItem(scope.row)">
选入
@ -925,7 +925,7 @@ export default {
sjcpbm: row.sjcpbm,
bhxjcpbm: row.bhxjcpbm,
bhxjsl: row.bhxjsl,
relId: this.newProductData.id,
relId: this.newProductData.rlId,
uuid: this.newProductData.uuid,
productId: row.productId,
diType: row.diType,
@ -977,22 +977,49 @@ export default {
}).catch(() => {
})
},
extractNumber(bzgg) {
// 使
const match = bzgg.match(/^\d+/);
// null
return match ? parseInt(match[0], 10) : null;
},
extractUnitAfterNumber(bzgg) {
// 使
const match = bzgg.match(/^\d+([^\d/]+)/);
// null
return match ? match[1].trim() : null;
},
selectDrugLevelItem(row) {
getDrugLevelListBycode({nameCode: row.nameCode}).then((response) => {
if (response.code == 20000) {
if (response.data.length > 0) {
response.data.forEach(item => {
//
let parts = item.bzgg.split('/');
// ':'
const ratioParts = item.packRatio.split(':');
let selectedValue;
if (item.packLevel >= 0 && item.packLevel < ratioParts.length) {
selectedValue = ratioParts[item.packLevel];
} else {
selectedValue = null; //
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,
@ -1022,7 +1049,6 @@ export default {
})
}
}
}).catch(() => {
})
@ -1031,10 +1057,15 @@ export default {
this.selectedIndex = this.detailList.length - 1
this.isSave = false
this.selectDrugLevelVisible = false
},
this.getDetailList()
}
,
handleCurrentChange() {
this.selectDrugLevel()
},
}
,
addDrugLevel() {
this.detailList.push({
nameCode: '',
@ -1047,7 +1078,8 @@ export default {
this.newProductData.productId = null
this.selectedIndex = this.detailList.length - 1
this.isSave = false
},
}
,
rowChange(index, val) {
@ -1060,7 +1092,8 @@ export default {
this.selectedIndex = index
this.isSave = false
this.editRowSwitch = true
},
}
,
deleteLevel(index, row) {
this.$confirm('此操作将删除该层级,是否继续?', '提示', {
@ -1089,7 +1122,8 @@ export default {
}
}).catch(() => {
})
},
}
,
//
@ -1129,7 +1163,8 @@ export default {
this.detailList = []
})
}
},
}
,
distributeLevelDiChange(val) {
const matchingItem = this.detailList.find(item => item.nameCode == val)
@ -1144,7 +1179,8 @@ export default {
}
})
},
}
,
useLevelDiChange(val) {
const matchingItem = this.detailList.find(item => item.nameCode == val)
if (matchingItem) {
@ -1157,7 +1193,8 @@ export default {
useLeverCount: res.data.useLeverCount
}
})
},
}
,
getDiLevel() {
let query = {
id: this.relId
@ -1173,7 +1210,8 @@ export default {
this.loading = false
this.levelUnitList = []
})
},
}
,
findMaxLevelObject() {
this.maxLevel = 1;
@ -1182,19 +1220,22 @@ export default {
this.maxLevel = Number(obj.packLevel);
}
}
},
}
,
/**
* 选择收费项目
*/
selectPayFeecode() {
this.tollProjectDialogVisible = true
},
}
,
getData(data) {
this.tollProjectDialogVisible = false
this.newProductData.payFeeCode = data.medCatalogCode
},
}
,
/**
* 第三方系统药品信息
*/
@ -1212,7 +1253,8 @@ export default {
this.loading = false
this.sysList = []
})
},
}
,
resetThirdId() {
this.sysList.forEach((item) => {
if (item.sysId === 'thirdId') {
@ -1227,7 +1269,8 @@ export default {
this.newProductData.thirdId4 = item.thirdId
}
})
},
}
,
/**
* 关联 第三方
*/
@ -1235,7 +1278,8 @@ export default {
this.defaultSys = row.sysId
this.isImport = false
this.chooseHouseDrugVisible = true
},
}
,
removeErp(row) {
this.$confirm('此操作将解除该绑定药品信息, 是否继续?', '提示', {
confirmButtonText: '确定',
@ -1264,11 +1308,13 @@ export default {
})
.catch(() => {
})
},
}
,
closeUdi(val) {
this.chooseHouseDrugVisible = false
this.getThirdSysDetail()
},
}
,
handleInput(index, value, type) {
const intValue = parseInt(value, 10);
//
@ -1297,9 +1343,11 @@ export default {
} else {
this.selectedIndex = 0
}
},
}
,
directives: {
'debounce-input': {
'debounce-input':
{
inserted(el, binding) {
let timeout
el.addEventListener('input', () => {

@ -717,7 +717,7 @@
<el-table-column label="包装规格" prop="bzgg" show-overflow-tooltip></el-table-column>
<el-table-column label="包装比例" prop="packRatio" show-overflow-tooltip></el-table-column>
<el-table-column label="包装级别" prop="packLevel" show-overflow-tooltip></el-table-column>
<el-table-column label="操作">
<el-table-column label="操作" fixed="right">
<template slot-scope="scope">
<el-button type="text" @click="selectDrugLevelItem(scope.row)">
选入
@ -1145,28 +1145,54 @@ export default {
}).catch(() => {
})
},
extractNumber(bzgg) {
// 使
const match = bzgg.match(/^\d+/);
// null
return match ? parseInt(match[0], 10) : null;
},
extractUnitAfterNumber(bzgg) {
// 使
const match = bzgg.match(/^\d+([^\d/]+)/);
// null
return match ? match[1].trim() : null;
},
selectDrugLevelItem(row) {
getDrugLevelListBycode({nameCode: row.nameCode}).then((response) => {
if (response.code == 20000) {
if (response.data.length > 0) {
response.data.forEach(item => {
//
let parts = item.bzgg.split('/')
// ':'
const ratioParts = item.packRatio.split(':')
let selectedValue
if (item.packLevel >= 0 && item.packLevel < ratioParts.length) {
selectedValue = ratioParts[item.packLevel]
} else {
selectedValue = null //
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];
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,
relId: this.newProductData.rlId,
uuid: this.newProductData.uuid,
productId: item.productId,
diType: item.packLevel == 1 ? 1 : 4,
@ -1199,7 +1225,10 @@ export default {
this.selectedIndex = this.detailList.length - 1
this.isSave = false
this.selectDrugLevelVisible = false
},
this.getDetailList()
}
,
addDrugLevel() {
this.detailList.push({
nameCode: '',

Loading…
Cancel
Save