|
|
@ -33,7 +33,7 @@ |
|
|
|
</el-button> |
|
|
|
</template> |
|
|
|
<template #action="{ row }"> |
|
|
|
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" /> |
|
|
|
<ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event,row)" /> |
|
|
|
</template> |
|
|
|
</Table> |
|
|
|
</ContentWrap> |
|
|
@ -50,6 +50,7 @@ |
|
|
|
:apiUpdate="PreparetoissueMainApi.updatePreparetoissueMain" |
|
|
|
:apiCreate="PreparetoissueMainApi.createPreparetoissueMain" |
|
|
|
:isBusiness="true" |
|
|
|
:isShowButton="isShowButton" |
|
|
|
@handleAddTable="handleAddTable" |
|
|
|
@handleDeleteTable="handleDeleteTable" |
|
|
|
@searchTableSuccess="searchTableSuccess" |
|
|
@ -80,6 +81,8 @@ import { PreparetoissueMain,PreparetoissueMainRules,PreparetoissueDetail,Prepare |
|
|
|
import * as PreparetoissueMainApi from '@/api/wms/preparetoissueMain' |
|
|
|
import * as PreparetoissueDetailApi from '@/api/wms/preparetoissueDetail' |
|
|
|
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
|
import * as ProductionDetailApi from '@/api/wms/productionDetail' |
|
|
|
import * as ProductionlineitemApi from '@/api/wms/productionlineitem' |
|
|
|
|
|
|
|
// 备料计划 |
|
|
|
defineOptions({ name: 'PreparetoissueMain' }) |
|
|
@ -92,6 +95,8 @@ const routeName = ref() |
|
|
|
routeName.value = route.name |
|
|
|
const tableColumns = ref(PreparetoissueMain.allSchemas.tableColumns) |
|
|
|
|
|
|
|
const isShowButton = ref(true) |
|
|
|
|
|
|
|
// 字段设置 更新主列表字段 |
|
|
|
const updataTableColumns = (val) => { |
|
|
|
tableColumns.value = val |
|
|
@ -109,9 +114,53 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => |
|
|
|
setV[formField] = val[0][searchField] |
|
|
|
if (formField == 'productionPlanNumber') { |
|
|
|
setV['workshop'] = val[0]['workshop'] |
|
|
|
setV['prodLine'] = val[0]['production_line'] |
|
|
|
setV['prodLine'] = val[0]['productionLine'] |
|
|
|
setV['shift'] = val[0]['shift'] |
|
|
|
setV['team'] = val[0]['team'] |
|
|
|
isShowButton.value = false |
|
|
|
// 获取子表数据 |
|
|
|
ProductionDetailApi.getProductionDetailPage({ |
|
|
|
masterId: val[0]['id'], |
|
|
|
pageSize: 100, |
|
|
|
pageNo: 1, |
|
|
|
sort: '', |
|
|
|
by: 'ASC' |
|
|
|
}).then(res => { |
|
|
|
if (res) tableData.value = res.list |
|
|
|
// 根据子表物品代码 和主表生产线 查询生产线物品关系 获取 原料库位赋值目标库位 |
|
|
|
tableData.value.map(item => { |
|
|
|
ProductionlineitemApi.getProductionlineitemPage({ |
|
|
|
productionLineCode: val[0]['productionLine'], |
|
|
|
itemCode: item.itemCode, |
|
|
|
pageSize: 100, |
|
|
|
pageNo: 1, |
|
|
|
sort: '', |
|
|
|
by: 'ASC' |
|
|
|
}).then(res => { |
|
|
|
item.toLocationCode = res.list[0].rawLocationCode |
|
|
|
}) |
|
|
|
}) |
|
|
|
// 修改 tableform 属性 |
|
|
|
PreparetoissueDetail.allSchemas.tableFormColumns.map(item => { |
|
|
|
if(item.field == 'itemCode') { |
|
|
|
item.isInpuFocusShow = false |
|
|
|
item.tableForm.isInpuFocusShow = false |
|
|
|
item.tableForm.disabled = true |
|
|
|
} |
|
|
|
if(item.field == 'planQty') { |
|
|
|
item.tableForm.disabled = true |
|
|
|
} |
|
|
|
if(item.field == 'uom') { |
|
|
|
item.tableForm.disabled = true |
|
|
|
} |
|
|
|
if(item.field == 'available') { |
|
|
|
item.tableForm.disabled = true |
|
|
|
} |
|
|
|
}) |
|
|
|
}).catch(err => { |
|
|
|
console.log(err) |
|
|
|
message.error('错误') |
|
|
|
}) |
|
|
|
} |
|
|
|
formRef.setValues(setV) |
|
|
|
} |
|
|
@ -136,8 +185,8 @@ const { getList, setSearchParams } = tableMethods |
|
|
|
|
|
|
|
// 列表头部按钮 |
|
|
|
const HeadButttondata = [ |
|
|
|
defaultButtons.defaultAddBtn({hasPermi:'wms:preparetoissue-main:create'}), // 新增——需要手动修改下权限 |
|
|
|
defaultButtons.defaultImportBtn({hasPermi:'wms:preparetoissue-main:import'}), // 导入 |
|
|
|
defaultButtons.defaultAddBtn({hasPermi:'wms:preparetoissue-main:create'}), // 新增 |
|
|
|
// defaultButtons.defaultImportBtn({hasPermi:'wms:preparetoissue-main:import'}), // 导入 |
|
|
|
defaultButtons.defaultExportBtn({hasPermi:'wms:preparetoissue-main:export'}), // 导出 |
|
|
|
defaultButtons.defaultFreshBtn(null), // 刷新 |
|
|
|
defaultButtons.defaultFilterBtn(null), // 筛选 |
|
|
@ -156,6 +205,7 @@ const HeadButttondata = [ |
|
|
|
const buttonBaseClick = (val, item) => { |
|
|
|
if (val == 'add') { // 新增 |
|
|
|
openForm('create') |
|
|
|
resetShow() |
|
|
|
} else if (val == 'import') { // 导入 |
|
|
|
handleImport() |
|
|
|
} else if (val == 'export') { // 导出 |
|
|
@ -180,29 +230,75 @@ const isShowMainButton = (row,val) => { |
|
|
|
// 列表-操作按钮 |
|
|
|
const butttondata = (row) => { |
|
|
|
return [ |
|
|
|
defaultButtons.mainListPlanOpeBtn({hide:isShowMainButton(row,['5','4'])}), // 打开 |
|
|
|
defaultButtons.mainListPlanCloBtn({hide:isShowMainButton(row,['1','2','3','4','6'])}), // 关闭 |
|
|
|
defaultButtons.mainListPlanOpeBtn({hide:isShowMainButton(row,['5'])}), // 打开 |
|
|
|
defaultButtons.mainListPlanCloBtn({hide:isShowMainButton(row,['1','2','3','4'])}), // 关闭 |
|
|
|
defaultButtons.mainListPlanSubBtn({hide:isShowMainButton(row,['1'])}), // 提交审批 |
|
|
|
defaultButtons.mainListPlanTurBtn({hide:isShowMainButton(row,['2'])}), // 驳回 |
|
|
|
defaultButtons.mainListPlanAppBtn({hide:isShowMainButton(row,['2'])}), // 审批通过 |
|
|
|
defaultButtons.mainListPlanPubBtn({hide:isShowMainButton(row,['3'])}), // 发布 |
|
|
|
defaultButtons.mainListPlanResBtn({hide:isShowMainButton(row,['4'])}), // 重置 |
|
|
|
defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:production-main:update'}), // 编辑 |
|
|
|
defaultButtons.mainListDeleteBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:production-main:delete'}), // 删除 |
|
|
|
// defaultButtons.mainListDeleteBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:production-main:delete'}), // 删除 |
|
|
|
] |
|
|
|
} |
|
|
|
|
|
|
|
// 列表-操作按钮事件 |
|
|
|
const buttonTableClick = async (val, row) => { |
|
|
|
if (val == 'mainPlanOpe') { // 打开 |
|
|
|
console.log('列表-操作按钮事件-打开') |
|
|
|
PreparetoissueMainApi.open(row.id).then(() => { |
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
getList() |
|
|
|
}).catch(err => { |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
} else if (val == 'mainPlanClo') { // 关闭 |
|
|
|
console.log('列表-操作按钮事件-关闭') |
|
|
|
await message.confirm('确认要关闭吗?') |
|
|
|
PreparetoissueMainApi.close(row.id).then(() => { |
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
getList() |
|
|
|
}).catch(err => { |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
} else if (val == 'mainPlanSub') { // 提交审批 |
|
|
|
console.log('列表-操作按钮事件-提交审批') |
|
|
|
await message.confirm('确认要提交审批吗?') |
|
|
|
PreparetoissueMainApi.submit(row.id).then(() => { |
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
getList() |
|
|
|
}).catch(err => { |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
} else if (val == 'mainPlanTur') { // 驳回 |
|
|
|
console.log('列表-操作按钮事件-驳回') |
|
|
|
await message.confirm('确认要驳回吗?') |
|
|
|
PreparetoissueMainApi.reject(row.id).then(() => { |
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
getList() |
|
|
|
}).catch(err => { |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
} else if (val == 'mainPlanApp') { // 审批通过 |
|
|
|
console.log('列表-操作按钮事件-审批通过') |
|
|
|
await message.confirm('确认要审批通过吗?') |
|
|
|
PreparetoissueMainApi.agree(row.id).then(() => { |
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
getList() |
|
|
|
}).catch(err => { |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
} else if (val == 'mainPlanPub') { // 发布 |
|
|
|
await message.confirm('确认要发布吗?') |
|
|
|
PreparetoissueMainApi.publish(row.id).then(() => { |
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
getList() |
|
|
|
}).catch(err => { |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
} else if (val == 'mainPlanRes') { // 重置 |
|
|
|
await message.confirm('确认要重置吗?') |
|
|
|
PreparetoissueMainApi.resetting(row.id).then(() => { |
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
getList() |
|
|
|
}).catch(err => { |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
} else if (val == 'edit') { // 编辑 |
|
|
|
openForm('update', row) |
|
|
|
} else if (val == 'delete') { // 删除 |
|
|
@ -315,9 +411,32 @@ const searchFormClick = (searchData) => { |
|
|
|
getList() // 刷新当前列表 |
|
|
|
} |
|
|
|
|
|
|
|
// 恢复最初属性:明细添加/删除行按钮,字段查询弹窗,可输入状态等 |
|
|
|
// 列表头部 新增按钮 触发 |
|
|
|
const resetShow = async () => { |
|
|
|
isShowButton.value = true // tableform按钮恢复到显示 |
|
|
|
// 修改 tableform 属性 |
|
|
|
PreparetoissueDetail.allSchemas.tableFormColumns.map(item => { |
|
|
|
if(item.field == 'itemCode') { |
|
|
|
item.isInpuFocusShow = true |
|
|
|
item.tableForm.isInpuFocusShow = true |
|
|
|
item.tableForm.disabled = false |
|
|
|
} |
|
|
|
if(item.field == 'planQty') { |
|
|
|
item.tableForm.disabled = false |
|
|
|
} |
|
|
|
if(item.field == 'uom') { |
|
|
|
item.tableForm.disabled = false |
|
|
|
} |
|
|
|
if(item.field == 'available') { |
|
|
|
item.tableForm.disabled = false |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
/** 初始化 **/ |
|
|
|
onMounted(async () => { |
|
|
|
getList() |
|
|
|
importTemplateData.templateUrl = await PreparetoissueMainApi.importTemplate() |
|
|
|
// importTemplateData.templateUrl = await PreparetoissueMainApi.importTemplate() |
|
|
|
}) |
|
|
|
</script> |
|
|
|