Browse Source

扩展tabs 详情组件修改

master
陈薪名 1 year ago
parent
commit
a4c88d9ba0
  1. 47
      src/components/Detail/src/Detail.vue
  2. 13
      src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestMain/index.vue

47
src/components/Detail/src/Detail.vue

@ -26,7 +26,7 @@
</ContentWrap> </ContentWrap>
<Tabs :tabsList="tabsList" :current="current" @change="change" /> <Tabs :tabsList="tabsList" :current="current" @change="change" />
<div class="flex" v-if="current == 0"> <div class="flex">
<!-- 详情 --> <!-- 详情 -->
<ContentWrap class="w-[73%]"> <ContentWrap class="w-[73%]">
<!-- 列表头部 --> <!-- 列表头部 -->
@ -47,12 +47,12 @@
/> />
<Table <Table
v-if="!isBasic" v-if="!isBasic"
:columns="detailAllSchemas.tableColumns" :columns="tableColumnsRef"
:data="tableObject.tableList" :data="tableObjectRef.tableList"
:loading="tableObject.loading" :loading="tableObjectRef.loading"
:pagination="{ total: tableObject.total }" :pagination="{ total: tableObjectRef.total }"
v-model:pageSize="tableObject.pageSize" v-model:pageSize="tableObjectRef.pageSize"
v-model:currentPage="tableObject.currentPage" v-model:currentPage="tableObjectRef.currentPage"
> >
<template #action="{ row }"> <template #action="{ row }">
<ButtonBase <ButtonBase
@ -276,7 +276,7 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName:
masterParmas.value.masterId = row.id masterParmas.value.masterId = row.id
masterParmas.value.number = row.number masterParmas.value.number = row.number
masterParmas.value.status = row.status masterParmas.value.status = row.status
tableObject.params = { tableObjectRef.value.params = {
masterId: row.id masterId: row.id
} }
getList() getList()
@ -331,10 +331,20 @@ const remarksSubmitScuess = async (remark) => {
const getChangeRecordList = async () => { const getChangeRecordList = async () => {
changeRecordData.changeRecordList = await RemarkApi.getChangeRecordPage(remarksData.data) changeRecordData.changeRecordList = await RemarkApi.getChangeRecordPage(remarksData.data)
} }
const tableObjectRef = ref()
const tableMethodsRef = ref()
const tableColumnsRef = ref()
const { tableObject, tableMethods } = useTable({ const { tableObject, tableMethods } = useTable({
getListApi: props.apiPage // getListApi: props.apiPage //
}) })
tableObjectRef.value = tableObject
tableMethodsRef.value = tableMethods
tableColumnsRef.value = props.detailAllSchemas.tableColumns
// //
const isShowMainButton = (row, val) => { const isShowMainButton = (row, val) => {
if (val.indexOf(row.status) > -1) { if (val.indexOf(row.status) > -1) {
@ -345,7 +355,7 @@ const isShowMainButton = (row, val) => {
} }
// //
const { getList } = tableMethods const { getList } = tableMethodsRef.value
// //
const buttonBaseClick = (val, item) => { const buttonBaseClick = (val, item) => {
@ -427,7 +437,7 @@ const handleDelete = async (id: number) => {
} }
// //
const searchFormClick = (searchData) => { const searchFormClick = (searchData) => {
tableObject.params = { tableObjectRef.value.params = {
isSearch: true, isSearch: true,
filters: searchData.filters filters: searchData.filters
? searchData.filters ? searchData.filters
@ -435,16 +445,19 @@ const searchFormClick = (searchData) => {
} }
getList() // getList() //
} }
console.log(props.apiPage)
// //
// watch(props.apiPage, (newValue, oldValue) => {
// //
// console.log('', '' + newValue, '' + oldValue)
// })
watch( watch(
() => props.apiPage, () => props.apiPage,
(newValue,oldValue) => { () => {
console.log('求和的值变了', '变化后的值是' + newValue, '变化前的值是' + oldValue) const { tableObject, tableMethods } = useTable({
getListApi: props.apiPage //
})
tableColumnsRef.value = props.detailAllSchemas.tableColumns
tableObjectRef.value = tableObject
tableMethodsRef.value = tableMethods
const { getList } = tableMethods
getList()
} }
) )
</script> </script>

13
src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestMain/index.vue

@ -61,7 +61,7 @@
ref="detailRef" ref="detailRef"
:isBasic="false" :isBasic="false"
:allSchemas="PurchasereceiptRequestMain.allSchemas" :allSchemas="PurchasereceiptRequestMain.allSchemas"
:detailAllSchemas="PurchasereceiptRequestDetail.allSchemas" :detailAllSchemas="detailAllSchemas"
:detailAllSchemasRules="PurchasereceiptRequestDetailRules" :detailAllSchemasRules="PurchasereceiptRequestDetailRules"
:apiCreate="PurchasereceiptRequestDetailApi.createPurchasereceiptRequestDetail" :apiCreate="PurchasereceiptRequestDetailApi.createPurchasereceiptRequestDetail"
:apiUpdate="PurchasereceiptRequestDetailApi.updatePurchasereceiptRequestDetail" :apiUpdate="PurchasereceiptRequestDetailApi.updatePurchasereceiptRequestDetail"
@ -84,6 +84,7 @@ import * as PurchasereceiptRequestMainApi from '@/api/wms/purchasereceiptRequest
import * as PurchasereceiptRequestDetailApi from '@/api/wms/purchasereceiptRequestDetail' import * as PurchasereceiptRequestDetailApi from '@/api/wms/purchasereceiptRequestDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { PurchasereceiptRequestTabsList } from '@/utils/disposition/tabsList' import { PurchasereceiptRequestTabsList } from '@/utils/disposition/tabsList'
import { SupplierdeliverRecordMain, SupplierdeliverRecordDetail} from './../../supplierdeliver/supplierdeliverRecordMain/supplierdeliverRecordMain.data'
// //
defineOptions({ name: 'PurchasereceiptRequestMain' }) defineOptions({ name: 'PurchasereceiptRequestMain' })
@ -97,6 +98,9 @@ routeName.value = route.name
const tableColumns = ref(PurchasereceiptRequestMain.allSchemas.tableColumns) const tableColumns = ref(PurchasereceiptRequestMain.allSchemas.tableColumns)
const apiPage = ref(PurchasereceiptRequestDetailApi.getPurchasereceiptRequestDetailPage) const apiPage = ref(PurchasereceiptRequestDetailApi.getPurchasereceiptRequestDetailPage)
const detailAllSchemas = ref(PurchasereceiptRequestDetail.allSchemas)
// //
const updataTableColumns = (val) => { const updataTableColumns = (val) => {
@ -363,15 +367,18 @@ const searchFormClick = (searchData) => {
} }
getList() // getList() //
} }
// tabs
const changeTabs = (data) =>{ const changeTabs = (data) =>{
// console.log(data.prop)
if(data.prop == 'receiptDetail'){ if(data.prop == 'receiptDetail'){
apiPage.value = PurchasereceiptRequestDetailApi.getPurchasereceiptRequestDetailPage apiPage.value = PurchasereceiptRequestDetailApi.getPurchasereceiptRequestDetailPage
detailAllSchemas.value = PurchasereceiptRequestDetail.allSchemas
}else if(data.prop == 'scarceGoodsDetail'){ }else if(data.prop == 'scarceGoodsDetail'){
apiPage.value = PurchasereceiptRequestDetailApi.getScarceGoodsDetailPage apiPage.value = PurchasereceiptRequestDetailApi.getScarceGoodsDetailPage
detailAllSchemas.value = SupplierdeliverRecordDetail.allSchemas
} }
console.log( apiPage.value)
} }
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
getList() getList()

Loading…
Cancel
Save