Browse Source

发货计划按钮及时间展示格式

master
chenfang 1 year ago
parent
commit
22556f404c
  1. 35
      src/api/wms/deliverPlanMain/index.ts
  2. 79
      src/views/wms/deliversettlementManage/deliverplan/deliverPlanMain/index.vue

35
src/api/wms/deliverPlanMain/index.ts

@ -55,4 +55,39 @@ export const exportDeliverPlanMain = async (params) => {
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/deliver-plan-main/get-import-template' })
}
// 关闭
export const close = (id) => {
return request.put({ url: '/wms/deliver-plan-main/close?id=' + id })
}
// 提交审批
export const submit = (id) => {
return request.put({ url: '/wms/deliver-plan-main/submit?id=' + id })
}
// 打开
export const open = (id) => {
return request.put({ url: '/wms/deliver-plan-main/open?id=' + id })
}
// 驳回
export const refies = (id) => {
return request.put({ url: '/wms/deliver-plan-main/refies?id=' + id })
}
// 通过
export const agree = (id) => {
return request.put({ url: '/wms/deliver-plan-main/agree?id=' + id })
}
// 发布
export const publish = (id) => {
return request.put({ url: '/wms/deliver-plan-main/publish?id=' + id })
}
// 重置
export const resetting = (id) => {
return request.put({ url: '/wms/deliver-plan-main/resetting?id=' + id })
}

79
src/views/wms/deliversettlementManage/deliverplan/deliverPlanMain/index.vue

@ -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>
@ -41,7 +41,6 @@
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="formRef"
@success="getList"
:rules="DeliverPlanMainRules"
:formAllSchemas="DeliverPlanMain.allSchemas"
:tableAllSchemas="DeliverPlanDetail.allSchemas"
@ -177,29 +176,74 @@ 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.mainListEditBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:production-main:update'}), //
defaultButtons.mainListDeleteBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:production-main:delete'}), //
defaultButtons.mainListPlanResBtn({hide:isShowMainButton(row,['4'])}), //
defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:deliver-plan-main:update'}), //
]
}
// -
const buttonTableClick = async (val, row) => {
if (val == 'mainPlanOpe') { //
console.log('列表-操作按钮事件-打开')
DeliverPlanMainApi.open(row.id).then(() => {
message.success(t('common.updateSuccess'))
getList()
}).catch(err => {
console.log(err)
})
} else if (val == 'mainPlanClo') { //
console.log('列表-操作按钮事件-关闭')
await message.confirm('确认要关闭吗?')
DeliverPlanMainApi.close(row.id).then(() => {
message.success(t('common.updateSuccess'))
getList()
}).catch(err => {
console.log(err)
})
} else if (val == 'mainPlanSub') { //
console.log('列表-操作按钮事件-提交审批')
await message.confirm('确认要提交审批吗?')
DeliverPlanMainApi.submit(row.id).then(() => {
message.success(t('common.updateSuccess'))
getList()
}).catch(err => {
console.log(err)
})
} else if (val == 'mainPlanTur') { //
console.log('列表-操作按钮事件-驳回')
await message.confirm('确认要驳回吗?')
DeliverPlanMainApi.refies(row.id).then(() => {
message.success(t('common.updateSuccess'))
getList()
}).catch(err => {
console.log(err)
})
} else if (val == 'mainPlanApp') { //
console.log('列表-操作按钮事件-审批通过')
await message.confirm('确认要审批通过吗?')
DeliverPlanMainApi.agree(row.id).then(() => {
message.success(t('common.updateSuccess'))
getList()
}).catch(err => {
console.log(err)
})
} else if (val == 'mainPlanPub') { //
await message.confirm('确认要发布吗?')
DeliverPlanMainApi.publish(row.id).then(() => {
message.success(t('common.updateSuccess'))
getList()
}).catch(err => {
console.log(err)
})
} else if (val == 'mainPlanRes') { //
await message.confirm('确认要重置吗?')
DeliverPlanMainApi.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') { //
@ -270,6 +314,19 @@ const handleDeleteTable = (item, index) => {
//
const submitForm = async (formType, data) => {
data.subList = tableData.value //
var isHave =DeliverPlanMain.allSchemas.formSchema.some(function (item) {
return item.field === 'beginTime' || item.field === 'endTime';
});
if(isHave){
if(data.beginTime && data.endTime && data.beginTime >=data.expireTime){
message.error('结束时间要大于开始时间')
return;
}
}
console.log(data.beginTime)
if(!data.beginTime)data.beginTime = null;
if(!data.planDate)data.planDate = null;
if(!data.endTime)data.endTime = null;
try {
if (formType === 'create') {
await DeliverPlanMainApi.createDeliverPlanMain(data)

Loading…
Cancel
Save