This commit is contained in:
wangshiming
2022-04-25 13:55:41 +08:00
parent 9d1c8d78c1
commit faad581140
6 changed files with 67 additions and 31 deletions

View File

@ -1,3 +1,13 @@
/*
* @Description :
* @Version : 1.0
* @Author : Shiming
* @Date : 2022-04-21 13:49:22
* @LastEditors : Shiming
* @LastEditTime : 2022-04-25 11:11:58
* @FilePath : \\tms-obc-web\\src\\app\\routes\\partner\\recorded\\services\\recorded.service.ts
* Copyright (C) 2022 huzhenhong. All rights reserved.
*/
import { Injectable, Injector } from '@angular/core';
import { BaseService } from '@shared';
@ -7,7 +17,7 @@ import { BaseService } from '@shared';
export class RecordedService extends BaseService {
$api_get_recorded_page = `/api/bpc/partnerInvoiceEntry/queryInvoiceEntrylist`; // 查询合伙人发票入账主表
$api_get_recorded_record_detail = `/api/bpc/partnerInvoice/getDetailByOpration`; // 入账记录详情
$api_get_recorded_record_detail = `/api/bpc/partnerInvoice/getDetailById`; // 入账记录详情
$api_disagree_recorded = ``; // 拒绝审核
$api_agree_recorded = ``; // 同意审核
$api_audit_recored = `/api/bpc/partnerInvoiceEntry/oprationAudit`; // 审核单据

View File

@ -73,7 +73,7 @@ export class EditPartnerComponentsAddComponent implements OnInit {
// { label: '销售渠道可见', value: 3 },
// ],
// },channelId
channelId: {
partnerId: {
type: 'string',
title: '合伙人修改为',
ui: {
@ -83,7 +83,7 @@ export class EditPartnerComponentsAddComponent implements OnInit {
visibleIf: {
_$expand: (value: boolean) => value
},
asyncData: () => this.shipperservice.getNetworkenterpriceIds()
asyncData: () => this.shipperservice.getNetworkEnterpriseName()
}
},
// settStartTime: {
@ -151,13 +151,13 @@ export class EditPartnerComponentsAddComponent implements OnInit {
const params = {
...this.sf.value,
enterpriceIds: enterId,
settStartTime: this.sf?.value?.settStartTime + ' 00:00:00'
}
this.service.request(this.service.$api_batchUpdateEnterpricePartner, params).subscribe(res => {
if(res) {
this.service.msgSrv.success('修改成功')
} else {
this.service.msgSrv.error(res.msg)
this.service.msgSrv.success('修改成功');
this.modal.destroy(true)
}
})
}

View File

@ -2,7 +2,7 @@ import { ChangeDetectorRef, Component, OnInit, ViewChild } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { SFComponent, SFRadioWidgetSchema, SFSchema, SFSelectWidgetSchema, SFUISchema } from '@delon/form';
import { _HttpClient } from '@delon/theme';
import { EAEnvironmentService } from '@shared';
import { EAEnvironmentService, ShipperBaseService } from '@shared';
import differenceInCalendarDays from 'date-fns/differenceInCalendarDays';
import format from 'date-fns/format';
import { NzMessageService } from 'ng-zorro-antd/message';
@ -21,6 +21,8 @@ export class EditSaleComponentsAddComponent implements OnInit {
@ViewChild('sf', { static: false }) sf!: SFComponent;
record: any = {};
i: any;
sts: any;
rows: any;
schema: SFSchema = {};
detailData: any = {}
ui: SFUISchema = {};
@ -33,12 +35,15 @@ export class EditSaleComponentsAddComponent implements OnInit {
public service: UsermanageService,
private envSrv: EAEnvironmentService,
private modal: NzModalRef,
public shipperservice: ShipperBaseService
) { }
ngOnInit(): void {
this.initDetailData()
if(this.sts == '2') {
this.initDetailData()
}
this.initSF();
}
initDetailData() {
@ -60,14 +65,14 @@ export class EditSaleComponentsAddComponent implements OnInit {
type: 'string',
title: '渠道销售修改为',
ui: {
widget: 'radio',
showRequired: true,
} as SFRadioWidgetSchema,
enum: [
{ label: '全部可见', value: 1 },
{ label: '合伙人可见', value: 2 },
{ label: '销售渠道可见', value: 3 },
],
widget: 'select',
placeholder: '请选择',
allowClear: true,
visibleIf: {
_$expand: (value: boolean) => value
},
asyncData: () => this.shipperservice.getChanners()
}
},
remark: {
type: 'string',
@ -88,7 +93,8 @@ export class EditSaleComponentsAddComponent implements OnInit {
} as SFRadioWidgetSchema,
enum: [
{ label: '修改成功后立即生效', value: 1 },
{ label: 'CRM流程审核通过后生效', value: 2 }
{ label: 'CRM流程审核后生效', value: 2 },
{ label: 'CRM流程审核通过后生效', value: 3 }
],
},
},
@ -106,18 +112,24 @@ export class EditSaleComponentsAddComponent implements OnInit {
return {};
}
save() {
let enterId : any;
if(this.sts == '1') {
enterId = this.rows
} else {
enterId = [this.i.id]
}
this.service.nzModalService.create({
nzTitle: '确定提交吗?',
nzClosable: false,
nzContent: '确定提交吗?',
nzOnOk: () => {
const params = {
...this.sf.value
...this.sf.value,
enterpriceIds: enterId,
}
this.service.request(this.service.$api_batchUpdateEnterpriceChannel, params).subscribe(res => {
if(res) {
this.service.msgSrv.success('修改成功')
} else {
this.service.msgSrv.error(res.msg)
this.modal.destroy(true)
}
})
}

View File

@ -141,8 +141,6 @@ export class FreightComponentsListComponent implements OnInit {
this.selectedRows.forEach(item => {
params.push(item.id);
});
console.log(params);
const modalRef = this.modal.create({
nzTitle: '修改合伙人',
nzContent: EditPartnerComponentsAddComponent,
@ -161,12 +159,26 @@ export class FreightComponentsListComponent implements OnInit {
});
}
editSale(record?: any) {
let status = 1
if(record) {
status = 2
}
if (this.selectedRows.length <= 0 && !record) {
this.service.msgSrv.error('请选择订单!');
return;
}
let params: any[] = [];
this.selectedRows.forEach(item => {
params.push(item.id);
});
const modalRef = this.modal.create({
nzTitle: '修改渠道销售',
nzContent: EditSaleComponentsAddComponent,
nzWidth: 800,
nzComponentParams: {
i: record
i: record,
sts: status,
rows: params
},
nzFooter: null
});

View File

@ -1,7 +1,7 @@
/*
* @Author: your name
* @Date: 2021-11-29 15:22:34
* @LastEditTime : 2022-04-24 16:49:05
* @LastEditTime : 2022-04-25 13:39:46
* @LastEditors : Shiming
* @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

View File

@ -29,6 +29,8 @@ export class ShipperBaseService extends BaseService {
// 合伙人下拉列表
public $api_partner_lists = '/api/mdc/partner/list';
// 获取渠道销售管理集合
public $api_listChannelSalesManagement = '/api/mdc/channelSalesManagement/list/listChannelSalesManagement';
// 批量获取项目信息
public $api_get_project_list = '/api/mdc/cuc/enterpriseProject/getProjectList';
constructor(public injector: Injector) {
@ -160,7 +162,7 @@ export class ShipperBaseService extends BaseService {
}
const list = res.map((item: any) => {
return {
label: item.keyword,
label: item.contactName + '/' + item.contactMobile,
value: item.id
};
});
@ -173,18 +175,18 @@ export class ShipperBaseService extends BaseService {
);
}
/**
* 获取网络货运人
* 获取渠道销售管理集合
* @returns
*/
getNetworkenterpriceIds(params = {}, containerAll = false) {
return this.request(this.$api_partner_lists, params).pipe(
getChanners(params = {}, containerAll = false) {
return this.request(this.$api_listChannelSalesManagement, params).pipe(
map((res: any) => {
if (!res) {
return [];
}
const list = res.map((item: any) => {
return {
label: item.contactName + '/' + item.contactMobile,
label: item.name + '/' + item.telephone,
value: item.id
};
});