前端最新版本同步
This commit is contained in:
@@ -2,12 +2,7 @@
|
||||
<div class="app-container">
|
||||
<el-row :gutter="10" class="mb8" v-if="viewStatus">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
v-if="viewStatus != 'view'"
|
||||
plain
|
||||
type="primary"
|
||||
icon="Edit"
|
||||
@click="handelApply"
|
||||
<el-button v-if="viewStatus != 'view'" plain type="primary" icon="Edit" @click="handelApply"
|
||||
>审批通过</el-button
|
||||
>
|
||||
</el-col>
|
||||
@@ -26,11 +21,6 @@
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="submitAudit">提交审核</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Printer" :disabled="multiple" @click="handleDelete">
|
||||
打印
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="EditPen" @click="handleTotalAmount">
|
||||
计算金额
|
||||
@@ -40,7 +30,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"
|
||||
@@ -63,7 +53,7 @@
|
||||
placeholder=""
|
||||
clearable
|
||||
filterable
|
||||
:disabled ="viewStatus=='view'"
|
||||
:disabled="viewStatus == 'view'"
|
||||
style="width: 150px"
|
||||
>
|
||||
<el-option
|
||||
@@ -79,7 +69,7 @@
|
||||
v-model="receiptHeaderForm.occurrenceTime"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
type="datetime"
|
||||
:disabled ="viewStatus=='view'"
|
||||
:disabled="viewStatus == 'view'"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="供应商:" prop="supplierId">
|
||||
@@ -89,7 +79,7 @@
|
||||
clearable
|
||||
filterable
|
||||
style="width: 150px"
|
||||
:disabled ="viewStatus=='view'"
|
||||
:disabled="viewStatus == 'view'"
|
||||
>
|
||||
<el-option
|
||||
v-for="supplier in supplierListOptions"
|
||||
@@ -161,7 +151,7 @@
|
||||
<!-- @cell-mouse-enter="handleMouseEnter" -->
|
||||
<!-- v-click-outside-row="handleClickOutside" @row-click="handleRowClick" 点击行以外的部分自动保存 -->
|
||||
<el-table
|
||||
row-key="id"
|
||||
row-key="rowKey"
|
||||
v-loading="loading"
|
||||
:data="form.purchaseinventoryList"
|
||||
@selection-change="handleSelectionChange"
|
||||
@@ -174,9 +164,19 @@
|
||||
<el-form-item
|
||||
:prop="`purchaseinventoryList.${scope.$index}.name`"
|
||||
:rules="tableRules.name"
|
||||
>
|
||||
<el-input v-if="viewStatus=='view'" v-model="scope.row.name" placeholder="" disabled />
|
||||
<PopoverList v-else @search="handleSearch" :width="1000" :modelValue="scope.row.name">
|
||||
>
|
||||
<el-input
|
||||
v-if="viewStatus == 'view'"
|
||||
v-model="scope.row.name"
|
||||
placeholder=""
|
||||
disabled
|
||||
/>
|
||||
<PopoverList
|
||||
v-else
|
||||
@search="handleSearch"
|
||||
:width="1000"
|
||||
:modelValue="scope.row.name"
|
||||
>
|
||||
<template #popover-content="{}">
|
||||
<MedicineList
|
||||
@selectRow="(row) => selectRow(row, scope.$index)"
|
||||
@@ -240,7 +240,7 @@
|
||||
placeholder="请选择仓库"
|
||||
:class="{ 'error-border': scope.row.error }"
|
||||
clearable
|
||||
:disabled ="viewStatus=='view'"
|
||||
:disabled="viewStatus == 'view'"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in locationList"
|
||||
@@ -268,7 +268,7 @@
|
||||
>
|
||||
<div class="select_wrapper_div">
|
||||
<el-input
|
||||
:disabled ="viewStatus=='view'"
|
||||
:disabled="viewStatus == 'view'"
|
||||
v-model="scope.row.itemQuantity"
|
||||
placeholder=""
|
||||
@blur="handleTotalPrice(scope.$index)"
|
||||
@@ -298,7 +298,7 @@
|
||||
placeholder=" "
|
||||
:class="{ 'error-border': scope.row.error }"
|
||||
:clearable="false"
|
||||
:disabled ="viewStatus=='view'"
|
||||
:disabled="viewStatus == 'view'"
|
||||
@change="(value) => handleUnitCodeChange(scope.row, scope.$index, value)"
|
||||
>
|
||||
<template v-if="scope.row.unitList && scope.row.partPercent > 1">
|
||||
@@ -336,22 +336,24 @@
|
||||
width="130"
|
||||
>
|
||||
<template #default="scope">
|
||||
|
||||
<el-tooltip :content="formatContent(scope.row.traceNo)" placement="top"
|
||||
popper-class="custom-tooltip">
|
||||
<el-tooltip
|
||||
:content="formatContent(scope.row.traceNo)"
|
||||
placement="top"
|
||||
popper-class="custom-tooltip"
|
||||
>
|
||||
<el-form-item
|
||||
:prop="`purchaseinventoryList.${scope.$index}.traceNo`"
|
||||
:rules="tableRules.traceNo"
|
||||
>
|
||||
<el-input
|
||||
:disabled ="viewStatus=='view'"
|
||||
:disabled="viewStatus == 'view'"
|
||||
v-model="scope.row.traceNo"
|
||||
@change="(value) => handleTraceNoInput(value, scope.row)"
|
||||
placeholder=""
|
||||
:id="'traceNo' + `${scope.$index}`"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-tooltip>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
@@ -366,7 +368,11 @@
|
||||
:prop="`purchaseinventoryList.${scope.$index}.packagingLevels`"
|
||||
:rules="tableRules.packagingLevels"
|
||||
>
|
||||
<el-input v-model="scope.row.packagingLevels" placeholder="" :disabled ="viewStatus=='view'"/>
|
||||
<el-input
|
||||
v-model="scope.row.packagingLevels"
|
||||
placeholder=""
|
||||
:disabled="viewStatus == 'view'"
|
||||
/>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -388,7 +394,7 @@
|
||||
placeholder=""
|
||||
@blur="handleTotalPrice(scope.$index)"
|
||||
:class="{ 'error-border': scope.row.error }"
|
||||
:disabled ="viewStatus=='view'"
|
||||
:disabled="viewStatus == 'view'"
|
||||
>
|
||||
<template #suffix>元</template>
|
||||
</el-input>
|
||||
@@ -423,7 +429,12 @@
|
||||
:prop="`purchaseinventoryList.${scope.$index}.lotNumber`"
|
||||
:rules="tableRules.lotNumber"
|
||||
>
|
||||
<el-input v-model="scope.row.lotNumber" placeholder="" maxlength="100" :disabled ="viewStatus=='view'" />
|
||||
<el-input
|
||||
v-model="scope.row.lotNumber"
|
||||
placeholder=""
|
||||
maxlength="100"
|
||||
:disabled="viewStatus == 'view'"
|
||||
/>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -445,7 +456,7 @@
|
||||
placeholder="选择日期"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
:disabled ="viewStatus=='view'"
|
||||
:disabled="viewStatus == 'view'"
|
||||
@change="changeValStart($event, scope.$index)"
|
||||
/>
|
||||
</el-form-item>
|
||||
@@ -464,7 +475,7 @@
|
||||
:rules="tableRules.endTime"
|
||||
>
|
||||
<el-date-picker
|
||||
:disabled ="viewStatus=='view'"
|
||||
:disabled="viewStatus == 'view'"
|
||||
v-model="scope.row.endTime"
|
||||
type="date"
|
||||
placeholder="选择日期"
|
||||
@@ -487,7 +498,11 @@
|
||||
:prop="`purchaseinventoryList.${scope.$index}.invoiceNo`"
|
||||
:rules="tableRules.invoiceNo"
|
||||
>
|
||||
<el-input v-model="scope.row.invoiceNo" placeholder="" :disabled ="viewStatus=='view'"/>
|
||||
<el-input
|
||||
v-model="scope.row.invoiceNo"
|
||||
placeholder=""
|
||||
:disabled="viewStatus == 'view'"
|
||||
/>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -498,7 +513,11 @@
|
||||
:prop="`purchaseinventoryList.${scope.$index}.remake`"
|
||||
:rules="tableRules.remake"
|
||||
>
|
||||
<el-input v-model="scope.row.remake" placeholder="" :disabled ="viewStatus=='view'" />
|
||||
<el-input
|
||||
v-model="scope.row.remake"
|
||||
placeholder=""
|
||||
:disabled="viewStatus == 'view'"
|
||||
/>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -520,7 +539,7 @@
|
||||
placeholder="请选择货位"
|
||||
:class="{ 'error-border': scope.row.error }"
|
||||
clearable
|
||||
:disabled ="viewStatus=='view'"
|
||||
:disabled="viewStatus == 'view'"
|
||||
>
|
||||
</el-select>
|
||||
</div>
|
||||
@@ -591,7 +610,13 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
<!-- </el-dialog> -->
|
||||
<TraceNoDialog :ypName="ypName" :rowData="rowData" :openDialog="openTraceNoDialog" @submit="submit" @cancel="openTraceNoDialog = false"/>
|
||||
<TraceNoDialog
|
||||
:ypName="ypName"
|
||||
:rowData="rowData"
|
||||
:openDialog="openTraceNoDialog"
|
||||
@submit="submit"
|
||||
@cancel="openTraceNoDialog = false"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -612,7 +637,7 @@ import {
|
||||
const route = useRoute();
|
||||
import PopoverList from '@/components/OpenHis/popoverList/index.vue';
|
||||
import MedicineList from './components/medicineList.vue';
|
||||
import TraceNoDialog from '@/components/OpenHis/TraceNoDialog/index.vue'
|
||||
import TraceNoDialog from '@/components/OpenHis/TraceNoDialog/index.vue';
|
||||
import { formatDate, formatDateymd } from '@/utils/index';
|
||||
import { useStore } from '@/store/store';
|
||||
import useUserStore from '@/store/modules/user';
|
||||
@@ -620,11 +645,14 @@ import { nextTick, ref, watch } from 'vue';
|
||||
import useTagsViewStore from '@/store/modules/tagsView';
|
||||
import _, { isEqual } from 'lodash';
|
||||
import { debounce } from 'lodash-es';
|
||||
import templateJson from './components/templateJson.json';
|
||||
import { hiprint } from 'vue-plugin-hiprint';
|
||||
|
||||
const router = useRouter();
|
||||
const tagsViewStore = useTagsViewStore();
|
||||
const userUserStore = useUserStore();
|
||||
const store = useStore();
|
||||
const rowData = ref({})
|
||||
const rowData = ref({});
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
const { warehous_type, category_code, service_type_code, specialty_code, purchase_type } =
|
||||
@@ -649,8 +677,8 @@ const total = ref(0);
|
||||
const title = ref('');
|
||||
const visible = ref(false);
|
||||
const row = ref({});
|
||||
const openTraceNoDialog = ref(false)
|
||||
const ypName = ref("");
|
||||
const openTraceNoDialog = ref(false);
|
||||
const ypName = ref('');
|
||||
const rowIndex = ref(-1);
|
||||
const totalAmount = ref(0);
|
||||
const editData = ref({});
|
||||
@@ -781,6 +809,7 @@ function addNewRow() {
|
||||
// return;
|
||||
// }
|
||||
const newRow = {
|
||||
rowKey: Date.now(),
|
||||
id: '',
|
||||
itemTable: '',
|
||||
itemQuantity: '',
|
||||
@@ -940,30 +969,35 @@ function saveRow(row, index) {
|
||||
});
|
||||
}
|
||||
|
||||
function handleScan(row,index){
|
||||
if(row.purposeLocationId && row.lotNumber) {
|
||||
rowData.value = row
|
||||
rowData.value.locationId = row.purposeLocationId
|
||||
rowData.value.itemType = receiptHeaderForm.medicationType
|
||||
ypName.value = row.name
|
||||
function handleScan(row, index) {
|
||||
if (row.purposeLocationId && row.lotNumber) {
|
||||
rowData.value = row;
|
||||
rowData.value.locationId = row.purposeLocationId;
|
||||
rowData.value.itemType = receiptHeaderForm.medicationType;
|
||||
ypName.value = row.name;
|
||||
openTraceNoDialog.value = true;
|
||||
currentIndex.value = index
|
||||
}else {
|
||||
proxy.$message.warning('请先选择仓库和产品批号!')
|
||||
currentIndex.value = index;
|
||||
} else {
|
||||
proxy.$message.warning('请先选择仓库和产品批号!');
|
||||
}
|
||||
}
|
||||
function submit(value){
|
||||
form.purchaseinventoryList[currentIndex.value].traceNo = value;
|
||||
function submit(value) {
|
||||
if (form.purchaseinventoryList[currentIndex.value].traceNo) {
|
||||
form.purchaseinventoryList[currentIndex.value].traceNo =
|
||||
form.purchaseinventoryList[currentIndex.value].traceNo + ',' + value;
|
||||
} else {
|
||||
form.purchaseinventoryList[currentIndex.value].traceNo = value;
|
||||
}
|
||||
openTraceNoDialog.value = false;
|
||||
}
|
||||
|
||||
function formatContent(value){
|
||||
let content = ''
|
||||
if(value){
|
||||
function formatContent(value) {
|
||||
let content = '';
|
||||
if (value) {
|
||||
value.split(',').forEach((item, index) => {
|
||||
content += `[${(index + 1)}] ${item}\n`
|
||||
})
|
||||
return content
|
||||
content += `[${index + 1}] ${item}\n`;
|
||||
});
|
||||
return content;
|
||||
}
|
||||
}
|
||||
// 药品列表搜索
|
||||
@@ -977,6 +1011,7 @@ function selectRow(rowValue, index) {
|
||||
form.purchaseinventoryList[index] = { id: form.purchaseinventoryList[index].id };
|
||||
price.value = 0;
|
||||
rowIndex.value = index;
|
||||
form.purchaseinventoryList[index].rowKey = Date.now();
|
||||
form.purchaseinventoryList[index].itemId = rowValue.definitionId;
|
||||
form.purchaseinventoryList[index].name = rowValue.name;
|
||||
form.purchaseinventoryList[index].volume = rowValue.volume;
|
||||
@@ -1265,6 +1300,29 @@ function handleSelectionChange(selection) {
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
|
||||
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);
|
||||
result.push({
|
||||
supplierName: supplierName,
|
||||
totalAmount: totalAmount,
|
||||
...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 deleteSelectedRows() {
|
||||
let length = selectedRows.value.length;
|
||||
let ids = [];
|
||||
@@ -1372,9 +1430,10 @@ function edit() {
|
||||
receiptHeaderForm.supplierId = editData.value.editRow.supplierId;
|
||||
receiptHeaderForm.practitionerId = editData.value.editRow.practitionerId;
|
||||
console.log(editData.value.editRow, editData.value, 'editData.value.editRow');
|
||||
receiptHeaderForm.occurrenceTime = editData.value.editRow.occurrenceTime
|
||||
? formatDate(editData.value.editRow.occurrenceTime)
|
||||
receiptHeaderForm.occurrenceTime = editData.value.item[0].occurrenceTime
|
||||
? formatDate(editData.value.item[0].occurrenceTime)
|
||||
: formatDate(new Date());
|
||||
console.log(editData.value.item[0].occurrenceTime);
|
||||
console.log(
|
||||
editData.value.editRow.purposeTypeEnum,
|
||||
editData.value,
|
||||
|
||||
Reference in New Issue
Block a user