This commit is contained in:
wangshiming
2022-02-28 12:02:58 +08:00
parent eaaa448e3f
commit 5b30dc34bb
2 changed files with 336 additions and 238 deletions

View File

@ -4,7 +4,7 @@
* @Author : Shiming * @Author : Shiming
* @Date : 2021-12-24 16:58:02 * @Date : 2021-12-24 16:58:02
* @LastEditors : Shiming * @LastEditors : Shiming
* @LastEditTime : 2022-02-28 11:58:21 * @LastEditTime : 2022-02-28 12:01:57
* @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\components\\bulk-detail-change\\bulk-detail-change.component.ts * @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\components\\bulk-detail-change\\bulk-detail-change.component.ts
* Copyright (C) 2022 huzhenhong. All rights reserved. * Copyright (C) 2022 huzhenhong. All rights reserved.
*/ */
@ -555,88 +555,170 @@ loadTime: any; // 货源单设置回显
}); });
} }
initSF3() { initSF3() {
this.schema3 = { this.schema3 = {
properties: { properties: {
goodsTypeId: { goodsTypeId: {
type: 'string', type: 'string',
title: '货物名称', title: '货物名称',
ui: { ui: {
widget: 'select', widget: 'select',
placeholder: '请选择', placeholder: '请选择',
errors: { required: '请选择货物类型' }, errors: { required: '请选择货物类型' },
asyncData: () => asyncData: () =>
this.shipperservice.loadConfigByKey('goods.name.config.type').pipe( this.service.loadConfigByKey('goods.name.config.type').pipe(
map((data: any) => { map((data: any) => {
return data[0].children?.map((m: any) => { return data[0].children?.map((m: any) => {
return { label: m.name, value: m.id }; return { label: m.name, value: m.id };
}); });
}) })
), ),
change: (value: any, data: any) => { change: (value, data: any) => {
this.changeGoodsType(value, data); this.changeGoodsType(value, data);
this.sf3.setValue('/goodsTypeName', data.label); this.sf3.setValue('/goodsTypeName', data.label);
}
} as SFSelectWidgetSchema
},
goodsTypeName: {
type: 'string',
title: '',
ui: {
hidden: true
} }
} as SFSelectWidgetSchema },
}, goodsNameId: {
goodsTypeName: { type: 'string',
type: 'string', title: '',
title: '', ui: {
ui: { widget: 'select',
hidden: true placeholder: '请选择',
} errors: { required: '请填写货物名称' },
}, change: (_value: any, data: any) => {
goodsNameId: { this.sf3.setValue('/goodsName', data.label);
type: 'string', },
title: '', visibleIf: {
ui: { goodsTypeName: (value: any) => value && value !== '其它'
widget: 'select', }
placeholder: '请选择', }
errors: { required: '请填写货物名称' }, },
change: (_value: any, data: any) => { goodsName: {
this.sf3.setValue('/goodsName', data.label); type: 'string',
}, title: '',
visibleIf: { ui: {
goodsTypeName: (value: any) => value && value !== '其它' hidden: true,
visibleIf: {
goodsTypeName: (value: any) => value && value !== '其它'
}
}
},
goodsName1: {
type: 'string',
title: '',
ui: {
errors: { required: '请填写货物名称' },
visibleIf: {
goodsTypeName: (value: any) => value && value === '其它'
}
} }
} }
}, },
goodsName: { required: ['goodsTypeId', 'goodsName', 'goodsNameId']
type: 'string', };
title: '', this.ui3 = {
ui: { '*': {
hidden: true, spanLabelFixed: 90,
visibleIf: { grid: { span: 12 }
goodsTypeName: (value: any) => value && value !== '其它'
}
}
},
goodsName1: {
type: 'string',
title: '',
ui: {
errors: { required: '请填写货物名称' },
visibleIf: {
goodsTypeName: (value: any) => value && value === '其它'
}
}
} }
}, };
required: ['goodsTypeId', 'goodsName', 'goodsNameId'] }
}; initSF4() {
this.ui3 = { this.schema4 = {
'*': { properties: {
spanLabelFixed: 110, weight: {
grid: { span: 12 } type: 'string',
}, title: '货物数量',
$goodsName: { ui: {
grid: { span: 12 } widget: 'custom',
}, placeholder: '请输入',
$qita: { errors: { required: '必填项' }
grid: { span: 12 } }
} },
}; volume: {
} type: 'string',
title: '',
ui: {
widget: 'custom',
placeholder: '请输入'
}
},
number: {
type: 'string',
title: '',
ui: {
widget: 'custom',
placeholder: '请输入'
}
},
carModel: {
type: 'string',
title: '车型/车长',
ui: {
widget: 'select',
mode: 'multiple',
maxMultipleCount:3,
placeholder: '请选择车型',
errors: { required: '请选择车型' },
asyncData: () => this.service.getDictOptions({ dictKey: 'car:model' }),
change:(tag:any , org:any)=>{
if(tag.includes("999")){
this.sf4.setValue('/carModel',["999"]);
}
}
}
},
carLength: {
type: 'string',
title: '',
ui: {
widget: 'select',
mode: 'multiple',
maxMultipleCount:3,
placeholder: '请选择车长',
errors: { required: '请选择车长' },
asyncData: () => this.service.getDictOptions({ dictKey: 'car:length' }),
change:(tag:any , org:any)=>{
if(tag.includes("999")){
this.sf4.setValue('/carModel',["999"]);
}
}
}
},
},
required: ['weight', 'carModel', 'carLength']
};
this.ui4 = {
'*': {
spanLabelFixed: 90,
grid: { span: 24 }
},
$weight: {
grid: { lg: 8, md: 12, sm: 12, xs: 24 }
},
$volume: {
grid: { lg: 8, md: 12, sm: 12, xs: 24 }
},
$number: {
grid: { lg: 8, md: 12, sm: 12, xs: 24 }
},
$carModel: {
spanLabelFixed: 100,
grid: { span: 8 }
},
$carLength: {
grid: { span: 8 }
}
};
}
changeGoodsType(value: string, data: any) { changeGoodsType(value: string, data: any) {
if (data.label === '其它') return; if (data.label === '其它') return;
const params = { const params = {
@ -663,165 +745,165 @@ changeGoodsType(value: string, data: any) {
} }
}); });
} }
initSF4() { // initSF4() {
this.schema4 = { // this.schema4 = {
properties: { // properties: {
weight: { // weight: {
type: 'string', // type: 'string',
title: '货物数量', // title: '货物数量',
ui: { // ui: {
widget: 'custom', // widget: 'custom',
placeholder: '请输入', // placeholder: '请输入',
errors: { required: '必填项' } // errors: { required: '必填项' }
} // }
}, // },
volume: { // volume: {
type: 'string', // type: 'string',
title: '', // title: '',
ui: { // ui: {
widget: 'custom', // widget: 'custom',
placeholder: '请输入' // placeholder: '请输入'
} // }
}, // },
number: { // number: {
type: 'string', // type: 'string',
title: '', // title: '',
ui: { // ui: {
widget: 'custom', // widget: 'custom',
placeholder: '请输入' // placeholder: '请输入'
} // }
}, // },
carmand: { // carmand: {
type: 'string', // type: 'string',
title: '用车需求', // title: '用车需求',
ui: { // ui: {
widget: 'custom', // widget: 'custom',
placeholder: '请输入' // placeholder: '请输入'
} // }
}, // },
drivers: { // drivers: {
type: 'string', // type: 'string',
title: '承运司机', // title: '承运司机',
ui: { // ui: {
widget: 'custom', // widget: 'custom',
placeholder: '请输入' // placeholder: '请输入'
} // }
}, // },
weightModel: { // weightModel: {
type: 'string', // type: 'string',
title: '车型车长承重', // title: '车型车长承重',
ui: { // ui: {
widget: 'custom', // widget: 'custom',
placeholder: '请输入' // placeholder: '请输入'
} // }
}, // },
loadTime: { // loadTime: {
type: 'string', // type: 'string',
title: '发车时间', // title: '发车时间',
ui: { // ui: {
widget: 'custom', // widget: 'custom',
placeholder: '请输入' // placeholder: '请输入'
} // }
}, // },
unloadTime: { // unloadTime: {
type: 'string', // type: 'string',
title: '到车时间', // title: '到车时间',
ui: { // ui: {
widget: 'custom', // widget: 'custom',
placeholder: '请输入' // placeholder: '请输入'
} // }
}, // },
acceptWeight: { // acceptWeight: {
type: 'number', // type: 'number',
title: '装货重量', // title: '装货重量',
minimum:0, // minimum:0,
maximum:99999, // maximum:99999,
ui: { // ui: {
unit: '吨', // unit: '吨',
placeholder: '请输入', // placeholder: '请输入',
grid: { // grid: {
span: 12 // span: 12
}, // },
hideStep: true, // hideStep: true,
} as SFNumberWidgetSchema // } as SFNumberWidgetSchema
}, // },
acceptVolume: { // acceptVolume: {
type: 'number', // type: 'number',
title: '装货体积', // title: '装货体积',
minimum:0, // minimum:0,
maximum:99999, // maximum:99999,
ui: { // ui: {
unit: '吨', // unit: '吨',
placeholder: '请输入', // placeholder: '请输入',
grid: { // grid: {
span: 12 // span: 12
}, // },
hideStep: true, // hideStep: true,
} as SFNumberWidgetSchema // } as SFNumberWidgetSchema
}, // },
settlementWeight: { // settlementWeight: {
type: 'number', // type: 'number',
title: '卸货重量', // title: '卸货重量',
minimum:0, // minimum:0,
maximum:99999, // maximum:99999,
ui: { // ui: {
unit: '吨', // unit: '吨',
placeholder: '请输入', // placeholder: '请输入',
grid: { // grid: {
span: 12 // span: 12
}, // },
hideStep: true, // hideStep: true,
} as SFNumberWidgetSchema // } as SFNumberWidgetSchema
}, // },
settlementVolume: { // settlementVolume: {
type: 'number', // type: 'number',
title: '卸货体积', // title: '卸货体积',
minimum:0, // minimum:0,
maximum:99999, // maximum:99999,
ui: { // ui: {
unit: '吨', // unit: '吨',
placeholder: '请输入', // placeholder: '请输入',
grid: { // grid: {
span: 12 // span: 12
}, // },
hideStep: true, // hideStep: true,
} as SFNumberWidgetSchema // } as SFNumberWidgetSchema
} // }
}, // },
required: ['weight','loadTime','unloadTime'] // required: ['weight','loadTime','unloadTime']
}; // };
this.ui4 = { // this.ui4 = {
'*': { // '*': {
spanLabelFixed: 90, // spanLabelFixed: 90,
grid: { span: 24 } // grid: { span: 24 }
}, // },
$weight: { // $weight: {
grid: { span: 8 } // grid: { span: 8 }
}, // },
$volume: { // $volume: {
grid: { span: 8 } // grid: { span: 8 }
}, // },
$number: { // $number: {
grid: { span: 8 } // grid: { span: 8 }
}, // },
$carmand: { // $carmand: {
grid: { span: 24 } // grid: { span: 24 }
}, // },
$weightModel: { // $weightModel: {
spanLabelFixed: 120, // spanLabelFixed: 120,
grid: { span: 12 } // grid: { span: 12 }
}, // },
$drivers: { // $drivers: {
grid: { span: 12 } // grid: { span: 12 }
}, // },
$loadTime: { // $loadTime: {
grid: { span: 12 } // grid: { span: 12 }
}, // },
$unloadTime: { // $unloadTime: {
grid: { span: 12 } // grid: { span: 12 }
}, // },
}; // };
} // }
// 处理上传图片 // 处理上传图片
handlePreview1 = async (file: NzUploadFile) => { handlePreview1 = async (file: NzUploadFile) => {
if (!file.url && !file.preview) { if (!file.url && !file.preview) {

View File

@ -4,7 +4,7 @@
* @Author : Shiming * @Author : Shiming
* @Date : 2021-12-03 15:31:52 * @Date : 2021-12-03 15:31:52
* @LastEditors : Shiming * @LastEditors : Shiming
* @LastEditTime : 2022-02-24 20:20:23 * @LastEditTime : 2022-02-28 12:01:42
* @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\services\\order-management.service.ts * @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\services\\order-management.service.ts
* Copyright (C) 2022 huzhenhong. All rights reserved. * Copyright (C) 2022 huzhenhong. All rights reserved.
*/ */
@ -190,6 +190,22 @@ export class OrderManagementService extends ShipperBaseService {
}) })
); );
} }
/**
* 获取车型、车长字典数据
* @returns
*/
getDictOptions(params = {}) {
return this.request(this.$api_getDictValue, params).pipe(
map((res: any) => {
if (!res) {
return [];
}
const obj = [];
obj.push({ label: '不限', value: '999' });
return [...obj, ...res];
})
);
}
constructor(public injector: Injector, public eaCacheSrv: EACacheService) { constructor(public injector: Injector, public eaCacheSrv: EACacheService) {
super(injector, eaCacheSrv); super(injector, eaCacheSrv);
} }