初次对接

This commit is contained in:
刘晓鹏 2025-04-08 00:14:08 +08:00
parent b7f32b6f09
commit 5465099c77
7 changed files with 275 additions and 316 deletions

7
package-lock.json generated
View File

@ -3546,8 +3546,9 @@
}, },
"node_modules/print-js": { "node_modules/print-js": {
"version": "1.6.0", "version": "1.6.0",
"resolved": "https://registry.npmjs.org/print-js/-/print-js-1.6.0.tgz", "resolved": "https://registry.npmmirror.com/print-js/-/print-js-1.6.0.tgz",
"integrity": "sha512-BfnOIzSKbqGRtO4o0rnj/K3681BSd2QUrsIZy/+WdCIugjIswjmx3lDEZpXB2ruGf9d4b3YNINri81+J0FsBWg==" "integrity": "sha512-BfnOIzSKbqGRtO4o0rnj/K3681BSd2QUrsIZy/+WdCIugjIswjmx3lDEZpXB2ruGf9d4b3YNINri81+J0FsBWg==",
"license": "MIT"
}, },
"node_modules/prismjs": { "node_modules/prismjs": {
"version": "1.29.0", "version": "1.29.0",
@ -6784,7 +6785,7 @@
}, },
"print-js": { "print-js": {
"version": "1.6.0", "version": "1.6.0",
"resolved": "https://registry.npmjs.org/print-js/-/print-js-1.6.0.tgz", "resolved": "https://registry.npmmirror.com/print-js/-/print-js-1.6.0.tgz",
"integrity": "sha512-BfnOIzSKbqGRtO4o0rnj/K3681BSd2QUrsIZy/+WdCIugjIswjmx3lDEZpXB2ruGf9d4b3YNINri81+J0FsBWg==" "integrity": "sha512-BfnOIzSKbqGRtO4o0rnj/K3681BSd2QUrsIZy/+WdCIugjIswjmx3lDEZpXB2ruGf9d4b3YNINri81+J0FsBWg=="
}, },
"prismjs": { "prismjs": {

View File

@ -1,187 +1,131 @@
<template> <template>
<div class="purchase-delivery-page"> <div class="orderPrinting" ref="orderPrintingRef">
<!-- 标题 --> <div class="title">采购送货单</div>
<h2 class="page-title">采购送货单</h2> <div class="orderPrintingTop">
<div class="item item1"></div>
<!-- 上方两列区域含二维码和基本信息 --> <div class="item item2">
<table class="header-table"> <div class="dataText">
<tr> <span class="span1">收料通知单编号送货单号</span>
<!-- 左侧列 --> <span class="span2">123465</span>
<td class="qr-col"> </div>
<!-- 如果有二维码图片可替换为实际图片地址 --> <div class="dataText">
<img <span class="span1">供应商名称</span>
class="qr-image" <span class="span2">123465</span>
:src="qrCodeLeft" </div>
alt="二维码" <div class="dataText">
/> <span class="span1">送货日期</span>
</td> <span class="span2">123465</span>
<td class="info-col"> </div>
<div> <div class="dataText">
<label>收料通知单编号送货单号</label> <span class="span1">发票号</span>
<span>{{ receivingNoticeNumberLeft }}</span> <span class="span2">123465</span>
</div> </div>
<div> </div>
<label>供应商名称</label> <div class="item item3"></div>
<span>{{ supplierNameLeft }}</span> </div>
</div> <avue-crud ref="crudRef" :data="state.data" :option="state.option"> </avue-crud>
<div> </div>
<label>送货日期</label>
<span>{{ deliveryDateLeft }}</span>
</div>
<div>
<label>发票号</label>
<span>{{ invoiceNumberLeft }}</span>
</div>
</td>
<!-- 右侧列 -->
<td class="qr-col">
<img
class="qr-image"
:src="qrCodeRight"
alt="二维码"
/>
</td>
</tr>
</table>
<!-- 明细表格 -->
<table class="detail-table">
<thead>
<tr>
<th>序号</th>
<th>PO号</th>
<th>物料代码</th>
<th>物料名称</th>
<th>单位</th>
<th>PO数量</th>
<th>实收数量</th>
<th>美金单价</th>
<th>供应商批号</th>
</tr>
</thead>
<tbody>
<tr v-for="(row, index) in tableData" :key="index">
<td>{{ index + 1 }}</td>
<td>{{ row.poNumber }}</td>
<td>{{ row.materialCode }}</td>
<td>{{ row.materialName }}</td>
<td>{{ row.unit }}</td>
<td>{{ row.poQuantity }}</td>
<td>{{ row.receivedQuantity }}</td>
<td>{{ row.usdPrice }}</td>
<td>{{ row.supplierBatchNumber }}</td>
</tr>
</tbody>
</table>
</div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref } from 'vue' import { reactive,ref } from 'vue';
const orderPrintingRef = ref()
// --------------------- const state = reactive({
// option: {
// --------------------- tip: false,
index: false,
// menuWidth: 120,
const qrCodeLeft = ref('https://via.placeholder.com/100?text=QR-Left') border: true,
const receivingNoticeNumberLeft = ref('RN-LEFT-123') delBtn: false,
const supplierNameLeft = ref('供应商A') editBtn: false,
const deliveryDateLeft = ref('2025-03-20') align: 'center',
const invoiceNumberLeft = ref('INV-LEFT-001') // searchLabelWidth:100,
selection: false,
// searchMenuSpan: 3,
const qrCodeRight = ref('https://via.placeholder.com/100?text=QR-Right') addBtn: false,
menu: false,
// column: [
const tableData = ref([ { label: 'PO号', prop: 'purchaseOrderFBillNo' },
{ { label: '物料代码', prop: 'sheet' },
poNumber: 'PO-001', { label: '物料名称', prop: 'fBillNo' },
materialCode: 'M-001', { label: '单位', prop: 'mssSupplierLot' },
materialName: '物料名称1', { label: 'PO数量', prop: 'fSupplierLot' },
unit: 'PCS', { label: '实收数量', prop: 'materialCode' },
poQuantity: 100, { label: '美金单价', prop: 'materialName' },
receivedQuantity: 95, { label: '供应商批号', prop: 'sendedQty' },
usdPrice: 1.25, ],
supplierBatchNumber: 'BATCH-001' },
}, data: [
{ {
poNumber: 'PO-002', purchaseOrderFBillNo: 1,
materialCode: 'M-002', sheet: 1,
materialName: '物料名称2', fBillNo: 1,
unit: 'PCS', mssSupplierLot: 1,
poQuantity: 200, fSupplierLot: 1,
receivedQuantity: 190, materialCode: 1,
usdPrice: 0.75, materialName: 1,
supplierBatchNumber: 'BATCH-002' sendedQty: 1,
} }
]) ],
});
defineExpose({
orderPrintingRef
});
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.purchase-delivery-page { :deep(.avue-crud__header) {
width: 100%; display: none;
margin: 0 auto;
font-family: sans-serif;
} }
/* 标题样式 */ :deep(.avue-crud__body) {
.page-title { padding: 0 !important;
text-align: center;
padding: 1em 0;
border: 1px solid #ccc;
background-color: #DEEAF6;
} }
/* 头部表格 */ .orderPrinting {
.header-table { width: 100%;
width: 100%;
border-collapse: collapse;
}
.header-table td { .title {
border: 1px solid #ccc; width: 100%;
vertical-align: top; height: 50px;
padding: 8px; background-color: #deeaf6;
/* 可根据需要调整宽度分配 */ display: flex;
width: 30%; align-items: center;
} justify-content: center;
font-size: 22px;
letter-spacing: 10px;
}
.qr-col { .orderPrintingTop {
text-align: center; height: 200px;
height: 200px; border: 1px solid #c2c4ca;
width: 33.33%; box-sizing: border-box;
} display: flex;
.info-col>*{
margin-top: 20px;
}
.qr-image {
width: 80px;
height: 80px;
display: block;
margin: 0 auto;
}
.info-col label { .item1 {
font-weight: bold; width: 33.33%;
} height: 199px;
border-right: 1px solid #c2c4ca;
}
/* 明细表格 */ .item2 {
.detail-table { width: 33.33%;
width: 100%; height: 199px;
border-collapse: collapse; border-right: 1px solid #c2c4ca;
} box-sizing: border-box;
padding: 16px;
.detail-table th, .dataText {
.detail-table td { font-size: 16px;
border: 1px solid #ccc; margin-bottom: 16px;
padding: 8px; }
text-align: center; }
}
.detail-table th { .item2 {
background-color: #f5f5f5; width: 33.33%;
height: 199px;
//border-right: 1px solid black;
}
}
} }
</style> </style>

