车辆对接
This commit is contained in:
@ -1,15 +1,15 @@
|
||||
<!--
|
||||
* @Author: your name
|
||||
* @Date: 2021-12-14 20:08:17
|
||||
* @LastEditTime: 2021-12-14 20:09:50
|
||||
* @LastEditors: your name
|
||||
* @LastEditTime: 2022-01-05 17:38:44
|
||||
* @LastEditors: Please set LastEditors
|
||||
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
||||
* @FilePath: \tms-obc-web\src\app\routes\supply-management\components\onecar-publish\address-list\address-list.component.html
|
||||
-->
|
||||
<st
|
||||
#st
|
||||
[bordered]="true"
|
||||
[data]="service.$api_getList"
|
||||
[data]="service.$api_commonAddress"
|
||||
[columns]="columns"
|
||||
[req]="{ method: 'POST', allInBody: true, reName: { pi: 'pageIndex', ps: 'pageSize' }, params: reqParams, process: reqProcess }"
|
||||
[res]="{ reName: { list: 'data.records', total: 'data.total' } }"
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
/*
|
||||
* @Author: your name
|
||||
* @Date: 2021-12-14 20:08:17
|
||||
* @LastEditTime: 2021-12-20 09:35:13
|
||||
* @LastEditors: Please set LastEditors
|
||||
* @LastEditTime: 2022-01-05 17:35:37
|
||||
* @LastEditors: your name
|
||||
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
||||
* @FilePath: \tms-obc-web\src\app\routes\supply-management\components\onecar-publish\address-list\address-list.component.ts
|
||||
*/
|
||||
@ -12,9 +12,7 @@ import { STChange, STColumn, STComponent, STRequestOptions } from '@delon/abc/st
|
||||
import { processSingleSort } from '@shared';
|
||||
import { NzDrawerService } from 'ng-zorro-antd/drawer';
|
||||
import { NzModalService } from 'ng-zorro-antd/modal';
|
||||
import { OrderManagementService } from 'src/app/routes/order-management/services/order-management.service';
|
||||
|
||||
|
||||
import { SupplyManagementService } from '../../../services/supply-management.service';
|
||||
@Component({
|
||||
selector: 'app-publish-address-list',
|
||||
templateUrl: './address-list.component.html'
|
||||
@ -32,7 +30,7 @@ export class PublishAddressListComponent implements OnInit {
|
||||
public router: Router,
|
||||
public ar: ActivatedRoute,
|
||||
private drawerService: NzDrawerService,
|
||||
public service: OrderManagementService,
|
||||
public service: SupplyManagementService,
|
||||
private modalService: NzModalService
|
||||
) {}
|
||||
|
||||
|
||||
@ -209,14 +209,9 @@
|
||||
<div nz-row>
|
||||
<div nz-col nzSpan="12">
|
||||
<sf #sf6 [schema]="schema6" [formData]="sf6data" [button]="'none'" [ui]="ui6">
|
||||
<ng-template sf-template="receiptUserId" let-i let-ui="ui">
|
||||
<input
|
||||
nz-input
|
||||
[ngModel]="i.value"
|
||||
(ngModelChange)="i.setValue($event)"
|
||||
placeholder="请点击选择收回单地址"
|
||||
(click)="backBillChange()"
|
||||
/>
|
||||
<ng-template sf-template="receiptAddressId" let-i let-ui="ui">
|
||||
<input nz-input [ngModel]="i.value" (ngModelChange)="i.setValue($event)" placeholder="请点击选择收回单地址"
|
||||
(click)="backBillChange()" />
|
||||
</ng-template>
|
||||
</sf>
|
||||
</div>
|
||||
@ -249,7 +244,9 @@
|
||||
</nz-card>
|
||||
<nz-card>
|
||||
<div class="align-center">
|
||||
<button nz-button nzType="primary" (click)="chooseFamifiar()">取消</button>
|
||||
<button nz-button nzType="primary" style="margin-left: 48px" (click)="submit()">提交修改</button>
|
||||
<button nz-button nzType="primary" *ngIf="this.PageStatus == '整车修改'" (click)="choose()">取消</button>
|
||||
<button *ngIf="this.PageStatus == '整车修改'" nz-button nzType="primary" style="margin-left: 48px" (click)="submit()">提交修改</button>
|
||||
<button nz-button nzType="primary" *ngIf="this.PageStatus == '整车下一单'" (click)="chooseFamifiar()">指派熟车</button>
|
||||
<button *ngIf="this.PageStatus == '整车下一单'" nz-button nzType="primary" style="margin-left: 48px" (click)="submit()">司机抢单</button>
|
||||
</div>
|
||||
</nz-card>
|
||||
|
||||
@ -169,23 +169,12 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
dispatchId: {
|
||||
type: 'string',
|
||||
title: '调度员',
|
||||
enum: [
|
||||
{ label: '调度员1', value: '1' },
|
||||
{ label: '调度员2', value: '2' }
|
||||
],
|
||||
ui: {
|
||||
widget: 'select',
|
||||
placeholder: '请选择',
|
||||
allowClear: true
|
||||
// asyncData: () =>
|
||||
// this.service.loadChildData2('0', '2').pipe(
|
||||
// map((data: any) => {
|
||||
// return data.map((m: any) => {
|
||||
// return { label: m.name, value: m.id };
|
||||
// });
|
||||
// }),
|
||||
// ),
|
||||
// change: (i) => this.updateCategory(i, '/categoryId2'),
|
||||
allowClear: true,
|
||||
optionalHelp: '选择调度员,司机直接联系调度员 ; 不选择,司机直接联系您',
|
||||
asyncData: () => this.shipperSrv.getStaffList2()
|
||||
} as SFSelectWidgetSchema
|
||||
}
|
||||
}
|
||||
@ -221,37 +210,76 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
initSF3() {
|
||||
this.schema3 = {
|
||||
properties: {
|
||||
goodsName: {
|
||||
goodsTypeId: {
|
||||
type: 'string',
|
||||
title: '货物名称',
|
||||
ui: {
|
||||
// widget: 'dict-select',
|
||||
// params: { dictKey: 'GoodsName' },
|
||||
placeholder: '请选择'
|
||||
}
|
||||
widget: 'select',
|
||||
placeholder: '请选择',
|
||||
errors: { required: '请选择货物类型' },
|
||||
asyncData: () =>
|
||||
this.shipperSrv.loadConfigByKey('goods.name.config.type').pipe(
|
||||
map((data: any) => {
|
||||
return data[0].children?.map((m: any) => {
|
||||
return { label: m.name, value: m.id };
|
||||
});
|
||||
})
|
||||
),
|
||||
change: (value, data: any) => {
|
||||
this.changeGoodsType(value, data);
|
||||
this.sf3.setValue('/goodsTypeName', data.label);
|
||||
}
|
||||
} as SFSelectWidgetSchema
|
||||
},
|
||||
qita: {
|
||||
goodsTypeName: {
|
||||
type: 'string',
|
||||
title: '',
|
||||
ui: {
|
||||
hidden: true
|
||||
}
|
||||
},
|
||||
goodsNameId: {
|
||||
type: 'string',
|
||||
title: '',
|
||||
ui: {
|
||||
widget: 'select',
|
||||
placeholder: '请选择',
|
||||
errors: { required: '请填写货物名称' },
|
||||
change: (value: any, data: any) => {
|
||||
this.sf3.setValue('/goodsName', data.label);
|
||||
},
|
||||
visibleIf: {
|
||||
goodsName: value => value === '3'
|
||||
goodsTypeName: (value: any) => value && value !== '其它'
|
||||
}
|
||||
}
|
||||
},
|
||||
goodsName: {
|
||||
type: 'string',
|
||||
title: '',
|
||||
ui: {
|
||||
hidden: true,
|
||||
visibleIf: {
|
||||
goodsTypeName: (value: any) => value && value !== '其它'
|
||||
}
|
||||
}
|
||||
},
|
||||
goodsName1: {
|
||||
type: 'string',
|
||||
title: '',
|
||||
ui: {
|
||||
errors: { required: '请填写货物名称' },
|
||||
visibleIf: {
|
||||
goodsTypeName: (value: any) => value && value === '其它'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
required: ['goodsName']
|
||||
required: ['goodsTypeId', 'goodsName', 'goodsNameId']
|
||||
};
|
||||
this.ui3 = {
|
||||
'*': {
|
||||
spanLabelFixed: 90,
|
||||
grid: { span: 12 }
|
||||
},
|
||||
$goodsName: {
|
||||
grid: { span: 12 }
|
||||
},
|
||||
$qita: {
|
||||
grid: { span: 12 }
|
||||
}
|
||||
};
|
||||
}
|
||||
@ -374,6 +402,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
initSF6() {
|
||||
this.schema6 = {
|
||||
properties: {
|
||||
@ -396,7 +425,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
ui: {
|
||||
widget: 'dict-select',
|
||||
params: { dictKey: 'receipt:type' },
|
||||
containsAllLable: false,
|
||||
containsAllLabel: false,
|
||||
placeholder: '请选择',
|
||||
errors: { required: '请选择' },
|
||||
visibleIf: {
|
||||
@ -600,6 +629,34 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
this.validateForm1.removeControl(`loadName${index}`);
|
||||
this.validateForm1.removeControl(`loadPhone${index}`);
|
||||
}
|
||||
changeGoodsType(value: string, data: any) {
|
||||
if (data.label === '其它') return;
|
||||
const params = {
|
||||
pageIndex: 1,
|
||||
pageSize: 100,
|
||||
configId: value
|
||||
};
|
||||
this.service
|
||||
.request(this.service.$api_get_config_item_page, params)
|
||||
.pipe(
|
||||
map(data => {
|
||||
return data.records?.map((m: any) => {
|
||||
return { label: m.name, value: m.id };
|
||||
});
|
||||
})
|
||||
)
|
||||
.subscribe(res => {
|
||||
if (res) {
|
||||
this.sf3.getProperty('/goodsNameId')!.schema.enum = res;
|
||||
this.sf3.getProperty('/goodsNameId')!.widget.reset(res);
|
||||
if(this.sf3data.goodsNameId){
|
||||
this.sf3.setValue('/goodsNameId',this.sf3data.goodsNameId);
|
||||
}
|
||||
} else {
|
||||
this.service.msgSrv.error(res.msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
addEndInfo(event: any) {
|
||||
if (this.addEndInfo.length < 5) {
|
||||
@ -689,6 +746,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
// if (this.validateForm1.invalid) {
|
||||
// return;
|
||||
// }
|
||||
console.log(this.sf7.value)
|
||||
const params: any = {
|
||||
...this.sf1.value,
|
||||
...this.sf5.value,
|
||||
@ -888,8 +946,15 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
});
|
||||
|
||||
this.sf3data = {
|
||||
goodsName: res?.goodsInfoVOList[0]?.goodsName
|
||||
goodsTypeId: res?.goodsInfoVOList[0]?.goodsTypeId || '',
|
||||
goodsTypeName: res?.goodsInfoVOList[0]?.goodsTypeName || '',
|
||||
goodsNameId: res?.goodsInfoVOList[0]?.goodsNameId || '',
|
||||
goodsName: res?.goodsInfoVOList[0]?.goodsName || '',
|
||||
};
|
||||
if (this.sf3data.goodsTypeName === '其它') {
|
||||
this.sf3data.goodsName1 = res?.goodsInfoVOList[0]?.goodsName || '';
|
||||
}
|
||||
this.changeGoodsType(this.sf3data.goodsTypeId, { label: this.sf3data.goodsTypeName, value: this.sf3data.goodsTypeId });
|
||||
this.sf4data = {
|
||||
weight: res?.goodsInfoVOList[0]?.weight,
|
||||
volume: res?.goodsInfoVOList[0]?.volume,
|
||||
@ -917,11 +982,21 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
goodsValue: res?.goodsValue
|
||||
};
|
||||
console.log(res?.stateReceipt);
|
||||
// this.sf6data = {
|
||||
// stateReceipt: res?.stateReceipt,
|
||||
// receiptType: res?.receiptType,
|
||||
// receiptUserId: res?.receiptUserId,
|
||||
// remarks: res?.remarks
|
||||
// };
|
||||
this.sf6data = {
|
||||
stateReceipt: res?.stateReceipt,
|
||||
receiptType: res?.receiptType,
|
||||
receiptUserId: res?.receiptUserId,
|
||||
remarks: res?.remarks
|
||||
receiptType: res?.receiptType || '',
|
||||
receiptAddressId: res?.receiptAddressId || '',
|
||||
receiptUserName: res?.receiptUserName || '',
|
||||
area: res?.area || '',
|
||||
phon: res?.phon || '',
|
||||
address: res?.address || '',
|
||||
remarks: res?.remarks || '',
|
||||
};
|
||||
this.sf7data = {
|
||||
prePay: res?.shippingInformationVO?.prePay,
|
||||
@ -944,11 +1019,15 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
nzOnOk: item => {
|
||||
const data = item.seleteData;
|
||||
if (JSON.stringify(data) === '{}') return;
|
||||
this.sf6.setValue('/name4', data.contactName);
|
||||
this.sf6.setValue('/name5', data.contactTelephone);
|
||||
this.sf6.setValue('/name6', `${data.province}-${data.city}-${data.area}`);
|
||||
this.sf6.setValue('/receiptAddress', data.detailedAddress);
|
||||
this.sf6.setValue('/receiptAddressId', data.id);
|
||||
this.sf6.setValue('/receiptUserName', data.contactName);
|
||||
this.sf6.setValue('/phon', data.contactTelephone);
|
||||
this.sf6.setValue('/area', `${data.province}-${data.city}-${data.area}`);
|
||||
this.sf6.setValue('/address', data.detailedAddress);
|
||||
}
|
||||
});
|
||||
}
|
||||
choose(){
|
||||
window.history.go(-1);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user