提交merge1.3

This commit is contained in:
2025-12-27 15:30:25 +08:00
parent 8c607c8749
commit 088861f66e
1245 changed files with 220442 additions and 77616 deletions

View File

@@ -39,11 +39,17 @@
>
</el-col>
</el-row>
<<<<<<< HEAD
<el-button type="primary" icon="View" @click="handlePrintPreview">
预览单据
</el-button>
<el-button type="success" plain icon="Printer" @click="handlePrint">
打印单据
=======
<el-button type="primary" plain icon="Printer" @click="handlePrint"> 打印单据 </el-button>
<el-button type="primary" plain @click="handleExport" v-if="viewStatus == 'view'">
导出
>>>>>>> v1.3
</el-button>
<el-form
:model="receiptHeaderForm"
@@ -254,11 +260,15 @@
:prop="`purchaseinventoryList.${scope.$index}.manufacturerText`"
:rules="tableRules.manufacturerText"
>
<<<<<<< HEAD
<el-input
v-model="scope.row.manufacturerText"
placeholder=""
disabled
/>
=======
<el-input v-model="scope.row.manufacturerText" placeholder="" disabled />
>>>>>>> v1.3
</el-form-item>
</template>
</el-table-column>
@@ -782,6 +792,7 @@ const data = reactive({
medicationType: [{ required: true, message: "请选择药品类型", trigger: "change" }],
},
tableRules: {
<<<<<<< HEAD
itemId: [{ required: true, message: "项目不能为空", trigger: "blur" }],
statusEnum_enumText: [{ required: true, message: "规格不能为空", trigger: "blur" }],
unitCode: [{ required: true, message: "计量单位不能为空", trigger: "blur" }],
@@ -792,6 +803,18 @@ const data = reactive({
price: [{ required: true, message: "单价不能为空", trigger: "blur" }],
invoiceNo: [{ required: true, message: "发票号不能为空", trigger: "blur" }],
totalPrice: [{ required: true, message: "总价不能为空", trigger: "blur" }],
=======
itemId: [{ required: true, message: '项目不能为空', trigger: 'blur' }],
statusEnum_enumText: [{ required: true, message: '规格不能为空', trigger: 'blur' }],
unitCode: [{ required: true, message: '计量单位不能为空', trigger: 'blur' }],
purposeLocationId: [{ required: true, message: '目的仓库不能为空', trigger: 'blur' }],
lotNumber: [{ required: true, message: '产品批号不能为空', trigger: 'change' }],
startTime: [{ required: true, message: '开始时间不能为空', trigger: 'blur' }],
endTime: [{ required: true, message: '结束时间不能为空', trigger: 'blur' }],
price: [{ required: true, message: '单价不能为空', trigger: 'blur' }],
invoiceNo: [{ required: true, message: '发票号不能为空', trigger: 'blur' }],
totalPrice: [{ required: true, message: '总价不能为空', trigger: 'blur' }],
>>>>>>> v1.3
},
});
@@ -882,16 +905,26 @@ onUnmounted(() => {
function addNewRow() {
// 先校验表头表单
<<<<<<< HEAD
proxy.$refs["receiptHeaderRef"].validate((valid) => {
=======
proxy.$refs['receiptHeaderRef'].validate((valid) => {
>>>>>>> v1.3
if (valid) {
// 检查表格中是否有未保存的行
const unsavedRows = form.purchaseinventoryList.filter((row) => !row.isSave);
if (unsavedRows.length > 0) {
// 校验表格中未保存的行
<<<<<<< HEAD
proxy.$refs["formRef"].validate((tableValid) => {
if (!tableValid) {
proxy.$message.warning("请先完善当前行的必填信息后再添加新行");
=======
proxy.$refs['formRef'].validate((tableValid) => {
if (!tableValid) {
proxy.$message.warning('请先完善当前行的必填信息后再添加新行');
>>>>>>> v1.3
return;
}
@@ -903,6 +936,7 @@ function addNewRow() {
// 检查必填字段
if (!row.itemId || !row.name) {
<<<<<<< HEAD
errors.push("项目");
}
if (!row.volume) {
@@ -934,12 +968,49 @@ function addNewRow() {
}
if (!row.totalPrice || row.totalPrice === "" || row.totalPrice === 0) {
errors.push("合计金额");
=======
errors.push('项目');
}
if (!row.volume) {
errors.push('规格');
}
if (!row.unitCode) {
errors.push('计量单位');
}
if (!row.purposeLocationId) {
errors.push('仓库');
}
if (!row.itemQuantity || row.itemQuantity === '' || row.itemQuantity === 0) {
errors.push('采购数量');
}
if (!row.lotNumber) {
errors.push('产品批号');
}
if (!row.startTime) {
errors.push('生产日期');
}
if (!row.endTime) {
errors.push('有效期至');
}
if (!row.price || row.price === '' || row.price === 0) {
errors.push('采购单价');
}
if (!row.invoiceNo || row.invoiceNo === '') {
errors.push('发票号');
}
if (!row.totalPrice || row.totalPrice === '' || row.totalPrice === 0) {
errors.push('合计金额');
>>>>>>> v1.3
}
if (errors.length > 0) {
invalidRows.push({
rowIndex: rowIndex + 1,
<<<<<<< HEAD
errors: errors.join("、"),
=======
errors: errors.join('、'),
>>>>>>> v1.3
});
}
});
@@ -947,14 +1018,20 @@ function addNewRow() {
if (invalidRows.length > 0) {
const errorMsg = invalidRows
.map((item) => `${item.rowIndex}行缺少:${item.errors}`)
<<<<<<< HEAD
.join("");
proxy.$message.warning(errorMsg + ",请完善后再添加新行");
=======
.join('');
proxy.$message.warning(errorMsg + ',请完善后再添加新行');
>>>>>>> v1.3
return;
}
// 所有校验通过,允许新增
const newRow = {
rowKey: Date.now(),
<<<<<<< HEAD
id: "",
itemTable: "",
itemQuantity: "",
@@ -974,6 +1051,27 @@ function addNewRow() {
totalPrice: "",
sellPrice: "",
minSellPrice: "",
=======
id: '',
itemTable: '',
itemQuantity: '',
itemId: '',
unitCode: '',
remake: '',
supplierId: '',
purposeTypeEnum: '',
purposeLocationId: null,
purposeLocationStoreId: null,
practitionerId: '',
traceNo: '',
invoiceNo: '-',
startTime: '',
endTime: '',
price: '',
totalPrice: '',
sellPrice: '',
minSellPrice: '',
>>>>>>> v1.3
unitList: {}, // 单位列表
isEditing: true, // 标记当前行是否正在编辑
error: false, // 新增 error 字段
@@ -986,6 +1084,7 @@ function addNewRow() {
// 没有未保存的行,直接新增
const newRow = {
rowKey: Date.now(),
<<<<<<< HEAD
id: "",
itemTable: "",
itemQuantity: "",
@@ -1005,6 +1104,27 @@ function addNewRow() {
totalPrice: "",
sellPrice: "",
minSellPrice: "",
=======
id: '',
itemTable: '',
itemQuantity: '',
itemId: '',
unitCode: '',
remake: '',
supplierId: '',
purposeTypeEnum: '',
purposeLocationId: null,
purposeLocationStoreId: null,
practitionerId: '',
traceNo: '',
invoiceNo: '-',
startTime: '',
endTime: '',
price: '',
totalPrice: '',
sellPrice: '',
minSellPrice: '',
>>>>>>> v1.3
unitList: {}, // 单位列表
isEditing: true, // 标记当前行是否正在编辑
error: false, // 新增 error 字段
@@ -1113,6 +1233,7 @@ function selectRow(rowValue, index) {
form.purchaseinventoryList[index].unitCode = rowValue.unitCode;
form.purchaseinventoryList[index].manufacturerText = rowValue.manufacturerText;
form.purchaseinventoryList[index].partPercent = rowValue.partPercent;
<<<<<<< HEAD
form.purchaseinventoryList[index].invoiceNo = "-";
form.purchaseinventoryList[index].price = (rowValue.purchaseAmount || 0).toFixed(2);
price.value = (rowValue.purchaseAmount || 0).toFixed(2);
@@ -1120,6 +1241,15 @@ function selectRow(rowValue, index) {
unitMap.value["unitCode"] = rowValue.unitCode;
unitMap.value["minUnitCode"] = rowValue.minUnitCode;
unitMap.value["currentCode"] = rowValue.unitCode;
=======
form.purchaseinventoryList[index].invoiceNo = '-';
form.purchaseinventoryList[index].price = rowValue.purchaseAmount || 0;
price.value = rowValue.purchaseAmount || 0;
form.purchaseinventoryList[index].unitList = rowValue.unitList[0];
unitMap.value['unitCode'] = rowValue.unitCode;
unitMap.value['minUnitCode'] = rowValue.minUnitCode;
unitMap.value['currentCode'] = rowValue.unitCode;
>>>>>>> v1.3
form.purchaseinventoryList[index].itemQuantity = 0;
form.purchaseinventoryList[index].totalPrice = 0;
}
@@ -1144,11 +1274,17 @@ function handleLocationClick(item, row, index) {
row.unitList.minUnitCode_dictText
) || 0;
<<<<<<< HEAD
form.purchaseinventoryList[index].itemTable = res.data[0].itemTable || "";
form.purchaseinventoryList[index].startTime =
formatDateymd(res.data[0].productionDate) || "";
form.purchaseinventoryList[index].endTime =
formatDateymd(res.data[0].expirationDate) || "";
=======
form.purchaseinventoryList[index].itemTable = res.data[0].itemTable || '';
form.purchaseinventoryList[index].startTime = formatDateymd(res.data[0].productionDate) || '';
form.purchaseinventoryList[index].endTime = formatDateymd(res.data[0].expirationDate) || '';
>>>>>>> v1.3
startTimeOld.value = form.purchaseinventoryList[index].startTime
? form.purchaseinventoryList[index].startTime
: "";
@@ -1374,7 +1510,11 @@ function addPurchaseinventorys(rowList) {
}
function handleTraceNoInput(value, row) {
<<<<<<< HEAD
row.traceNo = value.concat(",");
=======
row.traceNo = value.concat(',');
>>>>>>> v1.3
}
/** 选择条数 */
@@ -1654,6 +1794,7 @@ function formatPrintData() {
),
printDate: new Date().toLocaleString("zh-CN"),
...receiptHeaderForm,
<<<<<<< HEAD
purchaseinventoryList: form.purchaseinventoryList.map((item, index) => ({
...item,
rowNumber: index + 1,
@@ -1662,6 +1803,16 @@ function formatPrintData() {
totalPrice: Number(item.totalPrice).toFixed(2),
})),
};
=======
purchaseinventoryList: form.purchaseinventoryList,
});
const printElements = templateJson;
var hiprintTemplate = new hiprint.PrintTemplate({ template: printElements }); // 定义模板
hiprintTemplate.print2(result, {
printer: 'EPSON LQ-80KFII',
title: '打印标题',
}); //开始打印
>>>>>>> v1.3
}
function deleteSelectedRows() {
@@ -1703,7 +1854,11 @@ function handleTotalAmount() {
/** 重置操作表单 */
function reset() {
<<<<<<< HEAD
proxy.resetForm("receiptHeaderRef");
=======
proxy.resetForm('receiptHeaderRef');
>>>>>>> v1.3
form.purchaseinventoryList = [];
// 完全重置所有表单字段
Object.assign(receiptHeaderForm, {
@@ -1812,8 +1967,13 @@ function handleReject() {
store.clearCurrentData();
// 跳转到审核页面
router.replace({
<<<<<<< HEAD
path: "/aaaa/medicationmanagement/billapproval",
query: { type: "purchaseDocument" },
=======
path: '/aaaa/billapproval',
query: { type: 'purchaseDocument' },
>>>>>>> v1.3
});
}
});
@@ -1829,8 +1989,13 @@ function handelApply() {
store.clearCurrentData();
// 跳转到审核页面
router.replace({
<<<<<<< HEAD
path: "/aaaa/medicationmanagement/billapproval",
query: { type: "purchaseDocument" },
=======
path: '/aaaa/billapproval',
query: { type: 'purchaseDocument' },
>>>>>>> v1.3
});
}
})
@@ -1874,6 +2039,22 @@ defineExpose({
edit,
});
getPurchaseinventoryTypeList();
// 导出
const exportRequiredParams = ref({
pageNo: 1,
pageSize: 10,
busNo: route.query.supplyBusNo,
});
function handleExport() {
proxy.downloadGet(
'/inventory-manage/purchase/excel-out',
{
...exportRequiredParams.value,
},
`入库单据明细_${proxy.formatDateStr(new Date(), 'YYYY-MM-DD')}.xlsx`
);
}
</script>
<style scoped>
.custom-tree-node {