View File

@ -126,7 +126,7 @@ const state = reactive({
selectedData: [], selectedData: [],
chengNuoJiaoQiP: '', chengNuoJiaoQiP: '',
newChengNuoJiaoQiP: '', newChengNuoJiaoQiP: '',
selectedDataShow: false, selectedDataShow: true,
loading: false, loading: false,
}); });
const selectionChange = (list: any) => { const selectionChange = (list: any) => {

View File

@ -1,32 +1,56 @@
<template> <template>
<el-dialog :model-value="props.showes" width="70%" > <el-dialog :model-value="props.showes" width="70%">
<ceshi></ceshi> <ceshi ref="ceshiRef"></ceshi>
<div class="btnList"> <div class="btnList">
<el-button type="primary">打印</el-button> <el-button type="primary" @click="printElement">打印</el-button>
</div> </div>
</el-dialog> </el-dialog>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import {defineProps, reactive} from 'vue'; import { defineProps, reactive, ref, nextTick } from 'vue';
import ceshi from './ceshi.vue' import ceshi from './ceshi.vue';
import printJS from 'print-js';
const ceshiRef = ref(null);
const props = defineProps({ const props = defineProps({
listData:{ listData: {
type: Array, type: Array,
default: () => [] default: () => [],
}, },
showes:{ showes: {
type: Boolean, type: Boolean,
default: true default: true,
} },
}); });
const state = reactive({ const state = reactive({
dialogVisible: true, dialogVisible: true,
}); });
const printElement = () => {
// DOM HTML
nextTick(() => {
console.log(ceshiRef.value.orderPrintingRef);
// // 使 print-js
printJS({
printable: ceshiRef.value.orderPrintingRef,
type: 'html', // HTML
style: `
@page {
margin: 0;
size: auto;
}
@page :header, @page :footer {
display: none;
}
`,
});
});
};
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.btnList{ .btnList {
margin-top: 26px; margin-top: 26px;
display: flex; display: flex;
justify-content: center; justify-content: center;
} }
</style> </style>

View File

@ -1,6 +1,57 @@
<template> <template>
<div class="system-user-container layout-padding"> <div class="system-user-container layout-padding">
<el-card class="layout-padding-auto" shadow="hover"> <el-card class="layout-padding-auto" shadow="hover">
<div class="selectBoxes">
<div class="selectItem">
<el-input v-model="state.formData.fBillNo" style="width: 12vw" placeholder="单据编号" size="default" />
</div>
<div class="selectItem">
<el-select placeholder="业务状态" size="default" style="width: 12vw" v-model="state.formData.fmrpCloseStatus">
<el-option v-for="item in state.option.column[2].dicData" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</div>
<div class="selectItem">
<el-date-picker
v-model="state.elDatePicker"
style="width: 25vw"
type="daterange"
range-separator="-"
start-placeholder="开始采购日期"
end-placeholder="采购结束日期"
size="default"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
@change="elDatePickerFun"
/>
</div>
<div class="selectItem" style="margin-right: 0">
<el-button type="primary" size="default" @click="selectFun">搜索</el-button>
<el-button size="default" @click="resetFun">重置</el-button>
</div>
<div class="selectItem" style="flex: 1;margin-right: 0">
<div class="piliang">
<el-button type="primary" size="small" @click="state.selectedDataShow = true">
<span>已选中 {{ state.selectedData.length }} 条数据去查看</span>
</el-button>
<el-date-picker
v-model="state.chengNuoJiaoQiP"
type="date"
placeholder="批量修改选中承诺日期"
size="small"
style="width: 45%; margin-left: 12px"
@change="chengNuoJiaoQiPFun('0')"
/>
<el-date-picker
v-model="state.newChengNuoJiaoQiP"
type="date"
placeholder="批量修改选中承诺最新交期"
size="small"
style="width: 45%; margin-left: 12px"
@change="chengNuoJiaoQiPFun('1')"
/>
</div>
</div>
</div>
<avue-crud <avue-crud
ref="crudRef" ref="crudRef"
:data="state.data" :data="state.data"
@ -45,59 +96,11 @@
/> />
</template> </template>
<template #menu-left> <template #menu-left>
<div class="selectBoxes">
<div class="selectItem"> </template>
<el-input v-model="state.formData.fBillNo" style="width: 240px" placeholder="单据编号" size="default" /> <template #menu="{ row }">
</div> <el-button type="text" icon="el-icon-pie-chart" @click="toPurchaseDetails(row)">查看</el-button>
<div class="selectItem">
<el-select placeholder="业务状态" size="default" style="width: 240px" v-model="state.formData.fmrpCloseStatus">
<el-option v-for="item in state.option.column[2].dicData" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</div>
<div class="selectItem">
<el-date-picker
v-model="state.elDatePicker"
style="width: 560px"
type="daterange"
range-separator="-"
start-placeholder="开始采购日期"
end-placeholder="采购结束日期"
size="default"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
@change="elDatePickerFun"
/>
</div>
<div class="selectItem" style="flex: 1">
<el-button type="primary" size="default" @click="selectFun">搜索</el-button>
<el-button size="default" @click="resetFun">重置</el-button>
<div class="piliang">
<el-button type="primary" size="small" @click="state.selectedDataShow = true">
<span>已选中 {{ state.selectedData.length }} 条数据去查看</span>
</el-button>
<el-date-picker
v-model="state.chengNuoJiaoQiP"
type="date"
placeholder="批量修改选中承诺日期"
size="small"
style="width: 190px; margin-left: 12px"
@change="chengNuoJiaoQiPFun('0')"
/>
<el-date-picker
v-model="state.newChengNuoJiaoQiP"
type="date"
placeholder="批量修改选中承诺最新交期"
size="small"
style="width: 190px; margin-left: 12px"
@change="chengNuoJiaoQiPFun('1')"
/>
</div>
</div>
</div>
</template> </template>
<!-- <template #menu="{ row }">-->
<!-- <el-button type="text" icon="el-icon-pie-chart" @click="toPurchaseDetails(row)">查看</el-button>-->
<!-- </template>-->
</avue-crud> </avue-crud>
</el-card> </el-card>
<selectedData <selectedData
@ -105,7 +108,12 @@
:showes="state.selectedDataShow" :showes="state.selectedDataShow"
:listData="state.selectedData" :listData="state.selectedData"
@generateDocuments="generateDocumentsFun" @generateDocuments="generateDocumentsFun"
@close="() => {state.selectedDataShow = false;getList()}" @close="
() => {
state.selectedDataShow = false;
getList();
}
"
/> />
</div> </div>
</template> </template>
@ -129,10 +137,10 @@ const state = reactive({
pageSize: 30, pageSize: 30,
}, },
option: { option: {
height: '720', height: '730',
tip: false, tip: false,
index: false, index: true,
menu: false, menu: true,
menuWidth: 120, menuWidth: 120,
border: true, border: true,
delBtn: false, delBtn: false,
@ -140,6 +148,7 @@ const state = reactive({
align: 'center', align: 'center',
// searchLabelWidth:100, // searchLabelWidth:100,
selection: true, selection: true,
reserveSelection: true,
searchMenuSpan: 3, searchMenuSpan: 3,
addBtn: false, addBtn: false,
column: [ column: [
@ -291,17 +300,35 @@ const getList = () => {
}) })
.then((res: any) => { .then((res: any) => {
state.loading = false; state.loading = false;
if (res.resultCode === 0) { if (res.resultCode === 0) {
state.data = res.data.dataList; state.data = res.data.dataList;
state.page.total = res.data.total; state.page.total = res.data.total;
setTimeout(() => {
console.log(document.querySelector('.avue-crud__body').scrollHeight)
},1000)
} }
}); });
}; };
// //
onMounted(() => {}); onMounted(() => {
});
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
:deep(.avue-crud__header) {
display: none;
}
:deep(.el-button--text){
padding: 0 !important;
height: auto !important;
}
:deep(.avue-crud__pagination) {
padding: 0 12px !important;
}
:deep(.cell) { :deep(.cell) {
padding: 0 !important; padding: 0 !important;
} }
@ -344,8 +371,7 @@ onMounted(() => {});
.selectBoxes { .selectBoxes {
display: flex; display: flex;
flex: 1; flex-wrap: wrap;
.selectItem { .selectItem {
margin-right: 16px; margin-right: 16px;
display: flex; display: flex;

View File

@ -22,7 +22,7 @@
type="date" type="date"
placeholder="日期" placeholder="日期"
size="small" size="small"
style="width: 115px" style="width: 220px"
format="YYYY-MM-DD" format="YYYY-MM-DD"
value-format="YYYY-MM-DD" value-format="YYYY-MM-DD"
@change="batchSetChengNuoJiaoQiFun([{id:row.id,newTime:row.chengNuoJiaoQi}])" @change="batchSetChengNuoJiaoQiFun([{id:row.id,newTime:row.chengNuoJiaoQi}])"
@ -34,66 +34,12 @@
type="date" type="date"
placeholder="日期" placeholder="日期"
size="small" size="small"
style="width: 130px" style="width: 220px"
format="YYYY-MM-DD" format="YYYY-MM-DD"
value-format="YYYY-MM-DD" value-format="YYYY-MM-DD"
@change="batchSetNewChengNuoJiaoQiFun([{id:row.id,newTime:row.newChengNuoJiaoQi}])" @change="batchSetNewChengNuoJiaoQiFun([{id:row.id,newTime:row.newChengNuoJiaoQi}])"
/> />
</template> </template>
<template #menu-left>
<div class="selectBoxes">
<div class="selectItem">
<el-input v-model="state.formData.fBillNo" style="width: 240px" placeholder="单据编号" size="default" />
</div>
<div class="selectItem">
<el-select placeholder="业务状态" size="default" style="width: 240px" v-model="state.formData.fmrpCloseStatus">
<el-option v-for="item in state.option.column[2].dicData" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</div>
<div class="selectItem">
<el-date-picker
v-model="state.elDatePicker"
style="width: 560px"
type="daterange"
range-separator="-"
start-placeholder="开始采购日期"
end-placeholder="采购结束日期"
size="default"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
@change="elDatePickerFun"
/>
</div>
<div class="selectItem" style="flex: 1">
<el-button type="primary" size="default" @click="selectFun">搜索</el-button>
<el-button size="default" @click="resetFun">重置</el-button>
<div class="piliang">
<el-button type="primary" size="small" @click="state.selectedDataShow = true">
<span>已选中 {{ state.selectedData.length }} 条数据去查看</span>
</el-button>
<el-date-picker
v-model="state.chengNuoJiaoQiP"
type="date"
placeholder="批量修改选中承诺日期"
size="small"
style="width: 190px; margin-left: 12px"
@change="chengNuoJiaoQiPFun('0')"
/>
<el-date-picker
v-model="state.newChengNuoJiaoQiP"
type="date"
placeholder="批量修改选中承诺最新交期"
size="small"
style="width: 190px; margin-left: 12px"
@change="chengNuoJiaoQiPFun('1')"
/>
</div>
</div>
</div>
</template>
<template #menu="{ row }">
<el-button type="text" icon="el-icon-pie-chart" @click="toPurchaseDetails(row)">查看</el-button>
</template>
</avue-crud> </avue-crud>
</el-card> </el-card>
<selectedData ref="selectedDataRef" :showes="state.selectedDataShow" :listData="state.selectedData" @generateDocuments="generateDocumentsFun" @close="state.selectedDataShow = false"/> <selectedData ref="selectedDataRef" :showes="state.selectedDataShow" :listData="state.selectedData" @generateDocuments="generateDocumentsFun" @close="state.selectedDataShow = false"/>
@ -119,9 +65,9 @@ const state = reactive({
pageSize: 25, pageSize: 25,
}, },
option: { option: {
height: '720', height: '790',
tip: false, tip: false,
index: false, index: true,
menuWidth: 120, menuWidth: 120,
border: true, border: true,
delBtn: false, delBtn: false,
@ -131,6 +77,7 @@ const state = reactive({
selection: true, selection: true,
searchMenuSpan: 3, searchMenuSpan: 3,
addBtn: false, addBtn: false,
menu: false,
column: [ column: [
{ label: 'PO号', prop: 'fBillNo', /*search: true,*/ searchSpan: 3, width: '125' }, { label: 'PO号', prop: 'fBillNo', /*search: true,*/ searchSpan: 3, width: '125' },
{ label: '采购日期', prop: 'fDate', /*search: true,*/ type: 'datetime', searchSpan: 6, searchRange: true }, { label: '采购日期', prop: 'fDate', /*search: true,*/ type: 'datetime', searchSpan: 6, searchRange: true },
@ -160,8 +107,8 @@ const state = reactive({
}, },
{ label: '累计收料数量', prop: 'sendedQty', width: '110' }, { label: '累计收料数量', prop: 'sendedQty', width: '110' },
{ label: '剩余收料数量', prop: 'notSendQty' }, { label: '剩余收料数量', prop: 'notSendQty' },
{ label: '供应商承诺交期', prop: 'chengNuoJiaoQi', width: '140' }, { label: '供应商承诺交期', prop: 'chengNuoJiaoQi', width: '220' },
{ label: '供应商承诺最新交期', prop: 'newChengNuoJiaoQi', width: '160' }, { label: '供应商承诺最新交期', prop: 'newChengNuoJiaoQi', width: '220' },
], ],
}, },
data: [], data: [],
@ -266,6 +213,7 @@ const getList = () => {
listApi().getPurchaseOrderItemList({ listApi().getPurchaseOrderItemList({
fid:state.topId fid:state.topId
}).then((res:any) => { }).then((res:any) => {
state.loading = false
if(res.resultCode === 0){ if(res.resultCode === 0){
state.data = res.data state.data = res.data
} }
@ -279,6 +227,21 @@ onMounted(() => {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
:deep(.avue-crud__header) {
display: none;
}
:deep(.el-button--text){
padding: 0 !important;
height: auto !important;
}
:deep(.avue-crud__pagination) {
padding: 0 12px !important;
}
:deep(.cell) {
padding: 0 !important;
}
:deep(.avue-crud__left) { :deep(.avue-crud__left) {
flex: 1; flex: 1;
} }
@ -317,8 +280,7 @@ onMounted(() => {
.selectBoxes { .selectBoxes {
display: flex; display: flex;
flex: 1; flex-wrap: wrap;
.selectItem { .selectItem {
margin-right: 16px; margin-right: 16px;
display: flex; display: flex;

View File

@ -137,7 +137,9 @@ const xiugaizhanghao = (row:any) => {
} }
// //
onMounted(() => {}); onMounted(() => {
});
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>