Browse Source

更新要货预测FWHL-37

hella_online_20241226
王宇飞 3 months ago
parent
commit
7c5d656052
  1. 6
      src/api/wms/demandforecastingMain/index.ts
  2. 6
      src/locales/en-US.ts
  3. 9
      src/locales/zh-CN.ts
  4. 97
      src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingMain/demandforecastingMain.data.ts
  5. 88
      src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingMain/index.vue

6
src/api/wms/demandforecastingMain/index.ts

@ -156,4 +156,10 @@ export const updateIsRead = async (data) => {
return await request.post({ url: `/wms/demandforecasting-main/updateIsRead`,data })
}
//更新要货预测
export const updateDemandforecaste = async (data) => {
return await request.post({ url: `/wms/demandforecasting-detail/queryQADDemandforecasting`,data })
}

6
src/locales/en-US.ts

@ -1602,6 +1602,12 @@ export default {
'周转箱(周转包装)':'Turnover box (turnover packing)',
'外购件':'Outside purchased parts',
'请填供应商信息!':'Please fill in the supplier information!',
:'Update demand forecast',
:'All updated',
:'Updated by vendor',
:'Update by material',
'填写物料号(填写多个物料号)':'Fill in the material number (fill in multiple material numbers)',
'填写供应商代码(填写多个供应商)':'Fill in the vendor code (fill in multiple vendors)',
},

9
src/locales/zh-CN.ts

@ -1600,9 +1600,12 @@ export default {
'周转箱(周转包装)':'周转箱(周转包装)',
'外购件':'外购件',
'请填供应商信息!':'请填供应商信息!',
// 自制备件:'',
// 自制备件:'',
// 自制备件:'',
:'更新要货预测',
:'全部更新',
:'按供应商更新',
:'按物料更新',
'填写物料号(填写多个物料号)':'填写物料号(填写多个物料号)',
'填写供应商代码(填写多个供应商)':'填写供应商代码(填写多个供应商)',

97
src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingMain/demandforecastingMain.data.ts

@ -501,3 +501,100 @@ export const DemandforecastingDetailRules = reactive({
],
poLine: [{required:true, message: '请选择订单行', trigger: 'blur'}]
})
export const UpdateMain = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '全部更新',
field: 'isAll',
sort: 'custom',
isForm: true,
dictType: DICT_TYPE.FALSE_OR_TRUE,
dictClass: 'string',
form: {
component: 'Radio',
// value: 1,
// componentProps:{
// options: [{
// value: 1,
// label: '全部更新'
// },
// {
// value: 2,
// label: '按供应商更新'
// },
// {
// value: 3,
// label: '按物料更新'
// }]
// }
},
},
{
label: '供应商代码',
field: 'supplierCode',
sort: 'custom',
table: {
width: 150,
},
form: {
componentProps: {
disabled:true,
dialogWidth:'700px',//搜索出来弹窗的宽度
multiple: true,
enterSearch:false,
isSearchList: false, // 开启查询弹窗
searchListPlaceholder: '填写供应商代码(填写多个供应商)', // 输入框占位文本
searchField: 'supplierCode', // 查询弹窗赋值字段
searchTitle: '供应商信息', // 查询弹窗标题
searchAllSchemas: Supplier1.allSchemas, // 查询弹窗所需类
searchPage: DemandforecastingMainApi.querySupplierList, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}],
// verificationParams: [{
// key: 'codes',
// action: '==',
// value: '',
// isMainValue: false,
// isSearch: true,
// isFormModel: true,
// }],
// verificationPage: DemandforecastingMainApi.querySupplierList, // 校验数去焦点输入是否正确的方法
}
}
},
{
label: '物料代码',
field: 'itemCode',
sort: 'custom',
isForm: true,
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
disabled:true,
dialogWidth:'700px',//搜索出来弹窗的宽度
multiple: true,
enterSearch:false,
isSearchList: false, // 开启查询弹窗
searchListPlaceholder: '填写物料号(填写多个物料号)', // 输入框占位文本
searchField: 'itemCode', // 查询弹窗赋值字段
searchTitle: '物料基础信息', // 查询弹窗标题
searchAllSchemas: Supplieritem.allSchemas, // 查询弹窗所需类
searchPage: SupplieritemApi.getSupplieritemPageSCP, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
}
}
]))
//表单校验
export const UpdateMainRules = reactive({
})

