11/8 当采集最大层级未设置的时候设置默认层级

20240912_adapter
wangwei 5 months ago
parent 10d0276c58
commit e3a122fecf

@ -194,7 +194,6 @@
<el-form-item label="计量单位:" prop="useLevel" label-width="160px"> <el-form-item label="计量单位:" prop="useLevel" label-width="160px">
<el-select v-model="newProductData.useLevel" size="small" style="width: 90%" <el-select v-model="newProductData.useLevel" size="small" style="width: 90%"
clearable
@change="useLevelDiChange" @change="useLevelDiChange"
placeholder="请选择计量单位" placeholder="请选择计量单位"
> >
@ -568,42 +567,42 @@
<!-- </el-row>--> <!-- </el-row>-->
<!-- </el-collapse-item>--> <!-- </el-collapse-item>-->
<el-collapse-item name="4"> <!--<el-collapse-item name="4">-->
<template slot="title"> <!-- <template slot="title">-->
<p class="form-title">高级设置</p> <!-- <p class="form-title">高级设置</p>-->
</template> <!-- </template>-->
<el-row type="flex"> <!-- <el-row type="flex">-->
<el-col :span="11" class="el-col"> <!-- <el-col :span="11" class="el-col">-->
<span>参数</span> <!-- <span>参数</span>-->
</el-col> <!-- </el-col>-->
<el-divider direction="vertical"></el-divider> <!-- <el-divider direction="vertical"></el-divider>-->
<el-col :span="11" class="el-col"> <!-- <el-col :span="11" class="el-col">-->
<span>设置</span> <!-- <span>设置</span>-->
</el-col> <!-- </el-col>-->
<el-divider direction="vertical"></el-divider> <!-- <el-divider direction="vertical"></el-divider>-->
<el-col :span="11" class="el-col"> <!-- <el-col :span="11" class="el-col">-->
<span>参数设置说明</span> <!-- <span>参数设置说明</span>-->
</el-col> <!-- </el-col>-->
</el-row> <!-- </el-row>-->
<el-row type="flex"> <!-- <el-row type="flex">-->
<el-col :span="11" class="el-col"> <!-- <el-col :span="11" class="el-col">-->
<span class="sptext">是否禁用</span> <!-- <span class="sptext">是否禁用</span>-->
</el-col> <!-- </el-col>-->
<el-divider direction="vertical"></el-divider> <!-- <el-divider direction="vertical"></el-divider>-->
<el-col :span="11" class="el-col"> <!-- <el-col :span="11" class="el-col">-->
<el-switch <!-- <el-switch-->
v-model="status" <!-- v-model="status"-->
active-color="#13ce66" <!-- active-color="#13ce66"-->
inactive-color="#ff4949" <!-- inactive-color="#ff4949"-->
> <!-- >-->
</el-switch> <!-- </el-switch>-->
</el-col> <!-- </el-col>-->
<el-divider direction="vertical"></el-divider> <!-- <el-divider direction="vertical"></el-divider>-->
<el-col :span="11" class="el-col"> <!-- <el-col :span="11" class="el-col">-->
<span class="sptext">禁用后该药品将无法扫码使用</span> <!-- <span class="sptext">禁用后该药品将无法扫码使用</span>-->
</el-col> <!-- </el-col>-->
</el-row> <!-- </el-row>-->
</el-collapse-item> <!--</el-collapse-item>-->
</el-collapse> </el-collapse>
</el-form> </el-form>
<div style="text-align: center; margin-top: 20px;"> <div style="text-align: center; margin-top: 20px;">
@ -950,6 +949,7 @@ export default {
} }
}) })
} else { } else {
this.setDefaultLevel()
this.$refs['dataForm'].validate((valid) => { this.$refs['dataForm'].validate((valid) => {
if (!valid) { if (!valid) {
return this.$message.error('请补充必要数据') return this.$message.error('请补充必要数据')
@ -962,6 +962,7 @@ export default {
this.newProductData.uuid = this.rowData.uuid this.newProductData.uuid = this.rowData.uuid
this.newProductData.nameCode = this.rowData.nameCode this.newProductData.nameCode = this.rowData.nameCode
this.newProductData.relId = this.newProductData.id this.newProductData.relId = this.newProductData.id
updatetDrug(this.newProductData).then(res => { updatetDrug(this.newProductData).then(res => {
this.saveLoading = false this.saveLoading = false
if (res.code == 20000) { if (res.code == 20000) {
@ -980,6 +981,23 @@ export default {
this.closeDialog() this.closeDialog()
}, },
//
setDefaultLevel(){
//
if (this.newProductData.distributeMaxLevel == null){
let levelUnit = this.levelUnitList[this.levelUnitList.length - 1];
this.newProductData.distributeMaxLevel = levelUnit.packLevel
}
// 使
if (this.newProductData.useMaxLevel == null){
// packUnitnull
let levelUnit = this.levelUnitList[0];
if (isBlank(levelUnit.packUnit)){
levelUnit = this.levelUnitList[1]
}
this.newProductData.useMaxLevel = levelUnit.packLevel
}
},
// //
levelSave(row) { levelSave(row) {
this.editRowSwitch = false this.editRowSwitch = false

Loading…
Cancel
Save