Commit cb166a40 authored by rainbowmorel@163.com's avatar rainbowmorel@163.com

送货通知列表 生成送货单功能

parent 236f0dc5
......@@ -11,7 +11,10 @@ import {
getOrderDeliveryNoticeOrderCreateDeliveryOrder
} from '@/services/OrderNewV2Api';
import moment from "moment";
import { } from '../../constants'
import { isNull } from "lodash";
import { RoleTypeEnum } from "../../constants/RoleTypeEnum";
......@@ -252,8 +255,8 @@ export class DeliveryNoticeOrderAddService extends DeliveryNoteAddService {
getDetailById(id: string): any {
return getOrderDeliveryNoticeOrderCreateDeliveryOrder({ id }).then(res => {
const data = res.data
if(isNull(data)) return false;
if (isNull(data)) return false;
let formField = {
digest: data.digest,
......@@ -281,4 +284,19 @@ export class DeliveryNoticeOrderAddService extends DeliveryNoteAddService {
})
}
#formService = null;
setFormService(type: string | number) {
if (type === RoleTypeEnum.SRM) {
this.#formService = new DeliveryNoteAddService(this.getForm())
}
if (type === RoleTypeEnum.B2B) {
this.#formService = new ReceivingNoteB2BAddService(this.getForm())
}
}
getForomService(): HandleFormSubmit {
return this.#formService;
}
}
\ No newline at end of file
export enum RoleTypeEnum {
SRM = 2,
B2B = 1
}
\ No newline at end of file
......@@ -43,12 +43,14 @@ function DeliveryNoticeFromCreate() {
service.getDetailById(id).then(res => {
if (!res) {
message.error("数据存在错误,请练习服务端同事!")
message.error("数据存在错误,请联系服务端同事!")
history.back()
return;
}
const type = res.type;
service.setFormService(type);
form.setFieldsValue(res)
setTableDataSource(res.products)
})
......@@ -57,7 +59,7 @@ function DeliveryNoticeFromCreate() {
const handleSubmit = useCallback(() => {
service.setTableData(tableDataSource);
service.submit().then(res => {
service.getForomService().submit().then(res => {
if (res.code === 1000) {
history.go(-1)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment