初次对接

This commit is contained in:
2025-04-11 18:00:39 +08:00
parent 5465099c77
commit 0d3bf51c2b
11 changed files with 792 additions and 413 deletions

View File

@@ -27,7 +27,7 @@
<template #menu-left>
<div class="selectBoxes">
<div class="selectItem">
<el-input v-model="state.formData.fBillNo" style="width: 240px" placeholder="单据编号" size="default" />
<el-input v-model="state.formData.purchaseOrderFBillNo" style="width: 240px" placeholder="采购单号" size="default" />
</div>
<div class="selectItem">
<el-date-picker
@@ -52,24 +52,25 @@
</template>
<template #menu>
<div class="btnList">
<el-button type="text" @click="state.selectedDataShow = true">打印单据</el-button>
<el-button type="text" @click="state.selectedDataShow = true">打印条码</el-button>
</div>
</template>
</avue-crud>
</el-card>
<selectedData :showes="state.selectedDataShow"/>
<selectedData :listData="state.selectedData" :showes="state.selectedDataShow" @close="() => {state.selectedDataShow = false}"/>
</div>
</template>
<script lang="ts" setup>
import { reactive, onMounted, computed, nextTick, ref } from 'vue';
import { useRouter } from 'vue-router';
import { reactive, onMounted, computed, nextTick } from 'vue';
// import { useRouter } from 'vue-router';
import { listApi } from '../../api/list/index';
import { useI18n } from 'vue-i18n';
import SelectedData from '/@/views/materialReceiptNotice/selectedData.vue';
import { ElMessage } from 'element-plus';
// import { ElMessage } from 'element-plus';
const { t } = useI18n();
const router = useRouter();
// const router = useRouter();
// 定义变量内容
const state = reactive({
page: {
@@ -78,7 +79,7 @@ const state = reactive({
pageSize: 30,
},
option: {
height: '720',
height: computed(() => window.innerHeight - (window.innerHeight * 0.25) + '') ,
tip: false,
index: false,
menuWidth: 120,
@@ -86,7 +87,6 @@ const state = reactive({
delBtn: false,
editBtn: false,
align: 'center',
// searchLabelWidth:100,
selection: true,
searchMenuSpan: 3,
addBtn: false,
@@ -99,14 +99,14 @@ const state = reactive({
searchRange: true,
width:'160'
},
{ label: '采购单号', prop: 'purchaseOrderFBillNo',width:'120' },
{ label: '采购单号', prop: 'purchaseOrderFBillNo',width:'120' },
{ label: '发货单号', prop: 'sheet',width:'135' },
{ label: '收料单号', prop: 'fBillNo',width:'120' },
{ label: '收料单号', prop: 'fBillNo',width:'110' },
{ label: '美塞斯批号', prop: 'mssSupplierLot',width:'90' },
{ label: '供应商批号', prop: 'fSupplierLot',width:'90' },
{ label: '物料编码', prop: 'materialCode',width:'120' },
{ label: '物料名称', prop: 'materialName' },
{ label: computed(() => t('message.list.PONumber2')), prop: 'purchaseOrderFBillNo',width:'110' },
{ label: computed(() => t('message.list.SupplierCode2')), prop: 'supplierId',width:'90' },
{ label: computed(() => t('message.list.SupplierName2')), prop: 'supplierName',width:'120' },
{ label: '累计收料数量', prop: 'sendedQty',width:'110' },
@@ -118,7 +118,7 @@ const state = reactive({
data: [],
elDatePicker: '',
formData: {
fBillNo: '',
purchaseOrderFBillNo: '',
fDateBegin: '',
fDateEmd: '',
fmrpCloseStatus: '',
@@ -126,7 +126,7 @@ const state = reactive({
selectedData: [],
chengNuoJiaoQiP: '',
newChengNuoJiaoQiP: '',
selectedDataShow: true,
selectedDataShow: false,
loading: false,
});
const selectionChange = (list: any) => {
@@ -134,66 +134,7 @@ const selectionChange = (list: any) => {
state.selectedData = JSON.parse(JSON.stringify(list));
});
};
const chengNuoJiaoQiPFun = (e: string) => {
if (state.selectedData.length != 0) {
let arr: any = [];
if (e === '0') {
state.selectedData.forEach((item: any) => {
arr.push({ id: item.id, newTime: state.chengNuoJiaoQiP });
});
batchSetChengNuoJiaoQiFun(arr);
}
if (e === '1') {
state.selectedData.forEach((item: any) => {
arr.push({ id: item.id, newTime: state.newChengNuoJiaoQiP });
});
batchSetNewChengNuoJiaoQiFun(arr);
}
} else {
ElMessage.warning('请先选中数据');
}
};
const batchSetChengNuoJiaoQiFun = (arr: any) => {
listApi()
.batchSetChengNuoJiaoQi(arr)
.then((res: any) => {
if (res.resultCode === 0) {
ElMessage.success('操作成功');
getList();
state.chengNuoJiaoQiP = '';
}
if (res.resultCode === -1) {
ElMessage.success(res.errorMessage);
state.newChengNuoJiaoQiP = '';
}
});
};
const batchSetNewChengNuoJiaoQiFun = (arr: any) => {
listApi()
.batchSetNewChengNuoJiaoQi(arr)
.then((res: any) => {
if (res.resultCode === 0) {
ElMessage.success('操作成功');
getList();
}
if (res.resultCode === -1) {
ElMessage.success(res.errorMessage);
}
});
};
const generateDocumentsFun = () => {
state.selectedDataShow = false;
getList();
};
//跳转详情
const toPurchaseDetails = (item: any) => {
router.push({
path: '/purchaseDetails',
query: {
topId: item.fiD,
},
});
};
const elDatePickerFun = (val: any) => {
state.formData.fDateBegin = val[0];
state.formData.fDateEmd = val[1];
@@ -206,10 +147,10 @@ const selectFun = () => {
};
const resetFun = () => {
state.page.currentPage = 1;
state.page.pageSize = 20;
state.page.pageSize = 30;
state.elDatePicker = '';
state.formData = {
fBillNo: '',
purchaseOrderFBillNo: '',
fDateBegin: '',
fDateEmd: '',
fmrpCloseStatus: '',
@@ -238,7 +179,9 @@ const getList = () => {
});
};
// 页面加载时
onMounted(() => {});
onMounted(() => {
// console.log(window.innerHeight - 400)
});
</script>
<style lang="scss" scoped>
@@ -249,7 +192,10 @@ onMounted(() => {});
:deep(.avue-crud__left) {
flex: 1;
}
:deep(.el-button--text){
padding: 0 !important;
height: auto !important;
}
:deep(.avue-crud__refreshBtn) {
display: none;
}