|
@ -54,6 +54,7 @@ |
|
|
@handleDeleteTable="handleDeleteTable" |
|
|
@handleDeleteTable="handleDeleteTable" |
|
|
@searchTableSuccess="searchTableSuccess" |
|
|
@searchTableSuccess="searchTableSuccess" |
|
|
@submitForm="submitForm" |
|
|
@submitForm="submitForm" |
|
|
|
|
|
@buttonOperationClick="buttonOperationClick" |
|
|
/> |
|
|
/> |
|
|
|
|
|
|
|
|
<!-- 详情 --> |
|
|
<!-- 详情 --> |
|
@ -69,8 +70,31 @@ |
|
|
:apiDelete="ProductscrapRequestDetailApi.deleteProductscrapRequestDetail" |
|
|
:apiDelete="ProductscrapRequestDetailApi.deleteProductscrapRequestDetail" |
|
|
:Echo="Echo" |
|
|
:Echo="Echo" |
|
|
@searchTableSuccessDetail="searchTableSuccessDetail" |
|
|
@searchTableSuccessDetail="searchTableSuccessDetail" |
|
|
|
|
|
: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="ProdcutscrapBomDismantle.allSchemas.tableColumns" |
|
|
|
|
|
:tableData="detatableDataBom.tableList" |
|
|
|
|
|
:isShowButton="false" |
|
|
|
|
|
:isShowReduceButton="false" |
|
|
|
|
|
/> |
|
|
|
|
|
<template #footer> |
|
|
|
|
|
<ButtonBase :Butttondata="ButttondataBom" @button-base-click="buttonBaseClickBom" /> |
|
|
|
|
|
</template> |
|
|
|
|
|
</Dialog> |
|
|
|
|
|
|
|
|
<!-- 导入 --> |
|
|
<!-- 导入 --> |
|
|
<ImportForm ref="importFormRef" url="/wms/productscrap-request-main/import" :importTemplateData="importTemplateData" |
|
|
<ImportForm ref="importFormRef" url="/wms/productscrap-request-main/import" :importTemplateData="importTemplateData" |
|
|
@success="importSuccess" :updateIsDisable="true" :coverIsDisable="true" :mode="2" /> |
|
|
@success="importSuccess" :updateIsDisable="true" :coverIsDisable="true" :mode="2" /> |
|
@ -78,10 +102,12 @@ |
|
|
|
|
|
|
|
|
<script setup lang="ts"> |
|
|
<script setup lang="ts"> |
|
|
import download from '@/utils/download' |
|
|
import download from '@/utils/download' |
|
|
import { ProductscrapRequestMain,ProductscrapRequestMainRules,ProductscrapRequestDetail,ProductscrapRequestDetailRules } from './productscrapRequestMain.data' |
|
|
import { ProductscrapRequestMain,ProductscrapRequestMainRules,ProductscrapRequestDetail,ProductscrapRequestDetailRules,ProdcutscrapBomDismantle } from './productscrapRequestMain.data' |
|
|
import * as ProductscrapRequestMainApi from '@/api/wms/productscrapRequestMain' |
|
|
import * as ProductscrapRequestMainApi from '@/api/wms/productscrapRequestMain' |
|
|
import * as ProductscrapRequestDetailApi from '@/api/wms/productscrapRequestDetail' |
|
|
import * as ProductscrapRequestDetailApi from '@/api/wms/productscrapRequestDetail' |
|
|
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
|
|
|
import * as BomDismantleApi from "@/api/wms/bomDismantle"; |
|
|
|
|
|
import {getProductscrapBomDismantlePage} from "@/api/wms/bomDismantle"; |
|
|
|
|
|
|
|
|
// 制品报废申请 |
|
|
// 制品报废申请 |
|
|
defineOptions({ name: 'ProductscrapRequestMain' }) |
|
|
defineOptions({ name: 'ProductscrapRequestMain' }) |
|
@ -94,6 +120,86 @@ const routeName = ref() |
|
|
routeName.value = route.name |
|
|
routeName.value = route.name |
|
|
const tableColumns = ref(ProductscrapRequestMain.allSchemas.tableColumns) |
|
|
const tableColumns = ref(ProductscrapRequestMain.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.getProductscrapBomDismantlePage |
|
|
|
|
|
}) |
|
|
|
|
|
const { getList:getDetailListBom } = detatableMethodsBom |
|
|
|
|
|
/** 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 |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
// 新增 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 tableFormButton = async (val , row) => { |
|
|
|
|
|
if (val == 'bom') { // 查看 bom |
|
|
|
|
|
bomModelVisible.value = true |
|
|
|
|
|
DialogTitle.value = '物品代码【' + row.itemCode + '】——Bom信息' |
|
|
|
|
|
detatableDataBom.params = { |
|
|
|
|
|
itemCode: row.itemCode, |
|
|
|
|
|
bomVersion: row.bomVersion, |
|
|
|
|
|
masterId: row.id |
|
|
|
|
|
} |
|
|
|
|
|
await getDetailListBom() |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// 字段设置 更新主列表字段 |
|
|
// 字段设置 更新主列表字段 |
|
|
const updataTableColumns = (val) => { |
|
|
const updataTableColumns = (val) => { |
|
|
tableColumns.value = val |
|
|
tableColumns.value = val |
|
@ -104,14 +210,25 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => |
|
|
nextTick(() => { |
|
|
nextTick(() => { |
|
|
if (type == 'tableForm') { |
|
|
if (type == 'tableForm') { |
|
|
// 明细查询页赋值 |
|
|
// 明细查询页赋值 |
|
|
row[formField] = val[0][searchField] |
|
|
if(formField == 'productionLineCode'){ |
|
|
row['containerNumber'] = val[0]['containerNumber'] |
|
|
row['productionLineCode'] = val[0]['code'] |
|
|
row['itemCode'] = val[0]['itemCode'] |
|
|
}else if(formField == 'workStationCode'){ |
|
|
row['packingNumber'] = val[0]['packingNumber'] |
|
|
row['workStationCode'] = val[0]['code'] |
|
|
row['batch'] = val[0]['batch'] |
|
|
}else if(formField == 'processCode'){ |
|
|
row['uom'] = val[0]['uom'] |
|
|
row['processCode'] = val[0]['code'] |
|
|
row['inventoryStatus'] = val[0]['inventoryStatus'] |
|
|
}else if(formField == 'itemCode'){ |
|
|
row['fromLocationCode'] = val[0]['locationCode'] |
|
|
console.log("aaaaaaaa",val); |
|
|
|
|
|
row['itemCode'] = val[0]['itemCode'] |
|
|
|
|
|
row['fromLocationCode'] = val[0]['rawLocationCode'] |
|
|
|
|
|
} |
|
|
|
|
|
// row[formField] = val[0][searchField] |
|
|
|
|
|
// row['containerNumber'] = val[0]['containerNumber'] |
|
|
|
|
|
// row['itemCode'] = val[0]['itemCode'] |
|
|
|
|
|
// row['packingNumber'] = val[0]['packingNumber'] |
|
|
|
|
|
// row['batch'] = val[0]['batch'] |
|
|
|
|
|
// row['uom'] = val[0]['uom'] |
|
|
|
|
|
// row['inventoryStatus'] = val[0]['inventoryStatus'] |
|
|
|
|
|
// row['fromLocationCode'] = val[0]['locationCode'] |
|
|
} else { |
|
|
} else { |
|
|
const setV = {} |
|
|
const setV = {} |
|
|
setV[formField] = val[0][searchField] |
|
|
setV[formField] = val[0][searchField] |
|
@ -148,7 +265,7 @@ const { getList, setSearchParams } = tableMethods |
|
|
// 列表头部按钮 |
|
|
// 列表头部按钮 |
|
|
const HeadButttondata = [ |
|
|
const HeadButttondata = [ |
|
|
defaultButtons.defaultAddBtn({hasPermi:'wms:productscrap-request-main:create'}), // 新增——需要手动修改下权限 |
|
|
defaultButtons.defaultAddBtn({hasPermi:'wms:productscrap-request-main:create'}), // 新增——需要手动修改下权限 |
|
|
defaultButtons.defaultImportBtn({hasPermi:'wms:productscrap-request-main:import'}), // 导入 |
|
|
// defaultButtons.defaultImportBtn({hasPermi:'wms:productscrap-request-main:import'}), // 导入 |
|
|
defaultButtons.defaultExportBtn({hasPermi:'wms:productscrap-request-main:export'}), // 导出 |
|
|
defaultButtons.defaultExportBtn({hasPermi:'wms:productscrap-request-main:export'}), // 导出 |
|
|
defaultButtons.defaultFreshBtn(null), // 刷新 |
|
|
defaultButtons.defaultFreshBtn(null), // 刷新 |
|
|
defaultButtons.defaultFilterBtn(null), // 筛选 |
|
|
defaultButtons.defaultFilterBtn(null), // 筛选 |
|
@ -191,30 +308,37 @@ const isShowMainButton = (row,val) => { |
|
|
// 列表-操作按钮 |
|
|
// 列表-操作按钮 |
|
|
const butttondata = (row) => { |
|
|
const butttondata = (row) => { |
|
|
return [ |
|
|
return [ |
|
|
defaultButtons.mainListCloseBtn({hide:isShowMainButton(row,['1','2','3','4','6'])}), // 关闭 |
|
|
defaultButtons.mainListCloseBtn({hide:isShowMainButton(row,['1','2','3','4']),hasPermi:'wms:productscrap-request-main:close'}), // 关闭 |
|
|
defaultButtons.mainListReAddBtn({hide:isShowMainButton(row,['4','5'])}), // 重新添加 |
|
|
defaultButtons.mainListReAddBtn({hide:isShowMainButton(row,['5']),hasPermi:'wms:productscrap-request-main:reAdd'}), // 重新添加 |
|
|
defaultButtons.mainListSubmitBtn({hide:isShowMainButton(row,['1'])}), // 提交审批 |
|
|
defaultButtons.mainListSubmitBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:productscrap-request-main:submit'}), // 提交审批 |
|
|
defaultButtons.mainListTurnDownBtn({hide:isShowMainButton(row,['2'])}), // 驳回 |
|
|
defaultButtons.mainListTurnDownBtn({hide:isShowMainButton(row,['2']),hasPermi:'wms:productscrap-request-main:refused'}), // 驳回 |
|
|
defaultButtons.mainListApproveBtn({hide:isShowMainButton(row,['2'])}), // 审批通过 |
|
|
defaultButtons.mainListApproveBtn({hide:isShowMainButton(row,['2']),hasPermi:'wms:productscrap-request-main:agree'}), // 审批通过 |
|
|
defaultButtons.mainListEditBtn({hasPermi:'wms:productscrap-request-main:update'}), // 编辑 |
|
|
defaultButtons.mainListHandleBtn({hide:isShowMainButton(row,['3']),hasPermi:'wms:productscrap-request-main:handle'}), // 处理 |
|
|
defaultButtons.mainListDeleteBtn({hasPermi:'wms:productscrap-request-main:delete'}), // 删除 |
|
|
defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:productscrap-request-main:update'}), // 编辑 |
|
|
|
|
|
// defaultButtons.mainListDeleteBtn({hasPermi:'wms:productscrap-request-main:delete'}), // 删除 |
|
|
] |
|
|
] |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 列表-操作按钮事件 |
|
|
// 列表-操作按钮事件 |
|
|
const buttonTableClick = async (val, row) => { |
|
|
const buttonTableClick = async (val, row) => { |
|
|
if (val == 'mainClose') { // 关闭 |
|
|
if (val == 'mainClose') { // 关闭 |
|
|
console.log('列表-操作按钮事件-关闭') |
|
|
console.log('列表-操作按钮事件-关闭') |
|
|
|
|
|
handleClose(row.id) |
|
|
} else if (val == 'mainReAdd') { // 重新添加 |
|
|
} else if (val == 'mainReAdd') { // 重新添加 |
|
|
console.log('列表-操作按钮事件-重新添加') |
|
|
console.log('列表-操作按钮事件-重新添加') |
|
|
|
|
|
handleReAdd(row.id) |
|
|
} else if (val == 'mainSubmit') { // 提交审批 |
|
|
} else if (val == 'mainSubmit') { // 提交审批 |
|
|
console.log('列表-操作按钮事件-提交审批') |
|
|
console.log('列表-操作按钮事件-提交审批') |
|
|
|
|
|
handleSubmit(row.id) |
|
|
} else if (val == 'mainTurnDown') { // 驳回 |
|
|
} else if (val == 'mainTurnDown') { // 驳回 |
|
|
console.log('列表-操作按钮事件-驳回') |
|
|
console.log('列表-操作按钮事件-驳回') |
|
|
|
|
|
handleRefused(row.id) |
|
|
} else if (val == 'mainApprove') { // 审批通过 |
|
|
} else if (val == 'mainApprove') { // 审批通过 |
|
|
console.log('列表-操作按钮事件-审批通过') |
|
|
console.log('列表-操作按钮事件-审批通过') |
|
|
|
|
|
handleAgree(row.id) |
|
|
|
|
|
} else if (val == 'mainHandle') { // 处理 |
|
|
|
|
|
console.log('列表-操作按钮事件-处理') |
|
|
|
|
|
handleHandle(row.id) |
|
|
} else if (val == 'edit') { // 编辑 |
|
|
} else if (val == 'edit') { // 编辑 |
|
|
openForm('update', row) |
|
|
openForm('update', row) |
|
|
} else if (val == 'delete') { // 删除 |
|
|
} else if (val == 'delete') { // 删除 |
|
@ -222,6 +346,66 @@ const buttonTableClick = async (val, row) => { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** 关闭按钮操作 */ |
|
|
|
|
|
const handleClose = async (id: number) => { |
|
|
|
|
|
try { |
|
|
|
|
|
await message.confirm(t('common.confirmColse')) |
|
|
|
|
|
await ProductscrapRequestMainApi.closeProductscrapRequestMain(id) |
|
|
|
|
|
message.success(t('common.closeSuccess')) |
|
|
|
|
|
await getList() |
|
|
|
|
|
} catch {} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** 重新添加按钮操作 */ |
|
|
|
|
|
const handleReAdd = async (id: number) => { |
|
|
|
|
|
try { |
|
|
|
|
|
await message.confirm(t('common.confirmReAdd')) |
|
|
|
|
|
await ProductscrapRequestMainApi.reAddProductscrapRequestMain(id) |
|
|
|
|
|
message.success(t('common.reAddSuccess')) |
|
|
|
|
|
await getList() |
|
|
|
|
|
} catch {} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** 提交按钮操作 */ |
|
|
|
|
|
const handleSubmit = async (id: number) => { |
|
|
|
|
|
try { |
|
|
|
|
|
await message.confirm(t('common.confirmSubmit')) |
|
|
|
|
|
await ProductscrapRequestMainApi.submitProductscrapRequestMain(id) |
|
|
|
|
|
message.success(t('common.submitSuccess')) |
|
|
|
|
|
await getList() |
|
|
|
|
|
} catch {} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** 审批驳回按钮操作 */ |
|
|
|
|
|
const handleRefused = async (id: number) => { |
|
|
|
|
|
try { |
|
|
|
|
|
await message.confirm(t('common.confirmRefused')) |
|
|
|
|
|
await ProductscrapRequestMainApi.refusedProductscrapRequestMain(id) |
|
|
|
|
|
message.success(t('common.refusedSuccess')) |
|
|
|
|
|
await getList() |
|
|
|
|
|
} catch {} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** 审批通过按钮操作 */ |
|
|
|
|
|
const handleAgree = async (id: number) => { |
|
|
|
|
|
try { |
|
|
|
|
|
await message.confirm(t('common.confirmAgree')) |
|
|
|
|
|
await ProductscrapRequestMainApi.agreeProductscrapRequestMain(id) |
|
|
|
|
|
message.success(t('common.agreeSuccess')) |
|
|
|
|
|
await getList() |
|
|
|
|
|
} catch {} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** 处理按钮操作 */ |
|
|
|
|
|
const handleHandle = async (id: number) => { |
|
|
|
|
|
try { |
|
|
|
|
|
await message.confirm(t('common.confirmHandle')) |
|
|
|
|
|
await ProductscrapRequestMainApi.handleProductscrapRequestMain(id) |
|
|
|
|
|
message.success(t('common.handleSuccess')) |
|
|
|
|
|
await getList() |
|
|
|
|
|
} catch {} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/** 添加/修改操作 */ |
|
|
/** 添加/修改操作 */ |
|
|
const formRef = ref() |
|
|
const formRef = ref() |
|
|
const openForm =async (type: string, row?: number) => { |
|
|
const openForm =async (type: string, row?: number) => { |
|
|