陈薪名 1 year ago
parent
commit
f6e225123f
  1. 35
      src/api/wms/deliverPlanMain/index.ts
  2. 4
      src/views/system/serialNumber/SerialNumberForm.vue
  3. 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 = () => { export const importTemplate = () => {
return request.download({ url: '/wms/deliver-plan-main/get-import-template' }) 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 })
} }

4
src/views/system/serialNumber/SerialNumberForm.vue

@ -4,7 +4,7 @@
ref="formRef" ref="formRef"
:model="formData" :model="formData"
:rules="formRules" :rules="formRules"
label-width="100px" label-width="150px"
v-loading="formLoading" v-loading="formLoading"
> >
<el-form-item label="规则编码" prop="ruleCode"> <el-form-item label="规则编码" prop="ruleCode">
@ -59,9 +59,7 @@ const formRules = reactive({
ruleCode: [{ required: true, message: '规则编码不能为空', trigger: 'blur' }], ruleCode: [{ required: true, message: '规则编码不能为空', trigger: 'blur' }],
ruleName: [{ required: true, message: '规则名称不能为空', trigger: 'blur' }], ruleName: [{ required: true, message: '规则名称不能为空', trigger: 'blur' }],
prefix: [{ required: true, message: '编码前缀不能为空', trigger: 'blur' }], prefix: [{ required: true, message: '编码前缀不能为空', trigger: 'blur' }],
pattern: [{ required: true, message: '单据格式不能为空', trigger: 'blur' }],
length: [{ required: true, message: '单据流水长度不能为空', trigger: 'blur' }], length: [{ required: true, message: '单据流水长度不能为空', trigger: 'blur' }],
separator: [{ required: true, message: '单据分隔符不能为空', trigger: 'blur' }]
}) })
const formRef = ref() // Ref const formRef = ref() // Ref

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

@ -33,7 +33,7 @@
</el-button> </el-button>
</template> </template>
<template #action="{ row }"> <template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" /> <ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event,row)" />
</template> </template>
</Table> </Table>
</ContentWrap> </ContentWrap>
@ -41,7 +41,6 @@
<!-- 表单弹窗添加/修改 --> <!-- 表单弹窗添加/修改 -->
<BasicForm <BasicForm
ref="formRef" ref="formRef"
@success="getList"
:rules="DeliverPlanMainRules" :rules="DeliverPlanMainRules"
:formAllSchemas="DeliverPlanMain.allSchemas" :formAllSchemas="DeliverPlanMain.allSchemas"
:tableAllSchemas="DeliverPlanDetail.allSchemas" :tableAllSchemas="DeliverPlanDetail.allSchemas"
@ -177,29 +176,74 @@ const isShowMainButton = (row,val) => {
// - // -
const butttondata = (row) => { const butttondata = (row) => {
return [ return [
defaultButtons.mainListPlanOpeBtn({hide:isShowMainButton(row,['5','4'])}), // defaultButtons.mainListPlanOpeBtn({hide:isShowMainButton(row,['5'])}), //
defaultButtons.mainListPlanCloBtn({hide:isShowMainButton(row,['1','2','3','4','6'])}), // defaultButtons.mainListPlanCloBtn({hide:isShowMainButton(row,['1','2','3','4'])}), //
defaultButtons.mainListPlanSubBtn({hide:isShowMainButton(row,['1'])}), // defaultButtons.mainListPlanSubBtn({hide:isShowMainButton(row,['1'])}), //
defaultButtons.mainListPlanTurBtn({hide:isShowMainButton(row,['2'])}), // defaultButtons.mainListPlanTurBtn({hide:isShowMainButton(row,['2'])}), //
defaultButtons.mainListPlanAppBtn({hide:isShowMainButton(row,['2'])}), // defaultButtons.mainListPlanAppBtn({hide:isShowMainButton(row,['2'])}), //
defaultButtons.mainListPlanPubBtn({hide:isShowMainButton(row,['3'])}), // defaultButtons.mainListPlanPubBtn({hide:isShowMainButton(row,['3'])}), //
defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:production-main:update'}), // defaultButtons.mainListPlanResBtn({hide:isShowMainButton(row,['4'])}), //
defaultButtons.mainListDeleteBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:production-main:delete'}), // defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:deliver-plan-main:update'}), //
] ]
} }
// - // -
const buttonTableClick = async (val, row) => { const buttonTableClick = async (val, row) => {
if (val == 'mainPlanOpe') { // 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') { // } 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') { // } 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') { // } 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') { // } 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') { // } else if (val == 'edit') { //
openForm('update', row) openForm('update', row)
} else if (val == 'delete') { // } else if (val == 'delete') { //
@ -270,6 +314,19 @@ const handleDeleteTable = (item, index) => {
// //
const submitForm = async (formType, data) => { const submitForm = async (formType, data) => {
data.subList = tableData.value // 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 { try {
if (formType === 'create') { if (formType === 'create') {
await DeliverPlanMainApi.createDeliverPlanMain(data) await DeliverPlanMainApi.createDeliverPlanMain(data)

Loading…
Cancel
Save