88
src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingMain/index.vue

@ -1,7 +1,15 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search ref="seachRef" :showSearchTableQueryFields="['supplierCode','itemCode','version']" :hiddenFilterBtnFields="['supplierCode','itemCode','version']" :schema="DemandforecastingMain.allSchemas.searchSchema" @search="searchClick" @reset="searchClick" @searchTableSuccess="searchQueryTableSuccess" @onChange="onSearchChange"/>
<Search ref="seachRef" :showSearchTableQueryFields="['supplierCode','itemCode','version']" :hiddenFilterBtnFields="['supplierCode','itemCode','version']" :schema="DemandforecastingMain.allSchemas.searchSchema" @search="searchClick" @reset="searchClick" @searchTableSuccess="searchQueryTableSuccess" @onChange="onSearchChange">
<template #actionMore>
<el-button type="primary" class="updateBtn" @click="updateHandle">
<Icon class="mr-5px" icon="ep:" />
{{t(`ts.更新要货预测`)}}
<Icon class="ml-5px" icon="ep:" />
</el-button>
</template>
</Search>
</ContentWrap>
<!-- 列表头部 -->
@ -32,13 +40,22 @@
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="updateFormRef"
:rules="UpdateMainRules"
:formAllSchemas="UpdateMain.allSchemas"
@success="updateDemandforecaste"
@searchTableSuccess="searchTableSuccessUpdate"
@onChange="onChange"
:isBusiness="false"
/>
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { DemandforecastingMain,DemandforecastingMainRules,DemandforecastingDetail,DemandforecastingDetailRules } from './demandforecastingMain.data'
import { DemandforecastingMain,DemandforecastingMainRules,DemandforecastingDetail,DemandforecastingDetailRules ,UpdateMain,UpdateMainRules} from './demandforecastingMain.data'
import * as DemandforecastingMainApi from '@/api/wms/demandforecastingMain'
import * as DemandforecastingDetailApi from '@/api/wms/demandforecastingDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
@ -210,6 +227,66 @@ const searchFormClick = (searchData) => {
getList() //
}
const updateFormRef = ref()
const updateHandle = ()=>{
UpdateMain.allSchemas.formSchema.forEach((item) => {
if(item.field == 'supplierCode'||item.field == 'itemCode'){
item.componentProps.enterSearch = false
item.componentProps.isSearchList = false
item.componentProps.disabled = true
}
})
updateFormRef.value.open('create',null,null,t(`ts.更新要货预测`),t(`ts.更新要货预测`))
}
const onChange = (field, cur, formRef) => {
console.log('onChange',field, cur, formRef)
if(field == 'isAll'){
//
UpdateMain.allSchemas.formSchema.forEach((item) => {
if(item.field == 'supplierCode'){
item.componentProps.enterSearch = cur=='true'?false:true
item.componentProps.isSearchList = cur=='true'?false:true
item.componentProps.disabled = cur=='true'?true:false
}
if(item.field == 'itemCode'){
item.componentProps.enterSearch = cur=='true'?false:true
item.componentProps.isSearchList = cur=='true'?false:true
item.componentProps.disabled = cur=='true'?true:false
}
})
}
}
const searchTableSuccessUpdate = (formField, searchField, val, formRef, type, row ) => {
console.log('searchTableSuccessUpdate',formField, searchField, val, formRef, type, row )
const setV = {}
let list = []
val.forEach(item=>{
list.push(item[searchField])
})
setV[formField] = list.join(',')
formRef.setValues(setV)
}
const updateDemandforecaste = async (formType,data)=>{
console.log('updateDemandforecaste',formType,data)
let submitData = {
"supplierCodes":"",
"itemCodes":""
}
if(data.isAll=='false'){
submitData.supplierCodes = data.supplierCode || ''
submitData.itemCodes = data.itemCode || ''
}
updateFormRef.value.formLoading = true
try {
let res = await DemandforecastingMainApi.updateDemandforecaste(submitData)
console.log('更新结果',res)
} finally{
updateFormRef.value.formLoading = false
}
}
/** 初始化 **/
onMounted(async () => {
// try {
@ -229,4 +306,9 @@ onMounted(async () => {
color:var(--el-color-success);
font-weight:700;
}
.updateBtn{
max-width: 100px !important;
}
</style>
Loading…
Cancel
Save