|
|
@ -101,30 +101,38 @@ |
|
|
|
ref="maintenanceBillDateRef" |
|
|
|
fieldTableColumn="itemCode" |
|
|
|
@success="getList" |
|
|
|
:rules="DeliverRecordMainRules" |
|
|
|
:rules="MaintenanceBillDateMainRules" |
|
|
|
:formAllSchemas="MaintenanceBillDateMain.allSchemas" |
|
|
|
:tableAllSchemas="DeliverRecordDetail.allSchemas" |
|
|
|
:tableFormRules="DeliverRecordDetailRules" |
|
|
|
:tableAllSchemas="MaintenanceBillDateDetail.allSchemas" |
|
|
|
:tableFormRules="MaintenanceBillDateDetailRules" |
|
|
|
:isBusiness="true" |
|
|
|
:apiUpdate="DeliverRecordMainApi.inducedProductUpdate" |
|
|
|
:apiCreate="DeliverRecordMainApi.inducedProductCreate" |
|
|
|
fromeWhere="InducedProduct" |
|
|
|
:tableData="tableData" |
|
|
|
:handleAddTable="handleAddTable" |
|
|
|
@handleDeleteTable="handleDeleteTable" |
|
|
|
@tableSelectionDelete="tableSelectionDelete" |
|
|
|
@searchTableSuccess="searchTableAddSuccess" |
|
|
|
@submitForm="submitForm" |
|
|
|
@clearSearchInput="clearSearchInput" |
|
|
|
/> |
|
|
|
:tableData="tableDataBillDate" |
|
|
|
:isShowFooterButtton="false" |
|
|
|
:footButttondata="footButttondata" |
|
|
|
@handleAddTable="handleAddTableBillDate" |
|
|
|
@handleDeleteTable="handleDeleteTableBillDate" |
|
|
|
@tableSelectionDelete="tableSelectionDeleteBillDate" |
|
|
|
@searchTableSuccess="searchTableAddSuccessBillDate" |
|
|
|
@clearSearchInput="clearSearchInputBillDate" |
|
|
|
@footButtonClick="footButtonClick" |
|
|
|
> |
|
|
|
<template #foorter> |
|
|
|
<div style="position: absolute; left: 20px;bottom: 26px;"> |
|
|
|
发货数量合计:888 |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</BasicForm> |
|
|
|
|
|
|
|
</template> |
|
|
|
<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} from './deliverRecordMain.data' |
|
|
|
import { DeliverRecordMain,DeliverRecordMainRules,DeliverRecordDetail,DeliverRecordDetailRules,DeliverRecordImport,DeliverRecordImportRules,ImportLeadershipDocErrorData,ImportLeadershipDocTempData,MaintenanceBillDateMain,MaintenanceBillDateMainRules,MaintenanceBillDateDetail,MaintenanceBillDateDetailRules} from './deliverRecordMain.data' |
|
|
|
import * as DeliverRecordMainApi from '@/api/wms/deliverRecordMain' |
|
|
|
import * as DeliverRecordDetailApi from '@/api/wms/deliverRecordDetail' |
|
|
|
import * as MaintenanceBillDateApi from '@/api/wms/maintenanceBillDate' |
|
|
|
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
|
import { CACHE_KEY, useCache } from '@/hooks/web/useCache' |
|
|
|
import { getJmreportBaseUrl } from '@/utils/systemParam' |
|
|
@ -207,7 +215,7 @@ const HeadButttondata = [ |
|
|
|
defaultButtons.defaultImportBtn({ hasPermi: 'wms:itempackage:import' }), // 导入 |
|
|
|
defaultButtons.defaultImportBtn({ |
|
|
|
label: '维护对账日期', |
|
|
|
name: 'zdy', |
|
|
|
name: 'billDate', |
|
|
|
hide: false, |
|
|
|
type: 'primary', |
|
|
|
icon: 'ep:notebook', |
|
|
@ -246,6 +254,8 @@ const buttonBaseClick = (val, item) => { |
|
|
|
} else if (val == 'filtrate') { // 筛选 |
|
|
|
} else if (val == 'receiptOfInclusion') { // 导入纳入受领书 |
|
|
|
receiptOfInclusion() |
|
|
|
} else if (val == 'billDate') { //维护对账日期 |
|
|
|
handleMainBillDate('create') |
|
|
|
} else { // 其他按钮 |
|
|
|
console.log('其他按钮', item) |
|
|
|
} |
|
|
@ -507,7 +517,96 @@ const handleDeleteTable = (item, index) => { |
|
|
|
const tableSelectionDelete = (selection) => { |
|
|
|
tableData.value = tableData.value.filter(item => !selection.includes(item)) |
|
|
|
} |
|
|
|
|
|
|
|
const maintenanceBillDateRef = ref() |
|
|
|
const tableDataBillDate = ref([]) |
|
|
|
const tableFormKeysBillDate = {} |
|
|
|
const footButttondata = ref([ |
|
|
|
{ |
|
|
|
label: '计算发货数量', |
|
|
|
name: 'sendGoodsNum', |
|
|
|
type: 'primary', |
|
|
|
hide: false, |
|
|
|
icon: 'ep:platform', |
|
|
|
color: '', |
|
|
|
float: 'right', |
|
|
|
hasPermi: '' |
|
|
|
}, // 计算发货数量 |
|
|
|
{ |
|
|
|
label: '更新对账日期', |
|
|
|
name: 'updateBillDate', |
|
|
|
type: 'primary', |
|
|
|
hide: false, |
|
|
|
icon: 'ep:edit', |
|
|
|
color: '', |
|
|
|
float: 'right', |
|
|
|
hasPermi: '' |
|
|
|
}, // BOM下一步 |
|
|
|
defaultButtons.formCloseBtn(null) // BOM关闭 |
|
|
|
]) |
|
|
|
// 维护对账日期弹窗 |
|
|
|
const handleMainBillDate = async (type,row) => { |
|
|
|
maintenanceBillDateRef.value.open(type,row) |
|
|
|
} |
|
|
|
/** |
|
|
|
* tableForm方法 |
|
|
|
*/ |
|
|
|
MaintenanceBillDateDetail.allSchemas.tableFormColumns.forEach(item => { |
|
|
|
tableFormKeysBillDate[item.field] = item.default ? item.default : '' |
|
|
|
}) |
|
|
|
// 添加维护对账日期明细 |
|
|
|
const handleAddTableBillDate = () => { |
|
|
|
tableDataBillDate.value.push(JSON.parse(JSON.stringify(tableFormKeysBillDate))) |
|
|
|
} |
|
|
|
const handleDeleteTableBillDate = (item, index) => { |
|
|
|
let itemIndex = tableDataBillDate.value.indexOf(item) |
|
|
|
if(itemIndex>-1){ |
|
|
|
tableDataBillDate.value.splice(itemIndex, 1) |
|
|
|
} |
|
|
|
} |
|
|
|
const tableSelectionDeleteBillDate = (selection) => { |
|
|
|
tableDataBillDate.value = tableDataBillDate.value.filter(item => !selection.includes(item)) |
|
|
|
} |
|
|
|
const footButtonClick = async (val) => { |
|
|
|
if (val == 'sendGoodsNum') { |
|
|
|
sendGoodsNum() |
|
|
|
} else if (val == 'close') { |
|
|
|
formLabelRef.value.dialogVisible = false |
|
|
|
} |
|
|
|
} |
|
|
|
// 计算发货数量 |
|
|
|
const sendGoodsNum = async () => { |
|
|
|
const elForm = unref(maintenanceBillDateRef.value.formRef)?.getElFormRef() |
|
|
|
// 校验表单 |
|
|
|
if (!elForm) return |
|
|
|
const valid = await elForm.validate() |
|
|
|
if (!valid) return |
|
|
|
if (tableDataBillDate.value.length > 0) { |
|
|
|
const validateForm = await maintenanceBillDateRef.value.tableFormRef.validateForm() |
|
|
|
if (!validateForm) { |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
if (maintenanceBillDateRef.value.formRef.formModel.startDueTime >= maintenanceBillDateRef.value.formRef.formModel.endDueTime) { |
|
|
|
message.warning('顺引开始日期不能大于顺引结束日期!') |
|
|
|
return |
|
|
|
} |
|
|
|
if (maintenanceBillDateRef.value.formRef.formModel.startSerialNo >= maintenanceBillDateRef.value.formRef.formModel.endSerialNo) { |
|
|
|
message.warning('开始序号不能大于结束序号!') |
|
|
|
return |
|
|
|
} |
|
|
|
const data = { ...maintenanceBillDateRef.value.formRef.formModel } |
|
|
|
tableDataBillDate.value.forEach(item => { |
|
|
|
item.serialNo = item.serialNoShow.split(',') |
|
|
|
}) |
|
|
|
data.notIncludedList = tableDataBillDate.value |
|
|
|
console.log(data) |
|
|
|
await MaintenanceBillDateApi.comPuteReconciliationDate(data) |
|
|
|
} |
|
|
|
const searchTableAddSuccessBillDate = (formField, searchField, val, formRef, type, row) => { |
|
|
|
const setV = {} |
|
|
|
setV[formField] = val[0][searchField] |
|
|
|
formRef.setValues(setV) |
|
|
|
} |
|
|
|
/** 初始化 **/ |
|
|
|
onMounted(async () => { |
|
|
|
tableObject.params.businessType = 'InducedProduct' |
|
|
|