药品字典修改

20240912_adapter_z
anthonywj 8 months ago
parent e7ad1240e8
commit 1546c7846a

@ -102,6 +102,7 @@ export function addProduct(query) {
data: query
});
}
export function addDrug(query) {
return axios({
url: "/udi/udirel/addDrug",
@ -109,6 +110,7 @@ export function addDrug(query) {
data: query
});
}
export function updatetDrug(query) {
return axios({
url: "/udi/udirel/updatetDrug",
@ -117,6 +119,23 @@ export function updatetDrug(query) {
});
}
export function updateLevelDrug(query) {
return axios({
url: "/udi/udirel/updateLevelDrug",
method: "post",
data: query
});
}
export function delDrugLevel(query) {
return axios({
url: "udi/udirel/drug/delLevel",
method: "post",
data: query
});
}
export function addAllErp(query) {
return axios({

@ -1,6 +1,6 @@
<template>
<div>
<el-form :model="newProductData" :rules="formRules" label-width="120px" ref="dataForm">
<el-form :model="newProductData" :rules="formRules" label-width="140px" ref="dataForm">
<el-collapse v-model="activeNames">
<el-collapse-item name="1">
<template slot="title">
@ -21,53 +21,73 @@
key="3"
@current-change="handleDetail"
>
<el-table-column label="序号" type="index"></el-table-column>
<el-table-column label="层级标识" prop="nameCode" show-overflow-tooltip width="160">
<template slot-scope="scope">
<el-input v-model="productData.nameCode"
placeholder="" style="width: 100%"
<el-input size="small" v-model="scope.row.nameCode" style="width: 100%;margin: 4px;"
:disabled="scope.$index !== selectedIndex"
></el-input>
</template>
</el-table-column>
<el-table-column label="包装级别" prop="packLevel" show-overflow-tooltip width="160">
<template slot-scope="scope">
<el-input v-model="productData.packLevel"
placeholder="" style="width: 100%"
<el-input size="small" v-model="scope.row.packLevel" style="width: 100%"
type="number"
:disabled="scope.$index !== selectedIndex"
></el-input>
</template>
</el-table-column>
<el-table-column label="层级单位" prop="packUnit" show-overflow-tooltip width="100">
<template slot-scope="scope">
<el-input v-model="productData.packUnit"
placeholder="" style="width: 100%"
<el-input size="small" v-model="scope.row.packUnit" style="width: 100%"
:disabled="scope.$index !== selectedIndex"
></el-input>
</template>
</el-table-column>
<el-table-column label="上级标识" prop="sjcpbm" show-overflow-tooltip width="160">
<template slot-scope="scope">
<el-input v-model="productData.packUnit"
placeholder="" style="width: 100%;margin: 5px"
<el-input size="small" v-model="scope.row.sjcpbm" style="width: 100%"
:disabled="scope.$index !== selectedIndex"
></el-input>
</template>
</el-table-column>
<el-table-column label="下级标识" prop="bhxjcpbm" show-overflow-tooltip width="160">
<template slot-scope="scope">
<el-input v-model="productData.packUnit"
placeholder="" style="width: 100%"
<el-input size="small" v-model="scope.row.bhxjcpbm" style="width: 100%"
:disabled="scope.$index !== selectedIndex"
></el-input>
</template>
</el-table-column>
<el-table-column label="下级数量" prop="bhxjsl" show-overflow-tooltip width="100">
<template slot-scope="scope">
<el-input v-model="productData.bhxjsl"
<el-input size="small" v-model="scope.row.bhxjsl" style="width: 100%"
type="number"
placeholder="" style="width: 100%"
:disabled="scope.$index !== selectedIndex"
></el-input>
</template>
</el-table-column>
<el-table-column label="操作" width="180px">
<el-table-column label="操作" width="180px" fixed="right">
<template slot-scope="scope">
<el-button type="text" @click.native="levelSave(productData)">保存</el-button>
<el-button type="text">删除</el-button>
<el-button type="text" size="small" v-if="scope.$index == selectedIndex" @click.stop="true"
@click.native="levelSave(scope.row)">保存
</el-button>
<el-button
type="text"
size="small"
v-if="scope.$index != selectedIndex "
@click.stop="true"
@click.native="rowChange(scope.$index,scope.row)"
>编辑
</el-button>
<el-button
type="text"
size="small"
@click.stop="true"
:disabled="scope.$index == selectedIndex || scope.row.id == null"
@click.native="deleteLevel(scope.$index, scope.row)"
>删除
</el-button>
</template>
</el-table-column>
</el-table>
@ -241,51 +261,6 @@
</el-form-item>
</el-col>
</el-row>
<!-- <el-row type="flex">-->
<!-- <el-col :span="11" class="el-col">-->
<!-- <el-form-item label="产品类别:" prop="cplb">-->
<!-- <el-input style="width: 90%" size="small" placeholder="请输入产品类别" v-model.trim="newProductData.cplb"></el-input>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- <el-col :span="11" class="el-col">-->
<!-- <el-form-item label="分类编码:" prop="flbm">-->
<!-- <el-select-->
<!-- size="small"-->
<!-- v-model="newProductData.flbm"-->
<!-- filterable-->
<!-- remote-->
<!-- clearable="true"-->
<!-- style="width: 90%"-->
<!-- reserve-keyword-->
<!-- placeholder="请选择"-->
<!-- :loading="loading"-->
<!-- @change="classifyChange()"-->
<!-- >-->
<!-- <el-option-->
<!-- v-for="item in classifyList"-->
<!-- :key="item.code"-->
<!-- :label="item.name"-->
<!-- :value="item.code">-->
<!-- <span>{{ item.code }}</span>-->
<!-- <span>{{ item.name }}</span>-->
<!-- </el-option>-->
<!-- </el-select>-->
<!--&lt;!&ndash; <el-input style="width: 90%" size="small" placeholder="请输入分类编码" v-model.trim="newProductData.flbm"></el-input>&ndash;&gt;-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- </el-row>-->
<!--<el-row type="flex">-->
<!-- <el-col :span="11" class="el-col">-->
<!-- <el-form-item label="商品条码:" prop="sptm">-->
<!-- <el-input style="width: 90%" size="small" placeholder="请输入商品条码" v-model.trim="newProductData.sptm"></el-input>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- <el-col :span="11" class="el-col">-->
<!-- <el-form-item label="医保编码:" prop="ybbm">-->
<!-- <el-input style="width: 90%" size="small" placeholder="请输入医保编码" v-model.trim="newProductData.ybbm" v-debounce-input:500ms="getYbHcData" ></el-input>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!--</el-row>-->
<el-row type="flex">
<el-col :span="11" class="el-col">
<el-form-item label="统一社会信用号:" prop="tyshxydm">
@ -302,13 +277,6 @@
</el-select>
</el-form-item>
</el-col>
<!--<el-col :span="11" class="el-col">-->
<!-- <el-form-item label="产品描述:" prop="cpms">-->
<!-- <el-input style="width: 90%" type="textarea" size="mini" rows="1" placeholder="请输入产品描述"-->
<!-- v-model.trim="newProductData.cpms"-->
<!-- ></el-input>-->
<!-- </el-form-item>-->
<!--</el-col>-->
</el-row>
<el-row type="flex">
@ -322,7 +290,80 @@
</el-row>
</el-collapse-item>
<el-collapse-item name="3">
<template slot="title">
<p class="form-title">参数设置</p>
</template>
<el-row :gutter="20">
<el-col :span="11" class="el-col">
<el-form-item label="流通计量层级标识:" prop="distributeLevelDi" label-width="160px">
<el-select v-model="newProductData.distributeLevelDi" size="small" style="width: 90%"
@change="distributeLevelDiChange"
clearable
placeholder="请选择流通计量层级标识">
<el-option
v-for="item in detailList"
:key="item.nameCode"
:value="item.nameCode"
:label="item.nameCode">
<span style="float: left">{{ item.nameCode }}</span>
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.packLevel }}</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="11" class="el-col">
<el-form-item label="使用计量层级标识:" prop="useLevelDi" label-width="160px">
<el-select v-model="newProductData.useLevelDi" size="small" style="width: 90%"
@change="useLevelDiChange"
clearable
placeholder="请选择流通计量层级标识">
<el-option
v-for="item in detailList"
:key="item.nameCode"
:value="item.nameCode"
:label="item.nameCode">
<span style="float: left">{{ item.nameCode }}</span>
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.packLevel }}</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="11" class="el-col">
<el-form-item label="流通计量层级单位:" prop="distributeLevelUnit" label-width="160px">
<el-input style="width: 90%" size="small" placeholder="请输入流通计量层级单位"
disabled
v-model="newProductData.distributeLevelUnit"
></el-input>
</el-form-item>
</el-col>
<el-col :span="11" class="el-col">
<el-form-item label="使用计量层级标识:" prop="useLevelUnit" label-width="160px">
<el-input style="width: 90%" size="small" placeholder="请输入使用计量层级标识"
disabled
v-model.trim="newProductData.useLevelUnit"
></el-input>
</el-form-item>
</el-col>
<el-col :span="11" class="el-col">
<el-form-item label="流通时含计量单元数量:" prop="distributeLevelCount" label-width="160px">
<el-input style="width: 90%" size="small" placeholder="请输入流通时包含计量单元的数量"
v-model.trim="newProductData.distributeLevelCount"
></el-input>
</el-form-item>
</el-col>
<el-col :span="11" class="el-col">
<el-form-item label="使用时含计量单元数量:" prop="useLeverCount" label-width="160px">
<el-input style="width: 90%" size="small" placeholder="请输入使用时包含计量单元的数量"
v-model.trim="newProductData.useLeverCount"
></el-input>
</el-form-item>
</el-col>
</el-row>
</el-collapse-item>
<el-collapse-item name="4">
<template slot="title">
<p class="form-title">高级设置</p>
</template>
@ -345,10 +386,6 @@
</el-col>
<el-divider direction="vertical"></el-divider>
<el-col :span="11" class="el-col">
<!--<el-select v-model="newProductData.status" style="width: 65%" placeholder="状态" clearable>-->
<!-- <el-option label="是" :value=1></el-option>-->
<!-- <el-option label="否" :value=0></el-option>-->
<!--</el-select>-->
<el-switch
v-model="status"
active-color="#13ce66"
@ -372,8 +409,16 @@
</template>
<script>
import {getYbHcflDetail, addProduct, addDrug, updatetDrug} from '@/api/basic/product/udiRelevance'
import {
getYbHcflDetail,
addProduct,
addDrug,
updatetDrug,
delDrugLevel,
updateLevelDrug
} from '@/api/basic/product/udiRelevance'
import {filterClassify} from '@/api/purchase/classifyCode'
import {filterByUuid} from "@/api/basic/product/udiInfo";
export default {
name: 'drugAdd',
@ -387,6 +432,7 @@ export default {
required: false
},
type: {
//12
type: Object,
required: false
}
@ -403,10 +449,19 @@ export default {
manufactory: null,
ybbm: null,
cpms: null,
productsType: 2,
//
status: false
status: false,
relId: null,
drugLevelLists: [],
useLevelDi: null,
distributeLevelDi: null,
distributeLevelUnit: null,
useLeverCount: null,
distributeLevelCount: null,
useLevelUnit: null
},
thirdSys: [],
classifyList: [],
@ -452,7 +507,9 @@ export default {
{nameCode: '', packLevel: null, bhxjsl: null, isDisabled: false, isUpDisabled: true, rowDisabled: false}
],
status: false,
rowDisabled: false
rowDisabled: false,
selectedIndex: null,
loading: false,
}
},
@ -501,6 +558,7 @@ export default {
},
saveNewProduct() {
this.addProductDialogVisible = false
//
if (this.type == 1) {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
@ -509,13 +567,33 @@ export default {
} else {
this.newProductData.requireScanCode = 0
}
let detailList = this.detailList.map(item => ({
nameCode: item.nameCode,
packLevel: item.packLevel,
bhxjsl: item.bhxjsl
}));
this.newProductData.drugLevelLists = detailList
this.saveLoading = true
if (this.detailList.length <= 0) {
this.$message.error('请先添加药品层级标识')
return
} else {
const validateItem = (item, fieldName, errorMessage) => {
if (!item[fieldName]) {
this.$message.error(errorMessage);
return false;
}
return true;
};
for (let i = 0; i < this.detailList.length; i++) {
const item = this.detailList[i];
if (!validateItem(item, 'nameCode', '药品层级标识不能为空!') ||
!validateItem(item, 'packLevel', '包装级别不能为空') ||
!validateItem(item, 'packUnit', '层级单位不能为空')) {
return;
}
}
const isLevel1 = this.detailList.some(item => item.packLevel === 1);
if (!isLevel1) {
this.$message.error('药品层级缺少一级标识!');
}
this.newProductData.drugLevelLists = this.detailList;
}
addDrug(this.newProductData).then((res) => {
this.saveLoading = false
if (res.code == 20000) {
@ -539,14 +617,15 @@ 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) {
//
this.closeDialog()
this.$message.success('成功')
this.$message.success('保存成功')
} else {
this.$message.error('失败')
this.$message.error(res.message)
}
})
}
@ -558,26 +637,38 @@ export default {
//
levelSave(row) {
const isNotEmpty = row.nameCode || row.packLevel || row.bhxjsl;
if (!isNotEmpty) {
return this.$message.error("至少填写一个属性");
if (row.nameCode == null) {
this.$message.error("层级标识不能为空");
return
}
if (row.packLevel == null) {
this.$message.error("包装级别不能为空");
return
}
if (row.packUnit == null) {
this.$message.error("层级单位不能为空");
return
}
let editQuery = {
nameCode: row.nameCode,
packLevel: row.packLevel,
packUnit: row.packUnit,
sjcpbm: row.sjcpbm,
bhxjcpbm: row.bhxjcpbm,
bhxjsl: row.bhxjsl,
relId: this.newProductData.id,
uuid: this.newProductData.uuid
}
row.isDisabled = true
row.isUpDisabled = false
row.rowDisabled = true
// //
// if ( this.drugLevelList.length > 0){
// // this.drugLevelList
// const index = this.detailList.indexOf(row);
// this.$set(this.drugLevelList, index, {
// ...this.drugLevelList[index],
// nameCode: row.nameCode,
// packLevel: row.packLevel,
// bhxjsl: row.bhxjsl,
// });
// }else {
// this.drugLevelList.push(data)
// }
updateLevelDrug(editQuery).then(res => {
this.saveLoading = false
if (res.code == 20000) {
this.$message.success("保存成功!");
if (this.newProductData.id != null)
this.getDetailList();
} else {
this.$message.error(res.message)
}
})
},
update(row) {
row.isDisabled = false
@ -585,7 +676,6 @@ export default {
row.rowDisabled = false
},
addDrugLevel() {
// detailList
this.detailList.push({
nameCode: '',
packLevel: null,
@ -595,16 +685,64 @@ export default {
isUpDisabled: true
});
},
remove(row) {
// detailList
const index = this.detailList.indexOf(row);
if (index == 0) {
return this.$message.error("至少添加一层")
rowChange(index, val) {
this.selectedIndex = index;
},
deleteLevel(index, row) {
this.$confirm('此操作将删除该层级,是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let params = {nameCode: row.nameCode};
delDrugLevel(params).then((res) => {
if (res.code === 20000) {
this.$message.success("删除成功");
this.getList();
}
})
}).catch(() => {
});
},
//
getDetailList() {
this.loading = true;
if (this.newProductData.uuid != null) {
let query = {
uuid: this.newProductData.uuid,
id: this.newProductData.id
}
filterByUuid(query)
.then((response) => {
this.loading = false;
this.detailList = response.data || [];
})
.catch(() => {
this.loading = false;
this.detailList = [];
});
}
if (index !== -1) {
this.detailList.splice(index, 1);
},
distributeLevelDiChange(val) {
const matchingItem = this.detailList.find(item => item.nameCode == val);
if (matchingItem) {
this.newProductData.distributeLevelUnit = matchingItem.packUnit;
}
},
useLevelDiChange(val) {
const matchingItem = this.detailList.find(item => item.nameCode == val);
if (matchingItem) {
this.newProductData.useLevelUnit = matchingItem.packUnit;
}
}
},
created() {
if (this.rowData != null) {
@ -616,6 +754,7 @@ export default {
} else {
this.status = false
}
this.getDetailList();
}
},
directives: {

@ -102,7 +102,6 @@
<el-table-column label="价格" prop="price" width="90"></el-table-column>
<el-table-column label="批准文号" prop="zczbhhzbapzbh" width="90"></el-table-column>
<el-table-column label="生产企业" prop="manufactory" width="90"></el-table-column>
<el-table-column label="收费项目编码" prop="remake" width="100"></el-table-column>
<el-table-column label="医保编码" prop="ybbm" width="90"></el-table-column>
<el-table-column label="药品状态" prop="majorStatus" width="90">
<template slot-scope="scope">
@ -111,20 +110,8 @@
</el-tag>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" width="160">
<el-table-column label="操作" fixed="right" width="100">
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click.native.stop="edit(scope.row)"
>对照
</el-button>
<el-button
type="text"
size="small"
@click.native.stop="edit(scope.row)"
>详情
</el-button>
<el-button
type="text"
size="small"
@ -195,7 +182,7 @@ import drugAdd from '@/views/basic/product/drug/drugAdd'
import chooseDrug from '@/views/basic/product/drug/chooseDrug'
export default {
components: {drugAdd,chooseDrug},
components: {drugAdd, chooseDrug},
name: 'drugMaintain',
data() {
return {
@ -217,6 +204,7 @@ export default {
},
fromName: '',
rowData: {},
//12
type: null,
fromMap: {
'add': '新增-药品信息',
@ -246,13 +234,13 @@ export default {
this.filterQuery.page = 1;
this.getList()
},
addDrug(){
addDrug() {
this.fromName = 'add'
this.type = 1
this.rowData = null
this.addDrugVisible = true
},
chooseDrug(){
chooseDrug() {
this.chooseDrugVisible = true
},
getList() {
@ -268,7 +256,7 @@ export default {
this.total = 0
})
},
deleteDrug(row){
deleteDrug(row) {
this.$confirm("此操作将永久删除该药品信息, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
@ -278,10 +266,10 @@ export default {
id: row.id + "",
};
deletetUdiInfos(tquery).then(res => {
if (res.code != 20000){
if (res.code != 20000) {
this.$message.error("删除错误")
this.getList()
}else {
} else {
this.$message.success("删除成功!")
this.getList()
}
@ -290,13 +278,13 @@ export default {
})
})
},
editDrug(row){
editDrug(row) {
this.fromName = 'edit'
this.rowData = row
this.type = 2
this.addDrugVisible = true;
},
closeDialog(){
closeDialog() {
this.addDrugVisible = false;
}
},

@ -474,16 +474,16 @@ export default {
getPrescribeDetail(_this, row) {
if (row != null) {
_this.preQuery.page = 1
_this.preQuery.prescribeCode = row.code
_this.preQuery.codeIdFk = row.id
}
_this.preLoading = true;
detail(_this.preQuery).then(res => {
materialPrescribePage(_this.preQuery).then(res => {
_this.preLoading = false
if (res.code != 20000) {
_this.$message.error(res.message)
return
}
_this.preDetailList = res.data.items
_this.preDetailList = res.data.list
_this.preLoading = false
}).catch(() => {
_this.preLoading = false

Loading…
Cancel
Save