Browse Source

自制备件发货申请

master_hella_20240701
chenfang 6 months ago
parent
commit
8a31b638fc
  1. 11
      src/api/wms/customeritem/index.ts
  2. 13
      src/api/wms/deliverPlanMain/index.ts
  3. 13
      src/api/wms/deliverRequestMain/index.ts
  4. 29
      src/views/wms/deliversettlementManage/deliver/deliverJobMain/index.vue
  5. 28
      src/views/wms/deliversettlementManage/deliver/deliverRecordMain/index.vue
  6. 22
      src/views/wms/deliversettlementManage/deliver/deliverRequestMain/deliverRequestMain.data.ts
  7. 113
      src/views/wms/deliversettlementManage/deliver/deliverRequestMain/index.vue
  8. 22
      src/views/wms/deliversettlementManage/deliverplan/deliverPlanMain/deliverPlanMain.data.ts
  9. 60
      src/views/wms/deliversettlementManage/deliverplan/deliverPlanMain/index.vue

11
src/api/wms/customeritem/index.ts

@ -61,4 +61,15 @@ export const exportCustomeritem = async (params) => {
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/customeritem/get-import-template' })
}
// 获得业务类型筛选出的物料分页
export const getPageBusinessTypeToItemCode = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return request.post({ url: '/wms/customeritem/pageBusinessTypeToLocationSenior', data })
} else {
return await request.get({ url: `/wms/customeritem/pageBusinessTypeToItemCode`, params })
}
}

13
src/api/wms/deliverPlanMain/index.ts

