Revert "```"

This reverts commit abc0674531.
This commit is contained in:
2025-12-26 22:21:21 +08:00
parent ae6c486114
commit 3115e38cc4
920 changed files with 14452 additions and 107025 deletions

View File

@@ -35,7 +35,7 @@
align="center"
prop="doseUnitCode_dictText"
/> -->
<el-table-column label="生产厂家" align="center" prop="manufacturerText" />
<el-table-column label="生产厂家" align="center" prop="manufacturer" />
</el-table>
</div>
</template>

View File

@@ -35,7 +35,7 @@
align="center"
prop="doseUnitCode_dictText"
/> -->
<el-table-column label="生产厂家" align="center" prop="manufacturerText" />
<el-table-column label="生产厂家" align="center" prop="manufacturer" />
<el-table-column
label="编码"
align="center"

View File

@@ -35,7 +35,7 @@
align="center"
prop="doseUnitCode_dictText"
/> -->
<el-table-column label="生产厂家" align="center" prop="manufacturerText" />
<el-table-column label="生产厂家" align="center" prop="manufacturer" />
</el-table>
</div>
</template>

View File

@@ -1,225 +1,255 @@
<template>
<div class="app-container">
<el-form
:model="queryParams"
ref="queryRef"
:inline="true"
v-show="showSearch"
label-width="90px"
>
<el-form-item label="单据号:" prop="searchKey">
<el-input
v-model="queryParams.searchKey"
placeholder="单据号:"
clearable
style="width: 220px"
@keyup.enter="handleQuery"
<div class="app-container">
<el-form
:model="queryParams"
ref="queryRef"
:inline="true"
v-show="showSearch"
label-width="90px"
>
<el-form-item label="单据号:" prop="searchKey">
<el-input
v-model="queryParams.searchKey"
placeholder="单据号:"
clearable
style="width: 220px"
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="审批状态:" prop="statusEnum" label-width="100px">
<el-select
v-model="queryParams.statusEnum"
placeholder=""
clearable
style="width: 150px"
>
<el-option
v-for="supplyStatus in supplyStatusOptions"
:key="supplyStatus.value"
:label="supplyStatus.label"
:value="supplyStatus.value"
/>
</el-select>
</el-form-item>
<el-form-item label="制单人:" prop="applicantId" label-width="120px">
<el-select
v-model="queryParams.applicantId"
placeholder=""
clearable
style="width: 150px"
>
<el-option
v-for="practitioner in applicantListOptions"
:key="practitioner.value"
:label="practitioner.label"
:value="practitioner.value"
/>
</el-select>
</el-form-item>
<el-form-item label="制单日期:">
<el-date-picker
v-model="occurrenceTime"
value-format="YYYY-MM-DD"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<!-- 添加记录 -->
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="Plus"
@click="openAddStockPart"
>新增盘点单</el-button
>
<!-- v-hasPermi="['system:user:add']" -->
</el-col>
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="Plus"
@click="openAddStockBatch"
>新增批量盘点单</el-button
>
<!-- v-hasPermi="['system:user:add']" -->
</el-col>
<!-- 查询 -->
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="Search"
@click="handleQuery"
>查询</el-button
>
<!-- v-hasPermi="['system:user:import']" -->
</el-col>
<!-- 重置 -->
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="CircleClose"
@click="handleClear"
>重置</el-button
>
<!-- v-hasPermi="['system:user:export']" -->
</el-col>
</el-row>
<el-table
v-loading="loading"
:data="stockinventoryList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="50" align="center" />
<el-table-column
label="单据号"
align="center"
key="supplyBusNo"
prop="supplyBusNo"
width="200"
:show-overflow-tooltip="true"
/>
</el-form-item>
<el-form-item label="审批状态:" prop="statusEnum" label-width="100px">
<el-select v-model="queryParams.statusEnum" placeholder="" clearable style="width: 150px">
<el-option
v-for="supplyStatus in supplyStatusOptions"
:key="supplyStatus.value"
:label="supplyStatus.label"
:value="supplyStatus.value"
/>
</el-select>
</el-form-item>
<el-form-item label="制单人:" prop="applicantId" label-width="120px">
<el-select v-model="queryParams.applicantId" placeholder="" clearable style="width: 150px">
<el-option
v-for="practitioner in applicantListOptions"
:key="practitioner.value"
:label="practitioner.label"
:value="practitioner.value"
/>
</el-select>
</el-form-item>
<el-form-item label="制单日期:">
<el-date-picker
v-model="occurrenceTime"
value-format="YYYY-MM-DD"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<!-- 添加记录 -->
<el-col :span="1.5">
<el-button type="primary" plain icon="Plus" @click="openAddStockPart">新增盘点单</el-button>
<!-- v-hasPermi="['system:user:add']" -->
</el-col>
<el-col :span="1.5">
<el-button type="primary" plain icon="Plus" @click="openAddStockBatch"
>新增批量盘点单</el-button
<el-table-column
label="单据类型"
align="center"
key="typeEnum_enumText"
prop="typeEnum_enumText"
:show-overflow-tooltip="true"
/>
<el-table-column
label="审批状态"
align="center"
key="statusEnum_enumText"
prop="statusEnum_enumText"
:show-overflow-tooltip="true"
/>
<el-table-column
label="盘点仓库"
align="center"
key="purposeLocationId_dictText"
prop="purposeLocationId_dictText"
:show-overflow-tooltip="true"
/>
<el-table-column
label="盈亏金额"
align="center"
key="breakevenPrice"
prop="breakevenPrice"
:show-overflow-tooltip="true"
/>
<el-table-column
label="制单人"
align="center"
key="applicantId_dictText"
prop="applicantId_dictText"
:show-overflow-tooltip="true"
/>
<el-table-column
label="审核人"
align="center"
key="approverId_dictText"
prop="approverId_dictText"
:show-overflow-tooltip="true"
/>
<el-table-column
label="制单日期"
align="center"
key="createTime"
prop="createTime"
width="180"
:show-overflow-tooltip="true"
>
<!-- v-hasPermi="['system:user:add']" -->
</el-col>
<!-- 查询 -->
<el-col :span="1.5">
<el-button type="primary" plain icon="Search" @click="handleQuery">查询</el-button>
<!-- v-hasPermi="['system:user:import']" -->
</el-col>
<!-- 重置 -->
<el-col :span="1.5">
<el-button type="warning" plain icon="CircleClose" @click="handleClear">重置</el-button>
<!-- v-hasPermi="['system:user:export']" -->
</el-col>
</el-row>
<el-table
v-loading="loading"
:data="stockinventoryList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="50" align="center" />
<el-table-column
label="单据号"
align="center"
key="supplyBusNo"
prop="supplyBusNo"
width="200"
:show-overflow-tooltip="true"
/>
<el-table-column
label="单据类型"
align="center"
key="typeEnum_enumText"
prop="typeEnum_enumText"
:show-overflow-tooltip="true"
/>
<el-table-column
label="审批状态"
align="center"
key="statusEnum_enumText"
prop="statusEnum_enumText"
:show-overflow-tooltip="true"
/>
<el-table-column
label="盘点仓库"
align="center"
key="purposeLocationId_dictText"
prop="purposeLocationId_dictText"
:show-overflow-tooltip="true"
/>
<el-table-column
label="盈亏金额"
align="center"
key="breakevenPrice"
prop="breakevenPrice"
:show-overflow-tooltip="true"
/>
<el-table-column
label="制单人"
align="center"
key="applicantId_dictText"
prop="applicantId_dictText"
:show-overflow-tooltip="true"
/>
<el-table-column
label="审核人"
align="center"
key="approverId_dictText"
prop="approverId_dictText"
:show-overflow-tooltip="true"
/>
<el-table-column
label="制单日期"
align="center"
key="createTime"
prop="createTime"
width="180"
:show-overflow-tooltip="true"
>
<template #default="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column
label="审核日期 "
align="center"
key="approvalTime"
prop="approvalTime"
width="180"
:show-overflow-tooltip="true"
>
<template #default="scope">
<span>{{ parseTime(scope.row.approvalTime) }}</span>
</template>
</el-table-column>
<!-- <el-table-column
<template #default="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column
label="审核日期 "
align="center"
key="approvalTime"
prop="approvalTime"
width="180"
:show-overflow-tooltip="true"
>
<template #default="scope">
<span>{{ parseTime(scope.row.approvalTime) }}</span>
</template>
</el-table-column>
<!-- <el-table-column
label="备注"
align="center"
key="remake"
prop="remake"
/> -->
<el-table-column
label="操作"
align="center"
width="230"
class-name="small-padding fixed-width"
>
<template #default="scope">
<el-button
link
type="primary"
icon="View"
@click="
() => {
proxy.$refs['detailsDialogRef'].open(scope.row.supplyBusNo);
}
"
>详情</el-button
>
<el-button
link
type="primary"
icon="Edit"
@click="handleUpdate(scope.row)"
:disabled="
scope.row.statusEnum != '1' &&
scope.row.statusEnum != '9' &&
scope.row.statusEnum != '4'
"
>编辑</el-button
>
<!-- :disabled="scope.row.statusEnum != '1' && scope.row.statusEnum != '9' && scope.row.statusEnum != '4'" -->
<!-- v-hasPermi="['system:user:edit']" -->
<el-button
link
type="primary"
icon="View"
@click="handleSubmitApproval(scope.row)"
v-if="scope.row.statusEnum == '1' || scope.row.statusEnum == '9'"
>提交审批</el-button
>
<!-- v-hasPermi="['system:user:remove']" -->
<el-button
link
type="primary"
icon="View"
@click="handleWithdrawApproval(scope.row)"
v-if="scope.row.statusEnum == '2'"
>撤销审批</el-button
>
<!-- v-hasPermi="['system:user:remove']" -->
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
<ChkstockDetailsDialog ref="detailsDialogRef" />
<!-- <stock-receipt-dialog
<el-table-column
label="操作"
align="center"
width="230"
class-name="small-padding fixed-width"
>
<template #default="scope">
<el-button
link
type="primary"
icon="View"
@click="handleUpdate(scope.row,'view')"
>详情</el-button
>
<el-button
link
type="primary"
icon="Edit"
@click="handleUpdate(scope.row)"
disabled
>编辑</el-button
>
<!-- :disabled="scope.row.statusEnum != '1' && scope.row.statusEnum != '9' && scope.row.statusEnum != '4'" -->
<!-- v-hasPermi="['system:user:edit']" -->
<el-button
link
type="primary"
icon="View"
@click="handleSubmitApproval(scope.row)"
v-if="scope.row.statusEnum == '1' || scope.row.statusEnum == '9'"
>提交审批</el-button
>
<!-- v-hasPermi="['system:user:remove']" -->
<el-button
link
type="primary"
icon="View"
@click="handleWithdrawApproval(scope.row)"
v-if="scope.row.statusEnum == '2'"
>撤销审批</el-button
>
<!-- v-hasPermi="['system:user:remove']" -->
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
<!-- <stock-receipt-dialog
ref="stockReceiptRef"
:cabinetListOptions="cabinetListOptions"
:categoryListOptions ="categoryListOptions"
@@ -229,200 +259,195 @@
:editRow="editRow"
@refresh="getList"
/> -->
</div>
</template>
</div>
</template>
<script setup name="ChkstockRecord">
// 导入onActivated钩子
import { onMounted, onActivated } from 'vue';
import {
getStockinventoryList,
getstocktakingDetail,
getInit,
submitApproval,
withdrawApproval,
getDetailInit,
} from '../components/api';
import ChkstockDetailsDialog from '../components/chkstockDetailsDialog.vue';
// import stockReceiptDialog from "./components/stockReceiptDialog";
const router = useRouter();
const { proxy } = getCurrentInstance();
const stockinventoryList = ref([]);
const open = ref(false);
const loading = ref(true);
const showSearch = ref(true);
const ids = ref([]);
const single = ref(true);
const multiple = ref(true);
const total = ref(0);
const occurrenceTime = ref([]);
const busNoAdd = ref(''); // 单据号新增
const applicantListOptions = ref(undefined); // 制单人列表
const cabinetListOptions = ref(undefined); // 仓库列表
const categoryListOptions = ref(undefined); // 药品类型
const pharmacyListOptions = ref(undefined); // 药房列表
const supplyStatusOptions = ref(undefined); // 审批状态
const profitReasonOptions = ref(undefined); // 盈亏原因
const editRow = ref({});
// 使用 ref 定义当前编辑的采购
const currentData = ref({});
// 是否停用
const statusFlagOptions = ref(undefined);
const data = reactive({
form: {},
queryParams: {
supplyBusNo: undefined, // 编码
statusEnum: undefined, // 审批状态
applicantId: undefined, // 制单人
createTimeSTime: undefined,
createTimeETime: undefined,
pageNo: 1,
pageSize: 10,
searchKey: undefined, // 供应商名称
},
rules: {},
});
const { queryParams, form, rules } = toRefs(data);
/** 列表页查询下拉树结构 */
function getStockinventoryTypeList() {
getInit().then((response) => {
console.log('列表页下拉树response1111111', response);
busNoAdd.value = response.data.busNo; // 单据号新增
applicantListOptions.value = response.data.applicantListOptions; // 制单人列表
cabinetListOptions.value = response.data.cabinetListOptions; // 仓库列表
categoryListOptions.value = response.data.categoryListOptions; // 药品类型列表
pharmacyListOptions.value = response.data.pharmacyListOptions; // 药房列表
profitReasonOptions.value = response.data.profitReasonOptions; // 盈亏类型列表
supplyStatusOptions.value = response.data.supplyStatusOptions; // 审批状态
// 导入onActivated钩子
import { onMounted, onActivated } from 'vue';
import {
getStockinventoryList,
getstocktakingDetail,
getInit,
submitApproval,
withdrawApproval,
getDetailInit,
} from "../components/api";
// import stockReceiptDialog from "./components/stockReceiptDialog";
const router = useRouter();
const { proxy } = getCurrentInstance();
const stockinventoryList = ref([]);
const open = ref(false);
const loading = ref(true);
const showSearch = ref(true);
const ids = ref([]);
const single = ref(true);
const multiple = ref(true);
const total = ref(0);
const occurrenceTime = ref([]);
const busNoAdd = ref(""); // 单据号新增
const applicantListOptions = ref(undefined); // 制单人列表
const cabinetListOptions = ref(undefined); // 仓库列表
const categoryListOptions = ref(undefined); // 药品类型
const pharmacyListOptions = ref(undefined); // 药房列表
const supplyStatusOptions = ref(undefined); // 审批状态
const profitReasonOptions = ref(undefined); // 盈亏原因
const editRow = ref({});
// 使用 ref 定义当前编辑的采购
const currentData = ref({});
// 是否停用
const statusFlagOptions = ref(undefined);
const data = reactive({
form: {},
queryParams: {
supplyBusNo: undefined, // 编码
statusEnum: undefined, // 审批状态
applicantId: undefined, // 制单人
createTimeSTime:undefined,
createTimeETime:undefined,
pageNo:1,
pageSize: 10,
searchKey: undefined, // 供应商名称
},
rules: {},
});
}
/** 详情页查询下拉树结构 */
const { queryParams, form, rules } = toRefs(data);
/** 列表页查询下拉树结构 */
function getStockinventoryTypeList() {
getInit().then((response) => {
console.log('列表页下拉树response1111111',response)
busNoAdd.value = response.data.busNo; // 单据号新增
applicantListOptions.value = response.data.applicantListOptions; // 制单人列表
/** 查询盘点列表 */
function getList() {
loading.value = true;
getStockinventoryList(queryParams.value).then((res) => {
console.log('查询盘点列表response1111111', res);
loading.value = false;
stockinventoryList.value = res.data.records;
total.value = res.data.total;
});
}
cabinetListOptions.value = response.data.cabinetListOptions; // 仓库列表
categoryListOptions.value = response.data.categoryListOptions; // 药品类型列表
pharmacyListOptions.value = response.data.pharmacyListOptions; // 药房列表
profitReasonOptions.value = response.data.profitReasonOptions; // 盈亏类型列表
/** 搜索按钮操作 */
function handleQuery() {
queryParams.value.createTimeSTime =
occurrenceTime.value && occurrenceTime.value.length == 2
? occurrenceTime.value[0] + ' 00:00:00'
: '';
queryParams.value.createTimeETime =
occurrenceTime.value && occurrenceTime.value.length == 2
? occurrenceTime.value[1] + ' 23:59:59'
: '';
queryParams.value.pageNo = 1;
getList();
}
/** 清空条件按钮操作 */
function handleClear() {
// 清空查询条件
queryParams.value.createTimeSTime = '';
queryParams.value.createTimeETime = '';
occurrenceTime.value = '';
proxy.resetForm('queryRef');
getList();
}
/** 选择条数 */
function handleSelectionChange(selection) {
ids.value = selection.map((item) => item.id);
single.value = selection.length != 1;
multiple.value = !selection.length;
}
/** 打开商品盘点 */
function openAddStockPart() {
// nextTick(() => {
// proxy.$refs["stockReceiptRef"].show();
// });
router.push({ path: '/medicationmanagement/chkstock/chkstockPart' });
}
/** 打开批量商品盘点 */
function openAddStockBatch() {
// nextTick(() => {
// proxy.$refs["stockReceiptRef"].show();
// });
router.push({ path: '/medicationmanagement/chkstock/chkstockBatch' });
}
/** 修改按钮操作 */
function handleUpdate(row, view) {
editRow.value = row;
if (row.typeEnum == 4) {
// 盘点
router.push({
path: '/medicationmanagement/chkstock/chkstockPart',
query: { supplyBusNo: editRow.value.supplyBusNo, isEdit: true },
supplyStatusOptions.value = response.data.supplyStatusOptions; // 审批状态
});
} else {
if (view) {
router.replace({
path: '/medicationmanagement/chkstock/chkstockBatch',
query: { supplyBusNo: row.supplyBusNo, view: view },
});
} else {
router.push({
path: '/medicationmanagement/chkstock/chkstockBatch',
query: { supplyBusNo: editRow.value.supplyBusNo },
});
}
/** 详情页查询下拉树结构 */
/** 查询盘点列表 */
function getList() {
loading.value = true;
getStockinventoryList(queryParams.value).then((res) => {
console.log('查询盘点列表response1111111',res)
loading.value = false;
stockinventoryList.value = res.data.records;
total.value = res.data.total;
});
}
/** 搜索按钮操作 */
function handleQuery() {
queryParams.value.createTimeSTime =
occurrenceTime.value && occurrenceTime.value.length == 2
? occurrenceTime.value[0] + " 00:00:00"
: "";
queryParams.value.createTimeETime =
occurrenceTime.value && occurrenceTime.value.length == 2
? occurrenceTime.value[1] + " 23:59:59"
: "";
queryParams.value.pageNo = 1;
getList();
}
/** 清空条件按钮操作 */
function handleClear() {
// 清空查询条件
queryParams.value.createTimeSTime = ""
queryParams.value.createTimeETime = ""
occurrenceTime.value = ""
proxy.resetForm("queryRef");
getList();
}
/** 选择条数 */
function handleSelectionChange(selection) {
ids.value = selection.map((item) => item.id);
single.value = selection.length != 1;
multiple.value = !selection.length;
}
/** 打开商品盘点 */
function openAddStockPart() {
// nextTick(() => {
// proxy.$refs["stockReceiptRef"].show();
// });
router.push({ path: '/medicationmanagement/chkstock/chkstockPart' })
}
/** 打开批量商品盘点 */
function openAddStockBatch() {
// nextTick(() => {
// proxy.$refs["stockReceiptRef"].show();
// });
router.push({ path: '/medicationmanagement/chkstock/chkstockBatch' })
}
/** 修改按钮操作 */
function handleUpdate(row,view) {
editRow.value = row;
if(row.typeEnum==4){ // 盘点
if(view){
router.replace({ path: '/medicationmanagement/chkstock/chkstockPart',query:{supplyBusNo:row.supplyBusNo,view:view} })
}else{
router.push({ path: '/medicationmanagement/chkstock/chkstockPart',query:{supplyBusNo:editRow.value.supplyBusNo} })
}
}else{
if(view){
router.replace({ path: '/medicationmanagement/chkstock/chkstockBatch',query:{supplyBusNo:row.supplyBusNo,view:view} })
}else{
router.push({ path: '/medicationmanagement/chkstock/chkstockBatch',query:{supplyBusNo:editRow.value.supplyBusNo} })
}
}
}
}
/** 提交审核按钮 */
function handleSubmitApproval(row) {
submitApproval(row.supplyBusNo).then((response) => {
proxy.$modal.msgSuccess('提交审批成功');
open.value = false;
/** 提交审核按钮 */
function handleSubmitApproval(row) {
submitApproval(row.supplyBusNo).then((response) => {
proxy.$modal.msgSuccess("提交审批成功");
open.value = false;
getList();
});
}
/** 撤回审批按钮 */
function handleWithdrawApproval(row) {
withdrawApproval(row.supplyBusNo).then((response) => {
proxy.$modal.msgSuccess("撤销审批成功");
open.value = false;
getList();
});
}
onMounted(() => {
getStockinventoryTypeList();
getList();
});
}
/** 撤回审批按钮 */
function handleWithdrawApproval(row) {
withdrawApproval(row.supplyBusNo).then((response) => {
proxy.$modal.msgSuccess('撤销审批成功');
open.value = false;
getList();
});
}
onMounted(() => {
getStockinventoryTypeList();
getList();
});
// 添加组件被激活时的处理逻辑
onActivated(() => {
// 添加组件被激活时的处理逻辑
onActivated(() => {
// 重新加载数据
getList();
});
</script>
});
</script>
<style scoped>
.custom-tree-node {
display: flex;
align-items: center;
}
.title {
font-weight: bold;
font-size: large;
margin-bottom: 10px;
}
</style>
.custom-tree-node {
display: flex;
align-items: center;
}
.title {
font-weight: bold;
font-size: large;
margin-bottom: 10px;
}
</style>

View File

@@ -1,267 +0,0 @@
<template>
<div>
<el-dialog
v-model="dialogVisible"
title="盘点单明细"
width="90%"
:destroy-on-close="true"
v-loading="loading"
@close="close"
>
<el-row style="margin-bottom: 20px">
<template v-if="props.isApply">
<el-button plain type="primary" icon="Edit" @click="handelApply"> 审批通过 </el-button>
<el-button type="primary" plain icon="Edit" @click="handleReject"> 驳回 </el-button>
</template>
<el-button type="warning" plain icon="Printer" @click="handlePrint"> 打印单据 </el-button>
<el-button type="primary" plain icon="Download" @click="handleExport"> 导出 </el-button>
</el-row>
<el-descriptions :column="4" style="margin-bottom: 10px">
<el-descriptions-item label="单据号:">
{{ detailsList[0]?.busNo || '-' }}
</el-descriptions-item>
<el-descriptions-item label="盘点仓库:">
{{ detailsList[0]?.purposeLocationName || '-' }}
</el-descriptions-item>
<el-descriptions-item label="项目类型:">
{{ detailsList[0]?.itemType_dictText || '-' }}
</el-descriptions-item>
<el-descriptions-item label="盘点日期:">
{{ proxy.formatDateStr(detailsList[0]?.occurrenceTime, 'YYYY-MM-DD HH:mm:ss') || '-' }}
</el-descriptions-item>
</el-descriptions>
<el-table :data="detailsList" border max-height="600">
<el-table-column label="序号" width="60" type="index" align="center" />
<el-table-column label="项目名称" align="center" prop="itemName" />
<el-table-column
label="规格"
align="center"
prop="totalVolume"
:show-overflow-tooltip="true"
/>
<el-table-column
label="厂家/产地"
align="center"
prop="manufacturerText"
width="180"
:show-overflow-tooltip="true"
/>
<el-table-column label="产品批号" align="center" prop="lotNumber" />
<el-table-column label="单价" align="right" header-align="center" prop="price" width="120">
<template #default="scope">
{{ scope.row.price.toFixed(2) + ' 元' }}
</template>
</el-table-column>
<el-table-column
label="盘点单位"
align="center"
prop="measurementUnitCode_dictText"
width="80"
/>
<el-table-column
label="盘前库存"
align="right"
header-align="center"
prop="itemName"
width="100"
>
<template #default="scope">
{{
formatQuantity(
Number(scope.row.totalQuantity) - Number(scope.row.itemQuantity),
scope.row
)
}}
</template>
</el-table-column>
<el-table-column
label="实盘数量"
align="right"
header-align="center"
prop="totalQuantity"
width="100"
>
<template #default="scope">
{{ formatQuantity(scope.row.totalQuantity, scope.row) }}
</template>
</el-table-column>
<el-table-column
label="实盘金额"
align="right"
header-align="center"
prop="totalPrice"
width="120"
>
<template #default="scope">
{{ scope.row.totalPrice.toFixed(2) + ' 元' }}
</template>
</el-table-column>
<el-table-column
label="盈亏数量"
align="right"
header-align="center"
prop="itemQuantity"
width="100"
>
<template #default="scope">
{{ formatQuantity(scope.row.itemQuantity, scope.row) }}
</template>
</el-table-column>
<el-table-column label="盈亏金额" align="right" header-align="center" prop="">
<template #default="scope">
{{
((scope.row.itemQuantity * scope.row.price) / scope.row.partPercent).toFixed(2) + '元'
}}
</template>
</el-table-column>
<el-table-column label="盈亏类型" align="center" prop="reasonCode_dictText" />
<el-table-column label="盈亏原因" align="center" prop="reason" />
</el-table>
<div>
<span>合计盈亏金额{{ totalAmount ? totalAmount.toFixed(4) : 0 }}</span>
</div>
<template #footer>
<div class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script setup>
import { getCurrentInstance } from 'vue';
import { getstocktakingDetail, productStocktakingApproved, reject } from './api';
import templateJson from '@/views/medicationmanagement/chkstock/chkstockPart/components/template.json';
import { hiprint } from 'vue-plugin-hiprint';
import useUserStore from '@/store/modules/user';
const detailsList = ref([]);
const dialogVisible = ref(false);
const loading = ref(false);
const totalAmount = ref(0);
const supplyBusNo = ref('');
const userStore = useUserStore();
const { proxy } = getCurrentInstance();
const props = defineProps({
isApply: {
type: Boolean,
default: false,
},
});
function open(busNo) {
dialogVisible.value = true;
supplyBusNo.value = busNo;
getstocktakingDetail({ busNo: busNo, pageSize: 1000, pageNo: 1 }).then((res) => {
detailsList.value = res.data.records;
totalAmount.value = res.data.records.reduce((accumulator, currentRow) => {
return accumulator + (Number(((currentRow.itemQuantity * currentRow.price) / currentRow.partPercent).toFixed(2)) || 0);
}, 0);
});
}
function formatQuantity(quantity, row) {
if (row.measurementUnitCode == row.unitCode) {
return formatInventory(
quantity,
row.partPercent,
row.unitCode_dictText,
row.minUnitCode_dictText
);
} else {
return quantity + row.minUnitCode_dictText;
}
}
function handelApply() {
loading.value = true;
productStocktakingApproved(supplyBusNo.value).then((res) => {
if (res.code == 200) {
proxy.$modal.msgSuccess('操作成功');
loading.value = false;
}
});
}
function handleReject() {
reject(supplyBusNo.value).then((res) => {
if (res.code == 200) {
proxy.$modal.msgSuccess('操作成功');
}
});
}
/**
* 格式化库存数量显示(大单位情况)
* @param quantity 小单位库存数量
* @param partPercent 拆零比
* @param unitCode 大单位
* @param minUnitCode 小单位
*/
function formatInventory(quantity, partPercent, unitCode, minUnitCode) {
// 处理负数情况
const isNegative = quantity < 0;
const absQuantity = Math.abs(quantity);
if (absQuantity % partPercent !== 0) {
const integerPart = Math.floor(absQuantity / partPercent);
const decimalPart = absQuantity % partPercent;
let result = integerPart.toString() + ' ' + unitCode;
if (decimalPart > 0) {
result += decimalPart.toString() + ' ' + minUnitCode;
}
return isNegative ? '-' + result : result;
}
// 整除情况
const result = absQuantity / partPercent + ' ' + unitCode;
return isNegative ? '-' + result : result;
}
// 打印盘点单
function handlePrint() {
const result = [];
const printList = detailsList.value.map((item) => {
return {
...item,
name: item.itemName,
volume: item.totalVolume,
price: Number(item.price).toFixed(2),
itemQuantity: formatQuantity(item.itemQuantity, item),
profitAmount: ((item.itemQuantity * item.price) / item.partPercent).toFixed(2),
};
});
result.push({
purposeLocationName: printList[0].purposeLocationName,
name: userStore.name,
// totalAmount: totalAmount.value.toFixed(2),
occurrenceTime: proxy.formatDateStr(printList[0].occurrenceTime, 'YYYY-MM-DD HH:mm:ss'),
busNo: printList[0].busNo,
purposeLocationName: printList[0].purposeLocationName,
purchaseinventoryList: printList,
});
const printElements = templateJson;
var hiprintTemplate = new hiprint.PrintTemplate({ template: printElements }); // 定义模板
hiprintTemplate.print2(result, {
// printer: 'EPSON LQ-80KFII',
title: '打印标题',
}); //开始打印
}
// 导出
function handleExport() {
proxy.downloadGet(
'/inventory-manage/stocktaking/excel-out',
{
busNo: supplyBusNo.value,
},
`盘点单明细_${proxy.formatDateStr(new Date(), 'YYYY-MM-DD')}.xlsx`
);
}
defineExpose({
open,
});
</script>

View File

@@ -40,6 +40,12 @@
label="产品批号"
align="center"
prop="lotNumber"
/>
<el-table-column
label="包装单位"
align="center"
prop="unitCode_dictText"
:show-overflow-tooltip="true"
/>
<!-- <el-table-column label="用法" align="center" prop="methodCode_dictText" />
<el-table-column label="单次剂量" align="center" prop="dose" />
@@ -48,7 +54,7 @@
align="center"
prop="doseUnitCode_dictText"
/> -->
<el-table-column label="生产厂家" align="center" prop="manufacturerText" />
<el-table-column label="生产厂家" align="center" prop="manufacturer" />
<el-table-column
label="编码"
align="center"