生产 物料 台账联动
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
@current-change="currentChange"
|
||||
@selection-change="selectionChange"
|
||||
@sort-change="sortChange"
|
||||
@row-click="handleRowClick"
|
||||
>
|
||||
<template #search>
|
||||
<!-- <div v-if="isSearch" style="margin-bottom:6px">查询:</div> -->
|
||||
@@ -48,6 +49,14 @@
|
||||
</ElButton>
|
||||
<div ref="tableHeightRef"></div>
|
||||
</template>
|
||||
|
||||
|
||||
<template #expand="scope" v-if="reportCode === 'production_batch'" >
|
||||
<!-- 这里写你自定义的展开内容 -->
|
||||
<otherReport reportCode="material_info" @select-row-change="handleSelectRowChange" :row="scope.row" />
|
||||
<otherReport ref="inventoryAccountRef" reportCode="inventory_account" v-if="selectRow.material_id" :row="selectRow" />
|
||||
|
||||
</template>
|
||||
<template v-for="prop in searchReportSlots" :key="prop" #[`${prop}-search`]="scope" >
|
||||
<div>
|
||||
<el-select
|
||||
@@ -209,6 +218,9 @@ import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
|
||||
import Avue from '@smallwei/avue'
|
||||
import { Console } from 'console'
|
||||
import { ruleLeng } from '../utils/util'
|
||||
import otherReport from './other.vue'
|
||||
const inventoryAccountRef=ref<any>({})
|
||||
const selectRow=ref<any>({})
|
||||
defineOptions({ name: 'LowReport' })
|
||||
|
||||
interface Props {
|
||||
@@ -242,6 +254,14 @@ const changeMonths=(val:any)=>{
|
||||
})
|
||||
|
||||
}
|
||||
const handleSelectRowChange=(row:any)=>{
|
||||
if(selectRow.value.material_id==row.material_id){
|
||||
selectRow.value={}
|
||||
}else{
|
||||
selectRow.value=row
|
||||
// inventoryAccountRef.value.getTableData()
|
||||
}
|
||||
}
|
||||
const tableSaleInfo=ref<any>([])
|
||||
const tableSaleSearch=ref<any>({})
|
||||
const tableSalePage = ref<any>({ currentPage: 1, pageSize: 20, total: 0 })
|
||||
@@ -315,6 +335,19 @@ const permissions =
|
||||
const selectIds = computed(() => {
|
||||
return tableSelect.value.map((item) => item['id'])
|
||||
})
|
||||
// 整行点击展开/收起
|
||||
const handleRowClick = (row) => {
|
||||
if (props.reportCode !== 'production_batch') return
|
||||
|
||||
const currentKey = row.product_id
|
||||
|
||||
if (tableOption.value&&tableOption.value.expandRowKeys.length&&tableOption.value.expandRowKeys.includes(currentKey)) {
|
||||
tableOption.value.expandRowKeys = [] // 关闭
|
||||
} else if(tableOption.value) {
|
||||
tableOption.value.expandRowKeys = [currentKey] // 只展开当前行
|
||||
selectRow.value={}
|
||||
}
|
||||
}
|
||||
const openSaleDetail=(row)=>{
|
||||
|
||||
tableSalePage.value={
|
||||
@@ -590,6 +623,10 @@ const initTable = async () => {
|
||||
// stripe: reportVo.tableConfig.includes('stripe'),
|
||||
showSummary:false,
|
||||
stripe:true,
|
||||
expand:props.reportCode=='production_batch'?true:false,
|
||||
expandWidth:1,
|
||||
rowKey:props.reportCode=='production_batch'?'product_id':undefined,
|
||||
expandRowKeys:[],
|
||||
searchShow:props.reportCode=='zhxs-hz'?false:true,
|
||||
searchShowBtn:props.reportCode=='zhxs-hz'?false:true,
|
||||
searchBtnText:'查询',
|
||||
@@ -1166,6 +1203,8 @@ const getTableData = async (isLoading = true) => {
|
||||
} finally {
|
||||
|
||||
if (isLoading) loading.value = false
|
||||
selectRow.value={}
|
||||
tableOption.value.expandRowKeys=[]
|
||||
resolve()
|
||||
}
|
||||
})
|
||||
@@ -1278,6 +1317,7 @@ defineExpose({
|
||||
loading,
|
||||
clearSelection,
|
||||
resetChange:clearSearch,
|
||||
|
||||
initTableLayout
|
||||
})
|
||||
</script>
|
||||
|
||||
1375
src/components/LowDesign/src/LowReport/other.vue
Normal file
1375
src/components/LowDesign/src/LowReport/other.vue
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user