药品列表增加药房的显示
This commit is contained in:
@@ -52,23 +52,24 @@
|
||||
<a-row :gutter="24" >
|
||||
<a-col :span="12">
|
||||
<a-form-item field="avatar" label="药店编码:">
|
||||
<span>{{modalForm.product_pharmacy_code
|
||||
}} </span>
|
||||
<span>{{modalForm.product_pharmacy_code}} </span>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item field="idCard" label="处方平台编码:" >
|
||||
<div class="cardNum">{{modalForm.product_platform_code
|
||||
}}</div>
|
||||
<a-form-item label="第三方药房编码:">
|
||||
<span>{{modalForm.pharmacy_code || '-'}}</span>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row :gutter="24" >
|
||||
|
||||
<a-col :span="12">
|
||||
<a-form-item field="idCard" label="处方平台编码:" >
|
||||
<div class="cardNum">{{modalForm.product_platform_code}}</div>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item field="avatar" label="创建时间:">
|
||||
<span>{{modalForm.created_at
|
||||
}} </span>
|
||||
<span>{{modalForm.created_at}} </span>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
@@ -20,13 +20,46 @@
|
||||
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item field="pharmacy_id" label="所属药房:">
|
||||
<a-select
|
||||
v-if="modalSatus == 'add'"
|
||||
v-model="modalForm.pharmacy_id"
|
||||
placeholder="请选择所属药房"
|
||||
allow-search
|
||||
:style="{ width: '300px' }"
|
||||
>
|
||||
<a-option
|
||||
v-for="item in pharmacyList"
|
||||
:key="item.pharmacy_id"
|
||||
:value="item.pharmacy_id"
|
||||
:label="item.pharmacy_name"
|
||||
>
|
||||
{{ item.pharmacy_name }} ({{ item.pharmacy_code }})
|
||||
</a-option>
|
||||
</a-select>
|
||||
<div v-else class="box">
|
||||
<span>{{ modalForm.pharmacy_name || modalForm.pharmacy?.pharmacy_name || '-' }}</span>
|
||||
<span v-if="modalForm.pharmacy_code || modalForm.pharmacy?.pharmacy_code" style="color: #86909c; margin-left: 8px">
|
||||
({{ modalForm.pharmacy_code || modalForm.pharmacy?.pharmacy_code }})
|
||||
</span>
|
||||
</div>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row :gutter="24">
|
||||
<a-col :span="12">
|
||||
<a-form-item field="avatar" label="药品规格:">
|
||||
<span v-if="modalForm.product_spec">{{modalForm.product_spec}} </span>
|
||||
<span v-else>选择药品后展示</span>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
|
||||
<a-col :span="12">
|
||||
<a-form-item field="avatar" label="生产厂家:">
|
||||
<span v-if="modalForm.manufacturer">{{modalForm.manufacturer}} </span>
|
||||
<span v-else>选择药品后展示</span>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row :gutter="24" >
|
||||
<a-col :span="12">
|
||||
@@ -44,33 +77,6 @@
|
||||
</div>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<!--<a-row :gutter="24" >
|
||||
<a-col :span="12">
|
||||
<a-form-item field="idCard" label="药品价格:" >
|
||||
<div class="cardNum">{{modalForm.product_price}}元</div>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item field="idCard" label="药品类型:" >
|
||||
<div class="box" >
|
||||
<div class="cardNum">{{formatProductType(modalForm.product_type)}}</div>
|
||||
</div>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row> -->
|
||||
<a-row :gutter="24" >
|
||||
<!-- <a-col :span="12">
|
||||
<a-form-item field="idCard" label="批准文号:" >
|
||||
<div class="cardNum">{{modalForm.license_number}}</div>
|
||||
</a-form-item>
|
||||
</a-col> -->
|
||||
<a-col :span="12">
|
||||
<a-form-item field="avatar" label="生产厂家:">
|
||||
<span v-if="modalForm.manufacturer">{{modalForm.manufacturer}} </span>
|
||||
<span v-else>选择药品后展示</span>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<!-- <a-row :gutter="24" >
|
||||
|
||||
@@ -233,9 +239,10 @@
|
||||
</a-modal>
|
||||
</template>
|
||||
<script setup>
|
||||
import {ref,toRefs} from 'vue';
|
||||
import {addSysMedince,editSysMedince,editMedinceStatus,getList,getMedinceDetail} from "@/api/medince/list";
|
||||
import {formatProductType} from "@/utils/format"
|
||||
import { ref, toRefs, onMounted, watch } from 'vue';
|
||||
import { addSysMedince, editSysMedince, editMedinceStatus, getList, getMedinceDetail } from "@/api/medince/list";
|
||||
import { getPharmacyList } from "@/api/basic/pharmacy";
|
||||
import { formatProductType } from "@/utils/format"
|
||||
import { Message } from '@arco-design/web-vue';
|
||||
const props = defineProps({
|
||||
// 是否显示
|
||||
@@ -253,9 +260,33 @@ const props = defineProps({
|
||||
type: Object,
|
||||
},
|
||||
});
|
||||
const medinceList=ref([]);
|
||||
const medinceList = ref([]);
|
||||
const pharmacyList = ref([]);
|
||||
const loading = ref(false);
|
||||
const rules={
|
||||
|
||||
const fetchPharmacyList = async () => {
|
||||
try {
|
||||
const res = await getPharmacyList();
|
||||
if (res.code === 200) {
|
||||
pharmacyList.value = res.data || [];
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('获取药房列表异常:', e);
|
||||
}
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
fetchPharmacyList();
|
||||
});
|
||||
|
||||
watch(() => props.modalVisible, (val) => {
|
||||
if (val && pharmacyList.value.length === 0) {
|
||||
fetchPharmacyList();
|
||||
}
|
||||
});
|
||||
|
||||
const rules = {
|
||||
pharmacy_id: [{ required: true, message: '请选择所属药房' }],
|
||||
product_platform_id: [{ required: true, message: '请输入药品名称' }],
|
||||
product_price: [{ required: true, message: '请输入药品价格' }],
|
||||
product_platform_code: [{ required: true, message: '请输入处方平台编码' }],
|
||||
@@ -276,18 +307,22 @@ const {modalVisible,modalForm,modalSatus} = toRefs(props);
|
||||
const handleClose = () => {
|
||||
emits('familyVisibleChange', false);
|
||||
};
|
||||
const handAdd=async()=>{
|
||||
const handAdd = async () => {
|
||||
if (!modalForm.value.pharmacy_id) {
|
||||
Message.warning('请选择所属药房');
|
||||
return;
|
||||
}
|
||||
delete modalForm.value.avatar;
|
||||
delete modalForm.value.product_id
|
||||
modalForm.value.product_status=1;
|
||||
delete modalForm.value.product_id;
|
||||
modalForm.value.product_status = 1;
|
||||
|
||||
const {code}=await addSysMedince(modalForm.value);
|
||||
if(code==200){
|
||||
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){
|
||||
@@ -309,17 +344,20 @@ const handleEditStatus=async(status)=>{
|
||||
}
|
||||
//详情
|
||||
const handleDetail = async (product_platform_id) => {
|
||||
const currentPharmacyId = modalForm.value.pharmacy_id;
|
||||
const { code, data, message } = await getMedinceDetail(product_platform_id);
|
||||
|
||||
if (code == 200) {
|
||||
|
||||
Object.assign(modalForm.value,data);
|
||||
modalForm.value.stock=data.stock;
|
||||
Object.assign(modalForm.value, data);
|
||||
modalForm.value.stock = data.stock;
|
||||
if (currentPharmacyId) {
|
||||
modalForm.value.pharmacy_id = currentPharmacyId;
|
||||
}
|
||||
}
|
||||
};
|
||||
const handList= async(value)=>{
|
||||
loading.value=true;
|
||||
console.log(value)
|
||||
console.log(value)
|
||||
const {code,data}=await getList({
|
||||
product_name: value,
|
||||
});
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<a-drawer
|
||||
v-model:visible="visible"
|
||||
:title="drawerTitle"
|
||||
:width="860"
|
||||
:width="960"
|
||||
:footer="false"
|
||||
@cancel="handleClose"
|
||||
>
|
||||
|
||||
@@ -8,6 +8,9 @@
|
||||
<a-form-item field="product_pharmacy_code" label="药店编码">
|
||||
<a-input :style="{ width: '182px' }" v-model="queryForm.product_pharmacy_code" placeholder="请输入药品编码" @press-enter="handleQuery" />
|
||||
</a-form-item>
|
||||
<a-form-item field="pharmacy_code" label="第三方药房编码">
|
||||
<a-input :style="{ width: '182px' }" v-model="queryForm.pharmacy_code" placeholder="请输入第三方药房编码" @press-enter="handleQuery" />
|
||||
</a-form-item>
|
||||
<a-form-item field="manufacturer" label="生产企业">
|
||||
<a-input :style="{ width: '182px' }" v-model="queryForm.manufacturer" placeholder="请输入生产企业" @press-enter="handleQuery" />
|
||||
</a-form-item>
|
||||
@@ -47,6 +50,7 @@
|
||||
|
||||
<!-- table -->
|
||||
<a-table :columns="columns" :data="tableData"
|
||||
:scroll="{ x: 1500 }"
|
||||
:row-selection="{ type: 'checkbox', showCheckedAll: true }"
|
||||
:pagination="{ 'show-total': true, 'show-jumper': true, 'show-page-size': true, total: pager.total, current: currentPage }"
|
||||
row-key="family_id" @selection-change="(selection) => {deleteData = selection;console.log(selection)}"
|
||||
@@ -144,6 +148,7 @@
|
||||
{ title: '批准文号', dataIndex: 'license_number',width:200 },
|
||||
{ title: '生产厂家', dataIndex: 'manufacturer',width:200 },
|
||||
{ title: '药店编码', dataIndex: 'product_pharmacy_code',width:100 },
|
||||
{ title: '第三方药房编码', dataIndex: 'pharmacy_code', width: 160, ellipsis: true },
|
||||
// { title: '启用状态', dataIndex: 'status', slotName: 'status' },
|
||||
{ title: '操作', slotName: 'action', fixed: "right", width: 180 },
|
||||
];
|
||||
@@ -234,6 +239,7 @@
|
||||
// 重置搜索
|
||||
const handleResetQuery = () => {
|
||||
proxy.$refs.queryFormRef.resetFields();
|
||||
queryForm.pharmacy_code = '';
|
||||
getMedinceInfo(queryForm);
|
||||
}
|
||||
const handlExport=async(type)=>{
|
||||
|
||||
@@ -15,6 +15,16 @@
|
||||
<a-form-item field="product_pharmacy_code" label="药店编码">
|
||||
<a-input :style="{ width: '182px' }" v-model="queryForm.product_pharmacy_code" placeholder="请输入药品编码" @press-enter="handleQuery" />
|
||||
</a-form-item>
|
||||
<a-form-item field="pharmacy_id" label="所属药房">
|
||||
<a-select v-model="queryForm.pharmacy_id" placeholder="请选择所属药房" allow-clear allow-search :style="{ width: '182px' }">
|
||||
<a-option v-for="item in pharmacyList" :key="item.pharmacy_id" :value="item.pharmacy_id">
|
||||
{{ item.pharmacy_name }}
|
||||
</a-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
<a-form-item field="pharmacy_code" label="药房编码">
|
||||
<a-input :style="{ width: '182px' }" v-model="queryForm.pharmacy_code" placeholder="请输入药房编码" @press-enter="handleQuery" />
|
||||
</a-form-item>
|
||||
<a-form-item field="manufacturer" label="生产企业">
|
||||
<a-input :style="{ width: '182px' }" v-model="queryForm.manufacturer" placeholder="请输入生产企业" @press-enter="handleQuery" />
|
||||
</a-form-item>
|
||||
@@ -69,6 +79,7 @@
|
||||
|
||||
<!-- table -->
|
||||
<a-table :columns="columns" :data="tableData"
|
||||
:scroll="{ x: 2000 }"
|
||||
:row-selection="{ type: 'checkbox', showCheckedAll: true }"
|
||||
:pagination="{ 'show-total': true, 'show-jumper': true, 'show-page-size': true, total: pager.total, current: currentPage }"
|
||||
row-key="product_id" @selection-change="(selection) => {deleteData = selection;console.log(selection)}"
|
||||
@@ -76,6 +87,12 @@
|
||||
<template #doctor_id="{record,rowIndex}">
|
||||
<div>{{(rowIndex+1)+(pager.page-1)*pager.page_size}}</div>
|
||||
</template>
|
||||
<template #pharmacy_name="{record}">
|
||||
<div>{{ record.pharmacy_name || '-' }}</div>
|
||||
<div v-if="record.pharmacy_code" style="font-size: 12px; color: #86909c;">
|
||||
{{ record.pharmacy_code }}
|
||||
</div>
|
||||
</template>
|
||||
<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>
|
||||
@@ -113,8 +130,10 @@
|
||||
<script setup>
|
||||
import { reactive, ref, getCurrentInstance, onMounted, nextTick, watch, computed } from 'vue';
|
||||
import { getSysMedinceList,getSysMedinceDetail,exportProduct} from '@/api/medince/list';
|
||||
import { getPharmacyList } from '@/api/basic/pharmacy';
|
||||
import { downloadFile } from '@/utils/downloadFile';
|
||||
import {formatProductStatus} from '@/utils/format';
|
||||
const pharmacyList = ref([]);
|
||||
// Akiraka 20230210 删除数据
|
||||
const deleteData = ref([])
|
||||
// Akiraka 20230210 删除对话框
|
||||
@@ -142,6 +161,8 @@
|
||||
};
|
||||
// form
|
||||
const queryForm = reactive({
|
||||
pharmacy_id: undefined,
|
||||
pharmacy_code: '',
|
||||
order:{
|
||||
stock:''
|
||||
}
|
||||
@@ -174,6 +195,7 @@
|
||||
{ title: '药品名称', dataIndex: 'product_name',width:200 },
|
||||
{ title: '通用名称', dataIndex: 'common_name',width:200 },
|
||||
{ title: '规格', dataIndex: 'product_spec',width:200 },
|
||||
{ title: '所属药房', dataIndex: 'pharmacy_name', slotName: 'pharmacy_name', width: 170, ellipsis: true },
|
||||
{ title: '单价(元)', dataIndex: 'product_price', slotName: 'product_price',width: 150 },
|
||||
{ title: '批准文号', dataIndex: 'license_number',width:200 },
|
||||
{ title: '生产厂家', dataIndex: 'manufacturer',width:200 },
|
||||
@@ -196,6 +218,9 @@
|
||||
modalTitle.value = '新增药品';
|
||||
modalSatus.value = 'add';
|
||||
modalForm.product_id ='';
|
||||
modalForm.pharmacy_id = '';
|
||||
modalForm.pharmacy_name = '';
|
||||
modalForm.pharmacy_code = '';
|
||||
modalForm.frequency_use =null;
|
||||
modalForm.available_days =null;
|
||||
modalForm.product_name ='';
|
||||
@@ -296,6 +321,8 @@
|
||||
// 重置搜索
|
||||
const handleResetQuery = () => {
|
||||
proxy.$refs.queryFormRef.resetFields();
|
||||
queryForm.pharmacy_id = undefined;
|
||||
queryForm.pharmacy_code = '';
|
||||
queryForm.order.stock='';
|
||||
getMedinceInfo(queryForm);
|
||||
}
|
||||
@@ -339,8 +366,22 @@
|
||||
}
|
||||
proxy.$loading.hide();
|
||||
}
|
||||
|
||||
// 获取药房下拉数据
|
||||
const fetchPharmacyList = async () => {
|
||||
try {
|
||||
const res = await getPharmacyList();
|
||||
if (res.code === 200) {
|
||||
pharmacyList.value = res.data || [];
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('获取药房列表异常:', e);
|
||||
}
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getMedinceInfo(pager);
|
||||
fetchPharmacyList();
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user