Browse Source

物品基础信息扩展标签页功能

master
陈薪名 11 months ago
parent
commit
30b14df45b
  1. 37
      src/components/Detail/src/Detail.vue
  2. 1
      src/components/Tabs/src/Tabs.vue
  3. 85
      src/views/wms/basicDataManage/itemManage/itembasic/index.vue

37
src/components/Detail/src/Detail.vue

@ -39,12 +39,30 @@
@searchFormClick="searchFormClick"
:allSchemas="detailAllSchemas"
/>
<!-- 默认单表展现 -->
<Descriptions
v-if="isBasic"
v-if="isBasic && !tabsExtend"
:data="detailData"
:schema="allSchemas.detailSchema"
:columns="2"
/>
<!-- 单表切换tabs 展现table -->
<Table
v-if="isBasic && tabsExtend"
:columns="detailAllSchemasRef.tableColumns"
:data="tableObjectRef.tableList"
:loading="tableObjectRef.loading"
:pagination="{ total: tableObjectRef.total }"
v-model:pageSize="tableObjectRef.pageSize"
v-model:currentPage="tableObjectRef.currentPage"
>
<!-- <template #action="{ row }">
<ButtonBase
:Butttondata="buttondata"
@button-base-click="buttonTableClick($event, row)"
/>
</template> -->
</Table>
<Table
v-if="!isBasic && fromeWhere != 'countPlan'"
:columns="detailAllSchemasRef.tableColumns"
@ -238,6 +256,18 @@ const props = defineProps({
default: ()=>{
return []
}
},
// tabs table false
tabsExtend: {
type: Boolean,
required: false,
default: false
},
// tableObject
tableObjectExtend: {
type: Array,
required: false,
default: null
}
})
const isShowDrawer = ref(false)
@ -569,6 +599,11 @@ watch(
})
tableObject.params.masterId = masterParmas.value.masterId
detailAllSchemasRef.value = props.detailAllSchemas
if (props.tableObjectExtend) {
props.tableObjectExtend.forEach(item => {
tableObject.params[item.key] = item.value
})
}
tableObjectRef.value = tableObject
tableMethodsRef.value = tableMethods
const { getList } = tableMethods

1
src/components/Tabs/src/Tabs.vue

@ -29,7 +29,6 @@ const props = defineProps({
const current = ref(props.current);
const change = (item, index) => {
current.value = index
console.log(index);
emit('change',item,index)
}
const emit = defineEmits(['change'])

85
src/views/wms/basicDataManage/itemManage/itembasic/index.vue

@ -47,7 +47,17 @@
/>
<!-- 详情 -->
<Detail ref="detailRef" :tabs="ItemBasicTabsList" :isBasic="true" :allSchemas="Itembasic.allSchemas" />
<Detail
ref="detailRef"
:tabs="ItemBasicTabsList"
:isBasic="true"
:allSchemas="allSchemas"
@changeTabs="changeTabs"
:detailAllSchemas="detailAllSchemas"
:apiPage="apiPage"
:tabsExtend="tabsExtend"
:tableObjectExtend="tableObjectExtend"
/>
<!-- 导入 -->
<ImportForm ref="importFormRef" :url="ItembasicApi.importUrl" :importTemplateData="importTemplateData" @success="importSuccess" />
@ -61,7 +71,32 @@ import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import { Itembasic, rules } from './itembasic.data'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { ItemBasicTabsList } from '@/utils/disposition/tabsList'
import { Supplieritem } from '@/views/wms/basicDataManage/supplierManage/supplieritem/supplieritem.data'
import * as SupplieritemApi from '@/api/wms/supplieritem'
import { Customeritem } from '@/views/wms/basicDataManage/customerManage/customeritem/customeritem.data'
import * as CustomeritemApi from '@/api/wms/customeritem'
import { PurchaseMain } from '@/views/wms/purchasereceiptManage/supplierdeliver/purchaseMain/purchaseMain.data'
import * as PurchaseDetailApi from '@/api/wms/purchaseDetail'
import { PurchasePlanMain } from '@/views/wms/purchasereceiptManage/supplierdeliver/purchasePlanMain/purchasePlanMain.data'
import * as PurchasePlanDetailApi from '@/api/wms/purchasePlanDetail'
import { Balance } from '@/views/wms/inventoryManage/balance/balance.data'
import * as BalanceApi from '@/api/wms/balance'
import { Expectout } from '@/views/wms/inventoryManage/expectout/expectout.data'
import * as ExpectoutApi from '@/api/wms/expectout'
import { Expectin } from '@/views/wms/inventoryManage/expectin/expectin.data'
import * as ExpectinApi from '@/api/wms/expectin'
//
defineOptions({ name: 'Itembasic' })
const tabsExtend = ref(false)
const allSchemas = ref(Itembasic.allSchemas)
const detailAllSchemas = ref()
const apiPage = ref()
const itemCodeRow = ref()
const tableObjectExtend = ref()
const { tableObject, tableMethods } = useTable({
getListApi: ItembasicApi.getItembasicPage //
})
@ -181,6 +216,7 @@ const formsSuccess = async (formType,data) => {
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
itemCodeRow.value = row.code
detailRef.value.openDetail(row, titleName, titleValue, 'basicItembasic')
}
@ -188,7 +224,6 @@ const openDetail = (row: any, titleName: any, titleValue: any) => {
const handleDelete = async (id: number) => {
try {
//
console.log(tableObject.params)
await message.delConfirm()
//
await ItembasicApi.deleteItembasic(id)
@ -222,6 +257,52 @@ const searchFormClick = (searchData) => {
getList() //
}
// tabs
const changeTabs = (item) => {
if(item.prop == 'SupplierItems'){
tabsExtend.value = true
apiPage.value = SupplieritemApi.getSupplieritemPage
detailAllSchemas.value = Supplieritem.allSchemas
} else if(item.prop == 'CustomerItems'){
tabsExtend.value = true
apiPage.value = CustomeritemApi.getCustomeritemPage
detailAllSchemas.value = Customeritem.allSchemas
} else if(item.prop == 'PurchaseOrder'){
tabsExtend.value = true
apiPage.value = PurchaseDetailApi.getPurchaseDetailPage
detailAllSchemas.value = PurchaseMain.allSchemas
} else if(item.prop == 'PurchasingPlan'){
tabsExtend.value = true
apiPage.value = PurchasePlanDetailApi.getPurchasePlanDetailPage
detailAllSchemas.value = PurchasePlanMain.allSchemas
} else if(item.prop == 'InventoryBalance'){
tabsExtend.value = true
apiPage.value = BalanceApi.getBalancePage
detailAllSchemas.value = Balance.allSchemas
} else if(item.prop == 'ExpectedIn'){
tabsExtend.value = true
apiPage.value = ExpectinApi.getExpectinPage
detailAllSchemas.value = Expectin.allSchemas
} else if(item.prop == 'ExpectedOut'){
tabsExtend.value = true
apiPage.value = ExpectoutApi.getExpectoutPage
detailAllSchemas.value = Expectout.allSchemas
} else {
tabsExtend.value = false
allSchemas.value = Itembasic.allSchemas
}
detailAllSchemas.value.tableColumns.map((item,index) => {
if (item.field == 'action') {
detailAllSchemas.value.tableColumns.splice(index,1)
}
})
//
tableObjectExtend.value = [{
key: 'itemCode',
value: itemCodeRow.value
}]
}
/** 初始化 **/
onMounted(() => {

Loading…
Cancel
Save