2025-03-21 09:20:29 +08:00
|
|
|
<template>
|
2025-03-27 23:36:30 +08:00
|
|
|
<el-dialog :model-value="props.showes" width="70%">
|
|
|
|
|
<avue-crud
|
|
|
|
|
ref="crudRef"
|
|
|
|
|
:data="props.listData"
|
|
|
|
|
:option="state.option"
|
|
|
|
|
>
|
|
|
|
|
<template #nowSendQty="{row}">
|
|
|
|
|
<div style="display: flex;align-items: center;justify-content: center">
|
|
|
|
|
<el-input-number v-model="row.nowSendQty" :min="1"/>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<template #chengNuoJiaoQi="{row}">
|
|
|
|
|
<div style="display: flex;align-items: center;justify-content: center">
|
|
|
|
|
<el-date-picker v-model="row.chengNuoJiaoQi" type="date" size="large" style="width: 100%" format="YYYY/MM/DD"
|
|
|
|
|
value-format="YYYY-MM-DD" @change="chengNuoJiaoQiChange(row)"/>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<template #newChengNuoJiaoQi="{row}">
|
|
|
|
|
<div style="display: flex;align-items: center;justify-content: center">
|
|
|
|
|
<el-date-picker v-model="row.newChengNuoJiaoQi" type="date" size="large" style="width: 100%" format="YYYY/MM/DD"
|
|
|
|
|
value-format="YYYY-MM-DD" @change="newChengNuoJiaoQiChange(row)"/>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
</avue-crud>
|
|
|
|
|
<div class="btnList">
|
2025-04-01 23:48:13 +08:00
|
|
|
<el-button type="primary" @click="batchAddInvoiceOrderFun">确定</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-03-27 23:36:30 +08:00
|
|
|
import { defineProps, reactive, defineEmits, computed } from 'vue';
|
|
|
|
|
import { listApi } from '../../api/list/index'
|
|
|
|
|
const emits = defineEmits(['generateDocuments']);
|
2025-03-24 16:46:34 +08:00
|
|
|
import { useI18n } from 'vue-i18n';
|
2025-03-27 23:36:30 +08:00
|
|
|
import {ElMessage} from "element-plus";
|
|
|
|
|
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-03-27 23:36:30 +08:00
|
|
|
dialogVisible: true,
|
|
|
|
|
data: [],
|
|
|
|
|
show:true,
|
|
|
|
|
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-01 23:48:13 +08:00
|
|
|
{ label: 'PO号', prop: 'materialCode', },
|
|
|
|
|
{ label: '物料编码', prop: 'materialCode', },
|
|
|
|
|
{ label: '物料名称', prop: 'materialCode', },
|
|
|
|
|
{ label: '采购单位', prop: 'materialCode', },
|
|
|
|
|
{ label: '本次发货数量', prop: 'materialCode', },
|
|
|
|
|
{ label: '采购数量', prop: 'materialCode', },
|
|
|
|
|
{ label: '已发货数量', prop: 'materialCode', },
|
|
|
|
|
// { label: computed(() => t('message.list.MaterialName')), prop: 'materialName', },
|
|
|
|
|
// { label: computed(() => t('message.list.Specification')), prop: 'specificationModel', },
|
|
|
|
|
// { label: computed(() => t('message.list.PurchaseUnit')), prop: 'FUnitId', },
|
|
|
|
|
// { label: '采购数量', prop: 'qty', },
|
|
|
|
|
// { label: '处理中数量', prop: 'processingQty', },
|
|
|
|
|
// { label: '已发货数量', prop: 'sendedQty', },
|
|
|
|
|
// { label: '未发货数量', prop: 'notSendQty', },
|
|
|
|
|
// { label: '本次发货数量', prop: 'nowSendQty', ,fixed:true },
|
|
|
|
|
// { label: computed(() => t('message.list.UP')), prop: 'amount1', },
|
|
|
|
|
// { label: computed(() => t('message.list.TotalAmount')), prop: 'amount2', },
|
|
|
|
|
// { label: computed(() => t('message.list.AccumulatedReceiptQTY')), prop: 'FReceiveQty', },
|
|
|
|
|
// { label: computed(() => t('message.list.TaxAmount')), prop: 'taxAmount', },
|
|
|
|
|
// { label: computed(() => t('message.list.CommittedDeliveryDate')), prop: 'chengNuoJiaoQi',
|
|
|
|
|
// , type: 'datetime', searchSpan: 12, searchRange: true, searchLabelWidth: 150,fixed:true },
|
|
|
|
|
// {
|
|
|
|
|
// label: computed(() => t('message.list.LatestCommittedDeliveryDate')),
|
|
|
|
|
// prop: 'newChengNuoJiaoQi',
|
|
|
|
|
// ,
|
|
|
|
|
// type: 'datetime',
|
|
|
|
|
// searchSpan: 12,
|
|
|
|
|
// searchRange: true,
|
|
|
|
|
// searchLabelWidth: 150,
|
|
|
|
|
// fixed:true
|
|
|
|
|
// },
|
|
|
|
|
// { label: computed(() => t('message.list.Comments2')), prop: 'remark', },
|
2025-03-27 23:36:30 +08:00
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
topId: '',
|
2025-03-21 09:20:29 +08:00
|
|
|
});
|
2025-03-27 23:36:30 +08:00
|
|
|
const chengNuoJiaoQiChange = (item:any) => {
|
|
|
|
|
listApi().batchSetChengNuoJiaoQi([{
|
|
|
|
|
id:item.id,
|
|
|
|
|
newTime:item.chengNuoJiaoQi
|
|
|
|
|
}]).then((res:any) => {
|
|
|
|
|
if(res.resultCode === 0){
|
|
|
|
|
ElMessage.success('操作成功');
|
|
|
|
|
}
|
|
|
|
|
if(res.resultCode === -1){
|
|
|
|
|
ElMessage.success(res.errorMessage);
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
const newChengNuoJiaoQiChange = (item:any) => {
|
|
|
|
|
listApi().batchSetNewChengNuoJiaoQi([{
|
|
|
|
|
id:item.id,
|
|
|
|
|
newTime:item.newChengNuoJiaoQi
|
|
|
|
|
}]).then((res:any) => {
|
|
|
|
|
if(res.resultCode === 0){
|
|
|
|
|
ElMessage.success('操作成功');
|
|
|
|
|
}
|
|
|
|
|
if(res.resultCode === -1){
|
|
|
|
|
ElMessage.success(res.errorMessage);
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
const batchAddInvoiceOrderFun = () => {
|
|
|
|
|
console.log(props.listData)
|
|
|
|
|
let arr:any = []
|
|
|
|
|
props.listData.forEach((item:any) => {
|
|
|
|
|
arr.push({
|
|
|
|
|
id:item.id,
|
|
|
|
|
qty:item.nowSendQty
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
listApi().batchAddInvoiceOrder(arr).then((res:any) => {
|
|
|
|
|
if(res.resultCode === 0){
|
|
|
|
|
ElMessage.success('操作成功');
|
|
|
|
|
emits('generateDocuments')
|
|
|
|
|
}
|
|
|
|
|
if(res.resultCode === -1){
|
|
|
|
|
ElMessage.success(res.errorMessage);
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
2025-03-21 09:20:29 +08:00
|
|
|
</script>
|
|
|
|
|
<style scoped lang="scss">
|
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-03-27 23:36:30 +08:00
|
|
|
</style>
|