Browse Source

YT-1950批量打印备料单,取消勾选不生效,再次打印还会打印出来

intex_online20250220
张立 2 months ago
parent
commit
68f300388f
  1. 51
      src/views/wms/issueManage/preparetoissueplan/preparetoissueMain/index.vue

51
src/views/wms/issueManage/preparetoissueplan/preparetoissueMain/index.vue

@ -37,6 +37,8 @@
v-model:currentPage="tableObject.currentPage" v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort" v-model:sort="tableObject.sort"
@getSelectionRows="getSelectionRows" @getSelectionRows="getSelectionRows"
row-key="id"
:reserve-selection="true"
> >
<template #number="{ row }"> <template #number="{ row }">
<el-button type="primary" link @click="openDetail(row, '单据号', row.number)"> <el-button type="primary" link @click="openDetail(row, '单据号', row.number)">
@ -283,7 +285,7 @@ const HeadButttondata = computed(()=>{
defaultButtons.defaultFilterBtn(null), // defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null) // defaultButtons.defaultSetBtn(null) //
] ]
if(selectionRows.value.length > 0 && selectionRows.value[0]?.selectionRows.length > 0 ){ if(selectionRows.value.length > 0 ){
button.push(defaultButtons.mainLisSelectiontPointBtn(null),defaultButtons.mainLisSelectiontTrialResultBtn(null)) button.push(defaultButtons.mainLisSelectiontPointBtn(null),defaultButtons.mainLisSelectiontTrialResultBtn(null))
}else{ }else{
button.push(defaultButtons.mainLisSelectiontPointBtn({type: 'info',}),defaultButtons.mainLisSelectiontTrialResultBtn({type: 'info',})) button.push(defaultButtons.mainLisSelectiontPointBtn({type: 'info',}),defaultButtons.mainLisSelectiontTrialResultBtn({type: 'info',}))
@ -314,8 +316,9 @@ const buttonBaseClick = (val, item) => {
} else if (val == 'filtrate') { } else if (val == 'filtrate') {
// //
} else if (val == 'selection_point') {// } else if (val == 'selection_point') {//
if (selectionRows.value.length > 0 && selectionRows.value[0]?.selectionRows.length > 0) { console.log(selectionRows.value)
const trialResultList = selectionRows.value[0]?.selectionRows.filter(item => item.trialResult == 0 || item.trialResult == 2) if (selectionRows.value.length > 0 ) {
const trialResultList = selectionRows.value.filter(item => item.trialResult == 0 || item.trialResult == 2)
let str = '' let str = ''
if (trialResultList.length > 0) { if (trialResultList.length > 0) {
str=Array.from(new Set(trialResultList.map(item=>item.number))).join('、') str=Array.from(new Set(trialResultList.map(item=>item.number))).join('、')
@ -324,9 +327,9 @@ const buttonBaseClick = (val, item) => {
} }
handleSelectionPoint() handleSelectionPoint()
} }
}else if (val=='trial_result'){// } else if (val == 'trial_result') {//
if (selectionRows.value.length > 0 && selectionRows.value[0]?.selectionRows.length > 0) { if (selectionRows.value.length > 0) {
const trialResultList = selectionRows.value[0]?.selectionRows.filter(item => item.trialResult == 1) const trialResultList = selectionRows.value.filter(item => item.trialResult == 1)
let str = '' let str = ''
if (trialResultList.length > 0) { if (trialResultList.length > 0) {
str=Array.from(new Set(trialResultList.map(item=>item.number))).join('、') str=Array.from(new Set(trialResultList.map(item=>item.number))).join('、')
@ -760,15 +763,14 @@ const resetShow = async () => {
const src = ref(BASE_URL + '/jmreport/view/924811818898698240?token=' + getAccessToken()) const src = ref(BASE_URL + '/jmreport/view/924811818898698240?token=' + getAccessToken())
const srcPoint = ref(BASE_URL + '/jmreport/view/940818992169918464?token=' + getAccessToken()) const srcPoint = ref(BASE_URL + '/jmreport/view/940818992169918464?token=' + getAccessToken())
const masterIds = new Set(); let masterIds = new Set();
// //
const handleSelectionPoint = ()=>{ const handleSelectionPoint = () => {
selectionRows.value.forEach(item=>{ masterIds = new Set();
item.selectionRows.forEach(obj => { selectionRows.value.forEach(obj=>{
if (obj.masterId) { if (obj.masterId) {
masterIds.add(obj.masterId); masterIds.add(obj.masterId);
} }
});
}) })
// masterIds // masterIds
const idsArray = Array.from(masterIds); const idsArray = Array.from(masterIds);
@ -782,9 +784,7 @@ idsArray.forEach(id => {
// //
const handleSelectionTrialResult = async ()=>{ const handleSelectionTrialResult = async ()=>{
let rows:any = [] let rows:any = []
selectionRows.value.forEach(item=>{ selectionRows.value.map(item=>item.number)
rows = [...rows,...item.selectionRows.map(item1=>item1.number)]
})
console.log('批量试算',rows.join(',')) console.log('批量试算',rows.join(','))
await PreparetoissueMainApi.batchGenerateIssueRequest(rows.join(',')) await PreparetoissueMainApi.batchGenerateIssueRequest(rows.join(','))
.then((res) => { .then((res) => {
@ -813,17 +813,18 @@ const handleSelectionTrialResult = async ()=>{
const selectionRows = ref<any>([]) const selectionRows = ref<any>([])
const tableRef = ref() const tableRef = ref()
const getSelectionRows = (currentPage,currentPageSelectionRows) => { const getSelectionRows = (currentPage, currentPageSelectionRows) => {
const currentRows = selectionRows.value.find(item=>item.currentPage==currentPage) selectionRows.value = currentPageSelectionRows
console.log("getSelectionRows",currentPage,currentPageSelectionRows,currentRows,selectionRows.value) // const currentRows = selectionRows.value.find(item => item.currentPage == currentPage)
if(currentRows){ // console.log(currentPageSelectionRows)
currentRows.selectionRows = currentPageSelectionRows // if(currentRows){
}else{ // currentRows.selectionRows = currentPageSelectionRows
selectionRows.value.push({ // }else{
currentPage, // selectionRows.value.push({
selectionRows:currentPageSelectionRows // currentPage,
}) // selectionRows:currentPageSelectionRows
} // })
// }
} }
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {

Loading…
Cancel
Save