Browse Source

增加非SCP采购收货申请,或者修改采购收货申请页面

master_hella_20240701
yufei0306 8 months ago
parent
commit
53d4cd6f88
  1. 76
      src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestMain/index.vue
  2. 440
      src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestMain/purchasereceiptRequestMain.data.ts

76
src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestMain/index.vue

@ -42,6 +42,8 @@
<BasicForm <BasicForm
ref="formRef" ref="formRef"
@success="getList" @success="getList"
:isOpenSearchTable="true"
:indexTableColumn="1"
:rules="PurchasereceiptRequestMainRules" :rules="PurchasereceiptRequestMainRules"
:formAllSchemas="PurchasereceiptRequestMain.allSchemas" :formAllSchemas="PurchasereceiptRequestMain.allSchemas"
:tableAllSchemas="PurchasereceiptRequestDetail.allSchemas" :tableAllSchemas="PurchasereceiptRequestDetail.allSchemas"
@ -56,7 +58,6 @@
@submitForm="submitForm" @submitForm="submitForm"
@formFormDateChange="formFormDateChange" @formFormDateChange="formFormDateChange"
/> />
<!-- 详情 --> <!-- 详情 -->
<Detail <Detail
ref="detailRef" ref="detailRef"
@ -124,14 +125,18 @@ import {
PurchasereceiptRequestDetail, PurchasereceiptRequestDetail,
PurchasereceiptRequestDetailRules, PurchasereceiptRequestDetailRules,
PurchasereceiptRequestDetailLabel, PurchasereceiptRequestDetailLabel,
PurchasereceiptRequestDetailPackingNumber PurchasereceiptRequestDetailPackingNumber,
} from './purchasereceiptRequestMain.data' } from './purchasereceiptRequestMain.data'
import { PurchaseDetail } from '../../supplierdeliver/purchaseMain/purchaseMain.data'
import * as PurchasereceiptRequestMainApi from '@/api/wms/purchasereceiptRequestMain' import * as PurchasereceiptRequestMainApi from '@/api/wms/purchasereceiptRequestMain'
import * as PurchasereceiptRequestDetailApi from '@/api/wms/purchasereceiptRequestDetail' import * as PurchasereceiptRequestDetailApi from '@/api/wms/purchasereceiptRequestDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { formatDate } from '@/utils/formatTime' import { formatDate } from '@/utils/formatTime'
import * as SupplieritemApi from '@/api/wms/supplieritem' import * as SupplieritemApi from '@/api/wms/supplieritem'
import { getAccessToken } from '@/utils/auth' import { getAccessToken } from '@/utils/auth'
import * as PurchaseDetailApi from '@/api/wms/purchaseDetail'
// //
defineOptions({ name: 'PurchasereceiptRequestMain' }) defineOptions({ name: 'PurchasereceiptRequestMain' })
@ -166,17 +171,23 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
} else if(formField == 'poNumber') { } else if(formField == 'poNumber') {
row['poNumber'] = val[0]['number'] row['poNumber'] = val[0]['number']
} else if(formField == 'poLine'){ } else if(formField == 'poLine'){
row['poLine'] = val[0]['lineNumber'] //--
row['itemCode'] = val[0]['itemCode'] val.forEach(item=>{
row['uom'] = val[0]['uom'] if(tableData.value.find(item1=>item1['id'] == item['id'])) return
let supplierCode = formRef.formModel.supplierCode; const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...row}))
let itemCode = val[0]['itemCode'] newRow['poLine'] = item['lineNumber']
let queryData = { newRow['itemCode'] = item['itemCode']
supplierCode:supplierCode, newRow['uom'] = item['uom']
itemCode:itemCode newRow['poNumber'] = item['number']
} let supplierCode = formRef.formModel.supplierCode;
SupplieritemApi.getDefaultLocationCode(queryData as SupplieritemApi.SupplieritemVO).then(res =>{ let queryData = {
row['defaultToLocationCode'] = res supplierCode:supplierCode,
itemCode: item['itemCode']
}
SupplieritemApi.getDefaultLocationCode(queryData as SupplieritemApi.SupplieritemVO).then(res =>{
newRow['defaultToLocationCode'] = res
tableData.value.push(newRow)
})
}) })
}else if (formField == 'packQty'){ }else if (formField == 'packQty'){
row['packQty'] = val[0]['packQty'] row['packQty'] = val[0]['packQty']
@ -186,6 +197,16 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
const setV = {} const setV = {}
if(formField == 'supplierCode'){ if(formField == 'supplierCode'){
setV['supplierCode'] = val[0]['code'] setV['supplierCode'] = val[0]['code']
}else if(formField == 'ppNumber') {
//----
setV['supplierCode'] = val[0]['supplierCode']
setV['poNumber'] = val[0]['number']
const newRow = val[0]
newRow['poNumber'] = val[0]['number']
//
getSearchTableData(val[0]['number'],val[0]['supplierCode'])
// tableData.value = [newRow]
// formRef.handleAddTable()
} }
setV[formField] = val[0][searchField] setV[formField] = val[0][searchField]
formRef.setValues(setV) formRef.setValues(setV)
@ -351,6 +372,35 @@ const labelPrint = async (row) => {
} }
const getSearchTableData = async (number,supplierCode)=>{
const {tableObject ,tableMethods} = useTable({
defaultParams:{number},
getListApi: PurchaseDetailApi.getPurchaseDetailPage //
})
//
const { getList:getList1 } = tableMethods
await getList1()
const tableColumns = PurchaseDetail.allSchemas.tableFormColumns
tableColumns.forEach((item) => {
item.width = item.table?.width || 150
})
tableObject.tableList.forEach(row=>{
const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...row}))
newRow['poLine'] = row['lineNumber']
newRow['itemCode'] = row['itemCode']
newRow['uom'] = row['uom']
newRow['poNumber'] =row['number']
let queryData = {
supplierCode,
itemCode:row['itemCode']
}
SupplieritemApi.getDefaultLocationCode(queryData as SupplieritemApi.SupplieritemVO).then(res =>{
newRow['defaultToLocationCode'] = res
tableData.value.push(newRow)
})
})
}
/** 添加/修改操作 */ /** 添加/修改操作 */
const formRef = ref() const formRef = ref()
const openForm =async (type: string, row?: number) => { const openForm =async (type: string, row?: number) => {

440
src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestMain/purchasereceiptRequestMain.data.ts

@ -50,24 +50,24 @@ export const PurchasereceiptRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
isSearch: true, isSearch: true,
}, },
{ {
label: '供应商代码', label: '采购订单',
field: 'supplierCode', field: 'ppNumber',
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 180
}, },
isSearch: true,
form: { form: {
// labelMessage: '信息提示说明!!!', // labelMessage: '信息提示说明!!!',
componentProps: { componentProps: {
isSearchList: true, // 开启查询弹窗 isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择供应商代码', // 输入框占位文本 searchListPlaceholder: '请选择采购订单', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段 searchField: 'number', // 查询弹窗赋值字段
searchTitle: '供应商信息', // 查询弹窗标题 searchTitle: '采购订单信息', // 查询弹窗标题
searchAllSchemas: Supplier.allSchemas, // 查询弹窗所需类 searchAllSchemas: PurchaseMain.allSchemas, // 查询弹窗所需类
searchPage: SupplierApi.getSupplierPage // 查询弹窗所需分页方法 searchPage: PurchaseMainApi.getPurchaseMainPage, // 查询弹窗所需分页方法
} }
} },
isForm: true,
}, },
{ {
label: '发货单号', label: '发货单号',
@ -79,42 +79,63 @@ export const PurchasereceiptRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
isForm: true, isForm: true,
}, },
{ {
label: '要货计划单号', label: '供应商代码',
field: 'ppNumber', field: 'supplierCode',
sort: 'custom', sort: 'custom',
table: { table: {
width: 180 width: 150
}, },
isSearch: true,
form: { form: {
// labelMessage: '信息提示说明!!!', // labelMessage: '信息提示说明!!!',
componentProps: { componentProps: {
isSearchList: true, // 开启查询弹窗 disabled: true,
searchListPlaceholder: '请选择要货计划单号', // 输入框占位文本 isSearchList: false, // 开启查询弹窗
searchField: 'number', // 查询弹窗赋值字段 searchListPlaceholder: '请选择供应商代码', // 输入框占位文本
searchTitle: '要货计划信息', // 查询弹窗标题 searchField: 'code', // 查询弹窗赋值字段
searchAllSchemas: PurchasePlanMain.allSchemas, // 查询弹窗所需类 searchTitle: '供应商信息', // 查询弹窗标题
searchPage: PurchasePlanMainApi.getPurchasePlanMainPage, // 查询弹窗所需分页方法 searchAllSchemas: Supplier.allSchemas, // 查询弹窗所需类
searchCondition: [ searchPage: SupplierApi.getSupplierPage // 查询弹窗所需分页方法
{
key: 'supplierCode',
value: 'supplierCode',
message: '请填写供应商代码!',
isMainValue: true
},
{
key: 'status',
value: 4,
isMainValue: false
},
{
key: 'available',
value: "TRUE",
isMainValue: false
}]
} }
}, }
isForm: true,
}, },
// {
// label: '要货计划单号',
// field: 'ppNumber',
// sort: 'custom',
// table: {
// width: 180
// },
// form: {
// // labelMessage: '信息提示说明!!!',
// componentProps: {
// isSearchList: true, // 开启查询弹窗
// searchListPlaceholder: '请选择要货计划单号', // 输入框占位文本
// searchField: 'number', // 查询弹窗赋值字段
// searchTitle: '要货计划信息', // 查询弹窗标题
// searchAllSchemas: PurchasePlanMain.allSchemas, // 查询弹窗所需类
// searchPage: PurchasePlanMainApi.getPurchasePlanMainPage, // 查询弹窗所需分页方法
// searchCondition: [
// {
// key: 'supplierCode',
// value: 'supplierCode',
// message: '请填写供应商代码!',
// isMainValue: true
// },
// {
// key: 'status',
// value: 4,
// isMainValue: false
// },
// {
// key: 'available',
// value: "TRUE",
// isMainValue: false
// }]
// }
// },
// isForm: true,
// },
{ {
label: '承运商', label: '承运商',
field: 'carrierCode', field: 'carrierCode',
@ -141,22 +162,22 @@ export const PurchasereceiptRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
width: 150 width: 150
}, },
}, },
{ // {
label: '数据来源', // label: '数据来源',
field: 'sourceType', // field: 'sourceType',
dictType: DICT_TYPE.PURCHASERECEIPT_SOURCE_TYPE, // dictType: DICT_TYPE.PURCHASERECEIPT_SOURCE_TYPE,
sort: 'custom', // sort: 'custom',
table: { // table: {
width: 150 // width: 150
}, // },
form: { // form: {
value: 'ASN_ExternalReceipt', // value: 'ASN_ExternalReceipt',
componentProps: { // componentProps: {
disabled: true // disabled: true
} // }
}, // },
isSearch: false, // isSearch: false,
}, // },
{ {
label: '从仓库代码', label: '从仓库代码',
field: 'fromWarehouseCode', field: 'fromWarehouseCode',
@ -303,50 +324,50 @@ export const PurchasereceiptRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
}, },
isForm: false, isForm: false,
}, },
{ // {
label: '截止时间', // label: '截止时间',
field: 'dueTime', // field: 'dueTime',
formatter: dateFormatter, // formatter: dateFormatter,
detail: { // detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss' // dateFormat: 'YYYY-MM-DD HH:mm:ss'
}, // },
sort: 'custom', // sort: 'custom',
table: { // table: {
width: 180 // width: 180
}, // },
form: { // form: {
component: 'DatePicker', // component: 'DatePicker',
componentProps: { // componentProps: {
style: {width:'100%'}, // style: {width:'100%'},
type: 'datetime', // type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss', // dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x', // valueFormat: 'x',
} // }
}, // },
}, // },
{ // {
label: '部门', // label: '部门',
field: 'departmentCode', // field: 'departmentCode',
sort: 'custom', // sort: 'custom',
table: { // table: {
width: 150 // width: 150
}, // },
formatter: (_: Recordable, __: TableColumn, cellValue: number) => { // formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return userDeptArray.find((account) => account.id == cellValue)?.name // return userDeptArray.find((account) => account.id == cellValue)?.name
}, // },
form: { // form: {
value: userDept.id, // value: userDept.id,
component: 'Select', // component: 'Select',
api: () => userDeptArray, // api: () => userDeptArray,
componentProps: { // componentProps: {
disabled: true, // disabled: true,
optionsAlias: { // optionsAlias: {
labelField: 'name', // labelField: 'name',
valueField: 'id' // valueField: 'id'
} // }
} // }
} // }
}, // },
{ {
label: '状态', label: '状态',
field: 'status', field: 'status',
@ -476,6 +497,9 @@ export const PurchasereceiptRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
//表单校验 //表单校验
export const PurchasereceiptRequestMainRules = reactive({ export const PurchasereceiptRequestMainRules = reactive({
ppNumber: [
{ required: true, message: '请输入采购订单', trigger: 'blur' }
],
supplierCode: [ supplierCode: [
{ required: true, message: '请输入供应商代码', trigger: 'blur' } { required: true, message: '请输入供应商代码', trigger: 'blur' }
], ],
@ -583,6 +607,7 @@ export const PurchasereceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]
} }
}, },
tableForm:{ tableForm:{
multiple:true,
isInpuFocusShow: true, isInpuFocusShow: true,
searchListPlaceholder: '请选择订单行', // 输入框占位文本 searchListPlaceholder: '请选择订单行', // 输入框占位文本
searchField: 'lineNumber', // 查询弹窗赋值字段 searchField: 'lineNumber', // 查询弹窗赋值字段
@ -653,9 +678,49 @@ export const PurchasereceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]
isTableForm: false, isTableForm: false,
isForm: false isForm: false
}, },
// {
// label: '数量',
// field: 'qty',
// sort: 'custom',
// table: {
// width: 150
// },
// form: {
// component: 'InputNumber',
// componentProps: {
// min: 1,
// precision: 6
// },
// },
// tableForm: {
// type: 'InputNumber',
// min: 1,
// precision: 6
// }
// },
{
label: '订单数量',
field: 'orderQty',
sort: 'custom',
table: {
width: 150
},
form: {
component: 'InputNumber',
componentProps: {
min: 1,
precision: 6
},
},
tableForm: {
type: 'InputNumber',
min: 1,
precision: 6
}
},
{ {
label: '数量', label: '收货数量',
field: 'qty', field: 'receivedQty',
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150
@ -689,14 +754,76 @@ export const PurchasereceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]
} }
}, },
{ {
label: '从库位代码', label: '包装规格',
field: 'fromLocationCode', field: 'packUnit',
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150,
componentProps: {
disabled: true
}
},
tableForm:{
disabled:true
},
isTableForm: true,
isForm: true
},
{
label: '包装数量',
field: 'packQty',
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150
}, },
isTableForm: false, form: {
isForm: false componentProps: {
isSearchList: true,
searchListPlaceholder: '请选择包装',
searchField: 'packQty',
searchTitle: '物品包装信息',
searchAllSchemas: Itempackaging.allSchemas,
searchPage: ItemPackageApi.getItempackagingPageBySupplierdeliver,
searchCondition: [
{
key: 'itemCode',
value: 'itemCode',
message: '请选择订单行',
isMainValue: true
},
{
key: 'available',
value: 'TRUE',
isMainValue: false
}
]
}
},
tableForm: {
isInpuFocusShow: true,
searchListPlaceholder: '请选择包装',
searchField: 'packQty',
searchTitle: '物品包装信息',
searchAllSchemas: Itempackaging.allSchemas,
searchPage: ItemPackageApi.getItempackagingPageBySupplierdeliver,
searchCondition: [
{
key: 'itemCode',
value: 'itemCode',
message: '请选择订单行',
isMainValue: true
},
{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
},
isTableForm: true,
isForm: true
}, },
{ {
label: '默认到库位代码', label: '默认到库位代码',
@ -774,16 +901,16 @@ export const PurchasereceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]
disabled: true disabled: true
} }
}, },
{ // {
label: '替代批次', // label: '替代批次',
field: 'altBatch', // field: 'altBatch',
sort: 'custom', // sort: 'custom',
table: { // table: {
width: 150 // width: 150
}, // },
isTableForm: false, // isTableForm: false,
isForm: false // isForm: false
}, // },
{ {
label: '到货日期', label: '到货日期',
field: 'arriveDate', field: 'arriveDate',
@ -836,6 +963,17 @@ export const PurchasereceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]
valueFormat: 'x', valueFormat: 'x',
}, },
}, },
{
label: '从库位代码',
field: 'fromLocationCode',
sort: 'custom',
table: {
width: 150
},
isTableForm: false,
isForm: false
},
{ {
label: '库存状态', label: '库存状态',
field: 'inventoryStatus', field: 'inventoryStatus',
@ -852,78 +990,8 @@ export const PurchasereceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]
type: 'Select' type: 'Select'
} }
}, },
{
label: '包装数量',
field: 'packQty',
sort: 'custom',
table: {
width: 150
},
form: {
componentProps: {
isSearchList: true,
searchListPlaceholder: '请选择包装',
searchField: 'packQty',
searchTitle: '物品包装信息',
searchAllSchemas: Itempackaging.allSchemas,
searchPage: ItemPackageApi.getItempackagingPageBySupplierdeliver,
searchCondition: [
{
key: 'itemCode',
value: 'itemCode',
message: '请选择订单行',
isMainValue: true
},
{
key: 'available',
value: 'TRUE',
isMainValue: false
}
]
}
},
tableForm: {
isInpuFocusShow: true,
searchListPlaceholder: '请选择包装',
searchField: 'packQty',
searchTitle: '物品包装信息',
searchAllSchemas: Itempackaging.allSchemas,
searchPage: ItemPackageApi.getItempackagingPageBySupplierdeliver,
searchCondition: [
{
key: 'itemCode',
value: 'itemCode',
message: '请选择订单行',
isMainValue: true
},
{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
},
isTableForm: true,
isForm: true
},
{
label: '包装规格',
field: 'packUnit',
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150,
componentProps: {
disabled: true
}
},
tableForm:{
disabled:true
},
isTableForm: true,
isForm: true
},
{ {
label: '供应商计量数量', label: '供应商计量数量',
field: 'supplierPackQty', field: 'supplierPackQty',

Loading…
Cancel
Save