Merge branch 'main' of ssh://git.jizhiweb.cn:2222/clinic-v2/web

# Conflicts:
#	src/views/inventory/goods.vue
This commit is contained in:
ChenQiuYu 2025-05-14 13:21:00 +08:00
commit bf0dfcea3b
19 changed files with 266 additions and 153 deletions

View File

@ -1,5 +1,5 @@
<template> <template>
<Mask :top="50" :height="650" :width="900" :is-show="show" title="追溯码采集" @close="show = false" :show-footer="true"> <Mask :height="650" :width="900" :is-show="show" title="追溯码采集" @close="show = false" :show-footer="true">
<el-card> <el-card>
<div class="detail"> <div class="detail">
<el-input placeholder="请输入追溯码" v-model="inputIdCode" clearable @keydown.enter="openAssociationIdCode()"> <el-input placeholder="请输入追溯码" v-model="inputIdCode" clearable @keydown.enter="openAssociationIdCode()">

View File

@ -1,6 +1,6 @@
<template> <template>
<div style="position: fixed; z-index: 99999;"> <div style="position: fixed; z-index: 99999;">
<Mask :top="50" :height="700" :width="900" :is-show="show"> <Mask :height="700" :width="900" :is-show="show">
<CloseBtn @click="show = false"></CloseBtn> <CloseBtn @click="show = false"></CloseBtn>
<el-card> <el-card>
<template #header> <template #header>

View File

@ -1,5 +1,5 @@
<template> <template>
<Mask :width="1200" :height="600" :top="100" :is-show="isShow" @close="exit" title="新增领用" :show-footer="true"> <Mask :width="1200" :height="600" :is-show="isShow" @close="exit" title="新增领用" :show-footer="true">
<div class="add-panel"> <div class="add-panel">
<div class="top"> <div class="top">
<el-form :inline=true label-position="top" :model="formData" label-width="auto"> <el-form :inline=true label-position="top" :model="formData" label-width="auto">

View File

@ -1,5 +1,5 @@
<template> <template>
<Mask :width="1200" :height="600" :top="100" :is-show="isShow" @close="exit" title="查看领用" :show-footer="true"> <Mask :width="1200" :height="600" :is-show="isShow" @close="exit" title="查看领用" :show-footer="true">
<div style="margin-top: 24px;padding: 0 24px"> <div style="margin-top: 24px;padding: 0 24px">
<el-descriptions border label-width="100"> <el-descriptions border label-width="100">
<el-descriptions-item label="领用人" width="200"> <el-descriptions-item label="领用人" width="200">

View File

@ -1,5 +1,5 @@
<template> <template>
<Mask :width="1200" :height="540" :is-show="isShow" :top="100" @close="exit" title="新增盘点" :show-footer="true"> <Mask :width="1200" :height="540" :is-show="isShow" @close="exit" title="新增盘点" :show-footer="true">
<div class="body_wrapper"> <div class="body_wrapper">
<div class="top" style="width: 100%"> <div class="top" style="width: 100%">
<el-form :model="form" style="width: 100%" label-width="auto" class="demo-ruleForm" label-position="top"> <el-form :model="form" style="width: 100%" label-width="auto" class="demo-ruleForm" label-position="top">

View File

@ -1,5 +1,5 @@
<template> <template>
<Mask :width="1200" :height="540" :is-show="isShow" :top="100" @close="exit" title="查看盘点" :show-footer="true"> <Mask :width="1200" :height="540" :is-show="isShow" @close="exit" title="查看盘点" :show-footer="true">
<div class="body_wrapper"> <div class="body_wrapper">
<div class="top"> <div class="top">
<el-form :model="form" style="width: 100%" label-width="auto" class="demo-ruleForm" label-position="top"> <el-form :model="form" style="width: 100%" label-width="auto" class="demo-ruleForm" label-position="top">

View File

