药品管理
This commit is contained in:
parent
8810edfe10
commit
fafbf5aad4
@ -6,25 +6,53 @@ export function getMedinceList(params){//获取药品列表-分页-平台
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
};
|
||||
|
||||
export function getMedinceDetail(id){//商品详情-平台
|
||||
return request({
|
||||
url:`${url}/${id}`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
};
|
||||
export function getSysMedinceList(params){//获取商品列表-分页-系统
|
||||
return request({
|
||||
url:'/admin/product',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
};
|
||||
|
||||
export function getSysMedinceDetail(id){//商品详情-系统
|
||||
return request({
|
||||
url:`/admin/product/${id}`,
|
||||
method: 'get'
|
||||
})
|
||||
};
|
||||
export function addSysMedince(data){//新增商品-系统
|
||||
return request({
|
||||
url:`/admin/product`,
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
};
|
||||
export function editSysMedince(id,data){//修改商品-系统
|
||||
return request({
|
||||
url:`/admin/product/${id}`,
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
export function editMedinceStatus(id,data){//修改商品状态(上/下架)
|
||||
return request({
|
||||
url:`/admin/product/status/${id}`,
|
||||
method: 'put',
|
||||
data:data
|
||||
})
|
||||
}
|
||||
export function getList(){//获取商品列表-平台
|
||||
return request({
|
||||
url:`/admin/product/platform/list`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
@ -10,7 +10,13 @@
|
||||
<a-row :gutter="24" style="margin-top: 35px;">
|
||||
<a-col :span="12">
|
||||
<a-form-item field="avatar" label="药品名称:">
|
||||
<a-input v-model="modalForm.product_name" :style="{ width: '200px' }" placeholder="请输入身份证号" />
|
||||
<a-select :style="{width:'300px'}" allow-search placeholder="请选择药品名称" v-model="modalForm.product_name"
|
||||
:loading="loading" @change="changeMedince" @search="handList" :disabled="modalSatus=='edit'">
|
||||
<a-option size="large" style="max-width:400px" v-for="item in medinceList" :key="item.product_platform_id"
|
||||
:value="item.product_platform_id" :label="item.product_name">
|
||||
{{item.product_name }}
|
||||
</a-option>
|
||||
</a-select>
|
||||
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
@ -32,7 +38,8 @@
|
||||
<a-col :span="12">
|
||||
<a-form-item field="idCard" label="药品库存:" >
|
||||
<div class="box" >
|
||||
<div class="cardNum" v-if="modalForm.stock!=''">{{modalForm.stock}}</div>
|
||||
|
||||
<div class="cardNum" v-if="modalForm.stock || modalForm.stock===0 ">{{modalForm.stock}}</div>
|
||||
<span v-else>选择药品后展示</span>
|
||||
</div>
|
||||
</a-form-item>
|
||||
@ -119,7 +126,67 @@
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row :gutter="24">
|
||||
<a-col :span="12">
|
||||
<a-form-item field="product_type" label="药品类型:">
|
||||
<a-select :style="{width:'200px'}" v-model="modalForm.product_type" placeholder="请选择药品类型">
|
||||
<a-option :value="0">未知</a-option>
|
||||
<a-option :value="1" >中成药</a-option>
|
||||
<a-option :value="2">西药</a-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-divider />
|
||||
<div class="titlebox" >
|
||||
<div class="bar"></div>
|
||||
<div class="name">药品通用名称</div>
|
||||
</div>
|
||||
<a-row :gutter="24" style="margin-top: 35px;">
|
||||
<a-col :span="12">
|
||||
<a-form-item field="common_name" label="药品通用名称:">
|
||||
<a-input :style="{ width: '200px' }" v-model="modalForm.common_name" placeholder="请输入药品通用名称" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-divider />
|
||||
<div class="titlebox" >
|
||||
<div class="bar"></div>
|
||||
<div class="name">药品价格</div>
|
||||
</div>
|
||||
<a-row :gutter="24" style="margin-top: 35px;">
|
||||
<a-col :span="12">
|
||||
<a-form-item field="product_price" label="药品价格(元):">
|
||||
<a-input-number :style="{ width: '200px' }" v-model="modalForm.product_price" :min="0" placeholder="请输入药品价格" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-divider />
|
||||
<div class="titlebox" >
|
||||
<div class="bar"></div>
|
||||
<div class="name">批准文号</div>
|
||||
</div>
|
||||
<a-row :gutter="24" style="margin-top: 35px;">
|
||||
<a-col :span="12">
|
||||
<a-form-item field="license_number" label="批准文号:">
|
||||
<a-input :style="{ width: '200px' }" v-model="modalForm.license_number" placeholder="请输入批准文号" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-divider />
|
||||
<div class="titlebox" >
|
||||
<div class="bar"></div>
|
||||
<div class="name">处方平台编码:</div>
|
||||
</div>
|
||||
<a-row :gutter="24" style="margin-top: 35px;">
|
||||
<a-col :span="12">
|
||||
<a-form-item field="product_platform_code" label="处方平台编码:">
|
||||
<a-input :style="{ width: '200px' }" v-model="modalForm.product_platform_code" placeholder="请输入处方平台编码" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-divider />
|
||||
|
||||
<div class="titlebox" >
|
||||
<div class="bar"></div>
|
||||
<div class="name">购买上限</div>
|
||||
@ -131,6 +198,20 @@
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-divider />
|
||||
<div class="titlebox" >
|
||||
<div class="bar"></div>
|
||||
<div class="name">药品备注</div>
|
||||
</div>
|
||||
<a-row :gutter="24" style="margin-top: 35px;">
|
||||
<a-col :span="12">
|
||||
<a-form-item field="prescription_num" label="药品备注:">
|
||||
<a-textarea :auto-size="{minRows:2}" allow-clear
|
||||
v-model="modalForm.product_remarks"
|
||||
placeholder="请填写药品备注" :style="{ width: '400px' }"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-divider />
|
||||
</a-form>
|
||||
<div class="titlebox" >
|
||||
@ -141,9 +222,10 @@
|
||||
<a-col :span="24">
|
||||
<a-form-item field="" label="" no-style>
|
||||
<a-space >
|
||||
<a-button type="primary" @click="" v-if="modalSatus=='add'">上架</a-button>
|
||||
<a-button type="primary" status="success" @click="" v-if="modalSatus=='edit'">重新上架</a-button>
|
||||
<a-button type="primary" status="warning" @click="" v-if="modalSatus=='edit'">下架</a-button>
|
||||
<a-button type="primary" v-has="'admin:sysMedinceList:onshelf'" @click="handAdd" v-if="modalSatus=='add'">上架</a-button>
|
||||
<a-button type="primary" v-has="'admin:sysMedinceList:save'" @click="handEdit" v-else>保存</a-button>
|
||||
<a-button type="primary" status="success" v-has="'admin:sysMedinceList:onshelfAgain'" @click="handleEditStatus(1)" v-if="modalForm.product_status==2 && modalSatus=='edit'">重新上架</a-button>
|
||||
<a-button type="primary" v-has="'admin:sysMedinceList:offshelf'" status="warning" @click="handleEditStatus(2)" v-if="modalSatus=='edit' && modalForm.product_status==1">下架</a-button>
|
||||
</a-space>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
@ -152,7 +234,9 @@
|
||||
</template>
|
||||
<script setup>
|
||||
import {ref,toRefs} from 'vue';
|
||||
import {addSysMedince,editSysMedince,editMedinceStatus,getList,getMedinceDetail} from "@/api/medince/list";
|
||||
import {formatProductType} from "@/utils/format"
|
||||
import { Message } from '@arco-design/web-vue';
|
||||
const props = defineProps({
|
||||
// 是否显示
|
||||
modalVisible: {
|
||||
@ -169,8 +253,16 @@ const props = defineProps({
|
||||
type: Object,
|
||||
},
|
||||
});
|
||||
const medinceList=ref([]);
|
||||
const loading = ref(false);
|
||||
const rules={
|
||||
product_name: [{ required: true, message: '请输入药品名称' }],
|
||||
product_platform_id: [{ required: true, message: '请输入药品名称' }],
|
||||
product_price: [{ required: true, message: '请输入药品价格' }],
|
||||
product_platform_code: [{ required: true, message: '请输入处方平台编码' }],
|
||||
license_number: [{ required: true, message: '请输入批准文号' }],
|
||||
product_type: [{ required: true, message: '请选择药品类型' }],
|
||||
common_name: [{ required: true, message: '请输入通用名称' }],
|
||||
product_remarks: [{ required: true, message: '请输入药品备注' }],
|
||||
packaging_unit: [{ required: true, message: '请输入包装单位' }],
|
||||
single_use: [{ required: true, message: '请输入单次服法' }],
|
||||
single_unit: [{ required: true, message: '请输入每次剂量' }],
|
||||
@ -178,12 +270,70 @@ const rules={
|
||||
available_days: [{ required: true, message: '请输入用药天数' }],
|
||||
prescription_num: [{ required: true, message: '请输入购买上限' }]
|
||||
};
|
||||
const emits = defineEmits(['familyVisibleChange']);
|
||||
const emits = defineEmits(['familyVisibleChange','freshList']);
|
||||
const {modalVisible,modalForm,modalSatus} = toRefs(props);
|
||||
// Akiraka 20230210 关闭弹窗
|
||||
const handleClose = () => {
|
||||
emits('familyVisibleChange', false);
|
||||
};
|
||||
const handAdd=async()=>{
|
||||
delete modalForm.value.avatar;
|
||||
delete modalForm.value.product_id
|
||||
modalForm.value.product_status=1;
|
||||
const {code}=await addSysMedince(modalForm.value);
|
||||
if(code==200){
|
||||
Message.success("添加成功");
|
||||
handleClose(true);
|
||||
emits('freshList');
|
||||
}
|
||||
}
|
||||
const handEdit=async()=>{
|
||||
const {code}=await editSysMedince(modalForm.value.product_id,modalForm.value);
|
||||
if(code==200){
|
||||
Message.success("修改成功");
|
||||
handleClose(true);
|
||||
emits('freshList');
|
||||
}
|
||||
|
||||
};
|
||||
const handleEditStatus=async(status)=>{
|
||||
const {code}=await editMedinceStatus(modalForm.value.product_id,{
|
||||
product_status: status
|
||||
});
|
||||
if(code==200){
|
||||
status==1?Message.success("上架成功"):Message.success("下架成功");
|
||||
handleClose(true);
|
||||
emits('freshList');
|
||||
}
|
||||
}
|
||||
//详情
|
||||
const handleDetail = async (product_platform_id) => {
|
||||
const { code, data, message } = await getMedinceDetail(product_platform_id);
|
||||
|
||||
if (code == 200) {
|
||||
Object.assign(modalForm, data);
|
||||
modalForm.value.stock=data.stock;
|
||||
}
|
||||
};
|
||||
const handList= async(value)=>{
|
||||
loading.value=true;
|
||||
const {code,data}=await getList({
|
||||
product_name: value,
|
||||
});
|
||||
loading.value=false;
|
||||
if(code==200){
|
||||
medinceList.value=data;
|
||||
}
|
||||
}
|
||||
const changeMedince = (value) => {
|
||||
let arr = medinceList.value.filter((item) => item.product_platform_id == value);
|
||||
modalForm.value.product_platform_id = arr[0].product_platform_id;
|
||||
console.log(arr[0]);
|
||||
modalForm.value.product_spec=arr[0].product_spec;
|
||||
modalForm.value.product_pharmacy_code=arr[0].product_pharmacy_code;
|
||||
modalForm.value.manufacturer=arr[0].manufacturer;
|
||||
handleDetail(arr[0].product_platform_id)
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
.cardNum {
|
||||
|
||||
@ -37,13 +37,13 @@
|
||||
<a-divider />
|
||||
|
||||
<!-- action -->
|
||||
<div class="action">
|
||||
<!-- <div class="action">
|
||||
<a-space>
|
||||
<a-button v-has="'admin:sysFamilyList:selectExport'" type="primary" @click="handlExport(2)"><icon-export /> 选择数据导出 </a-button>
|
||||
<a-button v-has="'admin:sysFamilyList:searchExport'" type="primary" @click="handlExport(1)"><icon-export /> 当前搜索全部导出</a-button>
|
||||
<a-button v-has="'admin:sysFamilyList:allExport'" type="primary" @click="handlExport(3)"><icon-export /> 全部导出</a-button>
|
||||
<a-button v-has="'admin:platformMedinceList:selectExport'" type="primary" @click="handlExport(2)"><icon-export /> 选择数据导出 </a-button>
|
||||
<a-button v-has="'admin:platformMedinceList:searchExport'" type="primary" @click="handlExport(1)"><icon-export /> 当前搜索全部导出</a-button>
|
||||
<a-button v-has="'admin:platformMedinceList:allExport'" type="primary" @click="handlExport(3)"><icon-export /> 全部导出</a-button>
|
||||
</a-space>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<!-- table -->
|
||||
<a-table :columns="columns" :data="tableData"
|
||||
@ -56,11 +56,11 @@
|
||||
</template>
|
||||
<template #action="{ record }">
|
||||
<a-space>
|
||||
<a-button v-has="'admin:sysFamilyList:detail'" type="text"
|
||||
<a-button v-has="'admin:platformMedinceList:detail'" type="text"
|
||||
@click="handleDetail(record)"><icon-book />详情</a-button>
|
||||
<!-- <a-button v-has="'admin:sysFamilyList:edit'" type="text" @click="handleUpdate(record)"><icon-edit />
|
||||
<!-- <a-button v-has="'admin:platformMedinceList:edit'" type="text" @click="handleUpdate(record)"><icon-edit />
|
||||
修改</a-button> -->
|
||||
<!-- <a-button v-has="'admin:sysFamilyList:remove'" type="text"
|
||||
<!-- <a-button v-has="'admin:platformMedinceList:remove'" type="text"
|
||||
@click="() => { deleteVisible = true; deleteData = [record.doctor_id]; }"><icon-delete /> 删除</a-button> -->
|
||||
</a-space>
|
||||
</template>
|
||||
|
||||
@ -54,10 +54,10 @@
|
||||
<div class="action">
|
||||
<a-space>
|
||||
<a-button v-has="'admin:sysMedinceList:add'" type="primary" @click="handleAdd"><icon-plus /> 新增 </a-button>
|
||||
<a-button v-has="'admin:sysMedinceList:remove'" type="primary" status="danger" @click="handleAdd"><icon-delete /> 删除 </a-button>
|
||||
<!-- <a-button v-has="'admin:sysMedinceList:remove'" type="primary" status="danger" @click="handleAdd"><icon-delete /> 删除 </a-button>
|
||||
<a-button v-has="'admin:sysMedinceList:selectExport'" type="primary" @click="handlExport(2)"><icon-export /> 选择数据导出 </a-button>
|
||||
<a-button v-has="'admin:sysMedinceList:searchExport'" type="primary" @click="handlExport(1)"><icon-export /> 当前搜索全部导出</a-button>
|
||||
<a-button v-has="'admin:sysMedinceList:allExport'" type="primary" @click="handlExport(3)"><icon-export /> 全部导出</a-button>
|
||||
<a-button v-has="'admin:sysMedinceList:allExport'" type="primary" @click="handlExport(3)"><icon-export /> 全部导出</a-button> -->
|
||||
</a-space>
|
||||
</div>
|
||||
|
||||
@ -70,13 +70,15 @@
|
||||
<template #doctor_id="{record,rowIndex}">
|
||||
<div>{{(rowIndex+1)+(pager.page-1)*pager.page_size}}</div>
|
||||
</template>
|
||||
<template #product_name="{record}">
|
||||
<span> {{formatProductStatus(record.product_status)}}</span>
|
||||
<template #product_status="{record}">
|
||||
<a-tag v-if="record.product_status == 1" color="green">{{formatProductStatus(record.product_status)}}</a-tag>
|
||||
<a-tag v-else-if="record.product_status == 2" color="red">{{formatProductStatus(record.product_status)}}</a-tag>
|
||||
|
||||
</template>
|
||||
<template #action="{ record }">
|
||||
<a-space>
|
||||
<a-button v-has="'admin:sysMedinceList:detail'" type="text"
|
||||
@click="handleDetail(record)"><icon-book />详情</a-button>
|
||||
<a-button v-has="'admin:sysMedinceList:edit'" type="text"
|
||||
@click="handleDetail(record)"><icon-edit />修改</a-button>
|
||||
<!-- <a-button v-has="'admin:sysMedinceList:edit'" type="text" @click="handleUpdate(record)"><icon-edit />
|
||||
修改</a-button> -->
|
||||
<!-- <a-button v-has="'admin:sysMedinceList:remove'" type="text"
|
||||
@ -85,7 +87,7 @@
|
||||
</template>
|
||||
</a-table>
|
||||
|
||||
<sysmedinceDetailModal :modalVisible="modalVisible" :modalForm="modalForm" :modalSatus="modalSatus" @familyVisibleChange="()=>{modalVisible=false}" :modalTitle="modalTitle"></sysmedinceDetailModal>
|
||||
<sysmedinceDetailModal :modalVisible="modalVisible" :modalForm="modalForm" @freshList="getMedinceInfo({ ...pager, ...queryForm })" :modalSatus="modalSatus" @familyVisibleChange="familyVisibleChange" :modalTitle="modalTitle"></sysmedinceDetailModal>
|
||||
<!-- Akiraka 20230223 删除与批量删除 开始 -->
|
||||
<!-- <DeleteModal :data="deleteData" :visible="deleteVisible" :apiDelete="removeFamily"
|
||||
@deleteVisibleChange="() => deleteVisible = false" /> -->
|
||||
@ -183,18 +185,23 @@
|
||||
modalTitle.value = '新增药品';
|
||||
modalSatus.value = 'add';
|
||||
modalForm.product_id ='';
|
||||
modalForm.frequency_use ='';
|
||||
modalForm.available_days ='';
|
||||
modalForm.frequency_use =null;
|
||||
modalForm.available_days =null;
|
||||
modalForm.product_name ='';
|
||||
modalForm.common_name ='';
|
||||
modalForm.product_spec ='';
|
||||
modalForm.product_price ='';
|
||||
modalForm.product_price =null;
|
||||
modalForm.license_number ='';
|
||||
modalForm.manufacturer ='';
|
||||
modalForm.product_pharmacy_code ='';
|
||||
modalForm.product_platform_code ='';
|
||||
modalForm.stock ='';
|
||||
modalForm.prescription_num ='';
|
||||
modalForm.prescription_num =null;
|
||||
modalForm.single_unit ='';
|
||||
modalForm.single_use ='';
|
||||
modalForm.packaging_unit ='';
|
||||
modalForm.product_status ='';
|
||||
modalForm.product_type='';
|
||||
};
|
||||
|
||||
//详情
|
||||
@ -273,6 +280,9 @@
|
||||
proxy.$refs.queryFormRef.resetFields();
|
||||
getMedinceInfo(queryForm);
|
||||
}
|
||||
const familyVisibleChange=(data)=>{
|
||||
modalVisible.value=false;
|
||||
}
|
||||
const handlExport=async(type)=>{
|
||||
proxy.$loading.show();
|
||||
let fromData=null;
|
||||
@ -310,7 +320,6 @@
|
||||
}
|
||||
proxy.$loading.hide();
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getMedinceInfo(pager);
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user