1、从药品字典维护编辑功能移植到耗材字典维护 用他的界面和逻辑

20240912_adapter
qyt 6 months ago
parent ace8a4d295
commit 28754f6c05

@ -37,20 +37,114 @@
</div>
<div style=" float: right;
text-align: right;
margin-bottom: 8px;">
margin-bottom: 8px;"
>
<!-- <el-button type="primary" size="mini" icon="search" @click="addDrugLevel"-->
<!-- style="text-align:right"-->
<!-- >新增药品层级-->
<!-- </el-button>-->
<el-button type="primary" size="mini" icon="search" @click="removeDi" v-if="productType!=1"
style="text-align:right">解绑DI器械信息
</el-button>
</div>
<el-table v-loading="loading" :data="detailList" style="width: 100%; " border key="3" highlight-current-row
@current-change="handleDetail">
<el-table-column label="产品最小销售标识" prop="nameCode" show-overflow-tooltip></el-table-column>
<el-table-column label="物资名称" prop="cpmctymc" show-overflow-tooltip></el-table-column>
<el-table-column label="包装级别" prop="packLevel" show-overflow-tooltip></el-table-column>
<el-table-column label="包装单位" prop="packUnit" show-overflow-tooltip></el-table-column>
<el-table-column label="操作" width="180px">
<el-table
v-loading="loading"
:data="detailList"
style="width: 100%;"
border
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 size="small" v-model="scope.row.nameCode" style="width: 100%;margin: 4px;"
:disabled="true"
></el-input>
</template>
</el-table-column>
<!-- 1.主标识2使用单元标识3.本体标识4包装标识-->
<el-table-column label="标识类型" prop="diType" show-overflow-tooltip width="160">
<template slot-scope="scope">
<el-select v-model="scope.row.diType"
:disabled="true"
style="width: 90%" placeholder="选择标识类型" clearable>
<el-option label="最小销售标识" :value="1"></el-option>
<!-- <el-option label="使用单元标识" :value="2"></el-option>-->
<!-- <el-option label="本体标识" :value="3"></el-option>-->
<el-option label="外包装标识" :value="4"></el-option>
</el-select>
</template>
</el-table-column>
<el-table-column label="包装级别" prop="packLevel" show-overflow-tooltip width="100">
<template slot-scope="scope">
<el-input size="small" v-model="scope.row.packLevel" style="width: 100%"
type="number"
:disabled="true"
></el-input>
</template>
</el-table-column>
<el-table-column label="层级单位" prop="packUnit" show-overflow-tooltip width="120">
<template slot-scope="scope">
<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="bhxjsl" show-overflow-tooltip width="100">
<template slot-scope="scope">
<el-button type="text" @click.native.stop="singleDiEdit(scope.row)">编辑</el-button>
<el-input size="small" v-model="scope.row.bhxjsl" style="width: 100%"
type="number"
:disabled="scope.$index !== selectedIndex"
></el-input>
</template>
</el-table-column>
<el-table-column label="下级单位" prop="xjdw" show-overflow-tooltip width="120">
<template slot-scope="scope">
<el-input size="small" v-model="scope.row.xjdw" 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 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="sjcpbm" show-overflow-tooltip width="160">
<template slot-scope="scope">
<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="操作" width="180px" fixed="right">
<template slot-scope="scope">
<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>
<!--:disabled=" scope.row.id != null"-->
<!-- <el-button-->
<!-- type="text"-->
<!-- size="small"-->
<!-- @click.stop="true"-->
<!-- @click.native="deleteLevel(scope.$index, scope.row)"-->
<!-- >删除-->
<!-- </el-button>-->
</template>
</el-table-column>
</el-table>
@ -64,6 +158,7 @@
<el-select v-model="editQuery.distributeLevel" size="small" style="width: 90%"
clearable
@change="distributeLevelDiChange"
placeholder="请选择计量单位"
>
<el-option
@ -108,6 +203,7 @@
<el-select v-model="editQuery.useLevel" size="small" style="width: 90%"
clearable
@change="useLevelDiChange"
placeholder="请选择计量单位"
>
<el-option
@ -143,6 +239,18 @@
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="11" class="el-col">
<el-form-item label="拆包后可用时长(小时):" prop="unpackUseTime" label-width="160px">
<el-input v-model="editQuery.unpackUseTime" size="small" style="width: 90%"
clearable
placeholder="请输入拆包后可用时长(小时)"
>
</el-input>
</el-form-item>
</el-col>
</el-row>
</el-card>
<el-card>
<!--<el-row type="flex" class="edit-row" style="margin-top: 20px">-->
@ -1034,6 +1142,7 @@
</template>
<script>
import {
getYbHcflDetail,
disableUdi,
@ -1054,9 +1163,11 @@ import {getHslbs} from "@/api/thrsys/thrHsfl";
import {filterClassify} from "@/api/purchase/classifyCode"
import selectmedicalSuppliesDialog from "./selectmedicalSuppliesDialog"
import {
calculateDistCount, calculateUseCount
addDrug,
updatetDrug,
delDrugLevel,
updateLevelDrug, calculateDistCount, calculateUseCount
} from '@/api/basic/product/drugUdiinfos'
export default {
name: "productEdit",
props: {
@ -1101,7 +1212,18 @@ export default {
isUseDyCheck: true,
useNumEnable: true,
sysList: [],
detailList: [],
detailList: [
//
{
productId: null,
nameCode: '',
packLevel: null,
bhxjsl: null,
isDisabled: false,
isUpDisabled: true,
rowDisabled: false
}
],
fromDeptOptions: [],
hsflOptions: [],
defaultSys: null,
@ -1122,6 +1244,37 @@ export default {
onAddLoading: false,
levelUnitList: [],
maxLevel: 1,
editQuery: {
cpmctymc: null,
bzgg: null,
spmc: null,
measname: null,
manufactory: null,
ybbm: null,
cpms: null,
productsType: 2,
//
status: false,
relId: null,
drugLevelLists: [],
productId: null,
useLevelDi: null,
distributeLevelDi: null,
distributeLevelUnit: null,
useLeverCount: null,
distributeLevelCount: null,
useLevelUnit: null,
distributeLevel: null,
useLevel: null,
majorStatus: 1,
physicType: 3
},
isSave: true,
selectedIndex: null,
}
},
components: {
@ -1226,6 +1379,21 @@ export default {
})
},
addDrugLevel() {
console.log('this.detailList',this.detailList)
this.detailList.push({
nameCode: '',
packLevel: null,
bhxjsl: null,
isDisabled: false,
rowDisabled: false,
isUpDisabled: true
})
this.editQuery.productId = null
this.selectedIndex = this.detailList.length - 1
this.isSave = false
},
onClose() {
this.$emit("onClose")
},
@ -1395,6 +1563,7 @@ export default {
})
},
getDetailList(detailQuery) {
console.log('detailQuery',detailQuery)
this.loading = true;
filterByUuid(detailQuery)
.then((response) => {
@ -1540,6 +1709,82 @@ export default {
}
}
},
handleDetail(row) {
this.editQuery = row;
}, //
levelSave(row) {
if (isBlank(row.nameCode)) {
this.$message.error('层级标识不能为空')
return
}
if (isBlank(row.packLevel)) {
this.$message.error('包装级别不能为空')
return
}
if (isBlank(row.packUnit)) {
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.editQuery.id,
uuid: this.editQuery.uuid,
productId: row.productId,
diType: row.diType,
xjdw: row.xjdw
}
updateLevelDrug(editQuery).then(res => {
this.saveLoading = false
if (res.code == 20000) {
this.isSave = true
this.$message.success('保存成功!')
this.selectedIndex = null
this.getDetailList()
this.getDiLevel();
} else {
this.isSave = true
this.$message.error(res.message)
}
})
},
rowChange(index, val) {
console.log("rowChange===",index)
this.selectedIndex = index
this.isSave = false
},
deleteLevel(index, row) {
this.$confirm('此操作将删除该层级,是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
if (row.id != null) {
let params = {nameCode: row.nameCode}
console.log('params',params)
delDrugLevel(params).then((res) => {
if (res.code === 20000) {
this.isSave = true
this.$message.success('删除成功')
this.getDetailList()
}
})
} else {
this.isSave = true
this.detailList.splice(index, 1)
this.$message.success('删除成功')
}
}).catch(() => {
})
},
},
directives: {
'debounce-input': {

Loading…
Cancel
Save