解决合并冲突
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,449 @@
|
||||
{
|
||||
"panels": [
|
||||
{
|
||||
"index": 0,
|
||||
"name": 1,
|
||||
"paperType": "自定义",
|
||||
"height": 130,
|
||||
"width": 210,
|
||||
"paperHeader": 0,
|
||||
"paperFooter": 365.6692913385827,
|
||||
"paperNumberDisabled": true,
|
||||
"paperNumberContinue": true,
|
||||
"expandCss": "",
|
||||
"overPrintOptions": {
|
||||
"content": "",
|
||||
"opacity": 0.7,
|
||||
"type": 1
|
||||
},
|
||||
"watermarkOptions": {
|
||||
"content": "",
|
||||
"fillStyle": "rgba(184, 184, 184, 0.3)",
|
||||
"fontSize": "14px",
|
||||
"rotate": 25,
|
||||
"width": 200,
|
||||
"height": 200,
|
||||
"timestamp": false,
|
||||
"format": "YYYY-MM-DD HH:mm"
|
||||
},
|
||||
"panelLayoutOptions": {},
|
||||
"printElements": [
|
||||
{
|
||||
"options": {
|
||||
"left": 222,
|
||||
"top": 12,
|
||||
"height": 12,
|
||||
"width": 115.5,
|
||||
"title": "长春大学医院盘点单",
|
||||
"coordinateSync": false,
|
||||
"widthHeightSync": false,
|
||||
"fontSize": 12,
|
||||
"qrCodeLevel": 0
|
||||
},
|
||||
"printElementType": {
|
||||
"title": "文本",
|
||||
"type": "text"
|
||||
}
|
||||
},
|
||||
{
|
||||
"options": {
|
||||
"left": 19.5,
|
||||
"top": 33,
|
||||
"height": 9.75,
|
||||
"width": 120,
|
||||
"title": "日期",
|
||||
"field": "occurrenceTime",
|
||||
"coordinateSync": false,
|
||||
"widthHeightSync": false,
|
||||
"qrCodeLevel": 0
|
||||
},
|
||||
"printElementType": {
|
||||
"title": "文本",
|
||||
"type": "text"
|
||||
}
|
||||
},
|
||||
{
|
||||
"options": {
|
||||
"left": 222,
|
||||
"top": 33,
|
||||
"height": 9.75,
|
||||
"width": 120,
|
||||
"title": "单据号",
|
||||
"field": "busNo",
|
||||
"coordinateSync": false,
|
||||
"widthHeightSync": false,
|
||||
"qrCodeLevel": 0
|
||||
},
|
||||
"printElementType": {
|
||||
"title": "文本",
|
||||
"type": "text"
|
||||
}
|
||||
},
|
||||
{
|
||||
"options": {
|
||||
"left": 465,
|
||||
"top": 33,
|
||||
"height": 9.75,
|
||||
"width": 120,
|
||||
"title": "机构:长春大学医院",
|
||||
"coordinateSync": false,
|
||||
"widthHeightSync": false,
|
||||
"qrCodeLevel": 0
|
||||
},
|
||||
"printElementType": {
|
||||
"title": "文本",
|
||||
"type": "text"
|
||||
}
|
||||
},
|
||||
{
|
||||
"options": {
|
||||
"left": 19.5,
|
||||
"top": 57,
|
||||
"height": 9.75,
|
||||
"width": 120,
|
||||
"title": "盘点仓库",
|
||||
"field": "purposeLocationName",
|
||||
"coordinateSync": false,
|
||||
"widthHeightSync": false,
|
||||
"qrCodeLevel": 0
|
||||
},
|
||||
"printElementType": {
|
||||
"title": "文本",
|
||||
"type": "text"
|
||||
}
|
||||
},
|
||||
{
|
||||
"options": {
|
||||
"left": 19.5,
|
||||
"top": 84,
|
||||
"height": 36,
|
||||
"width": 570,
|
||||
"title": "undefined+beforeDragIn",
|
||||
"field": "purchaseinventoryList",
|
||||
"coordinateSync": false,
|
||||
"widthHeightSync": false,
|
||||
"columns": [
|
||||
[
|
||||
{
|
||||
"title": "项目名",
|
||||
"titleSync": false,
|
||||
"halign": "center",
|
||||
"tableQRCodeLevel": 0,
|
||||
"tableSummaryTitle": true,
|
||||
"tableSummary": "",
|
||||
"width": 50.418660151829066,
|
||||
"field": "name",
|
||||
"checked": true,
|
||||
"columnId": "name",
|
||||
"fixed": false,
|
||||
"rowspan": 1,
|
||||
"colspan": 1
|
||||
},
|
||||
{
|
||||
"title": "规格",
|
||||
"titleSync": false,
|
||||
"halign": "center",
|
||||
"tableQRCodeLevel": 0,
|
||||
"tableSummaryTitle": true,
|
||||
"tableSummary": "",
|
||||
"width": 47.38277249096388,
|
||||
"field": "volume",
|
||||
"checked": true,
|
||||
"columnId": "volume",
|
||||
"fixed": false,
|
||||
"rowspan": 1,
|
||||
"colspan": 1
|
||||
},
|
||||
{
|
||||
"title": "厂家/产地",
|
||||
"titleSync": false,
|
||||
"halign": "center",
|
||||
"tableQRCodeLevel": 0,
|
||||
"tableSummaryTitle": true,
|
||||
"tableSummary": "",
|
||||
"width": 70.82692033621548,
|
||||
"field": "manufacturer",
|
||||
"checked": true,
|
||||
"columnId": "manufacturer",
|
||||
"fixed": false,
|
||||
"rowspan": 1,
|
||||
"colspan": 1
|
||||
},
|
||||
{
|
||||
"title": "盘点单位",
|
||||
"titleSync": false,
|
||||
"align": "center",
|
||||
"halign": "center",
|
||||
"tableQRCodeLevel": 0,
|
||||
"tableSummaryTitle": true,
|
||||
"tableSummary": "",
|
||||
"width": 62.494476949595715,
|
||||
"field": "measurementUnitCode_dictText",
|
||||
"checked": true,
|
||||
"columnId": "measurementUnitCode_dictText",
|
||||
"fixed": false,
|
||||
"rowspan": 1,
|
||||
"colspan": 1
|
||||
},
|
||||
{
|
||||
"title": "单价",
|
||||
"titleSync": false,
|
||||
"align": "right",
|
||||
"halign": "center",
|
||||
"tableQRCodeLevel": 0,
|
||||
"tableSummaryTitle": true,
|
||||
"tableSummary": "",
|
||||
"formatter2": "function(value,row,index,options,rowIndex,column){ return value + ' 元'; }",
|
||||
"width": 47.779659918016016,
|
||||
"field": "price",
|
||||
"checked": true,
|
||||
"columnId": "price",
|
||||
"fixed": false,
|
||||
"rowspan": 1,
|
||||
"colspan": 1
|
||||
},
|
||||
{
|
||||
"title": "盈亏数量",
|
||||
"titleSync": false,
|
||||
"halign": "center",
|
||||
"tableQRCodeLevel": 0,
|
||||
"tableSummaryTitle": true,
|
||||
"tableSummary": "",
|
||||
"width": 60.04350865342028,
|
||||
"field": "itemQuantity",
|
||||
"checked": true,
|
||||
"columnId": "itemQuantity",
|
||||
"fixed": false,
|
||||
"rowspan": 1,
|
||||
"colspan": 1
|
||||
},
|
||||
{
|
||||
"title": "盈亏金额",
|
||||
"titleSync": false,
|
||||
"align": "right",
|
||||
"halign": "center",
|
||||
"tableQRCodeLevel": 0,
|
||||
"tableSummaryTitle": true,
|
||||
"tableSummary": "",
|
||||
"formatter2": "function(value,row,index,options,rowIndex,column){ return value + ' 元'; }",
|
||||
"width": 60.03571725956876,
|
||||
"field": "profitAmount",
|
||||
"checked": true,
|
||||
"columnId": "profitAmount",
|
||||
"fixed": false,
|
||||
"rowspan": 1,
|
||||
"colspan": 1
|
||||
},
|
||||
{
|
||||
"title": "产品批号",
|
||||
"titleSync": false,
|
||||
"halign": "center",
|
||||
"tableQRCodeLevel": 0,
|
||||
"tableSummaryTitle": true,
|
||||
"tableSummary": "",
|
||||
"width": 56.38575853120875,
|
||||
"field": "lotNumber",
|
||||
"checked": true,
|
||||
"columnId": "lotNumber",
|
||||
"fixed": false,
|
||||
"rowspan": 1,
|
||||
"colspan": 1
|
||||
},
|
||||
{
|
||||
"title": "盈亏类型",
|
||||
"titleSync": false,
|
||||
"halign": "center",
|
||||
"tableQRCodeLevel": 0,
|
||||
"tableSummaryTitle": true,
|
||||
"tableSummary": "",
|
||||
"width": 56.36601841060319,
|
||||
"field": "reasonCode_dictText",
|
||||
"checked": true,
|
||||
"columnId": "reasonCode_dictText",
|
||||
"fixed": false,
|
||||
"rowspan": 1,
|
||||
"colspan": 1
|
||||
},
|
||||
{
|
||||
"title": "盈亏原因",
|
||||
"titleSync": false,
|
||||
"halign": "center",
|
||||
"tableQRCodeLevel": 0,
|
||||
"tableSummaryTitle": true,
|
||||
"tableSummary": "",
|
||||
"width": 58.266507298578894,
|
||||
"field": "reason",
|
||||
"checked": true,
|
||||
"columnId": "reason",
|
||||
"fixed": false,
|
||||
"rowspan": 1,
|
||||
"colspan": 1
|
||||
},
|
||||
{
|
||||
"title": "盘前库存",
|
||||
"titleSync": false,
|
||||
"align": "center",
|
||||
"tableQRCodeLevel": 0,
|
||||
"tableSummaryTitle": true,
|
||||
"tableSummary": "",
|
||||
"width": 51.08786300584732,
|
||||
"field": "totalPurposeQuantity",
|
||||
"checked": false,
|
||||
"columnId": "totalPurposeQuantity",
|
||||
"fixed": false,
|
||||
"rowspan": 1,
|
||||
"colspan": 1
|
||||
},
|
||||
{
|
||||
"title": "实盘数量",
|
||||
"titleSync": false,
|
||||
"align": "right",
|
||||
"halign": "center",
|
||||
"tableQRCodeLevel": 0,
|
||||
"tableSummaryTitle": true,
|
||||
"tableSummary": "",
|
||||
"width": 53.074934501634054,
|
||||
"field": "totalQuantity",
|
||||
"checked": false,
|
||||
"columnId": "totalQuantity",
|
||||
"fixed": false,
|
||||
"rowspan": 1,
|
||||
"colspan": 1
|
||||
},
|
||||
{
|
||||
"title": "金额",
|
||||
"titleSync": false,
|
||||
"align": "right",
|
||||
"halign": "center",
|
||||
"tableQRCodeLevel": 0,
|
||||
"tableSummaryTitle": true,
|
||||
"tableSummary": "",
|
||||
"formatter2": "function(value,row,index,options,rowIndex,column){ return value + ' 元'; }",
|
||||
"width": 39.04544357631049,
|
||||
"field": "totalPrice",
|
||||
"checked": false,
|
||||
"columnId": "totalPrice",
|
||||
"fixed": false,
|
||||
"rowspan": 1,
|
||||
"colspan": 1
|
||||
},
|
||||
{
|
||||
"title": "仓库",
|
||||
"titleSync": false,
|
||||
"halign": "center",
|
||||
"tableQRCodeLevel": 0,
|
||||
"tableSummaryTitle": true,
|
||||
"tableSummary": "",
|
||||
"width": 40.041954542099724,
|
||||
"field": "purposeLocationName",
|
||||
"checked": false,
|
||||
"columnId": "purposeLocationName",
|
||||
"fixed": false,
|
||||
"rowspan": 1,
|
||||
"colspan": 1
|
||||
},
|
||||
{
|
||||
"title": "生产日期",
|
||||
"titleSync": false,
|
||||
"halign": "center",
|
||||
"tableQRCodeLevel": 0,
|
||||
"tableSummaryTitle": true,
|
||||
"tableSummary": "",
|
||||
"width": 63.089377997062755,
|
||||
"field": "startTime",
|
||||
"checked": false,
|
||||
"columnId": "startTime",
|
||||
"fixed": false,
|
||||
"rowspan": 1,
|
||||
"colspan": 1
|
||||
},
|
||||
{
|
||||
"title": "有效期至",
|
||||
"titleSync": false,
|
||||
"halign": "center",
|
||||
"tableQRCodeLevel": 0,
|
||||
"tableSummaryTitle": true,
|
||||
"tableSummary": "",
|
||||
"width": 59.05673483929025,
|
||||
"field": "endTime",
|
||||
"checked": false,
|
||||
"columnId": "endTime",
|
||||
"fixed": false,
|
||||
"rowspan": 1,
|
||||
"colspan": 1
|
||||
},
|
||||
{
|
||||
"title": "发票号",
|
||||
"titleSync": false,
|
||||
"halign": "center",
|
||||
"tableQRCodeLevel": 0,
|
||||
"tableSummaryTitle": true,
|
||||
"tableSummary": "",
|
||||
"width": 51.706448638859854,
|
||||
"field": "invoiceNo",
|
||||
"checked": false,
|
||||
"columnId": "invoiceNo",
|
||||
"fixed": false,
|
||||
"rowspan": 1,
|
||||
"colspan": 1
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"printElementType": {
|
||||
"title": "表格",
|
||||
"type": "table",
|
||||
"editable": true,
|
||||
"columnDisplayEditable": true,
|
||||
"columnDisplayIndexEditable": true,
|
||||
"columnTitleEditable": true,
|
||||
"columnResizable": true,
|
||||
"columnAlignEditable": true,
|
||||
"isEnableEditField": true,
|
||||
"isEnableContextMenu": true,
|
||||
"isEnableInsertRow": true,
|
||||
"isEnableDeleteRow": true,
|
||||
"isEnableInsertColumn": true,
|
||||
"isEnableDeleteColumn": true,
|
||||
"isEnableMergeCell": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"options": {
|
||||
"left": 480,
|
||||
"top": 130.5,
|
||||
"height": 12,
|
||||
"width": 109.5,
|
||||
"title": "盈亏合计",
|
||||
"field": "totalAmount",
|
||||
"coordinateSync": false,
|
||||
"widthHeightSync": false,
|
||||
"qrCodeLevel": 0,
|
||||
"formatter": "function(title,value,options,templateData,target,paperNo){\n return value + ' 元'\n}"
|
||||
},
|
||||
"printElementType": {
|
||||
"title": "文本",
|
||||
"type": "text"
|
||||
}
|
||||
},
|
||||
{
|
||||
"options": {
|
||||
"left": 261.24609375,
|
||||
"top": 130.74609375,
|
||||
"height": 12,
|
||||
"width": 109.5,
|
||||
"title": "制单人",
|
||||
"field": "name",
|
||||
"coordinateSync": false,
|
||||
"widthHeightSync": false,
|
||||
"qrCodeLevel": 0
|
||||
},
|
||||
"printElementType": {
|
||||
"title": "文本",
|
||||
"type": "text"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -35,6 +35,7 @@
|
||||
<el-button type="primary" plain icon="Plus" @click="handleSave">批量保存</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-button type="primary" plain icon="Printer" @click="handlePrint"> 打印单据 </el-button>
|
||||
<el-form
|
||||
:model="receiptHeaderForm"
|
||||
ref="receiptHeaderRef"
|
||||
@@ -633,6 +634,8 @@ import { useRoute } from 'vue-router';
|
||||
import { ref, reactive, watch, onMounted, onUnmounted, toRefs, defineEmits, getCurrentInstance } from 'vue';
|
||||
import { useStore } from '@/store/store';
|
||||
import useTagsViewStore from '@/store/modules/tagsView';
|
||||
import templateJson from './components/template';
|
||||
import { hiprint } from 'vue-plugin-hiprint';
|
||||
import { debounce } from 'lodash-es';
|
||||
const tagsViewStore = useTagsViewStore();
|
||||
const store = useStore();
|
||||
@@ -1367,6 +1370,39 @@ function handleLocationClick(purposeLocationId, itemId, index, lotNumber) {
|
||||
});
|
||||
}
|
||||
|
||||
function handlePrint() {
|
||||
const result = [];
|
||||
// let supplierName = supplierListOptions.value.filter((item) => {
|
||||
// return item.value == receiptHeaderForm.supplierId;
|
||||
// })[0].label;
|
||||
// const totalAmount = form.purchaseinventoryList.reduce((accumulator, currentRow) => {
|
||||
// return accumulator + (Number(currentRow.totalPrice) || 0);
|
||||
// }, 0);
|
||||
form.purchaseinventoryList = form.purchaseinventoryList.map((item) => {
|
||||
return {
|
||||
...item,
|
||||
price: Number(item.price).toFixed(2),
|
||||
profitAmount: Number(item.profitAmount).toFixed(2),
|
||||
reasonCode_dictText: profit_reason.value.filter((k) => k.value == item.reasonCode)[0]?.label,
|
||||
};
|
||||
});
|
||||
result.push({
|
||||
// supplierName: supplierName,
|
||||
purposeLocationName: form.purchaseinventoryList[0].purposeLocationName,
|
||||
name: userStore.name,
|
||||
totalAmount: totalAmount.value.toFixed(2),
|
||||
...receiptHeaderForm,
|
||||
purchaseinventoryList: form.purchaseinventoryList,
|
||||
});
|
||||
console.log(result, '345678987654');
|
||||
const printElements = templateJson;
|
||||
var hiprintTemplate = new hiprint.PrintTemplate({ template: printElements }); // 定义模板
|
||||
hiprintTemplate.print2(result, {
|
||||
printer: 'EPSON LQ-80KFII',
|
||||
title: '打印标题',
|
||||
}); //开始打印
|
||||
}
|
||||
|
||||
// 单位处理
|
||||
function handleUnitCodeChange(row, index, value) {
|
||||
// 防止点击和已选一样的问题
|
||||
@@ -1677,8 +1713,8 @@ function getMaxCounts(row, index, counts) {
|
||||
}
|
||||
|
||||
function handleSave(row, index) {
|
||||
if (form.purchaseinventoryList.length === 0) {
|
||||
proxy.$message.success('保存成功!');
|
||||
if (form.purchaseinventoryList.length === 0) {
|
||||
proxy.$message.success('保存成功!');
|
||||
return;
|
||||
}
|
||||
rowList.value = [];
|
||||
@@ -2504,7 +2540,7 @@ function totalSourceQuantityChange(rowData, index, value) {
|
||||
// 计算盈亏金额
|
||||
if (rowData.price > 0) {
|
||||
form.purchaseinventoryList[index].lllstatus = true;
|
||||
const profitAmount =
|
||||
const profitAmount =
|
||||
// 修复:正确计算盈亏金额 - 实盘数量减去盘前库存整数部分
|
||||
rowData.price * (totalQuantityNum - parseFloat(zhengshu)) +
|
||||
(rowData.price / partPercent) * parseFloat(xiaoshuzhi);
|
||||
@@ -2529,7 +2565,7 @@ function totalSourceQuantityChange(rowData, index, value) {
|
||||
// 确保在所有情况下都正确计算盈亏金额
|
||||
if (rowData.price > 0 && !form.purchaseinventoryList[index].lllstatus) {
|
||||
// 处理字符串类型的itemQuantity
|
||||
const itemQuantityNum =
|
||||
const itemQuantityNum =
|
||||
typeof form.purchaseinventoryList[index].itemQuantity === 'string'
|
||||
? parseFloat(form.purchaseinventoryList[index].itemQuantity) || 0
|
||||
: form.purchaseinventoryList[index].itemQuantity || 0;
|
||||
|
||||
@@ -0,0 +1,129 @@
|
||||
import request from '@/utils/request';
|
||||
import {parseStrEmpty} from '@/utils/openhis';
|
||||
|
||||
// 查询盘点列表
|
||||
export function getStockTakeList (query) {
|
||||
return request ({
|
||||
url: '/nurse-station/orgdevice-stocktake/summary-from',
|
||||
method: 'get',
|
||||
params: query,
|
||||
});
|
||||
}
|
||||
|
||||
// 盘点编辑页列表
|
||||
export function getstocktakingDetail (busNo) {
|
||||
return request ({
|
||||
url: '/inventory-manage/stocktaking/stocktaking-receipt',
|
||||
method: 'get',
|
||||
params: {busNo}, // 确保参数正确传递
|
||||
});
|
||||
}
|
||||
|
||||
// 添加/编辑入库单据
|
||||
export function addProductStocktaking (data) {
|
||||
return request ({
|
||||
url: '/inventory-manage/stocktaking/product-stocktaking',
|
||||
method: 'put',
|
||||
data: data,
|
||||
});
|
||||
}
|
||||
|
||||
// 查询盘点列表初始化查询区数据
|
||||
export function getInit () {
|
||||
return request ({
|
||||
url: '/inventory-manage/stocktaking/init',
|
||||
method: 'get',
|
||||
});
|
||||
}
|
||||
|
||||
// 查询盘点详情初始化查询区数据
|
||||
export function getDetailInit () {
|
||||
return request ({
|
||||
url: '/inventory-manage/stocktaking/detail-init',
|
||||
method: 'get',
|
||||
});
|
||||
}
|
||||
|
||||
// 生成批量盘点
|
||||
export function getStocktakingReceiptBatch () {
|
||||
return request ({
|
||||
url: '/inventory-manage/stocktaking/stocktaking-receipt-batch',
|
||||
method: 'get',
|
||||
});
|
||||
}
|
||||
//保存批量盘点
|
||||
export function addBatch (data) {
|
||||
return request ({
|
||||
url: '/inventory-manage/stocktaking/stocktaking-receipt-addBatch',
|
||||
method: 'put',
|
||||
data: data,
|
||||
});
|
||||
}
|
||||
|
||||
// 删除单据
|
||||
export function delProductStocktaking (param) {
|
||||
return request ({
|
||||
url: '/inventory-manage/stocktaking/product-stocktaking?supplyRequestIds=' +
|
||||
param,
|
||||
method: 'delete',
|
||||
});
|
||||
}
|
||||
|
||||
// 提交审批
|
||||
export function submitApproval (busNo) {
|
||||
return request ({
|
||||
url: '/inventory-manage/stocktaking/submit-approval',
|
||||
method: 'put',
|
||||
data: busNo,
|
||||
});
|
||||
}
|
||||
|
||||
// 撤回审批
|
||||
export function withdrawApproval (busNo) {
|
||||
return request ({
|
||||
url: '/inventory-manage/stocktaking/withdraw-approval',
|
||||
method: 'put',
|
||||
data: busNo,
|
||||
});
|
||||
}
|
||||
|
||||
// 获取药品目录
|
||||
export function getMedicineList (queryParams) {
|
||||
return request ({
|
||||
url: '/app-common/inventory-item',
|
||||
method: 'get',
|
||||
params: queryParams,
|
||||
});
|
||||
}
|
||||
|
||||
// 获取药品目录
|
||||
export function getCount (queryParams) {
|
||||
return request ({
|
||||
url: '/inventory-manage/purchase/inventory-item-info',
|
||||
method: 'get',
|
||||
params: queryParams,
|
||||
});
|
||||
}
|
||||
|
||||
// 获取药房列表
|
||||
export function getPharmacyList () {
|
||||
return request ({
|
||||
url: '/app-common/pharmacy-list',
|
||||
method: 'get',
|
||||
});
|
||||
}
|
||||
|
||||
// 获取药库列表
|
||||
export function getDispensaryList () {
|
||||
return request ({
|
||||
url: '/app-common/cabinet-list',
|
||||
method: 'get',
|
||||
});
|
||||
}
|
||||
|
||||
export function stocktakingReceiptAuto () {
|
||||
return request ({
|
||||
url: '/inventory-manage/stocktaking/stocktaking-receipt-auto',
|
||||
method: 'get',
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,119 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-table
|
||||
ref="medicineRef"
|
||||
height="400"
|
||||
:data="medicineList"
|
||||
@cell-click="clickRow"
|
||||
>
|
||||
<el-table-column
|
||||
label="项目名称"
|
||||
align="center"
|
||||
prop="name"
|
||||
width="300"
|
||||
/>
|
||||
<el-table-column
|
||||
label="项目类型"
|
||||
align="center"
|
||||
prop="itemType_enumText"
|
||||
/>
|
||||
<el-table-column
|
||||
label="包装单位"
|
||||
align="center"
|
||||
prop="unitCode_dictText"
|
||||
/>
|
||||
<el-table-column
|
||||
label="最小单位"
|
||||
align="center"
|
||||
prop="minUnitCode_dictText"
|
||||
/>
|
||||
<el-table-column label="规格" align="center" prop="volume" />
|
||||
<!-- <el-table-column label="用法" align="center" prop="methodCode_dictText" />
|
||||
<el-table-column label="单次剂量" align="center" prop="dose" />
|
||||
<el-table-column
|
||||
label="剂量单位"
|
||||
align="center"
|
||||
prop="doseUnitCode_dictText"
|
||||
/> -->
|
||||
<el-table-column label="生产厂家" align="center" prop="manufacturer" />
|
||||
<el-table-column
|
||||
label="编码"
|
||||
align="center"
|
||||
prop="ybNo"
|
||||
/>
|
||||
</el-table>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { getMedicineList } from "./api";
|
||||
import { watch } from "vue";
|
||||
import { throttle } from "lodash-es";
|
||||
|
||||
const props = defineProps({
|
||||
searchKey: {
|
||||
type: String,
|
||||
default: "",
|
||||
},
|
||||
itemType: {
|
||||
type: String,
|
||||
default: "",
|
||||
},
|
||||
purposeLocationId:{
|
||||
type: String,
|
||||
default: "",
|
||||
},
|
||||
purposeLocationId1:{
|
||||
type: String,
|
||||
default: "",
|
||||
},
|
||||
});
|
||||
const emit = defineEmits(["selectRow"]);
|
||||
const queryParams = ref({
|
||||
itemType: props.itemType,
|
||||
orgLocationId:props.purposeLocationId,
|
||||
orgLocationId1:props.purposeLocationId1,
|
||||
purchaseFlag:0
|
||||
});
|
||||
const medicineList = ref([]);
|
||||
|
||||
// 节流函数
|
||||
const throttledGetList = throttle(
|
||||
() => {
|
||||
getList();
|
||||
},
|
||||
300,
|
||||
{ leading: true, trailing: true }
|
||||
);
|
||||
|
||||
watch(
|
||||
() => props,
|
||||
(newValue) => {
|
||||
queryParams.value.searchKey = newValue.searchKey
|
||||
queryParams.value.itemType = newValue.itemType
|
||||
queryParams.value.orgLocationId = newValue.sourceLocationId
|
||||
queryParams.value.orgLocationId1 = newValue.sourceLocationId1
|
||||
throttledGetList();
|
||||
},
|
||||
{ immdiate: true, deep: true }
|
||||
);
|
||||
|
||||
getList();
|
||||
function getList() {
|
||||
if(route.query.supplyBusNo){ // 编辑
|
||||
queryParams.value.itemType = queryParams.value.itemType;
|
||||
queryParams.value.orgLocationId = queryParams.value.orgLocationId1
|
||||
}
|
||||
delete queryParams.value.orgLocationId1
|
||||
getMedicineList(queryParams.value).then((res) => {
|
||||
medicineList.value = res.data;
|
||||
});
|
||||
}
|
||||
|
||||
function clickRow(row) {
|
||||
emit("selectRow", row);
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
||||
@@ -0,0 +1,178 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch">
|
||||
<el-form-item label="项目名称" prop="name">
|
||||
<el-input
|
||||
v-model="queryParams.name"
|
||||
placeholder="请输入项目名称"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="仓库类型" prop="purposeTypeEnum">
|
||||
<el-select
|
||||
v-model="queryParams.purposeTypeEnum"
|
||||
placeholder="请选择"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 200px"
|
||||
@change="handleChangePurposeTypeEnum"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in warehous_type"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="盘点仓库" prop="purposeLocationId">
|
||||
<el-select
|
||||
v-model="queryParams.purposeLocationId"
|
||||
placeholder="请选择"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 200px"
|
||||
@change="handleCabinetChange(receiptHeaderForm.purposeLocationId)"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in [
|
||||
{ id: 1, name: '仓库1' },
|
||||
{ id: 2, name: '仓库2' },
|
||||
]"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="货位" prop="purposeLocation">
|
||||
<el-select
|
||||
v-model="queryParams.purposeLocation"
|
||||
placeholder="请选择"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 200px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in [
|
||||
{ id: 1, name: '货位1' },
|
||||
{ id: 2, name: '货位2' },
|
||||
]"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="dataList"
|
||||
@selection-change="handleSelectionChange"
|
||||
height="calc(100vh - 250px)"
|
||||
>
|
||||
<el-table-column
|
||||
label="项目"
|
||||
align="center"
|
||||
key="name"
|
||||
prop="name"
|
||||
width="200"
|
||||
fixed
|
||||
></el-table-column>
|
||||
<el-table-column label="规格" align="center" prop="totalVolume" />
|
||||
<el-table-column label="厂家/产地" align="center" prop="manufacturer" show-overflow-tooltip />
|
||||
<el-table-column label="产品批号" align="center" prop="lotNumber" />
|
||||
<el-table-column label="单价" align="center" key="unit" prop="unitPrice" />
|
||||
<el-table-column label="发放数量" align="center" prop="dispenseQuantity" />
|
||||
<el-table-column label="库存数量" align="center" prop="quantity" />
|
||||
<el-table-column label="盈亏数量" align="center" prop="itemQuantity">
|
||||
<template #default="scope">
|
||||
<el-input v-model="scope.row.itemQuantity" :input-style="{ textAlign: 'center' }" type="number" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="单位" align="center" prop="unitCode_dictText" />
|
||||
<el-table-column label="最小单位" align="center" prop="minUnitCode_dictText" />
|
||||
<el-table-column label="拆零比" align="center" prop="partPercent" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="Check"
|
||||
@click="handleSave(scope.row)"
|
||||
v-hasPermi="['chkstock:partDeptDevice:edit']"
|
||||
>保存
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import { ref, reactive, toRaw, computed, watch, onMounted } from 'vue';
|
||||
const { proxy } = getCurrentInstance();
|
||||
import { getStockTakeList } from './components/api.js';
|
||||
const { warehous_type } = proxy.useDict('warehous_type');
|
||||
const dataList = ref([]);
|
||||
const queryParams = reactive({
|
||||
// pageNo: 1,
|
||||
// pageSize: 10,
|
||||
});
|
||||
const loading = ref(false);
|
||||
const showSearch = ref(true);
|
||||
const total = ref(0);
|
||||
// 获取列表
|
||||
const getList = () => {
|
||||
loading.value = true;
|
||||
getStockTakeList(queryParams.value).then((res) => {
|
||||
loading.value = false;
|
||||
dataList.value = res.data;
|
||||
total.value = res.data.length;
|
||||
});
|
||||
};
|
||||
// 搜索
|
||||
const handleQuery = () => {
|
||||
getList();
|
||||
};
|
||||
// 重置
|
||||
const resetQuery = () => {
|
||||
queryParams.value = {};
|
||||
handleQuery();
|
||||
};
|
||||
// 重置
|
||||
const reset = () => {};
|
||||
|
||||
// 多选
|
||||
const handleSelectionChange = (selection) => {};
|
||||
// 保存
|
||||
const handleSave = (row) => {
|
||||
console.log(row);
|
||||
// 校验盈亏数量
|
||||
if (row.itemQuantity == '' || row.itemQuantity == null) {
|
||||
proxy.$modal.msgWarning('盈亏数量不能为空');
|
||||
return;
|
||||
}
|
||||
proxy.$modal
|
||||
.confirm('确定保存吗?', '保存', {
|
||||
confirmButtonText: '保存',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
})
|
||||
.then(() => {
|
||||
proxy.$modal.msgSuccess('保存成功');
|
||||
getList();
|
||||
})
|
||||
.catch(() => {});
|
||||
};
|
||||
const handleChangePurposeTypeEnum = (val) => {};
|
||||
const handleCabinetChange = (val) => {};
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user