Browse Source

YT-2797顺引发货记录增加【维护对账日期】功能,导入纳入受领书时,增加调整差异数据的功能

intex_online_narushoulingshu
张立 2 weeks ago
parent
commit
fa86ade896
  1. 14
      src/api/wms/maintenanceBillDate/index.ts
  2. 9
      src/components/BasicForm/src/BasicForm.vue
  3. 7
      src/components/ImportForm/src/ImportFormStep.vue
  4. 30
      src/views/wms/deliversettlementManage/inducedProduct/deliverRecordMain/deliverRecordMain.data.ts
  5. 100
      src/views/wms/deliversettlementManage/inducedProduct/deliverRecordMain/index.vue

14
src/api/wms/maintenanceBillDate/index.ts

@ -11,7 +11,8 @@ export interface MaintenanceBillDateMainVO {
endSerialNo: number, endSerialNo: number,
incorporationNumber: string, incorporationNumber: string,
backNumber: string, backNumber: string,
notIncludedList: object notIncludedList: object,
fileDataList: object
} }
// 计算发货数量 // 计算发货数量
@ -28,11 +29,14 @@ export const updateReconciliationDate = async (data: MaintenanceBillDateMainVO)
return await request.post({ url: `/wms/leadership-incorporation-doc-request/updateReconciliationDate`, data }) return await request.post({ url: `/wms/leadership-incorporation-doc-request/updateReconciliationDate`, data })
} }
// 更新对账日期 // 导入纳入受领书,差异数据页面中调整差异数量
export const updateReconciliationDate = async (data: MaintenanceBillDateMainVO) => { export const getAdjustmentReconDateList = async (data: MaintenanceBillDateMainVO) => {
return await request.post({ url: `/wms/leadership-incorporation-doc-request/updateReconciliationDate`, data }) return await request.post({ url: `wms/leadership-incorporation-doc-request/getAdjustmentReconDateList`, data })
} }
// 导入纳入受领书,差异数据页面中保存
export const inducedProductBatchUpdate = async (data: MaintenanceBillDateMainVO) => {
return await request.post({ url: `/wms/leadership-incorporation-doc-request/induced-product-batch-update`, data })
}

9
src/components/BasicForm/src/BasicForm.vue

@ -7,6 +7,8 @@
:vLoading="formLoading" :vLoading="formLoading"
@updateFullscreen="updateFullscreen" @updateFullscreen="updateFullscreen"
> >
<!-- 顺引调整差异数量页面设置loading不好用单独用此标签 -->
<div v-loading="isShowFormLoading" style="width: 100%;height: 100%;position: absolute;top: 0px;left: 0px;" v-if="isShowFormLoading"></div>
<div style="overflow-y: auto" :style="formHeight"> <div style="overflow-y: auto" :style="formHeight">
<Form <Form
ref="formRef" ref="formRef"
@ -414,6 +416,10 @@ const props = defineProps({
required: false, required: false,
default: null default: null
}, },
isShowFormLoading:{
type:Boolean,
default:false
},
}) })
const { t } = useI18n() // const { t } = useI18n() //
@ -461,6 +467,9 @@ const route = useRoute() // 路由信息
const routeName = ref('') const routeName = ref('')
const sureDisabled = ref(false) const sureDisabled = ref(false)
const tabSheet = ref('TableForm') const tabSheet = ref('TableForm')
const isShowFormLoading = computed(() => {
return props.isShowFormLoading
})
routeName.value = route.name routeName.value = route.name
const formHeight = ref({}) const formHeight = ref({})

7
src/components/ImportForm/src/ImportFormStep.vue

@ -248,6 +248,13 @@ const importUrl = ref('')
const active = ref(props.active) const active = ref(props.active)
const error = ref(false) const error = ref(false)
watch(
() => props.active,
(val) => {
active.value = val
}
)
// //
const emits = defineEmits([ const emits = defineEmits([
'success', 'success',

30
src/views/wms/deliversettlementManage/inducedProduct/deliverRecordMain/deliverRecordMain.data.ts

@ -1625,33 +1625,3 @@ export const AdjustDiffDataMain = useCrudSchemas(reactive<CrudSchema[]>([
}, },
])) ]))
/**
* @returns {Array}
*/
export const AdjustDiffDataTable = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '品番',
field: 'itemCode',
sort: 'custom',
}, {
label: '描述',
field: 'disc1',
sort: 'custom',
}, {
label: '背番',
field: 'backNumber',
sort: 'custom',
}, {
label: '纳入数量',
field: 'itemCode',
sort: 'custom',
}, {
label: '发货数量',
field: 'itemCode',
sort: 'custom',
}, {
label: '差异数量',
field: 'itemCode',
sort: 'custom',
}
]))

100
src/views/wms/deliversettlementManage/inducedProduct/deliverRecordMain/index.vue

