|
@@ -4,7 +4,7 @@
|
|
|
<searchArea :searchData="searchData" @submit="searchByForm"></searchArea>
|
|
|
</div>
|
|
|
|
|
|
- <div class="layout_display_flex_y">
|
|
|
+ <div class="layout_display_flex_y" style="height: 85%">
|
|
|
<div style="background-color: #fff;padding: 8px">
|
|
|
<!-- <el-button type="primary" icon="Search" @click="queryItem" style="margin-left: 5px">查询</el-button> -->
|
|
|
<el-button type="primary" icon="Plus" @click="onAddItem" style="margin-left: 5px">新增</el-button>
|
|
@@ -13,51 +13,37 @@
|
|
|
<el-table
|
|
|
:data="ypClassData.slice(pageSizeClass * (currentPageClass - 1), pageSizeClass * currentPageClass)"
|
|
|
border style="width: 100%" height="100%" stripe highlight-current-row class="ypClassTable normal-size">
|
|
|
- <el-table-column prop="code" label="供应商编码" width="80">
|
|
|
+ <el-table-column prop="code" label="项目编码">
|
|
|
<template v-slot="scope">
|
|
|
<el-input v-if="scope.row.isEdit" size="small" v-model="scope.row.code"></el-input>
|
|
|
<span v-else>{{ scope.row.code }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="name" label="供应商名称" width="200">
|
|
|
+ <el-table-column prop="name" label="项目名称">
|
|
|
<template v-slot="scope">
|
|
|
<el-input v-if="scope.row.isEdit" size="small" v-model="scope.row.name"></el-input>
|
|
|
<span v-else>{{ scope.row.name }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="pyCode" label="拼音码" width="140" />
|
|
|
- <el-table-column prop="dcode" label="五笔码" width="140" />
|
|
|
- <el-table-column prop="name" label="厂商类型" width="200">
|
|
|
+ <el-table-column prop="name" label="规格">
|
|
|
<template v-slot="scope">
|
|
|
<el-input v-if="scope.row.isEdit" size="small" v-model="scope.row.name"></el-input>
|
|
|
<span v-else>{{ scope.row.name }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="name" label="地址" width="200">
|
|
|
+ <el-table-column prop="name" label="单位">
|
|
|
<template v-slot="scope">
|
|
|
<el-input v-if="scope.row.isEdit" size="small" v-model="scope.row.name"></el-input>
|
|
|
<span v-else>{{ scope.row.name }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="name" label="电话" width="140">
|
|
|
+ <el-table-column prop="name" label="物价码">
|
|
|
<template v-slot="scope">
|
|
|
<el-input v-if="scope.row.isEdit" size="small" v-model="scope.row.name"></el-input>
|
|
|
<span v-else>{{ scope.row.name }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- =<el-table-column prop="name" label="账号" width="140">
|
|
|
- <template v-slot="scope">
|
|
|
- <el-input v-if="scope.row.isEdit" size="small" v-model="scope.row.name"></el-input>
|
|
|
- <span v-else>{{ scope.row.name }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="name" label="开户银行" width="140">
|
|
|
- <template v-slot="scope">
|
|
|
- <el-input v-if="scope.row.isEdit" size="small" v-model="scope.row.name"></el-input>
|
|
|
- <span v-else>{{ scope.row.name }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="delFlag" label="是否停用" width="100">
|
|
|
+ <el-table-column prop="delFlag" label="项目类型">
|
|
|
<template v-slot="scope">
|
|
|
<div v-if="scope.row.isEdit">
|
|
|
<el-select v-model="scope.row.delFlag" clearable placeholder="请选择是否停用">
|
|
@@ -123,10 +109,6 @@ import searchArea from '@/components/searchArea/index.vue';
|
|
|
const editableTabsValue = ref('ypClass')
|
|
|
const msgTip = '分类编码(code)有变更,原始字典记录存在关联,请谨慎做更改,是否确认!!!'
|
|
|
const delFlagOptions = [{ code: '0', name: '启用' }, { code: '1', name: '停用' }]
|
|
|
-const ypTypeOptions = [{ code: '1', name: '西药' }, { code: '2', name: '成药' }, { code: '3', name: '草药' }, { code: '4', name: '卫生材料' }]
|
|
|
-const refundableFeesOptions = [{ code: '0', name: '否' }, { code: '1', name: '是' }]
|
|
|
-const visibleFlagOptions = [{ code: '0', name: '正常' }, { code: '1', name: '停用' }]
|
|
|
-const yesOptions = [{ code: '0', name: '否' }, { code: '1', name: '是' }]
|
|
|
|
|
|
const searchData = ref([
|
|
|
{
|
|
@@ -742,894 +724,9 @@ const deleteYpClass = (index, row) => {
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
-// 药品字典-药性字典增删改存结束
|
|
|
-
|
|
|
-// 药品字典-药品分类字典增删改存开始
|
|
|
-// 编辑
|
|
|
-const editDrugKind = (row) => {
|
|
|
- // 备份原始数据
|
|
|
- row['oldRow'] = JSON.parse(JSON.stringify(row))
|
|
|
- row.isEdit = true
|
|
|
-}
|
|
|
-// 取消
|
|
|
-const cancelDrugKind = (row) => {
|
|
|
- // 如果是新增的数据
|
|
|
- if (row.isAdd) {
|
|
|
- drugKindData.value.splice(drugKindData.value.length - 1, 1)
|
|
|
- } else {
|
|
|
- // 不是新增的数据 还原数据
|
|
|
- for (const i in row.oldRow) {
|
|
|
- row[i] = row.oldRow[i]
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
-// 保存
|
|
|
-const updateDrugKind = (row) => {
|
|
|
- if (!row.code || !row.name) {
|
|
|
- ElMessage({
|
|
|
- type: "warning",
|
|
|
- message: "药品分类字典编码或名称不存在,请检查!",
|
|
|
- duration: 2500,
|
|
|
- showClose: true,
|
|
|
- });
|
|
|
- return
|
|
|
- }
|
|
|
-
|
|
|
- if (row.isAdd) {
|
|
|
- let fe = 0
|
|
|
- for (let num in drugKindData.value) {
|
|
|
- if (drugKindData.value[num].code === row.code) {
|
|
|
- fe++
|
|
|
- }
|
|
|
- }
|
|
|
- if (fe === 2) {
|
|
|
- ElMessage({
|
|
|
- type: "warning",
|
|
|
- message: "存在重复的药品分类字典,请核对!",
|
|
|
- duration: 2500,
|
|
|
- showClose: true,
|
|
|
- });
|
|
|
- } else {
|
|
|
- callSaveDrugKind(row, null)
|
|
|
- }
|
|
|
-
|
|
|
- } else {
|
|
|
- let oldCode = row.oldRow.code
|
|
|
- if (oldCode !== row.code) {
|
|
|
- ElMessageBox.confirm(msgTip, {
|
|
|
- cancelButtonText: '取消',
|
|
|
- confirmButtonText: '确定',
|
|
|
- type: 'warning',
|
|
|
- distinguishCancelAndClose: true,
|
|
|
- dangerouslyUseHTMLString: true
|
|
|
- }).then(() => {
|
|
|
- callSaveDrugKind(row, oldCode)
|
|
|
- }).catch((action) => {
|
|
|
- if (action === 'cancel') {
|
|
|
- queryDrugKind()
|
|
|
- }
|
|
|
- })
|
|
|
- } else {
|
|
|
- callSaveDrugKind(row, oldCode)
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-const callSaveDrugKind = (row, oldCode) => {
|
|
|
- let title = '请确认是否保存<span style="color:#d12020;">' + row.name + '</span>?'
|
|
|
- ElMessageBox.confirm(title, {
|
|
|
- cancelButtonText: '取消',
|
|
|
- confirmButtonText: '确定',
|
|
|
- type: 'warning',
|
|
|
- distinguishCancelAndClose: true,
|
|
|
- dangerouslyUseHTMLString: true
|
|
|
- }).then(() => {
|
|
|
- saveDrugKind(row).then((res) => {
|
|
|
- ElMessage({
|
|
|
- type: "success",
|
|
|
- message: res.cg,
|
|
|
- duration: 2500,
|
|
|
- showClose: true,
|
|
|
- });
|
|
|
- if (oldCode !== null && oldCode !== row.code) {
|
|
|
- // 删除原始数据
|
|
|
- delDrugKindByCode(oldCode).then((res) => {
|
|
|
- queryDrugKind()
|
|
|
- })
|
|
|
- } else {
|
|
|
- queryDrugKind()
|
|
|
- }
|
|
|
- })
|
|
|
- }).catch((action) => {
|
|
|
- if (action === 'cancel') {
|
|
|
- queryDrugKind()
|
|
|
- }
|
|
|
- })
|
|
|
-}
|
|
|
-
|
|
|
-const deleteDrugKind = (index, row) => {
|
|
|
- let title = '请确认是否删除<span style="color:#d12020;">' + row.name + '</span>?'
|
|
|
- ElMessageBox.confirm(title, {
|
|
|
- cancelButtonText: '取消',
|
|
|
- confirmButtonText: '确定',
|
|
|
- type: 'warning',
|
|
|
- distinguishCancelAndClose: true,
|
|
|
- dangerouslyUseHTMLString: true
|
|
|
- }).then(() => {
|
|
|
- delDrugKindByCode(row.code).then((res) => {
|
|
|
- ElMessage({
|
|
|
- type: "success",
|
|
|
- message: res.cg,
|
|
|
- duration: 2500,
|
|
|
- showClose: true,
|
|
|
- });
|
|
|
- queryDrugKind()
|
|
|
- })
|
|
|
- }).catch((action) => {
|
|
|
- if (action === 'cancel') {
|
|
|
- queryDrugKind()
|
|
|
- }
|
|
|
- })
|
|
|
-}
|
|
|
-// 药品字典-药品分类字典增删改存结束
|
|
|
-
|
|
|
-// 药品字典-药品剂型字典增删改存开始
|
|
|
-// 编辑
|
|
|
-const editYpDosage = (row) => {
|
|
|
- // 备份原始数据
|
|
|
- row['oldRow'] = JSON.parse(JSON.stringify(row))
|
|
|
- row.isEdit = true
|
|
|
-}
|
|
|
-// 取消
|
|
|
-const cancelYpDosage = (row) => {
|
|
|
- // 如果是新增的数据
|
|
|
- if (row.isAdd) {
|
|
|
- ypDosageData.value.splice(ypDosageData.value.length - 1, 1)
|
|
|
- } else {
|
|
|
- // 不是新增的数据 还原数据
|
|
|
- for (const i in row.oldRow) {
|
|
|
- row[i] = row.oldRow[i]
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
-// 保存
|
|
|
-const updateYpDosage = (row) => {
|
|
|
- if (!row.code || !row.name) {
|
|
|
- ElMessage({
|
|
|
- type: "warning",
|
|
|
- message: "药品剂型字典编码或名称不存在,请检查!",
|
|
|
- duration: 2500,
|
|
|
- showClose: true,
|
|
|
- });
|
|
|
- return
|
|
|
- }
|
|
|
-
|
|
|
- if (row.isAdd) {
|
|
|
- let fe = 0
|
|
|
- for (let num in ypDosageData.value) {
|
|
|
- if (ypDosageData.value[num].code === row.code) {
|
|
|
- fe++
|
|
|
- }
|
|
|
- }
|
|
|
- if (fe === 2) {
|
|
|
- ElMessage({
|
|
|
- type: "warning",
|
|
|
- message: "存在重复的药品剂型字典,请核对!",
|
|
|
- duration: 2500,
|
|
|
- showClose: true,
|
|
|
- });
|
|
|
- } else {
|
|
|
- callSaveYpDosage(row, null)
|
|
|
- }
|
|
|
-
|
|
|
- } else {
|
|
|
- let oldCode = row.oldRow.code
|
|
|
- if (oldCode !== row.code) {
|
|
|
- ElMessageBox.confirm(msgTip, {
|
|
|
- cancelButtonText: '取消',
|
|
|
- confirmButtonText: '确定',
|
|
|
- type: 'warning',
|
|
|
- distinguishCancelAndClose: true,
|
|
|
- dangerouslyUseHTMLString: true
|
|
|
- }).then(() => {
|
|
|
- callSaveYpDosage(row, oldCode)
|
|
|
- }).catch((action) => {
|
|
|
- if (action === 'cancel') {
|
|
|
- queryYpDosage()
|
|
|
- }
|
|
|
- })
|
|
|
- } else {
|
|
|
- callSaveYpDosage(row, oldCode)
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-const callSaveYpDosage = (row, oldCode) => {
|
|
|
- let title = '请确认是否保存<span style="color:#d12020;">' + row.name + '</span>?'
|
|
|
- ElMessageBox.confirm(title, {
|
|
|
- cancelButtonText: '取消',
|
|
|
- confirmButtonText: '确定',
|
|
|
- type: 'warning',
|
|
|
- distinguishCancelAndClose: true,
|
|
|
- dangerouslyUseHTMLString: true
|
|
|
- }).then(() => {
|
|
|
- saveYpDosage(row).then((res) => {
|
|
|
- ElMessage({
|
|
|
- type: "success",
|
|
|
- message: res.cg,
|
|
|
- duration: 2500,
|
|
|
- showClose: true,
|
|
|
- });
|
|
|
- if (oldCode !== null && oldCode !== row.code) {
|
|
|
- // 删除原始数据
|
|
|
- delYpDosageByCode(oldCode).then((res) => {
|
|
|
- queryYpDosage()
|
|
|
- })
|
|
|
- } else {
|
|
|
- queryYpDosage()
|
|
|
- }
|
|
|
- })
|
|
|
- }).catch((action) => {
|
|
|
- if (action === 'cancel') {
|
|
|
- queryYpDosage()
|
|
|
- }
|
|
|
- })
|
|
|
-}
|
|
|
|
|
|
-const deleteYpDosage = (index, row) => {
|
|
|
- let title = '请确认是否删除<span style="color:#d12020;">' + row.name + '</span>?'
|
|
|
- ElMessageBox.confirm(title, {
|
|
|
- cancelButtonText: '取消',
|
|
|
- confirmButtonText: '确定',
|
|
|
- type: 'warning',
|
|
|
- distinguishCancelAndClose: true,
|
|
|
- dangerouslyUseHTMLString: true
|
|
|
- }).then(() => {
|
|
|
- delYpDosageByCode(row.code).then((res) => {
|
|
|
- ElMessage({
|
|
|
- type: "success",
|
|
|
- message: res.cg,
|
|
|
- duration: 2500,
|
|
|
- showClose: true,
|
|
|
- });
|
|
|
- queryYpDosage()
|
|
|
- })
|
|
|
- }).catch((action) => {
|
|
|
- if (action === 'cancel') {
|
|
|
- queryYpDosage()
|
|
|
- }
|
|
|
- })
|
|
|
-}
|
|
|
-// 药品字典-药品剂型字典增删改存结束
|
|
|
|
|
|
-// 药品字典-药品单位字典增删改存开始
|
|
|
-// 编辑
|
|
|
-const editYpUnit = (row) => {
|
|
|
- // 备份原始数据
|
|
|
- row['oldRow'] = JSON.parse(JSON.stringify(row))
|
|
|
- row.isEdit = true
|
|
|
-}
|
|
|
-// 取消
|
|
|
-const cancelYpUnit = (row) => {
|
|
|
- // 如果是新增的数据
|
|
|
- if (row.isAdd) {
|
|
|
- ypUnitData.value.splice(ypUnitData.value.length - 1, 1)
|
|
|
- } else {
|
|
|
- // 不是新增的数据 还原数据
|
|
|
- for (const i in row.oldRow) {
|
|
|
- row[i] = row.oldRow[i]
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
-// 保存
|
|
|
-const updateYpUnit = (row) => {
|
|
|
- if (!row.code || !row.name) {
|
|
|
- ElMessage({
|
|
|
- type: "warning",
|
|
|
- message: "药品单位字典编码或名称不存在,请检查!",
|
|
|
- duration: 2500,
|
|
|
- showClose: true,
|
|
|
- });
|
|
|
- return
|
|
|
- }
|
|
|
|
|
|
- if (row.isAdd) {
|
|
|
- let fe = 0
|
|
|
- for (let num in ypUnitData.value) {
|
|
|
- if (ypUnitData.value[num].code === row.code) {
|
|
|
- fe++
|
|
|
- }
|
|
|
- }
|
|
|
- if (fe === 2) {
|
|
|
- ElMessage({
|
|
|
- type: "warning",
|
|
|
- message: "存在重复的药品单位字典,请核对!",
|
|
|
- duration: 2500,
|
|
|
- showClose: true,
|
|
|
- });
|
|
|
- } else {
|
|
|
- callSaveYpUnit(row, null)
|
|
|
- }
|
|
|
- } else {
|
|
|
- let oldCode = row.oldRow.code
|
|
|
- if (oldCode !== row.code) {
|
|
|
- ElMessageBox.confirm(msgTip, {
|
|
|
- cancelButtonText: '取消',
|
|
|
- confirmButtonText: '确定',
|
|
|
- type: 'warning',
|
|
|
- distinguishCancelAndClose: true,
|
|
|
- dangerouslyUseHTMLString: true
|
|
|
- }).then(() => {
|
|
|
- callSaveYpUnit(row, oldCode)
|
|
|
- }).catch((action) => {
|
|
|
- if (action === 'cancel') {
|
|
|
- queryYpUnit()
|
|
|
- }
|
|
|
- })
|
|
|
- } else {
|
|
|
- callSaveYpUnit(row, oldCode)
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-const callSaveYpUnit = (row, oldCode) => {
|
|
|
- let title = '请确认是否保存<span style="color:#d12020;">' + row.name + '</span>?'
|
|
|
- ElMessageBox.confirm(title, {
|
|
|
- cancelButtonText: '取消',
|
|
|
- confirmButtonText: '确定',
|
|
|
- type: 'warning',
|
|
|
- distinguishCancelAndClose: true,
|
|
|
- dangerouslyUseHTMLString: true
|
|
|
- }).then(() => {
|
|
|
- saveYpUnit(row).then((res) => {
|
|
|
- ElMessage({
|
|
|
- type: "success",
|
|
|
- message: res.cg,
|
|
|
- duration: 2500,
|
|
|
- showClose: true,
|
|
|
- });
|
|
|
- // 若修改了主键code,则需要删除原来的记录
|
|
|
- if (oldCode !== null && oldCode !== row.code) {
|
|
|
- // 删除原始数据
|
|
|
- delYpUnitByCode(oldCode).then((res) => {
|
|
|
- queryYpUnit()
|
|
|
- })
|
|
|
- } else {
|
|
|
- queryYpUnit()
|
|
|
- }
|
|
|
- })
|
|
|
- }).catch((action) => {
|
|
|
- if (action === 'cancel') {
|
|
|
- queryYpUnit()
|
|
|
- }
|
|
|
- })
|
|
|
-}
|
|
|
-
|
|
|
-const deleteYpUnit = (index, row) => {
|
|
|
- let title = '请确认是否删除<span style="color:#d12020;">' + row.name + '</span>?'
|
|
|
- ElMessageBox.confirm(title, {
|
|
|
- cancelButtonText: '取消',
|
|
|
- confirmButtonText: '确定',
|
|
|
- type: 'warning',
|
|
|
- distinguishCancelAndClose: true,
|
|
|
- dangerouslyUseHTMLString: true
|
|
|
- }).then(() => {
|
|
|
- delYpUnitByCode(row.code).then((res) => {
|
|
|
- ElMessage({
|
|
|
- type: "success",
|
|
|
- message: res.cg,
|
|
|
- duration: 2500,
|
|
|
- showClose: true,
|
|
|
- });
|
|
|
- queryYpUnit()
|
|
|
- })
|
|
|
- }).catch((action) => {
|
|
|
- if (action === 'cancel') {
|
|
|
- queryYpUnit()
|
|
|
- }
|
|
|
- })
|
|
|
-}
|
|
|
-// 药品字典-药品单位字典增删改存结束
|
|
|
-
|
|
|
-// 药品字典-药品费别字典增删改存开始
|
|
|
-// 编辑
|
|
|
-const editYpChargeGroup = (row) => {
|
|
|
- // 备份原始数据
|
|
|
- row['oldRow'] = JSON.parse(JSON.stringify(row))
|
|
|
- row.isEdit = true
|
|
|
-}
|
|
|
-// 取消
|
|
|
-const cancelYpChargeGroup = (row, index) => {
|
|
|
- // 如果是新增的数据
|
|
|
- if (row.isAdd) {
|
|
|
- ypChargeGroupData.value.splice(index, 1)
|
|
|
- } else {
|
|
|
- // 不是新增的数据 还原数据
|
|
|
- for (const i in row.oldRow) {
|
|
|
- row[i] = row.oldRow[i]
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
-// 保存
|
|
|
-const updateYpChargeGroup = (row) => {
|
|
|
- if (!row.code || !row.name) {
|
|
|
- ElMessage({
|
|
|
- type: "warning",
|
|
|
- message: "药品费别字典编码或名称不存在,请检查!",
|
|
|
- duration: 2500,
|
|
|
- showClose: true,
|
|
|
- });
|
|
|
- return
|
|
|
- }
|
|
|
-
|
|
|
- if (row.isAdd) {
|
|
|
- let fe = 0
|
|
|
- for (let num in ypChargeGroupData.value) {
|
|
|
- if (ypChargeGroupData.value[num].code === row.code) {
|
|
|
- fe++
|
|
|
- }
|
|
|
- }
|
|
|
- if (fe === 2) {
|
|
|
- ElMessage({
|
|
|
- type: "warning",
|
|
|
- message: "存在重复的药品费别字典,请核对!",
|
|
|
- duration: 2500,
|
|
|
- showClose: true,
|
|
|
- });
|
|
|
- } else {
|
|
|
- callSaveYpChargeGroup(row, null)
|
|
|
- }
|
|
|
-
|
|
|
- } else {
|
|
|
- let oldCode = row.oldRow.code
|
|
|
- if (oldCode !== row.code) {
|
|
|
- ElMessageBox.confirm(msgTip, {
|
|
|
- cancelButtonText: '取消',
|
|
|
- confirmButtonText: '确定',
|
|
|
- type: 'warning',
|
|
|
- distinguishCancelAndClose: true,
|
|
|
- dangerouslyUseHTMLString: true
|
|
|
- }).then(() => {
|
|
|
- callSaveYpChargeGroup(row, oldCode)
|
|
|
- }).catch((action) => {
|
|
|
- if (action === 'cancel') {
|
|
|
- queryYpChargeGroup()
|
|
|
- }
|
|
|
- })
|
|
|
- } else {
|
|
|
- callSaveYpChargeGroup(row, oldCode)
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-const callSaveYpChargeGroup = (row, oldCode) => {
|
|
|
- let title = '请确认是否保存<span style="color:#d12020;">' + row.name + '</span>?'
|
|
|
- ElMessageBox.confirm(title, {
|
|
|
- cancelButtonText: '取消',
|
|
|
- confirmButtonText: '确定',
|
|
|
- type: 'warning',
|
|
|
- distinguishCancelAndClose: true,
|
|
|
- dangerouslyUseHTMLString: true
|
|
|
- }).then(() => {
|
|
|
- saveYpChargeGroup(row).then((res) => {
|
|
|
- ElMessage({
|
|
|
- type: "success",
|
|
|
- message: res.cg,
|
|
|
- duration: 2500,
|
|
|
- showClose: true,
|
|
|
- });
|
|
|
- if (oldCode !== null && oldCode !== row.code) {
|
|
|
- // 删除原始数据
|
|
|
- delYpChargeGroupByCode(oldCode).then((res) => {
|
|
|
- queryYpChargeGroup()
|
|
|
- })
|
|
|
- } else {
|
|
|
- queryYpChargeGroup()
|
|
|
- }
|
|
|
- })
|
|
|
- }).catch((action) => {
|
|
|
- if (action === 'cancel') {
|
|
|
- queryYpChargeGroup()
|
|
|
- }
|
|
|
- })
|
|
|
-}
|
|
|
-
|
|
|
-const deleteYpChargeGroup = (index, row) => {
|
|
|
- let title = '请确认是否删除<span style="color:#d12020;">' + row.name + '</span>?'
|
|
|
- ElMessageBox.confirm(title, {
|
|
|
- cancelButtonText: '取消',
|
|
|
- confirmButtonText: '确定',
|
|
|
- type: 'warning',
|
|
|
- distinguishCancelAndClose: true,
|
|
|
- dangerouslyUseHTMLString: true
|
|
|
- }).then(() => {
|
|
|
- delYpChargeGroupByCode(row.code).then((res) => {
|
|
|
- ElMessage({
|
|
|
- type: "success",
|
|
|
- message: res.cg,
|
|
|
- duration: 2500,
|
|
|
- showClose: true,
|
|
|
- });
|
|
|
- queryYpChargeGroup()
|
|
|
- })
|
|
|
- }).catch((action) => {
|
|
|
- if (action === 'cancel') {
|
|
|
- queryYpChargeGroup()
|
|
|
- }
|
|
|
- })
|
|
|
-}
|
|
|
-// 药品字典-药品费别字典增删改存结束
|
|
|
-
|
|
|
-// 药房药品住院停用增删改存开始
|
|
|
-// 编辑
|
|
|
-const editVisibleFlag = (row) => {
|
|
|
- // 备份原始数据
|
|
|
- row['oldRow'] = JSON.parse(JSON.stringify(row))
|
|
|
- row.isEdit = true
|
|
|
-}
|
|
|
-// 取消
|
|
|
-const cancelVisibleFlag = (row, index) => {
|
|
|
- // 如果是新增的数据
|
|
|
- if (row.isAdd) {
|
|
|
- visibleFlagData.value.splice(index, 1)
|
|
|
- } else {
|
|
|
- // 不是新增的数据 还原数据
|
|
|
- for (const i in row.oldRow) {
|
|
|
- row[i] = row.oldRow[i]
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
-// 保存
|
|
|
-const updateVisibleFlag = (row) => {
|
|
|
- if (!row.chargeCode || !row.groupNo) {
|
|
|
- ElMessage({
|
|
|
- type: "warning",
|
|
|
- message: "药房药品停用的药品编码或药房编码不存在,请检查!",
|
|
|
- duration: 2500,
|
|
|
- showClose: true,
|
|
|
- });
|
|
|
- return
|
|
|
- }
|
|
|
-
|
|
|
- if (row.isAdd) {
|
|
|
- ElMessage({
|
|
|
- type: "warning",
|
|
|
- message: "不能新增药房药品停用,需先维护药品信息!",
|
|
|
- duration: 2500,
|
|
|
- showClose: true,
|
|
|
- });
|
|
|
- } else {
|
|
|
- callSaveVisibleFlag(row)
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-const callSaveVisibleFlag = (row) => {
|
|
|
- let title = '请确认是否保存<span style="color:#d12020;">' + row.drug + '</span>?'
|
|
|
- ElMessageBox.confirm(title, {
|
|
|
- cancelButtonText: '取消',
|
|
|
- confirmButtonText: '确定',
|
|
|
- type: 'warning',
|
|
|
- distinguishCancelAndClose: true,
|
|
|
- dangerouslyUseHTMLString: true
|
|
|
- }).then(() => {
|
|
|
- updateYpVisibleFlag(row).then((res) => {
|
|
|
- ElMessage({
|
|
|
- type: "success",
|
|
|
- message: res.cg,
|
|
|
- duration: 2500,
|
|
|
- showClose: true,
|
|
|
- });
|
|
|
- queryVisibleFlag()
|
|
|
- })
|
|
|
- }).catch((action) => {
|
|
|
- if (action === 'cancel') {
|
|
|
- queryVisibleFlag()
|
|
|
- }
|
|
|
- })
|
|
|
-}
|
|
|
-// 药房药品住院停用增删改存结束
|
|
|
-
|
|
|
-// 药品字典-药品供应商字典增删改存开始
|
|
|
-// 编辑
|
|
|
-const editYpSupply = (row) => {
|
|
|
- // 备份原始数据
|
|
|
- row['oldRow'] = JSON.parse(JSON.stringify(row))
|
|
|
- row.isEdit = true
|
|
|
-}
|
|
|
-
|
|
|
-// 取消
|
|
|
-const cancelYpSupply = (row, index) => {
|
|
|
- // 如果是新增的数据
|
|
|
- if (row.isAdd) {
|
|
|
- ypSupplyData.value.splice(ypSupplyData.value.length - 1, 1)
|
|
|
- } else {
|
|
|
- // 不是新增的数据 还原数据
|
|
|
- for (const i in row.oldRow) {
|
|
|
- row[i] = row.oldRow[i]
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
-// 保存
|
|
|
-const updateYpSupply = (row) => {
|
|
|
- if (!row.code || !row.name) {
|
|
|
- ElMessage({
|
|
|
- type: "warning",
|
|
|
- message: "药品供应商字典编码或名称不存在,请检查!",
|
|
|
- duration: 2500,
|
|
|
- showClose: true,
|
|
|
- });
|
|
|
- return
|
|
|
- }
|
|
|
-
|
|
|
- if (row.isAdd) {
|
|
|
- let fe = 0
|
|
|
- for (let num in ypSupplyData.value) {
|
|
|
- if (ypSupplyData.value[num].code === row.code) {
|
|
|
- fe++
|
|
|
- }
|
|
|
- }
|
|
|
- if (fe === 2) {
|
|
|
- ElMessage({
|
|
|
- type: "warning",
|
|
|
- message: "存在重复的药品供应商字典,请核对!",
|
|
|
- duration: 2500,
|
|
|
- showClose: true,
|
|
|
- });
|
|
|
- } else {
|
|
|
- callSaveYpSupply(row, null)
|
|
|
- }
|
|
|
-
|
|
|
- } else {
|
|
|
- let oldCode = row.oldRow.code
|
|
|
- if (oldCode !== row.code) {
|
|
|
- ElMessageBox.confirm(msgTip, {
|
|
|
- cancelButtonText: '取消',
|
|
|
- confirmButtonText: '确定',
|
|
|
- type: 'warning',
|
|
|
- distinguishCancelAndClose: true,
|
|
|
- dangerouslyUseHTMLString: true
|
|
|
- }).then(() => {
|
|
|
- callSaveYpSupply(row, oldCode)
|
|
|
- }).catch((action) => {
|
|
|
- if (action === 'cancel') {
|
|
|
- queryYpSupply()
|
|
|
- }
|
|
|
- })
|
|
|
- } else {
|
|
|
- callSaveYpSupply(row, oldCode)
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-const callSaveYpSupply = (row, oldCode) => {
|
|
|
- let title = '请确认是否保存<span style="color:#d12020;">' + row.name + '</span>?'
|
|
|
- ElMessageBox.confirm(title, {
|
|
|
- cancelButtonText: '取消',
|
|
|
- confirmButtonText: '确定',
|
|
|
- type: 'warning',
|
|
|
- distinguishCancelAndClose: true,
|
|
|
- dangerouslyUseHTMLString: true
|
|
|
- }).then(() => {
|
|
|
- saveYpSupply(row).then((res) => {
|
|
|
- ElMessage({
|
|
|
- type: "success",
|
|
|
- message: res.cg,
|
|
|
- duration: 2500,
|
|
|
- showClose: true,
|
|
|
- });
|
|
|
- if (oldCode !== null && oldCode !== row.code) {
|
|
|
- // 删除原始数据
|
|
|
- delYpSupplyByCode(oldCode).then((res) => {
|
|
|
- queryYpSupply()
|
|
|
- })
|
|
|
- } else {
|
|
|
- queryYpSupply()
|
|
|
- }
|
|
|
- })
|
|
|
- }).catch((action) => {
|
|
|
- if (action === 'cancel') {
|
|
|
- queryYpSupply()
|
|
|
- }
|
|
|
- })
|
|
|
-}
|
|
|
-
|
|
|
-const deleteYpSupply = (index, row) => {
|
|
|
- let title = '请确认是否删除<span style="color:#d12020;">' + row.name + '</span>?'
|
|
|
- ElMessageBox.confirm(title, {
|
|
|
- cancelButtonText: '取消',
|
|
|
- confirmButtonText: '确定',
|
|
|
- type: 'warning',
|
|
|
- distinguishCancelAndClose: true,
|
|
|
- dangerouslyUseHTMLString: true
|
|
|
- }).then(() => {
|
|
|
- delYpSupplyByCode(row.code).then((res) => {
|
|
|
- ElMessage({
|
|
|
- type: "success",
|
|
|
- message: res.cg,
|
|
|
- duration: 2500,
|
|
|
- showClose: true,
|
|
|
- });
|
|
|
- queryYpSupply()
|
|
|
- })
|
|
|
- }).catch((action) => {
|
|
|
- if (action === 'cancel') {
|
|
|
- queryYpSupply()
|
|
|
- }
|
|
|
- })
|
|
|
-}
|
|
|
-// 药品字典-药品供应商字典增删改存结束
|
|
|
-
|
|
|
-// 药品字典-生产厂家字典增删改存开始
|
|
|
-// 编辑
|
|
|
-const editYpManuFactory = (row) => {
|
|
|
- // 备份原始数据
|
|
|
- row['oldRow'] = JSON.parse(JSON.stringify(row))
|
|
|
- row.isEdit = true
|
|
|
-}
|
|
|
-
|
|
|
-// 取消
|
|
|
-const cancelYpManuFactory = (row) => {
|
|
|
- // 如果是新增的数据
|
|
|
- if (row.isAdd) {
|
|
|
- ypManuFactoryData.value.splice(ypManuFactoryData.value.length - 1, 1)
|
|
|
- } else {
|
|
|
- // 不是新增的数据 还原数据
|
|
|
- for (const i in row.oldRow) {
|
|
|
- row[i] = row.oldRow[i]
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
-// 保存
|
|
|
-const updateYpManuFactory = (row) => {
|
|
|
- if (!row.code || !row.name) {
|
|
|
- ElMessage({
|
|
|
- type: "warning",
|
|
|
- message: "生产厂家字典编码或名称不存在,请检查!",
|
|
|
- duration: 2500,
|
|
|
- showClose: true,
|
|
|
- });
|
|
|
- return
|
|
|
- }
|
|
|
-
|
|
|
- if (row.isAdd) {
|
|
|
- let fe = 0
|
|
|
- for (let num in ypManuFactoryData.value) {
|
|
|
- if (ypManuFactoryData.value[num].code === row.code) {
|
|
|
- fe++
|
|
|
- }
|
|
|
- }
|
|
|
- if (fe === 2) {
|
|
|
- ElMessage({
|
|
|
- type: "warning",
|
|
|
- message: "存在重复的生产厂家字典,请核对!",
|
|
|
- duration: 2500,
|
|
|
- showClose: true,
|
|
|
- });
|
|
|
- } else {
|
|
|
- callSaveYpManuFactory(row, null)
|
|
|
- }
|
|
|
-
|
|
|
- } else {
|
|
|
- let oldCode = row.oldRow.code
|
|
|
- if (oldCode !== row.code) {
|
|
|
- ElMessageBox.confirm(msgTip, {
|
|
|
- cancelButtonText: '取消',
|
|
|
- confirmButtonText: '确定',
|
|
|
- type: 'warning',
|
|
|
- distinguishCancelAndClose: true,
|
|
|
- dangerouslyUseHTMLString: true
|
|
|
- }).then(() => {
|
|
|
- callSaveYpManuFactory(row, oldCode)
|
|
|
- }).catch((action) => {
|
|
|
- if (action === 'cancel') {
|
|
|
- queryYpManuFactory()
|
|
|
- }
|
|
|
- })
|
|
|
- } else {
|
|
|
- callSaveYpManuFactory(row, oldCode)
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-const callSaveYpManuFactory = (row, oldCode) => {
|
|
|
- let title = '请确认是否保存<span style="color:#d12020;">' + row.name + '</span>?'
|
|
|
- ElMessageBox.confirm(title, {
|
|
|
- cancelButtonText: '取消',
|
|
|
- confirmButtonText: '确定',
|
|
|
- type: 'warning',
|
|
|
- distinguishCancelAndClose: true,
|
|
|
- dangerouslyUseHTMLString: true
|
|
|
- }).then(() => {
|
|
|
- saveYpManuFactory(row).then((res) => {
|
|
|
- ElMessage({
|
|
|
- type: "success",
|
|
|
- message: res.cg,
|
|
|
- duration: 2500,
|
|
|
- showClose: true,
|
|
|
- });
|
|
|
- if (oldCode !== null && oldCode !== row.code) {
|
|
|
- // 删除原始数据
|
|
|
- delYpManuFactoryByCode(oldCode).then((res) => {
|
|
|
- queryYpManuFactory()
|
|
|
- })
|
|
|
- } else {
|
|
|
- queryYpManuFactory()
|
|
|
- }
|
|
|
- })
|
|
|
- }).catch((action) => {
|
|
|
- if (action === 'cancel') {
|
|
|
- queryYpManuFactory()
|
|
|
- }
|
|
|
- })
|
|
|
-}
|
|
|
-
|
|
|
-const deleteYpManuFactory = (index, row) => {
|
|
|
- let title = '请确认是否删除<span style="color:#d12020;">' + row.name + '</span>?'
|
|
|
- ElMessageBox.confirm(title, {
|
|
|
- cancelButtonText: '取消',
|
|
|
- confirmButtonText: '确定',
|
|
|
- type: 'warning',
|
|
|
- distinguishCancelAndClose: true,
|
|
|
- dangerouslyUseHTMLString: true
|
|
|
- }).then(() => {
|
|
|
- delYpManuFactoryByCode(row.code).then((res) => {
|
|
|
- ElMessage({
|
|
|
- type: "success",
|
|
|
- message: res.cg,
|
|
|
- duration: 2500,
|
|
|
- showClose: true,
|
|
|
- });
|
|
|
- queryYpManuFactory()
|
|
|
- })
|
|
|
- }).catch((action) => {
|
|
|
- if (action === 'cancel') {
|
|
|
- queryYpManuFactory()
|
|
|
- }
|
|
|
- })
|
|
|
-}
|
|
|
-// 药品字典-生产厂家字典增删改存结束
|
|
|
-
|
|
|
-const exportData = () => {
|
|
|
- alert("功能建设中。。。")
|
|
|
-}
|
|
|
-
|
|
|
-const handleClick = (tab, event) => {
|
|
|
- // 查询哪个tab页面
|
|
|
- editableTabsValue.value = tab.props.name
|
|
|
- if (editableTabsValue.value === 'ypClass') {
|
|
|
- queryYpClass()
|
|
|
- currentPageClass.value = 1
|
|
|
- } else if (editableTabsValue.value === 'drugKind') {
|
|
|
- queryDrugKind()
|
|
|
- currentPageKind.value = 1
|
|
|
- } else if (editableTabsValue.value === 'ypDosage') {
|
|
|
- queryYpDosage()
|
|
|
- currentPageDosage.value = 1
|
|
|
- } else if (editableTabsValue.value === 'ypUnit') {
|
|
|
- queryYpUnit()
|
|
|
- currentPageUnit.value = 1
|
|
|
- } else if (editableTabsValue.value === 'ypChargeGroup') {
|
|
|
- queryYpChargeGroup()
|
|
|
- } else if (editableTabsValue.value === 'visibleFlag') {
|
|
|
- queryVisibleFlag()
|
|
|
- currentPage.value = 1
|
|
|
- } else if (editableTabsValue.value === 'ypSupply') {
|
|
|
- queryYpSupply()
|
|
|
- currentPageSupply.value = 1
|
|
|
- } else if (editableTabsValue.value === 'ypManuFactory') {
|
|
|
- queryYpManuFactory()
|
|
|
- currentPageManuFactory.value = 1
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-const tableRowClassName = ({
|
|
|
- row,
|
|
|
- rowIndex,
|
|
|
-}) => {
|
|
|
- if (row.delFlag === '1') {
|
|
|
- return 'warning-row'
|
|
|
- }
|
|
|
-}
|
|
|
|
|
|
</script>
|
|
|
<style lang="scss" deep>
|