Merge branch 'main' of ssh://git.jizhiweb.cn:2222/clinic-v2/web
# Conflicts: # src/views/inventory/goods.vue
This commit is contained in:
commit
bf0dfcea3b
|
|
@ -1,5 +1,5 @@
|
|||
<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>
|
||||
<div class="detail">
|
||||
<el-input placeholder="请输入追溯码" v-model="inputIdCode" clearable @keydown.enter="openAssociationIdCode()">
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<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>
|
||||
<el-card>
|
||||
<template #header>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<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="top">
|
||||
<el-form :inline=true label-position="top" :model="formData" label-width="auto">
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<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">
|
||||
<el-descriptions border label-width="100">
|
||||
<el-descriptions-item label="领用人" width="200">
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<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="top" style="width: 100%">
|
||||
<el-form :model="form" style="width: 100%" label-width="auto" class="demo-ruleForm" label-position="top">
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<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="top">
|
||||
<el-form :model="form" style="width: 100%" label-width="auto" class="demo-ruleForm" label-position="top">
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<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
|
||||
:data="cateList"
|
||||
style="width: 100%"
|
||||
|
|
|
|||
|
|
@ -78,20 +78,6 @@
|
|||
</el-input>
|
||||
</el-form-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-form-item label="" prop="producer" class="form-item">
|
||||
|
|
@ -280,10 +266,10 @@
|
|||
<el-input v-model="edit_data.extra.cabinetNumber">
|
||||
</el-input>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="用法用量" v-if="_type==1301">
|
||||
<el-input v-model="edit_data.extra.usage">
|
||||
</el-input>
|
||||
</el-descriptions-item>
|
||||
<!-- <el-descriptions-item label="用法用量" v-if="_type==1301">-->
|
||||
<!-- <el-input v-model="edit_data.extra.usage">-->
|
||||
<!-- </el-input>-->
|
||||
<!-- </el-descriptions-item>-->
|
||||
<el-descriptions-item label="处方药/OTC" v-if="_type==1301">
|
||||
<el-select
|
||||
v-model="edit_data.extra.drugCategory"
|
||||
|
|
@ -314,12 +300,51 @@
|
|||
/>
|
||||
</el-select>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="抗菌药物" v-if="_type==1301">
|
||||
<el-input v-model="edit_data.extra.isAntibacterialAgents"></el-input>
|
||||
<el-descriptions-item label="抗菌药物|DDD值" v-if="_type==1301">
|
||||
<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 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 label="医疗器械分类" v-if="_type==1306">
|
||||
<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-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-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-option
|
||||
v-for="item in pricingModelOptions"
|
||||
|
|
@ -348,7 +379,7 @@
|
|||
</el-option>
|
||||
</el-select>
|
||||
</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">
|
||||
<template #append>%</template>
|
||||
</el-input>
|
||||
|
|
@ -388,7 +419,8 @@
|
|||
<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-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>
|
||||
</div>
|
||||
</template>
|
||||
|
|
@ -401,7 +433,7 @@
|
|||
<script setup lang="ts">
|
||||
|
||||
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 Mask from "@/components/common/Mask.vue";
|
||||
import Search from "@/components/inventory/goods/Search.vue";
|
||||
|
|
@ -429,6 +461,26 @@ const pricingModelOptions = [
|
|||
value: 0,
|
||||
}
|
||||
]
|
||||
const isAntibacterialAgentsOptions = [
|
||||
{
|
||||
label: '非限制使用级',
|
||||
},
|
||||
{
|
||||
label: '限制使用级',
|
||||
},
|
||||
{
|
||||
label: '特殊使用级',
|
||||
}
|
||||
]
|
||||
const baseMedicineOptions = [
|
||||
{
|
||||
label: '国家基药',
|
||||
},
|
||||
{
|
||||
label: '地标基药',
|
||||
}
|
||||
]
|
||||
|
||||
const JMDFList = [
|
||||
{
|
||||
label: '精I',
|
||||
|
|
@ -494,7 +546,19 @@ let edit_data: any = ref({
|
|||
packagingUnit: "盒",
|
||||
pricingModel: 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 showPopover = ref(false);
|
||||
const idCodeList = ref<string[]>([]);
|
||||
|
|
@ -558,10 +622,15 @@ const openCreateSearch = () => {
|
|||
});
|
||||
}
|
||||
const createConfirm = (data: any) => {
|
||||
let id = edit_data.value.id
|
||||
edit_data.value = data
|
||||
edit_data.value.id = id
|
||||
|
||||
edit_data.value.name = data.name
|
||||
edit_data.value.approvalCode = data.approvalCode
|
||||
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 openContrastCodeSearch = () => {
|
||||
|
|
@ -572,15 +641,29 @@ const openContrastCodeSearch = () => {
|
|||
const contrastCodeConfirm = (data: any) => {
|
||||
edit_data.value.hilistCode = data.hilistCode
|
||||
}
|
||||
let save = async () => {
|
||||
let save = async (isClose:Boolean) => {
|
||||
try {
|
||||
|
||||
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));
|
||||
data.tags = data.tags ? data.tags.join(",") : null;
|
||||
data.idCode = idCodeList.value.join(",");
|
||||
data.type = _type.value;
|
||||
post("goods/goods/save", data).then((res: any) => {
|
||||
exit()
|
||||
ElMessage.success('保存成功')
|
||||
if (isClose){
|
||||
//关闭该页面
|
||||
exit()
|
||||
return
|
||||
}
|
||||
//重置该界面
|
||||
initEditData()
|
||||
|
||||
|
||||
})
|
||||
// ...原有保存逻辑...
|
||||
} catch (e) {
|
||||
|
|
@ -605,7 +688,7 @@ const cateCloseCallBack = () => {
|
|||
let exit = () => {
|
||||
document.addEventListener("click", handleClickOutside);
|
||||
isShow.value = false
|
||||
edit_data.value = {}
|
||||
initEditData()
|
||||
emit('close');
|
||||
}
|
||||
const handleClickOutside = (event: MouseEvent) => {
|
||||
|
|
@ -675,21 +758,14 @@ watch(() => edit_data.value.hilistCode, (newVal) => {
|
|||
})
|
||||
const drugCategoryOptions = [
|
||||
{
|
||||
label: '西药',
|
||||
value: 1301
|
||||
label: '处方药',
|
||||
value: 1
|
||||
},
|
||||
{
|
||||
label: '中药',
|
||||
value: 1302
|
||||
label: '非处方药',
|
||||
value: 2
|
||||
},
|
||||
{
|
||||
label: '非药品',
|
||||
value: 1303
|
||||
},
|
||||
{
|
||||
label: '其他',
|
||||
value: 1304
|
||||
}
|
||||
|
||||
]
|
||||
|
||||
const disableSale = () => {
|
||||
|
|
@ -741,6 +817,22 @@ const enableSale = () => {
|
|||
.common-layout {
|
||||
margin-top: 10px;
|
||||
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 {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<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_wrapper">
|
||||
<span>药品名称:</span>
|
||||
|
|
@ -15,13 +15,16 @@
|
|||
<div class="result_table" style="width: 100%; height: 100%;overflow: hidden">
|
||||
<el-scrollbar>
|
||||
<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">
|
||||
<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="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="80"
|
||||
<el-table-column v-if="type==1301" prop="json.reg_specifications" label="注册规格" width="120"
|
||||
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"
|
||||
show-overflow-tooltip/>
|
||||
<el-table-column v-if="type==1301" prop="json.min_packaging_number" label="包装数量" width="80"
|
||||
|
|
|
|||
|
|
@ -3,13 +3,16 @@
|
|||
<div class="name">
|
||||
{{ hilistInfo.name }}
|
||||
</div>
|
||||
<div class="code"> {{ hilistInfo.code }}</div>
|
||||
<!-- <div class="code"> {{ hilistInfo.code }}</div>-->
|
||||
</div>
|
||||
<div v-if="hilistInfo" class="hilist-detail">
|
||||
<div class="name">
|
||||
{{ hilistInfo.name }}
|
||||
{{ hilistInfo.json?.category ? '[' + hilistInfo.json.category + ']' : '-' }}
|
||||
</div>
|
||||
<div>
|
||||
{{ hilistInfo.code }}
|
||||
</div>
|
||||
<div>
|
||||
{{ hilistInfo.producer }}
|
||||
</div>
|
||||
|
|
@ -101,11 +104,11 @@ onMounted(() => {
|
|||
}
|
||||
.hilist-detail {
|
||||
padding: base.$padding-base;
|
||||
margin-top: 5px;
|
||||
margin-top: 3px;;
|
||||
width: 100%;
|
||||
height: 180px;
|
||||
height: 250px;
|
||||
border: 1px base.$border-color-base solid;
|
||||
font-size: 14px;
|
||||
font-size: 12px;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<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">
|
||||
<div class="add-panel" v-loading="isLoading" element-loading-text="正在保存......">
|
||||
<div class="top">
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<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">
|
||||
<div class="edit-panel" v-loading="isLoading" element-loading-text="正在保存......">
|
||||
<div class="top">
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<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="form">
|
||||
<el-form style="width: 100%" ref="ruleFormRef" :model="formData" :inline=true label-position="top">
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<Mask :top="100" :width="400" :height="400" :is-show="show">
|
||||
<Mask :width="400" :height="400" :is-show="show">
|
||||
<CloseBtn @click="close"></CloseBtn>
|
||||
<el-card>
|
||||
<template #header>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<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_wrapper">
|
||||
<span>项目名称:</span>
|
||||
|
|
|
|||
|
|
@ -22,9 +22,11 @@ function post(path: string, data: any = {}, options: any = {}) {
|
|||
})
|
||||
.then(response => {
|
||||
if (response.status != 200) {
|
||||
show_error("请求失败,请稍后重试");
|
||||
|
||||
if (config.catch_error) {
|
||||
reject("请求失败,请稍后重试");
|
||||
}else{
|
||||
show_error("请求失败,请稍后重试");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
@ -37,9 +39,11 @@ function post(path: string, data: any = {}, options: any = {}) {
|
|||
return;
|
||||
}
|
||||
else{
|
||||
show_error(data.message);
|
||||
|
||||
if (config.catch_error) {
|
||||
reject(data.message);
|
||||
}else{
|
||||
show_error(data.message);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
@ -47,10 +51,12 @@ function post(path: string, data: any = {}, options: any = {}) {
|
|||
})
|
||||
.catch(error => {
|
||||
// 可以在这里添加通知,例如使用 ElNotification
|
||||
show_error("请求异常,请稍后重试")
|
||||
|
||||
console.error(error)
|
||||
if(config.catch_error){
|
||||
reject(error);
|
||||
reject("请求异常,请稍后重试");
|
||||
}else{
|
||||
show_error("请求异常,请稍后重试")
|
||||
}
|
||||
|
||||
});
|
||||
|
|
|
|||
|
|
@ -16,4 +16,7 @@ const itemUnitList = [
|
|||
"次","项","针","根","颗","条","贴","副","袋","组","分钟","小时","穴位","部位",
|
||||
"壮","牙","洞","根管"
|
||||
]
|
||||
export {dosageUnitList, packagingUnit, itemUnitList}
|
||||
const DDDUnitList = [
|
||||
"μg","mg","g","U","万U","MU"
|
||||
]
|
||||
export {dosageUnitList, packagingUnit, itemUnitList,DDDUnitList}
|
||||
|
|
@ -13,6 +13,7 @@ const username = ref('')
|
|||
const password = ref('')
|
||||
const router = useRouter();
|
||||
const loading = ref(false)
|
||||
const tip=ref<string>("正在获取本地网卡地址")
|
||||
|
||||
interface NetWorkType {
|
||||
ip: string,
|
||||
|
|
@ -25,32 +26,24 @@ const netWork = ref<NetWorkType>({
|
|||
})
|
||||
|
||||
|
||||
const handleLogin = () => {
|
||||
const handleLogin = async () => {
|
||||
loading.value = true
|
||||
if (netWork.value.mac == "00-00-00-00-00") {
|
||||
//提示 获取本地IP地址失败,将使用默认IP地址
|
||||
ElMessage({
|
||||
message: "获取本地IP地址失败,将使用默认IP地址",
|
||||
type: 'warning',
|
||||
duration: 1000,
|
||||
})
|
||||
try{
|
||||
await loginCore();
|
||||
}catch (e:any){
|
||||
error(e)
|
||||
}
|
||||
post(apiConfig.ManagerUserLogin, {username: username.value, password: password.value},{catch_error: true}).then((token: any) => {
|
||||
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(() => {
|
||||
finally {
|
||||
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 = () => {
|
||||
loading.value = false
|
||||
ElMessageBox.alert('读卡签到失败,我们将以非签到模式启动系统', '签到提示', {
|
||||
confirmButtonText: '确定',
|
||||
type:'error',
|
||||
showClose: false,
|
||||
callback: (action: Action) => {
|
||||
router.push("/home/index")
|
||||
},
|
||||
})
|
||||
const error = (message:any) => {
|
||||
ElMessageBox.alert(message)
|
||||
}
|
||||
const wsStore = useWsStore();
|
||||
const reciceMessage = (response: Response) => {
|
||||
tip.value="将以IP:"+response.Data[0].IPAddress+"登录签到"
|
||||
netWork.value = {
|
||||
ip: response.Data[0].IPAddress,
|
||||
mac: response.Data[0].MACAddress
|
||||
|
|
@ -94,10 +80,15 @@ const getNetwork = () => {
|
|||
|
||||
onMounted(async () => {
|
||||
wsStore.setMessageCallback(reciceMessage)
|
||||
wsStore.setErrorCallback(errorCallback)
|
||||
getNetwork()
|
||||
});
|
||||
const errorCallback = () => {
|
||||
tip.value="获取本地IP失败,将以默认IP进行登录"
|
||||
}
|
||||
onUnmounted(() => {
|
||||
wsStore.removeAllMessageCallback()
|
||||
wsStore.removeAllErrorCallback()
|
||||
})
|
||||
const isShowAuth = ref(false)
|
||||
const showAuth = () => {
|
||||
|
|
@ -138,11 +129,13 @@ const showAuth = () => {
|
|||
class="input-field"
|
||||
>
|
||||
</div>
|
||||
<div class="button">
|
||||
<div class="button-group">
|
||||
<button type="submit" class="login-button" @click="handleLogin">登录</button>
|
||||
<button class="auth-button" @click="showAuth">授权</button>
|
||||
</div>
|
||||
<div class="tip" >{{tip}}</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<Mask :is-show="isShowAuth" @close="isShowAuth=false" :width="600" :height="500" title="授权">
|
||||
<Auth></Auth>
|
||||
|
|
@ -357,53 +350,67 @@ const showAuth = () => {
|
|||
}
|
||||
}
|
||||
|
||||
.button {
|
||||
.button-group {
|
||||
display: flex;
|
||||
|
||||
.login-button {
|
||||
flex: 1;
|
||||
padding: 1rem;
|
||||
background: linear-gradient(135deg, #3498db, #2980b9);
|
||||
border: none;
|
||||
border-radius: 8px;
|
||||
color: white;
|
||||
font-size: 1.1rem;
|
||||
font-weight: 600;
|
||||
cursor: pointer;
|
||||
transition: transform 0.2s ease;
|
||||
|
||||
&:hover {
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
|
||||
&:active {
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
||||
|
||||
.auth-button {
|
||||
flex: 1;
|
||||
margin-left: 10px;
|
||||
padding: 1rem;
|
||||
background: linear-gradient(135deg, #3498db, #2980b9);
|
||||
border: none;
|
||||
border-radius: 8px;
|
||||
color: white;
|
||||
font-size: 1.1rem;
|
||||
font-weight: 600;
|
||||
cursor: pointer;
|
||||
transition: transform 0.2s ease;
|
||||
|
||||
&:hover {
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
|
||||
&:active {
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.login-button {
|
||||
flex: 1;
|
||||
padding: 1rem;
|
||||
background: linear-gradient(135deg, #3498db, #2980b9);
|
||||
border: none;
|
||||
border-radius: 8px;
|
||||
color: white;
|
||||
font-size: 1.1rem;
|
||||
font-weight: 600;
|
||||
cursor: pointer;
|
||||
transition: transform 0.2s ease;
|
||||
|
||||
&:hover {
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
|
||||
&:active {
|
||||
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;
|
||||
}
|
||||
|
||||
.auth-button {
|
||||
flex: 1;
|
||||
margin-left: 10px;
|
||||
padding: 1rem;
|
||||
background: linear-gradient(135deg, #3498db, #2980b9);
|
||||
border: none;
|
||||
border-radius: 8px;
|
||||
color: white;
|
||||
font-size: 1.1rem;
|
||||
font-weight: 600;
|
||||
cursor: pointer;
|
||||
transition: transform 0.2s ease;
|
||||
|
||||
&:hover {
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
|
||||
&:active {
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
||||
|
||||
.register-link {
|
||||
text-align: center;
|
||||
margin-top: 1.5rem;
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@
|
|||
</template>
|
||||
</template>
|
||||
</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">
|
||||
<template #default="scope">
|
||||
|
|
@ -143,13 +143,13 @@
|
|||
{{ getProfitCategory(scope.row.interestRate) }}
|
||||
</template>
|
||||
</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">
|
||||
¥{{ scope.row.costPrice.toFixed(2) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="医保码" prop="hilistCode" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column label="标签" prop="producer" width="100">
|
||||
<el-table-column label="医保码" prop="hilistCode" width="240"></el-table-column>
|
||||
<el-table-column label="标签" prop="producer" width="200">
|
||||
<template #default="scope">
|
||||
<el-tag class="tags" type="success" v-for="item in getTagsArray(scope.row.tags)">{{ item }}</el-tag>
|
||||
</template>
|
||||
|
|
@ -184,7 +184,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<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-tab-pane label="商品信息" name="first">
|
||||
<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 CloseBtn from "@/components/CloseBtn.vue";
|
||||
import {Plus, SemiSelect} from "@element-plus/icons-vue";
|
||||
|
||||
const statisticsData = ref<any>({})
|
||||
const inventoryNumber = ref(false)
|
||||
const status = ref(false)
|
||||
|
|
|
|||
Loading…
Reference in New Issue