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 = () => { export const importTemplate = () => {
return request.download({ url: '/wms/customeritem/get-import-template' }) 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 // 导出发货计划主 Excel
export const exportDeliverPlanMain = async (params) => { 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) { if (params.isSearch) {
delete params.isSearch delete params.isSearch
const data = {...params} const data = {...params}

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

@ -65,6 +65,19 @@ export const deleteDeliverRequestMain = async (id: number) => {
// 导出发货申请主 Excel // 导出发货申请主 Excel
export const exportDeliverRequestMain = async (params) => { 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) { if (params.isSearch) {
delete params.isSearch delete params.isSearch
const data = {...params} const data = {...params}

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

@ -82,8 +82,33 @@ const { t } = useI18n() // 国际化
const route = useRoute() // const route = useRoute() //
const routeName = ref() const routeName = ref()
routeName.value = route.name 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 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) => { const updataTableColumns = (val) => {
tableColumns.value = 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 = ['ppNumber','poLine', 'batch', 'altBatch', 'itemCode', 'itemName', 'itemDesc1', 'itemDesc2', 'projectCode', 'qty', 'uom']
const Echo = [] const Echo = []
const { tableObject, tableMethods } = useTable({
getListApi: DeliverJobDetailApi.getDeliverJobDetailPage //
})
// //
const { getList, setSearchParams } = tableMethods const { getList, setSearchParams } = tableMethods

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

@ -78,16 +78,38 @@ const { t } = useI18n() // 国际化
const route = useRoute() // const route = useRoute() //
const routeName = ref() const routeName = ref()
routeName.value = route.name 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 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) => { const updataTableColumns = (val) => {
tableColumns.value = val tableColumns.value = val
} }
const { tableObject, tableMethods } = useTable({
getListApi: DeliverRecordDetailApi.getDeliverRecordDetailPage //
})
// //
const { getList, setSearchParams } = tableMethods 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', searchField: 'itemCode',
searchTitle: '客户物料基础信息', searchTitle: '客户物料基础信息',
searchAllSchemas: Customeritem.allSchemas, searchAllSchemas: Customeritem.allSchemas,
searchPage: CustomerItemApi.getCustomeritemPage, searchPage: CustomerItemApi.getPageBusinessTypeToItemCode,
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
},{
key: 'customerCode',
value: 'customerCode',
isMainValue: true
}]
}, },
form: { form: {
componentProps: { componentProps: {
@ -716,16 +707,7 @@ export const DeliverRequestDetail = useCrudSchemas(reactive<CrudSchema[]>([
searchField: 'itemCode', searchField: 'itemCode',
searchTitle: '客户物料基础信息', searchTitle: '客户物料基础信息',
searchAllSchemas: Customeritem.allSchemas, searchAllSchemas: Customeritem.allSchemas,
searchPage: CustomerItemApi.getCustomeritemPage, searchPage: CustomerItemApi.getPageBusinessTypeToItemCode,
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
},{
key: 'customerCode',
value: 'customerCode',
isMainValue: true
}]
} }
} }
}, },

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

@ -84,7 +84,7 @@
<!-- 导入 --> <!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/deliver-request-main/import" :importTemplateData="importTemplateData" <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> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -107,10 +107,34 @@ routeName.value = route.name
const tableColumns = ref([...DeliverRequestMain.allSchemas.tableColumns,...DeliverRequestDetail.allSchemas.tableMainColumns]) const tableColumns = ref([...DeliverRequestMain.allSchemas.tableColumns,...DeliverRequestDetail.allSchemas.tableMainColumns])
const isShowButton = ref(true) const isShowButton = ref(true)
const businessType = ref()
// // const importFileName = ref()
console.log(99 , routeName.value)
// //
const trueFalse = ref(false) 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) => { const updataTableColumns = (val) => {
tableColumns.value = val tableColumns.value = val
@ -139,54 +163,7 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
setV[formField] = val[0][searchField] setV[formField] = val[0][searchField]
if(formField == 'deliverPlanNumber') { if(formField == 'deliverPlanNumber') {
setV['deliverPlanNumber'] = val[0]['number'] setV['deliverPlanNumber'] = val[0]['number']
// if(setV['deliverPlanNumber'] != null){
// isShowButton.value = false
// }
setV['customerCode'] = val[0]['customerCode'] 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'){ if(formField == 'itemCode'){
console.log( val[0]); console.log( val[0]);
row['uom'] = val[0]['customerUom'] row['uom'] = val[0]['customerUom']
@ -212,10 +189,23 @@ const searchTableSuccessDetail = (formField, searchField, val, formRef ) => {
}) })
} }
const { tableObject, tableMethods } = useTable({ // tableform
getListApi: DeliverRequestDetailApi.getDeliverRequestDetailPage // 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 const { getList, setSearchParams } = tableMethods
@ -457,8 +447,13 @@ const handleExport = async () => {
await message.exportConfirm() await message.exportConfirm()
// //
exportLoading.value = true exportLoading.value = true
const data = await DeliverRequestMainApi.exportDeliverRequestMain(tableObject.params) if(routeName.value == 'DeliverRequestMain'){
download.excel(data, '发货申请主.xlsx') const data = await DeliverRequestMainApi.exportDeliverRequestMain(tableObject.params)
download.excel(data, '发货申请主.xlsx')
}else{
const data = await DeliverRequestMainApi.exportZZBJDeliverRequestMain(tableObject.params)
download.excel(data, '自制备件发货申请主.xlsx')
}
} catch { } catch {
} finally { } finally {
exportLoading.value = false exportLoading.value = false
@ -496,11 +491,13 @@ const submitForm = async (formType, data) => {
let rs = tableData.value.filter(filterItem => (filterItem.itemCode == item.itemCode)) let rs = tableData.value.filter(filterItem => (filterItem.itemCode == item.itemCode))
if(rs.length > 1) isExist = true if(rs.length > 1) isExist = true
}) })
data.businessType = businessType.value
console.log(data);
if (isExist) { if (isExist) {
formRef.value.formLoading = false formRef.value.formLoading = false
return message.warning('物料代码重复') return message.warning('物料代码重复')
} }
data.subList.forEach(obj => { data.subList.forEach(obj => {
if(obj.qty == 0){ if(obj.qty == 0){
message.warning(`数量不能为0!`) message.warning(`数量不能为0!`)
flag.value = true flag.value = true
@ -542,7 +539,7 @@ const handleImport = () => {
// //
const importTemplateData = reactive({ const importTemplateData = reactive({
templateUrl: '', 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', searchField: 'itemCode',
searchTitle: '客户物料基础信息', searchTitle: '客户物料基础信息',
searchAllSchemas: Customeritem.allSchemas, searchAllSchemas: Customeritem.allSchemas,
searchPage: CustomerItemApi.getCustomeritemPage, searchPage: CustomerItemApi.getPageBusinessTypeToItemCode,
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
},{
key: 'customerCode',
value: 'customerCode',
isMainValue: true
}]
}, },
form: { form: {
componentProps: { componentProps: {
@ -573,16 +564,7 @@ export const DeliverPlanDetail = useCrudSchemas(reactive<CrudSchema[]>([
searchField: 'itemCode', searchField: 'itemCode',
searchTitle: '客户物料基础信息', searchTitle: '客户物料基础信息',
searchAllSchemas: Customeritem.allSchemas, searchAllSchemas: Customeritem.allSchemas,
searchPage: CustomerItemApi.getCustomeritemPage, searchPage: CustomerItemApi.getPageBusinessTypeToItemCode,
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
},{
key: 'customerCode',
value: 'customerCode',
isMainValue: true
}]
} }
} }
}, },

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

@ -77,7 +77,7 @@
<!-- 导入 --> <!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/deliver-plan-main/import" :importTemplateData="importTemplateData" <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> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -96,9 +96,35 @@ const { t } = useI18n() // 国际化
const route = useRoute() // const route = useRoute() //
const routeName = ref() const routeName = ref()
routeName.value = route.name routeName.value = route.name
const businessType = ref()
const importFileName = ref()
console.log(99 , routeName.value)
const customerCode = ref() const customerCode = ref()
const tableColumns = ref([...DeliverPlanMain.allSchemas.tableColumns,...DeliverPlanDetail.allSchemas.tableMainColumns]) 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) => { const updataTableColumns = (val) => {
tableColumns.value = 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 = ['ppNumber','poLine', 'batch', 'altBatch', 'itemCode', 'itemName', 'itemDesc1', 'itemDesc2', 'projectCode', 'qty', 'uom']
const Echo = [] const Echo = []
const { tableObject, tableMethods } = useTable({
getListApi: DeliverPlanDetailApi.getDeliverPlanDetailPage //
})
// //
const { getList, setSearchParams } = tableMethods const { getList, setSearchParams } = tableMethods
@ -360,8 +400,13 @@ const handleExport = async () => {
await message.exportConfirm() await message.exportConfirm()
// //
exportLoading.value = true exportLoading.value = true
const data = await DeliverPlanMainApi.exportDeliverPlanMain(tableObject.params) if(routeName.value == 'DeliverRequestMain'){
download.excel(data, '发货计划主.xlsx') const data = await DeliverPlanMainApi.exportDeliverPlanMain(tableObject.params)
download.excel(data, '发货计划主.xlsx')
}else{
const data = await DeliverRequestMainApi.exportZZBJDeliverPlanMain(tableObject.params)
download.excel(data, '自制备件发货计划主.xlsx')
}
} catch { } catch {
} finally { } finally {
exportLoading.value = false exportLoading.value = false
@ -394,6 +439,7 @@ const flag = ref(false)
// //
const submitForm = async (formType, data) => { const submitForm = async (formType, data) => {
data.subList = tableData.value // data.subList = tableData.value //
data.businessType = businessType.value
// //
let isExist = false let isExist = false
tableData.value.forEach(item => { tableData.value.forEach(item => {

Loading…
Cancel
Save