初次对接
This commit is contained in:
@@ -1,91 +1,150 @@
|
||||
<template>
|
||||
<el-dialog :model-value="props.showes" width="70%" >
|
||||
<avue-crud ref="crudRef" :data="props.listData" :option="state.option"></avue-crud>
|
||||
<div class="btnList">
|
||||
<el-button type="primary" @click="emits('generateDocuments')">生成通知单</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<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">
|
||||
<el-button type="primary" @click="batchAddInvoiceOrderFun">生成通知单</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import {defineProps, reactive, defineEmits, computed} from 'vue';
|
||||
const emits = defineEmits(['generateDocuments'])
|
||||
import { defineProps, reactive, defineEmits, computed } from 'vue';
|
||||
import { listApi } from '../../api/list/index'
|
||||
const emits = defineEmits(['generateDocuments']);
|
||||
import { useI18n } from 'vue-i18n';
|
||||
const { locale, t } = useI18n();
|
||||
import {ElMessage} from "element-plus";
|
||||
const { t } = useI18n();
|
||||
const props = defineProps({
|
||||
listData:{
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
showes:{
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
listData: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
showes: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
});
|
||||
|
||||
const state = reactive({
|
||||
dialogVisible: true,
|
||||
option: {
|
||||
tip: false,
|
||||
selection: true,
|
||||
index: true,
|
||||
menu: false,
|
||||
menuWidth: 150,
|
||||
border: true,
|
||||
delBtn: false,
|
||||
editBtn: false,
|
||||
align: 'center',
|
||||
searchLabelWidth: 140,
|
||||
searchMenuSpan: 6,
|
||||
addBtn: false,
|
||||
column: [
|
||||
{ label: computed(() => t('message.list.MaterialCode')), prop: 'FMaterialId', width: 200, search: true },
|
||||
{ label: computed(() => t('message.list.MaterialName')), prop: 'FMaterialName', width: 200, search: true },
|
||||
{ label: computed(() => t('message.list.Specification')), prop: 'FModel', width: 200, search: true },
|
||||
{ label: computed(() => t('message.list.PurchaseUnit')), prop: 'FUnitId', width: 200, search: true },
|
||||
{ label: computed(() => t('message.list.QTY')), prop: 'FPrice', width: 200 },
|
||||
{ label: computed(() => t('message.list.UP')), prop: 'FTaxPrice', width: 200 },
|
||||
{ label: computed(() => t('message.list.TotalAmount')), prop: 'FEntryAmount', width: 200 },
|
||||
{ label: computed(() => t('message.list.TotalAmountTaxInclusive')), prop: 'FAllAmount', width: 200 },
|
||||
{ label: computed(() => t('message.list.AccumulatedReceiptQTY')), prop: 'FReceiveQty', width: 200 },
|
||||
{
|
||||
label: computed(() => t('message.list.DemondDate')),
|
||||
prop: 'FDeliveryDate',
|
||||
width: 200,
|
||||
search: true,
|
||||
type: 'datetime',
|
||||
searchSpan: 12,
|
||||
searchRange: true,
|
||||
searchLabelWidth: 150,
|
||||
},
|
||||
{ label: computed(() => t('message.list.TaxAmount')), prop: 'TaxAmount', width: 200 },
|
||||
{
|
||||
label: computed(() => t('message.list.CommittedDeliveryDate')),
|
||||
prop: 'FSupDueDate',
|
||||
width: 200,
|
||||
search: true,
|
||||
type: 'datetime',
|
||||
searchSpan: 12,
|
||||
searchRange: true,
|
||||
searchLabelWidth: 150,
|
||||
},
|
||||
{
|
||||
label: computed(() => t('message.list.LatestCommittedDeliveryDate')),
|
||||
prop: 'FSupDueNewDate',
|
||||
width: 200,
|
||||
search: true,
|
||||
type: 'datetime',
|
||||
searchSpan: 12,
|
||||
searchRange: true,
|
||||
searchLabelWidth: 150,
|
||||
},
|
||||
{ label: computed(() => t('message.list.Comments2')), prop: 'FNote', width: 200 },
|
||||
],
|
||||
},
|
||||
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: [
|
||||
{ label: computed(() => t('message.list.MaterialCode')), prop: 'materialCode', width: 200 },
|
||||
{ label: computed(() => t('message.list.MaterialName')), prop: 'materialName', width: 200 },
|
||||
{ label: computed(() => t('message.list.Specification')), prop: 'specificationModel', width: 200 },
|
||||
{ label: computed(() => t('message.list.PurchaseUnit')), prop: 'FUnitId', width: 200 },
|
||||
{ label: '采购数量', prop: 'qty', width: 200 },
|
||||
{ label: '处理中数量', prop: 'processingQty', width: 200 },
|
||||
{ label: '已发货数量', prop: 'sendedQty', width: 200 },
|
||||
{ label: '未发货数量', prop: 'notSendQty', width: 200 },
|
||||
{ label: '本次发货数量', prop: 'nowSendQty', width: 200,fixed:true },
|
||||
{ label: computed(() => t('message.list.UP')), prop: 'amount1', width: 200 },
|
||||
{ label: computed(() => t('message.list.TotalAmount')), prop: 'amount2', width: 200 },
|
||||
{ label: computed(() => t('message.list.AccumulatedReceiptQTY')), prop: 'FReceiveQty', width: 200 },
|
||||
{ label: computed(() => t('message.list.TaxAmount')), prop: 'taxAmount', width: 200 },
|
||||
{ label: computed(() => t('message.list.CommittedDeliveryDate')), prop: 'chengNuoJiaoQi',
|
||||
width: 200, type: 'datetime', searchSpan: 12, searchRange: true, searchLabelWidth: 150,fixed:true },
|
||||
{
|
||||
label: computed(() => t('message.list.LatestCommittedDeliveryDate')),
|
||||
prop: 'newChengNuoJiaoQi',
|
||||
width: 200,
|
||||
type: 'datetime',
|
||||
searchSpan: 12,
|
||||
searchRange: true,
|
||||
searchLabelWidth: 150,
|
||||
fixed:true
|
||||
},
|
||||
{ label: computed(() => t('message.list.Comments2')), prop: 'remark', width: 200 },
|
||||
],
|
||||
},
|
||||
topId: '',
|
||||
});
|
||||
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);
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
.btnList{
|
||||
margin-top: 26px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
.btnList {
|
||||
margin-top: 26px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user