diff --git a/src/app/routes/supply-management/components/onecar-publish/onecar-publish.component.html b/src/app/routes/supply-management/components/onecar-publish/onecar-publish.component.html index 7d1d662e..4ac2fadb 100644 --- a/src/app/routes/supply-management/components/onecar-publish/onecar-publish.component.html +++ b/src/app/routes/supply-management/components/onecar-publish/onecar-publish.component.html @@ -65,7 +65,13 @@
- + - // this.categoryService.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'), - } as SFSelectWidgetSchema + } }, qita: { type: 'string', @@ -492,7 +479,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit { receiptPay: { type: 'number', title: '回单付', default: 0, ui: { prefix: '¥',change: ()=> { this.changeValue();}, } as SFNumberWidgetSchema }, - oilCardPay2: { + subtotal: { type: 'string', title: '小计', ui: { @@ -576,15 +563,29 @@ export class SupplyManagementOnecarPublishComponent implements OnInit { }) } this.startInfo.splice(index, 1); + this.validateForm1.removeControl(`loadAddress${index}`); + this.validateForm1.removeControl(`loadName${index}`); + this.validateForm1.removeControl(`loadPhone${index}`); } addEndInfo(event: any) { - this.endInfo.push({ - detailedAddress: '', - appUserName: '', - contractTelephone: '', - type: 2 - }); + if (this.addEndInfo.length < 5) { + const controlId = this.endInfo.length; + this.endInfo.push({ + detailedAddress: '', + appUserName: '', + contractTelephone: '', + latitude: '', + longitude: '', + province: '', + city: '', + area: '', + type: 2 + }); + this.validateForm1.addControl(`unloadAddress${controlId}`, new FormControl(null, Validators.required)); + this.validateForm1.addControl(`unloadName${controlId}`, new FormControl(null, Validators.required)); + this.validateForm1.addControl(`unloadPhone${controlId}`, new FormControl(null, Validators.required)); + } } subEndInfo(event: any, index: number, id?:any) { if(id) { @@ -594,6 +595,9 @@ export class SupplyManagementOnecarPublishComponent implements OnInit { } console.log(event, index, id) this.endInfo.splice(index, 1); + this.validateForm1.removeControl(`unloadAddress${index}`); + this.validateForm1.removeControl(`unloadName${index}`); + this.validateForm1.removeControl(`unloadPhone${index}`); } //指派熟车 @@ -700,7 +704,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit { asds(i: any) { console.log(i) } - // const data = + // 初始化信息 dataR (res: any) { // this.dataList = res; this.sf1data = { @@ -715,11 +719,17 @@ export class SupplyManagementOnecarPublishComponent implements OnInit { } res?.unLoadingPlaceList.forEach((element: any) => { if(element.type === 1) { + const controlId = this.startInfo.length; if(this.PageStatus === '整车修改' || this.PageStatus === '大宗修改') { this.startInfo.push({ detailedAddress: element.detailedAddress, appUserName: element.appUserName, contractTelephone: element.contractTelephone, + latitude: element.latitude, + longitude: element.longitude, + province: element.province, + city: element.city, + area: element.area, type: element.type, id: element.id }) @@ -728,6 +738,11 @@ export class SupplyManagementOnecarPublishComponent implements OnInit { detailedAddress: element.detailedAddress, appUserName: element.appUserName, contractTelephone: element.contractTelephone, + latitude: element.latitude, + longitude: element.longitude, + province: element.province, + city: element.city, + area: element.area, type: element.type, }) } @@ -735,12 +750,21 @@ export class SupplyManagementOnecarPublishComponent implements OnInit { this.creatTime = element?.createTime this.modifyTime = element?.modifyTime } + this.validateForm1.addControl(`loadAddress${controlId}`, new FormControl(null, Validators.required)); + this.validateForm1.addControl(`loadName${controlId}`, new FormControl(null, Validators.required)); + this.validateForm1.addControl(`loadPhone${controlId}`, new FormControl(null, Validators.required)); } else if(element.type === 2) { + const controlId = this.endInfo.length; if(this.PageStatus === '整车修改' || this.PageStatus === '大宗修改') { this.endInfo.push({ detailedAddress: element?.detailedAddress, appUserName: element?.appUserName, contractTelephone: element?.contractTelephone, + latitude: element.latitude, + longitude: element.longitude, + province: element.province, + city: element.city, + area: element.area, type: element.type, id: element.id }) @@ -749,10 +773,17 @@ export class SupplyManagementOnecarPublishComponent implements OnInit { detailedAddress: element?.detailedAddress, appUserName: element?.appUserName, contractTelephone: element?.contractTelephone, + latitude: element.latitude, + longitude: element.longitude, + province: element.province, + city: element.city, + area: element.area, type: element.type }) } - + this.validateForm1.addControl(`unloadAddress${controlId}`, new FormControl(null, Validators.required)); + this.validateForm1.addControl(`unloadName${controlId}`, new FormControl(null, Validators.required)); + this.validateForm1.addControl(`unloadPhone${controlId}`, new FormControl(null, Validators.required)); } }); this.sf3data = { @@ -762,8 +793,8 @@ export class SupplyManagementOnecarPublishComponent implements OnInit { weight: res?.goodsInfoList[0]?.weight || '', volume: res?.goodsInfoList[0]?.volume || '', vehicleDemand: res?.goodsInfoList[0]?.vehicleDemand || '', - maxCube: res?.goodsInfoList[0]?.maxCube || '', - maxWeight: res?.goodsInfoList[0]?.maxWeight || '', + maxCube: res?.goodsInfoList[0]?.maxCube?.split(',') || '', + maxWeight: res?.goodsInfoList[0]?.maxWeight?.split(',') || '', number: res?.goodsInfoList[0]?.number || '', freightPrice: res?.goodsInfoList[0]?.freightPrice || '', freightType: res?.goodsInfoList[0]?.freightType || '', @@ -795,7 +826,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit { toPay: res?.shippingInformationVO?.toPay || '', oilCardPay: res?.shippingInformationVO?.oilCardPay || '', receiptPay: res?.shippingInformationVO?.receiptPay || '', - // oilCardPay2: res?.shippingInformationVO?.oilCardPay || '', + // subtotal: res?.shippingInformationVO?.oilCardPay || '', appendFee: res?.shippingInformationVO?.appendFee || '', paymentDays: res?.shippingInformationVO?.paymentDays || '', } diff --git a/src/app/routes/supply-management/components/vehicle/vehicle.component.ts b/src/app/routes/supply-management/components/vehicle/vehicle.component.ts index 4fd4892c..252d1d5d 100644 --- a/src/app/routes/supply-management/components/vehicle/vehicle.component.ts +++ b/src/app/routes/supply-management/components/vehicle/vehicle.component.ts @@ -101,12 +101,10 @@ export class SupplyManagementVehicleComponent implements OnInit { goodsName: { type: 'string', title: '货物名称', - enum: [ - { label: '普货', value: 1 }, - { label: '指派', value: 2 }, - ], + ui: { - widget: 'select', + widget: 'dict-select', + params: { dictKey: 'GoodsName' }, placeholder: '请选择', } as SFSelectWidgetSchema, }, diff --git a/src/app/routes/usercenter/components/freight/user/user.component.html b/src/app/routes/usercenter/components/freight/user/user.component.html index 27431f72..f03ede38 100644 --- a/src/app/routes/usercenter/components/freight/user/user.component.html +++ b/src/app/routes/usercenter/components/freight/user/user.component.html @@ -1,3 +1,11 @@ + diff --git a/src/app/routes/usercenter/components/freight/user/user.component.ts b/src/app/routes/usercenter/components/freight/user/user.component.ts index 80dd4355..74417def 100644 --- a/src/app/routes/usercenter/components/freight/user/user.component.ts +++ b/src/app/routes/usercenter/components/freight/user/user.component.ts @@ -78,7 +78,7 @@ export class FreightComponentsUserComponent implements OnInit { }); } - userAction(status: number) { + userAction(status: number, item: any) { this.modal.warning({ nzTitle: status === 1 ? '确定启用该用户吗?' : '确定冻结该用户吗?', nzContent: @@ -86,7 +86,15 @@ export class FreightComponentsUserComponent implements OnInit { ? '停用后,该用户将被限制使用,不限于访问受限、无法发布货源等,请谨慎操作' : '启用后,该用户将恢复正常使用功能,请再次确认', nzOnOk: () => { - // this.service.request(this.service.$api_lock_user) + console.log(item) + const params = { + appUserId: [item.appUserId], + telephone: item.telephone, + freezeOrResume: status === 0 ? true : false + } + this.service.request(this.service.$api_audit_freezeOrResume, params).subscribe((res: any) => { + this.st.reload(); + }) this.st.reload(); } }); @@ -219,12 +227,12 @@ export class FreightComponentsUserComponent implements OnInit { { text: '冻结', iif: item => item.stateLocked === 0, - click: (item: any) => this.userAction(0) + click: (item: any) => this.userAction(0, item) }, { text: '启用', iif: item => item.stateLocked === 1, - click: (item: any) => this.userAction(1) + click: (item: any) => this.userAction(1, item) } ] } diff --git a/src/app/routes/usercenter/services/usercenter.service.ts b/src/app/routes/usercenter/services/usercenter.service.ts index 6232602f..4e79dc27 100644 --- a/src/app/routes/usercenter/services/usercenter.service.ts +++ b/src/app/routes/usercenter/services/usercenter.service.ts @@ -1,8 +1,8 @@ /* * @Author: your name * @Date: 2021-11-29 15:22:34 - * @LastEditTime: 2021-11-29 15:43:42 - * @LastEditors: your name + * @LastEditTime: 2021-12-13 11:25:12 + * @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\usercenter\services\usercenter.service.ts */ @@ -65,6 +65,8 @@ export class UsermanageService extends BaseService { $api_get_enterprise_user_by_id = '/api/mdc/cuc/enterpriseAdmin/operate/get'; // 审核企业管理员 $api_audit_enterprise_admin = '/api/mdc/cuc/enterpriseAdmin/operate/audit'; + // 审核企业管理员 + $api_audit_freezeOrResume = '/api/mdc/cuc/userApp/freezeOrResume'; constructor(public injector: Injector) { super(injector); diff --git a/src/app/routes/vehicle/components/audit/audit.component.ts b/src/app/routes/vehicle/components/audit/audit.component.ts index 27a29cb7..1e37f2b6 100644 --- a/src/app/routes/vehicle/components/audit/audit.component.ts +++ b/src/app/routes/vehicle/components/audit/audit.component.ts @@ -72,26 +72,18 @@ export class VehicleComponentsAuditComponent implements OnInit { carNoColor: { type: 'string', title: '车牌颜色', - enum: [ - { label: '全部', value: '' }, - { label: '正常', value: 0 }, - { label: '冻结', value: 1 }, - { label: '废弃', value: 2 }, - ], ui: { - widget: 'select', - }, + widget: 'dict-select', + params: { dictKey: 'CarColor' }, + } }, isSelf: { type: 'string', title: '是否挂靠', - enum: [ - { label: '否', value: 0 }, - { label: '是', value: 1 }, - ], ui: { - widget: 'select', - }, + widget: 'dict-select', + params: { dictKey: 'Whether' }, + } }, saveUser: { type: 'string', diff --git a/src/app/routes/vehicle/components/list/list.component.ts b/src/app/routes/vehicle/components/list/list.component.ts index 1d7bdc4f..90554701 100644 --- a/src/app/routes/vehicle/components/list/list.component.ts +++ b/src/app/routes/vehicle/components/list/list.component.ts @@ -94,15 +94,9 @@ export class VehicleComponentsListComponent implements OnInit { carNoColor: { type: 'string', title: '车牌颜色', - enum: [ - { label: '全部', value: '' }, - { label: '正常', value: 0 }, - { label: '冻结', value: 1 }, - { label: '废弃', value: 2 }, - ], - default: '', ui: { - widget: 'select', + widget: 'dict-select', + params: { dictKey: 'CarColor' }, visibleIf: { expand: (value: boolean) => value, }, diff --git a/src/app/shared/components/amap/amap-poi-picker/amap-poi-picker.component.html b/src/app/shared/components/amap/amap-poi-picker/amap-poi-picker.component.html index 742b309c..169130cc 100644 --- a/src/app/shared/components/amap/amap-poi-picker/amap-poi-picker.component.html +++ b/src/app/shared/components/amap/amap-poi-picker/amap-poi-picker.component.html @@ -1,6 +1,19 @@ +
- +
-
-
\ No newline at end of file +
+
+
+ + +
+ \ No newline at end of file diff --git a/src/app/shared/components/amap/amap-poi-picker/amap-poi-picker.component.ts b/src/app/shared/components/amap/amap-poi-picker/amap-poi-picker.component.ts index 3f167d20..fa58df22 100644 --- a/src/app/shared/components/amap/amap-poi-picker/amap-poi-picker.component.ts +++ b/src/app/shared/components/amap/amap-poi-picker/amap-poi-picker.component.ts @@ -1,7 +1,8 @@ -import { Component, OnInit, ViewChild } from '@angular/core'; -import { throwError } from 'rxjs'; import AMapLoader from '@amap/amap-jsapi-loader'; +import { Component, OnInit, ViewChild } from '@angular/core'; import { amapConf } from '@conf/amap.config'; +import { NzModalRef } from 'ng-zorro-antd/modal'; +import { throwError } from 'rxjs'; declare var AMap: any; declare var AMapUI: any; declare var Loca: any; @@ -14,15 +15,15 @@ const CONFIG = amapConf; styleUrls: ['./amap-poi-picker.component.less'] }) export class AmapPoiPickerComponent implements OnInit { - @ViewChild('modal') - modal: any; + // @ViewChild('modal') + // modal: any; addressInput: any; aMap: any; poi: any; - constructor() {} + constructor(private modalRef: NzModalRef) {} ngOnInit(): void { this.mapInit(); // this.PoiPicker(); @@ -79,6 +80,7 @@ export class AmapPoiPickerComponent implements OnInit { }); } + //POI选点 poiPickerReady(poiPicker: any) { (window as any).poiPicker = poiPicker; const map = this.aMap; @@ -99,7 +101,6 @@ export class AmapPoiPickerComponent implements OnInit { poiPicker.on('poiPicked', (poiResult: any) => { const source = poiResult.source, poi = poiResult.item; - console.log(poi); this.poi = poi; marker.setMap(map); infoWindow.setMap(map); @@ -107,18 +108,29 @@ export class AmapPoiPickerComponent implements OnInit { marker.setPosition(poi.location); infoWindow.setPosition(poi.location); - infoWindow.setContent('地址:
' + poi.name + '
'); + infoWindow.setContent(`地址:
${poi.name}
`); infoWindow.open(map, marker.getPosition()); map.setCenter(marker.getPosition()); + //获取行政区信息 + map.getCity(function (info: any) { + poi.cityInfo = info; + }); }); - poiPicker.onCityReady(function () { - poiPicker.suggest('美食'); - }); + // poiPicker.onCityReady(function () { + // poiPicker.suggest('美食'); + // }); } closeInfoWindow() { this.aMap.clearInfoWindow(); } + + sure() { + this.modalRef.destroy(); + } + cancel() { + this.modalRef.destroy(); + } }