diff --git a/src/api/wms/deliverPlanMain/index.ts b/src/api/wms/deliverPlanMain/index.ts index 2bf9d0e23..04021ab44 100644 --- a/src/api/wms/deliverPlanMain/index.ts +++ b/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 }) } \ No newline at end of file diff --git a/src/views/system/serialNumber/SerialNumberForm.vue b/src/views/system/serialNumber/SerialNumberForm.vue index 6cc35bad1..316c3acd0 100644 --- a/src/views/system/serialNumber/SerialNumberForm.vue +++ b/src/views/system/serialNumber/SerialNumberForm.vue @@ -4,7 +4,7 @@ ref="formRef" :model="formData" :rules="formRules" - label-width="100px" + label-width="150px" v-loading="formLoading" > @@ -59,9 +59,7 @@ const formRules = reactive({ ruleCode: [{ required: true, message: '规则编码不能为空', trigger: 'blur' }], ruleName: [{ required: true, message: '规则名称不能为空', trigger: 'blur' }], prefix: [{ required: true, message: '编码前缀不能为空', trigger: 'blur' }], - pattern: [{ required: true, message: '单据格式不能为空', trigger: 'blur' }], length: [{ required: true, message: '单据流水长度不能为空', trigger: 'blur' }], - separator: [{ required: true, message: '单据分隔符不能为空', trigger: 'blur' }] }) const formRef = ref() // 表单 Ref diff --git a/src/views/wms/deliversettlementManage/deliverplan/deliverPlanMain/index.vue b/src/views/wms/deliversettlementManage/deliverplan/deliverPlanMain/index.vue index f41654672..436d8db66 100644 --- a/src/views/wms/deliversettlementManage/deliverplan/deliverPlanMain/index.vue +++ b/src/views/wms/deliversettlementManage/deliverplan/deliverPlanMain/index.vue @@ -33,7 +33,7 @@ @@ -41,7 +41,6 @@ { // 列表-操作按钮 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)