@ -1,5 +1,5 @@
<template> <template>
<Mask :width="400" :height="600" :top="100" :is-show="isShow" @close="isShow=false" :show-fotter="true" title="药品列表"> <Mask :width="400" :height="600" :is-show="isShow" @close="isShow=false" :show-fotter="true" title="药品列表">
<el-table <el-table
:data="cateList" :data="cateList"
style="width: 100%" style="width: 100%"

View File

@ -78,20 +78,6 @@
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="批准文号" v-if="_type==1301">
<el-form-item lable="" prop="approvalCode" class="form-item">
<el-input v-model="edit_data.approvalCode" class="input">
</el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="进价参考">
<el-form-item label="" prop="purchaseUnitPrice" class="form-item">
<el-input v-model.number="edit_data.purchaseUnitPrice">
<template #append></template>
</el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="生产企业" v-if="_type!=1302"> <el-descriptions-item label="生产企业" v-if="_type!=1302">
<el-form-item label="" prop="producer" class="form-item"> <el-form-item label="" prop="producer" class="form-item">
@ -280,10 +266,10 @@
<el-input v-model="edit_data.extra.cabinetNumber"> <el-input v-model="edit_data.extra.cabinetNumber">
</el-input> </el-input>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="用法用量" v-if="_type==1301"> <!-- <el-descriptions-item label="用法用量" v-if="_type==1301">-->
<el-input v-model="edit_data.extra.usage"> <!-- <el-input v-model="edit_data.extra.usage">-->
</el-input> <!-- </el-input>-->
</el-descriptions-item> <!-- </el-descriptions-item>-->
<el-descriptions-item label="处方药/OTC" v-if="_type==1301"> <el-descriptions-item label="处方药/OTC" v-if="_type==1301">
<el-select <el-select
v-model="edit_data.extra.drugCategory" v-model="edit_data.extra.drugCategory"
@ -314,12 +300,51 @@
/> />
</el-select> </el-select>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="抗菌药物" v-if="_type==1301"> <el-descriptions-item label="抗菌药物|DDD值" v-if="_type==1301">
<el-input v-model="edit_data.extra.isAntibacterialAgents"></el-input> <div class="antibacterial-agents">
<el-select
v-model="edit_data.extra.isAntibacterialAgents"
clearable
style="width: 100px"
>
<el-option
v-for="item in isAntibacterialAgentsOptions"
:key="item.label"
:label="item.label"
:value="item.label"
/>
</el-select>
<el-input v-model="edit_data.extra.DDD" style="width: 80px"/>
<div class="unit-item">
<el-popover
placement="bottom"
title="Title"
:width="200"
trigger="click"
>
<template #reference>
<div class="unit" style="width: 232px">{{ edit_data.extra.DDDUnit }}</div>
</template>
<UnitSelector :units="DDDUnitList" v-model="edit_data.extra.DDDUnit"></UnitSelector>
</el-popover>
</div>
</div>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="基药" v-if="_type==1301"> <el-descriptions-item label="基药" v-if="_type==1301">
<el-input v-model="edit_data.extra.baseMedicine"></el-input> <el-select
v-model="edit_data.extra.baseMedicine"
placeholder="选择基药"
clearable
style="width: 240px"
>
<el-option
v-for="item in baseMedicineOptions"
:key="item.label"
:label="item.label"
:value="item.label"
/>
</el-select>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="医疗器械分类" v-if="_type==1306"> <el-descriptions-item label="医疗器械分类" v-if="_type==1306">
<el-input v-model="edit_data.extra.instrumentCategroy"></el-input> <el-input v-model="edit_data.extra.instrumentCategroy"></el-input>
@ -338,7 +363,13 @@
<el-aside width="350px" style="border-left: 1px #ddd solid"> <el-aside width="350px" style="border-left: 1px #ddd solid">
<el-form style="width: 100%;" :rules="rules" ref="formRef" label-width="100px"> <el-form style="width: 100%;" :rules="rules" ref="formRef" label-width="100px">
<el-descriptions title="定价" border direction="vertical" :column="2" style="margin-left: 5px"> <el-descriptions title="定价" border direction="vertical" :column="2" style="margin-left: 5px">
<el-descriptions-item label="定价模式" width="180"> <el-descriptions-item label="进价参考" width="180">
<el-input v-model.number="edit_data.purchaseUnitPrice" type="number" :min="1">
<template #prefix></template>
</el-input>
</el-descriptions-item>
<el-descriptions-item label="定价模式" >
<el-select v-model="edit_data.pricingModel" placeholder="请选择"> <el-select v-model="edit_data.pricingModel" placeholder="请选择">
<el-option <el-option
v-for="item in pricingModelOptions" v-for="item in pricingModelOptions"
@ -348,7 +379,7 @@
</el-option> </el-option>
</el-select> </el-select>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="加成率" v-if="edit_data.pricingModel==1"> <el-descriptions-item label="加成率" v-if="edit_data.pricingModel==1" width="180">
<el-input v-model="edit_data.makeUp" type="number"> <el-input v-model="edit_data.makeUp" type="number">
<template #append>%</template> <template #append>%</template>
</el-input> </el-input>
@ -388,7 +419,8 @@
<el-button @click="returnInit" type="primary" v-if="edit_data.id != null">医保库存重新初始化</el-button> <el-button @click="returnInit" type="primary" v-if="edit_data.id != null">医保库存重新初始化</el-button>
<el-button v-if="edit_data.saleStatus" type="danger" @click="disableSale">停售</el-button> <el-button v-if="edit_data.saleStatus" type="danger" @click="disableSale">停售</el-button>
<el-button v-else type="danger" @click="enableSale">起售</el-button> <el-button v-else type="danger" @click="enableSale">起售</el-button>
<el-button @click="save" type="primary">保存</el-button> <el-button @click="save(true)" type="primary">保存</el-button>
<el-button @click="save(false)" type="primary" v-if="edit_data.id == null">保存并继续</el-button>
<el-button @click="exit" plain>关闭</el-button> <el-button @click="exit" plain>关闭</el-button>
</div> </div>
</template> </template>
@ -401,7 +433,7 @@
<script setup lang="ts"> <script setup lang="ts">
import {nextTick, ref, watch} from "vue"; import {nextTick, ref, watch} from "vue";
import {dosageUnitList, packagingUnit} from "@/utils/unitList.ts" import {dosageUnitList, packagingUnit,DDDUnitList} from "@/utils/unitList.ts"
import {Setting, Close} from "@element-plus/icons-vue"; import {Setting, Close} from "@element-plus/icons-vue";
import Mask from "@/components/common/Mask.vue"; import Mask from "@/components/common/Mask.vue";
import Search from "@/components/inventory/goods/Search.vue"; import Search from "@/components/inventory/goods/Search.vue";
@ -429,6 +461,26 @@ const pricingModelOptions = [
value: 0, value: 0,
} }
] ]
const isAntibacterialAgentsOptions = [
{
label: '非限制使用级',
},
{
label: '限制使用级',
},
{
label: '特殊使用级',
}
]
const baseMedicineOptions = [
{
label: '国家基药',
},
{
label: '地标基药',
}
]
const JMDFList = [ const JMDFList = [
{ {
label: '精I', label: '精I',
@ -494,7 +546,19 @@ let edit_data: any = ref({
packagingUnit: "盒", packagingUnit: "盒",
pricingModel: 0, pricingModel: 0,
expiryWarnDays: 0, expiryWarnDays: 0,
purchaseUnitPrice:1
}); });
const initEditData = () => {
edit_data.value = {
trdnFlag: false,
extra: {},
minPackagingUnit: "只",
packagingUnit: "盒",
pricingModel: 0,
expiryWarnDays: 0,
purchaseUnitPrice:1
}
}
const idCode = ref(""); const idCode = ref("");
const showPopover = ref(false); const showPopover = ref(false);
const idCodeList = ref<string[]>([]); const idCodeList = ref<string[]>([]);
@ -558,10 +622,15 @@ const openCreateSearch = () => {
}); });
} }
const createConfirm = (data: any) => { const createConfirm = (data: any) => {
let id = edit_data.value.id edit_data.value.name = data.name
edit_data.value = data edit_data.value.approvalCode = data.approvalCode
edit_data.value.id = id edit_data.value.producer = data.producer
edit_data.value.packagingUnit = data.packagingUnit
edit_data.value.minPackagingNumber = data.minPackagingNumber
edit_data.value.minPackagingUnit = data.minPackagingUnit
edit_data.value.medicineDosageUnit = data.medicineDosageUnit
edit_data.value.medicineDosageNumber = data.medicineDosageNumber
edit_data.value.extra = data.extra
} }
const contrastCodeSearch = ref() const contrastCodeSearch = ref()
const openContrastCodeSearch = () => { const openContrastCodeSearch = () => {
@ -572,15 +641,29 @@ const openContrastCodeSearch = () => {
const contrastCodeConfirm = (data: any) => { const contrastCodeConfirm = (data: any) => {
edit_data.value.hilistCode = data.hilistCode edit_data.value.hilistCode = data.hilistCode
} }
let save = async () => { let save = async (isClose:Boolean) => {
try { try {
await formRef.value.validate() await formRef.value.validate()
if (!edit_data.value.purchaseUnitPrice || edit_data.value.purchaseUnitPrice<1){
ElMessage.error('参考进价不能为空或小于1');
return
}
const data = JSON.parse(JSON.stringify(edit_data.value)); const data = JSON.parse(JSON.stringify(edit_data.value));
data.tags = data.tags ? data.tags.join(",") : null; data.tags = data.tags ? data.tags.join(",") : null;
data.idCode = idCodeList.value.join(","); data.idCode = idCodeList.value.join(",");
data.type = _type.value; data.type = _type.value;
post("goods/goods/save", data).then((res: any) => { post("goods/goods/save", data).then((res: any) => {
ElMessage.success('保存成功')
if (isClose){
//
exit() exit()
return
}
//
initEditData()
}) })
// ...... // ......
} catch (e) { } catch (e) {
@ -605,7 +688,7 @@ const cateCloseCallBack = () => {
let exit = () => { let exit = () => {
document.addEventListener("click", handleClickOutside); document.addEventListener("click", handleClickOutside);
isShow.value = false isShow.value = false
edit_data.value = {} initEditData()
emit('close'); emit('close');
} }
const handleClickOutside = (event: MouseEvent) => { const handleClickOutside = (event: MouseEvent) => {
@ -675,21 +758,14 @@ watch(() => edit_data.value.hilistCode, (newVal) => {
}) })
const drugCategoryOptions = [ const drugCategoryOptions = [
{ {
label: '西药', label: '处方药',
value: 1301 value: 1
}, },
{ {
label: '药', label: '非处方药',
value: 1302 value: 2
}, },
{
label: '非药品',
value: 1303
},
{
label: '其他',
value: 1304
}
] ]
const disableSale = () => { const disableSale = () => {
@ -741,6 +817,22 @@ const enableSale = () => {
.common-layout { .common-layout {
margin-top: 10px; margin-top: 10px;
padding: 0 24px 24px; padding: 0 24px 24px;
.antibacterial-agents{
display: flex;
.unit-item {
display: flex;
width: 50px;
.unit {
width: 32px;
height: 32px;
border: 1px #ddd solid;
color: #818080;
display: flex;
align-items: center;
justify-content: center;
}
}
}
} }
.item { .item {

View File

@ -1,5 +1,5 @@
<template> <template>
<Mask :width="800" :height="720" :is-show="show" :top="100" @close="show=false" title="药品" :show-footer="true"> <Mask :width="800" :height="720" :is-show="show" @close="show=false" title="药品" :show-footer="true">
<div class="search_content_wrapper"> <div class="search_content_wrapper">
<div class="search_wrapper"> <div class="search_wrapper">
<span>药品名称:</span> <span>药品名称:</span>
@ -15,13 +15,16 @@
<div class="result_table" style="width: 100%; height: 100%;overflow: hidden"> <div class="result_table" style="width: 100%; height: 100%;overflow: hidden">
<el-scrollbar> <el-scrollbar>
<el-table v-loading="isloading" :data="search_result.list" style="width: 100%" <el-table v-loading="isloading" :data="search_result.list" style="width: 100%"
highlight-current-row @current-change="change_current_search_data_index" highlight-current-row
@current-change="change_current_search_data_index"
@row-dblclick = confirm
:row-class-name="tableRowClassName"> :row-class-name="tableRowClassName">
<el-table-column prop="name" label="名称" fixed width="180" show-overflow-tooltip/> <el-table-column prop="name" label="名称" fixed width="180" show-overflow-tooltip/>
<el-table-column :prop="type==1306?'json.reg_number' : 'json.approval_number'" fixed label="国药准字" width="180" v-if="type==1301 || type==1306" show-overflow-tooltip/> <el-table-column :prop="type==1306?'json.reg_number' : 'json.approval_number'" fixed label="国药准字" width="180" v-if="type==1301 || type==1306" show-overflow-tooltip/>
<el-table-column prop="producer" label="生产企业" width="180" v-if="type==1301 || type==1306" show-overflow-tooltip/> <el-table-column v-if="type==1301" prop="json.reg_specifications" label="注册规格" width="120"
<el-table-column v-if="type==1301" prop="json.reg_specifications" label="注册规格" width="80"
show-overflow-tooltip/> show-overflow-tooltip/>
<el-table-column prop="producer" label="生产企业" width="200" v-if="type==1301 || type==1306" show-overflow-tooltip/>
<el-table-column v-if="type==1301" prop="json.min_packaging_unit" label="包装单位" width="80" <el-table-column v-if="type==1301" prop="json.min_packaging_unit" label="包装单位" width="80"
show-overflow-tooltip/> show-overflow-tooltip/>
<el-table-column v-if="type==1301" prop="json.min_packaging_number" label="包装数量" width="80" <el-table-column v-if="type==1301" prop="json.min_packaging_number" label="包装数量" width="80"

View File

@ -3,13 +3,16 @@
<div class="name"> <div class="name">
{{ hilistInfo.name }} {{ hilistInfo.name }}
</div> </div>
<div class="code"> {{ hilistInfo.code }}</div> <!-- <div class="code"> {{ hilistInfo.code }}</div>-->
</div> </div>
<div v-if="hilistInfo" class="hilist-detail"> <div v-if="hilistInfo" class="hilist-detail">
<div class="name"> <div class="name">
{{ hilistInfo.name }} {{ hilistInfo.name }}
{{ hilistInfo.json?.category ? '[' + hilistInfo.json.category + ']' : '-' }} {{ hilistInfo.json?.category ? '[' + hilistInfo.json.category + ']' : '-' }}
</div> </div>
<div>
{{ hilistInfo.code }}
</div>
<div> <div>
{{ hilistInfo.producer }} {{ hilistInfo.producer }}
</div> </div>
@ -101,11 +104,11 @@ onMounted(() => {
} }
.hilist-detail { .hilist-detail {
padding: base.$padding-base; padding: base.$padding-base;
margin-top: 5px; margin-top: 3px;;
width: 100%; width: 100%;
height: 180px; height: 250px;
border: 1px base.$border-color-base solid; border: 1px base.$border-color-base solid;
font-size: 14px; font-size: 12px;
border-radius: 8px; border-radius: 8px;
} }

View File

@ -1,5 +1,5 @@
<template> <template>
<Mask :width="1200" :top="100" :is-show="isShow" @close="exit" <Mask :width="1200" :is-show="isShow" @close="exit"
title="新增" :height="760" :show-footer="true"> title="新增" :height="760" :show-footer="true">
<div class="add-panel" v-loading="isLoading" element-loading-text="正在保存......"> <div class="add-panel" v-loading="isLoading" element-loading-text="正在保存......">
<div class="top"> <div class="top">

View File

@ -1,5 +1,5 @@
<template> <template>
<Mask :width="1200" :top="100" :is-show="isShow" @close="exit" <Mask :width="1200" :is-show="isShow" @close="exit"
title="编辑" :height="720" :show-footer="true"> title="编辑" :height="720" :show-footer="true">
<div class="edit-panel" v-loading="isLoading" element-loading-text="正在保存......"> <div class="edit-panel" v-loading="isLoading" element-loading-text="正在保存......">
<div class="top"> <div class="top">

View File

@ -1,5 +1,5 @@
<template> <template>
<Mask :width="540" :height="603" :is-show="isShow" :top="100" @close="close" :title="id?'编辑':'添加供应商'" :show-footer="true"> <Mask :width="540" :height="603" :is-show="isShow" @close="close" :title="id?'编辑':'添加供应商'" :show-footer="true">
<div class="add-supplier" style="width:100%;margin-top: 24px;padding: 0 24px"> <div class="add-supplier" style="width:100%;margin-top: 24px;padding: 0 24px">
<div class="form"> <div class="form">
<el-form style="width: 100%" ref="ruleFormRef" :model="formData" :inline=true label-position="top"> <el-form style="width: 100%" ref="ruleFormRef" :model="formData" :inline=true label-position="top">

View File

@ -1,5 +1,5 @@
<template> <template>
<Mask :top="100" :width="400" :height="400" :is-show="show"> <Mask :width="400" :height="400" :is-show="show">
<CloseBtn @click="close"></CloseBtn> <CloseBtn @click="close"></CloseBtn>
<el-card> <el-card>
<template #header> <template #header>

View File

@ -1,5 +1,5 @@
<template> <template>
<Mask :width="800" :height="600" :is-show="show" :top="100" @close="close" title="药品" :show-footer="true"> <Mask :width="800" :height="600" :is-show="show" @close="close" title="药品" :show-footer="true">
<div class="search_content_wrapper" style="padding: 24px"> <div class="search_content_wrapper" style="padding: 24px">
<div class="search_wrapper"> <div class="search_wrapper">
<span>项目名称:</span> <span>项目名称:</span>

View File

@ -22,9 +22,11 @@ function post(path: string, data: any = {}, options: any = {}) {
}) })
.then(response => { .then(response => {
if (response.status != 200) { if (response.status != 200) {
show_error("请求失败,请稍后重试");
if (config.catch_error) { if (config.catch_error) {
reject("请求失败,请稍后重试"); reject("请求失败,请稍后重试");
}else{
show_error("请求失败,请稍后重试");
} }
return; return;
} }
@ -37,9 +39,11 @@ function post(path: string, data: any = {}, options: any = {}) {
return; return;
} }
else{ else{
show_error(data.message);
if (config.catch_error) { if (config.catch_error) {
reject(data.message); reject(data.message);
}else{
show_error(data.message);
} }
return; return;
} }
@ -47,10 +51,12 @@ function post(path: string, data: any = {}, options: any = {}) {
}) })
.catch(error => { .catch(error => {
// 可以在这里添加通知,例如使用 ElNotification // 可以在这里添加通知,例如使用 ElNotification
show_error("请求异常,请稍后重试")
console.error(error) console.error(error)
if(config.catch_error){ if(config.catch_error){
reject(error); reject("请求异常,请稍后重试");
}else{
show_error("请求异常,请稍后重试")
} }
}); });

View File

@ -16,4 +16,7 @@ const itemUnitList = [
"次","项","针","根","颗","条","贴","副","袋","组","分钟","小时","穴位","部位", "次","项","针","根","颗","条","贴","副","袋","组","分钟","小时","穴位","部位",
"壮","牙","洞","根管" "壮","牙","洞","根管"
] ]
export {dosageUnitList, packagingUnit, itemUnitList} const DDDUnitList = [
"μg","mg","g","U","万U","MU"
]
export {dosageUnitList, packagingUnit, itemUnitList,DDDUnitList}

View File

@ -13,6 +13,7 @@ const username = ref('')
const password = ref('') const password = ref('')
const router = useRouter(); const router = useRouter();
const loading = ref(false) const loading = ref(false)
const tip=ref<string>("正在获取本地网卡地址")
interface NetWorkType { interface NetWorkType {
ip: string, ip: string,
@ -25,32 +26,24 @@ const netWork = ref<NetWorkType>({
}) })
const handleLogin = () => { const handleLogin = async () => {
loading.value = true loading.value = true
if (netWork.value.mac == "00-00-00-00-00") { try{
// IP使IP await loginCore();
ElMessage({ }catch (e:any){
message: "获取本地IP地址失败将使用默认IP地址", error(e)
type: 'warning',
duration: 1000,
})
} }
post(apiConfig.ManagerUserLogin, {username: username.value, password: password.value},{catch_error: true}).then((token: any) => { finally {
localStorage.setItem('token', token)
// success,error
ElMessage({
message: "登录成功,正在读卡签到,请稍后...",
type: 'success',
duration: 1000,
})
post(apiConfig.signIn, {mac: netWork.value.mac, ip: netWork.value.ip}, {catch_error: true}).then((res: any) => {
success()
}).catch(() => {
error()
})
}).catch(() => {
loading.value = false loading.value = false
}) }
}
const loginCore=async ()=>{
let token:any=await post(apiConfig.ManagerUserLogin, {username: username.value, password: password.value},{catch_error: true})
localStorage.setItem('token', token)
await post(apiConfig.signIn, {mac: netWork.value.mac, ip: netWork.value.ip}, {catch_error: true})
success()
} }
@ -64,19 +57,12 @@ const success = () => {
}, },
}) })
} }
const error = () => { const error = (message:any) => {
loading.value = false ElMessageBox.alert(message)
ElMessageBox.alert('读卡签到失败,我们将以非签到模式启动系统', '签到提示', {
confirmButtonText: '确定',
type:'error',
showClose: false,
callback: (action: Action) => {
router.push("/home/index")
},
})
} }
const wsStore = useWsStore(); const wsStore = useWsStore();
const reciceMessage = (response: Response) => { const reciceMessage = (response: Response) => {
tip.value="将以IP:"+response.Data[0].IPAddress+"登录签到"
netWork.value = { netWork.value = {
ip: response.Data[0].IPAddress, ip: response.Data[0].IPAddress,
mac: response.Data[0].MACAddress mac: response.Data[0].MACAddress
@ -94,10 +80,15 @@ const getNetwork = () => {
onMounted(async () => { onMounted(async () => {
wsStore.setMessageCallback(reciceMessage) wsStore.setMessageCallback(reciceMessage)
wsStore.setErrorCallback(errorCallback)
getNetwork() getNetwork()
}); });
const errorCallback = () => {
tip.value="获取本地IP失败将以默认IP进行登录"
}
onUnmounted(() => { onUnmounted(() => {
wsStore.removeAllMessageCallback() wsStore.removeAllMessageCallback()
wsStore.removeAllErrorCallback()
}) })
const isShowAuth = ref(false) const isShowAuth = ref(false)
const showAuth = () => { const showAuth = () => {
@ -138,11 +129,13 @@ const showAuth = () => {
class="input-field" class="input-field"
> >
</div> </div>
<div class="button"> <div class="button-group">
<button type="submit" class="login-button" @click="handleLogin">登录</button> <button type="submit" class="login-button" @click="handleLogin">登录</button>
<button class="auth-button" @click="showAuth">授权</button> <button class="auth-button" @click="showAuth">授权</button>
</div> </div>
<div class="tip" >{{tip}}</div>
</div> </div>
</div> </div>
<Mask :is-show="isShowAuth" @close="isShowAuth=false" :width="600" :height="500" title="授权"> <Mask :is-show="isShowAuth" @close="isShowAuth=false" :width="600" :height="500" title="授权">
<Auth></Auth> <Auth></Auth>
@ -357,11 +350,10 @@ const showAuth = () => {
} }
} }
.button { .button-group {
display: flex; display: flex;
}
.login-button { .login-button {
flex: 1; flex: 1;
padding: 1rem; padding: 1rem;
background: linear-gradient(135deg, #3498db, #2980b9); background: linear-gradient(135deg, #3498db, #2980b9);
@ -380,9 +372,9 @@ const showAuth = () => {
&:active { &:active {
transform: translateY(0); transform: translateY(0);
} }
} }
.auth-button { .auth-button {
flex: 1; flex: 1;
margin-left: 10px; margin-left: 10px;
padding: 1rem; padding: 1rem;
@ -402,8 +394,23 @@ const showAuth = () => {
&:active { &:active {
transform: translateY(0); transform: translateY(0);
} }
} }
}
.tip{
position: relative;
width: 100%;
height: 30px;
line-height: 30px;
font-size: 14px;
color: #999;
text-align: left;
box-sizing: border-box;
padding-left: 10px;
padding-right: 10px;
overflow: hidden;
margin-top: 10px;
}
.register-link { .register-link {
text-align: center; text-align: center;
margin-top: 1.5rem; margin-top: 1.5rem;

View File

@ -118,7 +118,7 @@
</template> </template>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="最近效期" prop="recentlyExpiryDate" width="200" show-overflow-tooltip></el-table-column> <el-table-column label="最近效期" prop="recentlyExpiryDate" width="150"></el-table-column>
<el-table-column label="进价" width="120"> <el-table-column label="进价" width="120">
<template #default="scope"> <template #default="scope">
@ -143,13 +143,13 @@
{{ getProfitCategory(scope.row.interestRate) }} {{ getProfitCategory(scope.row.interestRate) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="药品成本" prop="costPrice" width="200" show-overflow-tooltip> <el-table-column label="药品成本" prop="costPrice" width="150">
<template #default="scope"> <template #default="scope">
{{ scope.row.costPrice.toFixed(2) }} {{ scope.row.costPrice.toFixed(2) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="医保码" prop="hilistCode" show-overflow-tooltip></el-table-column> <el-table-column label="医保码" prop="hilistCode" width="240"></el-table-column>
<el-table-column label="标签" prop="producer" width="100"> <el-table-column label="标签" prop="producer" width="200">
<template #default="scope"> <template #default="scope">
<el-tag class="tags" type="success" v-for="item in getTagsArray(scope.row.tags)">{{ item }}</el-tag> <el-tag class="tags" type="success" v-for="item in getTagsArray(scope.row.tags)">{{ item }}</el-tag>
</template> </template>
@ -184,7 +184,7 @@
</div> </div>
</div> </div>
<Edit ref="editRef" @close="is_add = false;init()"/> <Edit ref="editRef" @close="is_add = false;init()"/>
<Mask :is-show="open" :top="50" :height="600" @close="open = false" title="编辑"> <Mask :isShow="open" :height="600" @close="open = false" title="编辑">
<el-tabs v-model="activeName" @tab-change="changeTab"> <el-tabs v-model="activeName" @tab-change="changeTab">
<el-tab-pane label="商品信息" name="first"> <el-tab-pane label="商品信息" name="first">
<Edit ref="editRef" @close="open = false;init()"/> <Edit ref="editRef" @close="open = false;init()"/>
@ -208,7 +208,6 @@ import InventoryBatchDetail from "@/components/inventory/goods/InventoryBatchDet
import InventoryStatistics from "@/components/inventory/goods/InventoryStatistics.vue"; import InventoryStatistics from "@/components/inventory/goods/InventoryStatistics.vue";
import CloseBtn from "@/components/CloseBtn.vue"; import CloseBtn from "@/components/CloseBtn.vue";
import {Plus, SemiSelect} from "@element-plus/icons-vue"; import {Plus, SemiSelect} from "@element-plus/icons-vue";
const statisticsData = ref<any>({}) const statisticsData = ref<any>({})
const inventoryNumber = ref(false) const inventoryNumber = ref(false)
const status = ref(false) const status = ref(false)