生产 物料 台账联动
This commit is contained in:
@@ -24,6 +24,7 @@
|
|||||||
@current-change="currentChange"
|
@current-change="currentChange"
|
||||||
@selection-change="selectionChange"
|
@selection-change="selectionChange"
|
||||||
@sort-change="sortChange"
|
@sort-change="sortChange"
|
||||||
|
@row-click="handleRowClick"
|
||||||
>
|
>
|
||||||
<template #search>
|
<template #search>
|
||||||
<!-- <div v-if="isSearch" style="margin-bottom:6px">查询:</div> -->
|
<!-- <div v-if="isSearch" style="margin-bottom:6px">查询:</div> -->
|
||||||
@@ -48,6 +49,14 @@
|
|||||||
</ElButton>
|
</ElButton>
|
||||||
<div ref="tableHeightRef"></div>
|
<div ref="tableHeightRef"></div>
|
||||||
</template>
|
</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" >
|
<template v-for="prop in searchReportSlots" :key="prop" #[`${prop}-search`]="scope" >
|
||||||
<div>
|
<div>
|
||||||
<el-select
|
<el-select
|
||||||
@@ -209,6 +218,9 @@ import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
|
|||||||
import Avue from '@smallwei/avue'
|
import Avue from '@smallwei/avue'
|
||||||
import { Console } from 'console'
|
import { Console } from 'console'
|
||||||
import { ruleLeng } from '../utils/util'
|
import { ruleLeng } from '../utils/util'
|
||||||
|
import otherReport from './other.vue'
|
||||||
|
const inventoryAccountRef=ref<any>({})
|
||||||
|
const selectRow=ref<any>({})
|
||||||
defineOptions({ name: 'LowReport' })
|
defineOptions({ name: 'LowReport' })
|
||||||
|
|
||||||
interface Props {
|
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 tableSaleInfo=ref<any>([])
|
||||||
const tableSaleSearch=ref<any>({})
|
const tableSaleSearch=ref<any>({})
|
||||||
const tableSalePage = ref<any>({ currentPage: 1, pageSize: 20, total: 0 })
|
const tableSalePage = ref<any>({ currentPage: 1, pageSize: 20, total: 0 })
|
||||||
@@ -315,6 +335,19 @@ const permissions =
|
|||||||
const selectIds = computed(() => {
|
const selectIds = computed(() => {
|
||||||
return tableSelect.value.map((item) => item['id'])
|
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)=>{
|
const openSaleDetail=(row)=>{
|
||||||
|
|
||||||
tableSalePage.value={
|
tableSalePage.value={
|
||||||
@@ -590,6 +623,10 @@ const initTable = async () => {
|
|||||||
// stripe: reportVo.tableConfig.includes('stripe'),
|
// stripe: reportVo.tableConfig.includes('stripe'),
|
||||||
showSummary:false,
|
showSummary:false,
|
||||||
stripe:true,
|
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,
|
searchShow:props.reportCode=='zhxs-hz'?false:true,
|
||||||
searchShowBtn:props.reportCode=='zhxs-hz'?false:true,
|
searchShowBtn:props.reportCode=='zhxs-hz'?false:true,
|
||||||
searchBtnText:'查询',
|
searchBtnText:'查询',
|
||||||
@@ -1166,6 +1203,8 @@ const getTableData = async (isLoading = true) => {
|
|||||||
} finally {
|
} finally {
|
||||||
|
|
||||||
if (isLoading) loading.value = false
|
if (isLoading) loading.value = false
|
||||||
|
selectRow.value={}
|
||||||
|
tableOption.value.expandRowKeys=[]
|
||||||
resolve()
|
resolve()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -1278,6 +1317,7 @@ defineExpose({
|
|||||||
loading,
|
loading,
|
||||||
clearSelection,
|
clearSelection,
|
||||||
resetChange:clearSearch,
|
resetChange:clearSearch,
|
||||||
|
|
||||||
initTableLayout
|
initTableLayout
|
||||||
})
|
})
|
||||||
</script>
|
</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