@ -83,6 +83,7 @@
:errorTableColumns="ImportLeadershipDocErrorData" :errorTableColumns="ImportLeadershipDocErrorData"
@success="importSuccess" @success="importSuccess"
accept=".txt" accept=".txt"
:active="active1"
:isShowDownloadBtn="false" :isShowDownloadBtn="false"
:confirmFormSuccess="confirmFormSuccess" :confirmFormSuccess="confirmFormSuccess"
@searchTableSuccess="searchTableSuccess" @searchTableSuccess="searchTableSuccess"
@ -143,6 +144,7 @@
:isShowReduceButtonSelection="true" :isShowReduceButtonSelection="true"
:updateTypeEdiltSubList="true" :updateTypeEdiltSubList="true"
:detailButttondata="detailButttondata" :detailButttondata="detailButttondata"
:isShowFormLoading="isShowFormLoading"
@handleAddTable="handleAddTableBillDate" @handleAddTable="handleAddTableBillDate"
@handleDeleteTable="handleDeleteTableBillDate" @handleDeleteTable="handleDeleteTableBillDate"
@tableSelectionDelete="tableSelectionDeleteBillDate" @tableSelectionDelete="tableSelectionDeleteBillDate"
@ -154,7 +156,9 @@
<template #table> <template #table>
<div> <div>
<div class="tips">以下是调整后的数据差异情况</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}"> <template #number="{row}">
<el-button type="primary" link @click="openDetail(row, '单据号', row.number)"> <el-button type="primary" link @click="openDetail(row, '单据号', row.number)">
<span>{{ row.number }}</span> <span>{{ row.number }}</span>
@ -168,7 +172,7 @@
<script setup lang="ts"> <script setup lang="ts">
import download from '@/utils/download' import download from '@/utils/download'
import { getAccessToken } from '@/utils/auth' 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 DeliverRecordMainApi from '@/api/wms/deliverRecordMain'
import * as DeliverRecordDetailApi from '@/api/wms/deliverRecordDetail' import * as DeliverRecordDetailApi from '@/api/wms/deliverRecordDetail'
import * as MaintenanceBillDateApi from '@/api/wms/maintenanceBillDate' import * as MaintenanceBillDateApi from '@/api/wms/maintenanceBillDate'
@ -178,6 +182,7 @@ import { getJmreportBaseUrl } from '@/utils/systemParam'
import { formatDate } from '@/utils/formatTime' import { formatDate } from '@/utils/formatTime'
import { usePageLoading } from '@/hooks/web/usePageLoading' import { usePageLoading } from '@/hooks/web/usePageLoading'
import { cloneDeep } from 'lodash-es' import { cloneDeep } from 'lodash-es'
import { BasicFaultTypeRules } from '@/views/eam/basicFaultType/basicFaultType.data'
const { loadStart, loadDone } = usePageLoading() const { loadStart, loadDone } = usePageLoading()
// //
defineOptions({ name: 'InducedProduct1' }) defineOptions({ name: 'InducedProduct1' })
@ -607,6 +612,8 @@ const footButttondataAdjustDiffData = ref([
}, // }, //
defaultButtons.formCloseBtn(null) // BOM defaultButtons.formCloseBtn(null) // BOM
]) ])
const active1 = ref(0)
const isShowFormLoading = ref(false)
// //
const handleMainBillDate = async (type,row) => { const handleMainBillDate = async (type,row) => {
maintenanceBillDateRef.value.open(type,row) maintenanceBillDateRef.value.open(type,row)
@ -639,7 +646,7 @@ const footButtonClick = async (val) => {
maintenanceBillDateRef.value.dialogVisible = false maintenanceBillDateRef.value.dialogVisible = false
} }
} }
const isOk = ref(false)
watch( watch(
() => maintenanceBillDateRef.value?.formRef?.formModel, () => maintenanceBillDateRef.value?.formRef?.formModel,
(val) => { (val) => {
@ -648,6 +655,7 @@ watch(
deep: true deep: true
} }
) )
// //
const sendGoodsNum = async () => { const sendGoodsNum = async () => {
const elForm = unref(maintenanceBillDateRef.value.formRef)?.getElFormRef() const elForm = unref(maintenanceBillDateRef.value.formRef)?.getElFormRef()
@ -757,6 +765,10 @@ const openDifferenceData = (formModel,list) => {
nextTick(() => { nextTick(() => {
adjustDiffDataRef.value.formRef.setValues(formModel) adjustDiffDataRef.value.formRef.setValues(formModel)
fileDataList.value = list fileDataList.value = list
tableDatAadjustDiffData.value.tableList = []
tableDatAadjustDiffData.value.total = 0
tableDataBillDate.value = []
}) })
} }
const detailButttondataClick = (val) => { const detailButttondataClick = (val) => {
@ -765,6 +777,22 @@ const detailButttondataClick = (val) => {
handleAdjustDifferenceData() 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 handleAdjustDifferenceData = async () => {
const elForm = unref(adjustDiffDataRef.value.formRef)?.getElFormRef() const elForm = unref(adjustDiffDataRef.value.formRef)?.getElFormRef()
// //
@ -777,13 +805,71 @@ const handleAdjustDifferenceData = async () => {
return return
} }
} }
const data = unref(adjustDiffDataRef.value.formRef)?.formModel paramsData.value = unref(adjustDiffDataRef.value.formRef)?.formModel
data.notIncludedList = tableDataBillDate.value ? tableDataBillDate.value : [] paramsData.value.startDueTime = paramsData.value.startDate
data.fileDataList = fileDataList.value paramsData.value.endDueTime = paramsData.value.endDate
await submitForm(data) 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 () => { 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 () => { onMounted(async () => {

Loading…
Cancel
Save