edit
This commit is contained in:
@ -35,7 +35,7 @@ export class SupplyManagementVehicleComponent implements OnInit {
|
||||
isVisible = false;
|
||||
freightSchema: SFSchema = {};
|
||||
auditMany = false;
|
||||
|
||||
|
||||
resourceStatus: any;
|
||||
auditID: any;
|
||||
constructor(
|
||||
@ -63,10 +63,9 @@ export class SupplyManagementVehicleComponent implements OnInit {
|
||||
};
|
||||
}
|
||||
afterRes = (data: any[], rawData?: any) => {
|
||||
console.log(data)
|
||||
return data.map(item => ({
|
||||
...item,
|
||||
disabled: item.auditStatus !== '1'
|
||||
disabled: item.auditStatus !== '1'
|
||||
}));
|
||||
};
|
||||
get selectedRows() {
|
||||
@ -89,7 +88,7 @@ export class SupplyManagementVehicleComponent implements OnInit {
|
||||
maxLength: 50,
|
||||
ui: {
|
||||
placeholder: '请输入备注',
|
||||
widget: 'textarea',
|
||||
widget: 'textarea'
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -105,7 +104,7 @@ export class SupplyManagementVehicleComponent implements OnInit {
|
||||
|
||||
search() {
|
||||
this.st?.load(1);
|
||||
this.getGoodsSourceStatistical()
|
||||
this.getGoodsSourceStatistical();
|
||||
}
|
||||
/**
|
||||
* 伸缩查询条件
|
||||
@ -198,9 +197,9 @@ export class SupplyManagementVehicleComponent implements OnInit {
|
||||
console.log(value);
|
||||
console.log(status);
|
||||
if (status === 2) {
|
||||
if(this.selectedRows.length <= 0) {
|
||||
if (this.selectedRows.length <= 0) {
|
||||
this.service.msgSrv.error('未选择货源单!');
|
||||
return
|
||||
return;
|
||||
}
|
||||
let list: any[] = [];
|
||||
this.selectedRows.forEach(item => {
|
||||
@ -209,7 +208,7 @@ export class SupplyManagementVehicleComponent implements OnInit {
|
||||
this.auditID = list;
|
||||
this.auditMany = true;
|
||||
} else {
|
||||
this.auditID = value.id
|
||||
this.auditID = value.id;
|
||||
this.auditMany = false;
|
||||
}
|
||||
this.isVisible = true;
|
||||
@ -224,19 +223,19 @@ export class SupplyManagementVehicleComponent implements OnInit {
|
||||
* 审核通过按钮
|
||||
*/
|
||||
handleOK(value: any) {
|
||||
console.log(this.sfFre.valid)
|
||||
console.log(this.sfFre.value)
|
||||
if(this.selectedRows.length <= 0) {
|
||||
console.log(this.sfFre.valid);
|
||||
console.log(this.sfFre.value);
|
||||
if (this.selectedRows.length <= 0) {
|
||||
const params: any = {
|
||||
id: this.auditID,
|
||||
remarks: this.sfFre.value.remarks,
|
||||
}
|
||||
if(value == 1) {
|
||||
params.auditStatus = 2
|
||||
remarks: this.sfFre.value.remarks
|
||||
};
|
||||
if (value == 1) {
|
||||
params.auditStatus = 2;
|
||||
} else {
|
||||
params.auditStatus = 3
|
||||
params.auditStatus = 3;
|
||||
}
|
||||
console.log(params)
|
||||
console.log(params);
|
||||
this.service.request(this.service.$api_goodsResourceAudit, params).subscribe(res => {
|
||||
if (res === true) {
|
||||
this.service.msgSrv.success('审核成功!');
|
||||
@ -244,18 +243,18 @@ export class SupplyManagementVehicleComponent implements OnInit {
|
||||
this.st?.reload();
|
||||
this.getGoodsSourceStatistical();
|
||||
}
|
||||
})
|
||||
});
|
||||
} else {
|
||||
const params: any = {
|
||||
ids: this.auditID,
|
||||
remarks: this.sfFre.value.remarks,
|
||||
}
|
||||
if(value == 1) {
|
||||
params.auditStatus = 2
|
||||
remarks: this.sfFre.value.remarks
|
||||
};
|
||||
if (value == 1) {
|
||||
params.auditStatus = 2;
|
||||
} else {
|
||||
params.auditStatus = 3
|
||||
params.auditStatus = 3;
|
||||
}
|
||||
console.log(params)
|
||||
console.log(params);
|
||||
this.service.request(this.service.$api_batchGoodsResourceAudit, params).subscribe(res => {
|
||||
if (res === true) {
|
||||
this.service.msgSrv.success('审核成功!');
|
||||
@ -263,9 +262,8 @@ export class SupplyManagementVehicleComponent implements OnInit {
|
||||
this.st?.reload();
|
||||
this.getGoodsSourceStatistical();
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
* 跳转修改货源
|
||||
@ -317,7 +315,7 @@ export class SupplyManagementVehicleComponent implements OnInit {
|
||||
stayQuantity: 0
|
||||
};
|
||||
const params: any = Object.assign({}, this.reqParams || {});
|
||||
delete params.resourceStatus
|
||||
delete params.resourceStatus;
|
||||
this.service.request(this.service.$api_get_goods_resource_statistical, { resourceType: 1, ...params }).subscribe(res => {
|
||||
if (res) {
|
||||
console.log(res);
|
||||
@ -396,7 +394,7 @@ export class SupplyManagementVehicleComponent implements OnInit {
|
||||
placeholder: '请选择',
|
||||
visibleIf: {
|
||||
_$expand: (value: boolean) => value
|
||||
},
|
||||
}
|
||||
} as SFSelectWidgetSchema
|
||||
},
|
||||
serviceType: {
|
||||
@ -422,8 +420,7 @@ export class SupplyManagementVehicleComponent implements OnInit {
|
||||
params: { dictKey: 'goodresource:audit:status' },
|
||||
visibleIf: {
|
||||
_$expand: (value: boolean) => value
|
||||
},
|
||||
|
||||
}
|
||||
} as SFSelectWidgetSchema
|
||||
},
|
||||
enterpriseInfoId: {
|
||||
@ -442,33 +439,33 @@ export class SupplyManagementVehicleComponent implements OnInit {
|
||||
}
|
||||
};
|
||||
}
|
||||
// 获取城市列表
|
||||
getRegionCode(regionCode: any) {
|
||||
console.log(regionCode);
|
||||
return this.service
|
||||
.request(this.service.$api_get_enterprise_project, { id: regionCode })
|
||||
.pipe(
|
||||
map(res =>
|
||||
res.map((item: any) => ({
|
||||
label: item.projectName,
|
||||
value: item.id
|
||||
}))
|
||||
// 获取城市列表
|
||||
getRegionCode(regionCode: any) {
|
||||
console.log(regionCode);
|
||||
return this.service
|
||||
.request(this.service.$api_get_enterprise_project, { id: regionCode })
|
||||
.pipe(
|
||||
map(res =>
|
||||
res.map((item: any) => ({
|
||||
label: item.projectName,
|
||||
value: item.id
|
||||
}))
|
||||
)
|
||||
)
|
||||
)
|
||||
.subscribe(res => {
|
||||
this.sf.getProperty('/enterpriseProjectId')!.schema.enum = res;
|
||||
this.sf.getProperty('/enterpriseProjectId')!.widget.reset(res);
|
||||
// if (this.enterpriseProjectIds) {
|
||||
// this.sf1.setValue('/enterpriseProjectId', this.enterpriseProjectIds);
|
||||
// }
|
||||
});
|
||||
}
|
||||
.subscribe(res => {
|
||||
this.sf.getProperty('/enterpriseProjectId')!.schema.enum = res;
|
||||
this.sf.getProperty('/enterpriseProjectId')!.widget.reset(res);
|
||||
// if (this.enterpriseProjectIds) {
|
||||
// this.sf1.setValue('/enterpriseProjectId', this.enterpriseProjectIds);
|
||||
// }
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 初始化数据列表
|
||||
*/
|
||||
private initST(): STColumn[] {
|
||||
return [
|
||||
{ title: '', type: 'checkbox', fixed: 'left', width: '50px', className: 'text-center' },
|
||||
{ title: '', type: 'checkbox', fixed: 'left', width: '50px', className: 'text-center' },
|
||||
{
|
||||
title: '货源编号',
|
||||
width: '180px',
|
||||
@ -476,11 +473,12 @@ export class SupplyManagementVehicleComponent implements OnInit {
|
||||
className: 'text-left',
|
||||
render: 'resourceCode'
|
||||
},
|
||||
{
|
||||
title: '货主',
|
||||
index: 'shipperAppUserName',
|
||||
width: '180px',
|
||||
className: 'text-left' },
|
||||
{
|
||||
title: '货主',
|
||||
index: 'shipperAppUserName',
|
||||
width: '180px',
|
||||
className: 'text-left'
|
||||
},
|
||||
{
|
||||
title: '项目名称',
|
||||
index: 'enterpriseProjectName',
|
||||
@ -542,7 +540,7 @@ export class SupplyManagementVehicleComponent implements OnInit {
|
||||
title: '货源状态',
|
||||
className: 'text-left',
|
||||
index: 'resourceStatusLabel',
|
||||
width: '120px',
|
||||
width: '120px'
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
@ -574,13 +572,13 @@ export class SupplyManagementVehicleComponent implements OnInit {
|
||||
text: '货源审核',
|
||||
click: _record => this.audit(_record, 1),
|
||||
iif: item => item.auditStatus === '1',
|
||||
acl: { ability: ['SUPPLY-INDEX-vehicleBatchAudit'] },
|
||||
acl: { ability: ['SUPPLY-INDEX-vehicleBatchAudit'] }
|
||||
},
|
||||
{
|
||||
text: '修改货源',
|
||||
click: _record => this.amend(_record),
|
||||
iif: item => item.resourceStatus === '1',
|
||||
acl: { ability: ['SUPPLY-INDEX-vehicleModificationSupply'] },
|
||||
acl: { ability: ['SUPPLY-INDEX-vehicleModificationSupply'] }
|
||||
},
|
||||
// {
|
||||
// text: '修改运费',
|
||||
@ -591,18 +589,18 @@ export class SupplyManagementVehicleComponent implements OnInit {
|
||||
text: '取消货源',
|
||||
click: _record => this.cancleGoodsSource(_record),
|
||||
iif: item => item.resourceStatus === '1',
|
||||
acl: { ability: ['SUPPLY-INDEX-vehicleCancelSupply'] },
|
||||
acl: { ability: ['SUPPLY-INDEX-vehicleCancelSupply'] }
|
||||
},
|
||||
{
|
||||
text: '再下一单',
|
||||
click: _record => this.nextOrder(_record),
|
||||
acl: { ability: ['SUPPLY-INDEX-vehiclePlaceOrder'] },
|
||||
acl: { ability: ['SUPPLY-INDEX-vehiclePlaceOrder'] }
|
||||
},
|
||||
{
|
||||
text: '重新指派 ',
|
||||
click: _record => this.assignedCar(_record),
|
||||
iif: item => item.resourceStatus === '1' && item.serviceType === '2',
|
||||
acl: { ability: ['SUPPLY-INDEX-vehicleReassign'] },
|
||||
acl: { ability: ['SUPPLY-INDEX-vehicleReassign'] }
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user