|
|
@ -83,6 +83,7 @@ |
|
|
|
:errorTableColumns="ImportLeadershipDocErrorData" |
|
|
|
@success="importSuccess" |
|
|
|
accept=".txt" |
|
|
|
:active="active1" |
|
|
|
:isShowDownloadBtn="false" |
|
|
|
:confirmFormSuccess="confirmFormSuccess" |
|
|
|
@searchTableSuccess="searchTableSuccess" |
|
|
@ -143,6 +144,7 @@ |
|
|
|
:isShowReduceButtonSelection="true" |
|
|
|
:updateTypeEdiltSubList="true" |
|
|
|
:detailButttondata="detailButttondata" |
|
|
|
:isShowFormLoading="isShowFormLoading" |
|
|
|
@handleAddTable="handleAddTableBillDate" |
|
|
|
@handleDeleteTable="handleDeleteTableBillDate" |
|
|
|
@tableSelectionDelete="tableSelectionDeleteBillDate" |
|
|
@ -154,7 +156,9 @@ |
|
|
|
<template #table> |
|
|
|
<div> |
|
|
|
<div class="tips">以下是调整后的数据差异情况</div> |
|
|
|
<Table v-clientTable :columns="AdjustDiffDataTable.allSchemas.tableColumns" :data="tableObject.tableList" :loading="tableObject.loading" :pagination="{ total: tableObject.total }" v-model:pageSize="tableObject.pageSize" v-model:currentPage="tableObject.currentPage" v-model:sort="tableObject.sort" style="width: calc(100% - 6px);"> |
|
|
|
<Table v-clientTable :columns="ImportLeadershipDocErrorData?.allSchemas?.tableColumns" :data="tableDatAadjustDiffData.tableList" |
|
|
|
:loading="tableDatAadjustDiffData.loading" |
|
|
|
:pagination="{ total: tableDatAadjustDiffData.total }" v-model:pageSize="tableDatAadjustDiffData.pageSize" v-model:currentPage="tableDatAadjustDiffData.currentPage" v-model:sort="tableDatAadjustDiffData.sort" style="width: calc(100% - 6px);"> |
|
|
|
<template #number="{row}"> |
|
|
|
<el-button type="primary" link @click="openDetail(row, '单据号', row.number)"> |
|
|
|
<span>{{ row.number }}</span> |
|
|
@ -168,7 +172,7 @@ |
|
|
|
<script setup lang="ts"> |
|
|
|
import download from '@/utils/download' |
|
|
|
import { getAccessToken } from '@/utils/auth' |
|
|
|
import { DeliverRecordMain,DeliverRecordMainRules,DeliverRecordDetail,DeliverRecordDetailRules,DeliverRecordImport,DeliverRecordImportRules,ImportLeadershipDocErrorData,ImportLeadershipDocTempData,MaintenanceBillDateMain,MaintenanceBillDateMainRules,MaintenanceBillDateDetail,MaintenanceBillDateDetailRules,AdjustDiffDataMain,AdjustDiffDataTable} from './deliverRecordMain.data' |
|
|
|
import { DeliverRecordMain,DeliverRecordMainRules,DeliverRecordDetail,DeliverRecordDetailRules,DeliverRecordImport,DeliverRecordImportRules,ImportLeadershipDocErrorData,ImportLeadershipDocTempData,MaintenanceBillDateMain,MaintenanceBillDateMainRules,MaintenanceBillDateDetail,MaintenanceBillDateDetailRules,AdjustDiffDataMain} from './deliverRecordMain.data' |
|
|
|
import * as DeliverRecordMainApi from '@/api/wms/deliverRecordMain' |
|
|
|
import * as DeliverRecordDetailApi from '@/api/wms/deliverRecordDetail' |
|
|
|
import * as MaintenanceBillDateApi from '@/api/wms/maintenanceBillDate' |
|
|
@ -178,6 +182,7 @@ import { getJmreportBaseUrl } from '@/utils/systemParam' |
|
|
|
import { formatDate } from '@/utils/formatTime' |
|
|
|
import { usePageLoading } from '@/hooks/web/usePageLoading' |
|
|
|
import { cloneDeep } from 'lodash-es' |
|
|
|
import { BasicFaultTypeRules } from '@/views/eam/basicFaultType/basicFaultType.data' |
|
|
|
const { loadStart, loadDone } = usePageLoading() |
|
|
|
// 发货记录主 |
|
|
|
defineOptions({ name: 'InducedProduct1' }) |
|
|
@ -607,6 +612,8 @@ const footButttondataAdjustDiffData = ref([ |
|
|
|
}, // 下一步 |
|
|
|
defaultButtons.formCloseBtn(null) // BOM关闭 |
|
|
|
]) |
|
|
|
const active1 = ref(0) |
|
|
|
const isShowFormLoading = ref(false) |
|
|
|
// 维护对账日期弹窗 |
|
|
|
const handleMainBillDate = async (type,row) => { |
|
|
|
maintenanceBillDateRef.value.open(type,row) |
|
|
@ -639,7 +646,7 @@ const footButtonClick = async (val) => { |
|
|
|
maintenanceBillDateRef.value.dialogVisible = false |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
const isOk = ref(false) |
|
|
|
watch( |
|
|
|
() => maintenanceBillDateRef.value?.formRef?.formModel, |
|
|
|
(val) => { |
|
|
@ -648,6 +655,7 @@ watch( |
|
|
|
deep: true |
|
|
|
} |
|
|
|
) |
|
|
|
|
|
|
|
// 计算发货数量 |
|
|
|
const sendGoodsNum = async () => { |
|
|
|
const elForm = unref(maintenanceBillDateRef.value.formRef)?.getElFormRef() |
|
|
@ -716,7 +724,7 @@ const updateBillDate = async () => { |
|
|
|
data.notIncludedList = tableDataBillDate.value&&tableDataBillDate.value.length>0 ? tableDataBillDate.value : [] |
|
|
|
data.customerOrderNumber='' |
|
|
|
data.customerCode='' |
|
|
|
data.incorporationNumber='' |
|
|
|
data.incorporationNumber = '' |
|
|
|
console.log(data) |
|
|
|
if (!allNumber.value) { |
|
|
|
message.warning('请先计算发货数量!') |
|
|
@ -757,6 +765,10 @@ const openDifferenceData = (formModel,list) => { |
|
|
|
nextTick(() => { |
|
|
|
adjustDiffDataRef.value.formRef.setValues(formModel) |
|
|
|
fileDataList.value = list |
|
|
|
tableDatAadjustDiffData.value.tableList = [] |
|
|
|
tableDatAadjustDiffData.value.total = 0 |
|
|
|
tableDataBillDate.value = [] |
|
|
|
|
|
|
|
}) |
|
|
|
} |
|
|
|
const detailButttondataClick = (val) => { |
|
|
@ -765,6 +777,22 @@ const detailButttondataClick = (val) => { |
|
|
|
handleAdjustDifferenceData() |
|
|
|
} |
|
|
|
} |
|
|
|
const tableDatAadjustDiffData = ref({ |
|
|
|
tableList: [], |
|
|
|
pageSize: 10, |
|
|
|
currentPage: 1, |
|
|
|
total: 0, |
|
|
|
loading:false |
|
|
|
}) |
|
|
|
watch( |
|
|
|
() => tableDataBillDate.value.length, |
|
|
|
(val) => { |
|
|
|
isOk.value = false |
|
|
|
},{ |
|
|
|
deep: true |
|
|
|
} |
|
|
|
) |
|
|
|
const paramsData = ref() |
|
|
|
const handleAdjustDifferenceData = async () => { |
|
|
|
const elForm = unref(adjustDiffDataRef.value.formRef)?.getElFormRef() |
|
|
|
// 校验表单 |
|
|
@ -777,13 +805,71 @@ const handleAdjustDifferenceData = async () => { |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
const data = unref(adjustDiffDataRef.value.formRef)?.formModel |
|
|
|
data.notIncludedList = tableDataBillDate.value ? tableDataBillDate.value : [] |
|
|
|
data.fileDataList = fileDataList.value |
|
|
|
await submitForm(data) |
|
|
|
paramsData.value = unref(adjustDiffDataRef.value.formRef)?.formModel |
|
|
|
paramsData.value.startDueTime = paramsData.value.startDate |
|
|
|
paramsData.value.endDueTime = paramsData.value.endDate |
|
|
|
paramsData.value.startSerialNo = paramsData.value.startNo |
|
|
|
paramsData.value.endSerialNo = paramsData.value.endNo |
|
|
|
paramsData.value.productionLineCode = paramsData.value.type |
|
|
|
paramsData.value.notIncludedList = tableDataBillDate.value ? tableDataBillDate.value : [] |
|
|
|
paramsData.value.fileDataList = fileDataList.value |
|
|
|
try { |
|
|
|
isShowFormLoading.value = true |
|
|
|
tableDatAadjustDiffData.value.tableList = [] |
|
|
|
tableDatAadjustDiffData.value.total=0 |
|
|
|
const res = await MaintenanceBillDateApi.getAdjustmentReconDateList(paramsData.value) |
|
|
|
console.log(22,res) |
|
|
|
tableDatAadjustDiffData.value.tableList = res.failList |
|
|
|
tableDatAadjustDiffData.value.total = res.failList.length |
|
|
|
isOk.value = true |
|
|
|
isShowFormLoading.value = false |
|
|
|
} catch { |
|
|
|
isOk.value = false |
|
|
|
isShowFormLoading.value = false |
|
|
|
} finally { |
|
|
|
console.log(999,isOk.value) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 调整差异数量下一步 |
|
|
|
const adjustDifferenceDataNextStep = async () => { |
|
|
|
console.log(8899,isOk.value) |
|
|
|
if(!isOk.value) { |
|
|
|
message.warning('请先调整差异数量') |
|
|
|
return |
|
|
|
} |
|
|
|
const isNext = tableDatAadjustDiffData.value.tableList.some(item=>item.difference!=0) |
|
|
|
// if(isNext) { |
|
|
|
// message.warning('纳入数量与发货数量不一致') |
|
|
|
// return |
|
|
|
// } |
|
|
|
const pars= tableDatAadjustDiffData.value.tableList.map(obj => { |
|
|
|
return { |
|
|
|
id: obj.id || null , |
|
|
|
type: paramsData.value.productionLineCode, |
|
|
|
orderNumber: paramsData.value.customerOrderNumber, |
|
|
|
materialCode: obj.materialCode, |
|
|
|
backNumber: obj.backNumber, |
|
|
|
quantity: obj.incorporationQuantity, |
|
|
|
materialDesc: obj.materialDesc, |
|
|
|
startDate: paramsData.value.startDate, |
|
|
|
startNo: paramsData.value.startNo, |
|
|
|
endDate: paramsData.value.endDate, |
|
|
|
endNo: paramsData.value.endNo, |
|
|
|
customerCode: paramsData.value.customerCode, |
|
|
|
notIncludedList: paramsData.value.notIncludedList, |
|
|
|
} |
|
|
|
}) |
|
|
|
console.log(111,pars) |
|
|
|
try { |
|
|
|
isShowFormLoading.value = true |
|
|
|
await MaintenanceBillDateApi.inducedProductBatchUpdate(pars) |
|
|
|
isShowFormLoading.value = false |
|
|
|
adjustDiffDataRef.value.dialogVisible = false |
|
|
|
active1.value = 2 |
|
|
|
} catch { |
|
|
|
isShowFormLoading.value = false |
|
|
|
} |
|
|
|
} |
|
|
|
/** 初始化 **/ |
|
|
|
onMounted(async () => { |
|
|
|