Browse Source

要货计划

master_hella_20240701
wangyufei 5 months ago
parent
commit
d814e01051
  1. 60
      src/api/wms/demandforecastingDetail/index.ts
  2. 6
      src/views/wms/purchasereceiptManage/supplierdeliver/purchasePlanMain/index.vue
  3. 14
      src/views/wms/purchasereceiptManage/supplierdeliver/purchasePlanMain/purchasePlanMain.data.ts

60
src/api/wms/demandforecastingDetail/index.ts

@ -15,14 +15,8 @@ export interface DemandforecastingDetailVO {
available: string available: string
} }
// 查询要货预测子列表 // 要货预测-列表和头部请求参数
export const getDemandforecastingDetailPage = async (params) => { const getPageParams = (params)=>{
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/demandforecasting-detail/senior', data })
} else {
console.log('params',params)
// 到货日期 // 到货日期
if(params.dueDate&&params.dueDate.length>0){ if(params.dueDate&&params.dueDate.length>0){
params.startDate = params.dueDate[0] params.startDate = params.dueDate[0]
@ -60,7 +54,18 @@ export const getDemandforecastingDetailPage = async (params) => {
params.detailVersion = keyValue.join(',') params.detailVersion = keyValue.join(',')
} }
params.version = '' params.version = ''
return params
}
// 查询要货预测子列表
export const getDemandforecastingDetailPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/demandforecasting-detail/senior', data })
} else {
params = getPageParams(params)
console.log('params',params)
return await request.get({ url: `/wms/demandforecasting-detail/page`, params }) return await request.get({ url: `/wms/demandforecasting-detail/page`, params })
} }
} }
@ -92,45 +97,8 @@ export const exportDemandforecastingDetail = async (params) => {
// 查询要货预测主列表 // 查询要货预测主列表
export const getPageTableHead = async (params) => { export const getPageTableHead = async (params) => {
params = getPageParams(params)
console.log('params',params) console.log('params',params)
// 到货日期
if(params.dueDate&&params.dueDate.length>0){
params.startDate = params.dueDate[0]
}
if(params.dueDate&&params.dueDate.length>1){
params.endDate = params.dueDate[1]
}
params.dueDate = ''
//计划员
if(params.planerId&&params.planerId.length>0){
params.planers = params.planerId.join(',')
}
params.planerId = ''
// 供应商代码
if(params.supplierCode&&params.supplierCode.length>0){
let keyValue = params.supplierCode.split(' ')
keyValue.forEach(item=>{item = item.trim()})
params.supplierCodes = keyValue.join(',')
}
params.supplierCode = ''
// 物料代码
if(params.itemCode&&params.itemCode.length>0){
let keyValue = params.itemCode.split(' ')
keyValue.forEach(item=>{item = item.trim()})
params.itemCodes = keyValue.join(',')
}
params.itemCode = ''
// 版本号
if(params.version&&params.version.length>0){
let keyValue = params.version.split(' ')
keyValue.forEach(item=>{item = item.trim()})
params.detailVersion = keyValue.join(',')
}
params.version = ''
return await request.get({ url: `/wms/demandforecasting-detail/queryPageTableHead`, params }) return await request.get({ url: `/wms/demandforecasting-detail/queryPageTableHead`, params })
} }

6
src/views/wms/purchasereceiptManage/supplierdeliver/purchasePlanMain/index.vue

@ -181,6 +181,10 @@
setV['planQty'] = val[0]['orderQty']-val[0]['plannedQty'] setV['planQty'] = val[0]['orderQty']-val[0]['plannedQty']
setV['available'] = val[0]['available'] setV['available'] = val[0]['available']
} }
if(formField == 'poNumber') {
//
setV['type'] = val[0]['type']
}
formRef.setValues(setV) formRef.setValues(setV)
console.log('formModel',formRef.formModel) console.log('formModel',formRef.formModel)
if(formField == 'poNumber') { if(formField == 'poNumber') {
@ -666,7 +670,6 @@ const handleSelectionPublish = async ()=>{
formRef.value.formLoading = false formRef.value.formLoading = false
return; return;
} }
if (data.subList.length == tableData.value.length) {
try { try {
if (formType === 'create') { if (formType === 'create') {
if(data.subList.length == 0){ if(data.subList.length == 0){
@ -685,7 +688,6 @@ const handleSelectionPublish = async ()=>{
} finally { } finally {
formRef.value.formLoading = false formRef.value.formLoading = false
} }
}
formRef.value.formLoading = false formRef.value.formLoading = false
} }

14
src/views/wms/purchasereceiptManage/supplierdeliver/purchasePlanMain/purchasePlanMain.data.ts

@ -156,7 +156,7 @@ export const PurchasePlanMain = useCrudSchemas(reactive<CrudSchema[]>([
}, },
{ {
label: '采购订单类型', label: '采购订单类型',
field: 'status', field: 'type',
sort: 'custom', sort: 'custom',
dictType: DICT_TYPE.PURCHASE_ORDER_TYPE, dictType: DICT_TYPE.PURCHASE_ORDER_TYPE,
dictClass: 'string', dictClass: 'string',
@ -166,7 +166,12 @@ export const PurchasePlanMain = useCrudSchemas(reactive<CrudSchema[]>([
table: { table: {
width: 150 width: 150
}, },
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
disabled: true
}
}
}, },
{ {
label: '收货人', label: '收货人',
@ -853,7 +858,7 @@ export const PurchasePlanDetail = useCrudSchemas(reactive<CrudSchema[]>([
const validatePlanQty = (rule, value, callback) => { const validatePlanQty = (rule, value, callback) => {
console.log('validatePlanQty',value) console.log('validatePlanQty',value)
const numReg = /^[\d]+$/ const numReg = /^[\d]+$/
if (numReg.test(value)&&value>0) { if (numReg.test(value)&&value>=0) {
callback() callback()
} else { } else {
callback(new Error('计划数量不能小于0')) callback(new Error('计划数量不能小于0'))
@ -872,8 +877,7 @@ export const PurchasePlanDetailRules = reactive({
], ],
planQty: [ planQty: [
{ required: true, message: '请输入计划数量', trigger: 'blur' }, { required: true, message: '请输入计划数量', trigger: 'blur' },
{ max: 0, message: '计划数量不能小于0', trigger: 'blur' } { validator:validatePlanQty, message: '计划数量不能小于0', trigger: 'blur'}
// { validator:validatePlanQty, message: '计划数量不能小于0', trigger: 'blur'}
], ],
remark: [ remark: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' } { max: 50, message: '不得超过50个字符', trigger: 'blur' }

Loading…
Cancel
Save