Browse Source

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

intex_online_narushoulingshu
张立 2 weeks ago
parent
commit
72f50e732d
  1. 44
      src/components/ImportForm/src/ImportFormStep.vue
  2. 94
      src/views/wms/deliversettlementManage/inducedProduct/deliverRecordMain/deliverRecordMain.data.ts
  3. 24
      src/views/wms/deliversettlementManage/inducedProduct/deliverRecordMain/index.vue

44
src/components/ImportForm/src/ImportFormStep.vue

@ -116,6 +116,7 @@ import { waitForDebugger } from 'node:inspector/promises'
import { it } from 'node:test'
import { emit } from 'process'
import * as XLSX from 'xlsx';
import * as MaintenanceBillDateApi from '@/api/wms/maintenanceBillDate'
defineOptions({ name: 'ImportForm' })
@ -320,8 +321,7 @@ const submitForm = async () => {
error.value = false
isShowLoading.value = false
}else{
if (props.confirmFormSuccess) {
console.log(888,formRef.value.formModel)
// if (props.confirmFormSuccess) {
const pars= props.tableObject.tableList.map(obj => {
return {
id: obj.id || null ,
@ -339,23 +339,15 @@ const submitForm = async () => {
notIncludedList: [],
}
})
await props.confirmFormSuccess(pars,
(msg)=>{
if(msg){
message.error(msg)
error.value = false
isShowLoading.value = false
return
}else{
message.success("导入成功!")
error.value = false
active.value = 2 //
isShowLoading.value = false
return
}
}
)
}
try {
isShowLoading.value = true
await MaintenanceBillDateApi.inducedProductBatchUpdate(pars)
isShowLoading.value = false
active.value = 2
} catch (e) {
isShowLoading.value = false
}
return
}
}
if(active.value === 2){
@ -578,7 +570,6 @@ const opensearchTable = (
}
const submitFormSuccess = (response: any) => {
formLoading.value = true
console.log(response)
if (response) {
if (response.code == 500) {
uploadRef.value!.clearFiles()
@ -608,16 +599,12 @@ const submitFormSuccess = (response: any) => {
} else {
message.success('上传成功')
if(response.data?.successData?.failList&&response.data?.successData?.failList.length>0) {
console.log('设置差异数据:', response.data.successData.failList);
console.log('使用的列定义:', props.errorTableColumns);
props.tableObject.tableList = response.data.successData.failList;
props.tableObject.total = response.data.successData.failList.length;
error.value = response.data.successData.failList.some(item=>item.difference!=0);
active.value = 1;
}
// else {
// console.log(':', response.data.successData.successList);
// console.log('使:', props.successTableColumns);
// props.tableObject.tableList = response.data.successData.successList;
// props.tableObject.total = response.data.successData.successList.length;
// error.value = false;
@ -634,10 +621,6 @@ const submitFormSuccess = (response: any) => {
//
const currentColumns = computed(() => {
console.log('当前 active:', active.value);
console.log('tableList:', props.tableObject?.tableList);
console.log('errorTableColumns:', props.errorTableColumns);
console.log('successTableColumns:', props.successTableColumns);
// active === 1
if (active.value !== 1) {
@ -656,16 +639,13 @@ const currentColumns = computed(() => {
columns = Array.isArray(props.errorTableColumns?.allSchemas?.tableColumns)
? props.errorTableColumns?.allSchemas?.tableColumns
: [];
console.log('使用错误数据列');
} else {
// 使
columns = Array.isArray(props.successTableColumns?.allSchemas?.tableColumns)
? props.successTableColumns?.allSchemas?.tableColumns
: [];
console.log('使用成功数据列');
}
console.log('最终使用的列:', columns);
return columns;
});
@ -690,7 +670,6 @@ const handleExceed = (): void => {
//
watch(() => props.tableObject?.tableList, (newVal) => {
console.log('tableList 发生变化:', newVal);
}, { deep: true });
//
@ -748,7 +727,6 @@ const downloadDifferenceData = () => {
quantity:item.incorporationQuantity,
};
});
console.log(11, list)
emits("open-difference-data",formRef.value.formModel,list)
}

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

@ -1371,6 +1371,63 @@ export const ImportLeadershipDocErrorData = useCrudSchemas(reactive<CrudSchema[]
* @returns {Array}
*/
export const MaintenanceBillDateMain = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '纳入申领书背番',
field: 'backNumberListShow',
sort: 'custom',
table: {
width: 150
},
tableForm: {
multiple: true,
isInpuFocusShow: false, // 开启查询弹窗
searchListPlaceholder: '请选择背番',
searchField: 'backNumber',
searchTitle: '物料基础信息',
searchAllSchemas: Itembasic.allSchemas,
searchPage: ItemBasicApi.selectItembasicPageToFgAndSemibasicPage,
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}],
verificationPage: ItemBasicApi.getItemListByCodes, // 校验数去焦点输入是否正确的方法
isShowTableFormSearch: true,
verificationParams: [{
key: 'code',
action: '==',
value: '',
isMainValue: false,
isSearch: true,
isFormModel: true,
}], // 失去焦点校验参数
},
form: {
componentProps: {
multiple: true,
enterSearch: true,
isSearchList: true,
searchListPlaceholder: '请选择背番',
searchField: 'backNumber',
searchTitle: '物料基础信息',
searchAllSchemas: Itembasic.allSchemas,
searchPage: ItemBasicApi.getBackNumberPage,
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}],
verificationParams: [{
key: 'backNumber',
action: '==',
value: '',
isMainValue: false,
isSearch: true,
isFormModel: true,
}], // 失去焦点校验参数
}
}
},
{
label: '背番',
field: 'backNumber',
@ -1381,7 +1438,7 @@ export const MaintenanceBillDateMain = useCrudSchemas(reactive<CrudSchema[]>([
tableForm:{
multiple:true,
isInpuFocusShow: false, // 开启查询弹窗
searchListPlaceholder: '请选择番',
searchListPlaceholder: '请选择番',
searchField: 'backNumber',
searchTitle: '物料基础信息',
searchAllSchemas: Itembasic.allSchemas,
@ -1406,7 +1463,7 @@ export const MaintenanceBillDateMain = useCrudSchemas(reactive<CrudSchema[]>([
componentProps: {
enterSearch: true,
isSearchList: true,
searchListPlaceholder: '请选择番',
searchListPlaceholder: '请选择番',
searchField: 'backNumber',
searchTitle: '物料基础信息',
searchAllSchemas: Itembasic.allSchemas,
@ -1416,14 +1473,14 @@ export const MaintenanceBillDateMain = useCrudSchemas(reactive<CrudSchema[]>([
value: 'TRUE',
isMainValue: false
}],
// verificationParams: [{
// key: 'code',
// action: '==',
// value: '',
// isMainValue: false,
// isSearch: true,
// isFormModel: true,
// }], // 失去焦点校验参数
verificationParams: [{
key: 'backNumber',
action: '==',
value: '',
isMainValue: false,
isSearch: true,
isFormModel: true,
}], // 失去焦点校验参数
}
}
},
@ -1468,9 +1525,10 @@ export const MaintenanceBillDateMain = useCrudSchemas(reactive<CrudSchema[]>([
component: 'DatePicker',
componentProps: {
style: { width: '100%' },
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'date',
dateFormat: 'YYYY-MM-DD',
valueFormat: 'x',
defaultTime: new Date('1 00:00:00')
}
},
},
@ -1482,9 +1540,10 @@ export const MaintenanceBillDateMain = useCrudSchemas(reactive<CrudSchema[]>([
component: 'DatePicker',
componentProps: {
style: { width: '100%' },
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'date',
dateFormat: 'YYYY-MM-DD',
valueFormat: 'x',
defaultTime: new Date('1 23:59:59')
}
},
},
@ -1548,6 +1607,9 @@ export const MaintenanceBillDateMain = useCrudSchemas(reactive<CrudSchema[]>([
// 维护对账日期主校验
export const MaintenanceBillDateMainRules = reactive({
backNumberListShow: [
{ required: true, message: '请输入纳入申领书背番', trigger: 'blur' },
],
backNumber: [
{ required: true, message: '请输入背番', trigger: 'blur' },
],
@ -1569,7 +1631,7 @@ export const MaintenanceBillDateMainRules = reactive({
{ type: 'number', message: '结束序号必须为数字', trigger: 'blur' }
],
reconciliationDate: [
{ required: true, message: '请选择顺引结束日期', trigger: 'change' },
{ required: true, message: '请选择对账日期', trigger: 'change' },
],
})
/**
@ -1582,7 +1644,7 @@ export const MaintenanceBillDateDetail = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom',
tableForm: {
type: 'FormDate',
placeholder: '请选择维护对账日期',
placeholder: '请选择不包含顺引日期',
valueFormat: 'YYYYMMDD',
}
},

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

@ -197,7 +197,6 @@ const businessType = ref()
const importFileName = ref()
const tableData = ref([])
const formRef = ref()
console.log(99 , routeName.value)
const tableColumns = ref([...DeliverRecordMain.allSchemas.tableColumns, ...DeliverRecordDetail.allSchemas.tableMainColumns])
const mainAndDetaillSchemas = ref(cloneDeep(DeliverRecordMain.allSchemas))
mainAndDetaillSchemas.value.tableColumns = [...DeliverRecordMain.allSchemas.tableColumns,...DeliverRecordDetail.allSchemas.tableMainColumns]
@ -341,7 +340,6 @@ const submitForm = async (formType, submitData) => {
if(rs.length > 1) isExist = true
})
data.businessType = businessType.value
console.log(data);
if (isExist) {
return message.warning('品番重复')
}
@ -458,7 +456,6 @@ const handlePoint = async (row) => {
//
const searchFormClick = (searchData) => {
tableObject.params.isSearch = true
console.log('searchData',searchData.filters);
if(!searchData.filters){//
searchData.filters = []
}
@ -491,7 +488,6 @@ const searchFormClick = (searchData) => {
const confirmFormSuccess = (dataList,callback) => {
MaintenanceBillDateApi.inducedProductBatchUpdate(dataList).then(res => {
console.log(res)
if (res && res.code == 200) {
getList()
}
@ -520,7 +516,6 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) =>
}
const searchTableAddSuccess = (formField, searchField, val, formRef, type, row) => {
console.log(type)
if (type == 'tableForm') {
if(formField == 'itemCode') {
const tableFormKeys = {}
@ -685,13 +680,12 @@ const sendGoodsNum = async () => {
data.notIncludedList = tableDataBillDate.value&&tableDataBillDate.value.length>0 ? tableDataBillDate.value : []
data.customerOrderNumber=''
data.customerCode=''
data.incorporationNumber=''
console.log(data)
data.incorporationNumber = ''
data.backNumberList = data.backNumberListShow.split(',')
try {
maintenanceBillDateRef.value.formLoading = true
const res = await MaintenanceBillDateApi.comPuteReconciliationDate(data)
maintenanceBillDateRef.value.formLoading = false
console.log(res)
allNumber.value = res.zs
} finally {
maintenanceBillDateRef.value.formLoading = false
@ -726,7 +720,6 @@ const updateBillDate = async () => {
data.customerOrderNumber=''
data.customerCode=''
data.incorporationNumber = ''
console.log(data)
if (!allNumber.value) {
message.warning('请先计算发货数量!')
return
@ -747,9 +740,13 @@ const updateBillDate = async () => {
}
const searchTableAddSuccessBillDate = (formField, searchField, val, formRef, type, row) => {
const setV = {}
const setV = {}
if (formField == 'backNumberListShow') {
setV['backNumberListShow'] = val.map(item => item[searchField]).join(',')
} else {
setV[formField] = val[0][searchField]
formRef.setValues(setV)
}
formRef.setValues(setV)
}
const footButtonClickAdjustDiffData = async (val) => {
if (val == 'nextStep') {
@ -761,7 +758,6 @@ const footButtonClickAdjustDiffData = async (val) => {
const fileDataList = ref()
//
const openDifferenceData = (formModel,list) => {
console.log(333,formModel)
adjustDiffDataRef.value.open('create')
nextTick(() => {
adjustDiffDataRef.value.formRef.setValues(formModel)
@ -819,7 +815,6 @@ const handleAdjustDifferenceData = async () => {
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
@ -828,13 +823,11 @@ const handleAdjustDifferenceData = async () => {
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
@ -861,7 +854,6 @@ const adjustDifferenceDataNextStep = async () => {
notIncludedList: paramsData.value.notIncludedList,
}
})
console.log(111,pars)
try {
isShowFormLoading.value = true
await MaintenanceBillDateApi.inducedProductBatchUpdate(pars)

Loading…
Cancel
Save