|
|
@ -1,23 +1,31 @@ |
|
|
|
<template> |
|
|
|
<ContentWrap> |
|
|
|
<!-- 搜索工作栏 --> |
|
|
|
<Search :schema="[...InventorychangeRequestMain.allSchemas.searchSchema,...InventorychangeRequestDetail.allSchemas.searchSchema]" @search="setSearchParams" @reset="setSearchParams" /> |
|
|
|
<Search |
|
|
|
:schema="[ |
|
|
|
...InventorychangeRequestMain.allSchemas.searchSchema, |
|
|
|
...InventorychangeRequestDetail.allSchemas.searchSchema |
|
|
|
]" |
|
|
|
@search="setSearchParams" |
|
|
|
@reset="setSearchParams" |
|
|
|
/> |
|
|
|
</ContentWrap> |
|
|
|
|
|
|
|
<!-- 列表头部 --> |
|
|
|
<TableHead |
|
|
|
:HeadButttondata="HeadButttondata" |
|
|
|
@button-base-click="buttonBaseClick" |
|
|
|
:routeName="routeName" |
|
|
|
@updataTableColumns="updataTableColumns" |
|
|
|
@searchFormClick="searchFormClick" |
|
|
|
:allSchemas="InventorychangeRequestMain.allSchemas" |
|
|
|
:detailAllSchemas="InventorychangeRequestDetail.allSchemas" |
|
|
|
/> |
|
|
|
<!-- 列表头部 --> |
|
|
|
<TableHead |
|
|
|
:HeadButttondata="HeadButttondata" |
|
|
|
@button-base-click="buttonBaseClick" |
|
|
|
:routeName="routeName" |
|
|
|
@updataTableColumns="updataTableColumns" |
|
|
|
@searchFormClick="searchFormClick" |
|
|
|
:allSchemas="InventorychangeRequestMain.allSchemas" |
|
|
|
:detailAllSchemas="InventorychangeRequestDetail.allSchemas" |
|
|
|
/> |
|
|
|
|
|
|
|
<!-- 列表 --> |
|
|
|
<ContentWrap> |
|
|
|
<Table v-clientTable |
|
|
|
<Table |
|
|
|
v-clientTable |
|
|
|
:columns="tableColumns" |
|
|
|
:data="tableObject.tableList" |
|
|
|
:loading="tableObject.loading" |
|
|
@ -28,13 +36,16 @@ |
|
|
|
v-model:currentPage="tableObject.currentPage" |
|
|
|
v-model:sort="tableObject.sort" |
|
|
|
> |
|
|
|
<template #number="{row}"> |
|
|
|
<template #number="{ row }"> |
|
|
|
<el-button type="primary" link @click="openDetail(row, '单据号', row.number)"> |
|
|
|
<span>{{ row.number }}</span> |
|
|
|
</el-button> |
|
|
|
</template> |
|
|
|
<template #action="{ row,$index }"> |
|
|
|
<ButtonBase :Butttondata="butttondata(row,$index)" @button-base-click="buttonTableClick($event,row)" /> |
|
|
|
<template #action="{ row, $index }"> |
|
|
|
<ButtonBase |
|
|
|
:Butttondata="butttondata(row, $index)" |
|
|
|
@button-base-click="buttonTableClick($event, row)" |
|
|
|
/> |
|
|
|
</template> |
|
|
|
</Table> |
|
|
|
</ContentWrap> |
|
|
@ -74,8 +85,15 @@ |
|
|
|
/> |
|
|
|
|
|
|
|
<!-- 导入 --> |
|
|
|
<ImportForm ref="importFormRef" url="/wms/inventorychange-request-main/import" :importTemplateData="importTemplateData" |
|
|
|
@success="importSuccess" :updateIsDisable="true" :coverIsDisable="true" :mode="2" /> |
|
|
|
<ImportForm |
|
|
|
ref="importFormRef" |
|
|
|
url="/wms/inventorychange-request-main/import" |
|
|
|
:importTemplateData="importTemplateData" |
|
|
|
@success="importSuccess" |
|
|
|
:updateIsDisable="true" |
|
|
|
:coverIsDisable="true" |
|
|
|
:mode="2" |
|
|
|
/> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script setup lang="ts"> |
|
|
@ -411,14 +429,23 @@ const flag = ref() |
|
|
|
// 主子数据 提交 |
|
|
|
const submitForm = async (formType, data) => { |
|
|
|
data.subList = tableData.value // 拼接子表数据参数 |
|
|
|
let isExist = false |
|
|
|
tableData.value.forEach(item => { |
|
|
|
let rs = tableData.value.filter(filterItem => (filterItem.packingNumber == item.packingNumber)) |
|
|
|
if(rs.length > 1) isExist = true |
|
|
|
}) |
|
|
|
if (isExist) { |
|
|
|
const duplicateItems = tableData.value.filter((item, index) => { |
|
|
|
return tableData.value.findIndex((el) => el.itemCode === item.itemCode) !== index; |
|
|
|
}); |
|
|
|
// tableData.value.forEach(item => { |
|
|
|
// let rs = tableData.value.filter(filterItem => (filterItem.packingNumber == item.packingNumber && filterItem.itemCode!=item.itemCode)) |
|
|
|
// // let same = tableData.value.filter(filterItem => (filterItem.packingNumber == item.packingNumber && filterItem.itemCode==item.itemCode)) |
|
|
|
// // debugger |
|
|
|
// // if(same.length!=tableData.value.length) isSameExist = true |
|
|
|
// if(rs.length > 1) isExist = true |
|
|
|
// }) |
|
|
|
// if (isSameExist) { |
|
|
|
// formRef.value.formLoading = false |
|
|
|
// return message.warning('包装号1重复') |
|
|
|
// } |
|
|
|
if (duplicateItems.length>0) { |
|
|
|
formRef.value.formLoading = false |
|
|
|
return message.warning('包装号重复') |
|
|
|
return message.warning('物料代码重复') |
|
|
|
} |
|
|
|
data.subList.forEach(obj => { |
|
|
|
if(obj.toQty == 0){ |
|
|
|