@ -49,6 +49,19 @@ export const deleteDeliverPlanMain = async (id: number) => {
// 导出发货计划主 Excel
export const exportDeliverPlanMain = async (params) => {
params.businessType = 'Deliver'
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/deliver-plan-main/export-excel-senior', data })
} else {
return await request.download({ url: `/wms/deliver-plan-main/export-excel`, params })
}
}
// 导出发货计划主 Excela
export const exportZZBJDeliverPlanMain = async (params) => {
params.businessType = 'ZZBJDeliver'
if (params.isSearch) {
delete params.isSearch
const data = {...params}

13
src/api/wms/deliverRequestMain/index.ts

@ -65,6 +65,19 @@ export const deleteDeliverRequestMain = async (id: number) => {
// 导出发货申请主 Excel
export const exportDeliverRequestMain = async (params) => {
params.businessType = 'Deliver'
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/deliver-request-main/export-excel-senior', data })
} else {
return await request.download({ url: `/wms/deliver-request-main/export-excel`, params })
}
}
// 导出发货申请主 Excel
export const exportZZBJDeliverRequestMain = async (params) => {
params.businessType = 'ZZBJDeliver'
if (params.isSearch) {
delete params.isSearch
const data = {...params}

29
src/views/wms/deliversettlementManage/deliver/deliverJobMain/index.vue

@ -82,8 +82,33 @@ const { t } = useI18n() // 国际化
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const businessType = ref()
const importFileName = ref()
console.log(99 , routeName.value)
const tableColumns = ref([...DeliverJobMain.allSchemas.tableColumns,...DeliverJobDetail.allSchemas.tableMainColumns])
const { tableObject, tableMethods } = useTable({
getListApi: DeliverJobDetailApi.getDeliverJobDetailPage //
})
//
/**
* OktoholdRequestMain 合格转隔离
*/
if ( routeName.value == 'DeliverJobMain') {
tableObject.params = {
businessType: 'Deliver'
}
businessType.value = 'Deliver'
importFileName.value = '成品发货任务'
} else if ( routeName.value == 'ZZBJDeliverJobMain') {
tableObject.params = {
businessType: 'ZZBJDeliver'
}
businessType.value = 'ZZBJDeliver'
importFileName.value = '自制备件发货任务'
}
//
const updataTableColumns = (val) => {
tableColumns.value = val
@ -128,10 +153,6 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
// const Echo = ['ppNumber','poLine', 'batch', 'altBatch', 'itemCode', 'itemName', 'itemDesc1', 'itemDesc2', 'projectCode', 'qty', 'uom']
const Echo = []
const { tableObject, tableMethods } = useTable({
getListApi: DeliverJobDetailApi.getDeliverJobDetailPage //
})
//
const { getList, setSearchParams } = tableMethods

28
src/views/wms/deliversettlementManage/deliver/deliverRecordMain/index.vue

@ -78,16 +78,38 @@ const { t } = useI18n() // 国际化
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const businessType = ref()
const importFileName = ref()
console.log(99 , routeName.value)
const tableColumns = ref([...DeliverRecordMain.allSchemas.tableColumns,...DeliverRecordDetail.allSchemas.tableMainColumns])
const { tableObject, tableMethods } = useTable({
getListApi: DeliverRecordDetailApi.getDeliverRecordDetailPage //
})
//
/**
* OktoholdRequestMain 合格转隔离
*/
if ( routeName.value == 'DeliverRecordMain') {
tableObject.params = {
businessType: 'Deliver'
}
businessType.value = 'Deliver'
importFileName.value = '成品发货记录'
} else if ( routeName.value == 'ZZBJDeliverRecordMain') {
tableObject.params = {
businessType: 'ZZBJDeliver'
}
businessType.value = 'ZZBJDeliver'
importFileName.value = '自制备件发货记录'
}
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
const { tableObject, tableMethods } = useTable({
getListApi: DeliverRecordDetailApi.getDeliverRecordDetailPage //
})
//
const { getList, setSearchParams } = tableMethods

22
src/views/wms/deliversettlementManage/deliver/deliverRequestMain/deliverRequestMain.data.ts

@ -698,16 +698,7 @@ export const DeliverRequestDetail = useCrudSchemas(reactive<CrudSchema[]>([
searchField: 'itemCode',
searchTitle: '客户物料基础信息',
searchAllSchemas: Customeritem.allSchemas,
searchPage: CustomerItemApi.getCustomeritemPage,
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
},{
key: 'customerCode',
value: 'customerCode',
isMainValue: true
}]
searchPage: CustomerItemApi.getPageBusinessTypeToItemCode,
},
form: {
componentProps: {
@ -716,16 +707,7 @@ export const DeliverRequestDetail = useCrudSchemas(reactive<CrudSchema[]>([
searchField: 'itemCode',
searchTitle: '客户物料基础信息',
searchAllSchemas: Customeritem.allSchemas,
searchPage: CustomerItemApi.getCustomeritemPage,
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
},{
key: 'customerCode',
value: 'customerCode',
isMainValue: true
}]
searchPage: CustomerItemApi.getPageBusinessTypeToItemCode,
}
}
},

113
src/views/wms/deliversettlementManage/deliver/deliverRequestMain/index.vue

@ -84,7 +84,7 @@
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/deliver-request-main/import" :importTemplateData="importTemplateData"
@success="importSuccess" :updateIsDisable="true" :coverIsDisable="true" :mode="2" />
@success="importSuccess" :updateIsDisable="true" :coverIsDisable="true" :mode="2" :extend= "businessType"/>
</template>
<script setup lang="ts">
@ -107,10 +107,34 @@ routeName.value = route.name
const tableColumns = ref([...DeliverRequestMain.allSchemas.tableColumns,...DeliverRequestDetail.allSchemas.tableMainColumns])
const isShowButton = ref(true)
// //
const businessType = ref()
const importFileName = ref()
console.log(99 , routeName.value)
// //
const trueFalse = ref(false)
const { tableObject, tableMethods } = useTable({
getListApi: DeliverRequestDetailApi.getDeliverRequestDetailPage //
})
//
/**
* DeliverRequestMain 成品发货申请
*/
if ( routeName.value == 'DeliverRequestMain') {
tableObject.params = {
businessType: 'Deliver'
}
businessType.value = 'Deliver'
importFileName.value = '成品发货申请'
} else if ( routeName.value == 'ZZBJDeliverRequestMain') {
tableObject.params = {
businessType: 'ZZBJDeliver'
}
businessType.value = 'ZZBJDeliver'
importFileName.value = '自制备件发货申请'
}
//
const updataTableColumns = (val) => {
tableColumns.value = val
@ -139,54 +163,7 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
setV[formField] = val[0][searchField]
if(formField == 'deliverPlanNumber') {
setV['deliverPlanNumber'] = val[0]['number']
// if(setV['deliverPlanNumber'] != null){
// isShowButton.value = false
// }
setV['customerCode'] = val[0]['customerCode']
// getBomDisassemble
// DeliverPlanDetailApi.selectDetailByMasterID(val[0]['id'])
// .then(res => {
// res.forEach(item => {
// item.qty = item.planQty
// })
// if (res) tableData.value = res
// // tableform
// DeliverRequestDetail.allSchemas.tableFormColumns.map(item => {
// if(item.field == 'itemCode') {
// item.isInpuFocusShow = false
// item.tableForm.isInpuFocusShow = false
// item.tableForm.disabled = true
// }
// if(item.field == 'uom') {
// item.tableForm.disabled = true
// }
// })
// // tableform
// if(formField == 'customerCode'){
// console.log(1111,val);
// customerCode.value = val[0]['code']
// console.log(11112,customerCode.value);
// }
// DeliverRequestMain.allSchemas.tableFormColumns.map(item => {
// if(item.field == 'customerDockCode') {
// item.tableForm.searchCondition = [
// {
// key: 'customerCode',
// value: customerCode.value ,
// isMainValue: true
// }]
// item.form.componentProps.searchCondition = [
// {
// key: 'customerCode',
// value: customerCode.value ,
// isMainValue: true
// }]}
// else {
// delete item.tableForm.searchCondition
// delete item.form.componentProps.searchCondition
// }
// })
// })
if(formField == 'itemCode'){
console.log( val[0]);
row['uom'] = val[0]['customerUom']
@ -212,10 +189,23 @@ const searchTableSuccessDetail = (formField, searchField, val, formRef ) => {
})
}
const { tableObject, tableMethods } = useTable({
getListApi: DeliverRequestDetailApi.getDeliverRequestDetailPage //
})
// tableform
DeliverRequestDetail.allSchemas.tableFormColumns.map(item => {
if(item.field == 'itemCode') {
item.tableForm.searchCondition = [
{
key: 'businessType',
value: businessType.value ,
isMainValue: false
},]
item.form.componentProps.searchCondition = [
{
key: 'businessType',
value: businessType.value,
isMainValue: false
}]
}
})
//
const { getList, setSearchParams } = tableMethods
@ -457,8 +447,13 @@ const handleExport = async () => {
await message.exportConfirm()
//
exportLoading.value = true
const data = await DeliverRequestMainApi.exportDeliverRequestMain(tableObject.params)
download.excel(data, '发货申请主.xlsx')
if(routeName.value == 'DeliverRequestMain'){
const data = await DeliverRequestMainApi.exportDeliverRequestMain(tableObject.params)
download.excel(data, '发货申请主.xlsx')
}else{
const data = await DeliverRequestMainApi.exportZZBJDeliverRequestMain(tableObject.params)
download.excel(data, '自制备件发货申请主.xlsx')
}
} catch {
} finally {
exportLoading.value = false
@ -496,11 +491,13 @@ const submitForm = async (formType, data) => {
let rs = tableData.value.filter(filterItem => (filterItem.itemCode == item.itemCode))
if(rs.length > 1) isExist = true
})
data.businessType = businessType.value
console.log(data);
if (isExist) {
formRef.value.formLoading = false
return message.warning('物料代码重复')
}
data.subList.forEach(obj => {
data.subList.forEach(obj => {
if(obj.qty == 0){
message.warning(`数量不能为0!`)
flag.value = true
@ -542,7 +539,7 @@ const handleImport = () => {
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '发货申请主导入模版.xlsx'
templateTitle: importFileName.value + '.xlsx'
})
//

22
src/views/wms/deliversettlementManage/deliverplan/deliverPlanMain/deliverPlanMain.data.ts

@ -555,16 +555,7 @@ export const DeliverPlanDetail = useCrudSchemas(reactive<CrudSchema[]>([
searchField: 'itemCode',
searchTitle: '客户物料基础信息',
searchAllSchemas: Customeritem.allSchemas,
searchPage: CustomerItemApi.getCustomeritemPage,
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
},{
key: 'customerCode',
value: 'customerCode',
isMainValue: true
}]
searchPage: CustomerItemApi.getPageBusinessTypeToItemCode,
},
form: {
componentProps: {
@ -573,16 +564,7 @@ export const DeliverPlanDetail = useCrudSchemas(reactive<CrudSchema[]>([
searchField: 'itemCode',
searchTitle: '客户物料基础信息',
searchAllSchemas: Customeritem.allSchemas,
searchPage: CustomerItemApi.getCustomeritemPage,
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
},{
key: 'customerCode',
value: 'customerCode',
isMainValue: true
}]
searchPage: CustomerItemApi.getPageBusinessTypeToItemCode,
}
}
},

60
src/views/wms/deliversettlementManage/deliverplan/deliverPlanMain/index.vue

@ -77,7 +77,7 @@
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/deliver-plan-main/import" :importTemplateData="importTemplateData"
@success="importSuccess" :updateIsDisable="true" :coverIsDisable="true" :mode="2" />
@success="importSuccess" :updateIsDisable="true" :coverIsDisable="true" :mode="2" :extend= "businessType"/>
</template>
<script setup lang="ts">
@ -96,9 +96,35 @@ const { t } = useI18n() // 国际化
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const businessType = ref()
const importFileName = ref()
console.log(99 , routeName.value)
const customerCode = ref()
const tableColumns = ref([...DeliverPlanMain.allSchemas.tableColumns,...DeliverPlanDetail.allSchemas.tableMainColumns])
const { tableObject, tableMethods } = useTable({
getListApi: DeliverPlanDetailApi.getDeliverPlanDetailPage //
})
//
/**
* OktoholdRequestMain 合格转隔离
*/
if ( routeName.value == 'DeliverPlanMain') {
tableObject.params = {
businessType: 'Deliver'
}
businessType.value = 'Deliver'
importFileName.value = '成品发货计划'
} else if ( routeName.value == 'ZZBJDeliverPlanMain') {
tableObject.params = {
businessType: 'ZZBJDeliver'
}
businessType.value = 'ZZBJDeliver'
importFileName.value = '自制备件发货计划'
}
//
const updataTableColumns = (val) => {
tableColumns.value = val
@ -161,14 +187,28 @@ const searchTableSuccessDetail = (formField, searchField, val, formRef ) => {
})
}
// tableform
DeliverPlanDetail.allSchemas.tableFormColumns.map(item => {
if(item.field == 'itemCode') {
item.tableForm.searchCondition = [
{
key: 'businessType',
value: businessType.value ,
isMainValue: false
},]
item.form.componentProps.searchCondition = [
{
key: 'businessType',
value: businessType.value,
isMainValue: false
}]
}
})
//
// const Echo = ['ppNumber','poLine', 'batch', 'altBatch', 'itemCode', 'itemName', 'itemDesc1', 'itemDesc2', 'projectCode', 'qty', 'uom']
const Echo = []
const { tableObject, tableMethods } = useTable({
getListApi: DeliverPlanDetailApi.getDeliverPlanDetailPage //
})
//
const { getList, setSearchParams } = tableMethods
@ -360,8 +400,13 @@ const handleExport = async () => {
await message.exportConfirm()
//
exportLoading.value = true
const data = await DeliverPlanMainApi.exportDeliverPlanMain(tableObject.params)
download.excel(data, '发货计划主.xlsx')
if(routeName.value == 'DeliverRequestMain'){
const data = await DeliverPlanMainApi.exportDeliverPlanMain(tableObject.params)
download.excel(data, '发货计划主.xlsx')
}else{
const data = await DeliverRequestMainApi.exportZZBJDeliverPlanMain(tableObject.params)
download.excel(data, '自制备件发货计划主.xlsx')
}
} catch {
} finally {
exportLoading.value = false
@ -394,6 +439,7 @@ const flag = ref(false)
//
const submitForm = async (formType, data) => {
data.subList = tableData.value //
data.businessType = businessType.value
//
let isExist = false
tableData.value.forEach(item => {

Loading…
Cancel
Save