|
@ -73,7 +73,7 @@ |
|
|
|
|
|
|
|
|
<!-- 导入 --> |
|
|
<!-- 导入 --> |
|
|
<ImportForm ref="importFormRef" url="/wms/inventorymove-request-main/import" :importTemplateData="importTemplateData" |
|
|
<ImportForm ref="importFormRef" url="/wms/inventorymove-request-main/import" :importTemplateData="importTemplateData" |
|
|
@success="importSuccess" :updateIsDisable="true" :coverIsDisable="true" :mode="2" /> |
|
|
@success="importSuccess" :updateIsDisable="true" :coverIsDisable="true" :mode="2" :fromInventoryStatus= "fromInventoryStatus" :toInventoryStatus="toInventoryStatus" /> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script setup lang="ts"> |
|
|
<script setup lang="ts"> |
|
@ -94,6 +94,56 @@ const routeName = ref() |
|
|
routeName.value = route.name |
|
|
routeName.value = route.name |
|
|
const tableColumns = ref(InventorymoveRequestMain.allSchemas.tableColumns) |
|
|
const tableColumns = ref(InventorymoveRequestMain.allSchemas.tableColumns) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
console.log(99 , routeName.value) |
|
|
|
|
|
const fromInventoryStatus = ref() |
|
|
|
|
|
const toInventoryStatus = ref() |
|
|
|
|
|
|
|
|
|
|
|
const { tableObject, tableMethods } = useTable({ |
|
|
|
|
|
getListApi: InventorymoveRequestMainApi.getInventorymoveRequestMainPage // 分页接口 |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
// 判断 路由名称 进行条件过滤 |
|
|
|
|
|
/** |
|
|
|
|
|
* OktoholdRequestMain 合格转隔离 |
|
|
|
|
|
*/ |
|
|
|
|
|
if ( routeName.value == 'OktoholdRequestMain') { |
|
|
|
|
|
tableObject.params = { |
|
|
|
|
|
fromInventoryStatus: 'OK', |
|
|
|
|
|
toInventoryStatus:'HOLD' |
|
|
|
|
|
} |
|
|
|
|
|
fromInventoryStatus.value = 'OK' |
|
|
|
|
|
toInventoryStatus.value = "HOLD" |
|
|
|
|
|
} else if ( routeName.value == 'HoldtookRequestMain') { |
|
|
|
|
|
tableObject.params = { |
|
|
|
|
|
fromInventoryStatus: 'HOLD', |
|
|
|
|
|
toInventoryStatus:'OK' |
|
|
|
|
|
} |
|
|
|
|
|
fromInventoryStatus.value = 'HOLD' |
|
|
|
|
|
toInventoryStatus.value = "OK" |
|
|
|
|
|
} else if ( routeName.value == 'HoldtoscrapRequestMain') { |
|
|
|
|
|
tableObject.params = { |
|
|
|
|
|
fromInventoryStatus: 'HOLD', |
|
|
|
|
|
toInventoryStatus:'SCRAP' |
|
|
|
|
|
} |
|
|
|
|
|
fromInventoryStatus.value = 'HOLD' |
|
|
|
|
|
toInventoryStatus.value = "SCRAP" |
|
|
|
|
|
} else if ( routeName.value == 'OktoscrapRequestMain') { |
|
|
|
|
|
tableObject.params = { |
|
|
|
|
|
fromInventoryStatus: 'OK', |
|
|
|
|
|
toInventoryStatus:'SCRAP' |
|
|
|
|
|
} |
|
|
|
|
|
fromInventoryStatus.value = 'OK' |
|
|
|
|
|
toInventoryStatus.value = "SCRAP" |
|
|
|
|
|
} else if ( routeName.value == 'ScraptoholdRequestMain') { |
|
|
|
|
|
tableObject.params = { |
|
|
|
|
|
fromInventoryStatus: 'SCRAP', |
|
|
|
|
|
toInventoryStatus:'HOLD' |
|
|
|
|
|
} |
|
|
|
|
|
fromInventoryStatus.value = 'SCRAP' |
|
|
|
|
|
toInventoryStatus.value = "HOLD" |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// 字段设置 更新主列表字段 |
|
|
// 字段设置 更新主列表字段 |
|
|
const updataTableColumns = (val) => { |
|
|
const updataTableColumns = (val) => { |
|
|
tableColumns.value = val |
|
|
tableColumns.value = val |
|
@ -142,10 +192,6 @@ const searchTableSuccessDetail = (formField, searchField, val, formRef ) => { |
|
|
// const Echo = ['ppNumber','poLine', 'batch', 'altBatch', 'itemCode', 'itemName', 'itemDesc1', 'itemDesc2', 'projectCode', 'qty', 'uom'] |
|
|
// const Echo = ['ppNumber','poLine', 'batch', 'altBatch', 'itemCode', 'itemName', 'itemDesc1', 'itemDesc2', 'projectCode', 'qty', 'uom'] |
|
|
const Echo = [] |
|
|
const Echo = [] |
|
|
|
|
|
|
|
|
const { tableObject, tableMethods } = useTable({ |
|
|
|
|
|
getListApi: InventorymoveRequestMainApi.getInventorymoveRequestMainPage // 分页接口 |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
// 获得表格的各种操作 |
|
|
// 获得表格的各种操作 |
|
|
const { getList, setSearchParams } = tableMethods |
|
|
const { getList, setSearchParams } = tableMethods |
|
|
|
|
|
|
|
@ -195,13 +241,14 @@ 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','6']),hasPermi:'wms:inventorymove-request-main:close'}), // 关闭 |
|
|
defaultButtons.mainListReAddBtn({hide:isShowMainButton(row,['4','5'])}), // 重新添加 |
|
|
defaultButtons.mainListReAddBtn({hide:isShowMainButton(row,['4','5']),hasPermi:'wms:inventorymove-request-main:reAdd'}), //重新添加 |
|
|
defaultButtons.mainListSubmitBtn({hide:isShowMainButton(row,['1'])}), // 提交审批 |
|
|
defaultButtons.mainListSubmitBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:inventorymove-request-main:submit'}), // 提交审批 |
|
|
defaultButtons.mainListTurnDownBtn({hide:isShowMainButton(row,['2'])}), // 驳回 |
|
|
defaultButtons.mainListTurnDownBtn({hide:isShowMainButton(row,['2']),hasPermi:'wms:inventorymove-request-main:refused'}), // 驳回 |
|
|
defaultButtons.mainListApproveBtn({hide:isShowMainButton(row,['2'])}), // 审批通过 |
|
|
defaultButtons.mainListApproveBtn({hide:isShowMainButton(row,['2']),hasPermi:'wms:inventorymove-request-main:agree'}), // 审批通过 |
|
|
defaultButtons.mainListEditBtn({hasPermi:'wms:inventorymove-request-main:update'}), // 编辑 |
|
|
defaultButtons.mainListHandleBtn({hide:isShowMainButton(row,['3']),hasPermi:'wms:inventorymove-request-main:handle'}), // 处理 |
|
|
defaultButtons.mainListDeleteBtn({hasPermi:'wms:inventorymove-request-main:delete'}), // 删除 |
|
|
defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:inventorymove-request-main:update'}), // 编辑 |
|
|
|
|
|
// defaultButtons.mainListDeleteBtn({hasPermi:'wms:inventorymove-request-main:delete'}), // 删除 |
|
|
] |
|
|
] |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -210,15 +257,53 @@ const butttondata = (row) => { |
|
|
// 列表-操作按钮事件 |
|
|
// 列表-操作按钮事件 |
|
|
const buttonTableClick = async (val, row) => { |
|
|
const buttonTableClick = async (val, row) => { |
|
|
if (val == 'mainClose') { // 关闭 |
|
|
if (val == 'mainClose') { // 关闭 |
|
|
console.log('列表-操作按钮事件-关闭') |
|
|
await message.confirm('确认要关闭吗?') |
|
|
|
|
|
InventorymoveRequestMainApi.close(row.id).then(() => { |
|
|
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
|
|
getList() |
|
|
|
|
|
}).catch(err => { |
|
|
|
|
|
console.log(err) |
|
|
|
|
|
}) |
|
|
} else if (val == 'mainReAdd') { // 重新添加 |
|
|
} else if (val == 'mainReAdd') { // 重新添加 |
|
|
console.log('列表-操作按钮事件-重新添加') |
|
|
await message.confirm('确认要重新添加吗?') |
|
|
|
|
|
InventorymoveRequestMainApi.reAdd(row.id).then(() => { |
|
|
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
|
|
getList() |
|
|
|
|
|
}).catch(err => { |
|
|
|
|
|
console.log(err) |
|
|
|
|
|
}) |
|
|
} else if (val == 'mainSubmit') { // 提交审批 |
|
|
} else if (val == 'mainSubmit') { // 提交审批 |
|
|
console.log('列表-操作按钮事件-提交审批') |
|
|
await message.confirm('确认要提交审批吗?') |
|
|
|
|
|
InventorymoveRequestMainApi.submit(row.id).then(() => { |
|
|
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
|
|
getList() |
|
|
|
|
|
}).catch(err => { |
|
|
|
|
|
console.log(err) |
|
|
|
|
|
}) |
|
|
} else if (val == 'mainTurnDown') { // 驳回 |
|
|
} else if (val == 'mainTurnDown') { // 驳回 |
|
|
console.log('列表-操作按钮事件-驳回') |
|
|
await message.confirm('确认要驳回吗?') |
|
|
|
|
|
InventorymoveRequestMainApi.refused(row.id).then(() => { |
|
|
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
|
|
getList() |
|
|
|
|
|
}).catch(err => { |
|
|
|
|
|
console.log(err) |
|
|
|
|
|
}) |
|
|
} else if (val == 'mainApprove') { // 审批通过 |
|
|
} else if (val == 'mainApprove') { // 审批通过 |
|
|
console.log('列表-操作按钮事件-审批通过') |
|
|
await message.confirm('确认要审批通过吗?') |
|
|
|
|
|
InventorymoveRequestMainApi.agree(row.id).then(() => { |
|
|
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
|
|
getList() |
|
|
|
|
|
}).catch(err => { |
|
|
|
|
|
console.log(err) |
|
|
|
|
|
}) |
|
|
|
|
|
} else if (val == 'mainHandle') { // 处理 |
|
|
|
|
|
await message.confirm('确认要处理吗?') |
|
|
|
|
|
InventorymoveRequestMainApi.handle(row.id).then(() => { |
|
|
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
|
|
getList() |
|
|
|
|
|
}).catch(err => { |
|
|
|
|
|
console.log(err) |
|
|
|
|
|
}) |
|
|
} else if (val == 'edit') { // 编辑 |
|
|
} else if (val == 'edit') { // 编辑 |
|
|
openForm('update', row) |
|
|
openForm('update', row) |
|
|
} else if (val == 'delete') { // 删除 |
|
|
} else if (val == 'delete') { // 删除 |
|
@ -289,6 +374,10 @@ const handleDeleteTable = (item, index) => { |
|
|
// 主子数据 提交 |
|
|
// 主子数据 提交 |
|
|
const submitForm = async (formType, data) => { |
|
|
const submitForm = async (formType, data) => { |
|
|
data.subList = tableData.value // 拼接子表数据参数 |
|
|
data.subList = tableData.value // 拼接子表数据参数 |
|
|
|
|
|
data.subList.forEach(item => { |
|
|
|
|
|
item.fromInventoryStatus = fromInventoryStatus.value |
|
|
|
|
|
item.toInventoryStatus = toInventoryStatus.value |
|
|
|
|
|
}) |
|
|
try { |
|
|
try { |
|
|
if (formType === 'create') { |
|
|
if (formType === 'create') { |
|
|
await InventorymoveRequestMainApi.createInventorymoveRequestMain(data) |
|
|
await InventorymoveRequestMainApi.createInventorymoveRequestMain(data) |
|
|