340 lines
8.1 KiB
Vue
Raw Normal View History

2025-03-21 09:20:29 +08:00
<template>
2025-04-12 20:40:39 +08:00
<div class="system-user-container layout-padding">
<el-card class="layout-padding-auto" shadow="hover">
<avue-crud
ref="crudRef"
:data="state.data"
:option="state.option"
v-model:page="state.page"
@on-load="onLoadFun"
:table-loading="state.loading"
>
<template #checkboxBox="{ row }">
2025-04-14 16:04:52 +08:00
<div style="width: 100%; height: 100%; display: flex; align-items: center; justify-content: center">
<el-checkbox v-if="row.ifHidden === 0" v-model="row.checkboxBox" true-value="1" false-value="0" @change="selectionChange(row)" />
</div>
</template>
<template #deliveryDate="{ row }">{{ row.ifHidden === 0 ? row.deliveryDate : '' }}</template>
2025-04-12 20:40:39 +08:00
<template #sheet="{ row }">{{ row.ifHidden === 0 ? row.sheet : '' }}</template>
<template #materialName="{ row }">
<el-tooltip :content="row.materialName" placement="top">
<div class="multi-line-omit">{{ row.materialName }}</div>
</el-tooltip>
</template>
<template #supplierName="{ row }">
<el-tooltip :content="row.supplierName" placement="top">
<div class="multi-line-omit">{{ row.supplierName }}</div>
</el-tooltip>
</template>
<template #menu-left>
<div class="selectBoxes">
<div class="selectItem">
<el-input v-model="state.formData.sheet" style="width: 240px" placeholder="发货单号" size="default" />
</div>
2025-04-14 16:04:52 +08:00
<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>
2025-04-12 20:40:39 +08:00
<el-button type="primary" size="default" @click="selectFun">搜索</el-button>
<el-button size="default" @click="resetFun">重置</el-button>
<el-button type="primary" size="default" @click="state.selectedDataShow = true">
<span>已选中 {{ state.selectedData.length }} 条数据去打印</span>
</el-button>
</div>
</template>
2025-04-14 16:04:52 +08:00
<template #menu="{ row }">
2025-04-12 20:40:39 +08:00
<div class="btnList">
2025-04-14 16:04:52 +08:00
<el-button type="text" @click="barCodeFunDataRow(row)">打印条码</el-button>
2025-04-12 20:40:39 +08:00
</div>
</template>
</avue-crud>
</el-card>
<selectedData
:listData="state.selectedData"
:showes="state.selectedDataShow"
@close="
() => {
state.selectedDataShow = false;
}
"
/>
2025-04-14 16:04:52 +08:00
<barCode :showes="state.barCodeShow" :data="state.barCodeItem" @close="() => { state.barCodeShow = false }"/>
2025-04-12 20:40:39 +08:00
</div>
2025-03-21 09:20:29 +08:00
</template>
<script lang="ts" setup>
2025-04-12 20:40:39 +08:00
import { reactive, onMounted, computed, nextTick, ref } from 'vue';
2025-04-03 01:06:09 +08:00
import { listApi } from '../../api/list/index';
2025-04-12 20:40:39 +08:00
import { ElMessage } from 'element-plus';
2025-03-24 16:46:34 +08:00
import { useI18n } from 'vue-i18n';
2025-04-03 01:06:09 +08:00
import SelectedData from '/@/views/materialReceiptNotice/selectedData.vue';
2025-04-14 16:04:52 +08:00
import barCode from './barCode.vue'
2025-03-27 23:36:30 +08:00
const { t } = useI18n();
2025-04-12 20:40:39 +08:00
const crudRef = ref();
2025-03-21 09:20:29 +08:00
// 定义变量内容
const state = reactive({
2025-04-12 20:40:39 +08:00
page: {
total: 1000,
currentPage: 1,
pageSize: 30,
},
option: {
height: computed(() => window.innerHeight - window.innerHeight * 0.25 + ''),
tip: false,
index: false,
menuWidth: 120,
border: true,
delBtn: false,
editBtn: false,
align: 'center',
selection: false,
searchMenuSpan: 3,
addBtn: false,
column: [
2025-04-14 16:04:52 +08:00
{ label: '', prop: 'checkboxBox', width: 35 },
{ label: '送货日期', prop: 'deliveryDate' },
2025-04-12 20:40:39 +08:00
{ label: '发货单号', prop: 'sheet', width: '135' },
{ label: '美塞斯批号', prop: 'mssSupplierLot' },
{ label: '供应商批号', prop: 'fSupplierLot' },
{ label: '物料编码', prop: 'materialCode', width: '120' },
{ label: '物料名称', prop: 'materialName' },
{ 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' },
{ label: '发货数量', prop: 'qty' },
{ label: '采购数量', prop: 'purchaseQty' },
{ label: '采购单位', prop: 'unitName' },
],
},
data: [],
elDatePicker: '',
formData: {
sheet: '',
fDateBegin: '',
fDateEmd: '',
fmrpCloseStatus: '',
},
selectedData: [],
chengNuoJiaoQiP: '',
newChengNuoJiaoQiP: '',
selectedDataShow: false,
loading: false,
2025-04-14 16:04:52 +08:00
barCodeShow:false,
barCodeItem: {}
2025-03-21 09:20:29 +08:00
});
2025-04-14 16:04:52 +08:00
const elDatePickerFun = (val: any) => {
state.formData.fDateBegin = val[0];
state.formData.fDateEmd = val[1];
2025-04-03 01:06:09 +08:00
};
2025-04-14 16:04:52 +08:00
const selectionChange = (row: any) => {
if (row.checkboxBox == '1') {
state.data.forEach((item: any) => {
if (item.id !== row.id) {
item.checkboxBox = '0';
}
});
listApi()
.invoiceOrderGetPageList({
condition: {
sheet: row.sheet,
fDateBegin: '',
fDateEmd: '',
fmrpCloseStatus: '',
},
pageSize: 1000000,
page: 1,
})
.then((res: any) => {
state.loading = false;
if (res.resultCode === 0) {
state.selectedData = res.data.dataList;
}
});
} else {
state.selectedData = [];
}
};
const barCodeFunDataRow = (row) => {
state.barCodeItem = row
state.barCodeShow = true
}
2025-04-03 01:06:09 +08:00
//接口数据处理
const selectFun = () => {
2025-04-12 20:40:39 +08:00
state.page.currentPage = 1;
state.page.pageSize = 30;
getList();
2025-04-03 01:06:09 +08:00
};
const resetFun = () => {
2025-04-12 20:40:39 +08:00
state.page.currentPage = 1;
state.page.pageSize = 30;
state.elDatePicker = '';
state.formData = {
sheet: '',
fDateBegin: '',
fDateEmd: '',
fmrpCloseStatus: '',
};
getList();
2025-04-03 01:06:09 +08:00
};
const onLoadFun = (e: any) => {
2025-04-12 20:40:39 +08:00
state.page.currentPage = e.currentPage;
state.page.pageSize = e.pageSize;
getList();
2025-04-03 01:06:09 +08:00
};
2025-03-27 23:36:30 +08:00
const getList = () => {
2025-04-12 20:40:39 +08:00
state.loading = true;
listApi()
.invoiceOrderGetPageList({
condition: state.formData,
pageSize: state.page.pageSize,
page: state.page.currentPage,
})
.then((res: any) => {
state.loading = false;
if (res.resultCode === 0) {
state.data = res.data.dataList;
2025-04-14 16:04:52 +08:00
state.data.forEach((item: any) => {
item.checkboxBox = '0';
});
2025-04-12 20:40:39 +08:00
state.page.total = res.data.total;
}
});
2025-04-03 01:06:09 +08:00
};
2025-03-21 09:20:29 +08:00
// 页面加载时
2025-04-12 20:40:39 +08:00
onMounted(() => {});
2025-03-21 09:20:29 +08:00
</script>
<style lang="scss" scoped>
2025-04-12 20:40:39 +08:00
//.el-checkbox__inner:nth-child(1){
// display: none;
//}
:deep(.el-checkbox--default):nth-child(0) {
display: none !important;
}
2025-04-14 16:04:52 +08:00
:deep(.el-checkbox) {
height: 15px !important;
2025-04-12 20:40:39 +08:00
}
2025-04-14 16:04:52 +08:00
2025-04-03 01:06:09 +08:00
:deep(.cell) {
2025-04-12 20:40:39 +08:00
padding: 0 8px !important;
2025-04-03 01:06:09 +08:00
}
:deep(.avue-crud__left) {
2025-04-12 20:40:39 +08:00
flex: 1;
2025-04-03 01:06:09 +08:00
}
2025-04-12 20:40:39 +08:00
:deep(.el-button--text) {
padding: 0 !important;
height: auto !important;
2025-04-11 18:00:39 +08:00
}
2025-04-12 20:40:39 +08:00
2025-04-03 01:06:09 +08:00
:deep(.avue-crud__refreshBtn) {
2025-04-12 20:40:39 +08:00
display: none;
2025-04-03 01:06:09 +08:00
}
:deep(.avue-crud__gridBtn) {
2025-04-12 20:40:39 +08:00
display: none;
2025-04-03 01:06:09 +08:00
}
.piliang {
2025-04-12 20:40:39 +08:00
margin-left: 12px;
border: 1px solid #d5d5d5;
border-radius: 8px;
flex: 1;
display: flex;
align-items: center;
box-sizing: border-box;
padding: 4px;
2025-04-03 01:06:09 +08:00
}
2025-03-21 09:20:29 +08:00
.system-user-container {
2025-04-12 20:40:39 +08:00
padding: 0 !important;
2025-04-03 01:06:09 +08:00
}
.multi-line-omit {
2025-04-12 20:40:39 +08:00
word-break: break-all; // 允许单词内自动换行,如果一个单词很长的话
text-overflow: ellipsis; // 溢出用省略号显示
overflow: hidden; // 超出的文本隐藏
display: -webkit-box; // 作为弹性伸缩盒子模型显示
-webkit-line-clamp: 1; // 显示的行
-webkit-box-orient: vertical; // 设置伸缩盒子的子元素排列方式--从上到下垂直排列
2025-04-03 01:06:09 +08:00
}
.selectBoxes {
2025-04-12 20:40:39 +08:00
display: flex;
flex: 1;
2025-04-03 01:06:09 +08:00
2025-04-12 20:40:39 +08:00
.selectItem {
margin-right: 16px;
display: flex;
}
2025-04-03 01:06:09 +08:00
}
:deep(.avue-crud) {
2025-04-12 20:40:39 +08:00
height: 100%;
width: 100%;
2025-04-03 01:06:09 +08:00
}
:deep(.avue-crud--card) {
2025-04-12 20:40:39 +08:00
display: flex;
flex-direction: column;
flex: 1;
2025-04-03 01:06:09 +08:00
}
:deep(.avue-crud__body) {
2025-04-12 20:40:39 +08:00
flex: 1;
2025-04-03 01:06:09 +08:00
}
:deep(.el-table__header) {
2025-04-12 20:40:39 +08:00
height: 40px;
2025-04-03 01:06:09 +08:00
}
:deep(.el-card__body) {
2025-04-12 20:40:39 +08:00
width: 100% !important;
height: 100% !important;
overflow: hidden !important;
padding: 0 !important;
2025-03-21 09:20:29 +08:00
}
2025-04-03 01:06:09 +08:00
:deep(.el-table__cell) {
2025-04-12 20:40:39 +08:00
padding: 0 !important;
//height: 56px !important;
2025-04-03 01:06:09 +08:00
}
:deep(.el-card) {
2025-04-12 20:40:39 +08:00
padding: 12px;
2025-04-03 01:06:09 +08:00
}
:deep(.el-form) {
2025-04-12 20:40:39 +08:00
flex: 1;
2025-04-03 01:06:09 +08:00
}
.system-user-container {
2025-04-12 20:40:39 +08:00
:deep(.el-card__body) {
display: flex;
flex-direction: column;
flex: 1;
overflow: auto;
2025-04-03 01:06:09 +08:00
2025-04-12 20:40:39 +08:00
.el-table {
flex: 1;
}
}
2025-03-21 09:20:29 +08:00
}
2025-04-03 01:06:09 +08:00
:deep(.el-col) {
2025-04-12 20:40:39 +08:00
margin-bottom: 16px;
2025-04-03 01:06:09 +08:00
}
2025-03-21 09:20:29 +08:00
</style>