|
|
@ -47,6 +47,7 @@ |
|
|
|
:tableAllSchemas="ProductscrapRecordDetail.allSchemas" |
|
|
|
:tableFormRules="ProductscrapRecordDetailRules" |
|
|
|
:isBusiness="true" |
|
|
|
@buttonOperationClick="buttonOperationClick" |
|
|
|
/> |
|
|
|
|
|
|
|
<!-- 详情 --> |
|
|
@ -57,15 +58,41 @@ |
|
|
|
:detailAllSchemas="ProductscrapRecordDetail.allSchemas" |
|
|
|
:detailAllSchemasRules="ProductscrapRecordDetailRules" |
|
|
|
:apiPage="ProductscrapRecordDetailApi.getProductscrapRecordDetailPage" |
|
|
|
:buttondataTable="buttondataTable" |
|
|
|
@tableFormButton="tableFormButton" |
|
|
|
/> |
|
|
|
|
|
|
|
<!-- bom列表 --> |
|
|
|
<Dialog |
|
|
|
:title="DialogTitle" |
|
|
|
v-model="bomModelVisible" |
|
|
|
width="80%" |
|
|
|
:scroll="true" |
|
|
|
max-height="450px" |
|
|
|
> |
|
|
|
<TableForm |
|
|
|
ref="tableFormRef" |
|
|
|
class="w-[100%]" |
|
|
|
:tableFields="ProdcutscrapRecordBomDismantle.allSchemas.tableColumns" |
|
|
|
:tableData="detatableDataBom.tableList" |
|
|
|
:isShowButton="false" |
|
|
|
:isShowReduceButton="false" |
|
|
|
/> |
|
|
|
<template #footer> |
|
|
|
<ButtonBase :Butttondata="ButttondataBom" @button-base-click="buttonBaseClickBom" /> |
|
|
|
</template> |
|
|
|
</Dialog> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
<script setup lang="ts"> |
|
|
|
import download from '@/utils/download' |
|
|
|
import { ProductscrapRecordMain,ProductscrapRecordMainRules,ProductscrapRecordDetail,ProductscrapRecordDetailRules } from './productscrapRecordMain.data' |
|
|
|
import { ProductscrapRecordMain,ProductscrapRecordMainRules,ProductscrapRecordDetail,ProductscrapRecordDetailRules,ProdcutscrapRecordBomDismantle } from './productscrapRecordMain.data' |
|
|
|
import * as ProductscrapRecordMainApi from '@/api/wms/productscrapRecordMain' |
|
|
|
import * as ProductscrapRecordDetailApi from '@/api/wms/productscrapRecordDetail' |
|
|
|
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
|
import * as BomDismantleApi from "@/api/wms/bomDismantle"; |
|
|
|
import {getProductscrapBomDismantleRecordPage} from "@/api/wms/bomDismantle"; |
|
|
|
|
|
|
|
// 制品报废记录主 |
|
|
|
defineOptions({ name: 'ProductscrapRecordMain' }) |
|
|
@ -78,6 +105,87 @@ const routeName = ref() |
|
|
|
routeName.value = route.name |
|
|
|
const tableColumns = ref(ProductscrapRecordMain.allSchemas.tableColumns) |
|
|
|
|
|
|
|
// 详情 table 操作扩展 按钮 |
|
|
|
const buttondataTable = ref([{ |
|
|
|
label: 'Bom', |
|
|
|
name: 'bom', |
|
|
|
hide: false, |
|
|
|
type: 'primary', |
|
|
|
icon: '', |
|
|
|
color: '', |
|
|
|
hasPermi: '', |
|
|
|
link: true, // 文本展现按钮 |
|
|
|
}]) |
|
|
|
|
|
|
|
// Bom 窗口 |
|
|
|
const DialogTitle = ref('Bom信息') |
|
|
|
const bomModelVisible = ref(false) |
|
|
|
const tableListBom = ref() |
|
|
|
const { tableObject: detatableDataBom, tableMethods: detatableMethodsBom } =useTable({ |
|
|
|
getListApi: BomDismantleApi.getProductscrapBomDismantleRecordPage |
|
|
|
}) |
|
|
|
|
|
|
|
const { getList:getDetailListBom } = detatableMethodsBom |
|
|
|
|
|
|
|
// 新增 tableform 按钮 |
|
|
|
const buttonOperationClick = async (row, label, index)=> { |
|
|
|
if (row.itemCode == '') { |
|
|
|
message.warning('请选择物品代码!') |
|
|
|
return |
|
|
|
} |
|
|
|
detatableDataBom.params.itemCode = row.itemCode |
|
|
|
DialogTitle.value = '物品代码:【' + row.itemCode + '】 Bom 信息' |
|
|
|
bomModelVisible.value = true |
|
|
|
await getDetailListBom() |
|
|
|
detatableDataBom.tableList.map(item => { |
|
|
|
item.rowId = index |
|
|
|
if(tableData.value[index].childList) { |
|
|
|
tableData.value[index].childList.forEach(itemChild => { |
|
|
|
if (itemChild.itemCode == item.itemCode) { |
|
|
|
item.qty = itemChild.qty |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
/** bom 列表 表单 按钮 */ |
|
|
|
const ButttondataBom = [ |
|
|
|
defaultButtons.formSaveBtn(null), // 保存 |
|
|
|
defaultButtons.formCloseBtn(null) // 关闭 |
|
|
|
] |
|
|
|
// bom 列表 表单 按钮 |
|
|
|
const buttonBaseClickBom = (val) => { |
|
|
|
// 保存 |
|
|
|
if (val == 'save') { |
|
|
|
// 根据 填写的数量 为基准 不填写数量的忽略 |
|
|
|
tableListBom.value = detatableDataBom.tableList.filter(item => (item.qty!=0)) |
|
|
|
tableData.value.forEach((item, index) => { |
|
|
|
if(tableListBom.value[0].rowId == index) { |
|
|
|
item.childList = tableListBom.value |
|
|
|
} |
|
|
|
}) |
|
|
|
console.log(157, tableData.value) |
|
|
|
bomModelVisible.value = false |
|
|
|
} |
|
|
|
// 关闭 |
|
|
|
else if (val == 'close') { |
|
|
|
bomModelVisible.value = false |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 查看 Bom 按钮回调事件 |
|
|
|
const tableFormButton = async (val , row) => { |
|
|
|
if (val == 'bom') { // 查看 bom |
|
|
|
bomModelVisible.value = true |
|
|
|
DialogTitle.value = '物品代码【' + row.itemCode + '】——Bom信息' |
|
|
|
detatableDataBom.params = { |
|
|
|
masterId: row.id |
|
|
|
} |
|
|
|
await getDetailListBom() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 字段设置 更新主列表字段 |
|
|
|
const updataTableColumns = (val) => { |
|
|
|
tableColumns.value = val |
|
|
|