2025-03-21 09:20:29 +08:00
|
|
|
|
<template>
|
2025-04-03 01:06:09 +08:00
|
|
|
|
<el-dialog :model-value="props.showes" @close="closeFun" width="80%">
|
2025-04-11 18:00:39 +08:00
|
|
|
|
<div style="display: flex; align-items: center; margin-bottom: 16px">
|
2025-04-14 17:40:58 +08:00
|
|
|
|
<div>{{ t('message.index.invoiceNumber') }}:</div>
|
|
|
|
|
|
<el-input style="width: 300px" v-model="state.f_VHUB_Text" :placeholder="t('message.index.invoiceNumber')" size="default" />
|
2025-04-11 18:00:39 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<avue-crud ref="crudRef" :data="state.data" :option="state.option">
|
|
|
|
|
|
<template #fSupplierLot="{ row }">
|
|
|
|
|
|
<div style="display: flex; align-items: center; justify-content: center">
|
2025-04-14 17:40:58 +08:00
|
|
|
|
<el-input v-model="row.fSupplierLot" :placeholder="t('message.index.supplierLot')" size="small" />
|
2025-04-11 18:00:39 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
2025-04-14 17:40:58 +08:00
|
|
|
|
<template #notSendQtyText="{ row }">
|
|
|
|
|
|
<div>{{ row.notSendQty }}</div>
|
2025-04-11 18:00:39 +08:00
|
|
|
|
</template>
|
|
|
|
|
|
<template #notSendQty="{ row }">
|
|
|
|
|
|
<div style="display: flex; align-items: center; justify-content: center">
|
2025-04-15 19:46:09 +08:00
|
|
|
|
<el-input-number v-model="row.notSendQtyText" size="small" />
|
2025-04-11 18:00:39 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</avue-crud>
|
2025-03-27 23:36:30 +08:00
|
|
|
|
<div class="btnList">
|
2025-04-15 19:46:09 +08:00
|
|
|
|
<el-button type="primary" :loading="state.loading" @click="batchAddInvoiceOrderFun">{{ t('message.index.confirm') }} </el-button>
|
2025-03-27 23:36:30 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</el-dialog>
|
2025-03-21 09:20:29 +08:00
|
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
2025-04-14 17:40:58 +08:00
|
|
|
|
import { defineProps, reactive, defineEmits, watch, computed } from 'vue';
|
2025-04-11 18:00:39 +08:00
|
|
|
|
import { listApi } from '../../api/list/index';
|
2025-04-15 19:46:09 +08:00
|
|
|
|
// import { useClipboard } from 'vue-clipboard3';
|
|
|
|
|
|
// const { copy } = useClipboard();
|
|
|
|
|
|
import useClipboard from 'vue-clipboard3';
|
|
|
|
|
|
const { toClipboard } = useClipboard();
|
2025-04-11 18:00:39 +08:00
|
|
|
|
const emits = defineEmits(['generateDocuments', 'close']);
|
2025-03-24 16:46:34 +08:00
|
|
|
|
import { useI18n } from 'vue-i18n';
|
2025-04-15 19:46:09 +08:00
|
|
|
|
import { ElMessage, ElMessageBox } from 'element-plus';
|
2025-04-11 18:00:39 +08:00
|
|
|
|
|
2025-03-27 23:36:30 +08:00
|
|
|
|
const { t } = useI18n();
|
2025-03-21 09:20:29 +08:00
|
|
|
|
const props = defineProps({
|
2025-03-27 23:36:30 +08:00
|
|
|
|
listData: {
|
|
|
|
|
|
type: Array,
|
|
|
|
|
|
default: () => [],
|
|
|
|
|
|
},
|
|
|
|
|
|
showes: {
|
|
|
|
|
|
type: Boolean,
|
|
|
|
|
|
default: false,
|
|
|
|
|
|
},
|
2025-03-21 09:20:29 +08:00
|
|
|
|
});
|
2025-03-27 23:36:30 +08:00
|
|
|
|
|
2025-03-21 09:20:29 +08:00
|
|
|
|
const state = reactive({
|
2025-04-14 17:40:58 +08:00
|
|
|
|
loading: false,
|
2025-04-11 18:00:39 +08:00
|
|
|
|
f_VHUB_Text: '',
|
|
|
|
|
|
fSupplierLot: '',
|
2025-03-27 23:36:30 +08:00
|
|
|
|
dialogVisible: true,
|
|
|
|
|
|
data: [],
|
2025-04-11 18:00:39 +08:00
|
|
|
|
show: true,
|
2025-03-27 23:36:30 +08:00
|
|
|
|
formData: {},
|
|
|
|
|
|
option: {
|
|
|
|
|
|
tip: false,
|
|
|
|
|
|
selection: false,
|
|
|
|
|
|
index: true,
|
|
|
|
|
|
menu: false,
|
|
|
|
|
|
menuWidth: 150,
|
|
|
|
|
|
border: true,
|
|
|
|
|
|
delBtn: false,
|
|
|
|
|
|
editBtn: false,
|
|
|
|
|
|
align: 'center',
|
|
|
|
|
|
searchLabelWidth: 140,
|
|
|
|
|
|
searchMenuSpan: 6,
|
|
|
|
|
|
addBtn: false,
|
|
|
|
|
|
column: [
|
2025-04-14 17:40:58 +08:00
|
|
|
|
{ label: computed(() => t('message.index.DocNumber')), prop: 'fBillNo' },
|
|
|
|
|
|
{ label: computed(() => t('message.index.partNumber')), prop: 'materialCode' },
|
|
|
|
|
|
{ label: computed(() => t('message.index.materialName')), prop: 'materialName', width: '180' },
|
|
|
|
|
|
{ label: computed(() => t('message.index.unit')), prop: 'unitName' },
|
|
|
|
|
|
{ label: computed(() => t('message.index.qty')), prop: 'qty' },
|
|
|
|
|
|
{ label: computed(() => t('message.index.receivedQTY')), prop: 'sendedQty' },
|
|
|
|
|
|
{ label: computed(() => t('message.index.unreceivedQTY')), prop: 'notSendQtyText' },
|
|
|
|
|
|
{ label: computed(() => t('message.index.supplierLot')), prop: 'fSupplierLot' },
|
|
|
|
|
|
{ label: computed(() => t('message.index.shipmentQTY')), prop: 'notSendQty', width: '180' },
|
|
|
|
|
|
{ label: computed(() => t('message.index.earliestDeliveryDate')), prop: 'chengNuoJiaoQi', width: '180' },
|
|
|
|
|
|
{ label: computed(() => t('message.index.latestDeliveryDate')), prop: 'newChengNuoJiaoQi', width: '180' },
|
2025-03-27 23:36:30 +08:00
|
|
|
|
],
|
|
|
|
|
|
},
|
|
|
|
|
|
topId: '',
|
2025-04-11 18:00:39 +08:00
|
|
|
|
chengNuoJiaoQiP: '',
|
|
|
|
|
|
newChengNuoJiaoQiP: '',
|
2025-03-21 09:20:29 +08:00
|
|
|
|
});
|
2025-04-11 18:00:39 +08:00
|
|
|
|
watch(
|
|
|
|
|
|
() => props.listData,
|
|
|
|
|
|
() => {
|
|
|
|
|
|
state.data = props.listData;
|
|
|
|
|
|
state.data.forEach((item: any) => {
|
2025-04-15 19:46:09 +08:00
|
|
|
|
item.notSendQtyText = item.notSendQty;
|
2025-04-11 18:00:39 +08:00
|
|
|
|
});
|
|
|
|
|
|
}
|
2025-04-15 19:46:09 +08:00
|
|
|
|
);
|
2025-03-27 23:36:30 +08:00
|
|
|
|
const batchAddInvoiceOrderFun = () => {
|
2025-04-14 17:40:58 +08:00
|
|
|
|
if (props.listData.length != 0) {
|
|
|
|
|
|
state.loading = true;
|
|
|
|
|
|
console.log(props.listData);
|
|
|
|
|
|
let arr: any = [];
|
|
|
|
|
|
props.listData.forEach((item: any) => {
|
|
|
|
|
|
arr.push({
|
|
|
|
|
|
id: item.id,
|
2025-04-15 19:46:09 +08:00
|
|
|
|
qty: item.notSendQtyText,
|
2025-04-14 17:40:58 +08:00
|
|
|
|
fSupplierLot: item.fSupplierLot,
|
|
|
|
|
|
});
|
|
|
|
|
|
});
|
|
|
|
|
|
listApi()
|
|
|
|
|
|
.batchAddInvoiceOrder({ f_VHUB_Text: state.f_VHUB_Text, upDateList: arr })
|
|
|
|
|
|
.then((res: any) => {
|
|
|
|
|
|
state.loading = false;
|
|
|
|
|
|
if (res.resultCode === 0) {
|
2025-04-15 19:46:09 +08:00
|
|
|
|
ElMessage.success(t('message.index.success'));
|
2025-04-14 17:40:58 +08:00
|
|
|
|
emits('generateDocuments');
|
2025-04-15 19:46:09 +08:00
|
|
|
|
ElMessageBox({
|
|
|
|
|
|
closeOnClickModal: false,
|
|
|
|
|
|
closeOnPressEscape: false,
|
|
|
|
|
|
title: t('message.index.prompt'),
|
|
|
|
|
|
message: t('message.index.deliveryNote') + ':' + res.data,
|
|
|
|
|
|
confirmButtonText: t('message.index.copy'),
|
|
|
|
|
|
showCancelButton: false,
|
|
|
|
|
|
buttonSize: 'default',
|
|
|
|
|
|
beforeClose: (action, instance, done) => {
|
|
|
|
|
|
if (action === 'confirm') {
|
|
|
|
|
|
toClipboard(res.data)
|
|
|
|
|
|
ElMessage.success(t('message.index.success'))
|
|
|
|
|
|
} else {
|
|
|
|
|
|
done();
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
});
|
2025-04-14 17:40:58 +08:00
|
|
|
|
}
|
|
|
|
|
|
if (res.resultCode === -1) {
|
|
|
|
|
|
ElMessage.error(res.errorMessage);
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
} else {
|
2025-04-15 19:46:09 +08:00
|
|
|
|
ElMessage.error(t('message.index.noData'));
|
2025-04-14 17:40:58 +08:00
|
|
|
|
}
|
2025-04-11 18:00:39 +08:00
|
|
|
|
};
|
2025-04-03 01:06:09 +08:00
|
|
|
|
const closeFun = () => {
|
2025-04-11 18:00:39 +08:00
|
|
|
|
emits('close');
|
|
|
|
|
|
};
|
2025-03-21 09:20:29 +08:00
|
|
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|
2025-04-11 18:00:39 +08:00
|
|
|
|
:deep(.el-card) {
|
|
|
|
|
|
padding: 0 !important;
|
|
|
|
|
|
//height: 56px !important;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-03-27 23:36:30 +08:00
|
|
|
|
.btnList {
|
|
|
|
|
|
margin-top: 26px;
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
justify-content: center;
|
2025-03-21 09:20:29 +08:00
|
|
|
|
}
|
2025-04-11 18:00:39 +08:00
|
|
|
|
|
2025-04-03 01:06:09 +08:00
|
|
|
|
:deep(.avue-crud__left) {
|
2025-04-11 18:00:39 +08:00
|
|
|
|
flex: 1;
|
2025-04-03 01:06:09 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
:deep(.avue-crud__refreshBtn) {
|
2025-04-11 18:00:39 +08:00
|
|
|
|
display: none;
|
2025-04-03 01:06:09 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
:deep(.avue-crud__gridBtn) {
|
2025-04-11 18:00:39 +08:00
|
|
|
|
display: none;
|
2025-04-03 01:06:09 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.piliang {
|
2025-04-11 18:00: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
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.system-user-container {
|
2025-04-11 18:00:39 +08:00
|
|
|
|
//padding: 0 !important;
|
2025-04-03 01:06:09 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.multi-line-omit {
|
2025-04-11 18:00: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-11 18:00:39 +08:00
|
|
|
|
display: flex;
|
|
|
|
|
|
flex: 1;
|
2025-04-03 01:06:09 +08:00
|
|
|
|
|
2025-04-11 18:00:39 +08:00
|
|
|
|
.selectItem {
|
|
|
|
|
|
margin-right: 16px;
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
}
|
2025-04-03 01:06:09 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
:deep(.avue-crud) {
|
2025-04-11 18:00:39 +08:00
|
|
|
|
height: 100%;
|
|
|
|
|
|
width: 100%;
|
2025-04-03 01:06:09 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
:deep(.avue-crud--card) {
|
2025-04-11 18:00:39 +08:00
|
|
|
|
display: flex;
|
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
|
flex: 1;
|
2025-04-03 01:06:09 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
:deep(.avue-crud__body) {
|
2025-04-11 18:00:39 +08:00
|
|
|
|
flex: 1;
|
2025-04-03 01:06:09 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
:deep(.el-table__header) {
|
2025-04-11 18:00:39 +08:00
|
|
|
|
height: 40px;
|
2025-04-03 01:06:09 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
:deep(.el-card__body) {
|
2025-04-11 18:00:39 +08:00
|
|
|
|
width: 100% !important;
|
|
|
|
|
|
height: 100% !important;
|
|
|
|
|
|
overflow: hidden !important;
|
|
|
|
|
|
padding: 0 !important;
|
2025-04-03 01:06:09 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
:deep(.el-table__cell) {
|
2025-04-11 18:00:39 +08:00
|
|
|
|
//padding: 0 !important;
|
|
|
|
|
|
//height: 56px !important;
|
2025-04-03 01:06:09 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
:deep(.el-card) {
|
2025-04-11 18:00:39 +08:00
|
|
|
|
padding: 12px;
|
2025-04-03 01:06:09 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
:deep(.el-form) {
|
2025-04-11 18:00:39 +08:00
|
|
|
|
flex: 1;
|
2025-04-03 01:06:09 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.system-user-container {
|
2025-04-11 18:00: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-11 18:00:39 +08:00
|
|
|
|
.el-table {
|
|
|
|
|
|
flex: 1;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2025-04-03 01:06:09 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
:deep(.el-col) {
|
2025-04-11 18:00:39 +08:00
|
|
|
|
margin-bottom: 16px;
|
2025-04-03 01:06:09 +08:00
|
|
|
|
}
|
2025-03-27 23:36:30 +08:00
|
|
|
|
</style>
|