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

Loading…
Cancel
Save