11/11 基础数据最大层级取消设置默认

dev_unify
wangwei 8 months ago
parent dddebaf784
commit 94bdc11d98

@ -79,6 +79,7 @@
<el-input size="small" v-model="scope.row.packLevel" style="width: 100%" <el-input size="small" v-model="scope.row.packLevel" style="width: 100%"
type="number" type="number"
:disabled="scope.$index !== selectedIndex" :disabled="scope.$index !== selectedIndex"
@input="handleInput(scope.$index, $event,1)"
></el-input> ></el-input>
</template> </template>
</el-table-column> </el-table-column>
@ -94,6 +95,7 @@
<el-input size="small" v-model="scope.row.bhxjsl" style="width: 100%" <el-input size="small" v-model="scope.row.bhxjsl" style="width: 100%"
type="number" type="number"
:disabled="scope.$index !== selectedIndex" :disabled="scope.$index !== selectedIndex"
@input="handleInput(scope.$index, $event,1)"
></el-input> ></el-input>
</template> </template>
</el-table-column> </el-table-column>
@ -157,6 +159,7 @@
<el-select v-model="newProductData.distributeLevel" size="small" style="width: 90%" <el-select v-model="newProductData.distributeLevel" size="small" style="width: 90%"
@change="distributeLevelDiChange" @change="distributeLevelDiChange"
placeholder="请选择计量单位" placeholder="请选择计量单位"
> >
<el-option <el-option
v-for="item in levelUnitList" v-for="item in levelUnitList"
@ -699,15 +702,15 @@ export default {
distributeLevel: [ distributeLevel: [
{required: true, message: '请选择计量单位', trigger: 'blur'} {required: true, message: '请选择计量单位', trigger: 'blur'}
], ],
distributeMaxLevel: [ // distributeMaxLevel: [
{required: true, message: '请选择允许采集的最大层级', trigger: 'blur'} // {required: true, message: '', trigger: 'blur'}
], // ],
useLevel: [ useLevel: [
{required: true, message: '请选择计量单位', trigger: 'blur'} {required: true, message: '请选择计量单位', trigger: 'blur'}
], ],
useMaxLevel: [ // useMaxLevel: [
{required: true, message: '请选择允许采集的最大层级', trigger: 'blur'} // {required: true, message: '', trigger: 'blur'}
], // ],
}, },
detailList: [ detailList: [
// //
@ -864,7 +867,6 @@ 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('请补充必要数据')
@ -1089,22 +1091,22 @@ export default {
// //
setDefaultLevel(){ // setDefaultLevel(){
// // //
if (this.newProductData.distributeMaxLevel == null){ // if (this.newProductData.distributeMaxLevel == null){
let levelUnit = this.levelUnitList[this.levelUnitList.length - 1]; // let levelUnit = this.levelUnitList[this.levelUnitList.length - 1];
this.newProductData.distributeMaxLevel = levelUnit.packLevel // this.newProductData.distributeMaxLevel = levelUnit.packLevel
} // }
// 使 // // 使
if (this.newProductData.useMaxLevel == null){ // if (this.newProductData.useMaxLevel == null){
// packUnitnull // // packUnitnull
let levelUnit = this.levelUnitList[0]; // let levelUnit = this.levelUnitList[0];
if (isBlank(levelUnit.packUnit)){ // if (isBlank(levelUnit.packUnit)){
levelUnit = this.levelUnitList[1] // levelUnit = this.levelUnitList[1]
} // }
this.newProductData.useMaxLevel = levelUnit.packLevel // this.newProductData.useMaxLevel = levelUnit.packLevel
} // }
}, // },
// //
getDetailList() { getDetailList() {
if (this.newProductData.uuid != null) { if (this.newProductData.uuid != null) {
@ -1118,7 +1120,7 @@ export default {
filterByUuid(query) filterByUuid(query)
.then((response) => { .then((response) => {
this.loading = false this.loading = false
this.detailList = response.data.list || [] this.detailList = response.data || []
}) })
.catch(() => { .catch(() => {
this.loading = false this.loading = false
@ -1264,13 +1266,22 @@ export default {
closeUdi(val) { closeUdi(val) {
this.chooseHouseDrugVisible = false this.chooseHouseDrugVisible = false
this.getThirdSysDetail() this.getThirdSysDetail()
},
handleInput(index, value,type){
const intValue = parseInt(value, 10);
//
if (type == 1){
this.$set(this.detailList[index], 'packLevel', intValue);
}else {
this.$set(this.detailList[index], 'bhxjsl', intValue);
}
} }
}, },
created() { created() {
if (this.rowData != null) { if (this.rowData != null) {
this.newProductData = this.rowData this.newProductData = this.rowData
console.log("和水水水水",this.newProductData)
this.newProductData.cpmctymc = this.rowData.cpmctymc this.newProductData.cpmctymc = this.rowData.cpmctymc
this.newProductData.zczbhhzbapzbh = this.rowData.zczbhhzbapzbh this.newProductData.zczbhhzbapzbh = this.rowData.zczbhhzbapzbh
if (this.rowData.requireScanCode == 1) { if (this.rowData.requireScanCode == 1) {

@ -712,12 +712,14 @@ export default {
unionCode: null, unionCode: null,
udiCode: null, udiCode: null,
ylqxzcrbarmc: "", ylqxzcrbarmc: "",
cpmctymc: "", thrPiId: null, cpmctymc: "",
thrPiId: null,
nameCode: "", nameCode: "",
ggxh: null, ggxh: null,
page: 1, page: 1,
limit: 20, limit: 20,
addType: 1, addType: 1,
productType: 2
}; };
this.getList(); this.getList();
}, },

@ -67,7 +67,8 @@
<template slot-scope="scope"> <template slot-scope="scope">
<el-select v-model="scope.row.diType" <el-select v-model="scope.row.diType"
:disabled="scope.$index !== selectedIndex" :disabled="scope.$index !== selectedIndex"
style="width: 90%" placeholder="选择标识类型" clearable> style="width: 90%" placeholder="选择标识类型" clearable
>
<el-option label="最小销售标识" :value="1"></el-option> <el-option label="最小销售标识" :value="1"></el-option>
<!-- <el-option label="使用单元标识" :value="2"></el-option>--> <!-- <el-option label="使用单元标识" :value="2"></el-option>-->
<!-- <el-option label="本体标识" :value="3"></el-option>--> <!-- <el-option label="本体标识" :value="3"></el-option>-->
@ -80,6 +81,7 @@
<el-input size="small" v-model="scope.row.packLevel" style="width: 100%" <el-input size="small" v-model="scope.row.packLevel" style="width: 100%"
type="number" type="number"
:disabled="scope.$index !== selectedIndex" :disabled="scope.$index !== selectedIndex"
@input="handleInput(scope.$index, $event,1)"
></el-input> ></el-input>
</template> </template>
</el-table-column> </el-table-column>
@ -95,6 +97,7 @@
<el-input size="small" v-model="scope.row.bhxjsl" style="width: 100%" <el-input size="small" v-model="scope.row.bhxjsl" style="width: 100%"
type="number" type="number"
:disabled="scope.$index !== selectedIndex" :disabled="scope.$index !== selectedIndex"
@input="handleInput(scope.$index, $event,2)"
></el-input> ></el-input>
</template> </template>
</el-table-column> </el-table-column>
@ -572,42 +575,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;" v-if="type != 2"> <div style="text-align: center; margin-top: 20px;" v-if="type != 2">
@ -688,7 +691,11 @@
margin-bottom: 8px; margin-bottom: 8px;
margin-right: 15px;" margin-right: 15px;"
> >
<el-button type="primary" icon="search" @click="handleCurrentChange" <el-button type="primary" icon="search" @click="onResetDrugLevelList"
style="text-align:right"
>重置
</el-button>
<el-button type="primary" icon="search" @click="getDrugLevelList"
style="text-align:right" style="text-align:right"
>查询 >查询
</el-button> </el-button>
@ -724,12 +731,12 @@
:total="filterQueryDrugLevel.total" :total="filterQueryDrugLevel.total"
:page.sync="filterQueryDrugLevel.page" :page.sync="filterQueryDrugLevel.page"
:limit.sync="filterQueryDrugLevel.limit" :limit.sync="filterQueryDrugLevel.limit"
@pagination="handleCurrentChange" @pagination="selectDrugLevel"
></pagination> ></pagination>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
@ -740,7 +747,7 @@ import {
updateLevelDrug, calculateDistCount, calculateUseCount, updateLevelDrug, calculateDistCount, calculateUseCount,
getDrugLevelList, getDrugLevelListBycode getDrugLevelList, getDrugLevelListBycode
} from '@/api/basic/product/drugUdiinfos' } from '@/api/basic/product/drugUdiinfos'
import {isBlank} from "@/utils/strUtil"; import { isBlank } from '@/utils/strUtil'
import { import {
getYbDrugDetail, removeRl, thirdSysDetail getYbDrugDetail, removeRl, thirdSysDetail
@ -868,7 +875,7 @@ export default {
], ],
useMaxLevel: [ useMaxLevel: [
{ required: true, message: '请选择允许采集的最大层级', trigger: 'blur' } { required: true, message: '请选择允许采集的最大层级', trigger: 'blur' }
], ]
}, },
detailList: [ detailList: [
// //
@ -897,12 +904,12 @@ export default {
selectDrugLevelVisible: false, selectDrugLevelVisible: false,
selectDrugLevelList: [], selectDrugLevelList: [],
filterQueryDrugLevel: { filterQueryDrugLevel: {
nameCode: "", nameCode: '',
cpmctymc: "", cpmctymc: '',
page: 1, page: 1,
limit: 20, limit: 20,
total: 0, total: 0
}, }
} }
}, },
@ -938,7 +945,7 @@ export default {
this.newProductData.zczbhhzbapzbh = this.ybDrugDetail.approvalCode this.newProductData.zczbhhzbapzbh = this.ybDrugDetail.approvalCode
this.newProductData.cpmctymc = this.ybDrugDetail.registeredProductName this.newProductData.cpmctymc = this.ybDrugDetail.registeredProductName
this.newProductData.spmc = this.ybDrugDetail.goodsName this.newProductData.spmc = this.ybDrugDetail.goodsName
this.newProductData.bzgg = this.ybDrugDetail.factor + this.ybDrugDetail.minUnit + "/" + this.ybDrugDetail.unit this.newProductData.bzgg = this.ybDrugDetail.factor + this.ybDrugDetail.minUnit + '/' + this.ybDrugDetail.unit
this.newProductData.matrial = this.ybDrugDetail.materialName this.newProductData.matrial = this.ybDrugDetail.materialName
this.newProductData.packMatrial = this.ybDrugDetail.materialName this.newProductData.packMatrial = this.ybDrugDetail.materialName
this.newProductData.packUnit = this.ybDrugDetail.unit this.newProductData.packUnit = this.ybDrugDetail.unit
@ -946,12 +953,12 @@ export default {
this.newProductData.manufactory = this.ybDrugDetail.companyNameSc this.newProductData.manufactory = this.ybDrugDetail.companyNameSc
this.newProductData.prepnUnit = this.ybDrugDetail.realityMedicinemodel this.newProductData.prepnUnit = this.ybDrugDetail.realityMedicinemodel
if (this.ybDrugDetail.productInsuranceType != "" && this.ybDrugDetail.productInsuranceType != null) { if (this.ybDrugDetail.productInsuranceType != '' && this.ybDrugDetail.productInsuranceType != null) {
if ("甲" == this.ybDrugDetail.productInsuranceType) { if ('甲' == this.ybDrugDetail.productInsuranceType) {
this.newProductData.medicareType = 1 this.newProductData.medicareType = 1
} else if ("乙" == this.ybDrugDetail.productInsuranceType) { } else if ('乙' == this.ybDrugDetail.productInsuranceType) {
this.newProductData.medicareType = 2 this.newProductData.medicareType = 2
} else if ("丙" == this.ybDrugDetail.productInsuranceType) { } else if ('丙' == this.ybDrugDetail.productInsuranceType) {
this.newProductData.medicareType = 3 this.newProductData.medicareType = 3
} else { } else {
this.newProductData.medicareType = null this.newProductData.medicareType = null
@ -970,7 +977,7 @@ export default {
}, },
saveNewProduct() { saveNewProduct() {
if (!this.isSave) { if (!this.isSave) {
return this.$message.error("请先保存药品层级") return this.$message.error('请先保存药品层级')
} }
this.addProductDialogVisible = false this.addProductDialogVisible = false
this.newProductData.registerNo = this.newProductData.zczbhhzbapzbh this.newProductData.registerNo = this.newProductData.zczbhhzbapzbh
@ -1096,7 +1103,7 @@ export default {
this.$message.success('保存成功!') this.$message.success('保存成功!')
this.selectedIndex = null this.selectedIndex = null
this.getDetailList() this.getDetailList()
this.getDiLevel(); this.getDiLevel()
} else { } else {
this.isSave = true this.isSave = true
this.$message.error(res.message) this.$message.error(res.message)
@ -1108,6 +1115,23 @@ export default {
row.isUpDisabled = true row.isUpDisabled = true
row.rowDisabled = false row.rowDisabled = false
}, },
getDrugLevelList() {
this.filterQueryDrugLevel.page = 1
this.selectDrugLevel()
},
onResetDrugLevelList() {
this.$router.push({
path: ''
})
this.filterQueryDrugLevel = {
nameCode: '',
cpmctymc: '',
page: 1,
limit: 20,
total: 0
}
this.selectDrugLevel()
},
selectDrugLevel() { selectDrugLevel() {
// //
getDrugLevelList(this.filterQueryDrugLevel).then((response) => { getDrugLevelList(this.filterQueryDrugLevel).then((response) => {
@ -1125,14 +1149,14 @@ export default {
if (response.data.length > 0) { if (response.data.length > 0) {
response.data.forEach(item => { response.data.forEach(item => {
// //
let parts = item.bzgg.split('/'); let parts = item.bzgg.split('/')
// ':' // ':'
const ratioParts = item.packRatio.split(':'); const ratioParts = item.packRatio.split(':')
let selectedValue; let selectedValue
if (item.packLevel >= 0 && item.packLevel < ratioParts.length) { if (item.packLevel >= 0 && item.packLevel < ratioParts.length) {
selectedValue = ratioParts[item.packLevel]; selectedValue = ratioParts[item.packLevel]
} else { } else {
selectedValue = null; // selectedValue = null //
} }
let editQuery = { let editQuery = {
@ -1231,10 +1255,10 @@ export default {
uuid: this.newProductData.uuid, uuid: this.newProductData.uuid,
id: this.newProductData.rlId, id: this.newProductData.rlId,
nameCode: this.newProductData.nameCode, nameCode: this.newProductData.nameCode,
productType: this.newProductData.productsType, productType: this.newProductData.productsType
} }
this.loading = true this.loading = true
console.log("djdjd",query) console.log('djdjd', query)
filterByUuid(query) filterByUuid(query)
.then((response) => { .then((response) => {
this.loading = false this.loading = false
@ -1292,10 +1316,10 @@ export default {
}, },
findMaxLevelObject() { findMaxLevelObject() {
this.maxLevel = 1; this.maxLevel = 1
for (const obj of this.levelUnitList) { for (const obj of this.levelUnitList) {
if (obj.packLevel > this.maxLevel) { if (obj.packLevel > this.maxLevel) {
this.maxLevel = Number(obj.packLevel); this.maxLevel = Number(obj.packLevel)
} }
} }
}, },
@ -1384,6 +1408,18 @@ export default {
closeUdi(val) { closeUdi(val) {
this.chooseHouseDrugVisible = false this.chooseHouseDrugVisible = false
this.getThirdSysDetail() this.getThirdSysDetail()
},
//
handleInput(index, value,type){
const intValue = parseInt(value, 10);
//
if (type == 1){
this.$set(this.detailList[index], 'packLevel', intValue);
}else {
this.$set(this.detailList[index], 'bhxjsl', intValue);
}
} }
}, },

Loading…
Cancel
Save