Browse Source

YT-2847:要货预测-计划员,未勾选要货预测数据点击批量发布报错

intex
songguoqiang 3 days ago
parent
commit
67b8c895a3
  1. 32
      src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingMain/index.vue
  2. 7
      src/views/wms/supplierManage/supplierinvoiceInvoiced/supplierinvoiceInvoiced.data.ts

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

@ -78,6 +78,7 @@ import { formatDate } from '@/utils/formatTime'
import { usePageLoading } from '@/hooks/web/usePageLoading'
import { isString } from '@/utils/is'
import {publish} from "@/api/wms/demandforecastingMain";
import { disable } from '@/api/infra/outerApiHis'
const { loadStart, loadDone } = usePageLoading()
//
@ -223,7 +224,7 @@ const butttondata = (row,$index) => {
{
label: t(`ts.生成要货计划`).replace('ts.', ''),
name: 'previewPlan',
hide: isShowMainButton(row, ['2']) || !(row['planType_F'].length>0&&(!tableObject.params.version || tableObject.params.version.length == 0)),
hide: isShowMainButton(row, ['2']) || !(row['planType_F'].length>0&&(!tableObject.params.version || tableObject.params.version.length == 0)) || row.isMaxScpVersion == '1',
type: 'primary',
color: '',
link: true, //
@ -232,7 +233,7 @@ const butttondata = (row,$index) => {
{
label: '发布',
name: 'publish',
hide: isShowMainButton(row, ['1']),
hide: isShowMainButton(row, ['1']) || row.isMaxScpVersion == '1',
type: 'primary',
color: '',
link: true, //
@ -290,11 +291,23 @@ const { tableObject:tableObjectPlan, tableMethods:tableMethodsPlan } = useTable(
const { getList:getListPlan} = tableMethodsPlan
//
const selectionPlan = async ()=>{
if(!tableObject.tableList || tableObject.tableList.length === 0){
return
}
if(tableObject.tableList[0].isMaxScpVersion == '1'){
message.alert('选择版本号时无法生成要货计划选中!');
return;
}
let rows: any = []
selectionRows.value.forEach((item) => {
rows = [...rows, ...item.selectionRows.map((item1) => item1.mainId)]
})
console.log('批量生成要货计划', rows.join(','))
if(!rows || rows.length ===0){
message.alert('勾选数据不能为空!');
return
}
console.log('批量生成要货计划', rows.join(','))
tableObjectPlan.params.masterIds = rows.join(',')
tableObjectPlan.params.dueDate = tableObject.params.dueDate
handlePreviewPlan()
@ -372,12 +385,25 @@ const getSelectionRowsPlan = (currentPage, currentPageSelectionRows) => {
//
const handleSelectionPublish = async ()=>{
tableObject.loading = true
if(!tableObject.tableList || tableObject.tableList.length === 0){
message.alert('选择版本号时无法批量发布选中!');
return
}
if(tableObject.tableList[0].isMaxScpVersion == '1'){
message.alert('选择版本号时无法批量发布选中!');
return;
}
let rows: any = []
selectionRows.value.forEach((item) => {
rows = [...rows, ...item.selectionRows.map((item1) => item1.mainId)]
})
console.log('批量生成要货计划', rows.join(','))
if(!rows || rows.length ===0){
message.alert('勾选数据不能为空!');
return
}
tableObject.loading = true
let ids = rows.join(',')
await DemandforecastingMainApi.batchPublish(ids)
.then((res) => {

7
src/views/wms/supplierManage/supplierinvoiceInvoiced/supplierinvoiceInvoiced.data.ts

@ -48,6 +48,7 @@ export const SupplierinvoiceInvoiced = useCrudSchemas(reactive<CrudSchema[]>([
label: '供应商送货日期',
field: 'supplierDeliveryTime',
sort: 'custom',
hiddenSearchHigh:true,
formatter: dateFormatter2,
search: {
component: 'DatePicker',
@ -89,9 +90,9 @@ export const SupplierinvoiceInvoiced = useCrudSchemas(reactive<CrudSchema[]>([
component: 'DatePicker',
componentProps: {
style: {width:'100%'},
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
type: 'date',
dateFormat: 'YYYY-MM-DD',
valueFormat: 'YYYY-MM-DD',
}
},
table: {

Loading…
Cancel
Save