Browse Source

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

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

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

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

Loading…
Cancel
Save