|
|
@ -55,6 +55,7 @@ |
|
|
|
import { getAccessToken } from '@/utils/auth' |
|
|
|
import download from '@/utils/download' |
|
|
|
import * as PurchaseclaimRequestMainApi from '@/api/wms/purchaseclaimRequestMain' |
|
|
|
import * as SupplierdeliverRecordDetailApi from '@/api/wms/supplierdeliverRecordDetail' |
|
|
|
import * as PurchaseclaimRequestDetailApi from '@/api/wms/purchaseclaimRequestDetail' |
|
|
|
import { PurchaseclaimRequestMain, PurchaseclaimRequestMainRules, PurchaseclaimRequestDetail, PurchaseclaimRequestDetailRules } from './purchaseclaimRequestMain.data' |
|
|
|
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
@ -79,10 +80,10 @@ |
|
|
|
|
|
|
|
// 查询页面返回 |
|
|
|
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => { |
|
|
|
|
|
|
|
|
|
|
|
nextTick(() => { |
|
|
|
if (type == 'tableForm') { |
|
|
|
|
|
|
|
|
|
|
|
// 子表查询页赋值 |
|
|
|
row[formField] = val[0][searchField] |
|
|
|
row['poLine'] = val[0]['poLine'] |
|
|
@ -99,11 +100,10 @@ |
|
|
|
// 主表查询页赋值 |
|
|
|
const setV = {} |
|
|
|
setV[formField] = val[0][searchField] |
|
|
|
|
|
|
|
if(formField=='asnNumber'){ |
|
|
|
// 获取子表数据 getBomDisassemble |
|
|
|
PurchasePlanDetailApi.getPurchasePlanDetailList({ |
|
|
|
number: val[0]['asnNumber']}).then(res => { |
|
|
|
// 获取子表数据 getSupplierdeliverRecordDetailList |
|
|
|
SupplierdeliverRecordDetailApi.getSupplierdeliverRecordDetailList({ |
|
|
|
asnNumber: val[0]['asnNumber']}).then(res => { |
|
|
|
if (res) tableData.value = res; |
|
|
|
tableData.value.forEach(item=>{ |
|
|
|
item.batch = item.toBatch |
|
|
@ -113,11 +113,6 @@ |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setV['ppNumber'] = val[0]['ppNumber'] |
|
|
|
setV['supplierCode'] = val[0]['supplierCode'] |
|
|
|
formRef.setValues(setV) |
|
|
@ -128,7 +123,7 @@ |
|
|
|
const searchTableSuccessDetail = (formField, searchField, val, formRef) => { |
|
|
|
console.log(456) |
|
|
|
nextTick(() => { |
|
|
|
|
|
|
|
|
|
|
|
const setV = {} |
|
|
|
setV[formField] = val[0][searchField] |
|
|
|
setV['poLine'] = val[0]['poLine'] |
|
|
@ -189,14 +184,25 @@ |
|
|
|
// 列表-操作按钮 |
|
|
|
const buttondata = (row) => { |
|
|
|
return [ |
|
|
|
defaultButtons.mainListCloseBtn({ hide: isShowMainButton(row, ['1', '2', '3', '4', '6']) }), // 关闭 |
|
|
|
defaultButtons.mainListReAddBtn({ hide: isShowMainButton(row, ['4', '5']) }), // 重新添加 |
|
|
|
defaultButtons.mainListSubmitBtn({ hide: isShowMainButton(row, ['1']) }), // 提交审批 |
|
|
|
defaultButtons.mainListTurnDownBtn({ hide: isShowMainButton(row, ['2']) }), // 驳回 |
|
|
|
defaultButtons.mainListApproveBtn({ hide: isShowMainButton(row, ['2']) }), // 审批通过 |
|
|
|
defaultButtons.mainListPurchasePlanOpeBtn({ hide: isShowMainButton(row, ['5']) }), // 打开 |
|
|
|
defaultButtons.mainListPurchasePlanCloBtn({ hide: isShowMainButton(row, ['1', '2', '4']) }), // 关闭 |
|
|
|
defaultButtons.mainListPlanSubBtn({ hide: isShowMainButton(row, ['1']) }), // 提交审批 |
|
|
|
defaultButtons.mainListPlanAppBtn({ hide: isShowMainButton(row, ['2']) }), // 审批通过 |
|
|
|
defaultButtons.mainListPlanTurBtn({ hide: isShowMainButton(row, ['2']) }), // 驳回按钮 |
|
|
|
defaultButtons.mainListEditBtn({ hide: isShowMainButton(row, ['1']), hasPermi: 'wms:purchaseclaim-request-main:update' }), // 编辑 |
|
|
|
defaultButtons.mainListDeleteBtn({ hide: isShowMainButton(row, ['1']), hasPermi: 'wms:purchaseclaim-request-main:delete' }), // 删除 |
|
|
|
defaultButtons.mainListPointBtn(null), // 打印 |
|
|
|
// 生成记录 |
|
|
|
{ |
|
|
|
label: '处理', |
|
|
|
name: 'genRecords', |
|
|
|
hide: isShowMainButton(row, ['3']), |
|
|
|
type: 'primary', |
|
|
|
icon: '', |
|
|
|
color: '', |
|
|
|
hasPermi: '', |
|
|
|
link: true, // 文本展现按钮 |
|
|
|
}, |
|
|
|
] |
|
|
|
} |
|
|
|
|
|
|
@ -211,17 +217,19 @@ |
|
|
|
|
|
|
|
// 列表-操作按钮事件 |
|
|
|
const buttonTableClick = async (val, row) => { |
|
|
|
if (val == 'mainClose') { // 关闭 |
|
|
|
console.log('列表-操作按钮事件-关闭') |
|
|
|
} else if (val == 'mainReAdd') { // 重新添加 |
|
|
|
console.log('列表-操作按钮事件-重新添加') |
|
|
|
} else if (val == 'mainSubmit') { // 提交审批 |
|
|
|
console.log('列表-操作按钮事件-提交审批') |
|
|
|
} else if (val == 'mainTurnDown') { // 驳回 |
|
|
|
console.log('列表-操作按钮事件-驳回') |
|
|
|
} else if (val == 'mainApprove') { // 审批通过 |
|
|
|
console.log('列表-操作按钮事件-审批通过') |
|
|
|
} else if (val == 'edit') { // 编辑 |
|
|
|
if (val == 'mainPurPlanOpe') { // 打开 |
|
|
|
handleOpe(row.id) |
|
|
|
} else if (val == 'mainPurPlanClo') {// 关闭 |
|
|
|
handleClo(row.id) |
|
|
|
} else if (val == 'mainPlanSub') { // 提交审批 |
|
|
|
handleSub(row.id) |
|
|
|
} else if (val == 'mainPlanApp') { // 审批通过 |
|
|
|
handleApp(row.id) |
|
|
|
} else if (val == 'mainPlanTur') { // 驳回按钮 |
|
|
|
handleTur(row.id) |
|
|
|
}else if (val == 'genRecords') { // 驳回按钮 |
|
|
|
genRecords(row.id) |
|
|
|
}else if (val == 'edit') { // 编辑 |
|
|
|
// const res = await ItempackagingApi.getItempackaging(row.id) |
|
|
|
openForm('update', row) |
|
|
|
} else if (val == 'delete') { // 删除 |
|
|
@ -260,6 +268,85 @@ |
|
|
|
await getList() |
|
|
|
} catch { } |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** 关闭按钮操作 */ |
|
|
|
const handleClo = async (id : number) => { |
|
|
|
try { |
|
|
|
// 关闭的二次确认 |
|
|
|
await message.confirm('是否关闭所选中数据?') |
|
|
|
// 发起关闭 |
|
|
|
await PurchaseclaimRequestMainApi.cloPurchaseclaimRequestMain(id) |
|
|
|
message.success(t('关闭成功!')) |
|
|
|
// 刷新列表 |
|
|
|
await getList() |
|
|
|
} catch { } |
|
|
|
} |
|
|
|
|
|
|
|
/** 打开按钮操作 */ |
|
|
|
const handleOpe = async (id : number) => { |
|
|
|
try { |
|
|
|
// 打开的二次确认 |
|
|
|
await message.confirm('是否打开所选中数据?') |
|
|
|
// 发起打开 |
|
|
|
await PurchaseclaimRequestMainApi.opePurchaseclaimRequestMain(id) |
|
|
|
message.success(t('打开成功!')) |
|
|
|
// 刷新列表 |
|
|
|
await getList() |
|
|
|
} catch { } |
|
|
|
} |
|
|
|
|
|
|
|
/** 提交审批按钮操作 */ |
|
|
|
const handleSub = async (id : number) => { |
|
|
|
try { |
|
|
|
// 提交审批的二次确认 |
|
|
|
await message.confirm('是否提交审批所选中数据?') |
|
|
|
// 发起提交审批 |
|
|
|
await PurchaseclaimRequestMainApi.subPurchaseclaimRequestMain(id) |
|
|
|
message.success(t('提交审批成功!')) |
|
|
|
// 刷新列表 |
|
|
|
await getList() |
|
|
|
} catch { } |
|
|
|
} |
|
|
|
|
|
|
|
/** 审批通过按钮操作 */ |
|
|
|
const handleApp = async (id : number) => { |
|
|
|
try { |
|
|
|
// 审批通过的二次确认 |
|
|
|
await message.confirm('是否审批通过所选中数据?') |
|
|
|
// 发起审批通过 |
|
|
|
await PurchaseclaimRequestMainApi.appPurchaseclaimRequestMain(id) |
|
|
|
message.success(t('审批通过成功!')) |
|
|
|
// 刷新列表 |
|
|
|
await getList() |
|
|
|
} catch { } |
|
|
|
} |
|
|
|
|
|
|
|
/** 驳回按钮操作 */ |
|
|
|
const handleTur = async (id : number) => { |
|
|
|
try { |
|
|
|
// 驳回的二次确认 |
|
|
|
await message.confirm('是否驳回所选中数据?') |
|
|
|
// 发起驳回 |
|
|
|
await PurchaseclaimRequestMainApi.rejPurchaseclaimRequestMain(id) |
|
|
|
message.success(t('驳回成功!')) |
|
|
|
// 刷新列表 |
|
|
|
await getList() |
|
|
|
} catch { } |
|
|
|
} |
|
|
|
|
|
|
|
/** 处理按钮操作 */ |
|
|
|
const genRecords = async (id : number) => { |
|
|
|
try { |
|
|
|
// 处理的二次确认 |
|
|
|
await message.confirm('是否处理所选中数据?') |
|
|
|
// 发起处理 |
|
|
|
await PurchaseclaimRequestMainApi.genRecordsPurchaseclaimRequestMain(id) |
|
|
|
message.success(t('处理成功!')) |
|
|
|
// 刷新列表 |
|
|
|
await getList() |
|
|
|
} catch { } |
|
|
|
} |
|
|
|
|
|
|
|
/** 导出按钮操作 */ |
|
|
|
const handleExport = async () => { |
|
|
|