Browse Source

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

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

38
src/components/ImportForm/src/ImportFormStep.vue

@ -116,6 +116,7 @@ import { waitForDebugger } from 'node:inspector/promises'
import { it } from 'node:test' import { it } from 'node:test'
import { emit } from 'process' import { emit } from 'process'
import * as XLSX from 'xlsx'; import * as XLSX from 'xlsx';
import * as MaintenanceBillDateApi from '@/api/wms/maintenanceBillDate'
defineOptions({ name: 'ImportForm' }) defineOptions({ name: 'ImportForm' })
@ -320,8 +321,7 @@ const submitForm = async () => {
error.value = false error.value = false
isShowLoading.value = false isShowLoading.value = false
}else{ }else{
if (props.confirmFormSuccess) { // if (props.confirmFormSuccess) {
console.log(888,formRef.value.formModel)
const pars= props.tableObject.tableList.map(obj => { const pars= props.tableObject.tableList.map(obj => {
return { return {
id: obj.id || null , id: obj.id || null ,
@ -339,23 +339,15 @@ const submitForm = async () => {
notIncludedList: [], notIncludedList: [],
} }
}) })
await props.confirmFormSuccess(pars, try {
(msg)=>{ isShowLoading.value = true
if(msg){ await MaintenanceBillDateApi.inducedProductBatchUpdate(pars)
message.error(msg)
error.value = false
isShowLoading.value = false isShowLoading.value = false
return active.value = 2
}else{ } catch (e) {
message.success("导入成功!")
error.value = false
active.value = 2 //
isShowLoading.value = false isShowLoading.value = false
return
}
}
)
} }
return
} }
} }
if(active.value === 2){ if(active.value === 2){
@ -578,7 +570,6 @@ const opensearchTable = (
} }
const submitFormSuccess = (response: any) => { const submitFormSuccess = (response: any) => {
formLoading.value = true formLoading.value = true
console.log(response)
if (response) { if (response) {
if (response.code == 500) { if (response.code == 500) {
uploadRef.value!.clearFiles() uploadRef.value!.clearFiles()
@ -608,16 +599,12 @@ const submitFormSuccess = (response: any) => {
} else { } else {
message.success('上传成功') message.success('上传成功')
if(response.data?.successData?.failList&&response.data?.successData?.failList.length>0) { 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.tableList = response.data.successData.failList;
props.tableObject.total = response.data.successData.failList.length; props.tableObject.total = response.data.successData.failList.length;
error.value = response.data.successData.failList.some(item=>item.difference!=0); error.value = response.data.successData.failList.some(item=>item.difference!=0);
active.value = 1; active.value = 1;
} }
// else { // else {
// console.log(':', response.data.successData.successList);
// console.log('使:', props.successTableColumns);
// props.tableObject.tableList = response.data.successData.successList; // props.tableObject.tableList = response.data.successData.successList;
// props.tableObject.total = response.data.successData.successList.length; // props.tableObject.total = response.data.successData.successList.length;
// error.value = false; // error.value = false;
@ -634,10 +621,6 @@ const submitFormSuccess = (response: any) => {
// //
const currentColumns = computed(() => { 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 // active === 1
if (active.value !== 1) { if (active.value !== 1) {
@ -656,16 +639,13 @@ const currentColumns = computed(() => {
columns = Array.isArray(props.errorTableColumns?.allSchemas?.tableColumns) columns = Array.isArray(props.errorTableColumns?.allSchemas?.tableColumns)
? props.errorTableColumns?.allSchemas?.tableColumns ? props.errorTableColumns?.allSchemas?.tableColumns
: []; : [];
console.log('使用错误数据列');
} else { } else {
// 使 // 使
columns = Array.isArray(props.successTableColumns?.allSchemas?.tableColumns) columns = Array.isArray(props.successTableColumns?.allSchemas?.tableColumns)
? props.successTableColumns?.allSchemas?.tableColumns ? props.successTableColumns?.allSchemas?.tableColumns
: []; : [];
console.log('使用成功数据列');
} }
console.log('最终使用的列:', columns);
return columns; return columns;
}); });
@ -690,7 +670,6 @@ const handleExceed = (): void => {
// //
watch(() => props.tableObject?.tableList, (newVal) => { watch(() => props.tableObject?.tableList, (newVal) => {
console.log('tableList 发生变化:', newVal);
}, { deep: true }); }, { deep: true });
// //
@ -748,7 +727,6 @@ const downloadDifferenceData = () => {
quantity:item.incorporationQuantity, quantity:item.incorporationQuantity,
}; };
}); });
console.log(11, list)
emits("open-difference-data",formRef.value.formModel,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} * @returns {Array}
*/ */
export const MaintenanceBillDateMain = useCrudSchemas(reactive<CrudSchema[]>([ 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: '背番', label: '背番',
field: 'backNumber', field: 'backNumber',
@ -1381,7 +1438,7 @@ export const MaintenanceBillDateMain = useCrudSchemas(reactive<CrudSchema[]>([
tableForm:{ tableForm:{
multiple:true, multiple:true,
isInpuFocusShow: false, // 开启查询弹窗 isInpuFocusShow: false, // 开启查询弹窗
searchListPlaceholder: '请选择番', searchListPlaceholder: '请选择番',
searchField: 'backNumber', searchField: 'backNumber',
searchTitle: '物料基础信息', searchTitle: '物料基础信息',
searchAllSchemas: Itembasic.allSchemas, searchAllSchemas: Itembasic.allSchemas,
@ -1406,7 +1463,7 @@ export const MaintenanceBillDateMain = useCrudSchemas(reactive<CrudSchema[]>([
componentProps: { componentProps: {
enterSearch: true, enterSearch: true,
isSearchList: true, isSearchList: true,
searchListPlaceholder: '请选择番', searchListPlaceholder: '请选择番',
searchField: 'backNumber', searchField: 'backNumber',
searchTitle: '物料基础信息', searchTitle: '物料基础信息',
searchAllSchemas: Itembasic.allSchemas, searchAllSchemas: Itembasic.allSchemas,
@ -1416,14 +1473,14 @@ export const MaintenanceBillDateMain = useCrudSchemas(reactive<CrudSchema[]>([
value: 'TRUE', value: 'TRUE',
isMainValue: false isMainValue: false
}], }],
// verificationParams: [{ verificationParams: [{
// key: 'code', key: 'backNumber',
// action: '==', action: '==',
// value: '', value: '',
// isMainValue: false, isMainValue: false,
// isSearch: true, isSearch: true,
// isFormModel: true, isFormModel: true,
// }], // 失去焦点校验参数 }], // 失去焦点校验参数
} }
} }
}, },
@ -1468,9 +1525,10 @@ export const MaintenanceBillDateMain = useCrudSchemas(reactive<CrudSchema[]>([
component: 'DatePicker', component: 'DatePicker',
componentProps: { componentProps: {
style: { width: '100%' }, style: { width: '100%' },
type: 'datetime', type: 'date',
dateFormat: 'YYYY-MM-DD HH:mm:ss', dateFormat: 'YYYY-MM-DD',
valueFormat: 'x', valueFormat: 'x',
defaultTime: new Date('1 00:00:00')
} }
}, },
}, },
@ -1482,9 +1540,10 @@ export const MaintenanceBillDateMain = useCrudSchemas(reactive<CrudSchema[]>([
component: 'DatePicker', component: 'DatePicker',
componentProps: { componentProps: {
style: { width: '100%' }, style: { width: '100%' },
type: 'datetime', type: 'date',
dateFormat: 'YYYY-MM-DD HH:mm:ss', dateFormat: 'YYYY-MM-DD',
valueFormat: 'x', valueFormat: 'x',
defaultTime: new Date('1 23:59:59')
} }
}, },
}, },
@ -1548,6 +1607,9 @@ export const MaintenanceBillDateMain = useCrudSchemas(reactive<CrudSchema[]>([
// 维护对账日期主校验 // 维护对账日期主校验
export const MaintenanceBillDateMainRules = reactive({ export const MaintenanceBillDateMainRules = reactive({
backNumberListShow: [
{ required: true, message: '请输入纳入申领书背番', trigger: 'blur' },
],
backNumber: [ backNumber: [
{ required: true, message: '请输入背番', trigger: 'blur' }, { required: true, message: '请输入背番', trigger: 'blur' },
], ],
@ -1569,7 +1631,7 @@ export const MaintenanceBillDateMainRules = reactive({
{ type: 'number', message: '结束序号必须为数字', trigger: 'blur' } { type: 'number', message: '结束序号必须为数字', trigger: 'blur' }
], ],
reconciliationDate: [ reconciliationDate: [
{ required: true, message: '请选择顺引结束日期', trigger: 'change' }, { required: true, message: '请选择对账日期', trigger: 'change' },
], ],
}) })
/** /**
@ -1582,7 +1644,7 @@ export const MaintenanceBillDateDetail = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom', sort: 'custom',
tableForm: { tableForm: {
type: 'FormDate', type: 'FormDate',
placeholder: '请选择维护对账日期', placeholder: '请选择不包含顺引日期',
valueFormat: 'YYYYMMDD', valueFormat: 'YYYYMMDD',
} }
}, },

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

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

Loading…
Cancel
Save